efficient-shell 10.15.0 → 10.16.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 (265) hide show
  1. package/README.md +14 -0
  2. package/dist/{Browser-WR4GMYE7.js → Browser-RI5X7GMK.js} +14 -14
  3. package/dist/Calculator-Y566OMJZ.js +29 -0
  4. package/dist/{CurrencyConverter-HEAAQX23.js → CurrencyConverter-2GUEE7ZR.js} +6 -6
  5. package/dist/{Documents-NSPKXCTF.js → Documents-GI346UL5.js} +12 -12
  6. package/dist/{Files-5HAUE2PR.js → Files-UA23KXN7.js} +54 -54
  7. package/dist/{Notepad-5LSFAYXO.js → Notepad-HRZKLHO3.js} +9 -9
  8. package/dist/{PomodoroTimer-5V32QOCZ.js → PomodoroTimer-QYCTTTPZ.js} +68 -68
  9. package/dist/{Preview-PDVZZRSK.js → Preview-LSGN5GN7.js} +29 -29
  10. package/dist/Sidebar-2P26444H.js +44 -0
  11. package/dist/{Spreadsheet-K4IAI3A2.js → Spreadsheet-7JBZY6KJ.js} +9 -9
  12. package/dist/{Stock-AOCHAKUF.js → Stock-ZVQT25IE.js} +3 -3
  13. package/dist/{Weather-F2QHTG32.js → Weather-RAUDLLVU.js} +17 -17
  14. package/dist/{WorldClock-G72577HU.js → WorldClock-2XBWZ6SZ.js} +6 -6
  15. package/dist/ai/index.d.ts +76 -1
  16. package/dist/ai/index.js +70 -52
  17. package/dist/ai.css +1 -1
  18. package/dist/apps/index.js +1 -1
  19. package/dist/bin/media-host-check.js +1 -1
  20. package/dist/bin/ui-check.js +1 -1
  21. package/dist/brand.css +1 -1
  22. package/dist/charts/BoxPlotChart.js +1 -1
  23. package/dist/charts/CandlestickChart.js +1 -1
  24. package/dist/charts/ChartTooltip.js +1 -1
  25. package/dist/charts/ChordChart.js +1 -1
  26. package/dist/charts/ColumnChart.js +1 -1
  27. package/dist/charts/FunnelChart.js +1 -1
  28. package/dist/charts/HeatmapChart.js +1 -1
  29. package/dist/charts/HistogramChart.js +1 -1
  30. package/dist/charts/PieChart.js +1 -1
  31. package/dist/charts/RadarChart.js +1 -1
  32. package/dist/charts/RadialBarChart.js +1 -1
  33. package/dist/charts/RangeChart.js +1 -1
  34. package/dist/charts/SankeyChart.js +1 -1
  35. package/dist/charts/ScatterChart.js +1 -1
  36. package/dist/charts/SpecChart.js +1 -1
  37. package/dist/charts/SunburstChart.js +1 -1
  38. package/dist/charts/TimeSeriesChart.js +1 -1
  39. package/dist/charts/TreemapChart.js +1 -1
  40. package/dist/charts/WaterfallChart.js +1 -1
  41. package/dist/{chunk-4U57ANZF.js → chunk-2SY76NFO.js} +1 -1
  42. package/dist/{chunk-N2RHM432.js → chunk-2VGQS6CW.js} +1 -1
  43. package/dist/{chunk-SQCUN2DX.js → chunk-34URULVW.js} +1 -1
  44. package/dist/{chunk-5LCDCO46.js → chunk-3ELLBQPS.js} +1 -1
  45. package/dist/{chunk-NZCSLS4O.js → chunk-3LDXURVU.js} +3 -3
  46. package/dist/{chunk-NZQCDFDG.js → chunk-3NW5LD7D.js} +3 -3
  47. package/dist/{chunk-N3YBOXOF.js → chunk-4G2C6J4I.js} +1 -1
  48. package/dist/{chunk-FQIA5BTN.js → chunk-4QJOEHM6.js} +7 -7
  49. package/dist/{chunk-V2MIQ4GJ.js → chunk-4UKGVLFP.js} +2 -2
  50. package/dist/{chunk-FRVNDEV2.js → chunk-4WEFGKJL.js} +8 -8
  51. package/dist/{chunk-LVBO2OMQ.js → chunk-57HN6MPC.js} +2 -2
  52. package/dist/{chunk-2RAOWHHM.js → chunk-5UYZ75F3.js} +12 -12
  53. package/dist/{chunk-ZL5OSF26.js → chunk-6AS5PHHK.js} +18 -18
  54. package/dist/{chunk-Q3IR5SKD.js → chunk-6XBWM453.js} +1 -1
  55. package/dist/{chunk-CDA2VXBN.js → chunk-74OUAR6L.js} +6 -6
  56. package/dist/{chunk-ARCQYF7G.js → chunk-7HLC352T.js} +2 -2
  57. package/dist/{chunk-B25RVAVS.js → chunk-7HTRLRVO.js} +64 -64
  58. package/dist/{chunk-G4JTO5PB.js → chunk-7JGR7WPD.js} +1 -1
  59. package/dist/{chunk-RFEET2LS.js → chunk-7NBSBGLX.js} +1 -1
  60. package/dist/{chunk-S52GQQVB.js → chunk-7TNAOZZ2.js} +1 -1
  61. package/dist/{chunk-AJFR35CO.js → chunk-7UTPXU6K.js} +4 -4
  62. package/dist/{chunk-NBB2RKDH.js → chunk-7X5FABQS.js} +5 -5
  63. package/dist/chunk-7XYTJPWW.js +29 -0
  64. package/dist/{chunk-IC7BEFE3.js → chunk-7ZP64SC7.js} +1 -1
  65. package/dist/{chunk-YLGQ6ACR.js → chunk-AJO72CPB.js} +1 -1
  66. package/dist/{chunk-4XS32UWF.js → chunk-AOK3BHRT.js} +4 -4
  67. package/dist/{chunk-SSM3EN7G.js → chunk-B7UCXROE.js} +1 -1
  68. package/dist/chunk-BNJWZAQE.js +12 -0
  69. package/dist/{chunk-HL3DJTIC.js → chunk-CBEKJTXU.js} +7 -7
  70. package/dist/{chunk-NWURIQI3.js → chunk-CKKUFDZ3.js} +3 -3
  71. package/dist/chunk-COJYPNKF.js +2 -0
  72. package/dist/{chunk-ZLSUQAD3.js → chunk-CPZ42W2B.js} +1 -1
  73. package/dist/{chunk-ZL7O4KGQ.js → chunk-CQV3VSI2.js} +1 -1
  74. package/dist/{chunk-5LXT3IUL.js → chunk-D4I3U7UE.js} +1 -1
  75. package/dist/{chunk-7PSIPTOE.js → chunk-D7F442OZ.js} +1 -1
  76. package/dist/chunk-DESWIPOZ.js +3 -0
  77. package/dist/{chunk-KJCTXWF7.js → chunk-DRDYZ633.js} +2 -2
  78. package/dist/{chunk-FJYTYW6M.js → chunk-DWR7MYQU.js} +5 -5
  79. package/dist/{chunk-EYEB3J77.js → chunk-E3753CWP.js} +5 -5
  80. package/dist/chunk-EU3JZGV2.js +14 -0
  81. package/dist/{chunk-55W5TTKS.js → chunk-FEQDZTZ7.js} +6 -6
  82. package/dist/{chunk-LWEWURFT.js → chunk-FWVC4A2O.js} +13 -13
  83. package/dist/{chunk-WZ5QSSUM.js → chunk-G4GVLK44.js} +6 -6
  84. package/dist/{chunk-5N5AAYQV.js → chunk-GISDIVFK.js} +1 -1
  85. package/dist/{chunk-N4REWGMM.js → chunk-GPJO34QP.js} +8 -8
  86. package/dist/{chunk-FFZREKEF.js → chunk-H32EQG5Z.js} +9 -9
  87. package/dist/{chunk-PUBJ5YHQ.js → chunk-I2XGPTCN.js} +1 -1
  88. package/dist/chunk-I4VIEGCX.js +2 -0
  89. package/dist/{chunk-ZZTCYEQ4.js → chunk-IKNG7EFQ.js} +7 -7
  90. package/dist/{chunk-OSVY6SUO.js → chunk-ISJPW2FZ.js} +5 -5
  91. package/dist/{chunk-POQ4ETLL.js → chunk-JGTGQGHY.js} +1 -1
  92. package/dist/{chunk-RSS2ALHH.js → chunk-JJW43QPS.js} +5 -5
  93. package/dist/chunk-JSGQWVYH.js +7 -0
  94. package/dist/{chunk-HRPXJ4EI.js → chunk-K4ANB6AF.js} +1 -1
  95. package/dist/{chunk-CHAWFMV4.js → chunk-KTA77U3P.js} +4 -4
  96. package/dist/{chunk-OAT7OEWP.js → chunk-KTVXPGGB.js} +8 -8
  97. package/dist/{chunk-CFAELIKH.js → chunk-L4IW77TD.js} +6 -6
  98. package/dist/{chunk-ZHPHNQKM.js → chunk-LCJRTJXT.js} +7 -7
  99. package/dist/{chunk-FUVVO6YP.js → chunk-LDE5IV2M.js} +1 -1
  100. package/dist/{chunk-TXNCDDB4.js → chunk-LO5T2K4B.js} +3 -3
  101. package/dist/chunk-LU6NA4RU.js +5 -0
  102. package/dist/{chunk-ZI6SMZJ4.js → chunk-MHB52H2Y.js} +11 -11
  103. package/dist/{chunk-FGJOGBGZ.js → chunk-MNSKGMVZ.js} +8 -8
  104. package/dist/{chunk-AJFWBEIG.js → chunk-MTEFYFUO.js} +9 -9
  105. package/dist/{chunk-S5SRXI4V.js → chunk-MVZRZTQP.js} +1 -1
  106. package/dist/{chunk-MMQ6ETRD.js → chunk-N67QX3WW.js} +2 -2
  107. package/dist/{chunk-M5LR7ZZX.js → chunk-O6JJIR4H.js} +1 -1
  108. package/dist/{chunk-G7QK7WAK.js → chunk-PCFBDXLN.js} +1 -1
  109. package/dist/chunk-PJQGYKN6.js +11 -0
  110. package/dist/chunk-PN5FQVMB.js +7 -0
  111. package/dist/chunk-PN65IIYN.js +8 -0
  112. package/dist/chunk-PUF75SMJ.js +1 -0
  113. package/dist/{chunk-AJVUND5A.js → chunk-PVZGSCCB.js} +6 -6
  114. package/dist/{chunk-B37JVKW5.js → chunk-PYAJCN2Q.js} +1 -1
  115. package/dist/chunk-Q6YNMNUH.js +6 -0
  116. package/dist/{chunk-YFMZKTJC.js → chunk-QDQ347RL.js} +1 -1
  117. package/dist/{chunk-4VTJEKHX.js → chunk-QHOBK35Y.js} +1 -1
  118. package/dist/{chunk-66XPG5G3.js → chunk-QYSEYYV7.js} +1 -1
  119. package/dist/chunk-RCPFUDPS.js +4 -0
  120. package/dist/{chunk-25M7CYCR.js → chunk-RLJHRDDW.js} +8 -8
  121. package/dist/{chunk-6BB6A5OB.js → chunk-RPYFOQM2.js} +5 -5
  122. package/dist/chunk-RRUHQLUY.js +14 -0
  123. package/dist/{chunk-ESYYKGN4.js → chunk-S6FBMSFU.js} +2 -2
  124. package/dist/{chunk-5FRFSPQ2.js → chunk-SDQIXE5M.js} +8 -8
  125. package/dist/{chunk-PB3OC4BO.js → chunk-SG4LO2AN.js} +8 -8
  126. package/dist/{chunk-U2WCV56F.js → chunk-SHKBDFSE.js} +1 -1
  127. package/dist/{chunk-ZMRGHVKS.js → chunk-TKJBZIHT.js} +1 -1
  128. package/dist/{chunk-EHGGSUXA.js → chunk-TM33D3CE.js} +1 -1
  129. package/dist/chunk-TMNAHOJ7.js +9 -0
  130. package/dist/{chunk-GKIU55T5.js → chunk-TVH7IZQ4.js} +2 -2
  131. package/dist/{chunk-EQZZ4V5X.js → chunk-TXDA7TTP.js} +1 -1
  132. package/dist/{chunk-SOGQZVPJ.js → chunk-UBMY23AG.js} +5 -5
  133. package/dist/{chunk-KKOADH55.js → chunk-UDRMZ22J.js} +1 -1
  134. package/dist/{chunk-36R3R3IB.js → chunk-ULXCDM7Y.js} +4 -4
  135. package/dist/{chunk-MCYFUIXH.js → chunk-UWIZX3RK.js} +1 -1
  136. package/dist/{chunk-SP2AUVIU.js → chunk-UYRITNQW.js} +3 -3
  137. package/dist/{chunk-OET2Q7P6.js → chunk-VNACNNCJ.js} +3 -3
  138. package/dist/{chunk-UWIFXNH6.js → chunk-VTFZ6W2D.js} +3 -3
  139. package/dist/chunk-W35N7SL3.js +8 -0
  140. package/dist/{chunk-UPCLAEKC.js → chunk-W3OWPBQL.js} +2 -2
  141. package/dist/chunk-W4OBVKN4.js +1 -0
  142. package/dist/chunk-W6URVLQF.js +20 -0
  143. package/dist/{chunk-EK5WJQTR.js → chunk-WB4P4QE2.js} +1 -1
  144. package/dist/{chunk-XPPLCLYK.js → chunk-WINNA7LS.js} +1 -1
  145. package/dist/chunk-WMEYNKXZ.js +22 -0
  146. package/dist/{chunk-A267MPGS.js → chunk-X6BFVDB4.js} +2 -2
  147. package/dist/{chunk-5JU53T3U.js → chunk-XZGGJHJC.js} +8 -8
  148. package/dist/chunk-Y3R267FV.js +15 -0
  149. package/dist/{chunk-XJUREXYW.js → chunk-YOSUCCHG.js} +3 -3
  150. package/dist/chunk-ZZVE64OI.js +2 -0
  151. package/dist/data/DataTable.js +1 -1
  152. package/dist/data/Kanban.js +1 -1
  153. package/dist/data/ListLoadError.js +1 -1
  154. package/dist/format/index.js +1 -1
  155. package/dist/forms/AlignmentGrid.js +1 -1
  156. package/dist/forms/BorderInput.js +1 -1
  157. package/dist/forms/BrandAssetEditor.js +1 -1
  158. package/dist/forms/Button.js +1 -1
  159. package/dist/forms/ColorPicker.js +1 -1
  160. package/dist/forms/ComposerAttachments.js +1 -1
  161. package/dist/forms/CornersInput.js +1 -1
  162. package/dist/forms/DatePicker.js +1 -1
  163. package/dist/forms/DateRangePicker.js +1 -1
  164. package/dist/forms/DisplayChips.js +1 -1
  165. package/dist/forms/FilePicker.js +1 -1
  166. package/dist/forms/IconButton.js +1 -1
  167. package/dist/forms/IconPicker.js +1 -1
  168. package/dist/forms/InputNumber.js +1 -1
  169. package/dist/forms/LinkPicker.js +1 -1
  170. package/dist/forms/MediaLibrary.js +1 -1
  171. package/dist/forms/MediaUploadField.js +1 -1
  172. package/dist/forms/MediaUploadGrid.js +1 -1
  173. package/dist/forms/MediaUsedInList.js +1 -1
  174. package/dist/forms/NumericKeypad.js +1 -1
  175. package/dist/forms/PictureTiles.js +1 -1
  176. package/dist/forms/PositionInput.js +1 -1
  177. package/dist/forms/Segmented.js +1 -1
  178. package/dist/forms/Select.js +1 -1
  179. package/dist/forms/SidesInput.js +1 -1
  180. package/dist/forms/Slider.js +1 -1
  181. package/dist/forms/Snippet.js +1 -1
  182. package/dist/forms/SplitButton.js +1 -1
  183. package/dist/forms/TagInput.js +1 -1
  184. package/dist/forms/TextToolbar.js +1 -1
  185. package/dist/forms/WidthsBar.js +1 -1
  186. package/dist/hooks/useTheme.d.ts +1 -1
  187. package/dist/icons/index.js +1 -1
  188. package/dist/index.d.ts +3 -3
  189. package/dist/index.js +247 -247
  190. package/dist/map/index.js +7 -7
  191. package/dist/page-tabs/index.js +5 -5
  192. package/dist/shell/AppUpdateBanner.js +1 -1
  193. package/dist/shell/ColoredBadge.js +1 -1
  194. package/dist/shell/ConfirmDialog.js +1 -1
  195. package/dist/shell/ContextMenu.js +1 -1
  196. package/dist/shell/Dialog.js +1 -1
  197. package/dist/shell/Drawer.js +1 -1
  198. package/dist/shell/DropdownMenu.js +1 -1
  199. package/dist/shell/EditableGrid.js +1 -1
  200. package/dist/shell/FloatingBar.js +1 -1
  201. package/dist/shell/GlobalSearch.js +1 -1
  202. package/dist/shell/HelpCenter.js +1 -1
  203. package/dist/shell/IconRail.js +1 -1
  204. package/dist/shell/ImageLightbox.js +1 -1
  205. package/dist/shell/ItemCount.js +1 -1
  206. package/dist/shell/LanguageSelect.js +1 -1
  207. package/dist/shell/Markdown.js +1 -1
  208. package/dist/shell/MilestoneTimeline.js +1 -1
  209. package/dist/shell/Popover.js +1 -1
  210. package/dist/shell/PopupMenu.js +1 -1
  211. package/dist/shell/ProductionTimeline.js +1 -1
  212. package/dist/shell/ResizeHandle.js +1 -1
  213. package/dist/shell/SearchableSelect.js +1 -1
  214. package/dist/shell/SettingReset.js +1 -1
  215. package/dist/shell/SettingRow.js +1 -1
  216. package/dist/shell/SidebarLayout.js +1 -1
  217. package/dist/shell/SidebarNav.js +1 -1
  218. package/dist/shell/SortableList.js +1 -1
  219. package/dist/shell/StatusBadge.js +1 -1
  220. package/dist/shell/Tabs.js +1 -1
  221. package/dist/shell/TimelineTrack.js +1 -1
  222. package/dist/shell/Tooltip.js +1 -1
  223. package/dist/shell/TopNav.js +1 -1
  224. package/dist/shell/TransferProgress.js +1 -1
  225. package/dist/shell/Tree.js +1 -1
  226. package/dist/shell/discardGuard.js +1 -1
  227. package/dist/telemetry/index.js +1 -1
  228. package/dist/templates/AuthScreen.js +1 -1
  229. package/dist/templates/ChatTemplate.js +1 -1
  230. package/dist/templates/CheckoutTemplate.js +1 -1
  231. package/dist/templates/DashboardTemplate.js +1 -1
  232. package/dist/templates/DataTablePage.js +1 -1
  233. package/dist/templates/EmailTemplate.js +1 -1
  234. package/dist/templates/ErrorBoundary.d.ts +1 -1
  235. package/dist/templates/ErrorBoundary.js +1 -1
  236. package/dist/templates/FormLayoutPage.js +1 -1
  237. package/dist/templates/GalleryTemplate.js +1 -1
  238. package/dist/ui/index.js +1 -1
  239. package/dist/version.js +1 -1
  240. package/package.json +1 -1
  241. package/dist/Calculator-MV5JVQBS.js +0 -29
  242. package/dist/Sidebar-E3VDFBF6.js +0 -44
  243. package/dist/chunk-3GHTOSJP.js +0 -14
  244. package/dist/chunk-4AQ67NP2.js +0 -15
  245. package/dist/chunk-6WSH6D5N.js +0 -29
  246. package/dist/chunk-7LQGPMRP.js +0 -3
  247. package/dist/chunk-CNLYFW47.js +0 -9
  248. package/dist/chunk-EFU4Z66K.js +0 -8
  249. package/dist/chunk-FX6DBXXD.js +0 -1
  250. package/dist/chunk-HXNMRJQ4.js +0 -2
  251. package/dist/chunk-IFA2EOAF.js +0 -4
  252. package/dist/chunk-KMEERBZV.js +0 -2
  253. package/dist/chunk-KORKSPHQ.js +0 -6
  254. package/dist/chunk-LWWMRL2Y.js +0 -5
  255. package/dist/chunk-NLGMJGD6.js +0 -14
  256. package/dist/chunk-SCYL5V5X.js +0 -20
  257. package/dist/chunk-SM7IDX7Y.js +0 -1
  258. package/dist/chunk-TIPU74XW.js +0 -22
  259. package/dist/chunk-UUKTYAWY.js +0 -7
  260. package/dist/chunk-V6F42DX3.js +0 -11
  261. package/dist/chunk-VWEG2WM4.js +0 -12
  262. package/dist/chunk-XIB72X74.js +0 -2
  263. package/dist/chunk-ZE5TNYWX.js +0 -7
  264. package/dist/chunk-ZO244TWH.js +0 -8
  265. /package/dist/{chunk-ID6WFAXW.js → chunk-N3TOHWFF.js} +0 -0
