efficient-shell 9.9.0 → 9.10.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 (311) hide show
  1. package/dist/{Browser-ZPOVP4Z7.js → Browser-VUQISZ2Z.js} +14 -14
  2. package/dist/Calculator-IZXBE6R7.js +29 -0
  3. package/dist/{CurrencyConverter-SSR2XDIC.js → CurrencyConverter-AW7BB3DD.js} +8 -8
  4. package/dist/{Documents-T7JYO223.js → Documents-WPTBUSKV.js} +7 -7
  5. package/dist/{Files-HBGW3JWI.js → Files-IZ6N6SG6.js} +31 -31
  6. package/dist/{Notepad-GO2QT55C.js → Notepad-VRQH524R.js} +10 -10
  7. package/dist/{PdfViewer-XSISAJZP.js → PdfViewer-FFQOKKFW.js} +1 -1
  8. package/dist/{PomodoroTimer-EV6D4OFU.js → PomodoroTimer-5VCWY4QT.js} +25 -25
  9. package/dist/{Preview-Z2CRCDHA.js → Preview-SP3WIE54.js} +11 -11
  10. package/dist/Sidebar-PUXP2DFI.js +43 -0
  11. package/dist/{Spreadsheet-GEE77GD3.js → Spreadsheet-4U4ABNE2.js} +11 -11
  12. package/dist/{Stock-6ZIQHGPH.js → Stock-2VWS2IQJ.js} +4 -4
  13. package/dist/{Weather-II7NFRMK.js → Weather-4MEYBP4D.js} +18 -18
  14. package/dist/{WorldClock-NBLNO63Q.js → WorldClock-Y4YRJ43F.js} +6 -6
  15. package/dist/ai/index.js +56 -53
  16. package/dist/ai.css +1 -1
  17. package/dist/apps/index.js +1 -1
  18. package/dist/bin/media-host-check.js +1 -1
  19. package/dist/bin/ui-check.js +1 -1
  20. package/dist/brand.css +1 -1
  21. package/dist/charts/BoxPlotChart.js +1 -1
  22. package/dist/charts/CandlestickChart.js +1 -1
  23. package/dist/charts/CartesianPlot.d.ts +24 -1
  24. package/dist/charts/CartesianPlot.js +1 -1
  25. package/dist/charts/ChartBrush.js +1 -1
  26. package/dist/charts/ChartFrame.js +1 -1
  27. package/dist/charts/ChartSkeleton.js +1 -1
  28. package/dist/charts/ChordChart.js +1 -1
  29. package/dist/charts/ColumnChart.d.ts +4 -1
  30. package/dist/charts/ColumnChart.js +1 -1
  31. package/dist/charts/FunnelChart.js +1 -1
  32. package/dist/charts/HeatmapChart.js +1 -1
  33. package/dist/charts/HistogramChart.js +1 -1
  34. package/dist/charts/Meter.js +1 -1
  35. package/dist/charts/PieChart.js +1 -1
  36. package/dist/charts/RadarChart.js +1 -1
  37. package/dist/charts/RadialBarChart.js +1 -1
  38. package/dist/charts/RangeChart.js +1 -1
  39. package/dist/charts/RankedBars.js +1 -1
  40. package/dist/charts/SankeyChart.js +1 -1
  41. package/dist/charts/ScatterChart.js +1 -1
  42. package/dist/charts/SpecChart.js +1 -1
  43. package/dist/charts/StatTile.js +1 -1
  44. package/dist/charts/SunburstChart.js +1 -1
  45. package/dist/charts/TimeSeriesChart.d.ts +1 -1
  46. package/dist/charts/TimeSeriesChart.js +1 -1
  47. package/dist/charts/TreemapChart.js +1 -1
  48. package/dist/charts/WaterfallChart.js +1 -1
  49. package/dist/charts/types.d.ts +35 -1
  50. package/dist/{chunk-7WGOLPGM.js → chunk-2AHLONPR.js} +1 -1
  51. package/dist/{chunk-2MLRK7IO.js → chunk-2GPHHW7C.js} +4 -4
  52. package/dist/{chunk-P3OBE43Q.js → chunk-2LDOLQ7F.js} +6 -6
  53. package/dist/{chunk-EFFF3FCS.js → chunk-2SJDTKQA.js} +19 -19
  54. package/dist/{chunk-DZTAGMNY.js → chunk-2XBJNB7D.js} +34 -34
  55. package/dist/{chunk-HQMN5THW.js → chunk-3FBYM6O5.js} +14 -14
  56. package/dist/{chunk-EXNAAHN4.js → chunk-3MHBALGV.js} +2 -2
  57. package/dist/{chunk-CJB73MHF.js → chunk-3XRBVYTO.js} +2 -2
  58. package/dist/{chunk-BVTNGW5S.js → chunk-46YVA2BF.js} +1 -1
  59. package/dist/chunk-4CPE5NBC.js +8 -0
  60. package/dist/{chunk-CO5RKOVX.js → chunk-4DBPKTVX.js} +16 -16
  61. package/dist/{chunk-DNWV6N4P.js → chunk-4SZ3NNVF.js} +1 -1
  62. package/dist/{chunk-XD34TCRG.js → chunk-4XZXY2AF.js} +1 -1
  63. package/dist/{chunk-5JRL5LXD.js → chunk-5AWV5R6E.js} +6 -6
  64. package/dist/{chunk-PYLNMN6E.js → chunk-5CVQN2BR.js} +8 -8
  65. package/dist/{chunk-RWJCKZEY.js → chunk-5Q3PFKB5.js} +1 -1
  66. package/dist/{chunk-LUWRPPJA.js → chunk-5R6RNUDB.js} +5 -5
  67. package/dist/{chunk-WUKN5WUM.js → chunk-5RAOFJYT.js} +6 -6
  68. package/dist/{chunk-WFHYU66E.js → chunk-5VYBPDZ2.js} +1 -1
  69. package/dist/{chunk-ZAU2HIRH.js → chunk-5XNN2SSR.js} +4 -4
  70. package/dist/{chunk-O5LQBBW2.js → chunk-5Y6LGPZI.js} +7 -7
  71. package/dist/{chunk-ZYDZY6ED.js → chunk-5Y7JITHW.js} +1 -1
  72. package/dist/{chunk-3APSMJPN.js → chunk-64R3IYAM.js} +1 -1
  73. package/dist/{chunk-Z3JW77LH.js → chunk-65DYHG73.js} +1 -1
  74. package/dist/{chunk-5VOVNIOU.js → chunk-6O2W4X2V.js} +1 -1
  75. package/dist/{chunk-VVGL5O4F.js → chunk-6TRE326A.js} +6 -6
  76. package/dist/{chunk-ZTL2RPNY.js → chunk-73W7537K.js} +1 -1
  77. package/dist/{chunk-GS5AISRS.js → chunk-7IC4JMFA.js} +4 -4
  78. package/dist/{chunk-OV2SWQPT.js → chunk-7JJUI52C.js} +1 -1
  79. package/dist/{chunk-IMOPDLMA.js → chunk-7WLFHDWA.js} +1 -1
  80. package/dist/chunk-7YZJLFAK.js +11 -0
  81. package/dist/{chunk-56RAOI7O.js → chunk-AG63JVX7.js} +6 -6
  82. package/dist/{chunk-WH3JHMEA.js → chunk-AGETTWMK.js} +1 -1
  83. package/dist/{chunk-6MVHRNWC.js → chunk-BF7PZFKT.js} +1 -1
  84. package/dist/{chunk-IJWFKUYA.js → chunk-BJONHLET.js} +4 -4
  85. package/dist/{chunk-B4KMHEFZ.js → chunk-BNKULSCG.js} +1 -1
  86. package/dist/{chunk-RULVWW4A.js → chunk-BRHKQMRH.js} +6 -6
  87. package/dist/{chunk-VG2R6PZV.js → chunk-BYHKYYL6.js} +1 -1
  88. package/dist/{chunk-DLNYXXNE.js → chunk-CB6ROWOC.js} +2 -2
  89. package/dist/chunk-CBMXYXBH.js +15 -0
  90. package/dist/{chunk-BZBMZDLD.js → chunk-CFO54C3H.js} +1 -1
  91. package/dist/{chunk-P3Y5RFI4.js → chunk-CJI3POCE.js} +2 -2
  92. package/dist/{chunk-GVC535IA.js → chunk-D4KZOYXQ.js} +1 -1
  93. package/dist/chunk-D7JY2KHG.js +7 -0
  94. package/dist/{chunk-PDXPMHG3.js → chunk-DRNB7KDC.js} +1 -1
  95. package/dist/{chunk-U4OGRIP6.js → chunk-DWSCYYDM.js} +1 -1
  96. package/dist/{chunk-U5N6PSXO.js → chunk-E6EUGQGA.js} +5 -5
  97. package/dist/{chunk-N3JXHNID.js → chunk-E72USUUR.js} +10 -10
  98. package/dist/{chunk-C4UL2UNR.js → chunk-EOWOVR55.js} +1 -1
  99. package/dist/{chunk-CE5BARZI.js → chunk-EWJELWIT.js} +3 -3
  100. package/dist/{chunk-OQ2EDMB2.js → chunk-FEPBXJUR.js} +1 -1
  101. package/dist/{chunk-BWUU565Y.js → chunk-FKA6ZVQO.js} +9 -9
  102. package/dist/{chunk-QZKWIVZW.js → chunk-FNSVXN7B.js} +1 -1
  103. package/dist/{chunk-CRXFSN5K.js → chunk-G6LOKIFC.js} +11 -11
  104. package/dist/chunk-GCB5S2OI.js +8 -0
  105. package/dist/{chunk-LNQVTH5S.js → chunk-GP5UNEKY.js} +1 -1
  106. package/dist/{chunk-EW3L4W2I.js → chunk-GVAWCTJN.js} +8 -8
  107. package/dist/{chunk-X7PM7JOD.js → chunk-H2XCQJRG.js} +1 -1
  108. package/dist/{chunk-FBUUXK5G.js → chunk-H4YFANH5.js} +1 -1
  109. package/dist/chunk-HHOXLECO.js +29 -0
  110. package/dist/{chunk-442FFHQJ.js → chunk-HRAK46H7.js} +12 -12
  111. package/dist/chunk-HSTIEPLI.js +1 -0
  112. package/dist/chunk-I5XVZLDH.js +14 -0
  113. package/dist/{chunk-NWCW22U6.js → chunk-IBIUI2D3.js} +2 -2
  114. package/dist/{chunk-CXMTDYVI.js → chunk-IENPHB5B.js} +1 -1
  115. package/dist/{chunk-FLQZ7GQ3.js → chunk-IEPSBXMU.js} +12 -12
  116. package/dist/{chunk-LAEXWXJA.js → chunk-IUWAMMDN.js} +3 -3
  117. package/dist/{chunk-B6YOP2IX.js → chunk-IVY7CCTS.js} +3 -3
  118. package/dist/{chunk-JKDEE35P.js → chunk-IZQ3XTD2.js} +1 -1
  119. package/dist/chunk-J7OKOVSL.js +11 -0
  120. package/dist/{chunk-IB4333CI.js → chunk-JECMVR4S.js} +7 -7
  121. package/dist/{chunk-6ZHX56NM.js → chunk-JQDRM6UK.js} +1 -1
  122. package/dist/{chunk-QC6OK3ED.js → chunk-JVYSRH6U.js} +1 -1
  123. package/dist/{chunk-5VRMQTKV.js → chunk-KAHYUBXM.js} +7 -7
  124. package/dist/{chunk-YWGC7J6B.js → chunk-KECOZKJU.js} +7 -7
  125. package/dist/{chunk-JIW5CJXC.js → chunk-KOSV4UPK.js} +2 -2
  126. package/dist/{chunk-NHVXVHUR.js → chunk-KQSUSVMF.js} +17 -17
  127. package/dist/{chunk-BBEOFKLY.js → chunk-KTRNAMHY.js} +1 -1
  128. package/dist/chunk-LFPJ263N.js +6 -0
  129. package/dist/{chunk-F4DIVARP.js → chunk-LYX55RI3.js} +1 -1
  130. package/dist/{chunk-XZYAFTW4.js → chunk-M5MAIJQQ.js} +4 -4
  131. package/dist/{chunk-XNWQ72WA.js → chunk-MCMUJDEP.js} +1 -1
  132. package/dist/{chunk-ZOHQVSB3.js → chunk-MUHWI4GK.js} +12 -12
  133. package/dist/chunk-N3CTLEJS.js +9 -0
  134. package/dist/{chunk-HJWTWS5E.js → chunk-N52D37FS.js} +5 -5
  135. package/dist/chunk-NBKQADMY.js +9 -0
  136. package/dist/{chunk-P4XTWAKJ.js → chunk-NCRLKFXD.js} +1 -1
  137. package/dist/{chunk-43ONX6UZ.js → chunk-NGQHXTUK.js} +1 -1
  138. package/dist/{chunk-SOP447EP.js → chunk-NRGBXEBU.js} +1 -1
  139. package/dist/{chunk-JS6ZSEZJ.js → chunk-O426Q7KC.js} +1 -1
  140. package/dist/{chunk-CAG3TSV2.js → chunk-O4NPQ23Q.js} +1 -1
  141. package/dist/{chunk-ZHHEMSOD.js → chunk-ODOEH5QZ.js} +2 -2
  142. package/dist/{chunk-ENL5L6NR.js → chunk-P65C5TUU.js} +1 -1
  143. package/dist/chunk-PEM7UXQ3.js +1 -0
  144. package/dist/chunk-PTA7A7GF.js +22 -0
  145. package/dist/{chunk-FLEG5KP5.js → chunk-PWBLGKQ3.js} +5 -5
  146. package/dist/chunk-QCFN3ET4.js +9 -0
  147. package/dist/{chunk-F7F6Z64G.js → chunk-QLOKT22X.js} +1 -1
  148. package/dist/{chunk-IK2WXW2E.js → chunk-QLYOGT3U.js} +13 -13
  149. package/dist/{chunk-N7T63BVD.js → chunk-QMYQ4B5A.js} +3 -3
  150. package/dist/{chunk-EWVOGTEX.js → chunk-QSUQC4AN.js} +1 -1
  151. package/dist/{chunk-BGRT775Y.js → chunk-QYJQAY6C.js} +2 -2
  152. package/dist/{chunk-M5GMIQ47.js → chunk-R7JTTKG2.js} +3 -3
  153. package/dist/{chunk-Y44ABEW3.js → chunk-REGXKU74.js} +1 -1
  154. package/dist/{chunk-AGUA3O5O.js → chunk-RLLONZJJ.js} +1 -1
  155. package/dist/chunk-RSHNWBW2.js +4 -0
  156. package/dist/chunk-SC6HJBQA.js +8 -0
  157. package/dist/{chunk-OUSKOWNP.js → chunk-SGR4V5YI.js} +3 -3
  158. package/dist/{chunk-CVNJSD2J.js → chunk-T2ITXX7R.js} +6 -6
  159. package/dist/chunk-T76X2SHR.js +4 -0
  160. package/dist/{chunk-ARWMJSQJ.js → chunk-T7O2TNNX.js} +1 -1
  161. package/dist/chunk-TBLN4MDQ.js +6 -0
  162. package/dist/{chunk-ANFLQSGX.js → chunk-TQH6E5V2.js} +1 -1
  163. package/dist/{chunk-KEK47CP3.js → chunk-TRUPMMDJ.js} +9 -9
  164. package/dist/{chunk-L67VXJMF.js → chunk-UL4G6JY2.js} +1 -1
  165. package/dist/chunk-UYDP4DK3.js +9 -0
  166. package/dist/{chunk-E4E7MACR.js → chunk-UZGVIHFI.js} +14 -14
  167. package/dist/{chunk-DWBZ3Z34.js → chunk-V5QEPNPK.js} +2 -2
  168. package/dist/{chunk-MV6WDGB6.js → chunk-VANJPZ3H.js} +1 -1
  169. package/dist/{chunk-VVAJ23SD.js → chunk-VBNA237H.js} +1 -1
  170. package/dist/{chunk-24K6GVNM.js → chunk-VR4GSAFM.js} +17 -17
  171. package/dist/{chunk-2R3BVU75.js → chunk-VZV7Q5V2.js} +1 -1
  172. package/dist/{chunk-IJIESSTX.js → chunk-WIOG2NOJ.js} +5 -5
  173. package/dist/{chunk-BCUQXILM.js → chunk-WZQCRTXF.js} +1 -1
  174. package/dist/chunk-X4BKHXU5.js +9 -0
  175. package/dist/{chunk-UKDJUYIV.js → chunk-XI45TSEK.js} +1 -1
  176. package/dist/{chunk-MWIT4UN2.js → chunk-XREN3AKD.js} +9 -9
  177. package/dist/{chunk-IGNZULKG.js → chunk-YBU7NOD7.js} +1 -1
  178. package/dist/{chunk-QSJR7EI7.js → chunk-YQB5OYDC.js} +1 -1
  179. package/dist/{chunk-TVL3JPMY.js → chunk-YWR2WRDR.js} +1 -1
  180. package/dist/{chunk-2HEJDLPP.js → chunk-ZA6S5XVM.js} +2 -2
  181. package/dist/{chunk-K4D63NP3.js → chunk-ZC3CCRPG.js} +7 -7
  182. package/dist/{chunk-IPTCV6CQ.js → chunk-ZPW3KQ27.js} +30 -30
  183. package/dist/data/DataTable.js +1 -1
  184. package/dist/data/Kanban.js +1 -1
  185. package/dist/data/ListFooter.js +1 -1
  186. package/dist/data/ListLoadError.js +1 -1
  187. package/dist/data/Pagination.js +1 -1
  188. package/dist/file-intake/index.js +1 -1
  189. package/dist/forms/BorderInput.js +1 -1
  190. package/dist/forms/BrandAssetEditor.js +1 -1
  191. package/dist/forms/Calendar.js +1 -1
  192. package/dist/forms/ColorPicker.js +1 -1
  193. package/dist/forms/ComposerAttachments.js +1 -1
  194. package/dist/forms/CornersInput.js +1 -1
  195. package/dist/forms/DatePicker.js +1 -1
  196. package/dist/forms/DateRangePicker.js +1 -1
  197. package/dist/forms/DateTimePicker.js +1 -1
  198. package/dist/forms/DisplayChips.js +1 -1
  199. package/dist/forms/FilePicker.js +1 -1
  200. package/dist/forms/FormErrorSummary.js +1 -1
  201. package/dist/forms/IconPicker.js +1 -1
  202. package/dist/forms/ImageFocusPoint.js +1 -1
  203. package/dist/forms/InputNumber.js +1 -1
  204. package/dist/forms/LinkPicker.js +1 -1
  205. package/dist/forms/MediaLibrary.js +1 -1
  206. package/dist/forms/MediaUploadField.js +1 -1
  207. package/dist/forms/MediaUploadGrid.js +1 -1
  208. package/dist/forms/MediaUsedInList.js +1 -1
  209. package/dist/forms/NumericKeypad.js +1 -1
  210. package/dist/forms/PositionInput.js +1 -1
  211. package/dist/forms/Select.js +1 -1
  212. package/dist/forms/SidesInput.js +1 -1
  213. package/dist/forms/Slider.js +1 -1
  214. package/dist/forms/Snippet.js +1 -1
  215. package/dist/forms/TagInput.js +1 -1
  216. package/dist/forms/TextToolbar.js +1 -1
  217. package/dist/forms/TimePicker.js +1 -1
  218. package/dist/forms/WidthsBar.js +1 -1
  219. package/dist/forms/mediaLibraryMenu.js +1 -1
  220. package/dist/forms/mediaMoveItems.js +1 -1
  221. package/dist/forms/textAlign.js +1 -1
  222. package/dist/forms/useFileIntake.js +1 -1
  223. package/dist/hooks/useTheme.d.ts +1 -1
  224. package/dist/index.d.ts +1 -1
  225. package/dist/index.js +139 -139
  226. package/dist/locales/zh-Hans.js +1 -1
  227. package/dist/map/index.js +7 -7
  228. package/dist/page-tabs/index.js +5 -5
  229. package/dist/pdf/index.js +1 -1
  230. package/dist/shell/Accordion.js +1 -1
  231. package/dist/shell/AppUpdateBanner.js +1 -1
  232. package/dist/shell/Avatar.js +1 -1
  233. package/dist/shell/Banner.js +1 -1
  234. package/dist/shell/Breadcrumbs.js +1 -1
  235. package/dist/shell/BudgetBar.js +1 -1
  236. package/dist/shell/Card.js +1 -1
  237. package/dist/shell/ColoredBadge.js +1 -1
  238. package/dist/shell/ConfirmDialog.js +1 -1
  239. package/dist/shell/ContainerFillChart.js +1 -1
  240. package/dist/shell/CountBadge.js +1 -1
  241. package/dist/shell/Dialog.js +1 -1
  242. package/dist/shell/Drawer.js +1 -1
  243. package/dist/shell/EditableGrid.js +1 -1
  244. package/dist/shell/EmptyState.js +1 -1
  245. package/dist/shell/GlobalSearch.js +1 -1
  246. package/dist/shell/HelpCenter.js +1 -1
  247. package/dist/shell/IconRail.js +1 -1
  248. package/dist/shell/ImageLightbox.js +1 -1
  249. package/dist/shell/ItemCount.js +1 -1
  250. package/dist/shell/LanguageSelect.js +1 -1
  251. package/dist/shell/Markdown.js +1 -1
  252. package/dist/shell/MetricBar.js +1 -1
  253. package/dist/shell/MetricBarLegend.js +1 -1
  254. package/dist/shell/MilestoneTimeline.js +1 -1
  255. package/dist/shell/PageHeader.js +1 -1
  256. package/dist/shell/ProductionTimeline.js +1 -1
  257. package/dist/shell/ResizeHandle.js +1 -1
  258. package/dist/shell/Result.js +1 -1
  259. package/dist/shell/SearchableSelect.js +1 -1
  260. package/dist/shell/SettingReset.js +1 -1
  261. package/dist/shell/SettingRow.js +1 -1
  262. package/dist/shell/SidebarLayout.js +1 -1
  263. package/dist/shell/SidebarNav.js +1 -1
  264. package/dist/shell/SortableList.js +1 -1
  265. package/dist/shell/Statistic.js +1 -1
  266. package/dist/shell/TimeAgo.js +1 -1
  267. package/dist/shell/TimelineTrack.js +1 -1
  268. package/dist/shell/TransferProgress.js +1 -1
  269. package/dist/shell/Tree.js +1 -1
  270. package/dist/shell/language.js +1 -1
  271. package/dist/shell/strings.d.ts +6 -0
  272. package/dist/shell/strings.js +1 -1
  273. package/dist/shell/toast.js +1 -1
  274. package/dist/telemetry/index.js +1 -1
  275. package/dist/templates/AuthScreen.js +1 -1
  276. package/dist/templates/ChatTemplate.js +1 -1
  277. package/dist/templates/CheckoutTemplate.js +1 -1
  278. package/dist/templates/DashboardTemplate.js +1 -1
  279. package/dist/templates/DataTablePage.js +1 -1
  280. package/dist/templates/EmailTemplate.js +1 -1
  281. package/dist/templates/ErrorBoundary.d.ts +1 -1
  282. package/dist/templates/ErrorBoundary.js +1 -1
  283. package/dist/templates/ErrorPage.js +1 -1
  284. package/dist/templates/FormLayoutPage.js +1 -1
  285. package/dist/templates/GalleryTemplate.js +1 -1
  286. package/dist/ui/index.js +1 -1
  287. package/dist/version.js +1 -1
  288. package/package.json +1 -1
  289. package/dist/Calculator-CSYRZAS5.js +0 -29
  290. package/dist/Sidebar-Y4DTQYW2.js +0 -43
  291. package/dist/chunk-6453ISTQ.js +0 -4
  292. package/dist/chunk-6FEL5D56.js +0 -8
  293. package/dist/chunk-AC373WIU.js +0 -8
  294. package/dist/chunk-BZG5E7GF.js +0 -6
  295. package/dist/chunk-D7IXMMZT.js +0 -9
  296. package/dist/chunk-FKNJSD6B.js +0 -14
  297. package/dist/chunk-G6CTTBKE.js +0 -9
  298. package/dist/chunk-HEEY4TVP.js +0 -8
  299. package/dist/chunk-HUF34LSW.js +0 -15
  300. package/dist/chunk-IX6QMUJQ.js +0 -9
  301. package/dist/chunk-KWT6GT4M.js +0 -29
  302. package/dist/chunk-L4TN4EWK.js +0 -1
  303. package/dist/chunk-MG7A3R75.js +0 -1
  304. package/dist/chunk-OX2DOOOI.js +0 -8
  305. package/dist/chunk-PDB5W7VI.js +0 -6
  306. package/dist/chunk-Q7KTTDUS.js +0 -11
  307. package/dist/chunk-QWHQJNKL.js +0 -1
  308. package/dist/chunk-QXWY3CJ2.js +0 -11
  309. package/dist/chunk-RC6UHOAV.js +0 -4
  310. package/dist/chunk-WE7CYRZT.js +0 -7
  311. package/dist/chunk-XI4HKNFI.js +0 -19
