efficient-shell 12.22.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 (65) hide show
  1. package/README.md +1 -1
  2. package/dist/{Browser-PVENJWOP.js → Browser-I3RMT2LB.js} +14 -14
  3. package/dist/Calculator-LSDVIJVQ.js +29 -0
  4. package/dist/CurrencyConverter-G5IYUCN7.js +21 -0
  5. package/dist/Files-WKTSGZLO.js +141 -0
  6. package/dist/Notepad-GMDSZEAO.js +24 -0
  7. package/dist/PomodoroTimer-SFTPXEDV.js +91 -0
  8. package/dist/{Preview-WP3J555J.js → Preview-XYR5M6UU.js} +26 -26
  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/brand.css +1 -1
  17. package/dist/charts/PieChart.js +1 -1
  18. package/dist/charts/RadarChart.js +1 -1
  19. package/dist/charts/RadialBarChart.js +1 -1
  20. package/dist/charts/SpecChart.js +1 -1
  21. package/dist/charts/TimeSeriesChart.js +1 -1
  22. package/dist/{chunk-F4XGUOVL.js → chunk-4BKJ6A5H.js} +4 -4
  23. package/dist/{chunk-M7RGRV2J.js → chunk-5MWXBDRG.js} +2 -2
  24. package/dist/{chunk-L2Y6FZTA.js → chunk-AQCUGTOR.js} +4 -4
  25. package/dist/{chunk-VVT4J75X.js → chunk-BKPP47DR.js} +1 -1
  26. package/dist/chunk-BZHP645G.js +11 -0
  27. package/dist/{chunk-OGWQABFP.js → chunk-CALBDO7B.js} +1 -1
  28. package/dist/chunk-EC3P3W7Z.js +28 -0
  29. package/dist/chunk-EIFNESXS.js +1 -0
  30. package/dist/{chunk-XQWHKXLS.js → chunk-F37II2EH.js} +13 -13
  31. package/dist/{chunk-ZLKEPDJE.js → chunk-H6WXTJOT.js} +1 -1
  32. package/dist/{chunk-DG2TGWXI.js → chunk-JUFCEWE3.js} +5 -5
  33. package/dist/chunk-KZRZYLN7.js +99 -0
  34. package/dist/chunk-N56HV4IH.js +1 -0
  35. package/dist/{chunk-2NZ7CVMW.js → chunk-OALFCXD6.js} +1 -1
  36. package/dist/{chunk-VP2GI3UP.js → chunk-OHSRZLRD.js} +2 -2
  37. package/dist/{chunk-FVKXDF2Q.js → chunk-RB7IU7ZK.js} +5 -5
  38. package/dist/{chunk-WLX24TG6.js → chunk-TUPPFC74.js} +4 -4
  39. package/dist/{chunk-EEB5XPWP.js → chunk-VXDW6ZPG.js} +2 -2
  40. package/dist/format/index.js +1 -1
  41. package/dist/forms/BrandAssetEditor.js +1 -1
  42. package/dist/forms/LinkPicker.js +1 -1
  43. package/dist/forms/MediaLibrary.d.ts +4 -3
  44. package/dist/forms/MediaLibrary.js +1 -1
  45. package/dist/forms/MediaUploadField.d.ts +6 -1
  46. package/dist/forms/MediaUploadField.js +1 -1
  47. package/dist/icons/index.js +1 -1
  48. package/dist/index.js +135 -135
  49. package/dist/shell/Dialog.d.ts +5 -0
  50. package/dist/shell/LanguageSelect.js +1 -1
  51. package/dist/shell/SettingRow.js +1 -1
  52. package/dist/telemetry/index.js +1 -1
  53. package/dist/templates/DashboardTemplate.js +1 -1
  54. package/dist/ui/index.js +1 -1
  55. package/dist/version.js +1 -1
  56. package/package.json +1 -1
  57. package/dist/Calculator-OUPD7SZV.js +0 -29
  58. package/dist/CurrencyConverter-CNGYEKE3.js +0 -21
  59. package/dist/Files-SJVIIPJO.js +0 -141
  60. package/dist/Notepad-RULHLP22.js +0 -24
  61. package/dist/PomodoroTimer-I53C5QYM.js +0 -91
  62. package/dist/chunk-BDGYRQQE.js +0 -9
  63. package/dist/chunk-EEGTFJUQ.js +0 -28
  64. package/dist/chunk-MQP7E4CQ.js +0 -1
  65. package/dist/chunk-XQNZJNEJ.js +0 -99
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export{PieChart as default}from"../chunk-VP2GI3UP.js";import"../chunk-VFC6QUEN.js";import"../chunk-465RRWBY.js";import"../chunk-CNYAHYE6.js";import"../chunk-MAFUXCPZ.js";import"../chunk-2JWPNR2U.js";import"../chunk-WDQI3FV6.js";import"../chunk-TZFACUMR.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-JSHMIMAJ.js";import"../chunk-C3QOHMR6.js";
2
+ export{PieChart as default}from"../chunk-OHSRZLRD.js";import"../chunk-465RRWBY.js";import"../chunk-VFC6QUEN.js";import"../chunk-CNYAHYE6.js";import"../chunk-MAFUXCPZ.js";import"../chunk-2JWPNR2U.js";import"../chunk-WDQI3FV6.js";import"../chunk-TZFACUMR.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-JSHMIMAJ.js";import"../chunk-C3QOHMR6.js";
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export{RADAR_SERIES_CAP,RadarChart as default}from"../chunk-DG2TGWXI.js";import"../chunk-HY6CBG4M.js";import"../chunk-VFC6QUEN.js";import"../chunk-465RRWBY.js";import"../chunk-CNYAHYE6.js";import"../chunk-G67CJAQ2.js";import"../chunk-SOZCWT6I.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-2JWPNR2U.js";import"../chunk-WDQI3FV6.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-JSHMIMAJ.js";import"../chunk-C3QOHMR6.js";
2
+ export{RADAR_SERIES_CAP,RadarChart as default}from"../chunk-JUFCEWE3.js";import"../chunk-HY6CBG4M.js";import"../chunk-465RRWBY.js";import"../chunk-VFC6QUEN.js";import"../chunk-CNYAHYE6.js";import"../chunk-G67CJAQ2.js";import"../chunk-SOZCWT6I.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-2JWPNR2U.js";import"../chunk-WDQI3FV6.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-JSHMIMAJ.js";import"../chunk-C3QOHMR6.js";
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export{RadialBarChart as default}from"../chunk-FVKXDF2Q.js";import"../chunk-VFC6QUEN.js";import"../chunk-465RRWBY.js";import"../chunk-CNYAHYE6.js";import"../chunk-2JWPNR2U.js";import"../chunk-WDQI3FV6.js";import"../chunk-TZFACUMR.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-JSHMIMAJ.js";import"../chunk-C3QOHMR6.js";
2
+ export{RadialBarChart as default}from"../chunk-RB7IU7ZK.js";import"../chunk-465RRWBY.js";import"../chunk-VFC6QUEN.js";import"../chunk-CNYAHYE6.js";import"../chunk-2JWPNR2U.js";import"../chunk-WDQI3FV6.js";import"../chunk-TZFACUMR.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-JSHMIMAJ.js";import"../chunk-C3QOHMR6.js";
@@ -1 +1 @@
1
- export{SpecChart as default}from"../chunk-EEB5XPWP.js";import"../chunk-GEYM4WN3.js";import"../chunk-Y3JW2GW5.js";import"../chunk-36BRD5J3.js";import"../chunk-LF27WIN2.js";import"../chunk-XQWHKXLS.js";import"../chunk-TU2L7NW3.js";import"../chunk-CK2YOGUS.js";import"../chunk-RBS3AWE7.js";import"../chunk-VFC6QUEN.js";import"../chunk-GC4N4UQM.js";import"../chunk-465RRWBY.js";import"../chunk-WXZZGHET.js";import"../chunk-CNYAHYE6.js";import"../chunk-G67CJAQ2.js";import"../chunk-SOZCWT6I.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-ENFXDIIZ.js";import"../chunk-2DYVVHZA.js";import"../chunk-MAFUXCPZ.js";import"../chunk-2JWPNR2U.js";import"../chunk-WDQI3FV6.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-JSHMIMAJ.js";import"../chunk-C3QOHMR6.js";
1
+ export{SpecChart as default}from"../chunk-VXDW6ZPG.js";import"../chunk-GEYM4WN3.js";import"../chunk-Y3JW2GW5.js";import"../chunk-36BRD5J3.js";import"../chunk-LF27WIN2.js";import"../chunk-F37II2EH.js";import"../chunk-GC4N4UQM.js";import"../chunk-465RRWBY.js";import"../chunk-TU2L7NW3.js";import"../chunk-CK2YOGUS.js";import"../chunk-RBS3AWE7.js";import"../chunk-WXZZGHET.js";import"../chunk-VFC6QUEN.js";import"../chunk-CNYAHYE6.js";import"../chunk-G67CJAQ2.js";import"../chunk-SOZCWT6I.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-ENFXDIIZ.js";import"../chunk-2DYVVHZA.js";import"../chunk-MAFUXCPZ.js";import"../chunk-2JWPNR2U.js";import"../chunk-WDQI3FV6.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-JSHMIMAJ.js";import"../chunk-C3QOHMR6.js";
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export{TimeSeriesChart as default}from"../chunk-XQWHKXLS.js";import"../chunk-TU2L7NW3.js";import"../chunk-CK2YOGUS.js";import"../chunk-VFC6QUEN.js";import"../chunk-465RRWBY.js";import"../chunk-WXZZGHET.js";import"../chunk-CNYAHYE6.js";import"../chunk-2DYVVHZA.js";import"../chunk-MAFUXCPZ.js";import"../chunk-2JWPNR2U.js";import"../chunk-WDQI3FV6.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-JSHMIMAJ.js";import"../chunk-C3QOHMR6.js";
2
+ export{TimeSeriesChart as default}from"../chunk-F37II2EH.js";import"../chunk-465RRWBY.js";import"../chunk-TU2L7NW3.js";import"../chunk-CK2YOGUS.js";import"../chunk-WXZZGHET.js";import"../chunk-VFC6QUEN.js";import"../chunk-CNYAHYE6.js";import"../chunk-2DYVVHZA.js";import"../chunk-MAFUXCPZ.js";import"../chunk-2JWPNR2U.js";import"../chunk-WDQI3FV6.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-JSHMIMAJ.js";import"../chunk-C3QOHMR6.js";
@@ -1,9 +1,9 @@
1
- import{CountBadge as e}from"./chunk-OM6VWUAZ.js";import{isShown as i}from"./chunk-HCP7WOAL.js";import{SettingRowNameContext as n,SettingAutoContext as a}from"./chunk-2NMW66P5.js";import{useShellStrings as t}from"./chunk-JSHMIMAJ.js";import{isValidElement as l}from"react";import{jsx as s,jsxs as r,Fragment as d}from"react/jsx-runtime";var c={pad:"p-4",gap:"gap-4",text:"text-sm",bodyTop:"mt-4",bodyPad:"pt-3"},m=e=>Array.isArray(e)?e.some(m):l(e);function o({label:l,icon:o,action:h,value:u,readout:f,changed:p=!1,description:x,children:N,controlId:v,labelId:g,unknownText:b="—",quiet:y=!1,size:k="default",viewState:w,divider:$=!0,showWhen:j,values:P,context:A,className:M=""}){const W=t();if(!i(j,P,A))return null;const I="auto"===w?/* @__PURE__ */s("span",{"data-setting-auto":"","aria-hidden":"true",className:"shrink-0 rounded-sm border border-line px-1 text-2xs font-normal leading-4 text-ink-faint",children:W.settingView.auto}):"edited"===w?/* @__PURE__ */r("span",{"data-setting-edited":"",className:"inline-flex shrink-0 items-center",children:[
1
+ import{CountBadge as e}from"./chunk-OM6VWUAZ.js";import{SettingRowNameContext as i,SettingAutoContext as n}from"./chunk-2NMW66P5.js";import{isShown as a}from"./chunk-HCP7WOAL.js";import{useShellStrings as t}from"./chunk-JSHMIMAJ.js";import{isValidElement as l}from"react";import{jsx as s,jsxs as r,Fragment as d}from"react/jsx-runtime";var c={pad:"p-4",gap:"gap-4",text:"text-sm",bodyTop:"mt-4",bodyPad:"pt-3"},m=e=>Array.isArray(e)?e.some(m):l(e);function o({label:l,icon:o,action:h,value:u,readout:f,changed:p=!1,description:x,children:N,controlId:v,labelId:g,unknownText:b="—",quiet:y=!1,size:k="default",viewState:w,divider:$=!0,showWhen:j,values:P,context:A,className:M=""}){const W=t();if(!a(j,P,A))return null;const I="auto"===w?/* @__PURE__ */s("span",{"data-setting-auto":"","aria-hidden":"true",className:"shrink-0 rounded-sm border border-line px-1 text-2xs font-normal leading-4 text-ink-faint",children:W.settingView.auto}):"edited"===w?/* @__PURE__ */r("span",{"data-setting-edited":"",className:"inline-flex shrink-0 items-center",children:[
2
2
  /* @__PURE__ */s("span",{"aria-hidden":"true",className:"inline-flex",children:/* @__PURE__ */s(e,{dot:!0,tone:"accent"})}),
3
- /* @__PURE__ */s("span",{className:"sr-only",children:W.settingView.edited})]}):null,T=null!=f&&!1!==f;if("compact"===k){const e=m(u),i=m(h);if(!e&&!i)return null;const t=g,c=["es-field"];e||c.push("is-inline"),p&&c.push("is-changed"),M&&c.push(M);const b=/* @__PURE__ */r(d,{children:[null!=o&&/* @__PURE__ */s("span",{className:"es-field-icon","aria-hidden":"true",children:o}),
4
- /* @__PURE__ */s("span",{className:"es-field-label",id:t,children:l}),I]}),y=e=>/* @__PURE__ */s(n.Provider,{value:t,children:/* @__PURE__ */s(a.Provider,{value:"auto"===w,children:e})});/* @__PURE__ */
3
+ /* @__PURE__ */s("span",{className:"sr-only",children:W.settingView.edited})]}):null,T=null!=f&&!1!==f;if("compact"===k){const e=m(u),a=m(h);if(!e&&!a)return null;const t=g,c=["es-field"];e||c.push("is-inline"),p&&c.push("is-changed"),M&&c.push(M);const b=/* @__PURE__ */r(d,{children:[null!=o&&/* @__PURE__ */s("span",{className:"es-field-icon","aria-hidden":"true",children:o}),
4
+ /* @__PURE__ */s("span",{className:"es-field-label",id:t,children:l}),I]}),y=e=>/* @__PURE__ */s(i.Provider,{value:t,children:/* @__PURE__ */s(n.Provider,{value:"auto"===w,children:e})});/* @__PURE__ */
5
5
  return r("div",{className:c.join(" "),children:[
6
- /* @__PURE__ */r("div",{className:"es-field-head",children:[v?/* @__PURE__ */s("label",{className:"es-field-name",htmlFor:v,children:b}):/* @__PURE__ */s("span",{className:"es-field-name",children:b}),T&&/* @__PURE__ */s("span",{className:"es-field-value",children:f}),i&&y(h)]}),e&&/* @__PURE__ */s("div",{className:"es-field-ctl",children:y(u)}),x?/* @__PURE__ */s("p",{className:"es-field-hint",children:x}):null,N]})}const V=c,F=void 0!==u||void 0===N&&null==h,H=null==u||""===u,J=y?"text-gray-500":"text-gray-800",O=H?"text-gray-400":y?"text-gray-500":"text-gray-900",S=`${V.text} font-medium ${J}`,q=v?/* @__PURE__ */s("label",{htmlFor:v,id:g,className:S,children:l}):/* @__PURE__ */s("span",{id:g,className:S,children:l}),z=/* @__PURE__ */s(n.Provider,{value:g,children:/* @__PURE__ */s(a.Provider,{value:"auto"===w,children:H?b:u})}),B=[$?"border-t border-line-subtle first:border-t-0":"",V.pad,M].filter(Boolean).join(" "),C=null!=N&&!1!==N&&/* @__PURE__ */s("div",{className:`${V.bodyTop} border-t border-line-subtle ${V.bodyPad}`,children:N});/* @__PURE__ */
6
+ /* @__PURE__ */r("div",{className:"es-field-head",children:[v?/* @__PURE__ */s("label",{className:"es-field-name",htmlFor:v,children:b}):/* @__PURE__ */s("span",{className:"es-field-name",children:b}),T&&/* @__PURE__ */s("span",{className:"es-field-value",children:f}),a&&y(h)]}),e&&/* @__PURE__ */s("div",{className:"es-field-ctl",children:y(u)}),x?/* @__PURE__ */s("p",{className:"es-field-hint",children:x}):null,N]})}const V=c,F=void 0!==u||void 0===N&&null==h,H=null==u||""===u,J=y?"text-gray-500":"text-gray-800",O=H?"text-gray-400":y?"text-gray-500":"text-gray-900",S=`${V.text} font-medium ${J}`,q=v?/* @__PURE__ */s("label",{htmlFor:v,id:g,className:S,children:l}):/* @__PURE__ */s("span",{id:g,className:S,children:l}),z=/* @__PURE__ */s(i.Provider,{value:g,children:/* @__PURE__ */s(n.Provider,{value:"auto"===w,children:H?b:u})}),B=[$?"border-t border-line-subtle first:border-t-0":"",V.pad,M].filter(Boolean).join(" "),C=null!=N&&!1!==N&&/* @__PURE__ */s("div",{className:`${V.bodyTop} border-t border-line-subtle ${V.bodyPad}`,children:N});/* @__PURE__ */
7
7
  return r("div",T?{className:B,children:[
8
8
  /* @__PURE__ */r("div",{"data-setting-line":"",className:"flex flex-wrap items-center justify-between gap-x-2 gap-y-2",children:[
9
9
  /* @__PURE__ */s("div",{className:"flex-1 basis-0",children:/* @__PURE__ */r("div",{className:`flex min-w-0 items-center gap-2 ${J}`,children:[null!=o&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:o}),q,I]})}),
@@ -1,4 +1,4 @@
1
- import{useWindowMenuItem as e,Modal as t}from"./chunk-XQNZJNEJ.js";import{navIcons as r}from"./chunk-4LXCCZDM.js";import{VERSION as n}from"./chunk-MQP7E4CQ.js";import{Icon as s}from"./chunk-XZXFUZIK.js";import{DEFAULT_SHELL_STRINGS as i,useShellStrings as o,splitAround as a}from"./chunk-JSHMIMAJ.js";import{useState as l,useCallback as m,isValidElement as c,cloneElement as p}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var h=i.aboutApp,x={notepad:{name:"Notepad",version:"1.1.0",route:"/notepad",description:h.notepad},preview:{name:"Preview",version:"1.4.3",route:"/preview",description:h.preview},files:{name:"Files",version:"2.0.0",route:"/files",description:h.files},browser:{name:"Browser",version:"1.0.3",route:"/browser",description:h.browser}},u=/* @__PURE__ */d(s,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),w=/* @__PURE__ */d(s,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function N({app:s}){const i=x[s],[h,N]=l(!1),v=m(()=>N(!0),[]),b=o().aboutApp,k=b.title(i.name);if(e(k,v,u),!h)return null;const g=r[i.route],y=c(g)?p(g,{className:"h-9 w-9"}):w,[j,C]=a(b.partOf);/* @__PURE__ */
1
+ import{useWindowMenuItem as e,Modal as t}from"./chunk-KZRZYLN7.js";import{navIcons as r}from"./chunk-4LXCCZDM.js";import{VERSION as n}from"./chunk-N56HV4IH.js";import{Icon as s}from"./chunk-XZXFUZIK.js";import{DEFAULT_SHELL_STRINGS as i,useShellStrings as o,splitAround as a}from"./chunk-JSHMIMAJ.js";import{useState as l,useCallback as m,isValidElement as c,cloneElement as p}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var h=i.aboutApp,x={notepad:{name:"Notepad",version:"1.1.0",route:"/notepad",description:h.notepad},preview:{name:"Preview",version:"1.4.3",route:"/preview",description:h.preview},files:{name:"Files",version:"2.0.0",route:"/files",description:h.files},browser:{name:"Browser",version:"1.0.3",route:"/browser",description:h.browser}},u=/* @__PURE__ */d(s,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),w=/* @__PURE__ */d(s,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function N({app:s}){const i=x[s],[h,N]=l(!1),v=m(()=>N(!0),[]),b=o().aboutApp,k=b.title(i.name);if(e(k,v,u),!h)return null;const g=r[i.route],y=c(g)?p(g,{className:"h-9 w-9"}):w,[j,Z]=a(b.partOf);/* @__PURE__ */
2
2
  return d(t,{open:!0,onClose:()=>N(!1),title:k,size:"sm",compact:!0,bodyScroll:!1,autoHeight:!0,dimensions:[320,320],children:/* @__PURE__ */f("div",{className:"flex flex-col items-center text-center px-5 pt-5 pb-4",children:[
3
3
  /* @__PURE__ */d("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gray-100 text-gray-600 shrink-0",children:y}),
4
4
  /* @__PURE__ */d("h2",{className:"mt-3 text-lg font-bold text-gray-900",children:i.name}),
@@ -6,4 +6,4 @@ return d(t,{open:!0,onClose:()=>N(!1),title:k,size:"sm",compact:!0,bodyScroll:!1
6
6
  /* @__PURE__ */d("p",{className:"mt-2 text-xs text-gray-500 leading-relaxed",children:b[s]}),
7
7
  /* @__PURE__ */f("div",{className:"mt-4 pt-3 border-t border-gray-200 w-full",children:[
8
8
  /* @__PURE__ */f("p",{className:"text-2xs text-ink-faint",children:[j,
9
- /* @__PURE__ */d("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),C]}),n&&/* @__PURE__ */d("p",{className:"mt-0.5 text-2xs font-mono text-ink-faintest",children:b.shellVersion(n)})]})]})})}export{N as AboutApp,x as BUILTIN_APP_INFO};
9
+ /* @__PURE__ */d("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),Z]}),n&&/* @__PURE__ */d("p",{className:"mt-0.5 text-2xs font-mono text-ink-faintest",children:b.shellVersion(n)})]})]})})}export{N as AboutApp,x as BUILTIN_APP_INFO};
@@ -1,11 +1,11 @@
1
- import{MediaUploadField as e}from"./chunk-BDGYRQQE.js";import{BrandMark as r}from"./chunk-MI67DI3H.js";import{Button_default as a}from"./chunk-EVYD6UFQ.js";import{useShellStrings as t}from"./chunk-JSHMIMAJ.js";import{useRef as i,useState as l,useEffect as s}from"react";import{jsxs as n,jsx as c}from"react/jsx-runtime";function d({committedUrl:d,committedHasAlpha:o=null,committedIsLight:m=null,fallbackUrl:g,fallbackHasAlpha:h=null,fallbackIsLight:u=null,subjectName:b,assetName:p,onSave:x,onRemove:f,accept:v="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:y="PNG · ICO · SVG · JPG · WEBP",maxBytes:N=5242880,previews:w=[],disabled:k=!1}){const j=i(null),[L,R]=l(null),[U,H]=l(""),[I,A]=l(""),[C,E]=l(!1),[F,B]=l(!1),G=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(p),O=t().brandAsset,S=U||d||g||"",D=L?null:d?o:h,J=L?null:d?m:u;s(()=>()=>{j.current&&URL.revokeObjectURL(j.current)},[]);const M=()=>{j.current&&(URL.revokeObjectURL(j.current),j.current=null)};/* @__PURE__ */
1
+ import{MediaUploadField as e}from"./chunk-BZHP645G.js";import{BrandMark as r}from"./chunk-MI67DI3H.js";import{Button_default as a}from"./chunk-EVYD6UFQ.js";import{useShellStrings as t}from"./chunk-JSHMIMAJ.js";import{useRef as i,useState as l,useEffect as s}from"react";import{jsxs as n,jsx as c}from"react/jsx-runtime";function d({committedUrl:d,committedHasAlpha:o=null,committedIsLight:m=null,fallbackUrl:g,fallbackHasAlpha:h=null,fallbackIsLight:u=null,subjectName:b,assetName:p,onSave:x,onRemove:f,accept:v="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:y="PNG · ICO · SVG · JPG · WEBP",maxBytes:N=5242880,previews:w=[],disabled:k=!1}){const j=i(null),[L,U]=l(null),[R,H]=l(""),[I,A]=l(""),[C,F]=l(!1),[B,E]=l(!1),G=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(p),O=t().brandAsset,P=R||d||g||"",S=L?null:d?o:h,J=L?null:d?m:u;s(()=>()=>{j.current&&URL.revokeObjectURL(j.current)},[]);const M=()=>{j.current&&(URL.revokeObjectURL(j.current),j.current=null)};/* @__PURE__ */
2
2
  return n("section",{"aria-label":O.region(p,b),className:"grid gap-4 lg:grid-cols-2",children:[
3
3
  /* @__PURE__ */n("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[
4
- /* @__PURE__ */c(e,{value:S,onChange:()=>{},onFile:e=>{if(k)return;M();const r=URL.createObjectURL(e);j.current=r,R(e),H(r),A("")},label:p,hint:I||O.usedFor(b),error:I||void 0,accept:v,acceptHint:y,maxSizeBytes:N,fit:"contain",height:180,allowRemove:!1,busy:C||F,disabled:k}),
4
+ /* @__PURE__ */c(e,{value:P,onChange:()=>{},onFile:e=>{if(k)return;M();const r=URL.createObjectURL(e);j.current=r,U(e),H(r),A("")},label:p,hint:I||O.usedFor(b),error:I||void 0,accept:v,acceptHint:y,maxSizeBytes:N,fit:"contain",height:180,allowRemove:!1,busy:C||B,disabled:k}),
5
5
  /* @__PURE__ */n("div",{className:"mt-3 flex flex-wrap gap-2",children:[
6
- /* @__PURE__ */c(a,{onClick:async()=>{if(L&&!k&&!C){E(!0),A("");try{await x(L),M(),R(null),H("")}catch(e){A(e instanceof Error?e.message:O.saveFailed(G,p))}finally{E(!1)}}},disabled:!L||k,loading:C,children:O.save(G,p)}),(L||d)&&/* @__PURE__ */c(a,{variant:"ghost-danger",onClick:async()=>{if(!k&&!F){if(L)return M(),R(null),H(""),void A("");if(d){B(!0),A("");try{await f()}catch(e){A(e instanceof Error?e.message:O.removeFailed(G,p))}finally{B(!1)}}}},disabled:k,loading:F,children:L?O.discard:O.remove(G,p)})]})]}),w.length>0&&/* @__PURE__ */n("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":O.previews(p),children:[
6
+ /* @__PURE__ */c(a,{onClick:async()=>{if(L&&!k&&!C){F(!0),A("");try{await x(L),M(),U(null),H("")}catch(e){A(e instanceof Error?e.message:O.saveFailed(G,p))}finally{F(!1)}}},disabled:!L||k,loading:C,children:O.save(G,p)}),(L||d)&&/* @__PURE__ */c(a,{variant:"ghost-danger",onClick:async()=>{if(!k&&!B){if(L)return M(),U(null),H(""),void A("");if(d){E(!0),A("");try{await f()}catch(e){A(e instanceof Error?e.message:O.removeFailed(G,p))}finally{E(!1)}}}},disabled:k,loading:B,children:L?O.discard:O.remove(G,p)})]})]}),w.length>0&&/* @__PURE__ */n("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":O.previews(p),children:[
7
7
  /* @__PURE__ */c("h3",{className:"text-sm font-semibold text-gray-900",children:O.preview}),
8
- /* @__PURE__ */c("div",{className:"mt-3 grid gap-3",children:w.map(e=>{const a=/* @__PURE__ */c(r,{src:S,alt:O.alt(b,p),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:D,isLight:J,size:"browser-tab"===e.kind?16:void 0});/* @__PURE__ */
8
+ /* @__PURE__ */c("div",{className:"mt-3 grid gap-3",children:w.map(e=>{const a=/* @__PURE__ */c(r,{src:P,alt:O.alt(b,p),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:S,isLight:J,size:"browser-tab"===e.kind?16:void 0});/* @__PURE__ */
9
9
  return n("div",{"data-brand-preview":!0,className:"dark"===e.surface?"text-white":"text-gray-900",children:[
10
10
  /* @__PURE__ */c("div",{className:"mb-2 text-xs font-medium text-gray-500",children:e.label}),"browser-tab"===e.kind?/* @__PURE__ */n("div",{className:"flex items-end gap-1 border-b border-gray-200",children:[
11
11
  /* @__PURE__ */n("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:[a,
@@ -1 +1 @@
1
- import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-MQP7E4CQ.js";var n=-1,i=()=>n,a=e=>{addEventListener("pageshow",t=>{t.persisted&&(n=t.timeStamp,e(t))},!0)},r=(e,t,n,i)=>{let a,r;return o=>{var s,c;t.value>=0&&(o||i)&&(r=t.value-(a??0),(r||void 0===a)&&(a=t.value,t.delta=r,t.rating=(s=t.value)>(c=n)[1]?"poor":s>c[0]?"needs-improvement":"good",e(t)))}},o=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},c=()=>s()?.activationStart??0,d=-1,l=/* @__PURE__ */new Set,u=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,f=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of l)e();isFinite(d)||(d="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",f,!0))}},h=(e=!1)=>{if(e&&(d=1/0),d<0){const e=c(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=e)?.startTime;d=t??u(),addEventListener("visibilitychange",f,!0),addEventListener("prerenderingchange",f,!0),a(()=>{setTimeout(()=>{d=u()})})}return{get firstHiddenTime(){return d},onHidden(e){l.add(e)}}},g=(e,t=-1,n,a=0,r,o,d)=>{const l=s(),u=l?.navigationId||0;let f="navigate";return n?f=n:i()>=0?f="back-forward-cache":l&&(document.prerendering||c()>0?f="prerender":document.wasDiscarded?f="restore":l.type&&(f=l.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:f,navigationId:a||u,navigationInteractionId:r,navigationURL:o||l?.name,navigationStartTime:d||0}},v=/* @__PURE__ */new WeakMap;function p(e,t){let n=v.get(t);return n||(n=/* @__PURE__ */new WeakMap,v.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}var m,y=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}},T=(e,t,n={})=>{try{const i=e.filter(e=>PerformanceObserver.supportedEntryTypes.includes(e));if(i.length>0){const e=new PerformanceObserver(e=>{queueMicrotask(()=>{const n=e.getEntries();i.length>1&&n.sort((e,t)=>e.startTime+e.duration-(t.startTime+t.duration)),t(n)})});for(const t of i)e.observe({type:t,buffered:!0,...n});return e}}catch{}},w=e=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&e&&e.reportSoftNavs,I=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const t=e.keys().next().value;void 0!==t&&e.delete(t)}},b=e=>{let t=!1;return()=>{t||(e(),t=!0)}},C=class{l},E=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},L=[1800,3e3],P=(e,t={})=>{const n=w(t);E(()=>{const s=p(t,C),d=h();let l,u=g("FCP");const f=T(["paint"],e=>{for(const t of e)"first-contentful-paint"===t.name&&(f.disconnect(),t.startTime<d.firstHiddenTime&&(u.value=Math.max(t.startTime-c(),0),u.entries.push(t),u.navigationId=t.navigationId||u.navigationId,l(!0)))});f&&(l=r(e,u,L,t.reportAllChanges),a(n=>{u=g("FCP",-1,"back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),l=r(e,u,L,t.reportAllChanges),o(()=>{u.value=performance.now()-n.timeStamp,l(!0)})})),n&&T(["soft-navigation"],n=>{n.forEach(n=>{s.l&&n.navigationId&&I(s.l,n);const i=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);u=g("FCP",i,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),l=r(e,u,L,t.reportAllChanges),l(!0)})},t)})},A=[.1,.25],k=0,S=1/0,z=0,M=e=>{for(const t of e)t.interactionId&&(S=Math.min(S,t.interactionId),z=Math.max(z,t.interactionId),k=z?(z-S)/7+1:0)},$=()=>m?k:performance.interactionCount??0,_=class{u=0;v=[];m=/* @__PURE__ */new Map;p;T;_(){return $()-this.u}M(){this.u=$(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.p?.(e),!e.interactionId)return;const t=this.v.at(-1);let n=this.m.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.m.delete(t.id)}this.T?.(n)}}},Z=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{const a=b(e);let r=-1;const o=()=>{i(r),a()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),r=n(()=>{removeEventListener("visibilitychange",o,{capture:!0}),a()},{timeout:t})}},F=[200,500],R=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=h();E(()=>{"interactionCount"in performance||m||(m=T(["event"],M,{durationThreshold:0}));let o,s=g("INP");const c=p(t,_),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,F,t.reportAllChanges)},l=()=>{const e=c.L(s.navigationType);e&&e.P!==s.value&&(s.value=e.P,s.entries=e.entries,o())},u=e=>{l(),o(!0),d("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},f=(e,t=!1)=>{Z(()=>{for(const t of e)"soft-navigation"!==t.entryType?c.h(t):u(t);l(),t&&o(!0)})},h=["event","first-input"];w(t)&&h.push("soft-navigation");const v=T(h,f,{...t,durationThreshold:t.durationThreshold??40});o=r(e,s,F,t.reportAllChanges),v&&(n.onHidden(()=>{f(v.takeRecords(),!0)}),a(()=>{d("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,i())}))})},j=class{p;l;h(e){this.p?.(e)}},x=[2500,4e3],B=[800,1800],N=e=>{document.prerendering?E(()=>N(e)):"complete"!==document.readyState?addEventListener("load",()=>N(e),!0):setTimeout(e)};var U=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,O=/^[A-Za-z_$][A-Za-z0-9_$.]*$/,H=/^[A-Za-z0-9][A-Za-z0-9.+_-]*$/;var q=class{constructor(e){this.head=e}head;events=[];waiting=/* @__PURE__ */new Map;seen=/* @__PURE__ */new Set;get size(){return this.events.length}addVital(e){this.events.push(e)}addError(e){const t=function(e){return e.frames.length?`${e.name}|${e.frames.join("|")}`:`${e.name}|${e.message.replace(/\d/g,"0")}`}(e),n=this.waiting.get(t);return n?(n.count=Math.min(1e3,n.count+e.count),!0):!(this.seen.has(t)||this.seen.size>=20)&&(this.seen.add(t),this.waiting.set(t,e),this.events.push(e),!0)}drain(){const e=this.events;this.events=[],this.waiting.clear();const t=[],n=JSON.stringify({...this.head,events:[]}).length;let i=[],a=n;for(const r of e){const e=JSON.stringify(r).length+1;n+e>30720||((50===i.length||a+e>30720)&&(t.push({...this.head,events:i}),i=[],a=n),i.push(r),a+=e)}return i.length&&t.push({...this.head,events:i}),t}},J=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,K=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}(?:\.[A-Za-z0-9_-]*)?|\b[Bb]earer\s+[A-Za-z0-9._~+/=-]{8,}/g,V=/\b[a-z][a-z0-9+.-]*:\/\/\S+/gi,W=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,D=/\d{4,}/g,Q=/(^|[/:])(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{16,})(?=$|[/:])/gi,G=/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i,X=/(?:\(|@|\bat\s+)?((?:[a-z][a-z0-9+.-]*:\/\/|\/)[^\s()@]*?):(\d+):(\d+)\)?\s*$/i;function Y(e,t,n){const i=e.replace(G,"").split(/[?#]/,1)[0];return i?`${i}:${t}:${n}`.slice(0,256):null}function ee(e){if("string"!=typeof e)return[];const t=[];for(const n of e.split("\n")){const e=X.exec(n.trim()),i=e&&Y(e[1],e[2],e[3]);if(i&&t.push(i),5===t.length)break}return t}function te(e){const t=e instanceof Error?e.name:void 0;return"string"==typeof t&&t.length<=64&&O.test(t)?t:"Error"}function ne(e){if("string"!=typeof e)return"unknown";const t=e.trim().replace(G,"").split(/[?#]/,1)[0].replace(Q,(e,t)=>":"===t?":id":`${t}:id`);return t&&t.length<=128&&!t.includes("//")&&U.test(t)?t:"unknown"}var ie={flush(){},reportError(){},stop(){}},ae=null,re=/* @__PURE__ */new Set(["LCP","FCP","TTFB"]);function oe(e,t,n){const i=function(e){if(e.anonymous)return{credentials:"omit",headers:{"Content-Type":"application/json"}};const t=e.getAccessToken();return t?{credentials:"same-origin",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}:null}(t);if(!i)return;const a=t.anonymous?"/api/storefront-analytics/web-vitals/":"/api/client-telemetry/web-batches/";n(t.endpoint??a,{...i,method:"POST",keepalive:!0,body:JSON.stringify(e)}).catch(e=>{console.debug("[efficient-shell] client telemetry batch dropped:",e)})}function se(e){((e,t={})=>{let n=!1;const s=w(t);E(()=>{let d,l=h(),u=g("LCP");const f=p(t,j),v=(i,a,o,s,c)=>{u=g("LCP",-1,i,a,o,s,c),d=r(e,u,x,t.reportAllChanges),n=!1,"soft-navigation"===i&&(l=h(!0))},m=e=>{f.l&&e.navigationId&&I(f.l,e),n||d(!0),v("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);const t=e.getLargestInteractionContentfulPaint?.();t&&y([t])},y=e=>{t.reportAllChanges||s||(e=e.slice(-1));for(const t of e){if(!t)continue;if("soft-navigation"===t.entryType){m(t);continue}let e=0,n=[],i=t.startTime;if("largest-contentful-paint"===t.entryType)e=Math.max(t.startTime-c(),0),f.h(t),n=[t];else if("interaction-contentful-paint"===t.entryType){const a=t;if(!u.navigationId)continue;if("interactionId"in a&&a.interactionId!=u.navigationInteractionId)continue;i=a.largestContentfulPaint?.renderTime||0,e=Math.max(i-t.startTime,0),a.largestContentfulPaint&&(f.h(a.largestContentfulPaint),n=[a.largestContentfulPaint])}i<l.firstHiddenTime&&(u.value=e,u.entries=n,d())}},w=["largest-contentful-paint"];s&&w.push("interaction-contentful-paint","soft-navigation");const b=T(w,y);if(b){d=r(e,u,x,t.reportAllChanges);const c=["keydown","click","visibilitychange"],l=e=>{if(e.isTrusted&&!n){const e=u.id;Z(()=>{if(!n){if(!s){b.disconnect();for(const e of c)removeEventListener(e,l,{capture:!0})}e===u.id&&(n=!0,d(!0))}})}};for(const e of c)addEventListener(e,l,{capture:!0});a(a=>{v("back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),d=r(e,u,x,t.reportAllChanges),o(()=>{u.value=performance.now()-a.timeStamp,n=!0,d(!0)})})}})})(e),R(e),((e,t={})=>{const n=h();P(b(()=>{let s,c=g("CLS",0);const d=p(t,y),l=(n,i,a,o,l)=>{c=g("CLS",0,n,i,a,o,l),d.i=0,s=r(e,c,A,t.reportAllChanges)},u=(e=!1)=>{d.i>c.value&&(c.value=d.i,c.entries=d.o),s(e)},f=e=>{u(!0),l("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},h=e=>{for(const t of e)"soft-navigation"!==t.entryType?d.h(t):f(t);u()},v=["layout-shift"];w(t)&&v.push("soft-navigation");const m=T(v,h);m&&(s=r(e,c,A,t.reportAllChanges),n.onHidden(()=>{h(m.takeRecords()),s(!0)}),a(()=>{l("back-forward-cache",c.navigationId,c.navigationInteractionId,c.navigationURL,i()),o(s)}),setTimeout(s))}))})(e),P(e),((e,t={})=>{const n=w(t);let o=g("TTFB"),d=r(e,o,B,t.reportAllChanges);N(()=>{const l=s();if(l){const s=l.responseStart;o.value=Math.max(s-c(),0),o.entries=[l],d(!0),a(()=>{o=g("TTFB",0,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,i()),d=r(e,o,B,t.reportAllChanges),d(!0)}),n&&T(["soft-navigation"],n=>{n.forEach(n=>{n.navigationId&&(o=g("TTFB",0,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o.entries=[n],d=r(e,o,B,t.reportAllChanges),d(!0))})},t)}})})(e)}function ce(n){if(ae?.stop(),ae=null,!1===n.enabled||"undefined"==typeof window||"undefined"==typeof document)return ie;if(!function(e){const t="string"==typeof e.app&&H.test(e.app),n="string"==typeof e.release&&H.test(e.release);return t&&n||console.warn("[efficient-shell] client telemetry not started: `app` and `release` must be version-like strings."),t&&n}(n))return ie;const i=function(e){const t=e.vitalsSampleRate??1;return t>0&&(t>=1||(e.random??Math.random)()<t)}(n);if(n.anonymous&&!i)return ie;const a=n.fetch??window.fetch.bind(window),r=new q({app:n.app,release:n.release,shell_version:H.test(t)?t:""}),o=ne(n.routeKey()),s=function(e=("undefined"==typeof window?void 0:window)){if(!e)return"desktop";const t="function"==typeof e.matchMedia&&e.matchMedia("(pointer: coarse)").matches,n=e.innerWidth;return n<600?"mobile":t&&n<1280?"tablet":"desktop"}(window);let c=!1;const d=()=>{for(const e of r.drain())oe(e,n,a)},l=e=>{c||n.anonymous||(r.addError(e),r.size>=50&&d())},u=(e,t)=>{return{type:"error",source:t,name:te(e),message:(a=e,i=a instanceof Error?a.message:"string"==typeof a?a:a&&"object"==typeof a&&"string"==typeof a.message?a.message:"",i.slice(0,640).replace(J,"[redacted]").replace(K,"[redacted]").replace(V,"[url]").replace(W,"[id]").replace(D,"[n]").replace(/\s+/g," ").trim().slice(0,160)),frames:ee(e instanceof Error?e.stack:void 0),route:ne(n.routeKey()),count:1};var i,a};i&&(n.observeVitals??se)(e=>{c||(r.addVital(function(e,t,n,i){return{type:"vital",name:e.name,value:e.value,route:re.has(e.name)?t:n(),navigation:e.navigationType??"navigate",device:i}}(e,o,()=>ne(n.routeKey()),s)),r.size>=50&&d())});const f=n.anonymous?()=>{}:function(t,n){const i=e=>{const{error:i,message:a,filename:r,lineno:o,colno:s}=e;if(null!=i)return void t(n(i,"onerror"));const c=r?ee(`at ${r}:${o??0}:${s??0}`):[];t({...n(a??"","onerror"),frames:c})},a=e=>t(n(e.reason,"unhandledrejection"));window.addEventListener("error",i),window.addEventListener("unhandledrejection",a);const r=e(e=>t(n(e,"boundary")));return()=>{window.removeEventListener("error",i),window.removeEventListener("unhandledrejection",a),r()}}(l,u),h=()=>{"hidden"===document.visibilityState&&d()};document.addEventListener("visibilitychange",h),window.addEventListener("pagehide",d);const g=window.setInterval(d,n.flushIntervalMs??6e4),v={flush:d,reportError:e=>l(u(e,"boundary")),stop(){c||(d(),c=!0,f(),document.removeEventListener("visibilitychange",h),window.removeEventListener("pagehide",d),window.clearInterval(g),ae===v&&(ae=null))}};return ae=v,v}export{ce as startClientTelemetry};
1
+ import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-N56HV4IH.js";var n=-1,i=()=>n,a=e=>{addEventListener("pageshow",t=>{t.persisted&&(n=t.timeStamp,e(t))},!0)},r=(e,t,n,i)=>{let a,r;return o=>{var s,c;t.value>=0&&(o||i)&&(r=t.value-(a??0),(r||void 0===a)&&(a=t.value,t.delta=r,t.rating=(s=t.value)>(c=n)[1]?"poor":s>c[0]?"needs-improvement":"good",e(t)))}},o=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},c=()=>s()?.activationStart??0,d=-1,l=/* @__PURE__ */new Set,u=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,f=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of l)e();isFinite(d)||(d="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",f,!0))}},h=(e=!1)=>{if(e&&(d=1/0),d<0){const e=c(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=e)?.startTime;d=t??u(),addEventListener("visibilitychange",f,!0),addEventListener("prerenderingchange",f,!0),a(()=>{setTimeout(()=>{d=u()})})}return{get firstHiddenTime(){return d},onHidden(e){l.add(e)}}},g=(e,t=-1,n,a=0,r,o,d)=>{const l=s(),u=l?.navigationId||0;let f="navigate";return n?f=n:i()>=0?f="back-forward-cache":l&&(document.prerendering||c()>0?f="prerender":document.wasDiscarded?f="restore":l.type&&(f=l.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:f,navigationId:a||u,navigationInteractionId:r,navigationURL:o||l?.name,navigationStartTime:d||0}},v=/* @__PURE__ */new WeakMap;function p(e,t){let n=v.get(t);return n||(n=/* @__PURE__ */new WeakMap,v.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}var m,y=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}},T=(e,t,n={})=>{try{const i=e.filter(e=>PerformanceObserver.supportedEntryTypes.includes(e));if(i.length>0){const e=new PerformanceObserver(e=>{queueMicrotask(()=>{const n=e.getEntries();i.length>1&&n.sort((e,t)=>e.startTime+e.duration-(t.startTime+t.duration)),t(n)})});for(const t of i)e.observe({type:t,buffered:!0,...n});return e}}catch{}},w=e=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&e&&e.reportSoftNavs,I=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const t=e.keys().next().value;void 0!==t&&e.delete(t)}},b=e=>{let t=!1;return()=>{t||(e(),t=!0)}},C=class{l},E=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},L=[1800,3e3],P=(e,t={})=>{const n=w(t);E(()=>{const s=p(t,C),d=h();let l,u=g("FCP");const f=T(["paint"],e=>{for(const t of e)"first-contentful-paint"===t.name&&(f.disconnect(),t.startTime<d.firstHiddenTime&&(u.value=Math.max(t.startTime-c(),0),u.entries.push(t),u.navigationId=t.navigationId||u.navigationId,l(!0)))});f&&(l=r(e,u,L,t.reportAllChanges),a(n=>{u=g("FCP",-1,"back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),l=r(e,u,L,t.reportAllChanges),o(()=>{u.value=performance.now()-n.timeStamp,l(!0)})})),n&&T(["soft-navigation"],n=>{n.forEach(n=>{s.l&&n.navigationId&&I(s.l,n);const i=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);u=g("FCP",i,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),l=r(e,u,L,t.reportAllChanges),l(!0)})},t)})},A=[.1,.25],k=0,S=1/0,z=0,M=e=>{for(const t of e)t.interactionId&&(S=Math.min(S,t.interactionId),z=Math.max(z,t.interactionId),k=z?(z-S)/7+1:0)},$=()=>m?k:performance.interactionCount??0,_=class{u=0;v=[];m=/* @__PURE__ */new Map;p;T;_(){return $()-this.u}M(){this.u=$(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.p?.(e),!e.interactionId)return;const t=this.v.at(-1);let n=this.m.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.m.delete(t.id)}this.T?.(n)}}},Z=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{const a=b(e);let r=-1;const o=()=>{i(r),a()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),r=n(()=>{removeEventListener("visibilitychange",o,{capture:!0}),a()},{timeout:t})}},F=[200,500],R=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=h();E(()=>{"interactionCount"in performance||m||(m=T(["event"],M,{durationThreshold:0}));let o,s=g("INP");const c=p(t,_),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,F,t.reportAllChanges)},l=()=>{const e=c.L(s.navigationType);e&&e.P!==s.value&&(s.value=e.P,s.entries=e.entries,o())},u=e=>{l(),o(!0),d("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},f=(e,t=!1)=>{Z(()=>{for(const t of e)"soft-navigation"!==t.entryType?c.h(t):u(t);l(),t&&o(!0)})},h=["event","first-input"];w(t)&&h.push("soft-navigation");const v=T(h,f,{...t,durationThreshold:t.durationThreshold??40});o=r(e,s,F,t.reportAllChanges),v&&(n.onHidden(()=>{f(v.takeRecords(),!0)}),a(()=>{d("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,i())}))})},j=class{p;l;h(e){this.p?.(e)}},x=[2500,4e3],N=[800,1800],B=e=>{document.prerendering?E(()=>B(e)):"complete"!==document.readyState?addEventListener("load",()=>B(e),!0):setTimeout(e)};var H=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,U=/^[A-Za-z_$][A-Za-z0-9_$.]*$/,O=/^[A-Za-z0-9][A-Za-z0-9.+_-]*$/;var q=class{constructor(e){this.head=e}head;events=[];waiting=/* @__PURE__ */new Map;seen=/* @__PURE__ */new Set;get size(){return this.events.length}addVital(e){this.events.push(e)}addError(e){const t=function(e){return e.frames.length?`${e.name}|${e.frames.join("|")}`:`${e.name}|${e.message.replace(/\d/g,"0")}`}(e),n=this.waiting.get(t);return n?(n.count=Math.min(1e3,n.count+e.count),!0):!(this.seen.has(t)||this.seen.size>=20)&&(this.seen.add(t),this.waiting.set(t,e),this.events.push(e),!0)}drain(){const e=this.events;this.events=[],this.waiting.clear();const t=[],n=JSON.stringify({...this.head,events:[]}).length;let i=[],a=n;for(const r of e){const e=JSON.stringify(r).length+1;n+e>30720||((50===i.length||a+e>30720)&&(t.push({...this.head,events:i}),i=[],a=n),i.push(r),a+=e)}return i.length&&t.push({...this.head,events:i}),t}},J=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,K=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}(?:\.[A-Za-z0-9_-]*)?|\b[Bb]earer\s+[A-Za-z0-9._~+/=-]{8,}/g,V=/\b[a-z][a-z0-9+.-]*:\/\/\S+/gi,W=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,D=/\d{4,}/g,G=/(^|[/:])(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{16,})(?=$|[/:])/gi,Q=/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i,X=/(?:\(|@|\bat\s+)?((?:[a-z][a-z0-9+.-]*:\/\/|\/)[^\s()@]*?):(\d+):(\d+)\)?\s*$/i;function Y(e,t,n){const i=e.replace(Q,"").split(/[?#]/,1)[0];return i?`${i}:${t}:${n}`.slice(0,256):null}function ee(e){if("string"!=typeof e)return[];const t=[];for(const n of e.split("\n")){const e=X.exec(n.trim()),i=e&&Y(e[1],e[2],e[3]);if(i&&t.push(i),5===t.length)break}return t}function te(e){const t=e instanceof Error?e.name:void 0;return"string"==typeof t&&t.length<=64&&U.test(t)?t:"Error"}function ne(e){if("string"!=typeof e)return"unknown";const t=e.trim().replace(Q,"").split(/[?#]/,1)[0].replace(G,(e,t)=>":"===t?":id":`${t}:id`);return t&&t.length<=128&&!t.includes("//")&&H.test(t)?t:"unknown"}var ie={flush(){},reportError(){},stop(){}},ae=null,re=/* @__PURE__ */new Set(["LCP","FCP","TTFB"]);function oe(e,t,n){const i=function(e){if(e.anonymous)return{credentials:"omit",headers:{"Content-Type":"application/json"}};const t=e.getAccessToken();return t?{credentials:"same-origin",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}:null}(t);if(!i)return;const a=t.anonymous?"/api/storefront-analytics/web-vitals/":"/api/client-telemetry/web-batches/";n(t.endpoint??a,{...i,method:"POST",keepalive:!0,body:JSON.stringify(e)}).catch(e=>{console.debug("[efficient-shell] client telemetry batch dropped:",e)})}function se(e){((e,t={})=>{let n=!1;const s=w(t);E(()=>{let d,l=h(),u=g("LCP");const f=p(t,j),v=(i,a,o,s,c)=>{u=g("LCP",-1,i,a,o,s,c),d=r(e,u,x,t.reportAllChanges),n=!1,"soft-navigation"===i&&(l=h(!0))},m=e=>{f.l&&e.navigationId&&I(f.l,e),n||d(!0),v("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);const t=e.getLargestInteractionContentfulPaint?.();t&&y([t])},y=e=>{t.reportAllChanges||s||(e=e.slice(-1));for(const t of e){if(!t)continue;if("soft-navigation"===t.entryType){m(t);continue}let e=0,n=[],i=t.startTime;if("largest-contentful-paint"===t.entryType)e=Math.max(t.startTime-c(),0),f.h(t),n=[t];else if("interaction-contentful-paint"===t.entryType){const a=t;if(!u.navigationId)continue;if("interactionId"in a&&a.interactionId!=u.navigationInteractionId)continue;i=a.largestContentfulPaint?.renderTime||0,e=Math.max(i-t.startTime,0),a.largestContentfulPaint&&(f.h(a.largestContentfulPaint),n=[a.largestContentfulPaint])}i<l.firstHiddenTime&&(u.value=e,u.entries=n,d())}},w=["largest-contentful-paint"];s&&w.push("interaction-contentful-paint","soft-navigation");const b=T(w,y);if(b){d=r(e,u,x,t.reportAllChanges);const c=["keydown","click","visibilitychange"],l=e=>{if(e.isTrusted&&!n){const e=u.id;Z(()=>{if(!n){if(!s){b.disconnect();for(const e of c)removeEventListener(e,l,{capture:!0})}e===u.id&&(n=!0,d(!0))}})}};for(const e of c)addEventListener(e,l,{capture:!0});a(a=>{v("back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),d=r(e,u,x,t.reportAllChanges),o(()=>{u.value=performance.now()-a.timeStamp,n=!0,d(!0)})})}})})(e),R(e),((e,t={})=>{const n=h();P(b(()=>{let s,c=g("CLS",0);const d=p(t,y),l=(n,i,a,o,l)=>{c=g("CLS",0,n,i,a,o,l),d.i=0,s=r(e,c,A,t.reportAllChanges)},u=(e=!1)=>{d.i>c.value&&(c.value=d.i,c.entries=d.o),s(e)},f=e=>{u(!0),l("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},h=e=>{for(const t of e)"soft-navigation"!==t.entryType?d.h(t):f(t);u()},v=["layout-shift"];w(t)&&v.push("soft-navigation");const m=T(v,h);m&&(s=r(e,c,A,t.reportAllChanges),n.onHidden(()=>{h(m.takeRecords()),s(!0)}),a(()=>{l("back-forward-cache",c.navigationId,c.navigationInteractionId,c.navigationURL,i()),o(s)}),setTimeout(s))}))})(e),P(e),((e,t={})=>{const n=w(t);let o=g("TTFB"),d=r(e,o,N,t.reportAllChanges);B(()=>{const l=s();if(l){const s=l.responseStart;o.value=Math.max(s-c(),0),o.entries=[l],d(!0),a(()=>{o=g("TTFB",0,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,i()),d=r(e,o,N,t.reportAllChanges),d(!0)}),n&&T(["soft-navigation"],n=>{n.forEach(n=>{n.navigationId&&(o=g("TTFB",0,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o.entries=[n],d=r(e,o,N,t.reportAllChanges),d(!0))})},t)}})})(e)}function ce(n){if(ae?.stop(),ae=null,!1===n.enabled||"undefined"==typeof window||"undefined"==typeof document)return ie;if(!function(e){const t="string"==typeof e.app&&O.test(e.app),n="string"==typeof e.release&&O.test(e.release);return t&&n||console.warn("[efficient-shell] client telemetry not started: `app` and `release` must be version-like strings."),t&&n}(n))return ie;const i=function(e){const t=e.vitalsSampleRate??1;return t>0&&(t>=1||(e.random??Math.random)()<t)}(n);if(n.anonymous&&!i)return ie;const a=n.fetch??window.fetch.bind(window),r=new q({app:n.app,release:n.release,shell_version:O.test(t)?t:""}),o=ne(n.routeKey()),s=function(e=("undefined"==typeof window?void 0:window)){if(!e)return"desktop";const t="function"==typeof e.matchMedia&&e.matchMedia("(pointer: coarse)").matches,n=e.innerWidth;return n<600?"mobile":t&&n<1280?"tablet":"desktop"}(window);let c=!1;const d=()=>{for(const e of r.drain())oe(e,n,a)},l=e=>{c||n.anonymous||(r.addError(e),r.size>=50&&d())},u=(e,t)=>{return{type:"error",source:t,name:te(e),message:(a=e,i=a instanceof Error?a.message:"string"==typeof a?a:a&&"object"==typeof a&&"string"==typeof a.message?a.message:"",i.slice(0,640).replace(J,"[redacted]").replace(K,"[redacted]").replace(V,"[url]").replace(W,"[id]").replace(D,"[n]").replace(/\s+/g," ").trim().slice(0,160)),frames:ee(e instanceof Error?e.stack:void 0),route:ne(n.routeKey()),count:1};var i,a};i&&(n.observeVitals??se)(e=>{c||(r.addVital(function(e,t,n,i){return{type:"vital",name:e.name,value:e.value,route:re.has(e.name)?t:n(),navigation:e.navigationType??"navigate",device:i}}(e,o,()=>ne(n.routeKey()),s)),r.size>=50&&d())});const f=n.anonymous?()=>{}:function(t,n){const i=e=>{const{error:i,message:a,filename:r,lineno:o,colno:s}=e;if(null!=i)return void t(n(i,"onerror"));const c=r?ee(`at ${r}:${o??0}:${s??0}`):[];t({...n(a??"","onerror"),frames:c})},a=e=>t(n(e.reason,"unhandledrejection"));window.addEventListener("error",i),window.addEventListener("unhandledrejection",a);const r=e(e=>t(n(e,"boundary")));return()=>{window.removeEventListener("error",i),window.removeEventListener("unhandledrejection",a),r()}}(l,u),h=()=>{"hidden"===document.visibilityState&&d()};document.addEventListener("visibilitychange",h),window.addEventListener("pagehide",d);const g=window.setInterval(d,n.flushIntervalMs??6e4),v={flush:d,reportError:e=>l(u(e,"boundary")),stop(){c||(d(),c=!0,f(),document.removeEventListener("visibilitychange",h),window.removeEventListener("pagehide",d),window.clearInterval(g),ae===v&&(ae=null))}};return ae=v,v}export{ce as startClientTelemetry};
@@ -0,0 +1,11 @@
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
+ /* @__PURE__ */x(p,{name:"swap","aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
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(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
+ /* @__PURE__ */x("span",{className:"px-3 text-xs text-ink-faint",children:we}),
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
+ /* @__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
+ /* @__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
+ /* @__PURE__ */x("span",{className:"text-ink-faintest",children:/* @__PURE__ */x(l,{})}),Oe]})});/* @__PURE__ */
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
+ /* @__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))}),