efficient-shell 9.9.1 → 9.10.1

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 (324) hide show
  1. package/dist/{Browser-GQ2ZK4PR.js → Browser-4SQ4P24B.js} +14 -14
  2. package/dist/Calculator-6NA35GFS.js +29 -0
  3. package/dist/{CurrencyConverter-SSR2XDIC.js → CurrencyConverter-EDEJOKHC.js} +8 -8
  4. package/dist/{Documents-5AC4WSNK.js → Documents-4TQFZOMU.js} +9 -9
  5. package/dist/Files-GGJYYELO.js +88 -0
  6. package/dist/{Notepad-EUIQXFUA.js → Notepad-JRRC5U3N.js} +10 -10
  7. package/dist/{PdfViewer-XSISAJZP.js → PdfViewer-FFQOKKFW.js} +1 -1
  8. package/dist/{PomodoroTimer-EV6D4OFU.js → PomodoroTimer-HCLT2JVD.js} +24 -24
  9. package/dist/{Preview-QK5HYJ6U.js → Preview-FFHAUR6X.js} +16 -16
  10. package/dist/Sidebar-BBZ7UFYQ.js +43 -0
  11. package/dist/{Spreadsheet-HR6GBICY.js → Spreadsheet-QTTDPD3U.js} +14 -14
  12. package/dist/{Stock-6ZIQHGPH.js → Stock-3IBS63UR.js} +3 -3
  13. package/dist/{Weather-II7NFRMK.js → Weather-EFIIVKFE.js} +17 -17
  14. package/dist/{WorldClock-NBLNO63Q.js → WorldClock-ERQQ4VWP.js} +6 -6
  15. package/dist/ai/index.js +35 -35
  16. package/dist/apps/index.js +1 -1
  17. package/dist/bin/media-host-check.js +1 -1
  18. package/dist/bin/ui-check.js +1 -1
  19. package/dist/brand.css +1 -1
  20. package/dist/charts/BoxPlotChart.js +1 -1
  21. package/dist/charts/CandlestickChart.js +1 -1
  22. package/dist/charts/CartesianPlot.d.ts +24 -1
  23. package/dist/charts/CartesianPlot.js +1 -1
  24. package/dist/charts/ChartBrush.js +1 -1
  25. package/dist/charts/ChartFrame.js +1 -1
  26. package/dist/charts/ChartSkeleton.js +1 -1
  27. package/dist/charts/ChordChart.js +1 -1
  28. package/dist/charts/ColumnChart.d.ts +4 -1
  29. package/dist/charts/ColumnChart.js +1 -1
  30. package/dist/charts/FunnelChart.js +1 -1
  31. package/dist/charts/HeatmapChart.js +1 -1
  32. package/dist/charts/HistogramChart.js +1 -1
  33. package/dist/charts/Meter.js +1 -1
  34. package/dist/charts/PieChart.js +1 -1
  35. package/dist/charts/RadarChart.js +1 -1
  36. package/dist/charts/RadialBarChart.js +1 -1
  37. package/dist/charts/RangeChart.js +1 -1
  38. package/dist/charts/RankedBars.js +1 -1
  39. package/dist/charts/SankeyChart.js +1 -1
  40. package/dist/charts/ScatterChart.js +1 -1
  41. package/dist/charts/SpecChart.js +1 -1
  42. package/dist/charts/StatTile.js +1 -1
  43. package/dist/charts/SunburstChart.js +1 -1
  44. package/dist/charts/TimeSeriesChart.d.ts +1 -1
  45. package/dist/charts/TimeSeriesChart.js +1 -1
  46. package/dist/charts/TreemapChart.js +1 -1
  47. package/dist/charts/WaterfallChart.js +1 -1
  48. package/dist/charts/types.d.ts +35 -1
  49. package/dist/{chunk-7WGOLPGM.js → chunk-2AHLONPR.js} +1 -1
  50. package/dist/{chunk-2MLRK7IO.js → chunk-2GPHHW7C.js} +4 -4
  51. package/dist/{chunk-Y44ABEW3.js → chunk-2J2OU65F.js} +2 -2
  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-SC63O7AL.js → chunk-3C4RNMN4.js} +1 -1
  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-CO5RKOVX.js → chunk-4DBPKTVX.js} +16 -16
  60. package/dist/{chunk-XD34TCRG.js → chunk-4XZXY2AF.js} +1 -1
  61. package/dist/{chunk-732XHVR4.js → chunk-4YZZYB42.js} +3 -3
  62. package/dist/{chunk-6JU3WQOR.js → chunk-4ZKTUUQK.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-ZAU2HIRH.js → chunk-5XNN2SSR.js} +4 -4
  69. package/dist/{chunk-O5LQBBW2.js → chunk-5Y6LGPZI.js} +7 -7
  70. package/dist/{chunk-2HEJDLPP.js → chunk-5ZGL2BRZ.js} +2 -2
  71. package/dist/{chunk-3APSMJPN.js → chunk-64R3IYAM.js} +1 -1
  72. package/dist/{chunk-Z3JW77LH.js → chunk-65DYHG73.js} +1 -1
  73. package/dist/{chunk-DZTAGMNY.js → chunk-6FI3HVUR.js} +42 -42
  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-7BYBGPWU.js +9 -0
  77. package/dist/chunk-7DMTFIQN.js +11 -0
  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-ZTL2RPNY.js → chunk-AOSLOKAL.js} +1 -1
  83. package/dist/chunk-AVAYZK3Z.js +3 -0
  84. package/dist/{chunk-6MVHRNWC.js → chunk-BF7PZFKT.js} +1 -1
  85. package/dist/{chunk-IJWFKUYA.js → chunk-BJONHLET.js} +4 -4
  86. package/dist/{chunk-H7MJM2WI.js → chunk-BJWPPUM6.js} +2 -2
  87. package/dist/{chunk-B4KMHEFZ.js → chunk-BNKULSCG.js} +1 -1
  88. package/dist/{chunk-VG2R6PZV.js → chunk-BYHKYYL6.js} +1 -1
  89. package/dist/chunk-CBMXYXBH.js +15 -0
  90. package/dist/{chunk-GVC535IA.js → chunk-D4KZOYXQ.js} +1 -1
  91. package/dist/chunk-D7JY2KHG.js +7 -0
  92. package/dist/{chunk-PDXPMHG3.js → chunk-DRNB7KDC.js} +1 -1
  93. package/dist/{chunk-U5N6PSXO.js → chunk-E6EUGQGA.js} +5 -5
  94. package/dist/{chunk-N3JXHNID.js → chunk-E72USUUR.js} +10 -10
  95. package/dist/{chunk-C4UL2UNR.js → chunk-EOWOVR55.js} +1 -1
  96. package/dist/{chunk-GS5AISRS.js → chunk-ERLZDA75.js} +2 -2
  97. package/dist/{chunk-CE5BARZI.js → chunk-EWJELWIT.js} +3 -3
  98. package/dist/chunk-F52WQG3M.js +9 -0
  99. package/dist/{chunk-OQ2EDMB2.js → chunk-FEPBXJUR.js} +1 -1
  100. package/dist/{chunk-BWUU565Y.js → chunk-FKA6ZVQO.js} +9 -9
  101. package/dist/chunk-FLXIPEWL.js +2 -0
  102. package/dist/{chunk-RULVWW4A.js → chunk-FVDX6ZSZ.js} +6 -6
  103. package/dist/{chunk-CRXFSN5K.js → chunk-G6LOKIFC.js} +11 -11
  104. package/dist/{chunk-LNQVTH5S.js → chunk-GP5UNEKY.js} +1 -1
  105. package/dist/{chunk-P3DTYFMC.js → chunk-GSKWYMM4.js} +2 -2
  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-FPGRKHUW.js → chunk-HAFB45DT.js} +7 -7
  110. package/dist/{chunk-ZYDZY6ED.js → chunk-HMG5TW2R.js} +1 -1
  111. package/dist/{chunk-442FFHQJ.js → chunk-HRAK46H7.js} +12 -12
  112. package/dist/chunk-I5XVZLDH.js +14 -0
  113. package/dist/{chunk-CXMTDYVI.js → chunk-IENPHB5B.js} +1 -1
  114. package/dist/{chunk-QZKWIVZW.js → chunk-IK332TWA.js} +1 -1
  115. package/dist/{chunk-JKDEE35P.js → chunk-IZQ3XTD2.js} +1 -1
  116. package/dist/{chunk-IB4333CI.js → chunk-JECMVR4S.js} +7 -7
  117. package/dist/{chunk-ZHHEMSOD.js → chunk-JENEVLJU.js} +2 -2
  118. package/dist/{chunk-MWIT4UN2.js → chunk-JGDLTIOX.js} +9 -9
  119. package/dist/{chunk-6ZHX56NM.js → chunk-JQDRM6UK.js} +1 -1
  120. package/dist/{chunk-QC6OK3ED.js → chunk-JVYSRH6U.js} +1 -1
  121. package/dist/{chunk-XS4HFUTW.js → chunk-JWX7QRGE.js} +1 -1
  122. package/dist/{chunk-5VRMQTKV.js → chunk-KAHYUBXM.js} +7 -7
  123. package/dist/{chunk-YWGC7J6B.js → chunk-KECOZKJU.js} +7 -7
  124. package/dist/{chunk-WH3JHMEA.js → chunk-KJHXCVNI.js} +5 -5
  125. package/dist/{chunk-NHVXVHUR.js → chunk-KQSUSVMF.js} +17 -17
  126. package/dist/{chunk-BBEOFKLY.js → chunk-KTRNAMHY.js} +1 -1
  127. package/dist/chunk-LFPJ263N.js +6 -0
  128. package/dist/chunk-LFSCENKW.js +1 -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-UE4PVCA5.js → chunk-MLPIJMOV.js} +2 -2
  133. package/dist/{chunk-ZOHQVSB3.js → chunk-MUHWI4GK.js} +12 -12
  134. package/dist/chunk-N3CTLEJS.js +9 -0
  135. package/dist/{chunk-HJWTWS5E.js → chunk-N52D37FS.js} +5 -5
  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-IQWIYZB5.js → chunk-NU2YQSOP.js} +2 -2
  140. package/dist/chunk-NUTVIQAV.js +8 -0
  141. package/dist/{chunk-EGAV5LSX.js → chunk-O25B75XX.js} +1 -1
  142. package/dist/{chunk-JS6ZSEZJ.js → chunk-O426Q7KC.js} +1 -1
  143. package/dist/{chunk-CAG3TSV2.js → chunk-O4NPQ23Q.js} +1 -1
  144. package/dist/{chunk-IJIESSTX.js → chunk-O56CY36U.js} +4 -4
  145. package/dist/chunk-OEFMBTDH.js +6 -0
  146. package/dist/{chunk-B6YOP2IX.js → chunk-OVDHEMLK.js} +5 -5
  147. package/dist/{chunk-ENL5L6NR.js → chunk-P65C5TUU.js} +1 -1
  148. package/dist/chunk-P6SATWL5.js +22 -0
  149. package/dist/chunk-PEM7UXQ3.js +1 -0
  150. package/dist/{chunk-FLEG5KP5.js → chunk-PWBLGKQ3.js} +5 -5
  151. package/dist/chunk-QCFN3ET4.js +9 -0
  152. package/dist/{chunk-F7F6Z64G.js → chunk-QLOKT22X.js} +1 -1
  153. package/dist/{chunk-IK2WXW2E.js → chunk-QLYOGT3U.js} +13 -13
  154. package/dist/{chunk-N7T63BVD.js → chunk-QMYQ4B5A.js} +3 -3
  155. package/dist/{chunk-EWVOGTEX.js → chunk-QSUQC4AN.js} +1 -1
  156. package/dist/{chunk-RDKBMX6U.js → chunk-QXK2HO4Q.js} +1 -1
  157. package/dist/{chunk-DNWV6N4P.js → chunk-R6R57BWQ.js} +4 -4
  158. package/dist/{chunk-M5GMIQ47.js → chunk-R7JTTKG2.js} +3 -3
  159. package/dist/{chunk-JIW5CJXC.js → chunk-RISKWWMD.js} +3 -3
  160. package/dist/{chunk-AGUA3O5O.js → chunk-RLLONZJJ.js} +1 -1
  161. package/dist/chunk-RSHNWBW2.js +4 -0
  162. package/dist/{chunk-24K6GVNM.js → chunk-SAHQB2JD.js} +17 -17
  163. package/dist/chunk-SC6HJBQA.js +8 -0
  164. package/dist/{chunk-OUSKOWNP.js → chunk-SGR4V5YI.js} +3 -3
  165. package/dist/chunk-SYH7EPLF.js +29 -0
  166. package/dist/{chunk-CVNJSD2J.js → chunk-T2ITXX7R.js} +6 -6
  167. package/dist/chunk-T76X2SHR.js +4 -0
  168. package/dist/{chunk-ARWMJSQJ.js → chunk-T7O2TNNX.js} +1 -1
  169. package/dist/{chunk-ANFLQSGX.js → chunk-TQH6E5V2.js} +1 -1
  170. package/dist/{chunk-KEK47CP3.js → chunk-TRUPMMDJ.js} +9 -9
  171. package/dist/chunk-UAECFZRW.js +8 -0
  172. package/dist/{chunk-L67VXJMF.js → chunk-UL4G6JY2.js} +1 -1
  173. package/dist/{chunk-E4E7MACR.js → chunk-UZGVIHFI.js} +14 -14
  174. package/dist/{chunk-DWBZ3Z34.js → chunk-V5QEPNPK.js} +2 -2
  175. package/dist/{chunk-MV6WDGB6.js → chunk-VANJPZ3H.js} +1 -1
  176. package/dist/{chunk-VVAJ23SD.js → chunk-VBNA237H.js} +1 -1
  177. package/dist/chunk-VVZE27M4.js +7 -0
  178. package/dist/{chunk-2R3BVU75.js → chunk-VZV7Q5V2.js} +1 -1
  179. package/dist/{chunk-BCUQXILM.js → chunk-WZQCRTXF.js} +1 -1
  180. package/dist/chunk-X4BKHXU5.js +9 -0
  181. package/dist/{chunk-UKDJUYIV.js → chunk-XI45TSEK.js} +1 -1
  182. package/dist/{chunk-IGNZULKG.js → chunk-YBU7NOD7.js} +1 -1
  183. package/dist/{chunk-QSJR7EI7.js → chunk-YQB5OYDC.js} +1 -1
  184. package/dist/{chunk-TVL3JPMY.js → chunk-YWR2WRDR.js} +1 -1
  185. package/dist/{chunk-FLQZ7GQ3.js → chunk-Z3CYLDHB.js} +11 -11
  186. package/dist/{chunk-K4D63NP3.js → chunk-ZC3CCRPG.js} +7 -7
  187. package/dist/{chunk-IPTCV6CQ.js → chunk-ZPW3KQ27.js} +30 -30
  188. package/dist/data/DataTable.js +1 -1
  189. package/dist/data/Kanban.js +1 -1
  190. package/dist/data/ListFooter.js +1 -1
  191. package/dist/data/ListLoadError.js +1 -1
  192. package/dist/data/Pagination.js +1 -1
  193. package/dist/file-intake/index.js +1 -1
  194. package/dist/format/index.js +1 -1
  195. package/dist/forms/BorderInput.js +1 -1
  196. package/dist/forms/BrandAssetEditor.js +1 -1
  197. package/dist/forms/Calendar.js +1 -1
  198. package/dist/forms/ColorPicker.js +1 -1
  199. package/dist/forms/ComposerAttachments.js +1 -1
  200. package/dist/forms/CornersInput.js +1 -1
  201. package/dist/forms/DatePicker.js +1 -1
  202. package/dist/forms/DateRangePicker.js +1 -1
  203. package/dist/forms/DateTimePicker.js +1 -1
  204. package/dist/forms/DisplayChips.js +1 -1
  205. package/dist/forms/FilePicker.js +1 -1
  206. package/dist/forms/FormErrorSummary.js +1 -1
  207. package/dist/forms/IconPicker.js +1 -1
  208. package/dist/forms/ImageFocusPoint.js +1 -1
  209. package/dist/forms/InputNumber.js +1 -1
  210. package/dist/forms/LinkPicker.js +1 -1
  211. package/dist/forms/MediaLibrary.js +1 -1
  212. package/dist/forms/MediaUploadField.js +1 -1
  213. package/dist/forms/MediaUploadGrid.js +1 -1
  214. package/dist/forms/MediaUsedInList.js +1 -1
  215. package/dist/forms/NumericKeypad.js +1 -1
  216. package/dist/forms/PositionInput.js +1 -1
  217. package/dist/forms/Select.js +1 -1
  218. package/dist/forms/SidesInput.js +1 -1
  219. package/dist/forms/Slider.js +1 -1
  220. package/dist/forms/Snippet.js +1 -1
  221. package/dist/forms/SplitButton.js +1 -1
  222. package/dist/forms/TagInput.js +1 -1
  223. package/dist/forms/TextToolbar.js +1 -1
  224. package/dist/forms/TimePicker.js +1 -1
  225. package/dist/forms/WidthsBar.js +1 -1
  226. package/dist/forms/mediaLibraryMenu.js +1 -1
  227. package/dist/forms/mediaMoveItems.js +1 -1
  228. package/dist/forms/textAlign.js +1 -1
  229. package/dist/forms/useFileIntake.js +1 -1
  230. package/dist/icons/index.js +1 -1
  231. package/dist/index.js +168 -168
  232. package/dist/locales/zh-Hans.js +1 -1
  233. package/dist/map/index.js +7 -7
  234. package/dist/page-tabs/index.js +5 -5
  235. package/dist/pdf/index.js +1 -1
  236. package/dist/shell/Accordion.js +1 -1
  237. package/dist/shell/AppUpdateBanner.js +1 -1
  238. package/dist/shell/Avatar.js +1 -1
  239. package/dist/shell/Banner.js +1 -1
  240. package/dist/shell/Breadcrumbs.js +1 -1
  241. package/dist/shell/BudgetBar.js +1 -1
  242. package/dist/shell/Card.js +1 -1
  243. package/dist/shell/ColoredBadge.js +1 -1
  244. package/dist/shell/ConfirmDialog.js +1 -1
  245. package/dist/shell/ContainerFillChart.js +1 -1
  246. package/dist/shell/ContextMenu.js +1 -1
  247. package/dist/shell/CountBadge.js +1 -1
  248. package/dist/shell/Dialog.js +1 -1
  249. package/dist/shell/Drawer.js +1 -1
  250. package/dist/shell/DropdownMenu.js +1 -1
  251. package/dist/shell/EditableGrid.js +1 -1
  252. package/dist/shell/EmptyState.js +1 -1
  253. package/dist/shell/GlobalSearch.js +1 -1
  254. package/dist/shell/HelpCenter.js +1 -1
  255. package/dist/shell/IconRail.js +1 -1
  256. package/dist/shell/ImageLightbox.js +1 -1
  257. package/dist/shell/ItemCount.js +1 -1
  258. package/dist/shell/LanguageSelect.js +1 -1
  259. package/dist/shell/Markdown.js +1 -1
  260. package/dist/shell/MetricBar.js +1 -1
  261. package/dist/shell/MetricBarLegend.js +1 -1
  262. package/dist/shell/MilestoneTimeline.js +1 -1
  263. package/dist/shell/PageHeader.js +1 -1
  264. package/dist/shell/PopupMenu.js +1 -1
  265. package/dist/shell/ProductionTimeline.js +1 -1
  266. package/dist/shell/ResizeHandle.js +1 -1
  267. package/dist/shell/Result.js +1 -1
  268. package/dist/shell/SearchableSelect.js +1 -1
  269. package/dist/shell/SettingReset.js +1 -1
  270. package/dist/shell/SettingRow.js +1 -1
  271. package/dist/shell/SidebarLayout.js +1 -1
  272. package/dist/shell/SidebarNav.js +1 -1
  273. package/dist/shell/SortableList.js +1 -1
  274. package/dist/shell/Statistic.js +1 -1
  275. package/dist/shell/TimeAgo.js +1 -1
  276. package/dist/shell/TimelineTrack.js +1 -1
  277. package/dist/shell/TopNav.js +1 -1
  278. package/dist/shell/TransferProgress.js +1 -1
  279. package/dist/shell/Tree.js +1 -1
  280. package/dist/shell/language.js +1 -1
  281. package/dist/shell/strings.d.ts +6 -0
  282. package/dist/shell/strings.js +1 -1
  283. package/dist/shell/toast.js +1 -1
  284. package/dist/telemetry/index.js +1 -1
  285. package/dist/templates/AuthScreen.js +1 -1
  286. package/dist/templates/ChatTemplate.js +1 -1
  287. package/dist/templates/CheckoutTemplate.js +1 -1
  288. package/dist/templates/DashboardTemplate.js +1 -1
  289. package/dist/templates/DataTablePage.js +1 -1
  290. package/dist/templates/EmailTemplate.js +1 -1
  291. package/dist/templates/ErrorBoundary.js +1 -1
  292. package/dist/templates/ErrorPage.js +1 -1
  293. package/dist/templates/FormLayoutPage.js +1 -1
  294. package/dist/templates/GalleryTemplate.js +1 -1
  295. package/dist/ui/index.js +1 -1
  296. package/dist/version.js +1 -1
  297. package/package.json +1 -1
  298. package/dist/Calculator-CSYRZAS5.js +0 -29
  299. package/dist/Files-4SD6LLKX.js +0 -88
  300. package/dist/Sidebar-Y4DTQYW2.js +0 -43
  301. package/dist/chunk-5SJ45P5E.js +0 -8
  302. package/dist/chunk-6453ISTQ.js +0 -4
  303. package/dist/chunk-D7IXMMZT.js +0 -9
  304. package/dist/chunk-FKNJSD6B.js +0 -14
  305. package/dist/chunk-G4EVQD5U.js +0 -8
  306. package/dist/chunk-G6CTTBKE.js +0 -9
  307. package/dist/chunk-HUF34LSW.js +0 -15
  308. package/dist/chunk-IMA5SXEC.js +0 -2
  309. package/dist/chunk-IX6QMUJQ.js +0 -9
  310. package/dist/chunk-JKHWZ2ZY.js +0 -19
  311. package/dist/chunk-KWT6GT4M.js +0 -29
  312. package/dist/chunk-LB3A53D5.js +0 -8
  313. package/dist/chunk-MG7A3R75.js +0 -1
  314. package/dist/chunk-N45ACN3G.js +0 -6
  315. package/dist/chunk-OX2DOOOI.js +0 -8
  316. package/dist/chunk-PDB5W7VI.js +0 -6
  317. package/dist/chunk-POCQ7ZL4.js +0 -3
  318. package/dist/chunk-PVR4KU7H.js +0 -7
  319. package/dist/chunk-Q7KTTDUS.js +0 -11
  320. package/dist/chunk-QWHQJNKL.js +0 -1
  321. package/dist/chunk-RC6UHOAV.js +0 -4
  322. package/dist/chunk-TNTQL6SX.js +0 -1
  323. package/dist/chunk-TTHWXGT7.js +0 -11
  324. package/dist/chunk-WE7CYRZT.js +0 -7