@@ -1,23 +1,23 @@
1
- import{toast_default as e}from"./chunk-XD34TCRG.js";import{Icon as t}from"./chunk-FSPFV4MI.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import{useShellStrings as r}from"./chunk-QWHQJNKL.js";import{createContext as a,useContext as o,useRef as i,useState as s,useEffect as l}from"react";import*as c from"pdfjs-dist";import{createPortal as d}from"react-dom";import{jsx as u,jsxs as m}from"react/jsx-runtime";function h(e,t,n){return new Error(`The response for ${e} is not a WebAssembly module (got ${function(e){if(0===e.length)return"an empty response";const t=Array.from(e.subarray(0,24)).map(e=>e>=32&&e<127?String.fromCharCode(e):".").join("");return`${e.length} bytes starting "${t}"`}(n)}). The bundler did not emit "${t}" as an asset, and the host answered with a fallback page instead of a 404. Serve pdfjs-dist/wasm/ yourself and point window.__REACT_OS_SHELL_PDF_WASM__ at it.`)}var p=a(null);function f({children:e}){const t=o(p);return t?d(e,t):
2
- /* @__PURE__ */u("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-gray-200 bg-gray-50 px-3 py-2 text-xs",children:e})}"undefined"==typeof window||c.GlobalWorkerOptions.workerSrc||(c.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${c.version}/build/pdf.worker.min.mjs`);var g={"jbig2.wasm":new URL("pdfjs-dist/wasm/jbig2.wasm",import.meta.url).href,"openjpeg.wasm":new URL("pdfjs-dist/wasm/openjpeg.wasm",import.meta.url).href},w=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=g[t];if(!n)throw new Error(`No bundled pdf.js wasm module for "${t}".`);const r=await fetch(n);if(!r.ok)throw new Error(`Unable to load wasm data at: ${n}`);const a=new Uint8Array(await r.arrayBuffer());if(!function(e){return e.length>=4&&0===e[0]&&97===e[1]&&115===e[2]&&109===e[3]}(a))throw h(n,t,a);return a}};function y(e){const t=e||("undefined"!=typeof window?window.__REACT_OS_SHELL_PDF_WASM__:void 0);return"string"==typeof t&&t?{wasmUrl:t.endsWith("/")?t:`${t}/`}:{BinaryDataFactory:w}}var v=[50,75,100,125,150,200,300,400];function b(e,t,n){const r=(t.width-40)/n.width,a="page"===e?Math.min(r,(t.height-40)/n.height):r;return Math.min(Math.max(a,.3),4)}function x({url:a,filename:o,fit:d="width",onDownload:h,onEmail:p,workerSrc:g,wasmUrl:w}){const x=r().pdf,k=i(null),C=i(null),N=i(null),[M,j]=s(null),[E,z]=s(1),[P,_]=s(0),[D,W]=s(1),[L,S]=s(!0),[T,$]=s(!0),A=i(x.loadFailed);A.current=x.loadFailed,l(()=>{let t=!1;return $(!0),z(1),g&&(c.GlobalWorkerOptions.workerSrc=g),c.getDocument({url:a,...y(w)}).promise.then(e=>{t||(j(e),_(e.numPages),$(!1))}).catch(()=>{t||(e.error(A.current),$(!1))}),()=>{t=!0}},[a,g,w]),l(()=>{if(!M||!L||!N.current)return;const e=()=>{const e=N.current;e&&M.getPage(E).then(t=>{if(!N.current)return;const n=t.getViewport({scale:1}),r=b(d,{width:e.clientWidth,height:e.clientHeight},{width:n.width,height:n.height});W(e=>Math.abs(e-r)<.005?e:r)})};e();const t=new ResizeObserver(e);return t.observe(N.current),()=>t.disconnect()},[M,E,L,d]),l(()=>{if(!M||!k.current)return;let e=!1,t=null,n=null;return M.getPage(E).then(r=>{if(e||!k.current)return;const a=r.getViewport({scale:D}),o=k.current;o.width=a.width,o.height=a.height,o.style.width=`${a.width}px`,o.style.height=`${a.height}px`;const i=o.getContext("2d");t=r.render({canvas:o,canvasContext:i,viewport:a}),t.promise.catch(()=>{});const s=C.current;s&&(s.replaceChildren(),s.style.setProperty("--total-scale-factor",String(a.scale)),n=new c.TextLayer({textContentSource:r.streamTextContent(),container:s,viewport:a}),n.render().then(()=>{if(e)return;const t=document.createElement("div");t.className="endOfContent",s.append(t)}).catch(()=>{}))}),()=>{e=!0,t?.cancel(),n?.cancel()}},[M,E,D]),l(()=>{const e=()=>C.current?.classList.remove("selecting");return window.addEventListener("pointerup",e),()=>window.removeEventListener("pointerup",e)},[]);const O="page"===d?x.fitPage:x.fitWidth,H="px-2 py-1 rounded hover:bg-gray-200 transition-colors text-gray-600 flex items-center gap-1";/* @__PURE__ */
1
+ import{toast_default as e}from"./chunk-4XZXY2AF.js";import{Icon as t}from"./chunk-FSPFV4MI.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import{useShellStrings as r}from"./chunk-PEM7UXQ3.js";import{createContext as a,useContext as o,useRef as i,useState as s,useEffect as l}from"react";import*as c from"pdfjs-dist";import{createPortal as d}from"react-dom";import{jsx as u,jsxs as m}from"react/jsx-runtime";function h(e,t,n){return new Error(`The response for ${e} is not a WebAssembly module (got ${function(e){if(0===e.length)return"an empty response";const t=Array.from(e.subarray(0,24)).map(e=>e>=32&&e<127?String.fromCharCode(e):".").join("");return`${e.length} bytes starting "${t}"`}(n)}). The bundler did not emit "${t}" as an asset, and the host answered with a fallback page instead of a 404. Serve pdfjs-dist/wasm/ yourself and point window.__REACT_OS_SHELL_PDF_WASM__ at it.`)}var p=a(null);function f({children:e}){const t=o(p);return t?d(e,t):
2
+ /* @__PURE__ */u("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-gray-200 bg-gray-50 px-3 py-2 text-xs",children:e})}"undefined"==typeof window||c.GlobalWorkerOptions.workerSrc||(c.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${c.version}/build/pdf.worker.min.mjs`);var g={"jbig2.wasm":new URL("pdfjs-dist/wasm/jbig2.wasm",import.meta.url).href,"openjpeg.wasm":new URL("pdfjs-dist/wasm/openjpeg.wasm",import.meta.url).href},w=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=g[t];if(!n)throw new Error(`No bundled pdf.js wasm module for "${t}".`);const r=await fetch(n);if(!r.ok)throw new Error(`Unable to load wasm data at: ${n}`);const a=new Uint8Array(await r.arrayBuffer());if(!function(e){return e.length>=4&&0===e[0]&&97===e[1]&&115===e[2]&&109===e[3]}(a))throw h(n,t,a);return a}};function y(e){const t=e||("undefined"!=typeof window?window.__REACT_OS_SHELL_PDF_WASM__:void 0);return"string"==typeof t&&t?{wasmUrl:t.endsWith("/")?t:`${t}/`}:{BinaryDataFactory:w}}var v=[50,75,100,125,150,200,300,400];function b(e,t,n){const r=(t.width-40)/n.width,a="page"===e?Math.min(r,(t.height-40)/n.height):r;return Math.min(Math.max(a,.3),4)}function x({url:a,filename:o,fit:d="width",onDownload:h,onEmail:p,workerSrc:g,wasmUrl:w}){const x=r().pdf,k=i(null),C=i(null),N=i(null),[M,j]=s(null),[E,P]=s(1),[z,_]=s(0),[D,S]=s(1),[W,L]=s(!0),[$,A]=s(!0),T=i(x.loadFailed);T.current=x.loadFailed,l(()=>{let t=!1;return A(!0),P(1),g&&(c.GlobalWorkerOptions.workerSrc=g),c.getDocument({url:a,...y(w)}).promise.then(e=>{t||(j(e),_(e.numPages),A(!1))}).catch(()=>{t||(e.error(T.current),A(!1))}),()=>{t=!0}},[a,g,w]),l(()=>{if(!M||!W||!N.current)return;const e=()=>{const e=N.current;e&&M.getPage(E).then(t=>{if(!N.current)return;const n=t.getViewport({scale:1}),r=b(d,{width:e.clientWidth,height:e.clientHeight},{width:n.width,height:n.height});S(e=>Math.abs(e-r)<.005?e:r)})};e();const t=new ResizeObserver(e);return t.observe(N.current),()=>t.disconnect()},[M,E,W,d]),l(()=>{if(!M||!k.current)return;let e=!1,t=null,n=null;return M.getPage(E).then(r=>{if(e||!k.current)return;const a=r.getViewport({scale:D}),o=k.current;o.width=a.width,o.height=a.height,o.style.width=`${a.width}px`,o.style.height=`${a.height}px`;const i=o.getContext("2d");t=r.render({canvas:o,canvasContext:i,viewport:a}),t.promise.catch(()=>{});const s=C.current;s&&(s.replaceChildren(),s.style.setProperty("--total-scale-factor",String(a.scale)),n=new c.TextLayer({textContentSource:r.streamTextContent(),container:s,viewport:a}),n.render().then(()=>{if(e)return;const t=document.createElement("div");t.className="endOfContent",s.append(t)}).catch(()=>{}))}),()=>{e=!0,t?.cancel(),n?.cancel()}},[M,E,D]),l(()=>{const e=()=>C.current?.classList.remove("selecting");return window.addEventListener("pointerup",e),()=>window.removeEventListener("pointerup",e)},[]);const O="page"===d?x.fitPage:x.fitWidth,F="px-2 py-1 rounded hover:bg-gray-200 transition-colors text-gray-600 flex items-center gap-1";/* @__PURE__ */
3
3
  return m("div",{className:"flex flex-col h-full",children:[
4
4
  /* @__PURE__ */m(f,{children:[
5
- /* @__PURE__ */u("button",{type:"button","aria-label":x.previousPage,onClick:()=>z(e=>Math.max(1,e-1)),disabled:E<=1,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(t,{name:"chevron-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
6
- /* @__PURE__ */u("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:x.pageOf(E,P)}),
7
- /* @__PURE__ */u("button",{type:"button","aria-label":x.nextPage,onClick:()=>z(e=>Math.min(P,e+1)),disabled:E>=P,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(t,{name:"chevron-right",className:"h-3.5 w-3.5",strokeWidth:2})}),
5
+ /* @__PURE__ */u("button",{type:"button","aria-label":x.previousPage,onClick:()=>P(e=>Math.max(1,e-1)),disabled:E<=1,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(t,{name:"chevron-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
6
+ /* @__PURE__ */u("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:x.pageOf(E,z)}),
7
+ /* @__PURE__ */u("button",{type:"button","aria-label":x.nextPage,onClick:()=>P(e=>Math.min(z,e+1)),disabled:E>=z,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(t,{name:"chevron-right",className:"h-3.5 w-3.5",strokeWidth:2})}),
8
8
  /* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
9
- /* @__PURE__ */u("button",{type:"button","aria-label":x.zoomOut,title:x.zoomOut,onClick:()=>{S(!1),W(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:H,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"−"})}),
10
- /* @__PURE__ */m("select",{value:L?"fit":v.includes(Math.round(100*D))?Math.round(100*D):"custom",onChange:e=>{const t=e.target.value;"fit"!==t?"custom"!==t&&(S(!1),W(Number(t)/100)):S(!0)},className:"bg-transparent hover:bg-gray-200 rounded px-1 py-1 text-gray-600 tabular-nums cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-400","aria-label":x.zoom,title:x.zoom,children:[
11
- /* @__PURE__ */u("option",{value:"fit",children:O}),!L&&!v.includes(Math.round(100*D))&&/* @__PURE__ */m("option",{value:"custom",children:[Math.round(100*D),"%"]}),v.map(e=>/* @__PURE__ */m("option",{value:e,children:[e,"%"]},e))]}),
12
- /* @__PURE__ */u("button",{type:"button","aria-label":x.zoomIn,title:x.zoomIn,onClick:()=>{S(!1),W(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:H,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"+"})}),
13
- /* @__PURE__ */u("button",{type:"button",onClick:()=>S(!0),"aria-pressed":L,className:H+(L?" bg-gray-200 text-gray-900":""),title:x.fitHint,children:x.fit}),
9
+ /* @__PURE__ */u("button",{type:"button","aria-label":x.zoomOut,title:x.zoomOut,onClick:()=>{L(!1),S(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:F,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"−"})}),
10
+ /* @__PURE__ */m("select",{value:W?"fit":v.includes(Math.round(100*D))?Math.round(100*D):"custom",onChange:e=>{const t=e.target.value;"fit"!==t?"custom"!==t&&(L(!1),S(Number(t)/100)):L(!0)},className:"bg-transparent hover:bg-gray-200 rounded px-1 py-1 text-gray-600 tabular-nums cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-400","aria-label":x.zoom,title:x.zoom,children:[
11
+ /* @__PURE__ */u("option",{value:"fit",children:O}),!W&&!v.includes(Math.round(100*D))&&/* @__PURE__ */m("option",{value:"custom",children:[Math.round(100*D),"%"]}),v.map(e=>/* @__PURE__ */m("option",{value:e,children:[e,"%"]},e))]}),
12
+ /* @__PURE__ */u("button",{type:"button","aria-label":x.zoomIn,title:x.zoomIn,onClick:()=>{L(!1),S(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:F,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"+"})}),
13
+ /* @__PURE__ */u("button",{type:"button",onClick:()=>L(!0),"aria-pressed":W,className:F+(W?" bg-gray-200 text-gray-900":""),title:x.fitHint,children:x.fit}),
14
14
  /* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
15
- /* @__PURE__ */m("button",{type:"button",onClick:()=>{if(!M)return;const t=window.open("","_blank");if(!t)return void e.error(x.allowPopups);const n=[];for(let e=1;e<=P;e++)n.push(M.getPage(e).then(e=>{const t=e.getViewport({scale:2}),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,e.render({canvas:n,canvasContext:n.getContext("2d"),viewport:t}).promise.then(()=>n.toDataURL())}));Promise.all(n).then(e=>{var n;t.document.write(`<html><head><title>${n=o,n.replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"}[e]))}</title><style>@media print{body{margin:0}img{width:100%;page-break-after:always}}</style></head><body>`),t.document.write(e.map(e=>`<img src="${e}"/>`).join("")),t.document.write("</body></html>"),t.document.close(),setTimeout(()=>{t.print(),t.close()},300)})},className:H,children:[
15
+ /* @__PURE__ */m("button",{type:"button",onClick:()=>{if(!M)return;const t=window.open("","_blank");if(!t)return void e.error(x.allowPopups);const n=[];for(let e=1;e<=z;e++)n.push(M.getPage(e).then(e=>{const t=e.getViewport({scale:2}),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,e.render({canvas:n,canvasContext:n.getContext("2d"),viewport:t}).promise.then(()=>n.toDataURL())}));Promise.all(n).then(e=>{var n;t.document.write(`<html><head><title>${n=o,n.replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"}[e]))}</title><style>@media print{body{margin:0}img{width:100%;page-break-after:always}}</style></head><body>`),t.document.write(e.map(e=>`<img src="${e}"/>`).join("")),t.document.write("</body></html>"),t.document.close(),setTimeout(()=>{t.print(),t.close()},300)})},className:F,children:[
16
16
  /* @__PURE__ */u(t,{name:"print",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.print]}),
17
- /* @__PURE__ */m("button",{type:"button",onClick:h??(()=>{const e=document.createElement("a");e.href=a,e.download=o,e.click()}),className:H,children:[
18
- /* @__PURE__ */u(t,{name:"download",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.download]}),p&&/* @__PURE__ */m("button",{type:"button",onClick:p,className:H,children:[
17
+ /* @__PURE__ */m("button",{type:"button",onClick:h??(()=>{const e=document.createElement("a");e.href=a,e.download=o,e.click()}),className:F,children:[
18
+ /* @__PURE__ */u(t,{name:"download",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.download]}),p&&/* @__PURE__ */m("button",{type:"button",onClick:p,className:F,children:[
19
19
  /* @__PURE__ */u(t,{name:"email",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.email]})]}),
20
- /* @__PURE__ */u("div",{ref:N,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!M)return;if(e.ctrlKey||e.metaKey)return;const t=N.current;if(!t)return;const n=t.scrollTop<=0,r=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.deltaY>0&&r&&E<P?(e.preventDefault(),z(e=>Math.min(P,e+1)),requestAnimationFrame(()=>{N.current&&(N.current.scrollTop=0)})):e.deltaY<0&&n&&E>1&&(e.preventDefault(),z(e=>Math.max(1,e-1)),requestAnimationFrame(()=>{N.current&&(N.current.scrollTop=N.current.scrollHeight)}))},onKeyDown:e=>{if(!M)return;const t=(document.activeElement?.tagName||"").toLowerCase();"input"===t||"textarea"===t||document.activeElement?.isContentEditable||("PageDown"===e.key||"ArrowRight"===e.key?E<P&&(e.preventDefault(),z(e=>Math.min(P,e+1))):"PageUp"===e.key||"ArrowLeft"===e.key?E>1&&(e.preventDefault(),z(e=>Math.max(1,e-1))):"Home"===e.key?(e.preventDefault(),z(1)):"End"===e.key&&(e.preventDefault(),z(P)))},children:T?/* @__PURE__ */u(n,{size:"sm",padding:"",className:"h-full",label:x.loading}):/* @__PURE__ */m("div",{className:"min-h-full flex items-center justify-center p-4",children:[
20
+ /* @__PURE__ */u("div",{ref:N,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!M)return;if(e.ctrlKey||e.metaKey)return;const t=N.current;if(!t)return;const n=t.scrollTop<=0,r=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.deltaY>0&&r&&E<z?(e.preventDefault(),P(e=>Math.min(z,e+1)),requestAnimationFrame(()=>{N.current&&(N.current.scrollTop=0)})):e.deltaY<0&&n&&E>1&&(e.preventDefault(),P(e=>Math.max(1,e-1)),requestAnimationFrame(()=>{N.current&&(N.current.scrollTop=N.current.scrollHeight)}))},onKeyDown:e=>{if(!M)return;const t=(document.activeElement?.tagName||"").toLowerCase();"input"===t||"textarea"===t||document.activeElement?.isContentEditable||("PageDown"===e.key||"ArrowRight"===e.key?E<z&&(e.preventDefault(),P(e=>Math.min(z,e+1))):"PageUp"===e.key||"ArrowLeft"===e.key?E>1&&(e.preventDefault(),P(e=>Math.max(1,e-1))):"Home"===e.key?(e.preventDefault(),P(1)):"End"===e.key&&(e.preventDefault(),P(z)))},children:$?/* @__PURE__ */u(n,{size:"sm",padding:"",className:"h-full",label:x.loading}):/* @__PURE__ */m("div",{className:"min-h-full flex items-center justify-center p-4",children:[
21
21
  /* @__PURE__ */u("style",{children:'\n.preview-pdf-textlayer {\n position: absolute;\n inset: 0;\n overflow: clip;\n line-height: 1;\n text-align: initial;\n text-size-adjust: none;\n forced-color-adjust: none;\n transform-origin: 0 0;\n caret-color: CanvasText;\n --min-font-size: 1;\n --text-scale-factor: calc(var(--total-scale-factor, 1) * var(--min-font-size));\n --min-font-size-inv: calc(1 / var(--min-font-size));\n}\n.preview-pdf-textlayer :is(span, br) {\n color: transparent;\n position: absolute;\n white-space: pre;\n cursor: text;\n transform-origin: 0% 0%;\n}\n.preview-pdf-textlayer > :not(.markedContent),\n.preview-pdf-textlayer .markedContent span:not(.markedContent) {\n z-index: 1;\n --font-height: 0;\n font-size: calc(var(--text-scale-factor) * var(--font-height));\n --scale-x: 1;\n --rotate: 0deg;\n transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));\n}\n.preview-pdf-textlayer .markedContent {\n display: contents;\n}\n.preview-pdf-textlayer span[role="img"] {\n user-select: none;\n cursor: default;\n}\n.preview-pdf-textlayer ::selection {\n background: rgba(0, 80, 255, 0.25);\n}\n.preview-pdf-textlayer br::selection {\n background: transparent;\n}\n.preview-pdf-textlayer .endOfContent {\n display: block;\n position: absolute;\n inset: 100% 0 0;\n z-index: 0;\n cursor: default;\n user-select: none;\n}\n.preview-pdf-textlayer.selecting .endOfContent {\n top: 0;\n}\n'}),
22
22
  /* @__PURE__ */m("div",{className:"relative shadow-lg rounded",children:[
23
23
  /* @__PURE__ */u("canvas",{ref:k,className:"block rounded"}),
@@ -1,11 +1,11 @@
1
- import{Card as e}from"./chunk-WUKN5WUM.js";import{Select_default as a}from"./chunk-CO5RKOVX.js";import{Pagination as r}from"./chunk-ENL5L6NR.js";import{Input_default as t}from"./chunk-MAMWQCJ6.js";import{StatusBadgeProvider as i,StatusBadge as s}from"./chunk-LNARMEEZ.js";import{Button_default as l}from"./chunk-NHH2MXFU.js";import{Icon as c}from"./chunk-FSPFV4MI.js";import{TH_ONE_LINE as m}from"./chunk-OZAAIE4E.js";import{useState as n}from"react";import{jsx as d,jsxs as o}from"react/jsx-runtime";var h={active:"success",invited:"queued",suspended:"danger",pending:"pending"},p=[{name:"Alice Nguyen",email:"alice@acme.co",role:"Admin",status:"active"},{name:"Marco Reyes",email:"marco@acme.co",role:"Editor",status:"invited"},{name:"Priya Patel",email:"priya@acme.co",role:"Editor",status:"active"},{name:"Tom Becker",email:"tom@acme.co",role:"Viewer",status:"suspended"},{name:"Sara Lind",email:"sara@acme.co",role:"Viewer",status:"pending"},{name:"Yuki Tanaka",email:"yuki@acme.co",role:"Editor",status:"active"}];function u(){const[c,u]=n(1),[g,f]=n(""),[y,N]=n("");/* @__PURE__ */
1
+ import{Card as e}from"./chunk-5RAOFJYT.js";import{Select_default as a}from"./chunk-4DBPKTVX.js";import{Pagination as r}from"./chunk-P65C5TUU.js";import{Input_default as t}from"./chunk-MAMWQCJ6.js";import{StatusBadgeProvider as i,StatusBadge as s}from"./chunk-LNARMEEZ.js";import{Button_default as l}from"./chunk-NHH2MXFU.js";import{Icon as c}from"./chunk-FSPFV4MI.js";import{TH_ONE_LINE as m}from"./chunk-OZAAIE4E.js";import{useState as n}from"react";import{jsx as d,jsxs as o}from"react/jsx-runtime";var h={active:"success",invited:"queued",suspended:"danger",pending:"pending"},p=[{name:"Alice Nguyen",email:"alice@acme.co",role:"Admin",status:"active"},{name:"Marco Reyes",email:"marco@acme.co",role:"Editor",status:"invited"},{name:"Priya Patel",email:"priya@acme.co",role:"Editor",status:"active"},{name:"Tom Becker",email:"tom@acme.co",role:"Viewer",status:"suspended"},{name:"Sara Lind",email:"sara@acme.co",role:"Viewer",status:"pending"},{name:"Yuki Tanaka",email:"yuki@acme.co",role:"Editor",status:"active"}];function u(){const[c,u]=n(1),[g,f]=n(""),[y,v]=n("");/* @__PURE__ */
2
2
  return d(i,{groups:h,children:/* @__PURE__ */d("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */o("div",{className:"mx-auto max-w-5xl space-y-4",children:[
3
3
  /* @__PURE__ */o("div",{className:"flex items-center justify-between gap-4",children:[
4
4
  /* @__PURE__ */d("h1",{className:"text-xl font-semibold text-gray-900",children:"Members"}),
5
5
  /* @__PURE__ */d(l,{size:"sm",children:"Invite member"})]}),
6
6
  /* @__PURE__ */o(e,{padded:!1,children:[
7
7
  /* @__PURE__ */o("div",{className:"flex flex-wrap items-center gap-2 border-b border-gray-100 p-3",children:[
8
- /* @__PURE__ */d("div",{className:"min-w-48 flex-1",children:/* @__PURE__ */d(t,{value:y,onChange:e=>N(e.target.value),placeholder:"Search members…",leftIcon:/* @__PURE__ */d(x,{})})}),
8
+ /* @__PURE__ */d("div",{className:"min-w-48 flex-1",children:/* @__PURE__ */d(t,{value:y,onChange:e=>v(e.target.value),placeholder:"Search members…",leftIcon:/* @__PURE__ */d(x,{})})}),
9
9
  /* @__PURE__ */d("div",{className:"w-40",children:/* @__PURE__ */d(a,{value:g,onChange:f,placeholder:"All roles",options:[{value:"admin",label:"Admin"},{value:"editor",label:"Editor"},{value:"viewer",label:"Viewer"}]})}),
10
10
  /* @__PURE__ */d(l,{variant:"secondary",size:"sm",children:"Filter"})]}),
11
11
  /* @__PURE__ */o("table",{className:"w-full text-sm",children:[
@@ -1,2 +1,2 @@
1
- import{TimelineCard as e}from"./chunk-S4Z657L6.js";import{TimelineTrack as n,TimelineMilestoneIcon as s}from"./chunk-EFFF3FCS.js";import{toDayMs as i,fmtSliderDate as t,DAY_MS as a}from"./chunk-YDEIXM2A.js";import{useBrowserValueOnce as l}from"./chunk-D65T4H6J.js";import{useShellStrings as o,useShellLocale as r}from"./chunk-QWHQJNKL.js";import{jsx as h}from"react/jsx-runtime";function m({title:m,heading:d,subject:c,milestones:p,summary:u,endDate:g,phaseLabels:k,variant:v="card",edgeCaptions:f,highlightKeys:y=null,onHoverChange:b}){const M=l(Date.now,null),j=[],C=[],x=o().timeline,D=r();for(const e of p){const n=i(e.date??null);null===n?C.push({key:e.key,label:e.label,kind:e.kind}):j.push({...e,ms:n})}j.sort((e,n)=>e.ms-n.ms);const F=i(g??null);let H,L,N=!0;0===j.length?(L=F??M??0,H=L-30*a,N=null!==F||null!==M):(H=j[0].ms,L=F??j[j.length-1].ms,L-H<a&&(L=H+a));const w=j.length>0?Math.max(0,Math.round((L-H)/a)):0,K=u??(w>0?x.duration(w):void 0),O=[j.length>0?x.started(t(j[0].ms,D)):void 0,K,C.length>0?x.reached(j.length,p.length):void 0],E=j.map(e=>{return{key:e.key,ms:e.ms,kind:e.kind,label:e.label,detail:e.detail,preview:e.preview,glyph:e.glyph,onClick:e.onClick,onOpen:e.onOpen,priority:(n=e.kind,"dfm"===n?1:0),caption:e.caption,provisional:e.provisional};var n}),J={};for(const e of j)e.phase&&(J[e.phase]=J[e.phase]||[]).push(e.ms);const Q=Object.entries(J).filter(([,e])=>e.length>=2).map(([e,n])=>({key:e,label:k?.[e]??e,minMs:Math.min(...n),maxMs:Math.max(...n)})),S="rail"===v,A=N&&/* @__PURE__ */h("div",{className:"select-none",children:/* @__PURE__ */h(n,{axis:S?"spread":"compressed",labels:S?"none":"lanes",items:E,pending:C,phases:Q,startMs:H,endMs:L,todayMs:M??void 0,edgeCaptions:f,highlightKeys:y,onHoverChange:b,ariaLabel:x.milestones(m)})});/* @__PURE__ */
2
- return h("div",S?{className:"shrink-0","data-timeline-variant":"rail",children:A}:{className:"shrink-0",children:/* @__PURE__ */h(e,{icon:/* @__PURE__ */h(s,{}),heading:d??m,subject:c,meta:O,children:A})})}export{m as MilestoneTimeline};
1
+ import{TimelineCard as e}from"./chunk-S4Z657L6.js";import{TimelineTrack as n,TimelineMilestoneIcon as s}from"./chunk-2SJDTKQA.js";import{toDayMs as i,fmtSliderDate as t,DAY_MS as a}from"./chunk-YDEIXM2A.js";import{useBrowserValueOnce as l}from"./chunk-D65T4H6J.js";import{useShellStrings as o,useShellLocale as r}from"./chunk-PEM7UXQ3.js";import{jsx as h}from"react/jsx-runtime";function m({title:m,heading:d,subject:c,milestones:p,summary:u,endDate:g,phaseLabels:k,variant:v="card",edgeCaptions:f,highlightKeys:y=null,onHoverChange:b}){const M=l(Date.now,null),j=[],x=[],C=o().timeline,D=r();for(const e of p){const n=i(e.date??null);null===n?x.push({key:e.key,label:e.label,kind:e.kind}):j.push({...e,ms:n})}j.sort((e,n)=>e.ms-n.ms);const w=i(g??null);let H,K,L=!0;0===j.length?(K=w??M??0,H=K-30*a,L=null!==w||null!==M):(H=j[0].ms,K=w??j[j.length-1].ms,K-H<a&&(K=H+a));const N=j.length>0?Math.max(0,Math.round((K-H)/a)):0,O=u??(N>0?C.duration(N):void 0),A=[j.length>0?C.started(t(j[0].ms,D)):void 0,O,x.length>0?C.reached(j.length,p.length):void 0],E=j.map(e=>{return{key:e.key,ms:e.ms,kind:e.kind,label:e.label,detail:e.detail,preview:e.preview,glyph:e.glyph,onClick:e.onClick,onOpen:e.onOpen,priority:(n=e.kind,"dfm"===n?1:0),caption:e.caption,provisional:e.provisional};var n}),J={};for(const e of j)e.phase&&(J[e.phase]=J[e.phase]||[]).push(e.ms);const Q=Object.entries(J).filter(([,e])=>e.length>=2).map(([e,n])=>({key:e,label:k?.[e]??e,minMs:Math.min(...n),maxMs:Math.max(...n)})),S="rail"===v,T=L&&/* @__PURE__ */h("div",{className:"select-none",children:/* @__PURE__ */h(n,{axis:S?"spread":"compressed",labels:S?"none":"lanes",items:E,pending:x,phases:Q,startMs:H,endMs:K,todayMs:M??void 0,edgeCaptions:f,highlightKeys:y,onHoverChange:b,ariaLabel:C.milestones(m)})});/* @__PURE__ */
2
+ return h("div",S?{className:"shrink-0","data-timeline-variant":"rail",children:T}:{className:"shrink-0",children:/* @__PURE__ */h(e,{icon:/* @__PURE__ */h(s,{}),heading:d??m,subject:c,meta:A,children:T})})}export{m as MilestoneTimeline};
@@ -1,4 +1,4 @@
1
- import{Icon as e}from"./chunk-FSPFV4MI.js";import{DEFAULT_SHELL_STRINGS as t}from"./chunk-QWHQJNKL.js";import{jsx as r}from"react/jsx-runtime";var n=["left","center","right","justify"],a={left:"align-left",center:"align-center",right:"align-right",justify:"align-justify"};function i(t){switch(t){case"left":/* @__PURE__ */
1
+ import{Icon as e}from"./chunk-FSPFV4MI.js";import{DEFAULT_SHELL_STRINGS as t}from"./chunk-PEM7UXQ3.js";import{jsx as r}from"react/jsx-runtime";var n=["left","center","right","justify"],a={left:"align-left",center:"align-center",right:"align-right",justify:"align-justify"};function i(t){switch(t){case"left":/* @__PURE__ */
2
2
  return r(e,{name:"align-left"});case"center":/* @__PURE__ */
3
3
  return r(e,{name:"align-center"});case"right":/* @__PURE__ */
4
4
  return r(e,{name:"align-right"});case"justify":/* @__PURE__ */
@@ -0,0 +1,8 @@
1
+ import{DragBand as e,tooltipBesideBand as t}from"./chunk-QCFN3ET4.js";import{niceAxis as r,niceMax as i,linearScale as n,axisGutter as o,bandScale as l}from"./chunk-2JWPNR2U.js";import{usePlotWidth as a}from"./chunk-MAFUXCPZ.js";import{CHART_INK as h}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as c,useShellLocale as m}from"./chunk-PEM7UXQ3.js";import{formatPlain as d}from"./chunk-C3QOHMR6.js";import{useRef as u,useState as f,useId as g,useEffect as p}from"react";import{jsx as x,jsxs as y}from"react/jsx-runtime";function v({labels:v,values:b,height:k=220,width:M,bandPadding:w=.24,min:N,max:A,yTickCount:$=4,formatValue:j,yAxisLabel:E,xTickAnchor:P="center",children:U,overlay:R,tooltip:z,onSelect:C,zoom:D,ariaLabel:F,className:L,emptyLabel:S}){const T=c().charts,I=m(),Q=j??(e=>d(e,I)),V=S??T.noData,W=u(null),B=a(W),X=M??B,[Z,H]=f(null),J=g();if(p(()=>{if(null!==Z)return s(e=>"Escape"===e.key&&(H(null),!0))},[Z]),0===v.length||!b.some(Number.isFinite))/* @__PURE__ */
2
+ return x("div",{className:L,ref:W,children:/* @__PURE__ */x("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:k},children:V})});const K=b.filter(Number.isFinite),O=K.every(Number.isInteger),q=void 0===N&&void 0===A?r(Math.min(0,...K),Math.max(0,...K),{intervals:$+1,integer:O}):null,G=void 0!==N&&void 0===A?r(N,Math.max(N,...K),{intervals:$+1,integer:O,zero:!1}):null,Y=q?q.lo:N??Math.min(0,...K),_=q?q.hi:G?G.hi:A??i(Math.max(...K,0)),ee=q?q.ticks:G?[Y,...G.ticks.filter(e=>e>Y)]:n([Y,_],{from:0,to:1}).ticks($+1),te={top:12,right:16,bottom:26,left:o(ee.map(Q),48)+(E?10:0)},re=te.left,ie=Math.max(re+1,X-te.right),ne=te.top,oe=k-te.bottom,le=n([Y,_],{from:oe,to:ne}),ae=l(v.length,{from:re,to:ie},w),he=(ie-re)/Math.max(1,v.length),se=he>=48,ce=se?1:Math.max(1,Math.ceil(v.length/Math.max(1,Math.floor(X/84)))),me=Math.max(2,Math.floor((he-6)/6.6)),de=e=>se&&e.length>me?`${e.slice(0,me-1).trimEnd()}…`:e;/* @__PURE__ */
3
+ return y("div",{className:`relative ${L??""}`,ref:W,children:[
4
+ /* @__PURE__ */y("svg",{width:"100%",height:k,viewBox:`0 0 ${X} ${k}`,role:"img","aria-label":F,tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>H(null),onBlur:()=>H(null),onKeyDown:e=>{if(C&&null!==Z&&("Enter"===e.key||" "===e.key))return e.preventDefault(),void C(Z);if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1;H(e=>Math.min(v.length-1,Math.max(0,(e??0)+t)))},style:D?{userSelect:"none",touchAction:"pan-y"}:void 0,children:[
5
+ /* @__PURE__ */x("defs",{children:/* @__PURE__ */x("clipPath",{id:J,children:/* @__PURE__ */x("rect",{x:re,y:ne,width:ie-re,height:oe-ne})})}),ee.map(e=>/* @__PURE__ */x("line",{x1:re,y1:le(e),x2:ie,y2:le(e),stroke:h.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${e}`)),
6
+ /* @__PURE__ */x("line",{x1:re,y1:le(Math.max(Y,0)),x2:ie,y2:le(Math.max(Y,0)),stroke:h.axis,strokeWidth:1,shapeRendering:"crispEdges"}),ee.map(e=>/* @__PURE__ */x("text",{x:re-8,y:le(e)+4,textAnchor:"end",fontSize:11,fill:h.label,style:{fontVariantNumeric:"tabular-nums"},children:Q(e)},`t${e}`)),E&&/* @__PURE__ */x("text",{x:14,y:(ne+oe)/2,transform:`rotate(-90 14 ${(ne+oe)/2})`,textAnchor:"middle",fontSize:11,fill:h.label,children:E}),
7
+ /* @__PURE__ */x("g",{clipPath:`url(#${J})`,children:U({x:ae,y:le,left:re,right:ie,top:ne,bottom:oe,width:X,height:k,clipId:J,active:Z})}),R?.({x:ae,y:le,left:re,right:ie,top:ne,bottom:oe,width:X,height:k,clipId:J,active:Z}),v.map((e,t)=>t%ce===0?/* @__PURE__ */x("text",{x:"start"===P?ae(t):ae.center(t),y:k-8,textAnchor:"middle",fontSize:11,fill:h.label,style:{fontVariantNumeric:"tabular-nums"},children:de(e)},`x${t}`):null),D?.drag&&/* @__PURE__ */x(e,{x0:ae.center(D.drag[0])-(ie-re)/v.length/2,x1:ae.center(D.drag[1])+(ie-re)/v.length/2,top:ne,bottom:oe}),v.map((e,t)=>/* @__PURE__ */x("rect",{x:ae.center(t)-(ie-re)/v.length/2,y:ne,width:(ie-re)/v.length,height:oe-ne,fill:"transparent",onMouseEnter:()=>H(t),onPointerDown:D?()=>D.press(t):void 0,onPointerEnter:D?()=>D.over(t):void 0,onPointerUp:D?.release,onClick:C?()=>C(t):void 0,style:C?{cursor:"pointer"}:void 0},`h${t}`))]}),z&&null!==Z&&
8
+ /* @__PURE__ */x("div",{className:"pointer-events-none absolute top-2 z-10",style:t(ae.center(Z),ae.bandwidth,X),children:z(Z)})]})}export{v as CartesianPlot};
@@ -1,20 +1,20 @@
1
- import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as n}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as i,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-5F7HMNCX.js";import{useSettingAuto as d,useInSettingRow as s}from"./chunk-L65BESIE.js";import{inputClasses as c,PLACEHOLDER_INK as u}from"./chunk-AYZY3YNC.js";import{useIsMobile as p}from"./chunk-UGTRSRIW.js";import{optionNoteClass as m}from"./chunk-URHGHXDN.js";import{Icon as v}from"./chunk-FSPFV4MI.js";import{onOverlayOpen as h}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as f}from"./chunk-62LW225J.js";import{useDropdownPosition as b,MENU_MAX_HEIGHT as g}from"./chunk-GLUJS42B.js";import{solidSurfaceStyle as y}from"./chunk-DTJRIWFR.js";import{registerModalEscapeInterceptor as x}from"./chunk-TWVUQUUD.js";import{useShellStrings as N}from"./chunk-QWHQJNKL.js";import{forwardRef as k,useId as w,useState as $,useRef as D,useMemo as S,useCallback as j,useEffect as H,useLayoutEffect as E}from"react";import{createPortal as I}from"react-dom";import{jsxs as T,jsx as C,Fragment as z}from"react/jsx-runtime";var O=e=>e.labelStyle?{lineHeight:1.25,...e.labelStyle}:void 0,R=k(function({value:e,onChange:t,options:r,placeholder:n,invalid:i,className:a="",size:l,touchSize:o,renderOption:p,renderValue:m,valueText:h,readOnly:f,footer:b,changed:g,auto:y,multiple:x,"aria-describedby":k,...$},D){const S=t,j=N(),H=d(),E=y??H,I=w(),O=s(),R=/* @__PURE__ */T("select",{ref:D,value:e,multiple:x||void 0,onChange:e=>S(x?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":i||void 0,"aria-describedby":[k,E?I:void 0].filter(Boolean).join(" ")||void 0,className:c({invalid:i,size:l,auto:E,className:`${O&&!x?"appearance-none ":""}pr-8 ${a}`.trim()}),...$,children:[void 0!==n&&!x&&/* @__PURE__ */C("option",{value:"",disabled:!0,children:n}),
2
- /* @__PURE__ */C(A,{items:r})]}),B=O&&!x?/* @__PURE__ */T("div",{className:"relative",children:[R,
3
- /* @__PURE__ */C(v,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${u}`,strokeWidth:2})]}):R;return E?/* @__PURE__ */T(z,{children:[B,
4
- /* @__PURE__ */C("span",{id:I,hidden:!0,children:j.settingView.auto})]}):B});function A({items:e}){const t=e=>/* @__PURE__ */C("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
5
- return C(z,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */C("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var B=k(function({value:l,onChange:s,options:p,placeholder:k,invalid:R,className:B="",id:F,disabled:K,size:U,touchSize:V,title:W,multiple:L,renderOption:M,renderValue:P,valueText:G,readOnly:J=!1,footer:Y,changed:Q=!1,auto:X,"aria-describedby":q,"aria-label":Z,"aria-labelledby":_,...ee},te){const[re,ne]=$(!1),[ie,ae]=$(-1),le=D(null),oe=D(null),de=D(null),se=D(null),ce=D([]),ue=()=>se.current??de.current,pe=!!Y?.length,me="sm"===U,ve=me?"min-h-7 px-3 py-1 text-xs leading-4":"min-h-(--row-height-menu) px-3 py-2 text-sm leading-5",he=m(me),[fe,be]=$(null),ge=N(),ye=D(re);ye.current=re;const xe=D({buffer:"",timer:null}),Ne=w(),ke=`${Ne}-listbox`,we=F??`${Ne}-trigger`,$e=e=>`${Ne}-opt-${e}`,De=`${Ne}-changed`,Se=d(),je=X??Se,He=`${Ne}-auto`,Ee=[q,Q?De:void 0,je?He:void 0].filter(Boolean).join(" ")||void 0,Ie=S(()=>i(p),[p]),Te=L?l:[],Ce=s,ze=b(oe,re,{matchTriggerWidth:!0,...Y?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),Oe="undefined"==typeof window?H:E,Re=`${re}|${ze?.top}|${ze?.bottom}|${ze?.maxHeight}|${p.length}`;Oe(()=>{be(null)},[Re]),Oe(()=>{const e=de.current;if(!re||!e||null!==fe)return;if(e.scrollHeight<=e.clientHeight+1)return;const t=getComputedStyle(e),r=parseFloat(t.paddingTop)||0;parseFloat(t.paddingBottom);const n=e.getBoundingClientRect().top;let i=0;for(const t of e.querySelectorAll('[role="option"]')){const r=t.getBoundingClientRect().bottom-n+e.scrollTop;if(!(r<=e.clientHeight+.5))break;i=r}i>r&&be(Math.floor(i))},[re,fe,Re]);const Ae=L?Ie.findIndex(e=>Te.includes(e.value)):Ie.findIndex(e=>e.value===l),Be=L?Ie.filter(e=>Te.includes(e.value)).map(e=>e.label).join(", ")||void 0:Ae>=0?Ie[Ae].label:void 0,Fe=!L&&Ae>=0?Ie[Ae].lang:void 0,Ke=L?Ie.filter(e=>Te.includes(e.value)):Ae>=0?[Ie[Ae]]:[],Ue=P&&Ke.length?P(Ke):void 0,Ve=void 0!==Ue&&G?G(Ke):void 0,We=j((e=!0)=>{ne(!1),ae(-1),e&&oe.current?.focus()},[]),Le=j(()=>{K||J||(ae(Ae>=0?Ae:e(Ie)),ne(!0))},[K,J,Ie,Ae]),Me=j(e=>{const t=Ie[e];if(t&&!t.disabled){if(L){const r=l;return Ce(r.includes(t.value)?r.filter(e=>e!==t.value):[...r,t.value]),void ae(e)}Ce(t.value),We()}},[Ie,L,l,Ce,We]);H(()=>{if(!re)return;return x(e=>!("Escape"!==e.key||!ye.current)&&(We(),!0),ue)},[re,We]),H(()=>{if(!re)return;const e=e=>{const t=e.target;le.current?.contains(t)||ue()?.contains(t)||We(!1)};document.addEventListener("pointerdown",e);const t=h(()=>We(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[re,We]),H(()=>{!re||ie<0||de.current?.querySelector(`#${CSS.escape($e(ie))}`)?.scrollIntoView({block:"nearest"})},[re,ie]);const Pe=j(e=>{const r=xe.current;r.timer&&clearTimeout(r.timer),r.buffer+=e,r.timer=setTimeout(()=>{r.buffer="",r.timer=null},500);const n=re?ie:Ae,i=t(Ie,r.buffer,n);i<0||(re?ae(i):L?(ae(i),ne(!0)):Me(i))},[re,ie,Ae,Ie,Me,L]),Ge=re?a(p,(e,t)=>{const r=(n=e.value,L?Te.includes(n):l===n);var n;const i=t===ie;/* @__PURE__ */
6
- return T("div",{id:$e(t),role:"option",lang:e.description||e.labelStyle||M?void 0:e.lang,"aria-selected":r,"aria-disabled":e.disabled||void 0,onPointerEnter:()=>{e.disabled||ae(t)},onClick:()=>Me(t),className:`mx-1 cursor-pointer truncate rounded-lg ${ve}${L?" flex items-center gap-2":""}\n ${e.disabled?"cursor-not-allowed text-gray-400":i?"bg-blue-50 text-blue-700":r?"font-medium text-blue-600":"text-gray-700"}`,children:[L&&/* @__PURE__ */C(o,{selected:r}),M?/* @__PURE__ */C("span",{className:"block min-w-0 flex-1 truncate",children:M(e,{selected:r,active:i})}):L?/* @__PURE__ */T("span",{className:"block min-w-0 flex-1",children:[
1
+ import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as n}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as i,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-5F7HMNCX.js";import{useSettingAuto as d,useInSettingRow as s}from"./chunk-L65BESIE.js";import{inputClasses as c,PLACEHOLDER_INK as u}from"./chunk-AYZY3YNC.js";import{useIsMobile as p}from"./chunk-UGTRSRIW.js";import{optionNoteClass as m}from"./chunk-URHGHXDN.js";import{Icon as v}from"./chunk-FSPFV4MI.js";import{onOverlayOpen as h}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as f}from"./chunk-62LW225J.js";import{useDropdownPosition as b,MENU_MAX_HEIGHT as g}from"./chunk-GLUJS42B.js";import{solidSurfaceStyle as y}from"./chunk-DTJRIWFR.js";import{registerModalEscapeInterceptor as x}from"./chunk-TWVUQUUD.js";import{useShellStrings as k}from"./chunk-PEM7UXQ3.js";import{forwardRef as w,useId as N,useState as $,useRef as D,useMemo as S,useCallback as j,useEffect as E,useLayoutEffect as H}from"react";import{createPortal as I}from"react-dom";import{jsxs as T,jsx as C,Fragment as z}from"react/jsx-runtime";var O=e=>e.labelStyle?{lineHeight:1.25,...e.labelStyle}:void 0,R=w(function({value:e,onChange:t,options:r,placeholder:n,invalid:i,className:a="",size:l,touchSize:o,renderOption:p,renderValue:m,valueText:h,readOnly:f,footer:b,changed:g,auto:y,multiple:x,"aria-describedby":w,...$},D){const S=t,j=k(),E=d(),H=y??E,I=N(),O=s(),R=/* @__PURE__ */T("select",{ref:D,value:e,multiple:x||void 0,onChange:e=>S(x?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":i||void 0,"aria-describedby":[w,H?I:void 0].filter(Boolean).join(" ")||void 0,className:c({invalid:i,size:l,auto:H,className:`${O&&!x?"appearance-none ":""}pr-8 ${a}`.trim()}),...$,children:[void 0!==n&&!x&&/* @__PURE__ */C("option",{value:"",disabled:!0,children:n}),
2
+ /* @__PURE__ */C(U,{items:r})]}),A=O&&!x?/* @__PURE__ */T("div",{className:"relative",children:[R,
3
+ /* @__PURE__ */C(v,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${u}`,strokeWidth:2})]}):R;return H?/* @__PURE__ */T(z,{children:[A,
4
+ /* @__PURE__ */C("span",{id:I,hidden:!0,children:j.settingView.auto})]}):A});function U({items:e}){const t=e=>/* @__PURE__ */C("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
5
+ return C(z,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */C("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var A=w(function({value:l,onChange:s,options:p,placeholder:w,invalid:R,className:A="",id:B,disabled:F,size:V,touchSize:K,title:M,multiple:P,renderOption:W,renderValue:L,valueText:G,readOnly:X=!1,footer:Y,changed:J=!1,auto:q,"aria-describedby":Q,"aria-label":Z,"aria-labelledby":_,...ee},te){const[re,ne]=$(!1),[ie,ae]=$(-1),le=D(null),oe=D(null),de=D(null),se=D(null),ce=D([]),ue=()=>se.current??de.current,pe=!!Y?.length,me="sm"===V,ve=me?"min-h-7 px-3 py-1 text-xs leading-4":"min-h-(--row-height-menu) px-3 py-2 text-sm leading-5",he=m(me),[fe,be]=$(null),ge=k(),ye=D(re);ye.current=re;const xe=D({buffer:"",timer:null}),ke=N(),we=`${ke}-listbox`,Ne=B??`${ke}-trigger`,$e=e=>`${ke}-opt-${e}`,De=`${ke}-changed`,Se=d(),je=q??Se,Ee=`${ke}-auto`,He=[Q,J?De:void 0,je?Ee:void 0].filter(Boolean).join(" ")||void 0,Ie=S(()=>i(p),[p]),Te=P?l:[],Ce=s,ze=b(oe,re,{matchTriggerWidth:!0,...Y?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),Oe="undefined"==typeof window?E:H,Re=`${re}|${ze?.top}|${ze?.bottom}|${ze?.maxHeight}|${p.length}`;Oe(()=>{be(null)},[Re]),Oe(()=>{const e=de.current;if(!re||!e||null!==fe)return;if(e.scrollHeight<=e.clientHeight+1)return;const t=getComputedStyle(e),r=parseFloat(t.paddingTop)||0;parseFloat(t.paddingBottom);const n=e.getBoundingClientRect().top;let i=0;for(const t of e.querySelectorAll('[role="option"]')){const r=t.getBoundingClientRect().bottom-n+e.scrollTop;if(!(r<=e.clientHeight+.5))break;i=r}i>r&&be(Math.floor(i))},[re,fe,Re]);const Ue=P?Ie.findIndex(e=>Te.includes(e.value)):Ie.findIndex(e=>e.value===l),Ae=P?Ie.filter(e=>Te.includes(e.value)).map(e=>e.label).join(", ")||void 0:Ue>=0?Ie[Ue].label:void 0,Be=!P&&Ue>=0?Ie[Ue].lang:void 0,Fe=P?Ie.filter(e=>Te.includes(e.value)):Ue>=0?[Ie[Ue]]:[],Ve=L&&Fe.length?L(Fe):void 0,Ke=void 0!==Ve&&G?G(Fe):void 0,Me=j((e=!0)=>{ne(!1),ae(-1),e&&oe.current?.focus()},[]),Pe=j(()=>{F||X||(ae(Ue>=0?Ue:e(Ie)),ne(!0))},[F,X,Ie,Ue]),We=j(e=>{const t=Ie[e];if(t&&!t.disabled){if(P){const r=l;return Ce(r.includes(t.value)?r.filter(e=>e!==t.value):[...r,t.value]),void ae(e)}Ce(t.value),Me()}},[Ie,P,l,Ce,Me]);E(()=>{if(!re)return;return x(e=>!("Escape"!==e.key||!ye.current)&&(Me(),!0),ue)},[re,Me]),E(()=>{if(!re)return;const e=e=>{const t=e.target;le.current?.contains(t)||ue()?.contains(t)||Me(!1)};document.addEventListener("pointerdown",e);const t=h(()=>Me(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[re,Me]),E(()=>{!re||ie<0||de.current?.querySelector(`#${CSS.escape($e(ie))}`)?.scrollIntoView({block:"nearest"})},[re,ie]);const Le=j(e=>{const r=xe.current;r.timer&&clearTimeout(r.timer),r.buffer+=e,r.timer=setTimeout(()=>{r.buffer="",r.timer=null},500);const n=re?ie:Ue,i=t(Ie,r.buffer,n);i<0||(re?ae(i):P?(ae(i),ne(!0)):We(i))},[re,ie,Ue,Ie,We,P]),Ge=re?a(p,(e,t)=>{const r=(n=e.value,P?Te.includes(n):l===n);var n;const i=t===ie;/* @__PURE__ */
6
+ return T("div",{id:$e(t),role:"option",lang:e.description||e.labelStyle||W?void 0:e.lang,"aria-selected":r,"aria-disabled":e.disabled||void 0,onPointerEnter:()=>{e.disabled||ae(t)},onClick:()=>We(t),className:`mx-1 cursor-pointer truncate rounded-lg ${ve}${P?" flex items-center gap-2":""}\n ${e.disabled?"cursor-not-allowed text-gray-400":i?"bg-blue-50 text-blue-700":r?"font-medium text-blue-600":"text-gray-700"}`,children:[P&&/* @__PURE__ */C(o,{selected:r}),W?/* @__PURE__ */C("span",{className:"block min-w-0 flex-1 truncate",children:W(e,{selected:r,active:i})}):P?/* @__PURE__ */T("span",{className:"block min-w-0 flex-1",children:[
7
7
  /* @__PURE__ */C("span",{lang:e.lang,className:"block truncate",style:O(e),children:e.label}),e.description&&/* @__PURE__ */C("span",{className:he,children:e.description})]}):e.description||e.labelStyle?
8
8
  /* @__PURE__ */T(z,{children:[
9
- /* @__PURE__ */C("span",{lang:e.lang,className:"block truncate",style:O(e),children:e.label}),e.description&&/* @__PURE__ */C("span",{className:he,children:e.description})]}):e.label]},e.value)},Ne,"mx-1"):null,Je=void 0!==Ue?
9
+ /* @__PURE__ */C("span",{lang:e.lang,className:"block truncate",style:O(e),children:e.label}),e.description&&/* @__PURE__ */C("span",{className:he,children:e.description})]}):e.label]},e.value)},ke,"mx-1"):null,Xe=void 0!==Ve?
10
10
  /* @__PURE__ */T("span",{className:"relative block min-w-0 truncate",children:[
11
- /* @__PURE__ */C("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:Ue}),
12
- /* @__PURE__ */C("span",{lang:void 0===Ve?Fe:void 0,className:"sr-only",children:Ve??Be})]}):/* @__PURE__ */C("span",{lang:Fe,className:`block truncate ${void 0===Be?u:""}`,children:Be??k??" "}),Ye={zIndex:f.popup,left:ze?.left,top:ze?.top,bottom:ze?.bottom,width:ze?.width,maxHeight:ze?.maxHeight??g,visibility:ze?void 0:"hidden",...y()},Qe=/* @__PURE__ */C("div",{ref:de,id:ke,role:"listbox","aria-labelledby":_??(Z?void 0:we),"aria-label":_?void 0:Z,"aria-multiselectable":L||void 0,className:pe?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:pe?null!==fe?{maxHeight:fe}:void 0:null!==fe?{...Ye,maxHeight:fe}:Ye,children:Ge}),Xe=pe?/* @__PURE__ */T("div",{ref:se,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:Ye,children:[Qe,
13
- /* @__PURE__ */C("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:Y.map((e,t)=>/* @__PURE__ */T("button",{ref:e=>{ce.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(We(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(Y?.length??0)-1,n=t=>{e.preventDefault(),ce.current[t]?.focus()},i=()=>{e.preventDefault(),oe.current?.focus()};switch(e.key){case"ArrowDown":return void n(Math.min(t+1,r));case"ArrowUp":return void(0===t?i():n(t-1));case"Home":return void n(0);case"End":return void n(r);case"Tab":return e.shiftKey?void(0===t?i():n(t-1)):t<r?void n(t+1):(e.preventDefault(),void We());case"Escape":return e.preventDefault(),e.stopPropagation(),void We()}})(e,t),className:`flex w-full items-center gap-2 rounded-lg ${ve} text-left rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${e.disabled?"cursor-not-allowed text-ink-faintest":"cursor-pointer text-ink hover:bg-accent-tint hover:text-blue-700"}`,children:[e.icon&&/* @__PURE__ */C(v,{name:e.icon,"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
14
- /* @__PURE__ */C("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):Qe;/* @__PURE__ */
11
+ /* @__PURE__ */C("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:Ve}),
12
+ /* @__PURE__ */C("span",{lang:void 0===Ke?Be:void 0,className:"sr-only",children:Ke??Ae})]}):/* @__PURE__ */C("span",{lang:Be,className:`block truncate ${void 0===Ae?u:""}`,children:Ae??w??" "}),Ye={zIndex:f.popup,left:ze?.left,top:ze?.top,bottom:ze?.bottom,width:ze?.width,maxHeight:ze?.maxHeight??g,visibility:ze?void 0:"hidden",...y()},Je=/* @__PURE__ */C("div",{ref:de,id:we,role:"listbox","aria-labelledby":_??(Z?void 0:Ne),"aria-label":_?void 0:Z,"aria-multiselectable":P||void 0,className:pe?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:pe?null!==fe?{maxHeight:fe}:void 0:null!==fe?{...Ye,maxHeight:fe}:Ye,children:Ge}),qe=pe?/* @__PURE__ */T("div",{ref:se,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:Ye,children:[Je,
13
+ /* @__PURE__ */C("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:Y.map((e,t)=>/* @__PURE__ */T("button",{ref:e=>{ce.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(Me(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(Y?.length??0)-1,n=t=>{e.preventDefault(),ce.current[t]?.focus()},i=()=>{e.preventDefault(),oe.current?.focus()};switch(e.key){case"ArrowDown":return void n(Math.min(t+1,r));case"ArrowUp":return void(0===t?i():n(t-1));case"Home":return void n(0);case"End":return void n(r);case"Tab":return e.shiftKey?void(0===t?i():n(t-1)):t<r?void n(t+1):(e.preventDefault(),void Me());case"Escape":return e.preventDefault(),e.stopPropagation(),void Me()}})(e,t),className:`flex w-full items-center gap-2 rounded-lg ${ve} text-left rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${e.disabled?"cursor-not-allowed text-ink-faintest":"cursor-pointer text-ink hover:bg-accent-tint hover:text-blue-700"}`,children:[e.icon&&/* @__PURE__ */C(v,{name:e.icon,"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
14
+ /* @__PURE__ */C("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):Je;/* @__PURE__ */
15
15
  return T("div",{ref:le,className:"relative",children:[
16
- /* @__PURE__ */C("button",{ref:oe,id:we,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":re,"aria-controls":re?ke:void 0,"aria-activedescendant":re&&ie>=0?$e(ie):void 0,"aria-invalid":R||void 0,"aria-describedby":Ee,"aria-label":Z,"aria-labelledby":_,title:W,disabled:K,"aria-readonly":J||void 0,onClick:()=>re?We():Le(),onKeyDown:t=>{if(!K&&!J)switch(t.key){case"ArrowDown":return t.preventDefault(),void(re?ae(e=>n(Ie,e,1)):Le());case"ArrowUp":return t.preventDefault(),void(re?ae(e=>n(Ie,e,-1)):Le());case"Home":return void(re&&(t.preventDefault(),ae(e(Ie))));case"End":return void(re&&(t.preventDefault(),ae(r(Ie))));case"Enter":return void(re&&(t.preventDefault(),Me(ie)));case" ":return t.preventDefault(),void(re?Me(ie):Le());case"Escape":return void(re&&(t.preventDefault(),t.stopPropagation(),We()));case"Tab":return re&&pe&&!t.shiftKey?(t.preventDefault(),void ce.current[0]?.focus()):void(re&&We(!1));default:1!==t.key.length||t.metaKey||t.ctrlKey||t.altKey||(t.preventDefault(),Pe(t.key))}},className:c({invalid:R,size:U,readOnly:J,auto:je,className:`${J?"":"pr-8 "}text-left ${B}`.trim()}),children:Q?
17
- /* @__PURE__ */T("span",{className:"flex min-w-0 items-center gap-1",children:[Je,
18
- /* @__PURE__ */C("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):Je}),Q&&/* @__PURE__ */C("span",{id:De,hidden:!0,children:ge.select.changed}),je&&/* @__PURE__ */C("span",{id:He,hidden:!0,children:ge.settingView.auto}),!J&&/* @__PURE__ */C(v,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${u}`,strokeWidth:2}),
19
- /* @__PURE__ */T("select",{ref:te,value:l,multiple:L||void 0,onChange:e=>Ce(L?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:K,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...ee,children:[void 0!==k&&!L&&/* @__PURE__ */C("option",{value:"",disabled:!0,children:k}),
20
- /* @__PURE__ */C(A,{items:p})]}),re&&I(Xe,document.body)]})}),F=k(function({touchSize:e,...t},r){const n=p(),i=s(),a=e??(i?t.size??"md":"touch");return!n||void 0===t.footer&&void 0===t.changed||t.readOnly?n&&!t.readOnly?/* @__PURE__ */C(R,{ref:r,...t,size:a}):/* @__PURE__ */C(B,{ref:r,...t}):/* @__PURE__ */C(B,{ref:r,...t,size:a})});export{R as NativeSelect,F as Select_default};
16
+ /* @__PURE__ */C("button",{ref:oe,id:Ne,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":re,"aria-controls":re?we:void 0,"aria-activedescendant":re&&ie>=0?$e(ie):void 0,"aria-invalid":R||void 0,"aria-describedby":He,"aria-label":Z,"aria-labelledby":_,title:M,disabled:F,"aria-readonly":X||void 0,onClick:()=>re?Me():Pe(),onKeyDown:t=>{if(!F&&!X)switch(t.key){case"ArrowDown":return t.preventDefault(),void(re?ae(e=>n(Ie,e,1)):Pe());case"ArrowUp":return t.preventDefault(),void(re?ae(e=>n(Ie,e,-1)):Pe());case"Home":return void(re&&(t.preventDefault(),ae(e(Ie))));case"End":return void(re&&(t.preventDefault(),ae(r(Ie))));case"Enter":return void(re&&(t.preventDefault(),We(ie)));case" ":return t.preventDefault(),void(re?We(ie):Pe());case"Escape":return void(re&&(t.preventDefault(),t.stopPropagation(),Me()));case"Tab":return re&&pe&&!t.shiftKey?(t.preventDefault(),void ce.current[0]?.focus()):void(re&&Me(!1));default:1!==t.key.length||t.metaKey||t.ctrlKey||t.altKey||(t.preventDefault(),Le(t.key))}},className:c({invalid:R,size:V,readOnly:X,auto:je,className:`${X?"":"pr-8 "}text-left ${A}`.trim()}),children:J?
17
+ /* @__PURE__ */T("span",{className:"flex min-w-0 items-center gap-1",children:[Xe,
18
+ /* @__PURE__ */C("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):Xe}),J&&/* @__PURE__ */C("span",{id:De,hidden:!0,children:ge.select.changed}),je&&/* @__PURE__ */C("span",{id:Ee,hidden:!0,children:ge.settingView.auto}),!X&&/* @__PURE__ */C(v,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${u}`,strokeWidth:2}),
19
+ /* @__PURE__ */T("select",{ref:te,value:l,multiple:P||void 0,onChange:e=>Ce(P?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:F,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...ee,children:[void 0!==w&&!P&&/* @__PURE__ */C("option",{value:"",disabled:!0,children:w}),
20
+ /* @__PURE__ */C(U,{items:p})]}),re&&I(qe,document.body)]})}),B=w(function({touchSize:e,...t},r){const n=p(),i=s(),a=e??(i?t.size??"md":"touch");return!n||void 0===t.footer&&void 0===t.changed||t.readOnly?n&&!t.readOnly?/* @__PURE__ */C(R,{ref:r,...t,size:a}):/* @__PURE__ */C(A,{ref:r,...t}):/* @__PURE__ */C(A,{ref:r,...t,size:a})});export{R as NativeSelect,B as Select_default};
@@ -1,4 +1,4 @@
1
- import{swallowPress as e,describedByWith as i,OffWithReason as r}from"./chunk-HL6JSDN3.js";import{Icon as a}from"./chunk-FSPFV4MI.js";import{OneLineLabel as o}from"./chunk-OZAAIE4E.js";import{Tooltip as s}from"./chunk-BCDG4N6L.js";import{useShellStrings as n}from"./chunk-QWHQJNKL.js";import{useId as l,Fragment as d}from"react";import{jsx as t,jsxs as c}from"react/jsx-runtime";function b({items:b,onChange:h,label:m,className:u="","aria-labelledby":f,"aria-describedby":p}){const w=n().displayChips,g=l();/* @__PURE__ */
1
+ import{swallowPress as e,describedByWith as i,OffWithReason as r}from"./chunk-HL6JSDN3.js";import{Icon as a}from"./chunk-FSPFV4MI.js";import{OneLineLabel as o}from"./chunk-OZAAIE4E.js";import{Tooltip as s}from"./chunk-BCDG4N6L.js";import{useShellStrings as n}from"./chunk-PEM7UXQ3.js";import{useId as l,Fragment as d}from"react";import{jsx as t,jsxs as c}from"react/jsx-runtime";function b({items:b,onChange:h,label:m,className:u="","aria-labelledby":f,"aria-describedby":p}){const w=n().displayChips,g=l();/* @__PURE__ */
2
2
  return t("div",{role:"group","aria-label":f?void 0:m,"aria-labelledby":f,"aria-describedby":p,className:`flex flex-wrap gap-2 ${u}`.trim(),children:b.map((n,l)=>{const b=`${g}-${l}-state`,m=`${g}-${l}-reason`,u=Boolean(n.disabled)&&null!=n.disabledReason&&""!==n.disabledReason,f=/* @__PURE__ */c("button",{type:"button","aria-pressed":n.shown,disabled:!(!n.disabled||u)||void 0,"aria-disabled":!!u||void 0,"aria-describedby":i(b,u?m:void 0),onClick:u?e:()=>h(n.id,!n.shown),className:"inline-flex h-6 max-w-full shrink-0 items-center gap-1 whitespace-nowrap rounded-full border pl-2 pr-3 text-xs font-medium transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60 aria-disabled:cursor-not-allowed aria-disabled:opacity-60 "+(n.shown?"border-blue-200 bg-accent-tint text-blue-700 hover:bg-blue-100":"border-line bg-surface text-ink-faint hover:bg-row-hover hover:text-ink-strongest"),children:[
3
3
  /* @__PURE__ */t(a,{name:n.shown?"eye":"eye-off",className:"h-4 w-4 shrink-0",strokeWidth:"1.75"}),
4
4
  /* @__PURE__ */t(o,{children:n.label})]}),p=/* @__PURE__ */t("span",{id:b,className:"sr-only",children:n.shown?w.shown:w.hidden});/* @__PURE__ */
@@ -1 +1 @@
1
- import{buttonClasses as t}from"./chunk-UQYNPYF4.js";import{SPINNER_RING as e}from"./chunk-MRJKZWWV.js";import{currentShellStrings as n}from"./chunk-QWHQJNKL.js";var o="http://www.w3.org/2000/svg",s={},r=/* @__PURE__ */new Map;function i(t,e){let n=document.getElementById(t);return n||(n=document.createElement("div"),n.id=t,n.className=e,document.body.appendChild(n)),n}var a={success:"M5 13l4 4L19 7",error:"M6 18L18 6M6 6l12 12",warning:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z",info:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",bell:"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"};function c(t,e){const n=document.createElementNS(o,"svg");n.setAttribute("class",e),n.setAttribute("fill","none"),n.setAttribute("viewBox","0 0 24 24"),n.setAttribute("stroke","currentColor"),n.setAttribute("stroke-width","2");const s=document.createElementNS(o,"path");return s.setAttribute("stroke-linecap","round"),s.setAttribute("stroke-linejoin","round"),s.setAttribute("d",a[t]),n.appendChild(s),n}function l(t,e){const n=document.createElement("div");return n.className=t,void 0!==e&&(n.textContent=e),n}function d(n,o,a){const d={...s,...a},u=d.placement??"top",m=d.sticky??!1,p=`${u}|${n}|${o}`;if(d.dedupe){const t=r.get(p);if(t)return t.restart(),{dismiss:t.dismiss}}"loading"!==n&&!1!==d.sound&&import("./sounds-E5OTSJLX.js").then(t=>{"success"===n?t.playSuccess():"error"===n?t.playError():t.playNotification()}).catch(()=>{});const f="bottom"===u?i("toast-container-bottom","fixed bottom-4 left-1/2 -translate-x-1/2 z-(--z-toast) flex flex-col-reverse gap-2 items-center pointer-events-none"):i("toast-container","fixed top-4 left-1/2 -translate-x-1/2 z-(--z-toast) flex flex-col gap-2 items-center pointer-events-none"),h="bottom"===u?"translateY(10px)":"translateY(-10px)",y=l("pointer-events-auto cursor-pointer rosh-toast");if(y.style.opacity="0",y.style.transform=`${h} scale(0.95)`,y.setAttribute("role","error"===n?"alert":"status"),y.setAttribute("aria-atomic","true"),"loading"===n){const t=document.createElement("span");t.setAttribute("aria-hidden","true"),t.className=`${e} h-4 w-4 rosh-tone-loading`,y.appendChild(t)}else y.appendChild(c(n,`h-4 w-4 rosh-tone-${n}`));const v=document.createElement("span");if(v.textContent=o,y.appendChild(v),d.action){const{label:e,onClick:n}=d.action,o=document.createElement("button");o.type="button",o.className=t({variant:"link",size:"sm"}),o.textContent=e,o.addEventListener("click",t=>{t.stopPropagation(),g||(n(),x("action"))}),y.appendChild(o)}let b;f.appendChild(y),requestAnimationFrame(()=>{y.style.opacity="1",y.style.transform="translateY(0) scale(1)"});let g=!1;const x=t=>{g||(g=!0,b&&clearTimeout(b),r.delete(p),y.style.opacity="0",y.style.transform=`${h} scale(0.95)`,setTimeout(()=>y.remove(),300),d.onClose?.(t))},w=()=>x("dismissed"),E=d.duration??("info"===n?4500:3e3),C=()=>{b&&clearTimeout(b),m||(b=setTimeout(()=>x("timeout"),E))};return C(),y.addEventListener("mouseenter",()=>{b&&clearTimeout(b)}),y.addEventListener("mouseleave",()=>{g||C()}),y.addEventListener("click",w),r.set(p,{el:y,restart:C,dismiss:w}),{dismiss:w}}var u=8e3,m=/* @__PURE__ */new Map,p=!1;var f={success:(t,e)=>d("success",t,e),error:(t,e)=>d("error",t,e),warning:(t,e)=>d("warning",t,e),info:(t,e)=>d("info",t,e),notify:(t,e)=>function(t,e){!1!==(e?.sound??s.sound)&&import("./sounds-E5OTSJLX.js").then(t=>t.playNotification()).catch(()=>{});const o=i("notif-container","fixed top-4 right-4 z-(--z-toast) flex flex-col gap-3 items-end pointer-events-none"),r=l("pointer-events-auto cursor-pointer rosh-notif");r.style.opacity="0",r.style.transform="translateX(30px) scale(0.95)";const a=l("rosh-notif-badge");a.appendChild(c("bell","h-5 w-5"));const d=l("rosh-notif-body");d.append(l("rosh-notif-title",n().toast.notification),l("notif-msg rosh-notif-msg",t));const u=document.createElement("button");u.className="rosh-notif-close",u.textContent="×",r.append(a,d,u);const m=()=>{r.style.opacity="0",r.style.transform="translateX(30px) scale(0.95)",setTimeout(()=>r.remove(),300)};u.addEventListener("click",t=>{t.stopPropagation(),m()}),r.addEventListener("click",m),o.appendChild(r),requestAnimationFrame(()=>{r.style.opacity="1",r.style.transform="translateX(0) scale(1)"}),setTimeout(m,e?.duration??1e4)}(t,e),promise:(t,e,n)=>{const o=d("loading",e.loading,{...n,sticky:!0});return t.then(t=>{o.dismiss(),d("success","function"==typeof e.success?e.success(t):e.success,n)},t=>{o.dismiss(),d("error","function"==typeof e.error?e.error(t):e.error,n)}),t},configure:t=>{s={...t}},undoable:function(t,e){p||"undefined"==typeof window||(p=!0,window.addEventListener("pagehide",()=>{const t=[...m.values()];m.clear();for(const e of t)e.run({keepalive:!0})}));const o=/* @__PURE__ */Symbol("undoable");let s=!1,r=null;const i=async t=>{if(!s){s=!0,m.delete(o);try{await(t?e.commit(t):e.commit())}catch(t){e.onFail?.(t)}}},a=()=>!s&&(s=!0,m.delete(o),e.undo(),!0);return m.set(o,{run:i}),r=d("success",t,{sound:!1,placement:e.placement,duration:e.duration??8e3,action:{label:e.actionLabel??n().toast.undo,onClick:()=>{a()}},onClose:t=>{"action"!==t&&i()}}),{undo:()=>{const t=a();return t&&r?.dismiss(),t},commit:async()=>{if(s)return;const t=i();r?.dismiss(),await t}}}};export{u as UNDOABLE_MS,f as toast_default};
1
+ import{buttonClasses as t}from"./chunk-UQYNPYF4.js";import{SPINNER_RING as e}from"./chunk-MRJKZWWV.js";import{currentShellStrings as n}from"./chunk-PEM7UXQ3.js";var o="http://www.w3.org/2000/svg",s={},r=/* @__PURE__ */new Map;function i(t,e){let n=document.getElementById(t);return n||(n=document.createElement("div"),n.id=t,n.className=e,document.body.appendChild(n)),n}var a={success:"M5 13l4 4L19 7",error:"M6 18L18 6M6 6l12 12",warning:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z",info:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",bell:"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"};function c(t,e){const n=document.createElementNS(o,"svg");n.setAttribute("class",e),n.setAttribute("fill","none"),n.setAttribute("viewBox","0 0 24 24"),n.setAttribute("stroke","currentColor"),n.setAttribute("stroke-width","2");const s=document.createElementNS(o,"path");return s.setAttribute("stroke-linecap","round"),s.setAttribute("stroke-linejoin","round"),s.setAttribute("d",a[t]),n.appendChild(s),n}function l(t,e){const n=document.createElement("div");return n.className=t,void 0!==e&&(n.textContent=e),n}function d(n,o,a){const d={...s,...a},u=d.placement??"top",m=d.sticky??!1,p=`${u}|${n}|${o}`;if(d.dedupe){const t=r.get(p);if(t)return t.restart(),{dismiss:t.dismiss}}"loading"!==n&&!1!==d.sound&&import("./sounds-E5OTSJLX.js").then(t=>{"success"===n?t.playSuccess():"error"===n?t.playError():t.playNotification()}).catch(()=>{});const f="bottom"===u?i("toast-container-bottom","fixed bottom-4 left-1/2 -translate-x-1/2 z-(--z-toast) flex flex-col-reverse gap-2 items-center pointer-events-none"):i("toast-container","fixed top-4 left-1/2 -translate-x-1/2 z-(--z-toast) flex flex-col gap-2 items-center pointer-events-none"),h="bottom"===u?"translateY(10px)":"translateY(-10px)",y=l("pointer-events-auto cursor-pointer rosh-toast");if(y.style.opacity="0",y.style.transform=`${h} scale(0.95)`,y.setAttribute("role","error"===n?"alert":"status"),y.setAttribute("aria-atomic","true"),"loading"===n){const t=document.createElement("span");t.setAttribute("aria-hidden","true"),t.className=`${e} h-4 w-4 rosh-tone-loading`,y.appendChild(t)}else y.appendChild(c(n,`h-4 w-4 rosh-tone-${n}`));const v=document.createElement("span");if(v.textContent=o,y.appendChild(v),d.action){const{label:e,onClick:n}=d.action,o=document.createElement("button");o.type="button",o.className=t({variant:"link",size:"sm"}),o.textContent=e,o.addEventListener("click",t=>{t.stopPropagation(),g||(n(),x("action"))}),y.appendChild(o)}let b;f.appendChild(y),requestAnimationFrame(()=>{y.style.opacity="1",y.style.transform="translateY(0) scale(1)"});let g=!1;const x=t=>{g||(g=!0,b&&clearTimeout(b),r.delete(p),y.style.opacity="0",y.style.transform=`${h} scale(0.95)`,setTimeout(()=>y.remove(),300),d.onClose?.(t))},w=()=>x("dismissed"),E=d.duration??("info"===n?4500:3e3),C=()=>{b&&clearTimeout(b),m||(b=setTimeout(()=>x("timeout"),E))};return C(),y.addEventListener("mouseenter",()=>{b&&clearTimeout(b)}),y.addEventListener("mouseleave",()=>{g||C()}),y.addEventListener("click",w),r.set(p,{el:y,restart:C,dismiss:w}),{dismiss:w}}var u=8e3,m=/* @__PURE__ */new Map,p=!1;var f={success:(t,e)=>d("success",t,e),error:(t,e)=>d("error",t,e),warning:(t,e)=>d("warning",t,e),info:(t,e)=>d("info",t,e),notify:(t,e)=>function(t,e){!1!==(e?.sound??s.sound)&&import("./sounds-E5OTSJLX.js").then(t=>t.playNotification()).catch(()=>{});const o=i("notif-container","fixed top-4 right-4 z-(--z-toast) flex flex-col gap-3 items-end pointer-events-none"),r=l("pointer-events-auto cursor-pointer rosh-notif");r.style.opacity="0",r.style.transform="translateX(30px) scale(0.95)";const a=l("rosh-notif-badge");a.appendChild(c("bell","h-5 w-5"));const d=l("rosh-notif-body");d.append(l("rosh-notif-title",n().toast.notification),l("notif-msg rosh-notif-msg",t));const u=document.createElement("button");u.className="rosh-notif-close",u.textContent="×",r.append(a,d,u);const m=()=>{r.style.opacity="0",r.style.transform="translateX(30px) scale(0.95)",setTimeout(()=>r.remove(),300)};u.addEventListener("click",t=>{t.stopPropagation(),m()}),r.addEventListener("click",m),o.appendChild(r),requestAnimationFrame(()=>{r.style.opacity="1",r.style.transform="translateX(0) scale(1)"}),setTimeout(m,e?.duration??1e4)}(t,e),promise:(t,e,n)=>{const o=d("loading",e.loading,{...n,sticky:!0});return t.then(t=>{o.dismiss(),d("success","function"==typeof e.success?e.success(t):e.success,n)},t=>{o.dismiss(),d("error","function"==typeof e.error?e.error(t):e.error,n)}),t},configure:t=>{s={...t}},undoable:function(t,e){p||"undefined"==typeof window||(p=!0,window.addEventListener("pagehide",()=>{const t=[...m.values()];m.clear();for(const e of t)e.run({keepalive:!0})}));const o=/* @__PURE__ */Symbol("undoable");let s=!1,r=null;const i=async t=>{if(!s){s=!0,m.delete(o);try{await(t?e.commit(t):e.commit())}catch(t){e.onFail?.(t)}}},a=()=>!s&&(s=!0,m.delete(o),e.undo(),!0);return m.set(o,{run:i}),r=d("success",t,{sound:!1,placement:e.placement,duration:e.duration??8e3,action:{label:e.actionLabel??n().toast.undo,onClick:()=>{a()}},onClose:t=>{"action"!==t&&i()}}),{undo:()=>{const t=a();return t&&r?.dismiss(),t},commit:async()=>{if(s)return;const t=i();r?.dismiss(),await t}}}};export{u as UNDOABLE_MS,f as toast_default};
@@ -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-DWBZ3Z34.js";import{useIsPhone as a}from"./chunk-UGTRSRIW.js";import{Icon as n}from"./chunk-FSPFV4MI.js";import{useBrowserState as o}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-QWHQJNKL.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:j="bg-white"}){const z="right"===m,C=i().sidebar,D=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}}(),[I,O]=o(()=>(x?r(x,w,k):null)??b(N,w,k),b(N,w,k)),E=null!=l||null!=n,K=/* @__PURE__ */f("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:I},children:[
2
- /* @__PURE__ */f("div",{className:`flex h-full flex-col ${E?"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}),E?/* @__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:I,onResize:O,min:w,max:k,defaultWidth:b(N,w,k),storageKey:x,hint:C.resize})]}),M=/* @__PURE__ */p("div",{className:`flex min-w-0 flex-1 flex-col ${j}`,children:u});/* @__PURE__ */
4
- return f("div",D?{className:`relative flex h-full w-full flex-col overflow-hidden ${y}`,children:[
5
- /* @__PURE__ */p(g,{phone:P,top:l,fallback:C.sections}),M,
6
- /* @__PURE__ */p(v,{phone:P,bottom:n,label:C.sections,closeLabel:C.closeSections,children:e})]}:{className:`flex h-full w-full overflow-hidden ${y}`,children:[z?null:K,M,z?K: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-V5QEPNPK.js";import{useIsPhone as a}from"./chunk-UGTRSRIW.js";import{Icon as n}from"./chunk-FSPFV4MI.js";import{useBrowserState as o}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-PEM7UXQ3.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:P=("right"===m?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:j="bg-white"}){const z="right"===m,C=i().sidebar,E=a(),W=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,I]=o(()=>(x?r(x,w,k):null)??b(N,w,k),b(N,w,k)),M=null!=l||null!=n,O=/* @__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 ${M?"overflow-hidden":"overflow-y-auto"} ${P}`,children:[null!=l&&/* @__PURE__ */p("div",{className:"flex shrink-0 flex-col gap-2 px-2 pt-3 pb-2",children:l}),M?/* @__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:I,min:w,max:k,defaultWidth:b(N,w,k),storageKey:x,hint:C.resize})]}),K=/* @__PURE__ */p("div",{className:`flex min-w-0 flex-1 flex-col ${j}`,children:u});/* @__PURE__ */
4
+ return f("div",E?{className:`relative flex h-full w-full flex-col overflow-hidden ${y}`,children:[
5
+ /* @__PURE__ */p(g,{phone:W,top:l,fallback:C.sections}),K,
6
+ /* @__PURE__ */p(v,{phone:W,bottom:n,label:C.sections,closeLabel:C.closeSections,children:e})]}:{className:`flex h-full w-full overflow-hidden ${y}`,children:[z?null:O,K,z?O: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,19 +1,19 @@
1
- import{escapeHtml as e}from"./chunk-G6DKCCWH.js";import{TH_ONE_LINE as t}from"./chunk-OZAAIE4E.js";import{useBrowserLayoutEffect as n}from"./chunk-D65T4H6J.js";import{useShellStrings as r}from"./chunk-QWHQJNKL.js";import{useRef as o,useState as l,useEffect as c,useCallback as a,useMemo as s}from"react";import{createPortal as i}from"react-dom";import{jsxs as u,jsx as h,Fragment as d}from"react/jsx-runtime";function w(e,t){const n=e[e.length-1];return n&&!n.some(e=>e.trim())?e:[...e,Array(t).fill("")]}function m({text:t,...n}){const r=s(()=>({__html:e(t)}),[t]);/* @__PURE__ */
2
- return h("div",{...n,dangerouslySetInnerHTML:r})}function g({columns:e,data:g,onChange:f,onColumnsChange:p,fixedRows:b=!1,minRows:y=15,maxHeight:v="260px",cellStyles:x,onFocusChange:M,onSelectionChange:D}){const k=o(null),C=r().grid,[E,L]=l(null);c(()=>{M?.(E)},[E,M]);const[$,S]=l({}),A=o(null),[N,z]=l({}),O=o(null),[K,T]=l(null),[R,P]=l(null),[F,H]=l(null),[I,j]=l(null),[X,Y]=l(null),W=o(null);n(()=>{const e=W.current;if(!e||e.row!==X?.row||e.col!==X?.col)return;W.current=null;const t=k.current?.querySelector(`[data-row="${e.row}"][data-col="${e.col}"]`);if(!t)return;t.focus();const n=document.createRange();n.selectNodeContents(t),n.collapse(!1);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(n)},[X]);const[q,B]=l(null),[J,Q]=l(null);c(()=>{D?.(q&&J?{anchor:q,end:J}:null)},[q,J,D]);const _=o(!1),[G,U]=l(null),V=o(!1),Z=o({a:null,e:null});Z.current={a:q,e:J};const ee=q&&J&&(q.row!==J.row||q.col!==J.col),te=[...g];if(!b)for(;te.length<y;)te.push(Array(e.length).fill(""));const ne=a((t,n,r)=>{const o=te.map(e=>[...e]);for(;o.length<=t;)o.push(Array(e.length).fill(""));for(;o[t].length<e.length;)o[t].push("");o[t][n]=r,f(o)},[te,e.length,f]),re=a((e,t,n)=>{if(0!==e.button)return;const r=document.activeElement;if(r?.dataset?.row&&r?.dataset?.col){const e=parseInt(r.dataset.row),t=parseInt(r.dataset.col),n=r.textContent||"";if(n!==(te[e]?.[t]||"")){const r=te.map(e=>[...e]);r[e]&&(r[e][t]=n,f(r))}}_.current=!0,e.shiftKey&&q||B({row:t,col:n}),Q({row:t,col:n})},[te,f,q]),oe=a((e,t)=>{_.current&&Q({row:e,col:t})},[]);c(()=>{const e=()=>{_.current=!1};return window.addEventListener("mouseup",e),()=>window.removeEventListener("mouseup",e)},[]),c(()=>{const e=e=>{if(!e.ctrlKey&&!e.metaKey||"c"!==e.key)return;if(!q||!J)return;const t=window.getSelection();if(t&&t.toString().length>0&&!ee)return;const n=Math.min(q.row,J.row),r=Math.max(q.row,J.row),o=Math.min(q.col,J.col),l=Math.max(q.col,J.col),c=[];for(let e=n;e<=r;e++){const t=[];for(let n=o;n<=l;n++)t.push(te[e]?.[n]||"");c.push(t.join("\t"))}const a=c.join("\n");a&&(e.preventDefault(),navigator.clipboard.writeText(a))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[q,J,te,ee]),c(()=>{const t=t=>{if(!E)return;const n=document.activeElement;if(n?.isContentEditable)return;if(!k.current?.contains(n))return;const r=t.clipboardData?.getData("text/plain");if(!r)return;t.preventDefault();const o=r.split("\n").filter(e=>e).map(e=>e.split("\t")),l=te.map(e=>[...e]);for(let t=0;t<o.length;t++){const n=E.row+t;for(;l.length<=n;)l.push(Array(e.length).fill(""));for(;l[n].length<e.length;)l[n].push("");for(let r=0;r<o[t].length;r++){const c=E.col+r;if(c>=e.length)break;e[c].readOnly||(l[n][c]=o[t][r].trim())}}f(b?l:w(l,e.length)),B({row:E.row,col:E.col}),Q({row:Math.min(E.row+o.length-1,l.length-1),col:Math.min(E.col+(o[0]?.length||1)-1,e.length-1)})};return window.addEventListener("paste",t),()=>window.removeEventListener("paste",t)},[E,te,e,f,b]);const le=a((t,n,r)=>{const o=t.clipboardData.getData("text/plain");if(!o)return;const l=o.split("\n").map(e=>e.split("\t"));if(l.length<=1&&l[0]?.length<=1)return;t.preventDefault();const c=te.map(e=>[...e]);for(let t=0;t<l.length;t++){const o=n+t;for(;c.length<=o;)c.push(Array(e.length).fill(""));for(;c[o].length<e.length;)c[o].push("");for(let n=0;n<l[t].length;n++){const a=r+n;if(a>=e.length)break;e[a].readOnly||(c[o][a]=l[t][n].trim())}}f(b?c:w(c,e.length))},[te,e,f,b]),ce=a((t,n,r)=>{let o=n,l=r;if("Tab"===t.key)t.preventDefault(),l=t.shiftKey?r-1:r+1,l>=e.length&&(l=0,o=n+1),l<0&&(l=e.length-1,o=n-1);else if("Enter"===t.key)t.preventDefault(),o=t.shiftKey?n-1:n+1;else if("ArrowDown"===t.key)t.preventDefault(),o=n+1;else if("ArrowUp"===t.key)t.preventDefault(),o=n-1;else if("ArrowLeft"===t.key)t.preventDefault(),l=r-1;else{if("ArrowRight"!==t.key){if("Delete"===t.key||"Backspace"===t.key){const o=t.target;if(o.isContentEditable)return void(o.textContent&&window.getSelection()?.toString()===o.textContent&&(t.preventDefault(),ne(n,r,"")));if(t.preventDefault(),q&&J){const t=Math.min(q.row,J.row),n=Math.max(q.row,J.row),r=Math.min(q.col,J.col),o=Math.max(q.col,J.col),l=te.map(e=>[...e]);for(let c=t;c<=n;c++)for(let t=r;t<=o;t++)l[c]&&!e[t]?.readOnly&&(l[c][t]="");f(l)}else ne(n,r,"");return}return}t.preventDefault(),l=r+1}for(;l>=0&&l<e.length&&e[l].readOnly;)l+="Tab"===t.key&&t.shiftKey?-1:1;if(o>=0&&o<te.length&&l>=0&&l<e.length){const e=k.current?.querySelector(`[data-row="${o}"][data-col="${l}"]`);e&&(e.focus({preventScroll:!0}),e.scrollIntoView({block:"nearest",inline:"nearest"}),L({row:o,col:l}),Y(null),B({row:o,col:l}),Q({row:o,col:l}))}},[e,te,te.length,ne,q,J,f]),ae=a(t=>{if(!b&&t>=te.length-2){const t=te.map(e=>[...e]);for(let n=0;n<5;n++)t.push(Array(e.length).fill(""));f(t)}},[b,te,e.length,f]),[se,ie]=l(null);c(()=>{if(!se)return;const e=()=>ie(null);return window.addEventListener("pointerdown",e),()=>window.removeEventListener("pointerdown",e)},[se]);const ue=a(t=>{const n=te.map(e=>[...e]);n.splice(t,0,Array(e.length).fill("")),f(n)},[te,e.length,f]),he=a(e=>{if(te.length<=1)return;const t=te.filter((t,n)=>n!==e);f(t)},[te,f]),de=a(e=>{const t=te.map(t=>{const n=[...t];return n.splice(e,0,""),n});f(t)},[te,f]),we=a(t=>{if(e.length<=1)return;const n=te.map(e=>{const n=[...e];return n.splice(t,1),n});f(n)},[te,e.length,f]),me=a((e,t)=>{e.preventDefault(),b||ie({x:e.clientX,y:e.clientY,items:[{label:C.insertRowAbove,onClick:()=>{ue(t),ie(null)}},{label:C.insertRowBelow,onClick:()=>{ue(t+1),ie(null)}},{label:C.deleteRow(t+1),onClick:()=>{he(t),ie(null)}}]})},[b,ue,he,C]),ge=a((t,n)=>{t.preventDefault(),b||ie({x:t.clientX,y:t.clientY,items:[{label:C.insertColumnLeft,onClick:()=>{de(n),ie(null)}},{label:C.insertColumnRight,onClick:()=>{de(n+1),ie(null)}},{label:C.deleteColumn(String(e[n]?.title||n+1)),onClick:()=>{we(n),ie(null)}}]})},[b,e,de,we,C]),fe=t=>$[t]??e[t]?.width??150;c(()=>{const t=e=>{if(!A.current)return;const t=e.clientX-A.current.startX,n=Math.max(40,A.current.startW+t);S(e=>({...e,[A.current.col]:n}))},n=()=>{if(A.current&&p){const t=e.map((e,t)=>({...e,width:$[t]??e.width}));t[A.current.col]={...t[A.current.col],width:$[A.current.col]??e[A.current.col].width},p(t)}A.current=null,document.body.style.cursor=""};return window.addEventListener("mousemove",t),window.addEventListener("mouseup",n),()=>{window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",n)}},[e,$,p]);const pe=e=>N[e]??28;c(()=>{const e=e=>{if(!O.current)return;const t=e.clientY-O.current.startY,n=Math.max(20,O.current.startH+t);z(e=>({...e,[O.current.row]:n}))},t=()=>{O.current=null,document.body.style.cursor=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[]);const be=a(t=>{const n=document.createElement("canvas").getContext("2d");if(!n)return;n.font="12px ui-monospace, SFMono-Regular, Menlo, monospace";let r=0;for(const e of te){const o=String(e[t]??"").replace(/<[^>]*>/g,""),l=n.measureText(o).width;l>r&&(r=l)}const o=n.measureText(e[t]?.title??"").width;o>r&&(r=o);const l=Math.max(40,Math.ceil(r+24));if(S(e=>({...e,[t]:l})),p){const n=e.map((e,n)=>({...e,width:n===t?l:$[n]??e.width}));p(n)}},[te,e,$,p]),ye=a(e=>{z(t=>{const n={...t};return delete n[e],n})},[]),ve=a(t=>{const{a:n,e:r}=Z.current;if(!n||!r)return;const o=Math.min(n.row,r.row),l=Math.max(n.row,r.row),c=Math.min(n.col,r.col),a=Math.max(n.col,r.col);let s=o,i=l,u=c,h=a;t.row>l?i=t.row:t.row<o&&(s=t.row),t.col>a?h=t.col:t.col<c&&(u=t.col);const d=l-o+1,w=a-c+1,m=te.map(e=>[...e]);for(;m.length<=i;)m.push(Array(e.length).fill(""));for(const e of m)for(;e.length<=h;)e.push("");function g(e){const t=e.map(e=>parseFloat(e));if(t.length<2||t.some(e=>Number.isNaN(e)))return null;const n=t[1]-t[0];for(let e=2;e<t.length;e++)if(Math.abs(t[e]-t[e-1]-n)>1e-9)return null;return{step:n}}for(let e=s;e<=i;e++)for(let t=u;t<=h;t++){if(e>=o&&e<=l&&t>=c&&t<=a)continue;let n;if(1===w&&u===c&&h===a){const r=g(Array.from({length:d},(e,n)=>m[o+n]?.[t]??""));if(r){const c=parseFloat(m[l]?.[t]??"0"),a=parseFloat(m[o]?.[t]??"0"),s=e>l?e-l:-(o-e);n=String((e>l?c:a)+r.step*s)}else{const r=((e-o)%d+d)%d;n=m[o+r]?.[t]??""}}else if(1===d&&s===o&&i===l){const r=g(Array.from({length:w},(t,n)=>m[e]?.[c+n]??""));if(r){const o=parseFloat(m[e]?.[a]??"0"),l=parseFloat(m[e]?.[c]??"0"),s=t>a?t-a:-(c-t);n=String((t>a?o:l)+r.step*s)}else{const r=((t-c)%w+w)%w;n=m[e]?.[c+r]??""}}else{const r=((e-o)%d+d)%d,l=((t-c)%w+w)%w;n=m[o+r]?.[c+l]??""}m[e][t]=n}f(m),B({row:s,col:u}),Q({row:i,col:h})},[te,e.length,f]);c(()=>{const e=e=>{if(!V.current)return;const t=document.elementFromPoint(e.clientX,e.clientY),n=t?.closest?.("[data-row][data-col]");if(!n)return;const r=parseInt(n.dataset.row),o=parseInt(n.dataset.col);U({row:r,col:o})},t=()=>{V.current&&G&&ve(G),V.current=!1,U(null),document.body.style.cursor=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[G,ve]);const xe=e=>{e.preventDefault(),e.stopPropagation(),V.current=!0,document.body.style.cursor="crosshair"},Me=o(null),[De,ke]=l(0),[Ce,Ee]=l(800);c(()=>{const e=Me.current;if(!e)return;const t=()=>Ee(e.clientHeight||800);t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);const Le=te.length>100,$e=Le?Math.max(0,Math.floor(De/28)-20):0,Se=Le?Math.min(te.length,Math.ceil((De+Ce)/28)+20):te.length,Ae=s(()=>te.slice($e,Se),[te,$e,Se]),Ne=28*$e,ze=28*(te.length-Se),Oe="px-2 h-8 text-left text-xs font-medium text-ink-faint uppercase bg-gray-100 border-b border-r border-line select-none";/* @__PURE__ */
1
+ import{escapeHtml as e}from"./chunk-G6DKCCWH.js";import{TH_ONE_LINE as t}from"./chunk-OZAAIE4E.js";import{useBrowserLayoutEffect as n}from"./chunk-D65T4H6J.js";import{useShellStrings as r}from"./chunk-PEM7UXQ3.js";import{useRef as o,useState as l,useEffect as c,useCallback as a,useMemo as s}from"react";import{createPortal as i}from"react-dom";import{jsxs as u,jsx as h,Fragment as d}from"react/jsx-runtime";function w(e,t){const n=e[e.length-1];return n&&!n.some(e=>e.trim())?e:[...e,Array(t).fill("")]}function m({text:t,...n}){const r=s(()=>({__html:e(t)}),[t]);/* @__PURE__ */
2
+ return h("div",{...n,dangerouslySetInnerHTML:r})}function g({columns:e,data:g,onChange:f,onColumnsChange:p,fixedRows:b=!1,minRows:y=15,maxHeight:v="260px",cellStyles:x,onFocusChange:M,onSelectionChange:D}){const k=o(null),C=r().grid,[E,$]=l(null);c(()=>{M?.(E)},[E,M]);const[L,S]=l({}),A=o(null),[z,N]=l({}),O=o(null),[T,K]=l(null),[R,P]=l(null),[F,I]=l(null),[H,X]=l(null),[j,Y]=l(null),W=o(null);n(()=>{const e=W.current;if(!e||e.row!==j?.row||e.col!==j?.col)return;W.current=null;const t=k.current?.querySelector(`[data-row="${e.row}"][data-col="${e.col}"]`);if(!t)return;t.focus();const n=document.createRange();n.selectNodeContents(t),n.collapse(!1);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(n)},[j]);const[q,B]=l(null),[U,_]=l(null);c(()=>{D?.(q&&U?{anchor:q,end:U}:null)},[q,U,D]);const G=o(!1),[J,Q]=l(null),V=o(!1),Z=o({a:null,e:null});Z.current={a:q,e:U};const ee=q&&U&&(q.row!==U.row||q.col!==U.col),te=[...g];if(!b)for(;te.length<y;)te.push(Array(e.length).fill(""));const ne=a((t,n,r)=>{const o=te.map(e=>[...e]);for(;o.length<=t;)o.push(Array(e.length).fill(""));for(;o[t].length<e.length;)o[t].push("");o[t][n]=r,f(o)},[te,e.length,f]),re=a((e,t,n)=>{if(0!==e.button)return;const r=document.activeElement;if(r?.dataset?.row&&r?.dataset?.col){const e=parseInt(r.dataset.row),t=parseInt(r.dataset.col),n=r.textContent||"";if(n!==(te[e]?.[t]||"")){const r=te.map(e=>[...e]);r[e]&&(r[e][t]=n,f(r))}}G.current=!0,e.shiftKey&&q||B({row:t,col:n}),_({row:t,col:n})},[te,f,q]),oe=a((e,t)=>{G.current&&_({row:e,col:t})},[]);c(()=>{const e=()=>{G.current=!1};return window.addEventListener("mouseup",e),()=>window.removeEventListener("mouseup",e)},[]),c(()=>{const e=e=>{if(!e.ctrlKey&&!e.metaKey||"c"!==e.key)return;if(!q||!U)return;const t=window.getSelection();if(t&&t.toString().length>0&&!ee)return;const n=Math.min(q.row,U.row),r=Math.max(q.row,U.row),o=Math.min(q.col,U.col),l=Math.max(q.col,U.col),c=[];for(let e=n;e<=r;e++){const t=[];for(let n=o;n<=l;n++)t.push(te[e]?.[n]||"");c.push(t.join("\t"))}const a=c.join("\n");a&&(e.preventDefault(),navigator.clipboard.writeText(a))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[q,U,te,ee]),c(()=>{const t=t=>{if(!E)return;const n=document.activeElement;if(n?.isContentEditable)return;if(!k.current?.contains(n))return;const r=t.clipboardData?.getData("text/plain");if(!r)return;t.preventDefault();const o=r.split("\n").filter(e=>e).map(e=>e.split("\t")),l=te.map(e=>[...e]);for(let t=0;t<o.length;t++){const n=E.row+t;for(;l.length<=n;)l.push(Array(e.length).fill(""));for(;l[n].length<e.length;)l[n].push("");for(let r=0;r<o[t].length;r++){const c=E.col+r;if(c>=e.length)break;e[c].readOnly||(l[n][c]=o[t][r].trim())}}f(b?l:w(l,e.length)),B({row:E.row,col:E.col}),_({row:Math.min(E.row+o.length-1,l.length-1),col:Math.min(E.col+(o[0]?.length||1)-1,e.length-1)})};return window.addEventListener("paste",t),()=>window.removeEventListener("paste",t)},[E,te,e,f,b]);const le=a((t,n,r)=>{const o=t.clipboardData.getData("text/plain");if(!o)return;const l=o.split("\n").map(e=>e.split("\t"));if(l.length<=1&&l[0]?.length<=1)return;t.preventDefault();const c=te.map(e=>[...e]);for(let t=0;t<l.length;t++){const o=n+t;for(;c.length<=o;)c.push(Array(e.length).fill(""));for(;c[o].length<e.length;)c[o].push("");for(let n=0;n<l[t].length;n++){const a=r+n;if(a>=e.length)break;e[a].readOnly||(c[o][a]=l[t][n].trim())}}f(b?c:w(c,e.length))},[te,e,f,b]),ce=a((t,n,r)=>{let o=n,l=r;if("Tab"===t.key)t.preventDefault(),l=t.shiftKey?r-1:r+1,l>=e.length&&(l=0,o=n+1),l<0&&(l=e.length-1,o=n-1);else if("Enter"===t.key)t.preventDefault(),o=t.shiftKey?n-1:n+1;else if("ArrowDown"===t.key)t.preventDefault(),o=n+1;else if("ArrowUp"===t.key)t.preventDefault(),o=n-1;else if("ArrowLeft"===t.key)t.preventDefault(),l=r-1;else{if("ArrowRight"!==t.key){if("Delete"===t.key||"Backspace"===t.key){const o=t.target;if(o.isContentEditable)return void(o.textContent&&window.getSelection()?.toString()===o.textContent&&(t.preventDefault(),ne(n,r,"")));if(t.preventDefault(),q&&U){const t=Math.min(q.row,U.row),n=Math.max(q.row,U.row),r=Math.min(q.col,U.col),o=Math.max(q.col,U.col),l=te.map(e=>[...e]);for(let c=t;c<=n;c++)for(let t=r;t<=o;t++)l[c]&&!e[t]?.readOnly&&(l[c][t]="");f(l)}else ne(n,r,"");return}return}t.preventDefault(),l=r+1}for(;l>=0&&l<e.length&&e[l].readOnly;)l+="Tab"===t.key&&t.shiftKey?-1:1;if(o>=0&&o<te.length&&l>=0&&l<e.length){const e=k.current?.querySelector(`[data-row="${o}"][data-col="${l}"]`);e&&(e.focus({preventScroll:!0}),e.scrollIntoView({block:"nearest",inline:"nearest"}),$({row:o,col:l}),Y(null),B({row:o,col:l}),_({row:o,col:l}))}},[e,te,te.length,ne,q,U,f]),ae=a(t=>{if(!b&&t>=te.length-2){const t=te.map(e=>[...e]);for(let n=0;n<5;n++)t.push(Array(e.length).fill(""));f(t)}},[b,te,e.length,f]),[se,ie]=l(null);c(()=>{if(!se)return;const e=()=>ie(null);return window.addEventListener("pointerdown",e),()=>window.removeEventListener("pointerdown",e)},[se]);const ue=a(t=>{const n=te.map(e=>[...e]);n.splice(t,0,Array(e.length).fill("")),f(n)},[te,e.length,f]),he=a(e=>{if(te.length<=1)return;const t=te.filter((t,n)=>n!==e);f(t)},[te,f]),de=a(e=>{const t=te.map(t=>{const n=[...t];return n.splice(e,0,""),n});f(t)},[te,f]),we=a(t=>{if(e.length<=1)return;const n=te.map(e=>{const n=[...e];return n.splice(t,1),n});f(n)},[te,e.length,f]),me=a((e,t)=>{e.preventDefault(),b||ie({x:e.clientX,y:e.clientY,items:[{label:C.insertRowAbove,onClick:()=>{ue(t),ie(null)}},{label:C.insertRowBelow,onClick:()=>{ue(t+1),ie(null)}},{label:C.deleteRow(t+1),onClick:()=>{he(t),ie(null)}}]})},[b,ue,he,C]),ge=a((t,n)=>{t.preventDefault(),b||ie({x:t.clientX,y:t.clientY,items:[{label:C.insertColumnLeft,onClick:()=>{de(n),ie(null)}},{label:C.insertColumnRight,onClick:()=>{de(n+1),ie(null)}},{label:C.deleteColumn(String(e[n]?.title||n+1)),onClick:()=>{we(n),ie(null)}}]})},[b,e,de,we,C]),fe=t=>L[t]??e[t]?.width??150;c(()=>{const t=e=>{if(!A.current)return;const t=e.clientX-A.current.startX,n=Math.max(40,A.current.startW+t);S(e=>({...e,[A.current.col]:n}))},n=()=>{if(A.current&&p){const t=e.map((e,t)=>({...e,width:L[t]??e.width}));t[A.current.col]={...t[A.current.col],width:L[A.current.col]??e[A.current.col].width},p(t)}A.current=null,document.body.style.cursor=""};return window.addEventListener("mousemove",t),window.addEventListener("mouseup",n),()=>{window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",n)}},[e,L,p]);const pe=e=>z[e]??28;c(()=>{const e=e=>{if(!O.current)return;const t=e.clientY-O.current.startY,n=Math.max(20,O.current.startH+t);N(e=>({...e,[O.current.row]:n}))},t=()=>{O.current=null,document.body.style.cursor=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[]);const be=a(t=>{const n=document.createElement("canvas").getContext("2d");if(!n)return;n.font="12px ui-monospace, SFMono-Regular, Menlo, monospace";let r=0;for(const e of te){const o=String(e[t]??"").replace(/<[^>]*>/g,""),l=n.measureText(o).width;l>r&&(r=l)}const o=n.measureText(e[t]?.title??"").width;o>r&&(r=o);const l=Math.max(40,Math.ceil(r+24));if(S(e=>({...e,[t]:l})),p){const n=e.map((e,n)=>({...e,width:n===t?l:L[n]??e.width}));p(n)}},[te,e,L,p]),ye=a(e=>{N(t=>{const n={...t};return delete n[e],n})},[]),ve=a(t=>{const{a:n,e:r}=Z.current;if(!n||!r)return;const o=Math.min(n.row,r.row),l=Math.max(n.row,r.row),c=Math.min(n.col,r.col),a=Math.max(n.col,r.col);let s=o,i=l,u=c,h=a;t.row>l?i=t.row:t.row<o&&(s=t.row),t.col>a?h=t.col:t.col<c&&(u=t.col);const d=l-o+1,w=a-c+1,m=te.map(e=>[...e]);for(;m.length<=i;)m.push(Array(e.length).fill(""));for(const e of m)for(;e.length<=h;)e.push("");function g(e){const t=e.map(e=>parseFloat(e));if(t.length<2||t.some(e=>Number.isNaN(e)))return null;const n=t[1]-t[0];for(let e=2;e<t.length;e++)if(Math.abs(t[e]-t[e-1]-n)>1e-9)return null;return{step:n}}for(let e=s;e<=i;e++)for(let t=u;t<=h;t++){if(e>=o&&e<=l&&t>=c&&t<=a)continue;let n;if(1===w&&u===c&&h===a){const r=g(Array.from({length:d},(e,n)=>m[o+n]?.[t]??""));if(r){const c=parseFloat(m[l]?.[t]??"0"),a=parseFloat(m[o]?.[t]??"0"),s=e>l?e-l:-(o-e);n=String((e>l?c:a)+r.step*s)}else{const r=((e-o)%d+d)%d;n=m[o+r]?.[t]??""}}else if(1===d&&s===o&&i===l){const r=g(Array.from({length:w},(t,n)=>m[e]?.[c+n]??""));if(r){const o=parseFloat(m[e]?.[a]??"0"),l=parseFloat(m[e]?.[c]??"0"),s=t>a?t-a:-(c-t);n=String((t>a?o:l)+r.step*s)}else{const r=((t-c)%w+w)%w;n=m[e]?.[c+r]??""}}else{const r=((e-o)%d+d)%d,l=((t-c)%w+w)%w;n=m[o+r]?.[c+l]??""}m[e][t]=n}f(m),B({row:s,col:u}),_({row:i,col:h})},[te,e.length,f]);c(()=>{const e=e=>{if(!V.current)return;const t=document.elementFromPoint(e.clientX,e.clientY),n=t?.closest?.("[data-row][data-col]");if(!n)return;const r=parseInt(n.dataset.row),o=parseInt(n.dataset.col);Q({row:r,col:o})},t=()=>{V.current&&J&&ve(J),V.current=!1,Q(null),document.body.style.cursor=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[J,ve]);const xe=e=>{e.preventDefault(),e.stopPropagation(),V.current=!0,document.body.style.cursor="crosshair"},Me=o(null),[De,ke]=l(0),[Ce,Ee]=l(800);c(()=>{const e=Me.current;if(!e)return;const t=()=>Ee(e.clientHeight||800);t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);const $e=te.length>100,Le=$e?Math.max(0,Math.floor(De/28)-20):0,Se=$e?Math.min(te.length,Math.ceil((De+Ce)/28)+20):te.length,Ae=s(()=>te.slice(Le,Se),[te,Le,Se]),ze=28*Le,Ne=28*(te.length-Se),Oe="px-2 h-8 text-left text-xs font-medium text-ink-faint uppercase bg-gray-100 border-b border-r border-line select-none";/* @__PURE__ */
3
3
  return u("div",{ref:Me,className:"border border-gray-300 rounded overflow-scroll grid-scroll",style:{maxHeight:v,height:v},onScroll:e=>ke(e.target.scrollTop),children:[
4
4
  /* @__PURE__ */u("table",{ref:k,className:"border-collapse select-none",style:{tableLayout:"fixed",minWidth:36+e.reduce((t,n)=>t+fe(e.indexOf(n)),0)},children:[
5
5
  /* @__PURE__ */u("colgroup",{children:[
6
6
  /* @__PURE__ */h("col",{style:{width:36}}),e.map((e,t)=>/* @__PURE__ */h("col",{style:{width:fe(t)}},e.key))]}),
7
7
  /* @__PURE__ */h("thead",{className:"sticky top-0 z-10",children:/* @__PURE__ */u("tr",{children:[
8
- /* @__PURE__ */h("th",{className:`${t} ${Oe} text-center w-9 cursor-pointer hover:bg-gray-200`,onClick:()=>{B({row:0,col:0}),Q({row:te.length-1,col:e.length-1})},title:C.selectAll,children:"#"}),e.map((n,r)=>{const o=q&&J&&Math.min(q.col,J.col)<=r&&r<=Math.max(q.col,J.col)&&0===Math.min(q.row,J.row)&&Math.max(q.row,J.row)===te.length-1;/* @__PURE__ */
9
- return u("th",{className:`${t} ${Oe} cursor-pointer hover:bg-gray-200 relative${o?" !bg-blue-200":""}${I===r?" !bg-blue-100":""}`,style:{width:fe(r)},draggable:!0,onDragStart:()=>(e=>H(e))(r),onDragOver:e=>((e,t)=>{e.preventDefault(),j(t)})(e,r),onDrop:()=>(t=>{if(null===F||F===t)return H(null),void j(null);const n=te.map(e=>{const n=[...e],[r]=n.splice(F,1);return n.splice(t,0,r),n});if(f(n),p){const n=[...e],[r]=n.splice(F,1);n.splice(t,0,r),p(n)}H(null),j(null)})(r),onDragEnd:()=>{H(null),j(null)},onClick:e=>{e.shiftKey&&q||B({row:0,col:r}),Q({row:te.length-1,col:r})},onContextMenu:e=>ge(e,r),children:[n.title,
8
+ /* @__PURE__ */h("th",{className:`${t} ${Oe} text-center w-9 cursor-pointer hover:bg-gray-200`,onClick:()=>{B({row:0,col:0}),_({row:te.length-1,col:e.length-1})},title:C.selectAll,children:"#"}),e.map((n,r)=>{const o=q&&U&&Math.min(q.col,U.col)<=r&&r<=Math.max(q.col,U.col)&&0===Math.min(q.row,U.row)&&Math.max(q.row,U.row)===te.length-1;/* @__PURE__ */
9
+ return u("th",{className:`${t} ${Oe} cursor-pointer hover:bg-gray-200 relative${o?" !bg-blue-200":""}${H===r?" !bg-blue-100":""}`,style:{width:fe(r)},draggable:!0,onDragStart:()=>(e=>I(e))(r),onDragOver:e=>((e,t)=>{e.preventDefault(),X(t)})(e,r),onDrop:()=>(t=>{if(null===F||F===t)return I(null),void X(null);const n=te.map(e=>{const n=[...e],[r]=n.splice(F,1);return n.splice(t,0,r),n});if(f(n),p){const n=[...e],[r]=n.splice(F,1);n.splice(t,0,r),p(n)}I(null),X(null)})(r),onDragEnd:()=>{I(null),X(null)},onClick:e=>{e.shiftKey&&q||B({row:0,col:r}),_({row:te.length-1,col:r})},onContextMenu:e=>ge(e,r),children:[n.title,
10
10
  /* @__PURE__ */h("div",{className:"absolute -right-1 top-0 bottom-0 w-2 cursor-col-resize z-20",onMouseDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),A.current={col:t,startX:e.clientX,startW:fe(t)},document.body.style.cursor="col-resize"})(e,r),onDoubleClick:e=>{e.stopPropagation(),be(r)},title:C.resize})]},n.key)})]})}),
11
- /* @__PURE__ */u("tbody",{children:[Ne>0&&/* @__PURE__ */h("tr",{style:{height:Ne}}),Ae.map((t,n)=>{const r=$e+n,o=q&&J&&Math.min(q.row,J.row)<=r&&r<=Math.max(q.row,J.row)&&0===Math.min(q.col,J.col)&&Math.max(q.col,J.col)===e.length-1;/* @__PURE__ */
11
+ /* @__PURE__ */u("tbody",{children:[ze>0&&/* @__PURE__ */h("tr",{style:{height:ze}}),Ae.map((t,n)=>{const r=Le+n,o=q&&U&&Math.min(q.row,U.row)<=r&&r<=Math.max(q.row,U.row)&&0===Math.min(q.col,U.col)&&Math.max(q.col,U.col)===e.length-1;/* @__PURE__ */
12
12
  return u("tr",{style:{height:pe(r)},children:[
13
- /* @__PURE__ */u("td",{className:`relative px-1 py-1 text-center text-2xs text-ink-faintest border-b border-r border-line bg-surface-sunken select-none cursor-pointer hover:bg-gray-200${o?" !bg-blue-200 !text-gray-700":""}${R===r?" !bg-blue-100":""}`,draggable:!0,onDragStart:()=>(e=>T(e))(r),onDragOver:e=>((e,t)=>{e.preventDefault(),P(t)})(e,r),onDrop:()=>(e=>{if(null===K||K===e)return T(null),void P(null);const t=te.map(e=>[...e]),[n]=t.splice(K,1);t.splice(e,0,n),f(t),T(null),P(null)})(r),onDragEnd:()=>{T(null),P(null)},onClick:t=>{t.shiftKey&&q||B({row:r,col:0}),Q({row:r,col:e.length-1})},onContextMenu:e=>me(e,r),children:[r+1,
14
- /* @__PURE__ */h("div",{className:"absolute -bottom-1 left-0 right-0 h-2 cursor-row-resize z-20",onMouseDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),O.current={row:t,startY:e.clientY,startH:pe(t)},document.body.style.cursor="row-resize"})(e,r),onDoubleClick:e=>{e.stopPropagation(),ye(r)},title:C.resize})]}),e.map((e,n)=>{const o=q&&J&&function(e,t,n,r){const o=Math.min(e.row,t.row),l=Math.max(e.row,t.row),c=Math.min(e.col,t.col),a=Math.max(e.col,t.col);return n>=o&&n<=l&&r>=c&&r<=a}(q,J,r,n),l=X?.row===r&&X?.col===n&&!e.readOnly,c=E?.row===r&&E?.col===n,a=x?.[`${r}:${n}`],s=q&&J?Math.max(q.row,J.row):-1,i=q&&J?Math.max(q.col,J.col):-1,d=q&&J&&r===s&&n===i,w=V.current&&G&&q&&J&&(()=>{const e=Math.min(q.row,J.row),t=Math.max(q.row,J.row),o=Math.min(q.col,J.col),l=Math.max(q.col,J.col);let c=e,a=t,s=o,i=l;return G.row>t?a=G.row:G.row<e&&(c=G.row),G.col>l?i=G.col:G.col<o&&(s=G.col),r>=c&&r<=a&&n>=s&&n<=i&&!(r>=e&&r<=t&&n>=o&&n<=l)})(),g="sm"===a?.fontSize?"text-2xs":"lg"===a?.fontSize?"text-sm":"xl"===a?.fontSize?"text-base":"text-xs",f=`${a?.bold?" font-bold":""}${a?.italic?" italic":""}${a?.underline?" underline":""}`;/* @__PURE__ */
13
+ /* @__PURE__ */u("td",{className:`relative px-1 py-1 text-center text-2xs text-ink-faintest border-b border-r border-line bg-surface-sunken select-none cursor-pointer hover:bg-gray-200${o?" !bg-blue-200 !text-gray-700":""}${R===r?" !bg-blue-100":""}`,draggable:!0,onDragStart:()=>(e=>K(e))(r),onDragOver:e=>((e,t)=>{e.preventDefault(),P(t)})(e,r),onDrop:()=>(e=>{if(null===T||T===e)return K(null),void P(null);const t=te.map(e=>[...e]),[n]=t.splice(T,1);t.splice(e,0,n),f(t),K(null),P(null)})(r),onDragEnd:()=>{K(null),P(null)},onClick:t=>{t.shiftKey&&q||B({row:r,col:0}),_({row:r,col:e.length-1})},onContextMenu:e=>me(e,r),children:[r+1,
14
+ /* @__PURE__ */h("div",{className:"absolute -bottom-1 left-0 right-0 h-2 cursor-row-resize z-20",onMouseDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),O.current={row:t,startY:e.clientY,startH:pe(t)},document.body.style.cursor="row-resize"})(e,r),onDoubleClick:e=>{e.stopPropagation(),ye(r)},title:C.resize})]}),e.map((e,n)=>{const o=q&&U&&function(e,t,n,r){const o=Math.min(e.row,t.row),l=Math.max(e.row,t.row),c=Math.min(e.col,t.col),a=Math.max(e.col,t.col);return n>=o&&n<=l&&r>=c&&r<=a}(q,U,r,n),l=j?.row===r&&j?.col===n&&!e.readOnly,c=E?.row===r&&E?.col===n,a=x?.[`${r}:${n}`],s=q&&U?Math.max(q.row,U.row):-1,i=q&&U?Math.max(q.col,U.col):-1,d=q&&U&&r===s&&n===i,w=V.current&&J&&q&&U&&(()=>{const e=Math.min(q.row,U.row),t=Math.max(q.row,U.row),o=Math.min(q.col,U.col),l=Math.max(q.col,U.col);let c=e,a=t,s=o,i=l;return J.row>t?a=J.row:J.row<e&&(c=J.row),J.col>l?i=J.col:J.col<o&&(s=J.col),r>=c&&r<=a&&n>=s&&n<=i&&!(r>=e&&r<=t&&n>=o&&n<=l)})(),g="sm"===a?.fontSize?"text-2xs":"lg"===a?.fontSize?"text-sm":"xl"===a?.fontSize?"text-base":"text-xs",f=`${a?.bold?" font-bold":""}${a?.italic?" italic":""}${a?.underline?" underline":""}`;/* @__PURE__ */
15
15
  return u("td",{className:`relative px-0 py-0 border-b border-r border-gray-200 text-sm${e.readOnly?" bg-gray-50 text-gray-500 cursor-default":" cursor-cell"}${o?" !bg-blue-100":""}${c&&!o?" ring-2 ring-inset ring-blue-400":""}${w?" !bg-blue-50 ring-1 ring-inset ring-blue-300":""}`,onMouseDown:e=>{if(e.target===e.currentTarget){re(e,r,n);const t=e.currentTarget.querySelector("[data-row][data-col]");t?.focus()}},onMouseEnter:()=>oe(r,n),onClick:e=>{if(e.target===e.currentTarget){const t=e.currentTarget.querySelector("[data-row][data-col]");t?.focus()}},onDoubleClick:t=>{t.target!==t.currentTarget||e.readOnly||Y({row:r,col:n})},children:[
16
- /* @__PURE__ */h(m,{contentEditable:l,suppressContentEditableWarning:!0,tabIndex:0,"data-row":r,"data-col":n,className:`w-full h-full px-2 py-1 rosh-focus-ring whitespace-nowrap overflow-hidden ${"right"===e.align?"text-right":"center"===e.align?"text-center":""} ${e.readOnly?"cursor-default":"cursor-cell"} font-mono ${g}${f}`,onMouseDown:e=>re(e,r,n),onMouseEnter:()=>oe(r,n),onDoubleClick:()=>{e.readOnly||Y({row:r,col:n})},onFocus:()=>{L({row:r,col:n}),_.current||(B({row:r,col:n}),Q({row:r,col:n}))},onBlur:e=>{const o=e.currentTarget.textContent||"";o!==(t[n]||"")&&ne(r,n,o),Y(null)},onInput:()=>ae(r),onPaste:e=>le(e,r,n),onKeyDown:t=>{if(!(l||e.readOnly||1!==t.key.length||t.ctrlKey||t.metaKey||t.altKey))return t.preventDefault(),ne(r,n,t.key),W.current={row:r,col:n},void Y({row:r,col:n});ce(t,r,n)},text:t[n]||""}),d&&/* @__PURE__ */h("div",{onMouseDown:xe,title:C.fill,className:"absolute -bottom-[3px] -right-[3px] w-[7px] h-[7px] bg-blue-500 border border-white cursor-crosshair z-30 hover:bg-blue-600"})]},n)})]},r)}),ze>0&&/* @__PURE__ */h("tr",{style:{height:ze}})]})]}),se&&i(
16
+ /* @__PURE__ */h(m,{contentEditable:l,suppressContentEditableWarning:!0,tabIndex:0,"data-row":r,"data-col":n,className:`w-full h-full px-2 py-1 rosh-focus-ring whitespace-nowrap overflow-hidden ${"right"===e.align?"text-right":"center"===e.align?"text-center":""} ${e.readOnly?"cursor-default":"cursor-cell"} font-mono ${g}${f}`,onMouseDown:e=>re(e,r,n),onMouseEnter:()=>oe(r,n),onDoubleClick:()=>{e.readOnly||Y({row:r,col:n})},onFocus:()=>{$({row:r,col:n}),G.current||(B({row:r,col:n}),_({row:r,col:n}))},onBlur:e=>{const o=e.currentTarget.textContent||"";o!==(t[n]||"")&&ne(r,n,o),Y(null)},onInput:()=>ae(r),onPaste:e=>le(e,r,n),onKeyDown:t=>{if(!(l||e.readOnly||1!==t.key.length||t.ctrlKey||t.metaKey||t.altKey))return t.preventDefault(),ne(r,n,t.key),W.current={row:r,col:n},void Y({row:r,col:n});ce(t,r,n)},text:t[n]||""}),d&&/* @__PURE__ */h("div",{onMouseDown:xe,title:C.fill,className:"absolute -bottom-[3px] -right-[3px] w-[7px] h-[7px] bg-blue-500 border border-white cursor-crosshair z-30 hover:bg-blue-600"})]},n)})]},r)}),Ne>0&&/* @__PURE__ */h("tr",{style:{height:Ne}})]})]}),se&&i(
17
17
  /* @__PURE__ */u(d,{children:[
18
18
  /* @__PURE__ */h("div",{className:"fixed inset-0 z-(--z-popup)",onPointerDown:()=>ie(null)}),
19
19
  /* @__PURE__ */h("div",{className:"fixed z-(--z-popup) bg-surface rounded-lg shadow-lg border border-line py-1 min-w-[160px]",style:{left:se.x,top:se.y},children:se.items.map((e,t)=>/* @__PURE__ */h("button",{onPointerDown:t=>{t.stopPropagation(),e.onClick()},className:"w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm text-ink hover:bg-gray-100",children:e.label},t))})]}),document.body)]})}export{g as EditableGrid,w as withSpareRow};
@@ -1 +1 @@
1
- import{useShellLocale as e}from"./chunk-QWHQJNKL.js";import{formatPlain as t}from"./chunk-C3QOHMR6.js";import{jsx as r,jsxs as n}from"react/jsx-runtime";var i={danger:"bg-red-600 text-white",neutral:"bg-gray-600 text-white",accent:"bg-blue-600 text-white"};function a({count:a=0,max:l=99,dot:s=!1,tone:o="danger",showZero:c=!1,children:m,className:u=""}){const h=s||a>0||0===a&&c,d=e(),x=a>l?`${t(l,d)}+`:t(a,d),f=m?"":u,g=h?/* @__PURE__ */r("span",s?{className:`block h-2.5 w-2.5 rounded-full ring-2 ring-white ${i[o]} ${f}`.trim(),"aria-hidden":m?"true":void 0}:{className:`flex h-5 min-w-[1.25rem] items-center justify-center whitespace-nowrap rounded-full px-1 text-xs font-semibold tabular-nums ring-2 ring-white ${i[o]} ${f}`.trim(),children:x}):null;return m?/* @__PURE__ */n("span",{className:`relative inline-flex ${u}`.trim(),children:[m,g&&/* @__PURE__ */r("span",{className:"absolute -right-1.5 -top-1.5 flex",children:g})]}):g}export{a as CountBadge};
1
+ import{useShellLocale as e}from"./chunk-PEM7UXQ3.js";import{formatPlain as t}from"./chunk-C3QOHMR6.js";import{jsx as r,jsxs as n}from"react/jsx-runtime";var i={danger:"bg-red-600 text-white",neutral:"bg-gray-600 text-white",accent:"bg-blue-600 text-white"};function a({count:a=0,max:l=99,dot:s=!1,tone:o="danger",showZero:c=!1,children:m,className:u=""}){const h=s||a>0||0===a&&c,d=e(),x=a>l?`${t(l,d)}+`:t(a,d),f=m?"":u,g=h?/* @__PURE__ */r("span",s?{className:`block h-2.5 w-2.5 rounded-full ring-2 ring-white ${i[o]} ${f}`.trim(),"aria-hidden":m?"true":void 0}:{className:`flex h-5 min-w-[1.25rem] items-center justify-center whitespace-nowrap rounded-full px-1 text-xs font-semibold tabular-nums ring-2 ring-white ${i[o]} ${f}`.trim(),children:x}):null;return m?/* @__PURE__ */n("span",{className:`relative inline-flex ${u}`.trim(),children:[m,g&&/* @__PURE__ */r("span",{className:"absolute -right-1.5 -top-1.5 flex",children:g})]}):g}export{a as CountBadge};
@@ -1,7 +1,7 @@
1
- import{writeClipboard as e}from"./chunk-FBUUXK5G.js";import{IconButton_default as r}from"./chunk-RUTUVS4H.js";import{toast_default as t}from"./chunk-XD34TCRG.js";import{Icon as n}from"./chunk-FSPFV4MI.js";import{useShellStrings as a}from"./chunk-QWHQJNKL.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-H4YFANH5.js";import{IconButton_default as r}from"./chunk-RUTUVS4H.js";import{toast_default as t}from"./chunk-4XZXY2AF.js";import{Icon as n}from"./chunk-FSPFV4MI.js";import{useShellStrings as a}from"./chunk-PEM7UXQ3.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:N=!1,onCopy:v,multiline:w=!1,id:j,"aria-describedby":T,className:C=""}){const[U,B]=i(!1),F=o(null),G=a().copy;c(()=>()=>{F.current&&clearTimeout(F.current)},[]);const H=l(async()=>{await e(n)?(B(!0),F.current&&clearTimeout(F.current),F.current=setTimeout(()=>{B(!1),F.current=null},2e3),v?.(n)):t.error(G.failed)},[n,v,G]),{box:K,button:L}=p[g],Q=!N;/* @__PURE__ */
4
- return m("div",{id:Q?void 0:j,"aria-describedby":Q?void 0:T,className:["inline-flex max-w-full items-center rounded-md",u[k],K,C].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:N=!1,onCopy:v,multiline:w=!1,id:j,"aria-describedby":F,className:T=""}){const[C,H]=i(!1),U=o(null),X=a().copy;c(()=>()=>{U.current&&clearTimeout(U.current)},[]);const A=l(async()=>{await e(n)?(H(!0),U.current&&clearTimeout(U.current),U.current=setTimeout(()=>{H(!1),U.current=null},2e3),v?.(n)):t.error(X.failed)},[n,v,X]),{box:B,button:M}=p[g],P=!N;/* @__PURE__ */
4
+ return m("div",{id:P?void 0:j,"aria-describedby":P?void 0:F,className:["inline-flex max-w-full items-center rounded-md",u[k],B,T].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 "+(w?"whitespace-pre-wrap break-all":"truncate"),title:w?void 0:n,children:y??n}),!N&&/* @__PURE__ */m(d,{children:[
6
- /* @__PURE__ */s(r,{id:j,"aria-label":x?G.copyLabel(x):G.copy,"aria-describedby":T,onClick:H,className:`${L} text-gray-400`,children:/* @__PURE__ */s(U?h:b,{})}),
7
- /* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:U?G.copied:""})]})]})}export{y as Snippet};
6
+ /* @__PURE__ */s(r,{id:j,"aria-label":x?X.copyLabel(x):X.copy,"aria-describedby":F,onClick:A,className:`${M} text-gray-400`,children:/* @__PURE__ */s(C?h:b,{})}),
7
+ /* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:C?X.copied:""})]})]})}export{y as Snippet};
@@ -1,9 +1,9 @@
1
- import{useShellLocale as e}from"./chunk-QWHQJNKL.js";import{formatPlain as r}from"./chunk-C3QOHMR6.js";import{useId as d,Children as n}from"react";import{jsxs as t,jsx as a}from"react/jsx-runtime";var i={none:{body:"",edge:"px-4 py-3"},sm:{body:"p-3",edge:"px-3 py-2"},md:{body:"p-4",edge:"px-4 py-3"},lg:{body:"p-6",edge:"px-6 py-4"}},l={neutral:"border-line",warning:"border-amber-300",current:"border-line"};function s({children:e,header:r,description:s,footer:c,padded:o=!0,padding:m,headingLevel:b,headerActions:u,"aria-label":p,className:h="",bodyClassName:x="",style:g,tone:f="neutral"}){const y=i[m??(o?"md":"none")],N=d(),v=d(),$=null!=r&&null!=s&&""!==s,w=null!=b&&null!=r,j=`h${b}`,k=null!=p&&""!==p,Q=w||k,A=Q?"section":"div",C=`rounded-(--radius-card) border ${l[f]} bg-surface shadow-sm ${h}`.trim(),H=n.toArray(e).length>0,L=H?"border-b border-line-subtle ":"",B="current"===f,J=B?"text-base font-semibold text-blue-700":"text-base font-semibold text-ink-strongest",K=B?"rounded-t-(--radius-card) bg-accent-tint ":"",M=`${L}${K}${y.edge} ${J}`;/* @__PURE__ */
2
- return t(A,{className:C,style:g,...k?{"aria-label":p}:w?{"aria-labelledby":N}:{},...$&&Q?{"aria-describedby":v}:{},...B?{"aria-current":!0}:{},children:[$?
3
- /* @__PURE__ */t("div",{className:`${L}${K}${y.edge}`,children:[null!=u?/* @__PURE__ */t("div",{className:`flex items-center justify-between gap-3 ${J}`,children:[w?/* @__PURE__ */a(j,{id:N,children:r}):/* @__PURE__ */a("span",{children:r}),u]}):w?/* @__PURE__ */a(j,{id:N,className:J,children:r}):/* @__PURE__ */a("div",{className:J,children:r}),
4
- /* @__PURE__ */a("p",{id:v,className:B?"mt-0.5 text-xs text-gray-600":"mt-0.5 text-xs text-ink-faint",children:s})]}):null!=r&&(null!=u?
5
- /* @__PURE__ */t("div",{className:`${M} flex items-center justify-between gap-3`,children:[w?/* @__PURE__ */a(j,{id:N,children:r}):/* @__PURE__ */a("span",{children:r}),u]}):w?
6
- /* @__PURE__ */a(j,{id:N,className:M,children:r}):/* @__PURE__ */a("div",{className:M,children:r})),H&&/* @__PURE__ */a("div",{className:[y.body,x].filter(Boolean).join(" "),children:e}),c&&/* @__PURE__ */a("div",{className:`border-t border-gray-100 ${y.edge}`,children:c})]})}function c({label:d,value:n,icon:i,delta:l,className:s=""}){const c=e(),o="number"==typeof n&&c?r(n,c):n,m="up"===l?.direction?"text-green-600":"down"===l?.direction?"text-red-600":"text-gray-500",b="up"===l?.direction?"▲":"down"===l?.direction?"▼":"→";/* @__PURE__ */
1
+ import{useShellLocale as e}from"./chunk-PEM7UXQ3.js";import{formatPlain as r}from"./chunk-C3QOHMR6.js";import{useId as d,Children as n}from"react";import{jsxs as t,jsx as a}from"react/jsx-runtime";var i={none:{body:"",edge:"px-4 py-3"},sm:{body:"p-3",edge:"px-3 py-2"},md:{body:"p-4",edge:"px-4 py-3"},lg:{body:"p-6",edge:"px-6 py-4"}},l={neutral:"border-line",warning:"border-amber-300",current:"border-line"};function s({children:e,header:r,description:s,footer:c,padded:o=!0,padding:m,headingLevel:b,headerActions:u,"aria-label":p,className:h="",bodyClassName:x="",style:g,tone:f="neutral"}){const y=i[m??(o?"md":"none")],N=d(),v=d(),$=null!=r&&null!=s&&""!==s,w=null!=b&&null!=r,j=`h${b}`,k=null!=p&&""!==p,A=w||k,C=A?"section":"div",M=`rounded-(--radius-card) border ${l[f]} bg-surface shadow-sm ${h}`.trim(),Q=n.toArray(e).length>0,B=Q?"border-b border-line-subtle ":"",E="current"===f,H=E?"text-base font-semibold text-blue-700":"text-base font-semibold text-ink-strongest",L=E?"rounded-t-(--radius-card) bg-accent-tint ":"",O=`${B}${L}${y.edge} ${H}`;/* @__PURE__ */
2
+ return t(C,{className:M,style:g,...k?{"aria-label":p}:w?{"aria-labelledby":N}:{},...$&&A?{"aria-describedby":v}:{},...E?{"aria-current":!0}:{},children:[$?
3
+ /* @__PURE__ */t("div",{className:`${B}${L}${y.edge}`,children:[null!=u?/* @__PURE__ */t("div",{className:`flex items-center justify-between gap-3 ${H}`,children:[w?/* @__PURE__ */a(j,{id:N,children:r}):/* @__PURE__ */a("span",{children:r}),u]}):w?/* @__PURE__ */a(j,{id:N,className:H,children:r}):/* @__PURE__ */a("div",{className:H,children:r}),
4
+ /* @__PURE__ */a("p",{id:v,className:E?"mt-0.5 text-xs text-gray-600":"mt-0.5 text-xs text-ink-faint",children:s})]}):null!=r&&(null!=u?
5
+ /* @__PURE__ */t("div",{className:`${O} flex items-center justify-between gap-3`,children:[w?/* @__PURE__ */a(j,{id:N,children:r}):/* @__PURE__ */a("span",{children:r}),u]}):w?
6
+ /* @__PURE__ */a(j,{id:N,className:O,children:r}):/* @__PURE__ */a("div",{className:O,children:r})),Q&&/* @__PURE__ */a("div",{className:[y.body,x].filter(Boolean).join(" "),children:e}),c&&/* @__PURE__ */a("div",{className:`border-t border-gray-100 ${y.edge}`,children:c})]})}function c({label:d,value:n,icon:i,delta:l,className:s=""}){const c=e(),o="number"==typeof n&&c?r(n,c):n,m="up"===l?.direction?"text-green-600":"down"===l?.direction?"text-red-600":"text-gray-500",b="up"===l?.direction?"▲":"down"===l?.direction?"▼":"→";/* @__PURE__ */
7
7
  return t("div",{className:`rounded-(--radius-card) border border-gray-200 bg-white p-4 shadow-sm ${s}`.trim(),children:[
8
8
  /* @__PURE__ */t("div",{className:"flex items-center justify-between text-ink-faint",children:[
9
9
  /* @__PURE__ */a("span",{className:"text-xs font-medium uppercase tracking-wide",children:d}),i]}),
@@ -1,4 +1,4 @@
1
- import{Avatar as e}from"./chunk-Z3JW77LH.js";import{StatCard as a,Card as t}from"./chunk-WUKN5WUM.js";import{Sparkline as r}from"./chunk-CKCDGSTC.js";import{PieChart as s}from"./chunk-5VRMQTKV.js";import{ColumnChart as l}from"./chunk-6FEL5D56.js";import{StatusBadgeProvider as i,StatusBadge as d}from"./chunk-LNARMEEZ.js";import{Button_default as c}from"./chunk-NHH2MXFU.js";import{TH_ONE_LINE as n}from"./chunk-OZAAIE4E.js";import{jsx as o,jsxs as m}from"react/jsx-runtime";var u={paid:"success",shipped:"active",processing:"queued",refunded:"neutral",overdue:"danger"},h=[12,18,14,22,19,27,24,31,28,35,30,38],p=["J","F","M","A","M","J","J","A","S","O","N","D"],g=[{key:"direct",label:"Direct",value:45},{key:"search",label:"Search",value:30},{key:"social",label:"Social",value:15},{key:"email",label:"Email",value:10}],x=[{id:"#3201",customer:"Alice Nguyen",total:"$1,204",status:"paid"},{id:"#3202",customer:"Marco Reyes",total:"$642",status:"shipped"},{id:"#3203",customer:"Priya Patel",total:"$2,980",status:"processing"},{id:"#3204",customer:"Tom Becker",total:"$318",status:"overdue"},{id:"#3205",customer:"Sara Lind",total:"$540",status:"refunded"}];function v(){/* @__PURE__ */
1
+ import{Avatar as e}from"./chunk-65DYHG73.js";import{StatCard as a,Card as t}from"./chunk-5RAOFJYT.js";import{Sparkline as r}from"./chunk-CKCDGSTC.js";import{PieChart as s}from"./chunk-KAHYUBXM.js";import{ColumnChart as l}from"./chunk-NBKQADMY.js";import{StatusBadgeProvider as i,StatusBadge as d}from"./chunk-LNARMEEZ.js";import{Button_default as c}from"./chunk-NHH2MXFU.js";import{TH_ONE_LINE as n}from"./chunk-OZAAIE4E.js";import{jsx as o,jsxs as m}from"react/jsx-runtime";var u={paid:"success",shipped:"active",processing:"queued",refunded:"neutral",overdue:"danger"},h=[12,18,14,22,19,27,24,31,28,35,30,38],p=["J","F","M","A","M","J","J","A","S","O","N","D"],g=[{key:"direct",label:"Direct",value:45},{key:"search",label:"Search",value:30},{key:"social",label:"Social",value:15},{key:"email",label:"Email",value:10}],x=[{id:"#3201",customer:"Alice Nguyen",total:"$1,204",status:"paid"},{id:"#3202",customer:"Marco Reyes",total:"$642",status:"shipped"},{id:"#3203",customer:"Priya Patel",total:"$2,980",status:"processing"},{id:"#3204",customer:"Tom Becker",total:"$318",status:"overdue"},{id:"#3205",customer:"Sara Lind",total:"$540",status:"refunded"}];function v(){/* @__PURE__ */
2
2
  return o(i,{groups:u,children:/* @__PURE__ */o("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */m("div",{className:"mx-auto max-w-6xl space-y-6",children:[
3
3
  /* @__PURE__ */m("div",{className:"flex items-center justify-between gap-4",children:[
4
4
  /* @__PURE__ */m("div",{children:[
@@ -1,14 +1,14 @@
1
- import{Markdown as e}from"./chunk-OV2SWQPT.js";import{PLACEHOLDER_INK as t}from"./chunk-AYZY3YNC.js";import{Icon as l}from"./chunk-FSPFV4MI.js";import{LoadingSpinner as r}from"./chunk-R2VKEMZH.js";import{useShellStrings as s}from"./chunk-QWHQJNKL.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(),[N,v]=a(""),[w,k]=a(null),[C,j]=a({}),M=N.trim().toLowerCase(),L=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=>!M||e.title.toLowerCase().includes(M)||e.body.toLowerCase().includes(M)||e.category_label.toLowerCase().includes(M),A=n(()=>L.map(e=>({...e,docs:e.docs.filter(_)})).filter(e=>e.docs.length>0),[L,M]),E=n(()=>A.flatMap(e=>e.docs),[A]),P=(w?E.find(e=>e.slug===w):void 0)??E[0]??null,Q=e=>!!M||(C[e]??e===P?.category);/* @__PURE__ */
1
+ import{Markdown as e}from"./chunk-7JJUI52C.js";import{PLACEHOLDER_INK as t}from"./chunk-AYZY3YNC.js";import{Icon as l}from"./chunk-FSPFV4MI.js";import{LoadingSpinner as r}from"./chunk-R2VKEMZH.js";import{useShellStrings as s}from"./chunk-PEM7UXQ3.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]),E=e=>!M||e.title.toLowerCase().includes(M)||e.body.toLowerCase().includes(M)||e.category_label.toLowerCase().includes(M),L=n(()=>_.map(e=>({...e,docs:e.docs.filter(E)})).filter(e=>e.docs.length>0),[_,M]),A=n(()=>L.flatMap(e=>e.docs),[L]),P=(w?A.find(e=>e.slug===w):void 0)??A[0]??null,Y=e=>!!M||(C[e]??e===P?.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:[
5
5
  /* @__PURE__ */o("h2",{className:"text-sm font-semibold text-gray-900",children:y.help.title}),u&&g&&/* @__PURE__ */o("button",{type:"button",onClick:g,className:"text-xs text-blue-600 hover:underline",children:y.help.newArticle})]}),
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
- /* @__PURE__ */o("input",{type:"text",value:N,onChange:e=>v(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===A.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}):A.map(e=>{const t=Q(e.key);/* @__PURE__ */
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===L.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}):L.map(e=>{const t=Y(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]:!Q(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]:!Y(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
13
  /* @__PURE__ */o("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=P?.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:[