efficient-shell 12.23.0 → 12.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +1 -1
  2. package/dist/{Browser-G3NJJDFN.js → Browser-I3RMT2LB.js} +15 -15
  3. package/dist/Calculator-LSDVIJVQ.js +29 -0
  4. package/dist/CurrencyConverter-G5IYUCN7.js +21 -0
  5. package/dist/{Files-A5MD7QNE.js → Files-WKTSGZLO.js} +141 -141
  6. package/dist/Notepad-GMDSZEAO.js +24 -0
  7. package/dist/PomodoroTimer-SFTPXEDV.js +91 -0
  8. package/dist/{Preview-DRNDT6WX.js → Preview-XYR5M6UU.js} +10 -10
  9. package/dist/{Stock-JY3PJI2M.js → Stock-YCPMLYPR.js} +3 -3
  10. package/dist/{Weather-POQXLYFA.js → Weather-TLFNIPDG.js} +13 -13
  11. package/dist/{WorldClock-FUJOPJ5G.js → WorldClock-66IRFS2W.js} +6 -6
  12. package/dist/ai/index.js +30 -30
  13. package/dist/apps/index.js +1 -1
  14. package/dist/bin/media-host-check.js +1 -1
  15. package/dist/bin/ui-check.js +1 -1
  16. package/dist/charts/PieChart.js +1 -1
  17. package/dist/charts/RadarChart.js +1 -1
  18. package/dist/charts/RadialBarChart.js +1 -1
  19. package/dist/charts/SpecChart.js +1 -1
  20. package/dist/charts/TimeSeriesChart.js +1 -1
  21. package/dist/{chunk-F4XGUOVL.js → chunk-4BKJ6A5H.js} +4 -4
  22. package/dist/{chunk-ZNLCITYY.js → chunk-5MWXBDRG.js} +2 -2
  23. package/dist/{chunk-QJWQ6OMF.js → chunk-AQCUGTOR.js} +6 -6
  24. package/dist/{chunk-MFSDS6CN.js → chunk-BKPP47DR.js} +1 -1
  25. package/dist/{chunk-T2OSPUS6.js → chunk-BZHP645G.js} +3 -3
  26. package/dist/{chunk-OGWQABFP.js → chunk-CALBDO7B.js} +1 -1
  27. package/dist/chunk-EC3P3W7Z.js +28 -0
  28. package/dist/chunk-EIFNESXS.js +1 -0
  29. package/dist/{chunk-XQWHKXLS.js → chunk-F37II2EH.js} +13 -13
  30. package/dist/{chunk-ZLKEPDJE.js → chunk-H6WXTJOT.js} +1 -1
  31. package/dist/{chunk-DG2TGWXI.js → chunk-JUFCEWE3.js} +5 -5
  32. package/dist/chunk-KZRZYLN7.js +99 -0
  33. package/dist/chunk-N56HV4IH.js +1 -0
  34. package/dist/{chunk-2NZ7CVMW.js → chunk-OALFCXD6.js} +1 -1
  35. package/dist/{chunk-VP2GI3UP.js → chunk-OHSRZLRD.js} +2 -2
  36. package/dist/{chunk-FVKXDF2Q.js → chunk-RB7IU7ZK.js} +5 -5
  37. package/dist/{chunk-WLX24TG6.js → chunk-TUPPFC74.js} +4 -4
  38. package/dist/{chunk-EEB5XPWP.js → chunk-VXDW6ZPG.js} +2 -2
  39. package/dist/format/index.js +1 -1
  40. package/dist/forms/BrandAssetEditor.js +1 -1
  41. package/dist/forms/LinkPicker.js +1 -1
  42. package/dist/forms/MediaLibrary.d.ts +4 -3
  43. package/dist/forms/MediaLibrary.js +1 -1
  44. package/dist/forms/MediaUploadField.js +1 -1
  45. package/dist/icons/index.js +1 -1
  46. package/dist/index.js +120 -120
  47. package/dist/shell/Dialog.d.ts +5 -0
  48. package/dist/shell/LanguageSelect.js +1 -1
  49. package/dist/shell/SettingRow.js +1 -1
  50. package/dist/telemetry/index.js +1 -1
  51. package/dist/templates/DashboardTemplate.js +1 -1
  52. package/dist/ui/index.js +1 -1
  53. package/dist/version.js +1 -1
  54. package/package.json +1 -1
  55. package/dist/Calculator-OUPD7SZV.js +0 -29
  56. package/dist/CurrencyConverter-CNGYEKE3.js +0 -21
  57. package/dist/Notepad-CUWBPETD.js +0 -24
  58. package/dist/PomodoroTimer-I53C5QYM.js +0 -91
  59. package/dist/chunk-EEGTFJUQ.js +0 -28
  60. package/dist/chunk-MDVABA4H.js +0 -1
  61. package/dist/chunk-XQNZJNEJ.js +0 -99
