efficient-shell 11.5.0 → 11.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (353) hide show
  1. package/README.md +15 -0
  2. package/dist/{Browser-URFWAJYZ.js → Browser-FIRNNCSC.js} +17 -17
  3. package/dist/Calculator-ELI5Z3XW.js +29 -0
  4. package/dist/{CurrencyConverter-CUIFL32O.js → CurrencyConverter-LU7QXMOI.js} +11 -11
  5. package/dist/{Documents-Y62EQJWN.js → Documents-CE7YKNJM.js} +24 -24
  6. package/dist/Files-ARRIIZZ6.js +88 -0
  7. package/dist/{Notepad-LYK7OAGU.js → Notepad-HNED2SWM.js} +10 -10
  8. package/dist/PdfViewer-ZRDIG2L2.js +1 -0
  9. package/dist/{PomodoroTimer-IMNUQQAC.js → PomodoroTimer-ZJ432VPC.js} +43 -43
  10. package/dist/{Preview-ZKPVPYYL.js → Preview-OGSYTTKC.js} +32 -32
  11. package/dist/Sidebar-ETWHTFNP.js +44 -0
  12. package/dist/Spreadsheet-4HZR2TUV.js +75 -0
  13. package/dist/{Stock-S6URCQBQ.js → Stock-4BOTUHWE.js} +3 -3
  14. package/dist/{Weather-SM5ZQUE2.js → Weather-NDUOK3P3.js} +18 -18
  15. package/dist/{WorldClock-I26FGYJO.js → WorldClock-FH6NFTOM.js} +4 -4
  16. package/dist/ai/index.js +62 -62
  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/borderLineStyles-C-W0uSzL.d.ts +12 -0
  21. package/dist/brand.css +1 -1
  22. package/dist/charts/BoxPlotChart.js +1 -1
  23. package/dist/charts/CandlestickChart.js +1 -1
  24. package/dist/charts/CartesianPlot.js +1 -1
  25. package/dist/charts/ChartBrush.js +1 -1
  26. package/dist/charts/ChartFrame.js +1 -1
  27. package/dist/charts/ChartSkeleton.js +1 -1
  28. package/dist/charts/ChordChart.js +1 -1
  29. package/dist/charts/ColumnChart.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-QOI4GQVH.js → chunk-276JUQXK.js} +1 -1
  48. package/dist/{chunk-G66SG6JN.js → chunk-2CPYXRR2.js} +8 -8
  49. package/dist/{chunk-SXNQHIBY.js → chunk-2JTG3U5L.js} +1 -1
  50. package/dist/{chunk-HNUKXGYP.js → chunk-2UTCGWMZ.js} +4 -4
  51. package/dist/chunk-2V3LKX7G.js +6 -0
  52. package/dist/{chunk-LCSMBVMU.js → chunk-37JAU3U7.js} +1 -1
  53. package/dist/{chunk-MCAPJSB6.js → chunk-4L4GQW7P.js} +1 -1
  54. package/dist/chunk-4LQRLYB4.js +22 -0
  55. package/dist/{chunk-4EZIWLJJ.js → chunk-4UKPDURO.js} +1 -1
  56. package/dist/{chunk-SDDV3UCN.js → chunk-4VF66WBB.js} +12 -12
  57. package/dist/chunk-5CPRZ27M.js +28 -0
  58. package/dist/{chunk-XBHXGBJR.js → chunk-5DZN6ZDE.js} +9 -9
  59. package/dist/{chunk-AIJ6OR6X.js → chunk-5MGNT7XM.js} +2 -2
  60. package/dist/chunk-5XVXYBIQ.js +8 -0
  61. package/dist/{chunk-EOWUUOVE.js → chunk-7N4P6LGD.js} +1 -1
  62. package/dist/{chunk-YQOVUH5W.js → chunk-7QRKZOXR.js} +8 -8
  63. package/dist/{chunk-7TZV6G2F.js → chunk-A2SP4IZV.js} +1 -1
  64. package/dist/chunk-A4FCXZSY.js +8 -0
  65. package/dist/{chunk-JFV5CQN4.js → chunk-A65PRSKV.js} +4 -4
  66. package/dist/chunk-ABKCC7VB.js +9 -0
  67. package/dist/chunk-ABKFALDE.js +8 -0
  68. package/dist/{chunk-F56UUBKG.js → chunk-AFROFSDW.js} +1 -1
  69. package/dist/chunk-AJ6HMM4P.js +20 -0
  70. package/dist/{chunk-A6FR2D46.js → chunk-ALMBY7QO.js} +5 -5
  71. package/dist/{chunk-ILY4DU3D.js → chunk-B4D23ZLJ.js} +1 -1
  72. package/dist/{chunk-UNQ54QOF.js → chunk-BAT5B2LE.js} +1 -1
  73. package/dist/{chunk-36PJGT4W.js → chunk-BXTSBORU.js} +1 -1
  74. package/dist/{chunk-WDQEUNGE.js → chunk-CFFT5OCV.js} +1 -1
  75. package/dist/{chunk-2N64TKI5.js → chunk-D2BXHFYK.js} +1 -1
  76. package/dist/chunk-DGA4SO27.js +3 -0
  77. package/dist/{chunk-4DDL6NXB.js → chunk-DH2DKQKS.js} +1 -1
  78. package/dist/{chunk-VAK5FQXH.js → chunk-DWR6RVX5.js} +4 -4
  79. package/dist/{chunk-HAYGUFNM.js → chunk-DXFG4H4V.js} +1 -1
  80. package/dist/{chunk-4TYIYL56.js → chunk-E2LRAOCL.js} +10 -10
  81. package/dist/{chunk-MS5APD3V.js → chunk-ED6HJBCO.js} +1 -1
  82. package/dist/{chunk-C764JODK.js → chunk-EMUZJMR3.js} +1 -1
  83. package/dist/{chunk-XCAUDTCC.js → chunk-EOYGTVNS.js} +2 -2
  84. package/dist/{chunk-7JVGF555.js → chunk-EP5BHBZQ.js} +1 -1
  85. package/dist/chunk-FBACFP4U.js +4 -0
  86. package/dist/{chunk-JFBL4PR3.js → chunk-FNMF42DQ.js} +2 -2
  87. package/dist/{chunk-ORIXCEKO.js → chunk-FOHOSUK3.js} +1 -1
  88. package/dist/{chunk-ECJKIPWU.js → chunk-FRNSCVPN.js} +1 -1
  89. package/dist/{chunk-4BCFBF3C.js → chunk-FSRHVB4A.js} +7 -7
  90. package/dist/{chunk-YQFGRYEF.js → chunk-FTGA5IPI.js} +14 -14
  91. package/dist/chunk-G2BZ7NCM.js +19 -0
  92. package/dist/{chunk-AWGJIDBR.js → chunk-GNWK77U7.js} +1 -1
  93. package/dist/{chunk-OPN4I565.js → chunk-GPCTDEXQ.js} +1 -1
  94. package/dist/{chunk-QRU55BUS.js → chunk-GV5VNWPG.js} +2 -2
  95. package/dist/{chunk-JSG2AKCG.js → chunk-H5YD72OP.js} +1 -1
  96. package/dist/{chunk-RDYFZHT3.js → chunk-HBS4HYQM.js} +1 -1
  97. package/dist/{chunk-DVYIBJ3S.js → chunk-HRXQCHKI.js} +2 -2
  98. package/dist/chunk-HTTICQBP.js +27 -0
  99. package/dist/{chunk-LJN77RG6.js → chunk-HWFBNYNI.js} +1 -1
  100. package/dist/chunk-HYNUJY6W.js +13 -0
  101. package/dist/{chunk-T6BGS26U.js → chunk-HYXDKY2L.js} +1 -1
  102. package/dist/{chunk-E3EJWNNK.js → chunk-IAUEISDQ.js} +7 -7
  103. package/dist/{chunk-OBJGUJIE.js → chunk-IDRAW6MT.js} +2 -2
  104. package/dist/chunk-IEHTZR5M.js +7 -0
  105. package/dist/chunk-IH2KC3NQ.js +5 -0
  106. package/dist/{chunk-BUO7XCYR.js → chunk-IKKQ4P4R.js} +12 -12
  107. package/dist/{chunk-MDYJVXWD.js → chunk-IW2QNPDG.js} +2 -2
  108. package/dist/{chunk-SX3SG522.js → chunk-IXSSBGRD.js} +9 -9
  109. package/dist/{chunk-54NMFQMW.js → chunk-JADBOQ7S.js} +5 -5
  110. package/dist/{chunk-ZGOHRLXG.js → chunk-JGVKGEIV.js} +1 -1
  111. package/dist/{chunk-XYECIBVX.js → chunk-JJHPPTM6.js} +1 -1
  112. package/dist/{chunk-TMMNCXQT.js → chunk-KMSK6QQB.js} +1 -1
  113. package/dist/{chunk-OEPYQUXZ.js → chunk-KPFYXVCO.js} +9 -9
  114. package/dist/{chunk-4RGMRXYH.js → chunk-KZ6JVHFI.js} +1 -1
  115. package/dist/{chunk-4ULRP4Y4.js → chunk-L3RLB37Y.js} +1 -1
  116. package/dist/{chunk-H5NIW2KS.js → chunk-L433UT5E.js} +1 -1
  117. package/dist/{chunk-V6Y4OC6K.js → chunk-LCHU3ZG4.js} +8 -8
  118. package/dist/{chunk-VHF3CJVO.js → chunk-LLNWE7DR.js} +30 -30
  119. package/dist/{chunk-D5HGRACW.js → chunk-LNGLJA6K.js} +1 -1
  120. package/dist/{chunk-QVZKRROQ.js → chunk-LPTN55KO.js} +1 -1
  121. package/dist/chunk-LVHQJ5TW.js +9 -0
  122. package/dist/{chunk-AFYLVV74.js → chunk-LZJCULO7.js} +1 -1
  123. package/dist/{chunk-E6GDAV5R.js → chunk-MFDOGLFO.js} +3 -3
  124. package/dist/{chunk-P7H2DXJB.js → chunk-MG4IUKVP.js} +10 -10
  125. package/dist/{chunk-AFG34RBV.js → chunk-MOL2ND6G.js} +6 -6
  126. package/dist/{chunk-U44DVPGB.js → chunk-MQHUVZWM.js} +1 -1
  127. package/dist/{chunk-7ELJQL7J.js → chunk-MWKLLAJT.js} +1 -1
  128. package/dist/chunk-N3OJ47VK.js +1 -0
  129. package/dist/chunk-N7645DNN.js +6 -0
  130. package/dist/{chunk-TFSLPAGB.js → chunk-NFNDXE5O.js} +3 -3
  131. package/dist/{chunk-5XFBZ7C3.js → chunk-NGUXPP5Q.js} +54 -54
  132. package/dist/chunk-NOMWJTN2.js +1 -0
  133. package/dist/{chunk-QYL26AB4.js → chunk-NSYCJTHE.js} +1 -1
  134. package/dist/{chunk-4EBJO7ER.js → chunk-NTKNM25F.js} +9 -9
  135. package/dist/{chunk-IMDGMUE3.js → chunk-O4OFURPC.js} +1 -1
  136. package/dist/{chunk-5H4SWQGM.js → chunk-OE77XFOV.js} +1 -1
  137. package/dist/{chunk-WLYYC3AP.js → chunk-ONIL7WXO.js} +1 -1
  138. package/dist/{chunk-2E2SUEEE.js → chunk-OQG3XO4Y.js} +1 -1
  139. package/dist/{chunk-TDAI4J27.js → chunk-OS2KE6QG.js} +4 -4
  140. package/dist/{chunk-NZ34BQKH.js → chunk-OUXSI6X4.js} +1 -1
  141. package/dist/{chunk-CLTRQ7AQ.js → chunk-OYTRB237.js} +1 -1
  142. package/dist/{chunk-KXU4ORKE.js → chunk-OZEPYQ7E.js} +1 -1
  143. package/dist/{chunk-DZOJQURG.js → chunk-P7NO3NGC.js} +10 -10
  144. package/dist/{chunk-BMXTPJ7T.js → chunk-PAC4LK2N.js} +5 -5
  145. package/dist/{chunk-UEISJFZH.js → chunk-PBMAMVSE.js} +5 -5
  146. package/dist/{chunk-O3MBPAWZ.js → chunk-PC44XTGN.js} +1 -1
  147. package/dist/{chunk-7LU3H72S.js → chunk-PEVWAJUR.js} +6 -6
  148. package/dist/{chunk-RNBS6QGP.js → chunk-PMKR2BF2.js} +21 -21
  149. package/dist/{chunk-JH4ZCPHW.js → chunk-PR42NIDL.js} +10 -10
  150. package/dist/{chunk-6IOFNPR6.js → chunk-PTWKG635.js} +3 -3
  151. package/dist/{chunk-DIEH76MB.js → chunk-QIEAZN6Z.js} +1 -1
  152. package/dist/{chunk-DQQKG46I.js → chunk-QIVIQUKB.js} +7 -7
  153. package/dist/{chunk-PLC656AN.js → chunk-QL5E3MU3.js} +1 -1
  154. package/dist/chunk-QRZBLNOQ.js +4 -0
  155. package/dist/{chunk-6KGIHI6X.js → chunk-QVAOSKFO.js} +10 -10
  156. package/dist/{chunk-2UO47XB4.js → chunk-R64OZ6TC.js} +26 -12
  157. package/dist/{chunk-JTMEFXRL.js → chunk-RDTKMSEK.js} +1 -1
  158. package/dist/{chunk-IPO4LHSB.js → chunk-RKL47W7I.js} +6 -6
  159. package/dist/{chunk-QALPUJR2.js → chunk-RPTOAKLB.js} +1 -1
  160. package/dist/{chunk-3BFZVVAT.js → chunk-RQ6TC6RM.js} +1 -1
  161. package/dist/{chunk-4P3324KU.js → chunk-RSJLN3EG.js} +1 -1
  162. package/dist/{chunk-SAP4YI2Y.js → chunk-SDAX6BXF.js} +1 -1
  163. package/dist/{chunk-OA54HARK.js → chunk-SIA3W7VE.js} +6 -6
  164. package/dist/{chunk-DWAA4YZV.js → chunk-SJQKEIS7.js} +3 -3
  165. package/dist/{chunk-OH5L6HYW.js → chunk-SXBOODCJ.js} +4 -4
  166. package/dist/{chunk-3IUPYCW3.js → chunk-SZTIP6T7.js} +1 -1
  167. package/dist/{chunk-KYBXJL6A.js → chunk-T2ZFXPQV.js} +21 -21
  168. package/dist/{chunk-VX6TKEEK.js → chunk-TKE3EF2U.js} +1 -1
  169. package/dist/{chunk-XQZL6JDD.js → chunk-TURECNEK.js} +4 -4
  170. package/dist/{chunk-AWKJZSTO.js → chunk-U6IJL4Q5.js} +1 -1
  171. package/dist/{chunk-7FW2BQTV.js → chunk-U7T2ONAY.js} +1 -1
  172. package/dist/chunk-UGOSZLCD.js +14 -0
  173. package/dist/{chunk-HNVSVTNC.js → chunk-UIN2LUCZ.js} +14 -14
  174. package/dist/{chunk-55AEZX6K.js → chunk-UZ7TKJRO.js} +1 -1
  175. package/dist/{chunk-BBXFIBXB.js → chunk-V6LPIDZ6.js} +1 -1
  176. package/dist/chunk-VNTJ7QO5.js +1 -0
  177. package/dist/{chunk-SL77N7VT.js → chunk-VTXCCFJ4.js} +3 -3
  178. package/dist/{chunk-PSR6SXCC.js → chunk-WB6E6CSH.js} +13 -13
  179. package/dist/{chunk-CRILBBSU.js → chunk-WDZUPDNC.js} +1 -1
  180. package/dist/{chunk-6M5O2P64.js → chunk-WMS2DCRV.js} +9 -9
  181. package/dist/chunk-WQGBYFS3.js +8 -0
  182. package/dist/{chunk-PCTOL2FX.js → chunk-WTTXLWMK.js} +8 -8
  183. package/dist/{chunk-WPCNJ4UL.js → chunk-WYSNMIZN.js} +1 -1
  184. package/dist/{chunk-Z44JWU75.js → chunk-WZMZ3N5B.js} +2 -2
  185. package/dist/chunk-Y2LWUBXX.js +2 -0
  186. package/dist/{chunk-OKHKY3ZZ.js → chunk-YGCVMPIU.js} +1 -1
  187. package/dist/{chunk-NRALUW6P.js → chunk-YIFRSPUM.js} +10 -10
  188. package/dist/{chunk-EN5NXWT6.js → chunk-YKEB576T.js} +1 -1
  189. package/dist/{chunk-COF33H6J.js → chunk-YM4XIO4K.js} +5 -5
  190. package/dist/chunk-YMBNVMFU.js +11 -0
  191. package/dist/{chunk-2PGR2276.js → chunk-YY5TUQS4.js} +3 -3
  192. package/dist/{chunk-LXL2UCUR.js → chunk-Z32K3LIJ.js} +1 -1
  193. package/dist/{chunk-P3RXXWXN.js → chunk-ZDDYTXPK.js} +6 -6
  194. package/dist/{chunk-V2J2AHDW.js → chunk-ZGQ6H2PU.js} +4 -4
  195. package/dist/{chunk-NU5HN3FZ.js → chunk-ZM2NOLT6.js} +12 -12
  196. package/dist/chunk-ZQJTLJUF.js +2 -0
  197. package/dist/chunk-ZVEDA462.js +3 -0
  198. package/dist/{chunk-TGGUYAWA.js → chunk-ZWLOVJWN.js} +1 -1
  199. package/dist/data/DataTable.js +1 -1
  200. package/dist/data/EntityList.js +1 -1
  201. package/dist/data/Kanban.js +1 -1
  202. package/dist/data/ListFooter.js +1 -1
  203. package/dist/data/ListLoadError.js +1 -1
  204. package/dist/data/Pagination.js +1 -1
  205. package/dist/data/ResizableTable.js +1 -1
  206. package/dist/file-intake/index.js +1 -1
  207. package/dist/format/index.d.ts +1 -0
  208. package/dist/format/index.js +1 -1
  209. package/dist/forms/BorderInput.d.ts +3 -3
  210. package/dist/forms/BorderInput.js +1 -1
  211. package/dist/forms/BrandAssetEditor.js +1 -1
  212. package/dist/forms/Calendar.js +1 -1
  213. package/dist/forms/ColorPicker.js +1 -1
  214. package/dist/forms/ComposerAttachments.js +1 -1
  215. package/dist/forms/CornersInput.js +1 -1
  216. package/dist/forms/DatePicker.js +1 -1
  217. package/dist/forms/DateRangePicker.js +1 -1
  218. package/dist/forms/DateTimePicker.js +1 -1
  219. package/dist/forms/DisplayChips.js +1 -1
  220. package/dist/forms/FilePicker.js +1 -1
  221. package/dist/forms/FormErrorSummary.js +1 -1
  222. package/dist/forms/IconPicker.d.ts +12 -1
  223. package/dist/forms/IconPicker.js +1 -1
  224. package/dist/forms/ImageFocusPoint.js +1 -1
  225. package/dist/forms/Input.js +1 -1
  226. package/dist/forms/InputNumber.js +1 -1
  227. package/dist/forms/LinkPicker.d.ts +22 -0
  228. package/dist/forms/LinkPicker.js +1 -1
  229. package/dist/forms/MediaLibrary.js +1 -1
  230. package/dist/forms/MediaUploadField.js +1 -1
  231. package/dist/forms/MediaUploadGrid.js +1 -1
  232. package/dist/forms/MediaUsedInList.js +1 -1
  233. package/dist/forms/NumericKeypad.js +1 -1
  234. package/dist/forms/PositionInput.js +1 -1
  235. package/dist/forms/RenameField.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/index.js +1 -1
  250. package/dist/index.d.ts +2 -1
  251. package/dist/index.js +509 -509
  252. package/dist/locales/zh-Hans.js +1 -1
  253. package/dist/map/index.js +3 -3
  254. package/dist/markdown/index.js +1 -1
  255. package/dist/page-tabs/index.js +5 -5
  256. package/dist/pdf/index.js +1 -1
  257. package/dist/shell/Accordion.js +1 -1
  258. package/dist/shell/AppUpdateBanner.js +1 -1
  259. package/dist/shell/Avatar.js +1 -1
  260. package/dist/shell/Banner.js +1 -1
  261. package/dist/shell/Breadcrumbs.js +1 -1
  262. package/dist/shell/BudgetBar.js +1 -1
  263. package/dist/shell/Card.js +1 -1
  264. package/dist/shell/ColoredBadge.js +1 -1
  265. package/dist/shell/ConfirmDialog.js +1 -1
  266. package/dist/shell/ContainerFillChart.js +1 -1
  267. package/dist/shell/ContextMenu.js +1 -1
  268. package/dist/shell/CountBadge.js +1 -1
  269. package/dist/shell/Dialog.js +1 -1
  270. package/dist/shell/Drawer.js +1 -1
  271. package/dist/shell/DropdownMenu.js +1 -1
  272. package/dist/shell/EditableGrid.js +1 -1
  273. package/dist/shell/EmptyState.js +1 -1
  274. package/dist/shell/GlobalSearch.js +1 -1
  275. package/dist/shell/HelpCenter.js +1 -1
  276. package/dist/shell/IconRail.js +1 -1
  277. package/dist/shell/ImageLightbox.js +1 -1
  278. package/dist/shell/ItemCount.js +1 -1
  279. package/dist/shell/LanguageSelect.js +1 -1
  280. package/dist/shell/Markdown.js +1 -1
  281. package/dist/shell/MetricBar.js +1 -1
  282. package/dist/shell/MetricBarLegend.js +1 -1
  283. package/dist/shell/MilestoneTimeline.js +1 -1
  284. package/dist/shell/PageHeader.js +1 -1
  285. package/dist/shell/PopupMenu.js +1 -1
  286. package/dist/shell/ProductionTimeline.js +1 -1
  287. package/dist/shell/ResizeHandle.js +1 -1
  288. package/dist/shell/Result.js +1 -1
  289. package/dist/shell/SearchableSelect.js +1 -1
  290. package/dist/shell/SettingReset.js +1 -1
  291. package/dist/shell/SettingRow.js +1 -1
  292. package/dist/shell/SidebarLayout.js +1 -1
  293. package/dist/shell/SidebarNav.js +1 -1
  294. package/dist/shell/SortableList.js +1 -1
  295. package/dist/shell/Statistic.js +1 -1
  296. package/dist/shell/StepChain.js +1 -1
  297. package/dist/shell/Stepper.js +1 -1
  298. package/dist/shell/TimeAgo.js +1 -1
  299. package/dist/shell/TimelineTrack.js +1 -1
  300. package/dist/shell/TopNav.js +1 -1
  301. package/dist/shell/TransferProgress.js +1 -1
  302. package/dist/shell/Tree.js +1 -1
  303. package/dist/shell/discardGuard.js +1 -1
  304. package/dist/shell/language.js +1 -1
  305. package/dist/shell/strings.d.ts +129 -0
  306. package/dist/shell/strings.js +1 -1
  307. package/dist/shell/toast.js +1 -1
  308. package/dist/telemetry/index.js +1 -1
  309. package/dist/templates/AuthScreen.js +1 -1
  310. package/dist/templates/ChatTemplate.js +1 -1
  311. package/dist/templates/CheckoutTemplate.js +1 -1
  312. package/dist/templates/DashboardTemplate.js +1 -1
  313. package/dist/templates/DataTablePage.js +1 -1
  314. package/dist/templates/EmailTemplate.js +1 -1
  315. package/dist/templates/ErrorBoundary.js +1 -1
  316. package/dist/templates/ErrorPage.js +1 -1
  317. package/dist/templates/FormLayoutPage.js +1 -1
  318. package/dist/templates/GalleryTemplate.js +1 -1
  319. package/dist/ui/index.d.ts +2 -1
  320. package/dist/ui/index.js +1 -1
  321. package/dist/version.js +1 -1
  322. package/package.json +1 -1
  323. package/dist/Calculator-OJSMHQKW.js +0 -29
  324. package/dist/Files-NXY7XRZD.js +0 -88
  325. package/dist/PdfViewer-Y3SAVADX.js +0 -1
  326. package/dist/Sidebar-BCTWRG7P.js +0 -44
  327. package/dist/Spreadsheet-BPW2TLVQ.js +0 -37
  328. package/dist/chunk-3XZFWR6T.js +0 -13
  329. package/dist/chunk-4P57TIFK.js +0 -2
  330. package/dist/chunk-5PDHKH2A.js +0 -3
  331. package/dist/chunk-77AQNJE2.js +0 -9
  332. package/dist/chunk-7INZ7O3A.js +0 -5
  333. package/dist/chunk-CH3JQUDW.js +0 -8
  334. package/dist/chunk-DOF56HTO.js +0 -6
  335. package/dist/chunk-EVX7AZII.js +0 -9
  336. package/dist/chunk-EXLHFM3V.js +0 -6
  337. package/dist/chunk-GBATZZX7.js +0 -1
  338. package/dist/chunk-GDQJBQ5B.js +0 -1
  339. package/dist/chunk-K4JQ3FQI.js +0 -2
  340. package/dist/chunk-LDZQJLMC.js +0 -3
  341. package/dist/chunk-M66ACZXQ.js +0 -5
  342. package/dist/chunk-MHPFBVDD.js +0 -8
  343. package/dist/chunk-NWC6YCIJ.js +0 -11
  344. package/dist/chunk-NZISMTQE.js +0 -7
  345. package/dist/chunk-PLK2WHZG.js +0 -27
  346. package/dist/chunk-QO5E33DH.js +0 -8
  347. package/dist/chunk-RBZKV3ED.js +0 -14
  348. package/dist/chunk-TNJ2VCH4.js +0 -8
  349. package/dist/chunk-VX4COEWP.js +0 -4
  350. package/dist/chunk-WOAMPTZI.js +0 -20
  351. package/dist/chunk-XFH64VIG.js +0 -19
  352. package/dist/chunk-XKGEI6NL.js +0 -28
  353. package/dist/chunk-XXL5RLNM.js +0 -22
