efficient-shell 10.1.1 → 10.2.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 (371) hide show
  1. package/README.md +1 -1
  2. package/dist/{Browser-Q34VNUTL.js → Browser-YHMFQIN5.js} +14 -14
  3. package/dist/Calculator-NSYIXONM.js +29 -0
  4. package/dist/CurrencyConverter-YQ2AZ7ZG.js +21 -0
  5. package/dist/Documents-CMCZA5PH.js +52 -0
  6. package/dist/Files-UW65YMFW.js +88 -0
  7. package/dist/Notepad-RSYZ7HZA.js +24 -0
  8. package/dist/{PdfViewer-WNKGFJD6.js → PdfViewer-Z4YKDHIH.js} +1 -1
  9. package/dist/{PomodoroTimer-X5Y3LA3V.js → PomodoroTimer-5KCWCL62.js} +10 -10
  10. package/dist/{Preview-3FZTC25R.js → Preview-PK4QI7SK.js} +47 -47
  11. package/dist/Sidebar-QCUDD4OU.js +44 -0
  12. package/dist/Spreadsheet-MQR4TQGV.js +37 -0
  13. package/dist/Stock-DMW2REHR.js +16 -0
  14. package/dist/{Weather-BYGZVNNK.js → Weather-PN7XVCZY.js} +12 -12
  15. package/dist/{WorldClock-P4JVDPGE.js → WorldClock-JYLOJCUS.js} +9 -9
  16. package/dist/ai/index.js +59 -59
  17. package/dist/apps/index.js +1 -1
  18. package/dist/bin/media-host-check.js +1 -1
  19. package/dist/bin/ui-check.js +1 -1
  20. package/dist/brand.css +1 -1
  21. package/dist/charts/BoxPlotChart.js +1 -1
  22. package/dist/charts/CandlestickChart.js +1 -1
  23. package/dist/charts/CartesianPlot.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/ChartTooltip.js +1 -1
  28. package/dist/charts/ChordChart.js +1 -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.js +1 -1
  45. package/dist/charts/TreemapChart.js +1 -1
  46. package/dist/charts/WaterfallChart.js +1 -1
  47. package/dist/chunk-2JG5JU4M.js +8 -0
  48. package/dist/{chunk-5VSP3TYU.js → chunk-2K2W6VIR.js} +1 -1
  49. package/dist/{chunk-QXRRAADR.js → chunk-2SY76NFO.js} +4 -4
  50. package/dist/{chunk-BMXMSAQE.js → chunk-2VTO64YC.js} +7 -7
  51. package/dist/{chunk-HL6JSDN3.js → chunk-34URULVW.js} +1 -1
  52. package/dist/{chunk-RZR3OAKV.js → chunk-35DG7Y4M.js} +1 -1
  53. package/dist/{chunk-MH6DI6YY.js → chunk-37U326EL.js} +12 -12
  54. package/dist/{chunk-YL6LLHJA.js → chunk-3CPB3WP2.js} +18 -18
  55. package/dist/{chunk-CKPVXDKX.js → chunk-3ELLBQPS.js} +3 -3
  56. package/dist/{chunk-A6RB4PIX.js → chunk-3NW5LD7D.js} +4 -4
  57. package/dist/{chunk-BNQRPLBW.js → chunk-3RORPK2J.js} +1 -1
  58. package/dist/{chunk-U5DMF2TX.js → chunk-4BYJQU37.js} +1 -1
  59. package/dist/chunk-4PAWQEXM.js +1 -0
  60. package/dist/{chunk-CUA6CREW.js → chunk-5S3YYN7M.js} +7 -7
  61. package/dist/{chunk-Q5YM65DZ.js → chunk-632N62BY.js} +8 -8
  62. package/dist/{chunk-LOYCPZUB.js → chunk-63L5ORRZ.js} +1 -1
  63. package/dist/{chunk-B7HW6XZD.js → chunk-67JCJ2MG.js} +1 -1
  64. package/dist/chunk-6OMCCEYA.js +1 -0
  65. package/dist/{chunk-4VDGVF5T.js → chunk-6PFZK6ED.js} +1 -1
  66. package/dist/{chunk-P6LB3I3D.js → chunk-6RX4PVBU.js} +1 -1
  67. package/dist/chunk-6XBWM453.js +6 -0
  68. package/dist/{chunk-ZG2HMC7S.js → chunk-7SMV6G4Z.js} +1 -1
  69. package/dist/{chunk-X6YT3I5F.js → chunk-7X3XNVES.js} +1 -1
  70. package/dist/{chunk-WUMHSI4U.js → chunk-7X5FABQS.js} +1 -1
  71. package/dist/{chunk-JZK3UDOT.js → chunk-7YOQS3C6.js} +1 -1
  72. package/dist/{chunk-TDLU6GF5.js → chunk-7Z4PTLDL.js} +4 -4
  73. package/dist/{chunk-2OJ3HGFY.js → chunk-A4HJDSRA.js} +6 -6
  74. package/dist/chunk-A5BV6NFA.js +7 -0
  75. package/dist/{chunk-42XMT5JN.js → chunk-AJO72CPB.js} +2 -2
  76. package/dist/chunk-AKJHVOSD.js +8 -0
  77. package/dist/{chunk-OQW42DOR.js → chunk-AKM6JBMD.js} +1 -1
  78. package/dist/chunk-AM2F5ZXH.js +2 -0
  79. package/dist/{chunk-4WZRNPIG.js → chunk-AUWTGM65.js} +1 -1
  80. package/dist/chunk-B73AXE6P.js +1 -0
  81. package/dist/{chunk-V4RYE6KA.js → chunk-C2P2Z6HU.js} +11 -11
  82. package/dist/{chunk-WKSNTMEJ.js → chunk-CAVADOJK.js} +1 -1
  83. package/dist/chunk-CBEKJTXU.js +9 -0
  84. package/dist/{chunk-Q4LBBFLO.js → chunk-CGQAKGPT.js} +6 -6
  85. package/dist/{chunk-AEQFFD5I.js → chunk-CHBRMAJV.js} +1 -1
  86. package/dist/{chunk-2OE5VVBE.js → chunk-CPZ42W2B.js} +1 -1
  87. package/dist/{chunk-BDAKGS7O.js → chunk-D7F442OZ.js} +1 -1
  88. package/dist/{chunk-BZPPDYEE.js → chunk-DDCMMOB4.js} +1 -1
  89. package/dist/{chunk-5VTRKWKO.js → chunk-DKGZPVLL.js} +1 -1
  90. package/dist/{chunk-XABYSSXW.js → chunk-DLNIRZNR.js} +1 -1
  91. package/dist/{chunk-RBIGSJ2J.js → chunk-DRDYZ633.js} +2 -2
  92. package/dist/{chunk-FS2KWQJW.js → chunk-E5MVH3SH.js} +10 -10
  93. package/dist/chunk-EU3JZGV2.js +14 -0
  94. package/dist/{chunk-GGIFS34Z.js → chunk-EYZZW6SO.js} +5 -5
  95. package/dist/{chunk-43T5JGFB.js → chunk-EZEYKCI6.js} +1 -1
  96. package/dist/{chunk-DTJRIWFR.js → chunk-F27JJHNJ.js} +1 -1
  97. package/dist/{chunk-7ILNRFEV.js → chunk-FFIQPFUR.js} +1 -1
  98. package/dist/{chunk-TLRCTNUF.js → chunk-G4GVLK44.js} +1 -1
  99. package/dist/chunk-G5NQOV7L.js +6 -0
  100. package/dist/{chunk-JB3WKDD7.js → chunk-GGK27H67.js} +1 -1
  101. package/dist/{chunk-2YLG32JY.js → chunk-GISDIVFK.js} +1 -1
  102. package/dist/{chunk-FFASZGNZ.js → chunk-GNHLVGG5.js} +3 -3
  103. package/dist/{chunk-6FPDOEOX.js → chunk-GSKLHUQ6.js} +1 -1
  104. package/dist/{chunk-GY67Y5SN.js → chunk-H4HB5OET.js} +1 -1
  105. package/dist/{chunk-6L2UAAGT.js → chunk-HNBGLF4B.js} +1 -1
  106. package/dist/{chunk-YJSX6JAC.js → chunk-I2XGPTCN.js} +1 -1
  107. package/dist/{chunk-NHH2MXFU.js → chunk-I4VIEGCX.js} +1 -1
  108. package/dist/chunk-IKNG7EFQ.js +12 -0
  109. package/dist/{chunk-RQNZ2PVW.js → chunk-INNIWRVU.js} +4 -4
  110. package/dist/{chunk-J53OQCKC.js → chunk-IOJNSX4N.js} +7 -7
  111. package/dist/{chunk-JKZJVQIB.js → chunk-IPFWXM2Y.js} +6 -6
  112. package/dist/{chunk-K7PCBUDC.js → chunk-JRZ7PPVJ.js} +6 -6
  113. package/dist/chunk-JSGQWVYH.js +7 -0
  114. package/dist/{chunk-ZCV377AG.js → chunk-KEPJWZJZ.js} +3 -3
  115. package/dist/{chunk-JJP54OT4.js → chunk-KJ4CBZEQ.js} +1 -1
  116. package/dist/{chunk-XHMIJ7S3.js → chunk-KP2THXEI.js} +6 -6
  117. package/dist/{chunk-GKK7DR2H.js → chunk-LCJRTJXT.js} +9 -9
  118. package/dist/{chunk-Q3MNSM7W.js → chunk-LDE5IV2M.js} +4 -4
  119. package/dist/{chunk-MZ26SYFY.js → chunk-LEDUD23S.js} +1 -1
  120. package/dist/{chunk-7TONF2PM.js → chunk-LOFYSLC7.js} +9 -9
  121. package/dist/{chunk-AGLBDT7X.js → chunk-LTKXAHS3.js} +8 -8
  122. package/dist/{chunk-BMQCUHSD.js → chunk-M22B3Y5Y.js} +1 -1
  123. package/dist/{chunk-CLQFP42I.js → chunk-MBXLROCD.js} +1 -1
  124. package/dist/{chunk-KCV7BFKJ.js → chunk-MCDM2G4W.js} +1 -1
  125. package/dist/{chunk-R4Q5653D.js → chunk-MNXRAZJV.js} +20 -20
  126. package/dist/{chunk-VC42SDAC.js → chunk-MQU3PZUS.js} +1 -1
  127. package/dist/{chunk-GVY2X4CC.js → chunk-MTX5LMJD.js} +17 -17
  128. package/dist/{chunk-OZAAIE4E.js → chunk-MVZRZTQP.js} +1 -1
  129. package/dist/{chunk-NNOA7AVG.js → chunk-MXH3UPCH.js} +5 -5
  130. package/dist/{chunk-ZLHPCPXS.js → chunk-N4DI5F74.js} +18 -18
  131. package/dist/{chunk-EIUCHQI2.js → chunk-N67QX3WW.js} +2 -2
  132. package/dist/{chunk-WMQ2URP4.js → chunk-O42AN43Q.js} +1 -1
  133. package/dist/{chunk-MLKY5ESV.js → chunk-O45WQK57.js} +1 -1
  134. package/dist/{chunk-RSIGTZMU.js → chunk-O4V5PEA3.js} +1 -1
  135. package/dist/{chunk-M554OMPA.js → chunk-O6JJIR4H.js} +1 -1
  136. package/dist/{chunk-APXQMZSV.js → chunk-O7DW2BKY.js} +26 -26
  137. package/dist/{chunk-UB5TLWZN.js → chunk-ON67HF5K.js} +8 -8
  138. package/dist/{chunk-KZQAGXME.js → chunk-ORIGX2H5.js} +4 -4
  139. package/dist/{chunk-JRBQLRAZ.js → chunk-OZBM2XFQ.js} +1 -1
  140. package/dist/{chunk-ZRZ5LOW3.js → chunk-PBWUEBJ5.js} +1 -1
  141. package/dist/chunk-PJQGYKN6.js +11 -0
  142. package/dist/chunk-PN65IIYN.js +8 -0
  143. package/dist/chunk-PUF75SMJ.js +1 -0
  144. package/dist/{chunk-5EX6XXUX.js → chunk-PXDDCD5X.js} +1 -1
  145. package/dist/{chunk-RKFEJ5CX.js → chunk-PXQG5EIH.js} +1 -1
  146. package/dist/{chunk-5VDT4762.js → chunk-QEKOEIOQ.js} +2 -2
  147. package/dist/{chunk-GMRZX2ET.js → chunk-QHOBK35Y.js} +1 -1
  148. package/dist/{chunk-CMHLXELO.js → chunk-QL4757YL.js} +3 -3
  149. package/dist/{chunk-7VCAMNCH.js → chunk-QP4UPCXQ.js} +1 -1
  150. package/dist/chunk-QQPIQCT7.js +11 -0
  151. package/dist/{chunk-CL7SBEBQ.js → chunk-QYRMFGES.js} +1 -1
  152. package/dist/{chunk-3V6ZERBS.js → chunk-RBQWIHYD.js} +1 -1
  153. package/dist/chunk-RCPFUDPS.js +4 -0
  154. package/dist/{chunk-N6TK43YN.js → chunk-RP3GUVAI.js} +44 -44
  155. package/dist/chunk-RPYFOQM2.js +6 -0
  156. package/dist/{chunk-53KQSCMG.js → chunk-SDQIXE5M.js} +9 -9
  157. package/dist/{chunk-NW7Z3G7P.js → chunk-SF654IHN.js} +13 -13
  158. package/dist/{chunk-LPDI5NL6.js → chunk-SO6X4CII.js} +2 -2
  159. package/dist/{chunk-VP63OOO4.js → chunk-SOECV4V5.js} +3 -3
  160. package/dist/chunk-SWN3LSQX.js +12 -0
  161. package/dist/{chunk-TBPHW42V.js → chunk-TKJBZIHT.js} +1 -1
  162. package/dist/chunk-TMNAHOJ7.js +9 -0
  163. package/dist/{chunk-CBGKLHPB.js → chunk-TOVKWNI2.js} +6 -6
  164. package/dist/{chunk-PF5CKD4C.js → chunk-TVH7IZQ4.js} +2 -2
  165. package/dist/{chunk-LNARMEEZ.js → chunk-TXDA7TTP.js} +1 -1
  166. package/dist/{chunk-SKY2NBTQ.js → chunk-UBOP6HFI.js} +5 -5
  167. package/dist/{chunk-J7CIBRDS.js → chunk-UDRMZ22J.js} +1 -1
  168. package/dist/{chunk-IWJRSC7M.js → chunk-ULAGXDOL.js} +1 -1
  169. package/dist/{chunk-O6ABVKHU.js → chunk-ULXCDM7Y.js} +10 -10
  170. package/dist/{chunk-MVQMAIZM.js → chunk-UPQW4GCT.js} +1 -1
  171. package/dist/{chunk-E3RHEEA6.js → chunk-URERZUX5.js} +1 -1
  172. package/dist/{chunk-RPMWF42S.js → chunk-UTWJKSET.js} +5 -5
  173. package/dist/{chunk-SWO4VPOB.js → chunk-UWIZX3RK.js} +1 -1
  174. package/dist/{chunk-EQN65XOO.js → chunk-UYRITNQW.js} +4 -4
  175. package/dist/{chunk-4UEXVRBC.js → chunk-VJJMWJPZ.js} +1 -1
  176. package/dist/{chunk-QSW3YHPK.js → chunk-VKKK4WLS.js} +4 -4
  177. package/dist/{chunk-JJYAYMY7.js → chunk-VTFZ6W2D.js} +2 -2
  178. package/dist/chunk-W35N7SL3.js +8 -0
  179. package/dist/{chunk-IWEL2ZCV.js → chunk-W5CJD54C.js} +1 -1
  180. package/dist/{chunk-45XXERGA.js → chunk-W6SC3ZNO.js} +2 -2
  181. package/dist/{chunk-ZF545DXX.js → chunk-W6URVLQF.js} +14 -14
  182. package/dist/{chunk-R5EJJ6HC.js → chunk-WINNA7LS.js} +1 -1
  183. package/dist/chunk-WMEYNKXZ.js +22 -0
  184. package/dist/{chunk-DKQWFQAV.js → chunk-WN5HHHLO.js} +1 -1
  185. package/dist/chunk-WTTSB4SV.js +3 -0
  186. package/dist/{chunk-WP4CIYJ7.js → chunk-XDQGIW4X.js} +1 -1
  187. package/dist/{chunk-4UX6ET7G.js → chunk-XKDBYJHF.js} +1 -1
  188. package/dist/chunk-XLYCWGTK.js +4 -0
  189. package/dist/{chunk-HI6IE5HI.js → chunk-XO7URRTM.js} +1 -1
  190. package/dist/chunk-Y3R267FV.js +15 -0
  191. package/dist/chunk-YATWJMLM.js +29 -0
  192. package/dist/{chunk-Y23TGQFN.js → chunk-YCOYCPAH.js} +3 -3
  193. package/dist/chunk-YGSU5KCP.js +9 -0
  194. package/dist/{chunk-VMDBVXDJ.js → chunk-YJLLLO5R.js} +1 -1
  195. package/dist/chunk-YMYY5G6V.js +1 -0
  196. package/dist/{chunk-BDFZNLFQ.js → chunk-YWDEFPSW.js} +3 -3
  197. package/dist/{chunk-FMC2XNSP.js → chunk-ZNAVCHBV.js} +6 -6
  198. package/dist/{chunk-B7AHMB3U.js → chunk-ZURB2DCM.js} +1 -1
  199. package/dist/{chunk-NQJKANUP.js → chunk-ZUS7FXKE.js} +13 -13
  200. package/dist/{chunk-3V74SUZO.js → chunk-ZZOBG6GP.js} +17 -17
  201. package/dist/chunk-ZZVE64OI.js +2 -0
  202. package/dist/data/DataTable.js +1 -1
  203. package/dist/data/Kanban.js +1 -1
  204. package/dist/data/ListFooter.js +1 -1
  205. package/dist/data/ListLoadError.js +1 -1
  206. package/dist/data/Pagination.js +1 -1
  207. package/dist/file-intake/index.js +1 -1
  208. package/dist/format/index.js +1 -1
  209. package/dist/forms/AlignmentGrid.js +1 -1
  210. package/dist/forms/BorderInput.js +1 -1
  211. package/dist/forms/BrandAssetEditor.js +1 -1
  212. package/dist/forms/Button.js +1 -1
  213. package/dist/forms/Calendar.js +1 -1
  214. package/dist/forms/ColorPicker.js +1 -1
  215. package/dist/forms/ComposerAttachments.js +1 -1
  216. package/dist/forms/CornersInput.js +1 -1
  217. package/dist/forms/DatePicker.js +1 -1
  218. package/dist/forms/DateRangePicker.js +1 -1
  219. package/dist/forms/DateTimePicker.js +1 -1
  220. package/dist/forms/DisplayChips.js +1 -1
  221. package/dist/forms/FilePicker.js +1 -1
  222. package/dist/forms/FormErrorSummary.js +1 -1
  223. package/dist/forms/IconButton.js +1 -1
  224. package/dist/forms/IconPicker.js +1 -1
  225. package/dist/forms/ImageFocusPoint.js +1 -1
  226. package/dist/forms/InputNumber.js +1 -1
  227. package/dist/forms/LinkPicker.js +1 -1
  228. package/dist/forms/MediaLibrary.js +1 -1
  229. package/dist/forms/MediaUploadField.js +1 -1
  230. package/dist/forms/MediaUploadGrid.js +1 -1
  231. package/dist/forms/MediaUsedInList.js +1 -1
  232. package/dist/forms/NumericKeypad.js +1 -1
  233. package/dist/forms/PictureTiles.js +1 -1
  234. package/dist/forms/PositionInput.js +1 -1
  235. package/dist/forms/Segmented.js +1 -1
  236. package/dist/forms/Select.js +1 -1
  237. package/dist/forms/SidesInput.js +1 -1
  238. package/dist/forms/Slider.js +1 -1
  239. package/dist/forms/Snippet.js +1 -1
  240. package/dist/forms/SplitButton.js +1 -1
  241. package/dist/forms/TagInput.js +1 -1
  242. package/dist/forms/TextToolbar.js +1 -1
  243. package/dist/forms/TimePicker.js +1 -1
  244. package/dist/forms/WidthsBar.js +1 -1
  245. package/dist/forms/mediaLibraryMenu.js +1 -1
  246. package/dist/forms/mediaMoveItems.js +1 -1
  247. package/dist/forms/textAlign.js +1 -1
  248. package/dist/forms/useFileIntake.js +1 -1
  249. package/dist/icons/efficient-glyphs.js +1 -1
  250. package/dist/icons/efficient-looks.js +1 -1
  251. package/dist/icons/efficient.js +1 -1
  252. package/dist/icons/index.js +1 -1
  253. package/dist/icons/looks/map.js +1 -1
  254. package/dist/icons/sets.js +1 -1
  255. package/dist/index.d.ts +1 -0
  256. package/dist/index.js +143 -143
  257. package/dist/locales/zh-Hans.js +1 -1
  258. package/dist/map/index.js +8 -8
  259. package/dist/page-tabs/index.js +5 -5
  260. package/dist/pdf/index.js +1 -1
  261. package/dist/shell/Accordion.js +1 -1
  262. package/dist/shell/AppUpdateBanner.js +1 -1
  263. package/dist/shell/Avatar.js +1 -1
  264. package/dist/shell/Banner.js +1 -1
  265. package/dist/shell/Breadcrumbs.js +1 -1
  266. package/dist/shell/BudgetBar.js +1 -1
  267. package/dist/shell/Card.js +1 -1
  268. package/dist/shell/ColoredBadge.js +1 -1
  269. package/dist/shell/ConfirmDialog.js +1 -1
  270. package/dist/shell/ContainerFillChart.js +1 -1
  271. package/dist/shell/ContextMenu.js +1 -1
  272. package/dist/shell/CountBadge.js +1 -1
  273. package/dist/shell/Dialog.d.ts +15 -2
  274. package/dist/shell/Dialog.js +1 -1
  275. package/dist/shell/Drawer.d.ts +5 -1
  276. package/dist/shell/Drawer.js +1 -1
  277. package/dist/shell/DropdownMenu.js +1 -1
  278. package/dist/shell/EditableGrid.js +1 -1
  279. package/dist/shell/EmptyState.js +1 -1
  280. package/dist/shell/FloatingBar.js +1 -1
  281. package/dist/shell/GlobalSearch.js +1 -1
  282. package/dist/shell/HelpCenter.js +1 -1
  283. package/dist/shell/IconRail.js +1 -1
  284. package/dist/shell/ImageLightbox.js +1 -1
  285. package/dist/shell/ItemCount.js +1 -1
  286. package/dist/shell/LanguageSelect.js +1 -1
  287. package/dist/shell/Markdown.js +1 -1
  288. package/dist/shell/MetricBar.js +1 -1
  289. package/dist/shell/MetricBarLegend.js +1 -1
  290. package/dist/shell/MilestoneTimeline.js +1 -1
  291. package/dist/shell/PageHeader.js +1 -1
  292. package/dist/shell/PopupMenu.js +1 -1
  293. package/dist/shell/ProductionTimeline.js +1 -1
  294. package/dist/shell/ResizeHandle.js +1 -1
  295. package/dist/shell/Result.js +1 -1
  296. package/dist/shell/SearchableSelect.js +1 -1
  297. package/dist/shell/SettingReset.js +1 -1
  298. package/dist/shell/SettingRow.js +1 -1
  299. package/dist/shell/SidebarLayout.js +1 -1
  300. package/dist/shell/SidebarNav.js +1 -1
  301. package/dist/shell/SortableList.js +1 -1
  302. package/dist/shell/Statistic.js +1 -1
  303. package/dist/shell/StatusBadge.js +1 -1
  304. package/dist/shell/Tabs.js +1 -1
  305. package/dist/shell/TimeAgo.js +1 -1
  306. package/dist/shell/TimelineTrack.js +1 -1
  307. package/dist/shell/Tooltip.js +1 -1
  308. package/dist/shell/TopNav.js +1 -1
  309. package/dist/shell/TransferProgress.js +1 -1
  310. package/dist/shell/Tree.js +1 -1
  311. package/dist/shell/discardGuard.d.ts +43 -0
  312. package/dist/shell/discardGuard.js +2 -0
  313. package/dist/shell/language.js +1 -1
  314. package/dist/shell/strings.d.ts +6 -0
  315. package/dist/shell/strings.js +1 -1
  316. package/dist/shell/toast.js +1 -1
  317. package/dist/telemetry/index.js +1 -1
  318. package/dist/templates/AuthScreen.js +1 -1
  319. package/dist/templates/ChatTemplate.js +1 -1
  320. package/dist/templates/CheckoutTemplate.js +1 -1
  321. package/dist/templates/DashboardTemplate.js +1 -1
  322. package/dist/templates/DataTablePage.js +1 -1
  323. package/dist/templates/EmailTemplate.js +1 -1
  324. package/dist/templates/ErrorBoundary.js +1 -1
  325. package/dist/templates/ErrorPage.js +1 -1
  326. package/dist/templates/FormLayoutPage.js +1 -1
  327. package/dist/templates/GalleryTemplate.js +1 -1
  328. package/dist/ui/index.d.ts +1 -0
  329. package/dist/ui/index.js +1 -1
  330. package/dist/ui.css +5 -0
  331. package/dist/utils/glass.d.ts +4 -2
  332. package/dist/utils/glass.js +1 -1
  333. package/dist/version.js +1 -1
  334. package/package.json +1 -1
  335. package/dist/Calculator-63XNC3BA.js +0 -29
  336. package/dist/CurrencyConverter-Q4HYAY4N.js +0 -21
  337. package/dist/Documents-KLVVF4KK.js +0 -52
  338. package/dist/Files-AOIBTQTE.js +0 -88
  339. package/dist/Notepad-SOUIZDKN.js +0 -24
  340. package/dist/Sidebar-4OI4LP6G.js +0 -44
  341. package/dist/Spreadsheet-RBEVCQIV.js +0 -37
  342. package/dist/Stock-KESFJPYD.js +0 -16
  343. package/dist/chunk-2SLQD57V.js +0 -6
  344. package/dist/chunk-4X6GIVTI.js +0 -29
  345. package/dist/chunk-5GUBNCTP.js +0 -1
  346. package/dist/chunk-A3VJ4PRU.js +0 -11
  347. package/dist/chunk-ACVKU6YW.js +0 -7
  348. package/dist/chunk-AG2OLB3E.js +0 -15
  349. package/dist/chunk-AXL7VTNM.js +0 -11
  350. package/dist/chunk-BCDG4N6L.js +0 -6
  351. package/dist/chunk-DY2M6BIG.js +0 -12
  352. package/dist/chunk-F7A6K3D5.js +0 -9
  353. package/dist/chunk-GZYTCHPX.js +0 -8
  354. package/dist/chunk-IFANUMK3.js +0 -4
  355. package/dist/chunk-IGEFUHYE.js +0 -12
  356. package/dist/chunk-K64JRGNE.js +0 -6
  357. package/dist/chunk-KE5U4KKG.js +0 -4
  358. package/dist/chunk-KFRU53WD.js +0 -8
  359. package/dist/chunk-N6VP75F5.js +0 -3
  360. package/dist/chunk-OPB3I4JH.js +0 -8
  361. package/dist/chunk-QASKQDUR.js +0 -22
  362. package/dist/chunk-QMUAY24U.js +0 -8
  363. package/dist/chunk-QZ3MO3HB.js +0 -1
  364. package/dist/chunk-RUTUVS4H.js +0 -1
  365. package/dist/chunk-SKETTGCJ.js +0 -2
  366. package/dist/chunk-UP442DPT.js +0 -9
  367. package/dist/chunk-VO3ZB7C6.js +0 -14
  368. package/dist/chunk-W244OMOU.js +0 -7
  369. package/dist/chunk-X2PZMXDP.js +0 -1
  370. package/dist/chunk-YVTKTWZX.js +0 -9
  371. package/dist/chunk-ZN2BFSQR.js +0 -2