@@ -1,11 +1,11 @@
1
- import{Segmented as e}from"./chunk-HNIIDDLJ.js";import{FormField as i}from"./chunk-6KBDNYRW.js";import{ImageFocusPoint as a}from"./chunk-232YPI2L.js";import{isVideoUrl as t,mediaPromptLine as r,mediaFileName as o,FilenameBadge as n,BusyOverlay as s,UploadGlyph as l,zoneFocusClass as c,dropzoneClass as d}from"./chunk-VLMBXPRM.js";import{TransferProgress as u}from"./chunk-FJVZ2W55.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-V4XR4MOS.js";import{Icon as p}from"./chunk-XZXFUZIK.js";import{useShellStrings as b}from"./chunk-JSHMIMAJ.js";import{useState as f,useRef as g,useEffect as v,useId as y}from"react";import{jsxs as k,jsx as x,Fragment as j}from"react/jsx-runtime";var N=["flex h-8 items-center justify-center rounded-(--radius-control) text-(--status-on-solid)","not-disabled:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-60","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"].join(" ");function w({value:w,onChange:L,onPick:R,onFile:F,label:$,hint:C,error:U,required:z,className:P,accept:I="image/*",maxSizeBytes:O,fit:H="cover",height:M,shape:q="rect",placeholder:B,cta:J,acceptHint:S,showFilename:V=!0,allowReplace:X=!0,allowRemove:D=!0,replaceLabel:K,removeLabel:W,busy:Z=!1,busyLabel:A,choosingLabel:Y,pickFailedLabel:_,progress:E,disabled:G=!1,kind:Q,onKindChange:T,focus:ee,onFocusChange:ie,focusLabel:ae}){const te=b().media,re="circle"===q,oe=M??(re?96:112),ne=J??te.cta,se=Q??(/video/.test(I)&&!/image/.test(I)?"video":"image"),le="string"==typeof W&&W?W:te.remove,[ce,de]=f(!1),[ue,me]=f(!1),he=g(!0);v(()=>()=>{he.current=!1},[]);const pe=Z||ce,be=ce&&!Z?Y??te.choosing:A??te.uploading,fe=U??(ue?_??te.pickFailed:void 0),ge=e=>{if(!R)return;me(!1);const i=R(e);i&&"function"==typeof i.then&&(de(!0),i.then(e=>{he.current&&(de(!1),"string"==typeof e&&e&&L(e))},()=>{he.current&&(de(!1),me(!0))}))},ve=y(),ye=g(null),[ke,xe]=f(null);v(()=>()=>{ye.current&&URL.revokeObjectURL(ye.current)},[]);const je=G||pe,Ne=!!w&&(t(w,I)||w===ke),we=B??r(I,te),Le=K??(Ne||"video"===se?te.changeVideo:te.changeImage),Re=e=>{R?ge(e):F?F(e):(e=>{ye.current&&URL.revokeObjectURL(ye.current);const i=URL.createObjectURL(e);ye.current=i,xe(e.type.startsWith("video/")?i:null),L(i)})(e)},Fe=m({accept:I,maxSizeBytes:O,acceptHint:S,multiple:!1,disabled:je,onAccept:([e])=>Re(e)}),{dragOver:$e}=Fe,Ce=()=>{je||(R?ge():Fe.open())},Ue=w?o(w):"",ze=!re&&!Ne&&!!ie,Pe=G||!X&&!D?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:[re?"absolute inset-0 flex items-center justify-center gap-1 p-1 text-(--status-on-solid)":"absolute inset-x-0 bottom-0 flex items-center gap-1 p-1 text-(--status-on-solid)","opacity-0 transition-opacity duration-(--motion-fast)","group-hover/media:opacity-100 group-focus-within/media:opacity-100 [@media(hover:none)]:opacity-100"].join(" "),style:{background:"var(--rosh-media-scrim-button)"},children:[X&&/* @__PURE__ */k("button",{id:ze?void 0:ve,type:"button","aria-labelledby":`${ve}-change`,onClick:()=>Ce(),disabled:pe,className:re?`w-8 shrink-0 ${N}`:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${N}`,children:[
1
+ import{Segmented as e}from"./chunk-HNIIDDLJ.js";import{ImageFocusPoint as i}from"./chunk-232YPI2L.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{isVideoUrl as t,mediaPromptLine as r,mediaFileName as o,FilenameBadge as n,BusyOverlay as s,UploadGlyph as l,zoneFocusClass as c,dropzoneClass as d}from"./chunk-VLMBXPRM.js";import{TransferProgress as u}from"./chunk-FJVZ2W55.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-V4XR4MOS.js";import{Icon as p}from"./chunk-XZXFUZIK.js";import{useShellStrings as b}from"./chunk-JSHMIMAJ.js";import{useState as f,useRef as g,useEffect as v,useId as y}from"react";import{jsxs as k,jsx as x,Fragment as j}from"react/jsx-runtime";var N=["flex h-8 items-center justify-center rounded-(--radius-control) text-(--status-on-solid)","not-disabled:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-60","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"].join(" ");function w({value:w,onChange:L,onPick:R,onFile:F,label:$,hint:C,error:U,required:z,className:P,accept:I="image/*",maxSizeBytes:O,fit:H="cover",height:M,shape:q="rect",placeholder:B,cta:J,acceptHint:S,showFilename:V=!0,allowReplace:X=!0,allowRemove:D=!0,replaceLabel:K,removeLabel:W,busy:Z=!1,busyLabel:A,choosingLabel:Y,pickFailedLabel:_,progress:E,disabled:G=!1,kind:Q,onKindChange:T,focus:ee,onFocusChange:ie,focusLabel:ae}){const te=b().media,re="circle"===q,oe=M??(re?96:112),ne=J??te.cta,se=Q??(/video/.test(I)&&!/image/.test(I)?"video":"image"),le="string"==typeof W&&W?W:te.remove,[ce,de]=f(!1),[ue,me]=f(!1),he=g(!0);v(()=>()=>{he.current=!1},[]);const pe=Z||ce,be=ce&&!Z?Y??te.choosing:A??te.uploading,fe=U??(ue?_??te.pickFailed:void 0),ge=e=>{if(!R)return;me(!1);const i=R(e);i&&"function"==typeof i.then&&(de(!0),i.then(e=>{he.current&&(de(!1),"string"==typeof e&&e&&L(e))},()=>{he.current&&(de(!1),me(!0))}))},ve=y(),ye=g(null),[ke,xe]=f(null);v(()=>()=>{ye.current&&URL.revokeObjectURL(ye.current)},[]);const je=G||pe,Ne=!!w&&(t(w,I)||w===ke),we=B??r(I,te),Le=K??(Ne||"video"===se?te.changeVideo:te.changeImage),Re=e=>{R?ge(e):F?F(e):(e=>{ye.current&&URL.revokeObjectURL(ye.current);const i=URL.createObjectURL(e);ye.current=i,xe(e.type.startsWith("video/")?i:null),L(i)})(e)},Fe=m({accept:I,maxSizeBytes:O,acceptHint:S,multiple:!1,disabled:je,onAccept:([e])=>Re(e)}),{dragOver:$e}=Fe,Ce=()=>{je||(R?ge():Fe.open())},Ue=w?o(w):"",ze=!re&&!Ne&&!!ie,Pe=G||!X&&!D?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:[re?"absolute inset-0 flex items-center justify-center gap-1 p-1 text-(--status-on-solid)":"absolute inset-x-0 bottom-0 flex items-center gap-1 p-1 text-(--status-on-solid)","opacity-0 transition-opacity duration-(--motion-fast)","group-hover/media:opacity-100 group-focus-within/media:opacity-100 [@media(hover:none)]:opacity-100"].join(" "),style:{background:"var(--rosh-media-scrim-button)"},children:[X&&/* @__PURE__ */k("button",{id:ze?void 0:ve,type:"button","aria-labelledby":`${ve}-change`,onClick:()=>Ce(),disabled:pe,className:re?`w-8 shrink-0 ${N}`:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${N}`,children:[
2
2
  /* @__PURE__ */x(p,{name:"swap","aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
3
3
  /* @__PURE__ */x("span",{id:`${ve}-change`,className:re?"sr-only":"truncate",children:Le})]}),D&&/* @__PURE__ */x("button",{type:"button","aria-label":le,onClick:()=>{ye.current&&(URL.revokeObjectURL(ye.current),ye.current=null),xe(null),L("")},disabled:pe,className:`${re?"":"ml-auto "}w-8 shrink-0 ${N}`,children:/* @__PURE__ */x(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Ie=/* @__PURE__ */k("div",{...Fe.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden border transition-colors",re?"shrink-0 rounded-full":"rounded-(--radius-control)",ze?"":"bg-gray-100",$e?"border-blue-500":"border-line"].join(" "),style:ze?void 0:re?{height:oe,width:oe}:{height:oe},children:[ze?
4
- /* @__PURE__ */x(a,{value:ee??"",onChange:e=>ie?.(e),label:ae??te.focus,image:w,hint:null,id:ve,disabled:je,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):Ne?/* @__PURE__ */x("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Ue||void 0,className:"h-full w-full",style:{objectFit:H}}):/* @__PURE__ */x("img",{src:w??void 0,alt:Ue,className:"h-full w-full",style:{objectFit:H,objectPosition:ee||void 0}}),V&&!re&&w&&/* @__PURE__ */x(n,{children:Ue}),Pe,pe&&/* @__PURE__ */x(s,{label:be,progress:E,rounded:re?"rounded-full":"rounded-md"})]}),Oe=/* @__PURE__ */k(j,{children:[
4
+ /* @__PURE__ */x(i,{value:ee??"",onChange:e=>ie?.(e),label:ae??te.focus,image:w,hint:null,id:ve,disabled:je,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):Ne?/* @__PURE__ */x("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Ue||void 0,className:"h-full w-full",style:{objectFit:H}}):/* @__PURE__ */x("img",{src:w??void 0,alt:Ue,className:"h-full w-full",style:{objectFit:H,objectPosition:ee||void 0}}),V&&!re&&w&&/* @__PURE__ */x(n,{children:Ue}),Pe,pe&&/* @__PURE__ */x(s,{label:be,progress:E,rounded:re?"rounded-full":"rounded-md"})]}),Oe=/* @__PURE__ */k(j,{children:[
5
5
  /* @__PURE__ */x("span",{className:"px-3 text-xs text-ink-faint",children:we}),
6
6
  /* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:ne}),S&&/* @__PURE__ */x("span",{className:"text-xs text-ink-faintest",children:S})]}),He=/* @__PURE__ */k("button",{type:"button",id:ve,onClick:()=>Ce(),disabled:je,"aria-label":"string"==typeof we?we:te.upload,"aria-busy":pe||void 0,"aria-invalid":!!fe||void 0,"aria-required":z||void 0,"aria-describedby":fe?`${ve}-error`:C?`${ve}-hint`:void 0,...Fe.zoneProps,"data-media-circle":"",className:["group/zone flex w-full items-center gap-4 rounded-lg text-left",je?"cursor-not-allowed opacity-60":"cursor-pointer",c(je)].join(" "),children:[
7
7
  /* @__PURE__ */x("span",{className:["flex shrink-0 items-center justify-center rounded-full border-2 border-dashed text-ink-faintest transition-colors",$e?"border-accent-fill bg-accent-tint":"border-line-strong bg-surface-sunken group-hover/zone:bg-accent-tint"].join(" "),style:{height:oe,width:oe},children:/* @__PURE__ */x(l,{})}),
8
8
  /* @__PURE__ */x("span",{className:"flex min-w-0 flex-col items-start gap-1 [&>span]:px-0",children:pe?/* @__PURE__ */x(u,{state:"busy",verb:be,pct:E}):Oe})]}),Me=re?He:/* @__PURE__ */x("button",{type:"button",id:ve,onClick:()=>Ce(),disabled:je,"aria-label":"string"==typeof we?we:te.upload,"aria-busy":pe||void 0,"aria-invalid":!!fe||void 0,"aria-required":z||void 0,"aria-describedby":fe?`${ve}-error`:C?`${ve}-hint`:void 0,...Fe.zoneProps,className:d($e,je,c(je)),style:{minHeight:oe},children:pe?/* @__PURE__ */x(u,{state:"busy",verb:be,pct:E}):/* @__PURE__ */k(j,{children:[
9
9
  /* @__PURE__ */x("span",{className:"text-ink-faintest",children:/* @__PURE__ */x(l,{})}),Oe]})});/* @__PURE__ */
10
- return k(i,{label:$,htmlFor:ve,hint:C,error:fe,required:z,className:P,children:[T&&/* @__PURE__ */x("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */x(e,{value:se,onChange:e=>T(e),options:[{value:"image",label:te.image,icon:/* @__PURE__ */x(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:je},{value:"video",label:te.video,icon:/* @__PURE__ */x(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:je}],block:!0,size:"md",label:"string"==typeof $&&$?$:te.upload})}),w?Ie:Me,!R&&/* @__PURE__ */x("input",{...Fe.inputProps}),
10
+ return k(a,{label:$,htmlFor:ve,hint:C,error:fe,required:z,className:P,children:[T&&/* @__PURE__ */x("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */x(e,{value:se,onChange:e=>T(e),options:[{value:"image",label:te.image,icon:/* @__PURE__ */x(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:je},{value:"video",label:te.video,icon:/* @__PURE__ */x(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:je}],block:!0,size:"md",label:"string"==typeof $&&$?$:te.upload})}),w?Ie:Me,!R&&/* @__PURE__ */x("input",{...Fe.inputProps}),
11
11
  /* @__PURE__ */x(h,{rejections:Fe.rejections})]})}export{w as MediaUploadField};
@@ -1 +1 @@
1
- import{client_default as a}from"./chunk-XQNZJNEJ.js";var t=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),e="uploaded:wallpaper";function r(a,t){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===e?t||"":a}var l=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=(t,e)=>{const r=new FormData;r.append("wallpaper",t);const l=e?{onUploadProgress:a=>e(a.total?Math.round(a.loaded/a.total*100):null)}:void 0;return a.post("/auth/me/wallpaper/",r,l).then(a=>a.data)},p=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function o(a){const t=a?.response?.status,e=a?.response?.data,r=Array.isArray(e?.wallpaper)?e.wallpaper[0]:void 0;return r||(413===t?"That picture is too large to use as a wallpaper.":415===t?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{e as WALLPAPER_PREF_TOKEN,p as deleteWallpaper,t as getNumberingConfigs,l as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,o as wallpaperUploadError};
1
+ import{client_default as a}from"./chunk-KZRZYLN7.js";var t=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),e="uploaded:wallpaper";function r(a,t){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===e?t||"":a}var l=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=(t,e)=>{const r=new FormData;r.append("wallpaper",t);const l=e?{onUploadProgress:a=>e(a.total?Math.round(a.loaded/a.total*100):null)}:void 0;return a.post("/auth/me/wallpaper/",r,l).then(a=>a.data)},p=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function o(a){const t=a?.response?.status,e=a?.response?.data,r=Array.isArray(e?.wallpaper)?e.wallpaper[0]:void 0;return r||(413===t?"That picture is too large to use as a wallpaper.":415===t?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{e as WALLPAPER_PREF_TOKEN,p as deleteWallpaper,t as getNumberingConfigs,l as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,o as wallpaperUploadError};
@@ -0,0 +1,28 @@
1
+ import{Tree as e,TreeRow as n,TreeGroup as l}from"./chunk-OLCRYT3N.js";import{MarqueeBox as a}from"./chunk-IC72MGON.js";import{EmptyState as r}from"./chunk-T2TZBTSM.js";import{ImageLightbox as i}from"./chunk-436PJFHC.js";import{DescriptionList as t}from"./chunk-SACUSHVN.js";import{Drawer as o}from"./chunk-UP4HLGMZ.js";import{Breadcrumbs as d}from"./chunk-QMSINDXL.js";import{ROOT_KEY as s,mediaLibraryMenu as c}from"./chunk-VQ4X3OBR.js";import{useMediaMoveItems as u}from"./chunk-NOGSS432.js";import{RenameField as m}from"./chunk-GEZM6ARD.js";import{NativeSelect as p}from"./chunk-TM4CRQ3W.js";import{MediaUploadGrid as h}from"./chunk-OG53D3R5.js";import{MediaUsedInList as f}from"./chunk-FQ4IRBMA.js";import{Segmented as g}from"./chunk-HNIIDDLJ.js";import{useGridSelection as v}from"./chunk-VLKDWKVR.js";import{useMarquee as k}from"./chunk-OLFYNMTD.js";import{copyToClipboard as y}from"./chunk-Y7KDCC6E.js";import{Checkbox_default as b}from"./chunk-CGZBDI6C.js";import{useContextMenu as w,ContextMenu as x}from"./chunk-6FZ5JTBY.js";import{Banner as N}from"./chunk-N3R6N7LG.js";import{Input_default as C}from"./chunk-6RK6R3RY.js";import{DropdownMenu as I}from"./chunk-SFULX4E3.js";import{IconButton_default as D}from"./chunk-SV5RRBVA.js";import{useFileIntake as S,FileIntakeAlert as j}from"./chunk-V4XR4MOS.js";import{setModalDragAside as z,modalIdHolding as T}from"./chunk-EIFNESXS.js";import{ColoredBadge as F}from"./chunk-CJHYOHMU.js";import{Button_default as L}from"./chunk-EVYD6UFQ.js";import{Icon as O}from"./chunk-XZXFUZIK.js";import{Tooltip as E}from"./chunk-SOZCWT6I.js";import{buttonClasses as M}from"./chunk-UQYNPYF4.js";import{usePlotWidth as R}from"./chunk-MAFUXCPZ.js";import{useShellStrings as A}from"./chunk-JSHMIMAJ.js";import{useRef as P,useMemo as U,useCallback as B,useState as K,useEffect as H}from"react";import{jsxs as J,Fragment as V,jsx as G}from"react/jsx-runtime";var Y="application/x-efficient-media-files",Z="application/x-efficient-media-folder",X="application/x-efficient-media-file";function Q(e){if(!e||!Array.from(e.types).includes(X))return null;try{const n=JSON.parse(e.getData(X));if(n&&"string"==typeof n.id&&"string"==typeof n.url&&"string"==typeof n.name&&("image"===n.kind||"video"===n.kind))return{id:n.id,url:n.url,kind:n.kind,name:n.name}}catch{}return null}var $={type:"all",use:"any",sort:"newest"},W={lock:/* @__PURE__ */G(O,{name:"lock","aria-hidden":"true",className:"h-4 w-4"}),folder:/* @__PURE__ */G(O,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),folderOpen:/* @__PURE__ */G(O,{name:"folder-open","aria-hidden":"true",className:"h-4 w-4"}),folderPlus:/* @__PURE__ */G(O,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */G(O,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),upload:/* @__PURE__ */G(O,{name:"upload","aria-hidden":"true",className:"h-4 w-4"}),search:/* @__PURE__ */G(O,{name:"search","aria-hidden":"true",className:"h-4 w-4"}),grid:/* @__PURE__ */G(O,{name:"grid","aria-hidden":"true",className:"h-4 w-4"}),list:/* @__PURE__ */G(O,{name:"list","aria-hidden":"true",className:"h-4 w-4"}),more:/* @__PURE__ */G(O,{name:"more","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */G(O,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */G(O,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */G(O,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),crop:/* @__PURE__ */G(O,{name:"crop","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */G(O,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */G(O,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},q={link:/* @__PURE__ */G(O,{name:"link","aria-hidden":"true",className:"h-3 w-3"}),email:/* @__PURE__ */G(O,{name:"email","aria-hidden":"true",className:"h-3 w-3"}),lock:/* @__PURE__ */G(O,{name:"lock","aria-hidden":"true",className:"h-3 w-3"}),clock:/* @__PURE__ */G(O,{name:"clock","aria-hidden":"true",className:"h-3 w-3"})};function _(O){const{mode:Q="manage",layout:_="auto",location:ee,onLocationChange:ne,folders:le,products:ae,allFilesCount:re,trashCount:ie,files:te,query:oe,onQueryChange:de,filters:se=$,onFiltersChange:ce,extraFilters:ue,view:me="grid",onViewChange:pe,selectedIds:he,onSelectionChange:fe,usedIn:ge,denied:ve={},accept:ke="image/*,video/*",maxSizeBytes:ye,busy:be,progress:we,onUpload:xe,onNewFolder:Ne,onRename:Ce,onMove:Ie,onTrash:De,onDeleteFolder:Se,onRestore:je,onDeleteForever:ze,onEmptyTrash:Te,onReplace:Fe,onCropEdit:Le,onOpenInDesign:Oe,onChoose:Ee,onCancel:Me,pickNote:Re,onDragOut:Ae,className:Pe=""}=O,Ue=A().mediaLibrary,Be=A().media,Ke="pick"===Q,He=!Ke,Je=P(null),Ve=R(Je,"phone"===_?343:1200),Ge="phone"===_||"auto"===_&&Ve<640,Ye=U(()=>function(e=[]){const n=/* @__PURE__ */new Map,l=(e,a)=>{for(const r of e){const e=[...a,r];n.set(r.id,{node:r,path:e}),r.children&&l(r.children,e)}};return l(e,[]),n}(ae),[ae]),Ze=U(()=>new Map(le.map(e=>[e.id,e])),[le]),Xe=U(()=>{const e=/* @__PURE__ */new Map;for(const n of le){const l=n.parentId&&Ze.has(n.parentId)?n.parentId:null;e.set(l,[...e.get(l)??[],n])}return e},[le,Ze]),Qe=B(e=>{const n=[];for(let l=e?Ze.get(e):void 0;l&&(n.unshift(l),!(n.length>le.length));l=l.parentId?Ze.get(l.parentId):void 0);return n},[Ze,le.length]),$e=B((e,n)=>Qe(e).some(e=>e.id===n),[Qe]),[We,qe]=K(()=>/* @__PURE__ */new Set(["@files"])),_e=e=>qe(n=>{const l=new Set(n);return l.has(e)?l.delete(e):l.add(e),l}),en=B(e=>{qe(n=>e.every(e=>n.has(e))?n:/* @__PURE__ */new Set([...n,...e]))},[]),nn="files"===(ln=ee).place?`files:${ln.folderId??""}`:"products"===ln.place?`products:${ln.nodeId??""}`:"trash";var ln;H(()=>{if("files"===ee.place)en(["@files",...Qe(ee.folderId).slice(0,-1).map(e=>e.id)]);else if("products"===ee.place){const e=ee.nodeId?Ye.get(ee.nodeId)?.path??[]:[];en(["@products",...e.slice(0,-1).map(e=>`p:${e.id}`)])}},[nn]);const an="products"===ee.place,rn="trash"===ee.place,tn="files"===ee.place,on=tn?ee.folderId:null,dn=an&&ee.nodeId?Ye.get(ee.nodeId)?.path[0]:void 0,sn=e=>e?.sharedFrom?`${Ue.readOnly} ${Ue.editedAtHq(e.sharedFrom)}`:Ue.readOnly,cn=U(()=>te.map(e=>e.id),[te]),un=U(()=>new Map(te.map(e=>[e.id,e])),[te]),mn=v(cn),pn=U(()=>cn.filter(e=>mn.selected.has(e)),[cn,mn.selected]),hn=1===pn.length?un.get(pn[0]):void 0,fn=P(!0);H(()=>{fn.current?fn.current=!1:mn.clear()},[nn]);const gn=he?.join("\0");H(()=>{he&&mn.setSelection(he)},[gn]);const vn=P(gn??""),kn=pn.join("\0");H(()=>{vn.current!==kn&&(vn.current=kn,fe?.(pn))},[kn]);const yn=(e,n={})=>{Ke?mn.select(e):mn.select(e,{ctrl:!(!n.ctrlKey&&!n.metaKey),shift:!!n.shiftKey})},[bn,wn]=K(null),xn=e=>{const n=bn;if(wn(null),!n||null==e)return;e!==("folder"===n.kind?Ze.get(n.id)?.name:un.get(n.id)?.name)&&Ce?.(n,e)},Nn=async e=>{if(!Ne)return;const n=await Ne(e);en(["@files",...e?[e]:[]]),"string"==typeof n&&wn({kind:"folder",id:n})},Cn=B(e=>{const n=[],l=n=>{if("files"===e.kind)return n===on&&tn?Ue.alreadyHere:void 0;const l=Ze.get(e.id);return n===e.id||n&&$e(n,e.id)?Ue.notIntoItself:(l?.parentId??null)===n?Ue.folderAlreadyHere:void 0};n.push({key:s,label:Ue.allFiles,disabledReason:l(null)});const a=(e,r)=>{for(const i of Xe.get(e)??[])n.push({key:i.id,label:i.name,depth:r,disabledReason:l(i.id)}),a(i.id,r+1)};return a(null,1),n},[Xe,Ze,tn,$e,on,Ue]),In=B(e=>{const n=new Set(e.map(e=>un.get(e)?.kind??"image"));return 1===n.size?[...n][0]:"file"},[un]),[Dn,Sn]=K(null),jn={words:Ue,media:Be,denied:ve,moveTargets:Cn,kindOf:In,urlOf:e=>un.get(e)?.url,newSubfolder:Ne&&He?e=>{Nn(e)}:void 0,rename:Ce&&He?e=>{"file"!==e.kind||mn.isSelected(e.id)||mn.select(e.id),wn(e)}:void 0,move:Ie&&He?Ie:void 0,trash:De&&He?De:void 0,deleteFolder:Se&&He?Se:void 0,folderNotEmpty:e=>!!Ze.get(e)?.notEmpty,replace:Fe&&He?Fe:void 0,copyUrl:e=>{const n=un.get(e)?.url;n&&y(Ue.urlLabel,n)},openInDesign:Oe,restore:je,deleteForever:ze},zn=e=>c(e,jn),Tn=w(),Fn=(e,n)=>{Ke||(mn.isSelected(e)||mn.select(e),Tn.open(n,(e=>{const n=mn.isSelected(e)?pn:[e];return an?{kind:"render",id:e}:rn?{kind:"trashed",ids:n}:{kind:"files",ids:n}})(e)))},[Ln,On]=K(null),[En,Mn]=K(null),[Rn,An]=K(null);H(()=>{if(!En&&!Ln)return;const e=()=>{Mn(null),On(null)};return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[En,Ln]);const Pn=(e,n)=>Array.from(e.dataTransfer?.types??[]).includes(n),Un=(e,n)=>!(!Ie||ve.move||Ke)&&(!!Pn(e,Y)||!(!Pn(e,Z)||!Rn)&&(n!==Rn&&!(n&&$e(n,Rn)))),Bn=(e,n)=>({onDragEnter:l=>{Un(l,n)&&(l.preventDefault(),On(e))},onDragOver:l=>{Un(l,n)&&(l.preventDefault(),l.dataTransfer.dropEffect="move",Ln!==e&&On(e))},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||On(n=>n===e?null:n)},onDrop:e=>{if(Un(e,n))if(e.preventDefault(),On(null),Pn(e,Y)){let l;try{l=JSON.parse(e.dataTransfer.getData(Y))}catch{l=null}Array.isArray(l)&&l.length&&Ie({kind:"files",ids:l.map(String)},n)}else Rn&&(Ie({kind:"folder",id:Rn},n),An(null))}}),Kn=e=>{const n=e=>Pn(e,Y)||Pn(e,Z)||Pn(e,"Files");return{onDragEnter:l=>{n(l)&&Mn(e)},onDragOver:l=>{n(l)&&En!==e&&Mn(e)},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Mn(n=>n===e?null:n)}}},Hn=(e,n,l)=>/* @__PURE__ */G(E,{side:"right",content:En===e?Ue.noDropProducts:sn(l),open:En===e||!En&&void 0,children:/* @__PURE__ */G("span",{children:n})}),Jn=e=>({onContextMenu:n=>{Tn.open(n,e)}}),Vn=(e,a,r)=>e.map(e=>{const i=`p:${e.id}`,t=r??e,o=We.has(i),d=e.children?.length?e.children:null;/* @__PURE__ */
2
+ return J("div",{role:"none",className:"contents",children:[
3
+ /* @__PURE__ */G(n,{label:Hn(i,e.name,t),level:a,icon:d&&o?W.folderOpen:W.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Ue.fileCount(e.count):void 0,selected:an&&ee.nodeId===e.id,expanded:d?o:void 0,onToggle:d?()=>_e(i):void 0,onSelect:()=>ne({place:"products",nodeId:e.id}),rowProps:{"data-media-row":i,...Kn(i),...He?Jn({kind:"product-node",id:e.id}):{}}}),d&&o&&/* @__PURE__ */G(l,{children:Vn(d,a+1,t)})]},e.id)}),Gn=(e,a)=>(Xe.get(e)??[]).map(e=>{const r=Xe.get(e.id),i=We.has(e.id),t="folder"===bn?.kind&&bn.id===e.id,o=zn({kind:"folder",id:e.id});/* @__PURE__ */
4
+ return J("div",{role:"none",className:"contents",children:[
5
+ /* @__PURE__ */G(n,{label:e.name,level:a,icon:r&&i?W.folderOpen:W.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Ue.fileCount(e.count):void 0,selected:t||tn&&ee.folderId===e.id,expanded:r?i:void 0,onToggle:r?()=>_e(e.id):void 0,onSelect:()=>ne({place:"files",folderId:e.id}),drop:Ln===e.id?"into":void 0,dragging:Rn===e.id,draggable:He&&!!Ie&&!ve.move,rename:t?/* @__PURE__ */G(m,{value:e.name,label:Ue.folderName,onDone:xn}):void 0,actions:He&&o.length?/* @__PURE__ */G(I,{align:"end","aria-label":Ue.folderActions,trigger:W.more,items:o}):void 0,rowProps:{"data-media-row":e.id,...Bn(e.id,e.id),...He?Jn({kind:"folder",id:e.id}):{},...He&&Ie&&!ve.move?{draggable:!0,onDragStart:n=>{n.dataTransfer.effectAllowed="move",n.dataTransfer.setData(Z,e.id),An(e.id)},onDragEnd:()=>{An(null),On(null)}}:{}}}),r&&i&&/* @__PURE__ */G(l,{children:Gn(e.id,a+1)})]},e.id)}),Yn=We.has("@files"),Zn=We.has("@products"),Xn=/* @__PURE__ */J(e,{"aria-label":Ue.folders,children:[ae&&/* @__PURE__ */J(V,{children:[
6
+ /* @__PURE__ */G(n,{label:Hn("@products",Ue.products),level:1,icon:W.lock,badge:{label:Ue.readOnlyBadge,tone:"neutral"},expanded:ae.length?Zn:void 0,onToggle:()=>_e("@products"),selected:an&&null==ee.nodeId,onSelect:()=>ne({place:"products",nodeId:null}),rowProps:{"data-media-row":"@products",...Kn("@products")}}),Zn&&ae.length>0&&/* @__PURE__ */G(l,{children:Vn(ae,2)})]}),
7
+ /* @__PURE__ */G(n,{label:Ue.allFiles,level:1,icon:Yn?W.folderOpen:W.folder,count:re,countLabel:null!=re?Ue.fileCount(re):void 0,expanded:Xe.get(null)?.length?Yn:void 0,onToggle:()=>_e("@files"),selected:tn&&null==ee.folderId,onSelect:()=>ne({place:"files",folderId:null}),drop:"@files"===Ln?"into":void 0,rowProps:{"data-media-row":"@files",...Bn("@files",null)}}),Yn&&(Xe.get(null)?.length??0)>0&&/* @__PURE__ */G(l,{children:Gn(null,2)}),He&&/* @__PURE__ */G(n,{label:Ue.trash,level:1,icon:W.trash,count:ie,countLabel:null!=ie?Ue.fileCount(ie):void 0,selected:rn,onSelect:()=>ne({place:"trash"}),rowProps:{"data-media-row":"@trash"}})]}),Qn=(()=>{if(rn)return[{label:Ue.trash}];if(an){const e=ee.nodeId?Ye.get(ee.nodeId)?.path??[]:[];return[{label:Ue.products,onClick:e.length?()=>ne({place:"products",nodeId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>ne({place:"products",nodeId:n.id}):void 0}))]}const e=Qe(on);return[{label:Ue.allFiles,onClick:e.length?()=>ne({place:"files",folderId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>ne({place:"files",folderId:n.id}):void 0}))]})(),$n=an?Ue.readOnly:ve.upload,Wn=!!xe&&!rn&&!$n,qn=S({accept:ke,maxSizeBytes:ye,multiple:!0,disabled:!Wn,onAccept:e=>xe?.(e,on)}),_n=an?Ue.noProductFolder:ve.newFolder,el=e=>e?{"aria-disabled":!0,disabledReason:e}:{},nl=/* @__PURE__ */J("div",{className:"flex flex-wrap items-center gap-2",children:[He&&Ne&&!rn&&/* @__PURE__ */G(L,{variant:"secondary",size:"sm",leftIcon:W.folderPlus,onClick:()=>{Nn(on)},...el(_n),children:Ue.newFolder}),xe&&!rn&&/* @__PURE__ */G(L,{variant:"primary",size:"sm",leftIcon:W.upload,onClick:()=>qn.open(),...el($n),children:Ue.upload}),He&&rn&&Te&&te.length>0&&/* @__PURE__ */G(L,{variant:"danger",size:"sm",onClick:Te,...el(ve.deleteForever),children:Ue.emptyTrash})]}),ll=(e,n,l,a,r)=>/* @__PURE__ */G("div",{style:{width:Ge?void 0:r,flex:Ge?"1 1 120px":"0 0 auto",minWidth:0},children:/* @__PURE__ */G(p,{size:"sm","aria-label":e,value:n,onChange:a,options:l})},e),al=e=>n=>ce?.({...se,[e]:n}),rl=/* @__PURE__ */J("div",{className:"flex flex-wrap items-center gap-2",children:[de&&/* @__PURE__ */G("div",{style:{flex:"1 1 200px",minWidth:0},children:/* @__PURE__ */G(C,{size:"sm",type:"search",leftIcon:W.search,placeholder:an?Ue.searchProducts:Ue.search,"aria-label":an?Ue.searchProducts:Ue.search,value:oe??"",onChange:e=>de(e.target.value)})}),ce&&ll(Ue.mediaType,se.type,[{value:"all",label:Ue.allTypes},{value:"image",label:Ue.images},{value:"video",label:Ue.videos},{value:"svg",label:"SVG"},{value:"gif",label:"GIF"}],al("type"),130),ce&&!an&&!rn&&ll(Ue.use,se.use,[{value:"any",label:Ue.anyUse},{value:"email",label:Ue.emailOnly},{value:"website",label:Ue.websiteOnly},{value:"unused",label:Ue.notUsed}],al("use"),130),ce&&He&&ll(Ue.sort,se.sort,[{value:"newest",label:Ue.newest},{value:"name",label:Ue.byName},{value:"size",label:Ue.bySize}],al("sort"),110),ue?.map(e=>ll(e.label,e.value,e.options,e.onChange,120)),pe&&/* @__PURE__ */G(g,{size:"sm",label:Ue.view,value:me,onChange:pe,options:[{value:"grid",label:Ue.grid,icon:W.grid},{value:"list",label:Ue.list,icon:W.list}]})]}),il=e=>{const n=[];return null!=e.trashedDaysAgo&&n.push({key:"t",label:Ue.daysAgo(e.trashedDaysAgo),count:e.trashedDaysAgo,icon:q.clock,tone:"neutral"}),e.usedCount&&n.push({key:"u",label:Ue.used(e.usedCount),count:e.usedCount,icon:q.link,tone:"active"}),e.email&&n.push({key:"e",label:Ue.email,icon:q.email,tone:"queued"}),e.private&&n.push({key:"p",label:Ue.private,icon:q.lock,tone:"neutral"}),n},tl=e=>il(e).map(e=>/* @__PURE__ */G(F,{tone:e.tone,size:"xs",children:e.label},e.key)),ol=He&&tn&&!!Ie&&!ve.move,dl=!!Ae&&!rn,sl=P(""),cl=P(null),ul=P(Ae);ul.current=Ae;const ml=B(()=>{cl.current?.(),cl.current=null,z(sl.current,!1)},[]),pl=B(()=>{ml();const e=Je.current?.ownerDocument;if(sl.current=T(Je.current),!e||!sl.current)return;const n=Je.current.closest("[data-modal-panel]"),l=e=>{n?.contains(e.target)||z(sl.current,!0)},a=()=>{cl.current&&(ml(),ul.current?.("cancelled"))},r=["dragend","drop"],i=["pointermove","pointerdown","mousemove","mousedown"];for(const n of r)e.addEventListener(n,ml,!0);for(const n of i)e.addEventListener(n,a,!0);e.addEventListener("dragover",l,!0),cl.current=()=>{for(const n of r)e.removeEventListener(n,ml,!0);for(const n of i)e.removeEventListener(n,a,!0);e.removeEventListener("dragover",l,!0)}},[ml]);H(()=>ml,[ml]);const hl=(e,n)=>{const l=un.get(n);l&&fl(l)&&("start"===e?pl():ml(),Ae(e))},fl=e=>!dl||e.private||e.pickDisabledReason?void 0:JSON.stringify({id:e.id,url:e.url,kind:"video"===e.kind?"video":"image",name:e.name}),gl=te.map(e=>({id:e.id,url:e.thumbUrl??e.url,name:e.name,kind:e.kind,caption:e.name,badges:il(e),dragData:ol?JSON.stringify(mn.isSelected(e.id)?pn:[e.id]):fl(e),...ol&&fl(e)?{dragAlso:{[X]:fl(e)}}:{}})),vl=Ge?Math.max(72,Math.floor((Ve-24-16-1)/3)):112,kl=P(null),yl=k({containerRef:kl,enabled:He&&!Ge&&te.length>0,selected:mn.selected,setSelection:e=>mn.setSelection(e),clearSelection:mn.clear}),bl=e=>{if(Ke){const n=un.get(e);return void(!n||n.private||n.pickDisabledReason||Ee?.(n))}const n=cn.indexOf(e);n>=0&&Sn(n)},wl=te.length?null:oe?/* @__PURE__ */G(r,{variant:"dashed",title:Ue.noMatches}):an?/* @__PURE__ */G(r,{variant:"dashed",title:Ue.emptyProducts,description:sn(dn)}):rn?/* @__PURE__ */G(r,{variant:"dashed",title:Ue.trashEmpty}):!Wn||Ke?/* @__PURE__ */G(r,{variant:"dashed",title:Ue.emptyFolder}):null,xl="list"===me&&te.length>0,Nl=wl??(xl?/* @__PURE__ */G("ul",{role:"listbox","aria-multiselectable":He||void 0,"aria-label":Ue.folders,className:"flex flex-col gap-1",children:te.map(e=>/* @__PURE__ */J("li",{role:"option","aria-selected":mn.isSelected(e.id),tabIndex:0,"data-grid-item":"","data-grid-id":e.id,onClick:n=>yn(e.id,n),onDoubleClick:()=>bl(e.id),onContextMenu:n=>Fn(e.id,n),draggable:!!fl(e)||void 0,onDragStart:fl(e)?n=>{n.dataTransfer.effectAllowed="link",n.dataTransfer.setData(X,fl(e)),hl("start",e.id)}:void 0,onDragEnd:fl(e)?n=>hl("none"===n.dataTransfer.dropEffect?"cancelled":"dropped",e.id):void 0,onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),yn(e.id,n))},className:"flex h-12 cursor-pointer items-center gap-3 rounded-md px-2 text-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(mn.isSelected(e.id)?"bg-accent-tint text-blue-700":"text-ink hover:bg-gray-100"),children:[
8
+ /* @__PURE__ */G("img",{src:e.thumbUrl??e.url,alt:"",className:"h-10 w-10 shrink-0 rounded bg-gray-100 object-contain"}),
9
+ /* @__PURE__ */G("span",{className:"min-w-0 flex-1 truncate",children:e.name}),
10
+ /* @__PURE__ */G("span",{className:"flex shrink-0 items-center gap-1",children:tl(e)}),e.sizeLabel&&/* @__PURE__ */G("span",{className:"w-16 shrink-0 text-right text-xs text-ink-faint",children:e.sizeLabel})]},e.id))}):/* @__PURE__ */G(h,{items:gl,readOnly:!Wn||Ke,onFiles:Wn&&!Ke?e=>xe(e,on):void 0,accept:ke,maxSizeBytes:ye,busy:be,progress:we,fit:"contain",thumbSize:vl,dragType:ol?Y:dl?X:void 0,onDragOutChange:dl?(e,n)=>hl(e,n):void 0,selected:mn.selected,onItemClick:yn,onItemDoubleClick:bl,onItemContextMenu:He?Fn:void 0,menuOnMedia:He})),Cl=u({count:pn.length,kind:In(pn),targets:Cn({kind:"files",ids:pn}),onPick:e=>Ie?.({kind:"files",ids:pn},e.key===s?null:e.key)}),Il=M({variant:"secondary",size:"sm"}),Dl=/* @__PURE__ */G(I,{align:"start",triggerClassName:Il,trigger:/* @__PURE__ */J(V,{children:[W.folder,Ue.moveTo]}),items:Cl,disabled:!!ve.move}),Sl=He&&pn.length>1&&!an?/* @__PURE__ */J("div",{"data-media-bulk":"",className:"flex flex-wrap items-center gap-2 rounded-lg border border-line px-3 py-2",children:[
11
+ /* @__PURE__ */G(b,{checked:pn.length===te.length,indeterminate:pn.length<te.length,onChange:e=>e?mn.selectAll():mn.clear(),label:Ue.selected(pn.length)}),/* @__PURE__ */J(V,rn?{children:[je&&/* @__PURE__ */G(L,{variant:"secondary",size:"sm",leftIcon:W.undo,onClick:()=>je(pn),...el(ve.restore),children:Ue.restore}),ze&&/* @__PURE__ */G(L,{variant:"secondary-danger",size:"sm",onClick:()=>ze(pn),...el(ve.deleteForever),children:Ue.deleteForever})]}:{children:[Ie&&Dl,Ce&&/* @__PURE__ */G(L,{variant:"secondary",size:"sm",leftIcon:W.edit,disabled:!0,children:Ue.rename}),De&&/* @__PURE__ */G(L,{variant:"secondary",size:"sm",leftIcon:W.trash,onClick:()=>De({kind:"files",ids:pn}),...el(ve.trash),children:Ue.moveFilesToTrash(pn.length)})]}),
12
+ /* @__PURE__ */G(L,{variant:"ghost",size:"sm",onClick:mn.clear,children:Ue.clearSelection})]}):null,jl=e=>{const n=[],l=(e,l,a)=>{null!=a&&""!==a&&n.push({key:e,label:l,value:a})},a="file"===bn?.kind&&bn.id===e.id;l("name",Ue.name,a?/* @__PURE__ */G(m,{value:e.name,label:Ue.fileName,onDone:xn}):e.name),l("type",Ue.type,e.typeLabel),l("size",Ue.size,e.sizeLabel),l("resolution",Ue.resolution,e.resolution),an?(l("design",Ue.design,e.design),l("finish",Ue.finish,e.finish),l("angle",Ue.angleLug,e.angleLug),l("owner",Ue.owner,e.owner)):(l("added",Ue.addedBy,e.addedBy),l("folder",Ue.folder,e.folderPath)),l("used",Ue.usedIn,null!=e.usedCount?Ue.places(e.usedCount):void 0);const r=c({kind:"files",ids:[e.id]},jn).find(e=>"submenu"===e.type);/* @__PURE__ */
13
+ return J("div",{"data-media-details":"",className:"flex flex-col gap-3",children:[
14
+ /* @__PURE__ */G("img",{src:e.url,alt:e.name,className:"aspect-square w-full rounded-lg bg-gray-100 object-contain"}),an&&/* @__PURE__ */G(N,{tone:"neutral",title:Ue.readOnlyBadge,children:sn(dn)}),
15
+ /* @__PURE__ */G(t,{size:"sm",columns:1,items:n}),!rn&&/* @__PURE__ */J("div",{className:"flex gap-2",children:[
16
+ /* @__PURE__ */G("div",{style:{flex:"1 1 0",minWidth:0},children:/* @__PURE__ */G(C,{size:"sm",readOnly:!0,value:e.url,"aria-label":Ue.fileUrl,onFocus:e=>e.currentTarget.select()})}),
17
+ /* @__PURE__ */G(L,{variant:"secondary",size:"sm",leftIcon:W.copy,onClick:()=>jn.copyUrl(e.id),children:Ue.copyUrl})]}),tn&&He&&/* @__PURE__ */J("div",{className:"flex flex-wrap gap-2",children:[Fe&&/* @__PURE__ */G(L,{variant:"secondary",size:"sm",leftIcon:W.swap,onClick:()=>Fe(e.id),...el(ve.replace),children:Ue.replace}),Le&&/* @__PURE__ */G(L,{variant:"secondary",size:"sm",leftIcon:W.crop,onClick:()=>Le(e.id),children:Ue.cropEdit}),Ie&&"submenu"===r?.type&&/* @__PURE__ */G(I,{align:"start",triggerClassName:Il,trigger:/* @__PURE__ */J(V,{children:[W.folder,Ue.moveTo]}),items:r.items,disabled:!!ve.move}),Ce&&/* @__PURE__ */G(L,{variant:"secondary",size:"sm",leftIcon:W.edit,onClick:()=>wn({kind:"file",id:e.id}),...el(ve.rename),children:Ue.rename}),De&&/* @__PURE__ */G(D,{"aria-label":Ue.moveToTrash,size:"sm",onClick:()=>De({kind:"files",ids:[e.id]}),disabledReason:ve.trash,"aria-disabled":!!ve.trash||void 0,children:W.trash})]}),rn&&He&&/* @__PURE__ */J("div",{className:"flex flex-wrap gap-2",children:[je&&/* @__PURE__ */G(L,{variant:"primary",size:"sm",leftIcon:W.undo,onClick:()=>je([e.id]),...el(ve.restore),children:Ue.restore}),ze&&/* @__PURE__ */G(L,{variant:"danger",size:"sm",onClick:()=>ze([e.id]),...el(ve.deleteForever),children:Ue.deleteForever})]}),an&&Oe&&/* @__PURE__ */G(L,{variant:"secondary",size:"sm",leftIcon:W.external,onClick:()=>Oe({kind:"render",id:e.id}),children:Ue.openInDesign}),ge&&/* @__PURE__ */G(f,{items:ge})]})},zl=hn?hn.private?Ue.privateNoPick:hn.pickDisabledReason:void 0,Tl=Ke?/* @__PURE__ */J("div",{"data-media-picker-footer":"",className:"flex flex-wrap items-center justify-between gap-2 border-t border-line px-3 py-2",children:[
18
+ /* @__PURE__ */G("span",{className:"min-w-0 truncate text-sm text-ink-faint",children:hn?Ue.oneChosen(hn.name):Ue.noneChosen}),
19
+ /* @__PURE__ */J("div",{className:"flex gap-2",children:[Me&&/* @__PURE__ */G(L,{variant:"secondary",size:"sm",onClick:Me,children:Ue.cancel}),
20
+ /* @__PURE__ */G(L,{variant:"primary",size:"sm",disabled:!hn,...el(zl),onClick:()=>{hn&&!zl&&Ee?.(hn)},children:Ue.chooseImage})]})]}):null,Fl=He&&!!hn,Ll=/* @__PURE__ */J("div",{className:"flex min-w-0 flex-col gap-3",children:[Re&&/* @__PURE__ */G(N,{tone:"neutral",children:Re}),
21
+ /* @__PURE__ */J("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[
22
+ /* @__PURE__ */G(d,{items:Qn}),nl]}),rl,Sl,
23
+ /* @__PURE__ */J("div",{ref:kl,className:"relative",onPointerDown:yl.onPointerDown,onKeyDown:e=>{He&&(e.ctrlKey||e.metaKey)&&"a"===e.key.toLowerCase()?(e.preventDefault(),mn.selectAll()):"Escape"===e.key&&mn.size&&mn.clear()},children:[Nl,
24
+ /* @__PURE__ */G(a,{rect:yl.rect})]}),Wn&&/* @__PURE__ */G("input",{...qn.inputProps}),
25
+ /* @__PURE__ */G(j,{rejections:qn.rejections})]});/* @__PURE__ */
26
+ return J("div",{ref:Je,"data-media-library":"","data-layout":Ge?"phone":"wide",className:`flex h-full min-h-0 min-w-0 flex-col ${Pe}`.trim(),children:[/* @__PURE__ */J("div",Ge?{className:"flex flex-col gap-3 p-3",children:[Xn,Ll]}:{className:"flex min-h-0 min-w-0 flex-1",children:[
27
+ /* @__PURE__ */G("div",{className:"shrink-0 overflow-y-auto border-r border-line p-3",style:{width:280,"--rosh-tree-ground":"var(--surface)"},children:Xn}),
28
+ /* @__PURE__ */G("div",{className:"min-w-0 flex-1 overflow-y-auto p-3",children:Ll}),Fl&&/* @__PURE__ */G("div",{className:"shrink-0 overflow-y-auto border-l border-line p-3",style:{width:300},children:jl(hn)})]}),Tl,Ge&&/* @__PURE__ */G(o,{open:Fl,onClose:mn.clear,side:"bottom",title:hn?.name,children:hn&&jl(hn)}),Tn.state&&/* @__PURE__ */G(x,{...Tn.props,items:zn(Tn.state.data)}),null!=Dn&&te.length>0&&/* @__PURE__ */G(i,{images:te.map(e=>({url:e.url,caption:e.name})),startIndex:Math.min(Dn,te.length-1),onClose:()=>Sn(null)})]})}export{Y as MEDIA_FILES_DRAG_TYPE,X as MEDIA_FILE_DRAG_TYPE,Z as MEDIA_FOLDER_DRAG_TYPE,_ as MediaLibrary,Q as readMediaFileDrag};
@@ -0,0 +1 @@
1
+ import{useEffect as t,useSyncExternalStore as e}from"react";var a=/* @__PURE__ */new Set,d=/* @__PURE__ */new Set;function n(t,e){t&&a.has(t)!==e&&(e?a.add(t):a.delete(t),d.forEach(t=>t()))}function r(t){return t?.closest("[data-modal-panel]")?.getAttribute("data-modal-id")??""}function o(r){return t(()=>()=>n(r,!1),[r]),e(t=>(d.add(t),()=>{d.delete(t)}),()=>a.has(r),()=>!1)}export{r as modalIdHolding,n as setModalDragAside,o as useModalDragAside};
@@ -1,22 +1,22 @@
1
- import{ChartBrush as t}from"./chunk-TU2L7NW3.js";import{ChartDot as e}from"./chunk-CK2YOGUS.js";import{stepPath as a,curvePath as r,areaBetween as o,areaFrom as l}from"./chunk-VFC6QUEN.js";import{ChartDefs as n,MOTION as i,stagger as s,fillFor as c,dashFor as d,maskId as m}from"./chunk-465RRWBY.js";import{ChartSkeleton as h}from"./chunk-WXZZGHET.js";import{useHighlight as u,highlightOpacity as f}from"./chunk-CNYAHYE6.js";import{useDragZoom as p,DragBand as g,ChartZoomSummary as y,tooltipBesideBand as k}from"./chunk-2DYVVHZA.js";import{usePlotWidth as x}from"./chunk-MAFUXCPZ.js";import{pairedAxes as v,niceAxis as b,niceMax as M,linearScale as N,axisGutter as w,bandScale as j,ladderScale as $}from"./chunk-2JWPNR2U.js";import{ChartTooltip as V}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as A,CHART_INK as W,STATUS_VARS as z}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as L}from"./chunk-TWVUQUUD.js";import{useShellStrings as S,useShellLocale as D}from"./chunk-JSHMIMAJ.js";import{formatPercent as E,formatPlain as R}from"./chunk-C3QOHMR6.js";import{useRef as C,useState as T,useId as U,useEffect as I}from"react";import{jsx as P,jsxs as F}from"react/jsx-runtime";var H=12,O=16,Y=26,Z=52,B=t=>"number"==typeof t&&Number.isFinite(t);function Q({series:Q,labels:J,height:G=200,stacked:K=!1,stackMode:X="value",levels:q,curve:_="linear",tension:tt=0,max:et,yTickCount:at=4,formatValue:rt,formatTooltipValue:ot,tooltipLabels:lt,yAxisLabel:nt,referenceLines:it,labelEndpoints:st=!1,dots:ct,dotVariant:dt="border",pulse:mt=!1,brush:ht=!1,range:ut,onRangeChange:ft,zoomable:pt=!0,columnStrip:gt,onSelect:yt,loading:kt=!1,animate:xt=!0,reveal:vt="left-to-right",fillVariant:bt="gradient",gridStyle:Mt="solid",width:Nt,className:wt,emptyLabel:jt}){const $t=S().charts,Vt=D(),At=rt??(t=>R(t,Vt)),Wt=ot??At,zt=jt??$t.noData,Lt=C(null),St=x(Lt),Dt=Nt??St,[Et,Rt]=T(null),[Ct,Tt]=T(null),{highlighted:Ut}=u(),It=U(),Pt=ut??Ct,Ft=p(ht&&Pt?Pt[1]-Pt[0]+1:J.length,pt);if(I(()=>{if(null!==Et)return L(t=>"Escape"===t.key&&(Rt(null),!0))},[Et]),kt)/* @__PURE__ */
2
- return P("div",{className:wt,ref:Lt,children:/* @__PURE__ */P(h,{height:G,width:Nt??St})});const Ht=J,Ot=ut??Ct??[0,Math.max(0,Ht.length-1)],[Yt,Zt]=Ot,Bt=t=>Ft.slice(ht?t.slice(Yt,Zt+1):t),Qt=lt?Bt(lt):void 0,Jt=Q.map((t,e)=>({...t,slot:e})).filter(t=>t.data.some(B)).map(t=>({...t,data:Bt(t.data),pointTones:t.pointTones?Bt(t.pointTones):void 0})),Gt=t=>(ht?Yt:0)+(Ft.view?.[0]??0)+t;if(J=Bt(Ht),0===Jt.length||0===J.length)/* @__PURE__ */
1
+ import{ChartDefs as t,MOTION as e,stagger as a,fillFor as r,dashFor as o,maskId as l}from"./chunk-465RRWBY.js";import{ChartBrush as n}from"./chunk-TU2L7NW3.js";import{ChartDot as i}from"./chunk-CK2YOGUS.js";import{ChartSkeleton as s}from"./chunk-WXZZGHET.js";import{stepPath as c,curvePath as d,areaBetween as m,areaFrom as h}from"./chunk-VFC6QUEN.js";import{useHighlight as u,highlightOpacity as f}from"./chunk-CNYAHYE6.js";import{useDragZoom as p,DragBand as g,ChartZoomSummary as y,tooltipBesideBand as k}from"./chunk-2DYVVHZA.js";import{usePlotWidth as x}from"./chunk-MAFUXCPZ.js";import{pairedAxes as v,niceAxis as b,niceMax as M,linearScale as N,axisGutter as w,bandScale as j,ladderScale as $}from"./chunk-2JWPNR2U.js";import{ChartTooltip as V}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as A,CHART_INK as W,STATUS_VARS as z}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as L}from"./chunk-TWVUQUUD.js";import{useShellStrings as S,useShellLocale as D}from"./chunk-JSHMIMAJ.js";import{formatPercent as E,formatPlain as R}from"./chunk-C3QOHMR6.js";import{useRef as C,useState as T,useId as U,useEffect as I}from"react";import{jsx as P,jsxs as F}from"react/jsx-runtime";var H=12,O=16,Y=26,Z=52,B=t=>"number"==typeof t&&Number.isFinite(t);function Q({series:Q,labels:J,height:G=200,stacked:K=!1,stackMode:X="value",levels:q,curve:_="linear",tension:tt=0,max:et,yTickCount:at=4,formatValue:rt,formatTooltipValue:ot,tooltipLabels:lt,yAxisLabel:nt,referenceLines:it,labelEndpoints:st=!1,dots:ct,dotVariant:dt="border",pulse:mt=!1,brush:ht=!1,range:ut,onRangeChange:ft,zoomable:pt=!0,columnStrip:gt,onSelect:yt,loading:kt=!1,animate:xt=!0,reveal:vt="left-to-right",fillVariant:bt="gradient",gridStyle:Mt="solid",width:Nt,className:wt,emptyLabel:jt}){const $t=S().charts,Vt=D(),At=rt??(t=>R(t,Vt)),Wt=ot??At,zt=jt??$t.noData,Lt=C(null),St=x(Lt),Dt=Nt??St,[Et,Rt]=T(null),[Ct,Tt]=T(null),{highlighted:Ut}=u(),It=U(),Pt=ut??Ct,Ft=p(ht&&Pt?Pt[1]-Pt[0]+1:J.length,pt);if(I(()=>{if(null!==Et)return L(t=>"Escape"===t.key&&(Rt(null),!0))},[Et]),kt)/* @__PURE__ */
2
+ return P("div",{className:wt,ref:Lt,children:/* @__PURE__ */P(s,{height:G,width:Nt??St})});const Ht=J,Ot=ut??Ct??[0,Math.max(0,Ht.length-1)],[Yt,Zt]=Ot,Bt=t=>Ft.slice(ht?t.slice(Yt,Zt+1):t),Qt=lt?Bt(lt):void 0,Jt=Q.map((t,e)=>({...t,slot:e})).filter(t=>t.data.some(B)).map(t=>({...t,data:Bt(t.data),pointTones:t.pointTones?Bt(t.pointTones):void 0})),Gt=t=>(ht?Yt:0)+(Ft.view?.[0]??0)+t;if(J=Bt(Ht),0===Jt.length||0===J.length)/* @__PURE__ */
3
3
  return P("div",{className:wt,ref:Lt,children:/* @__PURE__ */P("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:G},children:zt})});const Kt=J.map((t,e)=>Jt.reduce((t,a)=>t+(B(a.data[e])?a.data[e]:0),0)),Xt=(t,e)=>Kt[e]>0?t/Kt[e]:null,qt=[];if(K){let t=J.map(()=>0);for(const e of Jt)t=t.map((t,a)=>t+(B(e.data[a])?e.data[a]:0)),qt.push("percent"===X?t.map((t,e)=>Xt(t,e)):[...t])}const _t=!!q&&q.length>0,te=t=>"right"===t.axis,ee=!K&&!_t&&void 0===et&&Jt.some(te)&&Jt.some(t=>!te(t)),ae=gt&&!K?gt:null,re=t=>!!ae&&"column"===t.mode,oe=(ee?Jt.filter(t=>!te(t)):Jt).filter(t=>!re(t)),le=ee?Jt.filter(te).flatMap(t=>t.data.filter(B)):[],ne=K?(qt.at(-1)??[]).filter(B):oe.flatMap(t=>t.data.filter(B)),ie=ee?v([Math.min(0,...ne),Math.max(0,...ne)],[Math.min(0,...le),Math.max(0,...le)],{intervals:at+1,integerLeft:ne.every(Number.isInteger),integerRight:le.every(Number.isInteger)}):null,se=ie?ie.left:K&&"percent"===X||_t||void 0!==et?null:b(K?0:Math.min(0,...ne),Math.max(0,...ne),{intervals:at+1,integer:ne.every(Number.isInteger)}),ce=se?se.lo:0,de=K&&"percent"===X?1:se?se.hi:et??M(Math.max(...ne,0)),me=K&&"percent"===X?t=>E(Math.round(100*t),0,Vt):At,he=_t?q:se?se.ticks:N([ce,de],{from:0,to:1}).ticks(at+1),ue=w(he.map(me),Z),fe=ie?w(ie.right.ticks.map(At),O):O,pe={left:ue,right:Math.max(ue+1,Dt-fe),top:H,bottom:G-Y},ge=j(J.length,{from:pe.left,to:pe.right}),ye=_t?$(q,{from:pe.bottom,to:pe.top}):null,ke=N([ce,de],{from:pe.bottom,to:pe.top}),xe=ke(Math.max(ce,0)),ve=t=>ye?ye(t):ke(t),be=Jt.filter(re),Me=Math.max(0,...J.map((t,e)=>be.reduce((t,a)=>t+Math.max(0,B(a.data[e])?a.data[e]:0),0))),Ne=t=>xe-(Me>0?t/Me:0)*(pe.bottom-pe.top)*(ae??0),we=ie?N([ie.right.lo,ie.right.hi],{from:pe.bottom,to:pe.top}):null,je=t=>we&&te(t)?we:ve,$e=ye?ye.levels.map(t=>({value:t,y:ye(t)})):he.map(t=>({value:t,y:ke(t)})),Ve=t=>e=>{e.preventDefault(),Rt(e=>{const a=(e??0)+t;return Math.min(J.length-1,Math.max(0,a))})},Ae=Math.max(1,Math.ceil(J.length/Math.max(1,Math.floor(Dt/96))));/* @__PURE__ */
4
4
  return F("div",{className:`relative ${wt??""}`,ref:Lt,children:[
5
5
  /* @__PURE__ */F("svg",{width:"100%",height:G,viewBox:`0 0 ${Dt} ${G}`,role:"img","aria-label":$t.overIntervals(Jt.map(t=>t.label),J.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>Rt(null),onBlur:()=>Rt(null),style:pt?{userSelect:"none",touchAction:"pan-y"}:void 0,onKeyDown:t=>{if(yt&&null!==Et&&("Enter"===t.key||" "===t.key))return t.preventDefault(),void yt(Gt(Et));"ArrowRight"===t.key&&Ve(1)(t),"ArrowLeft"===t.key&&Ve(-1)(t)},children:[
6
6
  /* @__PURE__ */P("defs",{children:/* @__PURE__ */P("clipPath",{id:It,children:/* @__PURE__ */P("rect",{x:pe.left,y:pe.top,width:pe.right-pe.left,height:pe.bottom-pe.top})})}),
7
- /* @__PURE__ */P(n,{id:It,fills:Jt.map((t,e)=>({color:A(t.slot,t.color,t.tone),variant:t.fillVariant??bt})),fadeFrom:K?.42:.3,reveal:!!xt&&vt}),$e.map(t=>/* @__PURE__ */P("line",{x1:pe.left,y1:t.y,x2:pe.right,y2:t.y,stroke:W.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===Mt?"3 3":void 0},`grid-${t.value}`)),
7
+ /* @__PURE__ */P(t,{id:It,fills:Jt.map((t,e)=>({color:A(t.slot,t.color,t.tone),variant:t.fillVariant??bt})),fadeFrom:K?.42:.3,reveal:!!xt&&vt}),$e.map(t=>/* @__PURE__ */P("line",{x1:pe.left,y1:t.y,x2:pe.right,y2:t.y,stroke:W.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===Mt?"3 3":void 0},`grid-${t.value}`)),
8
8
  /* @__PURE__ */P("line",{x1:pe.left,y1:xe,x2:pe.right,y2:xe,stroke:W.axis,strokeWidth:1,shapeRendering:"crispEdges"}),$e.map(t=>/* @__PURE__ */P("text",{x:pe.left-8,y:t.y+4,textAnchor:"end","data-axis-tick":"true",fontSize:11,fill:W.label,style:{fontVariantNumeric:"tabular-nums"},children:me(t.value)},`ytick-${t.value}`)),ie&&$e.map((t,e)=>/* @__PURE__ */P("text",{x:pe.right+8,y:t.y+4,textAnchor:"start","data-axis-tick":"true",fontSize:11,fill:W.label,style:{fontVariantNumeric:"tabular-nums"},children:At(ie.right.ticks[e])},`ytick-r-${t.value}`)),nt&&/* @__PURE__ */P("text",{x:12,y:(pe.top+pe.bottom)/2,transform:`rotate(-90 12 ${(pe.top+pe.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:W.label,children:nt}),
9
- /* @__PURE__ */P("g",{clipPath:`url(#${It})`,mask:xt&&vt?`url(#${m(It)})`:void 0,children:Jt.map((t,e)=>{const n=A(t.slot,t.color,t.tone),m=t.mode??(K?"area":"line"),h=f(t.key,Ut);if("step"===m){const e=J.map((e,a)=>({start:ge(a),end:ge.end(a),value:t.data[a]})).filter(t=>B(t.value)).map(e=>({start:e.start,end:e.end,y:je(t)(e.value)}));/* @__PURE__ */
10
- return P("path",{d:a(e),fill:"none",stroke:n,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:h??void 0,className:"rosh-viz-mark"},t.key)}const u=J.map((a,r)=>{const o=K?qt[e]?.[r]:t.data[r];return B(o)?[ge.center(r),je(t)(o)]:null}).filter(t=>null!==t);if(0===u.length)return null;if("column"===m){const a=Math.max(1,.62*ge.bandwidth),r="solid"===t.fillVariant,o=je(t);return re(t)?/* @__PURE__ */P("g",{opacity:h??void 0,className:"rosh-viz-mark",children:J.map((o,l)=>{const i=t.data[l];if(!B(i)||i<=0)return null;const s=((t,e)=>be.slice(0,be.findIndex(e=>e.key===Jt[t]?.key)).reduce((t,a)=>t+Math.max(0,B(a.data[e])?a.data[e]:0),0))(e,l),c=Ne(s+i),d=Ne(s)-(s>0?1:0);/* @__PURE__ */
11
- return P("rect",{x:ge.center(l)-a/2,y:c,width:a,height:Math.max(0,d-c),rx:2,fill:t.pointTones?.[l]?z[t.pointTones[l]]:n,fillOpacity:r?1:.55},l)})},t.key):/* @__PURE__ */P("g",{opacity:h??void 0,className:"rosh-viz-mark",children:J.map((l,c)=>{const d=K?qt[e]?.[c]:t.data[c];if(!B(d))return null;const m=o(d);/* @__PURE__ */
12
- return P("rect",{x:ge.center(c)-a/2,y:Math.min(m,xe),width:a,height:Math.abs(xe-m),rx:2,fill:n,fillOpacity:r?1:.35,className:xt?i.rise:void 0,style:xt?s(c,26):void 0},c)})},t.key)}const p=r(u,_,tt),g=K&&e>0?J.map((t,a)=>[ge.center(a),ve(qt[e-1]?.[a]??0)-2]):null,y=g?o(p,g):l(p,u,xe);/* @__PURE__ */
13
- return F("g",{opacity:h??void 0,className:"rosh-viz-mark",children:[("area"===m||K)&&
14
- /* @__PURE__ */P("path",{d:y,fill:c(It,e,t.fillVariant??bt,n),stroke:"none"}),
15
- /* @__PURE__ */P("path",{d:p,fill:"none",stroke:n,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:d(t.stroke??(t.forecast?"animated-dashed":"solid")),className:xt&&("animated-dashed"===t.stroke||t.forecast&&!t.stroke)?i.march:void 0})]},t.key)})}),it?.map((t,e)=>{const a=t.color??z[t.tone??"critical"],r=ve(t.value);/* @__PURE__ */
9
+ /* @__PURE__ */P("g",{clipPath:`url(#${It})`,mask:xt&&vt?`url(#${l(It)})`:void 0,children:Jt.map((t,l)=>{const n=A(t.slot,t.color,t.tone),i=t.mode??(K?"area":"line"),s=f(t.key,Ut);if("step"===i){const e=J.map((e,a)=>({start:ge(a),end:ge.end(a),value:t.data[a]})).filter(t=>B(t.value)).map(e=>({start:e.start,end:e.end,y:je(t)(e.value)}));/* @__PURE__ */
10
+ return P("path",{d:c(e),fill:"none",stroke:n,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:s??void 0,className:"rosh-viz-mark"},t.key)}const u=J.map((e,a)=>{const r=K?qt[l]?.[a]:t.data[a];return B(r)?[ge.center(a),je(t)(r)]:null}).filter(t=>null!==t);if(0===u.length)return null;if("column"===i){const r=Math.max(1,.62*ge.bandwidth),o="solid"===t.fillVariant,i=je(t);return re(t)?/* @__PURE__ */P("g",{opacity:s??void 0,className:"rosh-viz-mark",children:J.map((e,a)=>{const i=t.data[a];if(!B(i)||i<=0)return null;const s=((t,e)=>be.slice(0,be.findIndex(e=>e.key===Jt[t]?.key)).reduce((t,a)=>t+Math.max(0,B(a.data[e])?a.data[e]:0),0))(l,a),c=Ne(s+i),d=Ne(s)-(s>0?1:0);/* @__PURE__ */
11
+ return P("rect",{x:ge.center(a)-r/2,y:c,width:r,height:Math.max(0,d-c),rx:2,fill:t.pointTones?.[a]?z[t.pointTones[a]]:n,fillOpacity:o?1:.55},a)})},t.key):/* @__PURE__ */P("g",{opacity:s??void 0,className:"rosh-viz-mark",children:J.map((s,c)=>{const d=K?qt[l]?.[c]:t.data[c];if(!B(d))return null;const m=i(d);/* @__PURE__ */
12
+ return P("rect",{x:ge.center(c)-r/2,y:Math.min(m,xe),width:r,height:Math.abs(xe-m),rx:2,fill:n,fillOpacity:o?1:.35,className:xt?e.rise:void 0,style:xt?a(c,26):void 0},c)})},t.key)}const p=d(u,_,tt),g=K&&l>0?J.map((t,e)=>[ge.center(e),ve(qt[l-1]?.[e]??0)-2]):null,y=g?m(p,g):h(p,u,xe);/* @__PURE__ */
13
+ return F("g",{opacity:s??void 0,className:"rosh-viz-mark",children:[("area"===i||K)&&
14
+ /* @__PURE__ */P("path",{d:y,fill:r(It,l,t.fillVariant??bt,n),stroke:"none"}),
15
+ /* @__PURE__ */P("path",{d:p,fill:"none",stroke:n,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:o(t.stroke??(t.forecast?"animated-dashed":"solid")),className:xt&&("animated-dashed"===t.stroke||t.forecast&&!t.stroke)?e.march:void 0})]},t.key)})}),it?.map((t,e)=>{const a=t.color??z[t.tone??"critical"],r=ve(t.value);/* @__PURE__ */
16
16
  return F("g",{children:[
17
- /* @__PURE__ */P("line",{x1:pe.left,y1:r,x2:pe.right,y2:r,stroke:a,strokeWidth:1,strokeDasharray:"5 4"}),t.label&&/* @__PURE__ */P("text",{x:pe.right-4,y:r-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:a,children:t.label})]},`rule-${e}`)}),"none"!==(ct??(st?"last":"none"))&&Jt.map((t,a)=>{if("column"===t.mode)return null;const r=ct??(st?"last":"none"),o=A(t.slot,t.color,t.tone),l=[...t.data].map(B).lastIndexOf(!0),n="all"===r?J.map((t,e)=>e).filter(e=>B(K?qt[a]?.[e]:t.data[e])):l>=0?[l]:[];/* @__PURE__ */
18
- return F("g",{children:[n.map(r=>{const n=K?qt[a]?.[r]:t.data[r];return B(n)?/* @__PURE__ */P(e,{cx:ge.center(r),cy:je(t)(n),color:o,variant:dt,pulse:mt&&r===l,title:`${J[r]}: ${t.label} ${At(n)}`},r):null}),st&&l>=0&&B(K?qt[a]?.[l]:t.data[l])&&/* @__PURE__ */P("text",{x:ge.center(l)-10,y:je(t)(K?qt[a]?.[l]:t.data[l])-9,textAnchor:"end",fontSize:12,fontWeight:600,fill:W.label,style:{fontVariantNumeric:"tabular-nums"},children:At(K?qt[a]?.[l]:t.data[l])})]},`dots-${t.key}`)}),J.map((t,e)=>e%Ae===0?/* @__PURE__ */P("text",{x:ge.center(e),y:G-8,textAnchor:"middle",fontSize:11,fill:W.label,style:{fontVariantNumeric:"tabular-nums"},children:t},`xtick-${e}`):null),null!==Et&&/* @__PURE__ */P("line",{x1:ge.center(Et),y1:pe.top,x2:ge.center(Et),y2:pe.bottom,stroke:W.axis,strokeWidth:1}),ae&&Me>0&&
17
+ /* @__PURE__ */P("line",{x1:pe.left,y1:r,x2:pe.right,y2:r,stroke:a,strokeWidth:1,strokeDasharray:"5 4"}),t.label&&/* @__PURE__ */P("text",{x:pe.right-4,y:r-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:a,children:t.label})]},`rule-${e}`)}),"none"!==(ct??(st?"last":"none"))&&Jt.map((t,e)=>{if("column"===t.mode)return null;const a=ct??(st?"last":"none"),r=A(t.slot,t.color,t.tone),o=[...t.data].map(B).lastIndexOf(!0),l="all"===a?J.map((t,e)=>e).filter(a=>B(K?qt[e]?.[a]:t.data[a])):o>=0?[o]:[];/* @__PURE__ */
18
+ return F("g",{children:[l.map(a=>{const l=K?qt[e]?.[a]:t.data[a];return B(l)?/* @__PURE__ */P(i,{cx:ge.center(a),cy:je(t)(l),color:r,variant:dt,pulse:mt&&a===o,title:`${J[a]}: ${t.label} ${At(l)}`},a):null}),st&&o>=0&&B(K?qt[e]?.[o]:t.data[o])&&/* @__PURE__ */P("text",{x:ge.center(o)-10,y:je(t)(K?qt[e]?.[o]:t.data[o])-9,textAnchor:"end",fontSize:12,fontWeight:600,fill:W.label,style:{fontVariantNumeric:"tabular-nums"},children:At(K?qt[e]?.[o]:t.data[o])})]},`dots-${t.key}`)}),J.map((t,e)=>e%Ae===0?/* @__PURE__ */P("text",{x:ge.center(e),y:G-8,textAnchor:"middle",fontSize:11,fill:W.label,style:{fontVariantNumeric:"tabular-nums"},children:t},`xtick-${e}`):null),null!==Et&&/* @__PURE__ */P("line",{x1:ge.center(Et),y1:pe.top,x2:ge.center(Et),y2:pe.bottom,stroke:W.axis,strokeWidth:1}),ae&&Me>0&&
19
19
  /* @__PURE__ */F("g",{pointerEvents:"none","data-column-strip":"true",children:[
20
20
  /* @__PURE__ */P("line",{x1:pe.left,y1:Ne(Me),x2:pe.right,y2:Ne(Me),stroke:W.grid,strokeWidth:1,strokeDasharray:"2 3",shapeRendering:"crispEdges"}),
21
- /* @__PURE__ */P("text",{x:pe.left+4,y:Ne(Me)-4,fontSize:11,fill:W.label,style:{fontVariantNumeric:"tabular-nums"},children:At(Me)})]}),Ft.drag&&/* @__PURE__ */P(g,{x0:ge(Ft.drag[0]),x1:ge(Ft.drag[1])+ge.bandwidth,top:pe.top,bottom:pe.bottom}),J.map((t,e)=>/* @__PURE__ */P("rect",{x:ge(e),y:pe.top,width:Math.max(1,ge.bandwidth),height:pe.bottom-pe.top,fill:"transparent",onMouseEnter:()=>Rt(e),onPointerDown:()=>Ft.press(e),onPointerEnter:()=>Ft.over(e),onPointerUp:Ft.release,onClick:yt?()=>yt(Gt(e)):void 0,style:yt?{cursor:"pointer"}:void 0},`hit-${e}`))]}),Ft.view&&/* @__PURE__ */P(y,{from:Qt?.[0]??J[0],to:Qt?.at(-1)??J[J.length-1],count:J.length,total:K&&"percent"!==X?Wt(Kt.reduce((t,e)=>t+e,0)):ae?Wt(be.reduce((t,e)=>t+e.data.filter(B).reduce((t,e)=>t+e,0),0)):void 0,rows:(ae?be:Jt).filter(t=>t.data.some(B)).map(t=>{const e=t.data.filter(B),a=A(t.slot,t.color,t.tone);if(0===e.length)return{key:t.key,label:t.label,color:a,value:"—"};const r=e.reduce((t,e)=>t+e,0),o=K||"column"===t.mode?Wt(r):$t.zoomLevel(Wt(r/e.length),Wt(Math.max(...e)));return{key:t.key,label:t.label,color:a,value:o}}),onClear:Ft.clear}),ht&&Ht.length>2&&/* @__PURE__ */P(t,{className:"mt-1",labels:Ht,width:Dt,data:Q[0]?.data??[],range:Ot,onRangeChange:t=>{ft?ft(t):Tt(t)}}),null!==Et&&
21
+ /* @__PURE__ */P("text",{x:pe.left+4,y:Ne(Me)-4,fontSize:11,fill:W.label,style:{fontVariantNumeric:"tabular-nums"},children:At(Me)})]}),Ft.drag&&/* @__PURE__ */P(g,{x0:ge(Ft.drag[0]),x1:ge(Ft.drag[1])+ge.bandwidth,top:pe.top,bottom:pe.bottom}),J.map((t,e)=>/* @__PURE__ */P("rect",{x:ge(e),y:pe.top,width:Math.max(1,ge.bandwidth),height:pe.bottom-pe.top,fill:"transparent",onMouseEnter:()=>Rt(e),onPointerDown:()=>Ft.press(e),onPointerEnter:()=>Ft.over(e),onPointerUp:Ft.release,onClick:yt?()=>yt(Gt(e)):void 0,style:yt?{cursor:"pointer"}:void 0},`hit-${e}`))]}),Ft.view&&/* @__PURE__ */P(y,{from:Qt?.[0]??J[0],to:Qt?.at(-1)??J[J.length-1],count:J.length,total:K&&"percent"!==X?Wt(Kt.reduce((t,e)=>t+e,0)):ae?Wt(be.reduce((t,e)=>t+e.data.filter(B).reduce((t,e)=>t+e,0),0)):void 0,rows:(ae?be:Jt).filter(t=>t.data.some(B)).map(t=>{const e=t.data.filter(B),a=A(t.slot,t.color,t.tone);if(0===e.length)return{key:t.key,label:t.label,color:a,value:"—"};const r=e.reduce((t,e)=>t+e,0),o=K||"column"===t.mode?Wt(r):$t.zoomLevel(Wt(r/e.length),Wt(Math.max(...e)));return{key:t.key,label:t.label,color:a,value:o}}),onClear:Ft.clear}),ht&&Ht.length>2&&/* @__PURE__ */P(n,{className:"mt-1",labels:Ht,width:Dt,data:Q[0]?.data??[],range:Ot,onRangeChange:t=>{ft?ft(t):Tt(t)}}),null!==Et&&
22
22
  /* @__PURE__ */P("div",{className:"pointer-events-none absolute top-2 z-10",style:k(ge.center(Et),ge.bandwidth,Dt),children:/* @__PURE__ */P(V,{title:Qt?.[Et]??J[Et],rows:Jt.map((t,e)=>({key:t.key,label:t.label,color:A(t.slot,t.color,t.tone),value:B(t.data[Et])?K&&"percent"===X?`${E(100*(Xt(t.data[Et],Et)??0),1,Vt)} · ${Wt(t.data[Et])}`:Wt(t.data[Et]):void 0})),footnote:K&&"percent"===X?$t.inBucket(Wt(Kt[Et])):void 0})})]})}export{Q as TimeSeriesChart};
@@ -1,4 +1,4 @@
1
- import{Modal as e}from"./chunk-XQNZJNEJ.js";import{keepsNativeMenu as a}from"./chunk-5QFPTDQF.js";import{jsx as i,jsxs as n}from"react/jsx-runtime";var t={activeOpacity:70,inactiveOpacity:50,activeBlur:0,inactiveBlur:0};function r(e){try{const a=JSON.parse(localStorage.getItem(e)||"");return null!=a.blur&&null==a.activeBlur&&(a.activeBlur=a.blur,a.inactiveBlur=a.blur,delete a.blur),{...t,...a}}catch{return t}}function l({open:t,onClose:r,title:l,appearance:c,onAppearanceChange:s,onSave:d,children:o}){if(!t)return null;const u="w-full h-1.5 rounded-full appearance-none bg-gray-200 cursor-pointer accent-blue-500",p="flex items-center justify-between text-xs text-gray-500";/* @__PURE__ */
1
+ import{Modal as e}from"./chunk-KZRZYLN7.js";import{keepsNativeMenu as a}from"./chunk-5QFPTDQF.js";import{jsx as i,jsxs as n}from"react/jsx-runtime";var t={activeOpacity:70,inactiveOpacity:50,activeBlur:0,inactiveBlur:0};function r(e){try{const a=JSON.parse(localStorage.getItem(e)||"");return null!=a.blur&&null==a.activeBlur&&(a.activeBlur=a.blur,a.inactiveBlur=a.blur,delete a.blur),{...t,...a}}catch{return t}}function l({open:t,onClose:r,title:l,appearance:c,onAppearanceChange:s,onSave:d,children:o}){if(!t)return null;const u="w-full h-1.5 rounded-full appearance-none bg-gray-200 cursor-pointer accent-blue-500",p="flex items-center justify-between text-xs text-gray-500";/* @__PURE__ */
2
2
  return i("div",{onPointerDown:e=>e.stopPropagation(),onContextMenu:e=>{e.stopPropagation(),a(e.target)||e.preventDefault()},children:/* @__PURE__ */i(e,{open:t,onClose:r,title:l,size:"sm",children:/* @__PURE__ */n("div",{className:"space-y-4",children:[o,
3
3
  /* @__PURE__ */n("div",{children:[
4
4
  /* @__PURE__ */i("h3",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Appearance"}),
@@ -1,14 +1,14 @@
1
- import{AccessibleTable as e}from"./chunk-HY6CBG4M.js";import{polygonPoints as t}from"./chunk-VFC6QUEN.js";import{ChartDefs as r,maskId as l}from"./chunk-465RRWBY.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{angleScale as o}from"./chunk-2JWPNR2U.js";import{ChartTooltip as n}from"./chunk-WDQI3FV6.js";import{CHART_INK as i,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{useShellStrings as m,useShellLocale as c}from"./chunk-JSHMIMAJ.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useId as p,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var k=3,g=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function x({axes:k,series:x,size:y=300,mode:b="area",grid:M="polygon",rings:v=4,formatValue:N,animate:j=!0,className:$,emptyLabel:C}){const W=m().charts,F=c(),w=N??(e=>h(e,F)),A=C??W.nothingToCompare,R=p(),[H,L]=u(null),{highlighted:Y}=a(),z=x;if(k.length<3||0===z.length)/* @__PURE__ */
1
+ import{AccessibleTable as e}from"./chunk-HY6CBG4M.js";import{ChartDefs as t,maskId as r}from"./chunk-465RRWBY.js";import{polygonPoints as l}from"./chunk-VFC6QUEN.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{angleScale as o}from"./chunk-2JWPNR2U.js";import{ChartTooltip as n}from"./chunk-WDQI3FV6.js";import{CHART_INK as i,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{useShellStrings as m,useShellLocale as c}from"./chunk-JSHMIMAJ.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useId as p,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var k=3,g=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function x({axes:k,series:x,size:y=300,mode:b="area",grid:M="polygon",rings:v=4,formatValue:N,animate:j=!0,className:$,emptyLabel:C}){const W=m().charts,F=c(),w=N??(e=>h(e,F)),A=C??W.nothingToCompare,R=p(),[H,L]=u(null),{highlighted:Y}=a(),z=x;if(k.length<3||0===z.length)/* @__PURE__ */
2
2
  return d("p",{className:`text-sm text-gray-500 ${$??""}`,children:A});const B=y/2,E=y/2,J=y/2-46,Q=o(k.length),S=k.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...z.map(e=>e.values[t]??0).filter(Number.isFinite))),T=(e,t)=>{const r=Math.max(0,Math.min(1,t/S[e])),l=Q.center(e)-Q.step/2;return[B+J*r*Math.cos(l),E+J*r*Math.sin(l)]},U=(e,t)=>null!==H?H!==e:null!==Y&&Y!==t,V=null!==H?z[H]:void 0;/* @__PURE__ */
3
3
  return f("div",{className:`relative ${$??""}`,children:[
4
4
  /* @__PURE__ */f("svg",{width:"100%",height:y,viewBox:`0 0 ${y} ${y}`,role:"img","aria-labelledby":R,onMouseLeave:()=>L(null),children:[
5
- /* @__PURE__ */d("title",{id:R,children:W.acrossMeasures(z.map(e=>e.label),k.length)}),Array.from({length:v},(e,r)=>{const l=J*(r+1)/v;return"circle"===M?/* @__PURE__ */d("circle",{cx:B,cy:E,r:l,fill:"none",stroke:i.grid,strokeWidth:1},r):/* @__PURE__ */d("path",{d:g(t(B,E,l,k.length)),fill:"none",stroke:i.grid,strokeWidth:1},r)}),k.map((e,t)=>{const[r,l]=T(t,S[t]);/* @__PURE__ */
5
+ /* @__PURE__ */d("title",{id:R,children:W.acrossMeasures(z.map(e=>e.label),k.length)}),Array.from({length:v},(e,t)=>{const r=J*(t+1)/v;return"circle"===M?/* @__PURE__ */d("circle",{cx:B,cy:E,r:r,fill:"none",stroke:i.grid,strokeWidth:1},t):/* @__PURE__ */d("path",{d:g(l(B,E,r,k.length)),fill:"none",stroke:i.grid,strokeWidth:1},t)}),k.map((e,t)=>{const[r,l]=T(t,S[t]);/* @__PURE__ */
6
6
  return f("g",{children:[
7
7
  /* @__PURE__ */d("line",{x1:B,y1:E,x2:r,y2:l,stroke:i.grid,strokeWidth:1}),
8
8
  /* @__PURE__ */d("text",{x:B+(J+18)*Math.cos(Q.center(t)-Q.step/2),y:E+(J+18)*Math.sin(Q.center(t)-Q.step/2)+4,textAnchor:"middle",fontSize:11,fill:i.label,children:e.label})]},e.key)}),
9
- /* @__PURE__ */d(r,{id:R,reveal:!!j&&"center-out"}),z.map((e,t)=>{const r=s(t,3,e.color,e.tone),a=k.map((t,r)=>T(r,e.values[r]??0));/* @__PURE__ */
10
- return f("g",{opacity:U(t,e.key)?.3:1,onMouseEnter:()=>L(t),mask:j?`url(#${l(R)})`:void 0,children:["area"===b&&/* @__PURE__ */d("path",{d:g(a),fill:r,fillOpacity:.18,stroke:"none"}),
11
- /* @__PURE__ */d("path",{d:g(a),fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round"}),a.map(([e,t],l)=>/* @__PURE__ */d("circle",{cx:e,cy:t,r:3.5,fill:r,stroke:i.surface,strokeWidth:1.5},l))]},e.key)})]}),V&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:V.label,rows:k.map((e,t)=>({key:e.key,label:e.label,color:s(H,3,V.color,V.tone),value:w(V.values[t]??0)}))})}),
9
+ /* @__PURE__ */d(t,{id:R,reveal:!!j&&"center-out"}),z.map((e,t)=>{const l=s(t,3,e.color,e.tone),a=k.map((t,r)=>T(r,e.values[r]??0));/* @__PURE__ */
10
+ return f("g",{opacity:U(t,e.key)?.3:1,onMouseEnter:()=>L(t),mask:j?`url(#${r(R)})`:void 0,children:["area"===b&&/* @__PURE__ */d("path",{d:g(a),fill:l,fillOpacity:.18,stroke:"none"}),
11
+ /* @__PURE__ */d("path",{d:g(a),fill:"none",stroke:l,strokeWidth:2,strokeLinejoin:"round"}),a.map(([e,t],r)=>/* @__PURE__ */d("circle",{cx:e,cy:t,r:3.5,fill:l,stroke:i.surface,strokeWidth:1.5},r))]},e.key)})]}),V&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:V.label,rows:k.map((e,t)=>({key:e.key,label:e.label,color:s(H,3,V.color,V.tone),value:w(V.values[t]??0)}))})}),
12
12
  /* @__PURE__ */d("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:z.map((e,t)=>/* @__PURE__ */f("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
13
13
  /* @__PURE__ */d("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:s(t,3,e.color,e.tone)}}),
14
14
  /* @__PURE__ */d("span",{className:"flex-1 truncate",children:e.label})]},e.key))}),