@@ -1,2 +1,2 @@
1
- import{EmptyValue as r}from"./chunk-HNQPF5QZ.js";import{toInstant as e,timeAgo as t}from"./chunk-GEYM4WN3.js";import{formatDateTime as o}from"./chunk-Y3JW2GW5.js";import{useShellLocale as c}from"./chunk-GDQJBQ5B.js";import{jsx as i}from"react/jsx-runtime";function m({value:m,precise:n,locale:s,className:l}){const a=c(),p=e(m);if(!p)/* @__PURE__ */return i(r,{});const u="string"==typeof m?m:p.toISOString();/* @__PURE__ */
1
+ import{EmptyValue as r}from"./chunk-HNQPF5QZ.js";import{toInstant as e,timeAgo as t}from"./chunk-GEYM4WN3.js";import{formatDateTime as o}from"./chunk-Y3JW2GW5.js";import{useShellLocale as c}from"./chunk-VNTJ7QO5.js";import{jsx as i}from"react/jsx-runtime";function m({value:m,precise:n,locale:s,className:l}){const a=c(),p=e(m);if(!p)/* @__PURE__ */return i(r,{});const u="string"==typeof m?m:p.toISOString();/* @__PURE__ */
2
2
  return i("time",{dateTime:u,title:o(u,{locale:s??a}),className:l,children:t(p,{precise:n,locale:s??a})})}export{m as TimeAgo};
@@ -1,4 +1,4 @@
1
- import{Icon as e}from"./chunk-2UO47XB4.js";import{SpinnerRing as t}from"./chunk-R2VKEMZH.js";import{useState as a,useId as r,Children as s,isValidElement as i}from"react";import{jsx as n,jsxs as l}from"react/jsx-runtime";function c({summary:t,busy:c=!1,open:o,onOpenChange:d,label:m="Steps",className:u="",children:p}){const[f,h]=a(null),g=r(),x=o??f??c;return 1===s.toArray(p).filter(i).length?/* @__PURE__ */n("div",{className:`text-xs text-gray-500 ${u}`.trim(),children:/* @__PURE__ */n("ol",{"aria-label":m,children:p})}):/* @__PURE__ */l("div",{className:`text-xs text-gray-500 ${u}`.trim(),children:[
1
+ import{Icon as e}from"./chunk-R64OZ6TC.js";import{SpinnerRing as t}from"./chunk-R2VKEMZH.js";import{useState as a,useId as r,Children as s,isValidElement as i}from"react";import{jsx as n,jsxs as l}from"react/jsx-runtime";function c({summary:t,busy:c=!1,open:o,onOpenChange:d,label:m="Steps",className:u="",children:p}){const[f,h]=a(null),g=r(),x=o??f??c;return 1===s.toArray(p).filter(i).length?/* @__PURE__ */n("div",{className:`text-xs text-gray-500 ${u}`.trim(),children:/* @__PURE__ */n("ol",{"aria-label":m,children:p})}):/* @__PURE__ */l("div",{className:`text-xs text-gray-500 ${u}`.trim(),children:[
2
2
  /* @__PURE__ */l("button",{type:"button",onClick:()=>{h(!x),d?.(!x)},"aria-expanded":x,"aria-controls":x?g:void 0,className:"flex w-full items-center gap-2 rounded text-left hover:text-gray-700 focus-visible:outline focus-visible:outline-2 focus-visible:outline-blue-600",children:[
3
3
  /* @__PURE__ */n(e,{name:"chevron-right",size:12,className:"shrink-0 motion-safe:transition-transform "+(x?"rotate-90":"")}),
4
4
  /* @__PURE__ */n("span",{"aria-live":"polite",className:"min-w-0 flex-1 truncate",children:t})]}),x&&/* @__PURE__ */n("ol",{id:g,"aria-label":m,className:"mt-2 ml-2 space-y-2 border-l border-gray-200 pl-3",children:p})]})}var o={pending:"text-gray-400",active:"text-gray-800",complete:"text-gray-600",failed:"text-red-600",stopped:"text-gray-500",waiting:"text-amber-700",skipped:"text-gray-400"},d={pending:"Pending",active:"In progress",complete:"Done",failed:"Failed",stopped:"Stopped",waiting:"Waiting for you",skipped:"Skipped"};function m({status:a}){switch(a){case"active":/* @__PURE__ */
@@ -1,5 +1,5 @@
1
- import{ChartTooltip as e}from"./chunk-36VIGB6J.js";import{CartesianPlot as l}from"./chunk-QO5E33DH.js";import{STATUS_VARS as o}from"./chunk-TZFACUMR.js";import{useShellStrings as t,useShellLocale as a}from"./chunk-GDQJBQ5B.js";import{formatPlain as i,formatFixed as r}from"./chunk-C3QOHMR6.js";import{jsx as c,jsxs as n,Fragment as s}from"react/jsx-runtime";function h({candles:h,variant:m="candle",height:p=260,width:d,formatValue:u,yAxisLabel:b,label:y,className:x,emptyLabel:k}){const g=t().charts,f=a(),w=u??(e=>Number.isInteger(e)?i(e,f):r(e,2,f)),M=y??g.price,v=h.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),j=Math.min(...v),L=Math.max(...v),A=.08*(L-j)||1;/* @__PURE__ */
2
- return c(l,{labels:h.map(e=>e.label),values:v,height:p,width:d,min:j-A,max:L+A,bandPadding:.42,formatValue:w,yAxisLabel:b,className:x,emptyLabel:k,ariaLabel:g.ohlc(M,h.length),tooltip:l=>{const t=h[l],a=t.close>=t.open,i=a?o.good:o.critical;/* @__PURE__ */
1
+ import{ChartTooltip as e}from"./chunk-36VIGB6J.js";import{CartesianPlot as l}from"./chunk-WQGBYFS3.js";import{STATUS_VARS as o}from"./chunk-TZFACUMR.js";import{useShellStrings as t,useShellLocale as a}from"./chunk-VNTJ7QO5.js";import{formatPlain as i,formatFixed as r}from"./chunk-C3QOHMR6.js";import{jsx as c,jsxs as n,Fragment as s}from"react/jsx-runtime";function h({candles:h,variant:m="candle",height:p=260,width:d,formatValue:u,yAxisLabel:b,label:y,className:x,emptyLabel:k}){const g=t().charts,f=a(),w=u??(e=>Number.isInteger(e)?i(e,f):r(e,2,f)),M=y??g.price,v=h.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),j=Math.min(...v),L=Math.max(...v),N=.08*(L-j)||1;/* @__PURE__ */
2
+ return c(l,{labels:h.map(e=>e.label),values:v,height:p,width:d,min:j-N,max:L+N,bandPadding:.42,formatValue:w,yAxisLabel:b,className:x,emptyLabel:k,ariaLabel:g.ohlc(M,h.length),tooltip:l=>{const t=h[l],a=t.close>=t.open,i=a?o.good:o.critical;/* @__PURE__ */
3
3
  return c(e,{title:t.label,rows:[{key:"open",label:g.open,color:i,value:w(t.open)},{key:"high",label:g.high,color:i,value:w(t.high)},{key:"low",label:g.low,color:i,value:w(t.low)},{key:"close",label:g.close,color:i,value:w(t.close)}],emphasisKey:"close",footnote:a?g.closedAbove:g.closedBelow})},children:({x:e,y:l,active:t})=>/* @__PURE__ */c("g",{children:h.map((a,i)=>{const r=a.close>=a.open,h=r?o.good:o.critical,p=e.center(i),d=Math.max(3,e.bandwidth),u=null!==t&&t!==i,b=l(Math.max(a.open,a.close)),y=Math.max(1,Math.abs(l(a.close)-l(a.open)));/* @__PURE__ */
4
4
  return n("g",{opacity:u?.45:1,children:[
5
5
  /* @__PURE__ */c("line",{x1:p,y1:l(a.high),x2:p,y2:l(a.low),stroke:h,strokeWidth:1.5}),"candle"===m?/* @__PURE__ */c("rect",{x:p-d/2,y:b,width:d,height:y,rx:1,fill:r?h:"transparent",fillOpacity:r?.85:1,stroke:h,strokeWidth:1.5}):/* @__PURE__ */n(s,{children:[
@@ -0,0 +1,27 @@
1
+ import{Dialog as e}from"./chunk-IH2KC3NQ.js";import{buttonClasses as t}from"./chunk-UQYNPYF4.js";import{Icon as r}from"./chunk-R64OZ6TC.js";import{useShellStrings as n,splitAround as o}from"./chunk-VNTJ7QO5.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"}),L="w-full rounded-md border border-line-strong h-8 px-3 text-sm";function P(){/* @__PURE__ */
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),T=a(0),E=a([]),$=a(null),K=a(null),Q=c(e=>{F.current=e.id,N.current=e.resolve,y(e.id),b(e.options),l(!0)},[]),W=c(e=>{const t="string"==typeof e?{message:e}:e;return new Promise(e=>{const r={id:++T.current,options:t,resolve:e};null===F.current?Q(r):E.current.push(r)})},[Q]),[D,O]=s(!1),[V,Y]=s({message:""}),[H,I]=s(""),J=a(),R=c(e=>(Y(e),I(""),O(!0),new Promise(e=>{J.current=e})),[]),[U,Z]=s(!1),[q,z]=s({}),[A,B]=s(""),G=a(),M=c(e=>{const t="string"==typeof e?{message:e}:e;return z(t),B(t.defaultValue??""),Z(!0),new Promise(e=>{G.current=e})},[]);u(()=>{g=W,v=R,x=M},[W,R,M]);const S=(e,t)=>{if(F.current!==e)return;const r=N.current,n=E.current.shift();n?Q(n):(F.current=null,N.current=void 0,l(!1)),r?.(t)},X=e=>{O(!1),I(""),J.current?.(e)},_=e=>{if(e){const e=A.trim();if(!e&&!q.allowEmpty)return Z(!1),void G.current?.(null);Z(!1),G.current?.(e)}else Z(!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"===V.variant?"warning":"danger"],ne=V.confirmWord,oe=null==ne||H===ne,le=n().dialog,[ie,se]=o(le.typeToConfirm);/* @__PURE__ */
4
+ return d(f.Provider,{value:W,children:[t,
5
+ /* @__PURE__ */m(e,{open:r,onClose:()=>S(p,!1),initialFocus:$,footer:/* @__PURE__ */d(h,{children:[
6
+ /* @__PURE__ */m("button",{ref:$,type:"button",onClick:()=>S(p,!1),className:w,children:i.cancelLabel||le.cancel}),
7
+ /* @__PURE__ */m("button",{type:"button",onClick:()=>S(p,!0),className:te.button,children:i.confirmLabel||le.ok})]}),children:/* @__PURE__ */d("div",{className:"flex gap-4",children:[
8
+ /* @__PURE__ */m("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${te.icon}`,children:/* @__PURE__ */m(P,{})}),
9
+ /* @__PURE__ */d("div",{className:"flex-1",children:[
10
+ /* @__PURE__ */m("h2",{className:"text-base font-semibold text-gray-900",children:i.title||le.confirmTitle}),
11
+ /* @__PURE__ */m("p",{className:"mt-2 text-sm text-gray-600",children:i.message})]})]})}),
12
+ /* @__PURE__ */d(e,{open:D,onClose:()=>X(!1),initialFocus:null!=ne?void 0:K,footer:/* @__PURE__ */d(h,{children:[
13
+ /* @__PURE__ */m("button",{ref:K,type:"button",onClick:()=>X(!1),className:w,children:V.cancelLabel||le.destructiveCancel}),
14
+ /* @__PURE__ */m("button",{type:"button",onClick:()=>X(!0),disabled:!oe,className:re.button,children:ne??V.confirmLabel??le.destructiveConfirm})]}),children:[
15
+ /* @__PURE__ */m("button",{type:"button",onClick:()=>X(!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
+ /* @__PURE__ */d("div",{className:"flex gap-4",children:[
17
+ /* @__PURE__ */m("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${re.icon}`,children:/* @__PURE__ */m(P,{})}),
18
+ /* @__PURE__ */d("div",{className:"flex-1",children:[
19
+ /* @__PURE__ */m("h2",{className:"text-base font-semibold text-gray-900 pr-6",children:V.title||le.destructiveTitle}),
20
+ /* @__PURE__ */m("p",{className:"mt-2 text-sm text-gray-600",children:V.message}),null!=ne&&/* @__PURE__ */d(h,{children:[
21
+ /* @__PURE__ */d("p",{className:"mt-3 text-sm text-gray-700",children:[ie,
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:H,onChange:e=>I(e.target.value),onKeyDown:e=>{"Enter"===e.key&&H===ne&&X(!0)},placeholder:ne,className:`mt-2 ${L} focus:border-red-500`})]})]})]})]}),
24
+ /* @__PURE__ */d(e,{open:U,onClose:()=>_(!1),title:q.title||le.promptTitle,footer:/* @__PURE__ */d(h,{children:[
25
+ /* @__PURE__ */m("button",{type:"button",onClick:()=>_(!1),className:w,children:q.cancelLabel||le.cancel}),
26
+ /* @__PURE__ */m("button",{type:"button",onClick:()=>_(!0),disabled:!q.allowEmpty&&!A.trim(),className:C,children:q.confirmLabel||le.ok})]}),children:[q.message&&/* @__PURE__ */m("p",{className:"text-sm text-gray-600",children:q.message}),
27
+ /* @__PURE__ */m("input",{autoFocus:!0,type:"text",value:A,onChange:e=>B(e.target.value),onKeyDown:e=>{"Enter"===e.key?_(!0):"Escape"===e.key&&_(!1)},onFocus:e=>e.target.select(),placeholder:q.placeholder,className:`mt-3 ${L} 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};
@@ -1,4 +1,4 @@
1
- import{Icon as t}from"./chunk-2UO47XB4.js";import{jsxs as n,jsx as e}from"react/jsx-runtime";var r=t=>Array.isArray(t.options);function o(t){const n=[];for(const e of t)r(e)?n.push(...e.options):n.push(e);return n}function i(t,n){const e=[];for(const o of t){if(!r(o)){n(o)&&e.push(o);continue}const t=o.options.filter(n);t.length&&e.push({...o,options:t})}return e}function s(t,o,i,s=""){const a=[];let c=0;return t.forEach((t,u)=>{if(!r(t))return a.push(o(t,c)),void(c+=1);const l=`${i}-group-${u}`,p=c;c+=t.options.length,a.push(
1
+ import{Icon as t}from"./chunk-R64OZ6TC.js";import{jsxs as n,jsx as e}from"react/jsx-runtime";var r=t=>Array.isArray(t.options);function o(t){const n=[];for(const e of t)r(e)?n.push(...e.options):n.push(e);return n}function i(t,n){const e=[];for(const o of t){if(!r(o)){n(o)&&e.push(o);continue}const t=o.options.filter(n);t.length&&e.push({...o,options:t})}return e}function s(t,o,i,s=""){const a=[];let c=0;return t.forEach((t,u)=>{if(!r(t))return a.push(o(t,c)),void(c+=1);const l=`${i}-group-${u}`,p=c;c+=t.options.length,a.push(
2
2
  /* @__PURE__ */n("div",{role:"group","aria-labelledby":l,children:[
3
3
  /* @__PURE__ */e("div",{id:l,role:"presentation","data-option-group-heading":"",className:`truncate px-3 pb-1 pt-2 text-xs font-semibold text-gray-500 ${s}`.trim(),children:t.label}),t.options.map((t,n)=>o(t,p+n))]},l))}),a}function a({selected:n}){/* @__PURE__ */
4
4
  return e(t,{name:"check","aria-hidden":"true",className:"h-4 w-4 shrink-0 "+(n?"":"invisible"),strokeWidth:2.5})}function c(t,n){return t.label.toLowerCase().includes(n)||(t.sublabel?.toLowerCase().includes(n)??!1)}function u({children:t,grows:n=!1}){/* @__PURE__ */
@@ -0,0 +1,13 @@
1
+ import{nextEnabledIndex as e}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as t,filterOptionItems as n,optionMatches as r,groupedRows as l,OptionCheck as o,OptionSublabel as i}from"./chunk-HWFBNYNI.js";import{END_ACTIONS_PAD as a,InputEndActionSlot as s,InputEndActionButton as c}from"./chunk-2UTCGWMZ.js";import{INPUT_BASE_ON as u,INPUT_BASE as d}from"./chunk-AYZY3YNC.js";import{Button_default as h}from"./chunk-EOVXFXVV.js";import{Icon as p}from"./chunk-R64OZ6TC.js";import{LoadingSpinner as m}from"./chunk-R2VKEMZH.js";import{Tooltip as f}from"./chunk-NJN5IKWO.js";import{onOverlayOpen as b}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as g}from"./chunk-62LW225J.js";import{useDropdownPosition as v,MENU_MAX_HEIGHT as w}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as y}from"./chunk-D65T4H6J.js";import{GLASS_DIVIDER as x,glassStyle as k}from"./chunk-5FYDNH4Y.js";import{registerModalEscapeInterceptor as N}from"./chunk-TWVUQUUD.js";import{useShellStrings as j}from"./chunk-VNTJ7QO5.js";import{useState as $,useId as D,useRef as C,useMemo as W,useEffect as S}from"react";import{createPortal as F}from"react-dom";import{jsxs as M,jsx as R}from"react/jsx-runtime";function T(e,t){const n=e.length;if(0===n||t(e.join(", ")))return{shown:n,cut:!1};if(1===n)return{shown:1,cut:!0};let r=0;for(let l=1;l<n&&t(`${e.slice(0,l).join(", ")} +${n-l}`);l+=1)r=l;return{shown:r,cut:!1}}var E=["right-2","right-8","right-16"],O=[8,32,64];function z(z){const{options:L,placeholder:A,emptyOptionLabel:H,className:I="",disabled:U,id:V,filter:Y=!1,allowFreeText:B=!1,freeTextOption:J,onSearchChange:Z,loading:G=!1,error:K,onRetry:X,rightAdornment:Q,endAction:P,renderOption:q,clearable:_=!0,"aria-label":ee,"aria-labelledby":te,"aria-describedby":ne}=z,re=!0===z.multiple,le=z.multiple?z.value:z.value?[z.value]:[],oe=z.multiple?"":z.value,ie=e=>{z.multiple?z.onChange(e):z.onChange(e[0]??"")},ae=le.length>0,se=Y&&ae&&!U,ce=re||Y,ue=null!=J,de=B||ue,[he,pe]=$(!1),[me,fe]=$(-1),be=D(),ge=V??`${be}-input`,ve=`${be}-listbox`,we=e=>`${be}-opt-${e}`,[ye,xe]=$(""),ke=j(),Ne=H??ke.select.none,je=e=>{xe(e),fe(-1),Z?.(e)},$e=C(null),De=C(null),Ce=C(null),We=C(null),Se=C(he);Se.current=he;const Fe=C(!1),Me=e=>{Se.current&&(Se.current=!1,e&&B&&!ue&&et&&(re?le.includes(et)||ie([...le,et]):et!==oe&&ie([et])),pe(!1),je(""))},Re=(e,t)=>{if(!e.disabled){if(re)return ie(le.includes(e.value)?le.filter(t=>t!==e.value):[...le,e.value]),void(e===tt?je(""):fe(t));ie([e.value]),Me(!1)}},[Te,Ee]=$(null);y(()=>{if(!Q||he)return void Ee(null);const e=We.current?.offsetWidth??0;Ee(e?e+O[Ue]+6:null)});const Oe=v(De,he,ce?{popupRef:Ce}:{matchTriggerWidth:!0}),ze=W(()=>t(L),[L]),Le=le.join("\0"),Ae=W(()=>{const e=[],t=/* @__PURE__ */new Set;for(const n of ze)le.includes(n.value)&&!t.has(n.value)&&(t.add(n.value),e.push(n.label));if(de)for(const n of le)t.has(n)||e.push(n);return e},[ze,Le,de]),He=Ae.join(", "),Ie=_&&ae&&!U,Ue=(Ie?1:0)+(P?1:0),[Ve,Ye]=$(null),Be=C(null),Je=C(""),Ze=C(()=>{});Ze.current=()=>{const e=De.current,t=Be.current;if(!re||!e||!t)return;const n=getComputedStyle(e),r=e.clientWidth-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0),l=[n.fontStyle,n.fontWeight,n.fontSize,n.fontFamily,n.letterSpacing].join("|"),o=`${r}|${l}|${Ae.join("\0")}`;if(o===Je.current)return;Je.current=o;let i=null;r>0&&Ae.length>0&&(t.style.fontStyle=n.fontStyle,t.style.fontWeight=n.fontWeight,t.style.fontSize=n.fontSize,t.style.fontFamily=n.fontFamily,t.style.letterSpacing=n.letterSpacing,i=T(Ae,e=>(t.textContent=e,t.getBoundingClientRect().width<=r)),t.textContent=""),Ye(e=>e?.shown===i?.shown&&e?.cut===i?.cut?e:i)},y(()=>{Ze.current()}),S(()=>{const e=De.current;if(!re||!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>Ze.current());return t.observe(e),()=>t.disconnect()},[re]);const Ge=Ae.length,Ke=!re||!Ve||Ve.shown>=Ge?He:0===Ve.shown?ke.select.selectedCount(Ge):`${Ae.slice(0,Ve.shown).join(", ")} +${Ge-Ve.shown}`,Xe=re&&null!==Ve&&(Ve.shown<Ge||Ve.cut),Qe=he&&ae&&ce;S(()=>{if(!he)return;const e=e=>{const t=e.target;$e.current?.contains(t)||Ce.current?.contains(t)||Me(!0)};document.addEventListener("mousedown",e);const t=b(()=>Me(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[he,B,ye,Le,z.onChange]),S(()=>{if(he)return N(e=>!("Escape"!==e.key||!Se.current)&&(Me(!1),De.current?.blur(),!0),()=>Ce.current)},[he]);const Pe=W(()=>{const e=/* @__PURE__ */new Set;return n(L,t=>!e.has(t.value)&&(e.add(t.value),!0))},[L]),qe=W(()=>{if(Z)return Pe;const e=ye.trim().toLowerCase();return e?n(Pe,t=>r(t,e)):Pe},[Pe,ye,Z]),_e=W(()=>t(qe),[qe]),et=ye.trim(),tt=W(()=>ue&&et?ze.some(e=>e.label===et)||le.includes(et)?null:{value:et,label:et}:null,[ue,et,ze,Le]),nt=W(()=>tt?[..._e,tt]:_e,[_e,tt]);/* @__PURE__ */
2
+ return M("div",{ref:$e,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&($e.current?.contains(t)||Ce.current?.contains(t))||Fe.current||document.activeElement!==De.current&&Me(!0)},children:[(rt=/* @__PURE__ */R("input",{id:ge,ref:De,type:"text",autoComplete:"off",role:"combobox","aria-expanded":he,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":he?ve:void 0,"aria-activedescendant":he&&me>=0&&me<nt.length?we(me):void 0,"aria-label":te?void 0:ee,"aria-labelledby":te,"aria-describedby":ne,value:he?ye:Ke,onChange:e=>{je(e.target.value),pe(!0)},onFocus:()=>{U||(je(""),pe(!0))},onKeyDown:t=>{if("ArrowDown"===t.key||"ArrowUp"===t.key){if(U)return;if(t.preventDefault(),!he)return void pe(!0);if(0===nt.length)return;const n="ArrowDown"===t.key?1:-1;return void fe(t=>e(nt,t,n))}"Enter"===t.key?(t.preventDefault(),he&&me>=0&&me<nt.length?Re(nt[me],me):1!==_e.length||_e[0].disabled?B&&!ue&&et&&(re?(le.includes(et)||ie([...le,et]),je("")):(ie([et]),Me(!1),De.current?.blur())):Re(_e[0],0)):"Escape"===t.key?(Me(!1),De.current?.blur()):"Tab"===t.key&&Me(!0)},placeholder:Qe?Ke:A||Ne,className:`${se?u:d} ${I} ${a[Ue]}${U?"bg-surface-sunken text-ink-faintest cursor-not-allowed":""} truncate${Qe?" rosh-field-shows-choice":""}`,style:Te?{paddingRight:Te}:void 0,disabled:U}),re?/* @__PURE__ */R(f,{content:!he&&Xe?He:null,className:"block",children:rt}):rt),re&&
3
+ /* @__PURE__ */R("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */R("span",{ref:Be,className:"whitespace-pre"})}),Ue>0&&
4
+ /* @__PURE__ */M(s,{children:[Ie&&
5
+ /* @__PURE__ */R("span",{onMouseDown:e=>e.preventDefault(),className:"flex opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100",children:/* @__PURE__ */R(c,{action:{label:ke.select.clear,icon:/* @__PURE__ */R(p,{name:"close"}),onClick:()=>{ie([]),Me(!1)}}})}),P&&/* @__PURE__ */R("span",{onMouseDown:e=>e.preventDefault(),className:"flex",children:/* @__PURE__ */R(c,{action:P})})]}),Q&&!he&&/* @__PURE__ */R("div",{ref:We,className:`absolute top-1/2 -translate-y-1/2 ${E[Ue]} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:Q}),he&&F(
6
+ /* @__PURE__ */M("div",{ref:Ce,onMouseDownCapture:()=>{Fe.current=!0,setTimeout(()=>{Fe.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:g.popup,left:Oe?.left,right:Oe?.right,top:Oe?.top,bottom:Oe?.bottom,minWidth:Oe?.minWidth,width:Oe?.width,...ce&&{maxWidth:Oe?.maxWidth},visibility:Oe?void 0:"hidden",...k()},children:[re&&ae&&_&&!U&&
7
+ /* @__PURE__ */R("button",{type:"button",tabIndex:-1,onMouseDown:e=>{e.preventDefault(),ie([])},className:`block w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm text-gray-600 hover:bg-row-hover border-b ${x}`,children:ke.select.clearAll}),G?
8
+ /* @__PURE__ */R(m,{size:"sm",padding:"py-2",label:ke.search.searching}):K?/* @__PURE__ */M("div",{role:"alert",className:"flex items-center gap-2 px-3 py-2 text-sm text-red-600",children:[
9
+ /* @__PURE__ */R("span",{className:"min-w-0 flex-1",children:K}),X&&/* @__PURE__ */R(h,{variant:"link",size:"sm",onMouseDown:e=>e.preventDefault(),onClick:X,className:"shrink-0",children:ke.list.retry})]}):null,
10
+ /* @__PURE__ */M("div",{id:ve,role:nt.length?"listbox":void 0,"aria-labelledby":nt.length?te??(ee?void 0:ge):void 0,"aria-label":nt.length&&!te?ee:void 0,"aria-multiselectable":!(!nt.length||!re)||void 0,className:"overflow-y-auto",style:{maxHeight:Oe?.maxHeight??w},children:[0===nt.length?G||K?null:/* @__PURE__ */R("p",{className:"px-3 py-3 text-sm text-ink-faintest text-center",children:ke.select.noMatches}):0===_e.length?null:l(qe,(e,t)=>{const n=le.includes(e.value);/* @__PURE__ */
11
+ return M("button",{id:we(t),type:"button",role:"option","aria-selected":n,"aria-disabled":e.disabled||void 0,tabIndex:-1,onMouseDown:n=>{(e.disabled||re)&&n.preventDefault(),Re(e,t)},className:"w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center justify-between gap-2 whitespace-nowrap "+(e.disabled?"cursor-not-allowed text-gray-400":`hover:bg-gray-50 ${n?"text-blue-600 font-medium":"text-gray-700"} ${t===me?"bg-gray-100":n?"bg-blue-50/50":""}`),children:[re&&/* @__PURE__ */R(o,{selected:n}),
12
+ /* @__PURE__ */R("span",{className:`min-w-0 ${ce?"flex-auto":"flex-1"} truncate`,children:q?q(e,{selected:n,active:t===me}):e.label}),e.sublabel&&/* @__PURE__ */R(i,{grows:ce,children:e.sublabel})]},e.value)},be),tt&&J&&
13
+ /* @__PURE__ */R("button",{id:we(_e.length),type:"button",role:"option","aria-selected":!1,tabIndex:-1,onMouseDown:e=>{re&&e.preventDefault(),Re(tt,_e.length)},className:`w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 whitespace-nowrap text-ink hover:bg-row-hover ${_e.length?`border-t ${x}`:""} ${me===_e.length?"bg-gray-100":""}`,children:/* @__PURE__ */R("span",{className:"min-w-0 flex-1 truncate",children:J(tt.value)})},`${be}-typed`)]})]}),document.body)]});var rt}export{z as SearchableSelect,T as fitChoice};
@@ -1,4 +1,4 @@
1
- import{DropdownMenu as e}from"./chunk-NZISMTQE.js";import{Fragment as t}from"react";import{jsxs as a,jsx as r,Fragment as n}from"react/jsx-runtime";var i="relative inline-flex items-center gap-2 px-4 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-40",s="bg-blue-50 text-blue-600",l="text-gray-600 hover:bg-gray-50 hover:text-gray-900";function c(){/* @__PURE__ */
1
+ import{DropdownMenu as e}from"./chunk-IEHTZR5M.js";import{Fragment as t}from"react";import{jsxs as a,jsx as r,Fragment as n}from"react/jsx-runtime";var i="relative inline-flex items-center gap-2 px-4 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-40",s="bg-blue-50 text-blue-600",l="text-gray-600 hover:bg-gray-50 hover:text-gray-900";function c(){/* @__PURE__ */
2
2
  return r("span",{className:"my-3 w-px shrink-0 bg-gray-200","aria-hidden":!0})}function m({item:e,active:t,caret:i}){/* @__PURE__ */
3
3
  return a(n,{children:[e.icon&&/* @__PURE__ */r("span",{className:"h-4 w-4 shrink-0",children:e.icon}),
4
4
  /* @__PURE__ */r("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */r("span",{className:"ml-0.5 inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-gray-100 px-2 text-2xs font-semibold leading-5 text-gray-600",children:e.badge}),i&&/* @__PURE__ */r("span",{className:"-ml-1 text-xs","aria-hidden":!0,children:"▾"}),t&&/* @__PURE__ */r("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]})}function d({items:n,activeKey:d,onSelect:o,brand:u,actions:b,linkAs:h,className:g}){/* @__PURE__ */
@@ -1,14 +1,14 @@
1
- import{FormField as e}from"./chunk-6KBDNYRW.js";import{zoneFocusClass as t,mediaPromptLine as r,UploadGlyph as a,dropzoneClass as n,BusyOverlay as l,isVideoUrl as i,mediaFileName as o,FilenameBadge as s}from"./chunk-H5NIW2KS.js";import{useFileIntake as d,FileIntakeAlert as c}from"./chunk-JTMEFXRL.js";import{ColoredBadge as u}from"./chunk-OKHKY3ZZ.js";import{MENU_ON_MEDIA_ATTR as m}from"./chunk-5QFPTDQF.js";import{Icon as p}from"./chunk-2UO47XB4.js";import{Tooltip as f}from"./chunk-NJN5IKWO.js";import{useShellStrings as h}from"./chunk-GDQJBQ5B.js";import{useId as g,useState as b,useRef as y}from"react";import{jsxs as v,jsx as x}from"react/jsx-runtime";var k=112,D=/* @__PURE__ */x(p,{name:"close",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3"});function N({items:p,onPick:k,onFiles:N,onRemove:w,onReorder:j,dragType:K,onDragOutChange:T,dropType:C,onDropData:O,label:A,hint:I,error:F,required:L,className:S,accept:z="image/*",maxSizeBytes:E,maxFiles:P,fit:$="cover",thumbSize:B=96,placeholder:H,cta:M,acceptHint:R,showCover:W=!1,coverLabel:Q,busy:J=!1,busyLabel:q,progress:U,disabled:X=!1,readOnly:Y=!1,selected:Z,onItemClick:G,onItemDoubleClick:V,onItemContextMenu:_,menuOnMedia:ee=!1}){const te=h().media,re=M??te.cta,ae=Q??te.cover,ne=q??te.uploading,le=g(),[ie,oe]=b(null),se=X||J,de=!(!k&&!N||se||Y),ce=!!w&&!se&&!Y,ue=!!j&&!se&&!Y,me=!!K&&!X&&!ue,pe=!(!C||!O||se||Y),fe=t(se),he=H??r(z,te),ge=d({accept:z,maxSizeBytes:E,maxFiles:P,acceptHint:R,multiple:!0,disabled:!de,currentCount:p.length,onAccept:e=>{if(N)N(e);else for(const t of e)k(t)}}),[be,ye]=b(!1),ve=y(0),xe=e=>pe&&Array.from(e.dataTransfer?.types??[]).includes(C),ke=ge.zoneProps,De={onDragEnter:e=>{if(!xe(e))return ke.onDragEnter?.(e);e.preventDefault(),ve.current+=1,ye(!0)},onDragOver:e=>{if(!xe(e))return ke.onDragOver?.(e);e.preventDefault(),e.dataTransfer.dropEffect="link",be||ye(!0)},onDragLeave:e=>{if(!xe(e))return ke.onDragLeave?.(e);ve.current=Math.max(0,ve.current-1),0===ve.current&&ye(!1)},onDrop:e=>{if(!xe(e))return ke.onDrop?.(e);e.preventDefault(),ve.current=0,ye(!1);const t=e.dataTransfer.getData(C);t&&O(t)}},Ne=ge.dragOver||be,we=()=>{de&&(k?k():ge.open())},je={width:B,height:B},Ke=null==Z?null:new Set(Z),Te=!!G,Ce=B<112,Oe=(e,t)=>{const r=e.kind?"video"===e.kind:i(e.url,z),a=e.name??o(e.url),n=W&&(e.cover??0===t);/* @__PURE__ */
2
- return v("div",{...Te?{"data-grid-item":"","data-grid-id":e.id,role:"option"}:{},...ee?{[m]:""}:{},"aria-selected":Ke?Ke.has(e.id):void 0,onClick:Te?t=>{t.target.closest?.("button")||G(e.id,{ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey})}:void 0,onDoubleClick:V?()=>V(e.id):void 0,onContextMenu:_?t=>_(e.id,t):void 0,draggable:ue||me&&!!e.dragData||void 0,onDragStart:ue?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(t)),oe(t)}:me&&e.dragData?t=>{t.dataTransfer.effectAllowed=e.dragAlso?"all":"link",t.dataTransfer.setData(K,e.dragData);for(const[r,a]of Object.entries(e.dragAlso??{}))t.dataTransfer.setData(r,a);T?.("start",e.id)}:void 0,onDragEnd:ue?()=>oe(null):me&&e.dragData&&T?t=>T("none"===t.dataTransfer.dropEffect?"cancelled":"dropped",e.id):void 0,onDragOver:ue?e=>{null!=ie&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:ue?e=>{null!=ie&&(e.preventDefault(),e.stopPropagation(),ie!==t&&j(ie,t),oe(null))}:void 0,tabIndex:ue||Te?0:void 0,"aria-label":ue?te.reorder(a,t+1,p.length):Te?a:void 0,onKeyDown:Te&&!ue?t=>{t.target!==t.currentTarget||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),G(e.id,{ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey}))}:ue?e=>{"ArrowLeft"===e.key||"ArrowUp"===e.key?t>0&&(e.preventDefault(),j(t,t-1)):"ArrowRight"!==e.key&&"ArrowDown"!==e.key||t<p.length-1&&(e.preventDefault(),j(t,t+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-line bg-gray-100",fe,ie===t?"opacity-50":"",Ke?.has(e.id)?"ring-2 ring-blue-500 ring-offset-1":"",Te?"cursor-pointer":""].join(" "),style:{...je,cursor:ue?"move":void 0},children:[r?/* @__PURE__ */x("video",{src:e.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":a,className:"h-full w-full",style:{objectFit:$}}):/* @__PURE__ */x("img",{src:e.url,alt:a,className:"h-full w-full",style:{objectFit:$}}),n&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 rounded bg-accent-fill px-2 py-0.5 text-xs font-medium text-on-accent",children:ae}),!n&&null!=e.mark&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-medium text-on-accent",style:{background:"var(--rosh-media-scrim)"},children:e.mark}),!n&&null==e.mark&&!!e.badges?.length&&
1
+ import{FormField as e}from"./chunk-6KBDNYRW.js";import{zoneFocusClass as t,mediaPromptLine as r,UploadGlyph as a,dropzoneClass as n,BusyOverlay as l,isVideoUrl as i,mediaFileName as o,FilenameBadge as s}from"./chunk-L433UT5E.js";import{useFileIntake as d,FileIntakeAlert as c}from"./chunk-RDTKMSEK.js";import{ColoredBadge as u}from"./chunk-YGCVMPIU.js";import{MENU_ON_MEDIA_ATTR as m}from"./chunk-5QFPTDQF.js";import{Icon as p}from"./chunk-R64OZ6TC.js";import{Tooltip as f}from"./chunk-NJN5IKWO.js";import{useShellStrings as h}from"./chunk-VNTJ7QO5.js";import{useId as g,useState as b,useRef as y}from"react";import{jsxs as v,jsx as x}from"react/jsx-runtime";var k=112,D=/* @__PURE__ */x(p,{name:"close",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3"});function N({items:p,onPick:k,onFiles:N,onRemove:w,onReorder:j,dragType:K,onDragOutChange:T,dropType:C,onDropData:O,label:A,hint:I,error:E,required:F,className:L,accept:P="image/*",maxSizeBytes:S,maxFiles:z,fit:M="cover",thumbSize:$=96,placeholder:R,cta:H,acceptHint:W,showCover:B=!1,coverLabel:Q,busy:U=!1,busyLabel:q,progress:J,disabled:V=!1,readOnly:Y=!1,selected:G,onItemClick:Z,onItemDoubleClick:X,onItemContextMenu:_,menuOnMedia:ee=!1}){const te=h().media,re=H??te.cta,ae=Q??te.cover,ne=q??te.uploading,le=g(),[ie,oe]=b(null),se=V||U,de=!(!k&&!N||se||Y),ce=!!w&&!se&&!Y,ue=!!j&&!se&&!Y,me=!!K&&!V&&!ue,pe=!(!C||!O||se||Y),fe=t(se),he=R??r(P,te),ge=d({accept:P,maxSizeBytes:S,maxFiles:z,acceptHint:W,multiple:!0,disabled:!de,currentCount:p.length,onAccept:e=>{if(N)N(e);else for(const t of e)k(t)}}),[be,ye]=b(!1),ve=y(0),xe=e=>pe&&Array.from(e.dataTransfer?.types??[]).includes(C),ke=ge.zoneProps,De={onDragEnter:e=>{if(!xe(e))return ke.onDragEnter?.(e);e.preventDefault(),ve.current+=1,ye(!0)},onDragOver:e=>{if(!xe(e))return ke.onDragOver?.(e);e.preventDefault(),e.dataTransfer.dropEffect="link",be||ye(!0)},onDragLeave:e=>{if(!xe(e))return ke.onDragLeave?.(e);ve.current=Math.max(0,ve.current-1),0===ve.current&&ye(!1)},onDrop:e=>{if(!xe(e))return ke.onDrop?.(e);e.preventDefault(),ve.current=0,ye(!1);const t=e.dataTransfer.getData(C);t&&O(t)}},Ne=ge.dragOver||be,we=()=>{de&&(k?k():ge.open())},je={width:$,height:$},Ke=null==G?null:new Set(G),Te=!!Z,Ce=$<112,Oe=(e,t)=>{const r=e.kind?"video"===e.kind:i(e.url,P),a=e.name??o(e.url),n=B&&(e.cover??0===t);/* @__PURE__ */
2
+ return v("div",{...Te?{"data-grid-item":"","data-grid-id":e.id,role:"option"}:{},...ee?{[m]:""}:{},"aria-selected":Ke?Ke.has(e.id):void 0,onClick:Te?t=>{t.target.closest?.("button")||Z(e.id,{ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey})}:void 0,onDoubleClick:X?()=>X(e.id):void 0,onContextMenu:_?t=>_(e.id,t):void 0,draggable:ue||me&&!!e.dragData||void 0,onDragStart:ue?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(t)),oe(t)}:me&&e.dragData?t=>{t.dataTransfer.effectAllowed=e.dragAlso?"all":"link",t.dataTransfer.setData(K,e.dragData);for(const[r,a]of Object.entries(e.dragAlso??{}))t.dataTransfer.setData(r,a);T?.("start",e.id)}:void 0,onDragEnd:ue?()=>oe(null):me&&e.dragData&&T?t=>T("none"===t.dataTransfer.dropEffect?"cancelled":"dropped",e.id):void 0,onDragOver:ue?e=>{null!=ie&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:ue?e=>{null!=ie&&(e.preventDefault(),e.stopPropagation(),ie!==t&&j(ie,t),oe(null))}:void 0,tabIndex:ue||Te?0:void 0,"aria-label":ue?te.reorder(a,t+1,p.length):Te?a:void 0,onKeyDown:Te&&!ue?t=>{t.target!==t.currentTarget||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),Z(e.id,{ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey}))}:ue?e=>{"ArrowLeft"===e.key||"ArrowUp"===e.key?t>0&&(e.preventDefault(),j(t,t-1)):"ArrowRight"!==e.key&&"ArrowDown"!==e.key||t<p.length-1&&(e.preventDefault(),j(t,t+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-line bg-gray-100",fe,ie===t?"opacity-50":"",Ke?.has(e.id)?"ring-2 ring-blue-500 ring-offset-1":"",Te?"cursor-pointer":""].join(" "),style:{...je,cursor:ue?"move":void 0},children:[r?/* @__PURE__ */x("video",{src:e.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":a,className:"h-full w-full",style:{objectFit:M}}):/* @__PURE__ */x("img",{src:e.url,alt:a,className:"h-full w-full",style:{objectFit:M}}),n&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 rounded bg-accent-fill px-2 py-0.5 text-xs font-medium text-on-accent",children:ae}),!n&&null!=e.mark&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-medium text-on-accent",style:{background:"var(--rosh-media-scrim)"},children:e.mark}),!n&&null==e.mark&&!!e.badges?.length&&
3
3
  /* @__PURE__ */x("span",{"data-tile-badges":"",className:"absolute left-1 top-1 flex flex-nowrap items-center gap-1 overflow-hidden rounded-md bg-surface p-0.5 shadow-sm",style:{maxWidth:"calc(100% - 8px)"},children:e.badges.map(e=>/* @__PURE__ */x("span",{"data-tile-badge":"",className:"flex min-w-0",children:Ce?
4
4
  /* @__PURE__ */x(f,{content:e.label,children:/* @__PURE__ */x("span",{tabIndex:0,"aria-label":e.label,className:`flex rounded-full ${fe}`,children:/* @__PURE__ */x(u,{tone:e.tone,size:"xs",children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"inline-flex items-center gap-0.5",children:[
5
5
  /* @__PURE__ */x("span",{className:"inline-flex h-3 w-3 shrink-0 items-center justify-center",children:e.icon}),null!=e.count&&/* @__PURE__ */x("span",{children:e.count})]})})})}):/* @__PURE__ */x(u,{tone:e.tone,size:"xs",children:e.label})},e.key))}),null!=e.caption&&/* @__PURE__ */x(s,{children:e.caption}),ce&&/* @__PURE__ */x("button",{type:"button",onClick:()=>w(e.id),"aria-label":e.removeLabel??te.removeItem(a),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${fe}`,style:{background:"var(--rosh-media-scrim-button)"},children:D})]},e.id)},Ae=de&&/* @__PURE__ */v("button",{type:"button",onClick:()=>we(),"aria-label":te.addMedia,className:`flex shrink-0 flex-col items-center justify-center gap-1 rounded-md border-2 border-dashed border-gray-300 bg-gray-50 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-500 ${fe}`,style:je,children:[
6
6
  /* @__PURE__ */x(a,{className:"h-5 w-5"}),
7
- /* @__PURE__ */x("span",{className:"text-xs font-medium text-gray-500",children:te.add})]}),Ie=de?/* @__PURE__ */v("button",{type:"button",onClick:()=>we(),"aria-label":"string"==typeof he?he:te.upload,className:n(Ne,!1,fe),style:{minHeight:B+32},children:[
7
+ /* @__PURE__ */x("span",{className:"text-xs font-medium text-gray-500",children:te.add})]}),Ie=de?/* @__PURE__ */v("button",{type:"button",onClick:()=>we(),"aria-label":"string"==typeof he?he:te.upload,className:n(Ne,!1,fe),style:{minHeight:$+32},children:[
8
8
  /* @__PURE__ */x("span",{className:"text-ink-faintest",children:/* @__PURE__ */x(a,{})}),
9
9
  /* @__PURE__ */x("span",{className:"px-3 text-xs text-ink-faint",children:he}),
10
- /* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:re}),R&&/* @__PURE__ */x("span",{className:"text-xs text-ink-faintest",children:R})]}):/* @__PURE__ */x("div",{className:"flex w-full items-center justify-center rounded-lg border border-line bg-surface-sunken px-3 text-xs text-ink-faintest",style:{minHeight:B+32},children:/* @__PURE__ */x("span",{className:J?"invisible":void 0,children:te.empty})});/* @__PURE__ */
11
- return v(e,{label:A,labelId:A?`${le}-label`:void 0,htmlFor:le,hint:I,error:F,required:L,className:S,children:[
12
- /* @__PURE__ */v("div",{id:le,role:"group","aria-labelledby":A?`${le}-label`:void 0,"aria-describedby":F?`${le}-error`:I?`${le}-hint`:void 0,"aria-busy":J||void 0,...ge.zoneProps,...pe?De:{},className:"relative rounded-lg transition-colors",style:{...se?{opacity:.6}:{},...Ne?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===p.length?Ie:/* @__PURE__ */v("div",{className:"flex flex-wrap gap-2",children:[Te?
13
- /* @__PURE__ */x("div",{role:"listbox","aria-multiselectable":!!Ke||void 0,"aria-label":"string"==typeof A?A:te.files,className:"contents",children:p.map(Oe)}):p.map(Oe),Ae]}),J&&/* @__PURE__ */x(l,{label:ne,progress:U})]}),!k&&N&&/* @__PURE__ */x("input",{...ge.inputProps}),
10
+ /* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:re}),W&&/* @__PURE__ */x("span",{className:"text-xs text-ink-faintest",children:W})]}):/* @__PURE__ */x("div",{className:"flex w-full items-center justify-center rounded-lg border border-line bg-surface-sunken px-3 text-xs text-ink-faintest",style:{minHeight:$+32},children:/* @__PURE__ */x("span",{className:U?"invisible":void 0,children:te.empty})});/* @__PURE__ */
11
+ return v(e,{label:A,labelId:A?`${le}-label`:void 0,htmlFor:le,hint:I,error:E,required:F,className:L,children:[
12
+ /* @__PURE__ */v("div",{id:le,role:"group","aria-labelledby":A?`${le}-label`:void 0,"aria-describedby":E?`${le}-error`:I?`${le}-hint`:void 0,"aria-busy":U||void 0,...ge.zoneProps,...pe?De:{},className:"relative rounded-lg transition-colors",style:{...se?{opacity:.6}:{},...Ne?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===p.length?Ie:/* @__PURE__ */v("div",{className:"flex flex-wrap gap-2",children:[Te?
13
+ /* @__PURE__ */x("div",{role:"listbox","aria-multiselectable":!!Ke||void 0,"aria-label":"string"==typeof A?A:te.files,className:"contents",children:p.map(Oe)}):p.map(Oe),Ae]}),U&&/* @__PURE__ */x(l,{label:ne,progress:J})]}),!k&&N&&/* @__PURE__ */x("input",{...ge.inputProps}),
14
14
  /* @__PURE__ */x(c,{rejections:ge.rejections})]})}export{k as FULL_BADGE_TILE_PX,N as MediaUploadGrid};
@@ -1,2 +1,2 @@
1
- import{inputClasses as e}from"./chunk-AYZY3YNC.js";import{pad2 as t}from"./chunk-LF27WIN2.js";import{useShellLocale as n}from"./chunk-GDQJBQ5B.js";import{forwardRef as r}from"react";import{jsx as i}from"react/jsx-runtime";var a=/^\d{2}:\d{2}(:\d{2})?$/;function o(e,n){if(null==e||""===e)return"";if(e instanceof Date){if(Number.isNaN(e.getTime()))return"";const r=`${t(e.getHours())}:${t(e.getMinutes())}`;return n?`${r}:${t(e.getSeconds())}`:r}return a.test(e)?e:""}var s=r(function({value:t,onChange:r,min:s,max:u,invalid:m,size:l,className:c="",step:f,...v},d){const p=null!=f&&Number(f)<60,g=n();/* @__PURE__ */
2
- return i("input",{ref:d,type:"time",lang:g,step:f,"aria-invalid":m||void 0,value:o(t,p),min:o(s,p)||void 0,max:o(u,p)||void 0,onChange:e=>r?.(a.test(e.target.value)?e.target.value:null),className:e({invalid:m,size:l,className:c}),...v})});export{s as TimePicker_default};
1
+ import{inputClasses as e}from"./chunk-AYZY3YNC.js";import{pad2 as t}from"./chunk-LF27WIN2.js";import{useShellLocale as n}from"./chunk-VNTJ7QO5.js";import{forwardRef as r}from"react";import{jsx as i}from"react/jsx-runtime";var a=/^\d{2}:\d{2}(:\d{2})?$/;function o(e,n){if(null==e||""===e)return"";if(e instanceof Date){if(Number.isNaN(e.getTime()))return"";const r=`${t(e.getHours())}:${t(e.getMinutes())}`;return n?`${r}:${t(e.getSeconds())}`:r}return a.test(e)?e:""}var s=r(function({value:t,onChange:r,min:s,max:u,invalid:m,size:l,className:c="",step:f,...v},d){const p=null!=f&&Number(f)<60,N=n();/* @__PURE__ */
2
+ return i("input",{ref:d,type:"time",lang:N,step:f,"aria-invalid":m||void 0,value:o(t,p),min:o(s,p)||void 0,max:o(u,p)||void 0,onChange:e=>r?.(a.test(e.target.value)?e.target.value:null),className:e({invalid:m,size:l,className:c}),...v})});export{s as TimePicker_default};
@@ -0,0 +1,7 @@
1
+ import{isFocusableEntry as e,menuStatusIds as t,renderMenuEntries as r}from"./chunk-DH2DKQKS.js";import{useTabLayer as n,focusableIn as o}from"./chunk-CDAJKLGL.js";import{PopupMenu as i,PopupMenuDivider as a}from"./chunk-QVAOSKFO.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as s}from"./chunk-62LW225J.js";import{placeMenu as d,popupBounds as c,followAnchor as u}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as p}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useState as m,useRef as h,useId as g,useCallback as v,useEffect as b}from"react";import{jsxs as y,jsx as x}from"react/jsx-runtime";var k=/(^|[\s:])!?z-/,w={paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:"0.25rem",paddingBottom:"0.25rem"};function D({trigger:D,items:K,align:L="end",side:S="bottom","aria-label":j,className:A="",triggerClassName:C,menuClassName:E="",minWidth:W=180,linkAs:H,disabled:$,id:N,"aria-describedby":T,"aria-disabled":U=!1,onOpenChange:B,footer:I,footerLabel:J}){const[q,G]=m(!1),[M,O]=m(-1),Q=h(null),z=h(null),P=h(null),R=h(null),V=h(null),F=null!=I&&!1!==I,Y=h({text:"",at:0}),X=g(),Z=g(),_=N??Z,ee=h(B);ee.current=B;const te=h(q);te.current=q;const re=v(e=>{G(!1),te.current&&(te.current=!1,ee.current?.(!1)),e&&z.current?.focus()},[]),ne=(t,r)=>{const n=K.length;for(let o=0;o<n;o+=1){const i=((t+r*o)%n+n)%n;if(e(K[i]))return i}return-1},oe=()=>P.current?.closest("[data-popup-menu-tree]")??null;b(()=>{if(!q)return;const e=e=>{const t=e.target;if(Q.current?.contains(t)||oe()?.contains(t))return;const r=oe()?.getAttribute("data-popup-menu-tree"),n=t.closest?.("[data-popup-menu-tree]");r&&n?.getAttribute("data-popup-menu-tree")===r||re(!1)};document.addEventListener("pointerdown",e,!0);const t=l(()=>re(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[q,re]);const ie=v(()=>{const e=oe(),t=z.current;if(!e||!t)return;const r=e.style;r.left="0px",r.top="0px",r.maxWidth="none",r.maxHeight="none";const n={width:e.offsetWidth,height:e.offsetHeight},o=d({trigger:t.getBoundingClientRect(),menu:n,bounds:c(t),align:L,side:S});r.left=`${o.left}px`,r.top=`${o.top}px`,r.maxWidth=`${o.maxWidth}px`,r.maxHeight=`${o.maxHeight}px`,r.overflowY=n.height>o.maxHeight?"auto":"",e.dataset.side=o.side,e.dataset.align=L},[L,S]);p(()=>{q&&ie()}),b(()=>{if(q)return u(()=>z.current,ie)},[q,ie]),b(()=>{if(!q)return;const t=P.current,r=e(K[M])?t?.querySelector(`[data-dropdown-index="${M}"]`):null;(r??t)?.focus({preventScroll:!0})},[q,M]),b(()=>{if(q)return f(e=>"Escape"===e.key&&(re(!0),!0),()=>R.current)},[q,re]),n(R,q&&F);const ae=h(null),le=e=>"first"===e?ne(0,1):ne(K.length-1,-1),se=e=>{O(le(e)),G(!0),te.current||(te.current=!0,ae.current=e,B?.(!0))};p(()=>{const e=ae.current;if(!q||!e)return;ae.current=null;const t=le(e);t!==M&&O(t)});const de=t(K,X),ce="function"==typeof I?I({close:()=>re(!0)}):I,ue={...k.test(E)?{}:{zIndex:s.popup},minWidth:W};/* @__PURE__ */
2
+ return y("div",{ref:Q,className:`relative inline-flex ${A}`.trim(),children:[
3
+ /* @__PURE__ */x("button",{ref:z,id:_,type:"button","aria-haspopup":"menu","aria-expanded":q,"aria-controls":q?X:void 0,"aria-label":j,"aria-describedby":T,"aria-disabled":U||void 0,disabled:$,onClick:()=>{U||(q?re(!1):se("first"))},onKeyDown:e=>{U||("ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),se("first")):"ArrowUp"===e.key&&(e.preventDefault(),se("last")))},className:C??"inline-flex items-center justify-center rounded-(--radius-control) text-gray-600 transition-colors not-disabled:not-aria-disabled:hover:bg-gray-100 not-disabled:not-aria-disabled:hover:text-ink-strongest rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] disabled:cursor-not-allowed disabled:opacity-60 "+(j?"h-8 min-w-8 px-0":"h-8 min-w-8 gap-2 px-3"),children:D}),q&&
4
+ /* @__PURE__ */x(i,{portal:!0,className:E,style:ue,children:/* @__PURE__ */y("div",{ref:R,children:[
5
+ /* @__PURE__ */x("div",{ref:P,id:X,role:"menu","aria-orientation":"vertical","aria-label":j,"aria-labelledby":j?void 0:_,"aria-describedby":de,tabIndex:-1,onKeyDown:t=>{if(!t.target.closest?.("[data-popup-submenu-panel]")||"Tab"===t.key)if("ArrowDown"===t.key)t.preventDefault(),O(ne(M+1,1));else if("ArrowUp"===t.key)t.preventDefault(),O(ne(M-1,-1));else if("Home"===t.key)t.preventDefault(),O(ne(0,1));else if("End"===t.key)t.preventDefault(),O(ne(K.length-1,-1));else if("Tab"===t.key){t.preventDefault();const e=!t.shiftKey&&V.current?o(V.current)[0]:void 0;e?e.focus({preventScroll:!0}):re(!0)}else if(" "===t.key){const e=t.target;e.matches?.("a[href]")&&(t.preventDefault(),e.click())}else 1!==t.key.length||t.ctrlKey||t.metaKey||t.altKey||(t=>{const r=Date.now(),n=t.key.toLowerCase(),o=r-Y.current.at<500?Y.current.text+n:n;Y.current={text:o,at:r};const i=[...o].every(e=>e===o[0]),a=i?o[0]:o,l=i?M+1:Math.max(M,0),s=P.current,d=K.length;for(let r=0;r<d;r+=1){const n=((l+r)%d+d)%d;if(e(K[n])&&(s?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(a))return t.preventDefault(),void O(n)}})(t)},children:r(K,{menuId:X,choose:e=>{e.disabled||(re(!0),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>re(!0),rowProps:(e,t)=>({"data-dropdown-index":e,tabIndex:e===M?0:-1,onMouseEnter:()=>{t.disabled||V.current?.contains(document.activeElement)||O(e)}}),linkAs:H})}),F&&/* @__PURE__ */y("div",{ref:V,role:"group","aria-label":J,"data-dropdown-footer":"",onKeyDown:e=>{const t=V.current;if("Tab"!==e.key||!t||!t.contains(e.target))return;const r=o(t),n=document.activeElement;if(e.shiftKey){if(r.length>0&&n!==r[0])return;e.preventDefault();const t=P.current?.querySelector(`[data-dropdown-index="${M}"]`);return void(t??P.current)?.focus({preventScroll:!0})}r.length>0&&n!==r[r.length-1]||(e.preventDefault(),re(!0))},children:[
6
+ /* @__PURE__ */x("div",{"aria-hidden":"true",children:/* @__PURE__ */x(a,{})}),
7
+ /* @__PURE__ */x("div",{style:w,children:ce})]})]})})]})}export{D as DropdownMenu};
@@ -0,0 +1,5 @@
1
+ import{useOverlayTarget as e,usePopupAnchor as r,usePanelPosition as i,OverlayLayerProvider as t}from"./chunk-3DVNXNTF.js";import{useDiscardGuard as l}from"./chunk-FRNSCVPN.js";import{dialogA11y as a}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as o}from"./chunk-7QSDPSXP.js";import{useFocusTrap as n,useScrollLock as s}from"./chunk-CDAJKLGL.js";import{Icon as d}from"./chunk-R64OZ6TC.js";import{Z_LAYERS as c}from"./chunk-62LW225J.js";import{useHydrated as m}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useShellStrings as p}from"./chunk-VNTJ7QO5.js";import{useRef as f,useId as h,useState as x,useEffect as v}from"react";import{createPortal as b}from"react-dom";import{jsxs as y,Fragment as g,jsx as k}from"react/jsx-runtime";var N={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl","2xl":"max-w-6xl"};function j({open:j,onClose:w,title:C,description:T,role:D="dialog",children:V,footer:W,blocking:J=!1,size:L="md",aside:F=!1,dirty:P=!1,initialFocus:Q,"aria-label":S,"aria-labelledby":U,"aria-describedby":$,className:z=""}){const A=f(null),G=h(),I=h(),O=!J,R=h(),X=p().dialog,Z=e(m()),[B,H]=x(null),K=l({open:j,dirty:P,onClose:w,title:C,layer:B}),Y=f(null),q=r(j&&null!==Z,Y),E=i(q,A);if(o(j),n(A,j&&null!==Z,Q),s(j),v(()=>{if(j)return u(()=>(J||K(),!0),()=>A.current)},[j,J,K]),!j||!Z)return null;/* @__PURE__ */
2
+ return y(g,{children:[/* @__PURE__ */k("span",{ref:Y,hidden:!0,"data-popup-anchor":""}),b(
3
+ /* @__PURE__ */k(t,{value:B,children:/* @__PURE__ */y("div",{ref:H,className:"fixed inset-0"+(F?" pointer-events-none opacity-0":""),style:{zIndex:c.overlay},role:"presentation","data-overlay-layer":"","data-aside":F?"":void 0,children:[
4
+ /* @__PURE__ */k("div",{className:"fixed inset-0 bg-black/30","aria-hidden":"true"}),
5
+ /* @__PURE__ */k("div",{className:q?"fixed inset-0":"fixed inset-0 flex items-center justify-center p-4",onClick:J?void 0:e=>{e.target===e.currentTarget&&K()},children:/* @__PURE__ */y("div",{ref:A,"data-popup-panel":"",style:q?{left:E?.left??0,top:E?.top??0,visibility:E?void 0:"hidden"}:void 0,...a({role:D,modal:!0,titleId:C?R:void 0,labelledBy:U,label:S}),"aria-describedby":$??(T?I:V?G:void 0),className:`${q?"absolute max-h-[calc(100%-2rem)] w-[calc(100%-2rem)]":"relative max-h-full w-full"} ${N[L]} overflow-y-auto overscroll-contain rounded-(--radius-card) bg-white p-6 shadow-xl ${z}`.trim(),children:[C&&/* @__PURE__ */k("h2",{id:R,className:(O?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:C}),T&&/* @__PURE__ */k("p",{id:I,className:((C?"mt-1":O?"pr-8":"")+" text-sm text-gray-500").trim(),children:T}),V&&/* @__PURE__ */k("div",{id:G,className:"mt-2 text-sm text-gray-600",children:V}),W&&/* @__PURE__ */k("div",{className:"mt-6 flex flex-wrap justify-end gap-3",children:W}),O&&/* @__PURE__ */k("button",{type:"button",onClick:K,"aria-label":X.close,className:"absolute right-3 top-3 rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */k(d,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})})]})}),Z)]})}export{j as Dialog};
@@ -1,15 +1,15 @@
1
- import{Popover as e}from"./chunk-7JGR7WPD.js";import{InputNumber_default as r}from"./chunk-QRU55BUS.js";import{parseHexColor as a,hexToHsv as n,hsvToHex as o,hexReadout as t,HUE_GRADIENT as l,HEX_MAX_LENGTH as i,svFromPoint as s,hueFromPoint as c}from"./chunk-S6OB6HJB.js";import{inputClasses as u}from"./chunk-AYZY3YNC.js";import{Tooltip as d}from"./chunk-NJN5IKWO.js";import{useShellStrings as h}from"./chunk-GDQJBQ5B.js";import{forwardRef as g,useState as p,useRef as b,useEffect as m,useId as f}from"react";import{jsx as v,jsxs as w}from"react/jsx-runtime";var x={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},y={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function k(e){return null==e||Number.isNaN(e)?100:Math.round(Math.min(100,Math.max(0,e)))}function N(e,r){if(!e)return y;const a=k(r);if(a>=100)return{background:e};const n=`color-mix(in srgb, ${e} ${a}%, transparent)`;return{backgroundImage:`linear-gradient(${n}, ${n}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`}}function C({size:e="md",selected:r=!1,className:a=""}={}){return["relative inline-flex shrink-0 overflow-hidden rounded-md p-0 transition-shadow","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-60",r?"border-2 border-blue-500":"border border-gray-300 hover:shadow-sm",x[e],a].filter(Boolean).join(" ")}var $=g(function({color:e,size:r="md",selected:a,className:n,type:o="button",...t},l){/* @__PURE__ */
2
- return v("button",{ref:l,type:o,"aria-pressed":a,className:C({size:r,selected:a,className:n}),...t,children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:N(e)})})}),z=(e,r,a)=>Math.min(a,Math.max(r,e)),D=e=>"string"==typeof e?{value:e}:e;function I(e,r,a){const n=a?.1:.01,o={ArrowLeft:[-n,0],ArrowRight:[n,0],ArrowDown:[0,-n],ArrowUp:[0,n]}[r];return o?{...e,s:z(e.s+o[0],0,1),v:z(e.v+o[1],0,1)}:null}function A(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return z(e-n,0,359);case"ArrowRight":case"ArrowUp":return z(e+n,0,359);case"PageDown":return z(e-10,0,359);case"PageUp":return z(e+10,0,359);case"Home":return 0;case"End":return 359;default:return null}}var P={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function M(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return z(e-n,0,100);case"ArrowRight":case"ArrowUp":return z(e+n,0,100);case"PageDown":return z(e-10,0,100);case"PageUp":return z(e+10,0,100);case"Home":return 0;case"End":return 100;default:return null}}function j({value:e,onChange:r,label:i,presets:u,clearable:g=!1,fallback:f,dragWrites:x="live",disabled:C=!1,opacity:z,onOpacityChange:j,onClose:B,id:S,className:K=""}){const U=h().color,O=k(z),L=e=>{const r=k(e);C||r===O||j?.(r)},W=e=>{const r=e.currentTarget.getBoundingClientRect();return r.width>0?(e.clientX-r.left)/r.width*100:O},E=a(f??""),[H,J]=p(()=>n(e||E||"")),Y=b(e);m(()=>{e!==Y.current&&(Y.current=e,e?J(n(e)):E&&J(n(E)))},[e]);const q=a=>{C||a===e||(Y.current=a,r(a))},Q=e=>{const r=a(e);r&&(J(n(r)),q(r))},X=e=>{J(e),q(o(e))},[G,F]=p(!1),V=b(H);V.current=H;const Z=e=>({onPointerDown:r=>{if(C||0!==r.button)return;r.currentTarget.setPointerCapture?.(r.pointerId),r.currentTarget.focus({preventScroll:!0});const a=e(r,V.current);"end"===x?(F(!0),J(a)):X(a)},onPointerMove:r=>{if(C||!(1&r.buttons))return;const a=e(r,V.current);"end"===x?J(a):X(a)},onPointerUp:r=>{"end"===x&&G&&(F(!1),X(e(r,V.current)))}}),_=Z((e,r)=>({...r,...s(e.clientX,e.clientY,e.currentTarget.getBoundingClientRect())})),ee=Z((e,r)=>({...r,h:c(e.clientX,e.currentTarget.getBoundingClientRect())})),re=G?o(H):e,ae=e=>`${Math.round(100*e)}%`,ne=(u??[]).map(D),oe=a(e),te=re||E||"";/* @__PURE__ */
3
- return w("div",{id:S,className:`flex w-56 flex-col gap-3 ${C?"opacity-60":""} ${K}`.trim(),onKeyDown:e=>{"Escape"===e.key&&B&&(e.preventDefault(),e.stopPropagation(),B())},children:[(ne.length>0||g)&&/* @__PURE__ */w("div",{role:"group","aria-label":U.presets,className:"flex flex-wrap gap-2",children:[g&&/* @__PURE__ */v(d,{content:U.clear,children:/* @__PURE__ */v($,{color:"",size:"sm","aria-label":U.clear,selected:""===e,disabled:C,onClick:()=>{C||""===e||(Y.current="",r(""))}})}),ne.map(e=>{const r=a(e.value),n=e.label?`${e.label} · ${t(r??e.value)}`:t(r??e.value);/* @__PURE__ */
4
- return v(d,{content:n,children:/* @__PURE__ */v($,{color:r??e.value,size:"sm","aria-label":n,selected:null!==r&&r===oe,disabled:C,onClick:()=>Q(e.value)})},`${e.label??""}:${e.value}`)})]}),
5
- /* @__PURE__ */v("div",{role:"slider",tabIndex:C?-1:0,"aria-label":U.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*H.v),"aria-valuetext":U.squareValue(Math.round(100*H.s),Math.round(100*H.v)),"aria-disabled":C||void 0,"data-color-square":"",onKeyDown:e=>{if(C)return;const r=I(H,e.key,e.shiftKey);r&&(e.preventDefault(),X(r))},..._,className:"relative h-36 w-full cursor-crosshair touch-none rounded-md rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundColor:o({h:H.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:ae(H.s),top:ae(1-H.v),...P}})}),
6
- /* @__PURE__ */v("div",{role:"slider",tabIndex:C?-1:0,"aria-label":U.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(H.h),"aria-orientation":"horizontal","aria-disabled":C||void 0,"data-color-hue":"",onKeyDown:e=>{if(C)return;const r=A(H.h,e.key,e.shiftKey);null!==r&&(e.preventDefault(),X({...H,h:r}))},...ee,className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:l},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:H.h/360*100+"%",background:o({h:H.h,s:1,v:1}),...P}})}),j&&/* @__PURE__ */v("div",{role:"slider",tabIndex:C?-1:0,"aria-label":U.opacity(i),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":O,"aria-valuetext":`${O}%`,"aria-orientation":"horizontal","aria-disabled":C||void 0,"data-color-opacity":"",onKeyDown:e=>{if(C)return;const r=M(O,e.key,e.shiftKey);null!==r&&(e.preventDefault(),L(r))},onPointerDown:e=>{C||0!==e.button||(e.currentTarget.setPointerCapture?.(e.pointerId),e.currentTarget.focus({preventScroll:!0}),L(W(e)))},onPointerMove:e=>{!C&&1&e.buttons&&L(W(e))},className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:`linear-gradient(to right, transparent, ${te||"black"}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:`${O}%`,...N(te||"black",O),...P}})}),
1
+ import{Popover as e}from"./chunk-7JGR7WPD.js";import{InputNumber_default as r}from"./chunk-GV5VNWPG.js";import{parseHexColor as a,hexToHsv as n,hsvToHex as o,hexReadout as t,HUE_GRADIENT as l,HEX_MAX_LENGTH as i,svFromPoint as s,hueFromPoint as c}from"./chunk-S6OB6HJB.js";import{inputClasses as u}from"./chunk-AYZY3YNC.js";import{Tooltip as d}from"./chunk-NJN5IKWO.js";import{useShellStrings as h}from"./chunk-VNTJ7QO5.js";import{forwardRef as g,useState as p,useRef as b,useEffect as m,useId as f}from"react";import{jsx as v,jsxs as w}from"react/jsx-runtime";var x={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},y={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function k(e){return null==e||Number.isNaN(e)?100:Math.round(Math.min(100,Math.max(0,e)))}function N(e,r){if(!e)return y;const a=k(r);if(a>=100)return{background:e};const n=`color-mix(in srgb, ${e} ${a}%, transparent)`;return{backgroundImage:`linear-gradient(${n}, ${n}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`}}function C({size:e="md",selected:r=!1,className:a=""}={}){return["relative inline-flex shrink-0 overflow-hidden rounded-md p-0 transition-shadow","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-60",r?"border-2 border-blue-500":"border border-gray-300 hover:shadow-sm",x[e],a].filter(Boolean).join(" ")}var $=g(function({color:e,size:r="md",selected:a,className:n,type:o="button",...t},l){/* @__PURE__ */
2
+ return v("button",{ref:l,type:o,"aria-pressed":a,className:C({size:r,selected:a,className:n}),...t,children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:N(e)})})}),z=(e,r,a)=>Math.min(a,Math.max(r,e)),D=e=>"string"==typeof e?{value:e}:e;function I(e,r,a){const n=a?.1:.01,o={ArrowLeft:[-n,0],ArrowRight:[n,0],ArrowDown:[0,-n],ArrowUp:[0,n]}[r];return o?{...e,s:z(e.s+o[0],0,1),v:z(e.v+o[1],0,1)}:null}function P(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return z(e-n,0,359);case"ArrowRight":case"ArrowUp":return z(e+n,0,359);case"PageDown":return z(e-10,0,359);case"PageUp":return z(e+10,0,359);case"Home":return 0;case"End":return 359;default:return null}}var A={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function M(e,r,a){const n=a?10:1;switch(r){case"ArrowLeft":case"ArrowDown":return z(e-n,0,100);case"ArrowRight":case"ArrowUp":return z(e+n,0,100);case"PageDown":return z(e-10,0,100);case"PageUp":return z(e+10,0,100);case"Home":return 0;case"End":return 100;default:return null}}function j({value:e,onChange:r,label:i,presets:u,clearable:g=!1,fallback:f,dragWrites:x="live",disabled:C=!1,opacity:z,onOpacityChange:j,onClose:K,id:S,className:T=""}){const R=h().color,U=k(z),W=e=>{const r=k(e);C||r===U||j?.(r)},L=e=>{const r=e.currentTarget.getBoundingClientRect();return r.width>0?(e.clientX-r.left)/r.width*100:U},E=a(f??""),[H,J]=p(()=>n(e||E||"")),V=b(e);m(()=>{e!==V.current&&(V.current=e,e?J(n(e)):E&&J(n(E)))},[e]);const Y=a=>{C||a===e||(V.current=a,r(a))},q=e=>{const r=a(e);r&&(J(n(r)),Y(r))},G=e=>{J(e),Y(o(e))},[X,F]=p(!1),Q=b(H);Q.current=H;const Z=e=>({onPointerDown:r=>{if(C||0!==r.button)return;r.currentTarget.setPointerCapture?.(r.pointerId),r.currentTarget.focus({preventScroll:!0});const a=e(r,Q.current);"end"===x?(F(!0),J(a)):G(a)},onPointerMove:r=>{if(C||!(1&r.buttons))return;const a=e(r,Q.current);"end"===x?J(a):G(a)},onPointerUp:r=>{"end"===x&&X&&(F(!1),G(e(r,Q.current)))}}),_=Z((e,r)=>({...r,...s(e.clientX,e.clientY,e.currentTarget.getBoundingClientRect())})),ee=Z((e,r)=>({...r,h:c(e.clientX,e.currentTarget.getBoundingClientRect())})),re=X?o(H):e,ae=e=>`${Math.round(100*e)}%`,ne=(u??[]).map(D),oe=a(e),te=re||E||"";/* @__PURE__ */
3
+ return w("div",{id:S,className:`flex w-56 flex-col gap-3 ${C?"opacity-60":""} ${T}`.trim(),onKeyDown:e=>{"Escape"===e.key&&K&&(e.preventDefault(),e.stopPropagation(),K())},children:[(ne.length>0||g)&&/* @__PURE__ */w("div",{role:"group","aria-label":R.presets,className:"flex flex-wrap gap-2",children:[g&&/* @__PURE__ */v(d,{content:R.clear,children:/* @__PURE__ */v($,{color:"",size:"sm","aria-label":R.clear,selected:""===e,disabled:C,onClick:()=>{C||""===e||(V.current="",r(""))}})}),ne.map(e=>{const r=a(e.value),n=e.label?`${e.label} · ${t(r??e.value)}`:t(r??e.value);/* @__PURE__ */
4
+ return v(d,{content:n,children:/* @__PURE__ */v($,{color:r??e.value,size:"sm","aria-label":n,selected:null!==r&&r===oe,disabled:C,onClick:()=>q(e.value)})},`${e.label??""}:${e.value}`)})]}),
5
+ /* @__PURE__ */v("div",{role:"slider",tabIndex:C?-1:0,"aria-label":R.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*H.v),"aria-valuetext":R.squareValue(Math.round(100*H.s),Math.round(100*H.v)),"aria-disabled":C||void 0,"data-color-square":"",onKeyDown:e=>{if(C)return;const r=I(H,e.key,e.shiftKey);r&&(e.preventDefault(),G(r))},..._,className:"relative h-36 w-full cursor-crosshair touch-none rounded-md rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundColor:o({h:H.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:ae(H.s),top:ae(1-H.v),...A}})}),
6
+ /* @__PURE__ */v("div",{role:"slider",tabIndex:C?-1:0,"aria-label":R.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(H.h),"aria-orientation":"horizontal","aria-disabled":C||void 0,"data-color-hue":"",onKeyDown:e=>{if(C)return;const r=P(H.h,e.key,e.shiftKey);null!==r&&(e.preventDefault(),G({...H,h:r}))},...ee,className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:l},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:H.h/360*100+"%",background:o({h:H.h,s:1,v:1}),...A}})}),j&&/* @__PURE__ */v("div",{role:"slider",tabIndex:C?-1:0,"aria-label":R.opacity(i),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":U,"aria-valuetext":`${U}%`,"aria-orientation":"horizontal","aria-disabled":C||void 0,"data-color-opacity":"",onKeyDown:e=>{if(C)return;const r=M(U,e.key,e.shiftKey);null!==r&&(e.preventDefault(),W(r))},onPointerDown:e=>{C||0!==e.button||(e.currentTarget.setPointerCapture?.(e.pointerId),e.currentTarget.focus({preventScroll:!0}),W(L(e)))},onPointerMove:e=>{!C&&1&e.buttons&&W(L(e))},className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:`linear-gradient(to right, transparent, ${te||"black"}), ${y.backgroundImage}`,backgroundSize:`auto, ${y.backgroundSize}`},children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:`${U}%`,...N(te||"black",U),...A}})}),
7
7
  /* @__PURE__ */w("div",{className:"flex items-center gap-2",children:[
8
- /* @__PURE__ */v("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-line-strong",style:N(te,j?O:null)}),
9
- /* @__PURE__ */v(R,{value:re,placeholder:!e&&E?t(E):void 0,onChange:Q,label:U.hex(i),disabled:C}),j&&/* @__PURE__ */v(T,{value:O,onChange:L,label:U.opacity(i),disabled:C})]})]})}var B={sm:"w-[calc(7ch+1rem+4px)] min-w-[calc(7ch+1rem+4px)]",md:"w-[calc(7ch+1.5rem+4px)] min-w-[calc(7ch+1.5rem+4px)]",lg:"w-[calc(7ch+2rem+4px)] min-w-[calc(7ch+2rem+4px)]"},S={sm:"h-6",md:"h-8",lg:"h-10"},K=["block w-[calc(7ch+0.5rem+4px)] min-w-[calc(7ch+0.5rem+4px)] flex-none rounded-(--radius-control)","border border-transparent bg-transparent px-1 text-2xs font-mono uppercase","text-ink-strong placeholder:text-[color:var(--ink-placeholder)] hover:border-gray-300","focus:border-blue-400 focus:bg-(--surface) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)]","disabled:cursor-not-allowed disabled:opacity-60"].join(" ");function R({value:e,onChange:r,label:n,placeholder:o,disabled:l,id:s,size:c="md",look:d="box",className:h=""}){const[g,b]=p(null),m="text"===d?`${K} ${S[c]} ${h}`.trim():u({size:c,className:`${B[c]} flex-1 font-mono uppercase ${h}`.trim()}).replace(/(^| )w-full( |$)/," ");/* @__PURE__ */
10
- return v("input",{id:s,type:"text",value:g??(e?t(e):""),"aria-label":n,placeholder:o,maxLength:i,spellCheck:!1,autoComplete:"off",disabled:l,onChange:n=>{b(n.target.value);const o=a(n.target.value);null!==o&&o!==e&&r(o)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),b(null))},onBlur:()=>b(null),"data-hex-look":d,className:m})}function T({value:e,onChange:a,label:n,disabled:o,size:t="md"}){/* @__PURE__ */
11
- return v("div",{"data-color-opacity-box":"",className:"w-20 shrink-0",children:/* @__PURE__ */v(r,{value:e,onChange:e=>{null!==e&&a(e)},min:0,max:100,precision:0,suffix:"%",size:t,"aria-label":n,disabled:o})})}function U({value:r,onChange:n,label:o,presets:l,clearable:i,fallback:s,dragWrites:c,disabled:u,id:d,showHexInput:g=!1,opacity:p,onOpacityChange:b,size:m="md",align:x="start",open:y,onOpenChange:$,className:z=""}){const D=h().color,I=k(p),A=f(),P=a(s??""),M=r||P||"",B=r?t(r):P?t(P):D.none;
8
+ /* @__PURE__ */v("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-line-strong",style:N(te,j?U:null)}),
9
+ /* @__PURE__ */v(O,{value:re,placeholder:!e&&E?t(E):void 0,onChange:q,label:R.hex(i),disabled:C}),j&&/* @__PURE__ */v(B,{value:U,onChange:W,label:R.opacity(i),disabled:C})]})]})}var K={sm:"w-[calc(7ch+1rem+4px)] min-w-[calc(7ch+1rem+4px)]",md:"w-[calc(7ch+1.5rem+4px)] min-w-[calc(7ch+1.5rem+4px)]",lg:"w-[calc(7ch+2rem+4px)] min-w-[calc(7ch+2rem+4px)]"},S={sm:"h-6",md:"h-8",lg:"h-10"},T=["block w-[calc(7ch+0.5rem+4px)] min-w-[calc(7ch+0.5rem+4px)] flex-none rounded-(--radius-control)","border border-transparent bg-transparent px-1 text-2xs font-mono uppercase","text-ink-strong placeholder:text-[color:var(--ink-placeholder)] hover:border-gray-300","focus:border-blue-400 focus:bg-(--surface) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)]","disabled:cursor-not-allowed disabled:opacity-60"].join(" ");function O({value:e,onChange:r,label:n,placeholder:o,disabled:l,id:s,size:c="md",look:d="box",className:h=""}){const[g,b]=p(null),m="text"===d?`${T} ${S[c]} ${h}`.trim():u({size:c,className:`${K[c]} flex-1 font-mono uppercase ${h}`.trim()}).replace(/(^| )w-full( |$)/," ");/* @__PURE__ */
10
+ return v("input",{id:s,type:"text",value:g??(e?t(e):""),"aria-label":n,placeholder:o,maxLength:i,spellCheck:!1,autoComplete:"off",disabled:l,onChange:n=>{b(n.target.value);const o=a(n.target.value);null!==o&&o!==e&&r(o)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),b(null))},onBlur:()=>b(null),"data-hex-look":d,className:m})}function B({value:e,onChange:a,label:n,disabled:o,size:t="md"}){/* @__PURE__ */
11
+ return v("div",{"data-color-opacity-box":"",className:"w-20 shrink-0",children:/* @__PURE__ */v(r,{value:e,onChange:e=>{null!==e&&a(e)},min:0,max:100,precision:0,suffix:"%",size:t,"aria-label":n,disabled:o})})}function R({value:r,onChange:n,label:o,presets:l,clearable:i,fallback:s,dragWrites:c,disabled:u,id:d,showHexInput:g=!1,opacity:p,onOpacityChange:b,size:m="md",align:x="start",open:y,onOpenChange:$,className:z=""}){const D=h().color,I=k(p),P=f(),A=a(s??""),M=r||A||"",K=r?t(r):A?t(A):D.none;
12
12
  /* @__PURE__ */
13
13
  return w("div",{className:`inline-flex items-center ${b?"flex-wrap justify-end gap-1":g?"gap-1":"gap-2"} ${z}`.trim(),children:[
14
- /* @__PURE__ */v(e,{id:d,trigger:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:N(M,b?I:null)}),triggerLabel:D.swatch(o,B),triggerClassName:C({size:m}),"aria-label":D.panel(o),align:x,open:y,onOpenChange:$,disabled:u,children:/* @__PURE__ */v(j,{id:A,value:r,onChange:n,label:o,presets:l,clearable:i,fallback:s,dragWrites:c,disabled:u,opacity:p,onOpacityChange:b})}),g&&
15
- /* @__PURE__ */v(R,{value:r,placeholder:!r&&P?t(P):void 0,onChange:e=>{u||e===r||n(e)},label:D.hex(o),disabled:u,size:m,look:"text"}),b&&/* @__PURE__ */v(T,{value:I,onChange:e=>{u||e===I||b(e)},label:D.opacity(o),disabled:u,size:m})]})}export{U as ColorPicker,j as ColorPickerPanel,$ as ColorSwatch,R as HexInput,y as NO_COLOR_FILL,k as clampOpacity,N as colorFill,C as colorSwatchClasses,A as stepHue,M as stepOpacity,I as stepSquare};
14
+ /* @__PURE__ */v(e,{id:d,trigger:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"absolute inset-0",style:N(M,b?I:null)}),triggerLabel:D.swatch(o,K),triggerClassName:C({size:m}),"aria-label":D.panel(o),align:x,open:y,onOpenChange:$,disabled:u,children:/* @__PURE__ */v(j,{id:P,value:r,onChange:n,label:o,presets:l,clearable:i,fallback:s,dragWrites:c,disabled:u,opacity:p,onOpacityChange:b})}),g&&
15
+ /* @__PURE__ */v(O,{value:r,placeholder:!r&&A?t(A):void 0,onChange:e=>{u||e===r||n(e)},label:D.hex(o),disabled:u,size:m,look:"text"}),b&&/* @__PURE__ */v(B,{value:I,onChange:e=>{u||e===I||b(e)},label:D.opacity(o),disabled:u,size:m})]})}export{R as ColorPicker,j as ColorPickerPanel,$ as ColorSwatch,O as HexInput,y as NO_COLOR_FILL,k as clampOpacity,N as colorFill,C as colorSwatchClasses,P as stepHue,M as stepOpacity,I as stepSquare};
@@ -1,2 +1,2 @@
1
- import{toast_default as t}from"./chunk-7ELJQL7J.js";import{useShellPrefs as e}from"./chunk-KC3EX26K.js";import{useSyncExternalStore as n,useCallback as o,useMemo as a}from"react";var r=[{id:"bell",label:"Bell",description:"Soft bell with one harmonic"},{id:"chime",label:"Chime",description:"Two-note ascending chime"},{id:"bowl",label:"Singing Bowl",description:"Long-decay meditation tone"},{id:"wind-chimes",label:"Wind Chimes",description:"Four soft tones in succession"},{id:"off",label:"Off (silent)",description:"No sound — only desktop notification"}],i=[{id:"none",label:"None"},{id:"tick-fast",label:"Ticking Fast"},{id:"tick-slow",label:"Ticking Slow"},{id:"rain",label:"Rain"},{id:"fireplace",label:"Fireplace"},{id:"white",label:"White Noise"},{id:"pink",label:"Pink Noise"},{id:"brown",label:"Brown Noise"}],c=()=>`pomodoro-${/* @__PURE__ */(new Date).toISOString().slice(0,10)}`,l={focus:1500,short:300,long:900},s="bell",u=100,d=1,f="none",m=50,h={autoStartBreaks:!1,autoStartPomodoros:!1,longBreakInterval:4},g={running:!1,remaining:l.focus,mode:"focus",total:l.focus,streak:0,count:"undefined"!=typeof localStorage?(()=>{try{return parseInt(localStorage.getItem(c())||"0",10)||0}catch{return 0}})():0},p=null,k=/* @__PURE__ */new Set,w=t=>{g={...g,...t},k.forEach(t=>t())};function M(){return g}function S(t){return k.add(t),()=>{k.delete(t)}}function b(t){l=t,g.running||g.remaining!==g.total||w({remaining:t[g.mode],total:t[g.mode]})}function y(t){s=t}function v(t,e){u=Math.max(0,Math.min(100,Math.round(t))),d=Math.max(1,Math.min(5,Math.round(e)))}function T(t){h={autoStartBreaks:!!t.autoStartBreaks,autoStartPomodoros:!!t.autoStartPomodoros,longBreakInterval:Math.max(1,Math.min(20,Math.round(t.longBreakInterval||4)))}}function A(t,e){f=t,m=Math.max(0,Math.min(100,Math.round(e))),g.running&&"focus"===g.mode?(E(),R()):"none"!==t&&0!==m||E()}function I(){g.running||(w({running:!0}),p=setInterval(C,1e3),"focus"===g.mode&&R())}function x(){(g.running||null!==p)&&(null!==p&&(clearInterval(p),p=null),w({running:!1}),E())}function B(t){x(),w({mode:t,remaining:l[t],total:l[t]})}function C(){g.remaining<=1?function(){null!==p&&(clearInterval(p),p=null);E(),N(s,{volume:u,repeat:d});const e="focus"===g.mode?"Pomodoro complete — time for a break! 🍅":"Break's over — back to work!";if("undefined"!=typeof Notification&&"granted"===Notification.permission)try{new Notification(e)}catch{}try{t.info(e)}catch{}if("focus"===g.mode){const t=g.streak+1,e=g.count+1;(t=>{try{localStorage.setItem(c(),String(t))}catch{}})(e);const n=t%h.longBreakInterval===0?"long":"short";w({running:!1,streak:t,count:e,mode:n,remaining:l[n],total:l[n]}),h.autoStartBreaks&&setTimeout(()=>I(),50)}else w({running:!1,mode:"focus",remaining:l.focus,total:l.focus}),h.autoStartPomodoros&&setTimeout(()=>I(),50)}():w({remaining:g.remaining-1})}function N(t=s,e={}){if("off"===t)return;const n=Math.max(0,Math.min(100,e.volume??100))/100;if(0===n)return;const o=Math.max(1,Math.min(5,e.repeat??1));for(let e=0;e<o;e++)setTimeout(()=>P(t,n),2500*e)}function P(t,e){try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=(t,n,a,r=.22,i="sine")=>{const c=o.createOscillator(),l=o.createGain();c.connect(l),l.connect(o.destination),c.type=i,c.frequency.value=t;const s=o.currentTime+n;l.gain.setValueAtTime(0,s),l.gain.linearRampToValueAtTime(r*e,s+.03),l.gain.exponentialRampToValueAtTime(1e-4,s+a),c.start(s),c.stop(s+a)};let r=2;"bell"===t?(a(880,0,1.8),a(1320,0,1.4,.1),r=2):"chime"===t?(a(659.25,0,.7),a(880,.2,1.3),r=2):"bowl"===t?(a(440,0,3.4,.22),a(660,0,3,.08),a(880,.05,2.8,.05),r=4):"wind-chimes"===t&&(a(1175,0,1.1,.16),a(880,.15,1.3,.16),a(1318,.3,1.5,.16),a(1047,.5,1.7,.13),r=3),setTimeout(()=>{try{o.close()}catch{}},1e3*r+500)}catch{}}var D=null,_={none:0,white:.3,pink:.3,brown:.3,"tick-fast":.6,"tick-slow":.6,rain:.4,fireplace:.5};function O(t,e){if("none"===e)return null;const n=t.sampleRate,o="white"===e||"pink"===e||"brown"===e?2:4,a=n*o,r=t.createBuffer(1,a,n),i=r.getChannelData(0);if("white"===e)for(let t=0;t<a;t++)i[t]=.5*(2*Math.random()-1);else if("pink"===e){let t=0,e=0,n=0,o=0,r=0,c=0,l=0;for(let s=0;s<a;s++){const a=2*Math.random()-1;t=.99886*t+.0555179*a,e=.99332*e+.0750759*a,n=.969*n+.153852*a,o=.8665*o+.3104856*a,r=.55*r+.5329522*a,c=-.7616*c-.016898*a,i[s]=.11*(t+e+n+o+r+c+l+.5362*a)*.55,l=.115926*a}}else if("brown"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=3.5*t*.5}}else if("tick-fast"===e||"tick-slow"===e){const t="tick-fast"===e?.5:1,r=Math.floor(.045*n);for(let e=0;e<o;e+=t){const t=Math.floor(e*n);for(let e=0;e<r&&t+e<a;e++){const o=Math.exp(-e/n*180),a=2*Math.random()-1,r=Math.sin(2*Math.PI*1100*(e/n));i[t+e]+=(.7*a+.25*r)*o*.55}}}else if("rain"===e){let t=0;for(let e=0;e<a;e++){const o=2*Math.random()-1,a=o-.93*t;t=o;const r=.7+.3*Math.sin(e/n*2*Math.PI*.25);i[e]=a*r*.4}}else if("fireplace"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=1.6*t}let e=.4*Math.random()*n;for(;e<a;){const t=Math.floor((.012+.05*Math.random())*n),o=.35+.45*Math.random(),r=Math.floor(e);for(let e=0;e<t&&r+e<a;e++){const t=Math.exp(-e/n*90);i[r+e]+=(2*Math.random()-1)*t*o}e+=(.08+.62*Math.random())*n}}return r}function R(){if(!D&&"none"!==f&&0!==m)try{const t=window.AudioContext||window.webkitAudioContext;if(!t)return;const e=new t,n=O(e,f);if(!n){try{e.close()}catch{}return}const o=e.createBufferSource();o.buffer=n,o.loop=!0;const a=e.createGain();a.gain.value=m/100*_[f],o.connect(a).connect(e.destination),o.start(),D={ctx:e,src:o,gain:a}}catch{}}function E(){if(D){try{D.src.stop()}catch{}try{D.ctx.close()}catch{}D=null}}function F(t,e){if("none"!==t&&0!==e)try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=O(o,t);if(!a){try{o.close()}catch{}return}const r=o.createBufferSource();r.buffer=a,r.loop=!0;const i=o.createGain();i.gain.value=e/100*_[t],r.connect(i).connect(o.destination),r.start(),setTimeout(()=>{try{r.stop()}catch{}try{o.close()}catch{}},3e3)}catch{}}var G="pomodoro_tasks",J="pomodoro_tasks_migrated";function L(){return Math.random().toString(36).slice(2,11)}function V(){/* @__PURE__ */
2
- return(new Date).toISOString()}var j=null,K=[],W=!1,q=null,Q=/* @__PURE__ */new Set;function X(){for(const t of Q)t()}function $(t){K=t,X()}function z(){const t=j;return t?q=t.list().then(e=>{j===t&&(K=e,W=!0,X())}).catch(()=>{j===t&&(W=!0,X())}).finally(()=>{q=null}):(K=[],W=!0,X(),Promise.resolve())}function H(t){j=t,K=[],W=!1,t?z():X()}function U(t){return Q.add(t),!j||W||q||z(),()=>{Q.delete(t)}}function Y(){return K}function Z(){const t=function(){const{prefs:t,save:n}=e(),r=a(()=>{const e=t.todo_tasks;return Array.isArray(e)?e:[]},[t.todo_tasks]),i=o(t=>{n({todo_tasks:t})},[n]),c=o(t=>{const e=L(),n=V(),o={done:!1,...t,name:t.name.trim(),id:e,createdAt:n,updatedAt:n};return i([...r,o]),e},[r,i]),l=o((t,e)=>{i(r.map(n=>n.id===t?{...n,...e,id:n.id,updatedAt:V()}:n))},[r,i]),s=o(t=>{i(r.filter(e=>e.id!==t))},[r,i]),u=o(t=>{const e=r.find(e=>e.id===t);e&&l(t,{done:!e.done})},[r,l]);return{tasks:r,addTask:c,updateTask:l,removeTask:s,toggleDone:u,setAllTasks:i}}(),r=n(U,Y,Y),i=o(e=>{const n=j;if(!n)return t.addTask(e);const o="tmp-"+L(),a=V(),r={done:!1,...e,name:e.name.trim(),id:o,createdAt:a,updatedAt:a};return $([...K,r]),n.create({...e,name:e.name.trim()}).then(t=>$(K.map(e=>e.id===o?{...r,...t}:e))).catch(()=>$(K.filter(t=>t.id!==o))),o},[t]),c=o((e,n)=>{const o=j;if(!o)return t.updateTask(e,n);$(K.map(t=>t.id===e?{...t,...n,id:e,updatedAt:V()}:t)),o.update(e,n).catch(()=>{z()})},[t]),l=o(e=>{const n=j;if(!n)return t.removeTask(e);const o=K;$(K.filter(t=>t.id!==e)),n.remove(e).catch(()=>$(o))},[t]),s=o(e=>{if(!j)return t.toggleDone(e);const n=K.find(t=>t.id===e);n&&c(e,{done:!n.done})},[t,c]),u=o(e=>{j||t.setAllTasks(e)},[t]);return null===j?t:{tasks:r,addTask:i,updateTask:c,removeTask:l,toggleDone:s,setAllTasks:u}}function tt(t,e){try{if(localStorage.getItem(J))return;const n=localStorage.getItem(G);if(!n)return void localStorage.setItem(J,"1");const o=JSON.parse(n);if(!Array.isArray(o)||0===o.length)return localStorage.removeItem(G),void localStorage.setItem(J,"1");const a=V(),r=o.filter(t=>"string"==typeof t?.name).map(t=>({id:t.id||L(),name:String(t.name),done:!!t.done,estimated:"number"==typeof t.estimated?t.estimated:void 0,completed:"number"==typeof t.completed?t.completed:void 0,createdAt:a,updatedAt:a})),i=new Set(t.map(t=>t.id));e([...r.filter(t=>!i.has(t.id)),...t]),localStorage.removeItem(G),localStorage.setItem(J,"1")}catch{try{localStorage.setItem(J,"1")}catch{}}}export{r as ALARM_OPTIONS,i as FOCUS_SOUND_OPTIONS,M as getPomoSnapshot,tt as migratePomodoroTasksOnce,N as playAlarm,x as pomoPause,I as pomoStart,B as pomoSwitchMode,F as previewFocusSound,y as setPomoAlarm,v as setPomoAlarmConfig,T as setPomoBehaviour,b as setPomoDurations,A as setPomoFocusSound,H as setShellTodoProvider,S as subscribePomo,Z as useTodoTasks};
1
+ import{toast_default as t}from"./chunk-MWKLLAJT.js";import{useShellPrefs as e}from"./chunk-KC3EX26K.js";import{useSyncExternalStore as n,useCallback as o,useMemo as a}from"react";var r=[{id:"bell",label:"Bell",description:"Soft bell with one harmonic"},{id:"chime",label:"Chime",description:"Two-note ascending chime"},{id:"bowl",label:"Singing Bowl",description:"Long-decay meditation tone"},{id:"wind-chimes",label:"Wind Chimes",description:"Four soft tones in succession"},{id:"off",label:"Off (silent)",description:"No sound — only desktop notification"}],i=[{id:"none",label:"None"},{id:"tick-fast",label:"Ticking Fast"},{id:"tick-slow",label:"Ticking Slow"},{id:"rain",label:"Rain"},{id:"fireplace",label:"Fireplace"},{id:"white",label:"White Noise"},{id:"pink",label:"Pink Noise"},{id:"brown",label:"Brown Noise"}],c=()=>`pomodoro-${/* @__PURE__ */(new Date).toISOString().slice(0,10)}`,l={focus:1500,short:300,long:900},s="bell",u=100,d=1,f="none",m=50,h={autoStartBreaks:!1,autoStartPomodoros:!1,longBreakInterval:4},g={running:!1,remaining:l.focus,mode:"focus",total:l.focus,streak:0,count:"undefined"!=typeof localStorage?(()=>{try{return parseInt(localStorage.getItem(c())||"0",10)||0}catch{return 0}})():0},p=null,k=/* @__PURE__ */new Set,w=t=>{g={...g,...t},k.forEach(t=>t())};function M(){return g}function S(t){return k.add(t),()=>{k.delete(t)}}function b(t){l=t,g.running||g.remaining!==g.total||w({remaining:t[g.mode],total:t[g.mode]})}function y(t){s=t}function v(t,e){u=Math.max(0,Math.min(100,Math.round(t))),d=Math.max(1,Math.min(5,Math.round(e)))}function T(t){h={autoStartBreaks:!!t.autoStartBreaks,autoStartPomodoros:!!t.autoStartPomodoros,longBreakInterval:Math.max(1,Math.min(20,Math.round(t.longBreakInterval||4)))}}function A(t,e){f=t,m=Math.max(0,Math.min(100,Math.round(e))),g.running&&"focus"===g.mode?(F(),R()):"none"!==t&&0!==m||F()}function I(){g.running||(w({running:!0}),p=setInterval(C,1e3),"focus"===g.mode&&R())}function x(){(g.running||null!==p)&&(null!==p&&(clearInterval(p),p=null),w({running:!1}),F())}function B(t){x(),w({mode:t,remaining:l[t],total:l[t]})}function C(){g.remaining<=1?function(){null!==p&&(clearInterval(p),p=null);F(),N(s,{volume:u,repeat:d});const e="focus"===g.mode?"Pomodoro complete — time for a break! 🍅":"Break's over — back to work!";if("undefined"!=typeof Notification&&"granted"===Notification.permission)try{new Notification(e)}catch{}try{t.info(e)}catch{}if("focus"===g.mode){const t=g.streak+1,e=g.count+1;(t=>{try{localStorage.setItem(c(),String(t))}catch{}})(e);const n=t%h.longBreakInterval===0?"long":"short";w({running:!1,streak:t,count:e,mode:n,remaining:l[n],total:l[n]}),h.autoStartBreaks&&setTimeout(()=>I(),50)}else w({running:!1,mode:"focus",remaining:l.focus,total:l.focus}),h.autoStartPomodoros&&setTimeout(()=>I(),50)}():w({remaining:g.remaining-1})}function N(t=s,e={}){if("off"===t)return;const n=Math.max(0,Math.min(100,e.volume??100))/100;if(0===n)return;const o=Math.max(1,Math.min(5,e.repeat??1));for(let e=0;e<o;e++)setTimeout(()=>P(t,n),2500*e)}function P(t,e){try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=(t,n,a,r=.22,i="sine")=>{const c=o.createOscillator(),l=o.createGain();c.connect(l),l.connect(o.destination),c.type=i,c.frequency.value=t;const s=o.currentTime+n;l.gain.setValueAtTime(0,s),l.gain.linearRampToValueAtTime(r*e,s+.03),l.gain.exponentialRampToValueAtTime(1e-4,s+a),c.start(s),c.stop(s+a)};let r=2;"bell"===t?(a(880,0,1.8),a(1320,0,1.4,.1),r=2):"chime"===t?(a(659.25,0,.7),a(880,.2,1.3),r=2):"bowl"===t?(a(440,0,3.4,.22),a(660,0,3,.08),a(880,.05,2.8,.05),r=4):"wind-chimes"===t&&(a(1175,0,1.1,.16),a(880,.15,1.3,.16),a(1318,.3,1.5,.16),a(1047,.5,1.7,.13),r=3),setTimeout(()=>{try{o.close()}catch{}},1e3*r+500)}catch{}}var D=null,_={none:0,white:.3,pink:.3,brown:.3,"tick-fast":.6,"tick-slow":.6,rain:.4,fireplace:.5};function O(t,e){if("none"===e)return null;const n=t.sampleRate,o="white"===e||"pink"===e||"brown"===e?2:4,a=n*o,r=t.createBuffer(1,a,n),i=r.getChannelData(0);if("white"===e)for(let t=0;t<a;t++)i[t]=.5*(2*Math.random()-1);else if("pink"===e){let t=0,e=0,n=0,o=0,r=0,c=0,l=0;for(let s=0;s<a;s++){const a=2*Math.random()-1;t=.99886*t+.0555179*a,e=.99332*e+.0750759*a,n=.969*n+.153852*a,o=.8665*o+.3104856*a,r=.55*r+.5329522*a,c=-.7616*c-.016898*a,i[s]=.11*(t+e+n+o+r+c+l+.5362*a)*.55,l=.115926*a}}else if("brown"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=3.5*t*.5}}else if("tick-fast"===e||"tick-slow"===e){const t="tick-fast"===e?.5:1,r=Math.floor(.045*n);for(let e=0;e<o;e+=t){const t=Math.floor(e*n);for(let e=0;e<r&&t+e<a;e++){const o=Math.exp(-e/n*180),a=2*Math.random()-1,r=Math.sin(2*Math.PI*1100*(e/n));i[t+e]+=(.7*a+.25*r)*o*.55}}}else if("rain"===e){let t=0;for(let e=0;e<a;e++){const o=2*Math.random()-1,a=o-.93*t;t=o;const r=.7+.3*Math.sin(e/n*2*Math.PI*.25);i[e]=a*r*.4}}else if("fireplace"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=1.6*t}let e=.4*Math.random()*n;for(;e<a;){const t=Math.floor((.012+.05*Math.random())*n),o=.35+.45*Math.random(),r=Math.floor(e);for(let e=0;e<t&&r+e<a;e++){const t=Math.exp(-e/n*90);i[r+e]+=(2*Math.random()-1)*t*o}e+=(.08+.62*Math.random())*n}}return r}function R(){if(!D&&"none"!==f&&0!==m)try{const t=window.AudioContext||window.webkitAudioContext;if(!t)return;const e=new t,n=O(e,f);if(!n){try{e.close()}catch{}return}const o=e.createBufferSource();o.buffer=n,o.loop=!0;const a=e.createGain();a.gain.value=m/100*_[f],o.connect(a).connect(e.destination),o.start(),D={ctx:e,src:o,gain:a}}catch{}}function F(){if(D){try{D.src.stop()}catch{}try{D.ctx.close()}catch{}D=null}}function G(t,e){if("none"!==t&&0!==e)try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=O(o,t);if(!a){try{o.close()}catch{}return}const r=o.createBufferSource();r.buffer=a,r.loop=!0;const i=o.createGain();i.gain.value=e/100*_[t],r.connect(i).connect(o.destination),r.start(),setTimeout(()=>{try{r.stop()}catch{}try{o.close()}catch{}},3e3)}catch{}}var K="pomodoro_tasks",L="pomodoro_tasks_migrated";function V(){return Math.random().toString(36).slice(2,11)}function W(){/* @__PURE__ */
2
+ return(new Date).toISOString()}var j=null,E=[],J=!1,q=null,X=/* @__PURE__ */new Set;function $(){for(const t of X)t()}function z(t){E=t,$()}function H(){const t=j;return t?q=t.list().then(e=>{j===t&&(E=e,J=!0,$())}).catch(()=>{j===t&&(J=!0,$())}).finally(()=>{q=null}):(E=[],J=!0,$(),Promise.resolve())}function Q(t){j=t,E=[],J=!1,t?H():$()}function U(t){return X.add(t),!j||J||q||H(),()=>{X.delete(t)}}function Y(){return E}function Z(){const t=function(){const{prefs:t,save:n}=e(),r=a(()=>{const e=t.todo_tasks;return Array.isArray(e)?e:[]},[t.todo_tasks]),i=o(t=>{n({todo_tasks:t})},[n]),c=o(t=>{const e=V(),n=W(),o={done:!1,...t,name:t.name.trim(),id:e,createdAt:n,updatedAt:n};return i([...r,o]),e},[r,i]),l=o((t,e)=>{i(r.map(n=>n.id===t?{...n,...e,id:n.id,updatedAt:W()}:n))},[r,i]),s=o(t=>{i(r.filter(e=>e.id!==t))},[r,i]),u=o(t=>{const e=r.find(e=>e.id===t);e&&l(t,{done:!e.done})},[r,l]);return{tasks:r,addTask:c,updateTask:l,removeTask:s,toggleDone:u,setAllTasks:i}}(),r=n(U,Y,Y),i=o(e=>{const n=j;if(!n)return t.addTask(e);const o="tmp-"+V(),a=W(),r={done:!1,...e,name:e.name.trim(),id:o,createdAt:a,updatedAt:a};return z([...E,r]),n.create({...e,name:e.name.trim()}).then(t=>z(E.map(e=>e.id===o?{...r,...t}:e))).catch(()=>z(E.filter(t=>t.id!==o))),o},[t]),c=o((e,n)=>{const o=j;if(!o)return t.updateTask(e,n);z(E.map(t=>t.id===e?{...t,...n,id:e,updatedAt:W()}:t)),o.update(e,n).catch(()=>{H()})},[t]),l=o(e=>{const n=j;if(!n)return t.removeTask(e);const o=E;z(E.filter(t=>t.id!==e)),n.remove(e).catch(()=>z(o))},[t]),s=o(e=>{if(!j)return t.toggleDone(e);const n=E.find(t=>t.id===e);n&&c(e,{done:!n.done})},[t,c]),u=o(e=>{j||t.setAllTasks(e)},[t]);return null===j?t:{tasks:r,addTask:i,updateTask:c,removeTask:l,toggleDone:s,setAllTasks:u}}function tt(t,e){try{if(localStorage.getItem(L))return;const n=localStorage.getItem(K);if(!n)return void localStorage.setItem(L,"1");const o=JSON.parse(n);if(!Array.isArray(o)||0===o.length)return localStorage.removeItem(K),void localStorage.setItem(L,"1");const a=W(),r=o.filter(t=>"string"==typeof t?.name).map(t=>({id:t.id||V(),name:String(t.name),done:!!t.done,estimated:"number"==typeof t.estimated?t.estimated:void 0,completed:"number"==typeof t.completed?t.completed:void 0,createdAt:a,updatedAt:a})),i=new Set(t.map(t=>t.id));e([...r.filter(t=>!i.has(t.id)),...t]),localStorage.removeItem(K),localStorage.setItem(L,"1")}catch{try{localStorage.setItem(L,"1")}catch{}}}export{r as ALARM_OPTIONS,i as FOCUS_SOUND_OPTIONS,M as getPomoSnapshot,tt as migratePomodoroTasksOnce,N as playAlarm,x as pomoPause,I as pomoStart,B as pomoSwitchMode,G as previewFocusSound,y as setPomoAlarm,v as setPomoAlarmConfig,T as setPomoBehaviour,b as setPomoDurations,A as setPomoFocusSound,Q as setShellTodoProvider,S as subscribePomo,Z as useTodoTasks};
@@ -1,13 +1,13 @@
1
- import{copyToClipboard as e,selectionAt as t}from"./chunk-TMMNCXQT.js";import{ResizableTable as n}from"./chunk-HNVSVTNC.js";import{useTableNav as r}from"./chunk-ATMJ5ZPK.js";import{escapeHtml as o}from"./chunk-G6DKCCWH.js";import{Checkbox_default as l}from"./chunk-CGZBDI6C.js";import{ListFooter as i}from"./chunk-4ULRP4Y4.js";import{ListLoadError as a}from"./chunk-UNQ54QOF.js";import{LoadingSpinner as c}from"./chunk-O3MBPAWZ.js";import{toast_default as d}from"./chunk-7ELJQL7J.js";import{PopupMenu as s,PopupMenuLabel as h,PopupMenuItem as m,PopupMenuDivider as u}from"./chunk-6KGIHI6X.js";import{keepsNativeMenu as p}from"./chunk-5QFPTDQF.js";import{LoadingSpinner as f}from"./chunk-R2VKEMZH.js";import{shellHttp as g}from"./chunk-STKJA4PV.js";import{useShellStrings as y}from"./chunk-GDQJBQ5B.js";import{useState as k,useRef as b}from"react";import{jsx as x,Fragment as w,jsxs as C}from"react/jsx-runtime";function j(e){return Array.from(e.children).filter(e=>void 0!==e.dataset?.colKey&&"_select"!==e.dataset.colKey)}function v(e){return("string"==typeof e.innerText?e.innerText:e.textContent??"").replace(/\s+/g," ").trim()}function S(S){const{items:N,isLoading:R,emptyState:L,totalCount:T,isError:$,onRetry:M,errorTitle:K,errorMessage:P,tableId:A,columns:E,renderCell:F,getRowId:I=e=>e.id,sort:Q,onSort:U,selected:D,setSelected:B,onRowClick:H,onRowHover:J,getRowClassName:O,footerLabel:W,footerExtra:G,sentinelRef:V,isFetchingNextPage:Z,saveDefaultPerms:_,exportEndpoint:X,exportFilename:z="export.csv",contextActions:Y}=S,[q,ee]=k(null),te=b(null),ne=y(),re=ne.entityList,oe=e=>{B(t=>{const n=new Set(t),r=I(e);return n.has(r)?n.delete(r):n.add(r),n})},le=()=>{B(e=>{const t=N.map(I),n=new Set(e);return t.every(t=>e.has(t))?t.forEach(e=>n.delete(e)):t.forEach(e=>n.add(e)),n})},ie=r(N,H,oe,le,(e,t)=>{B(n=>{const r=new Set(n);for(let n=e;n<=t;n++)r.add(I(N[n]));return r})},te),ae=N.filter(e=>D.has(I(e))),ce=()=>{const e=[...te.current?.querySelectorAll("tr[data-row-idx]")??[]].filter(e=>{const t=N[Number(e.dataset.rowIdx)];return void 0!==t&&D.has(I(t))}),t=e.length?j(e[0]).map(e=>e.dataset.colKey??""):[],n=new Map(E.map(e=>[e.key,e.label]));return{keys:t,header:t.map(e=>n.get(e)??e),body:e.map(e=>j(e).map(v))}},de=()=>{ee(null);const{header:t,body:n}=ce();if(!n.length)return;const r=[t,...n].map(e=>e.join("\t")).join("\n"),l="<table><thead><tr>"+t.map(e=>`<th>${o(e)}</th>`).join("")+"</tr></thead><tbody>"+n.map(e=>`<tr>${e.map(e=>`<td>${o(e)}</td>`).join("")}</tr>`).join("")+"</tbody></table>";e(re.copiedRows(n.length),r,l)},se=async()=>{ee(null);const e=ae.map(I);if(!e.length||!X)return;const t=new URLSearchParams({ids:e.join(",")}),n=(()=>{const e=new Map(E.map(e=>[e.key,e.exportLabel??e.label]));try{const t=localStorage.getItem(`col-config-${A}`);if(t){const n=JSON.parse(t).filter(t=>!t.hidden&&"_select"!==t.key&&e.has(t.key)).map(t=>`${t.key}|${e.get(t.key)}`);if(n.length)return n.join(",")}}catch{}return E.filter(e=>!e.defaultHidden).map(e=>`${e.key}|${e.exportLabel??e.label}`).join(",")})();n&&t.set("cols",n);const r=X.includes("?")?"&":"?";try{const n=await g.get(`${X}${r}${t}`,{responseType:"blob"}),o=window.URL.createObjectURL(new Blob([n.data],{type:"text/csv"})),l=document.createElement("a");l.href=o,l.download=z,l.click(),window.URL.revokeObjectURL(o);const i=n.headers??{},a=Number(i["x-row-count"]);if("true"===String(i["x-truncated"]))return void d.notify(Number.isFinite(a)?re.exportTruncated(a,e.length):re.exportTruncatedUnknown(e.length));d.success(re.exported(e.length))}catch{d.error(re.exportFailed)}};if(R)/* @__PURE__ */return x(c,{});if($&&0===N.length)/* @__PURE__ */
2
- return x(a,{title:K,message:P,onRetry:M});if(0===N.length)/* @__PURE__ */return x(w,{children:L});const he=N.length>0&&ae.length===N.length,me=ae.length>0&&!he,ue=D.size-ae.length,pe=[{key:"_select",label:"",defaultWidth:52,minWidth:52,headerNode:/* @__PURE__ */x(l,{"aria-label":ne.table.selectAll,checked:he,indeterminate:me,onChange:le,style:{height:14,width:14}})},...E],fe=/* @__PURE__ */x(i,{selectedCount:ae.length,hiddenSelectedCount:ue,loadedCount:N.length,totalCount:T,label:W,isFetchingMore:Z,extra:G}),ge=V?/* @__PURE__ */C(w,{children:[
3
- /* @__PURE__ */x("div",{ref:V}),Z&&/* @__PURE__ */x(f,{size:"sm",padding:"py-3",label:ne.list.loadingMore})]}):void 0;let ye=null;if(q){const{x:t,y:n,item:r,text:o,firstColumn:l}=q,i=Y?Y(ae):[],a=ae.length,c=()=>ee(null),d=void 0!==T&&T>N.length;ye=/* @__PURE__ */C(s,{portal:!0,style:{left:t,top:n},onClose:c,minWidth:210,children:[
1
+ import{copyToClipboard as e,selectionAt as t}from"./chunk-KMSK6QQB.js";import{ResizableTable as n}from"./chunk-UIN2LUCZ.js";import{useTableNav as r}from"./chunk-ATMJ5ZPK.js";import{escapeHtml as o}from"./chunk-G6DKCCWH.js";import{Checkbox_default as l}from"./chunk-CGZBDI6C.js";import{ListFooter as i}from"./chunk-L3RLB37Y.js";import{ListLoadError as a}from"./chunk-BAT5B2LE.js";import{LoadingSpinner as c}from"./chunk-PC44XTGN.js";import{toast_default as d}from"./chunk-MWKLLAJT.js";import{PopupMenu as s,PopupMenuLabel as h,PopupMenuItem as m,PopupMenuDivider as u}from"./chunk-QVAOSKFO.js";import{keepsNativeMenu as p}from"./chunk-5QFPTDQF.js";import{LoadingSpinner as f}from"./chunk-R2VKEMZH.js";import{shellHttp as g}from"./chunk-STKJA4PV.js";import{useShellStrings as y}from"./chunk-VNTJ7QO5.js";import{useState as k,useRef as b}from"react";import{jsx as x,Fragment as w,jsxs as C}from"react/jsx-runtime";function j(e){return Array.from(e.children).filter(e=>void 0!==e.dataset?.colKey&&"_select"!==e.dataset.colKey)}function v(e){return("string"==typeof e.innerText?e.innerText:e.textContent??"").replace(/\s+/g," ").trim()}function S(S){const{items:L,isLoading:N,emptyState:R,totalCount:T,isError:K,onRetry:$,errorTitle:A,errorMessage:M,tableId:E,columns:P,renderCell:F,getRowId:U=e=>e.id,sort:B,onSort:I,selected:O,setSelected:D,onRowClick:Q,onRowHover:J,getRowClassName:W,footerLabel:H,footerExtra:V,sentinelRef:Z,isFetchingNextPage:_,saveDefaultPerms:G,exportEndpoint:z,exportFilename:X="export.csv",contextActions:Y}=S,[q,ee]=k(null),te=b(null),ne=y(),re=ne.entityList,oe=e=>{D(t=>{const n=new Set(t),r=U(e);return n.has(r)?n.delete(r):n.add(r),n})},le=()=>{D(e=>{const t=L.map(U),n=new Set(e);return t.every(t=>e.has(t))?t.forEach(e=>n.delete(e)):t.forEach(e=>n.add(e)),n})},ie=r(L,Q,oe,le,(e,t)=>{D(n=>{const r=new Set(n);for(let n=e;n<=t;n++)r.add(U(L[n]));return r})},te),ae=L.filter(e=>O.has(U(e))),ce=()=>{const e=[...te.current?.querySelectorAll("tr[data-row-idx]")??[]].filter(e=>{const t=L[Number(e.dataset.rowIdx)];return void 0!==t&&O.has(U(t))}),t=e.length?j(e[0]).map(e=>e.dataset.colKey??""):[],n=new Map(P.map(e=>[e.key,e.label]));return{keys:t,header:t.map(e=>n.get(e)??e),body:e.map(e=>j(e).map(v))}},de=()=>{ee(null);const{header:t,body:n}=ce();if(!n.length)return;const r=[t,...n].map(e=>e.join("\t")).join("\n"),l="<table><thead><tr>"+t.map(e=>`<th>${o(e)}</th>`).join("")+"</tr></thead><tbody>"+n.map(e=>`<tr>${e.map(e=>`<td>${o(e)}</td>`).join("")}</tr>`).join("")+"</tbody></table>";e(re.copiedRows(n.length),r,l)},se=async()=>{ee(null);const e=ae.map(U);if(!e.length||!z)return;const t=new URLSearchParams({ids:e.join(",")}),n=(()=>{const e=new Map(P.map(e=>[e.key,e.exportLabel??e.label]));try{const t=localStorage.getItem(`col-config-${E}`);if(t){const n=JSON.parse(t).filter(t=>!t.hidden&&"_select"!==t.key&&e.has(t.key)).map(t=>`${t.key}|${e.get(t.key)}`);if(n.length)return n.join(",")}}catch{}return P.filter(e=>!e.defaultHidden).map(e=>`${e.key}|${e.exportLabel??e.label}`).join(",")})();n&&t.set("cols",n);const r=z.includes("?")?"&":"?";try{const n=await g.get(`${z}${r}${t}`,{responseType:"blob"}),o=window.URL.createObjectURL(new Blob([n.data],{type:"text/csv"})),l=document.createElement("a");l.href=o,l.download=X,l.click(),window.URL.revokeObjectURL(o);const i=n.headers??{},a=Number(i["x-row-count"]);if("true"===String(i["x-truncated"]))return void d.notify(Number.isFinite(a)?re.exportTruncated(a,e.length):re.exportTruncatedUnknown(e.length));d.success(re.exported(e.length))}catch{d.error(re.exportFailed)}};if(N)/* @__PURE__ */return x(c,{});if(K&&0===L.length)/* @__PURE__ */
2
+ return x(a,{title:A,message:M,onRetry:$});if(0===L.length)/* @__PURE__ */return x(w,{children:R});const he=L.length>0&&ae.length===L.length,me=ae.length>0&&!he,ue=O.size-ae.length,pe=[{key:"_select",label:"",defaultWidth:52,minWidth:52,headerNode:/* @__PURE__ */x(l,{"aria-label":ne.table.selectAll,checked:he,indeterminate:me,onChange:le,style:{height:14,width:14}})},...P],fe=/* @__PURE__ */x(i,{selectedCount:ae.length,hiddenSelectedCount:ue,loadedCount:L.length,totalCount:T,label:H,isFetchingMore:_,extra:V}),ge=Z?/* @__PURE__ */C(w,{children:[
3
+ /* @__PURE__ */x("div",{ref:Z}),_&&/* @__PURE__ */x(f,{size:"sm",padding:"py-3",label:ne.list.loadingMore})]}):void 0;let ye=null;if(q){const{x:t,y:n,item:r,text:o,firstColumn:l}=q,i=Y?Y(ae):[],a=ae.length,c=()=>ee(null),d=void 0!==T&&T>L.length;ye=/* @__PURE__ */C(s,{portal:!0,style:{left:t,top:n},onClose:c,minWidth:210,children:[
4
4
  /* @__PURE__ */x(h,{children:ue>0?ne.list.selectedNotShown(a,ue):ne.list.selected(a)}),
5
- /* @__PURE__ */x(m,{className:"font-medium",onClick:()=>{c(),H(r)},children:re.open}),
5
+ /* @__PURE__ */x(m,{className:"font-medium",onClick:()=>{c(),Q(r)},children:re.open}),
6
6
  /* @__PURE__ */x(u,{}),o&&/* @__PURE__ */x(m,{onClick:()=>{c(),e(re.copiedText,o.text,o.html)},children:re.copy}),l&&/* @__PURE__ */x(m,{onClick:()=>(t=>{ee(null);const{keys:n,body:r}=ce(),o=n.indexOf(t.key);o<0||!r.length||e(t.label,r.map(e=>e[o]).join("\n"))})(l),children:re.copyColumn(l.label)}),
7
- /* @__PURE__ */x(m,{disabled:0===a,onClick:de,children:re.copyRows(a)}),X&&/* @__PURE__ */x(m,{onClick:se,children:re.exportSelected}),i.map((e,t)=>/* @__PURE__ */C("div",{children:[(e.divider||0===t)&&/* @__PURE__ */x(u,{}),
7
+ /* @__PURE__ */x(m,{disabled:0===a,onClick:de,children:re.copyRows(a)}),z&&/* @__PURE__ */x(m,{onClick:se,children:re.exportSelected}),i.map((e,t)=>/* @__PURE__ */C("div",{children:[(e.divider||0===t)&&/* @__PURE__ */x(u,{}),
8
8
  /* @__PURE__ */x(m,{danger:e.danger,disabled:e.disabled,onClick:()=>{c(),e.onClick(ae)},children:e.label})]},t)),
9
- /* @__PURE__ */x(u,{}),!he&&/* @__PURE__ */x(m,{onClick:()=>{c(),B(e=>/* @__PURE__ */new Set([...e,...N.map(I)]))},children:d?re.selectAllLoaded(N.length):re.selectAll}),
10
- /* @__PURE__ */x(m,{onClick:()=>{c(),B(/* @__PURE__ */new Set)},children:re.clearSelection}),M&&/* @__PURE__ */x(m,{onClick:()=>{c(),M()},children:re.refresh})]})}/* @__PURE__ */
9
+ /* @__PURE__ */x(u,{}),!he&&/* @__PURE__ */x(m,{onClick:()=>{c(),D(e=>/* @__PURE__ */new Set([...e,...L.map(U)]))},children:d?re.selectAllLoaded(L.length):re.selectAll}),
10
+ /* @__PURE__ */x(m,{onClick:()=>{c(),D(/* @__PURE__ */new Set)},children:re.clearSelection}),$&&/* @__PURE__ */x(m,{onClick:()=>{c(),$()},children:re.refresh})]})}/* @__PURE__ */
11
11
  return C("div",{className:"flex-1 flex flex-col mb-1 bg-white rounded-lg shadow overflow-hidden",children:[
12
- /* @__PURE__ */x("div",{className:"flex-1 min-h-0 flex flex-col",children:/* @__PURE__ */x(n,{tableId:A,columns:pe,sort:Q,onSort:U,footer:fe,afterBody:ge,saveDefaultPerms:_,children:e=>/* @__PURE__ */x("tbody",{ref:te,className:"divide-y divide-gray-100",children:N.map((n,r)=>{const o=I(n);/* @__PURE__ */
13
- return x("tr",{"data-row-idx":r,className:`cursor-pointer ${ie===r?"bg-blue-50 ring-1 ring-inset ring-blue-300":D.has(o)?"bg-blue-50 hover:bg-blue-100":"hover:bg-gray-50"} ${O?.(n)??""}`,onClick:()=>H(n),onContextMenu:e=>((e,n)=>{if(e.shiftKey||p(e.target))return;e.preventDefault();const r=I(n);D.has(r)||B(/* @__PURE__ */new Set([r]));const o=j(e.currentTarget)[0]?.dataset.colKey,l=o?E.find(e=>e.key===o)?.label:void 0;ee({x:e.clientX,y:e.clientY,item:n,text:t(e.target),firstColumn:o&&l?{key:o,label:l}:null})})(e,n),onMouseEnter:J?()=>J(n):void 0,children:e.map(e=>/* @__PURE__ */x("td",{"data-col-key":e.key,className:"px-4 py-3 whitespace-nowrap text-sm overflow-hidden",children:"_select"===e.key?/* @__PURE__ */x(l,{"aria-label":ne.table.selectRow,checked:D.has(o),onChange:()=>oe(n),onClick:e=>e.stopPropagation(),style:{height:14,width:14}}):F(n,e.key)},e.key))},o)})})})}),ye]})}export{S as EntityList};
12
+ /* @__PURE__ */x("div",{className:"flex-1 min-h-0 flex flex-col",children:/* @__PURE__ */x(n,{tableId:E,columns:pe,sort:B,onSort:I,footer:fe,afterBody:ge,saveDefaultPerms:G,children:e=>/* @__PURE__ */x("tbody",{ref:te,className:"divide-y divide-gray-100",children:L.map((n,r)=>{const o=U(n);/* @__PURE__ */
13
+ return x("tr",{"data-row-idx":r,className:`cursor-pointer ${ie===r?"bg-blue-50 ring-1 ring-inset ring-blue-300":O.has(o)?"bg-blue-50 hover:bg-blue-100":"hover:bg-gray-50"} ${W?.(n)??""}`,onClick:()=>Q(n),onContextMenu:e=>((e,n)=>{if(e.shiftKey||p(e.target))return;e.preventDefault();const r=U(n);O.has(r)||D(/* @__PURE__ */new Set([r]));const o=j(e.currentTarget)[0]?.dataset.colKey,l=o?P.find(e=>e.key===o)?.label:void 0;ee({x:e.clientX,y:e.clientY,item:n,text:t(e.target),firstColumn:o&&l?{key:o,label:l}:null})})(e,n),onMouseEnter:J?()=>J(n):void 0,children:e.map(e=>/* @__PURE__ */x("td",{"data-col-key":e.key,className:"px-4 py-3 whitespace-nowrap text-sm overflow-hidden",children:"_select"===e.key?/* @__PURE__ */x(l,{"aria-label":ne.table.selectRow,checked:O.has(o),onChange:()=>oe(n),onClick:e=>e.stopPropagation(),style:{height:14,width:14}}):F(n,e.key)},e.key))},o)})})})}),ye]})}export{S as EntityList};
@@ -1,10 +1,10 @@
1
- import{LoadingSpinner as e}from"./chunk-R2VKEMZH.js";import{useBrowserLayoutEffect as n}from"./chunk-D65T4H6J.js";import{useShellStrings as t,useShellLocale as r}from"./chunk-GDQJBQ5B.js";import{formatPlain as a}from"./chunk-C3QOHMR6.js";import{useState as o,useMemo as l,useRef as i,Fragment as s}from"react";import{jsx as d,Fragment as c,jsxs as u}from"react/jsx-runtime";function m({items:m,columns:f,columnOf:p,getId:g,onMove:h,renderCard:x,onCardClick:b,sortInColumn:y,isLoading:v=!1,loadingText:N,emptyState:k,showColumnsWhenEmpty:w=!1,columnEmptyText:C,onAddItem:D,addItemText:E}){const j=t().kanban,I=r(),T=N??j.loading,M=C??j.dropHere,A=E??j.addItem,[H,O]=o(null),[$,B]=o(null),Q=l(()=>{const e={};for(const n of f)e[n.value]=[];for(const n of m)(e[p(n)]??=[]).push(n);if(y)for(const n of Object.keys(e))e[n].sort(y);return e},[m,f,p,y]),R=()=>{O(null),B(null)},S=i(null),q=i(/* @__PURE__ */new Map);n(()=>{if(null!==H)return;const e=S.current;if(!e)return;const n=/* @__PURE__ */new Map,t=[];if(e.querySelectorAll("[data-kanban-card]").forEach(e=>{const r=e.dataset.kanbanCard,a=e.getBoundingClientRect();n.set(r,a);const o=q.current.get(r);if(o){const n=o.left-a.left,r=o.top-a.top;(n||r)&&t.push([e,n,r])}}),q.current=n,t.length){for(const[e,n,r]of t)e.style.transition="none",e.style.transform=`translate(${n}px, ${r}px)`;requestAnimationFrame(()=>{for(const[e]of t)e.style.transition="transform 200ms cubic-bezier(0.2, 0, 0, 1)",e.style.transform="",e.addEventListener("transitionend",()=>{e.style.transition="",e.style.transform=""},{once:!0})})}},[Q,H]);return v?/* @__PURE__ */d(e,{size:"sm",padding:"p-4",label:T}):0!==m.length||w?/* @__PURE__ */d("div",{ref:S,className:"flex-1 overflow-x-auto grid-scroll",children:/* @__PURE__ */d("div",{className:"flex gap-3 h-full min-w-max pb-2",children:f.map(e=>{const n=Q[e.value]??[],t=null!==$&&$.col===e.value,r=null!==H?n.findIndex(e=>g(e)===H):-1,o=t&&(-1===r||$.index!==r&&$.index!==r+1)?$.index:-1;/* @__PURE__ */
2
- return u("div",{className:"group flex flex-col w-72 shrink-0 rounded-xl bg-gray-50 border transition-colors "+(t?"border-blue-400 ring-2 ring-blue-300/60":"border-gray-200"),onDragOver:e=>{e.preventDefault();try{e.dataTransfer.dropEffect="move"}catch{}},onDrop:n=>{n.preventDefault(),(e=>{if(H&&$&&$.col===e){const n=(Q[e]??[]).findIndex(e=>g(e)===H),t=-1!==n;if(!t||$.index!==n&&$.index!==n+1){const r=t&&$.index>n?$.index-1:$.index;h(H,e,r)}}R()})(e.value)},children:[
1
+ import{LoadingSpinner as e}from"./chunk-R2VKEMZH.js";import{useBrowserLayoutEffect as n}from"./chunk-D65T4H6J.js";import{useShellStrings as t,useShellLocale as r}from"./chunk-VNTJ7QO5.js";import{formatPlain as a}from"./chunk-C3QOHMR6.js";import{useState as o,useMemo as l,useRef as i,Fragment as s}from"react";import{jsx as d,Fragment as c,jsxs as u}from"react/jsx-runtime";function m({items:m,columns:f,columnOf:p,getId:g,onMove:h,renderCard:x,onCardClick:b,sortInColumn:y,isLoading:v=!1,loadingText:N,emptyState:k,showColumnsWhenEmpty:w=!1,columnEmptyText:C,onAddItem:D,addItemText:E}){const j=t().kanban,I=r(),T=N??j.loading,M=C??j.dropHere,O=E??j.addItem,[A,H]=o(null),[$,R]=o(null),S=l(()=>{const e={};for(const n of f)e[n.value]=[];for(const n of m)(e[p(n)]??=[]).push(n);if(y)for(const n of Object.keys(e))e[n].sort(y);return e},[m,f,p,y]),q=()=>{H(null),R(null)},z=i(null),F=i(/* @__PURE__ */new Map);n(()=>{if(null!==A)return;const e=z.current;if(!e)return;const n=/* @__PURE__ */new Map,t=[];if(e.querySelectorAll("[data-kanban-card]").forEach(e=>{const r=e.dataset.kanbanCard,a=e.getBoundingClientRect();n.set(r,a);const o=F.current.get(r);if(o){const n=o.left-a.left,r=o.top-a.top;(n||r)&&t.push([e,n,r])}}),F.current=n,t.length){for(const[e,n,r]of t)e.style.transition="none",e.style.transform=`translate(${n}px, ${r}px)`;requestAnimationFrame(()=>{for(const[e]of t)e.style.transition="transform 200ms cubic-bezier(0.2, 0, 0, 1)",e.style.transform="",e.addEventListener("transitionend",()=>{e.style.transition="",e.style.transform=""},{once:!0})})}},[S,A]);return v?/* @__PURE__ */d(e,{size:"sm",padding:"p-4",label:T}):0!==m.length||w?/* @__PURE__ */d("div",{ref:z,className:"flex-1 overflow-x-auto grid-scroll",children:/* @__PURE__ */d("div",{className:"flex gap-3 h-full min-w-max pb-2",children:f.map(e=>{const n=S[e.value]??[],t=null!==$&&$.col===e.value,r=null!==A?n.findIndex(e=>g(e)===A):-1,o=t&&(-1===r||$.index!==r&&$.index!==r+1)?$.index:-1;/* @__PURE__ */
2
+ return u("div",{className:"group flex flex-col w-72 shrink-0 rounded-xl bg-gray-50 border transition-colors "+(t?"border-blue-400 ring-2 ring-blue-300/60":"border-gray-200"),onDragOver:e=>{e.preventDefault();try{e.dataTransfer.dropEffect="move"}catch{}},onDrop:n=>{n.preventDefault(),(e=>{if(A&&$&&$.col===e){const n=(S[e]??[]).findIndex(e=>g(e)===A),t=-1!==n;if(!t||$.index!==n&&$.index!==n+1){const r=t&&$.index>n?$.index-1:$.index;h(A,e,r)}}q()})(e.value)},children:[
3
3
  /* @__PURE__ */u("div",{className:`flex items-center justify-between px-3 py-2 rounded-t-xl text-sm font-medium ${e.accent??"text-gray-700 bg-gray-100"}`,children:[
4
4
  /* @__PURE__ */u("span",{className:"flex items-center gap-2",children:[
5
5
  /* @__PURE__ */d("span",{className:`h-2 w-2 rounded-full ${e.dot??"bg-gray-400"}`}),e.label]}),
6
6
  /* @__PURE__ */d("span",{className:"text-xs opacity-70",children:a(n.length,I)})]}),
7
- /* @__PURE__ */u("div",{className:"flex-1 overflow-y-auto p-2 space-y-2 min-h-[120px]",onDragEnter:()=>B(t=>t&&t.col===e.value&&t.index===n.length?t:{col:e.value,index:n.length}),children:[n.map((t,r)=>{const a=g(t),l=a===H;/* @__PURE__ */
7
+ /* @__PURE__ */u("div",{className:"flex-1 overflow-y-auto p-2 space-y-2 min-h-[120px]",onDragEnter:()=>R(t=>t&&t.col===e.value&&t.index===n.length?t:{col:e.value,index:n.length}),children:[n.map((t,r)=>{const a=g(t),l=a===A;/* @__PURE__ */
8
8
  return u(s,{children:[o===r&&/* @__PURE__ */d("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),
9
- /* @__PURE__ */d("div",{"data-kanban-card":a,draggable:!0,onDragStart:e=>{O(a);try{e.dataTransfer.effectAllowed="move"}catch{}},onDragEnter:t=>{t.stopPropagation();const a=null!==H?n.findIndex(e=>g(e)===H):-1,o=-1!==a&&a<r?r+1:r;B(n=>n&&n.col===e.value&&n.index===o?n:{col:e.value,index:o})},onDragEnd:R,onClick:b?()=>b(t):void 0,style:null===H?void 0:{opacity:l?.4:1,transition:"opacity 120ms ease"},className:"rounded-lg bg-white border border-gray-200 p-3 shadow-sm hover:border-blue-400 hover:shadow transition "+(b?"cursor-pointer":""),children:x(t)})]},a)}),n.length>0&&o===n.length&&/* @__PURE__ */d("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),0===n.length&&/* @__PURE__ */d("div",{className:"text-2xs text-center rounded-lg transition-all duration-150 "+(t?"border-2 border-dashed border-blue-300 bg-blue-50/50 text-blue-400 py-8":"text-gray-400 py-6"),children:M})]}),D&&/* @__PURE__ */d("div",{className:"p-2 pt-0",children:/* @__PURE__ */u("button",{type:"button",onClick:()=>D(e.value),className:"flex w-full items-center justify-center gap-1 rounded-lg px-2 min-h-8 py-1 text-xs font-medium text-ink-faint opacity-0 transition hover:bg-gray-100 hover:text-ink focus-visible:opacity-100 group-hover:opacity-100",children:[
10
- /* @__PURE__ */d("span",{"aria-hidden":!0,className:"text-sm leading-none",children:"+"}),A]})})]},e.value)})})}):/* @__PURE__ */d(c,{children:k??/* @__PURE__ */d("div",{className:"text-sm text-gray-500 p-4",children:j.empty})})}export{m as Kanban};
9
+ /* @__PURE__ */d("div",{"data-kanban-card":a,draggable:!0,onDragStart:e=>{H(a);try{e.dataTransfer.effectAllowed="move"}catch{}},onDragEnter:t=>{t.stopPropagation();const a=null!==A?n.findIndex(e=>g(e)===A):-1,o=-1!==a&&a<r?r+1:r;R(n=>n&&n.col===e.value&&n.index===o?n:{col:e.value,index:o})},onDragEnd:q,onClick:b?()=>b(t):void 0,style:null===A?void 0:{opacity:l?.4:1,transition:"opacity 120ms ease"},className:"rounded-lg bg-white border border-gray-200 p-3 shadow-sm hover:border-blue-400 hover:shadow transition "+(b?"cursor-pointer":""),children:x(t)})]},a)}),n.length>0&&o===n.length&&/* @__PURE__ */d("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),0===n.length&&/* @__PURE__ */d("div",{className:"text-2xs text-center rounded-lg transition-all duration-150 "+(t?"border-2 border-dashed border-blue-300 bg-blue-50/50 text-blue-400 py-8":"text-gray-400 py-6"),children:M})]}),D&&/* @__PURE__ */d("div",{className:"p-2 pt-0",children:/* @__PURE__ */u("button",{type:"button",onClick:()=>D(e.value),className:"flex w-full items-center justify-center gap-1 rounded-lg px-2 min-h-8 py-1 text-xs font-medium text-ink-faint opacity-0 transition hover:bg-gray-100 hover:text-ink focus-visible:opacity-100 group-hover:opacity-100",children:[
10
+ /* @__PURE__ */d("span",{"aria-hidden":!0,className:"text-sm leading-none",children:"+"}),O]})})]},e.value)})})}):/* @__PURE__ */d(c,{children:k??/* @__PURE__ */d("div",{className:"text-sm text-gray-500 p-4",children:j.empty})})}export{m as Kanban};
@@ -1,4 +1,4 @@
1
- import{Icon as e}from"./chunk-2UO47XB4.js";import{useShellStrings as r}from"./chunk-GDQJBQ5B.js";import{jsxs as t,jsx as n,Fragment as i}from"react/jsx-runtime";var a={info:{box:"bg-blue-50 border-blue-200",icon:"text-blue-600"},success:{box:"bg-green-50 border-green-200",icon:"text-green-600"},warning:{box:"bg-amber-50 border-amber-200",icon:"text-amber-600"},danger:{box:"bg-red-50 border-red-200",icon:"text-red-600"},neutral:{box:"bg-[var(--status-neutral-soft)] border-[color:var(--line)]",icon:"text-[color:var(--status-neutral-soft-ink)]"}},s={info:"bg-blue-700 border-blue-700 text-white",success:"bg-green-700 border-green-700 text-white",warning:"bg-amber-700 border-amber-700 text-white",danger:"bg-red-700 border-red-700 text-white",neutral:"bg-[var(--status-neutral-solid)] border-[color:var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function o({tone:r}){const t={className:"h-5 w-5","aria-hidden":!0};switch(r){case"success":/* @__PURE__ */
1
+ import{Icon as e}from"./chunk-R64OZ6TC.js";import{useShellStrings as r}from"./chunk-VNTJ7QO5.js";import{jsxs as t,jsx as n,Fragment as i}from"react/jsx-runtime";var a={info:{box:"bg-blue-50 border-blue-200",icon:"text-blue-600"},success:{box:"bg-green-50 border-green-200",icon:"text-green-600"},warning:{box:"bg-amber-50 border-amber-200",icon:"text-amber-600"},danger:{box:"bg-red-50 border-red-200",icon:"text-red-600"},neutral:{box:"bg-[var(--status-neutral-soft)] border-[color:var(--line)]",icon:"text-[color:var(--status-neutral-soft-ink)]"}},s={info:"bg-blue-700 border-blue-700 text-white",success:"bg-green-700 border-green-700 text-white",warning:"bg-amber-700 border-amber-700 text-white",danger:"bg-red-700 border-red-700 text-white",neutral:"bg-[var(--status-neutral-solid)] border-[color:var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function o({tone:r}){const t={className:"h-5 w-5","aria-hidden":!0};switch(r){case"success":/* @__PURE__ */
2
2
  return n(e,{name:"check-circle",look:"mini",...t});case"warning":/* @__PURE__ */
3
3
  return n(e,{name:"warning",look:"mini",...t});case"danger":/* @__PURE__ */
4
4
  return n(e,{name:"close-circle",look:"mini",...t});default:/* @__PURE__ */
@@ -1,4 +1,4 @@
1
- import{Icon as e}from"./chunk-2UO47XB4.js";import{useShellStrings as i}from"./chunk-GDQJBQ5B.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-R64OZ6TC.js";import{useShellStrings as i}from"./chunk-VNTJ7QO5.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 +1 @@
1
- import{toast_default as t}from"./chunk-7ELJQL7J.js";import{currentShellStrings as e}from"./chunk-GDQJBQ5B.js";function n(t){let e=null;try{e=window.getSelection()}catch{return null}if(!e||0===e.rangeCount||e.isCollapsed)return null;const n=t;if(n&&"number"==typeof n.nodeType){let t=!1;for(let r=0;r<e.rangeCount&&!t;r++)t=e.getRangeAt(r).intersectsNode(n);if(!t)return null}const r=e.toString();if(!r.trim())return null;const o=document.createElement("div");for(let t=0;t<e.rangeCount;t++)o.appendChild(e.getRangeAt(t).cloneContents());return{text:r,html:o.innerHTML}}async function r(t,e){try{if(e&&"undefined"!=typeof ClipboardItem&&navigator.clipboard?.write)return await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([e],{type:"text/html"})})]),!0;if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(t),!0}catch{}const n=n=>{n.clipboardData?.setData("text/plain",t),e&&n.clipboardData?.setData("text/html",e),n.preventDefault()},r=document.createElement("textarea");r.value=t,r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.select(),document.addEventListener("copy",n);try{return document.execCommand("copy")}catch{return!1}finally{document.removeEventListener("copy",n),r.remove()}}async function o(n,o,a){const i=await r(o,a),l=e().copy;return i?t.success(l.copiedLabel(n)):t.error(l.failed),i}export{o as copyToClipboard,n as selectionAt,r as writeClipboard};
1
+ import{toast_default as t}from"./chunk-MWKLLAJT.js";import{currentShellStrings as e}from"./chunk-VNTJ7QO5.js";function n(t){let e=null;try{e=window.getSelection()}catch{return null}if(!e||0===e.rangeCount||e.isCollapsed)return null;const n=t;if(n&&"number"==typeof n.nodeType){let t=!1;for(let r=0;r<e.rangeCount&&!t;r++)t=e.getRangeAt(r).intersectsNode(n);if(!t)return null}const r=e.toString();if(!r.trim())return null;const o=document.createElement("div");for(let t=0;t<e.rangeCount;t++)o.appendChild(e.getRangeAt(t).cloneContents());return{text:r,html:o.innerHTML}}async function r(t,e){try{if(e&&"undefined"!=typeof ClipboardItem&&navigator.clipboard?.write)return await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([e],{type:"text/html"})})]),!0;if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(t),!0}catch{}const n=n=>{n.clipboardData?.setData("text/plain",t),e&&n.clipboardData?.setData("text/html",e),n.preventDefault()},r=document.createElement("textarea");r.value=t,r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.select(),document.addEventListener("copy",n);try{return document.execCommand("copy")}catch{return!1}finally{document.removeEventListener("copy",n),r.remove()}}async function o(n,o,a){const i=await r(o,a),l=e().copy;return i?t.success(l.copiedLabel(n)):t.error(l.failed),i}export{o as copyToClipboard,n as selectionAt,r as writeClipboard};
@@ -1,21 +1,21 @@
1
- import{Markdown as e}from"./chunk-QOI4GQVH.js";import{PLACEHOLDER_INK as t}from"./chunk-AYZY3YNC.js";import{Icon as l}from"./chunk-2UO47XB4.js";import{LoadingSpinner as r}from"./chunk-R2VKEMZH.js";import{useShellStrings as s}from"./chunk-GDQJBQ5B.js";import{useState as a,useMemo as n}from"react";import{jsxs as i,jsx as o,Fragment as c}from"react/jsx-runtime";var d=({open:e})=>/* @__PURE__ */o(l,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function h({docs:h,loading:m=!1,categoryOrder:p,canEdit:u=!1,onNew:g,onEdit:x,renderBody:f,emptyMessage:b}){const y=s(),[v,N]=a(""),[w,k]=a(null),[C,j]=a({}),B=v.trim().toLowerCase(),M=n(()=>{const e=/* @__PURE__ */new Map;for(const t of h){let l=e.get(t.category);l||(l={key:t.category,label:t.category_label||t.category,docs:[]},e.set(t.category,l)),l.docs.push(t)}if(!p?.length)return[...e.values()];const t=new Map(p.map((e,t)=>[e,t]));return[...e.values()].sort((e,l)=>(t.get(e.key)??1/0)-(t.get(l.key)??1/0))},[h,p]),_=e=>!B||e.title.toLowerCase().includes(B)||e.body.toLowerCase().includes(B)||e.category_label.toLowerCase().includes(B),L=n(()=>M.map(e=>({...e,docs:e.docs.filter(_)})).filter(e=>e.docs.length>0),[M,B]),Q=n(()=>L.flatMap(e=>e.docs),[L]),A=(w?Q.find(e=>e.slug===w):void 0)??Q[0]??null,E=e=>!!B||(C[e]??e===A?.category);/* @__PURE__ */
1
+ import{Markdown as e}from"./chunk-276JUQXK.js";import{PLACEHOLDER_INK as t}from"./chunk-AYZY3YNC.js";import{Icon as l}from"./chunk-R64OZ6TC.js";import{LoadingSpinner as r}from"./chunk-R2VKEMZH.js";import{useShellStrings as s}from"./chunk-VNTJ7QO5.js";import{useState as a,useMemo as n}from"react";import{jsxs as i,jsx as o,Fragment as c}from"react/jsx-runtime";var d=({open:e})=>/* @__PURE__ */o(l,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function h({docs:h,loading:m=!1,categoryOrder:p,canEdit:u=!1,onNew:g,onEdit:x,renderBody:f,emptyMessage:b}){const y=s(),[N,v]=a(""),[w,k]=a(null),[C,j]=a({}),M=N.trim().toLowerCase(),_=n(()=>{const e=/* @__PURE__ */new Map;for(const t of h){let l=e.get(t.category);l||(l={key:t.category,label:t.category_label||t.category,docs:[]},e.set(t.category,l)),l.docs.push(t)}if(!p?.length)return[...e.values()];const t=new Map(p.map((e,t)=>[e,t]));return[...e.values()].sort((e,l)=>(t.get(e.key)??1/0)-(t.get(l.key)??1/0))},[h,p]),L=e=>!M||e.title.toLowerCase().includes(M)||e.body.toLowerCase().includes(M)||e.category_label.toLowerCase().includes(M),A=n(()=>_.map(e=>({...e,docs:e.docs.filter(L)})).filter(e=>e.docs.length>0),[_,M]),E=n(()=>A.flatMap(e=>e.docs),[A]),O=(w?E.find(e=>e.slug===w):void 0)??E[0]??null,R=e=>!!M||(C[e]??e===O?.category);/* @__PURE__ */
2
2
  return i("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
3
3
  /* @__PURE__ */i("aside",{className:"w-64 shrink-0 flex flex-col bg-white rounded-lg shadow overflow-hidden",children:[
4
4
  /* @__PURE__ */i("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
5
5
  /* @__PURE__ */o("h2",{className:"text-sm font-semibold text-gray-900",children:y.help.title}),u&&g&&/* @__PURE__ */o("button",{type:"button",onClick:g,className:"text-xs text-blue-600 hover:underline",children:y.help.newArticle})]}),
6
6
  /* @__PURE__ */o("div",{className:"px-3 py-2 border-b border-line-subtle shrink-0",children:/* @__PURE__ */i("div",{className:"relative",children:[
7
7
  /* @__PURE__ */o(l,{name:"search",look:"mini",className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 ${t}`,"aria-hidden":"true"}),
8
- /* @__PURE__ */o("input",{type:"text",value:v,onChange:e=>N(e.target.value),placeholder:y.help.searchPlaceholder,className:"w-full rounded-md border border-line-strong bg-surface h-8 pl-8 pr-2 text-sm shadow-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})}),
9
- /* @__PURE__ */o("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"py-6",label:y.help.loading}):0===L.length?/* @__PURE__ */o("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:B?y.help.noResults:b??y.help.empty}):L.map(e=>{const t=E(e.key);/* @__PURE__ */
8
+ /* @__PURE__ */o("input",{type:"text",value:N,onChange:e=>v(e.target.value),placeholder:y.help.searchPlaceholder,className:"w-full rounded-md border border-line-strong bg-surface h-8 pl-8 pr-2 text-sm shadow-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})}),
9
+ /* @__PURE__ */o("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"py-6",label:y.help.loading}):0===A.length?/* @__PURE__ */o("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:M?y.help.noResults:b??y.help.empty}):A.map(e=>{const t=R(e.key);/* @__PURE__ */
10
10
  return i("div",{className:"py-0.5",children:[
11
- /* @__PURE__ */i("button",{type:"button",onClick:()=>{return t=e.key,j(e=>({...e,[t]:!E(t)}));var t},className:"w-full flex items-center gap-2 h-8 px-3 text-left text-3xs font-semibold uppercase tracking-wide text-ink-faintest hover:text-gray-600",children:[
11
+ /* @__PURE__ */i("button",{type:"button",onClick:()=>{return t=e.key,j(e=>({...e,[t]:!R(t)}));var t},className:"w-full flex items-center gap-2 h-8 px-3 text-left text-3xs font-semibold uppercase tracking-wide text-ink-faintest hover:text-gray-600",children:[
12
12
  /* @__PURE__ */o(d,{open:t}),
13
- /* @__PURE__ */o("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=A?.slug===e.slug;/* @__PURE__ */
13
+ /* @__PURE__ */o("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=O?.slug===e.slug;/* @__PURE__ */
14
14
  return i("button",{type:"button",onClick:()=>k(e.slug),className:"w-full text-left pl-8 pr-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 transition-colors "+(t?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),children:[
15
15
  /* @__PURE__ */o("span",{className:"truncate",children:e.title}),!1===e.is_published&&/* @__PURE__ */o("span",{className:"ml-auto shrink-0 text-2xs text-amber-600",children:y.help.draft})]},e.slug)})]},e.key)})})]}),
16
- /* @__PURE__ */o("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:A?/* @__PURE__ */i(c,{children:[
16
+ /* @__PURE__ */o("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:O?/* @__PURE__ */i(c,{children:[
17
17
  /* @__PURE__ */i("div",{className:"flex items-start justify-between gap-4 px-5 py-3 border-b border-gray-200 bg-gray-50 shrink-0",children:[
18
18
  /* @__PURE__ */i("div",{className:"min-w-0",children:[
19
- /* @__PURE__ */o("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:A.title}),
20
- /* @__PURE__ */i("p",{className:"text-xs text-gray-500 mt-0.5",children:[A.category_label,!1===A.is_published&&/* @__PURE__ */i("span",{className:"ml-2 text-amber-600",children:["· ",y.help.draft]})]})]}),u&&x&&/* @__PURE__ */o("button",{type:"button",onClick:()=>x(A),className:"shrink-0 text-sm text-blue-600 hover:underline",children:y.help.edit})]}),
21
- /* @__PURE__ */o("div",{className:"flex-1 overflow-auto px-5 py-4",children:f?f(A):A.body?/* @__PURE__ */o(e,{children:A.body}):/* @__PURE__ */o("p",{className:"text-sm text-gray-500 italic",children:y.help.noBody})})]}):/* @__PURE__ */o("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"",label:y.help.loading}):/* @__PURE__ */o("p",{className:"text-sm text-ink-faint",children:y.help.pickArticle})})})]})}export{h as HelpCenter};
19
+ /* @__PURE__ */o("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:O.title}),
20
+ /* @__PURE__ */i("p",{className:"text-xs text-gray-500 mt-0.5",children:[O.category_label,!1===O.is_published&&/* @__PURE__ */i("span",{className:"ml-2 text-amber-600",children:["· ",y.help.draft]})]})]}),u&&x&&/* @__PURE__ */o("button",{type:"button",onClick:()=>x(O),className:"shrink-0 text-sm text-blue-600 hover:underline",children:y.help.edit})]}),
21
+ /* @__PURE__ */o("div",{className:"flex-1 overflow-auto px-5 py-4",children:f?f(O):O.body?/* @__PURE__ */o(e,{children:O.body}):/* @__PURE__ */o("p",{className:"text-sm text-gray-500 italic",children:y.help.noBody})})]}):/* @__PURE__ */o("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"",label:y.help.loading}):/* @__PURE__ */o("p",{className:"text-sm text-ink-faint",children:y.help.pickArticle})})})]})}export{h as HelpCenter};