@@ -1,2 +1,2 @@
1
- import{Tooltip as e}from"./chunk-Q3IR5SKD.js";import{useBrowserLayoutEffect as r}from"./chunk-D65T4H6J.js";import{useShellStrings as t}from"./chunk-4PAWQEXM.js";import{useRef as o,useEffect as n,useCallback as i}from"react";import{jsx as s}from"react/jsx-runtime";var a=(e,r,t)=>Math.min(t,Math.max(r,e));function l(e,r,t,o,n){return Math.round(a("left"===t||"top"===t?e+r:e-r,o,n))}function u(e,r,t){let o=null;try{o=window.localStorage.getItem(e)}catch{return null}const n=o?parseInt(o,10):NaN;return Number.isNaN(n)?null:a(n,r,t)}function c({width:c,onResize:d,orientation:h="vertical",side:m,min:f,max:p,defaultWidth:v=f,step:g=16,storageKey:b,label:w,hint:z,controls:y,className:x=""}){const P="horizontal"===h,k=t().resizeHandle,N=o(null),D=o({onResize:d,min:f,max:p,side:m});D.current={onResize:d,min:f,max:p,side:m},r(()=>{if(!b)return;const e=u(b,f,p);null!==e&&e!==c&&d(e)},[b]),n(()=>{if(!b)return;const e=window.setTimeout(()=>{try{window.localStorage.setItem(b,String(Math.round(c)))}catch{}},200);return()=>window.clearTimeout(e)},[c,b]);const M=i(()=>{N.current=null,document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")},[]);n(()=>M,[M]);const I=e=>{N.current&&(e.currentTarget.hasPointerCapture?.(N.current.pointer)&&e.currentTarget.releasePointerCapture(N.current.pointer),M())},C="left"===m?"right-0":"right"===m?"left-0":"top"===m?"bottom-0":"top-0",R="left"===m?"right":"right"===m?"left":"top"===m?"bottom":"top",T=P?`absolute inset-x-0 ${C} z-10 flex h-2`:`absolute inset-y-0 ${C} z-10 flex w-2`;/* @__PURE__ */
2
- return s(e,{content:z??k.hint,side:R,delay:600,className:`${T} ${x}`.trim(),children:/* @__PURE__ */s("div",{role:"separator",tabIndex:0,"aria-orientation":h,"aria-label":w??k.label,"aria-valuenow":Math.round(c),"aria-valuemin":f,"aria-valuemax":p,"aria-controls":y,"data-resize-handle":m,onPointerDown:e=>{0===e.button&&(e.preventDefault(),N.current={x:P?e.clientY:e.clientX,width:c,moved:!1,pointer:e.pointerId},e.currentTarget.setPointerCapture?.(e.pointerId),document.body.style.cursor=P?"row-resize":"col-resize",document.body.style.userSelect="none")},onPointerMove:e=>{const r=N.current;if(!r)return;if(0===e.buttons)return void M();const t=(P?e.clientY:e.clientX)-r.x;if(!r.moved){if(Math.abs(t)<3)return;r.moved=!0}const{onResize:o,min:n,max:i,side:s}=D.current;o(l(r.width,t,s,n,i))},onPointerUp:I,onPointerCancel:I,onLostPointerCapture:()=>{N.current&&M()},onDoubleClick:()=>d(a(v,f,p)),onKeyDown:e=>{const r=P?"ArrowDown":"ArrowRight",t=P?"ArrowUp":"ArrowLeft",o=e.key===r?g:e.key===t?-g:null,n=null!==o?l(c,o,m,f,p):"Home"===e.key?f:"End"===e.key?p:"Enter"===e.key?a(v,f,p):null;null!==n&&(e.preventDefault(),n!==c&&d(n))},className:P?"group/resize relative h-full w-full cursor-row-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"group/resize relative h-full w-full cursor-col-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */s("div",{"aria-hidden":"true",className:P?`absolute inset-x-0 ${C} h-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:h-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`:`absolute inset-y-0 ${C} w-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:w-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`})})})}export{c as ResizeHandle,u as readStoredWidth,l as resizedWidth};
1
+ import{Tooltip as e}from"./chunk-6XBWM453.js";import{useBrowserLayoutEffect as r}from"./chunk-D65T4H6J.js";import{useShellStrings as t}from"./chunk-4PAWQEXM.js";import{useRef as o,useEffect as n,useCallback as i}from"react";import{jsx as s}from"react/jsx-runtime";var a=(e,r,t)=>Math.min(t,Math.max(r,e));function l(e,r,t,o,n){return Math.round(a("left"===t||"top"===t?e+r:e-r,o,n))}function u(e,r,t){let o=null;try{o=window.localStorage.getItem(e)}catch{return null}const n=o?parseInt(o,10):NaN;return Number.isNaN(n)?null:a(n,r,t)}function c({width:c,onResize:d,orientation:h="vertical",side:m,min:f,max:p,defaultWidth:v=f,step:g=16,storageKey:b,label:w,hint:z,controls:y,className:x=""}){const P="horizontal"===h,k=t().resizeHandle,M=o(null),N=o({onResize:d,min:f,max:p,side:m});N.current={onResize:d,min:f,max:p,side:m},r(()=>{if(!b)return;const e=u(b,f,p);null!==e&&e!==c&&d(e)},[b]),n(()=>{if(!b)return;const e=window.setTimeout(()=>{try{window.localStorage.setItem(b,String(Math.round(c)))}catch{}},200);return()=>window.clearTimeout(e)},[c,b]);const D=i(()=>{M.current=null,document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")},[]);n(()=>D,[D]);const C=e=>{M.current&&(e.currentTarget.hasPointerCapture?.(M.current.pointer)&&e.currentTarget.releasePointerCapture(M.current.pointer),D())},I="left"===m?"right-0":"right"===m?"left-0":"top"===m?"bottom-0":"top-0",T="left"===m?"right":"right"===m?"left":"top"===m?"bottom":"top",$=P?`absolute inset-x-0 ${I} z-10 flex h-2`:`absolute inset-y-0 ${I} z-10 flex w-2`;/* @__PURE__ */
2
+ return s(e,{content:z??k.hint,side:T,delay:600,className:`${$} ${x}`.trim(),children:/* @__PURE__ */s("div",{role:"separator",tabIndex:0,"aria-orientation":h,"aria-label":w??k.label,"aria-valuenow":Math.round(c),"aria-valuemin":f,"aria-valuemax":p,"aria-controls":y,"data-resize-handle":m,onPointerDown:e=>{0===e.button&&(e.preventDefault(),M.current={x:P?e.clientY:e.clientX,width:c,moved:!1,pointer:e.pointerId},e.currentTarget.setPointerCapture?.(e.pointerId),document.body.style.cursor=P?"row-resize":"col-resize",document.body.style.userSelect="none")},onPointerMove:e=>{const r=M.current;if(!r)return;if(0===e.buttons)return void D();const t=(P?e.clientY:e.clientX)-r.x;if(!r.moved){if(Math.abs(t)<3)return;r.moved=!0}const{onResize:o,min:n,max:i,side:s}=N.current;o(l(r.width,t,s,n,i))},onPointerUp:C,onPointerCancel:C,onLostPointerCapture:()=>{M.current&&D()},onDoubleClick:()=>d(a(v,f,p)),onKeyDown:e=>{const r=P?"ArrowDown":"ArrowRight",t=P?"ArrowUp":"ArrowLeft",o=e.key===r?g:e.key===t?-g:null,n=null!==o?l(c,o,m,f,p):"Home"===e.key?f:"End"===e.key?p:"Enter"===e.key?a(v,f,p):null;null!==n&&(e.preventDefault(),n!==c&&d(n))},className:P?"group/resize relative h-full w-full cursor-row-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"group/resize relative h-full w-full cursor-col-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */s("div",{"aria-hidden":"true",className:P?`absolute inset-x-0 ${I} h-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:h-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`:`absolute inset-y-0 ${I} w-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:w-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`})})})}export{c as ResizeHandle,u as readStoredWidth,l as resizedWidth};
@@ -1,7 +1,7 @@
1
- import{writeClipboard as e}from"./chunk-MQU3PZUS.js";import{IconButton_default as r}from"./chunk-FX6DBXXD.js";import{toast_default as t}from"./chunk-AKM6JBMD.js";import{Icon as n}from"./chunk-2UO47XB4.js";import{useShellStrings as a}from"./chunk-4PAWQEXM.js";import{useState as i,useRef as o,useEffect as c,useCallback as l}from"react";import{jsxs as m,jsx as s,Fragment as d}from"react/jsx-runtime";var u={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},p={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function b(){/* @__PURE__ */
1
+ import{writeClipboard as e}from"./chunk-MQU3PZUS.js";import{IconButton_default as r}from"./chunk-PUF75SMJ.js";import{toast_default as t}from"./chunk-AKM6JBMD.js";import{Icon as n}from"./chunk-2UO47XB4.js";import{useShellStrings as a}from"./chunk-4PAWQEXM.js";import{useState as i,useRef as o,useEffect as c,useCallback as l}from"react";import{jsxs as m,jsx as s,Fragment as d}from"react/jsx-runtime";var u={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},p={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function b(){/* @__PURE__ */
2
2
  return s(n,{name:"copy",className:"h-4 w-4","aria-hidden":"true"})}function h(){/* @__PURE__ */
3
- return s(n,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:n,children:y,symbol:f,label:x,size:g="md",variant:k="bordered",hideCopyButton:v=!1,onCopy:w,multiline:N=!1,id:j,"aria-describedby":B,className:X=""}){const[M,C]=i(!1),D=o(null),T=a().copy;c(()=>()=>{D.current&&clearTimeout(D.current)},[]);const U=l(async()=>{await e(n)?(C(!0),D.current&&clearTimeout(D.current),D.current=setTimeout(()=>{C(!1),D.current=null},2e3),w?.(n)):t.error(T.failed)},[n,w,T]),{box:A,button:P}=p[g],Q=!v;/* @__PURE__ */
4
- return m("div",{id:Q?void 0:j,"aria-describedby":Q?void 0:B,className:["inline-flex max-w-full items-center rounded-md",u[k],A,X].filter(Boolean).join(" "),children:[null!=f&&""!==f&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:f}),
3
+ return s(n,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:n,children:y,symbol:f,label:x,size:g="md",variant:k="bordered",hideCopyButton:v=!1,onCopy:w,multiline:N=!1,id:j,"aria-describedby":M,className:B=""}){const[U,C]=i(!1),P=o(null),T=a().copy;c(()=>()=>{P.current&&clearTimeout(P.current)},[]);const A=l(async()=>{await e(n)?(C(!0),P.current&&clearTimeout(P.current),P.current=setTimeout(()=>{C(!1),P.current=null},2e3),w?.(n)):t.error(T.failed)},[n,w,T]),{box:J,button:Q}=p[g],S=!v;/* @__PURE__ */
4
+ return m("div",{id:S?void 0:j,"aria-describedby":S?void 0:M,className:["inline-flex max-w-full items-center rounded-md",u[k],J,B].filter(Boolean).join(" "),children:[null!=f&&""!==f&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:f}),
5
5
  /* @__PURE__ */s("span",{className:"min-w-0 font-mono text-gray-800 "+(N?"whitespace-pre-wrap break-all":"truncate"),title:N?void 0:n,children:y??n}),!v&&/* @__PURE__ */m(d,{children:[
6
- /* @__PURE__ */s(r,{id:j,"aria-label":x?T.copyLabel(x):T.copy,"aria-describedby":B,onClick:U,className:`${P} text-gray-400`,children:/* @__PURE__ */s(M?h:b,{})}),
7
- /* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:M?T.copied:""})]})]})}export{y as Snippet};
6
+ /* @__PURE__ */s(r,{id:j,"aria-label":x?T.copyLabel(x):T.copy,"aria-describedby":M,onClick:A,className:`${Q} text-gray-400`,children:/* @__PURE__ */s(U?h:b,{})}),
7
+ /* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:U?T.copied:""})]})]})}export{y as Snippet};
@@ -1,12 +1,12 @@
1
- import{CloseGlyph as e}from"./chunk-SSM3EN7G.js";import{IconButton_default as t}from"./chunk-FX6DBXXD.js";import{humanSize as n,useFileIntake as r,FileIntakeAlert as a}from"./chunk-6RX4PVBU.js";import{Button_default as s}from"./chunk-HXNMRJQ4.js";import{Icon as i}from"./chunk-2UO47XB4.js";import{useShellStrings as c}from"./chunk-4PAWQEXM.js";import{useRef as l,useEffect as o}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function m({className:e="h-4 w-4"}){/* @__PURE__ */
1
+ import{IconButton_default as e}from"./chunk-PUF75SMJ.js";import{CloseGlyph as t}from"./chunk-B7UCXROE.js";import{humanSize as n,useFileIntake as r,FileIntakeAlert as a}from"./chunk-6RX4PVBU.js";import{Button_default as s}from"./chunk-I4VIEGCX.js";import{Icon as i}from"./chunk-2UO47XB4.js";import{useShellStrings as c}from"./chunk-4PAWQEXM.js";import{useRef as l,useEffect as o}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function m({className:e="h-4 w-4"}){/* @__PURE__ */
2
2
  return d(i,{name:"attach",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function p({className:e="h-4 w-4"}){/* @__PURE__ */
3
3
  return d(i,{name:"page",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function h({intake:e,dropLabel:t,className:n="",children:r}){const a=c().files;/* @__PURE__ */
4
4
  return u("div",{...e.zoneProps,...e.pasteProps,className:`relative ${n}`,children:[r,
5
- /* @__PURE__ */d("input",{...e.inputProps}),e.dragOver&&/* @__PURE__ */d("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-lg border-2 border-dashed border-blue-500 bg-blue-50/80 text-sm font-medium text-blue-600",children:t??a.drop})]})}function f({files:t,onRemove:r,disabled:a=!1,className:s=""}){const i=c().files,m=l(/* @__PURE__ */new Map);o(()=>{const e=new Set(t);for(const[t,n]of m.current)e.has(t)||(URL.revokeObjectURL(n),m.current.delete(t))},[t]),o(()=>()=>{for(const e of m.current.values())URL.revokeObjectURL(e);m.current.clear()},[]);const h=e=>{if(!e.type.startsWith("image/")||"undefined"==typeof URL||"function"!=typeof URL.createObjectURL)return null;let t=m.current.get(e);return t||(t=URL.createObjectURL(e),m.current.set(e,t)),t};return 0===t.length?null:/* @__PURE__ */d("ul",{className:`flex flex-wrap gap-2 ${s}`,children:t.map((t,s)=>{const c=h(t);/* @__PURE__ */
5
+ /* @__PURE__ */d("input",{...e.inputProps}),e.dragOver&&/* @__PURE__ */d("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-lg border-2 border-dashed border-blue-500 bg-blue-50/80 text-sm font-medium text-blue-600",children:t??a.drop})]})}function f({files:e,onRemove:r,disabled:a=!1,className:s=""}){const i=c().files,m=l(/* @__PURE__ */new Map);o(()=>{const t=new Set(e);for(const[e,n]of m.current)t.has(e)||(URL.revokeObjectURL(n),m.current.delete(e))},[e]),o(()=>()=>{for(const e of m.current.values())URL.revokeObjectURL(e);m.current.clear()},[]);const h=e=>{if(!e.type.startsWith("image/")||"undefined"==typeof URL||"function"!=typeof URL.createObjectURL)return null;let t=m.current.get(e);return t||(t=URL.createObjectURL(e),m.current.set(e,t)),t};return 0===e.length?null:/* @__PURE__ */d("ul",{className:`flex flex-wrap gap-2 ${s}`,children:e.map((e,s)=>{const c=h(e);/* @__PURE__ */
6
6
  return u("li",{className:"flex max-w-full items-center gap-2 rounded-md border border-line bg-surface-sunken py-1 pl-2 pr-1 text-xs text-ink",children:[c?/* @__PURE__ */d("img",{src:c,alt:"",className:"h-6 w-6 shrink-0 rounded object-cover"}):/* @__PURE__ */d("span",{className:"text-gray-400",children:/* @__PURE__ */d(p,{})}),
7
- /* @__PURE__ */d("span",{className:"min-w-0 truncate",title:t.name,children:t.name}),
8
- /* @__PURE__ */d("span",{className:"shrink-0 tabular-nums text-gray-400",children:n(t.size,i)}),r&&/* @__PURE__ */d("button",{type:"button",disabled:a,onClick:()=>r(s),"aria-label":i.remove(t.name),className:"shrink-0 rounded p-0.5 text-gray-400 hover:bg-gray-200 hover:text-gray-600 disabled:cursor-not-allowed",children:/* @__PURE__ */d(e,{className:"h-3.5 w-3.5"})})]},`${t.name}-${t.size}-${s}`)})})}function b({onClick:e,count:n=0,variant:r="button",label:a,disabled:i=!1}){const l=c().files,o=a??l.attach,p=n>0?`${o} (${n})`:o;return"icon"===r?/* @__PURE__ */u("span",{className:"relative inline-flex",children:[
9
- /* @__PURE__ */d(t,{"aria-label":p,onClick:e,disabled:i,size:"sm",children:/* @__PURE__ */d(m,{})}),n>0&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-accent-fill px-1 text-center text-2xs font-semibold leading-4 text-on-accent",children:n})]}):/* @__PURE__ */d(s,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:i,leftIcon:/* @__PURE__ */d(m,{}),children:p})}function x({files:e,onChange:t,accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m=!1,dropLabel:p,attachLabel:x,trigger:g="button",actions:k,onReject:j,className:N="",children:v}){const L=r({accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m,multiple:!0,currentCount:e.length,onAccept:n=>t([...e,...n])}),y=l([]);return o(()=>{j&&L.rejections.length>0&&L.rejections!==y.current&&(y.current=L.rejections,j(L.rejections))},[L.rejections,j]),/* @__PURE__ */u(h,{intake:L,dropLabel:p,className:N,children:[v,
7
+ /* @__PURE__ */d("span",{className:"min-w-0 truncate",title:e.name,children:e.name}),
8
+ /* @__PURE__ */d("span",{className:"shrink-0 tabular-nums text-gray-400",children:n(e.size,i)}),r&&/* @__PURE__ */d("button",{type:"button",disabled:a,onClick:()=>r(s),"aria-label":i.remove(e.name),className:"shrink-0 rounded p-0.5 text-gray-400 hover:bg-gray-200 hover:text-gray-600 disabled:cursor-not-allowed",children:/* @__PURE__ */d(t,{className:"h-3.5 w-3.5"})})]},`${e.name}-${e.size}-${s}`)})})}function b({onClick:t,count:n=0,variant:r="button",label:a,disabled:i=!1}){const l=c().files,o=a??l.attach,p=n>0?`${o} (${n})`:o;return"icon"===r?/* @__PURE__ */u("span",{className:"relative inline-flex",children:[
9
+ /* @__PURE__ */d(e,{"aria-label":p,onClick:t,disabled:i,size:"sm",children:/* @__PURE__ */d(m,{})}),n>0&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-accent-fill px-1 text-center text-2xs font-semibold leading-4 text-on-accent",children:n})]}):/* @__PURE__ */d(s,{type:"button",variant:"secondary",size:"sm",onClick:t,disabled:i,leftIcon:/* @__PURE__ */d(m,{}),children:p})}function x({files:e,onChange:t,accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m=!1,dropLabel:p,attachLabel:x,trigger:g="button",actions:k,onReject:j,className:N="",children:v}){const L=r({accept:n,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m,multiple:!0,currentCount:e.length,onAccept:n=>t([...e,...n])}),y=l([]);return o(()=>{j&&L.rejections.length>0&&L.rejections!==y.current&&(y.current=L.rejections,j(L.rejections))},[L.rejections,j]),/* @__PURE__ */u(h,{intake:L,dropLabel:p,className:N,children:[v,
10
10
  /* @__PURE__ */d(f,{files:e,disabled:m,onRemove:n=>{L.clearRejections(),t(e.filter((e,t)=>t!==n))},className:"mt-2"}),
11
11
  /* @__PURE__ */u("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[
12
12
  /* @__PURE__ */d(b,{onClick:L.open,count:e.length,variant:g,label:x,disabled:m}),k]}),
@@ -0,0 +1,14 @@
1
+ import{useHighlight as e}from"./chunk-CNYAHYE6.js";import{ChartTooltip as t}from"./chunk-G4GVLK44.js";import{usePlotWidth as l}from"./chunk-MAFUXCPZ.js";import{resolveSeriesColor as a,CHART_INK as n,STATUS_VARS as r}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as i}from"./chunk-4PAWQEXM.js";import{formatPercent as u,formatPlain as h}from"./chunk-C3QOHMR6.js";import{useId as c,useState as m,useRef as s}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";function x({stages:x,shape:v="funnel",height:p,width:$,gap:g=4,minBandWidth:M=0,formatValue:y,color:b,className:k,emptyLabel:A}){const L=o().charts,N=i(),S=y??(e=>h(e,N)),j=A??L.noStages,z=c(),[V,W]=m(null),{highlighted:w}=e(),C=s(null),E=l(C,560),F=$??E;if(0===x.length)/* @__PURE__ */return d("p",{className:`text-sm text-gray-500 ${k??""}`,children:j});const Z=b??a(0),H=p??54*x.length,B=Math.max(...x.map(e=>e.value),1),G="bars"===v,P=G?Math.round(Math.min(132,Math.max(80,.24*F))):Math.round(Math.min(168,Math.max(104,.38*F))),Q=e=>{const t=x[e-1]?.value;return null!=t&&t>0?100*(1-x[e].value/t):null},R=e=>{const t=Q(e);return{count:S(x[e].value),drop:null!=t?`−${u(t,1,N)}`:""}},U=G?Math.ceil(Math.max(...x.map((e,t)=>{const{count:l,drop:a}=R(t);return.62*(l.length+(a?a.length+1:0))*12}))+16):0,X=F-P-U,Y=Math.max(G?2:0,Math.min(M,X)),K=e=>Math.max(Y,X*Math.max(0,e/B)),O=e=>K(e)/2,T=P+X/2,q=e=>46+e/Math.max(1,x.length-1)*54,D=e=>`color-mix(in oklab, ${Z} ${q(e).toFixed(0)}%, ${n.surface})`,I=e=>q(e)>=55?n.surface:n.label,J=(e,t)=>null!==V?V!==e:null!==w&&w!==t,_=null!==V?x[V]:void 0;/* @__PURE__ */
2
+ return f("div",{className:`relative ${k??""}`,ref:C,children:[
3
+ /* @__PURE__ */f("svg",{width:"100%",height:H,viewBox:`0 0 ${F} ${H}`,role:"img","aria-labelledby":z,onMouseLeave:()=>W(null),children:[
4
+ /* @__PURE__ */d("title",{id:z,children:L.funnel(x.length,S(x[0].value),S(x[x.length-1].value))}),x.map((e,t)=>{const l=t*H/x.length+g/2,a=(t+1)*H/x.length-g/2,r=(l+a)/2,o=u(e.value/(x[0].value||1)*100,0,N),i=.62*o.length*12+12;if(G){const u=P,h=u+K(e.value),{count:c,drop:m}=R(t);/* @__PURE__ */
5
+ return f("g",{opacity:J(t,e.key)?.45:1,onMouseEnter:()=>W(t),children:[
6
+ /* @__PURE__ */d("path",{d:`M${u},${l} L${h},${l} L${h},${a} L${u},${a} Z`,fill:D(t)}),
7
+ /* @__PURE__ */d("text",{x:P-12,y:r+4,textAnchor:"end",fontSize:12,fill:n.label,children:e.label}),h-u>=i&&/* @__PURE__ */d("text",{x:u+8,y:r+4,textAnchor:"start",fontSize:12,fontWeight:600,fill:I(t),style:{fontVariantNumeric:"tabular-nums"},children:o}),
8
+ /* @__PURE__ */f("text",{"data-funnel-value":"true",x:h+8,y:r+4,textAnchor:"start",fontSize:12,fill:n.label,style:{fontVariantNumeric:"tabular-nums"},children:[
9
+ /* @__PURE__ */d("tspan",{fontWeight:600,children:c}),m&&/* @__PURE__ */d("tspan",{fill:n.muted,children:` ${m}`})]})]},e.key)}const h=O(e.value),c="cone"===v?O(x[t+1]?.value??e.value):h,m=Q(t),s=2*Math.min(h,c)>=i;/* @__PURE__ */
10
+ return f("g",{opacity:J(t,e.key)?.45:1,onMouseEnter:()=>W(t),children:[
11
+ /* @__PURE__ */d("path",{d:`M${T-h},${l} L${T+h},${l} L${T+c},${a} L${T-c},${a} Z`,fill:D(t)}),
12
+ /* @__PURE__ */d("text",{x:P-14,y:r-2,textAnchor:"end",fontSize:12,fill:n.label,children:e.label}),
13
+ /* @__PURE__ */f("text",{x:P-14,y:r+14,textAnchor:"end",fontSize:11,fill:n.muted,style:{fontVariantNumeric:"tabular-nums"},children:[S(e.value),null!=m?` · −${u(m,1,N)}`:""]}),
14
+ /* @__PURE__ */d("text",{x:s?T:T+Math.max(h,c)+6,y:r+4,textAnchor:s?"middle":"start",fontSize:12,fontWeight:600,fill:s?I(t):n.label,style:{fontVariantNumeric:"tabular-nums"},children:o})]},e.key)})]}),_&&null!==V&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(t,{title:_.label,rows:[{key:"value",label:L.count,color:D(V),value:S(_.value)},{key:"share",label:L.ofFirstStage,color:n.muted,value:u(_.value/(x[0].value||1)*100,0,N)},...V>0&&x[V-1].value>0?[{key:"drop",label:L.droppedHere,color:r.critical,value:`−${u(100*(1-_.value/x[V-1].value),1,N)}`}]:[]]})})]})}export{x as FunnelChart};
@@ -1,9 +1,9 @@
1
- import{SidebarBarContext as e,SidebarSheetContext as l}from"./chunk-QWK6DRSN.js";import{readStoredWidth as r,ResizeHandle as t}from"./chunk-KJCTXWF7.js";import{useIsPhone as a}from"./chunk-UGTRSRIW.js";import{Icon as n}from"./chunk-2UO47XB4.js";import{useBrowserState as o}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-4PAWQEXM.js";import{useState as s,useRef as c,useReducer as d,useMemo as h,Fragment as u,useEffect as m}from"react";import{jsxs as f,jsx as p}from"react/jsx-runtime";var b=(e,l,r)=>Math.min(Math.max(e,l),r);function x({sidebar:e,sidebarTop:l,sidebarBottom:n,children:u,side:m="left",storageKey:x,defaultWidth:N=256,minWidth:w=180,maxWidth:k=480,className:y="",sidebarClassName:W=("right"===m?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:C="bg-white"}){const j="right"===m,z=i().sidebar,O=a(),P=function(){const[e,l]=s(!1),r=c(null),t=c(/* @__PURE__ */new Map),[,a]=d(e=>e+1,0),n=h(()=>({report(e,l,r){const n={label:l,el:r};return t.current.set(e,n),a(),()=>{t.current.get(e)===n&&(t.current.delete(e),a())}}}),[]);return{api:n,open:e,setOpen:l,current:()=>[...t.current.values()].sort((e,l)=>e.el&&l.el&&e.el.compareDocumentPosition(l.el)&Node.DOCUMENT_POSITION_PRECEDING?1:-1).map(e=>e.label()),trigger:r}}(),[D,E]=o(()=>(x?r(x,w,k):null)??b(N,w,k),b(N,w,k)),T=null!=l||null!=n,I=/* @__PURE__ */f("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:D},children:[
2
- /* @__PURE__ */f("div",{className:`flex h-full flex-col ${T?"overflow-hidden":"overflow-y-auto"} ${W}`,children:[null!=l&&/* @__PURE__ */p("div",{className:"flex shrink-0 flex-col gap-2 px-2 pt-3 pb-2",children:l}),T?/* @__PURE__ */p("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e}):e,null!=n&&/* @__PURE__ */p("div",{className:"mt-auto flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:n})]}),
3
- /* @__PURE__ */p(t,{side:m,width:D,onResize:E,min:w,max:k,defaultWidth:b(N,w,k),storageKey:x,hint:z.resize})]}),K=/* @__PURE__ */p("div",{className:`flex min-w-0 flex-1 flex-col ${C}`,children:u});/* @__PURE__ */
4
- return f("div",O?{className:`relative flex h-full w-full flex-col overflow-hidden ${y}`,children:[
5
- /* @__PURE__ */p(g,{phone:P,top:l,fallback:z.sections}),K,
6
- /* @__PURE__ */p(v,{phone:P,bottom:n,label:z.sections,closeLabel:z.closeSections,children:e})]}:{className:`flex h-full w-full overflow-hidden ${y}`,children:[j?null:I,K,j?I:null]})}function g({phone:l,top:r,fallback:t}){const a=l.current();/* @__PURE__ */
1
+ import{SidebarBarContext as e,SidebarSheetContext as l}from"./chunk-QWK6DRSN.js";import{readStoredWidth as r,ResizeHandle as t}from"./chunk-DRDYZ633.js";import{useIsPhone as a}from"./chunk-UGTRSRIW.js";import{Icon as n}from"./chunk-2UO47XB4.js";import{useBrowserState as o}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-4PAWQEXM.js";import{useState as s,useRef as c,useReducer as d,useMemo as h,Fragment as u,useEffect as m}from"react";import{jsxs as f,jsx as p}from"react/jsx-runtime";var b=(e,l,r)=>Math.min(Math.max(e,l),r);function x({sidebar:e,sidebarTop:l,sidebarBottom:n,children:u,side:m="left",storageKey:x,defaultWidth:N=256,minWidth:w=180,maxWidth:k=480,className:y="",sidebarClassName:D=("right"===m?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:W="bg-white"}){const j="right"===m,z=i().sidebar,C=a(),O=function(){const[e,l]=s(!1),r=c(null),t=c(/* @__PURE__ */new Map),[,a]=d(e=>e+1,0),n=h(()=>({report(e,l,r){const n={label:l,el:r};return t.current.set(e,n),a(),()=>{t.current.get(e)===n&&(t.current.delete(e),a())}}}),[]);return{api:n,open:e,setOpen:l,current:()=>[...t.current.values()].sort((e,l)=>e.el&&l.el&&e.el.compareDocumentPosition(l.el)&Node.DOCUMENT_POSITION_PRECEDING?1:-1).map(e=>e.label()),trigger:r}}(),[P,E]=o(()=>(x?r(x,w,k):null)??b(N,w,k),b(N,w,k)),R=null!=l||null!=n,I=/* @__PURE__ */f("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:P},children:[
2
+ /* @__PURE__ */f("div",{className:`flex h-full flex-col ${R?"overflow-hidden":"overflow-y-auto"} ${D}`,children:[null!=l&&/* @__PURE__ */p("div",{className:"flex shrink-0 flex-col gap-2 px-2 pt-3 pb-2",children:l}),R?/* @__PURE__ */p("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e}):e,null!=n&&/* @__PURE__ */p("div",{className:"mt-auto flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:n})]}),
3
+ /* @__PURE__ */p(t,{side:m,width:P,onResize:E,min:w,max:k,defaultWidth:b(N,w,k),storageKey:x,hint:z.resize})]}),M=/* @__PURE__ */p("div",{className:`flex min-w-0 flex-1 flex-col ${W}`,children:u});/* @__PURE__ */
4
+ return f("div",C?{className:`relative flex h-full w-full flex-col overflow-hidden ${y}`,children:[
5
+ /* @__PURE__ */p(g,{phone:O,top:l,fallback:z.sections}),M,
6
+ /* @__PURE__ */p(v,{phone:O,bottom:n,label:z.sections,closeLabel:z.closeSections,children:e})]}:{className:`flex h-full w-full overflow-hidden ${y}`,children:[j?null:I,M,j?I:null]})}function g({phone:l,top:r,fallback:t}){const a=l.current();/* @__PURE__ */
7
7
  return f("div",{"data-sidebar-section-bar":!0,className:"flex h-11 shrink-0 items-center gap-2 border-b border-gray-200 bg-white px-3",children:[
8
8
  /* @__PURE__ */f("button",{ref:l.trigger,type:"button","aria-haspopup":"dialog","aria-expanded":l.open,onClick:()=>l.setOpen(!0),className:"flex h-8 min-w-0 flex-1 items-center gap-1 text-left text-sm font-semibold text-gray-900",children:[
9
9
  /* @__PURE__ */p("span",{className:"min-w-0 truncate",children:0===a.length?t:a.map((e,l)=>/* @__PURE__ */f(u,{children:[l>0&&" · ",e]},l))}),
@@ -1,24 +1,24 @@
1
- import{Card as e}from"./chunk-TOVKWNI2.js";import{Select_default as l}from"./chunk-OET2Q7P6.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{Banner as r}from"./chunk-ZW3IDCP2.js";import{Input_default as i}from"./chunk-MAMWQCJ6.js";import{Button_default as c}from"./chunk-HXNMRJQ4.js";import{Checkbox_default as s}from"./chunk-CGZBDI6C.js";import{useState as d}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";var h=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function m(){const[m,o]=d(!0),[p,u]=d("us"),y=h.reduce((e,l)=>e+l.qty*l.price,0),g=y+9;/* @__PURE__ */
1
+ import{Card as e}from"./chunk-TOVKWNI2.js";import{Select_default as l}from"./chunk-VNACNNCJ.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Banner as i}from"./chunk-ZW3IDCP2.js";import{Input_default as c}from"./chunk-MAMWQCJ6.js";import{Button_default as s}from"./chunk-I4VIEGCX.js";import{useState as d}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";var h=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function m(){const[m,o]=d(!0),[p,u]=d("us"),y=h.reduce((e,l)=>e+l.qty*l.price,0),g=y+9;/* @__PURE__ */
2
2
  return n("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */t("div",{className:"mx-auto max-w-5xl space-y-5",children:[
3
3
  /* @__PURE__ */n("h1",{className:"text-xl font-semibold text-gray-900",children:"Checkout"}),
4
4
  /* @__PURE__ */t("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-3",children:[
5
5
  /* @__PURE__ */t("form",{className:"space-y-5 lg:col-span-2",onSubmit:e=>e.preventDefault(),children:[
6
- /* @__PURE__ */n(e,{header:"Contact",children:/* @__PURE__ */n("div",{className:"space-y-4",children:/* @__PURE__ */n(a,{label:"Email",htmlFor:"ck-email",required:!0,children:/* @__PURE__ */n(i,{id:"ck-email",type:"email",placeholder:"you@example.com"})})})}),
6
+ /* @__PURE__ */n(e,{header:"Contact",children:/* @__PURE__ */n("div",{className:"space-y-4",children:/* @__PURE__ */n(a,{label:"Email",htmlFor:"ck-email",required:!0,children:/* @__PURE__ */n(c,{id:"ck-email",type:"email",placeholder:"you@example.com"})})})}),
7
7
  /* @__PURE__ */n(e,{header:"Shipping address",children:/* @__PURE__ */t("div",{className:"space-y-4",children:[
8
8
  /* @__PURE__ */t("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
9
- /* @__PURE__ */n(a,{label:"First name",required:!0,children:/* @__PURE__ */n(i,{placeholder:"Alice"})}),
10
- /* @__PURE__ */n(a,{label:"Last name",required:!0,children:/* @__PURE__ */n(i,{placeholder:"Nguyen"})})]}),
11
- /* @__PURE__ */n(a,{label:"Address",required:!0,children:/* @__PURE__ */n(i,{placeholder:"123 Market St"})}),
9
+ /* @__PURE__ */n(a,{label:"First name",required:!0,children:/* @__PURE__ */n(c,{placeholder:"Alice"})}),
10
+ /* @__PURE__ */n(a,{label:"Last name",required:!0,children:/* @__PURE__ */n(c,{placeholder:"Nguyen"})})]}),
11
+ /* @__PURE__ */n(a,{label:"Address",required:!0,children:/* @__PURE__ */n(c,{placeholder:"123 Market St"})}),
12
12
  /* @__PURE__ */t("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[
13
- /* @__PURE__ */n(a,{label:"City",children:/* @__PURE__ */n(i,{placeholder:"San Francisco"})}),
14
- /* @__PURE__ */n(a,{label:"ZIP",children:/* @__PURE__ */n(i,{placeholder:"94103"})}),
13
+ /* @__PURE__ */n(a,{label:"City",children:/* @__PURE__ */n(c,{placeholder:"San Francisco"})}),
14
+ /* @__PURE__ */n(a,{label:"ZIP",children:/* @__PURE__ */n(c,{placeholder:"94103"})}),
15
15
  /* @__PURE__ */n(a,{label:"Country",children:/* @__PURE__ */n(l,{value:p,onChange:u,options:[{value:"us",label:"United States"},{value:"de",label:"Germany"},{value:"jp",label:"Japan"}]})})]}),
16
- /* @__PURE__ */n(s,{checked:m,onChange:o,label:"Billing address same as shipping"})]})}),
16
+ /* @__PURE__ */n(r,{checked:m,onChange:o,label:"Billing address same as shipping"})]})}),
17
17
  /* @__PURE__ */n(e,{header:"Payment",children:/* @__PURE__ */t("div",{className:"space-y-4",children:[
18
- /* @__PURE__ */n(a,{label:"Card number",required:!0,children:/* @__PURE__ */n(i,{placeholder:"1234 5678 9012 3456"})}),
18
+ /* @__PURE__ */n(a,{label:"Card number",required:!0,children:/* @__PURE__ */n(c,{placeholder:"1234 5678 9012 3456"})}),
19
19
  /* @__PURE__ */t("div",{className:"grid grid-cols-2 gap-4",children:[
20
- /* @__PURE__ */n(a,{label:"Expiry",required:!0,children:/* @__PURE__ */n(i,{placeholder:"MM / YY"})}),
21
- /* @__PURE__ */n(a,{label:"CVC",required:!0,children:/* @__PURE__ */n(i,{placeholder:"123"})})]})]})})]}),
20
+ /* @__PURE__ */n(a,{label:"Expiry",required:!0,children:/* @__PURE__ */n(c,{placeholder:"MM / YY"})}),
21
+ /* @__PURE__ */n(a,{label:"CVC",required:!0,children:/* @__PURE__ */n(c,{placeholder:"123"})})]})]})})]}),
22
22
  /* @__PURE__ */t("div",{className:"space-y-4",children:[
23
23
  /* @__PURE__ */t(e,{header:"Order summary",children:[
24
24
  /* @__PURE__ */n("ul",{className:"space-y-2 text-sm",children:h.map(e=>/* @__PURE__ */t("li",{className:"flex items-center justify-between gap-2 text-gray-700",children:[
@@ -35,5 +35,5 @@ return n("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__P
35
35
  /* @__PURE__ */t("div",{className:"flex justify-between text-base font-semibold text-gray-900",children:[
36
36
  /* @__PURE__ */n("span",{children:"Total"}),
37
37
  /* @__PURE__ */t("span",{children:["$",g]})]})]}),
38
- /* @__PURE__ */t(c,{block:!0,className:"mt-4",children:["Pay $",g]})]}),
39
- /* @__PURE__ */n(r,{tone:"success",title:"Promo applied",children:"Free returns within 30 days."})]})]})]})})}export{m as CheckoutTemplate};
38
+ /* @__PURE__ */t(s,{block:!0,className:"mt-4",children:["Pay $",g]})]}),
39
+ /* @__PURE__ */n(i,{tone:"success",title:"Promo applied",children:"Free returns within 30 days."})]})]})]})})}export{m as CheckoutTemplate};
@@ -1,6 +1,6 @@
1
- import{CHART_INK as e}from"./chunk-TZFACUMR.js";import{glassStyle as a}from"./chunk-F27JJHNJ.js";import{jsxs as s,jsx as t}from"react/jsx-runtime";function l({variant:l="solid",title:n,rows:r,footnote:o,emphasisKey:i,className:c}){const m="glass"===l;/* @__PURE__ */
2
- return s("div",{role:"status",className:`pointer-events-none min-w-44 rounded-xl p-3 text-xs ${m?"":"bg-surface ring-1 ring-black/5"} ${c??""}`,style:m?a():{boxShadow:"var(--elevation-popup)"},children:[n&&/* @__PURE__ */t("p",{className:"mb-2 text-sm font-medium text-gray-800",children:n}),
3
- /* @__PURE__ */t("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:r.map(a=>/* @__PURE__ */s("li",{className:"flex items-center gap-3",style:i&&a.key!==i?{opacity:.45}:void 0,children:[
4
- /* @__PURE__ */t("span",{className:"h-3 w-3 shrink-0 rounded-[4px]",style:{backgroundColor:a.color??e.muted}}),
5
- /* @__PURE__ */t("span",{className:"flex-1 whitespace-nowrap text-gray-600",children:a.label}),
6
- /* @__PURE__ */t("span",{className:"pl-4 font-semibold tabular-nums text-gray-900",children:a.value??"—"})]},a.key))}),o&&/* @__PURE__ */t("p",{className:"mt-2 text-2xs text-ink-faint",children:o})]})}export{l as ChartTooltip};
1
+ import{glassStyle as e}from"./chunk-F27JJHNJ.js";import{CHART_INK as a}from"./chunk-TZFACUMR.js";import{jsxs as s,jsx as t}from"react/jsx-runtime";function l({variant:l="solid",title:n,rows:r,footnote:o,emphasisKey:i,className:c}){const m="glass"===l;/* @__PURE__ */
2
+ return s("div",{role:"status",className:`pointer-events-none min-w-44 rounded-xl p-3 text-xs ${m?"":"bg-surface ring-1 ring-black/5"} ${c??""}`,style:m?e():{boxShadow:"var(--elevation-popup)"},children:[n&&/* @__PURE__ */t("p",{className:"mb-2 text-sm font-medium text-gray-800",children:n}),
3
+ /* @__PURE__ */t("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:r.map(e=>/* @__PURE__ */s("li",{className:"flex items-center gap-3",style:i&&e.key!==i?{opacity:.45}:void 0,children:[
4
+ /* @__PURE__ */t("span",{className:"h-3 w-3 shrink-0 rounded-[4px]",style:{backgroundColor:e.color??a.muted}}),
5
+ /* @__PURE__ */t("span",{className:"flex-1 whitespace-nowrap text-gray-600",children:e.label}),
6
+ /* @__PURE__ */t("span",{className:"pl-4 font-semibold tabular-nums text-gray-900",children:e.value??"—"})]},e.key))}),o&&/* @__PURE__ */t("p",{className:"mt-2 text-2xs text-ink-faint",children:o})]})}export{l as ChartTooltip};
@@ -1,2 +1,2 @@
1
- import{Tooltip as e}from"./chunk-Q3IR5SKD.js";import{jsx as a,jsxs as l}from"react/jsx-runtime";function r({options:r,value:i,onChange:o,onClear:s,columns:n,captions:t=!1,label:c,className:d="","aria-labelledby":u}){/* @__PURE__ */
1
+ import{Tooltip as e}from"./chunk-6XBWM453.js";import{jsx as a,jsxs as l}from"react/jsx-runtime";function r({options:r,value:i,onChange:o,onClear:s,columns:n,captions:t=!1,label:c,className:d="","aria-labelledby":u}){/* @__PURE__ */
2
2
  return a("div",{role:"group","aria-label":u?void 0:c,"aria-labelledby":u,style:n?{gridTemplateColumns:`repeat(${n}, minmax(0, 1fr))`}:void 0,className:`grid gap-(--space-8) ${n?"":"grid-cols-[repeat(auto-fill,minmax(58px,1fr))]"} ${d}`.replace(/\s+/g," ").trim(),children:r.map(r=>{const n=r.value===i,c=/* @__PURE__ */l("button",{type:"button","aria-pressed":n,"aria-label":t?void 0:r.label,disabled:r.disabled||void 0,onClick:()=>{n?s?.():o(r.value)},className:`flex w-full min-w-0 flex-col items-center justify-center gap-(--space-4) rounded-(--radius-control) border transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)] disabled:cursor-not-allowed disabled:opacity-50 ${t?"px-(--space-4) py-(--space-8)":"p-(--space-4)"} ${n?"border-blue-600 bg-surface text-blue-600 ring-2 ring-blue-400/40":"border-line bg-surface text-ink-faint hover:bg-row-hover hover:text-ink"}`,children:[r.picture,t&&/* @__PURE__ */a("span",{className:"max-w-full truncate text-2xs leading-4",children:r.label})]});return t?/* @__PURE__ */a("div",{className:"flex min-w-0",children:c},r.value):/* @__PURE__ */a(e,{content:r.label,describe:!1,className:"relative flex min-w-0",children:c},r.value)})})}export{r as PictureTiles};
@@ -1,4 +1,4 @@
1
- import{Markdown as e}from"./chunk-POQ4ETLL.js";import{PLACEHOLDER_INK as t}from"./chunk-AYZY3YNC.js";import{Icon as l}from"./chunk-2UO47XB4.js";import{LoadingSpinner as r}from"./chunk-R2VKEMZH.js";import{useShellStrings as s}from"./chunk-4PAWQEXM.js";import{useState as a,useMemo as n}from"react";import{jsxs as i,jsx as o,Fragment as c}from"react/jsx-runtime";var d=({open:e})=>/* @__PURE__ */o(l,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function h({docs:h,loading:m=!1,categoryOrder:p,canEdit:u=!1,onNew:g,onEdit:x,renderBody:f,emptyMessage:b}){const y=s(),[v,N]=a(""),[w,k]=a(null),[C,j]=a({}),L=v.trim().toLowerCase(),M=n(()=>{const e=/* @__PURE__ */new Map;for(const t of h){let l=e.get(t.category);l||(l={key:t.category,label:t.category_label||t.category,docs:[]},e.set(t.category,l)),l.docs.push(t)}if(!p?.length)return[...e.values()];const t=new Map(p.map((e,t)=>[e,t]));return[...e.values()].sort((e,l)=>(t.get(e.key)??1/0)-(t.get(l.key)??1/0))},[h,p]),E=e=>!L||e.title.toLowerCase().includes(L)||e.body.toLowerCase().includes(L)||e.category_label.toLowerCase().includes(L),_=n(()=>M.map(e=>({...e,docs:e.docs.filter(E)})).filter(e=>e.docs.length>0),[M,L]),A=n(()=>_.flatMap(e=>e.docs),[_]),B=(w?A.find(e=>e.slug===w):void 0)??A[0]??null,O=e=>!!L||(C[e]??e===B?.category);/* @__PURE__ */
1
+ import{Markdown as e}from"./chunk-JGTGQGHY.js";import{PLACEHOLDER_INK as t}from"./chunk-AYZY3YNC.js";import{Icon as l}from"./chunk-2UO47XB4.js";import{LoadingSpinner as r}from"./chunk-R2VKEMZH.js";import{useShellStrings as s}from"./chunk-4PAWQEXM.js";import{useState as a,useMemo as n}from"react";import{jsxs as i,jsx as o,Fragment as c}from"react/jsx-runtime";var d=({open:e})=>/* @__PURE__ */o(l,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function h({docs:h,loading:m=!1,categoryOrder:p,canEdit:u=!1,onNew:g,onEdit:x,renderBody:f,emptyMessage:b}){const y=s(),[v,N]=a(""),[w,k]=a(null),[C,j]=a({}),M=v.trim().toLowerCase(),_=n(()=>{const e=/* @__PURE__ */new Map;for(const t of h){let l=e.get(t.category);l||(l={key:t.category,label:t.category_label||t.category,docs:[]},e.set(t.category,l)),l.docs.push(t)}if(!p?.length)return[...e.values()];const t=new Map(p.map((e,t)=>[e,t]));return[...e.values()].sort((e,l)=>(t.get(e.key)??1/0)-(t.get(l.key)??1/0))},[h,p]),A=e=>!M||e.title.toLowerCase().includes(M)||e.body.toLowerCase().includes(M)||e.category_label.toLowerCase().includes(M),E=n(()=>_.map(e=>({...e,docs:e.docs.filter(A)})).filter(e=>e.docs.length>0),[_,M]),L=n(()=>E.flatMap(e=>e.docs),[E]),Y=(w?L.find(e=>e.slug===w):void 0)??L[0]??null,B=e=>!!M||(C[e]??e===Y?.category);/* @__PURE__ */
2
2
  return i("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
3
3
  /* @__PURE__ */i("aside",{className:"w-64 shrink-0 flex flex-col bg-white rounded-lg shadow overflow-hidden",children:[
4
4
  /* @__PURE__ */i("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
@@ -6,16 +6,16 @@ return i("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
6
6
  /* @__PURE__ */o("div",{className:"px-3 py-2 border-b border-line-subtle shrink-0",children:/* @__PURE__ */i("div",{className:"relative",children:[
7
7
  /* @__PURE__ */o(l,{name:"search",look:"mini",className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 ${t}`,"aria-hidden":"true"}),
8
8
  /* @__PURE__ */o("input",{type:"text",value:v,onChange:e=>N(e.target.value),placeholder:y.help.searchPlaceholder,className:"w-full rounded-md border border-line-strong bg-surface h-8 pl-8 pr-2 text-sm shadow-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})}),
9
- /* @__PURE__ */o("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"py-6",label:y.help.loading}):0===_.length?/* @__PURE__ */o("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:L?y.help.noResults:b??y.help.empty}):_.map(e=>{const t=O(e.key);/* @__PURE__ */
9
+ /* @__PURE__ */o("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"py-6",label:y.help.loading}):0===E.length?/* @__PURE__ */o("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:M?y.help.noResults:b??y.help.empty}):E.map(e=>{const t=B(e.key);/* @__PURE__ */
10
10
  return i("div",{className:"py-0.5",children:[
11
- /* @__PURE__ */i("button",{type:"button",onClick:()=>{return t=e.key,j(e=>({...e,[t]:!O(t)}));var t},className:"w-full flex items-center gap-2 h-8 px-3 text-left text-3xs font-semibold uppercase tracking-wide text-ink-faintest hover:text-gray-600",children:[
11
+ /* @__PURE__ */i("button",{type:"button",onClick:()=>{return t=e.key,j(e=>({...e,[t]:!B(t)}));var t},className:"w-full flex items-center gap-2 h-8 px-3 text-left text-3xs font-semibold uppercase tracking-wide text-ink-faintest hover:text-gray-600",children:[
12
12
  /* @__PURE__ */o(d,{open:t}),
13
- /* @__PURE__ */o("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=B?.slug===e.slug;/* @__PURE__ */
13
+ /* @__PURE__ */o("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=Y?.slug===e.slug;/* @__PURE__ */
14
14
  return i("button",{type:"button",onClick:()=>k(e.slug),className:"w-full text-left pl-8 pr-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 transition-colors "+(t?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),children:[
15
15
  /* @__PURE__ */o("span",{className:"truncate",children:e.title}),!1===e.is_published&&/* @__PURE__ */o("span",{className:"ml-auto shrink-0 text-2xs text-amber-600",children:y.help.draft})]},e.slug)})]},e.key)})})]}),
16
- /* @__PURE__ */o("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:B?/* @__PURE__ */i(c,{children:[
16
+ /* @__PURE__ */o("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:Y?/* @__PURE__ */i(c,{children:[
17
17
  /* @__PURE__ */i("div",{className:"flex items-start justify-between gap-4 px-5 py-3 border-b border-gray-200 bg-gray-50 shrink-0",children:[
18
18
  /* @__PURE__ */i("div",{className:"min-w-0",children:[
19
- /* @__PURE__ */o("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:B.title}),
20
- /* @__PURE__ */i("p",{className:"text-xs text-gray-500 mt-0.5",children:[B.category_label,!1===B.is_published&&/* @__PURE__ */i("span",{className:"ml-2 text-amber-600",children:["· ",y.help.draft]})]})]}),u&&x&&/* @__PURE__ */o("button",{type:"button",onClick:()=>x(B),className:"shrink-0 text-sm text-blue-600 hover:underline",children:y.help.edit})]}),
21
- /* @__PURE__ */o("div",{className:"flex-1 overflow-auto px-5 py-4",children:f?f(B):B.body?/* @__PURE__ */o(e,{children:B.body}):/* @__PURE__ */o("p",{className:"text-sm text-gray-500 italic",children:y.help.noBody})})]}):/* @__PURE__ */o("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"",label:y.help.loading}):/* @__PURE__ */o("p",{className:"text-sm text-ink-faint",children:y.help.pickArticle})})})]})}export{h as HelpCenter};
19
+ /* @__PURE__ */o("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:Y.title}),
20
+ /* @__PURE__ */i("p",{className:"text-xs text-gray-500 mt-0.5",children:[Y.category_label,!1===Y.is_published&&/* @__PURE__ */i("span",{className:"ml-2 text-amber-600",children:["· ",y.help.draft]})]})]}),u&&x&&/* @__PURE__ */o("button",{type:"button",onClick:()=>x(Y),className:"shrink-0 text-sm text-blue-600 hover:underline",children:y.help.edit})]}),
21
+ /* @__PURE__ */o("div",{className:"flex-1 overflow-auto px-5 py-4",children:f?f(Y):Y.body?/* @__PURE__ */o(e,{children:Y.body}):/* @__PURE__ */o("p",{className:"text-sm text-gray-500 italic",children:y.help.noBody})})]}):/* @__PURE__ */o("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"",label:y.help.loading}):/* @__PURE__ */o("p",{className:"text-sm text-ink-faint",children:y.help.pickArticle})})})]})}export{h as HelpCenter};
@@ -1,11 +1,11 @@
1
- import{FormField as e}from"./chunk-6KBDNYRW.js";import{dropzoneClass as t,zoneFocusClass as a,CloseGlyph as r}from"./chunk-SSM3EN7G.js";import{useFileIntake as n,humanSize as i,FileIntakeAlert as s}from"./chunk-6RX4PVBU.js";import{useShellStrings as l}from"./chunk-4PAWQEXM.js";import{forwardRef as c,useId as m}from"react";import{jsxs as o,jsx as d}from"react/jsx-runtime";var p=c(function({files:c,onChange:p,accept:u,acceptHint:h,multiple:x=!0,maxSizeBytes:b,maxFiles:f,disabled:y=!1,label:g,hint:N,error:j,required:k,className:v=""},$){const z=m(),B=l().files,C=n({accept:u,acceptHint:h,maxSizeBytes:b,maxFiles:f,multiple:x,disabled:y,currentCount:c.length,onAccept:e=>p(x?[...c,...e]:e.slice(0,1))}),M=j?`${z}-error`:N?`${z}-hint`:void 0;/* @__PURE__ */
2
- return o(e,{label:g,htmlFor:z,hint:N,error:j,required:k,className:v,children:[
3
- /* @__PURE__ */o("button",{ref:$,type:"button",id:z,disabled:y,onClick:C.open,"aria-invalid":!!j||void 0,"aria-required":k||void 0,"aria-describedby":M,...C.zoneProps,className:t(C.dragOver,y,a(y),"px-4 py-6"),children:[
1
+ import{FormField as e}from"./chunk-6KBDNYRW.js";import{dropzoneClass as t,zoneFocusClass as a,CloseGlyph as r}from"./chunk-B7UCXROE.js";import{useFileIntake as n,humanSize as i,FileIntakeAlert as s}from"./chunk-6RX4PVBU.js";import{useShellStrings as l}from"./chunk-4PAWQEXM.js";import{forwardRef as c,useId as m}from"react";import{jsxs as o,jsx as d}from"react/jsx-runtime";var p=c(function({files:c,onChange:p,accept:u,acceptHint:h,multiple:x=!0,maxSizeBytes:b,maxFiles:f,disabled:y=!1,label:g,hint:N,error:j,required:k,className:v=""},B){const C=m(),$=l().files,z=n({accept:u,acceptHint:h,maxSizeBytes:b,maxFiles:f,multiple:x,disabled:y,currentCount:c.length,onAccept:e=>p(x?[...c,...e]:e.slice(0,1))}),O=j?`${C}-error`:N?`${C}-hint`:void 0;/* @__PURE__ */
2
+ return o(e,{label:g,htmlFor:C,hint:N,error:j,required:k,className:v,children:[
3
+ /* @__PURE__ */o("button",{ref:B,type:"button",id:C,disabled:y,onClick:z.open,"aria-invalid":!!j||void 0,"aria-required":k||void 0,"aria-describedby":O,...z.zoneProps,className:t(z.dragOver,y,a(y),"px-4 py-6"),children:[
4
4
  /* @__PURE__ */o("span",{children:[
5
- /* @__PURE__ */d("span",{className:"text-sm font-medium text-blue-600",children:x?B.chooseMany:B.chooseOne}),
6
- /* @__PURE__ */d("span",{className:"text-sm text-gray-500",children:` ${x?B.dragMany:B.dragOne}`})]}),h&&/* @__PURE__ */d("span",{className:"text-xs text-gray-400",children:h})]}),
7
- /* @__PURE__ */d("input",{...C.inputProps}),c.length>0&&/* @__PURE__ */d("ul",{className:"mt-2 flex flex-col gap-1",children:c.map((e,t)=>/* @__PURE__ */o("li",{className:"flex items-center justify-between gap-3 rounded-md bg-gray-50 px-3 py-2",children:[
5
+ /* @__PURE__ */d("span",{className:"text-sm font-medium text-blue-600",children:x?$.chooseMany:$.chooseOne}),
6
+ /* @__PURE__ */d("span",{className:"text-sm text-gray-500",children:` ${x?$.dragMany:$.dragOne}`})]}),h&&/* @__PURE__ */d("span",{className:"text-xs text-gray-400",children:h})]}),
7
+ /* @__PURE__ */d("input",{...z.inputProps}),c.length>0&&/* @__PURE__ */d("ul",{className:"mt-2 flex flex-col gap-1",children:c.map((e,t)=>/* @__PURE__ */o("li",{className:"flex items-center justify-between gap-3 rounded-md bg-gray-50 px-3 py-2",children:[
8
8
  /* @__PURE__ */d("span",{className:"min-w-0 flex-1 truncate text-sm text-gray-800",title:e.name,children:e.name}),
9
- /* @__PURE__ */d("span",{className:"shrink-0 text-xs tabular-nums text-gray-500",children:i(e.size,B)}),
10
- /* @__PURE__ */d("button",{type:"button",disabled:y,onClick:()=>{C.clearRejections(),p(c.filter((e,a)=>a!==t))},"aria-label":B.remove(e.name),className:"shrink-0 text-gray-400 hover:text-gray-600",children:/* @__PURE__ */d(r,{})})]},`${e.name}-${t}`))}),
11
- /* @__PURE__ */d(s,{rejections:C.rejections})]})});export{p as FilePicker_default};
9
+ /* @__PURE__ */d("span",{className:"shrink-0 text-xs tabular-nums text-gray-500",children:i(e.size,$)}),
10
+ /* @__PURE__ */d("button",{type:"button",disabled:y,onClick:()=>{z.clearRejections(),p(c.filter((e,a)=>a!==t))},"aria-label":$.remove(e.name),className:"shrink-0 text-gray-400 hover:text-gray-600",children:/* @__PURE__ */d(r,{})})]},`${e.name}-${t}`))}),
11
+ /* @__PURE__ */d(s,{rejections:z.rejections})]})});export{p as FilePicker_default};
@@ -1,4 +1,4 @@
1
- import{Tooltip as r}from"./chunk-Q3IR5SKD.js";import{useShellStrings as e}from"./chunk-4PAWQEXM.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";var i="Alt+ArrowUp Alt+ArrowDown";function c(r){return!r.altKey||r.ctrlKey||r.metaKey?null:"ArrowUp"===r.key?"up":"ArrowDown"===r.key?"down":null}var a=/* @__PURE__ */n("svg",{"aria-hidden":"true",viewBox:"0 0 4 14",fill:"currentColor",className:"h-3.5 w-1",children:[
1
+ import{Tooltip as r}from"./chunk-6XBWM453.js";import{useShellStrings as e}from"./chunk-4PAWQEXM.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";var i="Alt+ArrowUp Alt+ArrowDown";function c(r){return!r.altKey||r.ctrlKey||r.metaKey?null:"ArrowUp"===r.key?"up":"ArrowDown"===r.key?"down":null}var a=/* @__PURE__ */n("svg",{"aria-hidden":"true",viewBox:"0 0 4 14",fill:"currentColor",className:"h-3.5 w-1",children:[
2
2
  /* @__PURE__ */t("circle",{cx:"2",cy:"3",r:"1.1"}),
3
3
  /* @__PURE__ */t("circle",{cx:"2",cy:"7",r:"1.1"}),
4
4
  /* @__PURE__ */t("circle",{cx:"2",cy:"11",r:"1.1"})]});function l({hint:n,dragging:i,revealClassName:c,marker:l}){const o=e().tree;/* @__PURE__ */
@@ -0,0 +1,2 @@
1
+ import{buttonClasses as e}from"./chunk-UQYNPYF4.js";import{isAriaDisabled as a,swallowPress as r,describedByWith as i,OffWithReason as s}from"./chunk-34URULVW.js";import{SpinnerRing as l}from"./chunk-R2VKEMZH.js";import{forwardRef as d,useId as n}from"react";import{jsxs as t,jsx as c}from"react/jsx-runtime";var o=d(function({variant:d="primary",size:o="md",loading:m=!1,leftIcon:p,rightIcon:b,block:f=!1,disabled:u,type:h="button",children:k,className:x="",disabledReason:N,onClick:y,pressed:v,"aria-disabled":g,"aria-describedby":j,...R},U){const w=n(),z=u||m,C=null!=N&&""!==N,I=z&&C,V=!z&&a(g),Y=V&&C,E=I||Y?w:void 0,F=/* @__PURE__ */t("button",{ref:U,type:h,disabled:z,"aria-busy":m||void 0,"aria-disabled":!!V||g,"aria-describedby":i(j,E),onClick:V?r:y,className:e({variant:d,size:o,block:f,pressed:v??(!0===R["aria-pressed"]||"true"===R["aria-pressed"]),className:x}),...R,children:[m?/* @__PURE__ */c(l,{className:"h-3.5 w-3.5",ink:""}):p,k,!m&&b]});return Y?/* @__PURE__ */c(s,{reason:N,id:w,block:f,children:F}):I?/* @__PURE__ */t("span",{className:f?"flex w-full flex-col gap-1":"inline-flex flex-col items-start gap-1",children:[F,
2
+ /* @__PURE__ */c("span",{id:E,className:"text-xs text-red-600",children:N})]}):F});export{o as Button_default};
@@ -1,11 +1,11 @@
1
- import{arcPath as e}from"./chunk-VFC6QUEN.js";import{MOTION as t,stagger as a}from"./chunk-465RRWBY.js";import{useHighlight as l}from"./chunk-CNYAHYE6.js";import{ChartTooltip as r}from"./chunk-WZ5QSSUM.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{resolveSeriesColor as o,CHART_INK as i}from"./chunk-TZFACUMR.js";import{useShellStrings as s,useShellLocale as c}from"./chunk-4PAWQEXM.js";import{formatPlain as m}from"./chunk-C3QOHMR6.js";import{useId as h,useState as u}from"react";import{jsx as p,jsxs as d}from"react/jsx-runtime";var f=300*Math.PI/180;function g({rows:g,variant:k="track",size:v=300,max:x,formatValue:M,animate:y=!0,className:N,emptyLabel:b,trackGap:j=6}){const C=s().charts,w=c(),E=M??(e=>m(e,w)),P=b??C.nothingToPlot,R=h(),[Q,T]=u(null),{highlighted:U}=l();if(0===g.length)/* @__PURE__ */return p("p",{className:`text-sm text-gray-500 ${N??""}`,children:P});const W=v/2,$=v/2,A=v/2-10,Y=x??Math.max(...g.map(e=>e.value),1),z="track"===k?Math.max(6,(A-.16*v)/g.length):0,B=Math.max(1,Math.floor((A-.16*v)/z||1)),F="track"===k?g.slice(0,B):g,H=Math.min(j,Math.max(1,z-2)),I=n(F.length,.03),L=null!==Q?F[Q]:void 0;/* @__PURE__ */
1
+ import{arcPath as e}from"./chunk-VFC6QUEN.js";import{MOTION as t,stagger as a}from"./chunk-465RRWBY.js";import{useHighlight as l}from"./chunk-CNYAHYE6.js";import{ChartTooltip as r}from"./chunk-G4GVLK44.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{resolveSeriesColor as o,CHART_INK as i}from"./chunk-TZFACUMR.js";import{useShellStrings as s,useShellLocale as c}from"./chunk-4PAWQEXM.js";import{formatPlain as m}from"./chunk-C3QOHMR6.js";import{useId as h,useState as u}from"react";import{jsx as p,jsxs as d}from"react/jsx-runtime";var f=300*Math.PI/180;function g({rows:g,variant:k="track",size:v=300,max:x,formatValue:y,animate:M=!0,className:N,emptyLabel:b,trackGap:j=6}){const C=s().charts,w=c(),E=y??(e=>m(e,w)),P=b??C.nothingToPlot,R=h(),[T,$]=u(null),{highlighted:A}=l();if(0===g.length)/* @__PURE__ */return p("p",{className:`text-sm text-gray-500 ${N??""}`,children:P});const G=v/2,L=v/2,Q=v/2-10,U=x??Math.max(...g.map(e=>e.value),1),V="track"===k?Math.max(6,(Q-.16*v)/g.length):0,W=Math.max(1,Math.floor((Q-.16*v)/V||1)),Y="track"===k?g.slice(0,W):g,z=Math.min(j,Math.max(1,V-2)),B=n(Y.length,.03),F=null!==T?Y[T]:void 0;/* @__PURE__ */
2
2
  return d("div",{className:`relative ${N??""}`,children:[
3
- /* @__PURE__ */d("svg",{width:"100%",height:v,viewBox:`0 0 ${v} ${v}`,role:"img","aria-labelledby":R,onMouseLeave:()=>T(null),children:[
4
- /* @__PURE__ */p("title",{id:R,children:"track"===k?C.radialTrack(F.length):C.radialCycle(F.length)}),F.map((l,r)=>{const n=o(r,l.color,l.tone),s=Math.max(0,Math.min(1,l.value/Y)),c=((e,t)=>null!==Q?Q!==e:null!==U&&U!==t)(r,l.key);if("track"===k){const o=A-r*z,m=o-z+H,h=-Math.PI/2;/* @__PURE__ */
5
- return d("g",{opacity:c?.4:1,onMouseEnter:()=>T(r),className:y?t.sweep:void 0,style:y?a(r,70):void 0,children:[
6
- /* @__PURE__ */p("path",{d:e(W,$,m,o,h,h+f),fill:i.grid}),
7
- /* @__PURE__ */p("path",{d:e(W,$,m,o,h,h+f*s),fill:n})]},l.key)}const m=.14*v;/* @__PURE__ */
8
- return p("g",{opacity:c?.4:1,onMouseEnter:()=>T(r),children:/* @__PURE__ */p("path",{d:e(W,$,m,m+(A-m)*s,I(r),I(r)+I.step),fill:n})},l.key)})]}),L&&null!==Q&&/* @__PURE__ */p("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */p(r,{title:L.label,rows:[{key:"value",label:C.value,color:o(Q,L.color,L.tone),value:E(L.value)}]})}),
3
+ /* @__PURE__ */d("svg",{width:"100%",height:v,viewBox:`0 0 ${v} ${v}`,role:"img","aria-labelledby":R,onMouseLeave:()=>$(null),children:[
4
+ /* @__PURE__ */p("title",{id:R,children:"track"===k?C.radialTrack(Y.length):C.radialCycle(Y.length)}),Y.map((l,r)=>{const n=o(r,l.color,l.tone),s=Math.max(0,Math.min(1,l.value/U)),c=((e,t)=>null!==T?T!==e:null!==A&&A!==t)(r,l.key);if("track"===k){const o=Q-r*V,m=o-V+z,h=-Math.PI/2;/* @__PURE__ */
5
+ return d("g",{opacity:c?.4:1,onMouseEnter:()=>$(r),className:M?t.sweep:void 0,style:M?a(r,70):void 0,children:[
6
+ /* @__PURE__ */p("path",{d:e(G,L,m,o,h,h+f),fill:i.grid}),
7
+ /* @__PURE__ */p("path",{d:e(G,L,m,o,h,h+f*s),fill:n})]},l.key)}const m=.14*v;/* @__PURE__ */
8
+ return p("g",{opacity:c?.4:1,onMouseEnter:()=>$(r),children:/* @__PURE__ */p("path",{d:e(G,L,m,m+(Q-m)*s,B(r),B(r)+B.step),fill:n})},l.key)})]}),F&&null!==T&&/* @__PURE__ */p("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */p(r,{title:F.label,rows:[{key:"value",label:C.value,color:o(T,F.color,F.tone),value:E(F.value)}]})}),
9
9
  /* @__PURE__ */p("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(150px,1fr))"},children:g.map((e,t)=>/* @__PURE__ */d("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
10
10
  /* @__PURE__ */p("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:o(t,e.color,e.tone)}}),
11
11
  /* @__PURE__ */p("span",{className:"flex-1 truncate",children:e.label}),
@@ -1,4 +1,4 @@
1
- import{buildQuerySections as e,buildEmptySections as t,flattenRows as r,DEFAULT_MAGNIFIER as n,stepIndex as a,nextGroupIndex as s,SEE_ALL_ICON as l,resultTypeKey as o}from"./chunk-WGRS6QBT.js";import{useDismissPopupsOnOpen as i}from"./chunk-7QSDPSXP.js";import{Z_LAYERS as c}from"./chunk-62LW225J.js";import{glassStyle as d}from"./chunk-F27JJHNJ.js";import{SpinnerRing as u,LoadingSpinner as p}from"./chunk-R2VKEMZH.js";import{useShellStrings as m}from"./chunk-4PAWQEXM.js";import{useState as h,useRef as f,useEffect as y,useMemo as g,useId as x,useCallback as b}from"react";import{createPortal as k}from"react-dom";import{jsxs as v,jsx as w}from"react/jsx-runtime";function N(e){if(Array.isArray(e))return{results:e,truncatedTypes:[]};if(e&&"object"==typeof e&&Array.isArray(e.results)){const{results:t,truncatedTypes:r}=e;return{results:t,truncatedTypes:Array.isArray(r)?r:[]}}return{results:[],truncatedTypes:[]}}var A=[];function L(e,t,r){const[n,a]=h([]),[s,l]=h(A),[o,i]=h(!1),[c,d]=h("none"),u=f(function(){let e=0,t=null;const r=()=>{e+=1,t?.abort(),t=null};return{begin:()=>{r();const n=e,a=new AbortController;return t=a,{signal:a.signal,isCurrent:()=>n===e}},cancel:r}}());y(()=>{const n=u.current;if(e.length<r||!t||0===t.length)return n.cancel(),a(e=>0===e.length?e:[]),l(A),d("none"),void i(!1);i(!0);const s=setTimeout(async()=>{const r=n.begin(),s=await async function(e,t,r){const n=await Promise.all(e.map(async e=>{try{return{failed:!1,...N(await e(t,{signal:r}))}}catch(e){const t=r.aborted||function(e){if(!e||"object"!=typeof e)return!1;const{name:t,code:r}=e;return"AbortError"===t||"CanceledError"===t||"ERR_CANCELED"===r}(e);return{failed:!t,results:[],truncatedTypes:[]}}}));return{results:n.flatMap(e=>e.results),truncatedTypes:Array.from(new Set(n.flatMap(e=>e.truncatedTypes))),failed:n.filter(e=>e.failed).length}}(t,e,r.signal);r.isCurrent()&&(a(s.results),l(s.truncatedTypes),d(0===s.failed?"none":s.failed>=t.length?"all":"some"),i(!1))},250);return()=>{clearTimeout(s),n.cancel()}},[e,t,r]);return{results:n,truncatedTypes:s,loading:o,failure:c,reset:b(()=>{u.current.cancel(),a(e=>0===e.length?e:[]),l(A),d("none"),i(!1)},[])}}var C=(e,t)=>`${e}-opt-${t}`;function E(e,t){if("seeAll"===e.kind)return l;if("action"===e.kind)return e.icon??n;if(e.icon)return e.icon;const r=t?.[o(e.result)];return r||n}function T({sections:e,activeIdx:t,listId:r,label:n,typeIcons:a,groupCount:s,groupLabel:l,onHover:o,onPick:i}){let c=0;/* @__PURE__ */
1
+ import{buildQuerySections as e,buildEmptySections as t,flattenRows as r,DEFAULT_MAGNIFIER as n,stepIndex as a,nextGroupIndex as s,SEE_ALL_ICON as l,resultTypeKey as o}from"./chunk-WGRS6QBT.js";import{useDismissPopupsOnOpen as i}from"./chunk-7QSDPSXP.js";import{SpinnerRing as c,LoadingSpinner as d}from"./chunk-R2VKEMZH.js";import{Z_LAYERS as u}from"./chunk-62LW225J.js";import{glassStyle as p}from"./chunk-F27JJHNJ.js";import{useShellStrings as m}from"./chunk-4PAWQEXM.js";import{useState as h,useRef as f,useEffect as y,useMemo as g,useId as x,useCallback as b}from"react";import{createPortal as k}from"react-dom";import{jsxs as v,jsx as w}from"react/jsx-runtime";function N(e){if(Array.isArray(e))return{results:e,truncatedTypes:[]};if(e&&"object"==typeof e&&Array.isArray(e.results)){const{results:t,truncatedTypes:r}=e;return{results:t,truncatedTypes:Array.isArray(r)?r:[]}}return{results:[],truncatedTypes:[]}}var A=[];function L(e,t,r){const[n,a]=h([]),[s,l]=h(A),[o,i]=h(!1),[c,d]=h("none"),u=f(function(){let e=0,t=null;const r=()=>{e+=1,t?.abort(),t=null};return{begin:()=>{r();const n=e,a=new AbortController;return t=a,{signal:a.signal,isCurrent:()=>n===e}},cancel:r}}());y(()=>{const n=u.current;if(e.length<r||!t||0===t.length)return n.cancel(),a(e=>0===e.length?e:[]),l(A),d("none"),void i(!1);i(!0);const s=setTimeout(async()=>{const r=n.begin(),s=await async function(e,t,r){const n=await Promise.all(e.map(async e=>{try{return{failed:!1,...N(await e(t,{signal:r}))}}catch(e){const t=r.aborted||function(e){if(!e||"object"!=typeof e)return!1;const{name:t,code:r}=e;return"AbortError"===t||"CanceledError"===t||"ERR_CANCELED"===r}(e);return{failed:!t,results:[],truncatedTypes:[]}}}));return{results:n.flatMap(e=>e.results),truncatedTypes:Array.from(new Set(n.flatMap(e=>e.truncatedTypes))),failed:n.filter(e=>e.failed).length}}(t,e,r.signal);r.isCurrent()&&(a(s.results),l(s.truncatedTypes),d(0===s.failed?"none":s.failed>=t.length?"all":"some"),i(!1))},250);return()=>{clearTimeout(s),n.cancel()}},[e,t,r]);return{results:n,truncatedTypes:s,loading:o,failure:c,reset:b(()=>{u.current.cancel(),a(e=>0===e.length?e:[]),l(A),d("none"),i(!1)},[])}}var C=(e,t)=>`${e}-opt-${t}`;function E(e,t){if("seeAll"===e.kind)return l;if("action"===e.kind)return e.icon??n;if(e.icon)return e.icon;const r=t?.[o(e.result)];return r||n}function T({sections:e,activeIdx:t,listId:r,label:n,typeIcons:a,groupCount:s,groupLabel:l,onHover:o,onPick:i}){let c=0;/* @__PURE__ */
2
2
  return w("div",{id:r,role:"listbox","aria-label":n,className:"py-1",children:e.map(e=>/* @__PURE__ */v("div",{role:"group","aria-label":l(e.title,e.count,!!e.truncated),children:[
3
3
  /* @__PURE__ */v("div",{"aria-hidden":"true",className:"flex items-center justify-between px-4 pt-2 pb-1 text-2xs font-semibold uppercase tracking-wide text-ink-faintest",children:[
4
4
  /* @__PURE__ */w("span",{children:e.title}),
@@ -7,14 +7,14 @@ return v("div",{id:C(r,n),role:"option","aria-selected":s,className:"flex items-
7
7
  /* @__PURE__ */w("svg",{className:"h-4 w-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */w("path",{strokeLinecap:"round",strokeLinejoin:"round",d:E(e,a)})}),
8
8
  /* @__PURE__ */v("div",{className:"flex-1 min-w-0",children:[
9
9
  /* @__PURE__ */w("p",{className:"text-sm font-medium truncate "+(u?"text-blue-600":"text-gray-900"),children:e.label}),d&&/* @__PURE__ */w("p",{className:"text-xs text-gray-400 truncate",children:d})]}),l&&/* @__PURE__ */w("span",{className:"shrink-0 rounded-full bg-gray-100 px-2 py-0.5 text-3xs font-medium text-ink-faint",children:l})]},e.key)})]},e.key))})}var j="react-os-shell:open-global-search";function D(){"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(j))}function I({providers:l,typeIcons:o,typeLabels:N,listRoutes:A,placeholder:E,quickActions:D,onSelect:I,recent:K,onRecord:M,favorites:P,hotkey:R=!0}={}){const S=m().search,$=E??S.placeholder,[B,W]=h(!1),[H,J]=h(""),[z,F]=h(0),Q=f(null),{results:G,truncatedTypes:V,loading:X,failure:q,reset:U}=L(H,l,2);y(()=>{const e=e=>{R&&!e.defaultPrevented&&(e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),W(e=>!e)),"Escape"===e.key&&B&&W(!1)},t=()=>W(!0);return window.addEventListener("keydown",e),window.addEventListener(j,t),()=>{window.removeEventListener("keydown",e),window.removeEventListener(j,t)}},[B,R]),i(B);const[Z,_]=h(!1);B!==Z&&(_(B),B&&(J(""),F(0),U())),y(()=>{B?setTimeout(()=>Q.current?.focus(),50):J("")},[B]),y(()=>{F(0)},[G]);const O=H.length>=2,Y=g(()=>O?e(G,D,H,S.actions,{truncatedTypes:V,listRoutes:A,typeLabels:N,seeAllLabel:S.seeAll}):t({recent:K,favorites:P,actions:D,typeLabels:N},S),[O,G,V,A,N,D,H,K,P,S]),ee=g(()=>r(Y),[Y]),te=Math.min(z,Math.max(ee.length-1,0)),re=x(),ne=ee.length>0;y(()=>{B&&0!==ee.length&&document.getElementById(C(re,te))?.scrollIntoView?.({block:"nearest"})},[B,te,ee.length,re]);const ae=b(e=>{W(!1),"action"!==e.kind?("result"!==e.kind&&"recent"!==e.kind||M?.(e.result),I?.(e.result)):e.action.onSelect()},[I,M]);return B?k(
10
- /* @__PURE__ */v("div",{"data-global-search":"",className:"fixed inset-0 flex items-start justify-center pt-[15vh]",style:{zIndex:c.overlay},onClick:()=>W(!1),children:[
10
+ /* @__PURE__ */v("div",{"data-global-search":"",className:"fixed inset-0 flex items-start justify-center pt-[15vh]",style:{zIndex:u.overlay},onClick:()=>W(!1),children:[
11
11
  /* @__PURE__ */w("div",{"data-global-search-backdrop":"",className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),
12
- /* @__PURE__ */v("div",{className:"relative z-10 w-full max-w-xl rounded-(--radius-popup) overflow-hidden",onClick:e=>e.stopPropagation(),style:d(),children:[
12
+ /* @__PURE__ */v("div",{className:"relative z-10 w-full max-w-xl rounded-(--radius-popup) overflow-hidden",onClick:e=>e.stopPropagation(),style:p(),children:[
13
13
  /* @__PURE__ */v("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-gray-200",children:[
14
14
  /* @__PURE__ */w("svg",{className:"h-5 w-5 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */w("path",{strokeLinecap:"round",strokeLinejoin:"round",d:n})}),
15
- /* @__PURE__ */w("input",{ref:Q,type:"text",value:H,onChange:e=>{J(e.target.value),F(0)},onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),F(a(te,1,ee.length))):"ArrowUp"===e.key?(e.preventDefault(),F(a(te,-1,ee.length))):"Tab"===e.key&&ee.length>0?(e.preventDefault(),F(s(Y.map(e=>e.rows.length),te,e.shiftKey?-1:1))):"Enter"===e.key&&ee[te]&&ae(ee[te])},placeholder:$,role:"combobox","aria-expanded":ne,"aria-controls":ne?re:void 0,"aria-activedescendant":ne?C(re,te):void 0,"aria-autocomplete":"list",className:"flex-1 text-sm bg-transparent border-0 rosh-focus-ring placeholder-gray-400"}),X&&/* @__PURE__ */w("span",{"data-global-search-spinner":"",role:"status","aria-label":S.searching,className:"flex shrink-0",children:/* @__PURE__ */w(u,{className:"h-4 w-4",ink:"text-ink-faint"})}),
15
+ /* @__PURE__ */w("input",{ref:Q,type:"text",value:H,onChange:e=>{J(e.target.value),F(0)},onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),F(a(te,1,ee.length))):"ArrowUp"===e.key?(e.preventDefault(),F(a(te,-1,ee.length))):"Tab"===e.key&&ee.length>0?(e.preventDefault(),F(s(Y.map(e=>e.rows.length),te,e.shiftKey?-1:1))):"Enter"===e.key&&ee[te]&&ae(ee[te])},placeholder:$,role:"combobox","aria-expanded":ne,"aria-controls":ne?re:void 0,"aria-activedescendant":ne?C(re,te):void 0,"aria-autocomplete":"list",className:"flex-1 text-sm bg-transparent border-0 rosh-focus-ring placeholder-gray-400"}),X&&/* @__PURE__ */w("span",{"data-global-search-spinner":"",role:"status","aria-label":S.searching,className:"flex shrink-0",children:/* @__PURE__ */w(c,{className:"h-4 w-4",ink:"text-ink-faint"})}),
16
16
  /* @__PURE__ */w("kbd",{className:"hidden sm:inline-flex items-center rounded border border-line-strong px-2 py-0.5 text-2xs font-medium text-ink-faintest",children:S.escBadge})]}),
17
- /* @__PURE__ */v("div",{className:"max-h-[50vh] overflow-y-auto",children:[X&&0===ee.length&&/* @__PURE__ */w(p,{size:"sm",padding:"py-6",label:S.searching}),!X&&"all"===q&&O&&/* @__PURE__ */w("div",{role:"alert",className:"px-4 py-3 text-center text-sm text-red-600",children:S.searchFailed}),!X&&O&&0===ee.length&&"all"!==q&&/* @__PURE__ */w("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:S.noResults}),ne&&/* @__PURE__ */w(T,{sections:Y,activeIdx:te,listId:re,label:S.listLabel,typeIcons:o,groupCount:S.groupCount,groupLabel:S.groupLabel,onHover:F,onPick:ae}),!X&&"some"===q&&O&&/* @__PURE__ */w("div",{role:"status",className:"px-4 py-2 text-xs text-amber-600",children:S.partialFailure}),!X&&!O&&0===ee.length&&/* @__PURE__ */w("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:S.minChars(2)})]}),
17
+ /* @__PURE__ */v("div",{className:"max-h-[50vh] overflow-y-auto",children:[X&&0===ee.length&&/* @__PURE__ */w(d,{size:"sm",padding:"py-6",label:S.searching}),!X&&"all"===q&&O&&/* @__PURE__ */w("div",{role:"alert",className:"px-4 py-3 text-center text-sm text-red-600",children:S.searchFailed}),!X&&O&&0===ee.length&&"all"!==q&&/* @__PURE__ */w("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:S.noResults}),ne&&/* @__PURE__ */w(T,{sections:Y,activeIdx:te,listId:re,label:S.listLabel,typeIcons:o,groupCount:S.groupCount,groupLabel:S.groupLabel,onHover:F,onPick:ae}),!X&&"some"===q&&O&&/* @__PURE__ */w("div",{role:"status",className:"px-4 py-2 text-xs text-amber-600",children:S.partialFailure}),!X&&!O&&0===ee.length&&/* @__PURE__ */w("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:S.minChars(2)})]}),
18
18
  /* @__PURE__ */v("div",{className:"flex items-center justify-between px-4 py-2 border-t border-line-subtle bg-surface-sunken text-2xs text-ink-faintest",children:[
19
19
  /* @__PURE__ */v("div",{className:"flex items-center gap-3",children:[
20
20
  /* @__PURE__ */v("span",{className:"flex items-center gap-1",children:[
@@ -1,4 +1,4 @@
1
- import{isSafeLinkHref as e}from"./chunk-PJPK2ADX.js";import{Button_default as t}from"./chunk-HXNMRJQ4.js";import{Icon as n}from"./chunk-2UO47XB4.js";import{useShellStrings as r}from"./chunk-4PAWQEXM.js";import{createContext as l,useContext as s}from"react";import{jsx as a,jsxs as i}from"react/jsx-runtime";var c=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g,o=l(void 0);function d({href:t,children:n}){const r=s(o),l=(t=>e(t.trim()))(t)?t:void 0;/* @__PURE__ */
1
+ import{isSafeLinkHref as e}from"./chunk-PJPK2ADX.js";import{Button_default as t}from"./chunk-I4VIEGCX.js";import{Icon as n}from"./chunk-2UO47XB4.js";import{useShellStrings as r}from"./chunk-4PAWQEXM.js";import{createContext as l,useContext as s}from"react";import{jsx as a,jsxs as i}from"react/jsx-runtime";var c=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g,o=l(void 0);function d({href:t,children:n}){const r=s(o),l=(t=>e(t.trim()))(t)?t:void 0;/* @__PURE__ */
2
2
  return a("a",{href:l,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline",onClick:l&&r?e=>{(e=>!(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey))(e)&&r(l)&&e.preventDefault()}:void 0,children:n})}function u(e){const t=[];let n,r=0,l=0;const s=new RegExp(c.source,"g");for(;null!==(n=s.exec(e));)n.index>r&&t.push(e.slice(r,n.index)),void 0!==n[1]?t.push(
3
3
  /* @__PURE__ */i("span",{className:"text-gray-400",children:["[",n[1],"]"]},l++)):void 0!==n[3]?t.push(
4
4
  /* @__PURE__ */a(d,{href:n[4],children:n[3]},l++)):void 0!==n[5]?t.push(
@@ -1,9 +1,9 @@
1
- import{ImageFocusPoint as e}from"./chunk-VKKK4WLS.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{Segmented as i}from"./chunk-5LCDCO46.js";import{isVideoUrl as t,mediaPromptLine as o,mediaFileName as r,FilenameBadge as n,BusyOverlay as l,UploadGlyph as s,dropzoneClass as c,zoneFocusClass as d}from"./chunk-SSM3EN7G.js";import{TransferProgress as u}from"./chunk-SP2AUVIU.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-6RX4PVBU.js";import{Icon as p}from"./chunk-2UO47XB4.js";import{useShellStrings as b}from"./chunk-4PAWQEXM.js";import{useState as g,useRef as v,useEffect as f,useId as y}from"react";import{jsxs as k,jsx as j,Fragment as x}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:U,label:C,hint:F,error:P,required:O,className:S,accept:$="image/*",maxSizeBytes:z,fit:B="cover",height:K=112,placeholder:V,cta:W,acceptHint:q,showFilename:A=!0,allowReplace:H=!0,allowRemove:I=!0,replaceLabel:X,removeLabel:D,busy:E=!1,busyLabel:M,choosingLabel:_,pickFailedLabel:G,progress:Q,disabled:Y=!1,kind:J,onKindChange:T,focus:Z,onFocusChange:ee,focusLabel:ae}){const ie=b().media,te=W??ie.cta,oe=J??(/video/.test($)&&!/image/.test($)?"video":"image"),re="string"==typeof D&&D?D:ie.remove,[ne,le]=g(!1),[se,ce]=g(!1),de=v(!0);f(()=>()=>{de.current=!1},[]);const ue=E||ne,me=ne&&!E?_??ie.choosing:M??ie.uploading,he=P??(se?G??ie.pickFailed:void 0),pe=e=>{if(!R)return;ce(!1);const a=R(e);a&&"function"==typeof a.then&&(le(!0),a.then(e=>{de.current&&(le(!1),"string"==typeof e&&e&&L(e))},()=>{de.current&&(le(!1),ce(!0))}))},be=y(),ge=v(null),[ve,fe]=g(null);f(()=>()=>{ge.current&&URL.revokeObjectURL(ge.current)},[]);const ye=Y||ue,ke=!!w&&(t(w,$)||w===ve),je=V??o($,ie),xe=X??(ke||"video"===oe?ie.changeVideo:ie.changeImage),Ne=e=>{R?pe(e):U?U(e):(e=>{ge.current&&URL.revokeObjectURL(ge.current);const a=URL.createObjectURL(e);ge.current=a,fe(e.type.startsWith("video/")?a:null),L(a)})(e)},we=m({accept:$,maxSizeBytes:z,acceptHint:q,multiple:!1,disabled:ye,onAccept:([e])=>Ne(e)}),{dragOver:Le}=we,Re=()=>{ye||(R?pe():we.open())},Ue=w?r(w):"",Ce=!ke&&!!ee,Fe=Y||!H&&!I?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:["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:[H&&/* @__PURE__ */k("button",{id:Ce?void 0:be,type:"button","aria-labelledby":`${be}-change`,onClick:()=>Re(),disabled:ue,className:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${N}`,children:[
1
+ import{FormField as e}from"./chunk-6KBDNYRW.js";import{ImageFocusPoint as a}from"./chunk-VKKK4WLS.js";import{Segmented as i}from"./chunk-3ELLBQPS.js";import{isVideoUrl as t,mediaPromptLine as o,mediaFileName as r,FilenameBadge as n,BusyOverlay as l,UploadGlyph as s,dropzoneClass as c,zoneFocusClass as d}from"./chunk-B7UCXROE.js";import{TransferProgress as u}from"./chunk-UYRITNQW.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-6RX4PVBU.js";import{Icon as p}from"./chunk-2UO47XB4.js";import{useShellStrings as b}from"./chunk-4PAWQEXM.js";import{useState as g,useRef as v,useEffect as f,useId as y}from"react";import{jsxs as k,jsx as j,Fragment as x}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 L({value:L,onChange:w,onPick:R,onFile:U,label:C,hint:F,error:P,required:B,className:O,accept:$="image/*",maxSizeBytes:z,fit:K="cover",height:W=112,placeholder:S,cta:X,acceptHint:q,showFilename:E=!0,allowReplace:H=!0,allowRemove:I=!0,replaceLabel:Q,removeLabel:V,busy:A=!1,busyLabel:Y,choosingLabel:_,pickFailedLabel:D,progress:M,disabled:T=!1,kind:G,onKindChange:J,focus:Z,onFocusChange:ee,focusLabel:ae}){const ie=b().media,te=X??ie.cta,oe=G??(/video/.test($)&&!/image/.test($)?"video":"image"),re="string"==typeof V&&V?V:ie.remove,[ne,le]=g(!1),[se,ce]=g(!1),de=v(!0);f(()=>()=>{de.current=!1},[]);const ue=A||ne,me=ne&&!A?_??ie.choosing:Y??ie.uploading,he=P??(se?D??ie.pickFailed:void 0),pe=e=>{if(!R)return;ce(!1);const a=R(e);a&&"function"==typeof a.then&&(le(!0),a.then(e=>{de.current&&(le(!1),"string"==typeof e&&e&&w(e))},()=>{de.current&&(le(!1),ce(!0))}))},be=y(),ge=v(null),[ve,fe]=g(null);f(()=>()=>{ge.current&&URL.revokeObjectURL(ge.current)},[]);const ye=T||ue,ke=!!L&&(t(L,$)||L===ve),je=S??o($,ie),xe=Q??(ke||"video"===oe?ie.changeVideo:ie.changeImage),Ne=e=>{R?pe(e):U?U(e):(e=>{ge.current&&URL.revokeObjectURL(ge.current);const a=URL.createObjectURL(e);ge.current=a,fe(e.type.startsWith("video/")?a:null),w(a)})(e)},Le=m({accept:$,maxSizeBytes:z,acceptHint:q,multiple:!1,disabled:ye,onAccept:([e])=>Ne(e)}),{dragOver:we}=Le,Re=()=>{ye||(R?pe():Le.open())},Ue=L?r(L):"",Ce=!ke&&!!ee,Fe=T||!H&&!I?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:["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:[H&&/* @__PURE__ */k("button",{id:Ce?void 0:be,type:"button","aria-labelledby":`${be}-change`,onClick:()=>Re(),disabled:ue,className:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${N}`,children:[
2
2
  /* @__PURE__ */j(p,{name:"swap","aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
3
- /* @__PURE__ */j("span",{id:`${be}-change`,className:"truncate",children:xe})]}),I&&/* @__PURE__ */j("button",{type:"button","aria-label":re,onClick:()=>{ge.current&&(URL.revokeObjectURL(ge.current),ge.current=null),fe(null),L("")},disabled:ue,className:`ml-auto w-8 shrink-0 ${N}`,children:/* @__PURE__ */j(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Pe=/* @__PURE__ */k("div",{...we.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden rounded-(--radius-control) border transition-colors",Ce?"":"bg-gray-100",Le?"border-blue-500":"border-line"].join(" "),style:Ce?void 0:{height:K},children:[Ce?
4
- /* @__PURE__ */j(e,{value:Z??"",onChange:e=>ee?.(e),label:ae??ie.focus,image:w,hint:null,id:be,disabled:ye,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):ke?/* @__PURE__ */j("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Ue||void 0,className:"h-full w-full",style:{objectFit:B}}):/* @__PURE__ */j("img",{src:w??void 0,alt:Ue,className:"h-full w-full",style:{objectFit:B,objectPosition:Z||void 0}}),A&&w&&/* @__PURE__ */j(n,{children:Ue}),Fe,ue&&/* @__PURE__ */j(l,{label:me,progress:Q,rounded:"rounded-md"})]}),Oe=/* @__PURE__ */j("button",{type:"button",id:be,onClick:()=>Re(),disabled:ye,"aria-label":"string"==typeof je?je:ie.upload,"aria-busy":ue||void 0,"aria-invalid":!!he||void 0,"aria-required":O||void 0,"aria-describedby":he?`${be}-error`:F?`${be}-hint`:void 0,...we.zoneProps,className:c(Le,ye,d(ye)),style:{minHeight:K},children:ue?/* @__PURE__ */j(u,{state:"busy",verb:me,pct:Q}):/* @__PURE__ */k(x,{children:[
3
+ /* @__PURE__ */j("span",{id:`${be}-change`,className:"truncate",children:xe})]}),I&&/* @__PURE__ */j("button",{type:"button","aria-label":re,onClick:()=>{ge.current&&(URL.revokeObjectURL(ge.current),ge.current=null),fe(null),w("")},disabled:ue,className:`ml-auto w-8 shrink-0 ${N}`,children:/* @__PURE__ */j(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Pe=/* @__PURE__ */k("div",{...Le.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden rounded-(--radius-control) border transition-colors",Ce?"":"bg-gray-100",we?"border-blue-500":"border-line"].join(" "),style:Ce?void 0:{height:W},children:[Ce?
4
+ /* @__PURE__ */j(a,{value:Z??"",onChange:e=>ee?.(e),label:ae??ie.focus,image:L,hint:null,id:be,disabled:ye,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):ke?/* @__PURE__ */j("video",{src:L??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Ue||void 0,className:"h-full w-full",style:{objectFit:K}}):/* @__PURE__ */j("img",{src:L??void 0,alt:Ue,className:"h-full w-full",style:{objectFit:K,objectPosition:Z||void 0}}),E&&L&&/* @__PURE__ */j(n,{children:Ue}),Fe,ue&&/* @__PURE__ */j(l,{label:me,progress:M,rounded:"rounded-md"})]}),Be=/* @__PURE__ */j("button",{type:"button",id:be,onClick:()=>Re(),disabled:ye,"aria-label":"string"==typeof je?je:ie.upload,"aria-busy":ue||void 0,"aria-invalid":!!he||void 0,"aria-required":B||void 0,"aria-describedby":he?`${be}-error`:F?`${be}-hint`:void 0,...Le.zoneProps,className:c(we,ye,d(ye)),style:{minHeight:W},children:ue?/* @__PURE__ */j(u,{state:"busy",verb:me,pct:M}):/* @__PURE__ */k(x,{children:[
5
5
  /* @__PURE__ */j("span",{className:"text-ink-faintest",children:/* @__PURE__ */j(s,{})}),
6
6
  /* @__PURE__ */j("span",{className:"px-3 text-xs text-ink-faint",children:je}),
7
7
  /* @__PURE__ */j("span",{className:"text-sm font-medium text-blue-600",children:te}),q&&/* @__PURE__ */j("span",{className:"text-xs text-ink-faintest",children:q})]})});/* @__PURE__ */
8
- return k(a,{label:C,htmlFor:be,hint:F,error:he,required:O,className:S,children:[T&&/* @__PURE__ */j("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */j(i,{value:oe,onChange:e=>T(e),options:[{value:"image",label:ie.image,icon:/* @__PURE__ */j(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye},{value:"video",label:ie.video,icon:/* @__PURE__ */j(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye}],block:!0,size:"md",label:"string"==typeof C&&C?C:ie.upload})}),w?Pe:Oe,!R&&/* @__PURE__ */j("input",{...we.inputProps}),
9
- /* @__PURE__ */j(h,{rejections:we.rejections})]})}export{w as MediaUploadField};
8
+ return k(e,{label:C,htmlFor:be,hint:F,error:he,required:B,className:O,children:[J&&/* @__PURE__ */j("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */j(i,{value:oe,onChange:e=>J(e),options:[{value:"image",label:ie.image,icon:/* @__PURE__ */j(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye},{value:"video",label:ie.video,icon:/* @__PURE__ */j(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye}],block:!0,size:"md",label:"string"==typeof C&&C?C:ie.upload})}),L?Pe:Be,!R&&/* @__PURE__ */j("input",{...Le.inputProps}),
9
+ /* @__PURE__ */j(h,{rejections:Le.rejections})]})}export{L as MediaUploadField};
@@ -0,0 +1,7 @@
1
+ import{squarify as e}from"./chunk-46BYGPGD.js";import{AccessibleTable as t}from"./chunk-TKJBZIHT.js";import{useHighlight as l}from"./chunk-CNYAHYE6.js";import{ChartTooltip as a}from"./chunk-G4GVLK44.js";import{usePlotWidth as r}from"./chunk-MAFUXCPZ.js";import{resolveSeriesColor as i,CHART_INK as o}from"./chunk-TZFACUMR.js";import{useShellStrings as n,useShellLocale as m}from"./chunk-4PAWQEXM.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useRef as c,useState as u}from"react";import{jsx as s,jsxs as f}from"react/jsx-runtime";function p({items:p,height:d=320,width:v,gap:x=2,radius:g=3,formatValue:y,color:k,className:b,emptyLabel:j}){const M=n().charts,w=m(),N=y??(e=>h(e,w)),$=j??M.nothingToBreakDown,A=c(null),B=r(A),C=v??B,[G,T]=u(null),{highlighted:z}=l(),E=e(p,C,d);if(0===E.length)/* @__PURE__ */
2
+ return s("div",{className:b,ref:A,children:/* @__PURE__ */s("p",{className:"py-8 text-center text-sm text-gray-500",children:$})});const F=k??i(0),H=Math.max(...E.map(e=>e.value),1),L=e=>34+e/H*62,P=e=>`color-mix(in oklab, ${F} ${L(e).toFixed(0)}%, ${o.surface})`,V=e=>L(e)>=55?o.surface:o.label,Y=G??z,Z=G?E.find(e=>e.key===G):void 0;/* @__PURE__ */
3
+ return f("div",{className:`relative ${b??""}`,ref:A,children:[
4
+ /* @__PURE__ */s("svg",{width:"100%",height:d,viewBox:`0 0 ${C} ${d}`,role:"img","aria-label":M.treemap(p.length),onMouseLeave:()=>T(null),children:E.map(e=>{const t=Math.max(0,e.width-x),l=Math.max(0,e.height-x),a=t>6.2*e.label.length+12&&l>30,r=a&&l>44;/* @__PURE__ */
5
+ return f("g",{opacity:Y&&Y!==e.key?.55:1,onMouseEnter:()=>T(e.key),children:[
6
+ /* @__PURE__ */s("rect",{x:e.x+x/2,y:e.y+x/2,width:t,height:l,rx:g,fill:P(e.value)}),a&&/* @__PURE__ */s("text",{x:e.x+x/2+8,y:e.y+x/2+18,fontSize:12,fontWeight:600,fill:V(e.value),children:e.label}),r&&/* @__PURE__ */s("text",{x:e.x+x/2+8,y:e.y+x/2+34,fontSize:11,fill:V(e.value),fillOpacity:.85,style:{fontVariantNumeric:"tabular-nums"},children:N(e.value)})]},e.key)})}),Z&&/* @__PURE__ */s("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */s(a,{title:Z.label,rows:[{key:"value",label:M.value,color:P(Z.value),value:N(Z.value)}]})}),
7
+ /* @__PURE__ */s(t,{caption:M.treemap(p.length),head:[M.tableItem,M.value],rows:E.map(e=>[e.label,N(e.value)])})]})}export{p as TreemapChart};
@@ -1 +1 @@
1
- import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-SM7IDX7Y.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,D=/\b[a-z][a-z0-9+.-]*:\/\/\S+/gi,V=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,W=/\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,X=/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i,Y=/(?:\(|@|\bat\s+)?((?:[a-z][a-z0-9+.-]*:\/\/|\/)[^\s()@]*?):(\d+):(\d+)\)?\s*$/i;function Q(e,t,n){const i=e.replace(X,"").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=Y.exec(n.trim()),i=e&&Q(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(X,"").split(/[?#]/,1)[0].replace(G,(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(D,"[url]").replace(V,"[id]").replace(W,"[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-W4OBVKN4.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 O=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,U=/^[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}},K=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,J=/\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("//")&&O.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(K,"[redacted]").replace(J,"[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};