efficient-shell 7.13.2 → 7.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/dist/{Browser-K57UUI7M.js → Browser-N5T7OXPZ.js} +14 -14
- package/dist/{Documents-MZ7BEGNG.js → Documents-JPLMNPIR.js} +2 -2
- package/dist/{Files-P4PB4GMS.js → Files-PTVHKWUP.js} +28 -28
- package/dist/{Notepad-7QFTPWIM.js → Notepad-4UEHCJC7.js} +9 -9
- package/dist/{PomodoroTimer-MYTQX74U.js → PomodoroTimer-LP7N2QFK.js} +5 -5
- package/dist/{Preview-K62QJSSB.js → Preview-LDGBYG4N.js} +28 -28
- package/dist/{Spreadsheet-LEDD423O.js → Spreadsheet-R62OWG57.js} +11 -11
- package/dist/apps/index.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/{chunk-ERJTO4DO.js → chunk-EESFTTKA.js} +1 -1
- package/dist/chunk-HJQAE6SP.js +1 -0
- package/dist/chunk-LMW5YFDY.js +1025 -0
- package/dist/{chunk-YNKJZKFF.js → chunk-M6FR6OFL.js} +1 -1
- package/dist/chunk-SZ3VBHNO.js +1 -0
- package/dist/{index-CGgt7t0J.d.ts → index-C32oXyz3.d.ts} +41 -13
- package/dist/index.d.ts +2 -2
- package/dist/index.js +631 -631
- package/dist/telemetry/index.js +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/ui.css +3 -3
- package/package.json +1 -1
- package/dist/chunk-6ZLZP6GV.js +0 -1023
- package/dist/chunk-OESIYQSY.js +0 -1
- package/dist/chunk-PM4GMFN3.js +0 -1
package/dist/chunk-6ZLZP6GV.js
DELETED
|
@@ -1,1023 +0,0 @@
|
|
|
1
|
-
import{Breadcrumbs as e}from"./chunk-Z2TTHY7G.js";import{SidebarLayout as t}from"./chunk-OV7F663H.js";import{BrandMark as r}from"./chunk-BQ7GR7H6.js";import{inputClasses as n,PLACEHOLDER_INK as a,INPUT_BASE_ON as l,INPUT_BASE as i,INPUT_SIZES as o}from"./chunk-OESIYQSY.js";import{isSafeLinkHref as s}from"./chunk-PJPK2ADX.js";import{useShellLanguage as c}from"./chunk-RBKIYZ7H.js";import{toast_default as d}from"./chunk-RUHUTZN4.js";import{useIsMobile as u,useShortcutLabel as h,useShellPrefs as m}from"./chunk-ZRU5F2XT.js";import{isAriaDisabled as p,swallowPress as g,describedByWith as f,OffWithReason as b,useDropdownPosition as y,MENU_MAX_HEIGHT as x,Button_default as v,Tooltip as w,popupBounds as N,VIEWPORT_MARGIN as k,placeMenu as $,followAnchor as M,POPUP_MAX_WIDTH as C,placeAtPoint as L}from"./chunk-A7TXAKTX.js";import{useTabLayer as S,focusableIn as D,useFocusTrap as P,useScrollLock as A,stopAfter as j}from"./chunk-QBXX5A7U.js";import{PopupMenu as z,MenuSemanticsContext as F,leavesContextMenuAlone as T,PopupMenuDivider as E,PopupMenuLabel as B,itemLook as I,MenuCheckMark as O}from"./chunk-IQDY2YFN.js";import{useDismissPopupsOnOpen as R}from"./chunk-UVBK6YSR.js";import{iconButtonClasses as W,buttonClasses as K}from"./chunk-JTNKC4CR.js";import{glassStyle as _,GLASS_DIVIDER as q}from"./chunk-7IQ3B77H.js";import{registerModalEscapeInterceptor as H,onOverlayOpen as U,Z_LAYERS as V}from"./chunk-FIEA5CGB.js";import{useBrowserLayoutEffect as Y,useBrowserValue as G,useHydrated as X,useBrowserValueOnce as Z,useBrowserState as J}from"./chunk-D65T4H6J.js";import{reportBoundaryError as Q}from"./chunk-KNUR2UEG.js";import{useFileIntake as ee,humanSize as te,FileIntakeAlert as re}from"./chunk-M4TRVJTO.js";import{useShellLocale as ne,useShellStrings as ae,DEFAULT_SHELL_STRINGS as le,currentShellStrings as ie,splitAround as oe}from"./chunk-QRCDQPJA.js";import{formatPlain as se,formatFixed as ce,formatPercent as de}from"./chunk-C3QOHMR6.js";import{parseFocal as ue,formatFocal as he,nudgeFocal as me,focalFromRect as pe}from"./chunk-AP2QEJXQ.js";import{calendarNames as ge,firstDayOfWeek as fe,formatDate as be,EMPTY_VALUE as ye,toInstant as xe,timeAgo as ve,formatDateTime as we}from"./chunk-W32SKK3D.js";import{Icon as Ne,setIconSet as ke}from"./chunk-ZGUQLVY4.js";import{forwardRef as $e,useId as Me,useCallback as Ce,useState as Le,useRef as Se,useMemo as De,useEffect as Pe,createContext as Ae,Children as je,isValidElement as ze,cloneElement as Fe,useContext as Te,Fragment as Ee,Component as Be,useSyncExternalStore as Ie,useLayoutEffect as Oe}from"react";import{jsx as Re,jsxs as We,Fragment as Ke}from"react/jsx-runtime";import{createPortal as _e}from"react-dom";var qe=$e(function({children:e,variant:t="ghost",size:r="md",type:n="button",className:a="",pressed:l,disabledReason:i,ink:o,disabled:s,onClick:c,"aria-disabled":d,"aria-describedby":u,...h},m){const y=Me(),x=(Boolean(s)||p(d))&&null!=i&&""!==i,v=x||p(d),w=/* @__PURE__ */Re("button",{ref:m,type:n,className:W({variant:t,size:r,pressed:l??(!0===h["aria-pressed"]||"true"===h["aria-pressed"]),ink:o,className:a}),...h,disabled:x?void 0:s,"aria-disabled":!!v||d,"aria-describedby":f(u,x?y:void 0),onClick:v?g:c,children:e});return x?/* @__PURE__ */Re(b,{reason:i,id:y,children:w}):w}),He=$e(function({invalid:e,leftIcon:t,rightAdornment:r,size:l,className:i="",readOnly:o,...s},c){const d=`${t?"pl-10":""} ${r?"pr-10":""}`.trim(),u=
|
|
2
|
-
/* @__PURE__ */Re("input",{ref:c,"aria-invalid":e||void 0,readOnly:o,className:n({invalid:e,size:l,readOnly:o,className:[d,i].filter(Boolean).join(" ")}),...s});return t||r?/* @__PURE__ */We("div",{className:"relative",children:[t&&/* @__PURE__ */Re("span",{className:`pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 ${a}`,children:t}),u,r&&/* @__PURE__ */Re("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:r})]}):u}),Ue=$e(function({invalid:e,autoGrow:t,className:r="",onInput:a,rows:l=3,size:i,readOnly:o,...s},c){const d=Ce(e=>{if(t){const t=e.currentTarget;t.style.height="auto",t.style.height=`${t.scrollHeight}px`}a?.(e)},[t,a]);/* @__PURE__ */
|
|
3
|
-
return Re("textarea",{ref:c,"aria-invalid":e||void 0,rows:l,onInput:d,readOnly:o,className:n({invalid:e,size:i,readOnly:o,multiline:!0,className:`${t?"resize-none overflow-hidden":""} ${r}`.trim()}),...s})});function Ve(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function Ye(e){for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}function Ge(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?Ve(e):Ye(e)}function Xe(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 Ze=e=>Array.isArray(e.options);function Je(e){const t=[];for(const r of e)Ze(r)?t.push(...r.options):t.push(r);return t}function Qe(e,t){const r=[];for(const n of e){if(!Ze(n)){t(n)&&r.push(n);continue}const e=n.options.filter(t);e.length&&r.push({...n,options:e})}return r}function et(e,t,r,n=""){const a=[];let l=0;return e.forEach((e,i)=>{if(!Ze(e))return a.push(t(e,l)),void(l+=1);const o=`${r}-group-${i}`,s=l;l+=e.options.length,a.push(
|
|
4
|
-
/* @__PURE__ */We("div",{role:"group","aria-labelledby":o,children:[
|
|
5
|
-
/* @__PURE__ */Re("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 tt({selected:e}){/* @__PURE__ */
|
|
6
|
-
return Re(Ne,{name:"check","aria-hidden":"true",className:"h-4 w-4 shrink-0 "+(e?"":"invisible"),strokeWidth:2.5})}function rt(e,t){return e.label.toLowerCase().includes(t)||(e.sublabel?.toLowerCase().includes(t)??!1)}function nt({children:e,grows:t=!1}){/* @__PURE__ */
|
|
7
|
-
return Re("span",{className:`min-w-0 ${t?"shrink":"max-w-[45%] shrink-0"} truncate text-xs text-gray-400`,children:e})}var at=$e(function({value:e,onChange:t,options:r,placeholder:a,invalid:l,className:i="",size:o,touchSize:s,renderOption:c,renderValue:d,valueText:u,readOnly:h,multiple:m,...p},g){const f=t;/* @__PURE__ */
|
|
8
|
-
return We("select",{ref:g,value:e,multiple:m||void 0,onChange:e=>f(m?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":l||void 0,className:n({invalid:l,size:o,className:`pr-8 ${i}`.trim()}),...p,children:[void 0!==a&&!m&&/* @__PURE__ */Re("option",{value:"",disabled:!0,children:a}),
|
|
9
|
-
/* @__PURE__ */Re(lt,{items:r})]})});function lt({items:e}){const t=e=>/* @__PURE__ */Re("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
|
|
10
|
-
return Re(Ke,{children:e.map((e,r)=>(e=>Ze(e))(e)?/* @__PURE__ */Re("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var it=$e(function({value:e,onChange:t,options:r,placeholder:l,invalid:i,className:o="",id:s,disabled:c,size:d,touchSize:u,title:h,multiple:m,renderOption:p,renderValue:g,valueText:f,readOnly:b=!1,"aria-describedby":v,"aria-label":w,"aria-labelledby":N,...k},$){const[M,C]=Le(!1),[L,S]=Le(-1),D=Se(null),P=Se(null),A=Se(null),j=Se(M);j.current=M;const z=Se({buffer:"",timer:null}),F=Me(),T=`${F}-listbox`,E=s??`${F}-trigger`,B=e=>`${F}-opt-${e}`,I=De(()=>Je(r),[r]),O=m?e:[],R=t,W=y(P,M,{matchTriggerWidth:!0}),K=m?I.findIndex(e=>O.includes(e.value)):I.findIndex(t=>t.value===e),q=m?I.filter(e=>O.includes(e.value)).map(e=>e.label).join(", ")||void 0:K>=0?I[K].label:void 0,Y=!m&&K>=0?I[K].lang:void 0,G=m?I.filter(e=>O.includes(e.value)):K>=0?[I[K]]:[],X=g&&G.length?g(G):void 0,Z=void 0!==X&&f?f(G):void 0,J=Ce((e=!0)=>{C(!1),S(-1),e&&P.current?.focus()},[]),Q=Ce(()=>{c||b||(S(K>=0?K:Ve(I)),C(!0))},[c,b,I,K]),ee=Ce(t=>{const r=I[t];if(r&&!r.disabled){if(m){const n=e;return R(n.includes(r.value)?n.filter(e=>e!==r.value):[...n,r.value]),void S(t)}R(r.value),J()}},[I,m,e,R,J]);Pe(()=>{if(!M)return;return H(e=>!("Escape"!==e.key||!j.current)&&(J(),!0),()=>A.current)},[M,J]),Pe(()=>{if(!M)return;const e=e=>{const t=e.target;D.current?.contains(t)||A.current?.contains(t)||J(!1)};document.addEventListener("pointerdown",e);const t=U(()=>J(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[M,J]),Pe(()=>{!M||L<0||A.current?.querySelector(`#${CSS.escape(B(L))}`)?.scrollIntoView({block:"nearest"})});const te=Ce(e=>{const t=z.current;t.timer&&clearTimeout(t.timer),t.buffer+=e,t.timer=setTimeout(()=>{t.buffer="",t.timer=null},500);const r=M?L:K,n=Xe(I,t.buffer,r);n<0||(M?S(n):m?(S(n),C(!0)):ee(n))},[M,L,K,I,ee,m]),re=M?et(r,(t,r)=>{const n=(a=t.value,m?O.includes(a):e===a);var a;const l=r===L;/* @__PURE__ */
|
|
11
|
-
return We("div",{id:B(r),role:"option",lang:t.description||p?void 0:t.lang,"aria-selected":n,"aria-disabled":t.disabled||void 0,onPointerEnter:()=>{t.disabled||S(r)},onClick:()=>ee(r),className:`mx-1 cursor-pointer truncate rounded-lg min-h-(--row-height-menu) px-3 py-2 text-sm leading-5${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__ */Re(tt,{selected:n}),p?/* @__PURE__ */Re("span",{className:"block min-w-0 flex-1 truncate",children:p(t,{selected:n,active:l})}):m?/* @__PURE__ */We("span",{className:"block min-w-0 flex-1",children:[
|
|
12
|
-
/* @__PURE__ */Re("span",{lang:t.lang,className:"block truncate",children:t.label}),t.description&&/* @__PURE__ */Re("span",{className:"mt-0.5 block truncate text-xs leading-4 font-normal text-gray-500",children:t.description})]}):t.description?
|
|
13
|
-
/* @__PURE__ */We(Ke,{children:[
|
|
14
|
-
/* @__PURE__ */Re("span",{lang:t.lang,className:"block truncate",children:t.label}),
|
|
15
|
-
/* @__PURE__ */Re("span",{className:"mt-0.5 block truncate text-xs leading-4 font-normal text-gray-500",children:t.description})]}):t.label]},t.value)},F,"mx-1"):null;/* @__PURE__ */
|
|
16
|
-
return We("div",{ref:D,className:"relative",children:[
|
|
17
|
-
/* @__PURE__ */Re("button",{ref:P,id:E,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":M,"aria-controls":M?T:void 0,"aria-activedescendant":M&&L>=0?B(L):void 0,"aria-invalid":i||void 0,"aria-describedby":v,"aria-label":w,"aria-labelledby":N,title:h,disabled:c,"aria-readonly":b||void 0,onClick:()=>M?J():Q(),onKeyDown:e=>{if(!c&&!b)switch(e.key){case"ArrowDown":return e.preventDefault(),void(M?S(e=>Ge(I,e,1)):Q());case"ArrowUp":return e.preventDefault(),void(M?S(e=>Ge(I,e,-1)):Q());case"Home":return void(M&&(e.preventDefault(),S(Ve(I))));case"End":return void(M&&(e.preventDefault(),S(Ye(I))));case"Enter":return void(M&&(e.preventDefault(),ee(L)));case" ":return e.preventDefault(),void(M?ee(L):Q());case"Escape":return void(M&&(e.preventDefault(),e.stopPropagation(),J()));case"Tab":return void(M&&J(!1));default:1!==e.key.length||e.metaKey||e.ctrlKey||e.altKey||(e.preventDefault(),te(e.key))}},className:n({invalid:i,size:d,readOnly:b,className:`${b?"":"pr-8 "}text-left ${o}`.trim()}),children:void 0!==X?
|
|
18
|
-
/* @__PURE__ */We("span",{className:"relative block min-w-0 truncate",children:[
|
|
19
|
-
/* @__PURE__ */Re("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:X}),
|
|
20
|
-
/* @__PURE__ */Re("span",{lang:void 0===Z?Y:void 0,className:"sr-only",children:Z??q})]}):/* @__PURE__ */Re("span",{lang:Y,className:"block truncate "+(void 0===q?"text-gray-400":""),children:q??l??" "})}),!b&&/* @__PURE__ */Re(Ne,{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 ${a}`,strokeWidth:2}),
|
|
21
|
-
/* @__PURE__ */We("select",{ref:$,value:e,multiple:m||void 0,onChange:e=>R(m?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:c,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...k,children:[void 0!==l&&!m&&/* @__PURE__ */Re("option",{value:"",disabled:!0,children:l}),
|
|
22
|
-
/* @__PURE__ */Re(lt,{items:r})]}),M&&_e(
|
|
23
|
-
/* @__PURE__ */Re("div",{ref:A,id:T,role:"listbox","aria-labelledby":N??(w?void 0:E),"aria-label":N?void 0:w,"aria-multiselectable":m||void 0,className:"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:{zIndex:V.popup,left:W?.left,top:W?.top,bottom:W?.bottom,width:W?.width,maxHeight:W?.maxHeight??x,visibility:W?void 0:"hidden",..._()},children:re}),document.body)]})}),ot=$e(function({touchSize:e="touch",...t},r){return u()&&!t.readOnly?/* @__PURE__ */Re(at,{ref:r,...t,size:e}):/* @__PURE__ */Re(it,{ref:r,...t})});function st(e,t,r,n){const a=Me(),l=!!e&&!!t,i=l?`${a}-label`:void 0,o=l?`${a}-description`:void 0;return{labelId:i,descriptionId:o,labelledBy:r??i,describedBy:[n,o].filter(Boolean).join(" ")||void 0}}var ct=$e(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=Se(null),h=st(n,a,o,s);Pe(()=>{u.current&&(u.current.indeterminate=r)},[r,e]);const m=Ce(e=>{u.current=e,"function"==typeof d?d(e):d&&(d.current=e)},[d]),p=(r="")=>/* @__PURE__ */Re("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__ */We("label",{className:`flex items-start gap-2 ${l?"cursor-not-allowed opacity-60":"cursor-pointer"} ${i}`.trim(),children:[p("mt-0.5"),
|
|
24
|
-
/* @__PURE__ */We("span",{className:"text-sm leading-tight",children:[n&&/* @__PURE__ */Re("span",{id:h.labelId,className:"font-medium text-gray-700",children:n}),a&&/* @__PURE__ */Re("span",{id:h.descriptionId,className:"mt-0.5 block text-xs text-gray-500",children:a})]})]}):p(i)}),dt="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",ut=$e(function({checked:e,onChange:t,label:r,description:n,disabled:a,className:l="","aria-labelledby":i,"aria-describedby":o,...s},c){const d=st(r,n,i,o);return r||n?/* @__PURE__ */We("label",{className:`flex items-start gap-2 ${a?"cursor-not-allowed opacity-60":"cursor-pointer"} ${l}`.trim(),children:[
|
|
25
|
-
/* @__PURE__ */Re("input",{ref:c,type:"radio",checked:e,disabled:a,onChange:e=>t(e.target.checked),className:`${dt} mt-0.5`,"aria-labelledby":d.labelledBy,"aria-describedby":d.describedBy,...s}),
|
|
26
|
-
/* @__PURE__ */We("span",{className:"min-w-0 flex-1 text-sm leading-tight",children:[r&&/* @__PURE__ */Re("span",{id:d.labelId,className:"block min-w-0 font-medium text-gray-700",children:r}),n&&/* @__PURE__ */Re("span",{id:d.descriptionId,className:"mt-0.5 block min-w-0 text-xs text-gray-500",children:n})]})]}):/* @__PURE__ */Re("input",{ref:c,type:"radio",checked:e,disabled:a,onChange:e=>t(e.target.checked),className:`${dt} ${l}`.trim(),"aria-labelledby":d.labelledBy,"aria-describedby":d.describedBy,...s})});function ht({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===je.count(o)?je.only(o):null,d=ze(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?Fe(d,u):o;/* @__PURE__ */
|
|
27
|
-
return We("div",{className:i,children:[e&&/* @__PURE__ */We("label",{id:r,htmlFor:t,className:"mb-1 block text-xs font-medium text-gray-600",children:[e,l&&/* @__PURE__ */Re("span",{"aria-hidden":"true",className:"ml-0.5 text-red-500",children:"*"})]}),h,a?
|
|
28
|
-
/* @__PURE__ */Re("p",{id:t?`${t}-error`:void 0,role:"alert",className:"mt-1 text-2xs text-red-600",children:a}):n?/* @__PURE__ */Re("p",{id:t?`${t}-hint`:void 0,className:"mt-1 text-2xs text-gray-400",children:n}):null]})}var mt={vertical:"flex flex-col gap-2",horizontal:"flex flex-wrap items-start gap-x-6 gap-y-2"};function pt({label:e,hint:t,error:r,required:n,name:a,value:l,onChange:i,options:o,orientation:s="vertical",disabled:c=!1,className:d=""}){const u=Me(),h=e?`${u}-label`:void 0;/* @__PURE__ */
|
|
29
|
-
return Re(ht,{label:e,labelId:h,htmlFor:u,hint:t,error:r,required:n,className:d,children:/* @__PURE__ */Re("div",{id:u,role:"radiogroup","aria-labelledby":h,"aria-required":n||void 0,className:mt[s],children:o.map(e=>/* @__PURE__ */Re(ut,{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 gt({errors:e,title:t,autoFocus:r=!0,className:n=""}){const a=ae(),l=Se(null),i=Se(!1);if(Pe(()=>{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__ */
|
|
30
|
-
return We("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:[
|
|
31
|
-
/* @__PURE__ */Re("h2",{className:"text-sm font-semibold text-red-800",children:t??a.form.errorSummaryTitle}),
|
|
32
|
-
/* @__PURE__ */Re("ul",{className:"mt-2 space-y-1",children:e.map(({fieldId:e,message:t},r)=>/* @__PURE__ */Re("li",{children:e?/* @__PURE__ */Re("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}):
|
|
33
|
-
/* @__PURE__ */Re("span",{className:"text-sm text-red-700",children:t})},`${e??""}-${r}`))})]})}var ft="text-xs font-medium text-gray-600";function bt({inline:e=!1,className:t=""}={}){return[e?"":"mb-1 block",ft,t].filter(Boolean).join(" ")}function yt({required:e,children:t,className:r="",...n}){/* @__PURE__ */
|
|
34
|
-
return We("label",{className:bt({className:r}),...n,children:[t,e&&/* @__PURE__ */Re("span",{className:"ml-0.5 text-red-500",children:"*"})]})}var xt=/^data:([a-z0-9!#$&^_.+-]+)\/([a-z0-9!#$&^_.+-]+)/i;function vt(e){if(/^data:/i.test(e||""))return function(e){const t=xt.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 wt=/\.(mp4|webm|ogg|ogv|mov|m4v)(\?|#|$)/i;function Nt(e,t=le.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 kt(e,t,r=""){return["flex w-full flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed text-center transition-colors",t?"cursor-not-allowed opacity-60":"cursor-pointer",e?"border-blue-500 bg-blue-50":"border-gray-300 bg-gray-50 hover:bg-gray-100",r].filter(Boolean).join(" ")}function $t(e){return e?"rosh-focus-ring":"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-zone)]"}function Mt({label:e,rounded:t="rounded-lg"}){/* @__PURE__ */
|
|
35
|
-
return We("div",{role:"status",className:`absolute inset-0 flex items-center justify-center gap-2 bg-white/60 ${t}`,children:[
|
|
36
|
-
/* @__PURE__ */Re(St,{}),
|
|
37
|
-
/* @__PURE__ */Re("span",{className:"text-xs font-medium text-gray-600",children:e})]})}function Ct({children:e}){/* @__PURE__ */
|
|
38
|
-
return Re("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 Lt(e,t=""){if(!e)return!1;const r=xt.exec(e);if(r)return"video"===r[1].toLowerCase();const n=t.includes("video"),a=t.includes("image")||"*"===t||""===t;return wt.test(e)||n&&!a}function St({className:e="h-5 w-5"}){/* @__PURE__ */
|
|
39
|
-
return We("svg",{className:`${e} animate-spin text-gray-400`,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[
|
|
40
|
-
/* @__PURE__ */Re("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),
|
|
41
|
-
/* @__PURE__ */Re("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}function Dt({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
42
|
-
return Re(Ne,{name:"close",className:e,strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})}function Pt({className:e="h-6 w-6"}){/* @__PURE__ */
|
|
43
|
-
return Re(Ne,{name:"upload",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function At({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:g,showFilename:f=!0,allowReplace:b=!0,allowRemove:y=!0,replaceLabel:x,removeLabel:w,busy:N=!1,busyLabel:k,disabled:$=!1}){const M=ae().media,C=p??M.cta,L=x??M.replace,S=w??M.remove,D=k??M.uploading,P=Me(),A=Se(null),[j,z]=Le(null);Pe(()=>()=>{A.current&&URL.revokeObjectURL(A.current)},[]);const F=$||N,T=!!e&&(Lt(e,c)||e===j),E=m??Nt(c,M),B=e=>{r?r(e):n?n(e):(e=>{A.current&&URL.revokeObjectURL(A.current);const r=URL.createObjectURL(e);A.current=r,z(e.type.startsWith("video/")?r:null),t(r)})(e)},I=ee({accept:c,maxSizeBytes:d,acceptHint:g,multiple:!1,disabled:F,onAccept:([e])=>B(e)}),{dragOver:O}=I,R=()=>{F||(r?r():I.open())},W=e?vt(e):"",K=/* @__PURE__ */We("div",{children:[
|
|
44
|
-
/* @__PURE__ */We("div",{...I.zoneProps,className:["relative overflow-hidden rounded-md border bg-gray-100 transition-colors",O?"border-blue-500":"border-gray-200"].join(" "),style:{height:h},children:[T?/* @__PURE__ */Re("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__ */Re("img",{src:e??void 0,alt:W,className:"h-full w-full",style:{objectFit:u}}),f&&e&&/* @__PURE__ */Re(Ct,{children:W}),N&&/* @__PURE__ */Re(Mt,{label:D,rounded:"rounded-md"})]}),!$&&(b||y)&&/* @__PURE__ */We("div",{className:"mt-2 flex gap-2",children:[b&&/* @__PURE__ */Re(v,{id:P,variant:"secondary",size:"sm",onClick:()=>R(),disabled:N,children:L}),y&&/* @__PURE__ */Re(v,{variant:"ghost",size:"sm",onClick:()=>{A.current&&(URL.revokeObjectURL(A.current),A.current=null),z(null),t("")},disabled:N,children:S})]})]}),_=/* @__PURE__ */Re("button",{type:"button",id:P,onClick:()=>R(),disabled:F,"aria-label":"string"==typeof E?E:M.upload,"aria-busy":N||void 0,"aria-invalid":!!i||void 0,"aria-required":o||void 0,"aria-describedby":i?`${P}-error`:l?`${P}-hint`:void 0,...I.zoneProps,className:kt(O,F,$t(F)),style:{minHeight:h},children:N?/* @__PURE__ */We("span",{role:"status",className:"flex flex-col items-center gap-2",children:[
|
|
45
|
-
/* @__PURE__ */Re(St,{}),
|
|
46
|
-
/* @__PURE__ */Re("span",{className:"text-xs font-medium text-gray-500",children:D})]}):/* @__PURE__ */We(Ke,{children:[
|
|
47
|
-
/* @__PURE__ */Re("span",{className:"text-gray-400",children:/* @__PURE__ */Re(Pt,{})}),
|
|
48
|
-
/* @__PURE__ */Re("span",{className:"px-3 text-xs text-gray-500",children:E}),
|
|
49
|
-
/* @__PURE__ */Re("span",{className:"text-sm font-medium text-blue-600",children:C}),g&&/* @__PURE__ */Re("span",{className:"text-xs text-gray-400",children:g})]})});/* @__PURE__ */
|
|
50
|
-
return We(ht,{label:a,htmlFor:P,hint:l,error:i,required:o,className:s,children:[e?K:_,!r&&/* @__PURE__ */Re("input",{...I.inputProps}),
|
|
51
|
-
/* @__PURE__ */Re(re,{rejections:I.rejections})]})}function jt({committedUrl:e,committedHasAlpha:t=null,committedIsLight:n=null,fallbackUrl:a,fallbackHasAlpha:l=null,fallbackIsLight:i=null,subjectName:o,assetName:s,onSave:c,onRemove:d,accept:u="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:h="PNG · ICO · SVG · JPG · WEBP",maxBytes:m=5242880,previews:p=[],disabled:g=!1}){const f=Se(null),[b,y]=Le(null),[x,w]=Le(""),[N,k]=Le(""),[$,M]=Le(!1),[C,L]=Le(!1),S=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(s),D=ae().brandAsset,P=x||e||a||"",A=b?null:e?t:l,j=b?null:e?n:i;Pe(()=>()=>{f.current&&URL.revokeObjectURL(f.current)},[]);const z=()=>{f.current&&(URL.revokeObjectURL(f.current),f.current=null)};/* @__PURE__ */
|
|
52
|
-
return We("section",{"aria-label":D.region(s,o),className:"grid gap-4 lg:grid-cols-2",children:[
|
|
53
|
-
/* @__PURE__ */We("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[
|
|
54
|
-
/* @__PURE__ */Re(At,{value:P,onChange:()=>{},onFile:e=>{if(g)return;z();const t=URL.createObjectURL(e);f.current=t,y(e),w(t),k("")},label:s,hint:N||D.usedFor(o),error:N||void 0,accept:u,acceptHint:h,maxSizeBytes:m,fit:"contain",height:180,allowRemove:!1,busy:$||C,disabled:g}),
|
|
55
|
-
/* @__PURE__ */We("div",{className:"mt-3 flex flex-wrap gap-2",children:[
|
|
56
|
-
/* @__PURE__ */Re(v,{onClick:async()=>{if(b&&!g&&!$){M(!0),k("");try{await c(b),z(),y(null),w("")}catch(e){k(e instanceof Error?e.message:D.saveFailed(S,s))}finally{M(!1)}}},disabled:!b||g,loading:$,children:D.save(S,s)}),(b||e)&&/* @__PURE__ */Re(v,{variant:"ghost-danger",onClick:async()=>{if(!g&&!C){if(b)return z(),y(null),w(""),void k("");if(e){L(!0),k("");try{await d()}catch(e){k(e instanceof Error?e.message:D.removeFailed(S,s))}finally{L(!1)}}}},disabled:g,loading:C,children:b?D.discard:D.remove(S,s)})]})]}),p.length>0&&/* @__PURE__ */We("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":D.previews(s),children:[
|
|
57
|
-
/* @__PURE__ */Re("h3",{className:"text-sm font-semibold text-gray-900",children:D.preview}),
|
|
58
|
-
/* @__PURE__ */Re("div",{className:"mt-3 grid gap-3",children:p.map(e=>{const t=/* @__PURE__ */Re(r,{src:P,alt:D.alt(o,s),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:A,isLight:j,size:"browser-tab"===e.kind?16:void 0});/* @__PURE__ */
|
|
59
|
-
return We("div",{"data-brand-preview":!0,className:"dark"===e.surface?"text-white":"text-gray-900",children:[
|
|
60
|
-
/* @__PURE__ */Re("div",{className:"mb-2 text-xs font-medium text-gray-500",children:e.label}),"browser-tab"===e.kind?/* @__PURE__ */We("div",{className:"flex items-end gap-1 border-b border-gray-200",children:[
|
|
61
|
-
/* @__PURE__ */We("div",{className:"flex max-w-[220px] items-center gap-2 rounded-t-lg border border-b-0 border-gray-200 bg-white px-3 py-2",children:[t,
|
|
62
|
-
/* @__PURE__ */Re("span",{className:"truncate text-xs text-gray-700",children:e.title??o}),
|
|
63
|
-
/* @__PURE__ */Re("span",{className:"text-gray-400",children:"×"})]}),
|
|
64
|
-
/* @__PURE__ */Re("span",{className:"mb-1 ml-1 text-gray-400",children:"+"})]}):"search-result"===e.kind?/* @__PURE__ */We("div",{className:"rounded-lg border border-gray-200 bg-white p-3",children:[
|
|
65
|
-
/* @__PURE__ */We("div",{className:"flex items-center gap-2",children:[
|
|
66
|
-
/* @__PURE__ */Re("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-full border border-gray-200 bg-gray-50",children:t}),
|
|
67
|
-
/* @__PURE__ */We("div",{className:"min-w-0 leading-tight",children:[
|
|
68
|
-
/* @__PURE__ */Re("div",{className:"truncate text-xs font-medium text-gray-700",children:e.title??o}),e.url&&/* @__PURE__ */Re("div",{className:"truncate text-xs text-gray-400",children:e.url})]})]}),
|
|
69
|
-
/* @__PURE__ */Re("div",{className:"mt-2 text-sm font-medium text-blue-700",children:e.title??o}),e.description&&/* @__PURE__ */Re("div",{className:"text-xs text-gray-500",children:e.description})]}):/* @__PURE__ */We("div",{className:["flex items-center gap-3 rounded-md border border-gray-200 p-3","dark"===e.surface?"bg-gray-900 text-white":"bg-white text-gray-900"].join(" "),children:[t,
|
|
70
|
-
/* @__PURE__ */Re("span",{className:"text-sm",children:e.title??e.label})]})]},`${e.label}-${e.slot}-${e.surface??"light"}`)})})]})]})}function zt(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 Ft=Ae(null);function Tt(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 Et({load:e,fallback:t,documentTitle:r,children:n}){const[a,l]=Le(t),[i,o]=Le(!0),[s,c]=Le(null),d=Se(e),u=Se(t);d.current=e,u.current=t,Pe(()=>{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()}},[]),Pe(()=>(Tt(a.favicon_url),()=>Tt(null)),[a.favicon_url]),Pe(()=>{r&&(document.title=r(a))},[a,r]);const h=De(()=>({branding:a,loading:i,error:s}),[a,i,s]);/* @__PURE__ */
|
|
71
|
-
return Re(Ft.Provider,{value:h,children:n})}function Bt(){const e=Te(Ft);if(!e)throw new Error("usePortalBranding must be used inside PortalBrandingProvider.");return e}var It=/* @__PURE__ */Re(Ne,{name:"close",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3"});function Ot({items:e,onPick:t,onFiles:r,onRemove:n,onReorder:a,label:l,hint:i,error:o,required:s,className:c,accept:d="image/*",maxSizeBytes:u,maxFiles:h,fit:m="cover",thumbSize:p=96,placeholder:g,cta:f,acceptHint:b,showCover:y=!1,coverLabel:x,busy:v=!1,busyLabel:w,disabled:N=!1,readOnly:k=!1}){const $=ae().media,M=f??$.cta,C=x??$.cover,L=w??$.uploading,S=Me(),[D,P]=Le(null),A=N||v,j=!(!t&&!r||A||k),z=!!n&&!A&&!k,F=!!a&&!A&&!k,T=$t(A),E=g??Nt(d,$),B=ee({accept:d,maxSizeBytes:u,maxFiles:h,acceptHint:b,multiple:!0,disabled:!j,currentCount:e.length,onAccept:e=>{if(r)r(e);else for(const r of e)t(r)}}),I=B.dragOver,O=()=>{j&&(t?t():B.open())},R={width:p,height:p},W=j&&/* @__PURE__ */We("button",{type:"button",onClick:()=>O(),"aria-label":$.addMedia,className:`flex shrink-0 flex-col items-center justify-center gap-1 rounded-md border-2 border-dashed border-gray-300 bg-gray-50 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-500 ${T}`,style:R,children:[
|
|
72
|
-
/* @__PURE__ */Re(Pt,{className:"h-5 w-5"}),
|
|
73
|
-
/* @__PURE__ */Re("span",{className:"text-xs font-medium text-gray-500",children:$.add})]}),K=j?/* @__PURE__ */We("button",{type:"button",onClick:()=>O(),"aria-label":"string"==typeof E?E:$.upload,className:kt(I,!1,T),style:{minHeight:p+32},children:[
|
|
74
|
-
/* @__PURE__ */Re("span",{className:"text-gray-400",children:/* @__PURE__ */Re(Pt,{})}),
|
|
75
|
-
/* @__PURE__ */Re("span",{className:"px-3 text-xs text-gray-500",children:E}),
|
|
76
|
-
/* @__PURE__ */Re("span",{className:"text-sm font-medium text-blue-600",children:M}),b&&/* @__PURE__ */Re("span",{className:"text-xs text-gray-400",children:b})]}):/* @__PURE__ */Re("div",{className:"flex w-full items-center justify-center rounded-lg border border-gray-200 bg-gray-50 px-3 text-xs text-gray-400",style:{minHeight:p+32},children:$.empty});/* @__PURE__ */
|
|
77
|
-
return We(ht,{label:l,labelId:l?`${S}-label`:void 0,htmlFor:S,hint:i,error:o,required:s,className:c,children:[
|
|
78
|
-
/* @__PURE__ */We("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,...B.zoneProps,className:"relative rounded-lg transition-colors",style:{...A?{opacity:.6}:{},...I?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===e.length?K:/* @__PURE__ */We("div",{className:"flex flex-wrap gap-2",children:[e.map((t,r)=>{const l=t.kind?"video"===t.kind:Lt(t.url,d),i=vt(t.url),o=y&&(t.cover??0===r);/* @__PURE__ */
|
|
79
|
-
return We("div",{draggable:F||void 0,onDragStart:F?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(r)),P(r)}:void 0,onDragEnd:F?()=>P(null):void 0,onDragOver:F?e=>{null!=D&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:F?e=>{null!=D&&(e.preventDefault(),e.stopPropagation(),D!==r&&a(D,r),P(null))}:void 0,tabIndex:F?0:void 0,"aria-label":F?$.reorder(i,r+1,e.length):void 0,onKeyDown:F?t=>{"ArrowLeft"===t.key||"ArrowUp"===t.key?r>0&&(t.preventDefault(),a(r,r-1)):"ArrowRight"!==t.key&&"ArrowDown"!==t.key||r<e.length-1&&(t.preventDefault(),a(r,r+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-gray-200 bg-gray-100",T,D===r?"opacity-50":""].join(" "),style:{...R,cursor:F?"move":void 0},children:[l?/* @__PURE__ */Re("video",{src:t.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":i,className:"h-full w-full",style:{objectFit:m}}):/* @__PURE__ */Re("img",{src:t.url,alt:i,className:"h-full w-full",style:{objectFit:m}}),o&&/* @__PURE__ */Re("span",{className:"absolute left-1 top-1 rounded bg-blue-600 px-2 py-0.5 text-xs font-medium text-white",children:C}),null!=t.caption&&/* @__PURE__ */Re(Ct,{children:t.caption}),z&&/* @__PURE__ */Re("button",{type:"button",onClick:()=>n(t.id),"aria-label":$.removeItem(i),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${T}`,style:{background:"var(--rosh-media-scrim-button)"},children:It})]},t.id)}),W]}),v&&/* @__PURE__ */Re(Mt,{label:L})]}),!t&&r&&/* @__PURE__ */Re("input",{...B.inputProps}),
|
|
80
|
-
/* @__PURE__ */Re(re,{rejections:B.rejections})]})}var Rt=e=>String(e).padStart(2,"0"),Wt="grid grid-cols-[repeat(7,minmax(0,40px))] sm:grid-cols-[repeat(7,minmax(0,32px))] justify-center gap-1";function Kt(e){return`${e.getFullYear()}-${Rt(e.getMonth()+1)}-${Rt(e.getDate())}`}function _t(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 qt=e=>`${e.getFullYear()}-${Rt(e.getMonth()+1)}`;var Ht=()=>Kt(/* @__PURE__ */new Date);var Ut=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),Vt=(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 Yt({value:e,endValue:t,mode:r="single",onSelect:n,min:a,max:l,month:i,defaultMonth:o,onMonthChange:s,weekStartsOn:c,quickJump:d=!0,markedDates:u,readOnly:h=!1,"aria-label":m,className:p=""}){const g=De(()=>new Set(u??[]),[u]),f=_t(e),b=G(Ht,null),y=_t(b),x=ae().calendar,v=ne(),w=ge(v),N=G(()=>fe(v),0),k=c??N,$=()=>{if(!y)return null;const e=qt(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]=Le(()=>o||(f?qt(f):$())),L=i??M??$(),S=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),[D,P]=Le(()=>e??b),A=Se(null),j=Se(!1),[z,F]=Le("days"),T=De(()=>S?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))}(S,k):[],[L,k]),E=e=>!!a&&e<a||!!l&&e>l,B=D??b,I=T.some(e=>Kt(e)===B),O=S?T.find(e=>e.getMonth()===S.getMonth())??T[0]:null,R=I&&B?B:O?Kt(O):"";if(Pe(()=>{j.current&&(j.current=!1,A.current?.querySelector('[data-active="true"]')?.focus())},[R,L]),!S)/* @__PURE__ */
|
|
81
|
-
return We("div",{className:p,"aria-hidden":"true","data-calendar-pending":"",children:[
|
|
82
|
-
/* @__PURE__ */Re("div",{className:"mb-2 h-6"}),
|
|
83
|
-
/* @__PURE__ */Re("div",{className:"space-y-1",children:Array.from({length:7},(e,t)=>/* @__PURE__ */Re("div",0===t?{className:"py-1 text-xs",children:" "}:{className:Wt,children:/* @__PURE__ */Re("span",{className:"aspect-square"})},t))})]});const W=e=>"years"===z?new Date(S.getFullYear()+12*e,S.getMonth(),1):"months"===z?new Date(S.getFullYear()+e,S.getMonth(),1):Vt(S,e),K=e=>{const t=qt(e);void 0===i&&C(t),s?.(t)},_=m??w.monthYear(S.getFullYear(),S.getMonth());/* @__PURE__ */
|
|
84
|
-
return We("div",{className:p,children:[
|
|
85
|
-
/* @__PURE__ */We("div",{className:"mb-2 flex items-center justify-between px-1",children:[
|
|
86
|
-
/* @__PURE__ */Re("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__ */Re(Ne,{name:"chevron-left",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})}),
|
|
87
|
-
/* @__PURE__ */Re("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:d?/* @__PURE__ */We(Ke,{children:["years"!==z&&/* @__PURE__ */Re("button",{type:"button","aria-label":x.chooseMonth(w.months[S.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[S.getMonth()]}),
|
|
88
|
-
/* @__PURE__ */Re("button",{type:"button","aria-label":x.chooseYear(S.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:S.getFullYear()})]}):/* @__PURE__ */Re("span",{children:w.monthYear(S.getFullYear(),S.getMonth())})}),
|
|
89
|
-
/* @__PURE__ */Re("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__ */Re(Ne,{name:"chevron-right",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})})]}),"months"===z&&/* @__PURE__ */Re("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__ */Re("button",{type:"button","aria-pressed":t===S.getMonth(),onClick:()=>{K(new Date(S.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===S.getMonth()?"bg-blue-600 font-semibold text-white":y&&t===y.getMonth()&&S.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__ */Re("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=S.getFullYear(),12*Math.floor(r/12)+t;var r}).map(e=>/* @__PURE__ */Re("button",{type:"button","aria-pressed":e===S.getFullYear(),onClick:()=>{K(new Date(e,S.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===S.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))}),
|
|
90
|
-
/* @__PURE__ */We("div",{ref:A,role:"grid","aria-label":_,className:"space-y-1","aria-readonly":h||void 0,onKeyDown:e=>{const t=_t(R)??y??S,r={ArrowLeft:()=>Ut(t,-1),ArrowRight:()=>Ut(t,1),ArrowUp:()=>Ut(t,-7),ArrowDown:()=>Ut(t,7),Home:()=>Ut(t,-(t.getDay()-k+7)%7),End:()=>Ut(t,6-(t.getDay()-k+7)%7),PageUp:()=>Vt(t,e.shiftKey?-12:-1),PageDown:()=>Vt(t,e.shiftKey?12:1)};if(r[e.key])return e.preventDefault(),a=r[e.key](),j.current=!0,P(Kt(a)),void(qt(a)!==L&&K(a));var a;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),h||E(R)||n(R))},hidden:"days"!==z,children:[
|
|
91
|
-
/* @__PURE__ */Re("div",{role:"row",className:`${Wt} text-center text-xs font-medium text-gray-500`,children:Array.from({length:7},(e,t)=>(t+k)%7).map(e=>
|
|
92
|
-
/* @__PURE__ */Re("div",{role:"columnheader","aria-label":w.weekdays[e],className:"py-1",children:/* @__PURE__ */Re("abbr",{title:w.weekdays[e],className:"no-underline",children:w.weekdaysShort[e]})},e))}),Array.from({length:6},(a,l)=>/* @__PURE__ */Re("div",{role:"row",className:`${Wt} text-center text-sm`,children:T.slice(7*l,7*l+7).map(a=>{const l=Kt(a),i=a.getMonth()!==S.getMonth(),o=l===e||"range"===r&&l===t,s=(n=>!("range"!==r||!e||!t)&&n>e&&n<t)(l),c=E(l),d=w.longDate(a.getFullYear(),a.getMonth(),a.getDate()),u=e=>["relative w-full aspect-square rounded-md transition-colors",e?"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",c?"cursor-not-allowed text-gray-300":o?"bg-blue-600 font-semibold text-white":s?"bg-blue-100 text-blue-800":i?"text-gray-500"+(e?" hover:bg-gray-100":""):"text-gray-700"+(e?" hover:bg-gray-100":""),l!==b||o?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),m=g.has(l)&&/* @__PURE__ */Re("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__ */
|
|
93
|
-
return Re("div",{role:"gridcell","aria-selected":o,"aria-label":h?d:void 0,children:h?/* @__PURE__ */We("span",{"aria-hidden":"true",className:`grid place-items-center ${u(!1)}`,children:[a.getDate(),m]}):/* @__PURE__ */We("button",{type:"button","data-active":l===R,tabIndex:l===R?0:-1,disabled:c,"aria-label":d,"aria-current":l===b?"date":void 0,onClick:()=>{P(l),n(l)},className:u(!0),children:[a.getDate(),m]})},l)})},l))]})]})}var Gt=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],Xt=e=>`${e.getFullYear()}-${Zt(e.getMonth()+1)}`,Zt=e=>String(e).padStart(2,"0");function Jt(e){return`${e.getFullYear()}-${Zt(e.getMonth()+1)}-${Zt(e.getDate())}`}function Qt(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:Jt(new Date(r,n,t.getDate()-14)),to:Jt(a)};case"lastMonth":return{from:Jt(i(1)),to:Jt(l)};case"last3Months":return{from:Jt(i(3)),to:Jt(l)};case"last6Months":return{from:Jt(i(6)),to:Jt(l)};case"last12Months":return{from:Jt(i(12)),to:Jt(l)}}}function er(e,t,r){const n=Xt(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function tr(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function rr(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var nr=/* @__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:h=!1,min:m,max:p,disabled:g=!1,allowOpenEnd:f=!1}){const b=ae().dateRange,x=ne(),v=n??(x?function(e){let t=nr.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),nr.set(e,t));const r=t;return e=>{const[t,n,a]=e.split("-").map(Number);return t&&n&&a?r.format(new Date(Date.UTC(t,n-1,a))):e}}(x):rr),w=u??b.placeholder,N=a??!l,[k,$]=Le(!1),[M,C]=Le(e),[L,S]=Le(t),[D,P]=Le(null),[A,j]=Le("from"),z=Se(null),F=Se(null),T=Se(null),E=Me(),B=Me(),I=Me(),[O,R]=Le(!1),W=y(z,k,{preferredMaxWidth:520,preferredMaxHeight:O?720:560,popupRef:T}),q=Se(null),H=Se(null),[G,X]=Le(!0);Y(()=>{const e=H.current;if(!k||!O||!e)return;const t=getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length||1,r=parseFloat(getComputedStyle(e).columnGap)||0,n=(e.clientWidth-r*(t-1))/t,a=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=n+.5;a!==G&&X(a)});const Z=Se(null);Y(()=>{const e=T.current;if(!k||!W||!e)return;const t=getComputedStyle(e),r=W.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(O)null!==Z.current&&Z.current<=r&&R(!1);else{const e=q.current?.offsetWidth??0;if(0===e)return;Z.current=e,e>r+.5&&R(!0)}});const[J,Q]=Le(!1);Y(()=>{const e=!!o&&(F.current?.labels?.length??0)>0;e!==J&&Q(e)});const ee=!!c||!!s||J,te=/* @__PURE__ */new Date,[re,le]=Le(()=>e?Xt(tr(e)):er(te,m,p)),ie=Gt.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(Qt(e,te),m,p)),oe=e=>e?v(e):"";Pe(()=>{if(!k)return;const e=e=>{const t=e.target;z.current?.contains(t)||T.current?.contains(t)||$(!1)};document.addEventListener("mousedown",e);const t=U(()=>$(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[k]),Pe(()=>{g&&$(!1)},[g]);const se=()=>{r("",""),$(!1)},ce=e&&t?`${oe(e)} — ${oe(t)}`:e?b.fromOnly(oe(e)):t?b.toOnly(oe(t)):"",de=ge(x),ue=e=>{const t=_t(e);return t?de.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},he=e&&t?b.range(ue(e),ue(t)):e?b.fromOnly(ue(e)):t?b.toOnly(ue(t)):w,me=e=>O?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(D===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 "+(D===e?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),pe=/* @__PURE__ */We(Ke,{children:[ie.map(e=>/* @__PURE__ */Re("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=Qt(e,te);C(t.from),S(t.to),P(e),le(t.from.slice(0,7))})(e),className:me(e),"aria-label":O?b[e]:void 0,children:O?G?b[e]:b[`${e}Short`]:b[e]},e)),
|
|
94
|
-
/* @__PURE__ */Re("button",{type:"button",onClick:()=>P("Custom"),className:me("Custom"),children:b.custom})]}),fe=(e,t)=>f?/* @__PURE__ */Re("button",{type:"button","data-range-end":e,"aria-pressed":A===e,onClick:()=>j(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */Re("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),be=e=>f&&A===e?" ring-1 ring-blue-400":"",ye=
|
|
95
|
-
/* @__PURE__ */Re(Yt,{mode:"range",min:m,max:p,value:M||null,endValue:L||null,month:re,onMonthChange:le,onSelect:e=>{P("Custom"),f?"from"===A?(L&&e>L?(C(L),S(e)):C(e),j("to")):M&&e<M?(S(M),C(e)):S(e):!M||M&&L?(C(e),S("")):e<M?(S(M),C(e)):S(e)},weekStartsOn:d,"aria-label":b.dialog});/* @__PURE__ */
|
|
96
|
-
return We("div",{className:"relative"+(h?" w-full":""),ref:z,children:[
|
|
97
|
-
/* @__PURE__ */We("div",{className:`${h?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${e||t?"border-blue-400 bg-blue-50 text-blue-700":"border-gray-300 text-gray-500"}${g?" cursor-not-allowed opacity-60":""}`,children:[
|
|
98
|
-
/* @__PURE__ */We("button",{ref:F,type:"button",onClick:()=>{g||(C(e),S(t),P(null),j(e&&!t?"to":"from"),le(e?Xt(tr(e)):er(te,m,p)),$(!0))},"aria-haspopup":"dialog","aria-expanded":k,id:o,disabled:g||void 0,"aria-label":c,"aria-labelledby":s,"aria-describedby":[ee?B:void 0,l?I:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":k?E:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(h?" min-w-0 flex-1 justify-start":""),children:[
|
|
99
|
-
/* @__PURE__ */Re(Ne,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
|
|
100
|
-
/* @__PURE__ */Re("span",{className:"truncate",children:ce||w})]}),N&&!g&&(e||t)&&/* @__PURE__ */Re("button",{type:"button",onClick:se,"aria-label":b.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:"×"})]}),ee&&/* @__PURE__ */Re("span",{id:B,className:"sr-only",children:he}),l&&/* @__PURE__ */Re("span",{id:I,className:"sr-only",children:b.required}),i&&/* @__PURE__ */We(Ke,{children:[
|
|
101
|
-
/* @__PURE__ */Re("input",{type:"hidden",name:i.from,value:e,disabled:g||void 0}),
|
|
102
|
-
/* @__PURE__ */Re("input",{type:"hidden",name:i.to,value:t,disabled:g||void 0})]}),k&&_e(
|
|
103
|
-
/* @__PURE__ */We("div",{ref:T,id:E,role:"dialog","aria-label":b.dialog,"data-layout":O?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:V.popup,left:W?.left,right:W?.right,top:W?.top,bottom:W?.bottom,width:O&&W?W.maxWidth:"max-content",maxWidth:W?.maxWidth,maxHeight:W?.maxHeight,overflowY:"auto",visibility:W?void 0:"hidden",..._()},children:[
|
|
104
|
-
/* @__PURE__ */We("div",{className:O?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[fe("from",/* @__PURE__ */We(Ke,{children:[
|
|
105
|
-
/* @__PURE__ */Re("span",{className:"text-xs font-medium text-gray-500",children:b.from}),
|
|
106
|
-
/* @__PURE__ */Re("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${M?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${be("from")}`,children:M?oe(M):b.start})]})),!O&&/* @__PURE__ */Re("span",{className:"text-gray-300",children:"—"}),fe("to",/* @__PURE__ */We(Ke,{children:[
|
|
107
|
-
/* @__PURE__ */Re("span",{className:"text-xs font-medium text-gray-500",children:b.to}),
|
|
108
|
-
/* @__PURE__ */Re("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"}${be("to")}`,children:L?oe(L):b.end})]}))]}),O?/* @__PURE__ */We(Ke,{children:[ie.length>0&&/* @__PURE__ */We("div",{className:"mb-3 @container",children:[!G&&/* @__PURE__ */Re("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-gray-500",children:b.lastHeading}),
|
|
109
|
-
/* @__PURE__ */We("div",{ref:H,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[pe,ie.map(e=>/* @__PURE__ */Re("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:b[e]},e))]})]}),
|
|
110
|
-
/* @__PURE__ */Re("div",{className:"w-full",children:ye})]}):
|
|
111
|
-
/* @__PURE__ */We("div",{ref:q,className:"flex w-max gap-4",children:[
|
|
112
|
-
/* @__PURE__ */Re("div",{className:"w-64",children:ye}),ie.length>0&&/* @__PURE__ */Re("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:pe})]}),
|
|
113
|
-
/* @__PURE__ */We("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[N&&/* @__PURE__ */Re("button",{type:"button",onClick:se,className:K({variant:"ghost"}),children:b.clear}),
|
|
114
|
-
/* @__PURE__ */Re("button",{type:"button",onClick:()=>$(!1),className:K({variant:"secondary"}),children:b.cancel}),
|
|
115
|
-
/* @__PURE__ */Re("button",{type:"button",onClick:()=>{r(M,L),$(!1)},disabled:f?!M&&!L:!M||!L,className:K({variant:"primary"}),children:b.apply})]})]}),document.body)]})}var lr=/^\d{2}:\d{2}(:\d{2})?$/,ir=e=>String(e).padStart(2,"0");function or(e,t){if(null==e||""===e)return"";if(e instanceof Date){if(Number.isNaN(e.getTime()))return"";const r=`${ir(e.getHours())}:${ir(e.getMinutes())}`;return t?`${r}:${ir(e.getSeconds())}`:r}return lr.test(e)?e:""}var sr=$e(function({value:e,onChange:t,min:r,max:a,invalid:l,size:i,className:o="",step:s,...c},d){const u=null!=s&&Number(s)<60,h=ne();/* @__PURE__ */
|
|
116
|
-
return Re("input",{ref:d,type:"time",lang:h,step:s,"aria-invalid":l||void 0,value:or(e,u),min:or(r,u)||void 0,max:or(a,u)||void 0,onChange:e=>t?.(lr.test(e.target.value)?e.target.value:null),className:n({invalid:l,size:i,className:o}),...c})}),cr=/^\d{4}-\d{2}-\d{2}$/,dr=/^(aria|data)-/,ur=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function hr(e){if(null==e||""===e)return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"":Jt(e);if(cr.test(e))return e;const t=new Date(e);return Number.isNaN(t.getTime())?"":Jt(t)}function mr(e){if(!cr.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 pr(e,t){const r=mr(e);return r?t.longDate(r.getFullYear(),r.getMonth(),r.getDate()):""}var gr=$e(function({value:e,onChange:t,min:r,max:l,invalid:i,size:o,native:s,weekStartsOn:c,className:d="","aria-label":u,"aria-describedby":h,"aria-labelledby":m,id:p,name:g,disabled:f,placeholder:b,required:x,clearable:v,form:w,title:N,tabIndex:k,autoFocus:$,onFocus:M,onBlur:C,...L},S){const D=v??!x,P=hr(e),A=hr(r),j=hr(l),z=ae().datePicker,F=ne(),T=ge(F),[E,B]=Le(!1),I=Se(null),O=Se(null),R=Se(null),W=Me(),K=Me(),_=Me(),q=y(O,E,{popupRef:R}),[G,X]=Le(!1);Y(()=>{const e=!!p&&(O.current?.labels?.length??0)>0;e!==G&&X(e)});const Z=!u&&(!!m||G);if(Pe(()=>{if(!E)return;const e=e=>{const t=e.target;I.current?.contains(t)||R.current?.contains(t)||B(!1)};document.addEventListener("pointerdown",e,!0);const t=U(()=>B(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[E]),Pe(()=>{if(E)return H(e=>"Escape"===e.key&&(B(!1),O.current?.focus(),!0),()=>R.current)},[E]),s)/* @__PURE__ */
|
|
117
|
-
return Re("input",{ref:S,type:"date",lang:F,id:p,name:g,disabled:f,"aria-label":u,"aria-describedby":h,"aria-invalid":i||void 0,value:P,min:A||void 0,max:j||void 0,onChange:e=>t?.(mr(e.target.value)),className:n({invalid:i,size:o,className:d}),"aria-labelledby":m,required:x,form:w,title:N,tabIndex:k,autoFocus:$,onFocus:M,onBlur:C,...L});const J=Object.fromEntries(Object.entries(L).filter(([e])=>dr.test(e)&&!ur.has(e))),Q=L["aria-required"],ee=!!x||!0===Q||"true"===Q,te=[Z?K:void 0,ee?_:void 0,h].filter(Boolean).join(" ")||void 0,re=Jt(/* @__PURE__ */new Date),le=(!A||re>=A)&&(!j||re<=j),ie=b??z.placeholder;/* @__PURE__ */
|
|
118
|
-
return We("div",{ref:I,className:"relative",children:[
|
|
119
|
-
/* @__PURE__ */Re("input",{ref:S,type:"hidden",name:g,form:w,value:P}),
|
|
120
|
-
/* @__PURE__ */We("button",{ref:O,type:"button",...J,id:p,disabled:f,title:N,tabIndex:k,autoFocus:$,onFocus:M,onBlur:C,"aria-haspopup":"dialog","aria-expanded":E,"aria-controls":E?W:void 0,"aria-labelledby":m,"aria-describedby":te,"aria-label":u?`${u}${P?`, ${pr(P,T)}`:""}`:void 0,onClick:()=>B(e=>!e),className:`${n({invalid:i,size:o,className:d})} flex items-center justify-between text-left`,children:[
|
|
121
|
-
/* @__PURE__ */Re("span",{className:P?"text-gray-900":"text-gray-400",children:P?pr(P,T):ie}),
|
|
122
|
-
/* @__PURE__ */Re(Ne,{name:"date",className:`h-4 w-4 shrink-0 ${a}`,strokeWidth:"1.75","aria-hidden":"true"})]}),Z&&/* @__PURE__ */Re("span",{id:K,className:"sr-only",children:P?pr(P,T):ie}),ee&&/* @__PURE__ */Re("span",{id:_,className:"sr-only",children:z.required}),E&&_e(
|
|
123
|
-
/* @__PURE__ */We("div",{ref:R,id:W,role:"dialog","aria-label":u??z.dialog,className:"fixed w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg",style:{zIndex:V.popup,left:q?.left,right:q?.right,top:q?.top,bottom:q?.bottom,maxWidth:q?.maxWidth,visibility:q?void 0:"hidden"},children:[
|
|
124
|
-
/* @__PURE__ */Re(Yt,{value:P||null,min:A||null,max:j||null,weekStartsOn:c,onSelect:e=>{B(!1),O.current?.focus(),t?.(mr(e))}}),(D||le)&&/* @__PURE__ */We("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[D&&/* @__PURE__ */Re("button",{type:"button",onClick:()=>{B(!1),O.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:z.clear}),le&&/* @__PURE__ */Re("button",{type:"button",onClick:()=>{B(!1),O.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:z.today})]})]}),document.body)]})}),fr=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$/,br=e=>String(e).padStart(2,"0");function yr(e){return null==e||""===e?"":e instanceof Date?Number.isNaN(e.getTime())?"":`${(t=e).getFullYear()}-${br(t.getMonth()+1)}-${br(t.getDate())}T${br(t.getHours())}:${br(t.getMinutes())}`:fr.test(e)?e:"";var t}var xr=$e(function({value:e,onChange:t,min:r,max:a,invalid:l,size:i,className:o="",...s},c){const d=ne();/* @__PURE__ */
|
|
125
|
-
return Re("input",{ref:c,type:"datetime-local",lang:d,"aria-invalid":l||void 0,value:yr(e),min:yr(r)||void 0,max:yr(a)||void 0,onChange:e=>t?.(function(e){if(!fr.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:n({invalid:l,size:i,className:o}),...s})});function vr(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 wr(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 Nr(e,t,r){const n=await wr(t,r),a=ie().copy;return n?d.success(a.copiedLabel(e)):d.error(a.failed),n}var kr={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},$r={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 Mr(){/* @__PURE__ */
|
|
126
|
-
return Re(Ne,{name:"copy",className:"h-4 w-4","aria-hidden":"true"})}function Cr(){/* @__PURE__ */
|
|
127
|
-
return Re(Ne,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function Lr({value:e,children:t,symbol:r,label:n,size:a="md",variant:l="bordered",hideCopyButton:i=!1,onCopy:o,multiline:s=!1,id:c,"aria-describedby":u,className:h=""}){const[m,p]=Le(!1),g=Se(null),f=ae().copy;Pe(()=>()=>{g.current&&clearTimeout(g.current)},[]);const b=Ce(async()=>{await wr(e)?(p(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{p(!1),g.current=null},2e3),o?.(e)):d.error(f.failed)},[e,o,f]),{box:y,button:x}=$r[a],v=!i;/* @__PURE__ */
|
|
128
|
-
return We("div",{id:v?void 0:c,"aria-describedby":v?void 0:u,className:["inline-flex max-w-full items-center rounded-md",kr[l],y,h].filter(Boolean).join(" "),children:[null!=r&&""!==r&&/* @__PURE__ */Re("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:r}),
|
|
129
|
-
/* @__PURE__ */Re("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__ */We(Ke,{children:[
|
|
130
|
-
/* @__PURE__ */Re(qe,{id:c,"aria-label":n?f.copyLabel(n):f.copy,"aria-describedby":u,onClick:b,className:`${x} text-gray-400`,children:/* @__PURE__ */Re(m?Cr:Mr,{})}),
|
|
131
|
-
/* @__PURE__ */Re("span",{"aria-live":"polite",className:"sr-only",children:m?f.copied:""})]})]})}var Sr=2;function Dr(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 Pr(e){return e.slice(0,-1)}var Ar=["1","2","3","4","5","6","7","8","9",".","0"];function jr({value:e,onChange:t,onEnter:r,enterLabel:n,enterDisabled:a,className:l=""}){const i=ae().keypad,o=r=>{r!==e&&t(r)};/* @__PURE__ */
|
|
132
|
-
return We("div",{className:`grid grid-cols-3 gap-3 ${l}`.trim(),children:[Ar.map(t=>/* @__PURE__ */Re(v,{size:"touch-xl",variant:"secondary",onClick:()=>o(Dr(e,t)),children:t},t)),
|
|
133
|
-
/* @__PURE__ */Re(v,{size:"touch-xl",variant:"secondary","aria-label":i.backspace,onClick:()=>o(Pr(e)),children:"⌫"}),r&&/* @__PURE__ */Re(v,{size:"touch-xl",variant:"primary",className:"col-span-3",disabled:a,onClick:r,children:n??i.enter})]})}var zr={md:"h-24 p-3",lg:"h-32 p-4"},Fr=$e(function({title:e,subtitle:t,size:r="lg",selected:n=!1,disabled:a,type:l="button",className:i="",...o},s){/* @__PURE__ */
|
|
134
|
-
return We("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)]",zr[r],i].filter(Boolean).join(" "),...o,children:[
|
|
135
|
-
/* @__PURE__ */Re("span",{className:"line-clamp-2 font-medium text-gray-900",children:e}),null!=t&&/* @__PURE__ */Re("span",{className:"text-sm text-gray-500",children:t})]})}),Tr={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 Er(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 Br({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",Tr[e],t?"bg-blue-600 text-white shadow-sm rosh-segmented-on":"text-gray-600 hover:text-gray-900",r?"cursor-not-allowed opacity-40":"cursor-pointer",n?"flex-1":""].filter(Boolean).join(" ")}function Ir(e=!1){return e?"relative inline-flex shrink-0 flex-1":"relative inline-flex shrink-0"}function Or({icon:e,label:t}){/* @__PURE__ */
|
|
136
|
-
return We(Ke,{children:[e?/* @__PURE__ */Re("span",{"aria-hidden":"true",className:"inline-flex shrink-0",children:e}):null,t]})}function Rr({value:e,onChange:t,options:r,name:n,size:a="md",block:l=!1,label:i,className:o="","aria-labelledby":s,"aria-describedby":c}){const d={"aria-label":s?void 0:i,"aria-labelledby":s,"aria-describedby":c},u=Me(),h=Er(l,o),m=Ir(l);/* @__PURE__ */
|
|
137
|
-
return Re("div",n?{role:"radiogroup",...d,className:h,children:r.map(r=>{const i=`${u}-${r.value}`,o=r.value===e,s=/* @__PURE__ */We("label",{htmlFor:i,className:Br({size:a,selected:o,disabled:r.disabled,block:l}),children:[
|
|
138
|
-
/* @__PURE__ */Re("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)]"}),
|
|
139
|
-
/* @__PURE__ */Re(Or,{icon:r.icon,label:r.label}),r.title&&/* @__PURE__ */Re("span",{id:`${i}-note`,className:"sr-only",children:r.title})]},r.value);return r.title?/* @__PURE__ */Re(w,{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__ */Re("button",{type:"button","aria-pressed":n,disabled:r.disabled,onClick:()=>t(r.value),className:Br({size:a,selected:n,disabled:r.disabled,block:l}),children:/* @__PURE__ */Re(Or,{icon:r.icon,label:r.label})},r.value);return r.title?/* @__PURE__ */Re(w,{content:r.title,className:m,children:i},r.value):i})})}var Wr={sm:"h-5 w-9",md:"h-6 w-11",touch:"h-8 w-14"},Kr={sm:"h-4 w-4",md:"h-5 w-5",touch:"h-7 w-7"},_r={sm:"translate-x-4",md:"translate-x-5",touch:"translate-x-6"},qr=$e(function({checked:e,onChange:t,disabled:r=!1,size:n="md",label:a,hint:l,id:i,className:o="",disabledReason:s,disabledReasonId:c,...d},u){const h=Me(),m=i??h,p=l?`${m}-hint`:void 0,g=r&&c?c:void 0,f=r&&!g&&null!=s&&""!==s,b=f?`${m}-reason`:void 0,y=[p,g??b].filter(Boolean).join(" ")||void 0,x=/* @__PURE__ */Re("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",Wr[n],e?"bg-blue-600":"bg-gray-300"].join(" "),children:/* @__PURE__ */Re("span",{className:["inline-block rounded-full bg-white shadow transition-transform",Kr[n],e?_r[n]:"translate-x-0"].join(" ")})});return a||l||f?/* @__PURE__ */We("span",{className:`flex items-start gap-3 ${o}`.trim(),children:[x,
|
|
140
|
-
/* @__PURE__ */We("span",{className:"min-w-0",children:[a&&/* @__PURE__ */Re("label",{htmlFor:m,className:"block text-sm font-medium text-gray-800",children:a}),l&&/* @__PURE__ */Re("span",{id:p,className:"mt-0.5 block text-xs text-gray-500",children:l}),f&&/* @__PURE__ */Re("span",{id:b,className:"mt-0.5 block text-xs text-red-600",children:s})]})]}):/* @__PURE__ */Re("span",{className:o,children:x})});function Hr(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}var Ur=(e,t)=>null==e?"":null!=t?e.toFixed(t):String(e);function Vr(e){const t=e.trim().replace(",",".");if(""===t||"-"===t||"."===t||"-."===t)return null;const r=Number(t);return Number.isFinite(r)?r:null}function Yr({dir:e,compact:t,label:r,disabled:n,onStep:a}){const l=Se(a);l.current=a;const i=Se({}),o=Ce(()=>{const e=i.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),i.current={}},[]);Pe(()=>o,[o]),Pe(()=>{n&&o()},[n,o]);const s=/* @__PURE__ */Re(Ne,{name:e>0?"chevron-up":"chevron-down","aria-hidden":"true",focusable:"false",className:t?"h-2.5 w-2.5":"h-3.5 w-3.5",strokeWidth:t?2.6:2}),c={tabIndex:-1,"aria-label":r,disabled:n,onPointerDown:e=>{if(0!==e.button||n)return;e.preventDefault(),o();const t=e.shiftKey;l.current(t);const r=e.currentTarget.ownerDocument.defaultView??window;r.addEventListener("pointerup",o),i.current={off:()=>r.removeEventListener("pointerup",o),wait:setTimeout(()=>{i.current.every=setInterval(()=>l.current(t),60)},400)}},onPointerLeave:o,onPointerCancel:o,onClick:e=>{0===e.detail&&l.current(e.shiftKey)}};return t?/* @__PURE__ */Re("button",{type:"button",...c,className:"flex min-h-0 flex-1 items-center justify-center text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 disabled:cursor-not-allowed disabled:opacity-40",children:s}):/* @__PURE__ */Re(qe,{size:"sm",...c,children:s})}var Gr=$e(function({value:e,onChange:t,min:r,max:a,precision:l,step:i,shiftStep:o,disabled:s,readOnly:c,invalid:d,placeholder:u,size:h,prefix:m,suffix:p,id:g,name:f,className:b="",onBlur:y,steppers:x=!1,stepFrom:v,snap:w=!1,allowEmpty:N=!0,"aria-label":k,"aria-labelledby":$},M){const C=ae(),[L,S]=Le(()=>Ur(e,l)),D=Se(L);D.current=L;const P=Se(null),A=Ce(e=>{P.current=e,"function"==typeof M?M(e):M&&(M.current=e)},[M]),j=Se(e),z=Se(e);z.current=e;const F=Boolean(s||c),T="compact"===x;Pe(()=>{Vr(D.current)!==e&&S(Ur(e,l))},[e,l]);const E=e=>{if(F)return;let n=(Vr(D.current)??v??(u?Vr(u):null)??0)+e;null!=r&&n<r&&(n=r),null!=a&&n>a&&(n=a);const o=l??String(i??1).split(".")[1]?.length??0;n=Number(n.toFixed(o));const s=Ur(n,l);D.current=s,S(s),t(n)},B=Se(E);B.current=E;const[I,O]=Le(!1);Pe(()=>{if(I&&!F)return H(e=>{if("Escape"!==e.key||document.activeElement!==P.current)return!1;const r=j.current;if(Vr(D.current)===r)return!1;const n=Ur(r,l);return D.current=n,S(n),z.current!==r&&t(r),!0})},[I,F,l,t]);const R=()=>{const e=Vr(D.current);if(null==e){if(!N){const e=Ur(z.current,l);return D.current=e,S(e),z.current}return D.current="",S(""),null!==z.current&&t(null),null}let n=e;const o=l??(w?Math.max(Hr(i??1),Hr(r??0)):void 0);w&&(n=function(e,t,r){const n=(e-r)/t;return r+Math.round(n+1e-9*Math.sign(e))*t}(n,i??1,r??0)),null!=r&&n<r&&(n=r),null!=a&&n>a&&(n=a),null!=o&&(n=Number(n.toFixed(o)));const s=Ur(n,l);return D.current=s,S(s),n===e&&n===z.current||t(n),n},W=/* @__PURE__ */Re("input",{ref:A,id:g,name:f,type:"text",inputMode:0===l?"numeric":"decimal",value:L,disabled:s,readOnly:c,placeholder:u,step:i,role:"spinbutton","aria-valuenow":e??void 0,"aria-valuemin":r,"aria-valuemax":a,"aria-valuetext":null==e?u||void 0:Ur(e,l),"aria-invalid":d||void 0,"aria-label":k,"aria-labelledby":$,onChange:e=>(e=>{if(c)return;if(""!==e&&!/^-?\d*[.,]?\d*$/.test(e))return;S(e);const r=Vr(e);(null!==r||N)&&t(r)})(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&!F)return void(j.current=R());const t=i??1,r=o??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||F||(e.preventDefault(),E(n))},onFocus:()=>{j.current=z.current,O(!0)},onBlur:()=>{O(!1),R(),y?.()},className:n({invalid:d,size:h,readOnly:c,className:[m?"pl-8":"",T?p?"pr-12":"pr-6":x?p?"pr-24":"pr-16":p?"pr-10":"","text-right tabular-nums",b].filter(Boolean).join(" ")})});if(!m&&!p&&!x)return W;const K=Vr(L);/* @__PURE__ */
|
|
141
|
-
return We("div",{className:"relative",children:[m&&/* @__PURE__ */Re("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:m}),W,p&&/* @__PURE__ */Re("span",{className:`pointer-events-none absolute ${T?"right-6":x?"right-16":"right-3"} top-1/2 -translate-y-1/2 text-sm text-gray-500`,children:p}),x&&(()=>{const e=/* @__PURE__ */Re(Yr,{dir:-1,compact:T,label:C.number.decrease,disabled:F||null!=r&&null!=K&&K<=r,onStep:e=>B.current(-(e?o??10*(i??1):i??1))}),t=/* @__PURE__ */Re(Yr,{dir:1,compact:T,label:C.number.increase,disabled:F||null!=a&&null!=K&&K>=a,onStep:e=>B.current(e?o??10*(i??1):i??1)});/* @__PURE__ */
|
|
142
|
-
return We("span",T?{"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]})})()]})}),Xr=(e,t,r)=>Math.min(r,Math.max(t,e));function Zr(e,t,r,n){return Number(Xr(e,t,r).toFixed(n))}function Jr({value:e,onChange:t,min:r,max:n,step:a=1,shiftStep:l,precision:i,inputMin:o,inputMax:s,suffix:c,showInput:d=!0,emptyLabel:u,placeholderValue:h,stepFrom:m,label:p,"aria-labelledby":g,valueText:f,id:b,disabled:y,size:x="md",className:v=""}){const w=ae(),N=Me(),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,S=m??h,D=Xr(e??h??r,r,n),P=e=>f?f(e):"string"==typeof c?`${e.toFixed($)} ${c}`:void 0,A=null==e?u??(null!=h?P(h)??String(h):void 0):P(e);/* @__PURE__ */
|
|
143
|
-
return We("div",{className:`flex items-center gap-3 ${v}`.trim(),children:[
|
|
144
|
-
/* @__PURE__ */Re("input",{id:k,type:"range",min:r,max:n,step:a,value:D,disabled:y,"aria-label":g?void 0:p,"aria-labelledby":g,"aria-valuetext":A,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!=S))return;i.preventDefault();t(Zr((e??S??D)+o*(s?l??a:a),r,n,$))},onChange:e=>t(Zr(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&&/* @__PURE__ */Re("div",{className:"sm"===x?"w-16 shrink-0":"w-20 shrink-0",children:/* @__PURE__ */Re(Gr,{value:e,onChange:e=>{null!=e?e<M||e>C||t(e):L&&t(null)},min:M,max:C,step:a,shiftStep:l,stepFrom:S,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:g})})]})}function Qr({items:e,onChange:t,label:r,className:n="","aria-labelledby":a,"aria-describedby":l}){const i=ae().displayChips,o=Me();/* @__PURE__ */
|
|
145
|
-
return Re("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__ */We("button",{type:"button","aria-pressed":e.shown,disabled:!(!e.disabled||l)||void 0,"aria-disabled":!!l||void 0,"aria-describedby":f(n,l?a:void 0),onClick:l?g:()=>t(e.id,!e.shown),className:"inline-flex h-6 shrink-0 items-center gap-1 whitespace-nowrap rounded-full border pl-2 pr-3 text-xs font-medium transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60 aria-disabled:cursor-not-allowed aria-disabled:opacity-60 "+(e.shown?"border-blue-200 bg-blue-50 text-blue-700 hover:bg-blue-100":"border-gray-200 bg-white text-gray-500 hover:bg-gray-50 hover:text-gray-900"),children:[
|
|
146
|
-
/* @__PURE__ */Re(Ne,{name:e.shown?"eye":"eye-off",className:"h-4 w-4 shrink-0",strokeWidth:"1.75"}),e.label]}),c=/* @__PURE__ */Re("span",{id:n,className:"sr-only",children:e.shown?i.shown:i.hidden});/* @__PURE__ */
|
|
147
|
-
return We(Ee,{children:[l?/* @__PURE__ */Re(b,{reason:e.disabledReason,id:a,children:s}):/* @__PURE__ */Re(w,{content:e.shown?i.shownHint:i.hiddenHint,describe:!1,className:"relative inline-flex",children:s}),c]},e.id)})})}var en=4,tn=10,rn={1:["100%"],2:["50%","50%"],3:["33.34%","33.33%","33.33%"],4:["25%","25%","25%","25%"]},nn={1:[],2:[50],3:[34,33],4:[25,25,25]},an=e=>"number"==typeof e&&Number.isFinite(e);function ln(e,t){if(!Number.isInteger(t)||t<2||t>4)return;if(!Array.isArray(e)||e.length!==t-1)return;if(!e.every(an))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,tn,100-n-(t-1-a)*tn);r.push(l),n+=l}),r}function on(e,t){const r=ln(e,t);if(!r)return(e=>[...rn[e]??rn[1]])(t);const n=r.reduce((e,t)=>e+t,0);return[...r.map(e=>`${e}%`),100-n+"%"]}function sn(e,t){return on(t,e)}var cn=10,dn=(e,t,r)=>Math.min(r,Math.max(t,e)),un=e=>e.reduce((e,t)=>e+t,0),hn=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]);function mn(e){const t=e.trim().replace(/%$/,"").trim();if(""===t)return null;const r=Number(t);return Number.isFinite(r)?r:null}var pn,gn="w-0.5",fn=`${gn} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var bn=["text-blue-700","text-gray-600"];function yn({column:e,share:t,start:r,max:n,label:a,name:l,hintId:i,readOnly:o,disabled:s,stored:c,onType:d,onRestore:u,onFocusChange:h,covered:m,seam:p}){const g=Se(null),f=o||s,[b,y]=Le(null),x=Se(!1),v=Se(void 0),w=Se({share:t,stored:c,onType:d,onRestore:u,locked:f});w.current={share:t,stored:c,onType:d,onRestore:u,locked:f};const N=Se(!1),[k,$]=Le(0),M=e=>{x.current=!1,y(e),$(e=>e+1)};Pe(()=>{k>0&&document.activeElement===g.current&&g.current?.select()},[k]),Pe(()=>{null===b||x.current||M(String(t))},[t]);const C=()=>{if(!x.current||null===b)return null;const t=mn(b),r=null===t||w.current.locked?null:w.current.onType(e,t);return x.current=!1,r},L=null!==b;Pe(()=>{if(L&&!f)return H(e=>{if("Escape"!==e.key||document.activeElement!==g.current)return!1;const t=v.current,r=(n=w.current.stored,a=t,!(void 0===n||void 0===a?n===a:hn(n,a)));var n,a;return!(!x.current&&!r)&&(r&&w.current.onRestore(t),M(String(w.current.share)),!0)})},[L,f]);const S=L?`max(${t}%, 40px)`:`${t}%`;/* @__PURE__ */
|
|
148
|
-
return We(Ke,{children:[
|
|
149
|
-
/* @__PURE__ */Re("input",{ref:g,type:"text",inputMode:"numeric",autoComplete:"off",spellCheck:!1,role:"spinbutton","data-widths-label":"","aria-label":l,"aria-valuenow":t,"aria-valuemin":tn,"aria-valuemax":n,"aria-valuetext":`${t}%`,"aria-describedby":i,value:b??a,readOnly:o,disabled:s,onFocus:()=>{v.current=w.current.stored,N.current=!0,M(String(t)),h(e,!0)},onBlur:()=>{C(),N.current=!1,x.current=!1,y(null),h(e,!1)},onMouseUp:e=>{N.current&&(N.current=!1,e.preventDefault())},onChange:e=>{f||(x.current=!0,y(e.target.value))},onKeyDown:r=>{if(f||r.altKey||r.ctrlKey||r.metaKey)return;if("Enter"===r.key){if(!x.current)return;const t=C();return t&&(v.current=t.slice(0,-1)),void M(String(t?t[e]:w.current.share))}const n=r.shiftKey?cn:1,a="ArrowUp"===r.key?n:"ArrowDown"===r.key?-n:"PageUp"===r.key?cn:"PageDown"===r.key?-10:null;if(null===a)return;r.preventDefault();const l=(x.current&&null!==b?mn(b):null)??t,i=d(e,l+a);M(String(i?i[e]:t))},style:{left:`clamp(0px, calc(${r+t/2}% - ${S} / 2), calc(100% - ${S}))`,width:S},className:`absolute inset-y-0 m-0 min-w-0 rounded-(--radius-control) border-0 p-0 text-center text-xs font-medium tabular-nums rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${bn[e%2]} ${L?"z-20 bg-white":"bg-transparent"} ${m&&!L?"opacity-0":""} ${f?"cursor-default":"cursor-text"}`}),p]})}function xn({count:e,value:t,onChange:r,label:n,"aria-labelledby":a,readOnly:l=!1,disabled:i=!1,footer:o=!0,className:s=""}){const c=ae().widths,d=Me(),u=dn(Math.round(e)||1,1,4),h=ln(t,u),m=h??[...nn[u]??[]],p=[...m,100-un(m)],g=l||i,f=Se(null),b=Se({onChange:r,shown:m,locked:g,n:u});b.current={onChange:r,shown:m,locked:g,n:u};const y=e=>{const{onChange:t,shown:r,locked:n,n:a}=b.current;if(n)return!1;const l=ln(e,a);return!(!l||hn(l,r))&&(t(l),!0)},x=(e,t,r)=>{const n=e[t]+e[t+1],a=[...e];a[t]=dn(Math.round(r),tn,n-tn),a[t+1]=n-a[t],y(a.slice(0,-1))},N=e=>t=>{if(t.altKey||t.ctrlKey||t.metaKey)return;const r=t.shiftKey?cn: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]+cn:"PageDown"===t.key?p[e]-cn:"Home"===t.key?tn:"End"===t.key?n-tn:null;null!==a&&(t.preventDefault(),x(p,e,a))},k=Se(null),[$,M]=Le(null),C=()=>{k.current=null,M(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};Pe(()=>C,[]);const L=e=>t=>{if(0!==t.button||g)return;t.preventDefault();const r=f.current?.getBoundingClientRect().width??0;r<=0||(k.current={i:e,x:t.clientX,width:r,from:p,moved:!1,pointer:t.pointerId},M(e),t.currentTarget.setPointerCapture?.(t.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},S=e=>{const t=k.current;if(!t)return;if(0===e.buttons)return void C();const r=e.clientX-t.x;if(!t.moved){if(Math.abs(r)<3)return;t.moved=!0}x(t.from,t.i,t.from[t.i]+r/t.width*100)},D=e=>{const t=k.current;t&&(e.currentTarget.hasPointerCapture?.(t.pointer)&&e.currentTarget.releasePointerCapture(t.pointer),C())},P=(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=dn(Math.round(r),tn,100-(n-1)*tn);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]-tn);a[e]-=t,i-=t}return a}([...r,100-un(r)],e,t);return y(n.slice(0,-1))?n:null},[A,j]=Le(0);Pe(()=>{const e=f.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>j(e.getBoundingClientRect().width));return t.observe(e),()=>t.disconnect()},[]);const z=e=>A>0&&A*e/100<36?String(e):`${e}%`,F=Se(null),[T,E]=Le(null),[B,I]=Le([]),O=(e,t)=>E(r=>t?e:r===e?null:r),R=p.join(",");Pe(()=>{const e=null===T?[]:function(e,t){if(!e)return[];const r=Array.from(e.querySelectorAll("input[data-widths-label]")),n=r[t]?.getBoundingClientRect();if(!n||0===n.width)return[];if(void 0===pn&&(pn=document.createElement("canvas").getContext("2d")),!pn)return[];const a=pn;return r.flatMap((e,r)=>{if(r===t)return[];const l=e.getBoundingClientRect(),i=getComputedStyle(e);a.font=`${i.fontWeight} ${i.fontSize} ${i.fontFamily}`;const o=a.measureText(e.value).width/2,s=(l.left+l.right)/2;return s+o>n.left&&s-o<n.right?[r]:[]})}(F.current,T);I(t=>hn(t,e)?t:e)},[T,R,A]);const W=p.slice(0,-1).map((e,t)=>un(p.slice(0,t+1)));/* @__PURE__ */
|
|
150
|
-
return We("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:[
|
|
151
|
-
/* @__PURE__ */We("div",{ref:F,"data-widths-bar":"",className:"relative h-8",children:[
|
|
152
|
-
/* @__PURE__ */Re("div",{ref:f,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-white",children:p.map((e,t)=>/* @__PURE__ */Re("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 ${bn[t%2]} ${t%2==0?"bg-blue-50":""}`,children:1===u&&/* @__PURE__ */Re("span",{"data-widths-label":"",children:`${e}%`})},t))}),
|
|
153
|
-
/* @__PURE__ */Re("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__ */Re(yn,{column:t,share:e,start:un(p.slice(0,t)),max:100-(u-1)*tn,label:z(e),name:c.column(t+1),hintId:d,readOnly:l,disabled:i,stored:h,onType:P,onFocusChange:O,covered:B.includes(t),onRestore:e=>{const{onChange:t,locked:r}=b.current;r||t(e)},seam:t<u-1?/* @__PURE__ */Re("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${W[t]}%`},children:/* @__PURE__ */Re(w,{content:c.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */Re("div",{role:"separator",tabIndex:i?-1:0,"aria-orientation":"vertical","aria-label":c.divider(t+1,t+2),"aria-valuenow":p[t],"aria-valuemin":tn,"aria-valuemax":p[t]+p[t+1]-tn,"aria-valuetext":c.dividerValue(t+1,p[t],t+2,p[t+1]),"aria-disabled":g||void 0,onKeyDown:g?void 0:N(t),onPointerDown:L(t),onPointerMove:S,onPointerUp:D,onPointerCancel:D,onLostPointerCapture:()=>{k.current&&C()},className:"group/widths flex h-full w-full touch-none justify-center rounded-(--radius-control) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(g?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */Re("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(g?`${gn} bg-gray-300`:`bg-blue-600 transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${$===t?"w-1":fn}`)})})})}):null},t))]}),u>1&&!o&&/* @__PURE__ */Re("span",{id:d,className:"sr-only",children:c.hint(u,tn)}),u>1&&o&&/* @__PURE__ */Re("div",{"data-widths-footer":"",className:"@container",children:/* @__PURE__ */We("div",{className:"flex items-center justify-between gap-2 @max-[264px]:flex-col @max-[264px]:items-end",children:[
|
|
154
|
-
/* @__PURE__ */Re("span",{id:d,"data-widths-hint":"",className:"text-2xs leading-tight text-gray-500 @max-[264px]:self-stretch",children:c.hint(u,tn)}),
|
|
155
|
-
/* @__PURE__ */Re(v,{variant:"secondary",size:"sm",disabled:g,onClick:()=>{g||void 0===t||r(void 0)},className:"shrink-0",children:c.reset})]})})]})}var vn=/(^|[\s:])!?z-/;function wn({trigger:e,children:t,title:r,description:n,"aria-label":a,align:l="start",side:i="bottom",open:o,defaultOpen:s=!1,onOpenChange:c,matchTriggerWidth:d=!1,maxHeight:u,initialFocus:h,id:m,triggerLabel:p,"aria-describedby":g,disabled:f,className:b="",triggerClassName:y,panelClassName:x=""}){const[v,w]=Le(s),C=(o??v)&&!f,L=X(),P=Se(null),A=Se(null),z=Se(null),F=Se(null),T=Me(),E=m??T,B=Me(),I=Me(),O=Me(),R=Se(null),W=Se(!1),_=Se({openProp:o,onOpenChange:c});_.current={openProp:o,onOpenChange:c};const q=Ce(e=>{void 0===_.current.openProp&&w(e),_.current.onOpenChange?.(e)},[]),G=Ce((e=!1)=>{W.current=e,q(!1)},[q]),Z=e=>{R.current=e.nativeEvent},J=Ce(()=>{const e=z.current,t=A.current;if(!e||!t)return;const r=t.getBoundingClientRect(),n=N(t),a=Math.max(0,n.right-n.left-2*k),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=$({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]);Y(()=>{C&&L&&J()}),Pe(()=>{if(!C||!L)return;const e=M(()=>A.current,J),t=F.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>J());return r.observe(t),()=>{e(),r.disconnect()}},[C,L,J]),Pe(()=>{if(!C)return;const e=e=>{let t=null,r=0;const n=e=>{t===e&&(t=null,window.clearTimeout(r),(e=>{if(R.current===e)return!1;const t=e.target;return!(t&&(P.current?.contains(t)||z.current?.contains(t)))})(e)&&G(!0))},a=e=>{t=e,r=window.setTimeout(()=>n(e),0)},l=e=>n(e);return document.addEventListener(e,a,!0),window.addEventListener(e,l),()=>{window.clearTimeout(r),document.removeEventListener(e,a,!0),window.removeEventListener(e,l)}},t=e("pointerdown"),r=e("focusin"),n=U(()=>G()),a=H(e=>"Escape"===e.key&&(G(),A.current?.focus(),!0),()=>z.current);return()=>{t(),r(),n(),a()}},[C,G]),S(z,C&&L),Y(()=>{if(!C||!L)return;const e=z.current;return()=>{if(W.current)return;const t=document.activeElement;t&&t!==document.body&&!e?.contains(t)||A.current?.focus({preventScroll:!0})}},[C,L]),Pe(()=>{if(!C||!L)return;const e=z.current;e&&(W.current=!1,(h?.current??D(e)[0]??e).focus({preventScroll:!0}))},[C,L]);const Q="function"==typeof t?t({close:()=>G()}):t,ee=r?{"aria-labelledby":I}:a?{"aria-label":a}:{"aria-labelledby":E};/* @__PURE__ */
|
|
156
|
-
return We("div",{ref:P,className:`relative inline-flex ${b}`.trim(),children:[
|
|
157
|
-
/* @__PURE__ */Re("button",{ref:A,id:E,type:"button","aria-haspopup":"dialog","aria-expanded":C,"aria-controls":C&&L?B:void 0,"aria-label":p,"aria-describedby":g,disabled:f,onClick:()=>C?G():q(!0),onKeyDown:e=>{if("Tab"!==e.key||e.shiftKey||!C)return;const t=(()=>{const e=z.current;return e?D(e)[0]??e:null})();t&&(e.preventDefault(),t.focus({preventScroll:!0}))},className:y??K({variant:"secondary"}),children:e}),C&&L&&_e(
|
|
158
|
-
/* @__PURE__ */Re("div",{ref:z,id:B,role:"dialog",...ee,"aria-describedby":n?O:void 0,tabIndex:-1,"data-popover-panel":"",onPointerDownCapture:Z,onFocusCapture:Z,onKeyDown:e=>{const t=z.current,r=A.current;if("Tab"!==e.key||!t||!r||!t.contains(e.target))return;const n=D(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=j(r,t);G(!!l),(l??r).focus({preventScroll:!0})},className:`fixed rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${x}`.trim(),style:vn.test(x)?void 0:{zIndex:V.popup},children:/* @__PURE__ */We("div",{ref:F,children:[r&&/* @__PURE__ */Re("h2",{id:I,className:"text-sm font-semibold text-gray-900",children:r}),n&&/* @__PURE__ */Re("p",{id:O,className:"mt-1 text-sm text-gray-500",children:n}),r||n?/* @__PURE__ */Re("div",{className:"mt-3",children:Q}):Q]})}),document.body)]})}var Nn=/^(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;function kn(e){const t=e.trim().replace(/^#/,"");if(!Nn.test(t))return null;return`#${(3===t.length?[...t].map(e=>e+e).join(""):t).toLowerCase()}`}var $n=e=>e.toUpperCase(),Mn=(e,t,r)=>Math.min(r,Math.max(t,e));function Cn(e){const t=kn(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 Ln({h:e,s:t,v:r}){const n=(e%360+360)%360,a=Mn(t,0,1),l=Mn(r,0,1),i=l*a,o=i*(1-Math.abs(n/60%2-1)),s=l-i,[c,d,u]=n<60?[i,o,0]:n<120?[o,i,0]:n<180?[0,i,o]:n<240?[0,o,i]:n<300?[o,0,i]:[i,0,o],h=e=>Math.round(255*(e+s)).toString(16).padStart(2,"0");return`#${h(c)}${h(d)}${h(u)}`}var Sn=`linear-gradient(to right, ${[0,60,120,180,240,300,360].map(e=>Ln({h:e%360,s:1,v:1})).join(", ")})`,Dn={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},Pn={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function An(e){return e?{background:e}:Pn}function jn({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",Dn[e],r].filter(Boolean).join(" ")}var zn=$e(function({color:e,size:t="md",selected:r,className:n,type:a="button",...l},i){/* @__PURE__ */
|
|
159
|
-
return Re("button",{ref:i,type:a,"aria-pressed":r,className:jn({size:t,selected:r,className:n}),...l,children:/* @__PURE__ */Re("span",{"aria-hidden":"true",className:"absolute inset-0",style:An(e)})})}),Fn=(e,t,r)=>Math.min(r,Math.max(t,e)),Tn=e=>"string"==typeof e?{value:e}:e;var En={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function Bn({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=ae().color,h=kn(l??""),[m,p]=Le(()=>Cn(e||h||"")),g=Se(e);Pe(()=>{e!==g.current&&(g.current=e,e?p(Cn(e)):h&&p(Cn(h)))},[e]);const f=r=>{o||r===e||(g.current=r,t(r))},b=e=>{const t=kn(e);t&&(p(Cn(t)),f(t))},y=e=>{p(e),f(Ln(e))},[x,v]=Le(!1),N=Se(m);N.current=m;const k=e=>({onPointerDown:t=>{if(o||0!==t.button)return;t.currentTarget.setPointerCapture?.(t.pointerId),t.currentTarget.focus({preventScroll:!0});const r=e(t,N.current);"end"===i?(v(!0),p(r)):y(r)},onPointerMove:t=>{if(o||!(1&t.buttons))return;const r=e(t,N.current);"end"===i?p(r):y(r)},onPointerUp:t=>{"end"===i&&x&&(v(!1),y(e(t,N.current)))}}),$=k((e,t)=>{return{...t,...(r=e.clientX,n=e.clientY,a=e.currentTarget.getBoundingClientRect(),{s:a.width>0?Mn((r-a.left)/a.width,0,1):0,v:a.height>0?1-Mn((n-a.top)/a.height,0,1):0})};var r,n,a}),M=k((e,t)=>{return{...t,h:(r=e.clientX,n=e.currentTarget.getBoundingClientRect(),n.width>0?Math.min(359,360*Mn((r-n.left)/n.width,0,1)):0)};var r,n}),C=x?Ln(m):e,L=e=>`${Math.round(100*e)}%`,S=(n??[]).map(Tn),D=kn(e);/* @__PURE__ */
|
|
160
|
-
return We("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:[(S.length>0||a)&&/* @__PURE__ */We("div",{role:"group","aria-label":u.presets,className:"flex flex-wrap gap-2",children:[a&&/* @__PURE__ */Re(w,{content:u.clear,children:/* @__PURE__ */Re(zn,{color:"",size:"sm","aria-label":u.clear,selected:""===e,disabled:o,onClick:()=>{o||""===e||(g.current="",t(""))}})}),S.map(e=>{const t=kn(e.value),r=e.label?`${e.label} · ${$n(t??e.value)}`:$n(t??e.value);/* @__PURE__ */
|
|
161
|
-
return Re(w,{content:r,children:/* @__PURE__ */Re(zn,{color:t??e.value,size:"sm","aria-label":r,selected:null!==t&&t===D,disabled:o,onClick:()=>b(e.value)})},`${e.label??""}:${e.value}`)})]}),
|
|
162
|
-
/* @__PURE__ */Re("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:Fn(e.s+a[0],0,1),v:Fn(e.v+a[1],0,1)}:null}(m,e.key,e.shiftKey);t&&(e.preventDefault(),y(t))},...$,className:"relative h-36 w-full cursor-crosshair touch-none rounded-md rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundColor:Ln({h:m.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */Re("span",{"aria-hidden":"true",className:"pointer-events-none absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:L(m.s),top:L(1-m.v),...En}})}),
|
|
163
|
-
/* @__PURE__ */Re("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 Fn(e-n,0,359);case"ArrowRight":case"ArrowUp":return Fn(e+n,0,359);case"PageDown":return Fn(e-10,0,359);case"PageUp":return Fn(e+10,0,359);case"Home":return 0;case"End":return 359;default:return null}}(m.h,e.key,e.shiftKey);null!==t&&(e.preventDefault(),y({...m,h:t}))},...M,className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:Sn},children:/* @__PURE__ */Re("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:Ln({h:m.h,s:1,v:1}),...En}})}),
|
|
164
|
-
/* @__PURE__ */We("div",{className:"flex items-center gap-2",children:[
|
|
165
|
-
/* @__PURE__ */Re("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-gray-300",style:An(C||(h??""))}),
|
|
166
|
-
/* @__PURE__ */Re(In,{value:C,placeholder:!e&&h?$n(h):void 0,onChange:b,label:u.hex(r),disabled:o})]})]})}function In({value:e,onChange:t,label:r,placeholder:a,disabled:l,id:i,size:o="md",className:s=""}){const[c,d]=Le(null);/* @__PURE__ */
|
|
167
|
-
return Re("input",{id:i,type:"text",value:c??(e?$n(e):""),"aria-label":r,placeholder:a,maxLength:7,spellCheck:!1,autoComplete:"off",disabled:l,onChange:r=>{d(r.target.value);const n=kn(r.target.value);null!==n&&n!==e&&t(n)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),d(null))},onBlur:()=>d(null),className:n({size:o,className:`min-w-0 flex-1 font-mono uppercase ${s}`.trim()})})}function On({value:e,onChange:t,label:r,presets:n,clearable:a,fallback:l,dragWrites:i,disabled:o,id:s,showHexInput:c=!1,size:d="md",align:u="start",open:h,onOpenChange:m,className:p=""}){const g=ae().color,f=Me(),b=kn(l??""),y=e||b||"",x=e?$n(e):b?$n(b):g.none;/* @__PURE__ */
|
|
168
|
-
return We("div",{className:`inline-flex items-center gap-2 ${p}`.trim(),children:[
|
|
169
|
-
/* @__PURE__ */Re(wn,{id:s,trigger:/* @__PURE__ */Re("span",{"aria-hidden":"true",className:"absolute inset-0",style:An(y)}),triggerLabel:g.swatch(r,x),triggerClassName:jn({size:d}),"aria-label":g.panel(r),align:u,open:h,onOpenChange:m,disabled:o,children:/* @__PURE__ */Re(Bn,{id:f,value:e,onChange:t,label:r,presets:n,clearable:a,fallback:l,dragWrites:i,disabled:o})}),c&&
|
|
170
|
-
/* @__PURE__ */Re("div",{className:"w-24 flex-none",children:/* @__PURE__ */Re(In,{value:e,placeholder:!e&&b?$n(b):void 0,onChange:r=>{o||r===e||t(r)},label:g.hex(r),disabled:o,size:d})})]})}var Rn={background:"color-mix(in srgb, var(--status-on-solid) 45%, transparent)"},Wn={borderColor:"var(--status-on-solid)",boxShadow:"0 0 0 1px var(--rosh-media-scrim-button), 0 1px 4px var(--rosh-media-scrim-button)"};function Kn({value:e,onChange:t,label:r,image:n,hint:a,emptyText:l,actions:i,disabled:o=!1,id:s,className:c=""}){const d=ae().imageFocus,u=Me(),h=Se(null),m=Se(!1),{x:p,y:g}=ue(e),f=he(p,g),b=r=>{r!==e&&t(r)},y=(e,t)=>{const r=h.current?.getBoundingClientRect();if(!r)return;const n=pe(r,e,t);b(he(n.x,n.y))},x=()=>{m.current=!1};if(!n)/* @__PURE__ */
|
|
171
|
-
return Re("div",{"data-image-focus":"",className:c||void 0,children:/* @__PURE__ */Re("p",{className:"text-xs text-gray-500",children:l??d.noImage})});const v=void 0===a,w=null!==a;/* @__PURE__ */
|
|
172
|
-
return We("div",{"data-image-focus":"",className:`flex flex-col gap-2 ${c}`.trim(),children:[
|
|
173
|
-
/* @__PURE__ */Re("button",{id:s,type:"button","data-image-focus-picture":"",disabled:o,"aria-label":d.picture(r,f),"aria-describedby":u,onKeyDown:t=>{if(o||t.altKey||t.ctrlKey||t.metaKey)return;const r=me(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__ */We("span",{ref:h,"data-image-focus-pane":"",className:"relative block max-w-full",children:[
|
|
174
|
-
/* @__PURE__ */Re("img",{src:n,alt:"",draggable:!1,className:"block h-auto max-h-36 w-auto max-w-full select-none object-contain"}),
|
|
175
|
-
/* @__PURE__ */Re("span",{"aria-hidden":"true","data-image-focus-cross":"h",className:"pointer-events-none absolute inset-x-0 h-px",style:{top:`${g}%`,...Rn}}),
|
|
176
|
-
/* @__PURE__ */Re("span",{"aria-hidden":"true","data-image-focus-cross":"v",className:"pointer-events-none absolute inset-y-0 w-px",style:{left:`${p}%`,...Rn}}),
|
|
177
|
-
/* @__PURE__ */Re("span",{"aria-hidden":"true","data-image-focus-dot":"",className:"pointer-events-none absolute h-4 w-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2",style:{left:`${p}%`,top:`${g}%`,...Wn}})]})}),w||i?/* @__PURE__ */We("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */Re("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__ */Re("span",{id:u,className:"sr-only",children:d.hint})]})}function _n({onClear:e,ariaLabel:t}){/* @__PURE__ */
|
|
178
|
-
return Re("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 qn(e){const{options:t,placeholder:r,emptyOptionLabel:n,className:a="",disabled:o,id:s,filter:c=!1,allowFreeText:d=!1,freeTextOption:u,onSearchChange:h,loading:m=!1,error:p,onRetry:g,rightAdornment:f,renderOption:b,clearable:N=!0,"aria-label":k,"aria-labelledby":$,"aria-describedby":M}=e,C=!0===e.multiple,L=e.multiple?e.value:e.value?[e.value]:[],S=e.multiple?"":e.value,D=t=>{e.multiple?e.onChange(t):e.onChange(t[0]??"")},P=L.length>0,A=c&&P&&!o,j=C||c,z=null!=u,F=d||z,[T,E]=Le(!1),[B,I]=Le(-1),O=Me(),R=s??`${O}-input`,W=`${O}-listbox`,K=e=>`${O}-opt-${e}`,[G,X]=Le(""),Z=ae(),J=n??Z.select.none,Q=e=>{X(e),I(-1),h?.(e)},ee=Se(null),te=Se(null),re=Se(null),ne=Se(null),le=Se(T);le.current=T;const ie=Se(!1),oe=e=>{le.current&&(le.current=!1,e&&d&&!z&&Fe&&(C?L.includes(Fe)||D([...L,Fe]):Fe!==S&&D([Fe])),E(!1),Q(""))},se=(e,t)=>{if(!e.disabled){if(C)return D(L.includes(e.value)?L.filter(t=>t!==e.value):[...L,e.value]),void(e===Te?Q(""):I(t));D([e.value]),oe(!1)}},[ce,de]=Le(null);Y(()=>{if(!f||T)return void de(null);const e=ne.current?.offsetWidth??0;de(e?e+(fe?32:8)+6:null)});const ue=y(te,T,j?{popupRef:re}:{matchTriggerWidth:!0}),he=De(()=>Je(t),[t]),me=L.join("\0"),pe=De(()=>{const e=[],t=/* @__PURE__ */new Set;for(const r of he)L.includes(r.value)&&!t.has(r.value)&&(t.add(r.value),e.push(r.label));if(F)for(const r of L)t.has(r)||e.push(r);return e},[he,me,F]),ge=pe.join(", "),fe=N&&P&&!o,[be,ye]=Le(null),xe=Se(null),ve=Se(""),we=Se(()=>{});we.current=()=>{const e=te.current,t=xe.current;if(!C||!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}|${pe.join("\0")}`;if(l===ve.current)return;ve.current=l;let i=null;n>0&&pe.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}}(pe,e=>(t.textContent=e,t.getBoundingClientRect().width<=n)),t.textContent=""),ye(e=>e?.shown===i?.shown&&e?.cut===i?.cut?e:i)},Y(()=>{we.current()}),Pe(()=>{const e=te.current;if(!C||!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>we.current());return t.observe(e),()=>t.disconnect()},[C]);const Ne=pe.length,ke=!C||!be||be.shown>=Ne?ge:0===be.shown?Z.select.selectedCount(Ne):`${pe.slice(0,be.shown).join(", ")} +${Ne-be.shown}`,$e=C&&null!==be&&(be.shown<Ne||be.cut),Ce=T&&P&&j;Pe(()=>{if(!T)return;const e=e=>{const t=e.target;ee.current?.contains(t)||re.current?.contains(t)||oe(!0)};document.addEventListener("mousedown",e);const t=U(()=>oe(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[T,d,G,me,e.onChange]),Pe(()=>{if(T)return H(e=>!("Escape"!==e.key||!le.current)&&(oe(!1),te.current?.blur(),!0),()=>re.current)},[T]);const Ae=De(()=>{const e=/* @__PURE__ */new Set;return Qe(t,t=>!e.has(t.value)&&(e.add(t.value),!0))},[t]),je=De(()=>{if(h)return Ae;const e=G.trim().toLowerCase();return e?Qe(Ae,t=>rt(t,e)):Ae},[Ae,G,h]),ze=De(()=>Je(je),[je]),Fe=G.trim(),Te=De(()=>z&&Fe?he.some(e=>e.label===Fe)||L.includes(Fe)?null:{value:Fe,label:Fe}:null,[z,Fe,he,me]),Ee=De(()=>Te?[...ze,Te]:ze,[ze,Te]);/* @__PURE__ */
|
|
179
|
-
return We("div",{ref:ee,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(ee.current?.contains(t)||re.current?.contains(t))||ie.current||document.activeElement!==te.current&&oe(!0)},children:[(Be=/* @__PURE__ */Re("input",{id:R,ref:te,type:"text",autoComplete:"off",role:"combobox","aria-expanded":T,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":T?W:void 0,"aria-activedescendant":T&&B>=0&&B<Ee.length?K(B):void 0,"aria-label":$?void 0:k,"aria-labelledby":$,"aria-describedby":M,value:T?G:ke,onChange:e=>{Q(e.target.value),E(!0)},onFocus:()=>{o||(Q(""),E(!0))},onKeyDown:e=>{if("ArrowDown"===e.key||"ArrowUp"===e.key){if(o)return;if(e.preventDefault(),!T)return void E(!0);if(0===Ee.length)return;const t="ArrowDown"===e.key?1:-1;return void I(e=>Ge(Ee,e,t))}"Enter"===e.key?(e.preventDefault(),T&&B>=0&&B<Ee.length?se(Ee[B],B):1!==ze.length||ze[0].disabled?d&&!z&&Fe&&(C?(L.includes(Fe)||D([...L,Fe]),Q("")):(D([Fe]),oe(!1),te.current?.blur())):se(ze[0],0)):"Escape"===e.key?(oe(!1),te.current?.blur()):"Tab"===e.key&&oe(!0)},placeholder:Ce?ke:r||J,className:`${A?l:i} ${a} ${fe?"pr-8":""} ${o?"bg-gray-50 text-gray-400 cursor-not-allowed":""} truncate${Ce?" rosh-field-shows-choice":""}`,style:ce?{paddingRight:ce}:void 0,disabled:o}),C?/* @__PURE__ */Re(w,{content:!T&&$e?ge:null,className:"block",children:Be}):Be),C&&
|
|
180
|
-
/* @__PURE__ */Re("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */Re("span",{ref:xe,className:"whitespace-pre"})}),fe&&/* @__PURE__ */Re(_n,{ariaLabel:Z.select.clear,onClear:()=>{D([]),oe(!1)}}),f&&!T&&/* @__PURE__ */Re("div",{ref:ne,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:f}),T&&_e(
|
|
181
|
-
/* @__PURE__ */We("div",{ref:re,onMouseDownCapture:()=>{ie.current=!0,setTimeout(()=>{ie.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:V.popup,left:ue?.left,right:ue?.right,top:ue?.top,bottom:ue?.bottom,minWidth:ue?.minWidth,width:ue?.width,...j&&{maxWidth:ue?.maxWidth},visibility:ue?void 0:"hidden",..._()},children:[C&&P&&N&&!o&&
|
|
182
|
-
/* @__PURE__ */Re("button",{type:"button",tabIndex:-1,onMouseDown:e=>{e.preventDefault(),D([])},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 ${q}`,children:Z.select.clearAll}),m?
|
|
183
|
-
/* @__PURE__ */Re("p",{role:"status",className:"px-3 py-2 text-sm text-gray-500",children:Z.search.searching}):p?/* @__PURE__ */We("div",{role:"alert",className:"flex items-center gap-2 px-3 py-2 text-sm text-red-600",children:[
|
|
184
|
-
/* @__PURE__ */Re("span",{className:"min-w-0 flex-1",children:p}),g&&/* @__PURE__ */Re(v,{variant:"link",size:"sm",onMouseDown:e=>e.preventDefault(),onClick:g,className:"shrink-0",children:Z.list.retry})]}):null,
|
|
185
|
-
/* @__PURE__ */We("div",{id:W,role:Ee.length?"listbox":void 0,"aria-labelledby":Ee.length?$??(k?void 0:R):void 0,"aria-label":Ee.length&&!$?k:void 0,"aria-multiselectable":!(!Ee.length||!C)||void 0,className:"overflow-y-auto",style:{maxHeight:ue?.maxHeight??x},children:[0===Ee.length?m||p?null:/* @__PURE__ */Re("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:Z.select.noMatches}):0===ze.length?null:et(je,(e,t)=>{const r=L.includes(e.value);/* @__PURE__ */
|
|
186
|
-
return We("button",{id:K(t),type:"button",role:"option","aria-selected":r,"aria-disabled":e.disabled||void 0,tabIndex:-1,onMouseDown:r=>{(e.disabled||C)&&r.preventDefault(),se(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===B?"bg-gray-100":r?"bg-blue-50/50":""}`),children:[C&&/* @__PURE__ */Re(tt,{selected:r}),
|
|
187
|
-
/* @__PURE__ */Re("span",{className:`min-w-0 ${j?"flex-auto":"flex-1"} truncate`,children:b?b(e,{selected:r,active:t===B}):e.label}),e.sublabel&&/* @__PURE__ */Re(nt,{grows:j,children:e.sublabel})]},e.value)},O),Te&&u&&
|
|
188
|
-
/* @__PURE__ */Re("button",{id:K(ze.length),type:"button",role:"option","aria-selected":!1,tabIndex:-1,onMouseDown:e=>{C&&e.preventDefault(),se(Te,ze.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 ${ze.length?`border-t ${q}`:""} ${B===ze.length?"bg-gray-100":""}`,children:/* @__PURE__ */Re("span",{className:"min-w-0 flex-1 truncate",children:u(Te.value)})},`${O}-typed`)]})]}),document.body)]});var Be}function Hn(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var Un="address",Vn={kindOf:()=>Un,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},Yn=e=>s(e.trim());function Gn(e){const{value:t,kinds:r,rules:n=Vn,filtersFor:a,label:l,readOnly:i,placeholder:o,className:s=""}=e,c=void 0!==e.onApply,d=ae().link,u=n.isSafe??Yn,h=Me(),m=Se(null),p=Se(null),[g,f]=Le({url:t}),b=c?g.url:t,[y,x]=Le(!1),[w,N]=Le(null),[k,$]=Le(null),M=Se(()=>{});M.current=c?e.onCancel:()=>{},Pe(()=>{if(c)return H(e=>{const t=m.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(M.current(),!0)},()=>m.current)},[c]),Pe(()=>{if(!c)return;const e=p.current;e?(e.focus(),e.select()):m.current?.querySelector("button, input")?.focus()},[]);const C=r??[{value:Un,label:d.address,target:{type:"text"}}],L=w&&w.against===b?w.kind:n.kindOf(b),S=C.filter(e=>!e.hideWhenEmpty||Hn(e.target).length>0||e.value===L),D=S.find(e=>"text"===e.target.type),P=S.find(e=>e.value===L)??D??S[0];if(!P)return null;const A="text"!==P.target.type,j=A?n.targetOf(b):b,z=Hn(P.target),F=z.find(e=>e.value===j),T=e=>({value:e,label:d.unavailable(e)}),E="select"===P.target.type&&j&&a?a(j):null,B=E?n.readFilter(b):null,I=B?E?.find(e=>e.param===B.param):void 0,O=k&&k.against===b?k.text:b,R=!A&&""!==O.trim()&&!u(O),W=R&&(!c||y),K=(t,r)=>{c?f({url:t,name:r}):void 0===r?e.onChange(t):e.onChange(t,r)},_=(e,t)=>{N(t=>t?{...t,against:e}:t),K(e,t)},q=e=>{if(!e)return _("");const t=z.find(t=>t.value===e);_(e,t?.label)},U=A?b:O.trim(),V=()=>{if(!c||!U)return;if(!A&&R)return void x(!0);const t=A&&g.url===U?g.name:void 0,r=e.onApply;void 0===t?r(U):r(U,t)},Y=(e,t)=>t&&!e.some(e=>e.value===t)?[T(t),...e]:[...e],G=(e,t,r,n,a)=>{const l=[];for(const e of r){const t=l[l.length-1],r={value:e.value,label:e.label};e.group?t&&"options"in t&&t.label===e.group?t.options.push(r):l.push({label:e.group,options:[r]}):l.push(r)}if(a){const a=r.some(e=>""===e.value);/* @__PURE__ */
|
|
189
|
-
return Re(qn,{"aria-label":e,value:t,options:l,disabled:i,clearable:a,placeholder:r.find(e=>""===e.value)?.label,onChange:n})}/* @__PURE__ */
|
|
190
|
-
return Re(ot,{size:"sm","aria-label":e,value:t,options:l,readOnly:i,onChange:n})};let X;if("text"===P.target.type)X=/* @__PURE__ */Re(He,{ref:p,id:`${h}-address`,size:"sm",type:"text",invalid:W,"aria-label":d.address,"aria-describedby":W?`${h}-why`:void 0,placeholder:o??d.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:O,readOnly:i,onChange:e=>(e=>{x(!1);const t=e.trim();t?u(e)?($({text:e,against:t}),_(t)):$({text:e,against:b}):($({text:e,against:""}),_(""))})(e.target.value)});else{const e="groups"===P.target.type?P.target.groups.flatMap(e=>e.options.map(t=>({value:t.value,label:t.label,group:e.label}))):P.target.options.map(e=>({value:e.value,label:e.label})),t=[{value:"",label:P.target.placeholder},...Y(e,j)];X=G(P.label,j,t,q,e.length>10)}const Z=/* @__PURE__ */We(Ke,{children:[r&&G(d.linkType,P.value,S.map(e=>({value:e.value,label:e.label})),e=>{$(null),x(!1);const t=S.find(t=>t.value===e);if(!t||"text"===t.target.type)return void N({kind:e,against:b});const r=Hn(t.target)[0];N({kind:e,against:r?r.value:""}),r?K(r.value,r.label):K("")},!1),X,E&&G(d.filter,B?.param??"",[{value:"",label:d.noFilter},...B&&!I?[T(B.param)]:[],...E.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return _(j,F?.label);const t=E?.find(t=>t.param===e),r=t?.values[0];r&&_(n.withFilter(j,{param:e,value:r.value}),r.label)},!1),E&&B&&G(d.value,B.value,Y((I?.values??[]).map(e=>({value:e.value,label:e.label})),B.value),e=>{if(!B)return;const t=I?.values.find(t=>t.value===e);_(n.withFilter(j,{param:B.param,value:e}),t?.label)},(I?.values.length??0)>10),W&&/* @__PURE__ */Re("p",{id:`${h}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:d.unsafe}),P.hint&&/* @__PURE__ */Re("p",{className:"text-2xs leading-4 text-gray-400",children:P.hint}),E&&/* @__PURE__ */Re("p",{className:"text-2xs leading-4 text-gray-400",children:d.filterHint})]});if(!c)/* @__PURE__ */
|
|
191
|
-
return Re("div",{ref:m,className:`flex min-w-0 flex-auto flex-col gap-2 ${s}`.trim(),role:l?"group":void 0,"aria-label":l,children:Z});const J=e.onRemove;/* @__PURE__ */
|
|
192
|
-
return We("div",{ref:m,role:"dialog","aria-label":l??d.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${s}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),V())},children:[A?/* @__PURE__ */Re("span",{className:bt({inline:!0}),children:d.title}):/* @__PURE__ */Re("label",{htmlFor:`${h}-address`,className:bt({inline:!0}),children:d.title}),Z,
|
|
193
|
-
/* @__PURE__ */We("div",{className:"flex items-center justify-between gap-2",children:[J?/* @__PURE__ */Re(v,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onClick:J,children:d.remove}):null,
|
|
194
|
-
/* @__PURE__ */We("span",{className:"ml-auto flex gap-1",children:[
|
|
195
|
-
/* @__PURE__ */Re(v,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>M.current(),children:d.cancel}),
|
|
196
|
-
/* @__PURE__ */Re(v,{variant:"primary",size:"sm","data-window-action":"apply",onClick:V,disabled:i||""===U,children:d.apply})]})]})]})}function Xn({label:e,text:t,onTextChange:r,link:n,onLinkChange:a,kinds:l,rules:i,filtersFor:s,textPlaceholder:c,readOnly:d,className:u=""}){const h=ae().link,[m,p]=Le(!1),g=Se(null),f=Me(),b=()=>{p(!1),g.current?.focus()};/* @__PURE__ */
|
|
197
|
-
return We("div",{className:`flex min-w-0 flex-auto flex-col ${u}`.trim(),children:[
|
|
198
|
-
/* @__PURE__ */Re(He,{size:"sm",type:"text",className:"rounded-b-none","aria-label":h.text(e),placeholder:c,value:t,readOnly:d,onChange:e=>r(e.target.value)}),
|
|
199
|
-
/* @__PURE__ */We("button",{ref:g,type:"button","aria-label":h.linkOf(e,n),"aria-expanded":m,"aria-controls":m?f:void 0,disabled:d,onClick:()=>p(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 ${o.sm} text-left hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60`,children:[
|
|
200
|
-
/* @__PURE__ */Re(Ne,{name:"link",strokeWidth:1.5,className:"h-4 w-4 shrink-0 "+(n?"text-blue-600":"text-gray-400")}),
|
|
201
|
-
/* @__PURE__ */Re("span",{className:"min-w-0 truncate "+(n?"text-blue-600":"text-gray-400"),children:n||h.addLink})]}),m&&/* @__PURE__ */Re("div",{id:f,className:"mt-2",children:/* @__PURE__ */Re(Gn,{value:n,label:h.linkOf(e,n),kinds:l,rules:i,filtersFor:s,onApply:(e,t)=>{void 0===t?a(e):a(e,t),b()},onRemove:n?()=>{a(""),b()}:void 0,onCancel:b})})]})}var Zn={tl:"",tr:"rotate-90",br:"rotate-180",bl:"-rotate-90"};function Jn({label:e,value:t,corners:r,onChange:n,radius:a=null,onRadiusChange:l,radiusLabel:i,radiusMin:o=0,radiusMax:s,radiusStep:c=1,radiusPlaceholder:d,disabled:u=!1,disabledReason:h,id:m,className:p=""}){const g=ae();/* @__PURE__ */
|
|
202
|
-
return We("div",{id:m,role:"group","aria-label":e,className:`flex min-w-0 flex-wrap items-center gap-2 ${p}`.trim(),children:[l&&
|
|
203
|
-
/* @__PURE__ */Re("div",{className:"min-w-30 flex-1",children:/* @__PURE__ */Re(Gr,{value:a,onChange:l,min:o,max:s,step:c,precision:0,placeholder:d,prefix:/* @__PURE__ */Re("span",{"data-radius-mark":"","aria-hidden":"true",children:g.corners.radiusMark}),suffix:g.corners.unit,steppers:"compact",disabled:u,"aria-label":i??g.corners.radius})}),
|
|
204
|
-
/* @__PURE__ */Re("div",{className:"flex shrink-0 items-center gap-1",children:r.map(e=>{const r=t.includes(e.value),a=u||!0===e.disabled,l=a&&(!0===e.disabled&&e.title||(u?h:void 0))||void 0,i=/* @__PURE__ */Re(qe,{"aria-pressed":r,"aria-label":e.label,"aria-disabled":a||void 0,disabledReason:l,"data-corner":e.value,onClick:()=>{a||n(r?t.filter(t=>t!==e.value):[...t,e.value])},children:/* @__PURE__ */Re(Ne,{name:"corner",strokeWidth:2,className:["h-4 w-4",Zn[e.value]??""].filter(Boolean).join(" ")})},e.value);return l?i:/* @__PURE__ */Re(w,{content:e.title??e.label,children:i},e.value)})})]})}var Qn={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]};function ea({label:e,value:t,points:r,onChange:n,disabled:a=!1,disabledReason:l,id:i,className:o=""}){const s=Me(),c=Se([]),d=r.findIndex(e=>e.value===t),u=r.findIndex(e=>!a&&!0!==e.disabled),h=d>=0?d:Math.max(0,u);/* @__PURE__ */
|
|
205
|
-
return Re("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__ */Re("button",{type:"button",role:"radio","aria-checked":o,"aria-label":e.label,"aria-disabled":d||void 0,"aria-describedby":f(void 0,u?m:void 0),ref:e=>{c.current[i]=e},tabIndex:i===h?0:-1,onKeyDown:e=>((e,l)=>{const i=Qn[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?g:()=>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__ */Re("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__ */Re("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__ */Re(b,{reason:u,id:m,block:!0,children:p},e.value):/* @__PURE__ */Re(w,{content:e.title??e.label,className:"relative flex",children:p},e.value)})})}var ta=$e(function({files:e,onChange:t,accept:r,acceptHint:n,multiple:a=!0,maxSizeBytes:l,maxFiles:i,disabled:o=!1,label:s,hint:c,error:d,required:u,className:h=""},m){const p=Me(),g=ae().files,f=ee({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__ */
|
|
206
|
-
return We(ht,{label:s,htmlFor:p,hint:c,error:d,required:u,className:h,children:[
|
|
207
|
-
/* @__PURE__ */We("button",{ref:m,type:"button",id:p,disabled:o,onClick:f.open,"aria-invalid":!!d||void 0,"aria-required":u||void 0,"aria-describedby":b,...f.zoneProps,className:kt(f.dragOver,o,`px-4 py-6 ${$t(o)}`),children:[
|
|
208
|
-
/* @__PURE__ */We("span",{children:[
|
|
209
|
-
/* @__PURE__ */Re("span",{className:"text-sm font-medium text-blue-600",children:a?g.chooseMany:g.chooseOne}),
|
|
210
|
-
/* @__PURE__ */Re("span",{className:"text-sm text-gray-500",children:` ${a?g.dragMany:g.dragOne}`})]}),n&&/* @__PURE__ */Re("span",{className:"text-xs text-gray-400",children:n})]}),
|
|
211
|
-
/* @__PURE__ */Re("input",{...f.inputProps}),e.length>0&&/* @__PURE__ */Re("ul",{className:"mt-2 flex flex-col gap-1",children:e.map((r,n)=>/* @__PURE__ */We("li",{className:"flex items-center justify-between gap-3 rounded-md bg-gray-50 px-3 py-2",children:[
|
|
212
|
-
/* @__PURE__ */Re("span",{className:"min-w-0 flex-1 truncate text-sm text-gray-800",title:r.name,children:r.name}),
|
|
213
|
-
/* @__PURE__ */Re("span",{className:"shrink-0 text-xs tabular-nums text-gray-500",children:te(r.size,g)}),
|
|
214
|
-
/* @__PURE__ */Re("button",{type:"button",disabled:o,onClick:()=>{f.clearRejections(),t(e.filter((e,t)=>t!==n))},"aria-label":g.remove(r.name),className:"shrink-0 text-gray-400 hover:text-gray-600",children:/* @__PURE__ */Re(Dt,{})})]},`${r.name}-${n}`))}),
|
|
215
|
-
/* @__PURE__ */Re(re,{rejections:f.rejections})]})});function ra({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
216
|
-
return Re(Ne,{name:"attach",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function na({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
217
|
-
return Re(Ne,{name:"page",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function aa({intake:e,dropLabel:t,className:r="",children:n}){const a=ae().files;/* @__PURE__ */
|
|
218
|
-
return We("div",{...e.zoneProps,...e.pasteProps,className:`relative ${r}`,children:[n,
|
|
219
|
-
/* @__PURE__ */Re("input",{...e.inputProps}),e.dragOver&&/* @__PURE__ */Re("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 la({files:e,onRemove:t,disabled:r=!1,className:n=""}){const a=ae().files,l=Se(/* @__PURE__ */new Map);Pe(()=>{const t=new Set(e);for(const[e,r]of l.current)t.has(e)||(URL.revokeObjectURL(r),l.current.delete(e))},[e]),Pe(()=>()=>{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__ */Re("ul",{className:`flex flex-wrap gap-2 ${n}`,children:e.map((e,n)=>{const l=i(e);/* @__PURE__ */
|
|
220
|
-
return We("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__ */Re("img",{src:l,alt:"",className:"h-6 w-6 shrink-0 rounded object-cover"}):/* @__PURE__ */Re("span",{className:"text-gray-400",children:/* @__PURE__ */Re(na,{})}),
|
|
221
|
-
/* @__PURE__ */Re("span",{className:"min-w-0 truncate",title:e.name,children:e.name}),
|
|
222
|
-
/* @__PURE__ */Re("span",{className:"shrink-0 tabular-nums text-gray-400",children:te(e.size,a)}),t&&/* @__PURE__ */Re("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__ */Re(Dt,{className:"h-3.5 w-3.5"})})]},`${e.name}-${e.size}-${n}`)})})}function ia({onClick:e,count:t=0,variant:r="button",label:n,disabled:a=!1}){const l=ae().files,i=n??l.attach,o=t>0?`${i} (${t})`:i;return"icon"===r?/* @__PURE__ */We("span",{className:"relative inline-flex",children:[
|
|
223
|
-
/* @__PURE__ */Re(qe,{"aria-label":o,onClick:e,disabled:a,size:"sm",children:/* @__PURE__ */Re(ra,{})}),t>0&&/* @__PURE__ */Re("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__ */Re(v,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:a,leftIcon:/* @__PURE__ */Re(ra,{}),children:o})}function oa({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=ee({accept:r,maxSizeBytes:n,maxFiles:a,acceptHint:l,disabled:i,multiple:!0,currentCount:e.length,onAccept:r=>t([...e,...r])}),g=Se([]);return Pe(()=>{u&&p.rejections.length>0&&p.rejections!==g.current&&(g.current=p.rejections,u(p.rejections))},[p.rejections,u]),/* @__PURE__ */We(aa,{intake:p,dropLabel:o,className:h,children:[m,
|
|
224
|
-
/* @__PURE__ */Re(la,{files:e,disabled:i,onRemove:r=>{p.clearRejections(),t(e.filter((e,t)=>t!==r))},className:"mt-2"}),
|
|
225
|
-
/* @__PURE__ */We("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[
|
|
226
|
-
/* @__PURE__ */Re(ia,{onClick:p.open,count:e.length,variant:c,label:s,disabled:i}),d]}),
|
|
227
|
-
/* @__PURE__ */Re(re,{rejections:p.rejections})]})}var sa={success:"bg-[var(--status-success-soft)] text-[color:var(--status-success-soft-ink)]",active:"bg-[var(--status-active-soft)] text-[color:var(--status-active-soft-ink)]",queued:"bg-[var(--status-queued-soft)] text-[color:var(--status-queued-soft-ink)]",info:"bg-[var(--status-info-soft)] text-[color:var(--status-info-soft-ink)]",pending:"bg-[var(--status-pending-soft)] text-[color:var(--status-pending-soft-ink)]",warning:"bg-[var(--status-warning-soft)] text-[color:var(--status-warning-soft-ink)]",danger:"bg-[var(--status-danger-soft)] text-[color:var(--status-danger-soft-ink)]",draft:"bg-[var(--status-draft-soft)] text-[color:var(--status-draft-soft-ink)]",neutral:"bg-[var(--status-neutral-soft)] text-[color:var(--status-neutral-soft-ink)]"},ca={success:"bg-[var(--status-success-solid)] text-[color:var(--status-on-solid)]",active:"bg-[var(--status-active-solid)] text-[color:var(--status-on-solid)]",queued:"bg-[var(--status-queued-solid)] text-[color:var(--status-on-solid)]",info:"bg-[var(--status-info-solid)] text-[color:var(--status-on-solid)]",pending:"bg-[var(--status-pending-solid)] text-[color:var(--status-on-solid)]",warning:"bg-[var(--status-warning-solid)] text-[color:var(--status-on-solid)]",danger:"bg-[var(--status-danger-solid)] text-[color:var(--status-on-solid)]",draft:"bg-[var(--status-draft-solid)] text-[color:var(--status-on-solid)]",neutral:"bg-[var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function da(e,t="subtle"){return"solid"===t?ca[e]:sa[e]}var ua=Ae({}),ha=Ae(void 0);function ma(e){return e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function pa({groups:e,labelFor:t,children:r}){/* @__PURE__ */
|
|
228
|
-
return Re(ua.Provider,{value:e,children:/* @__PURE__ */Re(ha.Provider,{value:t,children:r})})}function ga(){const e=Te(ha);return Ce(t=>e?.(t)??ma(t),[e])}function fa({status:e,label:t,emphasis:r="subtle"}){const n=da(Te(ua)[e]??"neutral",r),a=Te(ha),l=t??a?.(e)??ma(e);/* @__PURE__ */
|
|
229
|
-
return Re("span",{className:`inline-flex items-center rounded-full px-3 py-0.5 text-xs font-medium ${n}`,children:l})}var ba={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 ${sa.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 ya({value:e,onChange:t,options:r=[],placeholder:a,allowFreeText:l=!1,invalid:i,disabled:o,id:s,className:c="",tone:d,tooltip:u,split:h}){const[m,p]=Le(!1),[g,f]=Le(""),b=ae(),v=Se(null),N=Se(null),k=Se(null),$=y(v,m),M=e=>r.find(t=>t.value===e)?.label??e,L=De(()=>{const t=new Set(e),n=[],a=g.trim().toLowerCase();for(const e of r)t.has(e.value)||(t.add(e.value),a&&!rt(e,a)||n.push(e));return n},[r,e,g]),S=n=>{const a=[...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??(l?t:null);o&&!a.includes(o)&&a.push(o)}a.length!==e.length&&t(a)},D=r=>{r&&!e.includes(r)?(t([...e,r]),f("")):f("")},P=r=>t(e.filter(e=>e!==r)),A=()=>{const e=g.trim();if(h&&e)return S(e.split(h)),void f("");l&&e?D(e):f("")},j=Se(()=>{});j.current=()=>{A(),p(!1)},Pe(()=>{if(!m)return;const e=e=>{const t=e.target;v.current?.contains(t)||k.current?.contains(t)||(A(),p(!1))};document.addEventListener("mousedown",e);const t=U(()=>j.current());return()=>{document.removeEventListener("mousedown",e),t()}});const z=r.length>0;/* @__PURE__ */
|
|
230
|
-
return We("div",{ref:v,className:"relative",children:[
|
|
231
|
-
/* @__PURE__ */We("div",{onMouseDown:e=>{o||e.target.closest("button")||(e.preventDefault(),N.current?.focus())},className:n({invalid:i,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)] ${o?"bg-gray-50 cursor-not-allowed":""} ${c}`}),children:[e.map(e=>{const t=d?.(e),r=ba[t??"accent"],n=/* @__PURE__ */We("span",{"data-tone":t,className:r.chip,children:[
|
|
232
|
-
/* @__PURE__ */Re("span",{className:"truncate",children:M(e)}),!o&&/* @__PURE__ */Re("button",{type:"button","aria-label":b.select.removeItem?.(M(e))??`${b.select.remove} ${M(e)}`,onClick:()=>P(e),className:r.remove,children:"×"})]},e),a=u?.(e);return null==a?n:/* @__PURE__ */Re(w,{content:a,className:"relative inline-flex max-w-full",children:n},e)}),
|
|
233
|
-
/* @__PURE__ */Re("input",{id:s,ref:N,type:"text",autoComplete:"off",role:"combobox","aria-expanded":m&&z,"aria-invalid":i||void 0,disabled:o,value:g,placeholder:0===e.length?a:void 0,onChange:e=>{(e=>{if(h){const t=e.split(h);if(t.length>1)return S(t.slice(0,-1)),void f(t[t.length-1])}f(e)})(e.target.value),p(!0)},onFocus:()=>{!o&&z&&p(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&l){t.preventDefault();const e=g.trim(),r=e?L.filter(t=>rt(t,e.toLowerCase())):[];1===r.length?D(r[0].value):A()}else"Backspace"===t.key&&""===g&&e.length>0?P(e[e.length-1]):"Escape"===t.key?(p(!1),f(""),N.current?.blur()):"Tab"===t.key&&(A(),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&&z&&_e(
|
|
234
|
-
/* @__PURE__ */Re("div",{ref:k,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:V.popup,left:$?.left,right:$?.right,top:$?.top,bottom:$?.bottom,minWidth:$?.minWidth,maxWidth:$?.maxWidth??C,width:"max-content",visibility:$?void 0:"hidden",..._()},children:/* @__PURE__ */Re("div",{className:"overflow-y-auto",style:{maxHeight:$?.maxHeight??x},children:0===L.length?/* @__PURE__ */Re("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}):L.map(e=>/* @__PURE__ */Re("button",{type:"button",onMouseDown:t=>{t.preventDefault(),D(e.value)},className:e.sublabel?"w-full text-left px-3 min-h-(--row-height-menu) py-2 text-sm hover:bg-gray-50 text-gray-700 whitespace-nowrap flex items-center justify-between gap-3":"w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm hover:bg-gray-50 text-gray-700 whitespace-nowrap",children:e.sublabel?/* @__PURE__ */We(Ke,{children:[
|
|
235
|
-
/* @__PURE__ */Re("span",{className:"min-w-0 truncate",children:e.label}),
|
|
236
|
-
/* @__PURE__ */Re(nt,{grows:!0,children:e.sublabel})]}):e.label},e.value))})}),document.body)]})}var xa={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"}},va={neutral:"border-gray-200",warning:"border-amber-300",current:"border-gray-200"};function wa({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=xa[l??(a?"md":"none")],p=Me(),g=Me(),f=null!=t&&null!=r&&""!==r,b=null!=i&&null!=t,y=`h${i}`,x=null!=s&&""!==s,v=b||x,w=v?"section":"div",N=`rounded-(--radius-card) border ${va[h]} bg-white shadow-sm ${c}`.trim(),k=je.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 ":"",S=`${$}${L}${m.edge} ${C}`;/* @__PURE__ */
|
|
237
|
-
return We(w,{className:N,style:u,...x?{"aria-label":s}:b?{"aria-labelledby":p}:{},...f&&v?{"aria-describedby":g}:{},...M?{"aria-current":!0}:{},children:[f?
|
|
238
|
-
/* @__PURE__ */We("div",{className:`${$}${L}${m.edge}`,children:[null!=o?/* @__PURE__ */We("div",{className:`flex items-center justify-between gap-3 ${C}`,children:[b?/* @__PURE__ */Re(y,{id:p,children:t}):/* @__PURE__ */Re("span",{children:t}),o]}):b?/* @__PURE__ */Re(y,{id:p,className:C,children:t}):/* @__PURE__ */Re("div",{className:C,children:t}),
|
|
239
|
-
/* @__PURE__ */Re("p",{id:g,className:M?"mt-0.5 text-xs text-gray-600":"mt-0.5 text-xs text-gray-500",children:r})]}):null!=t&&(null!=o?
|
|
240
|
-
/* @__PURE__ */We("div",{className:`${S} flex items-center justify-between gap-3`,children:[b?/* @__PURE__ */Re(y,{id:p,children:t}):/* @__PURE__ */Re("span",{children:t}),o]}):b?
|
|
241
|
-
/* @__PURE__ */Re(y,{id:p,className:S,children:t}):/* @__PURE__ */Re("div",{className:S,children:t})),k&&/* @__PURE__ */Re("div",{className:[m.body,d].filter(Boolean).join(" "),children:e}),n&&/* @__PURE__ */Re("div",{className:`border-t border-gray-100 ${m.edge}`,children:n})]})}function Na({label:e,value:t,icon:r,delta:n,className:a=""}){const l=ne(),i="number"==typeof t&&l?se(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__ */
|
|
242
|
-
return We("div",{className:`rounded-(--radius-card) border border-gray-200 bg-white p-4 shadow-sm ${a}`.trim(),children:[
|
|
243
|
-
/* @__PURE__ */We("div",{className:"flex items-center justify-between text-gray-500",children:[
|
|
244
|
-
/* @__PURE__ */Re("span",{className:"text-xs font-medium uppercase tracking-wide",children:e}),r]}),
|
|
245
|
-
/* @__PURE__ */We("div",{className:"mt-2 flex items-baseline gap-2",children:[
|
|
246
|
-
/* @__PURE__ */Re("span",{className:"text-2xl font-semibold text-gray-900",children:i}),n&&/* @__PURE__ */We("span",{className:`text-xs font-medium ${o}`,children:[s," ",n.value]})]})]})}var ka={default:"text-gray-900",secondary:"text-gray-500",tertiary:"text-gray-400",disabled:"text-gray-300",danger:"text-red-600",success:"text-green-600",warning:"text-amber-600",link:"text-blue-600",inherit:""},$a={xs:"text-xs",sm:"text-sm",md:"text-base",lg:"text-lg"},Ma={normal:"font-normal",medium:"font-medium",semibold:"font-semibold"};function Ca({children:e,tone:t="default",size:r="sm",weight:n="normal",truncate:a=!1,as:l="span",className:i="",...o}){/* @__PURE__ */
|
|
247
|
-
return Re(l,{className:[ka[t],$a[r],Ma[n],a?"block truncate":"",i].filter(Boolean).join(" "),title:o.title??(a&&"string"==typeof e?e:void 0),htmlFor:o.htmlFor,children:e})}var La={1:"text-2xl font-semibold",2:"text-xl font-semibold",3:"text-lg font-semibold",4:"text-base font-semibold",5:"text-sm font-semibold"};function Sa({children:e,level:t=2,tone:r="default",className:n=""}){/* @__PURE__ */
|
|
248
|
-
return Re(`h${t}`,{className:[La[t],ka[r],n].filter(Boolean).join(" "),children:e})}function Da({children:e,tone:t="secondary",size:r="sm",className:n=""}){/* @__PURE__ */
|
|
249
|
-
return Re("p",{className:[ka[t],$a[r],"mb-2 last:mb-0",n].filter(Boolean).join(" "),children:e})}var Pa={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",6:"gap-6",8:"gap-8"},Aa={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},ja={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around"};function za({children:e,gap:t=4,align:r,justify:n,className:a=""}){/* @__PURE__ */
|
|
250
|
-
return Re("div",{className:["flex flex-col",Pa[t],r?Aa[r]:"",n?ja[n]:"",a].filter(Boolean).join(" "),children:e})}function Fa({children:e,gap:t=2,align:r="center",justify:n,wrap:a=!0,className:l=""}){/* @__PURE__ */
|
|
251
|
-
return Re("div",{className:["flex",a?"flex-wrap":"",Pa[t],Aa[r],n?ja[n]:"",l].filter(Boolean).join(" "),children:e})}var Ta={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",6:"grid-cols-6",12:"grid-cols-12"},Ea={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"},Ba={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 Ia({children:e,cols:t=1,smCols:r,lgCols:n,gap:a=4,className:l=""}){/* @__PURE__ */
|
|
252
|
-
return Re("div",{className:["grid",Ta[t],r?Ea[r]:"",n?Ba[n]:"",Pa[a],l].filter(Boolean).join(" "),children:e})}var Oa={sm:"my-2",md:"my-4",lg:"my-6"};function Ra({orientation:e="horizontal",children:t,align:r="center",spacing:n="md",className:a=""}){const l=Me();if("vertical"===e)/* @__PURE__ */
|
|
253
|
-
return Re("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__ */
|
|
254
|
-
return Re("hr",{className:`border-0 border-t border-gray-200 ${Oa[n]} ${a}`.trim()});const i="left"===r?"w-4 shrink-0":"flex-1",o="right"===r?"w-4 shrink-0":"flex-1";
|
|
255
|
-
/* @__PURE__ */
|
|
256
|
-
return We("div",{role:"separator","aria-orientation":"horizontal","aria-labelledby":l,className:`flex items-center gap-3 ${Oa[n]} ${a}`.trim(),children:[
|
|
257
|
-
/* @__PURE__ */Re("span",{"aria-hidden":"true",className:`${i} border-t border-gray-200`}),
|
|
258
|
-
/* @__PURE__ */Re("span",{id:l,className:"shrink-0 text-xs font-medium text-gray-500",children:t}),
|
|
259
|
-
/* @__PURE__ */Re("span",{"aria-hidden":"true",className:`${o} border-t border-gray-200`})]})}var Wa=[2,4,8,12,16,20,24,32,40,48],Ka={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},_a={sm:24,md:32,lg:40},qa={menu:36,windowBar:44,compactBar:32};function Ha(e){if("0"===e||"px"===e)return!0;const t=Number(e);return!!Number.isFinite(t)&&Wa.includes(4*t)}var Ua=[9,11,12,14,16,18,20,24,30],Va={body:400,control:500,heading:600,figure:700},Ya={fast:120,base:160},Ga={hairline:1,strong:2,accent:4},Xa=["control","card","panel","popup","window"],Za=["none","raised","panel","popup","dialog"],Ja={text:"rounded",rect:"rounded-md",circle:"rounded-full"},Qa=e=>"number"==typeof e?`${e}px`:e;function el({variant:e="text",width:t,height:r,lines:n=1,className:a=""}){const l=`animate-pulse bg-gray-200 ${Ja[e]} ${a}`.trim();if("circle"===e){const e=Qa(r??t)??"2.5rem";/* @__PURE__ */
|
|
260
|
-
return Re("span",{className:`inline-block ${l}`,style:{width:e,height:e},"aria-hidden":"true"})}const i={width:Qa(t)??"100%",height:Qa(r)??("text"===e?"1rem":"4rem")};/* @__PURE__ */
|
|
261
|
-
return Re("span","text"===e&&n>1?{className:"flex flex-col gap-2","aria-hidden":"true",children:Array.from({length:n},(e,t)=>/* @__PURE__ */Re("span",{className:`block ${l}`,style:{...i,width:t===n-1?"60%":i.width}},t))}:{className:`block ${l}`,style:i,"aria-hidden":"true"})}var tl={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3"},rl={1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3"},nl={1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3"},al={1:"col-span-1",2:"col-span-2",3:"col-span-3"};function ll({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__ */
|
|
262
|
-
return We("div",{className:[r?"rounded-lg border border-gray-200 bg-white":"",l].filter(Boolean).join(" "),children:[a&&/* @__PURE__ */Re("div",{className:`${d} ${r?"border-b border-gray-100":""} text-sm font-semibold text-gray-900`.trim(),children:a}),
|
|
263
|
-
/* @__PURE__ */Re("dl",{className:["grid",tl[s],o.sm?rl[o.sm]:"",o.lg?nl[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__ */We("div",{className:[e.span?al[c]:"",r?`${d} border-b border-gray-100 last:border-b-0`:""].filter(Boolean).join(" "),children:[
|
|
264
|
-
/* @__PURE__ */Re("dt",{className:`${u} text-gray-500`,children:e.label}),
|
|
265
|
-
/* @__PURE__ */Re("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 il={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 ol({label:e,value:t,description:r,children:n,controlId:a,unknownText:l="—",quiet:i=!1,size:o="default",divider:s=!0,className:c=""}){const d=il[o],u=void 0!==t||void 0===n,h=null==t||""===t,m=i?"text-gray-500":"text-gray-800",p=h?"text-gray-400":i?"text-gray-500":"text-gray-900",g=`${d.text} font-medium ${m}`,f=[s?"border-t border-gray-100 first:border-t-0":"",d.pad,c].filter(Boolean).join(" ");/* @__PURE__ */
|
|
266
|
-
return We("div",{className:f,children:[
|
|
267
|
-
/* @__PURE__ */We("div",{className:`flex items-center justify-between ${d.gap}`,children:[
|
|
268
|
-
/* @__PURE__ */We("div",{className:"min-w-0 flex-1",children:[a?/* @__PURE__ */Re("label",{htmlFor:a,className:g,children:e}):/* @__PURE__ */Re("span",{className:g,children:e}),r&&/* @__PURE__ */Re("p",{className:"mt-0.5 text-xs text-gray-500",children:r})]}),u&&/* @__PURE__ */Re("div",{className:`shrink-0 ${d.text} ${p}`,children:h?l:t})]}),null!=n&&!1!==n&&/* @__PURE__ */Re("div",{className:`${d.bodyTop} border-t border-gray-100 ${d.bodyPad}`,children:n})]})}var sl={danger:"bg-red-600 text-white",neutral:"bg-gray-600 text-white",accent:"bg-blue-600 text-white"};function cl({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=ne(),c=e>t?`${se(t,s)}+`:se(e,s),d=l?"":i,u=o?/* @__PURE__ */Re("span",r?{className:`block h-2.5 w-2.5 rounded-full ring-2 ring-white ${sl[n]} ${d}`.trim(),"aria-hidden":l?"true":void 0}:{className:`flex h-5 min-w-[1.25rem] items-center justify-center rounded-full px-1 text-xs font-semibold tabular-nums ring-2 ring-white ${sl[n]} ${d}`.trim(),children:c}):null;return l?/* @__PURE__ */We("span",{className:`relative inline-flex ${i}`.trim(),children:[l,u&&/* @__PURE__ */Re("span",{className:"absolute -right-1.5 -top-1.5 flex",children:u})]}):u}var dl={sm:"text-lg",md:"text-2xl",lg:"text-3xl"},ul={default:"text-gray-900",success:"text-green-600",danger:"text-red-600",muted:"text-gray-500"};function hl({title:e,value:t,precision:r,prefix:n,suffix:a,tone:l="default",size:i="md",className:o=""}){const s=ne(),c="number"!=typeof t?t:null!=r?ce(t,r,s):s?se(t,s):t;/* @__PURE__ */
|
|
269
|
-
return We("div",{className:o,children:[e&&/* @__PURE__ */Re("div",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
270
|
-
/* @__PURE__ */We("div",{className:`mt-1 flex items-baseline gap-1 ${ul[l]}`,children:[n&&/* @__PURE__ */Re("span",{className:"text-sm",children:n}),
|
|
271
|
-
/* @__PURE__ */Re("span",{className:`font-semibold tabular-nums ${dl[i]}`,children:c}),a&&/* @__PURE__ */Re("span",{className:"text-sm",children:a})]})]})}var ml={xs:24,sm:32,md:40,lg:56},pl={online:"bg-green-500",offline:"bg-gray-400",busy:"bg-red-500",away:"bg-amber-500"};function gl(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 fl({src:e,name:t,size:r="md",status:n,className:a=""}){const l=ml[r],i=Math.max(8,Math.round(.28*l)),[o,s]=Le(!1);Pe(()=>{s(!1)},[e]);const c=Boolean(e)&&!o;
|
|
272
|
-
/* @__PURE__ */
|
|
273
|
-
return We("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__ */Re("img",{src:e,alt:"",onError:()=>s(!0),className:"h-full w-full rounded-full object-cover"}):/* @__PURE__ */Re("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:gl(t)}),n&&/* @__PURE__ */Re("span",{className:`absolute bottom-0 right-0 rounded-full ring-2 ring-white ${pl[n]}`,style:{width:i,height:i}})]})}function bl({children:e,max:t,size:r="md",className:n=""}){const a=je.toArray(e),l=t?a.slice(0,t):a,i=t?a.length-l.length:0,o=ml[r],s=Math.round(.3*o),c=ne();/* @__PURE__ */
|
|
274
|
-
return We("div",{className:`flex items-center ${n}`.trim(),children:[l.map((e,t)=>/* @__PURE__ */Re("span",{className:"rounded-full ring-2 ring-white",style:{marginLeft:0===t?0:-s},children:e},t)),i>0&&/* @__PURE__ */We("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:["+",se(i,c)]})]})}var yl={info:{box:"bg-blue-50 border-blue-200",icon:"text-blue-600"},success:{box:"bg-green-50 border-green-200",icon:"text-green-600"},warning:{box:"bg-amber-50 border-amber-200",icon:"text-amber-600"},danger:{box:"bg-red-50 border-red-200",icon:"text-red-600"},neutral:{box:"bg-[var(--status-neutral-soft)] border-[color:var(--line)]",icon:"text-[color:var(--status-neutral-soft-ink)]"}},xl={info:"bg-blue-700 border-blue-700 text-white",success:"bg-green-700 border-green-700 text-white",warning:"bg-amber-700 border-amber-700 text-white",danger:"bg-red-700 border-red-700 text-white",neutral:"bg-[var(--status-neutral-solid)] border-[color:var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function vl({tone:e}){const t={className:"h-5 w-5","aria-hidden":!0};switch(e){case"success":/* @__PURE__ */
|
|
275
|
-
return Re(Ne,{name:"check-circle",look:"mini",...t});case"warning":/* @__PURE__ */
|
|
276
|
-
return Re(Ne,{name:"warning",look:"mini",...t});case"danger":/* @__PURE__ */
|
|
277
|
-
return Re(Ne,{name:"close-circle",look:"mini",...t});default:/* @__PURE__ */
|
|
278
|
-
return Re(Ne,{name:"info",look:"mini",...t})}}function wl({tone:e="info",emphasis:t="subtle",title:r,children:n,icon:a,action:l,onDismiss:i,sticky:o=!1,className:s=""}){const c=yl[e],d="solid"===t,u=ae().banner,h=d?xl[e]:c.box,m=o?"sticky top-0 z-30":"",p=/* @__PURE__ */We(Ke,{children:[r&&/* @__PURE__ */Re("div",{className:("font-semibold "+(d?"":"text-gray-900")).trim(),children:r}),n&&/* @__PURE__ */Re("div",{className:`${d?"":"text-gray-700"} ${r?"mt-0.5":""}`.trim(),children:n})]});/* @__PURE__ */
|
|
279
|
-
return We("div",{role:"danger"===e?"alert":"status",className:`${m} flex items-start gap-3 rounded-lg border px-4 py-3 ${h} ${s}`.trim(),children:[
|
|
280
|
-
/* @__PURE__ */Re("span",{className:`mt-0.5 shrink-0 ${d?"":c.icon}`.trim(),children:a??/* @__PURE__ */Re(vl,{tone:e})}),null==l?/* @__PURE__ */Re("div",{className:"min-w-0 flex-1 text-sm",children:p}):
|
|
281
|
-
/* @__PURE__ */We("div",{className:"flex min-w-0 flex-1 flex-wrap items-start gap-x-3 gap-y-2",children:[
|
|
282
|
-
/* @__PURE__ */Re("div",{className:"min-w-0 grow basis-48 text-sm",children:p}),
|
|
283
|
-
/* @__PURE__ */Re("div",{className:"shrink-0 self-center",children:l})]}),i&&/* @__PURE__ */Re("button",{type:"button",onClick:i,"aria-label":u.dismiss,className:"shrink-0 "+(d?"opacity-80 hover:opacity-100":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */Re(Ne,{name:"close",className:"h-4 w-4",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})}var Nl=(e,t)=>`${e}-tab-${t}`,kl=(e,t)=>`${e}-panel-${t}`,$l=(e,t)=>`flex items-center border-b border-gray-200${e?"":" gap-1"} ${t}`.trim();function Ml(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 Cl({items:e,value:t,onChange:r,variant:n="underline",block:a=!1,idPrefix:l,className:i="","aria-label":o,"aria-labelledby":s}){const c=Se([]),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__ */
|
|
284
|
-
return Re("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?Er(a,i):$l(a,i),children:e.map((e,n)=>{const i=e.id===t,o=/* @__PURE__ */Re("button",{ref:e=>{c.current[n]=e},type:"button",role:"tab",id:l?Nl(l,e.id):void 0,"aria-controls":l?kl(l,e.id):void 0,"aria-selected":i,tabIndex:i?0:-1,disabled:e.disabled,onClick:()=>r(e.id),className:d?Br({selected:i,disabled:e.disabled,block:a}):Ml(i,a),children:/* @__PURE__ */Re(Or,{icon:e.icon,label:e.label})},e.id);return null!=e.tooltip&&!1!==e.tooltip?/* @__PURE__ */Re(w,{content:e.tooltip,className:d||a?Ir(a):void 0,children:o},e.id):o})})}var Ll=()=>/* @__PURE__ */Re(Ne,{name:"check",className:"h-3.5 w-3.5","aria-hidden":"true"});function Sl({items:e,value:t,onChange:r,"aria-label":n,className:a=""}){const l=Math.max(0,e.findIndex(e=>e.id===t));/* @__PURE__ */
|
|
285
|
-
return Re("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__ */Re("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__ */Re(Ll,{}):n+1}),s=/* @__PURE__ */We("span",{className:"min-w-0 text-center",children:[
|
|
286
|
-
/* @__PURE__ */Re("span",{className:"block text-sm font-medium "+("upcoming"===a?"text-gray-400":"text-gray-900"),children:t.label}),t.description&&/* @__PURE__ */Re("span",{className:"block text-xs text-gray-500",children:t.description})]});/* @__PURE__ */
|
|
287
|
-
return We("li",{"aria-current":"current"===a?"step":void 0,className:"relative flex min-w-0 justify-center",children:[n<e.length-1&&/* @__PURE__ */Re("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__ */We("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__ */We("span",{className:"relative z-10 flex min-w-0 flex-col items-center gap-2 px-2 text-center",children:[o,s]})]},t.id)})})}function Dl({items:e,defaultOpenIds:t=[],openIds:r,onOpenChange:n,allowMultiple:a=!1,className:l=""}){const[i,o]=Le(t),s=r??i;/* @__PURE__ */
|
|
288
|
-
return Re("div",{className:`divide-y divide-gray-100 overflow-hidden rounded-lg border border-gray-200 ${l}`.trim(),children:e.map(e=>{const t=s.includes(e.id);/* @__PURE__ */
|
|
289
|
-
return We("div",{children:[
|
|
290
|
-
/* @__PURE__ */We("button",{type:"button",disabled:e.disabled,"aria-expanded":t,onClick:()=>(e=>{const t=s.includes(e)?s.filter(t=>t!==e):a?[...s,e]:[e];void 0===r&&o(t),n?.(t)})(e.id),className:"flex w-full items-center justify-between gap-3 px-4 py-3 text-left text-sm font-medium text-gray-900 hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50",children:[
|
|
291
|
-
/* @__PURE__ */Re("span",{children:e.title}),
|
|
292
|
-
/* @__PURE__ */Re(Ne,{name:"chevron-down",className:"h-4 w-4 shrink-0 transition-transform "+(t?"rotate-180":""),strokeWidth:"2","aria-hidden":"true"})]}),t&&/* @__PURE__ */Re("div",{className:"px-4 pb-3 text-sm text-gray-600",children:e.content})]},e.id)})})}function Pl({colorClass:e,tone:t,children:r,size:n="sm",capitalize:a=!1,closable:l=!1,onClose:i,closeLabel:o,className:s=""}){const c=e??sa[t??"neutral"],d="xs"===n?"px-2 py-0.5 text-3xs":"md"===n?"px-3 py-0.5 text-xs":"px-2 py-0.5 text-xs",u=a?"capitalize":"",h=ae().badge,m=o??("string"==typeof r?h.removeItem(r):h.remove),p="xs"===n?"h-2.5 w-2.5":"h-3 w-3";/* @__PURE__ */
|
|
293
|
-
return We("span",{className:["inline-flex items-center rounded-full font-medium",d,u,c,s].filter(Boolean).join(" "),children:[r,l&&/* @__PURE__ */Re("button",{type:"button",onClick:i,"aria-label":m,className:"-mr-0.5 ml-1 inline-flex shrink-0 items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",children:/* @__PURE__ */Re(Ne,{name:"close",look:"mini",className:p,"aria-hidden":"true"})})]})}function Al({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=ae().emptyState,h=t??(e?void 0:u.message),m=r??n;/* @__PURE__ */
|
|
294
|
-
return We("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__ */Re("div",{className:"mb-3 flex h-10 w-10 items-center justify-center text-gray-300","aria-hidden":"true",children:c}),d&&/* @__PURE__ */Re(Ne,{name:"inbox",className:"h-10 w-10 text-gray-300 mb-3","aria-hidden":"true",strokeWidth:1}),e&&/* @__PURE__ */Re("h3",{className:"text-sm font-medium text-gray-900",children:e}),h&&/* @__PURE__ */Re("p",{className:"text-sm text-gray-500 "+(e?"mt-2":""),children:h}),m&&/* @__PURE__ */Re("p",{className:"text-xs text-gray-400 mt-1",children:m}),o&&/* @__PURE__ */Re("div",{className:"mt-4",children:o})]})}function jl({title:t,description:r,subtitle:n,actions:a,children:l,icon:i,breadcrumbs:o}){const s=r??n,c=a??l;/* @__PURE__ */
|
|
295
|
-
return We("div",{className:"mb-6",children:[o&&o.length>0&&/* @__PURE__ */Re(e,{items:o,className:"mb-3"}),
|
|
296
|
-
/* @__PURE__ */We("div",{className:"flex items-start justify-between gap-4",children:[
|
|
297
|
-
/* @__PURE__ */We("div",{children:[
|
|
298
|
-
/* @__PURE__ */We("h1",{className:"flex items-center gap-2 text-xl font-semibold text-gray-900",children:[i&&/* @__PURE__ */Re("span",{className:"shrink-0",children:i}),t]}),s&&/* @__PURE__ */Re("p",{className:"mt-1 text-sm text-gray-500",children:s})]}),c&&/* @__PURE__ */Re("div",{className:"flex items-center gap-2",children:c})]})]})}var zl=["success","warning","danger"];function Fl(e){return"string"==typeof e&&zl.includes(e)}function Tl(e,t,r){if(null==e||!Number.isFinite(e))return null;const n=El(t),a=El(r);return null==n&&null==a?null:null!=a&&e>=a?"danger":null!=n&&e>=n?"warning":"success"}function El(e){return null!=e&&Number.isFinite(e)?e:null}var Bl={success:{tone:"success",fill:"bg-green-500",ink:"text-gray-900",word:"ok"},warning:{tone:"warning",fill:"bg-amber-500",ink:"text-amber-600",word:"warning"},danger:{tone:"danger",fill:"bg-red-500",ink:"text-red-600",word:"critical"}};var Il=/* @__PURE__ */new Set;function Ol(e,t){if(null==e)return null;if(Fl(e))return Bl[e];const r=function(e){const t="string"==typeof e?JSON.stringify(e):"number"==typeof e||"boolean"==typeof e||"bigint"==typeof e?String(e):Object.prototype.toString.call(e);return t.length>32?`${t.slice(0,31)}…`:t}(e);return function(e,t){const r=`${e}:${t}`;Il.has(r)||(Il.add(r),console.error(`[efficient-shell] ${e}: severity ${t} is not one of ${zl.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 Rl({at:e,title:t,className:r}){/* @__PURE__ */
|
|
299
|
-
return Re("div",{title:t,className:`absolute -top-[3px] h-3 w-0.5 rounded-[1px] ${r}`,style:{left:`${e}%`}})}var Wl=e=>Math.min(100,Math.max(0,e));function Kl({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=ae().meter,m=ne(),p=s??h.noData,g=null!=t&&Number.isFinite(t)?t:null,f=Number.isFinite(r)&&r>0?r:null;var b,y;null==f&&(b=`MetricBar:max:${String(r)}`,y=`[efficient-shell] MetricBar: max=${String(r)} is not a positive finite number, so there is no scale to draw a proportional bar against. Printing the value without a bar. Pass the real capacity, or leave the reading out entirely (value={null}) when it is unknown — do not pass 0.`,Il.has(b)||(Il.add(b),console.error(y)));const x=Ol(l,"MetricBar"),v=null!=g?x??(null==(w=Tl(g,n,a))?null:Bl[w]):null;var w;const N=El(n),k=El(a),$=null!=g&&null!=f?Wl(g/f*100):0,M=null!=g?(o??(e=>100===f?de(e,1,m):se(e,m)))(g):"—",C=null!=g&&null!=f&&(null!=N||null!=k),L="md"===c?"h-2":"h-1.5",S=null!=g&&null!=f,D=/* @__PURE__ */We("div",{...S?{role:"meter","aria-label":d??("string"==typeof e?e:void 0),"aria-valuemin":0,"aria-valuemax":f,"aria-valuenow":Math.min(f,Math.max(0,g)),"aria-valuetext":M}:{"aria-hidden":!0},className:S&&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:[S&&
|
|
300
|
-
/* @__PURE__ */Re("div",{className:`absolute inset-y-0 left-0 rounded-full ${v?v.fill:"bg-gray-400"}`,style:{width:`${$}%`}}),C&&null!=f&&null!=N&&/* @__PURE__ */Re(Rl,{at:Wl(N/f*100),title:h.warningAt(N),className:"bg-gray-400 opacity-75"}),C&&null!=f&&null!=k&&/* @__PURE__ */Re(Rl,{at:Wl(k/f*100),title:h.criticalAt(k),className:"bg-gray-500"})]}),P=v?v.ink:null!=g?"text-gray-900":"text-gray-400";/* @__PURE__ */
|
|
301
|
-
return We("div","md"===c?{className:u,children:[null!=e&&/* @__PURE__ */Re("div",{className:"text-3xs font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
302
|
-
/* @__PURE__ */We("div",{className:"mt-1 flex items-baseline gap-2",children:[
|
|
303
|
-
/* @__PURE__ */Re("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${P}`,children:M}),
|
|
304
|
-
/* @__PURE__ */Re("span",{className:"min-w-0 truncate text-2xs tabular-nums text-gray-400",children:null!=g?i:p})]}),D]}:{className:u,children:[
|
|
305
|
-
/* @__PURE__ */We("div",{className:"flex items-baseline gap-2",children:[null!=e&&/* @__PURE__ */Re("span",{className:"w-14 shrink-0 truncate text-3xs font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
306
|
-
/* @__PURE__ */Re("span",{className:`text-sm font-semibold tabular-nums ${P}`,children:M}),
|
|
307
|
-
/* @__PURE__ */Re("span",{className:"ml-auto min-w-0 truncate text-2xs tabular-nums text-gray-400",children:null!=g?i:p})]}),D]})}function _l(e){return null!=e&&Number.isFinite(e)&&e>=0?e:null}function ql(e,t){const r=_l(e);if(null==r)return"no-reading";const n=_l(t);return null==n||0===n?"no-budget":r>n?"over":"within"}var Hl=e=>Math.min(100,Math.max(0,e));function Ul({label:e,elapsed:t,budget:r,grace:n,detail:a,formatDuration:l,emptyLabel:i,noBudgetLabel:o,size:s="sm",ariaLabel:c,className:d=""}){const u=ae().meter,h=ne(),m=l??(e=>function(e,t=le.meter){const r=Math.round(e),n=Math.floor(r/3600),a=Math.floor(r%3600/60),l=r%60;return n>0?t.hoursMinutes(n,a):a>0?t.minutesSeconds(a,l):t.seconds(l)}(e,u)),p=i??u.noReading,g=o??u.noBudget,f=_l(t),b=_l(r),y=null!=b&&b>0?b:null,x=_l(n)??0,v="over"===ql(t,r),w=null!=y?y+x:null,N=null!=y&&null!=w?Hl(y/w*100):null,k=v&&x>0,$=null==w||null==f?0:v?k?N??0:0:Hl(f/w*100),M=k?N??0:0,C=v?k&&null!=w&&null!=f?Hl(f/w*100):100:0,L=Math.max(0,C-M),S=null!=f&&null!=y?f/y*100:null,D=null!=S?de(Math.round(S),0,h):null!=f?m(f):"—",P=a??(null==f?p:null==y?g:`${m(f)} / ${m(y)}`),A="md"===s?"h-2":"h-1.5",j=v?"text-red-600":null!=f?"text-gray-900":"text-gray-400",z=null!=f&&null!=y&&null!=w?/* @__PURE__ */We("div",{role:"meter","aria-label":c??("string"==typeof e?e:void 0),"aria-valuemin":0,"aria-valuemax":w,"aria-valuenow":Math.min(w,f),"aria-valuetext":u.ofBudget(D),className:`relative mt-2 ${A} overflow-hidden rounded-full bg-gray-200`,children:[(!v||k)&&/* @__PURE__ */Re("div",{className:"absolute inset-y-0 left-0 rounded-full bg-blue-600",style:{width:`${$}%`}}),L>0&&/* @__PURE__ */Re("div",{className:"rosh-budget-overrun absolute inset-y-0",style:{left:`${M}%`,width:`${L}%`}}),x>0&&null!=N&&/* @__PURE__ */Re("div",{title:u.budget,className:"absolute inset-y-0 w-0.5 bg-gray-700",style:{left:`${N}%`}})]}):null;/* @__PURE__ */
|
|
308
|
-
return We("div","md"===s?{className:d,children:[null!=e&&/* @__PURE__ */Re("div",{className:"text-3xs font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
309
|
-
/* @__PURE__ */We("div",{className:"mt-1 flex items-baseline gap-2",children:[
|
|
310
|
-
/* @__PURE__ */Re("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${j}`,children:D}),
|
|
311
|
-
/* @__PURE__ */Re("span",{className:"min-w-0 truncate text-2xs tabular-nums text-gray-400",children:P})]}),z]}:{className:d,children:[
|
|
312
|
-
/* @__PURE__ */We("div",{className:"flex items-baseline gap-2",children:[null!=e&&/* @__PURE__ */Re("span",{className:"w-14 shrink-0 truncate text-3xs font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
313
|
-
/* @__PURE__ */Re("span",{className:`text-sm font-semibold tabular-nums ${j}`,children:D}),
|
|
314
|
-
/* @__PURE__ */Re("span",{className:"ml-auto min-w-0 truncate text-2xs tabular-nums text-gray-400",children:P})]}),z]})}var Vl=864e5;function Yl(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 Gl(e,t){return be(new Date(e).toISOString().slice(0,10),{locale:t})}var Xl=(e,t)=>`${e}-fill-${t}`,Zl=e=>`${e}-glow`,Jl=e=>`${e}-reveal`,Ql=e=>`${e}-ground`;function ei(e,t,r,n){return"solid"===r?n:`url(#${Xl(e,t)})`}function ti(e){return"solid"===e?void 0:"4 3"}function ri({id:e,index:t,colour:r,variant:n,from:a,to:l}){const i=Xl(e,t);if("solid"===n)return null;if("gradient"===n||"gradient-reverse"===n){const e="gradient-reverse"===n;/* @__PURE__ */
|
|
315
|
-
return We("linearGradient",{id:i,x1:"0",y1:"0",x2:"0",y2:"1",children:[
|
|
316
|
-
/* @__PURE__ */Re("stop",{offset:"0%",stopColor:r,stopOpacity:e?l:a}),
|
|
317
|
-
/* @__PURE__ */Re("stop",{offset:"100%",stopColor:r,stopOpacity:e?a:l})]})}const o=/* @__PURE__ */Re("rect",{width:"100%",height:"100%",fill:r,fillOpacity:.45*a});return"duotone"===n?/* @__PURE__ */We("linearGradient",{id:i,x1:"0",y1:"0",x2:"0",y2:"1",children:[
|
|
318
|
-
/* @__PURE__ */Re("stop",{offset:"0%",stopColor:r,stopOpacity:a}),
|
|
319
|
-
/* @__PURE__ */Re("stop",{offset:"45%",stopColor:r,stopOpacity:a}),
|
|
320
|
-
/* @__PURE__ */Re("stop",{offset:"45%",stopColor:r,stopOpacity:.35*a}),
|
|
321
|
-
/* @__PURE__ */Re("stop",{offset:"100%",stopColor:r,stopOpacity:.35*a})]}):/* @__PURE__ */We("pattern","striped"===n?{id:i,width:"10",height:"10",patternUnits:"userSpaceOnUse",patternTransform:"rotate(-45)",children:[o,
|
|
322
|
-
/* @__PURE__ */Re("rect",{width:"5",height:"10",fill:r,fillOpacity:.7})]}:"blocks"===n?{id:i,width:"10",height:"10",patternUnits:"userSpaceOnUse",children:[o,
|
|
323
|
-
/* @__PURE__ */Re("rect",{x:"1",y:"1",width:"4",height:"4",rx:"1",fill:r,fillOpacity:.8}),
|
|
324
|
-
/* @__PURE__ */Re("rect",{x:"6",y:"6",width:"4",height:"4",rx:"1",fill:r,fillOpacity:.8})]}:"dotted"===n?{id:i,width:"8",height:"8",patternUnits:"userSpaceOnUse",children:[o,
|
|
325
|
-
/* @__PURE__ */Re("circle",{cx:"2",cy:"2",r:"1.2",fill:r,fillOpacity:.85})]}:"lines"===n?{id:i,width:"6",height:"6",patternUnits:"userSpaceOnUse",children:[o,
|
|
326
|
-
/* @__PURE__ */Re("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,
|
|
327
|
-
/* @__PURE__ */Re("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:r,strokeWidth:"2",strokeOpacity:.75})]})}function ni({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__ */
|
|
328
|
-
return Re("mask",{id:Jl(e),maskUnits:"objectBoundingBox",maskContentUnits:"objectBoundingBox",children:/* @__PURE__ */Re("rect",{x:"0",y:"0",width:"1",height:"1",fill:"white",className:r})})}function ai({id:e,fills:t=[],fadeFrom:r=.3,fadeTo:n=0,glow:a=!1,reveal:l=!1,background:i="none"}){/* @__PURE__ */
|
|
329
|
-
return We("defs",{children:[t.map((t,a)=>/* @__PURE__ */Re(ri,{id:e,index:a,colour:t.color,variant:t.variant??"gradient",from:r,to:n},a)),l&&/* @__PURE__ */Re(ni,{id:e,direction:l}),a&&/* @__PURE__ */We("filter",{id:Zl(e),x:"-40%",y:"-40%",width:"180%",height:"180%",children:[
|
|
330
|
-
/* @__PURE__ */Re("feGaussianBlur",{stdDeviation:"3.5",result:"blur"}),
|
|
331
|
-
/* @__PURE__ */We("feMerge",{children:[
|
|
332
|
-
/* @__PURE__ */Re("feMergeNode",{in:"blur"}),
|
|
333
|
-
/* @__PURE__ */Re("feMergeNode",{in:"SourceGraphic"})]})]}),"none"!==i&&/* @__PURE__ */Re(li,{id:Ql(e),variant:i})]})}function li({id:e,variant:t}){/* @__PURE__ */
|
|
334
|
-
return Re("pattern","dots"===t?{id:e,width:"20",height:"20",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */Re("circle",{cx:"2",cy:"2",r:"1",fill:"currentColor"})}:"grid"===t?{id:e,width:"20",height:"20",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */Re("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__ */Re("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__ */Re("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__ */Re("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:"currentColor",strokeWidth:"0.5"})})}var ii={rise:"rosh-viz-rise",grow:"rosh-viz-grow",sweep:"rosh-viz-sweep",march:"rosh-viz-march",fade:"rosh-viz-fade"},oi=(e,t=60)=>({animationDelay:e*t+"ms"}),si={receipt:/* @__PURE__ */We(Ke,{children:[
|
|
335
|
-
/* @__PURE__ */Re("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"}),
|
|
336
|
-
/* @__PURE__ */Re("path",{d:"M4.9 4.4h2.2M4.9 6.1h2.2",stroke:"currentColor",strokeWidth:"1.1",strokeLinecap:"round"})]}),check:/* @__PURE__ */Re("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__ */We(Ke,{children:[
|
|
337
|
-
/* @__PURE__ */Re("path",{d:"M3.5 1.9h3.4l2 2v6.2H3.5z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),
|
|
338
|
-
/* @__PURE__ */Re("path",{d:"M5.1 6.5h2.8M5.1 8.2h2",stroke:"currentColor",strokeWidth:"1.1",strokeLinecap:"round"})]}),flask:/* @__PURE__ */Re("path",{d:"M4.6 1.8h2.8M5.4 1.8v3.1L3.3 9.3a.9.9 0 0 0 .8 1.3h3.8a.9.9 0 0 0 .8-1.3L6.6 4.9V1.8",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),truck:/* @__PURE__ */We(Ke,{children:[
|
|
339
|
-
/* @__PURE__ */Re("path",{d:"M1.8 2.9h4.9v4.4H1.8z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),
|
|
340
|
-
/* @__PURE__ */Re("path",{d:"M6.7 4.4h1.6l1.5 1.7v1.2H6.7z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),
|
|
341
|
-
/* @__PURE__ */Re("circle",{cx:"3.5",cy:"8.7",r:"1",fill:"currentColor"}),
|
|
342
|
-
/* @__PURE__ */Re("circle",{cx:"8.4",cy:"8.7",r:"1",fill:"currentColor"})]}),flag:/* @__PURE__ */We(Ke,{children:[
|
|
343
|
-
/* @__PURE__ */Re("path",{d:"M3.8 1.7v8.6",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"}),
|
|
344
|
-
/* @__PURE__ */Re("path",{d:"M3.8 2.5h4.8L7.5 4.4l1.1 1.9H3.8z",fill:"currentColor"})]})};function ci({name:e}){/* @__PURE__ */
|
|
345
|
-
return Re("svg",{viewBox:"0 0 12 12","aria-hidden":"true",children:si[e]})}function di(){/* @__PURE__ */
|
|
346
|
-
return We("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",children:[
|
|
347
|
-
/* @__PURE__ */Re("path",{d:"M4.2 2.2v11.6"}),
|
|
348
|
-
/* @__PURE__ */Re("path",{d:"M4.2 3.1h7.4l-1.6 2.5 1.6 2.6H4.2z"})]})}function ui(){/* @__PURE__ */
|
|
349
|
-
return Re("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",children:/* @__PURE__ */Re("path",{d:"M2.8 11.6V8.2M6.6 11.6V5.4M10.4 11.6V7M14.2 11.6V3.6"})})}var hi=1e-6;function mi(e,t,r={}){const n=Number.isFinite(t)&&t>0?t:0,a=Array.from(new Set(e.filter(e=>Number.isFinite(e)))).sort((e,t)=>e-t);if(n<=0||a.length<2){const e=a[0]??0;return{anchorsMs:a,xs:a.map(()=>0),gaps:[],xByMs:()=>0,msByPx:()=>e,inCut:()=>!1}}const l=a[a.length-1]-a[0],i=r.maxTimeShare??.3,o=Math.min(r.breakPx??48,n),s=r.minGapPx??48,c=[],d=[],u=[];for(let e=0;e+1<a.length;e++){const t=a[e+1]-a[e];c.push(t),d.push(l>0?t/l*n:0),u.push(l>0&&t/l>i)}const h=u.filter(Boolean).length,m=Math.max(0,n-h*o);let p=0,g=0;for(let e=0;e<c.length;e++)u[e]||(p+=c[e],g+=1);const f=c.map((e,t)=>u[t]?o:0===g?0:p>0?m*e/p:m/g),b=function(e,t,r){const n=e.slice();let a=0;for(let e=0;e<n.length;e++)t[e]||n[e]>=r-hi||(a+=r-n[e],n[e]=r);if(a<=hi)return n;let l=0;for(let e=0;e<n.length;e++)!t[e]&&n[e]>r+hi&&(l+=n[e]-r);if(l<=hi)return n;const i=Math.min(a,l);for(let e=0;e<n.length;e++)t[e]||n[e]<=r+hi||(n[e]-=i*(n[e]-r)/l);return n}(f,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:f[t],px:v[t+1]-e,compressed:u[t]}));return{anchorsMs:a,xs:v,gaps:w,xByMs:e=>{if(!Number.isFinite(e)||e<=a[0])return 0;if(e>=a[a.length-1])return n;for(let t=0;t+1<a.length;t++){if(e>a[t+1])continue;const r=a[t+1]-a[t],n=r>0?(e-a[t])/r:0;return v[t]+n*(v[t+1]-v[t])}return n},msByPx:e=>{const t=Math.min(Math.max(Number.isFinite(e)?e:0,0),n);for(let e=0;e+1<a.length;e++){if(t>v[e+1]&&e+2<a.length)continue;const r=v[e+1]-v[e],n=r>0?(t-v[e])/r:0;return a[e]+n*(a[e+1]-a[e])}return a[a.length-1]},inCut:e=>w.some(t=>t.compressed&&e>t.fromMs&&e<t.toMs)}}function pi(e,t,r){return Math.max(0,Math.min(e-t/2,Math.max(0,r-t)))}var gi="mixed";function fi(e,t){return 5.6*Math.max(e.length,t.length)+8}var bi=(e,t,r)=>Math.min(Math.max(e,t),r),yi=e=>-(Math.cos(Math.PI*e)-1)/2;function xi(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)*yi(t);return{px:r,ms:e.msByPx(r)}}var vi={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 wi(){try{return"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}var Ni=e=>5.6*e.length,ki={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:{}},$i={doc:"dfm",flask:"testing",check:"completion",truck:"shipment",receipt:"invoice"};function Mi(e,t,r){if("none"!==e.glyph)return e.glyph?e.glyph:ki[t].glyph??(r?"flag":void 0)}function Ci(e,t,r=!1){const n=ki[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 Li(e){const t=(e=>"string"==typeof e?e:"")(e.detail);return`${e.label} · ${e.dateText}${t?` · ${t}`:""}`}var Si="undefined"==typeof document?Pe:Oe;function Di(e,t){const[r,n]=Le(0);return Si(()=>{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 Pi(e,t,r){const n=/* @__PURE__ */new Map;for(const e of t)Number.isFinite(e.x)&&n.set(e.x,Math.max(n.get(e.x)??0,e.widthPx));const a=[...n.keys()].sort((e,t)=>e-t);if(r<=0||a.length<2)return e;const l=Math.max(0,a[0]),i=Math.min(r,a[a.length-1]),o=i-l,s=[];for(let e=0;e+1<a.length;e++){const t=(n.get(a[e])??0)/2+(n.get(a[e+1])??0)/2+8;s.push(Math.max(28,t,a[e+1]-a[e]))}const c=s.reduce((e,t)=>e+t,0),d=Math.min(Math.max(c,o),.8*r);if(d<=o+.5)return e;const u=l,h=r-i,m=u+h,p=Math.max(0,r-d),g=m>0?p*u/m:0,f=g,b=g+d,y=s.map(e=>c>0?e*d/c:0),x=e=>{if(e<=l)return u>0?e*g/u:f;if(e>=i)return h>0?b+(e-i)*(r-b)/h:b;let t=f;for(let r=0;r+1<a.length;r++){if(e>a[r+1]){t+=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<=f)return g>0?e*u/g:l;if(e>=b)return r-b>0?i+(e-b)*h/(r-b):i;let t=f;for(let r=0;r+1<a.length;r++){if(!(e>t+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 Ai(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 ji({marks:e,innerRef:t}){/* @__PURE__ */
|
|
350
|
-
return Re("div",{ref:t,"aria-hidden":"true",className:"rosh-tl-measure",children:e.map(e=>/* @__PURE__ */We("div",{"data-lane-key":e.key,className:"rosh-tl-measure-box",children:[
|
|
351
|
-
/* @__PURE__ */Re("span",{className:"rosh-tl-name",children:e.label}),
|
|
352
|
-
/* @__PURE__ */Re("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})}function zi({startMs:e,endMs:t,axis:r,geo:n,reveal:a}){const l=ae().timeline,i=ge(ne()),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*Vl){if(r.inCut(e))continue;const t=r.xByMs(e);r.xByMs(e+7*Vl)-t<14||s.push(
|
|
353
|
-
/* @__PURE__ */Re("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=Ni(l.days(Math.round(e.gapMs/Vl)))/2+6;return[t-r,t+r]}),m=(e,t)=>h.some(([r,n])=>e<n&&t>r);s.push(
|
|
354
|
-
/* @__PURE__ */Re("i",{"data-timeline-part":"start-tick",className:"rosh-tl-tick",style:{left:"0px",top:`${o}px`,height:"6px"}},"start"));const p=new Date(e);p.setUTCDate(1);let g=-1/0,f=!0;for(;p.getTime()<t;){const t=p.getTime();if(!(t<=e)&&!r.inCut(t)){const e=r.xByMs(t);if(s.push(
|
|
355
|
-
/* @__PURE__ */Re("i",{className:"rosh-tl-tick",style:{left:`${e}px`,top:`${o}px`,height:"6px"}},`mo-${t}`)),e-g>=72||f){const r=f||0===p.getUTCMonth()?i.shortMonthYear(p.getUTCFullYear(),p.getUTCMonth()):i.monthsShort[p.getUTCMonth()];m(e,e+Ni(r))||(c.push(
|
|
356
|
-
/* @__PURE__ */Re("span",{className:"rosh-tl-month"+(a?" rosh-tl-fade":""),style:{left:`${e}px`,top:`${o+9}px`,...a?{animationDelay:"420ms"}:{}},children:r},`mon-${t}`)),g=e,f=!1)}}p.setUTCMonth(p.getUTCMonth()+1)}/* @__PURE__ */
|
|
357
|
-
return We("div",{"aria-hidden":"true","data-timeline-part":"ruler",children:[s,c,d.map(e=>{const t=Math.max(1,Math.round(e.gapMs/Vl));/* @__PURE__ */
|
|
358
|
-
return We("span",{"data-timeline-part":"break",className:"rosh-tl-rulercut"+(a?" rosh-tl-fade":""),style:{left:(e.fromPx+e.toPx)/2+"px",top:`${o}px`,...a?{animationDelay:"420ms"}:{}},children:[
|
|
359
|
-
/* @__PURE__ */We("span",{className:"rosh-tl-cutglyph",children:[
|
|
360
|
-
/* @__PURE__ */Re("i",{}),
|
|
361
|
-
/* @__PURE__ */Re("i",{})]}),
|
|
362
|
-
/* @__PURE__ */Re("span",{children:l.days(t)})]},`cut-${e.fromMs}`)})]})}function Fi({pending:e,reveal:t}){const r=ae().timeline,[n,a]=Le(!1),l=n?e:e.slice(0,2),i=e.length-l.length;/* @__PURE__ */
|
|
363
|
-
return We("div",{className:"rosh-tl-pending","data-timeline-part":"pending",children:[
|
|
364
|
-
/* @__PURE__ */Re("p",{className:"rosh-tl-pending-head",children:r.notReached}),
|
|
365
|
-
/* @__PURE__ */Re("ol",{className:"rosh-tl-ghosts","aria-label":r.notReached,children:l.map((e,n)=>/* @__PURE__ */We("li",{className:t?"rosh-tl-fade":void 0,style:t?{animationDelay:440+60*n+"ms"}:void 0,children:[
|
|
366
|
-
/* @__PURE__ */Re("span",{"aria-hidden":"true",className:"rosh-tl-node is-ghost"+(e.kind&&ki[e.kind].diamond?" is-diamond":"")}),
|
|
367
|
-
/* @__PURE__ */We("span",{children:[0===n&&/* @__PURE__ */Re("b",{children:`${r.next} · `}),e.label]})]},e.key))}),i>0&&/* @__PURE__ */Re("button",{type:"button",className:"rosh-tl-more text-gray-500",onClick:()=>a(!0),children:r.more(i)})]})}function Ti({marks:e,pending:t,currentKey:r,todayMs:n,reveal:a,ariaLabel:l,step:i,nodeProps:o,onKeyDown:s}){const c=ae().timeline,d=e.findIndex(e=>e.key===r),u=e.length>0&&null!==n?Math.round((n-e[e.length-1].ms)/Vl):0;/* @__PURE__ */
|
|
368
|
-
return We("div",{"data-timeline-part":"vertical",children:[
|
|
369
|
-
/* @__PURE__ */Re("ol",{className:"rosh-tl-v","aria-label":l,onKeyDown:s,children:e.map((e,t)=>{const n=Ci(e.kind,e.role),l=d>=0&&t<d,{glyph:s}=e;/* @__PURE__ */
|
|
370
|
-
return We("li",{className:a?"rosh-tl-fade":void 0,style:a?oi(t,i):void 0,...e.key===r?{"aria-current":"step"}:{},children:[
|
|
371
|
-
/* @__PURE__ */Re("i",{"aria-hidden":"true",className:`rosh-tl-vline text-blue-600${l?" is-on":" is-dash"}${l&&a?" rosh-tl-drawy":""}`}),
|
|
372
|
-
/* @__PURE__ */We("button",{...o(e),className:`${n.className}${a?" rosh-tl-pop":""}`,style:{...n.style,...a?oi(t,i):{}},children:[s&&/* @__PURE__ */Re(ci,{name:s}),"current"===e.role&&/* @__PURE__ */Re("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(a?" is-on":"")})]}),
|
|
373
|
-
/* @__PURE__ */We("span",{className:"rosh-tl-vrow","aria-hidden":"true",children:[
|
|
374
|
-
/* @__PURE__ */Re("span",{className:"rosh-tl-name",children:e.label}),
|
|
375
|
-
/* @__PURE__ */Re("span",{className:"rosh-tl-date",children:e.dateText})]})]},e.key)})}),u>0&&/* @__PURE__ */We("p",{className:"rosh-tl-vgap","aria-hidden":"true",children:[
|
|
376
|
-
/* @__PURE__ */Re("i",{className:"rosh-tl-vline is-dash"}),
|
|
377
|
-
/* @__PURE__ */Re("span",{children:c.daysToToday(u)})]}),t.length>0&&/* @__PURE__ */Re(Fi,{pending:t,reveal:a})]})}function Ei({axis:e,geo:t,fillTo:r,reveal:n,trackPx:a,tweened:l=!1}){/* @__PURE__ */
|
|
378
|
-
return We("div",{"aria-hidden":"true",children:[
|
|
379
|
-
/* @__PURE__ */Re("div",{className:"rosh-tl-rail bg-gray-200",style:{top:`${t.rail}px`,height:"6px",width:`${a}px`}}),null!==r&&/* @__PURE__ */Re("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__ */We("div",{className:"rosh-tl-cut",style:{left:(e.fromPx+e.toPx)/2+"px",top:`${t.rail}px`,height:"6px"},children:[
|
|
380
|
-
/* @__PURE__ */Re("i",{}),
|
|
381
|
-
/* @__PURE__ */Re("i",{})]},`railcut-${e.fromMs}`))]})}function Bi({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__ */
|
|
382
|
-
return We("div",{"aria-hidden":"true","data-timeline-part":"start",children:[
|
|
383
|
-
/* @__PURE__ */Re("i",{className:`rosh-tl-start${n?" is-around":""}${o}`,style:{left:"0px",top:`${e.rail+3}px`,...s}}),null!=t&&!1!==t&&/* @__PURE__ */Re("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__ */Re("span",{className:`rosh-tl-edge is-end${o}`,"data-timeline-part":"end-caption",style:{left:`${l}px`,top:`${i}px`,...s},children:r})]})}function Ii({x:e,geo:t,trackPx:r,label:n,reveal:a}){const l=ae().timeline;/* @__PURE__ */
|
|
384
|
-
return We("div",{"aria-hidden":"true","data-timeline-part":"today",children:[
|
|
385
|
-
/* @__PURE__ */Re("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"}:{}}}),
|
|
386
|
-
/* @__PURE__ */Re("span",{className:"rosh-tl-todaytag"+(a?" rosh-tl-fade":""),title:l.todayTitle(n),style:{left:`${pi(e,48,r)}px`,top:`${t.tag}px`,...a?{animationDelay:"420ms"}:{}},children:l.today})]})}function Oi({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=Ni(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__ */Re("div",{"aria-hidden":"true","data-timeline-part":"captions",children:a.map(e=>/* @__PURE__ */Re("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 Ri({phase:e,geo:t,xOf:r}){const n=r(e.minMs),a=Math.max(r(e.maxMs)-n,4);/* @__PURE__ */
|
|
387
|
-
return We("div",{"aria-hidden":"true","data-timeline-part":"phase",children:[
|
|
388
|
-
/* @__PURE__ */Re("div",{className:"rosh-tl-phase border-gray-300",style:{left:`${n}px`,width:`${a}px`,top:t.laneB+t.laneH-4+"px"}}),
|
|
389
|
-
/* @__PURE__ */We("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 Wi({nodes:e,trackPx:t,geo:r,activeKey:n,hoveredKey:a,currentKey:l}){const i=ae().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:fi(d,u),m=c?.onOpen;/* @__PURE__ */
|
|
390
|
-
return We("div",{"data-timeline-part":"label",className:`rosh-tl-label${s.key===a?" is-hot":""}${o(s,l)?" is-current":""}`,style:{left:`${pi(s.x,h,t)}px`,top:`${r.laneB}px`,width:`${h}px`,height:`${r.laneH}px`},children:[m?/* @__PURE__ */Re("button",{type:"button",className:"rosh-tl-name rosh-tl-open","data-timeline-part":"open","aria-label":i.open(d),onClick:m,children:d}):/* @__PURE__ */Re("span",{className:"rosh-tl-name","aria-hidden":"true",children:d}),
|
|
391
|
-
/* @__PURE__ */Re("span",{className:"rosh-tl-date","aria-hidden":"true",children:u})]})}function Ki({groups:e,trackPx:t,geo:r,startMs:n,endMs:a,currentKey:l,hoveredKey:i,reveal:o,step:s,zoomedKey:c,popId:d,aimBubble:u,openCluster:h,setOpenCluster:m,previewCluster:p,setPreviewCluster:g,setZoomKey:f,startCaptionPx:b}){const 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(Ni(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,Vl),{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=pi(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__ */
|
|
392
|
-
return We(Ke,{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=()=>{g(null),a||f(null)};/* @__PURE__ */
|
|
393
|
-
return We("div",{children:[
|
|
394
|
-
/* @__PURE__ */We("button",{type:"button","data-timeline-part":"cluster",className:`rosh-tl-pill${ki[e.group.kind]?.token?"":" text-blue-600"}${o?" rosh-tl-fade":""}`,"aria-expanded":a,"aria-controls":d,style:{left:`${e.left}px`,top:`${0===t?r.laneA+r.laneH-19:r.laneB}px`,color:ki[e.group.kind]?.token,...o?{animationDelay:`${n}ms`}:{}},onMouseEnter:()=>{g(e.key),f(e.key)},onMouseLeave:i,onFocus:()=>{g(e.key),f(e.key)},onBlur:i,onClick:()=>{m(a?null:e.key),f(a?null:e.key)},children:[
|
|
395
|
-
/* @__PURE__ */Re("i",{"aria-hidden":"true"}),e.text]}),
|
|
396
|
-
/* @__PURE__ */Re("i",{"aria-hidden":"true",className:"rosh-tl-cspan",style:{left:`${Math.min(...l)}px`,width:`${Math.max(1,Math.max(...l)-Math.min(...l))}px`,top:`${k(t)}px`}})]},e.key)}const a=e.group.mark;if(e.lane<0)return a.key===i?/* @__PURE__ */We("div",{"aria-hidden":"true","data-timeline-part":"reveal",className:"rosh-tl-label is-reveal is-hot",style:{left:`${e.left}px`,top:`${r.laneA}px`,width:`${e.widthPx}px`},children:[
|
|
397
|
-
/* @__PURE__ */Re("span",{className:"rosh-tl-name",children:a.label}),
|
|
398
|
-
/* @__PURE__ */Re("span",{className:"rosh-tl-date",children:a.dateText})]},e.key):null;const c=Math.abs(e.left+e.widthPx/2-a.x)<=8;/* @__PURE__ */
|
|
399
|
-
return We("div",{children:[
|
|
400
|
-
/* @__PURE__ */We("div",{"aria-hidden":"true","data-timeline-part":"label",className:`rosh-tl-label${0===t?" is-up":""}${a.key===l?" is-current":""}${a.key===i?" is-hot":""}${o?" rosh-tl-fade":""}`,style:{left:`${e.left}px`,top:`${N(t)}px`,width:`${e.widthPx}px`,height:`${r.laneH}px`,...o?{animationDelay:`${n}ms`}:{}},children:[
|
|
401
|
-
/* @__PURE__ */Re("span",{className:"rosh-tl-name",children:a.label}),
|
|
402
|
-
/* @__PURE__ */Re("span",{className:"rosh-tl-date",children:a.dateText})]}),!c&&/* @__PURE__ */Re("i",{"aria-hidden":"true",className:"rosh-tl-lead"+(o?" rosh-tl-fade":""),style:{left:`${Math.min(e.left+e.widthPx/2,a.x)}px`,width:`${Math.abs(e.left+e.widthPx/2-a.x)}px`,top:`${k(t)}px`,...o?{animationDelay:`${n}ms`}:{}}})]},e.key)}),w&&"cluster"===w.group.type&&/* @__PURE__ */We("div",{ref:e=>{u(e,w.x)},id:d,className:"rosh-tl-popover","data-timeline-part":"cluster-popover",style:{top:`${r.rail+6+6}px`},onMouseEnter:()=>g(w.key),onMouseLeave:()=>g(null),children:[
|
|
403
|
-
/* @__PURE__ */Re("p",{className:"rosh-tl-popover-head",children:w.text}),
|
|
404
|
-
/* @__PURE__ */Re("ol",{children:w.group.members.map(e=>/* @__PURE__ */We("li",{children:[
|
|
405
|
-
/* @__PURE__ */Re("span",{children:e.label}),
|
|
406
|
-
/* @__PURE__ */Re("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})]})]})}function _i({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=ae().timeline,p=ne(),g=Se(!1),f=c?c.px:n.xByMs(t),b=c?c.ms:t,y=Ai(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?.(),g.current=!0,t.currentTarget.setPointerCapture?.(t.pointerId),e.onDragStart?.()},k=t=>{g.current&&(g.current=!1,t.currentTarget.releasePointerCapture?.(t.pointerId),h(null),e.onDragEnd?.())},$=e=>{if(!g.current)return;const t=v(e.clientX);w(t),h(function(e,t){if(!Number.isFinite(t))return null;const r=e.filter(e=>Number.isFinite(e.ms)).slice().sort((e,t)=>e.ms-t.ms);for(let e=0;e+1<r.length;e++){const 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?bi((t-n.ms)/l,0,1):1,ms:t}}return null}(u,t))},M=e.valueText?e.valueText(b):Gl(b,p),C=Math.max(1,Math.round((i-l)/Vl));/* @__PURE__ */
|
|
407
|
-
return We(Ke,{children:[
|
|
408
|
-
/* @__PURE__ */Re("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}),
|
|
409
|
-
/* @__PURE__ */Re("div",{className:"rosh-tl-chip","data-timeline-part":"chip",style:{left:`${pi(f,88,o)+44}px`,top:`${a.tag}px`},children:e.chip?e.chip(b):Gl(b,p)}),
|
|
410
|
-
/* @__PURE__ */Re("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)/Vl),"aria-valuetext":M,style:{left:`${f}px`,top:`${a.rail+3}px`},onPointerDown:N,onPointerMove:$,onPointerUp:k,onPointerCancel:k,onKeyDown:e=>{const r=(e=>{const{key:r}=e;if(y&&y.length>0){const e=x<0?0:x;return"ArrowRight"===r||"ArrowUp"===r?y[Math.min(e+1,y.length-1)]:"ArrowLeft"===r||"ArrowDown"===r?y[Math.max(e-1,0)]:"Home"===r?y[0]:"End"===r?y[y.length-1]:null}const n=(e.shiftKey?7:1)*Vl;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 qi(e,t,r){return(t?e.height:e.ruler+26)+(r?22:0)}function Hi({startMs:e,endMs:t,axis:r="linear",items:n,markers:a=[],pending:l=[],fillToMs:i,todayMs:o,labels:s="lanes",activeKey:c=null,onActivate:d,thumb:u,playback:h,edgeCaptions:m,phases:p=[],currentKey:g,zoomRange:f=null,motion:b=!0,ariaLabel:y,highlightKeys:x=null,onHoverChange:v,endMark:w=null}){const k="none"===s,$=Z(Date.now,null),M=Z(wi,!1),C=o??$,L=Se(null),S=ae().timeline,D=ne(),P=e=>Gl(e,D),A=Se(null),j=Se(null),z=Se(null),F=Se(/* @__PURE__ */new Map),T=Se(void 0),E=Se(void 0),B=Se(null),[I,O]=Le({}),[R,W]=Le(null),[K,_]=Le(null),[q,U]=Le(null),[V,Y]=Le(null),[G,X]=Le(null),[J,Q]=Le(null),ee=Me(),te=Me(),re=Di(L,!0),le=re>0?re-(l.length>0&&!k?176:0):0,ie=le>0&&le-20<320,oe=Di(A,!ie),se=oe>0?oe:600,ce=vi[s],de=k&&l.length>0,ue=de?Math.max(0,se-36):se,he=r=>r>=e-Vl&&r<=t+Vl,me=n.filter(e=>Number.isFinite(e.ms)&&he(e.ms)).slice().sort((e,t)=>e.ms-t.ms),pe="spread"===r?a.map(e=>new Date(e.date).getTime()).filter(e=>Number.isFinite(e)):[],ge=mi([e,...[...me.map(e=>e.ms),...pe].filter(r=>r>e&&r<t),t],ue,"compressed"===(fe=r)?{}:"spread"===fe?{maxTimeShare:1/0}:{maxTimeShare:1/0,minGapPx:0});var fe;const be=ge.xByMs,ye=me.filter(e=>!e.provisional),xe=g??(ye.length>0?ye[ye.length-1].key:null),ve=me.map((e,t)=>{const r=e.date??P(e.ms),n=(e.priority??0)>0||"report"===e.kind,a=function(e){const t=e.kind??"default";return"default"===t&&e.glyph&&"none"!==e.glyph?$i[e.glyph]??t:t}(e);return{key:e.key,ms:e.ms,x:be(e.ms),baseX:be(e.ms),kind:a,label:e.label,dateText:r,detail:e.detail,preview:e.preview,glyph:Mi(e,a,0===t&&"default"===a),role:e.key===xe?"current":n?"dot":"key",widthPx:k?Math.max(16,Ni(e.caption??"")+6):I[e.key]||fi(e.label,r),collapsible:n,onClick:e.onClick,onOpen:e.onOpen,isItem:!0,caption:e.caption,provisional:!!e.provisional,isCap:!1}}),we=a.map(e=>({marker:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)&&he(e)).map(({marker:e,ms:t})=>{const r=`marker-${e.id}`,n=P(t);return{key:r,ms:t,x:be(t),baseX:be(t),kind:e.kind,label:e.label,dateText:n,detail:e.detail,preview:e.preview,glyph:e.glyph??ki[e.kind].glyph,role:"key",widthPx:I[r]||fi(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}}),Ne=de?(()=>{const e=l[l.length-1],r=l.slice(0,-1).map(e=>e.label);return[{key:e.key,ms:t+Vl,x:se,baseX:se,kind:e.kind??"default",label:e.label,dateText:S.notReached,detail:r.length>0?S.alsoToCome(r):void 0,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]})():[],ke=k&&w&&!de?[{key:w.key,ms:t,x:ue,baseX:ue,kind:"default",label:w.label,dateText:w.dateText??P(t),detail:w.detail,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]:[],$e=[...ve,...we,...Ne,...ke].sort((e,t)=>e.x-t.x||e.ms-t.ms),De=m?.start??S.start(P(e)),Ae=null==De||!1===De?0:"string"==typeof De?Math.ceil(Ni(De)):96,je="lanes"===s?function(e,t={}){const r=t.minPitchPx??40,n=[];let a=0;for(;a<e.length;){const t=e[a];if(!t.collapsible){n.push({type:"item",mark:t}),a+=1;continue}let l=a+1;for(;l<e.length&&e[l].collapsible&&e[l].kind===t.kind;)l+=1;const i=e.slice(a,l),o=i.length>1&&i.every((e,t)=>{if(0===t)return!0;const n=i[t-1],a=Math.max(r,Math.max(e.widthPx,n.widthPx)+8);return e.x-n.x<a});if(i.length>=3||o)n.push({type:"cluster",kind:t.kind,members:i});else for(const e of i)n.push({type:"item",mark:e});a=l}return n}($e):[],ze=function(e,t=16){const r=[];let n=0;for(;n<e.length;){let a=n+1;for(;a<e.length&&e[a].x-e[a-1].x<t;)a+=1;if(a-n===1)r.push({type:"item",mark:e[n]});else{const t=e.slice(n,a),l=new Set(t.map(e=>e.kind));r.push({type:"cluster",kind:1===l.size?t[0].kind:gi,members:t})}n=a}return r}($e),Fe=e=>"cluster"===e.type?`fold-${e.members[0].key}`:e.mark.key,Te=/* @__PURE__ */new Map;for(const e of ze)if("cluster"===e.type)for(const t of e.members)Te.set(t.key,Fe(e));const Ee=q??V??G,Be=je.find(e=>"cluster"===e.type&&(e=>"cluster"===e.type?`cluster-${e.members[0].key}`:e.mark.key)(e)===Ee)??ze.find(e=>"cluster"===e.type&&Fe(e)===Ee),Ie=e=>({x:e.baseX,widthPx:e.widthPx}),Oe=Be&&"cluster"===Be.type?Be.members.map(Ie):f?$e.filter(e=>e.ms>=f[0]&&e.ms<=f[1]).map(Ie):[],_e=Oe.length>1?Pi(ge,Oe,ue):ge,qe=_e!==ge;if(qe)for(const e of $e)e.isCap||(e.x=_e.xByMs(e.ms));const He=$e.some(e=>e.x<14),Ue=qe&&Be?Ee:null,Ve=e=>({key:e.key,mark:e,members:[e],x:e.x,kind:e.kind,openable:!1}),Ye=ie?$e.map(Ve):ze.flatMap(e=>{if("item"===e.type)return[Ve(e.mark)];const t=Fe(e);if(t===Ue&&(r=e.members).every((e,t)=>0===t||e.x-r[t-1].x>=16))return e.members.map(Ve);var r;const n=e.members.map(e=>e.x);return[{key:t,mark:null,members:e.members,x:n.reduce((e,t)=>e+t,0)/n.length,kind:e.kind,openable:new Set(e.members.map(e=>e.ms)).size>1}]}),Ge=/* @__PURE__ */new Map;for(const e of Ye)for(const t of e.members)Ge.set(t.key,e.key);const Xe=ze.find(e=>"cluster"===e.type&&Fe(e)===Ue),Ze=Xe&&"cluster"===Xe.type?{from:Math.min(...Xe.members.map(e=>e.x))-16,to:Math.max(...Xe.members.map(e=>e.x))+16}:null,Je=Se(Ue),[Qe,et]=Le(!1);Pe(()=>{if(Je.current===Ue)return;Je.current=Ue,et(!0);const e=setTimeout(()=>et(!1),240);return()=>clearTimeout(e)},[Ue]);const tt=$e.map(e=>`${e.key} ${e.label} ${e.dateText}`).join("|");Si(()=>{const e=j.current;if(!e)return;const t={};for(const r of Array.from(e.children)){const e=r.dataset.laneKey,n=r.getBoundingClientRect().width;e&&n>0&&(t[e]=n)}O(e=>function(e,t){const r=Object.keys(e);return r.length===Object.keys(t).length&&r.every(r=>Math.abs((e[r]??0)-(t[r]??0))<.5)}(e,t)?e:t)},[tt]);const rt=`${s}|${r}|${$e.map(e=>`${e.key}@${e.ms}`).join("|")}`,[nt,at]=Le(rt),lt=b&&nt===rt;Pe(()=>{nt!==rt&&at(rt)},[nt,rt]);const it=Math.min(28,340/Math.max(1,$e.length-1)),ot=Ai(u?.stops),st=r=>{const n=Math.min(Math.max(r,e),t);if(!ot)return n;let a=ot[0];for(const e of ot)Math.abs(e-n)<Math.abs(a-n)&&(a=e);return a},ct=u?st(u.valueMs):null,dt=h&&u?ve.filter(e=>!ot||ot.includes(e.ms)).map(e=>({key:e.key,ms:e.ms})):[],ut=function(e,t,r={}){const n=Number.isFinite(r.speed)&&(r.speed??0)>0?r.speed:1,a=Math.max(0,r.dwellMs??700)/n,l=t.filter(e=>Number.isFinite(e.ms)).slice().sort((e,t)=>e.ms-t.ms),i=[];for(let t=0;t+1<l.length;t++){const o=l[t],s=l[t+1],c=e.xByMs(o.ms),d=e.xByMs(s.ms),u=Math.max(0,d-c),h=u<=.5||r.reducedMotion?0:bi(350*u/100,450,1400)/n;i.push({fromKey:o.key,toKey:s.key,fromMs:o.ms,toMs:s.ms,fromPx:c,toPx:d,lengthPx:u,durationMs:h,dwellMs:a,msByPx:e.msByPx})}return i}(_e,dt,{speed:h?.speed,reducedMotion:M}),[ht,mt]=Le(null),pt=Se(null),gt=Se({segments:ut,value:ct,playback:h});Pe(()=>{gt.current={segments:ut,value:ct,playback:h}});const ft=Se(null),bt=Ce(e=>{null===e&&null===ft.current||(ft.current=e,gt.current.playback?.onProgress?.(e))},[]),yt=Ce(()=>{pt.current=null,mt(null),bt(null),gt.current.playback?.onStop?.()},[bt]),xt=!!h?.playing&&!!u;Pe(()=>{if(!xt)return;const e=gt.current,t=null===e.value?-1:e.segments.findIndex(t=>t.fromMs===e.value);if(t<0)return void yt();pt.current&&pt.current.index===t||(pt.current={index:t,phase:"rest",t:0,restLeftMs:e.segments[t].dwellMs,sinceMs:null});let r,n=0;const a=e=>mt(t=>t&&t.px===e.px&&t.ms===e.ms?t:e),l=()=>{clearTimeout(r);const e=pt.current;"rest"===e?.phase&&(r=setTimeout(i,Math.max(0,e.restLeftMs)))},i=()=>{const e=pt.current;if("rest"!==e?.phase)return;const t=gt.current.segments[e.index];t?(pt.current={index:e.index,phase:"glide",t:0,restLeftMs:0,sinceMs:null},a(xi(t,0))):yt()},o=e=>{const t=gt.current,r=pt.current;if(!r)return;const i=function(e,t,r){const n=e[t.index];if(!n)return{cursor:null,at:null,arrived:null,progress:null};const a=null===t.sinceMs?0:Math.max(0,r-t.sinceMs);if("rest"===t.phase){const e=t.restLeftMs-a;return e>0?{cursor:{...t,restLeftMs:e,sinceMs:r},at:xi(n,0),arrived:null,progress:null}:{cursor:{index:t.index,phase:"glide",t:0,restLeftMs:0,sinceMs:r},at:xi(n,0),arrived:null,progress:null}}const l=n.durationMs>0?Math.min(1,t.t+a/n.durationMs):1,i=xi(n,l);if(l<1)return{cursor:{...t,t:l,sinceMs:r},at:i,arrived:null,progress:{fromKey:n.fromKey,toKey:n.toKey,t:yi(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=ve.filter(e=>!e.provisional),wt=u?ht?ht.ms:ct:void 0!==i?i:vt.length>0?null===C?vt[vt.length-1].ms:Math.min(vt[vt.length-1].ms,C):null,Nt=new Set(x??[]),kt=$e.filter(e=>Nt.has(e.key)).map(e=>e.x),$t=kt.length>0?{from:Math.min(...kt),to:Math.max(...kt)}:null,Mt=Ce(()=>{clearTimeout(T.current),clearTimeout(E.current),W(null),_(null),U(null),Y(null),X(null)},[]);Pe(()=>()=>{clearTimeout(T.current),clearTimeout(E.current)},[]),Pe(()=>{const e=B.current;e&&(B.current=null,F.current.get(e)?.focus())});const Ct=null!==K||null!==q||null!==V||null!==G;Pe(()=>{if(Ct)return H(e=>"Escape"===e.key&&(Mt(),!0))},[Ct,Mt]);const Lt=Ce((e,t)=>{if(!e)return;const r=e.offsetWidth/2;let n=r>0?Math.max(r,Math.min(t,se-r)):t;const a=e.parentElement;if(r>0&&a){const t=N(e),l=a.getBoundingClientRect().left,i=t.left+8+r-l,o=t.right-8-r-l;i<=o&&(n=Math.max(i,Math.min(n,o)))}e.style.left=`${n}px`,e.style.setProperty("--rosh-tl-arrow",`${r+(t-n)}px`)},[se]),St=Ye.find(e=>e.key===K)??null,Dt=St?St.x:0;Si(()=>{Lt(z.current,Dt)},[Lt,K,Dt]);const Pt=ct??void 0,At=Se(null);Pe(()=>{if(void 0===Pt)return;const e=_e.xByMs(Pt),t=At.current;if(At.current=e,null===t||e<=t)return;const r=[];for(const n of $e){if(n.x<=t||n.x>e)continue;const a=F.current.get(Ge.get(n.key)??n.key);a&&(a.classList.add("is-hit"),r.push(setTimeout(()=>a.classList.remove("is-hit"),460)))}return()=>{for(const e of r)clearTimeout(e)}},[Pt]);const jt=Ye.map(e=>e.key),zt=xe?Ge.get(xe)??null:null,Ft=J&&jt.includes(J)?J:zt&&jt.includes(zt)?zt:jt[0],Tt=e=>{const t=jt.indexOf(e.target.dataset?.timelineKey??"");if(t<0)return;const r="ArrowRight"===e.key||"ArrowDown"===e.key?t+1:"ArrowLeft"===e.key||"ArrowUp"===e.key?t-1:"Home"===e.key?0:"End"===e.key?jt.length-1:-1;r<0||r>jt.length-1||(e.preventDefault(),Q(jt[r]),F.current.get(jt[r])?.focus())},Et=()=>clearTimeout(E.current),Bt=e=>{Et(),X(e)},It=()=>{clearTimeout(E.current),E.current=setTimeout(()=>X(null),260)},Ot=e=>{Ue&&Te.get(e)===Ue?Et():(Et(),X(null))},Rt=e=>{clearTimeout(T.current),W(e),_(e),v?.((e=>{const t=Ye.find(t=>t.key===e);return t?.members[0]?.key??e})(e))},Wt=e=>{W(t=>t===e?null:t),clearTimeout(T.current),T.current=setTimeout(()=>_(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":Li(e),"aria-describedby":K===e.key?ee:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?F.current.set(e.key,t):F.current.delete(e.key)},onMouseEnter:()=>{Ot(e.key),Rt(e.key)},onMouseLeave:()=>{It(),Wt(e.key)},onFocus:()=>{Ot(e.key),Rt(e.key),Q(e.key)},onBlur:()=>{It(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),e.onClick?.(),e.isItem&&d?.(e.key)}}),_t=e=>{return{type:"button","data-timeline-node":"fold","data-timeline-key":e.key,"data-timeline-count":String(e.members.length),"aria-label":(t=e.members,r=S,r.events(t.length,t.map(Li))),"aria-describedby":K===e.key?ee:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?F.current.set(e.key,t):F.current.delete(e.key)},onMouseEnter:()=>{e.openable?Bt(e.key):Rt(e.key)},onMouseLeave:()=>{It(),Wt(e.key)},onFocus:()=>{Et(),Rt(e.key),Q(e.key)},onBlur:()=>{It(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{if(t.stopPropagation(),!e.openable)return void Rt(e.key);Bt(e.key);const r=e.members[0];Q(r.key),B.current=r.key}};var t,r},qt="lanes"!==s||$e.length>1;if(ie)/* @__PURE__ */
|
|
411
|
-
return Re("div",{ref:L,children:/* @__PURE__ */Re(Ti,{marks:$e.filter(e=>!e.isCap),pending:l,currentKey:xe,todayMs:C,reveal:lt,ariaLabel:y,step:it,nodeProps:Kt,onKeyDown:Tt})});const Ht=(e,t)=>null==e||!1===e?null:/* @__PURE__ */Re("span",{"aria-hidden":"true",className:"rosh-tl-flank"+(t?" is-end":""),"data-timeline-part":t?"end-caption":"start-caption",style:{paddingTop:ce.rail-3+"px"},children:e});/* @__PURE__ */
|
|
412
|
-
return We("div",{ref:L,className:"rosh-tl-body"+(l.length>0&&!k?"":" is-solo"),children:[
|
|
413
|
-
/* @__PURE__ */We("div",{className:"flex items-stretch gap-3",children:[k&&Ht(De,!1),
|
|
414
|
-
/* @__PURE__ */Re("div",{className:"rosh-tl-stage",style:{height:`${qi(ce,qt,p.length>0&&!k)}px`},children:/* @__PURE__ */We("div",{ref:A,className:`rosh-tl-layer${Qe?" is-zooming":""}${ht?" is-gliding":""}`,onMouseMove:e=>{if(!Ze)return;const t=A.current?.getBoundingClientRect();if(!t)return;const r=e.clientX-t.left;r>=Ze.from&&r<=Ze.to?Et():It()},onMouseLeave:It,children:[!k&&/* @__PURE__ */Re(ji,{marks:$e,innerRef:j}),
|
|
415
|
-
/* @__PURE__ */Re(Ei,{axis:_e,geo:ce,fillTo:wt,reveal:lt,trackPx:ue,tweened:!!u}),de&&
|
|
416
|
-
/* @__PURE__ */Re("i",{"aria-hidden":"true",className:"rosh-tl-tail","data-timeline-part":"tail",style:{left:`${ue}px`,width:se-ue+"px",top:ce.rail+3-1+"px"}}),$t&&/* @__PURE__ */Re("div",{"aria-hidden":"true",className:"rosh-tl-band","data-timeline-part":"highlight",style:{left:$t.from-10+"px",width:$t.to-$t.from+20+"px",top:ce.rail-7+"px",height:"20px"}}),
|
|
417
|
-
/* @__PURE__ */Re(zi,{startMs:e,endMs:t,axis:_e,geo:ce,reveal:lt}),
|
|
418
|
-
/* @__PURE__ */Re(Bi,{geo:ce,caption:k?null:De,endCaption:k?null:m?.end,around:He,reveal:lt,trackPx:se}),k&&/* @__PURE__ */Re(Oi,{nodes:Ye,geo:ce,reveal:lt}),null!==C&&C>e&&C<=t+Vl&&/* @__PURE__ */Re(Ii,{x:_e.xByMs(Math.min(C,t)),geo:ce,trackPx:se,label:P(C),reveal:lt}),!k&&p.map(e=>/* @__PURE__ */Re(Ri,{phase:e,geo:ce,xOf:_e.xByMs},e.key)),
|
|
419
|
-
/* @__PURE__ */Re("ol",{className:"rosh-tl-nodes","aria-label":y,onKeyDown:Tt,children:Ye.map((e,t)=>{const r=t=>null!==t&&e.members.some(e=>e.key===t),n=`${ce.rail+3}px`,a=lt?oi(t,it):{},l=(e=>!!$t&&e.x>=$t.from-.5&&e.x<=$t.to+.5)(e)?" is-lit":"";if(e.mark?.isCap)/* @__PURE__ */
|
|
420
|
-
return Re("li",{children:/* @__PURE__ */Re("button",{...Kt(e.mark),className:`rosh-tl-node rosh-tl-mark is-cap${l}${lt?" rosh-tl-pop":""}`,style:{left:`${e.x}px`,top:n,...a}})},e.key);if(!e.mark){const t=e.kind===gi,i=Ci(t?"default":e.kind,"key"),o=t?void 0:ki[e.kind]?.glyph;/* @__PURE__ */
|
|
421
|
-
return We("li",{...r(xe)?{"aria-current":"step"}:{},children:[
|
|
422
|
-
/* @__PURE__ */We("button",{..._t(e),className:`${i.className} is-fold${t?" is-mixed":""}${r(c)?" is-active":""}${l}${lt?" rosh-tl-pop":""}`,style:{...i.style,left:`${e.x}px`,top:n,...a},children:[o&&/* @__PURE__ */Re(ci,{name:o}),t&&/* @__PURE__ */We("span",{"aria-hidden":"true",className:"rosh-tl-foldnum",children:["×",e.members.length]})]}),!t&&/* @__PURE__ */We("i",{"aria-hidden":"true",className:"rosh-tl-count"+(lt?" rosh-tl-fade":""),style:{left:`${e.x}px`,top:n},children:["×",e.members.length]})]},e.key)}const i=e.mark,o=Ci(i.kind,i.role,i.provisional),{glyph:s}=i;/* @__PURE__ */
|
|
423
|
-
return Re("li",{...i.key===xe?{"aria-current":"step"}:{},children:/* @__PURE__ */We("button",{...Kt(i),className:`${o.className}${i.key===c?" is-active":""}${l}${lt?" rosh-tl-pop":""}`,style:{...o.style,left:`${i.x}px`,top:n,...a},children:[s&&/* @__PURE__ */Re(ci,{name:s}),"current"===i.role&&/* @__PURE__ */Re("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(lt?" is-on":"")})]})},i.key)})}),"lanes"===s?/* @__PURE__ */Re(Ki,{groups:je,trackPx:se,geo:ce,startMs:e,endMs:t,currentKey:xe,hoveredKey:R,reveal:lt,step:it,zoomedKey:Ue,popId:te,aimBubble:Lt,startCaptionPx:Ae,openCluster:q,setOpenCluster:U,previewCluster:V,setPreviewCluster:Y,setZoomKey:X}):"active"===s?/* @__PURE__ */Re(Wi,{nodes:Ye,trackPx:se,geo:ce,activeKey:c,hoveredKey:R,currentKey:xe}):null,St&&/* @__PURE__ */Re("div",{ref:z,id:ee,role:"tooltip",className:"rosh-tl-bubble"+(St.members.some(e=>e.preview)?" is-preview":""),"data-timeline-part":"tooltip",style:{top:`${ce.rail+6+6}px`},onMouseEnter:()=>{Et(),Rt(St.key)},onMouseLeave:()=>{It(),Wt(St.key)},onFocus:()=>{Et(),Rt(St.key)},onBlur:()=>{It(),Wt(St.key)},children:St.mark?/* @__PURE__ */We(Ke,{children:[
|
|
424
|
-
/* @__PURE__ */Re("span",{className:"rosh-tl-name",children:St.mark.label}),
|
|
425
|
-
/* @__PURE__ */Re("span",{className:"rosh-tl-date",children:St.mark.dateText}),St.mark.preview?/* @__PURE__ */Re("div",{className:"rosh-tl-preview","data-timeline-part":"preview",children:St.mark.preview}):St.mark.detail&&/* @__PURE__ */Re("span",{className:"rosh-tl-detail",children:St.mark.detail}),(St.mark.onOpen??St.mark.onClick)&&/* @__PURE__ */Re("button",{type:"button",className:"rosh-tl-bubble-open text-blue-600","data-timeline-part":"bubble-open",onClick:()=>(St.mark?.onOpen??St.mark?.onClick)?.(),children:S.openButton})]}):
|
|
426
|
-
/* @__PURE__ */We("div",{className:"rosh-tl-fold-list","data-timeline-part":"fold-members",children:[
|
|
427
|
-
/* @__PURE__ */We("p",{className:"rosh-tl-popover-head",children:["×",St.members.length]}),
|
|
428
|
-
/* @__PURE__ */Re("ol",{children:St.members.map(e=>/* @__PURE__ */We("li",{children:[
|
|
429
|
-
/* @__PURE__ */We("p",{className:"rosh-tl-foldrow",children:[
|
|
430
|
-
/* @__PURE__ */Re("span",{children:e.label}),
|
|
431
|
-
/* @__PURE__ */Re("span",{className:"rosh-tl-date",children:e.dateText})]}),e.preview?/* @__PURE__ */Re("div",{className:"rosh-tl-preview","data-timeline-part":"preview",children:e.preview}):e.detail&&/* @__PURE__ */Re("span",{className:"rosh-tl-detail",children:e.detail})]},e.key))})]})}),u&&null!==ct&&
|
|
432
|
-
/* @__PURE__ */Re(_i,{thumb:u,value:ct,snap:st,axis:_e,geo:ce,startMs:e,endMs:t,trackPx:se,layerRef:A,glide:ht,onScrub:h?yt:void 0,nodes:dt,onProgress:bt})]})}),k&&Ht(m?.end,!0)]}),l.length>0&&!k&&/* @__PURE__ */Re(Fi,{pending:l,reveal:lt})]})}function Ui({icon:e,heading:t,subject:r,meta:n=[],actions:a,footer:l,children:i}){const o=[...r?[/* @__PURE__ */Re("b",{children:r},"subject")]:[],...n.filter(e=>null!=e&&!1!==e&&""!==e)];/* @__PURE__ */
|
|
433
|
-
return We("section",{className:"rosh-tl-card border-gray-200 bg-gray-50",children:[
|
|
434
|
-
/* @__PURE__ */We("div",{className:"rosh-tl-head",children:[
|
|
435
|
-
/* @__PURE__ */We("div",{className:"rosh-tl-head-main text-gray-800",children:[e&&/* @__PURE__ */Re("span",{className:"rosh-tl-ico","aria-hidden":"true",children:e}),
|
|
436
|
-
/* @__PURE__ */Re("h4",{className:"rosh-tl-title",children:t}),o.length>0&&/* @__PURE__ */Re("p",{className:"rosh-tl-meta text-gray-500",children:o.map((e,t)=>
|
|
437
|
-
/* @__PURE__ */We(Ee,{children:[t>0&&/* @__PURE__ */Re("span",{"aria-hidden":"true",children:" · "}),e]},t))})]}),a&&/* @__PURE__ */Re("span",{className:"rosh-tl-head-actions",children:a})]}),i,l&&/* @__PURE__ */Re("div",{className:"rosh-tl-foot border-gray-200",children:l})]})}function Vi({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=Z(Date.now,null),h=[],m=[],p=ae().timeline,g=ne();for(const e of n){const t=Yl(e.date??null);null===t?m.push({key:e.key,label:e.label,kind:e.kind}):h.push({...e,ms:t})}h.sort((e,t)=>e.ms-t.ms);const f=Yl(l??null);let b,y,x=!0;0===h.length?(y=f??u??0,b=y-30*Vl,x=null!==f||null!==u):(b=h[0].ms,y=f??h[h.length-1].ms,y-b<Vl&&(y=b+Vl));const v=h.length>0?Math.max(0,Math.round((y-b)/Vl)):0,w=a??(v>0?p.duration(v):void 0),N=[h.length>0?p.started(Gl(h[0].ms,g)):void 0,w,m.length>0?p.reached(h.length,n.length):void 0],k=h.map(e=>{return{key:e.key,ms:e.ms,kind:e.kind,label:e.label,detail:e.detail,preview:e.preview,glyph:e.glyph,onClick:e.onClick,onOpen:e.onOpen,priority:(t=e.kind,"dfm"===t?1:0),caption:e.caption,provisional:e.provisional};var t}),$={};for(const e of h)e.phase&&($[e.phase]=$[e.phase]||[]).push(e.ms);const M=Object.entries($).filter(([,e])=>e.length>=2).map(([e,t])=>({key:e,label:i?.[e]??e,minMs:Math.min(...t),maxMs:Math.max(...t)})),C="rail"===o,L=x&&/* @__PURE__ */Re("div",{className:"select-none",children:/* @__PURE__ */Re(Hi,{axis:C?"spread":"compressed",labels:C?"none":"lanes",items:k,pending:m,phases:M,startMs:b,endMs:y,todayMs:u??void 0,edgeCaptions:s,highlightKeys:c,onHoverChange:d,ariaLabel:p.milestones(e)})});/* @__PURE__ */
|
|
438
|
-
return Re("div",C?{className:"shrink-0","data-timeline-variant":"rail",children:L}:{className:"shrink-0",children:/* @__PURE__ */Re(Ui,{icon:/* @__PURE__ */Re(di,{}),heading:t??e,subject:r,meta:N,children:L})})}var Yi=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),Gi=[{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 Xi(e){if(e.order_qty<=0)return 0;let t=0;for(const r of Gi)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function Zi(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+Xi(t),0)/t.length}function Ji(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:n,poStatus:a,poNumber:l="",currentReportId:i,currentReportDate:o,msPerDayOfPlayback:s=500,markers:c=[]}=e,[d,u]=Le(null),h=ae().production;Pe(()=>{o?u(new Date(o).getTime()):t.length>0&&u(new Date(t[0].date).getTime())},[i]);const[m,p]=Le(!1),g=Se(null),f=()=>{null!=g.current&&(cancelAnimationFrame(g.current),g.current=null),p(!1)};Pe(()=>()=>f(),[]),Pe(()=>{f()},[i]);const b=t.map(e=>Yl(e.date)).filter(e=>null!=e),y=Z(Date.now,null)??Math.max(0,...b,...c.map(e=>Yl(e.date)??0),Yl(r??null)??0,Yl(n??null)??0),x=b.length?Math.min(...b):y,v=b.length?Math.max(...b):y,w=Yl(r??null)??x,N=Yl(n??null)??0,k=Yi.has((a||"").toLowerCase()),$=c.reduce((e,t)=>{const r=Yl(t.date);return null!=r&&r>e?r:e},0),M=(()=>{const e=[N,v,$,w+Vl];return k||e.push(y),Math.max(...e)})(),C=Math.max(1,Math.round((M-w)/Vl)),L=Yl(o??null)??v??w,S=Math.min(Math.max(d??L,w),M),D=t.find(e=>{const t=Yl(e.date);return null!=t&&t<=S})??null;let P=null;for(let e=t.length-1;e>=0;e--){const r=Yl(t[e].date);if(null!=r&&r>S){P=t[e];break}}const A=(()=>{if(D||!P||0===t.length)return null;const e=(t[t.length-1].items??[]).map((e,t)=>({id:`zero-${e.part_number}-${t}`,part_number:e.part_number,description:e.description??"",order_qty:Number(e.order_qty||0),casting:0,cnc:0,painting:0,packing:0,finished_goods:0,stock_qty:0}));return{id:`zero-${l}`,progress_number:h.start,date:r||new Date(w).toISOString().slice(0,10),items:e,est_completion_date:n??null,created_by_name:"",notes:""}})(),j=D??A,z=D?Yl(D.date):A?w:null,F=P?Yl(P.date):null,T=!!(j&&P&&null!=z&&null!=F&&S>z&&S<F);let E,B;if(T&&null!=z&&null!=F){const e=(S-z)/Math.max(F-z,1),t=(t,r)=>Math.round(t+(r-t)*e),r={};for(const e of j?.items??[])r[e.part_number]=e;const n={};for(const e of P?.items??[])n[e.part_number]=e;const a=Array.from(/* @__PURE__ */new Set([...Object.keys(r),...Object.keys(n)])).map((e,a)=>{const l=r[e]??{},i=n[e]??{},o=e=>Number(e)||0;return{id:`interp-${e}-${a}`,part_number:e,description:l.description??i.description??"",order_qty:o(l.order_qty??i.order_qty??0),casting:t(o(l.casting),o(i.casting)),cnc:t(o(l.cnc),o(i.cnc)),painting:t(o(l.painting),o(i.painting)),packing:t(o(l.packing),o(i.packing)),finished_goods:t(o(l.finished_goods),o(i.finished_goods)),stock_qty:t(o(l.stock_qty),o(i.stock_qty))}}),l=Yl(j?.est_completion_date),i=Yl(P?.est_completion_date);let o;o=null!=l&&null!=i?new Date(Math.round(l+(i-l)*e)).toISOString().slice(0,10):j?.est_completion_date||P?.est_completion_date||null,E={id:`interp-${S}`,progress_number:h.estimated,date:new Date(S).toISOString().slice(0,10),created_by_name:"",est_completion_date:o,items:a,notes:""},B=j}else if(E=j??t[t.length-1]??null,E){const e=t.findIndex(e=>e.id===E.id);B=e>=0&&e<t.length-1?t[e+1]:null}else B=null;const I={};for(const e of B?.items??[])I[e.part_number]=e;const O=!(!i||E?.id===i),R=i?Math.min(Yl(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:S,setScrubMs:e=>{f(),u(e)},resetToCurrent:()=>{f(),o&&u(new Date(o).getTime())},scrubbedAway:O,beforeAnchor:j,nextAfter:P,displayed:E,prevReport:B,prevByPN:I,isInterpolated:T,playing:m,startPlay:()=>{if(m)return void f();if(R<=w)return void u(R);p(!0),u(w);let e=performance.now(),t=w;const r=n=>{const a=n-e;if(e=n,t+=a/s*Vl,t>=R)return u(R),g.current=null,void p(!1);u(t),g.current=requestAnimationFrame(r)};g.current=requestAnimationFrame(r)},stopPlay:f,reports:t,markers:c,poNumber:l,currentReportId:i,currentReportProgressNumber:W,estCompletionMs:Yl(n??null)}}function Qi({startMs:e,endMs:t,reports:r,markers:n,valueMs:a,activeId:l,onChange:i,onPickReport:o,onOpenReport:s,onOpenMarker:c,onDragStart:d,renderReportPreview:u,reportLabel:h,playback:m,edgeCaptions:p,bare:g=!1,endMark:f=null}){const b=ae().production,y=ne(),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__ */
|
|
439
|
-
return Re("div",{className:"select-none",children:/* @__PURE__ */Re(Hi,{axis:g?"spread":"linear",labels:g?"none":"active",endMark:g?f:null,items:v,markers:k,startMs:e,endMs:t,activeKey:l,onActivate:e=>{const t=w.get(e);null!=t&&i(t),o(e)},playback:m,edgeCaptions:p,thumb:{valueMs:a,onChange:i,onDragStart:d,stops:N,ariaLabel:b.scrub,valueText:e=>{const t=(e=>x.find(t=>t.ms===e)?.report)(e);return t?`${h(t)} · ${Gl(e,y)}`:Gl(e,y)}},ariaLabel:b.label(Gl(e,y),Gl(t,y))})})}function eo({snapshot:e,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,onScrubProgress:l,heading:i,edgeCaptions:o,reportLabel:s=e=>e.progress_number,resetLabel:c,variant:d="card",onPlayStart:u}){const{reports:h,markers:m,poNumber:p,startMs:g,endMs:f,totalLeadDays:b,scrubMs:y,setScrubMs:x,displayed:v,scrubbedAway:w,resetToCurrent:N,currentReportId:k,currentReportProgressNumber:$,estCompletionMs:M}=e,C=function(e,t,r){const[n,a]=Le(!1),l=Se(!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=>Yl(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),x,u),L=ae().production,S=ne(),D=i??L.heading,P=e=>Gl(e,S);if(0===h.length&&0===m.length)return null;const A=m.filter(e=>"shipment"===e.kind),j=m.filter(e=>"inspection"===e.kind),z=m.filter(e=>"invoice"===e.kind),F=(v?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),T=v?Zi(v):0,E=h.find(e=>e.id===k),B=E?s(E):$,I=
|
|
440
|
-
/* @__PURE__ */We("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__ */Re(Ne,{name:"pause","aria-hidden":"true"}):/* @__PURE__ */Re(Ne,{name:"play","aria-hidden":"true"}),
|
|
441
|
-
/* @__PURE__ */Re("span",{children:C.playing?L.pause:L.play})]}),O=w&&(c??B)?/* @__PURE__ */Re("button",{type:"button",onClick:()=>{C.stop(),N()},className:"text-xs text-blue-600 underline-offset-4 hover:underline font-medium",children:c??L.backTo(String(B))}):null,[R,W]=oe(L.showing),K=e=>/* @__PURE__ */Re("p",{className:"rosh-tl-status text-gray-800",children:v?/* @__PURE__ */We(Ke,{children:[e&&R,
|
|
442
|
-
/* @__PURE__ */Re("b",{className:"font-medium",children:s(v)}),e&&W,
|
|
443
|
-
/* @__PURE__ */We("span",{className:"text-gray-500",children:[" · ",P(new Date(v.date).getTime())," · ",L.overall(Math.round(T))," · ",L.inStock(F)]})]}):/* @__PURE__ */Re("span",{className:"text-gray-500",children:L.noReport})});if("rail"===d){const e=null!=M&&M>=f&&f>g,i=e?{key:"__estimate__",label:L.estimatedCompletion,dateText:P(M)}:null;/* @__PURE__ */
|
|
444
|
-
return We("div",{className:"shrink-0","data-timeline-variant":"rail",children:[
|
|
445
|
-
/* @__PURE__ */Re(Qi,{bare:!0,endMark:i,startMs:g,endMs:f,reports:h,markers:m,valueMs:y,activeId:v?.id??"",onChange:x,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,reportLabel:s,edgeCaptions:{start:o?.start??L.start,end:o?.end??(e?L.estDone:void 0)},onDragStart:C.stop,playback:{playing:C.playing,onArrive:(e,t)=>x(t),onProgress:l,onStop:C.stop}}),
|
|
446
|
-
/* @__PURE__ */We("div",{className:"rosh-tl-railrow","data-timeline-part":"rail-row",children:[I,O,K(!1)]})]})}/* @__PURE__ */
|
|
447
|
-
return Re("div",{className:"shrink-0",children:/* @__PURE__ */Re(Ui,{icon:/* @__PURE__ */Re(ui,{}),heading:D,subject:p,meta:[`${P(g)} → ${P(f)}`,L.leadTime(b)],actions:/* @__PURE__ */We(Ke,{children:[O,I]}),footer:/* @__PURE__ */We(Ke,{children:[K(!0),
|
|
448
|
-
/* @__PURE__ */We("div",{className:"rosh-tl-legend",children:[h.length>0&&/* @__PURE__ */We("span",{className:"border-gray-200 text-gray-500",children:[
|
|
449
|
-
/* @__PURE__ */Re("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),L.report]}),A.length>0&&/* @__PURE__ */We("span",{className:"border-gray-200 text-gray-500",children:[
|
|
450
|
-
/* @__PURE__ */Re("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */Re(ci,{name:"truck"})}),L.shipment]}),j.length>0&&/* @__PURE__ */We("span",{className:"border-gray-200 text-gray-500",children:[
|
|
451
|
-
/* @__PURE__ */Re("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */Re(ci,{name:"flask"})}),L.inspection]}),z.length>0&&/* @__PURE__ */We("span",{className:"border-gray-200 text-gray-500",children:[
|
|
452
|
-
/* @__PURE__ */Re("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */Re(ci,{name:"receipt"})}),L.invoice]})]})]}),children:/* @__PURE__ */Re(Qi,{startMs:g,endMs:f,reports:h,markers:m,valueMs:y,activeId:v?.id??"",onChange:x,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,reportLabel:s,edgeCaptions:o,onDragStart:C.stop,playback:{playing:C.playing,onArrive:(e,t)=>x(t),onProgress:l,onStop:C.stop}})})})}var to=e=>"number"==typeof e?e:parseInt(String(e??""))||0;function ro({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=ae().containers,m=s?e.filter(s):e,p=e=>to(i(e)),g=e=>to(o(e)),f=m.some(e=>null!=o(e)&&g(e)>0),b=e=>f?p(e):"actual"===a?o(e)??i(e)??0:i(e)??0,y=m.reduce((e,t)=>e+to(b(t)),0),x=m.filter(e=>c(e)).length,v=m.filter(e=>c(e)).reduce((e,t)=>e+to(b(t)),0),w=m.reduce((e,t)=>e+p(t),0),N=m.reduce((e,t)=>e+g(t),0),k=e=>t?.(e)??0,$=r??(e=>k(e)*p(e)),M=n??(e=>k(e)*g(e)),C=m.reduce((e,t)=>e+$(t),0),L=m.reduce((e,t)=>e+M(t),0),S=f?Math.max(C,L):"actual"===a&&L||C,D=S<=34.65?"20ft":"40ft",P="20ft"===D?33:67,A=S>0?Math.max(1,Math.ceil(S/P)):0,j=A*P,z=S>0&&S>=.95*j&&S<=1.1*j;if(0===m.length)return null;const F=(e,t)=>P>0?Math.max(0,Math.min((e-t*P)/P*100,100)):0;/* @__PURE__ */
|
|
453
|
-
return We("div",{className:`mt-2 px-1 space-y-2 ${d??""}`.trim(),style:u,children:[
|
|
454
|
-
/* @__PURE__ */We("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[
|
|
455
|
-
/* @__PURE__ */We("span",{children:[`${h.items(m.length)} · ${h.pieces(y)}`,f&&w!==N&&/* @__PURE__ */Re("span",{className:"ml-1 text-gray-400",children:h.split(w,N)})]}),l&&x>0&&/* @__PURE__ */We("span",{className:"flex items-center gap-1 text-green-600",children:[
|
|
456
|
-
/* @__PURE__ */Re("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"}),h.added(x,v)]})]}),S>0?/* @__PURE__ */We("div",{className:"space-y-2",children:[Array.from({length:A}).map((e,t)=>{const r=F(C,t),n=F(L,t),a=f,l=Math.max(r,n),i=Math.min(r,n),o=r>=n,s=a?o?"bg-blue-500":"bg-green-500":"bg-blue-500",c=a?o?"bg-green-500":"bg-blue-500":"";/* @__PURE__ */
|
|
457
|
-
return We("div",{className:"flex items-center gap-2",children:[
|
|
458
|
-
/* @__PURE__ */Re("span",{className:"text-2xs text-gray-400 w-8 shrink-0",children:D}),
|
|
459
|
-
/* @__PURE__ */We("div",{className:"relative flex-1 h-4 bg-gray-100 rounded-full overflow-hidden border border-gray-200",children:[
|
|
460
|
-
/* @__PURE__ */Re("div",{className:`absolute inset-y-0 left-0 ${s} transition-all`,style:{width:`${l}%`}}),a&&i>0&&/* @__PURE__ */Re("div",{className:`absolute inset-y-0 left-0 ${c} transition-all`,style:{width:`${i}%`}})]}),
|
|
461
|
-
/* @__PURE__ */Re("span",{className:"text-2xs text-gray-500 w-16 text-right",children:a?h.fill(Math.min(L-t*P,P),P):h.fill(Math.min(C-t*P,P),P)})]},`bar-${t}`)}),
|
|
462
|
-
/* @__PURE__ */We("div",{className:"flex items-center justify-between text-xs pt-0.5",children:[
|
|
463
|
-
/* @__PURE__ */We("span",{className:"text-gray-500 inline-flex items-center gap-1",children:[h.total,f?/* @__PURE__ */We(Ke,{children:[
|
|
464
|
-
/* @__PURE__ */We("span",{className:"inline-flex items-center gap-1 text-blue-700",children:[
|
|
465
|
-
/* @__PURE__ */Re("span",{className:"inline-block w-2 h-2 rounded-full bg-blue-500"}),h.instructed(C)]}),
|
|
466
|
-
/* @__PURE__ */Re("span",{className:"text-gray-400",children:"/"}),
|
|
467
|
-
/* @__PURE__ */We("span",{className:"inline-flex items-center gap-1 text-green-700",children:[
|
|
468
|
-
/* @__PURE__ */Re("span",{className:"inline-block w-2 h-2 rounded-full bg-green-500"}),h.loaded(L)]})]}):/* @__PURE__ */Re("b",{className:"text-gray-700",children:h.volume(S)})]}),
|
|
469
|
-
/* @__PURE__ */We("span",{className:"font-medium "+(z?"text-green-600":"text-gray-500"),children:[z&&"✓ ",A," × ",D]})]})]}):/* @__PURE__ */Re("div",{className:"text-xs text-gray-400",children:h.noVolume})]})}var no=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g,ao=e=>s(e.trim());function lo(e){const t=[];let r,n=0,a=0;for(no.lastIndex=0;null!==(r=no.exec(e));)r.index>n&&t.push(e.slice(n,r.index)),void 0!==r[1]?t.push(
|
|
470
|
-
/* @__PURE__ */We("span",{className:"text-gray-400",children:["[",r[1],"]"]},a++)):void 0!==r[3]?t.push(
|
|
471
|
-
/* @__PURE__ */Re("a",{href:ao(r[4])?r[4]:void 0,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline",children:r[3]},a++)):void 0!==r[5]?t.push(
|
|
472
|
-
/* @__PURE__ */Re("strong",{className:"font-semibold text-gray-900",children:r[5]},a++)):void 0!==r[6]?t.push(
|
|
473
|
-
/* @__PURE__ */Re("code",{className:"rounded bg-gray-200 px-1 py-0.5 font-mono text-[0.85em] text-gray-800",children:r[6]},a++)):void 0!==r[7]&&t.push(/* @__PURE__ */Re("em",{children:r[7]},a++)),n=no.lastIndex;return n<e.length&&t.push(e.slice(n)),t}function io({alt:e}){const t=e.replace(/^screenshot:\s*/i,""),r=ae().markdown;/* @__PURE__ */
|
|
474
|
-
return We("div",{className:"my-1 flex items-start gap-2 rounded-lg border border-dashed border-gray-300 bg-gray-50 px-3 py-3 text-gray-500",children:[
|
|
475
|
-
/* @__PURE__ */Re(Ne,{name:"camera",look:"mini",className:"mt-0.5 h-4 w-4 shrink-0","aria-hidden":"true"}),
|
|
476
|
-
/* @__PURE__ */We("span",{className:"text-xs",children:[
|
|
477
|
-
/* @__PURE__ */Re("span",{className:"font-medium text-gray-600",children:`${r.screenshot} — `}),t]})]})}function oo(e,t){const r=[];for(const n of e){const e=t.exec(n);e?r.push(e[1]):r.length&&(r[r.length-1]+=" "+n.trim())}return r}var so=e=>e.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(e=>e.trim());function co(e,t){const r=e.split("\n"),n=r[0],a=/^(#{2,4})\s+(.*)$/.exec(n);if(a&&1===r.length){const e=a[1].length;/* @__PURE__ */
|
|
478
|
-
return Re(`h${e}`,{className:2===e?"mt-2 text-sm font-semibold uppercase tracking-wide text-gray-500":3===e?"mt-1 text-base font-semibold text-gray-900":"mt-1 text-sm font-semibold text-gray-900",children:lo(a[2])},t)}if(1===r.length&&/^---+$/.test(n))/* @__PURE__ */
|
|
479
|
-
return Re("hr",{className:"border-gray-200"},t);if(function(e){return e.length>=2&&e[0].includes("|")&&/^\s*\|?[\s:|-]*-[\s:|-]*\|?\s*$/.test(e[1])&&e[1].includes("-")}(r))return function(e,t){const r=so(e[0]),n=e.slice(2).map(so);/* @__PURE__ */
|
|
480
|
-
return Re("div",{className:"my-1 overflow-x-auto rounded-lg border border-gray-200",children:/* @__PURE__ */We("table",{className:"w-full border-collapse text-sm",children:[
|
|
481
|
-
/* @__PURE__ */Re("thead",{children:/* @__PURE__ */Re("tr",{className:"bg-gray-50",children:r.map((e,t)=>/* @__PURE__ */Re("th",{className:"border-b border-gray-200 px-3 py-2 text-left font-semibold text-gray-700",children:lo(e)},t))})}),
|
|
482
|
-
/* @__PURE__ */Re("tbody",{children:n.map((e,t)=>/* @__PURE__ */Re("tr",{className:"even:bg-gray-50/50",children:e.map((e,t)=>/* @__PURE__ */Re("td",{className:"border-t border-gray-100 px-3 h-8 align-top text-gray-700",children:lo(e)},t))},t))})]})},t)}(r,t);if(/^>\s?/.test(n)){const e=r.map(e=>e.replace(/^>\s?/,"")).join(" ");/* @__PURE__ */
|
|
483
|
-
return Re("div",{className:"my-1 rounded-r-lg border-l-4 border-blue-300 bg-blue-50/60 px-3 py-2 text-gray-700",children:lo(e)},t)}const l=/^!\[([^\]]*)\]\(([^)]+)\)$/.exec(n);if(l&&1===r.length)/* @__PURE__ */
|
|
484
|
-
return Re(io,{alt:l[1]},t);if(/^[-*]\s+/.test(n)){const e=oo(r,/^[-*]\s+(.*)$/);/* @__PURE__ */
|
|
485
|
-
return Re("ul",{className:"list-disc space-y-1 pl-5 marker:text-gray-400",children:e.map((e,t)=>/* @__PURE__ */Re("li",{children:lo(e)},t))},t)}const i=/^(\d+)\.\s+/.exec(n);if(i){const e=oo(r,/^\d+\.\s+(.*)$/);/* @__PURE__ */
|
|
486
|
-
return Re("ol",{start:Number(i[1]),className:"list-decimal space-y-1 pl-5 marker:text-gray-400",children:e.map((e,t)=>/* @__PURE__ */Re("li",{className:"pl-1",children:lo(e)},t))},t)}/* @__PURE__ */
|
|
487
|
-
return Re("p",{children:lo(r.join(" "))},t)}var uo=/^( {0,3})(`{3,}|~{3,})[ \t]*(.*?)[ \t]*$/;function ho(e){const t=e.replace(/\r\n/g,"\n").split("\n"),r=[];let n=[];const a=()=>{for(const e of n.join("\n").split(/\n{2,}/)){const t=e.replace(/\s+$/,"");""!==t.trim()&&r.push({text:t})}n=[]};for(let e=0;e<t.length;e+=1){const l=uo.exec(t[e]);if(!(null!==l&&!("`"===l[2][0]&&l[3].includes("`")))){n.push(t[e]);continue}a();const[,i,o,s]=l,c=[];for(e+=1;e<t.length;e+=1){const r=uo.exec(t[e]);if(null!==r&&r[2][0]===o[0]&&r[2].length>=o.length&&""===r[3])break;c.push(i?t[e].replace(new RegExp(`^ {0,${i.length}}`),""):t[e])}r.push({fence:{lang:s.split(/[ \t]/)[0],code:c.join("\n")}})}return a(),r}function mo({children:e,className:t}){/* @__PURE__ */
|
|
488
|
-
return Re("div",{className:`space-y-3 text-sm leading-relaxed text-gray-700 ${t??""}`.trim(),children:ho(e??"").map((e,t)=>"fence"in e?function({lang:e,code:t},r){/* @__PURE__ */
|
|
489
|
-
return Re("pre",{"data-language":e||void 0,className:"my-1 overflow-x-auto rounded-lg border border-gray-200 bg-gray-50 p-3 font-mono text-xs text-gray-800",children:/* @__PURE__ */Re("code",{children:t})},r)}(e.fence,t):co(e.text,t))})}var po=({open:e})=>/* @__PURE__ */Re(Ne,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function go({docs:e,loading:t=!1,categoryOrder:r,canEdit:n=!1,onNew:l,onEdit:i,renderBody:o,emptyMessage:s}){const c=ae(),[d,u]=Le(""),[h,m]=Le(null),[p,g]=Le({}),f=d.trim().toLowerCase(),b=De(()=>{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]),y=e=>!f||e.title.toLowerCase().includes(f)||e.body.toLowerCase().includes(f)||e.category_label.toLowerCase().includes(f),x=De(()=>b.map(e=>({...e,docs:e.docs.filter(y)})).filter(e=>e.docs.length>0),[b,f]),v=De(()=>x.flatMap(e=>e.docs),[x]),w=(h?v.find(e=>e.slug===h):void 0)??v[0]??null,N=e=>!!f||(p[e]??e===w?.category);/* @__PURE__ */
|
|
490
|
-
return We("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
|
|
491
|
-
/* @__PURE__ */We("aside",{className:"w-64 shrink-0 flex flex-col bg-white rounded-lg shadow overflow-hidden",children:[
|
|
492
|
-
/* @__PURE__ */We("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
|
-
/* @__PURE__ */Re("h2",{className:"text-sm font-semibold text-gray-900",children:c.help.title}),n&&l&&/* @__PURE__ */Re("button",{type:"button",onClick:l,className:"text-xs text-blue-600 hover:underline",children:c.help.newArticle})]}),
|
|
494
|
-
/* @__PURE__ */Re("div",{className:"px-3 py-2 border-b border-gray-100 shrink-0",children:/* @__PURE__ */We("div",{className:"relative",children:[
|
|
495
|
-
/* @__PURE__ */Re(Ne,{name:"search",look:"mini",className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 ${a}`,"aria-hidden":"true"}),
|
|
496
|
-
/* @__PURE__ */Re("input",{type:"text",value:d,onChange:e=>u(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__ */Re("div",{className:"flex-1 overflow-y-auto py-1",children:t?/* @__PURE__ */Re("p",{className:"px-3 py-6 text-center text-xs text-gray-400",children:c.help.loading}):0===x.length?/* @__PURE__ */Re("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:f?c.help.noResults:s??c.help.empty}):x.map(e=>{const t=N(e.key);/* @__PURE__ */
|
|
498
|
-
return We("div",{className:"py-0.5",children:[
|
|
499
|
-
/* @__PURE__ */We("button",{type:"button",onClick:()=>{return t=e.key,g(e=>({...e,[t]:!N(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__ */Re(po,{open:t}),
|
|
501
|
-
/* @__PURE__ */Re("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=w?.slug===e.slug;/* @__PURE__ */
|
|
502
|
-
return We("button",{type:"button",onClick:()=>m(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
|
-
/* @__PURE__ */Re("span",{className:"truncate",children:e.title}),!1===e.is_published&&/* @__PURE__ */Re("span",{className:"ml-auto shrink-0 text-2xs text-amber-600",children:c.help.draft})]},e.slug)})]},e.key)})})]}),
|
|
504
|
-
/* @__PURE__ */Re("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:w?/* @__PURE__ */We(Ke,{children:[
|
|
505
|
-
/* @__PURE__ */We("div",{className:"flex items-start justify-between gap-4 px-5 py-3 border-b border-gray-200 bg-gray-50 shrink-0",children:[
|
|
506
|
-
/* @__PURE__ */We("div",{className:"min-w-0",children:[
|
|
507
|
-
/* @__PURE__ */Re("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:w.title}),
|
|
508
|
-
/* @__PURE__ */We("p",{className:"text-xs text-gray-500 mt-0.5",children:[w.category_label,!1===w.is_published&&/* @__PURE__ */We("span",{className:"ml-2 text-amber-600",children:["· ",c.help.draft]})]})]}),n&&i&&/* @__PURE__ */Re("button",{type:"button",onClick:()=>i(w),className:"shrink-0 text-sm text-blue-600 hover:underline",children:c.help.edit})]}),
|
|
509
|
-
/* @__PURE__ */Re("div",{className:"flex-1 overflow-auto px-5 py-4",children:o?o(w):w.body?/* @__PURE__ */Re(mo,{children:w.body}):/* @__PURE__ */Re("p",{className:"text-sm text-gray-500 italic",children:c.help.noBody})})]}):/* @__PURE__ */Re("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:/* @__PURE__ */Re("p",{className:"text-sm text-gray-500",children:t?c.help.loading:c.help.pickArticle})})})]})}var fo={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 bo({children:e,onClick:t,variant:r="primary",hotkey:n,disabled:a=!1,type:l="button",title:i,className:o=""}){const s=h(n??"");/* @__PURE__ */
|
|
510
|
-
return We("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 ${fo[r]} ${o}`,children:[e,n&&/* @__PURE__ */Re("kbd",{className:"kbd-submit rounded border px-2 py-0.5 text-2xs font-medium",children:s})]})}function yo(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 xo({children:e,count:t}){return null==t?/* @__PURE__ */Re("p",{className:"px-3 pb-1 pt-1 text-2xs font-semibold uppercase tracking-wide text-gray-400",children:e}):/* @__PURE__ */We("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
|
-
/* @__PURE__ */Re("span",{className:"min-w-0 truncate",children:e}),
|
|
512
|
-
/* @__PURE__ */Re("span",{className:"shrink-0 normal-case tracking-normal tabular-nums",children:t})]})}function vo(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 wo({label:e,count:t,active:r,onClick:n,icon:a,trailing:l,severity:i,depth:o=0}){const s=Ol(i,"SidebarNavItem"),c=ae().severity,d=s?(h=c,(u=s).tone?h[u.tone]:h.unrecognised(u.token??"")):void 0;var u,h;const m=/* @__PURE__ */We(Ke,{children:[null!=a&&/* @__PURE__ */Re("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4",children:a}),s&&
|
|
513
|
-
/* @__PURE__ */Re("span",{"aria-hidden":"true",title:d,className:`shrink-0 h-1.5 w-1.5 rounded-full ${s.fill}`}),
|
|
514
|
-
/* @__PURE__ */Re("span",{className:"min-w-0 truncate mr-auto",title:"string"==typeof e?e:void 0,children:e}),s&&/* @__PURE__ */Re("span",{className:"sr-only",children:d}),null!=t&&t>0&&/* @__PURE__ */Re("span",{className:yo(r),children:t}),null!=l&&/* @__PURE__ */Re("span",{className:"shrink-0",children:l})]});/* @__PURE__ */
|
|
515
|
-
return Re("button",1===o?{type:"button",onClick:n,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */Re("span",{className:vo(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 No({label:e,count:t,children:r,defaultExpanded:n=!0,storageKey:a}){const l=Me(),[i,o]=J(()=>{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&&je.toArray(r).some(e=>ze(e)&&!0===e.props.active);/* @__PURE__ */
|
|
516
|
-
return We("div",{children:[
|
|
517
|
-
/* @__PURE__ */We("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
|
-
/* @__PURE__ */Re("span",{className:"min-w-0 truncate",title:e,children:e}),
|
|
519
|
-
/* @__PURE__ */Re(Ne,{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__ */Re("span",{className:yo(s),children:t})]}),
|
|
520
|
-
/* @__PURE__ */Re("div",{id:l,role:"group","aria-label":e,hidden:!i,children:r})]})}function ko({items:e,activeKey:t,onSelect:r,brand:n,actions:a,className:l}){/* @__PURE__ */
|
|
521
|
-
return We("div",{className:`flex h-12 shrink-0 items-stretch gap-1 border-b border-gray-200 bg-white px-3 ${l??""}`,children:[n&&/* @__PURE__ */Re("div",{className:"mr-1 flex items-center gap-2 pr-3 font-semibold text-gray-900",children:n}),
|
|
522
|
-
/* @__PURE__ */Re("nav",{className:"flex items-stretch gap-0.5",children:e.map(e=>{const n=e.key===t;/* @__PURE__ */
|
|
523
|
-
return We("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__ */Re("span",{className:"h-4 w-4 shrink-0",children:e.icon}),
|
|
524
|
-
/* @__PURE__ */Re("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */Re("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__ */Re("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]},e.key)})}),a&&/* @__PURE__ */Re("div",{className:"ml-auto flex items-center gap-2",children:a})]})}var $o=/(^|[\s:])!?z-/,Mo=e=>!!e&&"label"!==e.type&&"divider"!==e.type&&!e.disabled;function Co({trigger:e,items:t,align:r="end",side:n="bottom","aria-label":a,className:l="",triggerClassName:i,menuClassName:o="",minWidth:s=180,linkAs:c,disabled:d,id:u,"aria-describedby":h}){const[m,p]=Le(!1),[g,f]=Le(-1),b=Se(null),y=Se(null),x=Se(null),v=Se({text:"",at:0}),w=Me(),k=Me(),C=u??k,L=Ce(e=>{p(!1),e&&y.current?.focus()},[]),S=(e,r)=>{const n=t.length;for(let a=0;a<n;a+=1){const l=((e+r*a)%n+n)%n;if(Mo(t[l]))return l}return-1},D=()=>x.current?.closest("[data-popup-menu-tree]")??null;Pe(()=>{if(!m)return;const e=e=>{const t=e.target;b.current?.contains(t)||D()?.contains(t)||L(!1)};document.addEventListener("pointerdown",e,!0);const t=U(()=>L(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[m,L]);const P=Ce(()=>{const e=D(),t=y.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=$({trigger:t.getBoundingClientRect(),menu:l,bounds:N(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]);Y(()=>{m&&P()}),Pe(()=>{if(m)return M(()=>y.current,P)},[m,P]),Pe(()=>{if(!m)return;const e=x.current,r=Mo(t[g])?e?.querySelector(`[data-dropdown-index="${g}"]`):null;(r??e)?.focus({preventScroll:!0})},[m,g]),Pe(()=>{if(m)return H(e=>"Escape"===e.key&&(L(!0),!0),()=>x.current)},[m,L]);const A=e=>{f(e),p(!0)},j=e=>{e.disabled||(L(!0),e.onSelect())},F=c??"a",T=(e,t)=>({"data-dropdown-index":e,tabIndex:e===g?0:-1,onMouseEnter:()=>{t.disabled||f(e)}}),R=(e,t)=>{if("divider"===e.type)/* @__PURE__ */
|
|
525
|
-
return Re("div",{role:"separator",children:/* @__PURE__ */Re(E,{})},e.key);if("label"===e.type)/* @__PURE__ */
|
|
526
|
-
return Re("div",{id:`${w}-label-${t}`,children:/* @__PURE__ */Re(B,{children:e.label})},e.key);if("checkbox"===e.type){const r=I(!1,e.disabled,"");/* @__PURE__ */
|
|
527
|
-
return We("button",{type:"button",role:"menuitemcheckbox","aria-checked":e.checked,disabled:e.disabled,className:r.className,style:r.style,onClick:()=>(e=>{e.disabled||e.onSelect()})(e),...T(t,e),children:[
|
|
528
|
-
/* @__PURE__ */Re(O,{kind:"checkbox",checked:e.checked}),e.icon,e.label]},e.key)}if("radio"===e.type){const r=I(!1,e.disabled,"");/* @__PURE__ */
|
|
529
|
-
return We("button",{type:"button",role:"menuitemradio","aria-checked":e.checked,disabled:e.disabled,className:r.className,style:r.style,onClick:()=>j(e),...T(t,e),children:[
|
|
530
|
-
/* @__PURE__ */Re(O,{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=I(!1,e.disabled,"no-underline "+(e.current?"font-medium":""));return e.disabled?/* @__PURE__ */We("a",{role:"menuitem","aria-disabled":"true",className:r.className,style:r.style,...T(t,e),children:[e.icon,e.label]},e.key):/* @__PURE__ */We(F,{href:e.href,role:"menuitem","aria-current":e.current?"page":void 0,className:r.className,style:r.style,onClick:()=>L(!0),...T(t,e),children:[e.icon,e.label]},e.key)}const r=I(e.danger,e.disabled,"");/* @__PURE__ */
|
|
531
|
-
return We("button",{type:"button",role:"menuitem",disabled:e.disabled,className:r.className,style:r.style,onClick:()=>j(e),...T(t,e),children:[e.icon,e.label]},e.key)},W={...$o.test(o)?{}:{zIndex:V.popup},minWidth:s};/* @__PURE__ */
|
|
532
|
-
return We("div",{ref:b,className:`relative inline-flex ${l}`.trim(),children:[
|
|
533
|
-
/* @__PURE__ */Re("button",{ref:y,id:C,type:"button","aria-haspopup":"menu","aria-expanded":m,"aria-controls":m?w:void 0,"aria-label":a,"aria-describedby":h,disabled:d,onClick:()=>m?L(!1):A(S(0,1)),onKeyDown:e=>{"ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),A(S(0,1))):"ArrowUp"===e.key&&(e.preventDefault(),A(S(t.length-1,-1)))},className:i??"inline-flex items-center justify-center rounded-(--radius-control) text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] disabled:cursor-not-allowed disabled:opacity-60",children:e}),m&&
|
|
534
|
-
/* @__PURE__ */Re(z,{portal:!0,className:o,style:W,children:/* @__PURE__ */Re("div",{ref:x,id:w,role:"menu","aria-orientation":"vertical","aria-label":a,"aria-labelledby":a?void 0:C,tabIndex:-1,onKeyDown:e=>{if("ArrowDown"===e.key)e.preventDefault(),f(S(g+1,1));else if("ArrowUp"===e.key)e.preventDefault(),f(S(g-1,-1));else if("Home"===e.key)e.preventDefault(),f(S(0,1));else if("End"===e.key)e.preventDefault(),f(S(t.length-1,-1));else if("Tab"===e.key)e.preventDefault(),L(!0);else if(" "===e.key){const t=e.target;t.matches?.("a[href]")&&(e.preventDefault(),t.click())}else 1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey||(e=>{const r=Date.now(),n=e.key.toLowerCase(),a=r-v.current.at<500?v.current.text+n:n;v.current={text:a,at:r};const l=[...a].every(e=>e===a[0]),i=l?a[0]:a,o=l?g+1:Math.max(g,0),s=x.current,c=t.length;for(let r=0;r<c;r+=1){const n=((o+r)%c+c)%c;if(Mo(t[n])&&(s?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(i))return e.preventDefault(),void f(n)}})(e)},children:(()=>{const e=[];for(let r=0;r<t.length;){const n=t[r];if("radio"!==n.type&&"checkbox"!==n.type){e.push(R(n,r)),r+=1;continue}const a=n.type,l=r,i=[];for(;r<t.length&&t[r].type===a;)i.push(R(t[r],r)),r+=1;const o="label"===t[l-1]?.type?`${w}-label-${l-1}`:void 0;e.push(/* @__PURE__ */Re("div",{role:"group","aria-labelledby":o,children:i},`group:${n.key}`))}return e})()})})]})}function Lo(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function So({at:e,onClose:t,children:r,owner:n,"aria-label":a,minWidth:l=180,className:i="",autoFocus:o=!0}){const s=Se(null),[c,d]=Le(null),u=Se(t);u.current=t,Y(()=>{const t=s.current?.closest("[data-popup-menu-tree]");if(!t)return;const r={width:t.offsetWidth,height:t.offsetHeight},a=L({point:e,menu:r,bounds:N(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=Se(null),m=Se(!1);Pe(()=>(h.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!s.current?.contains(e)||h.current?.focus?.({preventScroll:!0})}),[]),Pe(()=>{c&&!m.current&&o&&(m.current=!0,Lo(s.current)[0]?.focus({preventScroll:!0}))},[c,o]),Pe(()=>{if(o)return;const e=e=>{if(s.current?.contains(document.activeElement))return;const t=Lo(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]),Pe(()=>H(e=>"Escape"===e.key&&(u.current(),!0),()=>s.current),[]),Pe(()=>{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=Ce(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void u.current();const t=Lo(s.current);if(0===t.length)return;const r=t.indexOf(document.activeElement),n="ArrowDown"===e.key?(r+1)%t.length:"ArrowUp"===e.key?r<=0?t.length-1:r-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;n<0||(e.preventDefault(),t[n].focus())},[]),g=c?{left:c.left,top:c.top,maxHeight:c.maxHeight,...c.scroll?{overflowY:"auto"}:{}}:{left:e.x,top:e.y,visibility:"hidden"};/* @__PURE__ */
|
|
535
|
-
return Re(z,{portal:!0,minWidth:l,style:g,onClose:t,className:i,children:/* @__PURE__ */Re(F.Provider,{value:!0,children:/* @__PURE__ */Re("div",{ref:s,role:"menu","aria-label":a,"data-context-menu":"",onKeyDown:p,children:r})})})}function Do(){const[e,t]=Le(null),r=Ce(()=>t(null),[]),n=Ce((e,r)=>{const n="nativeEvent"in e?e.nativeEvent:e;if(T(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=Ce(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 Po="Alt+ArrowUp Alt+ArrowDown";function Ao(e){return!e.altKey||e.ctrlKey||e.metaKey?null:"ArrowUp"===e.key?"up":"ArrowDown"===e.key?"down":null}var jo=/* @__PURE__ */We("svg",{"aria-hidden":"true",viewBox:"0 0 8 14",fill:"currentColor",className:"h-3.5 w-2",children:[
|
|
536
|
-
/* @__PURE__ */Re("circle",{cx:"2",cy:"3",r:"1.1"}),
|
|
537
|
-
/* @__PURE__ */Re("circle",{cx:"6",cy:"3",r:"1.1"}),
|
|
538
|
-
/* @__PURE__ */Re("circle",{cx:"2",cy:"7",r:"1.1"}),
|
|
539
|
-
/* @__PURE__ */Re("circle",{cx:"6",cy:"7",r:"1.1"}),
|
|
540
|
-
/* @__PURE__ */Re("circle",{cx:"2",cy:"11",r:"1.1"}),
|
|
541
|
-
/* @__PURE__ */Re("circle",{cx:"6",cy:"11",r:"1.1"})]});function zo({hint:e,dragging:t,revealClassName:r,marker:n}){const a=ae().tree;/* @__PURE__ */
|
|
542
|
-
return Re(w,{content:e??a.dragHint,side:"left",delay:700,className:"absolute left-0 top-1/2 inline-flex -translate-y-1/2 transition-opacity "+(t?"opacity-0":`opacity-0 ${r}`),children:/* @__PURE__ */Re("span",{"aria-hidden":"true",[`data-${n}-grip`]:"",className:"flex h-4 w-2 items-center justify-center text-gray-400",children:jo})})}function Fo({id:e}){/* @__PURE__ */
|
|
543
|
-
return Re("span",{id:e,hidden:!0,children:ae().tree.moveHint})}var To='[role="treeitem"]';function Eo(e){return[...e.querySelectorAll(To)].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 Bo({"aria-label":e,"aria-labelledby":t,children:r,className:n="",rootProps:a}){const l=Se(null);Y(()=>{const e=l.current;if(!e)return;const t=[...e.querySelectorAll(To)];if(0===t.length)return;const r=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-selected"))??Eo(e)[0]??t[0];for(const e of t)e.tabIndex=e===r?0:-1});const i=Ce(e=>{a?.onKeyDown?.(e);const t=l.current,r=e.target.closest?.(To);if(!t||!r||e.target!==r||e.defaultPrevented)return;if(e.altKey||e.ctrlKey||e.metaKey)return;const n=Eo(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(To))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__ */
|
|
544
|
-
return Re("div",{...a,ref:l,role:"tree","aria-label":t?void 0:e,"aria-labelledby":t,onKeyDown:i,className:`flex flex-col gap-1 ${n}`.trim(),children:r})}function Io({children:e,hidden:t,className:r=""}){/* @__PURE__ */
|
|
545
|
-
return Re("div",{role:"group",hidden:t,className:`ml-4 flex flex-col gap-1 border-l border-gray-200 pl-2 ${r}`.trim(),children:e})}function Oo({children:e}){/* @__PURE__ */
|
|
546
|
-
return Re("div",{role:"presentation",className:"px-3 pb-1 pt-3 text-xs font-semibold uppercase tracking-wide text-gray-500",children:e})}var Ro={backgroundColor:"inherit",maskImage:"linear-gradient(to right, transparent, black 12px)",WebkitMaskImage:"linear-gradient(to right, transparent, black 12px)"};function Wo({label:e,level:t=1,icon:r,preview:n,selected:a=!1,expanded:l,onToggle:i,onSelect:o,muted:s=!1,badge:c,actions:d,actionsPinned:u=!1,actionsOverlay:h=!0,rename:m,drop:p,dragging:g=!1,draggable:f=!1,dragHint:b,onMove:y,rowProps:x,className:v=""}){const w=void 0!==l,N=Me(),k=[x?.["aria-describedby"],y?N:void 0].filter(Boolean).join(" ")||void 0,$=a?"bg-blue-50 text-blue-700":"into"===p?"bg-blue-50 text-gray-900":"text-gray-700 hover:bg-gray-100";/* @__PURE__ */
|
|
547
|
-
return We("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?Po:void 0),"aria-describedby":k,"data-drop":p,"data-draggable":f||void 0,onKeyDown:e=>{if(x?.onKeyDown?.(e),e.target!==e.currentTarget||e.defaultPrevented)return;const t=Ao(e);t&&y?(e.preventDefault(),y(t)):"Enter"!==e.key&&" "!==e.key||!o?("ArrowRight"===e.key&&w&&!l&&i||"ArrowLeft"===e.key&&w&&l&&i)&&(e.preventDefault(),i()):(e.preventDefault(),o())},onClick:e=>{x?.onClick?.(e),e.defaultPrevented||o?.()},className:["group/treerow relative flex min-h-8 select-none items-center gap-2 rounded-md px-2 py-1 text-sm",f?"cursor-grab active:cursor-grabbing":"cursor-pointer","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",$,"into"===p?"ring-2 ring-inset ring-[color:var(--rosh-drop-ring)]":"",g?"opacity-40":"",v].filter(Boolean).join(" "),children:["before"===p&&/* @__PURE__ */Re("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__ */Re("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -bottom-0.5 h-0.5 rounded-full bg-blue-500"}),f&&
|
|
548
|
-
/* @__PURE__ */Re(zo,{marker:"tree",hint:b,dragging:g,revealClassName:"group-hover/treerow:opacity-100 group-focus-visible/treerow:opacity-100"}),
|
|
549
|
-
/* @__PURE__ */Re("span",w?{"aria-hidden":"true","data-tree-caret":"",onClick:e=>{e.stopPropagation(),i?.()},className:"flex h-4 w-4 shrink-0 items-center justify-center rounded text-gray-500 hover:bg-gray-200 hover:text-gray-900",children:(M=!!l,/* @__PURE__ */Re(Ne,{name:"chevron-right","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3 transition-transform "+(M?"rotate-90":"")}))}:{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),null!=r&&/* @__PURE__ */Re("span",{"aria-hidden":"true",className:"flex h-4 w-4 shrink-0 items-center justify-center "+(s?"text-gray-400":""),children:r}),
|
|
550
|
-
/* @__PURE__ */We("span",{className:"relative flex min-w-0 flex-1 items-center gap-2",children:[m??/* @__PURE__ */We("span",{className:`min-w-0 truncate ${a?"font-semibold":"font-medium"} ${s?"text-gray-400 line-through":""}`,children:[e,null!=n&&/* @__PURE__ */Re("span",{className:"ml-2 font-normal text-gray-500",children:n})]}),null!=c&&!1!==c&&/* @__PURE__ */Re("span",{className:"shrink-0 rounded bg-gray-100 px-1 py-0.5 text-2xs font-medium tabular-nums text-gray-500",children:c}),null!=d&&!h&&/* @__PURE__ */Re("span",{"data-tree-actions":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),className:"ml-auto flex shrink-0 items-center gap-0.5 transition-opacity "+(u||s?"opacity-100":"opacity-0 group-hover/treerow:opacity-100 group-focus-within/treerow:opacity-100"),children:d})]}),null!=d&&h&&
|
|
551
|
-
/* @__PURE__ */We("span",{"data-tree-actions":"","data-tree-actions-overlay":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),style:Ro,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:[
|
|
552
|
-
/* @__PURE__ */Re("span",{"aria-hidden":"true","data-tree-actions-scrim":"",className:"col-start-1 row-start-1",style:{background:"var(--rosh-tree-ground, var(--surface))"}}),
|
|
553
|
-
/* @__PURE__ */Re("span",{"aria-hidden":"true",className:"col-start-1 row-start-1",style:{backgroundColor:"inherit"}}),
|
|
554
|
-
/* @__PURE__ */Re("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:d})]}),y&&/* @__PURE__ */Re(Fo,{id:N})]});var M}function Ko({onAdd:e,label:t,drop:r=!1,slotProps:n}){const a=ae().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__ */
|
|
555
|
-
return Re("div",{...n,role:"presentation","data-drop":r||void 0,children:e?/* @__PURE__ */We("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:[
|
|
556
|
-
/* @__PURE__ */Re("span",{"aria-hidden":"true",children:"+"}),l]}):/* @__PURE__ */Re("span",{className:i,children:l})})}function _o({onInsert:e,label:t,drop:r=!1,seamProps:n}){const a=ae().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__ */
|
|
557
|
-
return We("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:[
|
|
558
|
-
/* @__PURE__ */Re("span",{"aria-hidden":"true",className:"absolute inset-x-0 -bottom-1 -top-1"}),
|
|
559
|
-
/* @__PURE__ */Re("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__ */Re(w,{content:l,className:"absolute left-1/2 top-1/2 inline-flex -translate-x-1/2 -translate-y-1/2",children:/* @__PURE__ */Re("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__ */Re(Ne,{name:"add","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3"})})})]})}var qo=Ae("compact");function Ho({"aria-label":e,"aria-labelledby":t,children:r,spacing:n="compact",className:a="",rootProps:l}){/* @__PURE__ */
|
|
560
|
-
return Re(qo.Provider,{value:n,children:/* @__PURE__ */Re("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 Uo({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=Te(qo),p=Se(null),g=Me(),f=[d?.["aria-describedby"],c?g:void 0].filter(Boolean).join(" ")||void 0,b=d?.tabIndex;Y(()=>{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__ */
|
|
561
|
-
return We("div",{role:"listitem","data-list-item":"","data-drop":s,className:"relative flex min-w-0 flex-col",children:[s&&/* @__PURE__ */Re("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]}`}),
|
|
562
|
-
/* @__PURE__ */We("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?Po:void 0),"aria-describedby":f,onKeyDown:e=>{if(d?.onKeyDown?.(e),e.defaultPrevented||!c)return;const t=Ao(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__ */Re(zo,{marker:"list",hint:i,dragging:o,revealClassName:"group-hover/listrow:opacity-100 group-focus-within/listrow:opacity-100"}),
|
|
563
|
-
/* @__PURE__ */Re("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__ */Re("div",{"data-list-actions":"",className:"flex shrink-0 items-center gap-0.5",children:t}),c&&/* @__PURE__ */Re(Fo,{id:g})]}),null!=r&&!1!==r&&/* @__PURE__ */Re("div",{"data-list-below":"",children:r})]})}var Vo=Ae({labels:"none",shown:"none"}),Yo="button[data-icon-rail-button]:not([disabled])";function Go(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 Xo({"aria-label":e,orientation:t="vertical",children:r,className:n="",labels:a="none",labelsFit:l=!1,onLabelsShown:i}){const o=Se(null),s="none"!==a&&l,[c,d]=Le(null),u="none"===a?"none":s?c??"none":"all",h=Se(()=>{});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,...Go(e,t,r.length)}))},Y(()=>{h.current()}),Pe(()=>{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=Se(null),p=Se(i);p.current=i,Pe(()=>{s&&null!==c&&m.current!==c&&(m.current=c,p.current?.(c))},[s,c]),Y(()=>{const e=o.current;if(!e)return;const t=[...e.querySelectorAll(Yo)];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__ */
|
|
564
|
-
return Re("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(Yo)],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__ */Re(Vo.Provider,{value:{labels:a,shown:u},children:r})})}function Zo({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}=Te(Vo),u=void 0===l||!1===l||0===l?t:/* @__PURE__ */Re(cl,{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__ */Re("button",{type:"button","data-icon-rail-button":"","aria-label":e,"aria-pressed":"boolean"==typeof r?r:void 0,disabled:n,onClick:n?void 0:a,className:[`relative inline-flex ${h?"beside"===c?"h-9 min-w-9 justify-center px-2":"min-h-9 min-w-9 flex-col justify-center px-1 py-1":"h-9 w-9 justify-center"} shrink-0 items-center rounded-lg transition-colors`,"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-40",s?"bg-blue-50 text-blue-700":"text-gray-600 hover:bg-gray-100 hover:text-gray-900",o].filter(Boolean).join(" "),children:h?/* @__PURE__ */We(Ke,{children:[
|
|
565
|
-
/* @__PURE__ */Re("span",{"data-icon-rail-glyph":"",className:"inline-flex shrink-0 items-center justify-center",children:u}),
|
|
566
|
-
/* @__PURE__ */Re("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__ */
|
|
567
|
-
return Re(w,{content:e,side:i,children:p})}var Jo=6e4;function Qo({currentVersion:e,versionUrl:t="/version.json",pollMs:r=6e4}){const[n,a]=Le(null);return Pe(()=>{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 es({currentVersion:e,versionUrl:t,pollMs:r,message:n,onRefresh:a,className:l=""}){const i=Qo({currentVersion:e,versionUrl:t,pollMs:r}),o=ae();if(null===i)return null;const s=a??(()=>window.location.reload());/* @__PURE__ */
|
|
568
|
-
return Re("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__ */We(wl,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */Re(v,{type:"button",variant:"primary",size:"md",onClick:s,children:o.update.refreshNow}),children:[
|
|
569
|
-
/* @__PURE__ */Re("span",{className:"font-medium",children:n??o.update.available}),
|
|
570
|
-
/* @__PURE__ */We("span",{className:"ml-2 whitespace-nowrap font-mono text-xs text-gray-500",children:[e," → ",i]})]})})}var ts={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 ns({onClose:e}){const t=ae().dialog;/* @__PURE__ */
|
|
571
|
-
return Re("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__ */Re(Ne,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function as({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=Se(null),g=Me(),f=Me(),b=Me();if(R(e),P(p,e,c),A(e),Pe(()=>{if(e)return H(()=>(s||t(),!0),()=>p.current)},[e,s,t]),!e)return null;const y="bottom"===r,x=y?{maxHeight:"85vh"}:void 0;/* @__PURE__ */
|
|
572
|
-
return We("div",{className:"fixed inset-0",style:{zIndex:V.overlay},role:"presentation",children:[
|
|
573
|
-
/* @__PURE__ */Re("div",{className:"fixed inset-0 bg-black/30",onClick:s?void 0:t,"aria-hidden":"true"}),
|
|
574
|
-
/* @__PURE__ */We("div",{ref:p,role:"dialog","aria-modal":"true","aria-labelledby":a?b:u,"aria-label":a||u?void 0:d,"aria-describedby":h??(l?f:o?g:void 0),style:x,className:["fixed flex flex-col bg-white shadow-xl",y?"":`w-full max-w-full ${ts[n]}`,rs[r],y?"rounded-t-xl":"",m].filter(Boolean).join(" "),children:[a?/* @__PURE__ */We("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
|
|
575
|
-
/* @__PURE__ */We("div",{className:"min-w-0",children:[
|
|
576
|
-
/* @__PURE__ */Re("h2",{id:b,className:"text-base font-semibold text-gray-900",children:a}),l&&/* @__PURE__ */Re("p",{id:f,className:"mt-0.5 text-sm text-gray-500",children:l})]}),!s&&/* @__PURE__ */Re(ns,{onClose:t})]}):!s&&/* @__PURE__ */Re("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */Re(ns,{onClose:t})}),
|
|
577
|
-
/* @__PURE__ */We("div",{id:g,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[l&&!a&&/* @__PURE__ */Re("p",{id:f,className:("mb-3 text-sm text-gray-500 "+(s?"":"pr-8")).trim(),children:l}),o]}),i&&/* @__PURE__ */Re("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:i})]})]})}function ls({items:e,columns:t,columnOf:r,getId:n,onMove:a,renderCard:l,onCardClick:i,sortInColumn:o,isLoading:s=!1,loadingText:c,emptyState:d,showColumnsWhenEmpty:u=!1,columnEmptyText:h,onAddItem:m,addItemText:p}){const g=ae().kanban,f=ne(),b=c??g.loading,y=h??g.dropHere,x=p??g.addItem,[v,w]=Le(null),[N,k]=Le(null),$=De(()=>{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=Se(null),L=Se(/* @__PURE__ */new Map);Y(()=>{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__ */Re("div",{className:"text-sm text-gray-500 p-4",children:b}):0!==e.length||u?/* @__PURE__ */Re("div",{ref:C,className:"flex-1 overflow-x-auto grid-scroll",children:/* @__PURE__ */Re("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__ */
|
|
578
|
-
return We("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:[
|
|
579
|
-
/* @__PURE__ */We("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:[
|
|
580
|
-
/* @__PURE__ */We("span",{className:"flex items-center gap-2",children:[
|
|
581
|
-
/* @__PURE__ */Re("span",{className:`h-2 w-2 rounded-full ${e.dot??"bg-gray-400"}`}),e.label]}),
|
|
582
|
-
/* @__PURE__ */Re("span",{className:"text-xs opacity-70",children:se(t.length,f)})]}),
|
|
583
|
-
/* @__PURE__ */We("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__ */
|
|
584
|
-
return We(Ee,{children:[s===a&&/* @__PURE__ */Re("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),
|
|
585
|
-
/* @__PURE__ */Re("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__ */Re("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),0===t.length&&/* @__PURE__ */Re("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__ */Re("div",{className:"p-2 pt-0",children:/* @__PURE__ */We("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:[
|
|
586
|
-
/* @__PURE__ */Re("span",{"aria-hidden":!0,className:"text-sm leading-none",children:"+"}),x]})})]},e.value)})})}):/* @__PURE__ */Re(Ke,{children:d??/* @__PURE__ */Re("div",{className:"text-sm text-gray-500 p-4",children:g.empty})})}var is="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 os({page:e,pageCount:t,onPageChange:r,siblingCount:n=1,showEdges:a=!1,className:l=""}){const i=ae().pagination,o=ne();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__ */
|
|
587
|
-
return We("nav",{"aria-label":i.label,className:`flex items-center gap-1 ${l}`.trim(),children:[a&&/* @__PURE__ */Re("button",{type:"button","aria-label":i.first,disabled:1===e,onClick:()=>c(1),className:`${is} text-gray-600 hover:bg-gray-100`,children:"«"}),
|
|
588
|
-
/* @__PURE__ */Re("button",{type:"button","aria-label":i.previous,disabled:1===e,onClick:()=>c(e-1),className:`${is} text-gray-600 hover:bg-gray-100`,children:"‹"}),s.map((t,r)=>"…"===t?/* @__PURE__ */Re("span",{className:"px-1 text-gray-400",children:"…"},`gap-${r}`):/* @__PURE__ */Re("button",{type:"button","aria-current":t===e?"page":void 0,onClick:()=>c(t),className:`${is} ${t===e?"bg-blue-600 font-medium text-white":"text-gray-700 hover:bg-gray-100"}`,children:se(t,o)},t)),
|
|
589
|
-
/* @__PURE__ */Re("button",{type:"button","aria-label":i.next,disabled:e===t,onClick:()=>c(e+1),className:`${is} text-gray-600 hover:bg-gray-100`,children:"›"}),a&&/* @__PURE__ */Re("button",{type:"button","aria-label":i.last,disabled:e===t,onClick:()=>c(t),className:`${is} text-gray-600 hover:bg-gray-100`,children:"»"})]})}function ss(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 cs=e=>Array.isArray(e.columns),ds=e=>"wide"===e.only?"rosh-dt-only-wide":"stacked"===e.only?"rosh-dt-only-stacked":"",us="rosh-dt-row-link rosh-focus-ring underline-offset-4 hover:underline",hs={sm:"px-2 py-2",md:"px-3 py-2"},ms={left:"text-left",right:"text-right",center:"text-center"};function ps({direction:e}){/* @__PURE__ */
|
|
590
|
-
return We("span",{className:"ml-1 inline-flex flex-col leading-none","aria-hidden":"true",children:[
|
|
591
|
-
/* @__PURE__ */Re("svg",{className:"h-2 w-2 "+("asc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */Re("path",{d:"M4 0L8 5H0z"})}),
|
|
592
|
-
/* @__PURE__ */Re("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */Re("path",{d:"M4 5L0 0h8z"})})]})}function gs({columns:e,data:t,rowKey:r,sort:n=null,onSortChange:a,pagination:l,caption:i,loading:o=!1,bordered:s=!1,size:c="md",minWidth:d,rowClassName:u,onRow:h,rowHref:m,onRowPress:p,linkAs:g,emptyText:f,selection:b,footer:y,virtualized:x,stackOnNarrow:v=!1,stackBelow:w,className:N=""}){const k=ae(),$=f??k.table.empty,M=(e,t)=>"function"==typeof r?r(e,t):String(e[r]),C=v&&!x,L=C?e:e.flatMap(e=>{if(!cs(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),S=e=>C?{role:e}:{},D=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[P,A]=Le(0),j=x?.overscan??6,z=x?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/x.rowHeight)-j);A(e=>e===t?e:t)}:void 0,F=x?Math.ceil(x.height/x.rowHeight)+2*j:t.length,T=x?Math.min(P,Math.max(0,t.length-F)):0,E=Math.min(t.length,T+F),B=x?T*x.rowHeight:0,I=x?(t.length-E)*x.rowHeight:0,O=Se(null),[R,W]=Le(0);Y(()=>{if(!x)return;const e=O.current?.offsetHeight??0;W(t=>t===e?t:e)});const K=e=>e.sortField??e.key,_=e=>n&&n.field===K(e)?n.direction:null,q=L.flatMap(e=>cs(e)?e.columns:[e]),H=L.some(cs),U=/* @__PURE__ */new Map;if(C)for(const e of L)if(cs(e))for(const t of e.columns)U.set(t,D(e.title,e.label));const V=e=>{const t=D(e.title,e.label),r=U.get(e);return t&&r?`${r} · ${t}`:t},G=new Set(b?.selected??[]),X=b?t.map((e,t)=>M(e,t)):[],Z=X.length>0&&X.every(e=>G.has(e)),J=X.some(e=>G.has(e)),Q=b?36:0,ee=q.length+(b?1:0),te=q.some(e=>"left"===e.fixed),re=C&&!b&&q.some(e=>e.cardCorner),ne=g??"a",le=`${hs[c]} ${"sm"===c?"text-xs":"text-sm"}`,ie=(e,t,r,n=0)=>{const l=_(e),i=ms[e.align??(e.numeric?"right":"left")],o="left"===e.fixed,s=!(!e.sortable||!a);/* @__PURE__ */
|
|
593
|
-
return Re("th",{scope:"col",...S("columnheader"),rowSpan:r>1?r:void 0,"aria-sort":"asc"===l?"ascending":"desc"===l?"descending":s?"none":void 0,style:{width:e.width,...o?{left:(se[t]??0)+Q}:{},...x?{top:n}:{}},className:[le,i,"font-semibold uppercase tracking-wide text-gray-500","sm"===c?"text-2xs":"text-xs",o?x?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":x?"sticky z-10 bg-gray-50":"",C&&s?"rosh-dt-sort":"",C?ds(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:s?/* @__PURE__ */We("button",{type:"button",onClick:()=>(e=>{if(!a)return;const t=K(e),r=_(e),n=e.sortFirst??"asc";a(null===r?{field:t,direction:n}:r===n?{field:t,direction:"asc"===n?"desc":"asc"}:null)})(e),"data-group":C?U.get(e):void 0,className:`inline-flex items-center font-semibold uppercase tracking-wide hover:text-gray-700 ${i}`,children:[e.title,
|
|
594
|
-
/* @__PURE__ */Re(ps,{direction:l})]}):e.title},e.key)};let oe=0;const se=q.map(e=>{if("left"!==e.fixed)return null;const t=oe;return oe+=e.width??0,t}),ce=/* @__PURE__ */We(Ke,{children:[
|
|
595
|
-
/* @__PURE__ */We("div",{onScroll:z,style:x?{maxHeight:x.height}:void 0,className:`relative overflow-x-auto ${x?"overflow-y-auto":""} ${s?"rounded-lg border border-gray-200":""}${C?" rosh-dt-scroll":""}`.trim(),children:[o&&
|
|
596
|
-
/* @__PURE__ */We("div",{className:"absolute inset-0 z-20 flex items-start justify-center bg-white/60 pt-8",role:"status","aria-live":"polite",children:[
|
|
597
|
-
/* @__PURE__ */Re("span",{className:"h-6 w-6 animate-spin rounded-full border-2 border-gray-200 border-t-blue-600"}),
|
|
598
|
-
/* @__PURE__ */Re("span",{className:"sr-only",children:k.table.loading})]}),
|
|
599
|
-
/* @__PURE__ */We("table",{...S("table"),className:(C?"rosh-dt-table ":"")+"w-full border-collapse tabular-nums",style:d?{minWidth:d}:void 0,children:[i&&/* @__PURE__ */Re("caption",{className:"sr-only",children:i}),
|
|
600
|
-
/* @__PURE__ */We("thead",{...S("rowgroup"),className:C?"rosh-dt-head":void 0,children:[
|
|
601
|
-
/* @__PURE__ */We("tr",{ref:O,...S("row"),className:"border-b border-gray-200 bg-gray-50",children:[b&&/* @__PURE__ */Re("th",{scope:"col",...S("columnheader"),rowSpan:H?2:void 0,style:{width:36,...x?{top:0}:{}},className:[le,te||x?"sticky z-20 bg-gray-50":"",te?"left-0":"",C?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */Re(ct,{"aria-label":k.table.selectAll,checked:Z,indeterminate:J&&!Z,onChange:()=>{if(!b)return;const e=new Set(X);b.onChange(Z?b.selected.filter(t=>!e.has(t)):[...b.selected,...X.filter(e=>!G.has(e))])}})}),L.map((e,t)=>cs(e)?/* @__PURE__ */Re("th",{scope:"colgroup",...S("columnheader"),colSpan:e.columns.length,style:x?{top:0}:void 0,className:[le,"text-center","font-semibold uppercase tracking-wide text-gray-500","sm"===c?"text-2xs":"text-xs","border-b border-gray-200",x?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:e.title},e.key??`group-${t}`):ie(e,q.indexOf(e),H?2:1))]}),H&&/* @__PURE__ */Re("tr",{...S("row"),className:"border-b border-gray-200 bg-gray-50",children:L.flatMap(e=>cs(e)?e.columns:[]).map(e=>ie(e,q.indexOf(e),1,R))})]}),
|
|
602
|
-
/* @__PURE__ */Re("tbody",{...S("rowgroup"),className:C?"rosh-dt-body":void 0,children:0!==t.length||o?/* @__PURE__ */We(Ke,{children:[B>0&&/* @__PURE__ */Re("tr",{"aria-hidden":"true",children:/* @__PURE__ */Re("td",{colSpan:ee,style:{height:B,padding:0,border:0}})}),t.slice(T,E).map((e,t)=>{const r=T+t,n=h?.(e,r),a=!!n?.current,l=m?.(e,r),i=void 0===l&&p?()=>p(e,r):void 0,o=void 0!==l||void 0!==i;let s=!1;const c=(e,t)=>{if(s=!0,!o)return e;const r=[us,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),n=a?"true":void 0;return void 0!==l?/* @__PURE__ */Re(ne,{href:l,className:r,"aria-current":n,children:e}):/* @__PURE__ */Re("button",{type:"button",onClick:i,className:r,"aria-current":n,children:e})},d=q.map(t=>t.render?t.render(e,r,c):t.dataIndex?e[t.dataIndex]:null);if(o&&!s){const e=q.findIndex(e=>"stacked"!==e.only&&!e.cardCorner),t=q.findIndex(e=>"wide"!==e.only&&!e.cardCorner);for(const r of/* @__PURE__ */new Set([e,t]))r>=0&&(d[r]=c(d[r]))}const g=e=>e?t=>{t.currentTarget.contains(t.relatedTarget)||e()}:void 0;/* @__PURE__ */
|
|
603
|
-
return We("tr",{...ss(n),...S("row"),style:x?{height:x.rowHeight}:void 0,onClick:n?.onClick,onMouseEnter:n?.onMouseEnter,onMouseLeave:n?.onMouseLeave,onFocus:g(n?.onFocus),onBlur:g(n?.onBlur),"aria-current":a&&!o?"true":void 0,...n?.onClick?{tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.onClick?.()))}}:{},className:[C?b?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"",C&&re?"rosh-dt-row-corner":"","border-b border-gray-100 last:border-b-0",n?.onClick?"cursor-pointer hover:bg-gray-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",o?"rosh-dt-linked hover:bg-gray-50":"",a?"rosh-dt-current":"",u?.(e,r)??"",n?.className??""].filter(Boolean).join(" "),children:[b&&(()=>{const t=M(e,r);/* @__PURE__ */
|
|
604
|
-
return Re("td",{...S("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[le,te?"sticky left-0 z-10 bg-white":"",C?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */Re(ct,{"aria-label":k.table.selectRow,checked:G.has(t),onChange:()=>(e=>{b&&b.onChange(G.has(e)?b.selected.filter(t=>t!==e):[...b.selected,e])})(t)})})})(),q.map((e,t)=>{const r="left"===e.fixed,n=d[t],a=re&&!!e.cardCorner,l=C&&!a&&"wide"!==e.only;/* @__PURE__ */
|
|
605
|
-
return Re("td",{...S("cell"),"data-label":l?V(e):void 0,style:r?{left:(se[t]??0)+Q}:void 0,className:[l?e.ellipsis?"rosh-dt-cell rosh-dt-clip":"rosh-dt-cell":"",a?"rosh-dt-corner":"",C?ds(e):"",le,ms[e.align??(e.numeric?"right":"left")],e.numeric&&!C?"font-mono":"","text-gray-900",e.ellipsis?"max-w-0 truncate":"",r?"sticky z-10 bg-white":"",e.className??""].filter(Boolean).join(" "),children:C?
|
|
606
|
-
/* @__PURE__ */Re("span",{className:e.numeric?"rosh-dt-value font-mono":"rosh-dt-value",children:n}):n},e.key)})]},M(e,r))}),I>0&&/* @__PURE__ */Re("tr",{"aria-hidden":"true",children:/* @__PURE__ */Re("td",{colSpan:ee,style:{height:I,padding:0,border:0}})})]}):/* @__PURE__ */Re("tr",{...S("row"),className:C?"rosh-dt-empty":void 0,children:/* @__PURE__ */Re("td",{...S("cell"),colSpan:ee,className:`${le} py-10 text-center text-gray-500`,children:$})})})]}),y]}),l&&l.pageCount>1&&/* @__PURE__ */Re("div",{className:C?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */Re(os,{page:l.page,pageCount:l.pageCount,onPageChange:l.onPageChange})})]});/* @__PURE__ */
|
|
607
|
-
return Re("div",C?void 0!==w&&w>0&&40!==w?{className:`rosh-dt-at ${N}`.trim(),children:/* @__PURE__ */Re("div",{className:"rosh-dt-stack",style:{width:40/w*100+"%"},children:/* @__PURE__ */Re("div",{className:"rosh-dt-fit",style:{width:w/40*100+"%"},children:ce})})}:{className:`rosh-dt-stack ${N}`.trim(),children:ce}:{className:N,children:ce})}function fs({selectedCount:e,hiddenSelectedCount:t=0,loadedCount:r,totalCount:n,label:a,isFetchingMore:l,extra:i}){const o=ae().list,s=n??r,c=r>=s,d=t>0?o.selectedNotShown(e,t):e>0?o.selected(e):"";/* @__PURE__ */
|
|
608
|
-
return We(Ke,{children:[i,d?`${d} — `:"",c?null!=n?o.allLoaded(s,a):o.count(s,a):o.loadedOf(r,s,a),l?` · ${o.loadingMore}`:""]})}function bs({title:e,message:t,onRetry:r,variant:n="dashed"}){const a=ae().list;/* @__PURE__ */
|
|
609
|
-
return We("div",{className:`flex flex-col items-center justify-center text-center ${"card"===n?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===n?"px-6 py-12":"rounded-lg border-2 border-dashed border-red-200 px-6 py-12"}`,role:"alert",children:[
|
|
610
|
-
/* @__PURE__ */Re(Ne,{name:"warning",className:"h-10 w-10 text-red-300 mb-3",strokeWidth:1,"aria-hidden":"true"}),
|
|
611
|
-
/* @__PURE__ */Re("h3",{className:"text-sm font-medium text-gray-900",children:e??a.loadError}),
|
|
612
|
-
/* @__PURE__ */Re("p",{className:"text-sm text-gray-500 mt-2",children:t??a.loadErrorMessage}),r&&/* @__PURE__ */Re("div",{className:"mt-4",children:/* @__PURE__ */Re(v,{variant:"secondary",size:"sm",onClick:r,children:a.retry})})]})}function ys({data:e,width:t=120,height:r=32,stroke:n="currentColor",fill:a,strokeWidth:l=1.5,showDots:i=!1,className:o,style:s}){if(0===e.length)return null;const c=Math.max(...e),d=Math.min(...e),u=c-d||1,h=l+(i?2:0),m=e=>r-h-(e-d)/u*(r-2*h),p=1===e.length?[[0,r/2],[t,r/2]]:e.map((r,n)=>[n*t/(e.length-1),m(r)]),g=p.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" "),f=`${g} L${t.toFixed(2)},${r} L0,${r} Z`;/* @__PURE__ */
|
|
613
|
-
return We("svg",{className:o,style:s,width:t,height:r,viewBox:`0 0 ${t} ${r}`,preserveAspectRatio:"none",role:"img","aria-hidden":"true",children:[a&&/* @__PURE__ */Re("path",{d:f,fill:a,stroke:"none"}),
|
|
614
|
-
/* @__PURE__ */Re("path",{d:g,fill:"none",stroke:n,strokeWidth:l,strokeLinejoin:"round",strokeLinecap:"round"}),i&&p.map(([e,t],r)=>/* @__PURE__ */Re("circle",{cx:e,cy:t,r:l+.5,fill:n},r))]})}var xs=8,vs=["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)"],ws={good:"var(--viz-good)",neutral:"var(--viz-neutral)",warning:"var(--viz-warning)",serious:"var(--viz-serious)",critical:"var(--viz-critical)"},Ns={grid:"var(--viz-grid)",axis:"var(--viz-axis)",label:"var(--viz-label)",muted:"var(--viz-muted)",surface:"var(--viz-surface)"};function ks(e){return vs[e]??Ns.muted}function $s(e,t,r){return t||(r?ws[r]:ks(e))}function Ms(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 Cs(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 Ls(e,t,r,n){return r||n?$s(e,r,n):e<t?ks(e):Ns.muted}function Ss(e,t){const[r,n]=e,a=n-r,l=e=>0===a?t.from:t.from+(e-r)/a*(t.to-t.from);return l.domain=e,l.range=t,l.ticks=e=>e<2?[r]:Array.from({length:e},(t,n)=>r+a*n/(e-1)),l}function Ds(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 Ps(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 As(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 js(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 zs(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 Fs(e,t){const r=Math.max(e[0],e[1]),n=Math.min(e[0],e[1]),a=r>0?r:0,l=n>0?n:a>0?10**(Math.ceil(Math.log10(a))-3):0,i=Math.log10(l),o=a>0&&l>0?Math.log10(a)-i:0,s=e=>{if(o<=0)return t.from;const r=Math.max(l,e);return t.from+(Math.log10(r)-i)/o*(t.to-t.from)};return s.domain=[l,a],s.range=t,s.ticks=e=>{if(e<2||o<=0)return[l];const t=Math.ceil(i),r=Math.floor(Math.log10(a)),n=[];for(let e=t;e<=r;e+=1)n.push(10**e);return 0===n.length?[l,a]:(Math.log10(n[0])-i>.15&&n.unshift(l),Math.log10(a)-Math.log10(n[n.length-1])>.15&&n.push(a),n)},s}function Ts(e,t=0){const r=e>0?2*Math.PI/e:0,n=e=>-Math.PI/2+e*r+t/2;return n.step=Math.max(0,r-t),n.center=e=>-Math.PI/2+e*r+r/2,n.count=e,n}function Es(e,t){const[r,n]=e,a=Math.sqrt(Math.max(0,n))-Math.sqrt(Math.max(0,r));return e=>{if(0===a)return t.to;const n=(Math.sqrt(Math.max(0,e))-Math.sqrt(Math.max(0,r)))/a;return t.from+Math.min(1,Math.max(0,n))*(t.to-t.from)}}function Bs(e,t=10){const r=e.filter(Number.isFinite);if(Array.isArray(t)){const e=[...t].filter(Number.isFinite).sort((e,t)=>e-t);if(e.length<2)return[];const n=Array.from({length:e.length-1},(t,r)=>({from:e[r],to:e[r+1],count:0})),a=e[e.length-1];for(const t of r){if(t<e[0]||t>a)continue;const r=t===a?n.length-1:n.findIndex(e=>t>=e.from&&t<e.to);r>=0&&(n[r].count+=1)}return n}const n=t;if(0===r.length||n<1)return[];const a=Math.min(...r),l=(Math.max(...r)-a)/n||1,i=Array.from({length:n},(e,t)=>({from:a+t*l,to:a+(t+1)*l,count:0}));for(const e of r){i[Math.min(n-1,Math.floor((e-a)/l))].count+=1}return i}function Is(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 Os(e,t=720){const[r,n]=Le(t);return Pe(()=>{const t=e.current;if(!t||"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(e=>{const t=e[0]?.contentRect.width??0;t>0&&n(t)});return r.observe(t),()=>r.disconnect()},[e]),r}function Rs(e,t,r){const n=(t/2+8).toFixed(1),a=e=>{return`clamp(0px, calc(${t=e,r>0?(t/r*100).toFixed(2):"0.00"}% + ${n}px), calc(100% - 184px))`;var t};return e<=r/2?{left:a(e)}:{right:a(r-e)}}function Ws({labels:e,values:t,height:r=220,width:n,bandPadding:a=.24,min:l,max:i,yTickCount:o=4,formatValue:s,yAxisLabel:c,xTickAnchor:d="center",children:u,overlay:h,tooltip:m,onSelect:p,ariaLabel:g,className:f,emptyLabel:b}){const y=ae().charts,x=ne(),v=s??(e=>se(e,x)),w=b??y.noData,N=Se(null),k=Os(N),$=n??k,[M,C]=Le(null),L=Me();if(Pe(()=>{if(null!==M)return H(e=>"Escape"===e.key&&(C(null),!0))},[M]),0===e.length||!t.some(Number.isFinite))/* @__PURE__ */
|
|
615
|
-
return Re("div",{className:f,ref:N,children:/* @__PURE__ */Re("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:w})});const S=t.filter(Number.isFinite),D=S.every(Number.isInteger),P=void 0===l&&void 0===i?js(Math.min(0,...S),Math.max(0,...S),{intervals:o+1,integer:D}):null,A=void 0!==l&&void 0===i?js(l,Math.max(l,...S),{intervals:o+1,integer:D,zero:!1}):null,j=P?P.lo:l??Math.min(0,...S),z=P?P.hi:A?A.hi:i??As(Math.max(...S,0)),F=P?P.ticks:A?[j,...A.ticks.filter(e=>e>j)]:Ss([j,z],{from:0,to:1}).ticks(o+1),T={top:12,right:16,bottom:26,left:Is(F.map(v),48)+(c?10:0)},E=T.left,B=Math.max(E+1,$-T.right),I=T.top,O=r-T.bottom,R=Ss([j,z],{from:O,to:I}),W=Ds(e.length,{from:E,to:B},a),K=(B-E)/Math.max(1,e.length),_=K>=48,q=_?1:Math.max(1,Math.ceil(e.length/Math.max(1,Math.floor($/84)))),U=Math.max(2,Math.floor((K-6)/6.6)),V=e=>_&&e.length>U?`${e.slice(0,U-1).trimEnd()}…`:e;/* @__PURE__ */
|
|
616
|
-
return We("div",{className:`relative ${f??""}`,ref:N,children:[
|
|
617
|
-
/* @__PURE__ */We("svg",{width:"100%",height:r,viewBox:`0 0 ${$} ${r}`,role:"img","aria-label":g,tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>C(null),onBlur:()=>C(null),onKeyDown:t=>{if(p&&null!==M&&("Enter"===t.key||" "===t.key))return t.preventDefault(),void p(M);if("ArrowRight"!==t.key&&"ArrowLeft"!==t.key)return;t.preventDefault();const r="ArrowRight"===t.key?1:-1;C(t=>Math.min(e.length-1,Math.max(0,(t??0)+r)))},children:[
|
|
618
|
-
/* @__PURE__ */Re("defs",{children:/* @__PURE__ */Re("clipPath",{id:L,children:/* @__PURE__ */Re("rect",{x:E,y:I,width:B-E,height:O-I})})}),F.map(e=>/* @__PURE__ */Re("line",{x1:E,y1:R(e),x2:B,y2:R(e),stroke:Ns.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${e}`)),
|
|
619
|
-
/* @__PURE__ */Re("line",{x1:E,y1:R(Math.max(j,0)),x2:B,y2:R(Math.max(j,0)),stroke:Ns.axis,strokeWidth:1,shapeRendering:"crispEdges"}),F.map(e=>/* @__PURE__ */Re("text",{x:E-8,y:R(e)+4,textAnchor:"end",fontSize:11,fill:Ns.label,style:{fontVariantNumeric:"tabular-nums"},children:v(e)},`t${e}`)),c&&/* @__PURE__ */Re("text",{x:14,y:(I+O)/2,transform:`rotate(-90 14 ${(I+O)/2})`,textAnchor:"middle",fontSize:11,fill:Ns.label,children:c}),
|
|
620
|
-
/* @__PURE__ */Re("g",{clipPath:`url(#${L})`,children:u({x:W,y:R,left:E,right:B,top:I,bottom:O,width:$,height:r,clipId:L,active:M})}),h?.({x:W,y:R,left:E,right:B,top:I,bottom:O,width:$,height:r,clipId:L,active:M}),e.map((e,t)=>t%q===0?/* @__PURE__ */Re("text",{x:"start"===d?W(t):W.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:Ns.label,style:{fontVariantNumeric:"tabular-nums"},children:V(e)},`x${t}`):null),e.map((t,r)=>/* @__PURE__ */Re("rect",{x:W.center(r)-(B-E)/e.length/2,y:I,width:(B-E)/e.length,height:O-I,fill:"transparent",onMouseEnter:()=>C(r),onClick:p?()=>p(r):void 0,style:p?{cursor:"pointer"}:void 0},`h${r}`))]}),m&&null!==M&&
|
|
621
|
-
/* @__PURE__ */Re("div",{className:"pointer-events-none absolute top-2 z-10",style:Rs(W.center(M),W.bandwidth,$),children:m(M)})]})}function Ks({height:e=220,width:t=720,variant:r="area",bars:n=9,label:a,className:l}){const i=ae().charts,o=a??i.loading,s=`${Me()}-shimmer`,c=48,d=t-16,u=12,h=e-26;/* @__PURE__ */
|
|
622
|
-
return Re("div",{className:l,children:/* @__PURE__ */We("svg",{width:"100%",height:e,viewBox:`0 0 ${t} ${e}`,role:"img","aria-label":o,"aria-busy":"true",children:[
|
|
623
|
-
/* @__PURE__ */Re("defs",{children:/* @__PURE__ */We("linearGradient",{id:s,x1:"0",y1:"0",x2:"1",y2:"0",children:[
|
|
624
|
-
/* @__PURE__ */Re("stop",{offset:"0%",stopColor:Ns.surface,stopOpacity:"0"}),
|
|
625
|
-
/* @__PURE__ */Re("stop",{offset:"45%",stopColor:Ns.surface,stopOpacity:"0.55"}),
|
|
626
|
-
/* @__PURE__ */Re("stop",{offset:"55%",stopColor:Ns.surface,stopOpacity:"0.55"}),
|
|
627
|
-
/* @__PURE__ */Re("stop",{offset:"100%",stopColor:Ns.surface,stopOpacity:"0"})]})}),Array.from({length:5},(e,t)=>{const r=u+(h-u)*t/4;/* @__PURE__ */
|
|
628
|
-
return Re("line",{x1:c,y1:r,x2:d,y2:r,stroke:Ns.grid,strokeWidth:1,shapeRendering:"crispEdges"},t)}),Array.from({length:5},(e,t)=>/* @__PURE__ */Re("rect",{x:18,y:u+(h-u)*t/4-4,width:22,height:8,rx:4,fill:Ns.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__ */
|
|
629
|
-
return Re("rect",{x:c+t*r+.18*r,y:h-l,width:.64*r,height:l,rx:3,fill:Ns.grid},t)}):/* @__PURE__ */Re("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:Ns.grid}),
|
|
630
|
-
/* @__PURE__ */Re("rect",{className:"rosh-viz-shimmer",x:-t,y:0,width:t,height:e,fill:`url(#${s})`})]})})}var _s=Ae({highlighted:null,setHighlighted:()=>{}});function qs({children:e}){const[t,r]=Le(null),n=De(()=>({highlighted:t,setHighlighted:r}),[t]);/* @__PURE__ */
|
|
631
|
-
return Re(_s.Provider,{value:n,children:e})}function Hs(){return Te(_s)}function Us(e,t,r=.22){return null===t?null:t===e?1:r}function Vs(e,t="none"){if("none"===t||0===e.length)return null;if("last"===t){for(let t=e.length-1;t>=0;t-=1)if("number"==typeof e[t]&&Number.isFinite(e[t]))return t;return null}let r=null;return e.forEach((n,a)=>{if("number"!=typeof n||!Number.isFinite(n))return;if(null===r)return void(r=a);const l=e[r];("max"===t?n>l:n<l)&&(r=a)}),r}function Ys({variant:e="solid",title:t,rows:r,footnote:n,emphasisKey:a,className:l}){const i="glass"===e;/* @__PURE__ */
|
|
632
|
-
return We("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?_():{boxShadow:"var(--elevation-popup)"},children:[t&&/* @__PURE__ */Re("p",{className:"mb-2 text-sm font-medium text-gray-800",children:t}),
|
|
633
|
-
/* @__PURE__ */Re("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:r.map(e=>/* @__PURE__ */We("li",{className:"flex items-center gap-3",style:a&&e.key!==a?{opacity:.45}:void 0,children:[
|
|
634
|
-
/* @__PURE__ */Re("span",{className:"h-3 w-3 shrink-0 rounded-[4px]",style:{backgroundColor:e.color??Ns.muted}}),
|
|
635
|
-
/* @__PURE__ */Re("span",{className:"flex-1 whitespace-nowrap text-gray-600",children:e.label}),
|
|
636
|
-
/* @__PURE__ */Re("span",{className:"pl-4 font-semibold tabular-nums text-gray-900",children:e.value??"—"})]},e.key))}),n&&/* @__PURE__ */Re("p",{className:"mt-2 text-2xs text-gray-500",children:n})]})}function Gs({series:e,labels:t,stacked:r=!1,stackMode:n="value",height:a=220,width:l,max:i,formatValue:o,yAxisLabel:s,className:c,emptyLabel:d,radius:u=3,loading:h=!1,animate:m=!0,glow:p=!1,emphasise:g=!1,activeKey:f,highlight:b="none",valueLabels:y=!1,onSelect:x,min:v,formatTooltipValue:w,tooltipLabels:N,barGap:k=4,seriesLabels:$=!1}){const M=Me(),{highlighted:C}=Hs(),L=ae().charts,S=ne(),D=o??(e=>se(e,S)),P=w??D;if(h)/* @__PURE__ */return Re(Ks,{height:a,width:l,variant:"bars",className:c});const A=(e,t)=>{const r=e.pointColors?.[t];if(r)return r;const n=e.pointTones?.[t];return n?ws[n]:$s(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)),T=t.map((e,t)=>j.reduce((e,r)=>e+Math.max(0,z(r,t)),0)),E=t.map((e,t)=>j.reduce((e,r)=>e+Math.min(0,z(r,t)),0)),B=r&&"percent"===n,I=(e,t)=>F[t]>0?e/F[t]:null,O=B?[1]:r?[...T,...E]: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),g=p&&t.label.length>m?`${t.label.slice(0,m-1).trimEnd()}…`:t.label,f=p?h-6:u-4;/* @__PURE__ */
|
|
637
|
-
return Re("text",{"data-series-label":"true",x:d,y:f,transform:`rotate(-90 ${d} ${f})`,textAnchor:"start",dominantBaseline:"central",fontSize:11,fill:p?Ns.surface:Ns.label,children:g},`n${t.key}-${a}`)}))}:null;/* @__PURE__ */
|
|
638
|
-
return Re(Ws,{labels:t,values:O,height:a,width:l,max:B?1:i,min:B?void 0:v,formatValue:B?e=>de(Math.round(100*e),0,S):D,yAxisLabel:s,className:c,emptyLabel:d,onSelect:x,ariaLabel:L.acrossCategories(j.map(e=>e.label),t.length),tooltip:e=>/* @__PURE__ */Re(Ys,{title:N?.[e]??t[e],rows:j.map(t=>({key:t.key,label:t.label,color:A(t,e),value:Number.isFinite(t.data[e])?B?`${de(100*(I(t.data[e],e)??0),1,S)} · ${P(t.data[e])}`:P(t.data[e]):void 0})),footnote:B?L.inCategory(P(F[e])):void 0}),overlay:y&&!B||W?({x:e,y:n})=>/* @__PURE__ */We("g",{pointerEvents:"none",children:[W?.({x:e,y:n}),y&&!B&&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?T[a]:E[a];/* @__PURE__ */
|
|
639
|
-
return Re("text",{"data-value-label":"true",x:e.center(a),y:t>=0?n(r)-4:n(r)+12,textAnchor:"middle",fontSize:11,fill:Ns.label,style:{fontVariantNumeric:"tabular-nums"},children:D(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__ */
|
|
640
|
-
return Re("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:Ns.label,style:{fontVariantNumeric:"tabular-nums"},children:D(i)},`v${t.key}-${a}`)})})]}):void 0,children:({x:e,y:n,bottom:a,active:l})=>{const i=f?t.indexOf(f):-1,o=Vs(r?F:j[0]?.data??[],b),s=l??(i>=0?i:o);/* @__PURE__ */
|
|
641
|
-
return We("g",{children:[
|
|
642
|
-
/* @__PURE__ */Re(ai,{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=B?I(d,a):d;if(null===h)return null;const f=A(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=$?f:g?Ns.muted:f,S=Us(t.key,C);/* @__PURE__ */
|
|
643
|
-
return Re("rect",{x:y,y:v,width:x,height:k,rx:u,fill:L,fillOpacity:S??($?1:g?.32:.45),filter:p&&s===a?`url(#${Zl(M)})`:void 0,className:"rosh-viz-mark"+(m?` ${ii.rise}`:""),style:m?oi(a*(r?1:j.length)+c,26):void 0},`${t.key}-${a}`)})}),null!==l&&!g&&/* @__PURE__ */Re("line",{x1:e.center(l),y1:n(n.domain[1]),x2:e.center(l),y2:a,stroke:Ns.axis,strokeWidth:1})]})}})}var Xs=e=>e.toFixed(2);function Zs(e){return e.map(([e,t],r)=>`${0===r?"M":"L"}${Xs(e)},${Xs(t)}`).join(" ")}function Js(e){let t="";return e.forEach((e,r)=>{t+=`${0===r?"M":" L"}${Xs(e.start)},${Xs(e.y)}`,t+=` L${Xs(e.end)},${Xs(e.y)}`}),t}function Qs(e){if(e.length<3)return Zs(e);const t=e.length,r=[],n=[];for(let a=0;a<t-1;a+=1){const t=e[a+1][0]-e[a][0];r.push(t),n.push(0===t?0:(e[a+1][1]-e[a][1])/t)}const a=[n[0]];for(let e=1;e<t-1;e+=1)a.push(n[e-1]*n[e]<=0?0:(n[e-1]+n[e])/2);a.push(n[t-2]);for(let e=0;e<t-1;e+=1){if(0===n[e]){a[e]=0,a[e+1]=0;continue}const t=a[e]/n[e],r=a[e+1]/n[e],l=t*t+r*r;if(l>9){const i=3/Math.sqrt(l);a[e]=i*t*n[e],a[e+1]=i*r*n[e]}}let l=`M${Xs(e[0][0])},${Xs(e[0][1])}`;for(let n=0;n<t-1;n+=1){const t=r[n]/3;l+=` C${Xs(e[n][0]+t)},${Xs(e[n][1]+a[n]*t)} ${Xs(e[n+1][0]-t)},${Xs(e[n+1][1]-a[n+1]*t)} ${Xs(e[n+1][0])},${Xs(e[n+1][1])}`}return l}function ec(e,t=0){if(e.length<3)return Zs(e);const r=e.map(e=>e[1]),n=Math.min(...r),a=Math.max(...r),l=e=>Math.min(a,Math.max(n,e)),i=(1-t)/6;let o=`M${Xs(e[0][0])},${Xs(e[0][1])}`;for(let t=0;t<e.length-1;t+=1){const r=e[t-1]??e[t],n=e[t],a=e[t+1],s=e[t+2]??a,c=n[0]+(a[0]-r[0])*i,d=l(n[1]+(a[1]-r[1])*i),u=a[0]-(s[0]-n[0])*i,h=l(a[1]-(s[1]-n[1])*i);o+=` C${Xs(c)},${Xs(d)} ${Xs(u)},${Xs(h)} ${Xs(a[0])},${Xs(a[1])}`}return o}function tc(e){if(e.length<2)return Zs(e);let t=`M${Xs(e[0][0])},${Xs(e[0][1])}`;for(let r=1;r<e.length;r+=1){const[n,a]=e[r-1],[l,i]=e[r],o=(n+l)/2;t+=` C${Xs(o)},${Xs(a)} ${Xs(o)},${Xs(i)} ${Xs(l)},${Xs(i)}`}return t}function rc(e,t="linear",r=0){return 0===e.length?"":1===e.length?`M${Xs(e[0][0])},${Xs(e[0][1])}`:"monotone"===t?Qs(e):"spline"===t?ec(e,r):"bump"===t?tc(e):Zs(e)}function nc(e,t,r){if(0===t.length)return"";const n=t[0],a=t[t.length-1];return`${e} L${Xs(a[0])},${Xs(r)} L${Xs(n[0])},${Xs(r)} Z`}function ac(e,t){if(0===t.length)return e;return`${e} L${[...t].reverse().map(([e,t])=>`${Xs(e)},${Xs(t)}`).join(" L")} Z`}function lc(e,t,r,n,a=-Math.PI/2){return Array.from({length:n},(l,i)=>{const o=a+2*i*Math.PI/n;return[e+r*Math.cos(o),t+r*Math.sin(o)]})}function ic(e,t,r,n,a,l){const i=l-a;if(Math.abs(i)>=2*Math.PI){const l=a+Math.PI;return`${ic(e,t,r,n,a,l)} ${ic(e,t,r,n,l,a+2*Math.PI)}`}const o=Math.abs(i)>Math.PI?1:0,s=(r,n)=>[e+r*Math.cos(n),t+r*Math.sin(n)],[c,d]=s(n,a),[u,h]=s(n,l);if(r<=0)return`M${Xs(e)},${Xs(t)} L${Xs(c)},${Xs(d)} A${Xs(n)},${Xs(n)} 0 ${o} 1 ${Xs(u)},${Xs(h)} Z`;const[m,p]=s(r,l),[g,f]=s(r,a);return`M${Xs(c)},${Xs(d)} A${Xs(n)},${Xs(n)} 0 ${o} 1 ${Xs(u)},${Xs(h)} L${Xs(m)},${Xs(p)} A${Xs(r)},${Xs(r)} 0 ${o} 0 ${Xs(g)},${Xs(f)} Z`}function oc({segments:e,variant:t="pie",size:r=280,innerRadius:n,padAngle:a=.012,maxSegments:l=6,otherLabel:i,formatValue:o,centerLabel:s,animate:c=!0,labels:d="none",labelMinShare:u=.04,className:h,emptyLabel:m}){const p=ae().charts,g=ne(),f=o??(e=>se(e,g)),b=i??p.other,y=m??p.nothingToBreakDown,x=Me(),[v,w]=Le(null),{highlighted:N}=Hs(),k=Se(null),$=Os(k,Number.POSITIVE_INFINITY),M=e.map((e,t)=>({...e,slot:t})).filter(e=>e.value>0);if(0===M.length)/* @__PURE__ */return Re("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),S=C.slice(l),D=S.length>0?[...L,{key:"__other__",label:b,value:S.reduce((e,t)=>e+t.value,0),slot:-1,color:Ns.muted}]:L,P=e=>$s(e.slot,e.color,e.tone),A=D.reduce((e,t)=>e+t.value,0),j=Math.ceil(.62*Math.max(...D.map(e=>String(e.label).length),4)*11)+24,z="outside"===d&&$>=120+2*j,F=z?j:0,T=z?Math.max(120,Math.min(r,$-2*F)):r,E=T+2*F,B=F+T/2,I=T/2,O=T/2-12,R=n??("ring"===t?.58*O:0),W=Ts(D.length,a),K=Math.max(...D.map(e=>e.value)),_=e=>R+(O-R)*Math.sqrt(Math.max(0,e)/K);let q=-Math.PI/2;const H=(()=>{if(!z)return[];let e=-Math.PI/2;const r=D.map((r,n)=>{const l="rose"===t?Ts(D.length,a).step:r.value/A*Math.PI*2,i="rose"===t?Ts(D.length,a).center(n):e+l/2;e+=l;const o="rose"===t?_(r.value):O;return{key:r.key,label:r.label,share:r.value/A,right:Math.cos(i)>=0,anchor:[B+o*Math.cos(i),I+o*Math.sin(i)],y:I+(o+14)*Math.sin(i),index:n}}).filter(e=>e.share>=u),n=Math.max(1,Math.floor((T-11-13)/26)+1),l=/* @__PURE__ */new Set;for(const e of[!0,!1]){const t=r.filter(t=>t.right===e).sort((e,t)=>t.share-e.share).slice(0,n).sort((e,t)=>e.y-t.y);for(let e=1;e<t.length;e+=1)t[e].y-t[e-1].y<26&&(t[e].y=t[e-1].y+26);for(let e=t.length-1;e>=0;e-=1){const r=e===t.length-1?T-13:t[e+1].y-26;t[e].y=Math.min(t[e].y,r)}t.forEach((e,r)=>{e.y=Math.max(e.y,0===r?11:t[r-1].y+26),l.add(e.key)})}return r.filter(e=>l.has(e.key))})(),U=(e,t)=>null!==v?v!==e:null!==N&&N!==t,V=null!==v?D[v]:void 0;/* @__PURE__ */
|
|
644
|
-
return We("div",{className:`relative ${h??""}`,ref:k,children:[
|
|
645
|
-
/* @__PURE__ */We("svg",{width:"100%",height:T,viewBox:`0 0 ${E} ${T}`,role:"img","aria-labelledby":x,onMouseLeave:()=>w(null),children:[
|
|
646
|
-
/* @__PURE__ */Re("title",{id:x,children:p.breakdown(f(A),D.length)}),D.map((e,r)=>{const n=P(e),l="rose"===t?W(r):q,i="rose"===t?W.step:e.value/A*Math.PI*2-a;"rose"!==t&&(q+=e.value/A*Math.PI*2);const o=l+Math.max(.001,i),s="rose"===t?_(e.value):O;/* @__PURE__ */
|
|
647
|
-
return Re("path",{d:ic(B,I,R,s,l,o),fill:n,fillOpacity:U(r,e.key)?.4:1,stroke:Ns.surface,strokeWidth:1,className:c?ii.sweep:void 0,style:c?oi(r,55):void 0,onMouseEnter:()=>w(r)},e.key)}),H.map(e=>{const t=e.right?E-6:6,r=e.right?B+O+14:B-O-14;/* @__PURE__ */
|
|
648
|
-
return We("g",{children:[
|
|
649
|
-
/* @__PURE__ */Re("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:Ns.grid,strokeWidth:1}),
|
|
650
|
-
/* @__PURE__ */Re("text",{x:t,y:e.y-2,fontSize:11,fill:Ns.label,textAnchor:e.right?"end":"start",children:e.label}),
|
|
651
|
-
/* @__PURE__ */Re("text",{x:t,y:e.y+10,fontSize:11,fontWeight:600,fill:Ns.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:de(100*e.share,1,g)})]},`lbl-${e.key}`)}),s&&R>0&&/* @__PURE__ */Re("text",{x:B,y:I+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:Ns.label,children:s})]}),V&&null!==v&&/* @__PURE__ */Re("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Re(Ys,{title:V.label,rows:[{key:"value",label:p.value,color:P(V),value:f(V.value)},{key:"share",label:p.share,color:Ns.muted,value:de(V.value/A*100,1,g)}]})}),
|
|
652
|
-
/* @__PURE__ */Re("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:D.map((e,t)=>/* @__PURE__ */We("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
653
|
-
/* @__PURE__ */Re("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:P(e)}}),
|
|
654
|
-
/* @__PURE__ */Re("span",{className:"flex-1 truncate",children:e.label}),
|
|
655
|
-
/* @__PURE__ */Re("span",{className:"tabular-nums text-gray-800",children:de(e.value/A*100,1,g)})]},e.key))})]})}var sc={paid:"success",shipped:"active",processing:"queued",refunded:"neutral",overdue:"danger"},cc=[12,18,14,22,19,27,24,31,28,35,30,38],dc=["J","F","M","A","M","J","J","A","S","O","N","D"],uc=[{key:"direct",label:"Direct",value:45},{key:"search",label:"Search",value:30},{key:"social",label:"Social",value:15},{key:"email",label:"Email",value:10}],hc=[{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 mc(){/* @__PURE__ */
|
|
656
|
-
return Re(pa,{groups:sc,children:/* @__PURE__ */Re("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */We("div",{className:"mx-auto max-w-6xl space-y-6",children:[
|
|
657
|
-
/* @__PURE__ */We("div",{className:"flex items-center justify-between gap-4",children:[
|
|
658
|
-
/* @__PURE__ */We("div",{children:[
|
|
659
|
-
/* @__PURE__ */Re("h1",{className:"text-xl font-semibold text-gray-900",children:"Dashboard"}),
|
|
660
|
-
/* @__PURE__ */Re("p",{className:"text-sm text-gray-500",children:"Overview of your store this month"})]}),
|
|
661
|
-
/* @__PURE__ */We("div",{className:"flex items-center gap-2",children:[
|
|
662
|
-
/* @__PURE__ */Re(v,{variant:"secondary",size:"sm",children:"Export"}),
|
|
663
|
-
/* @__PURE__ */Re(v,{size:"sm",children:"New report"})]})]}),
|
|
664
|
-
/* @__PURE__ */We("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[
|
|
665
|
-
/* @__PURE__ */Re(Na,{label:"Revenue",value:"$38.2k",delta:{value:"12%",direction:"up"}}),
|
|
666
|
-
/* @__PURE__ */Re(Na,{label:"Orders",value:"1,204",delta:{value:"4%",direction:"up"}}),
|
|
667
|
-
/* @__PURE__ */Re(Na,{label:"Customers",value:"892",delta:{value:"2%",direction:"down"}}),
|
|
668
|
-
/* @__PURE__ */Re(Na,{label:"Refunds",value:"$1.1k",delta:{value:"0%",direction:"flat"}})]}),
|
|
669
|
-
/* @__PURE__ */We("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-3",children:[
|
|
670
|
-
/* @__PURE__ */Re(wa,{header:"Revenue",className:"lg:col-span-2",children:/* @__PURE__ */Re(Gs,{labels:dc,height:200,series:[{key:"revenue",label:"Revenue",data:cc}],formatValue:e=>`$${e}k`})}),
|
|
671
|
-
/* @__PURE__ */Re(wa,{header:"Traffic sources",children:/* @__PURE__ */Re(oc,{variant:"ring",size:180,segments:uc,centerLabel:"100%"})})]}),
|
|
672
|
-
/* @__PURE__ */Re(wa,{header:"Recent orders",padded:!1,children:/* @__PURE__ */We("table",{className:"w-full text-sm",children:[
|
|
673
|
-
/* @__PURE__ */Re("thead",{children:/* @__PURE__ */We("tr",{className:"border-b border-gray-100 text-left text-xs uppercase tracking-wide text-gray-400",children:[
|
|
674
|
-
/* @__PURE__ */Re("th",{className:"px-4 py-2 font-medium",children:"Order"}),
|
|
675
|
-
/* @__PURE__ */Re("th",{className:"px-4 py-2 font-medium",children:"Customer"}),
|
|
676
|
-
/* @__PURE__ */Re("th",{className:"px-4 py-2 font-medium",children:"Total"}),
|
|
677
|
-
/* @__PURE__ */Re("th",{className:"px-4 py-2 font-medium",children:"Status"})]})}),
|
|
678
|
-
/* @__PURE__ */Re("tbody",{className:"divide-y divide-gray-100",children:hc.map(e=>/* @__PURE__ */We("tr",{className:"text-gray-700",children:[
|
|
679
|
-
/* @__PURE__ */Re("td",{className:"px-4 py-2 font-mono text-xs text-gray-500",children:e.id}),
|
|
680
|
-
/* @__PURE__ */Re("td",{className:"px-4 py-2",children:/* @__PURE__ */We("span",{className:"flex items-center gap-2",children:[
|
|
681
|
-
/* @__PURE__ */Re(fl,{size:"xs",name:e.customer}),e.customer]})}),
|
|
682
|
-
/* @__PURE__ */Re("td",{className:"px-4 py-2",children:e.total}),
|
|
683
|
-
/* @__PURE__ */Re("td",{className:"px-4 py-2",children:/* @__PURE__ */Re(fa,{status:e.status})})]},e.id))})]})}),
|
|
684
|
-
/* @__PURE__ */We("p",{className:"flex items-center gap-2 text-xs text-gray-400",children:[
|
|
685
|
-
/* @__PURE__ */Re("span",{className:"text-emerald-600",children:/* @__PURE__ */Re(ys,{data:cc,width:80,height:20})}),"Trending up 12% vs last month"]})]})})})}var pc={active:"success",invited:"queued",suspended:"danger",pending:"pending"},gc=[{name:"Alice Nguyen",email:"alice@acme.co",role:"Admin",status:"active"},{name:"Marco Reyes",email:"marco@acme.co",role:"Editor",status:"invited"},{name:"Priya Patel",email:"priya@acme.co",role:"Editor",status:"active"},{name:"Tom Becker",email:"tom@acme.co",role:"Viewer",status:"suspended"},{name:"Sara Lind",email:"sara@acme.co",role:"Viewer",status:"pending"},{name:"Yuki Tanaka",email:"yuki@acme.co",role:"Editor",status:"active"}];function fc(){const[e,t]=Le(1),[r,n]=Le(""),[a,l]=Le("");/* @__PURE__ */
|
|
686
|
-
return Re(pa,{groups:pc,children:/* @__PURE__ */Re("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */We("div",{className:"mx-auto max-w-5xl space-y-4",children:[
|
|
687
|
-
/* @__PURE__ */We("div",{className:"flex items-center justify-between gap-4",children:[
|
|
688
|
-
/* @__PURE__ */Re("h1",{className:"text-xl font-semibold text-gray-900",children:"Members"}),
|
|
689
|
-
/* @__PURE__ */Re(v,{size:"sm",children:"Invite member"})]}),
|
|
690
|
-
/* @__PURE__ */We(wa,{padded:!1,children:[
|
|
691
|
-
/* @__PURE__ */We("div",{className:"flex flex-wrap items-center gap-2 border-b border-gray-100 p-3",children:[
|
|
692
|
-
/* @__PURE__ */Re("div",{className:"min-w-48 flex-1",children:/* @__PURE__ */Re(He,{value:a,onChange:e=>l(e.target.value),placeholder:"Search members…",leftIcon:/* @__PURE__ */Re(bc,{})})}),
|
|
693
|
-
/* @__PURE__ */Re("div",{className:"w-40",children:/* @__PURE__ */Re(ot,{value:r,onChange:n,placeholder:"All roles",options:[{value:"admin",label:"Admin"},{value:"editor",label:"Editor"},{value:"viewer",label:"Viewer"}]})}),
|
|
694
|
-
/* @__PURE__ */Re(v,{variant:"secondary",size:"sm",children:"Filter"})]}),
|
|
695
|
-
/* @__PURE__ */We("table",{className:"w-full text-sm",children:[
|
|
696
|
-
/* @__PURE__ */Re("thead",{children:/* @__PURE__ */We("tr",{className:"border-b border-gray-100 text-left text-xs uppercase tracking-wide text-gray-400",children:[
|
|
697
|
-
/* @__PURE__ */Re("th",{className:"px-4 py-2 font-medium",children:"Name"}),
|
|
698
|
-
/* @__PURE__ */Re("th",{className:"px-4 py-2 font-medium",children:"Role"}),
|
|
699
|
-
/* @__PURE__ */Re("th",{className:"px-4 py-2 font-medium",children:"Status"}),
|
|
700
|
-
/* @__PURE__ */Re("th",{className:"px-4 py-2 font-medium text-right",children:"Actions"})]})}),
|
|
701
|
-
/* @__PURE__ */Re("tbody",{className:"divide-y divide-gray-100",children:gc.map(e=>/* @__PURE__ */We("tr",{className:"text-gray-700 hover:bg-gray-50",children:[
|
|
702
|
-
/* @__PURE__ */We("td",{className:"px-4 py-3",children:[
|
|
703
|
-
/* @__PURE__ */Re("div",{className:"font-medium text-gray-900",children:e.name}),
|
|
704
|
-
/* @__PURE__ */Re("div",{className:"text-xs text-gray-400",children:e.email})]}),
|
|
705
|
-
/* @__PURE__ */Re("td",{className:"px-4 py-3",children:e.role}),
|
|
706
|
-
/* @__PURE__ */Re("td",{className:"px-4 py-3",children:/* @__PURE__ */Re(fa,{status:e.status})}),
|
|
707
|
-
/* @__PURE__ */Re("td",{className:"px-4 py-3 text-right",children:/* @__PURE__ */Re(v,{variant:"ghost",size:"sm",children:"Edit"})})]},e.email))})]}),
|
|
708
|
-
/* @__PURE__ */We("div",{className:"flex items-center justify-between border-t border-gray-100 p-3",children:[
|
|
709
|
-
/* @__PURE__ */Re("span",{className:"text-xs text-gray-400",children:"Showing 1–6 of 48"}),
|
|
710
|
-
/* @__PURE__ */Re(os,{page:e,pageCount:8,onPageChange:t,showEdges:!0})]})]})]})})})}function bc(){/* @__PURE__ */
|
|
711
|
-
return Re(Ne,{name:"search",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})}function yc(){const[e,t]=Le("pro"),[r,n]=Le(!0),[a,l]=Le("us");/* @__PURE__ */
|
|
712
|
-
return Re("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */We("form",{className:"mx-auto max-w-2xl space-y-5",onSubmit:e=>e.preventDefault(),children:[
|
|
713
|
-
/* @__PURE__ */We("div",{children:[
|
|
714
|
-
/* @__PURE__ */Re("h1",{className:"text-xl font-semibold text-gray-900",children:"Account settings"}),
|
|
715
|
-
/* @__PURE__ */Re("p",{className:"text-sm text-gray-500",children:"Update your profile and preferences."})]}),
|
|
716
|
-
/* @__PURE__ */Re(wa,{header:"Profile",children:/* @__PURE__ */We("div",{className:"space-y-4",children:[
|
|
717
|
-
/* @__PURE__ */We("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
|
|
718
|
-
/* @__PURE__ */Re(ht,{label:"First name",htmlFor:"fn",required:!0,children:/* @__PURE__ */Re(He,{id:"fn",defaultValue:"Alice"})}),
|
|
719
|
-
/* @__PURE__ */Re(ht,{label:"Last name",htmlFor:"ln",required:!0,children:/* @__PURE__ */Re(He,{id:"ln",defaultValue:"Nguyen"})})]}),
|
|
720
|
-
/* @__PURE__ */Re(ht,{label:"Email",htmlFor:"email",hint:"We'll never share your email.",children:/* @__PURE__ */Re(He,{id:"email",type:"email",defaultValue:"alice@acme.co"})}),
|
|
721
|
-
/* @__PURE__ */Re(ht,{label:"Bio",htmlFor:"bio",hint:"Brief description for your profile.",children:/* @__PURE__ */Re(Ue,{id:"bio",autoGrow:!0,defaultValue:"Product designer at Acme."})})]})}),
|
|
722
|
-
/* @__PURE__ */Re(wa,{header:"Preferences",children:/* @__PURE__ */We("div",{className:"space-y-4",children:[
|
|
723
|
-
/* @__PURE__ */We("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
|
|
724
|
-
/* @__PURE__ */Re(ht,{label:"Country",htmlFor:"country",children:/* @__PURE__ */Re(ot,{value:a,onChange:l,options:[{value:"us",label:"United States"},{value:"de",label:"Germany"},{value:"jp",label:"Japan"}]})}),
|
|
725
|
-
/* @__PURE__ */Re(ht,{label:"Plan",children:/* @__PURE__ */We("div",{className:"space-y-2 pt-1",children:[
|
|
726
|
-
/* @__PURE__ */Re(ut,{name:"plan",checked:"free"===e,onChange:()=>t("free"),label:"Free"}),
|
|
727
|
-
/* @__PURE__ */Re(ut,{name:"plan",checked:"pro"===e,onChange:()=>t("pro"),label:"Pro"}),
|
|
728
|
-
/* @__PURE__ */Re(ut,{name:"plan",checked:"team"===e,onChange:()=>t("team"),label:"Team"})]})})]}),
|
|
729
|
-
/* @__PURE__ */Re(ct,{checked:r,onChange:n,label:"Email me product updates",description:"Occasional news — no more than once a month."})]})}),
|
|
730
|
-
/* @__PURE__ */We("div",{className:"flex items-center justify-end gap-2",children:[
|
|
731
|
-
/* @__PURE__ */Re(v,{variant:"secondary",children:"Cancel"}),
|
|
732
|
-
/* @__PURE__ */Re(v,{type:"submit",children:"Save changes"})]})]})})}var xc=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function vc(){const[e,t]=Le(!0),[r,n]=Le("us"),a=xc.reduce((e,t)=>e+t.qty*t.price,0),l=a+9;/* @__PURE__ */
|
|
733
|
-
return Re("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */We("div",{className:"mx-auto max-w-5xl space-y-5",children:[
|
|
734
|
-
/* @__PURE__ */Re("h1",{className:"text-xl font-semibold text-gray-900",children:"Checkout"}),
|
|
735
|
-
/* @__PURE__ */We("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-3",children:[
|
|
736
|
-
/* @__PURE__ */We("form",{className:"space-y-5 lg:col-span-2",onSubmit:e=>e.preventDefault(),children:[
|
|
737
|
-
/* @__PURE__ */Re(wa,{header:"Contact",children:/* @__PURE__ */Re("div",{className:"space-y-4",children:/* @__PURE__ */Re(ht,{label:"Email",htmlFor:"ck-email",required:!0,children:/* @__PURE__ */Re(He,{id:"ck-email",type:"email",placeholder:"you@example.com"})})})}),
|
|
738
|
-
/* @__PURE__ */Re(wa,{header:"Shipping address",children:/* @__PURE__ */We("div",{className:"space-y-4",children:[
|
|
739
|
-
/* @__PURE__ */We("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
|
|
740
|
-
/* @__PURE__ */Re(ht,{label:"First name",required:!0,children:/* @__PURE__ */Re(He,{placeholder:"Alice"})}),
|
|
741
|
-
/* @__PURE__ */Re(ht,{label:"Last name",required:!0,children:/* @__PURE__ */Re(He,{placeholder:"Nguyen"})})]}),
|
|
742
|
-
/* @__PURE__ */Re(ht,{label:"Address",required:!0,children:/* @__PURE__ */Re(He,{placeholder:"123 Market St"})}),
|
|
743
|
-
/* @__PURE__ */We("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[
|
|
744
|
-
/* @__PURE__ */Re(ht,{label:"City",children:/* @__PURE__ */Re(He,{placeholder:"San Francisco"})}),
|
|
745
|
-
/* @__PURE__ */Re(ht,{label:"ZIP",children:/* @__PURE__ */Re(He,{placeholder:"94103"})}),
|
|
746
|
-
/* @__PURE__ */Re(ht,{label:"Country",children:/* @__PURE__ */Re(ot,{value:r,onChange:n,options:[{value:"us",label:"United States"},{value:"de",label:"Germany"},{value:"jp",label:"Japan"}]})})]}),
|
|
747
|
-
/* @__PURE__ */Re(ct,{checked:e,onChange:t,label:"Billing address same as shipping"})]})}),
|
|
748
|
-
/* @__PURE__ */Re(wa,{header:"Payment",children:/* @__PURE__ */We("div",{className:"space-y-4",children:[
|
|
749
|
-
/* @__PURE__ */Re(ht,{label:"Card number",required:!0,children:/* @__PURE__ */Re(He,{placeholder:"1234 5678 9012 3456"})}),
|
|
750
|
-
/* @__PURE__ */We("div",{className:"grid grid-cols-2 gap-4",children:[
|
|
751
|
-
/* @__PURE__ */Re(ht,{label:"Expiry",required:!0,children:/* @__PURE__ */Re(He,{placeholder:"MM / YY"})}),
|
|
752
|
-
/* @__PURE__ */Re(ht,{label:"CVC",required:!0,children:/* @__PURE__ */Re(He,{placeholder:"123"})})]})]})})]}),
|
|
753
|
-
/* @__PURE__ */We("div",{className:"space-y-4",children:[
|
|
754
|
-
/* @__PURE__ */We(wa,{header:"Order summary",children:[
|
|
755
|
-
/* @__PURE__ */Re("ul",{className:"space-y-2 text-sm",children:xc.map(e=>/* @__PURE__ */We("li",{className:"flex items-center justify-between gap-2 text-gray-700",children:[
|
|
756
|
-
/* @__PURE__ */We("span",{children:[e.name," ",
|
|
757
|
-
/* @__PURE__ */We("span",{className:"text-gray-400",children:["×",e.qty]})]}),
|
|
758
|
-
/* @__PURE__ */We("span",{children:["$",e.qty*e.price]})]},e.name))}),
|
|
759
|
-
/* @__PURE__ */We("div",{className:"mt-3 space-y-2 border-t border-gray-100 pt-3 text-sm text-gray-600",children:[
|
|
760
|
-
/* @__PURE__ */We("div",{className:"flex justify-between",children:[
|
|
761
|
-
/* @__PURE__ */Re("span",{children:"Subtotal"}),
|
|
762
|
-
/* @__PURE__ */We("span",{children:["$",a]})]}),
|
|
763
|
-
/* @__PURE__ */We("div",{className:"flex justify-between",children:[
|
|
764
|
-
/* @__PURE__ */Re("span",{children:"Shipping"}),
|
|
765
|
-
/* @__PURE__ */We("span",{children:["$",9]})]}),
|
|
766
|
-
/* @__PURE__ */We("div",{className:"flex justify-between text-base font-semibold text-gray-900",children:[
|
|
767
|
-
/* @__PURE__ */Re("span",{children:"Total"}),
|
|
768
|
-
/* @__PURE__ */We("span",{children:["$",l]})]})]}),
|
|
769
|
-
/* @__PURE__ */We(v,{block:!0,className:"mt-4",children:["Pay $",l]})]}),
|
|
770
|
-
/* @__PURE__ */Re(wl,{tone:"success",title:"Promo applied",children:"Free returns within 30 days."})]})]})]})})}var wc=[{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"}],Nc=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know…",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported…",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by…",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th…",time:"Yest"}];function kc(){const[e,r]=Le(1),n=Nc.find(t=>t.id===e)??Nc[0];/* @__PURE__ */
|
|
771
|
-
return Re("div",{className:"h-full",children:/* @__PURE__ */Re(t,{side:"left",defaultWidth:200,sidebar:/* @__PURE__ */We("div",{className:"flex h-full flex-col p-2",children:[
|
|
772
|
-
/* @__PURE__ */Re(v,{block:!0,className:"mb-2",children:"Compose"}),wc.map((e,t)=>/* @__PURE__ */We("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:[
|
|
773
|
-
/* @__PURE__ */Re("span",{children:e.label}),null!=e.count&&/* @__PURE__ */Re("span",{className:"text-xs text-gray-400",children:e.count})]},e.id))]}),children:/* @__PURE__ */We("div",{className:"flex h-full",children:[
|
|
774
|
-
/* @__PURE__ */Re("div",{className:"w-72 shrink-0 overflow-auto border-r border-gray-200",children:Nc.map(t=>/* @__PURE__ */We("button",{onClick:()=>r(t.id),className:"block w-full border-b border-gray-100 px-4 py-3 text-left hover:bg-gray-50 "+(t.id===e?"bg-blue-50/50":""),children:[
|
|
775
|
-
/* @__PURE__ */We("div",{className:"flex items-center justify-between gap-2",children:[
|
|
776
|
-
/* @__PURE__ */Re("span",{className:"truncate text-sm "+(t.unread?"font-semibold text-gray-900":"text-gray-700"),children:t.from}),
|
|
777
|
-
/* @__PURE__ */Re("span",{className:"shrink-0 text-2xs text-gray-400",children:t.time})]}),
|
|
778
|
-
/* @__PURE__ */Re("div",{className:"truncate text-sm "+(t.unread?"text-gray-800":"text-gray-600"),children:t.subject}),
|
|
779
|
-
/* @__PURE__ */Re("div",{className:"truncate text-xs text-gray-400",children:t.preview})]},t.id))}),
|
|
780
|
-
/* @__PURE__ */We("div",{className:"flex min-w-0 flex-1 flex-col overflow-auto",children:[
|
|
781
|
-
/* @__PURE__ */We("div",{className:"flex items-center justify-between gap-3 border-b border-gray-200 p-4",children:[
|
|
782
|
-
/* @__PURE__ */Re("h2",{className:"truncate text-base font-semibold text-gray-900",children:n.subject}),
|
|
783
|
-
/* @__PURE__ */We("div",{className:"flex shrink-0 gap-2",children:[
|
|
784
|
-
/* @__PURE__ */Re(v,{variant:"ghost",size:"sm",children:"Archive"}),
|
|
785
|
-
/* @__PURE__ */Re(v,{variant:"secondary",size:"sm",children:"Reply"})]})]}),
|
|
786
|
-
/* @__PURE__ */We("div",{className:"flex items-center gap-3 border-b border-gray-100 p-4",children:[
|
|
787
|
-
/* @__PURE__ */Re(fl,{name:n.from}),
|
|
788
|
-
/* @__PURE__ */We("div",{className:"min-w-0",children:[
|
|
789
|
-
/* @__PURE__ */Re("div",{className:"text-sm font-medium text-gray-900",children:n.from}),
|
|
790
|
-
/* @__PURE__ */We("div",{className:"text-xs text-gray-400",children:["to me · ",n.time]})]})]}),
|
|
791
|
-
/* @__PURE__ */We("div",{className:"space-y-3 p-4 text-sm leading-relaxed text-gray-700",children:[
|
|
792
|
-
/* @__PURE__ */Re("p",{children:"Hi,"}),
|
|
793
|
-
/* @__PURE__ */We("p",{children:[n.preview," The full details are attached — happy to walk through anything on a quick call."]}),
|
|
794
|
-
/* @__PURE__ */We("p",{children:["Best,",
|
|
795
|
-
/* @__PURE__ */Re("br",{}),n.from]})]})]})]})})})}var $c=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],Mc=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function Cc(){const[e,r]=Le(1),n=$c.find(t=>t.id===e)??$c[0];/* @__PURE__ */
|
|
796
|
-
return Re("div",{className:"h-full",children:/* @__PURE__ */Re(t,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */Re("div",{className:"h-full overflow-auto",children:$c.map(t=>/* @__PURE__ */We("button",{onClick:()=>r(t.id),className:"flex w-full items-center gap-3 border-b border-gray-100 px-3 py-3 text-left hover:bg-gray-50 "+(t.id===e?"bg-blue-50/50":""),children:[
|
|
797
|
-
/* @__PURE__ */Re(fl,{name:t.name,status:t.status}),
|
|
798
|
-
/* @__PURE__ */We("div",{className:"min-w-0 flex-1",children:[
|
|
799
|
-
/* @__PURE__ */We("div",{className:"flex items-center justify-between gap-2",children:[
|
|
800
|
-
/* @__PURE__ */Re("span",{className:"truncate text-sm font-medium text-gray-900",children:t.name}),
|
|
801
|
-
/* @__PURE__ */Re("span",{className:"shrink-0 text-2xs text-gray-400",children:t.time})]}),
|
|
802
|
-
/* @__PURE__ */Re("div",{className:"truncate text-xs text-gray-500",children:t.last})]})]},t.id))}),children:/* @__PURE__ */We("div",{className:"flex h-full flex-col",children:[
|
|
803
|
-
/* @__PURE__ */We("div",{className:"flex items-center gap-3 border-b border-gray-200 p-3",children:[
|
|
804
|
-
/* @__PURE__ */Re(fl,{name:n.name,status:n.status,size:"sm"}),
|
|
805
|
-
/* @__PURE__ */We("div",{children:[
|
|
806
|
-
/* @__PURE__ */Re("div",{className:"text-sm font-medium text-gray-900",children:n.name}),
|
|
807
|
-
/* @__PURE__ */Re("div",{className:"text-xs text-gray-400 capitalize",children:n.status})]})]}),
|
|
808
|
-
/* @__PURE__ */Re("div",{className:"flex flex-1 flex-col gap-2 overflow-auto bg-gray-50 p-4",children:Mc.map((e,t)=>/* @__PURE__ */Re("div",{className:"flex "+(e.mine?"justify-end":"justify-start"),children:/* @__PURE__ */Re("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))}),
|
|
809
|
-
/* @__PURE__ */We("form",{className:"flex items-center gap-2 border-t border-gray-200 p-3",onSubmit:e=>e.preventDefault(),children:[
|
|
810
|
-
/* @__PURE__ */Re("div",{className:"flex-1",children:/* @__PURE__ */Re(He,{placeholder:"Type a message…"})}),
|
|
811
|
-
/* @__PURE__ */Re(v,{type:"submit",children:"Send"})]})]})})})}var Lc={featured:"success",new:"active",draft:"draft"},Sc=["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 Dc(){const[e,t]=Le("all"),r="all"===e?Sc:Sc.filter(t=>t.tag===e);/* @__PURE__ */
|
|
812
|
-
return Re(pa,{groups:Lc,children:/* @__PURE__ */Re("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */We("div",{className:"mx-auto max-w-5xl space-y-4",children:[
|
|
813
|
-
/* @__PURE__ */We("div",{className:"flex items-center justify-between gap-4",children:[
|
|
814
|
-
/* @__PURE__ */Re("h1",{className:"text-xl font-semibold text-gray-900",children:"Gallery"}),
|
|
815
|
-
/* @__PURE__ */Re(v,{size:"sm",children:"Upload"})]}),
|
|
816
|
-
/* @__PURE__ */Re(Cl,{value:e,onChange:t,variant:"pill",items:[{id:"all",label:"All"},{id:"featured",label:"Featured"},{id:"new",label:"New"},{id:"draft",label:"Drafts"}]}),
|
|
817
|
-
/* @__PURE__ */Re("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4",children:r.map(e=>/* @__PURE__ */We(wa,{padded:!1,className:"overflow-hidden",children:[
|
|
818
|
-
/* @__PURE__ */Re("div",{className:"relative h-28",style:{background:e.bg},children:/* @__PURE__ */Re("span",{className:"absolute right-2 top-2",children:/* @__PURE__ */Re(fa,{status:e.tag})})}),
|
|
819
|
-
/* @__PURE__ */We("div",{className:"flex items-center justify-between gap-2 p-3",children:[
|
|
820
|
-
/* @__PURE__ */Re("span",{className:"truncate text-sm font-medium text-gray-900",children:e.title}),
|
|
821
|
-
/* @__PURE__ */Re("span",{className:"text-xs text-gray-400",children:"2.4 MB"})]})]},e.id))})]})})})}var Pc={login:{title:"Welcome back",subtitle:"Sign in to your account",cta:"Sign in"},register:{title:"Create your account",subtitle:"Start your 14-day free trial",cta:"Create account"},forgot:{title:"Reset password",subtitle:"We'll email you a reset link",cta:"Send reset link"}};function Ac({mode:e="login"}){const[t,r]=Le(!0),n=Pc[e];/* @__PURE__ */
|
|
822
|
-
return Re("div",{className:"flex h-full items-center justify-center overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */We("div",{className:"w-full max-w-sm",children:[
|
|
823
|
-
/* @__PURE__ */We("div",{className:"mb-6 text-center",children:[
|
|
824
|
-
/* @__PURE__ */Re("div",{className:"mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-blue-600 text-sm font-bold text-white",children:"A"}),
|
|
825
|
-
/* @__PURE__ */Re("h1",{className:"text-lg font-semibold text-gray-900",children:n.title}),
|
|
826
|
-
/* @__PURE__ */Re("p",{className:"text-sm text-gray-500",children:n.subtitle})]}),
|
|
827
|
-
/* @__PURE__ */Re(wa,{children:/* @__PURE__ */We("form",{className:"space-y-4",onSubmit:e=>e.preventDefault(),children:["register"===e&&/* @__PURE__ */Re(ht,{label:"Name",htmlFor:"au-name",children:/* @__PURE__ */Re(He,{id:"au-name",placeholder:"Alice Nguyen"})}),
|
|
828
|
-
/* @__PURE__ */Re(ht,{label:"Email",htmlFor:"au-email",children:/* @__PURE__ */Re(He,{id:"au-email",type:"email",placeholder:"you@example.com"})}),"forgot"!==e&&/* @__PURE__ */Re(ht,{label:"Password",htmlFor:"au-pass",hint:"register"===e?"At least 8 characters.":void 0,children:/* @__PURE__ */Re(He,{id:"au-pass",type:"password",placeholder:"••••••••"})}),"login"===e&&/* @__PURE__ */We("div",{className:"flex items-center justify-between",children:[
|
|
829
|
-
/* @__PURE__ */Re(ct,{checked:t,onChange:r,label:"Remember me"}),
|
|
830
|
-
/* @__PURE__ */Re("a",{href:"#",className:"text-sm text-blue-600 hover:underline",children:"Forgot?"})]}),
|
|
831
|
-
/* @__PURE__ */Re(v,{type:"submit",block:!0,children:n.cta})]})}),
|
|
832
|
-
/* @__PURE__ */Re("p",{className:"mt-4 text-center text-sm text-gray-500",children:/* @__PURE__ */We(Ke,"register"===e?{children:["Already have an account? ",
|
|
833
|
-
/* @__PURE__ */Re("a",{href:"#",className:"text-blue-600 hover:underline",children:"Sign in"})]}:{children:["New here? ",
|
|
834
|
-
/* @__PURE__ */Re("a",{href:"#",className:"text-blue-600 hover:underline",children:"Create an account"})]})})]})})}var jc={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 zc({code:e=404,actions:t}){const r=jc[e](ae().errors);/* @__PURE__ */
|
|
835
|
-
return We("div",{className:"flex h-full flex-col items-center justify-center bg-gray-50 p-6 text-center",children:[
|
|
836
|
-
/* @__PURE__ */Re("div",{className:"text-7xl font-bold tracking-tight text-gray-400",children:e}),
|
|
837
|
-
/* @__PURE__ */Re("h1",{className:"mt-2 text-xl font-semibold text-gray-900",children:r.title}),
|
|
838
|
-
/* @__PURE__ */Re("p",{className:"mt-1 max-w-sm text-sm text-gray-500",children:r.body}),t&&/* @__PURE__ */Re("div",{className:"mt-6 flex items-center gap-2",children:t})]})}function Fc({pick:e}){/* @__PURE__ */
|
|
839
|
-
return Re(Ke,{children:e(ae().errors)})}var Tc=class extends Be{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("ErrorBoundary caught an error:",e,t),Q(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):
|
|
840
|
-
/* @__PURE__ */We("div",{className:"flex h-full flex-col",children:[
|
|
841
|
-
/* @__PURE__ */Re("div",{role:"alert",className:"min-h-0 flex-1",children:/* @__PURE__ */Re(zc,{code:500,actions:/* @__PURE__ */We(Ke,{children:[
|
|
842
|
-
/* @__PURE__ */Re(v,{onClick:this.reset,children:/* @__PURE__ */Re(Fc,{pick:e=>e.retry})}),this.props.actions]})})}),this.props.showDetails&&/* @__PURE__ */We("details",{className:"mx-auto w-full max-w-2xl shrink-0 px-6 pb-6",children:[
|
|
843
|
-
/* @__PURE__ */Re("summary",{className:"cursor-pointer text-sm font-medium text-gray-600",children:/* @__PURE__ */Re(Fc,{pick:e=>e.details})}),
|
|
844
|
-
/* @__PURE__ */Re("pre",{className:"mt-2 overflow-auto rounded-md bg-gray-100 p-3 text-xs text-gray-700",children:e.stack??e.message})]})]}):this.props.children}};function Ec(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}function Bc(e){const t=Ec();return t?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):()=>{}}function Ic(){return Ec()?.matches??!1}function Oc(){return!1}function Rc(e){const t=parseInt(e.slice(1,3),16)/255,r=parseInt(e.slice(3,5),16)/255,n=parseInt(e.slice(5,7),16)/255,a=Math.max(t,r,n),l=Math.min(t,r,n);let i=0,o=0;const s=(a+l)/2;if(a!==l){const e=a-l;o=s>.5?e/(2-a-l):e/(a+l),i=a===t?((r-n)/e+(r<n?6:0))/6:a===r?((n-t)/e+2)/6:((t-r)/e+4)/6}return[360*i,100*o,100*s]}function Wc(e,t,r){r/=100;const n=(t/=100)*Math.min(r,1-r),a=t=>{const a=(t+e/30)%12;return r-n*Math.max(Math.min(a-3,9-a,1),-1)},l=e=>Math.round(255*e).toString(16).padStart(2,"0");return`#${l(a(0))}${l(a(8))}${l(a(4))}`}function Kc(e){const t=e||"system";return"system"===t?Ic()?"dark":"light":t}function _c(e){const t=document.documentElement;if(e&&/^#[0-9a-fA-F]{6}$/.test(e)){const[r,n,a]=Rc(e);t.setAttribute("data-custom-accent","true"),t.style.setProperty("--accent-600",e),t.style.setProperty("--accent-700",Wc(r,n,Math.max(a-10,5))),t.style.setProperty("--accent-500",Wc(r,n,Math.min(a+10,95))),t.style.setProperty("--accent-400",Wc(r,n,Math.min(a+20,95))),t.style.setProperty("--accent-300",Wc(r,Math.min(n+10,100),Math.min(a+30,92))),t.style.setProperty("--accent-200",Wc(r,Math.min(n+15,100),Math.min(a+38,94))),t.style.setProperty("--accent-100",Wc(r,Math.min(n+20,100),Math.min(a+42,96))),t.style.setProperty("--accent-50",Wc(r,Math.min(n+20,100),Math.min(a+46,98)))}else t.removeAttribute("data-custom-accent"),["--accent-600","--accent-700","--accent-500","--accent-400","--accent-300","--accent-200","--accent-100","--accent-50"].forEach(e=>t.style.removeProperty(e))}function qc(e,t,r,n,a){const l=document.documentElement;if(e){const e=e=>`${parseInt(e.slice(1,3),16)} ${parseInt(e.slice(3,5),16)} ${parseInt(e.slice(5,7),16)}`;if(t&&l.style.setProperty("--custom-bg-color",t),r&&(l.style.setProperty("--window-header-rgb",e(r)),l.style.setProperty("--window-footer-rgb",e(r))),n&&l.style.setProperty("--window-content-rgb",e(n)),a){l.style.setProperty("--custom-button-color",a);const[e,t,r]=Rc(a);l.style.setProperty("--custom-button-hover",Wc(e,t,Math.max(r-10,5)))}}else["--custom-bg-color","--custom-button-color","--custom-button-hover"].forEach(e=>l.style.removeProperty(e))}var Hc=["square","soft","round"];function Uc(e){return"square"===e||"round"===e?e:"soft"}function Vc(e){const t=Uc(e);"soft"===t?document.documentElement.removeAttribute("data-corners"):document.documentElement.setAttribute("data-corners",t)}function Yc(e){const t="string"==typeof e&&e?e:null;ke(t),t?document.documentElement.setAttribute("data-icon-set",t):document.documentElement.removeAttribute("data-icon-set")}function Gc(e){"corners"in e&&Vc(e.corners),"icon_set"in e&&Yc(e.icon_set),document.documentElement.setAttribute("data-theme",Kc(e.theme)),_c(e.accent_color??null),qc(e.accent_color??null,e.custom_bg_color??null,e.custom_title_color??null,e.custom_window_color??null,e.custom_button_color??null)}function Xc(){const{prefs:e}=m(),t=Ie(Bc,Ic,Oc),r=e.theme||"system",n=e.accent_color||null,a=e.custom_bg_color||null,l=e.custom_title_color||null,i=e.custom_window_color||null,o=e.custom_button_color||null,s=Uc(e.corners),c="string"==typeof e.icon_set&&e.icon_set?e.icon_set:null,d="system"===r?t?"dark":"light":r;return Pe(()=>(document.documentElement.setAttribute("data-theme",d),()=>document.documentElement.removeAttribute("data-theme")),[d]),Pe(()=>(Vc(s),()=>document.documentElement.removeAttribute("data-corners")),[s]),Pe(()=>(Yc(c),()=>Yc(null)),[c]),Pe(()=>{_c(n)},[n]),Pe(()=>{qc(n,a,l,i,o)},[n,a,l,i,o]),{theme:r,resolved:d,corners:s,iconSet:c}}function Zc(e){const t=Math.max(0,...e.map(e=>[...e].reduce((e,t)=>e+((t.codePointAt(0)??0)>=11904?1:.62),0)));return Math.round(10*(t+3.5))/10}function Jc({size:e="sm",className:t=""}){const{language:r,languages:n,setLanguage:a}=c(),l=ae().language;return n.length<2?null:/* @__PURE__ */We("span",{className:`inline-flex items-center gap-2 text-gray-500 ${t}`.trim(),children:[
|
|
845
|
-
/* @__PURE__ */Re(Ne,{name:"globe","aria-hidden":!0,className:"h-4 w-4 shrink-0"}),
|
|
846
|
-
/* @__PURE__ */Re("span",{className:"block",style:{width:`${Zc(n.map(e=>e.name))}em`},children:/* @__PURE__ */Re(ot,{size:e,touchSize:e,"aria-label":l.title,value:r,onChange:e=>{a(e)},options:n.map(({tag:e,name:t})=>({value:e,label:t,lang:e}))})})]})}function Qc({description:e,className:t=""}){const{language:r,languages:n,setLanguage:a}=c(),l=ae().language;return n.length<2?null:/* @__PURE__ */We("div",{className:`space-y-4 ${t}`.trim(),children:[
|
|
847
|
-
/* @__PURE__ */We("div",{children:[
|
|
848
|
-
/* @__PURE__ */Re("h3",{className:"text-sm font-semibold text-gray-900",children:l.title}),
|
|
849
|
-
/* @__PURE__ */Re("p",{className:"mt-0.5 text-sm text-gray-500",children:e??l.description})]}),
|
|
850
|
-
/* @__PURE__ */Re(pt,{name:"shell-language",value:r,onChange:e=>{a(e)},hint:l.reloadNote,options:n.map(({tag:e,name:t})=>({value:e,label:/* @__PURE__ */Re("span",{lang:e,children:t})}))})]})}function ed({label:e="Not available"}){/* @__PURE__ */
|
|
851
|
-
return Re("span",{className:"text-gray-400",role:"img","aria-label":e,children:ye})}function td({value:e,precise:t,locale:r,className:n}){const a=ne(),l=xe(e);if(!l)/* @__PURE__ */return Re(ed,{});const i="string"==typeof e?e:l.toISOString();/* @__PURE__ */
|
|
852
|
-
return Re("time",{dateTime:i,title:we(i,{locale:r??a}),className:n,children:ve(l,{precise:t,locale:r??a})})}function rd(e,t=300){const[r,n]=Le(e);return Pe(()=>{const r=setTimeout(()=>n(e),t);return()=>clearTimeout(r)},[e,t]),r}function nd(e,t){Pe(()=>{const r=r=>{e.current&&!e.current.contains(r.target)&&t()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[e,t])}function ad(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 ld(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 id(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=ad(s.map(e=>e.value),c,t),a=ad([...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=ld(s,c,o,r);i.push(...e.tiles),o=e.rest,s=[],c=0}}s.length>0&&i.push(...ld(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 od({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=ae().charts,m=ne(),p=r??(e=>se(e,m)),g=u??h.nothingToRank;if(0===e.length)/* @__PURE__ */
|
|
853
|
-
return Re("p",{className:`text-sm text-gray-500 ${d??""}`,children:g});const f=Vs(e.map(e=>e.value),a),b=n??(null===f?void 0:e[f]?.key),y=t??Math.max(...e.map(e=>e.value).filter(Number.isFinite),0),x=ks(0);/* @__PURE__ */
|
|
854
|
-
return Re("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?ws[l]:ks(1):b?Ns.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__ */
|
|
855
|
-
return We("li",{className:"grid gap-1",children:[
|
|
856
|
-
/* @__PURE__ */We("div",{className:"flex items-baseline justify-between gap-3",children:[
|
|
857
|
-
/* @__PURE__ */We("span",{className:`truncate ${"mono"===c?"font-mono ":""}text-xs text-gray-600 ${r?"font-semibold":""}`,title:e.label,children:[e.label,r&&/* @__PURE__ */Re("span",{className:"sr-only",children:` ${h.emphasised}`})]}),
|
|
858
|
-
/* @__PURE__ */Re("span",{className:"shrink-0 text-xs font-semibold tabular-nums text-gray-700",style:r?{color:n}:void 0,children:null===a?"—":p(a)})]}),
|
|
859
|
-
/* @__PURE__ */Re("div",{className:"w-full rounded-sm bg-gray-200",style:{height:i},children:/* @__PURE__ */Re("div",{className:`rounded-sm ${s?ii.grow:""}`,style:{width:`${(100*o).toFixed(2)}%`,height:i,backgroundColor:n,minWidth:o>0?2:0,...s?oi(t):{}}})})]},e.key)})})}var sd=e=>Math.max(0,Math.min(1,e));function cd({value:e,segments:t,objective:r,label:n,detail:a,formatValue:l,tone:i,className:o,unavailableLabel:s}){const c=ae().charts,d=ne(),u=l??(e=>de(100*e,1,d)),h=s??c.notEnough;if(null==e||!Number.isFinite(e))/* @__PURE__ */
|
|
860
|
-
return We("div",{className:o,children:[n&&/* @__PURE__ */Re("p",{className:"text-sm font-medium text-gray-700",children:n}),
|
|
861
|
-
/* @__PURE__ */Re("p",{className:"mt-1 text-sm text-gray-500",children:h})]});const m=sd(e),p=null==r||e>=r,g=i??(p?"good":"critical"),f=ws[g],b=[t?.length?t.map(e=>`${e.label} ${u(e.value)}`).join(" · "):"",a??"",null!=r?(p?c.objectiveMet:c.objectiveMissed)(u(r)):""].filter(Boolean).join(" · ");/* @__PURE__ */
|
|
862
|
-
return We("div",{className:o,children:[
|
|
863
|
-
/* @__PURE__ */We("div",{className:"mb-2 flex items-baseline justify-between gap-3",children:[
|
|
864
|
-
/* @__PURE__ */Re("span",{className:"text-sm font-medium text-gray-700",children:n}),
|
|
865
|
-
/* @__PURE__ */Re("span",{className:"text-sm font-semibold tabular-nums",style:{color:f},children:u(e)})]}),
|
|
866
|
-
/* @__PURE__ */We("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:[
|
|
867
|
-
/* @__PURE__ */Re("div",t?.length?{className:"flex h-full overflow-hidden rounded-full",children:t.map((e,r)=>/* @__PURE__ */Re("div",{className:"h-full shrink-0"+(r===t.length-1?" rounded-r-full":""),style:{width:`${(100*sd(e.value)).toFixed(2)}%`,backgroundColor:ws[e.tone??(0===r?g:"neutral")]}},`${e.label}-${r}`))}:{className:"h-full rounded-full",style:{width:`${(100*m).toFixed(2)}%`,backgroundColor:f}}),null!=r&&/* @__PURE__ */Re("span",{className:"absolute top-[-4px] w-0.5 rounded-full",style:{left:`${(100*sd(r)).toFixed(2)}%`,height:20,backgroundColor:Ns.axis},"aria-hidden":"true"})]}),b&&/* @__PURE__ */Re("p",{className:"mt-2 text-xs text-gray-500",children:b})]})}var dd={up:{glyph:"▲",word:"trendUp"},down:{glyph:"▼",word:"trendDown"},flat:{glyph:"■",word:"trendFlat"}};function ud({label:e,value:t,unit:r,delta:n,deltaTone:a,trend:l,trendTone:i,footnote:o,className:s}){const c=ae().charts,d=ne(),u=null==n?null:n>0?"up":n<0?"down":"flat",h=a?ws[a]:void 0,m=i?ws[i]:$s(0);/* @__PURE__ */
|
|
868
|
-
return We("div",{className:`flex flex-col gap-0.5 rounded-lg border border-gray-200 bg-white p-4 ${s??""}`,children:[
|
|
869
|
-
/* @__PURE__ */Re("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
870
|
-
/* @__PURE__ */We("span",{className:"flex items-baseline gap-2",children:[
|
|
871
|
-
/* @__PURE__ */Re("span",{className:"text-2xl font-semibold leading-tight text-gray-900",children:t}),r&&/* @__PURE__ */Re("span",{className:"text-sm font-medium text-gray-500",children:r})]}),u&&/* @__PURE__ */We("span",{className:"text-xs font-medium",style:h?{color:h}:void 0,children:[
|
|
872
|
-
/* @__PURE__ */Re("span",{"aria-hidden":"true",children:dd[u].glyph})," ",se(Math.abs(n),d),
|
|
873
|
-
/* @__PURE__ */We("span",{className:"sr-only",children:[" ",c[dd[u].word]]})]}),l&&l.length>1&&/* @__PURE__ */Re(ys,{data:l,height:26,stroke:m,strokeWidth:2,className:"mt-2 w-full"}),o&&/* @__PURE__ */Re("span",{className:"mt-1 text-xs text-gray-500",children:o})]})}function hd({shape:e,colour:t}){const r="shrink-0";switch(e){case"circle":/* @__PURE__ */
|
|
874
|
-
return Re("span",{className:`${r} h-2.5 w-2.5 rounded-full`,style:{backgroundColor:t}});case"circle-outline":/* @__PURE__ */
|
|
875
|
-
return Re("span",{className:`${r} h-2.5 w-2.5 rounded-full border-2`,style:{borderColor:t}});case"rounded-square-outline":/* @__PURE__ */
|
|
876
|
-
return Re("span",{className:`${r} h-2.5 w-2.5 rounded-sm border-2`,style:{borderColor:t}});case"square":/* @__PURE__ */
|
|
877
|
-
return Re("span",{className:`${r} h-2.5 w-2.5`,style:{backgroundColor:t}});case"bar":/* @__PURE__ */
|
|
878
|
-
return Re("span",{className:`${r} h-1 w-4 rounded-full`,style:{backgroundColor:t}});case"bar-vertical":/* @__PURE__ */
|
|
879
|
-
return Re("span",{className:`${r} h-3.5 w-1 rounded-full`,style:{backgroundColor:t}});default:/* @__PURE__ */
|
|
880
|
-
return Re("span",{className:`${r} h-2.5 w-2.5 rounded-sm`,style:{backgroundColor:t}})}}function md({entries:e,interactive:t,fallbackSwatch:r,onClick:n}){const{highlighted:a,setHighlighted:l}=Hs();/* @__PURE__ */
|
|
881
|
-
return Re("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__ */We(Ke,{children:[
|
|
882
|
-
/* @__PURE__ */Re(hd,{shape:e.swatch??r,colour:$s(i,e.color,e.tone)}),e.label]});/* @__PURE__ */
|
|
883
|
-
return Re("li",{className:"list-none",children:t||n?/* @__PURE__ */Re("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__ */Re("span",{className:"flex items-center gap-2 text-xs text-gray-600",children:s})},e.key)})})}function pd({title:e,subtitle:t,legend:r,table:n,tableLabel:a,busy:l=!1,loading:i=!1,skeletonVariant:o="area",skeletonHeight:s,interactiveLegend:c=!0,legendSwatch:d="rounded-square",onLegendClick:u,actions:h,children:m,className:p}){const g=ae().charts;/* @__PURE__ */
|
|
884
|
-
return Re(qs,{children:/* @__PURE__ */We("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:[
|
|
885
|
-
/* @__PURE__ */We("header",{className:"flex items-start justify-between gap-4",children:[
|
|
886
|
-
/* @__PURE__ */We("div",{className:"min-w-0",children:[
|
|
887
|
-
/* @__PURE__ */Re("h3",{className:"text-base font-semibold text-gray-900",children:e}),t&&/* @__PURE__ */Re("p",{className:"mt-0.5 text-sm text-gray-500",children:t})]}),h&&/* @__PURE__ */Re("div",{className:"shrink-0",children:h})]}),i?/* @__PURE__ */Re(Ks,{variant:o,height:s}):/* @__PURE__ */Re("div",{className:l?"opacity-60 transition-opacity":"transition-opacity",children:m}),!i&&r&&r.length>1&&/* @__PURE__ */Re(md,{entries:r,interactive:c,fallbackSwatch:d,onClick:u}),!i&&n&&/* @__PURE__ */We("details",{className:"border-t border-gray-100 pt-3",children:[
|
|
888
|
-
/* @__PURE__ */Re("summary",{className:"cursor-pointer text-sm font-medium text-gray-600 rosh-focus-outline",children:a??g.showTable}),
|
|
889
|
-
/* @__PURE__ */Re("div",{className:"mt-3 overflow-x-auto",style:{color:Ns.label},children:n})]})]})})}function gd({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__ */
|
|
890
|
-
return We("g",{children:[a&&/* @__PURE__ */Re("circle",{className:"rosh-viz-ping",cx:e,cy:t,r:o,fill:r,fillOpacity:.45}),"border"===n&&/* @__PURE__ */Re("circle",{cx:e,cy:t,r:o+i,fill:Ns.surface}),
|
|
891
|
-
/* @__PURE__ */Re("circle",{cx:e,cy:t,r:o,fill:"colored-border"===n?Ns.surface:r,stroke:"colored-border"===n?r:void 0,strokeWidth:"colored-border"===n?i:void 0,children:l&&/* @__PURE__ */Re("title",{children:l})})]})}function fd({labels:e,data:t,range:r,onRangeChange:n,height:a=46,width:l=720,color:i,className:o}){const s=ae().charts,c=Se(null),d=e.length-1,[u,h]=r,m=i??$s(0),p=e=>0===d?0:e/d*l,g=e=>"number"==typeof e&&Number.isFinite(e),f=t.filter(g),b=Math.max(...f,1),y=e=>a-e/b*(a-6),x=[];e.forEach((e,r)=>{if(!g(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=Se(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__ */
|
|
892
|
-
return Re("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__ */
|
|
893
|
-
return Re("div",{className:o,children:/* @__PURE__ */We("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:[
|
|
894
|
-
/* @__PURE__ */Re("path",{d:v,fill:Ns.grid}),
|
|
895
|
-
/* @__PURE__ */Re("rect",{x:0,y:0,width:p(u),height:a,fill:Ns.surface,fillOpacity:.72}),
|
|
896
|
-
/* @__PURE__ */Re("rect",{x:p(h),y:0,width:Math.max(0,l-p(h)),height:a,fill:Ns.surface,fillOpacity:.72}),
|
|
897
|
-
/* @__PURE__ */Re("rect",{x:p(u),y:0,width:Math.max(1,p(h)-p(u)),height:a,fill:"none",stroke:m,strokeWidth:1}),L("from"),L("to")]})})}var bd=12,yd=16,xd=26,vd=52,wd=e=>"number"==typeof e&&Number.isFinite(e);function Nd({series:e,labels:t,height:r=200,stacked:n=!1,stackMode:a="value",levels:l,curve:i="linear",tension:o=0,max:s,yTickCount:c=4,formatValue:d,formatTooltipValue:u,tooltipLabels:h,yAxisLabel:m,referenceLines:p,labelEndpoints:g=!1,dots:f,dotVariant:b="border",pulse:y=!1,brush:x=!1,range:v,onRangeChange:w,loading:N=!1,animate:k=!0,reveal:$="left-to-right",fillVariant:M="gradient",gridStyle:C="solid",width:L,className:S,emptyLabel:D}){const P=ae().charts,A=ne(),j=d??(e=>se(e,A)),z=u??j,F=D??P.noData,T=Se(null),E=Os(T),B=L??E,[I,O]=Le(null),[R,W]=Le(null),{highlighted:K}=Hs(),_=Me();if(Pe(()=>{if(null!==I)return H(e=>"Escape"===e.key&&(O(null),!0))},[I]),N)/* @__PURE__ */
|
|
898
|
-
return Re("div",{className:S,ref:T,children:/* @__PURE__ */Re(Ks,{height:r,width:L??E})});const q=t,U=v??R??[0,Math.max(0,q.length-1)],[V,Y]=U,G=e=>x?e.slice(V,Y+1):e,X=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(wd)).map(e=>({...e,data:G(e.data)}));if(t=G(q),0===X.length||0===t.length)/* @__PURE__ */
|
|
899
|
-
return Re("div",{className:S,ref:T,children:/* @__PURE__ */Re("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:F})});const Z=t.map((e,t)=>X.reduce((e,r)=>e+(wd(r.data[t])?r.data[t]:0),0)),J=(e,t)=>Z[t]>0?e/Z[t]:null,Q=[];if(n){let e=t.map(()=>0);for(const t of X)e=e.map((e,r)=>e+(wd(t.data[r])?t.data[r]:0)),Q.push("percent"===a?e.map((e,t)=>J(e,t)):[...e])}const ee=!!l&&l.length>0,te=e=>"right"===e.axis,re=!n&&!ee&&void 0===s&&X.some(te)&&X.some(e=>!te(e)),le=re?X.filter(e=>!te(e)):X,ie=re?X.filter(te).flatMap(e=>e.data.filter(wd)):[],oe=n?(Q.at(-1)??[]).filter(wd):le.flatMap(e=>e.data.filter(wd)),ce=re?zs([Math.min(0,...oe),Math.max(0,...oe)],[Math.min(0,...ie),Math.max(0,...ie)],{intervals:c+1,integerLeft:oe.every(Number.isInteger),integerRight:ie.every(Number.isInteger)}):null,ue=ce?ce.left:n&&"percent"===a||ee||void 0!==s?null:js(n?0:Math.min(0,...oe),Math.max(0,...oe),{intervals:c+1,integer:oe.every(Number.isInteger)}),he=ue?ue.lo:0,me=n&&"percent"===a?1:ue?ue.hi:s??As(Math.max(...oe,0)),pe=n&&"percent"===a?e=>de(Math.round(100*e),0,A):j,ge=ee?l:ue?ue.ticks:Ss([he,me],{from:0,to:1}).ticks(c+1),fe=Is(ge.map(pe),vd),be=ce?Is(ce.right.ticks.map(j),yd):yd,ye={left:fe,right:Math.max(fe+1,B-be),top:bd,bottom:r-xd},xe=Ds(t.length,{from:ye.left,to:ye.right}),ve=ee?Ps(l,{from:ye.bottom,to:ye.top}):null,we=Ss([he,me],{from:ye.bottom,to:ye.top}),Ne=we(Math.max(he,0)),ke=e=>ve?ve(e):we(e),$e=ce?Ss([ce.right.lo,ce.right.hi],{from:ye.bottom,to:ye.top}):null,Ce=e=>$e&&te(e)?$e:ke,De=ve?ve.levels.map(e=>({value:e,y:ve(e)})):ge.map(e=>({value:e,y:we(e)})),Ae=e=>r=>{r.preventDefault(),O(r=>{const n=(r??0)+e;return Math.min(t.length-1,Math.max(0,n))})},je=Math.max(1,Math.ceil(t.length/Math.max(1,Math.floor(B/96))));/* @__PURE__ */
|
|
900
|
-
return We("div",{className:`relative ${S??""}`,ref:T,children:[
|
|
901
|
-
/* @__PURE__ */We("svg",{width:"100%",height:r,viewBox:`0 0 ${B} ${r}`,role:"img","aria-label":P.overIntervals(X.map(e=>e.label),t.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>O(null),onBlur:()=>O(null),onKeyDown:e=>{"ArrowRight"===e.key&&Ae(1)(e),"ArrowLeft"===e.key&&Ae(-1)(e)},children:[
|
|
902
|
-
/* @__PURE__ */Re("defs",{children:/* @__PURE__ */Re("clipPath",{id:_,children:/* @__PURE__ */Re("rect",{x:ye.left,y:ye.top,width:ye.right-ye.left,height:ye.bottom-ye.top})})}),
|
|
903
|
-
/* @__PURE__ */Re(ai,{id:_,fills:X.map((e,t)=>({color:$s(e.slot,e.color,e.tone),variant:e.fillVariant??M})),fadeFrom:n?.42:.3,reveal:!!k&&$}),De.map(e=>/* @__PURE__ */Re("line",{x1:ye.left,y1:e.y,x2:ye.right,y2:e.y,stroke:Ns.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===C?"3 3":void 0},`grid-${e.value}`)),
|
|
904
|
-
/* @__PURE__ */Re("line",{x1:ye.left,y1:Ne,x2:ye.right,y2:Ne,stroke:Ns.axis,strokeWidth:1,shapeRendering:"crispEdges"}),De.map(e=>/* @__PURE__ */Re("text",{x:ye.left-8,y:e.y+4,textAnchor:"end","data-axis-tick":"true",fontSize:11,fill:Ns.label,style:{fontVariantNumeric:"tabular-nums"},children:pe(e.value)},`ytick-${e.value}`)),ce&&De.map((e,t)=>/* @__PURE__ */Re("text",{x:ye.right+8,y:e.y+4,textAnchor:"start","data-axis-tick":"true",fontSize:11,fill:Ns.label,style:{fontVariantNumeric:"tabular-nums"},children:j(ce.right.ticks[t])},`ytick-r-${e.value}`)),m&&/* @__PURE__ */Re("text",{x:12,y:(ye.top+ye.bottom)/2,transform:`rotate(-90 12 ${(ye.top+ye.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:Ns.label,children:m}),
|
|
905
|
-
/* @__PURE__ */Re("g",{clipPath:`url(#${_})`,mask:k&&$?`url(#${Jl(_)})`:void 0,children:X.map((e,r)=>{const a=$s(e.slot,e.color,e.tone),l=e.mode??(n?"area":"line"),s=Us(e.key,K);if("step"===l){const r=t.map((t,r)=>({start:xe(r),end:xe.end(r),value:e.data[r]})).filter(e=>wd(e.value)).map(t=>({start:t.start,end:t.end,y:Ce(e)(t.value)}));/* @__PURE__ */
|
|
906
|
-
return Re("path",{d:Js(r),fill:"none",stroke:a,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:s??void 0,className:"rosh-viz-mark"},e.key)}const c=t.map((t,a)=>{const l=n?Q[r]?.[a]:e.data[a];return wd(l)?[xe.center(a),Ce(e)(l)]:null}).filter(e=>null!==e);if(0===c.length)return null;if("column"===l){const l=Math.max(1,.62*xe.bandwidth),i="solid"===e.fillVariant,o=Ce(e);/* @__PURE__ */
|
|
907
|
-
return Re("g",{opacity:s??void 0,className:"rosh-viz-mark",children:t.map((t,s)=>{const c=n?Q[r]?.[s]:e.data[s];if(!wd(c))return null;const d=o(c);/* @__PURE__ */
|
|
908
|
-
return Re("rect",{x:xe.center(s)-l/2,y:Math.min(d,Ne),width:l,height:Math.abs(Ne-d),rx:2,fill:a,fillOpacity:i?1:.35,className:k?ii.rise:void 0,style:k?oi(s,26):void 0},s)})},e.key)}const d=rc(c,i,o),u=n&&r>0?t.map((e,t)=>[xe.center(t),ke(Q[r-1]?.[t]??0)-2]):null,h=u?ac(d,u):nc(d,c,Ne);/* @__PURE__ */
|
|
909
|
-
return We("g",{opacity:s??void 0,className:"rosh-viz-mark",children:[("area"===l||n)&&
|
|
910
|
-
/* @__PURE__ */Re("path",{d:h,fill:ei(_,r,e.fillVariant??M,a),stroke:"none"}),
|
|
911
|
-
/* @__PURE__ */Re("path",{d:d,fill:"none",stroke:a,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:ti(e.stroke??(e.forecast?"animated-dashed":"solid")),className:k&&("animated-dashed"===e.stroke||e.forecast&&!e.stroke)?ii.march:void 0})]},e.key)})}),p?.map((e,t)=>{const r=e.color??ws[e.tone??"critical"],n=ke(e.value);/* @__PURE__ */
|
|
912
|
-
return We("g",{children:[
|
|
913
|
-
/* @__PURE__ */Re("line",{x1:ye.left,y1:n,x2:ye.right,y2:n,stroke:r,strokeWidth:1,strokeDasharray:"5 4"}),e.label&&/* @__PURE__ */Re("text",{x:ye.right-4,y:n-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:r,children:e.label})]},`rule-${t}`)}),"none"!==(f??(g?"last":"none"))&&X.map((e,r)=>{if("column"===e.mode)return null;const a=f??(g?"last":"none"),l=$s(e.slot,e.color,e.tone),i=[...e.data].map(wd).lastIndexOf(!0),o="all"===a?t.map((e,t)=>t).filter(t=>wd(n?Q[r]?.[t]:e.data[t])):i>=0?[i]:[];/* @__PURE__ */
|
|
914
|
-
return We("g",{children:[o.map(a=>{const o=n?Q[r]?.[a]:e.data[a];return wd(o)?/* @__PURE__ */Re(gd,{cx:xe.center(a),cy:Ce(e)(o),color:l,variant:b,pulse:y&&a===i,title:`${t[a]}: ${e.label} ${j(o)}`},a):null}),g&&i>=0&&wd(n?Q[r]?.[i]:e.data[i])&&/* @__PURE__ */Re("text",{x:xe.center(i)-10,y:Ce(e)(n?Q[r]?.[i]:e.data[i])-9,textAnchor:"end",fontSize:12,fontWeight:600,fill:Ns.label,style:{fontVariantNumeric:"tabular-nums"},children:j(n?Q[r]?.[i]:e.data[i])})]},`dots-${e.key}`)}),t.map((e,t)=>t%je===0?/* @__PURE__ */Re("text",{x:xe.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:Ns.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`xtick-${t}`):null),null!==I&&/* @__PURE__ */Re("line",{x1:xe.center(I),y1:ye.top,x2:xe.center(I),y2:ye.bottom,stroke:Ns.axis,strokeWidth:1}),t.map((e,t)=>/* @__PURE__ */Re("rect",{x:xe(t),y:ye.top,width:Math.max(1,xe.bandwidth),height:ye.bottom-ye.top,fill:"transparent",onMouseEnter:()=>O(t)},`hit-${t}`))]}),x&&q.length>2&&/* @__PURE__ */Re(fd,{className:"mt-1",labels:q,width:B,data:e[0]?.data??[],range:U,onRangeChange:e=>{w?w(e):W(e)}}),null!==I&&
|
|
915
|
-
/* @__PURE__ */Re("div",{className:"pointer-events-none absolute top-2 z-10",style:Rs(xe.center(I),xe.bandwidth,B),children:/* @__PURE__ */Re(Ys,{title:h?.[I]??t[I],rows:X.map((e,t)=>({key:e.key,label:e.label,color:$s(e.slot,e.color,e.tone),value:wd(e.data[I])?n&&"percent"===a?`${de(100*(J(e.data[I],I)??0),1,A)} · ${z(e.data[I])}`:z(e.data[I]):void 0})),footnote:n&&"percent"===a?P.inBucket(z(Z[I])):void 0})})]})}var kd=3;function $d({series:e,height:t=260,width:r,xLabel:n,yLabel:a,formatX:l,formatY:i,xDomain:o,yDomain:s,xScale:c="linear",yScale:d="linear",radiusRange:u=[4,22],className:h,emptyLabel:m}){const p=ae().charts,g=ne(),f=l??(e=>se(e,g)),b=i??(e=>se(e,g)),y=m??p.noObservations,x=Se(null),v=Os(x),w=r??v,N=Me(),[k,$]=Le(null);Pe(()=>{if(null!==k)return H(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,S=C.reduce((e,t)=>e+t.points.length,0)-L.reduce((e,t)=>e+t.points.length,0);if(0===L.length)/* @__PURE__ */
|
|
916
|
-
return Re("div",{className:h,ref:x,children:/* @__PURE__ */Re("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:t},children:y})});const D=L.flatMap(e=>e.points),P=D.some(e=>null!=e.size),A=14,j=20,z=34,F=52,T=(e,t,r,n)=>{const a=e.filter(e=>e>0),l="log"===r?a.length>0?Math.min(...a):0:Math.min(0,...e),i=t??[l,As(Math.max(...e))];return"log"===r?Fs(i,n):Ss(i,n)},E=T(D.map(e=>e.y),s,d,{from:t-z,to:A}),B=Is(E.ticks(5).map(b),F),I=Math.max(B+1,w-j),O=T(D.map(e=>e.x),o,c,{from:B,to:I}),R=Es([0,Math.max(...D.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,_=L.flatMap((e,t)=>e.points.map((e,r)=>({s:t,i:r})));/* @__PURE__ */
|
|
917
|
-
return We("div",{className:`relative ${h??""}`,ref:x,children:[
|
|
918
|
-
/* @__PURE__ */We("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)+(S>0?`. ${p.outsideRange(S)}`:""),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?_.findIndex(e=>e.s===k.s&&e.i===k.i):0;$(_[Math.min(_.length-1,Math.max(0,r+t))])},children:[
|
|
919
|
-
/* @__PURE__ */Re("defs",{children:/* @__PURE__ */Re("clipPath",{id:N,children:/* @__PURE__ */Re("rect",{x:B-u[1],y:A-u[1],width:I-B+2*u[1],height:t-z-A+2*u[1]})})}),E.ticks(5).map(e=>/* @__PURE__ */We("g",{children:[
|
|
920
|
-
/* @__PURE__ */Re("line",{x1:B,y1:E(e),x2:I,y2:E(e),stroke:Ns.grid,strokeWidth:1,shapeRendering:"crispEdges"}),
|
|
921
|
-
/* @__PURE__ */Re("text",{x:B-8,y:E(e)+4,textAnchor:"end",fontSize:11,fill:Ns.label,style:{fontVariantNumeric:"tabular-nums"},children:b(e)})]},`y${e}`)),O.ticks(5).map(e=>/* @__PURE__ */Re("text",{x:O(e),y:t-12,textAnchor:"middle",fontSize:11,fill:Ns.label,style:{fontVariantNumeric:"tabular-nums"},children:f(e)},`x${e}`)),n&&/* @__PURE__ */Re("text",{x:(B+I)/2,y:t-.5,textAnchor:"middle",fontSize:11,fill:Ns.label,children:n}),a&&/* @__PURE__ */Re("text",{x:12,y:t/2,transform:`rotate(-90 12 ${t/2})`,textAnchor:"middle",fontSize:11,fill:Ns.label,children:a}),
|
|
922
|
-
/* @__PURE__ */Re("g",{clipPath:`url(#${N})`,children:L.map((e,t)=>{const r=Ls(e.slot,3,e.color,e.tone);return e.points.map((n,a)=>/* @__PURE__ */Re("circle",{cx:O(n.x),cy:E(n.y),r:P?R(n.size??0):u[0]+1,fill:r,fillOpacity:k&&k.s!==t?.25:.62,stroke:Ns.surface,strokeWidth:2,onMouseEnter:()=>$({s:t,i:a})},`${e.key}-${a}`))})})]}),k&&W&&K&&/* @__PURE__ */Re("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Re(Ys,{title:K.label??W.label,rows:[{key:"x",label:n??p.xAxis,color:Ls(W.slot,3,W.color,W.tone),value:f(K.x)},{key:"y",label:a??p.yAxis,color:Ls(W.slot,3,W.color,W.tone),value:b(K.y)},...null!=K.size?[{key:"size",label:p.size,color:Ns.muted,value:se(K.size,g)}]:[]],footnote:K.label?W.label:void 0})})]})}function Md({rows:e,labels:t,variant:r="area",curve:n="linear",height:a=220,width:l,max:i,min:o,formatValue:s,yAxisLabel:c,color:d,tone:u,label:h,className:m,emptyLabel:p,radius:g=3}){const f=ae().charts,b=ne(),y=s??(e=>se(e,b)),x=h??f.range,v=e.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),w=$s(0,d,u);/* @__PURE__ */
|
|
923
|
-
return Re(Ws,{labels:t,values:v,height:a,width:l,max:i,min:o,formatValue:y,yAxisLabel:c,className:m,emptyLabel:p,bandPadding:"bar"===r?.34:0,ariaLabel:f.rangeLabel(x,t.length),tooltip:r=>/* @__PURE__ */Re(Ys,{title:t[r],rows:[{key:"high",label:f.high,color:w,value:null==e[r]?void 0:y(e[r].high)},{key:"low",label:f.low,color:w,value:null==e[r]?void 0:y(e[r].low)}]}),children:({x:t,y:a,active:l})=>"bar"===r?/* @__PURE__ */Re("g",{children:e.map((e,r)=>/* @__PURE__ */Re("rect",{x:t(r),y:a(e.high),width:Math.max(1,t.bandwidth),height:Math.max(1,a(e.low)-a(e.high)),rx:g,fill:w,fillOpacity:null===l||l===r?.85:.4},r))}):/* @__PURE__ */We("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__ */
|
|
924
|
-
return We(Ke,{children:[
|
|
925
|
-
/* @__PURE__ */Re("path",{d:ac(rc(r,n),l),fill:w,fillOpacity:.2,stroke:"none"}),
|
|
926
|
-
/* @__PURE__ */Re("path",{d:rc(r,n),fill:"none",stroke:w,strokeWidth:2,strokeLinejoin:"round"}),
|
|
927
|
-
/* @__PURE__ */Re("path",{d:rc(l,n),fill:"none",stroke:w,strokeWidth:2,strokeLinejoin:"round",strokeOpacity:.7})]})})(),null!==l&&/* @__PURE__ */Re("line",{x1:t.center(l),y1:a(e[l].high),x2:t.center(l),y2:a(e[l].low),stroke:Ns.axis,strokeWidth:1})]})})}function Cd({steps:e,height:t=240,width:r,formatValue:n,yAxisLabel:a,className:l,emptyLabel:i,radius:o=3,connectors:s=!0}){const c=ae().charts,d=ne(),u=n??(e=>se(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__ */
|
|
928
|
-
return Re(Ws,{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?ws.neutral:t.value>=0?ws.good:ws.critical;/* @__PURE__ */
|
|
929
|
-
return Re(Ys,{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:ws.neutral,value:u(t.to)}]]})},children:({x:e,y:t,active:r})=>/* @__PURE__ */We("g",{children:[s&&m.slice(0,-1).map((r,n)=>
|
|
930
|
-
/* @__PURE__ */Re("line",{x1:e.end(n),y1:t(r.to),x2:e(n+1),y2:t(r.to),stroke:Ns.grid,strokeWidth:1,shapeRendering:"crispEdges"},`c${n}`)),m.map((n,a)=>{const l=n.total?ws.neutral:n.value>=0?ws.good:ws.critical,i=Math.min(t(n.from),t(n.to)),s=Math.max(1,Math.abs(t(n.to)-t(n.from)));/* @__PURE__ */
|
|
931
|
-
return Re("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 Ld({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=ae().charts,p=ne(),g=o??(e=>Number.isInteger(e)?se(e,p):ce(e,1,p)),f=s??(e=>se(e,p)),b=c??m.countAxis,y=d??m.distribution,x=r??Bs(e??[],t),v=$s(0,l,i),w=x.map(e=>g(e.from)),N=x.map(e=>e.count);/* @__PURE__ */
|
|
932
|
-
return Re(Ws,{labels:w,values:N,height:n,width:a,bandPadding:0,xTickAnchor:"start",formatValue:f,yAxisLabel:b,className:u,emptyLabel:h,ariaLabel:m.histogram(y,x.length,(e??[]).length),tooltip:e=>/* @__PURE__ */Re(Ys,{title:`${g(x[e].from)} – ${g(x[e].to)}`,rows:[{key:"count",label:m.observations,color:v,value:f(x[e].count)}]}),children:({x:e,y:t,bottom:r,active:n})=>/* @__PURE__ */Re("g",{children:x.map((a,l)=>/* @__PURE__ */Re("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 Sd({boxes:e,height:t=240,width:r,color:n,tone:a,formatValue:l,yAxisLabel:i,label:o,className:s,emptyLabel:c}){const d=ae().charts,u=ne(),h=l??(e=>se(e,u)),m=o??d.distribution,p=$s(0,n,a),g=e.flatMap(e=>[e.min,e.max,...e.outliers??[]]).filter(Number.isFinite);/* @__PURE__ */
|
|
933
|
-
return Re(Ws,{labels:e.map(e=>e.label),values:g,height:t,width:r,bandPadding:.5,formatValue:h,yAxisLabel:i,className:s,emptyLabel:c,ariaLabel:d.fiveNumber(m,e.length),tooltip:t=>{const r=e[t];/* @__PURE__ */
|
|
934
|
-
return Re(Ys,{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__ */Re("g",{children:e.map((e,a)=>{const l=t.center(a),i=Math.max(6,t.bandwidth);/* @__PURE__ */
|
|
935
|
-
return We("g",{opacity:null!==n&&n!==a?.45:1,children:[
|
|
936
|
-
/* @__PURE__ */Re("line",{x1:l,y1:r(e.max),x2:l,y2:r(e.q3),stroke:p,strokeWidth:1.5}),
|
|
937
|
-
/* @__PURE__ */Re("line",{x1:l,y1:r(e.q1),x2:l,y2:r(e.min),stroke:p,strokeWidth:1.5}),
|
|
938
|
-
/* @__PURE__ */Re("line",{x1:l-i/4,y1:r(e.max),x2:l+i/4,y2:r(e.max),stroke:p,strokeWidth:1.5}),
|
|
939
|
-
/* @__PURE__ */Re("line",{x1:l-i/4,y1:r(e.min),x2:l+i/4,y2:r(e.min),stroke:p,strokeWidth:1.5}),
|
|
940
|
-
/* @__PURE__ */Re("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}),
|
|
941
|
-
/* @__PURE__ */Re("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__ */Re("circle",{cx:l,cy:r(e),r:3,fill:p,stroke:Ns.surface,strokeWidth:1.5},t))]},a)})})})}function Dd({candles:e,variant:t="candle",height:r=260,width:n,formatValue:a,yAxisLabel:l,label:i,className:o,emptyLabel:s}){const c=ae().charts,d=ne(),u=a??(e=>Number.isInteger(e)?se(e,d):ce(e,2,d)),h=i??c.price,m=e.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),p=Math.min(...m),g=Math.max(...m),f=.08*(g-p)||1;/* @__PURE__ */
|
|
942
|
-
return Re(Ws,{labels:e.map(e=>e.label),values:m,height:r,width:n,min:p-f,max:g+f,bandPadding:.42,formatValue:u,yAxisLabel:l,className:o,emptyLabel:s,ariaLabel:c.ohlc(h,e.length),tooltip:t=>{const r=e[t],n=r.close>=r.open,a=n?ws.good:ws.critical;/* @__PURE__ */
|
|
943
|
-
return Re(Ys,{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__ */Re("g",{children:e.map((e,l)=>{const i=e.close>=e.open,o=i?ws.good:ws.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__ */
|
|
944
|
-
return We("g",{opacity:d?.45:1,children:[
|
|
945
|
-
/* @__PURE__ */Re("line",{x1:s,y1:n(e.high),x2:s,y2:n(e.low),stroke:o,strokeWidth:1.5}),"candle"===t?/* @__PURE__ */Re("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__ */We(Ke,{children:[
|
|
946
|
-
/* @__PURE__ */Re("line",{x1:s-c/2,y1:n(e.open),x2:s,y2:n(e.open),stroke:o,strokeWidth:2}),
|
|
947
|
-
/* @__PURE__ */Re("line",{x1:s,y1:n(e.close),x2:s+c/2,y2:n(e.close),stroke:o,strokeWidth:2})]})]},l)})})})}function Pd({rows:e,columns:t,cells:r,height:n,width:a,color:l,max:i,formatValue:o,label:s,className:c,emptyLabel:d,cellGap:u=2,cellRadius:h=2}){const m=ae().charts,p=ne(),g=o??(e=>se(e,p)),f=s??m.intensity,b=d??m.noActivity,y=Se(null),x=Os(y),v=a??x,w=Me(),[N,k]=Le(null);if(Pe(()=>{if(null!==N)return H(e=>"Escape"===e.key&&(k(null),!0))},[N]),0===e.length||0===t.length)/* @__PURE__ */
|
|
948
|
-
return Re("div",{className:c,ref:y,children:/* @__PURE__ */Re("p",{className:"py-8 text-center text-sm text-gray-500",children:b})});const $=l??$s(0),M=i??Math.max(1,...r.flat().filter(Number.isFinite)),C=96,L=26*e.length,S=n??L+26+26,D=Math.max(2,(Math.max(97,v)-C)/t.length),P=e=>{const t=M>0?Math.max(0,Math.min(1,e/M)):0;return`color-mix(in oklab, ${$} ${(8+92*t).toFixed(1)}%, ${Ns.surface})`};/* @__PURE__ */
|
|
949
|
-
return We("div",{className:`relative ${c??""}`,ref:y,children:[
|
|
950
|
-
/* @__PURE__ */We("svg",{width:"100%",height:S,viewBox:`0 0 ${v} ${S}`,role:"img","aria-label":m.heatmap(f,e.length,t.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>k(null),onBlur:()=>k(null),onKeyDown:r=>{const n="ArrowDown"===r.key?1:"ArrowUp"===r.key?-1:0,a="ArrowRight"===r.key?1:"ArrowLeft"===r.key?-1:0;0===n&&0===a||(r.preventDefault(),k(r=>({r:Math.min(e.length-1,Math.max(0,(r?.r??0)+n)),c:Math.min(t.length-1,Math.max(0,(r?.c??0)+a))})))},children:[
|
|
951
|
-
/* @__PURE__ */Re("defs",{children:/* @__PURE__ */We("linearGradient",{id:w,x1:"0",x2:"1",children:[
|
|
952
|
-
/* @__PURE__ */Re("stop",{offset:"0",stopColor:P(0)}),
|
|
953
|
-
/* @__PURE__ */Re("stop",{offset:"1",stopColor:P(M)})]})}),e.map((e,t)=>/* @__PURE__ */Re("text",{x:86,y:26*t+13+4,textAnchor:"end",fontSize:11,fill:Ns.label,children:e},`r${t}`)),e.map((e,n)=>t.map((t,a)=>{const l=r[n]?.[a]??0,i=N&&(N.r!==n||N.c!==a);/* @__PURE__ */
|
|
954
|
-
return Re("rect",{x:C+a*D+u/2,y:26*n+u/2,width:Math.max(1,D-u),height:26-u,rx:h,fill:P(l),opacity:i?.55:1,onMouseEnter:()=>k({r:n,c:a}),children:/* @__PURE__ */Re("title",{children:`${e} · ${t}: ${g(l)}`})},`${n}-${a}`)})),t.map((e,r)=>r%Math.max(1,Math.ceil(t.length/Math.max(1,Math.floor((v-C)/56))))===0?/* @__PURE__ */Re("text",{x:C+r*D+D/2,y:L+15,textAnchor:"middle",fontSize:11,fill:Ns.label,children:e},`c${r}`):null),
|
|
955
|
-
/* @__PURE__ */Re("rect",{x:C,y:L+26,width:Math.min(180,Math.max(40,v-C)),height:8,rx:4,fill:`url(#${w})`}),
|
|
956
|
-
/* @__PURE__ */Re("text",{x:C,y:L+48,fontSize:11,fill:Ns.label,children:"0"}),
|
|
957
|
-
/* @__PURE__ */Re("text",{x:C+Math.min(180,Math.max(40,v-C)),y:L+48,textAnchor:"end",fontSize:11,fill:Ns.label,style:{fontVariantNumeric:"tabular-nums"},children:g(M)})]}),N&&/* @__PURE__ */Re("div",{className:"pointer-events-none absolute top-1 right-1 z-10",children:/* @__PURE__ */Re(Ys,{title:`${e[N.r]} · ${t[N.c]}`,rows:[{key:"v",label:f,color:$,value:null==r[N.r]?.[N.c]?void 0:g(r[N.r][N.c])}]})})]})}function Ad({caption:e,head:t,rows:r}){/* @__PURE__ */
|
|
958
|
-
return We("table",{className:"sr-only",children:[
|
|
959
|
-
/* @__PURE__ */Re("caption",{children:e}),
|
|
960
|
-
/* @__PURE__ */Re("thead",{children:/* @__PURE__ */Re("tr",{children:t.map(e=>/* @__PURE__ */Re("th",{scope:"col",children:e},e))})}),
|
|
961
|
-
/* @__PURE__ */Re("tbody",{children:r.map((e,t)=>/* @__PURE__ */Re("tr",{children:e.map((e,t)=>/* @__PURE__ */Re("td",{children:e},t))},t))})]})}var jd=3,zd=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function Fd({axes:e,series:t,size:r=300,mode:n="area",grid:a="polygon",rings:l=4,formatValue:i,animate:o=!0,className:s,emptyLabel:c}){const d=ae().charts,u=ne(),h=i??(e=>se(e,u)),m=c??d.nothingToCompare,p=Me(),[g,f]=Le(null),{highlighted:b}=Hs(),y=t;if(e.length<3||0===y.length)/* @__PURE__ */
|
|
962
|
-
return Re("p",{className:`text-sm text-gray-500 ${s??""}`,children:m});const x=r/2,v=r/2,w=r/2-46,N=Ts(e.length),k=e.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...y.map(e=>e.values[t]??0).filter(Number.isFinite))),$=(e,t)=>{const r=Math.max(0,Math.min(1,t/k[e])),n=N.center(e)-N.step/2;return[x+w*r*Math.cos(n),v+w*r*Math.sin(n)]},M=(e,t)=>null!==g?g!==e:null!==b&&b!==t,C=null!==g?y[g]:void 0;/* @__PURE__ */
|
|
963
|
-
return We("div",{className:`relative ${s??""}`,children:[
|
|
964
|
-
/* @__PURE__ */We("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":p,onMouseLeave:()=>f(null),children:[
|
|
965
|
-
/* @__PURE__ */Re("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__ */Re("circle",{cx:x,cy:v,r:n,fill:"none",stroke:Ns.grid,strokeWidth:1},r):/* @__PURE__ */Re("path",{d:zd(lc(x,v,n,e.length)),fill:"none",stroke:Ns.grid,strokeWidth:1},r)}),e.map((e,t)=>{const[r,n]=$(t,k[t]);/* @__PURE__ */
|
|
966
|
-
return We("g",{children:[
|
|
967
|
-
/* @__PURE__ */Re("line",{x1:x,y1:v,x2:r,y2:n,stroke:Ns.grid,strokeWidth:1}),
|
|
968
|
-
/* @__PURE__ */Re("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:Ns.label,children:e.label})]},e.key)}),
|
|
969
|
-
/* @__PURE__ */Re(ai,{id:p,reveal:!!o&&"center-out"}),y.map((t,r)=>{const a=Ls(r,3,t.color,t.tone),l=e.map((e,r)=>$(r,t.values[r]??0));/* @__PURE__ */
|
|
970
|
-
return We("g",{opacity:M(r,t.key)?.3:1,onMouseEnter:()=>f(r),mask:o?`url(#${Jl(p)})`:void 0,children:["area"===n&&/* @__PURE__ */Re("path",{d:zd(l),fill:a,fillOpacity:.18,stroke:"none"}),
|
|
971
|
-
/* @__PURE__ */Re("path",{d:zd(l),fill:"none",stroke:a,strokeWidth:2,strokeLinejoin:"round"}),l.map(([e,t],r)=>/* @__PURE__ */Re("circle",{cx:e,cy:t,r:3.5,fill:a,stroke:Ns.surface,strokeWidth:1.5},r))]},t.key)})]}),C&&/* @__PURE__ */Re("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Re(Ys,{title:C.label,rows:e.map((e,t)=>({key:e.key,label:e.label,color:Ls(g,3,C.color,C.tone),value:h(C.values[t]??0)}))})}),
|
|
972
|
-
/* @__PURE__ */Re("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__ */We("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
973
|
-
/* @__PURE__ */Re("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:Ls(t,3,e.color,e.tone)}}),
|
|
974
|
-
/* @__PURE__ */Re("span",{className:"flex-1 truncate",children:e.label})]},e.key))}),
|
|
975
|
-
/* @__PURE__ */Re(Ad,{caption:d.acrossMeasures(y.map(e=>e.label),e.length),head:[d.tableSeries,...e.map(e=>e.label)],rows:y.map(t=>[t.label,...e.map((e,r)=>h(t.values[r]??0))])})]})}var Td=300*Math.PI/180;function Ed({rows:e,variant:t="track",size:r=300,max:n,formatValue:a,animate:l=!0,className:i,emptyLabel:o,trackGap:s=6}){const c=ae().charts,d=ne(),u=a??(e=>se(e,d)),h=o??c.nothingToPlot,m=Me(),[p,g]=Le(null),{highlighted:f}=Hs();if(0===e.length)/* @__PURE__ */return Re("p",{className:`text-sm text-gray-500 ${i??""}`,children:h});const b=r/2,y=r/2,x=r/2-10,v=n??Math.max(...e.map(e=>e.value),1),w="track"===t?Math.max(6,(x-.16*r)/e.length):0,N=Math.max(1,Math.floor((x-.16*r)/w||1)),k="track"===t?e.slice(0,N):e,$=Math.min(s,Math.max(1,w-2)),M=Ts(k.length,.03),C=null!==p?k[p]:void 0;/* @__PURE__ */
|
|
976
|
-
return We("div",{className:`relative ${i??""}`,children:[
|
|
977
|
-
/* @__PURE__ */We("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":m,onMouseLeave:()=>g(null),children:[
|
|
978
|
-
/* @__PURE__ */Re("title",{id:m,children:"track"===t?c.radialTrack(k.length):c.radialCycle(k.length)}),k.map((e,n)=>{const a=$s(n,e.color,e.tone),i=Math.max(0,Math.min(1,e.value/v)),o=((e,t)=>null!==p?p!==e:null!==f&&f!==t)(n,e.key);if("track"===t){const t=x-n*w,r=t-w+$,s=-Math.PI/2;/* @__PURE__ */
|
|
979
|
-
return We("g",{opacity:o?.4:1,onMouseEnter:()=>g(n),className:l?ii.sweep:void 0,style:l?oi(n,70):void 0,children:[
|
|
980
|
-
/* @__PURE__ */Re("path",{d:ic(b,y,r,t,s,s+Td),fill:Ns.grid}),
|
|
981
|
-
/* @__PURE__ */Re("path",{d:ic(b,y,r,t,s,s+Td*i),fill:a})]},e.key)}const s=.14*r;/* @__PURE__ */
|
|
982
|
-
return Re("g",{opacity:o?.4:1,onMouseEnter:()=>g(n),children:/* @__PURE__ */Re("path",{d:ic(b,y,s,s+(x-s)*i,M(n),M(n)+M.step),fill:a})},e.key)})]}),C&&null!==p&&/* @__PURE__ */Re("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Re(Ys,{title:C.label,rows:[{key:"value",label:c.value,color:$s(p,C.color,C.tone),value:u(C.value)}]})}),
|
|
983
|
-
/* @__PURE__ */Re("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__ */We("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
984
|
-
/* @__PURE__ */Re("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:$s(t,e.color,e.tone)}}),
|
|
985
|
-
/* @__PURE__ */Re("span",{className:"flex-1 truncate",children:e.label}),
|
|
986
|
-
/* @__PURE__ */Re("span",{className:"tabular-nums text-gray-800",children:u(e.value)})]},e.key))})]})}function Bd({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=ae().charts,u=ne(),h=i??(e=>se(e,u)),m=c??d.noStages,p=Me(),[g,f]=Le(null),{highlighted:b}=Hs(),y=Se(null),x=Os(y,560),v=n??x;if(0===e.length)/* @__PURE__ */return Re("p",{className:`text-sm text-gray-500 ${s??""}`,children:m});const w=o??$s(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?`−${de(r,1,u)}`:""}},S=$?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,D=v-M-S,P=Math.max($?2:0,Math.min(l,D)),A=e=>Math.max(P,D*Math.max(0,e/k)),j=e=>A(e)/2,z=M+D/2,F=t=>46+t/Math.max(1,e.length-1)*54,T=e=>`color-mix(in oklab, ${w} ${F(e).toFixed(0)}%, ${Ns.surface})`,E=e=>F(e)>=55?Ns.surface:Ns.label,B=(e,t)=>null!==g?g!==e:null!==b&&b!==t,I=null!==g?e[g]:void 0;/* @__PURE__ */
|
|
987
|
-
return We("div",{className:`relative ${s??""}`,ref:y,children:[
|
|
988
|
-
/* @__PURE__ */We("svg",{width:"100%",height:N,viewBox:`0 0 ${v} ${N}`,role:"img","aria-labelledby":p,onMouseLeave:()=>f(null),children:[
|
|
989
|
-
/* @__PURE__ */Re("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=de(r.value/(e[0].value||1)*100,0,u),c=.62*s.length*12+12;if($){const e=M,t=e+A(r.value),{count:a,drop:d}=L(n);/* @__PURE__ */
|
|
990
|
-
return We("g",{opacity:B(n,r.key)?.45:1,onMouseEnter:()=>f(n),children:[
|
|
991
|
-
/* @__PURE__ */Re("path",{d:`M${e},${l} L${t},${l} L${t},${i} L${e},${i} Z`,fill:T(n)}),
|
|
992
|
-
/* @__PURE__ */Re("text",{x:M-12,y:o+4,textAnchor:"end",fontSize:12,fill:Ns.label,children:r.label}),t-e>=c&&/* @__PURE__ */Re("text",{x:e+8,y:o+4,textAnchor:"start",fontSize:12,fontWeight:600,fill:E(n),style:{fontVariantNumeric:"tabular-nums"},children:s}),
|
|
993
|
-
/* @__PURE__ */We("text",{"data-funnel-value":"true",x:t+8,y:o+4,textAnchor:"start",fontSize:12,fill:Ns.label,style:{fontVariantNumeric:"tabular-nums"},children:[
|
|
994
|
-
/* @__PURE__ */Re("tspan",{fontWeight:600,children:a}),d&&/* @__PURE__ */Re("tspan",{fill:Ns.muted,children:` ${d}`})]})]},r.key)}const d=j(r.value),m="cone"===t?j(e[n+1]?.value??r.value):d,p=C(n),g=2*Math.min(d,m)>=c;/* @__PURE__ */
|
|
995
|
-
return We("g",{opacity:B(n,r.key)?.45:1,onMouseEnter:()=>f(n),children:[
|
|
996
|
-
/* @__PURE__ */Re("path",{d:`M${z-d},${l} L${z+d},${l} L${z+m},${i} L${z-m},${i} Z`,fill:T(n)}),
|
|
997
|
-
/* @__PURE__ */Re("text",{x:M-14,y:o-2,textAnchor:"end",fontSize:12,fill:Ns.label,children:r.label}),
|
|
998
|
-
/* @__PURE__ */We("text",{x:M-14,y:o+14,textAnchor:"end",fontSize:11,fill:Ns.muted,style:{fontVariantNumeric:"tabular-nums"},children:[h(r.value),null!=p?` · −${de(p,1,u)}`:""]}),
|
|
999
|
-
/* @__PURE__ */Re("text",{x:g?z:z+Math.max(d,m)+6,y:o+4,textAnchor:g?"middle":"start",fontSize:12,fontWeight:600,fill:g?E(n):Ns.label,style:{fontVariantNumeric:"tabular-nums"},children:s})]},r.key)})]}),I&&null!==g&&/* @__PURE__ */Re("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Re(Ys,{title:I.label,rows:[{key:"value",label:d.count,color:T(g),value:h(I.value)},{key:"share",label:d.ofFirstStage,color:Ns.muted,value:de(I.value/(e[0].value||1)*100,0,u)},...g>0&&e[g-1].value>0?[{key:"drop",label:d.droppedHere,color:ws.critical,value:`−${de(100*(1-I.value/e[g-1].value),1,u)}`}]:[]]})})]})}function Id({items:e,height:t=320,width:r,gap:n=2,radius:a=3,formatValue:l,color:i,className:o,emptyLabel:s}){const c=ae().charts,d=ne(),u=l??(e=>se(e,d)),h=s??c.nothingToBreakDown,m=Se(null),p=Os(m),g=r??p,[f,b]=Le(null),{highlighted:y}=Hs(),x=id(e,g,t);if(0===x.length)/* @__PURE__ */
|
|
1000
|
-
return Re("div",{className:o,ref:m,children:/* @__PURE__ */Re("p",{className:"py-8 text-center text-sm text-gray-500",children:h})});const v=i??$s(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)}%, ${Ns.surface})`,$=e=>N(e)>=55?Ns.surface:Ns.label,M=f??y,C=f?x.find(e=>e.key===f):void 0;/* @__PURE__ */
|
|
1001
|
-
return We("div",{className:`relative ${o??""}`,ref:m,children:[
|
|
1002
|
-
/* @__PURE__ */Re("svg",{width:"100%",height:t,viewBox:`0 0 ${g} ${t}`,role:"img","aria-label":c.treemap(e.length),onMouseLeave:()=>b(null),children:x.map(e=>{const t=Math.max(0,e.width-n),r=Math.max(0,e.height-n),l=t>6.2*e.label.length+12&&r>30,i=l&&r>44;/* @__PURE__ */
|
|
1003
|
-
return We("g",{opacity:M&&M!==e.key?.55:1,onMouseEnter:()=>b(e.key),children:[
|
|
1004
|
-
/* @__PURE__ */Re("rect",{x:e.x+n/2,y:e.y+n/2,width:t,height:r,rx:a,fill:k(e.value)}),l&&/* @__PURE__ */Re("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__ */Re("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__ */Re("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Re(Ys,{title:C.label,rows:[{key:"value",label:c.value,color:k(C.value),value:u(C.value)}]})}),
|
|
1005
|
-
/* @__PURE__ */Re(Ad,{caption:c.treemap(e.length),head:[c.tableItem,c.value],rows:x.map(e=>[e.label,u(e.value)])})]})}function Od(e,t,r,n,a,l,i,o){if(n>=8)return;const s=e.reduce((e,t)=>e+Rd(t,8-n),0);if(s<=0)return;let c=t;e.forEach((e,t)=>{const d=Rd(e,8-n),u=d/s*r,h=`${i}/${e.key}`,m=0===n?t:a,p=0===n?e.key:l;o.push({id:h,label:e.label,value:d,depth:n,start:c,end:c+u,branch:m,branchKey:p}),e.children?.length&&Od(e.children,c,u,n+1,m,p,h,o),c+=u})}function Rd(e,t){return t>0&&e.children?.length?e.children.reduce((e,r)=>e+Rd(r,t-1),0):Math.max(0,e.value??0)}function Wd({nodes:e,size:t=320,innerRadius:r=44,ringGap:n=2,formatValue:a,centerLabel:l,className:i,emptyLabel:o}){const s=ae().charts,c=ne(),d=a??(e=>se(e,c)),u=o??s.nothingToBreakDown,[h,m]=Le(null),{highlighted:p}=Hs(),g=[];if(Od(e,-Math.PI/2,2*Math.PI,0,0,"","",g),0===g.length)/* @__PURE__ */return Re("p",{className:`text-sm text-gray-500 ${i??""}`,children:u});const f=Math.max(...g.map(e=>e.depth))+1,b=t/2,y=t/2,x=(t/2-8-r)/f,v=g.filter(e=>0===e.depth).reduce((e,t)=>e+t.value,0),w=e=>`color-mix(in oklab, ${$s(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${Ns.surface})`,N=e=>null!==h?e.id===h:null===p||e.branchKey===p,k=h?g.find(e=>e.id===h):void 0,$=e=>de(e.value/v*100,1,c);/* @__PURE__ */
|
|
1006
|
-
return We("div",{className:`relative ${i??""}`,children:[
|
|
1007
|
-
/* @__PURE__ */We("svg",{width:"100%",height:t,viewBox:`0 0 ${t} ${t}`,role:"img","aria-label":s.sunburst(d(v),f),onMouseLeave:()=>m(null),children:[g.map(e=>/* @__PURE__ */Re("path",{d:ic(b,y,r+e.depth*x+n/2,r+(e.depth+1)*x-n/2,e.start,e.end),fill:w(e),fillOpacity:N(e)?1:.45,stroke:Ns.surface,strokeWidth:1,onMouseEnter:()=>m(e.id)},e.id)),l&&/* @__PURE__ */Re("text",{x:b,y:y+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:Ns.label,children:l})]}),k&&/* @__PURE__ */Re("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Re(Ys,{title:k.label,rows:[{key:"value",label:s.value,color:w(k),value:d(k.value)},{key:"share",label:s.share,color:Ns.muted,value:$(k)}]})}),
|
|
1008
|
-
/* @__PURE__ */Re(Ad,{caption:s.sunburst(d(v),f),head:[s.tableLevel,s.tableItem,s.value,s.share],rows:g.map(e=>[e.depth+1,e.label,d(e.value),$(e)])})]})}function Kd({nodes:e,links:t,height:r=320,width:n,nodeWidth:a=14,nodePadding:l=12,formatValue:i,className:o,emptyLabel:s}){const c=ae().charts,d=ne(),u=i??(e=>se(e,d)),h=s??c.noFlows,m=Se(null),p=Os(m),g=n??p,[f,b]=Le(null),{highlighted:y}=Hs();if(0===e.length||0===t.length)/* @__PURE__ */
|
|
1009
|
-
return Re("div",{className:o,ref:m,children:/* @__PURE__ */Re("p",{className:"py-8 text-center text-sm text-gray-500",children:h})});const x=[...new Set(e.map(e=>e.depth))].sort((e,t)=>e-t),v=e=>x.length<=1?0:x.indexOf(e)/(x.length-1)*(g-a-140)+70,w=new Map(e.map(e=>{const r=t.filter(t=>t.from===e.key).reduce((e,t)=>e+t.value,0),n=t.filter(t=>t.to===e.key).reduce((e,t)=>e+t.value,0);return[e.key,Math.max(r,n,e.value??0)]})),N=/* @__PURE__ */new Map;for(const t of e)N.set(t.depth,[...N.get(t.depth)??[],t]);const k=Math.max(...[...N.values()].map(e=>e.reduce((e,t)=>e+(w.get(t.key)??0),0))),$=r-20,M=k>0?($-l*(Math.max(...[...N.values()].map(e=>e.length))-1))/k:0,C=/* @__PURE__ */new Map;for(const[e,t]of N){const r=t.map(e=>Math.max(2,(w.get(e.key)??0)*M)),n=r.reduce((e,t)=>e+t,0)+l*(t.length-1),a=r.reduce((e,t)=>e+Math.max(0,t-2),0),i=n>$&&a>0?Math.max(0,1-(n-$)/a):1;let o=10;t.forEach((t,n)=>{const a=2+Math.max(0,r[n]-2)*i;C.set(t.key,{x:v(e),y:o,h:a,index:n}),o+=a+l})}const L=/* @__PURE__ */new Map,S=/* @__PURE__ */new Map,D=/* @__PURE__ */new Map,P=(e,t)=>e.from===t||e.to===t,A="link"===f?.kind?t[f.index]:void 0,j="node"===f?.kind?e.find(e=>e.key===f.key):void 0;/* @__PURE__ */
|
|
1010
|
-
return We("div",{className:`relative ${o??""}`,ref:m,children:[
|
|
1011
|
-
/* @__PURE__ */We("svg",{width:"100%",height:r,viewBox:`0 0 ${g} ${r}`,role:"img","aria-label":c.sankey(e.length,t.length),onMouseLeave:()=>b(null),children:[t.map((e,t)=>{const r=C.get(e.from),n=C.get(e.to);if(!r||!n)return null;const l=Math.max(1,e.value*M),i=r.y+(L.get(e.from)??0)+l/2,o=n.y+(S.get(e.to)??0)+l/2;L.set(e.from,(L.get(e.from)??0)+l),S.set(e.to,(S.get(e.to)??0)+l);const s=r.x+a,c=n.x,d=$s(r.index,e.color),u=`${e.from}→${e.to}`,h=D.get(u)??0;D.set(u,h+1);const m=((e,t)=>f?"link"===f.kind?f.index===t:P(e,f.key):null!==y?P(e,y):null)(e,t);/* @__PURE__ */
|
|
1012
|
-
return Re("path",{d:tc([[s,i],[c,o]]),fill:"none",stroke:d,strokeWidth:l,strokeOpacity:null===m||m?.42:.12,onMouseEnter:()=>b({kind:"link",index:t})},h?`${u}#${h}`:u)}),e.map(e=>{const r=C.get(e.key);if(!r)return null;const n=r.x>g/2,l=(i=e.key,f?"node"===f.kind?f.key===i:P(t[f.index],i):null!==y?y===i:null);var i;/* @__PURE__ */
|
|
1013
|
-
return We("g",{opacity:null===l||l?1:.45,onMouseEnter:()=>b({kind:"node",key:e.key}),children:[
|
|
1014
|
-
/* @__PURE__ */Re("rect",{x:r.x,y:r.y,width:a,height:r.h,rx:2,fill:$s(r.index,e.color,e.tone)}),
|
|
1015
|
-
/* @__PURE__ */Re("text",{x:n?r.x-8:r.x+a+8,y:r.y+r.h/2+4,textAnchor:n?"end":"start",fontSize:11,fill:Ns.label,children:e.label})]},e.key)})]}),A&&/* @__PURE__ */Re("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Re(Ys,{title:`${A.from} → ${A.to}`,rows:[{key:"value",label:c.flow,color:$s(C.get(A.from)?.index??0,A.color),value:u(A.value)}]})}),j&&/* @__PURE__ */Re("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Re(Ys,{title:j.label,rows:[{key:"value",label:c.throughput,color:$s(C.get(j.key)?.index??0,j.color,j.tone),value:u(w.get(j.key)??0)}]})}),
|
|
1016
|
-
/* @__PURE__ */Re(Ad,{caption:c.sankey(e.length,t.length),head:[c.tableFrom,c.tableTo,c.value],rows:t.map(e=>[e.from,e.to,u(e.value)])})]})}function _d({labels:e,matrix:t,size:r=340,maxNodes:n=8,padAngle:a=.04,arcWidth:l=12,formatValue:i,className:o,emptyLabel:s}){const c=ae().charts,d=ne(),u=i??(e=>se(e,d)),h=s??c.noFlows,[m,p]=Le(null),{highlighted:g}=Hs(),f=function(e,t,r,n){const a=(e,r)=>{const n=t[e]?.[r];return"number"==typeof n&&Number.isFinite(n)?n:0},l=e.map((t,r)=>e.reduce((e,t,n)=>e+a(r,n)+a(n,r),0)),i=Math.max(2,r),o=e.length>i,s=o?e.map((e,t)=>t).sort((e,t)=>l[t]-l[e]).slice(0,i-1).sort((e,t)=>e-t):e.map((e,t)=>t),c=new Map(s.map((e,t)=>[e,t])),d=o?s.length:-1,u=o?[...s.map(t=>e[t]),n]:[...e],h=u.map(()=>u.map(()=>0));let m=0;e.forEach((t,r)=>e.forEach((e,t)=>{const n=c.get(r)??d,l=c.get(t)??d;n!==d||l!==d?h[n][l]+=a(r,t):m+=a(r,t)}));const p=u.map((e,t)=>u.reduce((e,r,n)=>e+h[t][n]+h[n][t],0));return d>=0&&(p[d]+=m),{labels:u,matrix:h,totals:p,otherIndex:d,foldedCount:o?e.length-s.length:0}}(e,t,n,c.other),{labels:b,matrix:y,otherIndex:x,foldedCount:v}=f,w=(e,t)=>y[e]?.[t]??0,N=e=>e===x?Ns.muted:$s(e),k=f.totals,$=b.map((e,t)=>t).sort((e,t)=>k[t]-k[e]),M=$.reduce((e,t)=>e+k[t],0);if(M<=0)/* @__PURE__ */return Re("p",{className:`text-sm text-gray-500 ${o??""}`,children:h});const C=r/2,L=r/2,S=r/2-44,D=S-l,P=a*$.length,A=/* @__PURE__ */new Map;let j=-Math.PI/2;$.forEach((e,t)=>{const r=k[e]/M*(2*Math.PI-P);A.set(e,{start:j,end:j+r,slot:t}),j+=r+a});const z=/* @__PURE__ */new Map,F=[];for(const e of $)for(const t of $){const r=w(e,t);if(r<=0)continue;const n=A.get(e),a=r/Math.max(1,k[e])*(n.end-n.start),l=z.get(e)??0;z.set(e,l+a),F.push({from:e,to:t,value:r,a:n.start+l+a/2,b:A.get(t).start+(A.get(t).end-A.get(t).start)/2})}const T=(e,t)=>[C+t*Math.cos(e),L+t*Math.sin(e)],E="arc"===m?.kind?m.index:void 0,B="ribbon"===m?.kind?F[m.index]:void 0;/* @__PURE__ */
|
|
1017
|
-
return We("div",{className:`relative ${o??""}`,children:[
|
|
1018
|
-
/* @__PURE__ */We("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-label":c.chord($.length),onMouseLeave:()=>p(null),children:[F.map((e,t)=>{const[n,a]=T(e.a,D),[l,i]=T(e.b,D),o=N(e.from),s=((e,t)=>m?"ribbon"===m.kind?m.index===t:m.index===e.from||m.index===e.to:null!==g?b[e.from]===g||b[e.to]===g:null)(e,t);/* @__PURE__ */
|
|
1019
|
-
return Re("path",{d:`M${n},${a} Q${C},${L} ${l},${i}`,fill:"none",stroke:o,strokeWidth:Math.max(1,e.value/M*r*.9),strokeOpacity:null===s||s?.34:.07,strokeLinecap:"round",onMouseEnter:()=>p({kind:"ribbon",index:t})},`${b[e.from]}→${b[e.to]}`)}),$.map(e=>{const t=A.get(e),r=(t.start+t.end)/2,[n,a]=T(r,S+16),l=(e=>m?"arc"===m.kind?m.index===e:F[m.index].from===e||F[m.index].to===e:null!==g?b[e]===g:null)(e);/* @__PURE__ */
|
|
1020
|
-
return We("g",{onMouseEnter:()=>p({kind:"arc",index:e}),children:[
|
|
1021
|
-
/* @__PURE__ */Re("path",{d:ic(C,L,D,S,t.start,t.end),fill:N(e),fillOpacity:null===l||l?1:.45}),
|
|
1022
|
-
/* @__PURE__ */Re("text",{x:n,y:a+4,fontSize:11,fill:Ns.label,textAnchor:Math.cos(r)>.15?"start":Math.cos(r)<-.15?"end":"middle",children:b[e]})]},e)})]}),v>0&&/* @__PURE__ */Re("p",{className:"mt-1 text-xs text-gray-500",children:c.chordFolded(v)}),void 0!==E&&/* @__PURE__ */Re("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Re(Ys,{title:b[E],rows:[{key:"total",label:c.totalFlow,color:N(E),value:u(k[E])}]})}),B&&/* @__PURE__ */Re("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Re(Ys,{title:`${b[B.from]} → ${b[B.to]}`,rows:[{key:"value",label:c.flow,color:N(B.from),value:u(B.value)}]})}),
|
|
1023
|
-
/* @__PURE__ */Re(Ad,{caption:c.chord($.length),head:[c.tableFrom,c.tableTo,c.value],rows:F.map(e=>[b[e.from],b[e.to],u(e.value)])})]})}export{Jo as APP_UPDATE_POLL_MS,Dl as Accordion,ea as AlignmentGrid,es as AppUpdateBanner,ia as AttachButton,aa as AttachmentDropZone,la as AttachmentList,Ac as AuthScreen,fl as Avatar,bl as AvatarGroup,Ga as BORDER_WIDTHS,wl as Banner,Sd as BoxPlotChart,jt as BrandAssetEditor,Ul as BudgetBar,Ns as CHART_INK,en as COLUMN_COUNT_MAX,rn as COLUMN_COUNT_WIDTHS,nn as COLUMN_SHARES_EQUAL,tn as COLUMN_SHARE_MIN,_a as CONTROL_HEIGHTS,Hc as CORNERS,Yt as Calendar,Dd as CandlestickChart,wa as Card,Ws as CartesianPlot,fd as ChartBrush,ai as ChartDefs,gd as ChartDot,pd as ChartFrame,qs as ChartHighlightProvider,Ks as ChartSkeleton,Ys as ChartTooltip,Cc as ChatTemplate,ct as Checkbox_default,vc as CheckoutTemplate,_d as ChordChart,On as ColorPicker,Bn as ColorPickerPanel,zn as ColorSwatch,Pl as ColoredBadge,Gs as ColumnChart,oa as ComposerAttachments,ro as ContainerFillChart,So as ContextMenu,Jn as CornersInput,cl as CountBadge,Vl as DAY_MS,mc as DashboardTemplate,gs as DataTable,fc as DataTablePage,gr as DatePicker_default,ar as DateRangePicker,xr as DateTimePicker_default,ll as DescriptionList,Qr as DisplayChips,Ra as Divider,as as Drawer,Co as DropdownMenu,Za as ELEVATION_LEVELS,kc as EmailTemplate,Al as EmptyState,ed as EmptyValue,Tc as ErrorBoundary,zc as ErrorPage,Va as FONT_WEIGHTS,ta as FilePicker_default,gt as FormErrorSummary,ht as FormField,yc as FormLayoutPage,Bd as FunnelChart,sa as GROUP_COLORS,ca as GROUP_COLORS_SOLID,Dc as GalleryTemplate,Ia as Grid,Pd as HeatmapChart,go as HelpCenter,In as HexInput,Ld as HistogramChart,qe as IconButton_default,Xo as IconRail,Zo as IconRailButton,Kn as ImageFocusPoint,Fa as Inline,Gr as InputNumber_default,He as Input_default,ls as Kanban,yt as Label,Qc as LanguagePanel,Jc as LanguageSelect,Gn as LinkPicker,fs as ListFooter,bs as ListLoadError,Uo as ListRow,Sr as MAX_FRACTION_DIGITS,ii as MOTION,Ya as MOTION_DURATIONS,mo as Markdown,At as MediaUploadField,Ot as MediaUploadGrid,cd as Meter,Kl as MetricBar,Vi as MilestoneTimeline,at as NativeSelect,jr as NumericKeypad,Yi as POST_PRODUCTION_STATUSES,jl as PageHeader,os as Pagination,ra as PaperclipGlyph,Da as Paragraph,oc as PieChart,wn as Popover,Et as PortalBrandingProvider,eo as ProductionTimeline,jd as RADAR_SERIES_CAP,Xa as RADIUS_ROLES,qa as ROW_HEIGHTS,Fd as RadarChart,Ed as RadialBarChart,pt as RadioGroup,ut as Radio_default,Md as RangeChart,od as RankedBars,kd as SCATTER_SERIES_CAP,xs as SERIES_SLOT_COUNT,vs as SERIES_VARS,Ka as SPACING_ROLES,Wa as SPACING_SCALE,Gi as STAGES,ws as STATUS_VARS,Kd as SankeyChart,$d as ScatterChart,qn as SearchableSelect,Rr as Segmented,ot as Select_default,ol as SettingRow,bo as SidebarActionButton,xo as SidebarGroupLabel,No as SidebarNavGroup,wo as SidebarNavItem,el as Skeleton,Jr as Slider,Lr as Snippet,Ho as SortableList,ys as Sparkline,za as Stack,Na as StatCard,ud as StatTile,hl as Statistic,fa as StatusBadge,pa as StatusBadgeProvider,Sl as Stepper,Wd as SunburstChart,qr as Switch_default,Ua as TYPE_SCALE,Cl as Tabs,ya as TagInput,Ca as Text,Xn as TextLinkField,Ue as Textarea_default,Fr as TileButton_default,td as TimeAgo,sr as TimePicker_default,Nd as TimeSeriesChart,Hi as TimelineTrack,Sa as Title,ko as TopNav,Bo as Tree,Ko as TreeEmptySlot,Io as TreeGroup,Oo as TreeGroupLabel,Wo as TreeRow,_o as TreeSeam,Id as TreemapChart,Cd as WaterfallChart,xn as WidthsBar,Ts as angleScale,Dr as appendKey,Vc as applyCorners,Yc as applyIconSet,Gc as applyThemePrefs,ic as arcPath,ac as areaBetween,nc as areaFrom,Ms as assignSeriesSlots,Vs as autoHighlightIndex,Pr as backspace,Ds as bandScale,Bs as binValues,ql as budgetState,tc as bumpPath,Xi as calcOverall,Zi as calcReportOverall,An as colorFill,jn as colorSwatchClasses,on as columnSharesWidths,Nr as copyToClipboard,rc as curvePath,ti as dashFor,ei as fillFor,Xl as fillId,Ve as firstEnabledIndex,Gl as fmtSliderDate,_t as fromKey,Zl as glowId,Ql as groundId,da as groupColors,Cn as hexToHsv,Us as highlightOpacity,Ln as hsvToHex,Fl as isSeverityTone,Ha as isSpacingStep,bt as labelClasses,Ps as ladderScale,Zc as languageSelectWidth,Ye as lastEnabledIndex,Zs as linearPath,Ss as linearScale,Fs as logScale,Jl as maskId,Xe as matchTypeahead,vt as mediaFileName,Qs as monotonePath,Ge as nextEnabledIndex,js as niceAxis,As as niceMax,kn as parseHexColor,lc as polygonPoints,Es as radiusScale,ln as resolveColumnShares,sn as resolveColumnWidths,Uc as resolveCorners,zt as resolvePortalBrandAsset,$s as resolveSeriesColor,Ls as resolveSeriesColorWithin,Kc as resolveTheme,vr as selectionAt,ks as seriesColor,Tl as severityOf,ec as splinePath,id as squarify,oi as stagger,Js as stepPath,Nl as tabButtonId,kl as tabPanelId,Yl as toDayMs,Jt as toISODate,Kt as toKey,Cs as toggleSeriesSlot,Qo as useAppUpdate,nd as useClickOutside,Do as useContextMenu,rd as useDebouncedValue,Hs as useHighlight,Os as usePlotWidth,Bt as usePortalBranding,Ji as useProductionTimeline,ga as useStatusLabel,Xc as useTheme};
|