@@ -1,20 +1,20 @@
1
- import{Checkbox_default as e}from"./chunk-CGZBDI6C.js";import{Pagination as t}from"./chunk-ENL5L6NR.js";import{SpinnerRing as r}from"./chunk-R2VKEMZH.js";import{TH_ONE_LINE as o,OneLineLabel as n}from"./chunk-OZAAIE4E.js";import{useBrowserLayoutEffect as l}from"./chunk-D65T4H6J.js";import{useShellStrings as s}from"./chunk-QWHQJNKL.js";import{useState as i,useRef as a}from"react";import{jsxs as c,Fragment as d,jsx as h}from"react/jsx-runtime";function u(e){const t={};if(!e)return t;for(const[r,o]of Object.entries(e))!r.startsWith("data-")||"string"!=typeof o&&"number"!=typeof o&&"boolean"!=typeof o||(t[r]=o);return t}var m=e=>Array.isArray(e.columns),f=e=>"wide"===e.only?"rosh-dt-only-wide":"stacked"===e.only?"rosh-dt-only-stacked":"",g="rosh-dt-row-link rosh-focus-ring underline-offset-4 hover:underline",p={sm:"px-2 py-2",md:"px-3 py-2"},y={left:"text-left",right:"text-right",center:"text-center"};function b({direction:e}){/* @__PURE__ */
1
+ import{Checkbox_default as e}from"./chunk-CGZBDI6C.js";import{Pagination as t}from"./chunk-P65C5TUU.js";import{SpinnerRing as r}from"./chunk-R2VKEMZH.js";import{TH_ONE_LINE as o,OneLineLabel as n}from"./chunk-OZAAIE4E.js";import{useBrowserLayoutEffect as l}from"./chunk-D65T4H6J.js";import{useShellStrings as s}from"./chunk-PEM7UXQ3.js";import{useState as i,useRef as a}from"react";import{jsxs as c,Fragment as d,jsx as h}from"react/jsx-runtime";function u(e){const t={};if(!e)return t;for(const[r,o]of Object.entries(e))!r.startsWith("data-")||"string"!=typeof o&&"number"!=typeof o&&"boolean"!=typeof o||(t[r]=o);return t}var m=e=>Array.isArray(e.columns),f=e=>"wide"===e.only?"rosh-dt-only-wide":"stacked"===e.only?"rosh-dt-only-stacked":"",g="rosh-dt-row-link rosh-focus-ring underline-offset-4 hover:underline",p={sm:"px-2 py-2",md:"px-3 py-2"},y={left:"text-left",right:"text-right",center:"text-center"};function b({direction:e}){/* @__PURE__ */
2
2
  return c("span",{className:"ml-1 inline-flex flex-col leading-none","aria-hidden":"true",children:[
3
3
  /* @__PURE__ */h("svg",{className:"h-2 w-2 "+("asc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */h("path",{d:"M4 0L8 5H0z"})}),
4
- /* @__PURE__ */h("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */h("path",{d:"M4 5L0 0h8z"})})]})}function w(e,t=!1){const r=t?"":" whitespace-nowrap";return e.code?`font-mono${r}`:e.numeric?`tabular-nums${r}`:""}function x({columns:x,data:v,rowKey:k,sort:N=null,onSortChange:C,pagination:j,caption:M,loading:B=!1,bordered:$=!1,size:S="md",minWidth:z,rowClassName:H,onRow:E,rowHref:I,onRowPress:L,linkAs:T,emptyText:A,selection:O,footer:R,virtualized:D,stackOnNarrow:F=!1,stackBelow:K,className:P=""}){const W=s(),Z=A??W.table.empty,J=(e,t)=>"function"==typeof k?k(e,t):String(e[k]),Q=F&&!D,G=Q?x:x.flatMap(e=>{if(!m(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),V=e=>Q?{role:e}:{},q=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[U,X]=i(0),Y=D?.overscan??6,_=D?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/D.rowHeight)-Y);X(e=>e===t?e:t)}:void 0,ee=D?Math.ceil(D.height/D.rowHeight)+2*Y:v.length,te=D?Math.min(U,Math.max(0,v.length-ee)):0,re=Math.min(v.length,te+ee),oe=D?te*D.rowHeight:0,ne=D?(v.length-re)*D.rowHeight:0,le=a(null),[se,ie]=i(0);l(()=>{if(!D)return;const e=le.current?.offsetHeight??0;ie(t=>t===e?t:e)});const ae=e=>e.sortField??e.key,ce=e=>N&&N.field===ae(e)?N.direction:null,de=G.flatMap(e=>m(e)?e.columns:[e]),he=G.some(m),ue=/* @__PURE__ */new Map;if(Q)for(const e of G)if(m(e))for(const t of e.columns)ue.set(t,q(e.title,e.label));const me=e=>{const t=q(e.title,e.label),r=ue.get(e);return t&&r?`${r} · ${t}`:t},fe=new Set(O?.selected??[]),ge=O?v.map((e,t)=>J(e,t)):[],pe=ge.length>0&&ge.every(e=>fe.has(e)),ye=ge.some(e=>fe.has(e)),be=O?36:0,we=de.length+(O?1:0),xe=de.some(e=>"left"===e.fixed),ve=Q&&!O&&de.some(e=>e.cardCorner),ke=T??"a",Ne=`${p[S]} ${"sm"===S?"text-xs":"text-sm"}`,Ce=(e,t)=>e.ellipsis?/* @__PURE__ */h("span",{className:"block w-0 min-w-full",children:t}):t,je=(e,t,r,l=0)=>{const s=ce(e),i=y[e.align??(e.numeric?"right":"left")],a="left"===e.fixed,d=!(!e.sortable||!C);/* @__PURE__ */
5
- return h("th",{scope:"col",...V("columnheader"),rowSpan:r>1?r:void 0,"aria-sort":"asc"===s?"ascending":"desc"===s?"descending":d?"none":void 0,style:{width:e.width,...a?{left:(Be[t]??0)+be}:{},...D?{top:l}:{}},className:[Ne,i,o,"font-semibold uppercase tracking-wide text-gray-500","sm"===S?"text-2xs":"text-xs",a?D?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":D?"sticky z-10 bg-gray-50":"",Q&&d?"rosh-dt-sort":"",Q?f(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:Ce(e,d?/* @__PURE__ */c("button",{type:"button",onClick:()=>(e=>{if(!C)return;const t=ae(e),r=ce(e),o=e.sortFirst??"asc";C(null===r?{field:t,direction:o}:r===o?{field:t,direction:"asc"===o?"desc":"asc"}:null)})(e),"data-group":Q?ue.get(e):void 0,className:`inline-flex max-w-full items-center font-semibold uppercase tracking-wide hover:text-ink ${i}`,children:[
4
+ /* @__PURE__ */h("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */h("path",{d:"M4 5L0 0h8z"})})]})}function w(e,t=!1){const r=t?"":" whitespace-nowrap";return e.code?`font-mono${r}`:e.numeric?`tabular-nums${r}`:""}function x({columns:x,data:v,rowKey:k,sort:N=null,onSortChange:C,pagination:j,caption:M,loading:B=!1,bordered:$=!1,size:S="md",minWidth:z,rowClassName:H,onRow:T,rowHref:E,onRowPress:I,linkAs:A,emptyText:P,selection:O,footer:D,virtualized:F,stackOnNarrow:L=!1,stackBelow:R,className:K=""}){const U=s(),W=P??U.table.empty,Z=(e,t)=>"function"==typeof k?k(e,t):String(e[k]),G=L&&!F,J=G?x:x.flatMap(e=>{if(!m(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),Q=e=>G?{role:e}:{},V=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[X,q]=i(0),Y=F?.overscan??6,_=F?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/F.rowHeight)-Y);q(e=>e===t?e:t)}:void 0,ee=F?Math.ceil(F.height/F.rowHeight)+2*Y:v.length,te=F?Math.min(X,Math.max(0,v.length-ee)):0,re=Math.min(v.length,te+ee),oe=F?te*F.rowHeight:0,ne=F?(v.length-re)*F.rowHeight:0,le=a(null),[se,ie]=i(0);l(()=>{if(!F)return;const e=le.current?.offsetHeight??0;ie(t=>t===e?t:e)});const ae=e=>e.sortField??e.key,ce=e=>N&&N.field===ae(e)?N.direction:null,de=J.flatMap(e=>m(e)?e.columns:[e]),he=J.some(m),ue=/* @__PURE__ */new Map;if(G)for(const e of J)if(m(e))for(const t of e.columns)ue.set(t,V(e.title,e.label));const me=e=>{const t=V(e.title,e.label),r=ue.get(e);return t&&r?`${r} · ${t}`:t},fe=new Set(O?.selected??[]),ge=O?v.map((e,t)=>Z(e,t)):[],pe=ge.length>0&&ge.every(e=>fe.has(e)),ye=ge.some(e=>fe.has(e)),be=O?36:0,we=de.length+(O?1:0),xe=de.some(e=>"left"===e.fixed),ve=G&&!O&&de.some(e=>e.cardCorner),ke=A??"a",Ne=`${p[S]} ${"sm"===S?"text-xs":"text-sm"}`,Ce=(e,t)=>e.ellipsis?/* @__PURE__ */h("span",{className:"block w-0 min-w-full",children:t}):t,je=(e,t,r,l=0)=>{const s=ce(e),i=y[e.align??(e.numeric?"right":"left")],a="left"===e.fixed,d=!(!e.sortable||!C);/* @__PURE__ */
5
+ return h("th",{scope:"col",...Q("columnheader"),rowSpan:r>1?r:void 0,"aria-sort":"asc"===s?"ascending":"desc"===s?"descending":d?"none":void 0,style:{width:e.width,...a?{left:(Be[t]??0)+be}:{},...F?{top:l}:{}},className:[Ne,i,o,"font-semibold uppercase tracking-wide text-gray-500","sm"===S?"text-2xs":"text-xs",a?F?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":F?"sticky z-10 bg-gray-50":"",G&&d?"rosh-dt-sort":"",G?f(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:Ce(e,d?/* @__PURE__ */c("button",{type:"button",onClick:()=>(e=>{if(!C)return;const t=ae(e),r=ce(e),o=e.sortFirst??"asc";C(null===r?{field:t,direction:o}:r===o?{field:t,direction:"asc"===o?"desc":"asc"}:null)})(e),"data-group":G?ue.get(e):void 0,className:`inline-flex max-w-full items-center font-semibold uppercase tracking-wide hover:text-ink ${i}`,children:[
6
6
  /* @__PURE__ */h(n,{children:e.title}),
7
7
  /* @__PURE__ */h(b,{direction:s})]}):/* @__PURE__ */h(n,{children:e.title}))},e.key)};let Me=0;const Be=de.map(e=>{if("left"!==e.fixed)return null;const t=Me;return Me+=e.width??0,t}),$e=/* @__PURE__ */c(d,{children:[
8
- /* @__PURE__ */c("div",{onScroll:_,style:D?{maxHeight:D.height}:void 0,className:`relative overflow-x-auto ${D?"overflow-y-auto":""} ${$?"rounded-lg border border-gray-200":""}${Q?" rosh-dt-scroll":""}`.trim(),children:[B&&
8
+ /* @__PURE__ */c("div",{onScroll:_,style:F?{maxHeight:F.height}:void 0,className:`relative overflow-x-auto ${F?"overflow-y-auto":""} ${$?"rounded-lg border border-gray-200":""}${G?" rosh-dt-scroll":""}`.trim(),children:[B&&
9
9
  /* @__PURE__ */c("div",{className:"absolute inset-0 z-20 flex items-start justify-center bg-white/60 pt-8",role:"status","aria-live":"polite",children:[
10
10
  /* @__PURE__ */h(r,{className:"h-6 w-6"}),
11
- /* @__PURE__ */h("span",{className:"sr-only",children:W.table.loading})]}),
12
- /* @__PURE__ */c("table",{...V("table"),className:(Q?"rosh-dt-table ":"")+"w-full border-collapse tabular-nums",style:z?{minWidth:z}:void 0,children:[M&&/* @__PURE__ */h("caption",{className:"sr-only",children:M}),
13
- /* @__PURE__ */c("thead",{...V("rowgroup"),className:Q?"rosh-dt-head":void 0,children:[
14
- /* @__PURE__ */c("tr",{ref:le,...V("row"),className:"border-b border-gray-200 bg-gray-50",children:[O&&/* @__PURE__ */h("th",{scope:"col",...V("columnheader"),rowSpan:he?2:void 0,style:{width:36,...D?{top:0}:{}},className:[Ne,o,xe||D?"sticky z-20 bg-gray-50":"",xe?"left-0":"",Q?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */h(e,{"aria-label":W.table.selectAll,checked:pe,indeterminate:ye&&!pe,onChange:()=>{if(!O)return;const e=new Set(ge);O.onChange(pe?O.selected.filter(t=>!e.has(t)):[...O.selected,...ge.filter(e=>!fe.has(e))])}})}),G.map((e,t)=>m(e)?/* @__PURE__ */h("th",{scope:"colgroup",...V("columnheader"),colSpan:e.columns.length,style:D?{top:0}:void 0,className:[Ne,"text-center",o,"font-semibold uppercase tracking-wide text-gray-500","sm"===S?"text-2xs":"text-xs","border-b border-gray-200",D?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:/* @__PURE__ */h(n,{children:e.title})},e.key??`group-${t}`):je(e,de.indexOf(e),he?2:1))]}),he&&/* @__PURE__ */h("tr",{...V("row"),className:"border-b border-gray-200 bg-gray-50",children:G.flatMap(e=>m(e)?e.columns:[]).map(e=>je(e,de.indexOf(e),1,se))})]}),
15
- /* @__PURE__ */h("tbody",{...V("rowgroup"),className:Q?"rosh-dt-body":void 0,children:0!==v.length||B?/* @__PURE__ */c(d,{children:[oe>0&&/* @__PURE__ */h("tr",{"aria-hidden":"true",children:/* @__PURE__ */h("td",{colSpan:we,style:{height:oe,padding:0,border:0}})}),v.slice(te,re).map((t,r)=>{const o=te+r,n=E?.(t,o),l=!!n?.current,s=I?.(t,o),i=void 0===s&&L?()=>L(t,o):void 0,a=void 0!==s||void 0!==i;let d=!1;const m=(e,t)=>{if(d=!0,!a)return e;const r=[g,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),o=l?"true":void 0;return void 0!==s?/* @__PURE__ */h(ke,{href:s,className:r,"aria-current":o,children:e}):/* @__PURE__ */h("button",{type:"button",onClick:i,className:r,"aria-current":o,children:e})},p=de.map(e=>e.render?e.render(t,o,m):e.dataIndex?t[e.dataIndex]:null);if(a&&!d){const e=de.findIndex(e=>"stacked"!==e.only&&!e.cardCorner),t=de.findIndex(e=>"wide"!==e.only&&!e.cardCorner);for(const r of/* @__PURE__ */new Set([e,t]))r>=0&&(p[r]=m(p[r]))}const b=e=>e?t=>{t.currentTarget.contains(t.relatedTarget)||e()}:void 0;/* @__PURE__ */
16
- return c("tr",{...u(n),...V("row"),style:D?{height:D.rowHeight}:void 0,onClick:n?.onClick,onMouseEnter:n?.onMouseEnter,onMouseLeave:n?.onMouseLeave,onFocus:b(n?.onFocus),onBlur:b(n?.onBlur),"aria-current":l&&!a?"true":void 0,...n?.onClick?{tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.onClick?.()))}}:{},className:[Q?O?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"",Q&&ve?"rosh-dt-row-corner":"","border-b border-gray-100 last:border-b-0",n?.onClick?"cursor-pointer hover:bg-gray-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",a?"rosh-dt-linked hover:bg-gray-50":"",l?"rosh-dt-current":"",H?.(t,o)??"",n?.className??""].filter(Boolean).join(" "),children:[O&&(()=>{const r=J(t,o);/* @__PURE__ */
17
- return h("td",{...V("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[Ne,xe?"sticky left-0 z-10 bg-white":"",Q?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */h(e,{"aria-label":W.table.selectRow,checked:fe.has(r),onChange:()=>(e=>{O&&O.onChange(fe.has(e)?O.selected.filter(t=>t!==e):[...O.selected,e])})(r)})})})(),de.map((e,t)=>{const r="left"===e.fixed,o=p[t],n=ve&&!!e.cardCorner,l=Q&&!n&&"wide"!==e.only;/* @__PURE__ */
18
- return h("td",{...V("cell"),"data-label":l?me(e):void 0,style:r?{left:(Be[t]??0)+be}:void 0,className:[l?e.ellipsis?"rosh-dt-cell rosh-dt-clip":"rosh-dt-cell":"",n?"rosh-dt-corner":"",Q?f(e):"",Ne,y[e.align??(e.numeric?"right":"left")],Q?"":w(e),"text-ink-strongest",e.ellipsis?"max-w-0 truncate":"",r?"sticky z-10 bg-white":"",e.className??""].filter(Boolean).join(" "),children:Q?
19
- /* @__PURE__ */h("span",{className:["rosh-dt-value",w(e,!0)].filter(Boolean).join(" "),children:o}):o},e.key)})]},J(t,o))}),ne>0&&/* @__PURE__ */h("tr",{"aria-hidden":"true",children:/* @__PURE__ */h("td",{colSpan:we,style:{height:ne,padding:0,border:0}})})]}):/* @__PURE__ */h("tr",{...V("row"),className:Q?"rosh-dt-empty":void 0,children:/* @__PURE__ */h("td",{...V("cell"),colSpan:we,className:`${Ne} py-10 text-center text-gray-500`,children:Z})})})]}),R]}),j&&j.pageCount>1&&/* @__PURE__ */h("div",{className:Q?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */h(t,{page:j.page,pageCount:j.pageCount,onPageChange:j.onPageChange})})]});/* @__PURE__ */
20
- return h("div",Q?void 0!==K&&K>0&&40!==K?{className:`rosh-dt-at ${P}`.trim(),children:/* @__PURE__ */h("div",{className:"rosh-dt-stack",style:{width:40/K*100+"%"},children:/* @__PURE__ */h("div",{className:"rosh-dt-fit",style:{width:K/40*100+"%"},children:$e})})}:{className:`rosh-dt-stack ${P}`.trim(),children:$e}:{className:P,children:$e})}export{x as DataTable};
11
+ /* @__PURE__ */h("span",{className:"sr-only",children:U.table.loading})]}),
12
+ /* @__PURE__ */c("table",{...Q("table"),className:(G?"rosh-dt-table ":"")+"w-full border-collapse tabular-nums",style:z?{minWidth:z}:void 0,children:[M&&/* @__PURE__ */h("caption",{className:"sr-only",children:M}),
13
+ /* @__PURE__ */c("thead",{...Q("rowgroup"),className:G?"rosh-dt-head":void 0,children:[
14
+ /* @__PURE__ */c("tr",{ref:le,...Q("row"),className:"border-b border-gray-200 bg-gray-50",children:[O&&/* @__PURE__ */h("th",{scope:"col",...Q("columnheader"),rowSpan:he?2:void 0,style:{width:36,...F?{top:0}:{}},className:[Ne,o,xe||F?"sticky z-20 bg-gray-50":"",xe?"left-0":"",G?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */h(e,{"aria-label":U.table.selectAll,checked:pe,indeterminate:ye&&!pe,onChange:()=>{if(!O)return;const e=new Set(ge);O.onChange(pe?O.selected.filter(t=>!e.has(t)):[...O.selected,...ge.filter(e=>!fe.has(e))])}})}),J.map((e,t)=>m(e)?/* @__PURE__ */h("th",{scope:"colgroup",...Q("columnheader"),colSpan:e.columns.length,style:F?{top:0}:void 0,className:[Ne,"text-center",o,"font-semibold uppercase tracking-wide text-gray-500","sm"===S?"text-2xs":"text-xs","border-b border-gray-200",F?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:/* @__PURE__ */h(n,{children:e.title})},e.key??`group-${t}`):je(e,de.indexOf(e),he?2:1))]}),he&&/* @__PURE__ */h("tr",{...Q("row"),className:"border-b border-gray-200 bg-gray-50",children:J.flatMap(e=>m(e)?e.columns:[]).map(e=>je(e,de.indexOf(e),1,se))})]}),
15
+ /* @__PURE__ */h("tbody",{...Q("rowgroup"),className:G?"rosh-dt-body":void 0,children:0!==v.length||B?/* @__PURE__ */c(d,{children:[oe>0&&/* @__PURE__ */h("tr",{"aria-hidden":"true",children:/* @__PURE__ */h("td",{colSpan:we,style:{height:oe,padding:0,border:0}})}),v.slice(te,re).map((t,r)=>{const o=te+r,n=T?.(t,o),l=!!n?.current,s=E?.(t,o),i=void 0===s&&I?()=>I(t,o):void 0,a=void 0!==s||void 0!==i;let d=!1;const m=(e,t)=>{if(d=!0,!a)return e;const r=[g,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),o=l?"true":void 0;return void 0!==s?/* @__PURE__ */h(ke,{href:s,className:r,"aria-current":o,children:e}):/* @__PURE__ */h("button",{type:"button",onClick:i,className:r,"aria-current":o,children:e})},p=de.map(e=>e.render?e.render(t,o,m):e.dataIndex?t[e.dataIndex]:null);if(a&&!d){const e=de.findIndex(e=>"stacked"!==e.only&&!e.cardCorner),t=de.findIndex(e=>"wide"!==e.only&&!e.cardCorner);for(const r of/* @__PURE__ */new Set([e,t]))r>=0&&(p[r]=m(p[r]))}const b=e=>e?t=>{t.currentTarget.contains(t.relatedTarget)||e()}:void 0;/* @__PURE__ */
16
+ return c("tr",{...u(n),...Q("row"),style:F?{height:F.rowHeight}:void 0,onClick:n?.onClick,onMouseEnter:n?.onMouseEnter,onMouseLeave:n?.onMouseLeave,onFocus:b(n?.onFocus),onBlur:b(n?.onBlur),"aria-current":l&&!a?"true":void 0,...n?.onClick?{tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.onClick?.()))}}:{},className:[G?O?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"",G&&ve?"rosh-dt-row-corner":"","border-b border-gray-100 last:border-b-0",n?.onClick?"cursor-pointer hover:bg-gray-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",a?"rosh-dt-linked hover:bg-gray-50":"",l?"rosh-dt-current":"",H?.(t,o)??"",n?.className??""].filter(Boolean).join(" "),children:[O&&(()=>{const r=Z(t,o);/* @__PURE__ */
17
+ return h("td",{...Q("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[Ne,xe?"sticky left-0 z-10 bg-white":"",G?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */h(e,{"aria-label":U.table.selectRow,checked:fe.has(r),onChange:()=>(e=>{O&&O.onChange(fe.has(e)?O.selected.filter(t=>t!==e):[...O.selected,e])})(r)})})})(),de.map((e,t)=>{const r="left"===e.fixed,o=p[t],n=ve&&!!e.cardCorner,l=G&&!n&&"wide"!==e.only;/* @__PURE__ */
18
+ return h("td",{...Q("cell"),"data-label":l?me(e):void 0,style:r?{left:(Be[t]??0)+be}:void 0,className:[l?e.ellipsis?"rosh-dt-cell rosh-dt-clip":"rosh-dt-cell":"",n?"rosh-dt-corner":"",G?f(e):"",Ne,y[e.align??(e.numeric?"right":"left")],G?"":w(e),"text-ink-strongest",e.ellipsis?"max-w-0 truncate":"",r?"sticky z-10 bg-white":"",e.className??""].filter(Boolean).join(" "),children:G?
19
+ /* @__PURE__ */h("span",{className:["rosh-dt-value",w(e,!0)].filter(Boolean).join(" "),children:o}):o},e.key)})]},Z(t,o))}),ne>0&&/* @__PURE__ */h("tr",{"aria-hidden":"true",children:/* @__PURE__ */h("td",{colSpan:we,style:{height:ne,padding:0,border:0}})})]}):/* @__PURE__ */h("tr",{...Q("row"),className:G?"rosh-dt-empty":void 0,children:/* @__PURE__ */h("td",{...Q("cell"),colSpan:we,className:`${Ne} py-10 text-center text-gray-500`,children:W})})})]}),D]}),j&&j.pageCount>1&&/* @__PURE__ */h("div",{className:G?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */h(t,{page:j.page,pageCount:j.pageCount,onPageChange:j.onPageChange})})]});/* @__PURE__ */
20
+ return h("div",G?void 0!==R&&R>0&&40!==R?{className:`rosh-dt-at ${K}`.trim(),children:/* @__PURE__ */h("div",{className:"rosh-dt-stack",style:{width:40/R*100+"%"},children:/* @__PURE__ */h("div",{className:"rosh-dt-fit",style:{width:R/40*100+"%"},children:$e})})}:{className:`rosh-dt-stack ${K}`.trim(),children:$e}:{className:K,children:$e})}export{x as DataTable};
@@ -1,2 +1,2 @@
1
- import{Tooltip as e}from"./chunk-BCDG4N6L.js";import{useBrowserLayoutEffect as r}from"./chunk-D65T4H6J.js";import{useShellStrings as t}from"./chunk-QWHQJNKL.js";import{useRef as o,useEffect as n,useCallback as i}from"react";import{jsx as s}from"react/jsx-runtime";var a=(e,r,t)=>Math.min(t,Math.max(r,e));function l(e,r,t,o,n){return Math.round(a("left"===t||"top"===t?e+r:e-r,o,n))}function u(e,r,t){let o=null;try{o=window.localStorage.getItem(e)}catch{return null}const n=o?parseInt(o,10):NaN;return Number.isNaN(n)?null:a(n,r,t)}function c({width:c,onResize:d,orientation:h="vertical",side:m,min:f,max:p,defaultWidth:v=f,step:g=16,storageKey:b,label:w,hint:z,controls:y,className:x=""}){const N="horizontal"===h,P=t().resizeHandle,k=o(null),D=o({onResize:d,min:f,max:p,side:m});D.current={onResize:d,min:f,max:p,side:m},r(()=>{if(!b)return;const e=u(b,f,p);null!==e&&e!==c&&d(e)},[b]),n(()=>{if(!b)return;const e=window.setTimeout(()=>{try{window.localStorage.setItem(b,String(Math.round(c)))}catch{}},200);return()=>window.clearTimeout(e)},[c,b]);const C=i(()=>{k.current=null,document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")},[]);n(()=>C,[C]);const M=e=>{k.current&&(e.currentTarget.hasPointerCapture?.(k.current.pointer)&&e.currentTarget.releasePointerCapture(k.current.pointer),C())},I="left"===m?"right-0":"right"===m?"left-0":"top"===m?"bottom-0":"top-0",T="left"===m?"right":"right"===m?"left":"top"===m?"bottom":"top",$=N?`absolute inset-x-0 ${I} z-10 flex h-2`:`absolute inset-y-0 ${I} z-10 flex w-2`;/* @__PURE__ */
2
- return s(e,{content:z??P.hint,side:T,delay:600,className:`${$} ${x}`.trim(),children:/* @__PURE__ */s("div",{role:"separator",tabIndex:0,"aria-orientation":h,"aria-label":w??P.label,"aria-valuenow":Math.round(c),"aria-valuemin":f,"aria-valuemax":p,"aria-controls":y,"data-resize-handle":m,onPointerDown:e=>{0===e.button&&(e.preventDefault(),k.current={x:N?e.clientY:e.clientX,width:c,moved:!1,pointer:e.pointerId},e.currentTarget.setPointerCapture?.(e.pointerId),document.body.style.cursor=N?"row-resize":"col-resize",document.body.style.userSelect="none")},onPointerMove:e=>{const r=k.current;if(!r)return;if(0===e.buttons)return void C();const t=(N?e.clientY:e.clientX)-r.x;if(!r.moved){if(Math.abs(t)<3)return;r.moved=!0}const{onResize:o,min:n,max:i,side:s}=D.current;o(l(r.width,t,s,n,i))},onPointerUp:M,onPointerCancel:M,onLostPointerCapture:()=>{k.current&&C()},onDoubleClick:()=>d(a(v,f,p)),onKeyDown:e=>{const r=N?"ArrowDown":"ArrowRight",t=N?"ArrowUp":"ArrowLeft",o=e.key===r?g:e.key===t?-g:null,n=null!==o?l(c,o,m,f,p):"Home"===e.key?f:"End"===e.key?p:"Enter"===e.key?a(v,f,p):null;null!==n&&(e.preventDefault(),n!==c&&d(n))},className:N?"group/resize relative h-full w-full cursor-row-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"group/resize relative h-full w-full cursor-col-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */s("div",{"aria-hidden":"true",className:N?`absolute inset-x-0 ${I} h-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:h-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`:`absolute inset-y-0 ${I} w-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:w-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`})})})}export{c as ResizeHandle,u as readStoredWidth,l as resizedWidth};
1
+ import{Tooltip as e}from"./chunk-BCDG4N6L.js";import{useBrowserLayoutEffect as r}from"./chunk-D65T4H6J.js";import{useShellStrings as t}from"./chunk-PEM7UXQ3.js";import{useRef as o,useEffect as n,useCallback as i}from"react";import{jsx as s}from"react/jsx-runtime";var a=(e,r,t)=>Math.min(t,Math.max(r,e));function l(e,r,t,o,n){return Math.round(a("left"===t||"top"===t?e+r:e-r,o,n))}function u(e,r,t){let o=null;try{o=window.localStorage.getItem(e)}catch{return null}const n=o?parseInt(o,10):NaN;return Number.isNaN(n)?null:a(n,r,t)}function c({width:c,onResize:d,orientation:h="vertical",side:m,min:f,max:p,defaultWidth:v=f,step:g=16,storageKey:b,label:w,hint:z,controls:y,className:x=""}){const P="horizontal"===h,N=t().resizeHandle,k=o(null),D=o({onResize:d,min:f,max:p,side:m});D.current={onResize:d,min:f,max:p,side:m},r(()=>{if(!b)return;const e=u(b,f,p);null!==e&&e!==c&&d(e)},[b]),n(()=>{if(!b)return;const e=window.setTimeout(()=>{try{window.localStorage.setItem(b,String(Math.round(c)))}catch{}},200);return()=>window.clearTimeout(e)},[c,b]);const M=i(()=>{k.current=null,document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")},[]);n(()=>M,[M]);const C=e=>{k.current&&(e.currentTarget.hasPointerCapture?.(k.current.pointer)&&e.currentTarget.releasePointerCapture(k.current.pointer),M())},I="left"===m?"right-0":"right"===m?"left-0":"top"===m?"bottom-0":"top-0",T="left"===m?"right":"right"===m?"left":"top"===m?"bottom":"top",$=P?`absolute inset-x-0 ${I} z-10 flex h-2`:`absolute inset-y-0 ${I} z-10 flex w-2`;/* @__PURE__ */
2
+ return s(e,{content:z??N.hint,side:T,delay:600,className:`${$} ${x}`.trim(),children:/* @__PURE__ */s("div",{role:"separator",tabIndex:0,"aria-orientation":h,"aria-label":w??N.label,"aria-valuenow":Math.round(c),"aria-valuemin":f,"aria-valuemax":p,"aria-controls":y,"data-resize-handle":m,onPointerDown:e=>{0===e.button&&(e.preventDefault(),k.current={x:P?e.clientY:e.clientX,width:c,moved:!1,pointer:e.pointerId},e.currentTarget.setPointerCapture?.(e.pointerId),document.body.style.cursor=P?"row-resize":"col-resize",document.body.style.userSelect="none")},onPointerMove:e=>{const r=k.current;if(!r)return;if(0===e.buttons)return void M();const t=(P?e.clientY:e.clientX)-r.x;if(!r.moved){if(Math.abs(t)<3)return;r.moved=!0}const{onResize:o,min:n,max:i,side:s}=D.current;o(l(r.width,t,s,n,i))},onPointerUp:C,onPointerCancel:C,onLostPointerCapture:()=>{k.current&&M()},onDoubleClick:()=>d(a(v,f,p)),onKeyDown:e=>{const r=P?"ArrowDown":"ArrowRight",t=P?"ArrowUp":"ArrowLeft",o=e.key===r?g:e.key===t?-g:null,n=null!==o?l(c,o,m,f,p):"Home"===e.key?f:"End"===e.key?p:"Enter"===e.key?a(v,f,p):null;null!==n&&(e.preventDefault(),n!==c&&d(n))},className:P?"group/resize relative h-full w-full cursor-row-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"group/resize relative h-full w-full cursor-col-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */s("div",{"aria-hidden":"true",className:P?`absolute inset-x-0 ${I} h-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:h-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`:`absolute inset-y-0 ${I} w-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:w-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`})})})}export{c as ResizeHandle,u as readStoredWidth,l as resizedWidth};
@@ -1 +1 @@
1
- import{setPdfPreview as e}from"./chunk-ESL5TDNA.js";import{setSpreadsheetPreview as t}from"./chunk-VTVSMRFX.js";import{toast_default as n}from"./chunk-XD34TCRG.js";var i="react-os-shell:preview-opened";async function o(o){const{filePath:a,filename:r,kind:c,onStaged:s}=o;try{const o=await fetch(`${("undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000").replace(/\/$/,"")}/api/file?path=${encodeURIComponent(a)}`,{credentials:"include"});if(!o.ok)return n.error(`Download failed (${o.status})`),!1;const d=await o.blob();if("csv"===c){const e=await d.text();t({csv:e,filename:r}),s?.("/spreadsheet")}else{const t=URL.createObjectURL(d);e({url:t,filename:r,kind:c}),s?.("/preview")}return"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(i,{detail:{filePath:a,filename:r,kind:c}})),!0}catch(e){return n.error(e?.message||"Open failed"),!1}}export{i as PREVIEW_OPENED_EVENT,o as openPreviewFile};
1
+ import{setPdfPreview as e}from"./chunk-ESL5TDNA.js";import{setSpreadsheetPreview as t}from"./chunk-VTVSMRFX.js";import{toast_default as n}from"./chunk-4XZXY2AF.js";var i="react-os-shell:preview-opened";async function o(o){const{filePath:a,filename:r,kind:c,onStaged:s}=o;try{const o=await fetch(`${("undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000").replace(/\/$/,"")}/api/file?path=${encodeURIComponent(a)}`,{credentials:"include"});if(!o.ok)return n.error(`Download failed (${o.status})`),!1;const d=await o.blob();if("csv"===c){const e=await d.text();t({csv:e,filename:r}),s?.("/spreadsheet")}else{const t=URL.createObjectURL(d);e({url:t,filename:r,kind:c}),s?.("/preview")}return"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(i,{detail:{filePath:a,filename:r,kind:c}})),!0}catch(e){return n.error(e?.message||"Open failed"),!1}}export{i as PREVIEW_OPENED_EVENT,o as openPreviewFile};
@@ -1,4 +1,4 @@
1
- import{Card as e}from"./chunk-WUKN5WUM.js";import{Radio_default as a}from"./chunk-NI5FXWK5.js";import{Select_default as l}from"./chunk-CO5RKOVX.js";import{FormField as r}from"./chunk-6KBDNYRW.js";import{Checkbox_default as n}from"./chunk-CGZBDI6C.js";import{Textarea_default as i}from"./chunk-PB7G6CJ7.js";import{Input_default as c}from"./chunk-MAMWQCJ6.js";import{Button_default as o}from"./chunk-NHH2MXFU.js";import{useState as t}from"react";import{jsx as m,jsxs as d}from"react/jsx-runtime";function s(){const[s,h]=t("pro"),[u,p]=t(!0),[f,g]=t("us");/* @__PURE__ */
1
+ import{Card as e}from"./chunk-5RAOFJYT.js";import{Radio_default as a}from"./chunk-NI5FXWK5.js";import{Select_default as l}from"./chunk-4DBPKTVX.js";import{FormField as r}from"./chunk-6KBDNYRW.js";import{Checkbox_default as n}from"./chunk-CGZBDI6C.js";import{Textarea_default as i}from"./chunk-PB7G6CJ7.js";import{Input_default as c}from"./chunk-MAMWQCJ6.js";import{Button_default as o}from"./chunk-NHH2MXFU.js";import{useState as t}from"react";import{jsx as m,jsxs as d}from"react/jsx-runtime";function s(){const[s,h]=t("pro"),[u,p]=t(!0),[f,g]=t("us");/* @__PURE__ */
2
2
  return m("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */d("form",{className:"mx-auto max-w-2xl space-y-5",onSubmit:e=>e.preventDefault(),children:[
3
3
  /* @__PURE__ */d("div",{children:[
4
4
  /* @__PURE__ */m("h1",{className:"text-xl font-semibold text-gray-900",children:"Account settings"}),
@@ -0,0 +1,7 @@
1
+ import{isFocusableEntry as e,menuStatusIds as t,renderMenuEntries as r}from"./chunk-JWX7QRGE.js";import{useTabLayer as n,focusableIn as o}from"./chunk-CDAJKLGL.js";import{PopupMenu as i,PopupMenuDivider as a}from"./chunk-HAFB45DT.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as s}from"./chunk-62LW225J.js";import{placeMenu as d,popupBounds as c,followAnchor as u}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as p}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useState as m,useRef as h,useId as g,useCallback as v,useEffect as b}from"react";import{jsxs as y,jsx as x}from"react/jsx-runtime";var k=/(^|[\s:])!?z-/,w={paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:"0.25rem",paddingBottom:"0.25rem"};function D({trigger:D,items:L,align:j="end",side:A="bottom","aria-label":E,className:W="",triggerClassName:C,menuClassName:K="",minWidth:S=180,linkAs:H,disabled:$,id:N,"aria-describedby":T,"aria-disabled":U=!1,onOpenChange:B,footer:J,footerLabel:G}){const[I,q]=m(!1),[M,R]=m(-1),z=h(null),P=h(null),Q=h(null),F=h(null),O=h(null),V=null!=J&&!1!==J,X=h({text:"",at:0}),Y=g(),Z=g(),_=N??Z,ee=h(B);ee.current=B;const te=h(I);te.current=I;const re=v(e=>{q(!1),te.current&&(te.current=!1,ee.current?.(!1)),e&&P.current?.focus()},[]),ne=(t,r)=>{const n=L.length;for(let o=0;o<n;o+=1){const i=((t+r*o)%n+n)%n;if(e(L[i]))return i}return-1},oe=()=>Q.current?.closest("[data-popup-menu-tree]")??null;b(()=>{if(!I)return;const e=e=>{const t=e.target;if(z.current?.contains(t)||oe()?.contains(t))return;const r=oe()?.getAttribute("data-popup-menu-tree"),n=t.closest?.("[data-popup-menu-tree]");r&&n?.getAttribute("data-popup-menu-tree")===r||re(!1)};document.addEventListener("pointerdown",e,!0);const t=l(()=>re(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[I,re]);const ie=v(()=>{const e=oe(),t=P.current;if(!e||!t)return;const r=e.style;r.left="0px",r.top="0px",r.maxWidth="none",r.maxHeight="none";const n={width:e.offsetWidth,height:e.offsetHeight},o=d({trigger:t.getBoundingClientRect(),menu:n,bounds:c(t),align:j,side:A});r.left=`${o.left}px`,r.top=`${o.top}px`,r.maxWidth=`${o.maxWidth}px`,r.maxHeight=`${o.maxHeight}px`,r.overflowY=n.height>o.maxHeight?"auto":"",e.dataset.side=o.side,e.dataset.align=j},[j,A]);p(()=>{I&&ie()}),b(()=>{if(I)return u(()=>P.current,ie)},[I,ie]),b(()=>{if(!I)return;const t=Q.current,r=e(L[M])?t?.querySelector(`[data-dropdown-index="${M}"]`):null;(r??t)?.focus({preventScroll:!0})},[I,M]),b(()=>{if(I)return f(e=>"Escape"===e.key&&(re(!0),!0),()=>F.current)},[I,re]),n(F,I&&V);const ae=h(null),le=e=>"first"===e?ne(0,1):ne(L.length-1,-1),se=e=>{R(le(e)),q(!0),te.current||(te.current=!0,ae.current=e,B?.(!0))};p(()=>{const e=ae.current;if(!I||!e)return;ae.current=null;const t=le(e);t!==M&&R(t)});const de=t(L,Y),ce="function"==typeof J?J({close:()=>re(!0)}):J,ue={...k.test(K)?{}:{zIndex:s.popup},minWidth:S};/* @__PURE__ */
2
+ return y("div",{ref:z,className:`relative inline-flex ${W}`.trim(),children:[
3
+ /* @__PURE__ */x("button",{ref:P,id:_,type:"button","aria-haspopup":"menu","aria-expanded":I,"aria-controls":I?Y:void 0,"aria-label":E,"aria-describedby":T,"aria-disabled":U||void 0,disabled:$,onClick:()=>{U||(I?re(!1):se("first"))},onKeyDown:e=>{U||("ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),se("first")):"ArrowUp"===e.key&&(e.preventDefault(),se("last")))},className:C??"inline-flex items-center justify-center rounded-(--radius-control) text-gray-600 transition-colors not-disabled:not-aria-disabled:hover:bg-gray-100 not-disabled:not-aria-disabled:hover:text-ink-strongest rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] disabled:cursor-not-allowed disabled:opacity-60 "+(E?"h-8 min-w-8 px-0":"h-8 min-w-8 gap-2 px-3"),children:D}),I&&
4
+ /* @__PURE__ */x(i,{portal:!0,className:K,style:ue,children:/* @__PURE__ */y("div",{ref:F,children:[
5
+ /* @__PURE__ */x("div",{ref:Q,id:Y,role:"menu","aria-orientation":"vertical","aria-label":E,"aria-labelledby":E?void 0:_,"aria-describedby":de,tabIndex:-1,onKeyDown:t=>{if(!t.target.closest?.("[data-popup-submenu-panel]")||"Tab"===t.key)if("ArrowDown"===t.key)t.preventDefault(),R(ne(M+1,1));else if("ArrowUp"===t.key)t.preventDefault(),R(ne(M-1,-1));else if("Home"===t.key)t.preventDefault(),R(ne(0,1));else if("End"===t.key)t.preventDefault(),R(ne(L.length-1,-1));else if("Tab"===t.key){t.preventDefault();const e=!t.shiftKey&&O.current?o(O.current)[0]:void 0;e?e.focus({preventScroll:!0}):re(!0)}else if(" "===t.key){const e=t.target;e.matches?.("a[href]")&&(t.preventDefault(),e.click())}else 1!==t.key.length||t.ctrlKey||t.metaKey||t.altKey||(t=>{const r=Date.now(),n=t.key.toLowerCase(),o=r-X.current.at<500?X.current.text+n:n;X.current={text:o,at:r};const i=[...o].every(e=>e===o[0]),a=i?o[0]:o,l=i?M+1:Math.max(M,0),s=Q.current,d=L.length;for(let r=0;r<d;r+=1){const n=((l+r)%d+d)%d;if(e(L[n])&&(s?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(a))return t.preventDefault(),void R(n)}})(t)},children:r(L,{menuId:Y,choose:e=>{e.disabled||(re(!0),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>re(!0),rowProps:(e,t)=>({"data-dropdown-index":e,tabIndex:e===M?0:-1,onMouseEnter:()=>{t.disabled||O.current?.contains(document.activeElement)||R(e)}}),linkAs:H})}),V&&/* @__PURE__ */y("div",{ref:O,role:"group","aria-label":G,"data-dropdown-footer":"",onKeyDown:e=>{const t=O.current;if("Tab"!==e.key||!t||!t.contains(e.target))return;const r=o(t),n=document.activeElement;if(e.shiftKey){if(r.length>0&&n!==r[0])return;e.preventDefault();const t=Q.current?.querySelector(`[data-dropdown-index="${M}"]`);return void(t??Q.current)?.focus({preventScroll:!0})}r.length>0&&n!==r[r.length-1]||(e.preventDefault(),re(!0))},children:[
6
+ /* @__PURE__ */x("div",{"aria-hidden":"true",children:/* @__PURE__ */x(a,{})}),
7
+ /* @__PURE__ */x("div",{style:w,children:ce})]})]})})]})}export{D as DropdownMenu};
@@ -1,4 +1,4 @@
1
- import{SidebarLayout as e}from"./chunk-5JRL5LXD.js";import{Avatar as t}from"./chunk-Z3JW77LH.js";import{ItemCount as r}from"./chunk-PDXPMHG3.js";import{Button_default as a}from"./chunk-NHH2MXFU.js";import{useState as i}from"react";import{jsx as l,jsxs as n}from"react/jsx-runtime";var s=[{id:"inbox",label:"Inbox",count:12},{id:"starred",label:"Starred",count:3},{id:"sent",label:"Sent"},{id:"drafts",label:"Drafts",count:1},{id:"archive",label:"Archive"},{id:"trash",label:"Trash"}],d=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know what you think before the review.",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported every icon at 1x and 2x.",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by the release bot after all checks passed.",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th at noon if you want to join.",time:"Yest"}];function c(){const[c,o]=i(1),m=d.find(e=>e.id===c)??d[0];/* @__PURE__ */
1
+ import{SidebarLayout as e}from"./chunk-5AWV5R6E.js";import{Avatar as t}from"./chunk-65DYHG73.js";import{ItemCount as r}from"./chunk-DRNB7KDC.js";import{Button_default as a}from"./chunk-NHH2MXFU.js";import{useState as i}from"react";import{jsx as l,jsxs as n}from"react/jsx-runtime";var s=[{id:"inbox",label:"Inbox",count:12},{id:"starred",label:"Starred",count:3},{id:"sent",label:"Sent"},{id:"drafts",label:"Drafts",count:1},{id:"archive",label:"Archive"},{id:"trash",label:"Trash"}],d=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know what you think before the review.",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported every icon at 1x and 2x.",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by the release bot after all checks passed.",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th at noon if you want to join.",time:"Yest"}];function c(){const[c,o]=i(1),m=d.find(e=>e.id===c)??d[0];/* @__PURE__ */
2
2
  return l("div",{className:"h-full",children:/* @__PURE__ */l(e,{side:"left",defaultWidth:200,sidebar:/* @__PURE__ */n("div",{className:"flex h-full flex-col p-2",children:[
3
3
  /* @__PURE__ */l(a,{block:!0,className:"mb-2",children:"Compose"}),s.map((e,t)=>/* @__PURE__ */n("button",{className:"flex items-center justify-between rounded-md px-3 py-2 text-left text-sm "+(0===t?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
4
4
  /* @__PURE__ */l("span",{children:e.label}),null!=e.count&&/* @__PURE__ */l(r,{count:e.count,active:0===t})]},e.id))]}),children:/* @__PURE__ */n("div",{className:"flex h-full",children:[
@@ -1,3 +1,3 @@
1
- import{optionNoteClass as e}from"./chunk-URHGHXDN.js";import{DEFAULT_SHELL_STRINGS as n,useShellStrings as o}from"./chunk-QWHQJNKL.js";import{jsxs as t,jsx as a}from"react/jsx-runtime";function l(n){const o=n.depth?{paddingInlineStart:16*n.depth+"px"}:{};/* @__PURE__ */
1
+ import{optionNoteClass as e}from"./chunk-URHGHXDN.js";import{DEFAULT_SHELL_STRINGS as n,useShellStrings as o}from"./chunk-PEM7UXQ3.js";import{jsxs as t,jsx as a}from"react/jsx-runtime";function l(n){const o=n.depth?{paddingInlineStart:16*n.depth+"px"}:{};/* @__PURE__ */
2
2
  return t("span",{"data-move-target":"",className:"flex min-w-0 flex-col",style:o,children:[
3
3
  /* @__PURE__ */a("span",{children:n.label}),n.disabledReason&&/* @__PURE__ */a("span",{className:e(),children:n.disabledReason})]})}function r({count:e,kind:o="file",targets:t,onPick:a},r=n.media){const i=[{type:"label",key:"move-to",label:r.moveTo(e,o)}];if(!t.length)return i.push({type:"status",key:"move-nowhere",label:r.moveNowhere}),i;let s;return t.forEach((e,n)=>{(n>0&&e.group!==s||0===n&&e.group)&&(n>0&&i.push({type:"divider",key:`group-line:${n}`}),e.group&&i.push({type:"label",key:`group:${n}`,label:e.group})),s=e.group,i.push({key:e.key,label:l(e),disabled:!!e.disabledReason,onSelect:()=>a(e)})}),i}function i(e,o=n.media){const{head:t=!0,icon:a,disabled:l,key:i="move-to-menu",...s}=e,u=r(s,o);return{type:"submenu",key:i,label:o.moveToMenu,icon:a,disabled:l,maxHeight:320,items:t?u:u.slice(1)}}function s(e){return r(e,o().media)}export{r as mediaMoveItems,i as mediaMoveSubmenu,s as useMediaMoveItems};
@@ -0,0 +1,9 @@
1
+ import{toISODate as e}from"./chunk-KQSUSVMF.js";import{Calendar as t}from"./chunk-E72USUUR.js";import{inputClasses as r,PLACEHOLDER_INK as a}from"./chunk-AYZY3YNC.js";import{calendarNames as n}from"./chunk-5OTS2G3M.js";import{Icon as i}from"./chunk-FSPFV4MI.js";import{onOverlayOpen as o}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as l}from"./chunk-62LW225J.js";import{useDropdownPosition as s}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as d}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useShellStrings as c,useShellLocale as m}from"./chunk-PEM7UXQ3.js";import{forwardRef as f,useState as b,useRef as p,useId as h,useEffect as v}from"react";import{createPortal as g}from"react-dom";import{jsx as y,jsxs as x}from"react/jsx-runtime";var N=/^\d{4}-\d{2}-\d{2}$/,k=/^(aria|data)-/,j=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function w(t){if(null==t||""===t)return"";if(t instanceof Date)return Number.isNaN(t.getTime())?"":e(t);if(N.test(t))return t;const r=new Date(t);return Number.isNaN(r.getTime())?"":e(r)}function D(e){if(!N.test(e))return null;const[t,r,a]=e.split("-").map(Number),n=new Date(t,r-1,a);return n.getMonth()===r-1&&n.getDate()===a?n:null}function F(e,t){const r=D(e);return r?t.longDate(r.getFullYear(),r.getMonth(),r.getDate()):""}var S=f(function({value:f,onChange:N,min:S,max:U,invalid:E,size:M,native:B,weekStartsOn:C,className:$="","aria-label":q,"aria-describedby":I,"aria-labelledby":O,id:T,name:W,disabled:z,placeholder:L,required:P,clearable:Y,form:G,title:J,tabIndex:Q,autoFocus:V,onFocus:R,onBlur:A,...H},K){const X=Y??!P,Z=w(f),_=w(S),ee=w(U),te=c().datePicker,re=m(),ae=n(re),[ne,ie]=b(!1),oe=p(null),le=p(null),se=p(null),de=h(),ue=h(),ce=h(),me=s(le,ne,{popupRef:se}),[fe,be]=b(!1);d(()=>{const e=!!T&&(le.current?.labels?.length??0)>0;e!==fe&&be(e)});const pe=!q&&(!!O||fe);if(v(()=>{if(!ne)return;const e=e=>{const t=e.target;oe.current?.contains(t)||se.current?.contains(t)||ie(!1)};document.addEventListener("pointerdown",e,!0);const t=o(()=>ie(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[ne]),v(()=>{if(ne)return u(e=>"Escape"===e.key&&(ie(!1),le.current?.focus(),!0),()=>se.current)},[ne]),B)/* @__PURE__ */
2
+ return y("input",{ref:K,type:"date",lang:re,id:T,name:W,disabled:z,"aria-label":q,"aria-describedby":I,"aria-invalid":E||void 0,value:Z,min:_||void 0,max:ee||void 0,onChange:e=>N?.(D(e.target.value)),className:r({invalid:E,size:M,className:$}),"aria-labelledby":O,required:P,form:G,title:J,tabIndex:Q,autoFocus:V,onFocus:R,onBlur:A,...H});const he=Object.fromEntries(Object.entries(H).filter(([e])=>k.test(e)&&!j.has(e))),ve=H["aria-required"],ge=!!P||!0===ve||"true"===ve,ye=[pe?ue:void 0,ge?ce:void 0,I].filter(Boolean).join(" ")||void 0,xe=e(/* @__PURE__ */new Date),Ne=(!_||xe>=_)&&(!ee||xe<=ee),ke=L??te.placeholder;/* @__PURE__ */
3
+ return x("div",{ref:oe,className:"relative",children:[
4
+ /* @__PURE__ */y("input",{ref:K,type:"hidden",name:W,form:G,value:Z}),
5
+ /* @__PURE__ */x("button",{ref:le,type:"button",...he,id:T,disabled:z,title:J,tabIndex:Q,autoFocus:V,onFocus:R,onBlur:A,"aria-haspopup":"dialog","aria-expanded":ne,"aria-controls":ne?de:void 0,"aria-labelledby":O,"aria-describedby":ye,"aria-label":q?`${q}${Z?`, ${F(Z,ae)}`:""}`:void 0,onClick:()=>ie(e=>!e),className:`${r({invalid:E,size:M,className:$})} flex items-center justify-between text-left`,children:[
6
+ /* @__PURE__ */y("span",{className:Z?"text-ink-strongest":a,children:Z?F(Z,ae):ke}),
7
+ /* @__PURE__ */y(i,{name:"date",className:`h-4 w-4 shrink-0 ${a}`,strokeWidth:"1.75","aria-hidden":"true"})]}),pe&&/* @__PURE__ */y("span",{id:ue,className:"sr-only",children:Z?F(Z,ae):ke}),ge&&/* @__PURE__ */y("span",{id:ce,className:"sr-only",children:te.required}),ne&&g(
8
+ /* @__PURE__ */x("div",{ref:se,id:de,role:"dialog","aria-label":q??te.dialog,className:"fixed w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg",style:{zIndex:l.popup,left:me?.left,right:me?.right,top:me?.top,bottom:me?.bottom,maxWidth:me?.maxWidth,visibility:me?void 0:"hidden"},children:[
9
+ /* @__PURE__ */y(t,{value:Z||null,min:_||null,max:ee||null,weekStartsOn:C,onSelect:e=>{ie(!1),le.current?.focus(),N?.(D(e))}}),(X||Ne)&&/* @__PURE__ */x("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[X&&/* @__PURE__ */y("button",{type:"button",onClick:()=>{ie(!1),le.current?.focus(),N?.(null)},className:"rounded-(--radius-control) px-2 py-1 text-sm text-gray-500 hover:bg-gray-100 hover:text-gray-700",children:te.clear}),Ne&&/* @__PURE__ */y("button",{type:"button",onClick:()=>{ie(!1),le.current?.focus(),N?.(/* @__PURE__ */new Date)},className:"ml-auto rounded-(--radius-control) px-2 py-1 text-sm font-medium text-blue-600 hover:bg-blue-50",children:te.today})]})]}),document.body)]})});export{S as DatePicker_default};
@@ -1,3 +1,3 @@
1
- import{mediaMoveSubmenu as e}from"./chunk-BCUQXILM.js";import{optionNoteClass as n}from"./chunk-URHGHXDN.js";import{Icon as r}from"./chunk-FSPFV4MI.js";import{jsxs as d,jsx as l}from"react/jsx-runtime";var a={folder:/* @__PURE__ */l(r,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),"folder-plus":/* @__PURE__ */l(r,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */l(r,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */l(r,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */l(r,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */l(r,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */l(r,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */l(r,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},o=e=>a[e];function i(e,r){return r?/* @__PURE__ */d("span",{className:"flex min-w-0 flex-col",children:[
1
+ import{mediaMoveSubmenu as e}from"./chunk-WZQCRTXF.js";import{optionNoteClass as n}from"./chunk-URHGHXDN.js";import{Icon as r}from"./chunk-FSPFV4MI.js";import{jsxs as d,jsx as l}from"react/jsx-runtime";var a={folder:/* @__PURE__ */l(r,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),"folder-plus":/* @__PURE__ */l(r,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */l(r,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */l(r,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */l(r,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */l(r,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */l(r,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */l(r,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},o=e=>a[e];function i(e,r){return r?/* @__PURE__ */d("span",{className:"flex min-w-0 flex-col",children:[
2
2
  /* @__PURE__ */l("span",{children:e}),
3
3
  /* @__PURE__ */l("span",{className:n(),children:r})]}):e}function t(n,r){const{words:d,denied:l}=r,a=[],t=(e,n,r,d={})=>{if(!r)return;const o=d.deny?l[d.deny]:void 0;a.push({key:e,label:i(n,o),icon:d.icon,danger:d.danger,disabled:!!o||!!d.off,onSelect:r})},c=(n,d,i,t)=>{const c=r.move;c&&a.push(e({count:d,kind:i,head:t,icon:o("folder"),disabled:!!l.move,targets:r.moveTargets(n),onPick:e=>c(n,e.key===s?null:e.key)},r.media))},h=e=>{a.length&&a.push({type:"divider",key:e})};switch(n.kind){case"folder":{const e={kind:"folder",id:n.id};if(t("new",d.newSubfolder,r.newSubfolder&&(()=>r.newSubfolder(n.id)),{icon:o("folder-plus"),deny:"newFolder"}),t("rename",d.rename,r.rename&&(()=>r.rename({kind:"folder",id:n.id})),{icon:o("edit"),deny:"rename"}),c(e,1,"file",!1),r.deleteFolder){h("d-delete");const e=!l.deleteFolder&&!!r.folderNotEmpty?.(n.id);a.push({key:"delete-folder",label:i(d.deleteFolder,l.deleteFolder??(e?d.folderNotEmpty:void 0)),icon:o("trash"),danger:!0,disabled:!!l.deleteFolder||e,onSelect:()=>r.deleteFolder(n.id)})}return a}case"files":{const{ids:e}=n,l=1===e.length,i={kind:"files",ids:e};l||a.push({type:"label",key:"count",label:d.filesSelected(e.length)}),c(i,e.length,r.kindOf(e),!0),t("rename",d.rename,r.rename&&(()=>r.rename({kind:"file",id:e[0]})),{icon:o("edit"),deny:"rename",off:!l}),t("replace",d.replace,r.replace&&(()=>r.replace(e[0])),{icon:o("swap"),deny:"replace",off:!l}),t("copy",d.copyUrl,()=>r.copyUrl(e[0]),{icon:o("copy"),off:!l});const s=l?r.urlOf(e[0]):void 0;return s&&a.push({type:"link",key:"open",label:d.openOriginal,href:s,icon:o("external")}),r.trash&&(h("d-trash"),t("trash",l?d.moveToTrash:d.moveFilesToTrash(e.length),()=>r.trash(i),{icon:o("trash"),danger:!0,deny:"trash"})),a}case"trashed":{const{ids:e}=n;return e.length>1&&a.push({type:"label",key:"count",label:d.filesSelected(e.length)}),t("restore",d.restore,r.restore&&(()=>r.restore(e)),{icon:o("undo"),deny:"restore"}),r.deleteForever&&(h("d-delete"),t("delete",d.deleteForever,()=>r.deleteForever(e),{icon:o("trash"),danger:!0,deny:"deleteForever"})),a}case"product-node":case"render":return a.push({type:"label",key:"read-only",label:d.readOnlyMenu}),t("design",d.openInDesign,r.openInDesign&&(()=>r.openInDesign({kind:n.kind,id:n.id})),{icon:o("external")}),"render"===n.kind&&t("copy",d.copyUrl,()=>r.copyUrl(n.id),{icon:o("copy")}),a;default:return a}}var s="__all-files__";export{s as ROOT_KEY,t as mediaLibraryMenu};
@@ -1,4 +1,4 @@
1
- import{SidebarLayout as e}from"./chunk-5JRL5LXD.js";import{Avatar as t}from"./chunk-Z3JW77LH.js";import{Input_default as a}from"./chunk-MAMWQCJ6.js";import{Button_default as i}from"./chunk-NHH2MXFU.js";import{useState as s}from"react";import{jsx as n,jsxs as l}from"react/jsx-runtime";var r=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],m=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function d(){const[d,o]=s(1),c=r.find(e=>e.id===d)??r[0];/* @__PURE__ */
1
+ import{SidebarLayout as e}from"./chunk-5AWV5R6E.js";import{Avatar as t}from"./chunk-65DYHG73.js";import{Input_default as a}from"./chunk-MAMWQCJ6.js";import{Button_default as i}from"./chunk-NHH2MXFU.js";import{useState as s}from"react";import{jsx as n,jsxs as l}from"react/jsx-runtime";var r=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],m=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function d(){const[d,o]=s(1),c=r.find(e=>e.id===d)??r[0];/* @__PURE__ */
2
2
  return n("div",{className:"h-full",children:/* @__PURE__ */n(e,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */n("div",{className:"h-full overflow-auto",children:r.map(e=>/* @__PURE__ */l("button",{onClick:()=>o(e.id),className:"flex w-full items-center gap-3 border-b border-gray-100 px-3 py-3 text-left hover:bg-gray-50 "+(e.id===d?"bg-blue-50/50":""),children:[
3
3
  /* @__PURE__ */n(t,{name:e.name,status:e.status}),
4
4
  /* @__PURE__ */l("div",{className:"min-w-0 flex-1",children:[
@@ -1,4 +1,4 @@
1
- import{Card as e}from"./chunk-WUKN5WUM.js";import{Select_default as l}from"./chunk-CO5RKOVX.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Banner as i}from"./chunk-IMOPDLMA.js";import{Input_default as c}from"./chunk-MAMWQCJ6.js";import{Button_default as s}from"./chunk-NHH2MXFU.js";import{useState as d}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";var h=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function m(){const[m,o]=d(!0),[p,u]=d("us"),y=h.reduce((e,l)=>e+l.qty*l.price,0),g=y+9;/* @__PURE__ */
1
+ import{Card as e}from"./chunk-5RAOFJYT.js";import{Select_default as l}from"./chunk-4DBPKTVX.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Banner as i}from"./chunk-7WLFHDWA.js";import{Input_default as c}from"./chunk-MAMWQCJ6.js";import{Button_default as s}from"./chunk-NHH2MXFU.js";import{useState as d}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";var h=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function m(){const[m,o]=d(!0),[p,u]=d("us"),y=h.reduce((e,l)=>e+l.qty*l.price,0),g=y+9;/* @__PURE__ */
2
2
  return n("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */t("div",{className:"mx-auto max-w-5xl space-y-5",children:[
3
3
  /* @__PURE__ */n("h1",{className:"text-xl font-semibold text-gray-900",children:"Checkout"}),
4
4
  /* @__PURE__ */t("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-3",children:[
@@ -1,4 +1,4 @@
1
- import{Button_default as e}from"./chunk-NHH2MXFU.js";import{Icon as r}from"./chunk-FSPFV4MI.js";import{useShellStrings as t}from"./chunk-QWHQJNKL.js";import{jsxs as a,jsx as d}from"react/jsx-runtime";function n({title:n,message:o,onRetry:s,variant:i="dashed"}){const m=t().list;/* @__PURE__ */
1
+ import{Button_default as e}from"./chunk-NHH2MXFU.js";import{Icon as r}from"./chunk-FSPFV4MI.js";import{useShellStrings as t}from"./chunk-PEM7UXQ3.js";import{jsxs as a,jsx as d}from"react/jsx-runtime";function n({title:n,message:o,onRetry:s,variant:i="dashed"}){const m=t().list;/* @__PURE__ */
2
2
  return a("div",{className:`flex flex-col items-center justify-center text-center ${"card"===i?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===i?"px-6 py-12":"rounded-lg border-2 border-dashed border-red-200 px-6 py-12"}`,role:"alert",children:[
3
3
  /* @__PURE__ */d(r,{name:"warning",className:"h-10 w-10 text-red-300 mb-3",strokeWidth:1,"aria-hidden":"true"}),
4
4
  /* @__PURE__ */d("h3",{className:"text-sm font-medium text-gray-900",children:n??m.loadError}),
@@ -1,16 +1,16 @@
1
- import{Popover as e}from"./chunk-7JGR7WPD.js";import{InputNumber_default as r}from"./chunk-ZHHEMSOD.js";import{InSettingRowContext as a}from"./chunk-L65BESIE.js";import{parseHexColor as n,hexToHsv as o,hsvToHex as t,hexReadout as l,HUE_GRADIENT as i,HEX_MAX_LENGTH as s,svFromPoint as c,hueFromPoint as u}from"./chunk-S6OB6HJB.js";import{inputClasses as d}from"./chunk-AYZY3YNC.js";import{Tooltip as h}from"./chunk-BCDG4N6L.js";import{useShellStrings as g}from"./chunk-QWHQJNKL.js";import{forwardRef as p,useState as b,useRef as m,useEffect as f,useId as v}from"react";import{jsx as w,jsxs as x}from"react/jsx-runtime";var k={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},y={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function C(e){return null==e||Number.isNaN(e)?100:Math.round(Math.min(100,Math.max(0,e)))}function N(e,r){if(!e)return y;const a=C(r);if(a>=100)return{background:e};const n=`color-mix(in srgb, ${e} ${a}%, transparent)`;return{backgroundImage:`linear-gradient(${n}, ${n}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`}}function $({size:e="md",selected:r=!1,className:a=""}={}){return["relative inline-flex shrink-0 overflow-hidden rounded-md p-0 transition-shadow","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-60",r?"border-2 border-blue-500":"border border-gray-300 hover:shadow-sm",k[e],a].filter(Boolean).join(" ")}var z=p(function({color:e,size:r="md",selected:a,className:n,type:o="button",...t},l){/* @__PURE__ */
2
- return w("button",{ref:l,type:o,"aria-pressed":a,className:$({size:r,selected:a,className:n}),...t,children:/* @__PURE__ */w("span",{"aria-hidden":"true",className:"absolute inset-0",style:N(e)})})}),D=(e,r,a)=>Math.min(a,Math.max(r,e)),I=e=>"string"==typeof e?{value:e}:e;function P(e,r,a){const n=a?.1:.01,o={ArrowLeft:[-n,0],ArrowRight:[n,0],ArrowDown:[0,-n],ArrowUp:[0,n]}[r];return o?{...e,s:D(e.s+o[0],0,1),v:D(e.v+o[1],0,1)}:null}function A(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return D(e-n,0,359);case"ArrowRight":case"ArrowUp":return D(e+n,0,359);case"PageDown":return D(e-10,0,359);case"PageUp":return D(e+10,0,359);case"Home":return 0;case"End":return 359;default:return null}}var M={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function j(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return D(e-n,0,100);case"ArrowRight":case"ArrowUp":return D(e+n,0,100);case"PageDown":return D(e-10,0,100);case"PageUp":return D(e+10,0,100);case"Home":return 0;case"End":return 100;default:return null}}function S({value:e,onChange:r,label:s,presets:d,clearable:p=!1,fallback:v,dragWrites:k="live",disabled:$=!1,opacity:D,onOpacityChange:S,onClose:B,id:K,className:L=""}){const H=g().color,O=C(D),R=e=>{const r=C(e);$||r===O||S?.(r)},U=e=>{const r=e.currentTarget.getBoundingClientRect();return r.width>0?(e.clientX-r.left)/r.width*100:O},W=n(v??""),[Y,q]=b(()=>o(e||W||"")),J=m(e);f(()=>{e!==J.current&&(J.current=e,e?q(o(e)):W&&q(o(W)))},[e]);const X=a=>{$||a===e||(J.current=a,r(a))},G=e=>{const r=n(e);r&&(q(o(r)),X(r))},Q=e=>{q(e),X(t(e))},[Z,F]=b(!1),V=m(Y);V.current=Y;const _=e=>({onPointerDown:r=>{if($||0!==r.button)return;r.currentTarget.setPointerCapture?.(r.pointerId),r.currentTarget.focus({preventScroll:!0});const a=e(r,V.current);"end"===k?(F(!0),q(a)):Q(a)},onPointerMove:r=>{if($||!(1&r.buttons))return;const a=e(r,V.current);"end"===k?q(a):Q(a)},onPointerUp:r=>{"end"===k&&Z&&(F(!1),Q(e(r,V.current)))}}),ee=_((e,r)=>({...r,...c(e.clientX,e.clientY,e.currentTarget.getBoundingClientRect())})),re=_((e,r)=>({...r,h:u(e.clientX,e.currentTarget.getBoundingClientRect())})),ae=Z?t(Y):e,ne=e=>`${Math.round(100*e)}%`,oe=(d??[]).map(I),te=n(e),le=ae||W||"";
1
+ import{Popover as e}from"./chunk-7JGR7WPD.js";import{InputNumber_default as r}from"./chunk-JENEVLJU.js";import{InSettingRowContext as a}from"./chunk-L65BESIE.js";import{parseHexColor as n,hexToHsv as o,hsvToHex as t,hexReadout as l,HUE_GRADIENT as i,HEX_MAX_LENGTH as s,svFromPoint as c,hueFromPoint as u}from"./chunk-S6OB6HJB.js";import{inputClasses as d}from"./chunk-AYZY3YNC.js";import{Tooltip as h}from"./chunk-BCDG4N6L.js";import{useShellStrings as g}from"./chunk-PEM7UXQ3.js";import{forwardRef as p,useState as b,useRef as m,useEffect as f,useId as v}from"react";import{jsx as w,jsxs as x}from"react/jsx-runtime";var k={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},y={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function C(e){return null==e||Number.isNaN(e)?100:Math.round(Math.min(100,Math.max(0,e)))}function N(e,r){if(!e)return y;const a=C(r);if(a>=100)return{background:e};const n=`color-mix(in srgb, ${e} ${a}%, transparent)`;return{backgroundImage:`linear-gradient(${n}, ${n}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`}}function $({size:e="md",selected:r=!1,className:a=""}={}){return["relative inline-flex shrink-0 overflow-hidden rounded-md p-0 transition-shadow","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-60",r?"border-2 border-blue-500":"border border-gray-300 hover:shadow-sm",k[e],a].filter(Boolean).join(" ")}var z=p(function({color:e,size:r="md",selected:a,className:n,type:o="button",...t},l){/* @__PURE__ */
2
+ return w("button",{ref:l,type:o,"aria-pressed":a,className:$({size:r,selected:a,className:n}),...t,children:/* @__PURE__ */w("span",{"aria-hidden":"true",className:"absolute inset-0",style:N(e)})})}),D=(e,r,a)=>Math.min(a,Math.max(r,e)),P=e=>"string"==typeof e?{value:e}:e;function I(e,r,a){const n=a?.1:.01,o={ArrowLeft:[-n,0],ArrowRight:[n,0],ArrowDown:[0,-n],ArrowUp:[0,n]}[r];return o?{...e,s:D(e.s+o[0],0,1),v:D(e.v+o[1],0,1)}:null}function A(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return D(e-n,0,359);case"ArrowRight":case"ArrowUp":return D(e+n,0,359);case"PageDown":return D(e-10,0,359);case"PageUp":return D(e+10,0,359);case"Home":return 0;case"End":return 359;default:return null}}var M={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function j(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return D(e-n,0,100);case"ArrowRight":case"ArrowUp":return D(e+n,0,100);case"PageDown":return D(e-10,0,100);case"PageUp":return D(e+10,0,100);case"Home":return 0;case"End":return 100;default:return null}}function S({value:e,onChange:r,label:s,presets:d,clearable:p=!1,fallback:v,dragWrites:k="live",disabled:$=!1,opacity:D,onOpacityChange:S,onClose:B,id:E,className:K=""}){const U=g().color,R=C(D),O=e=>{const r=C(e);$||r===R||S?.(r)},H=e=>{const r=e.currentTarget.getBoundingClientRect();return r.width>0?(e.clientX-r.left)/r.width*100:R},J=n(v??""),[W,X]=b(()=>o(e||J||"")),Y=m(e);f(()=>{e!==Y.current&&(Y.current=e,e?X(o(e)):J&&X(o(J)))},[e]);const q=a=>{$||a===e||(Y.current=a,r(a))},G=e=>{const r=n(e);r&&(X(o(r)),q(r))},V=e=>{X(e),q(t(e))},[F,Q]=b(!1),Z=m(W);Z.current=W;const _=e=>({onPointerDown:r=>{if($||0!==r.button)return;r.currentTarget.setPointerCapture?.(r.pointerId),r.currentTarget.focus({preventScroll:!0});const a=e(r,Z.current);"end"===k?(Q(!0),X(a)):V(a)},onPointerMove:r=>{if($||!(1&r.buttons))return;const a=e(r,Z.current);"end"===k?X(a):V(a)},onPointerUp:r=>{"end"===k&&F&&(Q(!1),V(e(r,Z.current)))}}),ee=_((e,r)=>({...r,...c(e.clientX,e.clientY,e.currentTarget.getBoundingClientRect())})),re=_((e,r)=>({...r,h:u(e.clientX,e.currentTarget.getBoundingClientRect())})),ae=F?t(W):e,ne=e=>`${Math.round(100*e)}%`,oe=(d??[]).map(P),te=n(e),le=ae||J||"";
3
3
  /* @__PURE__ */
4
- return w(a.Provider,{value:!1,children:/* @__PURE__ */x("div",{id:K,className:`flex w-56 flex-col gap-3 ${$?"opacity-60":""} ${L}`.trim(),onKeyDown:e=>{"Escape"===e.key&&B&&(e.preventDefault(),e.stopPropagation(),B())},children:[(oe.length>0||p)&&/* @__PURE__ */x("div",{role:"group","aria-label":H.presets,className:"flex flex-wrap gap-2",children:[p&&/* @__PURE__ */w(h,{content:H.clear,children:/* @__PURE__ */w(z,{color:"",size:"sm","aria-label":H.clear,selected:""===e,disabled:$,onClick:()=>{$||""===e||(J.current="",r(""))}})}),oe.map(e=>{const r=n(e.value),a=e.label?`${e.label} · ${l(r??e.value)}`:l(r??e.value);/* @__PURE__ */
4
+ return w(a.Provider,{value:!1,children:/* @__PURE__ */x("div",{id:E,className:`flex w-56 flex-col gap-3 ${$?"opacity-60":""} ${K}`.trim(),onKeyDown:e=>{"Escape"===e.key&&B&&(e.preventDefault(),e.stopPropagation(),B())},children:[(oe.length>0||p)&&/* @__PURE__ */x("div",{role:"group","aria-label":U.presets,className:"flex flex-wrap gap-2",children:[p&&/* @__PURE__ */w(h,{content:U.clear,children:/* @__PURE__ */w(z,{color:"",size:"sm","aria-label":U.clear,selected:""===e,disabled:$,onClick:()=>{$||""===e||(Y.current="",r(""))}})}),oe.map(e=>{const r=n(e.value),a=e.label?`${e.label} · ${l(r??e.value)}`:l(r??e.value);/* @__PURE__ */
5
5
  return w(h,{content:a,children:/* @__PURE__ */w(z,{color:r??e.value,size:"sm","aria-label":a,selected:null!==r&&r===te,disabled:$,onClick:()=>G(e.value)})},`${e.label??""}:${e.value}`)})]}),
6
- /* @__PURE__ */w("div",{role:"slider",tabIndex:$?-1:0,"aria-label":H.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*Y.v),"aria-valuetext":H.squareValue(Math.round(100*Y.s),Math.round(100*Y.v)),"aria-disabled":$||void 0,"data-color-square":"",onKeyDown:e=>{if($)return;const r=P(Y,e.key,e.shiftKey);r&&(e.preventDefault(),Q(r))},...ee,className:"relative h-36 w-full cursor-crosshair touch-none rounded-md rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundColor:t({h:Y.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */w("span",{"aria-hidden":"true",className:"pointer-events-none absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:ne(Y.s),top:ne(1-Y.v),...M}})}),
7
- /* @__PURE__ */w("div",{role:"slider",tabIndex:$?-1:0,"aria-label":H.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(Y.h),"aria-orientation":"horizontal","aria-disabled":$||void 0,"data-color-hue":"",onKeyDown:e=>{if($)return;const r=A(Y.h,e.key,e.shiftKey);null!==r&&(e.preventDefault(),Q({...Y,h:r}))},...re,className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:i},children:/* @__PURE__ */w("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:Y.h/360*100+"%",background:t({h:Y.h,s:1,v:1}),...M}})}),S&&/* @__PURE__ */w("div",{role:"slider",tabIndex:$?-1:0,"aria-label":H.opacity(s),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":O,"aria-valuetext":`${O}%`,"aria-orientation":"horizontal","aria-disabled":$||void 0,"data-color-opacity":"",onKeyDown:e=>{if($)return;const r=j(O,e.key,e.shiftKey);null!==r&&(e.preventDefault(),R(r))},onPointerDown:e=>{$||0!==e.button||(e.currentTarget.setPointerCapture?.(e.pointerId),e.currentTarget.focus({preventScroll:!0}),R(U(e)))},onPointerMove:e=>{!$&&1&e.buttons&&R(U(e))},className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:`linear-gradient(to right, transparent, ${le||"black"}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`},children:/* @__PURE__ */w("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:`${O}%`,...N(le||"black",O),...M}})}),
6
+ /* @__PURE__ */w("div",{role:"slider",tabIndex:$?-1:0,"aria-label":U.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*W.v),"aria-valuetext":U.squareValue(Math.round(100*W.s),Math.round(100*W.v)),"aria-disabled":$||void 0,"data-color-square":"",onKeyDown:e=>{if($)return;const r=I(W,e.key,e.shiftKey);r&&(e.preventDefault(),V(r))},...ee,className:"relative h-36 w-full cursor-crosshair touch-none rounded-md rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundColor:t({h:W.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */w("span",{"aria-hidden":"true",className:"pointer-events-none absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:ne(W.s),top:ne(1-W.v),...M}})}),
7
+ /* @__PURE__ */w("div",{role:"slider",tabIndex:$?-1:0,"aria-label":U.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(W.h),"aria-orientation":"horizontal","aria-disabled":$||void 0,"data-color-hue":"",onKeyDown:e=>{if($)return;const r=A(W.h,e.key,e.shiftKey);null!==r&&(e.preventDefault(),V({...W,h:r}))},...re,className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:i},children:/* @__PURE__ */w("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:W.h/360*100+"%",background:t({h:W.h,s:1,v:1}),...M}})}),S&&/* @__PURE__ */w("div",{role:"slider",tabIndex:$?-1:0,"aria-label":U.opacity(s),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":R,"aria-valuetext":`${R}%`,"aria-orientation":"horizontal","aria-disabled":$||void 0,"data-color-opacity":"",onKeyDown:e=>{if($)return;const r=j(R,e.key,e.shiftKey);null!==r&&(e.preventDefault(),O(r))},onPointerDown:e=>{$||0!==e.button||(e.currentTarget.setPointerCapture?.(e.pointerId),e.currentTarget.focus({preventScroll:!0}),O(H(e)))},onPointerMove:e=>{!$&&1&e.buttons&&O(H(e))},className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:`linear-gradient(to right, transparent, ${le||"black"}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`},children:/* @__PURE__ */w("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:`${R}%`,...N(le||"black",R),...M}})}),
8
8
  /* @__PURE__ */x("div",{className:"flex items-center gap-2",children:[
9
- /* @__PURE__ */w("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-line-strong",style:N(le,S?O:null)}),
10
- /* @__PURE__ */w(T,{value:ae,placeholder:!e&&W?l(W):void 0,onChange:G,label:H.hex(s),disabled:$}),S&&/* @__PURE__ */w(E,{value:O,onChange:R,label:H.opacity(s),disabled:$})]})]})})}var B={sm:"w-[calc(7ch+1rem+4px)] min-w-[calc(7ch+1rem+4px)]",md:"w-[calc(7ch+1.5rem+4px)] min-w-[calc(7ch+1.5rem+4px)]",lg:"w-[calc(7ch+2rem+4px)] min-w-[calc(7ch+2rem+4px)]"},K={sm:"h-6",md:"h-8",lg:"h-10"},L=["block w-[calc(7ch+0.5rem+4px)] min-w-[calc(7ch+0.5rem+4px)] flex-none rounded-(--radius-control)","border border-transparent bg-transparent px-1 text-2xs font-mono uppercase","text-ink-strong placeholder:text-[color:var(--ink-placeholder)] hover:border-gray-300","focus:border-blue-400 focus:bg-(--surface) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)]","disabled:cursor-not-allowed disabled:opacity-60"].join(" ");function T({value:e,onChange:r,label:a,placeholder:o,disabled:t,id:i,size:c="md",look:u="box",className:h=""}){const[g,p]=b(null),m="text"===u?`${L} ${K[c]} ${h}`.trim():d({size:c,className:`${B[c]} flex-1 font-mono uppercase ${h}`.trim()}).replace(/(^| )w-full( |$)/," ");/* @__PURE__ */
11
- return w("input",{id:i,type:"text",value:g??(e?l(e):""),"aria-label":a,placeholder:o,maxLength:s,spellCheck:!1,autoComplete:"off",disabled:t,onChange:a=>{p(a.target.value);const o=n(a.target.value);null!==o&&o!==e&&r(o)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),p(null))},onBlur:()=>p(null),"data-hex-look":u,className:m})}function E({value:e,onChange:a,label:n,disabled:o,size:t="md"}){/* @__PURE__ */
12
- return w("div",{"data-color-opacity-box":"",className:"w-20 shrink-0",children:/* @__PURE__ */w(r,{value:e,onChange:e=>{null!==e&&a(e)},min:0,max:100,precision:0,suffix:"%",size:t,"aria-label":n,disabled:o})})}function H({value:r,onChange:a,label:o,presets:t,clearable:i,fallback:s,dragWrites:c,disabled:u,id:d,showHexInput:h=!1,opacity:p,onOpacityChange:b,size:m="md",align:f="start",open:k,onOpenChange:y,className:z=""}){const D=g().color,I=C(p),P=v(),A=n(s??""),M=r||A||"",j=r?l(r):A?l(A):D.none;
9
+ /* @__PURE__ */w("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-line-strong",style:N(le,S?R:null)}),
10
+ /* @__PURE__ */w(L,{value:ae,placeholder:!e&&J?l(J):void 0,onChange:G,label:U.hex(s),disabled:$}),S&&/* @__PURE__ */w(T,{value:R,onChange:O,label:U.opacity(s),disabled:$})]})]})})}var B={sm:"w-[calc(7ch+1rem+4px)] min-w-[calc(7ch+1rem+4px)]",md:"w-[calc(7ch+1.5rem+4px)] min-w-[calc(7ch+1.5rem+4px)]",lg:"w-[calc(7ch+2rem+4px)] min-w-[calc(7ch+2rem+4px)]"},E={sm:"h-6",md:"h-8",lg:"h-10"},K=["block w-[calc(7ch+0.5rem+4px)] min-w-[calc(7ch+0.5rem+4px)] flex-none rounded-(--radius-control)","border border-transparent bg-transparent px-1 text-2xs font-mono uppercase","text-ink-strong placeholder:text-[color:var(--ink-placeholder)] hover:border-gray-300","focus:border-blue-400 focus:bg-(--surface) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)]","disabled:cursor-not-allowed disabled:opacity-60"].join(" ");function L({value:e,onChange:r,label:a,placeholder:o,disabled:t,id:i,size:c="md",look:u="box",className:h=""}){const[g,p]=b(null),m="text"===u?`${K} ${E[c]} ${h}`.trim():d({size:c,className:`${B[c]} flex-1 font-mono uppercase ${h}`.trim()}).replace(/(^| )w-full( |$)/," ");/* @__PURE__ */
11
+ return w("input",{id:i,type:"text",value:g??(e?l(e):""),"aria-label":a,placeholder:o,maxLength:s,spellCheck:!1,autoComplete:"off",disabled:t,onChange:a=>{p(a.target.value);const o=n(a.target.value);null!==o&&o!==e&&r(o)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),p(null))},onBlur:()=>p(null),"data-hex-look":u,className:m})}function T({value:e,onChange:a,label:n,disabled:o,size:t="md"}){/* @__PURE__ */
12
+ return w("div",{"data-color-opacity-box":"",className:"w-20 shrink-0",children:/* @__PURE__ */w(r,{value:e,onChange:e=>{null!==e&&a(e)},min:0,max:100,precision:0,suffix:"%",size:t,"aria-label":n,disabled:o})})}function U({value:r,onChange:a,label:o,presets:t,clearable:i,fallback:s,dragWrites:c,disabled:u,id:d,showHexInput:h=!1,opacity:p,onOpacityChange:b,size:m="md",align:f="start",open:k,onOpenChange:y,className:z=""}){const D=g().color,P=C(p),I=v(),A=n(s??""),M=r||A||"",j=r?l(r):A?l(A):D.none;
13
13
  /* @__PURE__ */
14
14
  return x("div",{className:`inline-flex items-center ${b?"flex-wrap justify-end gap-1":h?"gap-1":"gap-2"} ${z}`.trim(),children:[
15
- /* @__PURE__ */w(e,{id:d,trigger:/* @__PURE__ */w("span",{"aria-hidden":"true",className:"absolute inset-0",style:N(M,b?I:null)}),triggerLabel:D.swatch(o,j),triggerClassName:$({size:m}),"aria-label":D.panel(o),align:f,open:k,onOpenChange:y,disabled:u,children:/* @__PURE__ */w(S,{id:P,value:r,onChange:a,label:o,presets:t,clearable:i,fallback:s,dragWrites:c,disabled:u,opacity:p,onOpacityChange:b})}),h&&
16
- /* @__PURE__ */w(T,{value:r,placeholder:!r&&A?l(A):void 0,onChange:e=>{u||e===r||a(e)},label:D.hex(o),disabled:u,size:m,look:"text"}),b&&/* @__PURE__ */w(E,{value:I,onChange:e=>{u||e===I||b(e)},label:D.opacity(o),disabled:u,size:m})]})}export{H as ColorPicker,S as ColorPickerPanel,z as ColorSwatch,T as HexInput,y as NO_COLOR_FILL,C as clampOpacity,N as colorFill,$ as colorSwatchClasses,A as stepHue,j as stepOpacity,P as stepSquare};
15
+ /* @__PURE__ */w(e,{id:d,trigger:/* @__PURE__ */w("span",{"aria-hidden":"true",className:"absolute inset-0",style:N(M,b?P:null)}),triggerLabel:D.swatch(o,j),triggerClassName:$({size:m}),"aria-label":D.panel(o),align:f,open:k,onOpenChange:y,disabled:u,children:/* @__PURE__ */w(S,{id:I,value:r,onChange:a,label:o,presets:t,clearable:i,fallback:s,dragWrites:c,disabled:u,opacity:p,onOpacityChange:b})}),h&&
16
+ /* @__PURE__ */w(L,{value:r,placeholder:!r&&A?l(A):void 0,onChange:e=>{u||e===r||a(e)},label:D.hex(o),disabled:u,size:m,look:"text"}),b&&/* @__PURE__ */w(T,{value:P,onChange:e=>{u||e===P||b(e)},label:D.opacity(o),disabled:u,size:m})]})}export{U as ColorPicker,S as ColorPickerPanel,z as ColorSwatch,L as HexInput,y as NO_COLOR_FILL,C as clampOpacity,N as colorFill,$ as colorSwatchClasses,A as stepHue,j as stepOpacity,I as stepSquare};
@@ -1,11 +1,11 @@
1
- import{arcPath as e}from"./chunk-VFC6QUEN.js";import{MOTION as t,stagger as a}from"./chunk-465RRWBY.js";import{useHighlight as l}from"./chunk-CNYAHYE6.js";import{ChartTooltip as r}from"./chunk-TLRCTNUF.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{resolveSeriesColor as o,CHART_INK as i}from"./chunk-TZFACUMR.js";import{useShellStrings as s,useShellLocale as c}from"./chunk-QWHQJNKL.js";import{formatPlain as m}from"./chunk-C3QOHMR6.js";import{useId as h,useState as u}from"react";import{jsx as p,jsxs as d}from"react/jsx-runtime";var f=300*Math.PI/180;function g({rows:g,variant:k="track",size:v=300,max:x,formatValue:y,animate:M=!0,className:N,emptyLabel:b,trackGap:j=6}){const C=s().charts,w=c(),R=y??(e=>m(e,w)),T=b??C.nothingToPlot,E=h(),[L,P]=u(null),{highlighted:Q}=l();if(0===g.length)/* @__PURE__ */return p("p",{className:`text-sm text-gray-500 ${N??""}`,children:T});const U=v/2,$=v/2,F=v/2-10,H=x??Math.max(...g.map(e=>e.value),1),W="track"===k?Math.max(6,(F-.16*v)/g.length):0,Y=Math.max(1,Math.floor((F-.16*v)/W||1)),z="track"===k?g.slice(0,Y):g,A=Math.min(j,Math.max(1,W-2)),B=n(z.length,.03),I=null!==L?z[L]:void 0;/* @__PURE__ */
1
+ import{arcPath as e}from"./chunk-VFC6QUEN.js";import{MOTION as t,stagger as a}from"./chunk-465RRWBY.js";import{useHighlight as l}from"./chunk-CNYAHYE6.js";import{ChartTooltip as r}from"./chunk-TLRCTNUF.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{resolveSeriesColor as o,CHART_INK as i}from"./chunk-TZFACUMR.js";import{useShellStrings as s,useShellLocale as c}from"./chunk-PEM7UXQ3.js";import{formatPlain as m}from"./chunk-C3QOHMR6.js";import{useId as h,useState as u}from"react";import{jsx as p,jsxs as d}from"react/jsx-runtime";var f=300*Math.PI/180;function g({rows:g,variant:k="track",size:v=300,max:x,formatValue:y,animate:M=!0,className:N,emptyLabel:b,trackGap:j=6}){const C=s().charts,w=c(),R=y??(e=>m(e,w)),T=b??C.nothingToPlot,E=h(),[P,U]=u(null),{highlighted:$}=l();if(0===g.length)/* @__PURE__ */return p("p",{className:`text-sm text-gray-500 ${N??""}`,children:T});const F=v/2,L=v/2,Q=v/2-10,Y=x??Math.max(...g.map(e=>e.value),1),z="track"===k?Math.max(6,(Q-.16*v)/g.length):0,A=Math.max(1,Math.floor((Q-.16*v)/z||1)),B="track"===k?g.slice(0,A):g,H=Math.min(j,Math.max(1,z-2)),I=n(B.length,.03),V=null!==P?B[P]:void 0;/* @__PURE__ */
2
2
  return d("div",{className:`relative ${N??""}`,children:[
3
- /* @__PURE__ */d("svg",{width:"100%",height:v,viewBox:`0 0 ${v} ${v}`,role:"img","aria-labelledby":E,onMouseLeave:()=>P(null),children:[
4
- /* @__PURE__ */p("title",{id:E,children:"track"===k?C.radialTrack(z.length):C.radialCycle(z.length)}),z.map((l,r)=>{const n=o(r,l.color,l.tone),s=Math.max(0,Math.min(1,l.value/H)),c=((e,t)=>null!==L?L!==e:null!==Q&&Q!==t)(r,l.key);if("track"===k){const o=F-r*W,m=o-W+A,h=-Math.PI/2;/* @__PURE__ */
5
- return d("g",{opacity:c?.4:1,onMouseEnter:()=>P(r),className:M?t.sweep:void 0,style:M?a(r,70):void 0,children:[
6
- /* @__PURE__ */p("path",{d:e(U,$,m,o,h,h+f),fill:i.grid}),
7
- /* @__PURE__ */p("path",{d:e(U,$,m,o,h,h+f*s),fill:n})]},l.key)}const m=.14*v;/* @__PURE__ */
8
- return p("g",{opacity:c?.4:1,onMouseEnter:()=>P(r),children:/* @__PURE__ */p("path",{d:e(U,$,m,m+(F-m)*s,B(r),B(r)+B.step),fill:n})},l.key)})]}),I&&null!==L&&/* @__PURE__ */p("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */p(r,{title:I.label,rows:[{key:"value",label:C.value,color:o(L,I.color,I.tone),value:R(I.value)}]})}),
3
+ /* @__PURE__ */d("svg",{width:"100%",height:v,viewBox:`0 0 ${v} ${v}`,role:"img","aria-labelledby":E,onMouseLeave:()=>U(null),children:[
4
+ /* @__PURE__ */p("title",{id:E,children:"track"===k?C.radialTrack(B.length):C.radialCycle(B.length)}),B.map((l,r)=>{const n=o(r,l.color,l.tone),s=Math.max(0,Math.min(1,l.value/Y)),c=((e,t)=>null!==P?P!==e:null!==$&&$!==t)(r,l.key);if("track"===k){const o=Q-r*z,m=o-z+H,h=-Math.PI/2;/* @__PURE__ */
5
+ return d("g",{opacity:c?.4:1,onMouseEnter:()=>U(r),className:M?t.sweep:void 0,style:M?a(r,70):void 0,children:[
6
+ /* @__PURE__ */p("path",{d:e(F,L,m,o,h,h+f),fill:i.grid}),
7
+ /* @__PURE__ */p("path",{d:e(F,L,m,o,h,h+f*s),fill:n})]},l.key)}const m=.14*v;/* @__PURE__ */
8
+ return p("g",{opacity:c?.4:1,onMouseEnter:()=>U(r),children:/* @__PURE__ */p("path",{d:e(F,L,m,m+(Q-m)*s,I(r),I(r)+I.step),fill:n})},l.key)})]}),V&&null!==P&&/* @__PURE__ */p("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */p(r,{title:V.label,rows:[{key:"value",label:C.value,color:o(P,V.color,V.tone),value:R(V.value)}]})}),
9
9
  /* @__PURE__ */p("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(150px,1fr))"},children:g.map((e,t)=>/* @__PURE__ */d("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
10
10
  /* @__PURE__ */p("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:o(t,e.color,e.tone)}}),
11
11
  /* @__PURE__ */p("span",{className:"flex-1 truncate",children:e.label}),
@@ -1,54 +1,54 @@
1
- import{toast_default as e}from"./chunk-XD34TCRG.js";import{useShellStrings as t}from"./chunk-QWHQJNKL.js";import{forwardRef as n,useRef as r,useState as o,useMemo as i,useEffect as a,useImperativeHandle as l}from"react";import{jsx as c,jsxs as s,Fragment as d}from"react/jsx-runtime";var u=["#ef4444","#f97316","#eab308","#22c55e","#3b82f6","#8b5cf6","#000000","#ffffff"],h=[{id:"system",name:"fontSystem",css:"-apple-system, system-ui, sans-serif"},{id:"serif",name:"fontSerif",css:'Georgia, "Times New Roman", serif'},{id:"mono",name:"fontMono",css:'ui-monospace, "SF Mono", Menlo, monospace'},{id:"cursive",name:"fontCursive",css:'"Brush Script MT", "Comic Sans MS", cursive'}],p=()=>Math.random().toString(36).slice(2,9),x=n(function({src:n,filename:x,onApply:m,onCancel:g},N){const L=r(null),z=r(null),D=r(null),P=r(null),$=t().annotator,E=r($);E.current=$;const[I,W]=o("select"),[S,B]=o(u[0]),[R,j]=o(4),[H,T]=o(24),[F,U]=o(h[0].id),[A,O]=o(!0),[K,V]=o(!1),[X,Z]=o(!1),[G,q]=o(null),[Q,Y]=o(null),[_,J]=o(6),[ee,te]=o(12),[ne,re]=o([]),[oe,ie]=o(null),[ae,le]=o(null),[ce,se]=o(null),[de,ue]=o(1),[he,pe]=o(null),[xe,ye]=o(null),[me,ge]=o(null),fe=r(null),[we,be]=o(!1),ve=i(()=>ce?{w:ce.w*de,h:ce.h*de}:null,[ce,de]),ke=ve&&ae?ve.w/ae.w:1,Me=i(()=>ne.find(e=>e.id===oe)??null,[ne,oe]);a(()=>{"select"===I&&Me&&("color"in Me&&B(Me.color),"stroke"in Me&&j(Me.stroke),"rect"===Me.type&&te(Me.radius),"text"===Me.type&&(T(Me.size),U(Me.font),O(Me.bold),V(Me.italic),Z(Me.underline),q(Me.borderColor),Y(Me.background),J(Me.padding)))},[oe]),a(()=>{const t=new Image;t.crossOrigin="anonymous",t.onload=()=>{P.current=t,le({w:t.naturalWidth,h:t.naturalHeight}),re([]),ie(null)},t.onerror=()=>e.error(E.current.loadFailed),t.src=n},[n]),a(()=>{if(!ae)return;const e=()=>{const e=L.current;if(!e)return;const t=e.getBoundingClientRect(),n=Math.max(0,t.width-32),r=Math.max(0,t.height-32);if(0===n||0===r)return;const o=ae.w/ae.h;let i=ae.w,a=ae.h;i>n&&(i=n,a=i/o),a>r&&(a=r,i=a*o),se({w:i,h:a})};e();const t=new ResizeObserver(e);return L.current&&t.observe(L.current),()=>t.disconnect()},[ae]);const Ne=i(()=>ne.filter(e=>"mosaic"===e.type),[ne]);a(()=>{const e=P.current,t=z.current;if(!e||!t||!ae)return;t.width=ae.w,t.height=ae.h;const n=t.getContext("2d");n.drawImage(e,0,0);for(const e of Ne)C(n,e)},[ae,Ne,ce]);const Ce=e=>{const t=D.current;if(!t)return{x:0,y:0};const n=t.createSVGPoint();n.x=e.clientX,n.y=e.clientY;const r=t.getScreenCTM();if(!r)return{x:0,y:0};const o=n.matrixTransform(r.inverse());return{x:o.x,y:o.y}},Le=e=>{fe.current=e,be(!0)};a(()=>{if(!we)return;const e=e=>{const t=fe.current;if(!t)return;const n=Ce(e);if("draw"===t.kind)pe(b(I,t.start,n,S,R,ee));else if("pen"===t.kind){const e=t.points[t.points.length-1];(Math.abs(n.x-e.x)>1||Math.abs(n.y-e.y)>1)&&(t.points.push(n),pe({id:"",type:"draw",points:t.points.slice(),color:S,stroke:R}))}else if("crop"===t.kind)ge(M(t.start,n));else if("move"===t.kind){const e=n.x-t.start.x,r=n.y-t.start.y;re(n=>n.map(n=>n.id===t.id?v(t.original,e,r):n))}else"resize"===t.kind&&re(e=>e.map(e=>e.id===t.id?function(e,t,n){if("arrow"===e.type)return"start"===t?{...e,x1:n.x,y1:n.y}:"end"===t?{...e,x2:n.x,y2:n.y}:e;if("text"===e.type||"draw"===e.type)return e;const r=e.x,o=e.x+e.w,i=e.y,a=e.y+e.h;let l=r,c=i,s=o,d=a;"nw"===t&&(l=n.x,c=n.y);"ne"===t&&(s=n.x,c=n.y);"se"===t&&(s=n.x,d=n.y);"sw"===t&&(l=n.x,d=n.y);const u=M({x:l,y:c},{x:s,y:d});return{...e,x:u.x,y:u.y,w:u.w,h:u.h}}(t.original,t.corner,n):e))},t=()=>{const e=fe.current;if(fe.current=null,be(!1),"draw"===e?.kind)pe(e=>{if(!e||("arrow"===(t=e).type?Math.abs(t.x2-t.x1)<4&&Math.abs(t.y2-t.y1)<4:"draw"===t.type?t.points.length<2:"w"in t&&"h"in t&&(t.w<4||t.h<4)))return null;var t;const n={...e,id:p()};return re(e=>[...e,n]),ie(n.id),W("select"),null});else if("pen"===e?.kind){if(e.points.length<2)return void pe(null);const t={id:p(),type:"draw",points:e.points,color:S,stroke:R};re(e=>[...e,t]),ie(t.id),W("select"),pe(null)}};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[we,I,S,R,ee]);a(()=>{const e=e=>{if(!document.activeElement||!/^(INPUT|TEXTAREA)$/.test(document.activeElement.tagName))return!e.metaKey&&!e.ctrlKey||"z"!==e.key&&"Z"!==e.key||e.shiftKey?void(oe&&("Delete"===e.key||"Backspace"===e.key?(e.preventDefault(),re(e=>e.filter(e=>e.id!==oe)),ie(null)):"Escape"===e.key&&ie(null))):(e.preventDefault(),re(e=>e.slice(0,-1)),void ie(null))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[oe]);const ze=e=>{const t=!{bold:A,italic:K,underline:X}[e];"bold"===e&&O(t),"italic"===e&&V(t),"underline"===e&&Z(t),oe&&re(n=>n.map(n=>n.id===oe&&"text"===n.type?{...n,[e]:t}:n))},De=e=>{q(e),oe&&re(t=>t.map(t=>t.id===oe&&"text"===t.type?{...t,borderColor:e}:t))},Pe=e=>{Y(e),oe&&re(t=>t.map(t=>t.id===oe&&"text"===t.type?{...t,background:e}:t))},$e=e=>{if(!xe)return;const t=e??xe.value;if(!t.trim())return xe.editingId&&re(e=>e.filter(e=>e.id!==xe.editingId)),void ye(null);if(xe.editingId)re(e=>e.map(e=>e.id===xe.editingId&&"text"===e.type?{...e,text:t}:e));else{const e={id:p(),type:"text",x:xe.x,y:xe.y,text:t,color:S,size:H,font:F,bold:A,italic:K,underline:X,borderColor:G,background:Q,padding:_};re(t=>[...t,e]),ie(e.id),W("select")}ye(null)},Ee=async()=>{const e=z.current,t=D.current;if(!e||!t||!ae)return null;const n=document.createElement("canvas");n.width=ae.w,n.height=ae.h;const r=n.getContext("2d");r.drawImage(e,0,0);const o=t.cloneNode(!0);o.querySelectorAll("[data-chrome]").forEach(e=>e.remove());const i=(new XMLSerializer).serializeToString(o),a=new Blob([i],{type:"image/svg+xml;charset=utf-8"}),l=URL.createObjectURL(a),c=new Image;return await new Promise(e=>{c.onload=()=>e(),c.onerror=()=>e(),c.src=l}),r.drawImage(c,0,0,ae.w,ae.h),URL.revokeObjectURL(l),n};l(N,()=>({save:async()=>{const t=await Ee();t&&t.toBlob(t=>{if(!t)return void e.error(E.current.exportFailed);const n=URL.createObjectURL(t),r=document.createElement("a");r.href=n;const o=x.replace(/\.[^.]+$/,"");r.download=`${o}-annotated.png`,r.click(),URL.revokeObjectURL(n)},"image/png")},copy:async()=>{if(!("clipboard"in navigator)||"undefined"==typeof ClipboardItem)return void e.error(E.current.clipboardUnsupported);const t=await Ee();t&&t.toBlob(async t=>{if(t)try{await navigator.clipboard.write([new ClipboardItem({"image/png":t})]),e.success(E.current.copied)}catch{e.error(E.current.copyRefused)}else e.error(E.current.copyFailed)},"image/png")}}),[ae,x]);const Ie=i(()=>[{id:"select",label:$.toolSelect,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3l7 17 2-7 7-2L5 3z"})})},{id:"draw",label:$.toolDraw,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L6.832 19.82a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.863 4.487z"})})},{id:"rect",label:$.toolRect,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("rect",{x:"4",y:"6",width:"16",height:"12",rx:"3"})})},{id:"circle",label:$.toolEllipse,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("ellipse",{cx:"12",cy:"12",rx:"8",ry:"6"})})},{id:"arrow",label:$.toolArrow,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 19L19 5m0 0h-7m7 0v7"})})},{id:"mosaic",label:$.toolMosaic,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z"})})},{id:"text",label:$.toolText,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M12 6v14M9 20h6"})})},{id:"crop",label:$.toolCrop,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 2v15a1 1 0 001 1h15M2 6h15a1 1 0 011 1v15"})})}],[$]),We=e=>"p-2 rounded transition-colors "+(e?"bg-blue-500 text-on-accent":"text-ink hover:bg-gray-200"),Se=Me?.type??("select"===I?null:I),Be="rect"===Se||"circle"===Se||"arrow"===Se||"draw"===Se,Re="rect"===Se,je="text"===Se;/* @__PURE__ */
1
+ import{toast_default as e}from"./chunk-4XZXY2AF.js";import{useShellStrings as t}from"./chunk-PEM7UXQ3.js";import{forwardRef as n,useRef as r,useState as o,useMemo as i,useEffect as a,useImperativeHandle as l}from"react";import{jsx as c,jsxs as s,Fragment as d}from"react/jsx-runtime";var u=["#ef4444","#f97316","#eab308","#22c55e","#3b82f6","#8b5cf6","#000000","#ffffff"],h=[{id:"system",name:"fontSystem",css:"-apple-system, system-ui, sans-serif"},{id:"serif",name:"fontSerif",css:'Georgia, "Times New Roman", serif'},{id:"mono",name:"fontMono",css:'ui-monospace, "SF Mono", Menlo, monospace'},{id:"cursive",name:"fontCursive",css:'"Brush Script MT", "Comic Sans MS", cursive'}],p=()=>Math.random().toString(36).slice(2,9),x=n(function({src:n,filename:x,onApply:m,onCancel:g},N){const L=r(null),z=r(null),D=r(null),P=r(null),E=t().annotator,$=r(E);$.current=E;const[I,S]=o("select"),[W,B]=o(u[0]),[R,j]=o(4),[F,H]=o(24),[T,U]=o(h[0].id),[A,O]=o(!0),[X,K]=o(!1),[Z,V]=o(!1),[Y,q]=o(null),[G,_]=o(null),[Q,J]=o(6),[ee,te]=o(12),[ne,re]=o([]),[oe,ie]=o(null),[ae,le]=o(null),[ce,se]=o(null),[de,ue]=o(1),[he,pe]=o(null),[xe,ye]=o(null),[me,ge]=o(null),fe=r(null),[we,be]=o(!1),ve=i(()=>ce?{w:ce.w*de,h:ce.h*de}:null,[ce,de]),ke=ve&&ae?ve.w/ae.w:1,Me=i(()=>ne.find(e=>e.id===oe)??null,[ne,oe]);a(()=>{"select"===I&&Me&&("color"in Me&&B(Me.color),"stroke"in Me&&j(Me.stroke),"rect"===Me.type&&te(Me.radius),"text"===Me.type&&(H(Me.size),U(Me.font),O(Me.bold),K(Me.italic),V(Me.underline),q(Me.borderColor),_(Me.background),J(Me.padding)))},[oe]),a(()=>{const t=new Image;t.crossOrigin="anonymous",t.onload=()=>{P.current=t,le({w:t.naturalWidth,h:t.naturalHeight}),re([]),ie(null)},t.onerror=()=>e.error($.current.loadFailed),t.src=n},[n]),a(()=>{if(!ae)return;const e=()=>{const e=L.current;if(!e)return;const t=e.getBoundingClientRect(),n=Math.max(0,t.width-32),r=Math.max(0,t.height-32);if(0===n||0===r)return;const o=ae.w/ae.h;let i=ae.w,a=ae.h;i>n&&(i=n,a=i/o),a>r&&(a=r,i=a*o),se({w:i,h:a})};e();const t=new ResizeObserver(e);return L.current&&t.observe(L.current),()=>t.disconnect()},[ae]);const Ne=i(()=>ne.filter(e=>"mosaic"===e.type),[ne]);a(()=>{const e=P.current,t=z.current;if(!e||!t||!ae)return;t.width=ae.w,t.height=ae.h;const n=t.getContext("2d");n.drawImage(e,0,0);for(const e of Ne)C(n,e)},[ae,Ne,ce]);const Ce=e=>{const t=D.current;if(!t)return{x:0,y:0};const n=t.createSVGPoint();n.x=e.clientX,n.y=e.clientY;const r=t.getScreenCTM();if(!r)return{x:0,y:0};const o=n.matrixTransform(r.inverse());return{x:o.x,y:o.y}},Le=e=>{fe.current=e,be(!0)};a(()=>{if(!we)return;const e=e=>{const t=fe.current;if(!t)return;const n=Ce(e);if("draw"===t.kind)pe(b(I,t.start,n,W,R,ee));else if("pen"===t.kind){const e=t.points[t.points.length-1];(Math.abs(n.x-e.x)>1||Math.abs(n.y-e.y)>1)&&(t.points.push(n),pe({id:"",type:"draw",points:t.points.slice(),color:W,stroke:R}))}else if("crop"===t.kind)ge(M(t.start,n));else if("move"===t.kind){const e=n.x-t.start.x,r=n.y-t.start.y;re(n=>n.map(n=>n.id===t.id?v(t.original,e,r):n))}else"resize"===t.kind&&re(e=>e.map(e=>e.id===t.id?function(e,t,n){if("arrow"===e.type)return"start"===t?{...e,x1:n.x,y1:n.y}:"end"===t?{...e,x2:n.x,y2:n.y}:e;if("text"===e.type||"draw"===e.type)return e;const r=e.x,o=e.x+e.w,i=e.y,a=e.y+e.h;let l=r,c=i,s=o,d=a;"nw"===t&&(l=n.x,c=n.y);"ne"===t&&(s=n.x,c=n.y);"se"===t&&(s=n.x,d=n.y);"sw"===t&&(l=n.x,d=n.y);const u=M({x:l,y:c},{x:s,y:d});return{...e,x:u.x,y:u.y,w:u.w,h:u.h}}(t.original,t.corner,n):e))},t=()=>{const e=fe.current;if(fe.current=null,be(!1),"draw"===e?.kind)pe(e=>{if(!e||("arrow"===(t=e).type?Math.abs(t.x2-t.x1)<4&&Math.abs(t.y2-t.y1)<4:"draw"===t.type?t.points.length<2:"w"in t&&"h"in t&&(t.w<4||t.h<4)))return null;var t;const n={...e,id:p()};return re(e=>[...e,n]),ie(n.id),S("select"),null});else if("pen"===e?.kind){if(e.points.length<2)return void pe(null);const t={id:p(),type:"draw",points:e.points,color:W,stroke:R};re(e=>[...e,t]),ie(t.id),S("select"),pe(null)}};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[we,I,W,R,ee]);a(()=>{const e=e=>{if(!document.activeElement||!/^(INPUT|TEXTAREA)$/.test(document.activeElement.tagName))return!e.metaKey&&!e.ctrlKey||"z"!==e.key&&"Z"!==e.key||e.shiftKey?void(oe&&("Delete"===e.key||"Backspace"===e.key?(e.preventDefault(),re(e=>e.filter(e=>e.id!==oe)),ie(null)):"Escape"===e.key&&ie(null))):(e.preventDefault(),re(e=>e.slice(0,-1)),void ie(null))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[oe]);const ze=e=>{const t=!{bold:A,italic:X,underline:Z}[e];"bold"===e&&O(t),"italic"===e&&K(t),"underline"===e&&V(t),oe&&re(n=>n.map(n=>n.id===oe&&"text"===n.type?{...n,[e]:t}:n))},De=e=>{q(e),oe&&re(t=>t.map(t=>t.id===oe&&"text"===t.type?{...t,borderColor:e}:t))},Pe=e=>{_(e),oe&&re(t=>t.map(t=>t.id===oe&&"text"===t.type?{...t,background:e}:t))},Ee=e=>{if(!xe)return;const t=e??xe.value;if(!t.trim())return xe.editingId&&re(e=>e.filter(e=>e.id!==xe.editingId)),void ye(null);if(xe.editingId)re(e=>e.map(e=>e.id===xe.editingId&&"text"===e.type?{...e,text:t}:e));else{const e={id:p(),type:"text",x:xe.x,y:xe.y,text:t,color:W,size:F,font:T,bold:A,italic:X,underline:Z,borderColor:Y,background:G,padding:Q};re(t=>[...t,e]),ie(e.id),S("select")}ye(null)},$e=async()=>{const e=z.current,t=D.current;if(!e||!t||!ae)return null;const n=document.createElement("canvas");n.width=ae.w,n.height=ae.h;const r=n.getContext("2d");r.drawImage(e,0,0);const o=t.cloneNode(!0);o.querySelectorAll("[data-chrome]").forEach(e=>e.remove());const i=(new XMLSerializer).serializeToString(o),a=new Blob([i],{type:"image/svg+xml;charset=utf-8"}),l=URL.createObjectURL(a),c=new Image;return await new Promise(e=>{c.onload=()=>e(),c.onerror=()=>e(),c.src=l}),r.drawImage(c,0,0,ae.w,ae.h),URL.revokeObjectURL(l),n};l(N,()=>({save:async()=>{const t=await $e();t&&t.toBlob(t=>{if(!t)return void e.error($.current.exportFailed);const n=URL.createObjectURL(t),r=document.createElement("a");r.href=n;const o=x.replace(/\.[^.]+$/,"");r.download=`${o}-annotated.png`,r.click(),URL.revokeObjectURL(n)},"image/png")},copy:async()=>{if(!("clipboard"in navigator)||"undefined"==typeof ClipboardItem)return void e.error($.current.clipboardUnsupported);const t=await $e();t&&t.toBlob(async t=>{if(t)try{await navigator.clipboard.write([new ClipboardItem({"image/png":t})]),e.success($.current.copied)}catch{e.error($.current.copyRefused)}else e.error($.current.copyFailed)},"image/png")}}),[ae,x]);const Ie=i(()=>[{id:"select",label:E.toolSelect,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3l7 17 2-7 7-2L5 3z"})})},{id:"draw",label:E.toolDraw,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L6.832 19.82a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.863 4.487z"})})},{id:"rect",label:E.toolRect,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("rect",{x:"4",y:"6",width:"16",height:"12",rx:"3"})})},{id:"circle",label:E.toolEllipse,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("ellipse",{cx:"12",cy:"12",rx:"8",ry:"6"})})},{id:"arrow",label:E.toolArrow,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 19L19 5m0 0h-7m7 0v7"})})},{id:"mosaic",label:E.toolMosaic,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z"})})},{id:"text",label:E.toolText,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M12 6v14M9 20h6"})})},{id:"crop",label:E.toolCrop,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 2v15a1 1 0 001 1h15M2 6h15a1 1 0 011 1v15"})})}],[E]),Se=e=>"p-2 rounded transition-colors "+(e?"bg-blue-500 text-on-accent":"text-ink hover:bg-gray-200"),We=Me?.type??("select"===I?null:I),Be="rect"===We||"circle"===We||"arrow"===We||"draw"===We,Re="rect"===We,je="text"===We;/* @__PURE__ */
2
2
  return s("div",{className:"flex flex-col h-full bg-gray-100",children:[
3
- /* @__PURE__ */s("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-line bg-surface shrink-0 flex-wrap text-xs",children:[Ie.map(e=>/* @__PURE__ */c("button",{onClick:()=>{W(e.id),ie(null)},title:e.label,className:We(I===e.id),children:e.icon},e.id)),
3
+ /* @__PURE__ */s("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-line bg-surface shrink-0 flex-wrap text-xs",children:[Ie.map(e=>/* @__PURE__ */c("button",{onClick:()=>{S(e.id),ie(null)},title:e.label,className:Se(I===e.id),children:e.icon},e.id)),
4
4
  /* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
5
- /* @__PURE__ */c("div",{className:"flex items-center gap-1",children:u.map(e=>/* @__PURE__ */c("button",{onClick:()=>(e=>{B(e),oe&&re(t=>t.map(t=>t.id!==oe||"mosaic"===t.type?t:{...t,color:e}))})(e),title:e,className:"h-5 w-5 rounded-full border "+(S===e?"ring-2 ring-blue-500 ring-offset-1":"border-gray-300"),style:{background:e}},e))}),Be&&/* @__PURE__ */s(d,{children:[
5
+ /* @__PURE__ */c("div",{className:"flex items-center gap-1",children:u.map(e=>/* @__PURE__ */c("button",{onClick:()=>(e=>{B(e),oe&&re(t=>t.map(t=>t.id!==oe||"mosaic"===t.type?t:{...t,color:e}))})(e),title:e,className:"h-5 w-5 rounded-full border "+(W===e?"ring-2 ring-blue-500 ring-offset-1":"border-gray-300"),style:{background:e}},e))}),Be&&/* @__PURE__ */s(d,{children:[
6
6
  /* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
7
7
  /* @__PURE__ */s("label",{className:"flex items-center gap-2 text-gray-600",children:[
8
- /* @__PURE__ */c("span",{children:$.weight}),
8
+ /* @__PURE__ */c("span",{children:E.weight}),
9
9
  /* @__PURE__ */c("input",{type:"range",min:1,max:20,step:1,value:R,onChange:e=>{return t=Number(e.target.value),j(t),void(oe&&re(e=>e.map(e=>e.id!==oe?e:"rect"===e.type||"circle"===e.type||"arrow"===e.type||"draw"===e.type?{...e,stroke:t}:e)));var t},className:"w-16 accent-blue-500"}),
10
10
  /* @__PURE__ */c("span",{className:"tabular-nums w-5 text-right",children:R})]})]}),Re&&/* @__PURE__ */s(d,{children:[
11
11
  /* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
12
12
  /* @__PURE__ */s("label",{className:"flex items-center gap-2 text-gray-600",children:[
13
- /* @__PURE__ */c("span",{children:$.radius}),
13
+ /* @__PURE__ */c("span",{children:E.radius}),
14
14
  /* @__PURE__ */c("input",{type:"range",min:0,max:48,step:1,value:ee,onChange:e=>{return t=Number(e.target.value),te(t),void(oe&&re(e=>e.map(e=>e.id===oe&&"rect"===e.type?{...e,radius:t}:e)));var t},className:"w-16 accent-blue-500"}),
15
15
  /* @__PURE__ */c("span",{className:"tabular-nums w-6 text-right",children:ee})]})]}),je&&/* @__PURE__ */s(d,{children:[
16
16
  /* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
17
- /* @__PURE__ */c("select",{value:F,onChange:e=>{return t=e.target.value,U(t),void(oe&&re(e=>e.map(e=>e.id===oe&&"text"===e.type?{...e,font:t}:e)));var t},className:"text-xs border border-gray-300 rounded px-1 py-0.5 bg-white",children:h.map(e=>/* @__PURE__ */c("option",{value:e.id,children:$[e.name]},e.id))}),
18
- /* @__PURE__ */c("button",{onClick:()=>ze("bold"),className:We(A),title:$.bold,children:/* @__PURE__ */c("span",{className:"font-bold",children:$.boldLetter})}),
19
- /* @__PURE__ */c("button",{onClick:()=>ze("italic"),className:We(K),title:$.italic,children:/* @__PURE__ */c("span",{className:"italic",children:$.italicLetter})}),
20
- /* @__PURE__ */c("button",{onClick:()=>ze("underline"),className:We(X),title:$.underline,children:/* @__PURE__ */c("span",{className:"underline",children:$.underlineLetter})}),
17
+ /* @__PURE__ */c("select",{value:T,onChange:e=>{return t=e.target.value,U(t),void(oe&&re(e=>e.map(e=>e.id===oe&&"text"===e.type?{...e,font:t}:e)));var t},className:"text-xs border border-gray-300 rounded px-1 py-0.5 bg-white",children:h.map(e=>/* @__PURE__ */c("option",{value:e.id,children:E[e.name]},e.id))}),
18
+ /* @__PURE__ */c("button",{onClick:()=>ze("bold"),className:Se(A),title:E.bold,children:/* @__PURE__ */c("span",{className:"font-bold",children:E.boldLetter})}),
19
+ /* @__PURE__ */c("button",{onClick:()=>ze("italic"),className:Se(X),title:E.italic,children:/* @__PURE__ */c("span",{className:"italic",children:E.italicLetter})}),
20
+ /* @__PURE__ */c("button",{onClick:()=>ze("underline"),className:Se(Z),title:E.underline,children:/* @__PURE__ */c("span",{className:"underline",children:E.underlineLetter})}),
21
21
  /* @__PURE__ */s("label",{className:"flex items-center gap-2 text-gray-600",children:[
22
- /* @__PURE__ */c("span",{children:$.size}),
23
- /* @__PURE__ */c("input",{type:"range",min:10,max:96,step:1,value:H,onChange:e=>{return t=Number(e.target.value),T(t),void(oe&&re(e=>e.map(e=>e.id===oe&&"text"===e.type?{...e,size:t}:e)));var t},className:"w-16 accent-blue-500"}),
24
- /* @__PURE__ */c("span",{className:"tabular-nums w-7 text-right",children:H})]}),
22
+ /* @__PURE__ */c("span",{children:E.size}),
23
+ /* @__PURE__ */c("input",{type:"range",min:10,max:96,step:1,value:F,onChange:e=>{return t=Number(e.target.value),H(t),void(oe&&re(e=>e.map(e=>e.id===oe&&"text"===e.type?{...e,size:t}:e)));var t},className:"w-16 accent-blue-500"}),
24
+ /* @__PURE__ */c("span",{className:"tabular-nums w-7 text-right",children:F})]}),
25
25
  /* @__PURE__ */s("label",{className:"flex items-center gap-1 text-gray-600",children:[
26
- /* @__PURE__ */c("span",{children:$.border}),G?/* @__PURE__ */s(d,{children:[
27
- /* @__PURE__ */c("input",{type:"color",value:G,onChange:e=>De(e.target.value),title:$.borderColor,className:"h-5 w-6 rounded border border-gray-300 bg-white p-0 cursor-pointer"}),
28
- /* @__PURE__ */c("button",{onClick:()=>De(null),title:$.removeBorder,className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */c("button",{onClick:()=>De(S),title:$.addBorder,className:"px-2 py-0.5 rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:$.add})]}),
26
+ /* @__PURE__ */c("span",{children:E.border}),Y?/* @__PURE__ */s(d,{children:[
27
+ /* @__PURE__ */c("input",{type:"color",value:Y,onChange:e=>De(e.target.value),title:E.borderColor,className:"h-5 w-6 rounded border border-gray-300 bg-white p-0 cursor-pointer"}),
28
+ /* @__PURE__ */c("button",{onClick:()=>De(null),title:E.removeBorder,className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */c("button",{onClick:()=>De(W),title:E.addBorder,className:"px-2 py-0.5 rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:E.add})]}),
29
29
  /* @__PURE__ */s("label",{className:"flex items-center gap-1 text-gray-600",children:[
30
- /* @__PURE__ */c("span",{children:$.fill}),Q?/* @__PURE__ */s(d,{children:[
31
- /* @__PURE__ */c("input",{type:"color",value:Q,onChange:e=>Pe(e.target.value),title:$.fillColor,className:"h-5 w-6 rounded border border-gray-300 bg-white p-0 cursor-pointer"}),
32
- /* @__PURE__ */c("button",{onClick:()=>Pe(null),title:$.removeFill,className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */c("button",{onClick:()=>Pe("#ffffff"),title:$.addFill,className:"px-2 py-0.5 rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:$.add})]}),
30
+ /* @__PURE__ */c("span",{children:E.fill}),G?/* @__PURE__ */s(d,{children:[
31
+ /* @__PURE__ */c("input",{type:"color",value:G,onChange:e=>Pe(e.target.value),title:E.fillColor,className:"h-5 w-6 rounded border border-gray-300 bg-white p-0 cursor-pointer"}),
32
+ /* @__PURE__ */c("button",{onClick:()=>Pe(null),title:E.removeFill,className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */c("button",{onClick:()=>Pe("#ffffff"),title:E.addFill,className:"px-2 py-0.5 rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:E.add})]}),
33
33
  /* @__PURE__ */s("label",{className:"flex items-center gap-2 text-gray-600",children:[
34
- /* @__PURE__ */c("span",{children:$.padding}),
35
- /* @__PURE__ */c("input",{type:"range",min:0,max:40,step:1,value:_,onChange:e=>{return t=Number(e.target.value),J(t),void(oe&&re(e=>e.map(e=>e.id===oe&&"text"===e.type?{...e,padding:t}:e)));var t},className:"w-14 accent-blue-500"}),
36
- /* @__PURE__ */c("span",{className:"tabular-nums w-6 text-right",children:_})]})]}),
34
+ /* @__PURE__ */c("span",{children:E.padding}),
35
+ /* @__PURE__ */c("input",{type:"range",min:0,max:40,step:1,value:Q,onChange:e=>{return t=Number(e.target.value),J(t),void(oe&&re(e=>e.map(e=>e.id===oe&&"text"===e.type?{...e,padding:t}:e)));var t},className:"w-14 accent-blue-500"}),
36
+ /* @__PURE__ */c("span",{className:"tabular-nums w-6 text-right",children:Q})]})]}),
37
37
  /* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
38
- /* @__PURE__ */c("button",{onClick:()=>ue(e=>Math.max(.25,Math.round(100*(e-.25))/100)),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:$.zoomOut,children:"−"}),
38
+ /* @__PURE__ */c("button",{onClick:()=>ue(e=>Math.max(.25,Math.round(100*(e-.25))/100)),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:E.zoomOut,children:"−"}),
39
39
  /* @__PURE__ */s("span",{className:"text-gray-600 tabular-nums w-10 text-center",children:[Math.round(100*de),"%"]}),
40
- /* @__PURE__ */c("button",{onClick:()=>ue(e=>Math.min(4,Math.round(100*(e+.25))/100)),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:$.zoomIn,children:"+"}),
41
- /* @__PURE__ */c("button",{onClick:()=>ue(1),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:$.fitHint,children:$.fit}),
40
+ /* @__PURE__ */c("button",{onClick:()=>ue(e=>Math.min(4,Math.round(100*(e+.25))/100)),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:E.zoomIn,children:"+"}),
41
+ /* @__PURE__ */c("button",{onClick:()=>ue(1),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:E.fitHint,children:E.fit}),
42
42
  /* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
43
- /* @__PURE__ */c("button",{onClick:()=>{re(e=>e.slice(0,-1)),ie(null)},disabled:0===ne.length,className:"px-2 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-700",children:$.undo}),
43
+ /* @__PURE__ */c("button",{onClick:()=>{re(e=>e.slice(0,-1)),ie(null)},disabled:0===ne.length,className:"px-2 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-700",children:E.undo}),
44
44
  /* @__PURE__ */s("div",{className:"ml-auto flex items-center gap-2",children:[me&&/* @__PURE__ */s(d,{children:[
45
- /* @__PURE__ */c("button",{onClick:()=>{if(!me||!P.current||!ae)return;const e=me,t=document.createElement("canvas");t.width=Math.round(e.w),t.height=Math.round(e.h);const n=t.getContext("2d"),r=document.createElement("canvas");r.width=ae.w,r.height=ae.h;const o=r.getContext("2d");o.drawImage(P.current,0,0);for(const e of Ne)C(o,e);n.drawImage(r,e.x,e.y,e.w,e.h,0,0,e.w,e.h);const i=new Image;i.onload=()=>{P.current=i,le({w:i.naturalWidth,h:i.naturalHeight}),re(t=>t.filter(e=>"mosaic"!==e.type).map(t=>v(t,-e.x,-e.y)).filter(e=>function(e,t,n){const r=k(e);return r.x+r.w>0&&r.y+r.h>0&&r.x<t&&r.y<n}(e,i.naturalWidth,i.naturalHeight))),ge(null)},i.src=t.toDataURL("image/png")},className:"px-2 py-1 rounded bg-blue-500 text-white hover:bg-blue-600",children:$.applyCrop}),
46
- /* @__PURE__ */c("button",{onClick:()=>ge(null),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",children:$.cancel})]}),m&&!me&&/* @__PURE__ */s(d,{children:[g&&/* @__PURE__ */c("button",{onClick:g,className:"px-3 py-1 rounded hover:bg-gray-200 text-gray-700 text-xs font-medium",children:$.cancel}),
47
- /* @__PURE__ */c("button",{onClick:async()=>{const t=await Ee();t?t.toBlob(t=>{t?m(t):e.error(E.current.exportFailed)},"image/png"):e.error(E.current.exportFailed)},className:"px-3 py-1 rounded bg-blue-500 text-white hover:bg-blue-600 text-xs font-medium",children:$.apply})]})]})]}),
45
+ /* @__PURE__ */c("button",{onClick:()=>{if(!me||!P.current||!ae)return;const e=me,t=document.createElement("canvas");t.width=Math.round(e.w),t.height=Math.round(e.h);const n=t.getContext("2d"),r=document.createElement("canvas");r.width=ae.w,r.height=ae.h;const o=r.getContext("2d");o.drawImage(P.current,0,0);for(const e of Ne)C(o,e);n.drawImage(r,e.x,e.y,e.w,e.h,0,0,e.w,e.h);const i=new Image;i.onload=()=>{P.current=i,le({w:i.naturalWidth,h:i.naturalHeight}),re(t=>t.filter(e=>"mosaic"!==e.type).map(t=>v(t,-e.x,-e.y)).filter(e=>function(e,t,n){const r=k(e);return r.x+r.w>0&&r.y+r.h>0&&r.x<t&&r.y<n}(e,i.naturalWidth,i.naturalHeight))),ge(null)},i.src=t.toDataURL("image/png")},className:"px-2 py-1 rounded bg-blue-500 text-white hover:bg-blue-600",children:E.applyCrop}),
46
+ /* @__PURE__ */c("button",{onClick:()=>ge(null),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",children:E.cancel})]}),m&&!me&&/* @__PURE__ */s(d,{children:[g&&/* @__PURE__ */c("button",{onClick:g,className:"px-3 py-1 rounded hover:bg-gray-200 text-gray-700 text-xs font-medium",children:E.cancel}),
47
+ /* @__PURE__ */c("button",{onClick:async()=>{const t=await $e();t?t.toBlob(t=>{t?m(t):e.error($.current.exportFailed)},"image/png"):e.error($.current.exportFailed)},className:"px-3 py-1 rounded bg-blue-500 text-white hover:bg-blue-600 text-xs font-medium",children:E.apply})]})]})]}),
48
48
  /* @__PURE__ */c("div",{ref:L,className:"flex-1 overflow-auto bg-gray-200 flex items-center justify-center p-4 relative",children:ve&&ae&&/* @__PURE__ */s("div",{className:"relative shadow-lg rounded overflow-hidden bg-white shrink-0",style:{width:ve.w,height:ve.h},children:[
49
49
  /* @__PURE__ */c("canvas",{ref:z,style:{position:"absolute",inset:0,width:"100%",height:"100%",display:"block"}}),
50
- /* @__PURE__ */s("svg",{ref:D,viewBox:`0 0 ${ae.w} ${ae.h}`,preserveAspectRatio:"none",style:{position:"absolute",inset:0,width:"100%",height:"100%",touchAction:"none",cursor:"select"===I?"default":"text"===I?"text":"crosshair"},onPointerDown:e=>{if("select"===I)return void ie(null);if("text"===I){if(xe)return void $e();const t=Ce(e);return void ye({x:t.x,y:t.y,value:""})}const t=Ce(e);if("crop"!==I){if("draw"===I)return Le({kind:"pen",points:[t]}),void pe({id:"",type:"draw",points:[t],color:S,stroke:R});pe(b(I,t,t,S,R,ee)),Le({kind:"draw",start:t})}else Le({kind:"crop",start:t})},children:[ne.map(e=>/* @__PURE__ */c(y,{anno:e,selected:oe===e.id,zoom:de,onPointerDown:t=>((e,t)=>{"select"===I&&(e.stopPropagation(),ie(t.id),Le({kind:"move",id:t.id,start:Ce(e),original:t}))})(t,e),onDoubleClick:()=>{var t;"text"===(t=e).type&&ye({x:t.x,y:t.y,value:t.text,editingId:t.id})},onHandlePointerDown:(t,n)=>((e,t,n)=>{e.stopPropagation(),Le({kind:"resize",id:t.id,corner:n,start:Ce(e),original:t})})(t,e,n)},e.id)),he&&/* @__PURE__ */c(y,{anno:{...he,id:"__preview"},preview:!0}),me&&/* @__PURE__ */c(f,{rect:me,imageSize:ae})]}),xe&&/* @__PURE__ */c(w,{pendingText:xe,color:S,size:H,font:h.find(e=>e.id===F)?.css??h[0].css,bold:A,italic:K,underline:X,borderColor:G,background:Q,padding:_,scale:ke,onChange:e=>ye({...xe,value:e}),onCommit:$e,onCancel:()=>ye(null)})]})}),
51
- /* @__PURE__ */c("div",{className:"px-3 py-2 border-t border-line bg-surface text-2xs text-ink-faint shrink-0",children:"select"===I?oe?$.hintSelected:$.hintSelect:"text"===I?$.hintText:"crop"===I?$.hintCrop:"draw"===I?$.hintDraw:$.hintShape})]})});function y({anno:e,selected:t,preview:n,zoom:r=1,onPointerDown:o,onDoubleClick:i,onHandlePointerDown:a}){const l=k(e),u=o?{onPointerDown:o,pointerEvents:"all",style:{cursor:"move"}}:{},p=i?{onDoubleClick:i}:{};let x;if("rect"===e.type)x=/* @__PURE__ */c("rect",{x:e.x,y:e.y,width:e.w,height:e.h,rx:e.radius,ry:e.radius,fill:"none",stroke:e.color,strokeWidth:e.stroke,strokeLinecap:"round",strokeLinejoin:"round",...u});else if("circle"===e.type)x=/* @__PURE__ */c("ellipse",{cx:e.x+e.w/2,cy:e.y+e.h/2,rx:e.w/2,ry:e.h/2,fill:"none",stroke:e.color,strokeWidth:e.stroke,...u});else if("arrow"===e.type)x=/* @__PURE__ */c(g,{anno:e,interactive:u});else if("draw"===e.type)x=/* @__PURE__ */c("path",{d:N(e.points),fill:"none",stroke:e.color,strokeWidth:e.stroke,strokeLinecap:"round",strokeLinejoin:"round",...u});else if("mosaic"===e.type)x=/* @__PURE__ */c("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:"rgba(0,0,0,0.001)",stroke:t?"#3b82f6":"none",strokeWidth:t?2:0,strokeDasharray:t?"6,4":void 0,...u});else{const t=h.find(t=>t.id===e.font)?.css??h[0].css,n=e.padding??0,r=!!e.borderColor||!!e.background,o=k(e),i=e.borderColor?Math.max(1,Math.round(e.size/12)):0;x=/* @__PURE__ */s("g",{...u,...p,children:[r&&/* @__PURE__ */c("rect",{x:o.x-n,y:o.y-n,width:Math.max(0,o.w)+2*n,height:Math.max(0,o.h)+2*n,rx:Math.min(8,n),ry:Math.min(8,n),fill:e.background??"none",stroke:e.borderColor??"none",strokeWidth:i}),
50
+ /* @__PURE__ */s("svg",{ref:D,viewBox:`0 0 ${ae.w} ${ae.h}`,preserveAspectRatio:"none",style:{position:"absolute",inset:0,width:"100%",height:"100%",touchAction:"none",cursor:"select"===I?"default":"text"===I?"text":"crosshair"},onPointerDown:e=>{if("select"===I)return void ie(null);if("text"===I){if(xe)return void Ee();const t=Ce(e);return void ye({x:t.x,y:t.y,value:""})}const t=Ce(e);if("crop"!==I){if("draw"===I)return Le({kind:"pen",points:[t]}),void pe({id:"",type:"draw",points:[t],color:W,stroke:R});pe(b(I,t,t,W,R,ee)),Le({kind:"draw",start:t})}else Le({kind:"crop",start:t})},children:[ne.map(e=>/* @__PURE__ */c(y,{anno:e,selected:oe===e.id,zoom:de,onPointerDown:t=>((e,t)=>{"select"===I&&(e.stopPropagation(),ie(t.id),Le({kind:"move",id:t.id,start:Ce(e),original:t}))})(t,e),onDoubleClick:()=>{var t;"text"===(t=e).type&&ye({x:t.x,y:t.y,value:t.text,editingId:t.id})},onHandlePointerDown:(t,n)=>((e,t,n)=>{e.stopPropagation(),Le({kind:"resize",id:t.id,corner:n,start:Ce(e),original:t})})(t,e,n)},e.id)),he&&/* @__PURE__ */c(y,{anno:{...he,id:"__preview"},preview:!0}),me&&/* @__PURE__ */c(f,{rect:me,imageSize:ae})]}),xe&&/* @__PURE__ */c(w,{pendingText:xe,color:W,size:F,font:h.find(e=>e.id===T)?.css??h[0].css,bold:A,italic:X,underline:Z,borderColor:Y,background:G,padding:Q,scale:ke,onChange:e=>ye({...xe,value:e}),onCommit:Ee,onCancel:()=>ye(null)})]})}),
51
+ /* @__PURE__ */c("div",{className:"px-3 py-2 border-t border-line bg-surface text-2xs text-ink-faint shrink-0",children:"select"===I?oe?E.hintSelected:E.hintSelect:"text"===I?E.hintText:"crop"===I?E.hintCrop:"draw"===I?E.hintDraw:E.hintShape})]})});function y({anno:e,selected:t,preview:n,zoom:r=1,onPointerDown:o,onDoubleClick:i,onHandlePointerDown:a}){const l=k(e),u=o?{onPointerDown:o,pointerEvents:"all",style:{cursor:"move"}}:{},p=i?{onDoubleClick:i}:{};let x;if("rect"===e.type)x=/* @__PURE__ */c("rect",{x:e.x,y:e.y,width:e.w,height:e.h,rx:e.radius,ry:e.radius,fill:"none",stroke:e.color,strokeWidth:e.stroke,strokeLinecap:"round",strokeLinejoin:"round",...u});else if("circle"===e.type)x=/* @__PURE__ */c("ellipse",{cx:e.x+e.w/2,cy:e.y+e.h/2,rx:e.w/2,ry:e.h/2,fill:"none",stroke:e.color,strokeWidth:e.stroke,...u});else if("arrow"===e.type)x=/* @__PURE__ */c(g,{anno:e,interactive:u});else if("draw"===e.type)x=/* @__PURE__ */c("path",{d:N(e.points),fill:"none",stroke:e.color,strokeWidth:e.stroke,strokeLinecap:"round",strokeLinejoin:"round",...u});else if("mosaic"===e.type)x=/* @__PURE__ */c("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:"rgba(0,0,0,0.001)",stroke:t?"#3b82f6":"none",strokeWidth:t?2:0,strokeDasharray:t?"6,4":void 0,...u});else{const t=h.find(t=>t.id===e.font)?.css??h[0].css,n=e.padding??0,r=!!e.borderColor||!!e.background,o=k(e),i=e.borderColor?Math.max(1,Math.round(e.size/12)):0;x=/* @__PURE__ */s("g",{...u,...p,children:[r&&/* @__PURE__ */c("rect",{x:o.x-n,y:o.y-n,width:Math.max(0,o.w)+2*n,height:Math.max(0,o.h)+2*n,rx:Math.min(8,n),ry:Math.min(8,n),fill:e.background??"none",stroke:e.borderColor??"none",strokeWidth:i}),
52
52
  /* @__PURE__ */c("text",{x:e.x,y:e.y+e.size,fill:e.color,fontSize:e.size,fontWeight:e.bold?700:400,fontStyle:e.italic?"italic":"normal",textDecoration:e.underline?"underline":void 0,fontFamily:t,style:{userSelect:"none"},children:e.text.split("\n").map((t,n)=>/* @__PURE__ */c("tspan",{x:e.x,dy:0===n?0:1.2*e.size,children:t},n))})]})}/* @__PURE__ */
53
53
  return s("g",{children:[x,t&&!n&&/* @__PURE__ */s(d,{children:[
54
54
  /* @__PURE__ */c("rect",{"data-chrome":"selection",x:l.x-4,y:l.y-4,width:l.w+8,height:l.h+8,fill:"none",stroke:"#3b82f6",strokeWidth:2/r,strokeDasharray:`${6/r},${4/r}`,pointerEvents:"none"}),a&&/* @__PURE__ */c(m,{anno:e,zoom:r,onHandlePointerDown:a})]})]})}function m({anno:e,zoom:t,onHandlePointerDown:n}){const r=6/t,o=1.5/t,i=e=>({fill:"#fff",stroke:"#3b82f6",strokeWidth:o,pointerEvents:"all",style:{cursor:e},"data-chrome":"handle"});if("arrow"===e.type)/* @__PURE__ */
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export{DataTable as default}from"../chunk-E4E7MACR.js";import"../chunk-CGZBDI6C.js";import"../chunk-ENL5L6NR.js";import"../chunk-R2VKEMZH.js";import"../chunk-MRJKZWWV.js";import"../chunk-OZAAIE4E.js";import"../chunk-BCDG4N6L.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-DTJRIWFR.js";import"../chunk-TWVUQUUD.js";import"../chunk-QWHQJNKL.js";import"../chunk-C3QOHMR6.js";
2
+ export{DataTable as default}from"../chunk-UZGVIHFI.js";import"../chunk-CGZBDI6C.js";import"../chunk-P65C5TUU.js";import"../chunk-R2VKEMZH.js";import"../chunk-MRJKZWWV.js";import"../chunk-OZAAIE4E.js";import"../chunk-BCDG4N6L.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-DTJRIWFR.js";import"../chunk-TWVUQUUD.js";import"../chunk-PEM7UXQ3.js";import"../chunk-C3QOHMR6.js";
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export{Kanban as default}from"../chunk-FLEG5KP5.js";import"../chunk-R2VKEMZH.js";import"../chunk-MRJKZWWV.js";import"../chunk-D65T4H6J.js";import"../chunk-QWHQJNKL.js";import"../chunk-C3QOHMR6.js";
2
+ export{Kanban as default}from"../chunk-PWBLGKQ3.js";import"../chunk-R2VKEMZH.js";import"../chunk-MRJKZWWV.js";import"../chunk-D65T4H6J.js";import"../chunk-PEM7UXQ3.js";import"../chunk-C3QOHMR6.js";