@@ -1,27 +1,27 @@
1
- import{Dialog as e}from"./chunk-IFANUMK3.js";import{buttonClasses as t}from"./chunk-UQYNPYF4.js";import{Icon as r}from"./chunk-KKSVRIMP.js";import{useShellStrings as n,splitAround as o}from"./chunk-X2PZMXDP.js";import{createContext as l,useContext as i,useState as s,useRef as a,useCallback as c,useEffect as u}from"react";import{jsxs as d,jsx as m,Fragment as h}from"react/jsx-runtime";var f=l(()=>Promise.resolve(!1)),b=()=>i(f),g=()=>Promise.resolve(!1),p=e=>g(e),v=()=>Promise.resolve(!1),y=e=>v(e),x=()=>Promise.resolve(null),N=e=>x(e),k={danger:{icon:"text-red-600 bg-red-100",button:t({variant:"danger"})},warning:{icon:"text-yellow-600 bg-yellow-100",button:t({variant:"warning"})},info:{icon:"text-blue-600 bg-accent-tint-strong",button:t({variant:"primary"})}},w=t({variant:"secondary"}),C=t({variant:"primary"}),P="w-full rounded-md border border-line-strong h-8 px-3 text-sm";function L(){/* @__PURE__ */
1
+ import{Dialog as e}from"./chunk-XLYCWGTK.js";import{buttonClasses as t}from"./chunk-UQYNPYF4.js";import{Icon as r}from"./chunk-KKSVRIMP.js";import{useShellStrings as n,splitAround as o}from"./chunk-4PAWQEXM.js";import{createContext as l,useContext as i,useState as s,useRef as a,useCallback as c,useEffect as u}from"react";import{jsxs as d,jsx as m,Fragment as h}from"react/jsx-runtime";var f=l(()=>Promise.resolve(!1)),b=()=>i(f),g=()=>Promise.resolve(!1),p=e=>g(e),v=()=>Promise.resolve(!1),y=e=>v(e),x=()=>Promise.resolve(null),N=e=>x(e),k={danger:{icon:"text-red-600 bg-red-100",button:t({variant:"danger"})},warning:{icon:"text-yellow-600 bg-yellow-100",button:t({variant:"warning"})},info:{icon:"text-blue-600 bg-accent-tint-strong",button:t({variant:"primary"})}},w=t({variant:"secondary"}),C=t({variant:"primary"}),P="w-full rounded-md border border-line-strong h-8 px-3 text-sm";function L(){/* @__PURE__ */
2
2
  return m(r,{name:"warning",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function j(){/* @__PURE__ */
3
- return m(r,{name:"close",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function F({children:t}){const[r,l]=s(!1),[i,b]=s({message:""}),[p,y]=s(0),N=a(),F=a(null),E=a(0),K=a([]),T=a(null),$=a(null),D=c(e=>{F.current=e.id,N.current=e.resolve,y(e.id),b(e.options),l(!0)},[]),M=c(e=>{const t="string"==typeof e?{message:e}:e;return new Promise(e=>{const r={id:++E.current,options:t,resolve:e};null===F.current?D(r):K.current.push(r)})},[D]),[W,I]=s(!1),[U,V]=s({message:""}),[X,Y]=s(""),A=a(),Q=c(e=>(V(e),Y(""),I(!0),new Promise(e=>{A.current=e})),[]),[R,S]=s(!1),[Z,q]=s({}),[z,B]=s(""),G=a(),H=c(e=>{const t="string"==typeof e?{message:e}:e;return q(t),B(t.defaultValue??""),S(!0),new Promise(e=>{G.current=e})},[]);u(()=>{g=M,v=Q,x=H},[M,Q,H]);const J=(e,t)=>{if(F.current!==e)return;const r=N.current,n=K.current.shift();n?D(n):(F.current=null,N.current=void 0,l(!1)),r?.(t)},O=e=>{I(!1),Y(""),A.current?.(e)},_=e=>{if(e){const e=z.trim();if(!e&&!Z.allowEmpty)return S(!1),void G.current?.(null);S(!1),G.current?.(e)}else S(!1),G.current?.(null)},ee=i.variant||(i.confirmLabel?.toLowerCase().includes("delete")||i.message.toLowerCase().includes("delete")?"danger":"info"),te=k[ee],re=k["warning"===U.variant?"warning":"danger"],ne=U.confirmWord,oe=null==ne||X===ne,le=n().dialog,[ie,se]=o(le.typeToConfirm);/* @__PURE__ */
4
- return d(f.Provider,{value:M,children:[t,
5
- /* @__PURE__ */m(e,{open:r,onClose:()=>J(p,!1),initialFocus:T,footer:/* @__PURE__ */d(h,{children:[
6
- /* @__PURE__ */m("button",{ref:T,type:"button",onClick:()=>J(p,!1),className:w,children:i.cancelLabel||le.cancel}),
7
- /* @__PURE__ */m("button",{type:"button",onClick:()=>J(p,!0),className:te.button,children:i.confirmLabel||le.ok})]}),children:/* @__PURE__ */d("div",{className:"flex gap-4",children:[
3
+ return m(r,{name:"close",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function E({children:t}){const[r,l]=s(!1),[i,b]=s({message:""}),[p,y]=s(0),N=a(),E=a(null),F=a(0),K=a([]),T=a(null),W=a(null),$=c(e=>{E.current=e.id,N.current=e.resolve,y(e.id),b(e.options),l(!0)},[]),Y=c(e=>{const t="string"==typeof e?{message:e}:e;return new Promise(e=>{const r={id:++F.current,options:t,resolve:e};null===E.current?$(r):K.current.push(r)})},[$]),[D,M]=s(!1),[Q,V]=s({message:""}),[X,A]=s(""),G=a(),I=c(e=>(V(e),A(""),M(!0),new Promise(e=>{G.current=e})),[]),[R,S]=s(!1),[U,q]=s({}),[z,B]=s(""),H=a(),J=c(e=>{const t="string"==typeof e?{message:e}:e;return q(t),B(t.defaultValue??""),S(!0),new Promise(e=>{H.current=e})},[]);u(()=>{g=Y,v=I,x=J},[Y,I,J]);const O=(e,t)=>{if(E.current!==e)return;const r=N.current,n=K.current.shift();n?$(n):(E.current=null,N.current=void 0,l(!1)),r?.(t)},Z=e=>{M(!1),A(""),G.current?.(e)},_=e=>{if(e){const e=z.trim();if(!e&&!U.allowEmpty)return S(!1),void H.current?.(null);S(!1),H.current?.(e)}else S(!1),H.current?.(null)},ee=i.variant||(i.confirmLabel?.toLowerCase().includes("delete")||i.message.toLowerCase().includes("delete")?"danger":"info"),te=k[ee],re=k["warning"===Q.variant?"warning":"danger"],ne=Q.confirmWord,oe=null==ne||X===ne,le=n().dialog,[ie,se]=o(le.typeToConfirm);/* @__PURE__ */
4
+ return d(f.Provider,{value:Y,children:[t,
5
+ /* @__PURE__ */m(e,{open:r,onClose:()=>O(p,!1),initialFocus:T,footer:/* @__PURE__ */d(h,{children:[
6
+ /* @__PURE__ */m("button",{ref:T,type:"button",onClick:()=>O(p,!1),className:w,children:i.cancelLabel||le.cancel}),
7
+ /* @__PURE__ */m("button",{type:"button",onClick:()=>O(p,!0),className:te.button,children:i.confirmLabel||le.ok})]}),children:/* @__PURE__ */d("div",{className:"flex gap-4",children:[
8
8
  /* @__PURE__ */m("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${te.icon}`,children:/* @__PURE__ */m(L,{})}),
9
9
  /* @__PURE__ */d("div",{className:"flex-1",children:[
10
10
  /* @__PURE__ */m("h2",{className:"text-base font-semibold text-gray-900",children:i.title||le.confirmTitle}),
11
11
  /* @__PURE__ */m("p",{className:"mt-2 text-sm text-gray-600",children:i.message})]})]})}),
12
- /* @__PURE__ */d(e,{open:W,onClose:()=>O(!1),initialFocus:null!=ne?void 0:$,footer:/* @__PURE__ */d(h,{children:[
13
- /* @__PURE__ */m("button",{ref:$,type:"button",onClick:()=>O(!1),className:w,children:U.cancelLabel||le.destructiveCancel}),
14
- /* @__PURE__ */m("button",{type:"button",onClick:()=>O(!0),disabled:!oe,className:re.button,children:ne??U.confirmLabel??le.destructiveConfirm})]}),children:[
15
- /* @__PURE__ */m("button",{type:"button",onClick:()=>O(!1),"aria-label":le.close,className:"absolute right-4 top-4 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:/* @__PURE__ */m(j,{})}),
12
+ /* @__PURE__ */d(e,{open:D,onClose:()=>Z(!1),initialFocus:null!=ne?void 0:W,footer:/* @__PURE__ */d(h,{children:[
13
+ /* @__PURE__ */m("button",{ref:W,type:"button",onClick:()=>Z(!1),className:w,children:Q.cancelLabel||le.destructiveCancel}),
14
+ /* @__PURE__ */m("button",{type:"button",onClick:()=>Z(!0),disabled:!oe,className:re.button,children:ne??Q.confirmLabel??le.destructiveConfirm})]}),children:[
15
+ /* @__PURE__ */m("button",{type:"button",onClick:()=>Z(!1),"aria-label":le.close,className:"absolute right-4 top-4 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:/* @__PURE__ */m(j,{})}),
16
16
  /* @__PURE__ */d("div",{className:"flex gap-4",children:[
17
17
  /* @__PURE__ */m("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${re.icon}`,children:/* @__PURE__ */m(L,{})}),
18
18
  /* @__PURE__ */d("div",{className:"flex-1",children:[
19
- /* @__PURE__ */m("h2",{className:"text-base font-semibold text-gray-900 pr-6",children:U.title||le.destructiveTitle}),
20
- /* @__PURE__ */m("p",{className:"mt-2 text-sm text-gray-600",children:U.message}),null!=ne&&/* @__PURE__ */d(h,{children:[
19
+ /* @__PURE__ */m("h2",{className:"text-base font-semibold text-gray-900 pr-6",children:Q.title||le.destructiveTitle}),
20
+ /* @__PURE__ */m("p",{className:"mt-2 text-sm text-gray-600",children:Q.message}),null!=ne&&/* @__PURE__ */d(h,{children:[
21
21
  /* @__PURE__ */d("p",{className:"mt-3 text-sm text-gray-700",children:[ie,
22
22
  /* @__PURE__ */m("kbd",{className:"rounded border border-line-strong bg-surface-sunken px-2 py-0.5 text-xs font-bold text-red-600 font-mono",children:ne}),se]}),
23
- /* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:X,onChange:e=>Y(e.target.value),onKeyDown:e=>{"Enter"===e.key&&X===ne&&O(!0)},placeholder:ne,className:`mt-2 ${P} focus:border-red-500`})]})]})]})]}),
24
- /* @__PURE__ */d(e,{open:R,onClose:()=>_(!1),title:Z.title||le.promptTitle,footer:/* @__PURE__ */d(h,{children:[
25
- /* @__PURE__ */m("button",{type:"button",onClick:()=>_(!1),className:w,children:Z.cancelLabel||le.cancel}),
26
- /* @__PURE__ */m("button",{type:"button",onClick:()=>_(!0),disabled:!Z.allowEmpty&&!z.trim(),className:C,children:Z.confirmLabel||le.ok})]}),children:[Z.message&&/* @__PURE__ */m("p",{className:"text-sm text-gray-600",children:Z.message}),
27
- /* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:z,onChange:e=>B(e.target.value),onKeyDown:e=>{"Enter"===e.key?_(!0):"Escape"===e.key&&_(!1)},onFocus:e=>e.target.select(),placeholder:Z.placeholder,className:`mt-3 ${P} focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]`})]})]})}export{F as ConfirmProvider,p as confirm,y as confirmDestructive,N as prompt,b as useConfirm};
23
+ /* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:X,onChange:e=>A(e.target.value),onKeyDown:e=>{"Enter"===e.key&&X===ne&&Z(!0)},placeholder:ne,className:`mt-2 ${P} focus:border-red-500`})]})]})]})]}),
24
+ /* @__PURE__ */d(e,{open:R,onClose:()=>_(!1),title:U.title||le.promptTitle,footer:/* @__PURE__ */d(h,{children:[
25
+ /* @__PURE__ */m("button",{type:"button",onClick:()=>_(!1),className:w,children:U.cancelLabel||le.cancel}),
26
+ /* @__PURE__ */m("button",{type:"button",onClick:()=>_(!0),disabled:!U.allowEmpty&&!z.trim(),className:C,children:U.confirmLabel||le.ok})]}),children:[U.message&&/* @__PURE__ */m("p",{className:"text-sm text-gray-600",children:U.message}),
27
+ /* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:z,onChange:e=>B(e.target.value),onKeyDown:e=>{"Enter"===e.key?_(!0):"Escape"===e.key&&_(!1)},onFocus:e=>e.target.select(),placeholder:U.placeholder,className:`mt-3 ${P} focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]`})]})]})}export{E as ConfirmProvider,p as confirm,y as confirmDestructive,N as prompt,b as useConfirm};
@@ -1 +1 @@
1
- import{useInsideTooltip as e,Tooltip as n}from"./chunk-BCDG4N6L.js";import{useRef as r,useState as t}from"react";import{jsx as c}from"react/jsx-runtime";var i="whitespace-nowrap";function l({children:i}){const l=e(),o=r(null),[a,s]=t(!1),m=/* @__PURE__ */c("span",{ref:o,className:"min-w-0 truncate",onMouseEnter:()=>{const e=o.current;s(!!e&&e.scrollWidth>e.clientWidth+1)},children:i});return l?m:/* @__PURE__ */c(n,{content:a?i:null,describe:!1,className:"relative inline-flex min-w-0 max-w-full",children:m})}export{l as OneLineLabel,i as TH_ONE_LINE};
1
+ import{useInsideTooltip as e,Tooltip as n}from"./chunk-6XBWM453.js";import{useRef as r,useState as t}from"react";import{jsx as c}from"react/jsx-runtime";var i="whitespace-nowrap";function l({children:i}){const l=e(),o=r(null),[a,s]=t(!1),m=/* @__PURE__ */c("span",{ref:o,className:"min-w-0 truncate",onMouseEnter:()=>{const e=o.current;s(!!e&&e.scrollWidth>e.clientWidth+1)},children:i});return l?m:/* @__PURE__ */c(n,{content:a?i:null,describe:!1,className:"relative inline-flex min-w-0 max-w-full",children:m})}export{l as OneLineLabel,i as TH_ONE_LINE};
@@ -1,7 +1,7 @@
1
- import{writeClipboard as e}from"./chunk-VC42SDAC.js";import{IconButton_default as r}from"./chunk-RUTUVS4H.js";import{toast_default as t}from"./chunk-OQW42DOR.js";import{Icon as n}from"./chunk-KKSVRIMP.js";import{useShellStrings as a}from"./chunk-X2PZMXDP.js";import{useState as i,useRef as o,useEffect as c,useCallback as l}from"react";import{jsxs as m,jsx as s,Fragment as d}from"react/jsx-runtime";var u={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},p={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function b(){/* @__PURE__ */
1
+ import{writeClipboard as e}from"./chunk-MQU3PZUS.js";import{IconButton_default as r}from"./chunk-PUF75SMJ.js";import{toast_default as t}from"./chunk-AKM6JBMD.js";import{Icon as n}from"./chunk-KKSVRIMP.js";import{useShellStrings as a}from"./chunk-4PAWQEXM.js";import{useState as i,useRef as o,useEffect as c,useCallback as l}from"react";import{jsxs as m,jsx as s,Fragment as d}from"react/jsx-runtime";var u={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},p={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function b(){/* @__PURE__ */
2
2
  return s(n,{name:"copy",className:"h-4 w-4","aria-hidden":"true"})}function h(){/* @__PURE__ */
3
- return s(n,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:n,children:y,symbol:f,label:x,size:g="md",variant:k="bordered",hideCopyButton:v=!1,onCopy:w,multiline:N=!1,id:j,"aria-describedby":C,className:T=""}){const[D,P]=i(!1),R=o(null),S=a().copy;c(()=>()=>{R.current&&clearTimeout(R.current)},[]);const V=l(async()=>{await e(n)?(P(!0),R.current&&clearTimeout(R.current),R.current=setTimeout(()=>{P(!1),R.current=null},2e3),w?.(n)):t.error(S.failed)},[n,w,S]),{box:B,button:K}=p[g],M=!v;/* @__PURE__ */
4
- return m("div",{id:M?void 0:j,"aria-describedby":M?void 0:C,className:["inline-flex max-w-full items-center rounded-md",u[k],B,T].filter(Boolean).join(" "),children:[null!=f&&""!==f&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:f}),
3
+ return s(n,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:n,children:y,symbol:f,label:x,size:g="md",variant:k="bordered",hideCopyButton:v=!1,onCopy:w,multiline:N=!1,id:j,"aria-describedby":M,className:P=""}){const[B,C]=i(!1),K=o(null),S=a().copy;c(()=>()=>{K.current&&clearTimeout(K.current)},[]);const T=l(async()=>{await e(n)?(C(!0),K.current&&clearTimeout(K.current),K.current=setTimeout(()=>{C(!1),K.current=null},2e3),w?.(n)):t.error(S.failed)},[n,w,S]),{box:U,button:A}=p[g],J=!v;/* @__PURE__ */
4
+ return m("div",{id:J?void 0:j,"aria-describedby":J?void 0:M,className:["inline-flex max-w-full items-center rounded-md",u[k],U,P].filter(Boolean).join(" "),children:[null!=f&&""!==f&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:f}),
5
5
  /* @__PURE__ */s("span",{className:"min-w-0 font-mono text-gray-800 "+(N?"whitespace-pre-wrap break-all":"truncate"),title:N?void 0:n,children:y??n}),!v&&/* @__PURE__ */m(d,{children:[
6
- /* @__PURE__ */s(r,{id:j,"aria-label":x?S.copyLabel(x):S.copy,"aria-describedby":C,onClick:V,className:`${K} text-gray-400`,children:/* @__PURE__ */s(D?h:b,{})}),
7
- /* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:D?S.copied:""})]})]})}export{y as Snippet};
6
+ /* @__PURE__ */s(r,{id:j,"aria-label":x?S.copyLabel(x):S.copy,"aria-describedby":M,onClick:T,className:`${A} text-gray-400`,children:/* @__PURE__ */s(B?h:b,{})}),
7
+ /* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:B?S.copied:""})]})]})}export{y as Snippet};
@@ -1,19 +1,19 @@
1
- import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as n}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as i,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-QODTON7V.js";import{useSettingAuto as d}from"./chunk-2NMW66P5.js";import{inputClasses as s,PLACEHOLDER_INK as c}from"./chunk-AYZY3YNC.js";import{useIsMobile as u}from"./chunk-UGTRSRIW.js";import{optionNoteClass as p}from"./chunk-URHGHXDN.js";import{Icon as m}from"./chunk-KKSVRIMP.js";import{onOverlayOpen as v}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as h}from"./chunk-62LW225J.js";import{useDropdownPosition as f,MENU_MAX_HEIGHT as b}from"./chunk-GLUJS42B.js";import{solidSurfaceStyle as g}from"./chunk-DTJRIWFR.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{useShellStrings as x}from"./chunk-X2PZMXDP.js";import{forwardRef as k,useId as N,useState as w,useRef as $,useMemo as D,useCallback as j,useEffect as S,useLayoutEffect as T}from"react";import{createPortal as H}from"react-dom";import{jsxs as I,jsx as O,Fragment as C}from"react/jsx-runtime";var E=e=>e.labelStyle?{lineHeight:1.25,...e.labelStyle}:void 0,z=k(function({value:e,onChange:t,options:r,placeholder:n,invalid:i,className:a="",size:l,touchSize:o,renderOption:c,renderValue:u,valueText:p,readOnly:m,footer:v,changed:h,auto:f,multiple:b,"aria-describedby":g,...y},k){const w=t,$=x(),D=d(),j=f??D,S=N(),T=/* @__PURE__ */I("select",{ref:k,value:e,multiple:b||void 0,onChange:e=>w(b?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":i||void 0,"aria-describedby":[g,j?S:void 0].filter(Boolean).join(" ")||void 0,className:s({invalid:i,size:l,auto:j,className:`pr-8 ${a}`.trim()}),...y,children:[void 0!==n&&!b&&/* @__PURE__ */O("option",{value:"",disabled:!0,children:n}),
2
- /* @__PURE__ */O(R,{items:r})]});return j?/* @__PURE__ */I(C,{children:[T,
3
- /* @__PURE__ */O("span",{id:S,hidden:!0,children:$.settingView.auto})]}):T});function R({items:e}){const t=e=>/* @__PURE__ */O("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
4
- return O(C,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */O("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var K=k(function({value:l,onChange:u,options:k,placeholder:z,invalid:K,className:P="",id:V,disabled:A,size:U,touchSize:B,title:M,multiple:W,renderOption:F,renderValue:L,valueText:G,readOnly:X=!1,footer:Y,changed:J=!1,auto:q,"aria-describedby":Q,"aria-label":Z,"aria-labelledby":_,...ee},te){const[re,ne]=w(!1),[ie,ae]=w(-1),le=$(null),oe=$(null),de=$(null),se=$(null),ce=$([]),ue=()=>se.current??de.current,pe=!!Y?.length,me="sm"===U,ve=me?"min-h-7 px-3 py-1 text-xs leading-4":"min-h-(--row-height-menu) px-3 py-2 text-sm leading-5",he=p(me),[fe,be]=w(null),ge=x(),ye=$(re);ye.current=re;const xe=$({buffer:"",timer:null}),ke=N(),Ne=`${ke}-listbox`,we=V??`${ke}-trigger`,$e=e=>`${ke}-opt-${e}`,De=`${ke}-changed`,je=d(),Se=q??je,Te=`${ke}-auto`,He=[Q,J?De:void 0,Se?Te:void 0].filter(Boolean).join(" ")||void 0,Ie=D(()=>i(k),[k]),Oe=W?l:[],Ce=u,Ee=f(oe,re,{matchTriggerWidth:!0,...Y?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),ze="undefined"==typeof window?S:T,Re=`${re}|${Ee?.top}|${Ee?.bottom}|${Ee?.maxHeight}|${k.length}`;ze(()=>{be(null)},[Re]),ze(()=>{const e=de.current;if(!re||!e||null!==fe)return;if(e.scrollHeight<=e.clientHeight+1)return;const t=getComputedStyle(e),r=parseFloat(t.paddingTop)||0;parseFloat(t.paddingBottom);const n=e.getBoundingClientRect().top;let i=0;for(const t of e.querySelectorAll('[role="option"]')){const r=t.getBoundingClientRect().bottom-n+e.scrollTop;if(!(r<=e.clientHeight+.5))break;i=r}i>r&&be(Math.floor(i))},[re,fe,Re]);const Ke=W?Ie.findIndex(e=>Oe.includes(e.value)):Ie.findIndex(e=>e.value===l),Pe=W?Ie.filter(e=>Oe.includes(e.value)).map(e=>e.label).join(", ")||void 0:Ke>=0?Ie[Ke].label:void 0,Ve=!W&&Ke>=0?Ie[Ke].lang:void 0,Ae=W?Ie.filter(e=>Oe.includes(e.value)):Ke>=0?[Ie[Ke]]:[],Ue=L&&Ae.length?L(Ae):void 0,Be=void 0!==Ue&&G?G(Ae):void 0,Me=j((e=!0)=>{ne(!1),ae(-1),e&&oe.current?.focus()},[]),We=j(()=>{A||X||(ae(Ke>=0?Ke:e(Ie)),ne(!0))},[A,X,Ie,Ke]),Fe=j(e=>{const t=Ie[e];if(t&&!t.disabled){if(W){const r=l;return Ce(r.includes(t.value)?r.filter(e=>e!==t.value):[...r,t.value]),void ae(e)}Ce(t.value),Me()}},[Ie,W,l,Ce,Me]);S(()=>{if(!re)return;return y(e=>!("Escape"!==e.key||!ye.current)&&(Me(),!0),ue)},[re,Me]),S(()=>{if(!re)return;const e=e=>{const t=e.target;le.current?.contains(t)||ue()?.contains(t)||Me(!1)};document.addEventListener("pointerdown",e);const t=v(()=>Me(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[re,Me]),S(()=>{!re||ie<0||de.current?.querySelector(`#${CSS.escape($e(ie))}`)?.scrollIntoView({block:"nearest"})},[re,ie]);const Le=j(e=>{const r=xe.current;r.timer&&clearTimeout(r.timer),r.buffer+=e,r.timer=setTimeout(()=>{r.buffer="",r.timer=null},500);const n=re?ie:Ke,i=t(Ie,r.buffer,n);i<0||(re?ae(i):W?(ae(i),ne(!0)):Fe(i))},[re,ie,Ke,Ie,Fe,W]),Ge=re?a(k,(e,t)=>{const r=(n=e.value,W?Oe.includes(n):l===n);var n;const i=t===ie;/* @__PURE__ */
5
- return I("div",{id:$e(t),role:"option",lang:e.description||e.labelStyle||F?void 0:e.lang,"aria-selected":r,"aria-disabled":e.disabled||void 0,onPointerEnter:()=>{e.disabled||ae(t)},onClick:()=>Fe(t),className:`mx-1 cursor-pointer truncate rounded-lg ${ve}${W?" flex items-center gap-2":""}\n ${e.disabled?"cursor-not-allowed text-gray-400":i?"bg-blue-50 text-blue-700":r?"font-medium text-blue-600":"text-gray-700"}`,children:[W&&/* @__PURE__ */O(o,{selected:r}),F?/* @__PURE__ */O("span",{className:"block min-w-0 flex-1 truncate",children:F(e,{selected:r,active:i})}):W?/* @__PURE__ */I("span",{className:"block min-w-0 flex-1",children:[
6
- /* @__PURE__ */O("span",{lang:e.lang,className:"block truncate",style:E(e),children:e.label}),e.description&&/* @__PURE__ */O("span",{className:he,children:e.description})]}):e.description||e.labelStyle?
7
- /* @__PURE__ */I(C,{children:[
8
- /* @__PURE__ */O("span",{lang:e.lang,className:"block truncate",style:E(e),children:e.label}),e.description&&/* @__PURE__ */O("span",{className:he,children:e.description})]}):e.label]},e.value)},ke,"mx-1"):null,Xe=void 0!==Ue?
9
- /* @__PURE__ */I("span",{className:"relative block min-w-0 truncate",children:[
1
+ import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as n}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as i,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-QODTON7V.js";import{useSettingAuto as d}from"./chunk-2NMW66P5.js";import{inputClasses as s,PLACEHOLDER_INK as c}from"./chunk-AYZY3YNC.js";import{useIsMobile as u}from"./chunk-UGTRSRIW.js";import{optionNoteClass as p}from"./chunk-URHGHXDN.js";import{Icon as m}from"./chunk-KKSVRIMP.js";import{onOverlayOpen as v}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as h}from"./chunk-62LW225J.js";import{useDropdownPosition as f,MENU_MAX_HEIGHT as b}from"./chunk-GLUJS42B.js";import{solidSurfaceStyle as g}from"./chunk-F27JJHNJ.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{useShellStrings as x}from"./chunk-4PAWQEXM.js";import{forwardRef as N,useId as k,useState as w,useRef as $,useMemo as D,useCallback as j,useEffect as S,useLayoutEffect as H}from"react";import{createPortal as T}from"react-dom";import{jsxs as E,jsx as O,Fragment as C}from"react/jsx-runtime";var I=e=>e.labelStyle?{lineHeight:1.25,...e.labelStyle}:void 0,z=N(function({value:e,onChange:t,options:r,placeholder:n,invalid:i,className:a="",size:l,touchSize:o,renderOption:c,renderValue:u,valueText:p,readOnly:m,footer:v,changed:h,auto:f,multiple:b,"aria-describedby":g,...y},N){const w=t,$=x(),D=d(),j=f??D,S=k(),H=/* @__PURE__ */E("select",{ref:N,value:e,multiple:b||void 0,onChange:e=>w(b?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":i||void 0,"aria-describedby":[g,j?S:void 0].filter(Boolean).join(" ")||void 0,className:s({invalid:i,size:l,auto:j,className:`pr-8 ${a}`.trim()}),...y,children:[void 0!==n&&!b&&/* @__PURE__ */O("option",{value:"",disabled:!0,children:n}),
2
+ /* @__PURE__ */O(A,{items:r})]});return j?/* @__PURE__ */E(C,{children:[H,
3
+ /* @__PURE__ */O("span",{id:S,hidden:!0,children:$.settingView.auto})]}):H});function A({items:e}){const t=e=>/* @__PURE__ */O("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
4
+ return O(C,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */O("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var K=N(function({value:l,onChange:u,options:N,placeholder:z,invalid:K,className:V="",id:P,disabled:R,size:U,touchSize:B,title:M,multiple:W,renderOption:F,renderValue:J,valueText:L,readOnly:G=!1,footer:Y,changed:Q=!1,auto:X,"aria-describedby":q,"aria-label":Z,"aria-labelledby":_,...ee},te){const[re,ne]=w(!1),[ie,ae]=w(-1),le=$(null),oe=$(null),de=$(null),se=$(null),ce=$([]),ue=()=>se.current??de.current,pe=!!Y?.length,me="sm"===U,ve=me?"min-h-7 px-3 py-1 text-xs leading-4":"min-h-(--row-height-menu) px-3 py-2 text-sm leading-5",he=p(me),[fe,be]=w(null),ge=x(),ye=$(re);ye.current=re;const xe=$({buffer:"",timer:null}),Ne=k(),ke=`${Ne}-listbox`,we=P??`${Ne}-trigger`,$e=e=>`${Ne}-opt-${e}`,De=`${Ne}-changed`,je=d(),Se=X??je,He=`${Ne}-auto`,Te=[q,Q?De:void 0,Se?He:void 0].filter(Boolean).join(" ")||void 0,Ee=D(()=>i(N),[N]),Oe=W?l:[],Ce=u,Ie=f(oe,re,{matchTriggerWidth:!0,...Y?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),ze="undefined"==typeof window?S:H,Ae=`${re}|${Ie?.top}|${Ie?.bottom}|${Ie?.maxHeight}|${N.length}`;ze(()=>{be(null)},[Ae]),ze(()=>{const e=de.current;if(!re||!e||null!==fe)return;if(e.scrollHeight<=e.clientHeight+1)return;const t=getComputedStyle(e),r=parseFloat(t.paddingTop)||0;parseFloat(t.paddingBottom);const n=e.getBoundingClientRect().top;let i=0;for(const t of e.querySelectorAll('[role="option"]')){const r=t.getBoundingClientRect().bottom-n+e.scrollTop;if(!(r<=e.clientHeight+.5))break;i=r}i>r&&be(Math.floor(i))},[re,fe,Ae]);const Ke=W?Ee.findIndex(e=>Oe.includes(e.value)):Ee.findIndex(e=>e.value===l),Ve=W?Ee.filter(e=>Oe.includes(e.value)).map(e=>e.label).join(", ")||void 0:Ke>=0?Ee[Ke].label:void 0,Pe=!W&&Ke>=0?Ee[Ke].lang:void 0,Re=W?Ee.filter(e=>Oe.includes(e.value)):Ke>=0?[Ee[Ke]]:[],Ue=J&&Re.length?J(Re):void 0,Be=void 0!==Ue&&L?L(Re):void 0,Me=j((e=!0)=>{ne(!1),ae(-1),e&&oe.current?.focus()},[]),We=j(()=>{R||G||(ae(Ke>=0?Ke:e(Ee)),ne(!0))},[R,G,Ee,Ke]),Fe=j(e=>{const t=Ee[e];if(t&&!t.disabled){if(W){const r=l;return Ce(r.includes(t.value)?r.filter(e=>e!==t.value):[...r,t.value]),void ae(e)}Ce(t.value),Me()}},[Ee,W,l,Ce,Me]);S(()=>{if(!re)return;return y(e=>!("Escape"!==e.key||!ye.current)&&(Me(),!0),ue)},[re,Me]),S(()=>{if(!re)return;const e=e=>{const t=e.target;le.current?.contains(t)||ue()?.contains(t)||Me(!1)};document.addEventListener("pointerdown",e);const t=v(()=>Me(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[re,Me]),S(()=>{!re||ie<0||de.current?.querySelector(`#${CSS.escape($e(ie))}`)?.scrollIntoView({block:"nearest"})},[re,ie]);const Je=j(e=>{const r=xe.current;r.timer&&clearTimeout(r.timer),r.buffer+=e,r.timer=setTimeout(()=>{r.buffer="",r.timer=null},500);const n=re?ie:Ke,i=t(Ee,r.buffer,n);i<0||(re?ae(i):W?(ae(i),ne(!0)):Fe(i))},[re,ie,Ke,Ee,Fe,W]),Le=re?a(N,(e,t)=>{const r=(n=e.value,W?Oe.includes(n):l===n);var n;const i=t===ie;/* @__PURE__ */
5
+ return E("div",{id:$e(t),role:"option",lang:e.description||e.labelStyle||F?void 0:e.lang,"aria-selected":r,"aria-disabled":e.disabled||void 0,onPointerEnter:()=>{e.disabled||ae(t)},onClick:()=>Fe(t),className:`mx-1 cursor-pointer truncate rounded-lg ${ve}${W?" flex items-center gap-2":""}\n ${e.disabled?"cursor-not-allowed text-gray-400":i?"bg-blue-50 text-blue-700":r?"font-medium text-blue-600":"text-gray-700"}`,children:[W&&/* @__PURE__ */O(o,{selected:r}),F?/* @__PURE__ */O("span",{className:"block min-w-0 flex-1 truncate",children:F(e,{selected:r,active:i})}):W?/* @__PURE__ */E("span",{className:"block min-w-0 flex-1",children:[
6
+ /* @__PURE__ */O("span",{lang:e.lang,className:"block truncate",style:I(e),children:e.label}),e.description&&/* @__PURE__ */O("span",{className:he,children:e.description})]}):e.description||e.labelStyle?
7
+ /* @__PURE__ */E(C,{children:[
8
+ /* @__PURE__ */O("span",{lang:e.lang,className:"block truncate",style:I(e),children:e.label}),e.description&&/* @__PURE__ */O("span",{className:he,children:e.description})]}):e.label]},e.value)},Ne,"mx-1"):null,Ge=void 0!==Ue?
9
+ /* @__PURE__ */E("span",{className:"relative block min-w-0 truncate",children:[
10
10
  /* @__PURE__ */O("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:Ue}),
11
- /* @__PURE__ */O("span",{lang:void 0===Be?Ve:void 0,className:"sr-only",children:Be??Pe})]}):/* @__PURE__ */O("span",{lang:Ve,className:`block truncate ${void 0===Pe?c:""}`,children:Pe??z??" "}),Ye={zIndex:h.popup,left:Ee?.left,top:Ee?.top,bottom:Ee?.bottom,width:Ee?.width,maxHeight:Ee?.maxHeight??b,visibility:Ee?void 0:"hidden",...g()},Je=/* @__PURE__ */O("div",{ref:de,id:Ne,role:"listbox","aria-labelledby":_??(Z?void 0:we),"aria-label":_?void 0:Z,"aria-multiselectable":W||void 0,className:pe?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:pe?null!==fe?{maxHeight:fe}:void 0:null!==fe?{...Ye,maxHeight:fe}:Ye,children:Ge}),qe=pe?/* @__PURE__ */I("div",{ref:se,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:Ye,children:[Je,
12
- /* @__PURE__ */O("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:Y.map((e,t)=>/* @__PURE__ */I("button",{ref:e=>{ce.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(Me(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(Y?.length??0)-1,n=t=>{e.preventDefault(),ce.current[t]?.focus()},i=()=>{e.preventDefault(),oe.current?.focus()};switch(e.key){case"ArrowDown":return void n(Math.min(t+1,r));case"ArrowUp":return void(0===t?i():n(t-1));case"Home":return void n(0);case"End":return void n(r);case"Tab":return e.shiftKey?void(0===t?i():n(t-1)):t<r?void n(t+1):(e.preventDefault(),void Me());case"Escape":return e.preventDefault(),e.stopPropagation(),void Me()}})(e,t),className:`flex w-full items-center gap-2 rounded-lg ${ve} text-left rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${e.disabled?"cursor-not-allowed text-ink-faintest":"cursor-pointer text-ink hover:bg-accent-tint hover:text-blue-700"}`,children:[e.icon&&/* @__PURE__ */O(m,{name:e.icon,"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
13
- /* @__PURE__ */O("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):Je;/* @__PURE__ */
14
- return I("div",{ref:le,className:"relative",children:[
15
- /* @__PURE__ */O("button",{ref:oe,id:we,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":re,"aria-controls":re?Ne:void 0,"aria-activedescendant":re&&ie>=0?$e(ie):void 0,"aria-invalid":K||void 0,"aria-describedby":He,"aria-label":Z,"aria-labelledby":_,title:M,disabled:A,"aria-readonly":X||void 0,onClick:()=>re?Me():We(),onKeyDown:t=>{if(!A&&!X)switch(t.key){case"ArrowDown":return t.preventDefault(),void(re?ae(e=>n(Ie,e,1)):We());case"ArrowUp":return t.preventDefault(),void(re?ae(e=>n(Ie,e,-1)):We());case"Home":return void(re&&(t.preventDefault(),ae(e(Ie))));case"End":return void(re&&(t.preventDefault(),ae(r(Ie))));case"Enter":return void(re&&(t.preventDefault(),Fe(ie)));case" ":return t.preventDefault(),void(re?Fe(ie):We());case"Escape":return void(re&&(t.preventDefault(),t.stopPropagation(),Me()));case"Tab":return re&&pe&&!t.shiftKey?(t.preventDefault(),void ce.current[0]?.focus()):void(re&&Me(!1));default:1!==t.key.length||t.metaKey||t.ctrlKey||t.altKey||(t.preventDefault(),Le(t.key))}},className:s({invalid:K,size:U,readOnly:X,auto:Se,className:`${X?"":"pr-8 "}text-left ${P}`.trim()}),children:J?
16
- /* @__PURE__ */I("span",{className:"flex min-w-0 items-center gap-1",children:[Xe,
17
- /* @__PURE__ */O("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):Xe}),J&&/* @__PURE__ */O("span",{id:De,hidden:!0,children:ge.select.changed}),Se&&/* @__PURE__ */O("span",{id:Te,hidden:!0,children:ge.settingView.auto}),!X&&/* @__PURE__ */O(m,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${c}`,strokeWidth:2}),
18
- /* @__PURE__ */I("select",{ref:te,value:l,multiple:W||void 0,onChange:e=>Ce(W?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:A,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...ee,children:[void 0!==z&&!W&&/* @__PURE__ */O("option",{value:"",disabled:!0,children:z}),
19
- /* @__PURE__ */O(R,{items:k})]}),re&&H(qe,document.body)]})}),P=k(function({touchSize:e,...t},r){const n=u(),i=e??"touch";return!n||void 0===t.footer&&void 0===t.changed||t.readOnly?n&&!t.readOnly?/* @__PURE__ */O(z,{ref:r,...t,size:i}):/* @__PURE__ */O(K,{ref:r,...t}):/* @__PURE__ */O(K,{ref:r,...t,size:i})});export{z as NativeSelect,P as Select_default};
11
+ /* @__PURE__ */O("span",{lang:void 0===Be?Pe:void 0,className:"sr-only",children:Be??Ve})]}):/* @__PURE__ */O("span",{lang:Pe,className:`block truncate ${void 0===Ve?c:""}`,children:Ve??z??" "}),Ye={zIndex:h.popup,left:Ie?.left,top:Ie?.top,bottom:Ie?.bottom,width:Ie?.width,maxHeight:Ie?.maxHeight??b,visibility:Ie?void 0:"hidden",...g()},Qe=/* @__PURE__ */O("div",{ref:de,id:ke,role:"listbox","aria-labelledby":_??(Z?void 0:we),"aria-label":_?void 0:Z,"aria-multiselectable":W||void 0,className:pe?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:pe?null!==fe?{maxHeight:fe}:void 0:null!==fe?{...Ye,maxHeight:fe}:Ye,children:Le}),Xe=pe?/* @__PURE__ */E("div",{ref:se,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:Ye,children:[Qe,
12
+ /* @__PURE__ */O("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:Y.map((e,t)=>/* @__PURE__ */E("button",{ref:e=>{ce.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(Me(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(Y?.length??0)-1,n=t=>{e.preventDefault(),ce.current[t]?.focus()},i=()=>{e.preventDefault(),oe.current?.focus()};switch(e.key){case"ArrowDown":return void n(Math.min(t+1,r));case"ArrowUp":return void(0===t?i():n(t-1));case"Home":return void n(0);case"End":return void n(r);case"Tab":return e.shiftKey?void(0===t?i():n(t-1)):t<r?void n(t+1):(e.preventDefault(),void Me());case"Escape":return e.preventDefault(),e.stopPropagation(),void Me()}})(e,t),className:`flex w-full items-center gap-2 rounded-lg ${ve} text-left rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${e.disabled?"cursor-not-allowed text-ink-faintest":"cursor-pointer text-ink hover:bg-accent-tint hover:text-blue-700"}`,children:[e.icon&&/* @__PURE__ */O(m,{name:e.icon,"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
13
+ /* @__PURE__ */O("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):Qe;/* @__PURE__ */
14
+ return E("div",{ref:le,className:"relative",children:[
15
+ /* @__PURE__ */O("button",{ref:oe,id:we,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":re,"aria-controls":re?ke:void 0,"aria-activedescendant":re&&ie>=0?$e(ie):void 0,"aria-invalid":K||void 0,"aria-describedby":Te,"aria-label":Z,"aria-labelledby":_,title:M,disabled:R,"aria-readonly":G||void 0,onClick:()=>re?Me():We(),onKeyDown:t=>{if(!R&&!G)switch(t.key){case"ArrowDown":return t.preventDefault(),void(re?ae(e=>n(Ee,e,1)):We());case"ArrowUp":return t.preventDefault(),void(re?ae(e=>n(Ee,e,-1)):We());case"Home":return void(re&&(t.preventDefault(),ae(e(Ee))));case"End":return void(re&&(t.preventDefault(),ae(r(Ee))));case"Enter":return void(re&&(t.preventDefault(),Fe(ie)));case" ":return t.preventDefault(),void(re?Fe(ie):We());case"Escape":return void(re&&(t.preventDefault(),t.stopPropagation(),Me()));case"Tab":return re&&pe&&!t.shiftKey?(t.preventDefault(),void ce.current[0]?.focus()):void(re&&Me(!1));default:1!==t.key.length||t.metaKey||t.ctrlKey||t.altKey||(t.preventDefault(),Je(t.key))}},className:s({invalid:K,size:U,readOnly:G,auto:Se,className:`${G?"":"pr-8 "}text-left ${V}`.trim()}),children:Q?
16
+ /* @__PURE__ */E("span",{className:"flex min-w-0 items-center gap-1",children:[Ge,
17
+ /* @__PURE__ */O("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):Ge}),Q&&/* @__PURE__ */O("span",{id:De,hidden:!0,children:ge.select.changed}),Se&&/* @__PURE__ */O("span",{id:He,hidden:!0,children:ge.settingView.auto}),!G&&/* @__PURE__ */O(m,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${c}`,strokeWidth:2}),
18
+ /* @__PURE__ */E("select",{ref:te,value:l,multiple:W||void 0,onChange:e=>Ce(W?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:R,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...ee,children:[void 0!==z&&!W&&/* @__PURE__ */O("option",{value:"",disabled:!0,children:z}),
19
+ /* @__PURE__ */O(A,{items:N})]}),re&&T(Xe,document.body)]})}),V=N(function({touchSize:e,...t},r){const n=u(),i=e??"touch";return!n||void 0===t.footer&&void 0===t.changed||t.readOnly?n&&!t.readOnly?/* @__PURE__ */O(z,{ref:r,...t,size:i}):/* @__PURE__ */O(K,{ref:r,...t}):/* @__PURE__ */O(K,{ref:r,...t,size:i})});export{z as NativeSelect,V as Select_default};
@@ -1,2 +1,2 @@
1
- import{Z_LAYERS as t}from"./chunk-62LW225J.js";import{VIEWPORT_MARGIN as e,placeMenu as r,followRect as n}from"./chunk-GLUJS42B.js";import{useHydrated as o,useBrowserLayoutEffect as i}from"./chunk-D65T4H6J.js";import{solidSurfaceStyle as s}from"./chunk-DTJRIWFR.js";import{useRef as c,useCallback as a,useEffect as u}from"react";import{createPortal as d}from"react-dom";import{jsx as l}from"react/jsx-runtime";var f=()=>({left:0,top:0,right:window.innerWidth,bottom:window.innerHeight});function p({anchor:p,bounds:m,side:h="top",align:b="start","aria-label":g,children:x,className:w=""}){const v=o(),j=c(null),W=c(p);W.current=p;const k=c(m);k.current=m;const y=a(()=>{const t=j.current,n=W.current();if(!t||!n)return;const o=(k.current??f)(),i=t.style;i.maxWidth=`${Math.max(0,o.right-o.left-2*e)}px`;const s=r({trigger:n,menu:{width:t.offsetWidth,height:t.offsetHeight},bounds:o,align:b,side:h});i.left=`${s.left}px`,i.top=`${s.top}px`,t.dataset.side=s.side},[b,h]);i(()=>{v&&y()}),u(()=>{if(!v)return;const t=n(()=>W.current(),y),e=j.current;if(!e||"undefined"==typeof ResizeObserver)return t;const r=new ResizeObserver(()=>y());return r.observe(e),()=>{t(),r.disconnect()}},[v,y]);return v&&p()?d(
2
- /* @__PURE__ */l("div",{ref:j,role:"group","aria-label":g,"data-floating-bar":"",onMouseDown:t=>{const e=t.target;e?.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])')||t.preventDefault()},className:`fixed rounded-(--radius-popup) p-1 ${w}`.trim(),style:{...s(),position:"fixed",left:0,top:0,zIndex:t.popup},children:x}),document.body):null}export{p as FloatingBar};
1
+ import{Z_LAYERS as t}from"./chunk-62LW225J.js";import{VIEWPORT_MARGIN as e,placeMenu as r,followRect as n}from"./chunk-GLUJS42B.js";import{useHydrated as o,useBrowserLayoutEffect as i}from"./chunk-D65T4H6J.js";import{solidSurfaceStyle as s}from"./chunk-F27JJHNJ.js";import{useRef as c,useCallback as a,useEffect as u}from"react";import{createPortal as d}from"react-dom";import{jsx as l}from"react/jsx-runtime";var f=()=>({left:0,top:0,right:window.innerWidth,bottom:window.innerHeight});function p({anchor:p,bounds:m,side:h="top",align:b="start","aria-label":g,children:x,className:w=""}){const v=o(),J=c(null),j=c(p);j.current=p;const k=c(m);k.current=m;const y=a(()=>{const t=J.current,n=j.current();if(!t||!n)return;const o=(k.current??f)(),i=t.style;i.maxWidth=`${Math.max(0,o.right-o.left-2*e)}px`;const s=r({trigger:n,menu:{width:t.offsetWidth,height:t.offsetHeight},bounds:o,align:b,side:h});i.left=`${s.left}px`,i.top=`${s.top}px`,t.dataset.side=s.side},[b,h]);i(()=>{v&&y()}),u(()=>{if(!v)return;const t=n(()=>j.current(),y),e=J.current;if(!e||"undefined"==typeof ResizeObserver)return t;const r=new ResizeObserver(()=>y());return r.observe(e),()=>{t(),r.disconnect()}},[v,y]);return v&&p()?d(
2
+ /* @__PURE__ */l("div",{ref:J,role:"group","aria-label":g,"data-floating-bar":"",onMouseDown:t=>{const e=t.target;e?.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])')||t.preventDefault()},className:`fixed rounded-(--radius-popup) p-1 ${w}`.trim(),style:{...s(),position:"fixed",left:0,top:0,zIndex:t.popup},children:x}),document.body):null}export{p as FloatingBar};
@@ -1 +1 @@
1
- import{client_default as a}from"./chunk-N6TK43YN.js";var t=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),e="uploaded:wallpaper";function r(a,t){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===e?t||"":a}var l=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=(t,e)=>{const r=new FormData;r.append("wallpaper",t);const l=e?{onUploadProgress:a=>e(a.total?Math.round(a.loaded/a.total*100):null)}:void 0;return a.post("/auth/me/wallpaper/",r,l).then(a=>a.data)},p=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function o(a){const t=a?.response?.status,e=a?.response?.data,r=Array.isArray(e?.wallpaper)?e.wallpaper[0]:void 0;return r||(413===t?"That picture is too large to use as a wallpaper.":415===t?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{e as WALLPAPER_PREF_TOKEN,p as deleteWallpaper,t as getNumberingConfigs,l as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,o as wallpaperUploadError};
1
+ import{client_default as a}from"./chunk-RP3GUVAI.js";var t=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),e="uploaded:wallpaper";function r(a,t){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===e?t||"":a}var l=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=(t,e)=>{const r=new FormData;r.append("wallpaper",t);const l=e?{onUploadProgress:a=>e(a.total?Math.round(a.loaded/a.total*100):null)}:void 0;return a.post("/auth/me/wallpaper/",r,l).then(a=>a.data)},p=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function o(a){const t=a?.response?.status,e=a?.response?.data,r=Array.isArray(e?.wallpaper)?e.wallpaper[0]:void 0;return r||(413===t?"That picture is too large to use as a wallpaper.":415===t?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{e as WALLPAPER_PREF_TOKEN,p as deleteWallpaper,t as getNumberingConfigs,l as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,o as wallpaperUploadError};
@@ -1,4 +1,4 @@
1
- import{Card as e}from"./chunk-CBGKLHPB.js";import{Select_default as l}from"./chunk-ZLHPCPXS.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Banner as i}from"./chunk-6FPDOEOX.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-TOVKWNI2.js";import{Select_default as l}from"./chunk-N4DI5F74.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Banner as i}from"./chunk-GSKLHUQ6.js";import{Input_default as c}from"./chunk-MAMWQCJ6.js";import{Button_default as s}from"./chunk-I4VIEGCX.js";import{useState as d}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";var h=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function m(){const[m,o]=d(!0),[p,u]=d("us"),y=h.reduce((e,l)=>e+l.qty*l.price,0),g=y+9;/* @__PURE__ */
2
2
  return n("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */t("div",{className:"mx-auto max-w-5xl space-y-5",children:[
3
3
  /* @__PURE__ */n("h1",{className:"text-xl font-semibold text-gray-900",children:"Checkout"}),
4
4
  /* @__PURE__ */t("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-3",children:[
@@ -1,4 +1,4 @@
1
- import{Icon as e}from"./chunk-KKSVRIMP.js";import{useShellStrings as i}from"./chunk-X2PZMXDP.js";import{Fragment as t}from"react";import{jsx as n,jsxs as a}from"react/jsx-runtime";var s=/* @__PURE__ */n(e,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 text-gray-300","aria-hidden":!0}),r="inline-flex min-w-0 items-center gap-1 truncate rounded px-1 -mx-1 text-gray-500 transition-colors hover:text-gray-900 hover:underline rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]";function l({items:e,separator:l,maxItems:c=0,className:m}){const o=i().breadcrumbs;if(0===e.length)return null;const h=l??s,d=[],u=e.length-1;if(c>0&&e.length>c&&c>=2){const i=Math.max(1,c-1);d.push({kind:"item",item:e[0],isLast:!1}),d.push({kind:"ellipsis"});for(let t=e.length-i;t<=u;t++)d.push({kind:"item",item:e[t],isLast:t===u})}else e.forEach((e,i)=>d.push({kind:"item",item:e,isLast:i===u}));/* @__PURE__ */
1
+ import{Icon as e}from"./chunk-KKSVRIMP.js";import{useShellStrings as i}from"./chunk-4PAWQEXM.js";import{Fragment as t}from"react";import{jsx as n,jsxs as a}from"react/jsx-runtime";var s=/* @__PURE__ */n(e,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 text-gray-300","aria-hidden":!0}),r="inline-flex min-w-0 items-center gap-1 truncate rounded px-1 -mx-1 text-gray-500 transition-colors hover:text-gray-900 hover:underline rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]";function l({items:e,separator:l,maxItems:c=0,className:m}){const o=i().breadcrumbs;if(0===e.length)return null;const h=l??s,d=[],u=e.length-1;if(c>0&&e.length>c&&c>=2){const i=Math.max(1,c-1);d.push({kind:"item",item:e[0],isLast:!1}),d.push({kind:"ellipsis"});for(let t=e.length-i;t<=u;t++)d.push({kind:"item",item:e[t],isLast:t===u})}else e.forEach((e,i)=>d.push({kind:"item",item:e,isLast:i===u}));/* @__PURE__ */
2
2
  return n("nav",{"aria-label":o.label,className:`min-w-0 ${m??""}`,children:/* @__PURE__ */n("ol",{className:"flex items-center gap-2 text-sm",children:d.map((e,i)=>/* @__PURE__ */a(t,{children:[i>0&&/* @__PURE__ */n("li",{"aria-hidden":!0,className:"flex items-center",children:h}),
3
3
  /* @__PURE__ */n("li",{className:"flex min-w-0 items-center",children:"ellipsis"===e.kind?/* @__PURE__ */n("span",{className:"px-0.5 text-gray-400 select-none","aria-label":o.hidden,children:"…"}):e.isLast||!e.item.href&&!e.item.onClick?/* @__PURE__ */a("span",{"aria-current":e.isLast?"page":void 0,className:"inline-flex min-w-0 items-center gap-1 truncate "+(e.isLast?"font-medium text-gray-900":"text-gray-500"),children:[e.item.icon,
4
4
  /* @__PURE__ */n("span",{className:"truncate",children:e.item.label})]}):e.item.href?/* @__PURE__ */a("a",{href:e.item.href,onClick:e.item.onClick,className:r,children:[e.item.icon,
@@ -1,2 +1,2 @@
1
- import{swallowPress as e,describedByWith as r,OffWithReason as i}from"./chunk-HL6JSDN3.js";import{Tooltip as o}from"./chunk-BCDG4N6L.js";import{useId as a,useRef as n}from"react";import{jsx as t}from"react/jsx-runtime";var l={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]};function s({label:s,value:d,points:c,onChange:u,disabled:b=!1,disabledReason:v,id:f,className:g=""}){const h=a(),m=n([]),p=c.findIndex(e=>e.value===d),x=c.findIndex(e=>!b&&!0!==e.disabled),w=p>=0?p:Math.max(0,x);/* @__PURE__ */
1
+ import{swallowPress as e,describedByWith as r,OffWithReason as i}from"./chunk-34URULVW.js";import{Tooltip as o}from"./chunk-6XBWM453.js";import{useId as a,useRef as n}from"react";import{jsx as t}from"react/jsx-runtime";var l={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]};function s({label:s,value:d,points:c,onChange:u,disabled:b=!1,disabledReason:v,id:f,className:g=""}){const h=a(),m=n([]),p=c.findIndex(e=>e.value===d),x=c.findIndex(e=>!b&&!0!==e.disabled),w=p>=0?p:Math.max(0,x);/* @__PURE__ */
2
2
  return t("div",{id:f,role:"radiogroup","aria-label":s,className:`grid w-max grid-cols-3 gap-px overflow-hidden rounded-(--radius-control) border border-line bg-gray-200 ${g}`.trim(),children:c.map((a,n)=>{const s=d===a.value,f=b||!0===a.disabled,g=f&&(!0===a.disabled&&a.title||(b?v:void 0))||void 0,p=`${h}-${n}`,x=/* @__PURE__ */t("button",{type:"button",role:"radio","aria-checked":s,"aria-label":a.label,"aria-disabled":f||void 0,"aria-describedby":r(void 0,g?p:void 0),ref:e=>{m.current[n]=e},tabIndex:n===w?0:-1,onKeyDown:e=>((e,r)=>{const i=l[r.key];if(!i)return;r.preventDefault();const o=Math.floor(e/3)+i[0],a=e%3+i[1];if(o<0||a<0||a>=3)return;const n=3*o+a;if(n>=c.length)return;m.current[n]?.focus();const t=c[n];b||!0===t.disabled||t.value===d||u(t.value)})(n,e),onClick:f?e:()=>u(a.value),className:"group relative flex size-(--control-height-lg) items-center justify-center transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring)] aria-disabled:cursor-not-allowed aria-disabled:opacity-60 "+(s?"bg-accent-tint hover:bg-blue-100":"bg-surface hover:bg-row-hover"),children:a.icon?/* @__PURE__ */t("span",{"data-icon-slot":"","aria-hidden":"true",className:"inline-flex items-center justify-center [&_svg]:h-4 [&_svg]:w-4 "+(s?"text-blue-700":"text-ink-faint group-hover:text-gray-700"),children:a.icon}):/* @__PURE__ */t("span",{"data-dot":"","aria-hidden":"true",className:s?"size-3 rounded-sm bg-accent-fill":"size-1 rounded-full bg-[color:var(--ink-faintest)] transition-colors group-hover:bg-[color:var(--ink-faint)]"})},a.value);return g?/* @__PURE__ */t(i,{reason:g,id:p,block:!0,children:x},a.value):/* @__PURE__ */t(o,{content:a.title??a.label,className:"relative flex",children:x},a.value)})})}export{s as AlignmentGrid};
@@ -1,54 +1,54 @@
1
- import{toast_default as e}from"./chunk-OQW42DOR.js";import{useShellStrings as t}from"./chunk-X2PZMXDP.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,F]=o(24),[T,U]=o(h[0].id),[A,O]=o(!0),[K,X]=o(!1),[Z,V]=o(!1),[q,G]=o(null),[Y,_]=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&&(F(Me.size),U(Me.font),O(Me.bold),X(Me.italic),V(Me.underline),G(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(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:Z}[e];"bold"===e&&O(t),"italic"===e&&X(t),"underline"===e&&V(t),oe&&re(n=>n.map(n=>n.id===oe&&"text"===n.type?{...n,[e]:t}:n))},De=e=>{G(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))},$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:T,bold:A,italic:K,underline:Z,borderColor:q,background:Y,padding:Q};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-AKM6JBMD.js";import{useShellStrings as t}from"./chunk-4PAWQEXM.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,W]=o("select"),[S,B]=o(u[0]),[R,j]=o(4),[H,F]=o(24),[T,A]=o(h[0].id),[U,O]=o(!0),[K,V]=o(!1),[X,Z]=o(!1),[q,G]=o(null),[Y,_]=o(null),[J,Q]=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&&(F(Me.size),A(Me.font),O(Me.bold),V(Me.italic),Z(Me.underline),G(Me.borderColor),_(Me.background),Q(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,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:U,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=>{G(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:S,size:H,font:T,bold:U,italic:K,underline:X,borderColor:q,background:Y,padding:J};re(t=>[...t,e]),ie(e.id),W("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]),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__ */
2
2
  return s("div",{className:"flex flex-col h-full bg-gray-100",children:[
3
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)),
4
4
  /* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
5
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:[
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: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.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(Z),title:$.underline,children:/* @__PURE__ */c("span",{className:"underline",children:$.underlineLetter})}),
17
+ /* @__PURE__ */c("select",{value:T,onChange:e=>{return t=e.target.value,A(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:We(U),title:E.bold,children:/* @__PURE__ */c("span",{className:"font-bold",children:E.boldLetter})}),
19
+ /* @__PURE__ */c("button",{onClick:()=>ze("italic"),className:We(K),title:E.italic,children:/* @__PURE__ */c("span",{className:"italic",children:E.italicLetter})}),
20
+ /* @__PURE__ */c("button",{onClick:()=>ze("underline"),className:We(X),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}),
22
+ /* @__PURE__ */c("span",{children:E.size}),
23
23
  /* @__PURE__ */c("input",{type:"range",min:10,max:96,step:1,value:H,onChange:e=>{return t=Number(e.target.value),F(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
24
  /* @__PURE__ */c("span",{className:"tabular-nums w-7 text-right",children:H})]}),
25
25
  /* @__PURE__ */s("label",{className:"flex items-center gap-1 text-gray-600",children:[
26
- /* @__PURE__ */c("span",{children:$.border}),q?/* @__PURE__ */s(d,{children:[
27
- /* @__PURE__ */c("input",{type:"color",value:q,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}),q?/* @__PURE__ */s(d,{children:[
27
+ /* @__PURE__ */c("input",{type:"color",value:q,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(S),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}),Y?/* @__PURE__ */s(d,{children:[
31
- /* @__PURE__ */c("input",{type:"color",value:Y,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}),Y?/* @__PURE__ */s(d,{children:[
31
+ /* @__PURE__ */c("input",{type:"color",value:Y,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: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})]})]}),
34
+ /* @__PURE__ */c("span",{children:E.padding}),
35
+ /* @__PURE__ */c("input",{type:"range",min:0,max:40,step:1,value:J,onChange:e=>{return t=Number(e.target.value),Q(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:J})]})]}),
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===T)?.css??h[0].css,bold:A,italic:K,underline:Z,borderColor:q,background:Y,padding:Q,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: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===T)?.css??h[0].css,bold:U,italic:K,underline:X,borderColor:q,background:Y,padding:J,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,18 +1,18 @@
1
- import{useShellStrings as e}from"./chunk-X2PZMXDP.js";import{jsxs as t,jsx as a,Fragment as l}from"react/jsx-runtime";var n=e=>"number"==typeof e?e:parseInt(String(e??""))||0;function s({items:s,getVolume:i,getInstructionVolume:r,getActualVolume:c,qtyField:m="instruction",showNewIndicator:d=!1,getInstructionQty:u=e=>e.quantity,getActualQty:h=e=>e.actual_qty,isFilled:o,isNew:g=e=>Boolean(e._isNew),className:x,style:f}){const p=e().containers,y=o?s.filter(o):s,N=e=>n(u(e)),b=e=>n(h(e)),w=y.some(e=>null!=h(e)&&b(e)>0),v=e=>w?N(e):"actual"===m?h(e)??u(e)??0:u(e)??0,M=y.reduce((e,t)=>e+n(v(t)),0),$=y.filter(e=>g(e)).length,k=y.filter(e=>g(e)).reduce((e,t)=>e+n(v(t)),0),j=y.reduce((e,t)=>e+N(t),0),I=y.reduce((e,t)=>e+b(t),0),V=e=>i?.(e)??0,q=r??(e=>V(e)*N(e)),A=c??(e=>V(e)*b(e)),F=y.reduce((e,t)=>e+q(t),0),P=y.reduce((e,t)=>e+A(t),0),Q=w?Math.max(F,P):"actual"===m&&P||F,X=Q<=34.65?"20ft":"40ft",_="20ft"===X?33:67,B=Q>0?Math.max(1,Math.ceil(Q/_)):0,D=B*_,S=Q>0&&Q>=.95*D&&Q<=1.1*D;if(0===y.length)return null;const Z=(e,t)=>_>0?Math.max(0,Math.min((e-t*_)/_*100,100)):0;/* @__PURE__ */
1
+ import{useShellStrings as e}from"./chunk-4PAWQEXM.js";import{jsxs as t,jsx as a,Fragment as l}from"react/jsx-runtime";var n=e=>"number"==typeof e?e:parseInt(String(e??""))||0;function s({items:s,getVolume:i,getInstructionVolume:r,getActualVolume:c,qtyField:m="instruction",showNewIndicator:d=!1,getInstructionQty:u=e=>e.quantity,getActualQty:h=e=>e.actual_qty,isFilled:o,isNew:g=e=>Boolean(e._isNew),className:x,style:f}){const p=e().containers,y=o?s.filter(o):s,N=e=>n(u(e)),b=e=>n(h(e)),w=y.some(e=>null!=h(e)&&b(e)>0),v=e=>w?N(e):"actual"===m?h(e)??u(e)??0:u(e)??0,M=y.reduce((e,t)=>e+n(v(t)),0),$=y.filter(e=>g(e)).length,k=y.filter(e=>g(e)).reduce((e,t)=>e+n(v(t)),0),j=y.reduce((e,t)=>e+N(t),0),A=y.reduce((e,t)=>e+b(t),0),I=e=>i?.(e)??0,V=r??(e=>I(e)*N(e)),q=c??(e=>I(e)*b(e)),Q=y.reduce((e,t)=>e+V(t),0),F=y.reduce((e,t)=>e+q(t),0),_=w?Math.max(Q,F):"actual"===m&&F||Q,B=_<=34.65?"20ft":"40ft",E="20ft"===B?33:67,P=_>0?Math.max(1,Math.ceil(_/E)):0,S=P*E,W=_>0&&_>=.95*S&&_<=1.1*S;if(0===y.length)return null;const X=(e,t)=>E>0?Math.max(0,Math.min((e-t*E)/E*100,100)):0;/* @__PURE__ */
2
2
  return t("div",{className:`mt-2 px-1 space-y-2 ${x??""}`.trim(),style:f,children:[
3
3
  /* @__PURE__ */t("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[
4
- /* @__PURE__ */t("span",{children:[`${p.items(y.length)} · ${p.pieces(M)}`,w&&j!==I&&/* @__PURE__ */a("span",{className:"ml-1 text-gray-400",children:p.split(j,I)})]}),d&&$>0&&/* @__PURE__ */t("span",{className:"flex items-center gap-1 text-green-600",children:[
5
- /* @__PURE__ */a("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"}),p.added($,k)]})]}),Q>0?/* @__PURE__ */t("div",{className:"space-y-2",children:[Array.from({length:B}).map((e,l)=>{const n=Z(F,l),s=Z(P,l),i=w,r=Math.max(n,s),c=Math.min(n,s),m=n>=s,d=i?m?"bg-blue-500":"bg-green-500":"bg-blue-500",u=i?m?"bg-green-500":"bg-blue-500":"";/* @__PURE__ */
4
+ /* @__PURE__ */t("span",{children:[`${p.items(y.length)} · ${p.pieces(M)}`,w&&j!==A&&/* @__PURE__ */a("span",{className:"ml-1 text-gray-400",children:p.split(j,A)})]}),d&&$>0&&/* @__PURE__ */t("span",{className:"flex items-center gap-1 text-green-600",children:[
5
+ /* @__PURE__ */a("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"}),p.added($,k)]})]}),_>0?/* @__PURE__ */t("div",{className:"space-y-2",children:[Array.from({length:P}).map((e,l)=>{const n=X(Q,l),s=X(F,l),i=w,r=Math.max(n,s),c=Math.min(n,s),m=n>=s,d=i?m?"bg-blue-500":"bg-green-500":"bg-blue-500",u=i?m?"bg-green-500":"bg-blue-500":"";/* @__PURE__ */
6
6
  return t("div",{className:"flex items-center gap-2",children:[
7
- /* @__PURE__ */a("span",{className:"text-2xs text-ink-faintest w-8 shrink-0",children:X}),
7
+ /* @__PURE__ */a("span",{className:"text-2xs text-ink-faintest w-8 shrink-0",children:B}),
8
8
  /* @__PURE__ */t("div",{className:"relative flex-1 h-4 bg-gray-100 rounded-full overflow-hidden border border-gray-200",children:[
9
9
  /* @__PURE__ */a("div",{className:`absolute inset-y-0 left-0 ${d} transition-all`,style:{width:`${r}%`}}),i&&c>0&&/* @__PURE__ */a("div",{className:`absolute inset-y-0 left-0 ${u} transition-all`,style:{width:`${c}%`}})]}),
10
- /* @__PURE__ */a("span",{className:"text-2xs text-ink-faint w-16 text-right",children:i?p.fill(Math.min(P-l*_,_),_):p.fill(Math.min(F-l*_,_),_)})]},`bar-${l}`)}),
10
+ /* @__PURE__ */a("span",{className:"text-2xs text-ink-faint w-16 text-right",children:i?p.fill(Math.min(F-l*E,E),E):p.fill(Math.min(Q-l*E,E),E)})]},`bar-${l}`)}),
11
11
  /* @__PURE__ */t("div",{className:"flex items-center justify-between text-xs pt-0.5",children:[
12
12
  /* @__PURE__ */t("span",{className:"text-gray-500 inline-flex items-center gap-1",children:[p.total,w?/* @__PURE__ */t(l,{children:[
13
13
  /* @__PURE__ */t("span",{className:"inline-flex items-center gap-1 text-blue-700",children:[
14
- /* @__PURE__ */a("span",{className:"inline-block w-2 h-2 rounded-full bg-blue-500"}),p.instructed(F)]}),
14
+ /* @__PURE__ */a("span",{className:"inline-block w-2 h-2 rounded-full bg-blue-500"}),p.instructed(Q)]}),
15
15
  /* @__PURE__ */a("span",{className:"text-gray-400",children:"/"}),
16
16
  /* @__PURE__ */t("span",{className:"inline-flex items-center gap-1 text-green-700",children:[
17
- /* @__PURE__ */a("span",{className:"inline-block w-2 h-2 rounded-full bg-green-500"}),p.loaded(P)]})]}):/* @__PURE__ */a("b",{className:"text-gray-700",children:p.volume(Q)})]}),
18
- /* @__PURE__ */t("span",{className:"font-medium "+(S?"text-green-600":"text-gray-500"),children:[S&&"✓ ",B," × ",X]})]})]}):/* @__PURE__ */a("div",{className:"text-xs text-gray-400",children:p.noVolume})]})}export{s as ContainerFillChart};
17
+ /* @__PURE__ */a("span",{className:"inline-block w-2 h-2 rounded-full bg-green-500"}),p.loaded(F)]})]}):/* @__PURE__ */a("b",{className:"text-gray-700",children:p.volume(_)})]}),
18
+ /* @__PURE__ */t("span",{className:"font-medium "+(W?"text-green-600":"text-gray-500"),children:[W&&"✓ ",P," × ",B]})]})]}):/* @__PURE__ */a("div",{className:"text-xs text-gray-400",children:p.noVolume})]})}export{s as ContainerFillChart};
@@ -1,5 +1,5 @@
1
- import{Icon as e}from"./chunk-KKSVRIMP.js";import{swallowPress as i,describedByWith as r,OffWithReason as a}from"./chunk-HL6JSDN3.js";import{OneLineLabel as o}from"./chunk-OZAAIE4E.js";import{Tooltip as s}from"./chunk-BCDG4N6L.js";import{useShellStrings as n}from"./chunk-X2PZMXDP.js";import{useId as l,Fragment as d}from"react";import{jsx as t,jsxs as c}from"react/jsx-runtime";function b({items:b,onChange:h,label:m,className:u="","aria-labelledby":f,"aria-describedby":p}){const w=n().displayChips,g=l();/* @__PURE__ */
2
- return t("div",{role:"group","aria-label":f?void 0:m,"aria-labelledby":f,"aria-describedby":p,className:`flex flex-wrap gap-2 ${u}`.trim(),children:b.map((n,l)=>{const b=`${g}-${l}-state`,m=`${g}-${l}-reason`,u=Boolean(n.disabled)&&null!=n.disabledReason&&""!==n.disabledReason,f=/* @__PURE__ */c("button",{type:"button","aria-pressed":n.shown,disabled:!(!n.disabled||u)||void 0,"aria-disabled":!!u||void 0,"aria-describedby":r(b,u?m:void 0),onClick:u?i:()=>h(n.id,!n.shown),className:"inline-flex h-6 max-w-full shrink-0 items-center gap-1 whitespace-nowrap rounded-full border pl-2 pr-3 text-xs font-medium transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60 aria-disabled:cursor-not-allowed aria-disabled:opacity-60 "+(n.shown?"border-blue-200 bg-accent-tint text-blue-700 hover:bg-blue-100":"border-line bg-surface text-ink-faint hover:bg-row-hover hover:text-ink-strongest"),children:[
3
- /* @__PURE__ */t(e,{name:n.shown?"eye":"eye-off",className:"h-4 w-4 shrink-0",strokeWidth:"1.75"}),
1
+ import{swallowPress as e,describedByWith as i,OffWithReason as r}from"./chunk-34URULVW.js";import{Icon as a}from"./chunk-KKSVRIMP.js";import{OneLineLabel as o}from"./chunk-MVZRZTQP.js";import{Tooltip as s}from"./chunk-6XBWM453.js";import{useShellStrings as n}from"./chunk-4PAWQEXM.js";import{useId as l,Fragment as d}from"react";import{jsx as t,jsxs as c}from"react/jsx-runtime";function b({items:b,onChange:h,label:m,className:u="","aria-labelledby":f,"aria-describedby":p}){const w=n().displayChips,g=l();/* @__PURE__ */
2
+ return t("div",{role:"group","aria-label":f?void 0:m,"aria-labelledby":f,"aria-describedby":p,className:`flex flex-wrap gap-2 ${u}`.trim(),children:b.map((n,l)=>{const b=`${g}-${l}-state`,m=`${g}-${l}-reason`,u=Boolean(n.disabled)&&null!=n.disabledReason&&""!==n.disabledReason,f=/* @__PURE__ */c("button",{type:"button","aria-pressed":n.shown,disabled:!(!n.disabled||u)||void 0,"aria-disabled":!!u||void 0,"aria-describedby":i(b,u?m:void 0),onClick:u?e:()=>h(n.id,!n.shown),className:"inline-flex h-6 max-w-full shrink-0 items-center gap-1 whitespace-nowrap rounded-full border pl-2 pr-3 text-xs font-medium transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60 aria-disabled:cursor-not-allowed aria-disabled:opacity-60 "+(n.shown?"border-blue-200 bg-accent-tint text-blue-700 hover:bg-blue-100":"border-line bg-surface text-ink-faint hover:bg-row-hover hover:text-ink-strongest"),children:[
3
+ /* @__PURE__ */t(a,{name:n.shown?"eye":"eye-off",className:"h-4 w-4 shrink-0",strokeWidth:"1.75"}),
4
4
  /* @__PURE__ */t(o,{children:n.label})]}),p=/* @__PURE__ */t("span",{id:b,className:"sr-only",children:n.shown?w.shown:w.hidden});/* @__PURE__ */
5
- return c(d,{children:[u?/* @__PURE__ */t(a,{reason:n.disabledReason,id:m,children:f}):/* @__PURE__ */t(s,{content:n.shown?w.shownHint:w.hiddenHint,describe:!1,className:"relative inline-flex max-w-full",children:f}),p]},n.id)})})}export{b as DisplayChips};
5
+ return c(d,{children:[u?/* @__PURE__ */t(r,{reason:n.disabledReason,id:m,children:f}):/* @__PURE__ */t(s,{content:n.shown?w.shownHint:w.hiddenHint,describe:!1,className:"relative inline-flex max-w-full",children:f}),p]},n.id)})})}export{b as DisplayChips};
@@ -1,4 +1,4 @@
1
- import{Breadcrumbs as e}from"./chunk-RSIGTZMU.js";import{jsxs as t,jsx as s}from"react/jsx-runtime";function i({title:i,description:r,subtitle:c,actions:a,children:n,icon:l,breadcrumbs:m}){const d=r??c,h=a??n;/* @__PURE__ */
1
+ import{Breadcrumbs as e}from"./chunk-O4V5PEA3.js";import{jsxs as t,jsx as s}from"react/jsx-runtime";function i({title:i,description:r,subtitle:c,actions:a,children:n,icon:l,breadcrumbs:m}){const d=r??c,h=a??n;/* @__PURE__ */
2
2
  return t("div",{className:"mb-6",children:[m&&m.length>0&&/* @__PURE__ */s(e,{items:m,className:"mb-3"}),
3
3
  /* @__PURE__ */t("div",{className:"flex items-start justify-between gap-4",children:[
4
4
  /* @__PURE__ */t("div",{children:[
@@ -1,3 +1,3 @@
1
- import{ColoredBadge as e}from"./chunk-RKFEJ5CX.js";import{Button_default as n}from"./chunk-NHH2MXFU.js";import{useShellStrings as i}from"./chunk-X2PZMXDP.js";import{useId as t}from"react";import{jsx as m,jsxs as a}from"react/jsx-runtime";function s({items:s,heading:l,emptyText:r,className:c=""}){const o=i().media,d=t();return s.length?/* @__PURE__ */a("div",{className:c||void 0,children:[
1
+ import{ColoredBadge as e}from"./chunk-PXQG5EIH.js";import{Button_default as n}from"./chunk-I4VIEGCX.js";import{useShellStrings as i}from"./chunk-4PAWQEXM.js";import{useId as t}from"react";import{jsx as m,jsxs as a}from"react/jsx-runtime";function s({items:s,heading:l,emptyText:r,className:c=""}){const o=i().media,d=t();return s.length?/* @__PURE__ */a("div",{className:c||void 0,children:[
2
2
  /* @__PURE__ */m("p",{id:d,className:"text-xs font-medium text-ink-faint",children:l??o.usedIn(s.length)}),
3
3
  /* @__PURE__ */m("ul",{"aria-labelledby":d,className:"mt-2 flex flex-col gap-1",children:s.map(i=>/* @__PURE__ */a("li",{className:"flex min-w-0 items-center gap-2 text-sm",children:[null!=i.kind&&/* @__PURE__ */m(e,{size:"xs",className:"flex-none",children:i.kind}),i.onOpen?/* @__PURE__ */m(n,{variant:"link",size:"sm",onClick:i.onOpen,className:"min-w-0 text-left",children:i.name}):/* @__PURE__ */m("span",{className:"min-w-0 break-words text-ink",children:i.name})]},i.key))})]}):/* @__PURE__ */m("p",{className:`text-sm text-ink-faint ${c}`.trim(),children:r??o.notUsed})}export{s as MediaUsedInList};
@@ -0,0 +1,11 @@
1
+ import{ChartTooltip as e}from"./chunk-G4GVLK44.js";import{usePlotWidth as t}from"./chunk-MAFUXCPZ.js";import{resolveSeriesColor as l,CHART_INK as r}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as n}from"./chunk-TWVUQUUD.js";import{useShellStrings as i,useShellLocale as a}from"./chunk-4PAWQEXM.js";import{formatPlain as o}from"./chunk-C3QOHMR6.js";import{useRef as h,useId as c,useState as s,useEffect as m}from"react";import{jsx as f,jsxs as u}from"react/jsx-runtime";function x({rows:x,columns:d,cells:p,height:M,width:g,color:y,max:v,formatValue:$,label:b,className:k,emptyLabel:w,cellGap:A=2,cellRadius:N=2}){const j=i().charts,U=a(),z=$??(e=>o(e,U)),C=b??j.intensity,D=w??j.noActivity,F=h(null),G=t(F),L=g??G,R=c(),[S,V]=s(null);if(m(()=>{if(null!==S)return n(e=>"Escape"===e.key&&(V(null),!0))},[S]),0===x.length||0===d.length)/* @__PURE__ */
2
+ return f("div",{className:k,ref:F,children:/* @__PURE__ */f("p",{className:"py-8 text-center text-sm text-gray-500",children:D})});const E=y??l(0),Q=v??Math.max(1,...p.flat().filter(Number.isFinite)),B=96,K=26*x.length,P=M??K+26+26,T=Math.max(2,(Math.max(97,L)-B)/d.length),W=e=>{const t=Q>0?Math.max(0,Math.min(1,e/Q)):0;return`color-mix(in oklab, ${E} ${(8+92*t).toFixed(1)}%, ${r.surface})`};/* @__PURE__ */
3
+ return u("div",{className:`relative ${k??""}`,ref:F,children:[
4
+ /* @__PURE__ */u("svg",{width:"100%",height:P,viewBox:`0 0 ${L} ${P}`,role:"img","aria-label":j.heatmap(C,x.length,d.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>V(null),onBlur:()=>V(null),onKeyDown:e=>{const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:0,l="ArrowRight"===e.key?1:"ArrowLeft"===e.key?-1:0;0===t&&0===l||(e.preventDefault(),V(e=>({r:Math.min(x.length-1,Math.max(0,(e?.r??0)+t)),c:Math.min(d.length-1,Math.max(0,(e?.c??0)+l))})))},children:[
5
+ /* @__PURE__ */f("defs",{children:/* @__PURE__ */u("linearGradient",{id:R,x1:"0",x2:"1",children:[
6
+ /* @__PURE__ */f("stop",{offset:"0",stopColor:W(0)}),
7
+ /* @__PURE__ */f("stop",{offset:"1",stopColor:W(Q)})]})}),x.map((e,t)=>/* @__PURE__ */f("text",{x:86,y:26*t+13+4,textAnchor:"end",fontSize:11,fill:r.label,children:e},`r${t}`)),x.map((e,t)=>d.map((l,r)=>{const n=p[t]?.[r]??0,i=S&&(S.r!==t||S.c!==r);/* @__PURE__ */
8
+ return f("rect",{x:B+r*T+A/2,y:26*t+A/2,width:Math.max(1,T-A),height:26-A,rx:N,fill:W(n),opacity:i?.55:1,onMouseEnter:()=>V({r:t,c:r}),children:/* @__PURE__ */f("title",{children:`${e} · ${l}: ${z(n)}`})},`${t}-${r}`)})),d.map((e,t)=>t%Math.max(1,Math.ceil(d.length/Math.max(1,Math.floor((L-B)/56))))===0?/* @__PURE__ */f("text",{x:B+t*T+T/2,y:K+15,textAnchor:"middle",fontSize:11,fill:r.label,children:e},`c${t}`):null),
9
+ /* @__PURE__ */f("rect",{x:B,y:K+26,width:Math.min(180,Math.max(40,L-B)),height:8,rx:4,fill:`url(#${R})`}),
10
+ /* @__PURE__ */f("text",{x:B,y:K+48,fontSize:11,fill:r.label,children:"0"}),
11
+ /* @__PURE__ */f("text",{x:B+Math.min(180,Math.max(40,L-B)),y:K+48,textAnchor:"end",fontSize:11,fill:r.label,style:{fontVariantNumeric:"tabular-nums"},children:z(Q)})]}),S&&/* @__PURE__ */f("div",{className:"pointer-events-none absolute top-1 right-1 z-10",children:/* @__PURE__ */f(e,{title:`${x[S.r]} · ${d[S.c]}`,rows:[{key:"v",label:C,color:E,value:null==p[S.r]?.[S.c]?void 0:z(p[S.r][S.c])}]})})]})}export{x as HeatmapChart};
@@ -0,0 +1,8 @@
1
+ import{AccessibleTable as t}from"./chunk-TKJBZIHT.js";import{arcPath as e}from"./chunk-VFC6QUEN.js";import{useHighlight as o}from"./chunk-CNYAHYE6.js";import{ChartTooltip as n}from"./chunk-G4GVLK44.js";import{CHART_INK as r,resolveSeriesColor as a}from"./chunk-TZFACUMR.js";import{useShellStrings as l,useShellLocale as i}from"./chunk-4PAWQEXM.js";import{formatPlain as s}from"./chunk-C3QOHMR6.js";import{useState as c}from"react";import{jsx as d,jsxs as m}from"react/jsx-runtime";function h(t,e,o,n){const r=(t,o)=>{const n=e[t]?.[o];return"number"==typeof n&&Number.isFinite(n)?n:0},a=t.map((e,o)=>t.reduce((t,e,n)=>t+r(o,n)+r(n,o),0)),l=Math.max(2,o),i=t.length>l,s=i?t.map((t,e)=>e).sort((t,e)=>a[e]-a[t]).slice(0,l-1).sort((t,e)=>t-e):t.map((t,e)=>e),c=new Map(s.map((t,e)=>[t,e])),d=i?s.length:-1,m=i?[...s.map(e=>t[e]),n]:[...t],h=m.map(()=>m.map(()=>0));let u=0;t.forEach((e,o)=>t.forEach((t,e)=>{const n=c.get(o)??d,a=c.get(e)??d;n!==d||a!==d?h[n][a]+=r(o,e):u+=r(o,e)}));const f=m.map((t,e)=>m.reduce((t,o,n)=>t+h[e][n]+h[n][e],0));return d>=0&&(f[d]+=u),{labels:m,matrix:h,totals:f,otherIndex:d,foldedCount:i?t.length-s.length:0}}function u({labels:u,matrix:f,size:p=340,maxNodes:x=8,padAngle:g=.04,arcWidth:b=12,formatValue:k,className:v,emptyLabel:M}){const $=l().charts,w=i(),N=k??(t=>s(t,w)),j=M??$.noFlows,[y,E]=c(null),{highlighted:F}=o(),C=h(u,f,x,$.other),{labels:A,matrix:I,otherIndex:z,foldedCount:L}=C,Q=(t,e)=>I[t]?.[e]??0,T=t=>t===z?r.muted:a(t),H=C.totals,O=A.map((t,e)=>e).sort((t,e)=>H[e]-H[t]),P=O.reduce((t,e)=>t+H[e],0);if(P<=0)/* @__PURE__ */return d("p",{className:`text-sm text-gray-500 ${v??""}`,children:j});const V=p/2,W=p/2,B=p/2-44,G=B-b,K=g*O.length,R=/* @__PURE__ */new Map;let U=-Math.PI/2;O.forEach((t,e)=>{const o=H[t]/P*(2*Math.PI-K);R.set(t,{start:U,end:U+o,slot:e}),U+=o+g});const Y=/* @__PURE__ */new Map,Z=[];for(const t of O)for(const e of O){const o=Q(t,e);if(o<=0)continue;const n=R.get(t),r=o/Math.max(1,H[t])*(n.end-n.start),a=Y.get(t)??0;Y.set(t,a+r),Z.push({from:t,to:e,value:o,a:n.start+a+r/2,b:R.get(e).start+(R.get(e).end-R.get(e).start)/2})}const J=(t,e)=>[V+e*Math.cos(t),W+e*Math.sin(t)],S="arc"===y?.kind?y.index:void 0,X="ribbon"===y?.kind?Z[y.index]:void 0;/* @__PURE__ */
2
+ return m("div",{className:`relative ${v??""}`,children:[
3
+ /* @__PURE__ */m("svg",{width:"100%",height:p,viewBox:`0 0 ${p} ${p}`,role:"img","aria-label":$.chord(O.length),onMouseLeave:()=>E(null),children:[Z.map((t,e)=>{const[o,n]=J(t.a,G),[r,a]=J(t.b,G),l=T(t.from),i=((t,e)=>y?"ribbon"===y.kind?y.index===e:y.index===t.from||y.index===t.to:null!==F?A[t.from]===F||A[t.to]===F:null)(t,e);/* @__PURE__ */
4
+ return d("path",{d:`M${o},${n} Q${V},${W} ${r},${a}`,fill:"none",stroke:l,strokeWidth:Math.max(1,t.value/P*p*.9),strokeOpacity:null===i||i?.34:.07,strokeLinecap:"round",onMouseEnter:()=>E({kind:"ribbon",index:e})},`${A[t.from]}→${A[t.to]}`)}),O.map(t=>{const o=R.get(t),n=(o.start+o.end)/2,[a,l]=J(n,B+16),i=(t=>y?"arc"===y.kind?y.index===t:Z[y.index].from===t||Z[y.index].to===t:null!==F?A[t]===F:null)(t);/* @__PURE__ */
5
+ return m("g",{onMouseEnter:()=>E({kind:"arc",index:t}),children:[
6
+ /* @__PURE__ */d("path",{d:e(V,W,G,B,o.start,o.end),fill:T(t),fillOpacity:null===i||i?1:.45}),
7
+ /* @__PURE__ */d("text",{x:a,y:l+4,fontSize:11,fill:r.label,textAnchor:Math.cos(n)>.15?"start":Math.cos(n)<-.15?"end":"middle",children:A[t]})]},t)})]}),L>0&&/* @__PURE__ */d("p",{className:"mt-1 text-xs text-ink-faint",children:$.chordFolded(L)}),void 0!==S&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:A[S],rows:[{key:"total",label:$.totalFlow,color:T(S),value:N(H[S])}]})}),X&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:`${A[X.from]} → ${A[X.to]}`,rows:[{key:"value",label:$.flow,color:T(X.from),value:N(X.value)}]})}),
8
+ /* @__PURE__ */d(t,{caption:$.chord(O.length),head:[$.tableFrom,$.tableTo,$.value],rows:Z.map(t=>[A[t.from],A[t.to],N(t.value)])})]})}export{u as ChordChart,h as foldChord};
@@ -0,0 +1 @@
1
+ import{iconButtonClasses as e}from"./chunk-UQYNPYF4.js";import{isAriaDisabled as r,swallowPress as a,describedByWith as i,OffWithReason as s}from"./chunk-34URULVW.js";import{forwardRef as d,useId as n}from"react";import{jsx as o}from"react/jsx-runtime";var t=d(function({children:d,variant:t="ghost",size:c="md",type:l="button",className:m="",pressed:b,disabledReason:p,ink:u,disabled:f,onClick:h,"aria-disabled":k,"aria-describedby":v,...y},N){const j=n(),U=(Boolean(f)||r(k))&&null!=p&&""!==p,x=U||r(k),z=/* @__PURE__ */o("button",{ref:N,type:l,className:e({variant:t,size:c,pressed:b??(!0===y["aria-pressed"]||"true"===y["aria-pressed"]),ink:u,className:m}),...y,disabled:U?void 0:f,"aria-disabled":!!x||k,"aria-describedby":i(v,U?j:void 0),onClick:x?a:h,children:d});return U?/* @__PURE__ */o(s,{reason:p,id:j,children:z}):z});export{t as IconButton_default};
@@ -1,4 +1,4 @@
1
- import{useShellLanguage as e}from"./chunk-MVQMAIZM.js";import{RadioGroup as a}from"./chunk-32VV2J22.js";import{Select_default as n}from"./chunk-ZLHPCPXS.js";import{Icon as t}from"./chunk-KKSVRIMP.js";import{useShellStrings as l}from"./chunk-X2PZMXDP.js";import{jsxs as s,jsx as i}from"react/jsx-runtime";function r(e){const a=Math.max(0,...e.map(e=>[...e].reduce((e,a)=>e+((a.codePointAt(0)??0)>=11904?1:.62),0)));return Math.round(10*(a+3.5))/10}function m({size:a="sm",className:m=""}){const{language:o,languages:c,setLanguage:g}=e(),u=l().language;return c.length<2?null:/* @__PURE__ */s("span",{className:`inline-flex items-center gap-2 text-ink-faint ${m}`.trim(),children:[
1
+ import{useShellLanguage as e}from"./chunk-UPQW4GCT.js";import{RadioGroup as a}from"./chunk-32VV2J22.js";import{Select_default as n}from"./chunk-N4DI5F74.js";import{Icon as t}from"./chunk-KKSVRIMP.js";import{useShellStrings as l}from"./chunk-4PAWQEXM.js";import{jsxs as s,jsx as i}from"react/jsx-runtime";function r(e){const a=Math.max(0,...e.map(e=>[...e].reduce((e,a)=>e+((a.codePointAt(0)??0)>=11904?1:.62),0)));return Math.round(10*(a+3.5))/10}function m({size:a="sm",className:m=""}){const{language:o,languages:c,setLanguage:g}=e(),u=l().language;return c.length<2?null:/* @__PURE__ */s("span",{className:`inline-flex items-center gap-2 text-ink-faint ${m}`.trim(),children:[
2
2
  /* @__PURE__ */i(t,{name:"globe","aria-hidden":!0,className:"h-4 w-4 shrink-0"}),
3
3
  /* @__PURE__ */i("span",{className:"block",style:{width:`${r(c.map(e=>e.name))}em`},children:/* @__PURE__ */i(n,{size:a,touchSize:a,"aria-label":u.title,value:o,onChange:e=>{g(e)},options:c.map(({tag:e,name:a})=>({value:e,label:a,lang:e}))})})]})}function o({description:n,className:t=""}){const{language:r,languages:m,setLanguage:o}=e(),c=l().language;return m.length<2?null:/* @__PURE__ */s("div",{className:`space-y-4 ${t}`.trim(),children:[
4
4
  /* @__PURE__ */s("div",{children:[