efficient-shell 13.15.0 → 13.17.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 (320) hide show
  1. package/README.md +20 -1
  2. package/dist/Browser-547OGMQH.js +44 -0
  3. package/dist/Calculator-4UBMDAJO.js +29 -0
  4. package/dist/CurrencyConverter-H3HHXXKT.js +21 -0
  5. package/dist/{Files-EN4DDZYV.js → Files-GPPTZPDS.js} +80 -80
  6. package/dist/Notepad-GAZ7CZQB.js +24 -0
  7. package/dist/PdfViewer-EELX35ZI.js +1 -0
  8. package/dist/PomodoroTimer-JVCYYGRD.js +91 -0
  9. package/dist/{Preview-OSQHIS3Z.js → Preview-GSD54EUE.js} +33 -33
  10. package/dist/Sidebar-UCCVJFSY.js +44 -0
  11. package/dist/{Stock-2P4NWUNB.js → Stock-S266KGAF.js} +4 -4
  12. package/dist/{Weather-7LIQ4POB.js → Weather-TE4TTTQA.js} +22 -22
  13. package/dist/{WorldClock-KHBYIJQZ.js → WorldClock-5TPBHBYA.js} +7 -7
  14. package/dist/ai/index.js +118 -118
  15. package/dist/apps/ImageAnnotator.js +1 -1
  16. package/dist/apps/index.js +1 -1
  17. package/dist/bin/browser-check.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/charts/BoxPlotChart.js +1 -1
  21. package/dist/charts/CandlestickChart.js +1 -1
  22. package/dist/charts/CartesianPlot.js +1 -1
  23. package/dist/charts/ChordChart.js +1 -1
  24. package/dist/charts/ColumnChart.js +1 -1
  25. package/dist/charts/FlowChart.js +1 -1
  26. package/dist/charts/FunnelChart.js +1 -1
  27. package/dist/charts/HeatmapChart.js +1 -1
  28. package/dist/charts/HistogramChart.js +1 -1
  29. package/dist/charts/PieChart.js +1 -1
  30. package/dist/charts/RadarChart.js +1 -1
  31. package/dist/charts/RadialBarChart.js +1 -1
  32. package/dist/charts/RangeChart.js +1 -1
  33. package/dist/charts/SankeyChart.js +1 -1
  34. package/dist/charts/ScatterChart.js +1 -1
  35. package/dist/charts/SpecChart.js +1 -1
  36. package/dist/charts/SunburstChart.js +1 -1
  37. package/dist/charts/TimeSeriesChart.js +1 -1
  38. package/dist/charts/TreemapChart.js +1 -1
  39. package/dist/charts/WaterfallChart.js +1 -1
  40. package/dist/{chunk-JNSRDEB6.js → chunk-2J3C2RR4.js} +10 -10
  41. package/dist/{chunk-D3T3JCUC.js → chunk-34HRPEQD.js} +1 -1
  42. package/dist/{chunk-PT4GMPUB.js → chunk-3SIRRK3F.js} +3 -3
  43. package/dist/{chunk-OWAYSIQH.js → chunk-42DF7CDB.js} +5 -5
  44. package/dist/{chunk-4OBSVO6U.js → chunk-4G7PJ325.js} +1 -1
  45. package/dist/{chunk-3OUG6QAD.js → chunk-5EHIWKUZ.js} +1 -1
  46. package/dist/chunk-5URXJCNC.js +2 -0
  47. package/dist/{chunk-OEPQIIYL.js → chunk-63E4ZZYI.js} +1 -1
  48. package/dist/{chunk-CKTFXTJL.js → chunk-6OCA7RKQ.js} +1 -1
  49. package/dist/{chunk-HVHIXX6O.js → chunk-6OGX7V7L.js} +10 -10
  50. package/dist/{chunk-WP43XYL6.js → chunk-6QH7I2V5.js} +2 -2
  51. package/dist/{chunk-G53Y6EPJ.js → chunk-7CBWSLCW.js} +13 -13
  52. package/dist/{chunk-DVVB2CY5.js → chunk-7I5RJPY7.js} +1 -1
  53. package/dist/{chunk-22N3KA7A.js → chunk-7IXU4YT4.js} +4 -4
  54. package/dist/{chunk-VYHVIKP6.js → chunk-7SVSHJOO.js} +10 -10
  55. package/dist/{chunk-XEPA5J6K.js → chunk-A7VNKVZO.js} +4 -4
  56. package/dist/{chunk-I6JTDAOB.js → chunk-BNPWUCZX.js} +1 -1
  57. package/dist/{chunk-M5K4AX4E.js → chunk-BUFAJJDZ.js} +1 -1
  58. package/dist/{chunk-WJ7U6TGK.js → chunk-BVX7LUAW.js} +4 -4
  59. package/dist/chunk-BWQHABH7.js +4 -0
  60. package/dist/{chunk-G4D2WM3J.js → chunk-BZRFD4DK.js} +3 -3
  61. package/dist/{chunk-U6DRRCCG.js → chunk-C5OPAULN.js} +1 -1
  62. package/dist/{chunk-MEF4JVXP.js → chunk-CCLK2RPQ.js} +14 -14
  63. package/dist/{chunk-IJNQ2BUY.js → chunk-CILE3ZCC.js} +2 -2
  64. package/dist/{chunk-KC3EX26K.js → chunk-DPFEQQQU.js} +1 -1
  65. package/dist/{chunk-ZYU5HAIC.js → chunk-E7BQZL7X.js} +1 -1
  66. package/dist/{chunk-XHD6Q6JV.js → chunk-EFO72DEI.js} +1 -1
  67. package/dist/{chunk-YM2Z4LZ2.js → chunk-EFVQQF6F.js} +17 -17
  68. package/dist/{chunk-GO2TZ35U.js → chunk-EJOKROMB.js} +1 -1
  69. package/dist/{chunk-4IYHQNKZ.js → chunk-ENDYHUUR.js} +1 -1
  70. package/dist/{chunk-4F3SUYN5.js → chunk-ETQ45TBW.js} +1 -1
  71. package/dist/chunk-EX3DARI3.js +7 -0
  72. package/dist/{chunk-JPCPO4MX.js → chunk-EZYXY67W.js} +8 -8
  73. package/dist/chunk-F2RAIGCG.js +6 -0
  74. package/dist/{chunk-ZDMZM7HD.js → chunk-FBZUEZK7.js} +2 -2
  75. package/dist/{chunk-GURY4WS5.js → chunk-FFRJ6QZK.js} +1 -1
  76. package/dist/{chunk-F5B5WOQ7.js → chunk-FKMARSJZ.js} +2 -2
  77. package/dist/chunk-FMLUQCFB.js +2 -0
  78. package/dist/chunk-FRTDUHQF.js +1 -0
  79. package/dist/{chunk-AWWNMSDN.js → chunk-FXSGIT53.js} +10 -10
  80. package/dist/{chunk-YMHCLK3F.js → chunk-FZYUTZEV.js} +10 -10
  81. package/dist/chunk-G2JPTPRS.js +13 -0
  82. package/dist/{chunk-YDFDTRZF.js → chunk-G7SILKUY.js} +5 -5
  83. package/dist/{chunk-DEYVAMJQ.js → chunk-GEITUFYK.js} +13 -13
  84. package/dist/{chunk-GSLZ46DJ.js → chunk-GMLOMLCS.js} +13 -13
  85. package/dist/{chunk-6LS6Q77E.js → chunk-GUSENWAH.js} +1 -1
  86. package/dist/{chunk-YDQBELHJ.js → chunk-H5PSCQJ2.js} +6 -6
  87. package/dist/{chunk-J6QC45OS.js → chunk-HC5KQZFG.js} +5 -5
  88. package/dist/{chunk-LXPDURUL.js → chunk-HMOKKMIV.js} +2 -2
  89. package/dist/{chunk-RFR2K7JO.js → chunk-HPHDLN6E.js} +2 -2
  90. package/dist/{chunk-I5EVMLPB.js → chunk-IJ4JX6WP.js} +4 -4
  91. package/dist/{chunk-UGEX7SVM.js → chunk-IUQJGFEO.js} +8 -8
  92. package/dist/{chunk-5HBAJ2UA.js → chunk-J4CVYOY3.js} +13 -13
  93. package/dist/{chunk-CUZQVBPC.js → chunk-JDLJ7DHV.js} +1 -1
  94. package/dist/chunk-JPE4TYRQ.js +14 -0
  95. package/dist/{chunk-4Q2CZ4US.js → chunk-JPSWWIBW.js} +6 -6
  96. package/dist/{chunk-XOQGBU25.js → chunk-K2FVP22A.js} +1 -1
  97. package/dist/{chunk-7RGHV3J5.js → chunk-KGAYYSFE.js} +6 -6
  98. package/dist/{chunk-KLUCEASW.js → chunk-KQCJWK55.js} +6 -6
  99. package/dist/{chunk-OLSA36VX.js → chunk-KSK4VZIM.js} +6 -6
  100. package/dist/{chunk-ZNKZ6J65.js → chunk-L4ZQY4ZG.js} +3 -3
  101. package/dist/chunk-LADP6AJY.js +9 -0
  102. package/dist/{chunk-W6NGPSMM.js → chunk-LGGATDPH.js} +17 -17
  103. package/dist/{chunk-PALWXHBQ.js → chunk-LKAGXURQ.js} +20 -20
  104. package/dist/chunk-LNCAIY64.js +15 -0
  105. package/dist/chunk-LQCNIQ3I.js +8 -0
  106. package/dist/{chunk-QQK7HKNK.js → chunk-LUCO5PS6.js} +1 -1
  107. package/dist/chunk-M6UKCZHT.js +2 -0
  108. package/dist/{chunk-QVQO3EFL.js → chunk-MHQW6NAE.js} +11 -11
  109. package/dist/{chunk-VCR3RADH.js → chunk-MVOYVN3S.js} +1 -1
  110. package/dist/{chunk-N2FX4O3H.js → chunk-MZ3JADHG.js} +1 -1
  111. package/dist/{chunk-SV5RRBVA.js → chunk-NWS5G7FE.js} +1 -1
  112. package/dist/{chunk-UXGNF3OG.js → chunk-OF5X4HKC.js} +1 -1
  113. package/dist/{chunk-JFRBUVHX.js → chunk-OIEFMLYI.js} +3 -3
  114. package/dist/{chunk-A4WNUFLT.js → chunk-OOGUQEPT.js} +1 -1
  115. package/dist/chunk-OUYGLDQN.js +24 -0
  116. package/dist/chunk-OXWBSZL2.js +23 -0
  117. package/dist/{chunk-NISLELJF.js → chunk-P4J26R5P.js} +1 -1
  118. package/dist/{chunk-TTLVTJR6.js → chunk-POQUUMRS.js} +2 -2
  119. package/dist/{chunk-2YK6ZB7C.js → chunk-PPLPDP6D.js} +1 -1
  120. package/dist/chunk-PTYB2GGI.js +1 -0
  121. package/dist/{chunk-QIPO4EVJ.js → chunk-Q4MOT7TY.js} +1 -1
  122. package/dist/{chunk-7TJZ5AJE.js → chunk-QNXTVDIC.js} +6 -6
  123. package/dist/{chunk-7JG64RQW.js → chunk-QSJMLHBD.js} +1 -1
  124. package/dist/{chunk-7NO4IENQ.js → chunk-R5WBDXI2.js} +1 -1
  125. package/dist/{chunk-NYKOATR5.js → chunk-RDETBXMP.js} +1 -1
  126. package/dist/{chunk-I6QVXM2M.js → chunk-RDVC32EV.js} +15 -15
  127. package/dist/chunk-RJVIKGHJ.js +4 -0
  128. package/dist/{chunk-ZOCE74ED.js → chunk-SF4IIV5Z.js} +2 -2
  129. package/dist/{chunk-RZ3OQFOD.js → chunk-SHHRC5XK.js} +8 -8
  130. package/dist/{chunk-OBZZLLMQ.js → chunk-SLEA47VA.js} +1 -1
  131. package/dist/chunk-SM3N5UJ2.js +69 -0
  132. package/dist/{chunk-F6UJLCMI.js → chunk-SUSJFGXN.js} +9 -9
  133. package/dist/{chunk-FTKLODQK.js → chunk-SXHV5OLA.js} +1 -1
  134. package/dist/{chunk-65FZQ572.js → chunk-SZFULV7I.js} +6 -6
  135. package/dist/{chunk-HZ7TUMNL.js → chunk-TB2ARUE2.js} +1 -1
  136. package/dist/{chunk-G67CJAQ2.js → chunk-TD3ZQD5R.js} +1 -1
  137. package/dist/chunk-THAPVKEJ.js +15 -0
  138. package/dist/{chunk-GKNF53YM.js → chunk-TKCCJRPE.js} +1 -1
  139. package/dist/{chunk-HNIIDDLJ.js → chunk-TNALBYLY.js} +1 -1
  140. package/dist/{chunk-6CDWPEND.js → chunk-TPKNHQIE.js} +8 -8
  141. package/dist/{chunk-42RCQEEJ.js → chunk-U5RG34NE.js} +11 -11
  142. package/dist/{chunk-VADWTS7H.js → chunk-UFWBPTCM.js} +5 -5
  143. package/dist/{chunk-23LK4PLJ.js → chunk-UGEA3C5C.js} +5 -5
  144. package/dist/{chunk-EVYD6UFQ.js → chunk-UTISUEO4.js} +2 -2
  145. package/dist/chunk-UTQN5AIO.js +6 -0
  146. package/dist/chunk-UVHXVSB2.js +1 -0
  147. package/dist/{chunk-QMBMK6PP.js → chunk-VKZC3NPM.js} +2 -2
  148. package/dist/chunk-VLX7L2AM.js +1 -0
  149. package/dist/{chunk-UZFFSZFI.js → chunk-VQBKRBBR.js} +1 -1
  150. package/dist/{chunk-GLUJS42B.js → chunk-VY3UA6AR.js} +1 -1
  151. package/dist/chunk-WCCS4VFE.js +1 -0
  152. package/dist/{chunk-P5C7DI5A.js → chunk-WPGSU4QG.js} +5 -5
  153. package/dist/{chunk-WLG7BE55.js → chunk-WRV6QKJN.js} +1 -1
  154. package/dist/{chunk-LHHJHTWP.js → chunk-WZWSFYXJ.js} +1 -1
  155. package/dist/{chunk-S6YEPA4I.js → chunk-X4E4RPFE.js} +5 -5
  156. package/dist/{chunk-M7W63T6H.js → chunk-XAT2MKNU.js} +8 -8
  157. package/dist/chunk-XD3M5ZXM.js +7 -0
  158. package/dist/{chunk-QOYKBINM.js → chunk-XQVGBVHC.js} +1 -1
  159. package/dist/{chunk-CGKY4ZRA.js → chunk-XU4I2DMR.js} +2 -2
  160. package/dist/{chunk-E6FDUFPH.js → chunk-XVMCSUAV.js} +1 -1
  161. package/dist/chunk-XXTAMF3O.js +28 -0
  162. package/dist/{chunk-6HYO2W3O.js → chunk-YCXQDUTW.js} +5 -5
  163. package/dist/{chunk-WU2ZA6J2.js → chunk-YDJ5IZOU.js} +1 -1
  164. package/dist/{chunk-LLYMOV4S.js → chunk-YQ5JHHLE.js} +1 -1
  165. package/dist/{chunk-BWLC56GZ.js → chunk-YT5HMLC7.js} +1 -1
  166. package/dist/{chunk-G4PPHQ23.js → chunk-YWMCW5BN.js} +1 -1
  167. package/dist/{chunk-WF4A2HSB.js → chunk-ZCN5BU4U.js} +1 -1
  168. package/dist/{chunk-HY6CBG4M.js → chunk-ZDFMYAQB.js} +1 -1
  169. package/dist/chunk-ZDXRSY2Y.js +1 -0
  170. package/dist/chunk-ZI2FDUYJ.js +99 -0
  171. package/dist/chunk-ZISKHQZY.js +3 -0
  172. package/dist/{chunk-DVHRL3G6.js → chunk-ZVDYRXNP.js} +6 -6
  173. package/dist/{chunk-3DWVSQIJ.js → chunk-ZYKY4Z7R.js} +1 -1
  174. package/dist/data/DataTable.js +1 -1
  175. package/dist/data/EntityList.js +1 -1
  176. package/dist/data/Gantt.js +1 -1
  177. package/dist/data/Kanban.js +1 -1
  178. package/dist/data/ListLoadError.js +1 -1
  179. package/dist/data/ResizableTable.js +1 -1
  180. package/dist/data/statusColumn.js +1 -1
  181. package/dist/data/useColumnConfig.js +1 -1
  182. package/dist/data/useSort.js +1 -1
  183. package/dist/forms/AlignmentGrid.js +1 -1
  184. package/dist/forms/BorderInput.js +1 -1
  185. package/dist/forms/BrandAssetEditor.js +1 -1
  186. package/dist/forms/Button.js +1 -1
  187. package/dist/forms/Calendar.js +1 -1
  188. package/dist/forms/ColorPicker.js +1 -1
  189. package/dist/forms/ComposerAttachments.js +1 -1
  190. package/dist/forms/CornersInput.js +1 -1
  191. package/dist/forms/DatePicker.js +1 -1
  192. package/dist/forms/DateRangePicker.js +1 -1
  193. package/dist/forms/DisplayChips.js +1 -1
  194. package/dist/forms/FilePicker.js +1 -1
  195. package/dist/forms/IconButton.js +1 -1
  196. package/dist/forms/IconPicker.js +1 -1
  197. package/dist/forms/Input.js +1 -1
  198. package/dist/forms/InputNumber.js +1 -1
  199. package/dist/forms/LinkPicker.js +1 -1
  200. package/dist/forms/MediaLibrary.js +1 -1
  201. package/dist/forms/MediaUploadField.js +1 -1
  202. package/dist/forms/MediaUploadGrid.js +1 -1
  203. package/dist/forms/MediaUsedInList.js +1 -1
  204. package/dist/forms/NumericKeypad.js +1 -1
  205. package/dist/forms/PictureTiles.js +1 -1
  206. package/dist/forms/PositionInput.js +1 -1
  207. package/dist/forms/RenameField.js +1 -1
  208. package/dist/forms/Segmented.js +1 -1
  209. package/dist/forms/Select.js +1 -1
  210. package/dist/forms/SidesInput.js +1 -1
  211. package/dist/forms/Slider.js +1 -1
  212. package/dist/forms/Snippet.js +1 -1
  213. package/dist/forms/SplitButton.js +1 -1
  214. package/dist/forms/TagInput.js +1 -1
  215. package/dist/forms/TextToolbar.js +1 -1
  216. package/dist/forms/UnitMenu.js +1 -1
  217. package/dist/forms/WidthsBar.js +1 -1
  218. package/dist/forms/dropdownPosition.js +1 -1
  219. package/dist/hooks/index.d.ts +29 -0
  220. package/dist/hooks/index.js +2 -0
  221. package/dist/hooks/useTheme.js +1 -1
  222. package/dist/icons/brands.node.js +1 -1
  223. package/dist/icons/efficient-glyphs.js +1 -1
  224. package/dist/icons/efficient-looks.js +1 -1
  225. package/dist/icons/efficient.js +1 -1
  226. package/dist/icons/looks/map.js +1 -1
  227. package/dist/icons/payment.js +1 -1
  228. package/dist/icons/sets.js +1 -1
  229. package/dist/index.d.ts +4 -40
  230. package/dist/index.js +335 -335
  231. package/dist/map/index.js +7 -7
  232. package/dist/markdown/index.js +1 -1
  233. package/dist/page-tabs/index.js +5 -5
  234. package/dist/pdf/index.js +1 -1
  235. package/dist/shell/AppUpdateBanner.js +1 -1
  236. package/dist/shell/ColoredBadge.js +1 -1
  237. package/dist/shell/ConfirmDialog.js +1 -1
  238. package/dist/shell/ContextMenu.js +1 -1
  239. package/dist/shell/Dialog.js +1 -1
  240. package/dist/shell/Drawer.js +1 -1
  241. package/dist/shell/DropdownMenu.js +1 -1
  242. package/dist/shell/EditableGrid.js +1 -1
  243. package/dist/shell/FitFrame.d.ts +46 -0
  244. package/dist/shell/FitFrame.js +2 -0
  245. package/dist/shell/FloatingBar.js +1 -1
  246. package/dist/shell/GlobalSearch.js +1 -1
  247. package/dist/shell/HelpCenter.js +1 -1
  248. package/dist/shell/IconRail.js +1 -1
  249. package/dist/shell/ImageLightbox.js +1 -1
  250. package/dist/shell/ItemCount.js +1 -1
  251. package/dist/shell/Kbd.js +1 -1
  252. package/dist/shell/LanguageSelect.js +1 -1
  253. package/dist/shell/Markdown.js +1 -1
  254. package/dist/shell/MilestoneTimeline.js +1 -1
  255. package/dist/shell/Popover.js +1 -1
  256. package/dist/shell/PopupMenu.js +1 -1
  257. package/dist/shell/ProductionTimeline.js +1 -1
  258. package/dist/shell/ResizeHandle.js +1 -1
  259. package/dist/shell/SearchableSelect.js +1 -1
  260. package/dist/shell/SettingReset.js +1 -1
  261. package/dist/shell/ShellPrefs.js +1 -1
  262. package/dist/shell/SidebarLayout.js +1 -1
  263. package/dist/shell/SidebarNav.js +1 -1
  264. package/dist/shell/SortableList.js +1 -1
  265. package/dist/shell/StatusBadge.js +1 -1
  266. package/dist/shell/Tabs.js +1 -1
  267. package/dist/shell/TimelineTrack.js +1 -1
  268. package/dist/shell/Tooltip.js +1 -1
  269. package/dist/shell/TopNav.js +1 -1
  270. package/dist/shell/TransferProgress.js +1 -1
  271. package/dist/shell/Tree.js +1 -1
  272. package/dist/shell/discardGuard.js +1 -1
  273. package/dist/telemetry/index.js +1 -1
  274. package/dist/templates/AuthScreen.js +1 -1
  275. package/dist/templates/ChatTemplate.js +1 -1
  276. package/dist/templates/CheckoutTemplate.js +1 -1
  277. package/dist/templates/DashboardTemplate.js +1 -1
  278. package/dist/templates/DataTablePage.js +1 -1
  279. package/dist/templates/EmailTemplate.js +1 -1
  280. package/dist/templates/ErrorBoundary.js +1 -1
  281. package/dist/templates/FormLayoutPage.js +1 -1
  282. package/dist/templates/GalleryTemplate.js +1 -1
  283. package/dist/ui/index.d.ts +1 -0
  284. package/dist/ui/index.js +1 -1
  285. package/dist/version.js +1 -1
  286. package/package.json +6 -1
  287. package/dist/Browser-KHMTFVKZ.js +0 -44
  288. package/dist/Calculator-OKVS4UOJ.js +0 -29
  289. package/dist/CurrencyConverter-ZA2NGJWI.js +0 -21
  290. package/dist/Notepad-PHQNEUKW.js +0 -24
  291. package/dist/PdfViewer-PFQGQRQX.js +0 -1
  292. package/dist/PomodoroTimer-PW7BRZUJ.js +0 -91
  293. package/dist/Sidebar-GYGYAXS2.js +0 -44
  294. package/dist/chunk-3DSGJIC7.js +0 -7
  295. package/dist/chunk-3J4SFHC7.js +0 -15
  296. package/dist/chunk-3QNZ7YGZ.js +0 -99
  297. package/dist/chunk-47UTEV3P.js +0 -23
  298. package/dist/chunk-6QKTQOEV.js +0 -69
  299. package/dist/chunk-7KWYVQMX.js +0 -2
  300. package/dist/chunk-7QSDPSXP.js +0 -1
  301. package/dist/chunk-AOLJKOO6.js +0 -28
  302. package/dist/chunk-ASDYAASN.js +0 -3
  303. package/dist/chunk-CBUBDXJ2.js +0 -1
  304. package/dist/chunk-D65T4H6J.js +0 -1
  305. package/dist/chunk-DQTYV6AC.js +0 -9
  306. package/dist/chunk-EV5BEEVO.js +0 -1
  307. package/dist/chunk-FHNQC2MA.js +0 -1
  308. package/dist/chunk-GOAFMGUI.js +0 -15
  309. package/dist/chunk-HNPJ3V3I.js +0 -6
  310. package/dist/chunk-KXPXLUNM.js +0 -4
  311. package/dist/chunk-MHCNQKEK.js +0 -4
  312. package/dist/chunk-O2PVZC5D.js +0 -8
  313. package/dist/chunk-QTVE3OSD.js +0 -7
  314. package/dist/chunk-RDGXSAOD.js +0 -2
  315. package/dist/chunk-SOZCWT6I.js +0 -6
  316. package/dist/chunk-WWCAVO3R.js +0 -14
  317. package/dist/chunk-XMFJDT6Y.js +0 -13
  318. package/dist/chunk-YGKLZBWC.js +0 -24
  319. /package/dist/{chunk-HOHHRNCB.js → chunk-FRCTA5FS.js} +0 -0
  320. /package/dist/{chunk-VG6BT2UG.js → chunk-YRQ5WGOM.js} +0 -0
@@ -1,2 +1,2 @@
1
- import{userToday as t}from"./chunk-NHKT5IH6.js";import{useShellPrefs as e}from"./chunk-KC3EX26K.js";import{toast_default as n}from"./chunk-VQ35LXDC.js";import{useSyncExternalStore as o,useCallback as a,useMemo as r}from"react";var i=[{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"}],c=[{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"}];function l(e=/* @__PURE__ */new Date){return t(e)??""}function s(t=/* @__PURE__ */new Date){return`pomodoro-day-${l(t)}`}var u={focus:1500,short:300,long:900},d="bell",f=100,m=1,h="none",g=50,p={autoStartBreaks:!1,autoStartPomodoros:!1,longBreakInterval:4},k={running:!1,remaining:u.focus,mode:"focus",total:u.focus,streak:0,count:"undefined"!=typeof localStorage?function(t=/* @__PURE__ */new Date){const e=l(t);if(!e)return 0;try{const n=localStorage.getItem(s(t)),o=null===n?localStorage.getItem(`pomodoro-${e}`):null;return parseInt(n??o??"0",10)||0}catch{return 0}}():0},w=null,M=/* @__PURE__ */new Set,S=t=>{k={...k,...t},M.forEach(t=>t())};function b(){return k}function y(t){return M.add(t),()=>{M.delete(t)}}function v(t){u=t,k.running||k.remaining!==k.total||S({remaining:t[k.mode],total:t[k.mode]})}function T(t){d=t}function A(t,e){f=Math.max(0,Math.min(100,Math.round(t))),m=Math.max(1,Math.min(5,Math.round(e)))}function I(t){p={autoStartBreaks:!!t.autoStartBreaks,autoStartPomodoros:!!t.autoStartPomodoros,longBreakInterval:Math.max(1,Math.min(20,Math.round(t.longBreakInterval||4)))}}function x(t,e){h=t,g=Math.max(0,Math.min(100,Math.round(e))),k.running&&"focus"===k.mode?(F(),j()):"none"!==t&&0!==g||F()}function B(){k.running||(S({running:!0}),w=setInterval(D,1e3),"focus"===k.mode&&j())}function C(){(k.running||null!==w)&&(null!==w&&(clearInterval(w),w=null),S({running:!1}),F())}function N(t){C(),S({mode:t,remaining:u[t],total:u[t]})}function D(){k.remaining<=1?function(){null!==w&&(clearInterval(w),w=null);F(),P(d,{volume:f,repeat:m});const t="focus"===k.mode?"Pomodoro complete — time for a break! 🍅":"Break's over — back to work!";if("undefined"!=typeof Notification&&"granted"===Notification.permission)try{new Notification(t)}catch{}try{n.info(t)}catch{}if("focus"===k.mode){const t=k.streak+1,e=k.count+1;(t=>{try{l()&&localStorage.setItem(s(),String(t))}catch{}})(e);const n=t%p.longBreakInterval===0?"long":"short";S({running:!1,streak:t,count:e,mode:n,remaining:u[n],total:u[n]}),p.autoStartBreaks&&setTimeout(()=>B(),50)}else S({running:!1,mode:"focus",remaining:u.focus,total:u.focus}),p.autoStartPomodoros&&setTimeout(()=>B(),50)}():S({remaining:k.remaining-1})}function P(t=d,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(()=>_(t,n),2500*e)}function _(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 O=null,R={none:0,white:.3,pink:.3,brown:.3,"tick-fast":.6,"tick-slow":.6,rain:.4,fireplace:.5};function V(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 j(){if(!O&&"none"!==h&&0!==g)try{const t=window.AudioContext||window.webkitAudioContext;if(!t)return;const e=new t,n=V(e,h);if(!n){try{e.close()}catch{}return}const o=e.createBufferSource();o.buffer=n,o.loop=!0;const a=e.createGain();a.gain.value=g/100*R[h],o.connect(a).connect(e.destination),o.start(),O={ctx:e,src:o,gain:a}}catch{}}function F(){if(O){try{O.src.stop()}catch{}try{O.ctx.close()}catch{}O=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=V(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*R[t],r.connect(i).connect(o.destination),r.start(),setTimeout(()=>{try{r.stop()}catch{}try{o.close()}catch{}},3e3)}catch{}}var K="pomodoro_tasks",E="pomodoro_tasks_migrated";function H(){return Math.random().toString(36).slice(2,11)}function L(){/* @__PURE__ */
2
- return(new Date).toISOString()}var W=null,X=[],$=!1,q=null,J=/* @__PURE__ */new Set;function Q(){for(const t of J)t()}function z(t){X=t,Q()}function U(){const t=W;return t?q=t.list().then(e=>{W===t&&(X=e,$=!0,Q())}).catch(()=>{W===t&&($=!0,Q())}).finally(()=>{q=null}):(X=[],$=!0,Q(),Promise.resolve())}function Y(t){W=t,X=[],$=!1,t?U():Q()}function Z(t){return J.add(t),!W||$||q||U(),()=>{J.delete(t)}}function tt(){return X}function et(){const t=function(){const{prefs:t,save:n}=e(),o=r(()=>{const e=t.todo_tasks;return Array.isArray(e)?e:[]},[t.todo_tasks]),i=a(t=>{n({todo_tasks:t})},[n]),c=a(t=>{const e=H(),n=L(),a={done:!1,...t,name:t.name.trim(),id:e,createdAt:n,updatedAt:n};return i([...o,a]),e},[o,i]),l=a((t,e)=>{i(o.map(n=>n.id===t?{...n,...e,id:n.id,updatedAt:L()}:n))},[o,i]),s=a(t=>{i(o.filter(e=>e.id!==t))},[o,i]),u=a(t=>{const e=o.find(e=>e.id===t);e&&l(t,{done:!e.done})},[o,l]);return{tasks:o,addTask:c,updateTask:l,removeTask:s,toggleDone:u,setAllTasks:i}}(),n=o(Z,tt,tt),i=a(e=>{const n=W;if(!n)return t.addTask(e);const o="tmp-"+H(),a=L(),r={done:!1,...e,name:e.name.trim(),id:o,createdAt:a,updatedAt:a};return z([...X,r]),n.create({...e,name:e.name.trim()}).then(t=>z(X.map(e=>e.id===o?{...r,...t}:e))).catch(()=>z(X.filter(t=>t.id!==o))),o},[t]),c=a((e,n)=>{const o=W;if(!o)return t.updateTask(e,n);z(X.map(t=>t.id===e?{...t,...n,id:e,updatedAt:L()}:t)),o.update(e,n).catch(()=>{U()})},[t]),l=a(e=>{const n=W;if(!n)return t.removeTask(e);const o=X;z(X.filter(t=>t.id!==e)),n.remove(e).catch(()=>z(o))},[t]),s=a(e=>{if(!W)return t.toggleDone(e);const n=X.find(t=>t.id===e);n&&c(e,{done:!n.done})},[t,c]),u=a(e=>{W||t.setAllTasks(e)},[t]);return null===W?t:{tasks:n,addTask:i,updateTask:c,removeTask:l,toggleDone:s,setAllTasks:u}}function nt(t,e){try{if(localStorage.getItem(E))return;const n=localStorage.getItem(K);if(!n)return void localStorage.setItem(E,"1");const o=JSON.parse(n);if(!Array.isArray(o)||0===o.length)return localStorage.removeItem(K),void localStorage.setItem(E,"1");const a=L(),r=o.filter(t=>"string"==typeof t?.name).map(t=>({id:t.id||H(),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(E,"1")}catch{try{localStorage.setItem(E,"1")}catch{}}}export{i as ALARM_OPTIONS,c as FOCUS_SOUND_OPTIONS,b as getPomoSnapshot,nt as migratePomodoroTasksOnce,P as playAlarm,C as pomoPause,B as pomoStart,N as pomoSwitchMode,l as pomodoroToday,G as previewFocusSound,T as setPomoAlarm,A as setPomoAlarmConfig,I as setPomoBehaviour,v as setPomoDurations,x as setPomoFocusSound,Y as setShellTodoProvider,y as subscribePomo,et as useTodoTasks};
1
+ import{userToday as t}from"./chunk-NHKT5IH6.js";import{useShellPrefs as e}from"./chunk-DPFEQQQU.js";import{toast_default as n}from"./chunk-VQ35LXDC.js";import{useSyncExternalStore as o,useCallback as a,useMemo as r}from"react";var i=[{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"}],c=[{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"}];function l(e=/* @__PURE__ */new Date){return t(e)??""}function s(t=/* @__PURE__ */new Date){return`pomodoro-day-${l(t)}`}var u={focus:1500,short:300,long:900},d="bell",f=100,m=1,h="none",g=50,p={autoStartBreaks:!1,autoStartPomodoros:!1,longBreakInterval:4},k={running:!1,remaining:u.focus,mode:"focus",total:u.focus,streak:0,count:"undefined"!=typeof localStorage?function(t=/* @__PURE__ */new Date){const e=l(t);if(!e)return 0;try{const n=localStorage.getItem(s(t)),o=null===n?localStorage.getItem(`pomodoro-${e}`):null;return parseInt(n??o??"0",10)||0}catch{return 0}}():0},w=null,M=/* @__PURE__ */new Set,S=t=>{k={...k,...t},M.forEach(t=>t())};function b(){return k}function y(t){return M.add(t),()=>{M.delete(t)}}function v(t){u=t,k.running||k.remaining!==k.total||S({remaining:t[k.mode],total:t[k.mode]})}function T(t){d=t}function A(t,e){f=Math.max(0,Math.min(100,Math.round(t))),m=Math.max(1,Math.min(5,Math.round(e)))}function I(t){p={autoStartBreaks:!!t.autoStartBreaks,autoStartPomodoros:!!t.autoStartPomodoros,longBreakInterval:Math.max(1,Math.min(20,Math.round(t.longBreakInterval||4)))}}function x(t,e){h=t,g=Math.max(0,Math.min(100,Math.round(e))),k.running&&"focus"===k.mode?(V(),R()):"none"!==t&&0!==g||V()}function B(){k.running||(S({running:!0}),w=setInterval(N,1e3),"focus"===k.mode&&R())}function C(){(k.running||null!==w)&&(null!==w&&(clearInterval(w),w=null),S({running:!1}),V())}function D(t){C(),S({mode:t,remaining:u[t],total:u[t]})}function N(){k.remaining<=1?function(){null!==w&&(clearInterval(w),w=null);V(),P(d,{volume:f,repeat:m});const t="focus"===k.mode?"Pomodoro complete — time for a break! 🍅":"Break's over — back to work!";if("undefined"!=typeof Notification&&"granted"===Notification.permission)try{new Notification(t)}catch{}try{n.info(t)}catch{}if("focus"===k.mode){const t=k.streak+1,e=k.count+1;(t=>{try{l()&&localStorage.setItem(s(),String(t))}catch{}})(e);const n=t%p.longBreakInterval===0?"long":"short";S({running:!1,streak:t,count:e,mode:n,remaining:u[n],total:u[n]}),p.autoStartBreaks&&setTimeout(()=>B(),50)}else S({running:!1,mode:"focus",remaining:u.focus,total:u.focus}),p.autoStartPomodoros&&setTimeout(()=>B(),50)}():S({remaining:k.remaining-1})}function P(t=d,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(()=>_(t,n),2500*e)}function _(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 F=null,O={none:0,white:.3,pink:.3,brown:.3,"tick-fast":.6,"tick-slow":.6,rain:.4,fireplace:.5};function Q(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(!F&&"none"!==h&&0!==g)try{const t=window.AudioContext||window.webkitAudioContext;if(!t)return;const e=new t,n=Q(e,h);if(!n){try{e.close()}catch{}return}const o=e.createBufferSource();o.buffer=n,o.loop=!0;const a=e.createGain();a.gain.value=g/100*O[h],o.connect(a).connect(e.destination),o.start(),F={ctx:e,src:o,gain:a}}catch{}}function V(){if(F){try{F.src.stop()}catch{}try{F.ctx.close()}catch{}F=null}}function j(t,e){if("none"!==t&&0!==e)try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=Q(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*O[t],r.connect(i).connect(o.destination),r.start(),setTimeout(()=>{try{r.stop()}catch{}try{o.close()}catch{}},3e3)}catch{}}var G="pomodoro_tasks",E="pomodoro_tasks_migrated";function H(){return Math.random().toString(36).slice(2,11)}function L(){/* @__PURE__ */
2
+ return(new Date).toISOString()}var W=null,$=[],q=!1,J=null,K=/* @__PURE__ */new Set;function U(){for(const t of K)t()}function X(t){$=t,U()}function z(){const t=W;return t?J=t.list().then(e=>{W===t&&($=e,q=!0,U())}).catch(()=>{W===t&&(q=!0,U())}).finally(()=>{J=null}):($=[],q=!0,U(),Promise.resolve())}function Y(t){W=t,$=[],q=!1,t?z():U()}function Z(t){return K.add(t),!W||q||J||z(),()=>{K.delete(t)}}function tt(){return $}function et(){const t=function(){const{prefs:t,save:n}=e(),o=r(()=>{const e=t.todo_tasks;return Array.isArray(e)?e:[]},[t.todo_tasks]),i=a(t=>{n({todo_tasks:t})},[n]),c=a(t=>{const e=H(),n=L(),a={done:!1,...t,name:t.name.trim(),id:e,createdAt:n,updatedAt:n};return i([...o,a]),e},[o,i]),l=a((t,e)=>{i(o.map(n=>n.id===t?{...n,...e,id:n.id,updatedAt:L()}:n))},[o,i]),s=a(t=>{i(o.filter(e=>e.id!==t))},[o,i]),u=a(t=>{const e=o.find(e=>e.id===t);e&&l(t,{done:!e.done})},[o,l]);return{tasks:o,addTask:c,updateTask:l,removeTask:s,toggleDone:u,setAllTasks:i}}(),n=o(Z,tt,tt),i=a(e=>{const n=W;if(!n)return t.addTask(e);const o="tmp-"+H(),a=L(),r={done:!1,...e,name:e.name.trim(),id:o,createdAt:a,updatedAt:a};return X([...$,r]),n.create({...e,name:e.name.trim()}).then(t=>X($.map(e=>e.id===o?{...r,...t}:e))).catch(()=>X($.filter(t=>t.id!==o))),o},[t]),c=a((e,n)=>{const o=W;if(!o)return t.updateTask(e,n);X($.map(t=>t.id===e?{...t,...n,id:e,updatedAt:L()}:t)),o.update(e,n).catch(()=>{z()})},[t]),l=a(e=>{const n=W;if(!n)return t.removeTask(e);const o=$;X($.filter(t=>t.id!==e)),n.remove(e).catch(()=>X(o))},[t]),s=a(e=>{if(!W)return t.toggleDone(e);const n=$.find(t=>t.id===e);n&&c(e,{done:!n.done})},[t,c]),u=a(e=>{W||t.setAllTasks(e)},[t]);return null===W?t:{tasks:n,addTask:i,updateTask:c,removeTask:l,toggleDone:s,setAllTasks:u}}function nt(t,e){try{if(localStorage.getItem(E))return;const n=localStorage.getItem(G);if(!n)return void localStorage.setItem(E,"1");const o=JSON.parse(n);if(!Array.isArray(o)||0===o.length)return localStorage.removeItem(G),void localStorage.setItem(E,"1");const a=L(),r=o.filter(t=>"string"==typeof t?.name).map(t=>({id:t.id||H(),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(E,"1")}catch{try{localStorage.setItem(E,"1")}catch{}}}export{i as ALARM_OPTIONS,c as FOCUS_SOUND_OPTIONS,b as getPomoSnapshot,nt as migratePomodoroTasksOnce,P as playAlarm,C as pomoPause,B as pomoStart,D as pomoSwitchMode,l as pomodoroToday,j as previewFocusSound,T as setPomoAlarm,A as setPomoAlarmConfig,I as setPomoBehaviour,v as setPomoDurations,x as setPomoFocusSound,Y as setShellTodoProvider,y as subscribePomo,et as useTodoTasks};
@@ -1,8 +1,8 @@
1
- import{railLabelsShown as e}from"./chunk-FQEALPZJ.js";import{ChoiceContent as t,choiceItemClass as n,choiceTipClass as r,choiceTrackClass as o}from"./chunk-EFKJLUYP.js";import{Tooltip as l}from"./chunk-SOZCWT6I.js";import{useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{useRef as i,useState as c,useEffect as d}from"react";import{jsx as s,jsxs as u,Fragment as m}from"react/jsx-runtime";var b=(e,t)=>`flex items-center border-b border-gray-200${e?"":" gap-1"} ${t}`.trim();function f(e,t,n="default"){return`-mb-px inline-flex items-center gap-2 border-b-2 px-3 py-2 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${t?"flex-1 justify-center ":""}${e?"border-blue-600 text-blue-600":`border-transparent ${"warning"===n?"text-amber-700":"text-gray-900"} hover:border-gray-300`}`}function h(e){if(!e||!e.startsWith("#")||e.length<2)return null;try{return document.getElementById(decodeURIComponent(e.slice(1)))}catch{return null}}function p(e,t){const n=e.filter(e=>!e.disabled).map(e=>({id:e.id,section:h(e.href)})).filter(e=>null!=e.section);if(0===n.length)return null;const r=function(e){for(let t=e.parentElement;t;t=t.parentElement){const e=getComputedStyle(t).overflowY;if(("auto"===e||"scroll"===e)&&t.scrollHeight>t.clientHeight)return t}return document.scrollingElement??document.documentElement}(n[0].section);if(r.scrollTop>0&&r.scrollTop+r.clientHeight>=r.scrollHeight-1)return n[n.length-1].id;const o=Math.max(0,t.getBoundingClientRect().bottom)+8;let l=n[0].id;for(const e of n)e.section.getBoundingClientRect().top<=o&&(l=e.id);return l}function g({items:e,value:n,onChange:o,block:c=!1,className:u="","aria-label":m,"aria-labelledby":g}){const v=i(null),y=function(e,t,n,r){const o=i(0),l=i({items:t,value:n,onChange:r});l.current={items:t,value:n,onChange:r};const c=i(()=>{});return c.current=()=>{const t=e.current;if(!t||Date.now()<o.current)return;const n=p(l.current.items,t);null!=n&&n!==l.current.value&&l.current.onChange(n)},a(()=>{c.current()},[t]),d(()=>{let e=0;const t=()=>{e||(e=requestAnimationFrame(()=>{e=0,c.current()}))};return document.addEventListener("scroll",t,{capture:!0,passive:!0}),window.addEventListener("resize",t),()=>{document.removeEventListener("scroll",t,{capture:!0}),window.removeEventListener("resize",t),e&&cancelAnimationFrame(e)}},[]),e=>{o.current=Date.now()+800,e!==l.current.value&&l.current.onChange(e),window.setTimeout(()=>c.current(),850)}}(v,e,n,o);/* @__PURE__ */
2
- return s("nav",{ref:v,"aria-label":m,"aria-labelledby":g,className:b(c,u),children:e.map(e=>{const o=e.id===n,a=/* @__PURE__ */s("a",{href:e.disabled?void 0:e.href,"aria-current":o?"location":void 0,"aria-disabled":e.disabled||void 0,onClick:e.disabled?void 0:t=>((e,t)=>{const n=h(t.href);n&&(e=>!(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey))(e)&&(e.preventDefault(),y(t.id),n.scrollIntoView({block:"start",behavior:"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth"}),n.hasAttribute("tabindex")||n.setAttribute("tabindex","-1"),n.focus({preventScroll:!0}))})(t,e),className:`${f(o,c,"warning"===e.tone?"warning":"default")}${e.disabled?" cursor-not-allowed opacity-50":""}`,children:/* @__PURE__ */s(t,{icon:e.icon,label:e.label})},e.id);return null!=e.tooltip&&!1!==e.tooltip?/* @__PURE__ */s(l,{content:e.tooltip,className:c?r(c):void 0,children:a},e.id):a})})}var v=(e,t)=>`${e}-tab-${t}`,y=(e,t)=>`${e}-panel-${t}`;function w(e,t){const n=getComputedStyle(e),r=(parseFloat(n.paddingLeft)||0)+(parseFloat(n.paddingRight)||0)+(parseFloat(n.borderLeftWidth)||0)+(parseFloat(n.borderRightWidth)||0),o=(parseFloat(n.columnGap)||0)*Math.max(0,t-1),l=e.parentElement;let a=1/0;if(l){const e=getComputedStyle(l);a=l.clientWidth-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)}return{chrome:r+o,room:a}}function x(e){return e.items.some(e=>null!=e.href)?/* @__PURE__ */s(g,{...e}):/* @__PURE__ */s(k,{...e})}function k({items:h,value:p,onChange:g,variant:x="underline",block:k=!1,idPrefix:F,className:E="","aria-label":L,"aria-labelledby":N,labelsFit:R=!1,dotLabel:A="Has a setting"}){const $=i([]),S=i(null),W="pill"===x,[D,H]=c(null),j=D??"none",z=i(()=>{});z.current=()=>{const t=S.current;if(!t||!R)return;const n=function(e){return[...e.querySelectorAll('[role="tab"]')].map(e=>{const t=getComputedStyle(e),n=(parseFloat(t.paddingLeft)||0)+(parseFloat(t.paddingRight)||0)+(parseFloat(t.borderLeftWidth)||0)+(parseFloat(t.borderRightWidth)||0),r=e.querySelector("[data-tab-glyph]")?.getBoundingClientRect().width??0,o=e.querySelector("[data-tab-word]")?.scrollWidth??0;return{bare:n+r,worded:n+r+(r&&o?8:0)+o,active:"true"===e.getAttribute("aria-selected")}})}(t);H(function({tabs:t,block:n,chrome:r,room:o}){if(!n)return e({buttons:t,orientation:"horizontal",chrome:r,room:o});if(0===t.length)return"none";const l=e=>r+e*t.length<=o+.5;if(l(Math.max(...t.map(e=>e.worded))))return"all";const a=t.find(e=>e.active);return a&&l(Math.max(a.worded,...t.map(e=>e.bare)))?"chosen":"none"}({tabs:n,block:k,...w(t,n.length)}))},a(()=>{z.current()}),d(()=>{const e=S.current?.parentElement;if(!R||!e)return;let t=!0;const n=()=>{t&&z.current()},r="undefined"==typeof ResizeObserver?void 0:ResizeObserver,o=r?new r(n):null;return o?.observe(e),document.fonts?.ready.then(n,()=>{}),()=>{t=!1,o?.disconnect()}},[R]);const I=(e,t)=>{for(let n=1;n<=h.length;n+=1){const r=((e+t*n)%h.length+h.length)%h.length;if(!h[r]?.disabled)return r}return null},K=e=>{const t=1===e?h.map((e,t)=>t):h.map((e,t)=>h.length-1-t);for(const e of t)if(!h[e]?.disabled)return e;return null};/* @__PURE__ */
3
- return s("div",{ref:S,role:"tablist","data-labels-shown":R?j:void 0,"aria-label":L,"aria-labelledby":N,onKeyDown:e=>{const t=h.findIndex(e=>e.id===p);let n=null;if("ArrowRight"===e.key||"ArrowDown"===e.key)n=I(t,1);else if("ArrowLeft"===e.key||"ArrowUp"===e.key)n=I(t,-1);else if("Home"===e.key)n=K(1);else{if("End"!==e.key)return;n=K(-1)}e.preventDefault(),null!==n&&n!==t&&(g(h[n].id),$.current[n]?.focus())},className:W?o(k,E):b(k,E),children:h.map((e,o)=>{const a=e.id===p,i=R&&null!=e.icon,c="all"===j||"chosen"===j&&a,d=e.dot?/* @__PURE__ */s(C,{label:e.label,on:a,said:A}):e.label,b=/* @__PURE__ */s("button",{ref:e=>{$.current[o]=e},type:"button",role:"tab",id:F?v(F,e.id):void 0,"aria-controls":F?y(F,e.id):void 0,"aria-selected":a,tabIndex:a?0:-1,disabled:e.disabled,onClick:()=>g(e.id),className:W?n({selected:a,disabled:e.disabled,block:k}):f(a,k,"warning"===e.tone?"warning":"default"),children:i?/* @__PURE__ */u(m,{children:[
1
+ import{railLabelsShown as e}from"./chunk-FQEALPZJ.js";import{ChoiceContent as t,choiceItemClass as n,choiceTipClass as r,choiceTrackClass as o}from"./chunk-EFKJLUYP.js";import{Tooltip as l}from"./chunk-F2RAIGCG.js";import{useBrowserLayoutEffect as a}from"./chunk-ZDXRSY2Y.js";import{useRef as i,useState as c,useEffect as d}from"react";import{jsx as s,jsxs as u,Fragment as m}from"react/jsx-runtime";var b=(e,t)=>`flex items-center border-b border-gray-200${e?"":" gap-1"} ${t}`.trim();function f(e,t,n="default"){return`-mb-px inline-flex items-center gap-2 border-b-2 px-3 py-2 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${t?"flex-1 justify-center ":""}${e?"border-blue-600 text-blue-600":`border-transparent ${"warning"===n?"text-amber-700":"text-gray-900"} hover:border-gray-300`}`}function h(e){if(!e||!e.startsWith("#")||e.length<2)return null;try{return document.getElementById(decodeURIComponent(e.slice(1)))}catch{return null}}function p(e,t){const n=e.filter(e=>!e.disabled).map(e=>({id:e.id,section:h(e.href)})).filter(e=>null!=e.section);if(0===n.length)return null;const r=function(e){for(let t=e.parentElement;t;t=t.parentElement){const e=getComputedStyle(t).overflowY;if(("auto"===e||"scroll"===e)&&t.scrollHeight>t.clientHeight)return t}return document.scrollingElement??document.documentElement}(n[0].section);if(r.scrollTop>0&&r.scrollTop+r.clientHeight>=r.scrollHeight-1)return n[n.length-1].id;const o=Math.max(0,t.getBoundingClientRect().bottom)+8;let l=n[0].id;for(const e of n)e.section.getBoundingClientRect().top<=o&&(l=e.id);return l}function g({items:e,value:n,onChange:o,block:c=!1,className:u="","aria-label":m,"aria-labelledby":g}){const v=i(null),y=function(e,t,n,r){const o=i(0),l=i({items:t,value:n,onChange:r});l.current={items:t,value:n,onChange:r};const c=i(()=>{});return c.current=()=>{const t=e.current;if(!t||Date.now()<o.current)return;const n=p(l.current.items,t);null!=n&&n!==l.current.value&&l.current.onChange(n)},a(()=>{c.current()},[t]),d(()=>{let e=0;const t=()=>{e||(e=requestAnimationFrame(()=>{e=0,c.current()}))};return document.addEventListener("scroll",t,{capture:!0,passive:!0}),window.addEventListener("resize",t),()=>{document.removeEventListener("scroll",t,{capture:!0}),window.removeEventListener("resize",t),e&&cancelAnimationFrame(e)}},[]),e=>{o.current=Date.now()+800,e!==l.current.value&&l.current.onChange(e),window.setTimeout(()=>c.current(),850)}}(v,e,n,o);/* @__PURE__ */
2
+ return s("nav",{ref:v,"aria-label":m,"aria-labelledby":g,className:b(c,u),children:e.map(e=>{const o=e.id===n,a=/* @__PURE__ */s("a",{href:e.disabled?void 0:e.href,"aria-current":o?"location":void 0,"aria-disabled":e.disabled||void 0,onClick:e.disabled?void 0:t=>((e,t)=>{const n=h(t.href);n&&(e=>!(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey))(e)&&(e.preventDefault(),y(t.id),n.scrollIntoView({block:"start",behavior:"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth"}),n.hasAttribute("tabindex")||n.setAttribute("tabindex","-1"),n.focus({preventScroll:!0}))})(t,e),className:`${f(o,c,"warning"===e.tone?"warning":"default")}${e.disabled?" cursor-not-allowed opacity-50":""}`,children:/* @__PURE__ */s(t,{icon:e.icon,label:e.label})},e.id);return null!=e.tooltip&&!1!==e.tooltip?/* @__PURE__ */s(l,{content:e.tooltip,className:c?r(c):void 0,children:a},e.id):a})})}var v=(e,t)=>`${e}-tab-${t}`,y=(e,t)=>`${e}-panel-${t}`;function w(e,t){const n=getComputedStyle(e),r=(parseFloat(n.paddingLeft)||0)+(parseFloat(n.paddingRight)||0)+(parseFloat(n.borderLeftWidth)||0)+(parseFloat(n.borderRightWidth)||0),o=(parseFloat(n.columnGap)||0)*Math.max(0,t-1),l=e.parentElement;let a=1/0;if(l){const e=getComputedStyle(l);a=l.clientWidth-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)}return{chrome:r+o,room:a}}function x(e){return e.items.some(e=>null!=e.href)?/* @__PURE__ */s(g,{...e}):/* @__PURE__ */s(k,{...e})}function k({items:h,value:p,onChange:g,variant:x="underline",block:k=!1,idPrefix:F,className:E="","aria-label":R,"aria-labelledby":L,labelsFit:N=!1,dotLabel:A="Has a setting"}){const $=i([]),S=i(null),D="pill"===x,[W,j]=c(null),z=W??"none",H=i(()=>{});H.current=()=>{const t=S.current;if(!t||!N)return;const n=function(e){return[...e.querySelectorAll('[role="tab"]')].map(e=>{const t=getComputedStyle(e),n=(parseFloat(t.paddingLeft)||0)+(parseFloat(t.paddingRight)||0)+(parseFloat(t.borderLeftWidth)||0)+(parseFloat(t.borderRightWidth)||0),r=e.querySelector("[data-tab-glyph]")?.getBoundingClientRect().width??0,o=e.querySelector("[data-tab-word]")?.scrollWidth??0;return{bare:n+r,worded:n+r+(r&&o?8:0)+o,active:"true"===e.getAttribute("aria-selected")}})}(t);j(function({tabs:t,block:n,chrome:r,room:o}){if(!n)return e({buttons:t,orientation:"horizontal",chrome:r,room:o});if(0===t.length)return"none";const l=e=>r+e*t.length<=o+.5;if(l(Math.max(...t.map(e=>e.worded))))return"all";const a=t.find(e=>e.active);return a&&l(Math.max(a.worded,...t.map(e=>e.bare)))?"chosen":"none"}({tabs:n,block:k,...w(t,n.length)}))},a(()=>{H.current()}),d(()=>{const e=S.current?.parentElement;if(!N||!e)return;let t=!0;const n=()=>{t&&H.current()},r="undefined"==typeof ResizeObserver?void 0:ResizeObserver,o=r?new r(n):null;return o?.observe(e),document.fonts?.ready.then(n,()=>{}),()=>{t=!1,o?.disconnect()}},[N]);const I=(e,t)=>{for(let n=1;n<=h.length;n+=1){const r=((e+t*n)%h.length+h.length)%h.length;if(!h[r]?.disabled)return r}return null},K=e=>{const t=1===e?h.map((e,t)=>t):h.map((e,t)=>h.length-1-t);for(const e of t)if(!h[e]?.disabled)return e;return null};/* @__PURE__ */
3
+ return s("div",{ref:S,role:"tablist","data-labels-shown":N?z:void 0,"aria-label":R,"aria-labelledby":L,onKeyDown:e=>{const t=h.findIndex(e=>e.id===p);let n=null;if("ArrowRight"===e.key||"ArrowDown"===e.key)n=I(t,1);else if("ArrowLeft"===e.key||"ArrowUp"===e.key)n=I(t,-1);else if("Home"===e.key)n=K(1);else{if("End"!==e.key)return;n=K(-1)}e.preventDefault(),null!==n&&n!==t&&(g(h[n].id),$.current[n]?.focus())},className:D?o(k,E):b(k,E),children:h.map((e,o)=>{const a=e.id===p,i=N&&null!=e.icon,c="all"===z||"chosen"===z&&a,d=e.dot?/* @__PURE__ */s(C,{label:e.label,on:a,said:A}):e.label,b=/* @__PURE__ */s("button",{ref:e=>{$.current[o]=e},type:"button",role:"tab",id:F?v(F,e.id):void 0,"aria-controls":F?y(F,e.id):void 0,"aria-selected":a,tabIndex:a?0:-1,disabled:e.disabled,onClick:()=>g(e.id),className:D?n({selected:a,disabled:e.disabled,block:k}):f(a,k,"warning"===e.tone?"warning":"default"),children:i?/* @__PURE__ */u(m,{children:[
4
4
  /* @__PURE__ */s("span",{"aria-hidden":"true","data-tab-glyph":"",className:"inline-flex shrink-0",children:e.icon}),
5
- /* @__PURE__ */s("span",{"data-tab-word":c?"shown":"hidden",className:c?"whitespace-nowrap":"sr-only",children:d})]}):/* @__PURE__ */s(t,{icon:e.icon,label:d})},e.id),h=i?e.tooltip??e.label:e.tooltip;return null!=h&&!1!==h?/* @__PURE__ */s(l,{content:h,className:W||k?r(k):void 0,children:b},e.id):b})})}function C({label:e,on:t,said:n}){/* @__PURE__ */
5
+ /* @__PURE__ */s("span",{"data-tab-word":c?"shown":"hidden",className:c?"whitespace-nowrap":"sr-only",children:d})]}):/* @__PURE__ */s(t,{icon:e.icon,label:d})},e.id),h=i?e.tooltip??e.label:e.tooltip;return null!=h&&!1!==h?/* @__PURE__ */s(l,{content:h,className:D||k?r(k):void 0,children:b},e.id):b})})}function C({label:e,on:t,said:n}){/* @__PURE__ */
6
6
  return u("span",{className:"inline-flex items-center gap-(--space-4)",children:[e,
7
7
  /* @__PURE__ */s("span",{"aria-hidden":"true","data-tab-dot":t?"on":"off",className:"size-2 shrink-0 rounded-full "+(t?"bg-current":"bg-accent-fill")}),
8
8
  /* @__PURE__ */s("span",{className:"sr-only",children:n})]})}export{x as Tabs,v as tabButtonId,y as tabPanelId};
@@ -1,11 +1,11 @@
1
- import{ImageFocusPoint as e}from"./chunk-5POQCJL6.js";import{FormField as i}from"./chunk-6KBDNYRW.js";import{Segmented as a}from"./chunk-HNIIDDLJ.js";import{isVideoUrl as t,mediaPromptLine as r,mediaFileName as o,FilenameBadge as n,BusyOverlay as s,UploadGlyph as l,zoneFocusClass as c,dropzoneClass as d}from"./chunk-G4PPHQ23.js";import{TransferProgress as u}from"./chunk-6LS6Q77E.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-VFSAJMNX.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{useShellStrings as b}from"./chunk-IUVGHHR3.js";import{useState as f,useRef as g,useEffect as v,useId as y}from"react";import{jsxs as k,jsx as x,Fragment as j}from"react/jsx-runtime";var N=["flex h-8 items-center justify-center rounded-(--radius-control) text-(--status-on-solid)","not-disabled:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-60","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"].join(" ");function w({value:w,onChange:L,onPick:R,onFile:C,label:P,hint:$,error:F,required:U,className:z,accept:H="image/*",maxSizeBytes:O,fit:I="cover",height:S,shape:q="rect",placeholder:D,cta:V,acceptHint:B,showFilename:J=!0,allowReplace:Q=!0,allowRemove:A=!0,replaceLabel:G,removeLabel:K,busy:W=!1,busyLabel:_,choosingLabel:E,pickFailedLabel:M,progress:X,disabled:Y=!1,kind:T,onKindChange:Z,focus:ee,onFocusChange:ie,focusLabel:ae}){const te=b().media,re="circle"===q,oe=S??(re?96:112),ne=V??te.cta,se=T??(/video/.test(H)&&!/image/.test(H)?"video":"image"),le="string"==typeof K&&K?K:te.remove,[ce,de]=f(!1),[ue,me]=f(!1),he=g(!0);v(()=>()=>{he.current=!1},[]);const pe=W||ce,be=ce&&!W?E??te.choosing:_??te.uploading,fe=F??(ue?M??te.pickFailed:void 0),ge=e=>{if(!R)return;me(!1);const i=R(e);i&&"function"==typeof i.then&&(de(!0),i.then(e=>{he.current&&(de(!1),"string"==typeof e&&e&&L(e))},()=>{he.current&&(de(!1),me(!0))}))},ve=y(),ye=g(null),[ke,xe]=f(null);v(()=>()=>{ye.current&&URL.revokeObjectURL(ye.current)},[]);const je=Y||pe,Ne=!!w&&(t(w,H)||w===ke),we=D??r(H,te),Le=G??(Ne||"video"===se?te.changeVideo:te.changeImage),Re=e=>{R?ge(e):C?C(e):(e=>{ye.current&&URL.revokeObjectURL(ye.current);const i=URL.createObjectURL(e);ye.current=i,xe(e.type.startsWith("video/")?i:null),L(i)})(e)},Ce=m({accept:H,maxSizeBytes:O,acceptHint:B,multiple:!1,disabled:je,onAccept:([e])=>Re(e)}),{dragOver:Pe}=Ce,$e=()=>{je||(R?ge():Ce.open())},Fe=w?o(w):"",Ue=!re&&!Ne&&!!ie,ze=Y||!Q&&!A?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:[re?"absolute inset-0 flex items-center justify-center gap-1 p-1 text-(--status-on-solid)":"absolute inset-x-0 bottom-0 flex items-center gap-1 p-1 text-(--status-on-solid)","opacity-0 transition-opacity duration-(--motion-fast)","group-hover/media:opacity-100 group-focus-within/media:opacity-100 [@media(hover:none)]:opacity-100"].join(" "),style:{background:"var(--rosh-media-scrim-button)"},children:[Q&&/* @__PURE__ */k("button",{id:Ue?void 0:ve,type:"button","aria-labelledby":`${ve}-change`,onClick:()=>$e(),disabled:pe,className:re?`w-8 shrink-0 ${N}`:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${N}`,children:[
1
+ import{ImageFocusPoint as e}from"./chunk-5POQCJL6.js";import{FormField as i}from"./chunk-6KBDNYRW.js";import{Segmented as a}from"./chunk-TNALBYLY.js";import{isVideoUrl as t,mediaPromptLine as r,mediaFileName as o,FilenameBadge as n,BusyOverlay as s,UploadGlyph as l,zoneFocusClass as c,dropzoneClass as d}from"./chunk-YWMCW5BN.js";import{TransferProgress as u}from"./chunk-GUSENWAH.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-VFSAJMNX.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{useShellStrings as b}from"./chunk-IUVGHHR3.js";import{useState as f,useRef as g,useEffect as v,useId as y}from"react";import{jsxs as k,jsx as x,Fragment as N}from"react/jsx-runtime";var j=["flex h-8 items-center justify-center rounded-(--radius-control) text-(--status-on-solid)","not-disabled:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-60","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"].join(" ");function w({value:w,onChange:L,onPick:R,onFile:C,label:U,hint:$,error:F,required:z,className:P,accept:O="image/*",maxSizeBytes:H,fit:S="cover",height:B,shape:W="rect",placeholder:q,cta:A,acceptHint:I,showFilename:V=!0,allowReplace:Y=!0,allowRemove:D=!0,replaceLabel:G,removeLabel:J,busy:K=!1,busyLabel:M,choosingLabel:_,pickFailedLabel:E,progress:Q,disabled:T=!1,kind:X,onKindChange:Z,focus:ee,onFocusChange:ie,focusLabel:ae}){const te=b().media,re="circle"===W,oe=B??(re?96:112),ne=A??te.cta,se=X??(/video/.test(O)&&!/image/.test(O)?"video":"image"),le="string"==typeof J&&J?J:te.remove,[ce,de]=f(!1),[ue,me]=f(!1),he=g(!0);v(()=>()=>{he.current=!1},[]);const pe=K||ce,be=ce&&!K?_??te.choosing:M??te.uploading,fe=F??(ue?E??te.pickFailed:void 0),ge=e=>{if(!R)return;me(!1);const i=R(e);i&&"function"==typeof i.then&&(de(!0),i.then(e=>{he.current&&(de(!1),"string"==typeof e&&e&&L(e))},()=>{he.current&&(de(!1),me(!0))}))},ve=y(),ye=g(null),[ke,xe]=f(null);v(()=>()=>{ye.current&&URL.revokeObjectURL(ye.current)},[]);const Ne=T||pe,je=!!w&&(t(w,O)||w===ke),we=q??r(O,te),Le=G??(je||"video"===se?te.changeVideo:te.changeImage),Re=e=>{R?ge(e):C?C(e):(e=>{ye.current&&URL.revokeObjectURL(ye.current);const i=URL.createObjectURL(e);ye.current=i,xe(e.type.startsWith("video/")?i:null),L(i)})(e)},Ce=m({accept:O,maxSizeBytes:H,acceptHint:I,multiple:!1,disabled:Ne,onAccept:([e])=>Re(e)}),{dragOver:Ue}=Ce,$e=()=>{Ne||(R?ge():Ce.open())},Fe=w?o(w):"",ze=!re&&!je&&!!ie,Pe=T||!Y&&!D?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:[re?"absolute inset-0 flex items-center justify-center gap-1 p-1 text-(--status-on-solid)":"absolute inset-x-0 bottom-0 flex items-center gap-1 p-1 text-(--status-on-solid)","opacity-0 transition-opacity duration-(--motion-fast)","group-hover/media:opacity-100 group-focus-within/media:opacity-100 [@media(hover:none)]:opacity-100"].join(" "),style:{background:"var(--rosh-media-scrim-button)"},children:[Y&&/* @__PURE__ */k("button",{id:ze?void 0:ve,type:"button","aria-labelledby":`${ve}-change`,onClick:()=>$e(),disabled:pe,className:re?`w-8 shrink-0 ${j}`:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${j}`,children:[
2
2
  /* @__PURE__ */x(p,{name:"swap","aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
3
- /* @__PURE__ */x("span",{id:`${ve}-change`,className:re?"sr-only":"truncate",children:Le})]}),A&&/* @__PURE__ */x("button",{type:"button","aria-label":le,onClick:()=>{ye.current&&(URL.revokeObjectURL(ye.current),ye.current=null),xe(null),L("")},disabled:pe,className:`${re?"":"ml-auto "}w-8 shrink-0 ${N}`,children:/* @__PURE__ */x(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),He=/* @__PURE__ */k("div",{...Ce.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden border transition-colors",re?"shrink-0 rounded-full":"rounded-(--radius-control)",Ue?"":"bg-gray-100",Pe?"border-blue-500":"border-line"].join(" "),style:Ue?void 0:re?{height:oe,width:oe}:{height:oe},children:[Ue?
4
- /* @__PURE__ */x(e,{value:ee??"",onChange:e=>ie?.(e),label:ae??te.focus,image:w,hint:null,id:ve,disabled:je,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):Ne?/* @__PURE__ */x("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Fe||void 0,className:"h-full w-full",style:{objectFit:I}}):/* @__PURE__ */x("img",{src:w??void 0,alt:Fe,className:"h-full w-full",style:{objectFit:I,objectPosition:ee||void 0}}),J&&!re&&w&&/* @__PURE__ */x(n,{children:Fe}),ze,pe&&/* @__PURE__ */x(s,{label:be,progress:X,rounded:re?"rounded-full":"rounded-md"})]}),Oe=/* @__PURE__ */k(j,{children:[
3
+ /* @__PURE__ */x("span",{id:`${ve}-change`,className:re?"sr-only":"truncate",children:Le})]}),D&&/* @__PURE__ */x("button",{type:"button","aria-label":le,onClick:()=>{ye.current&&(URL.revokeObjectURL(ye.current),ye.current=null),xe(null),L("")},disabled:pe,className:`${re?"":"ml-auto "}w-8 shrink-0 ${j}`,children:/* @__PURE__ */x(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Oe=/* @__PURE__ */k("div",{...Ce.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden border transition-colors",re?"shrink-0 rounded-full":"rounded-(--radius-control)",ze?"":"bg-gray-100",Ue?"border-blue-500":"border-line"].join(" "),style:ze?void 0:re?{height:oe,width:oe}:{height:oe},children:[ze?
4
+ /* @__PURE__ */x(e,{value:ee??"",onChange:e=>ie?.(e),label:ae??te.focus,image:w,hint:null,id:ve,disabled:Ne,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):je?/* @__PURE__ */x("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Fe||void 0,className:"h-full w-full",style:{objectFit:S}}):/* @__PURE__ */x("img",{src:w??void 0,alt:Fe,className:"h-full w-full",style:{objectFit:S,objectPosition:ee||void 0}}),V&&!re&&w&&/* @__PURE__ */x(n,{children:Fe}),Pe,pe&&/* @__PURE__ */x(s,{label:be,progress:Q,rounded:re?"rounded-full":"rounded-md"})]}),He=/* @__PURE__ */k(N,{children:[
5
5
  /* @__PURE__ */x("span",{className:"px-3 text-xs text-ink-faint",children:we}),
6
- /* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:ne}),B&&/* @__PURE__ */x("span",{className:"text-xs text-ink-faintest",children:B})]}),Ie=/* @__PURE__ */k("button",{type:"button",id:ve,onClick:()=>$e(),disabled:je,"aria-label":"string"==typeof we?we:te.upload,"aria-busy":pe||void 0,"aria-invalid":!!fe||void 0,"aria-required":U||void 0,"aria-describedby":fe?`${ve}-error`:$?`${ve}-hint`:void 0,...Ce.zoneProps,"data-media-circle":"",className:["group/zone flex w-full items-center gap-4 rounded-lg text-left",je?"cursor-not-allowed opacity-60":"cursor-pointer",c(je)].join(" "),children:[
7
- /* @__PURE__ */x("span",{className:["flex shrink-0 items-center justify-center rounded-full border-2 border-dashed text-ink-faintest transition-colors",Pe?"border-accent-fill bg-accent-tint":"border-line-strong bg-surface-sunken group-hover/zone:bg-accent-tint"].join(" "),style:{height:oe,width:oe},children:/* @__PURE__ */x(l,{})}),
8
- /* @__PURE__ */x("span",{className:"flex min-w-0 flex-col items-start gap-1 [&>span]:px-0",children:pe?/* @__PURE__ */x(u,{state:"busy",verb:be,pct:X}):Oe})]}),Se=re?Ie:/* @__PURE__ */x("button",{type:"button",id:ve,onClick:()=>$e(),disabled:je,"aria-label":"string"==typeof we?we:te.upload,"aria-busy":pe||void 0,"aria-invalid":!!fe||void 0,"aria-required":U||void 0,"aria-describedby":fe?`${ve}-error`:$?`${ve}-hint`:void 0,...Ce.zoneProps,className:d(Pe,je,c(je)),style:{minHeight:oe},children:pe?/* @__PURE__ */x(u,{state:"busy",verb:be,pct:X}):/* @__PURE__ */k(j,{children:[
9
- /* @__PURE__ */x("span",{className:"text-ink-faintest",children:/* @__PURE__ */x(l,{})}),Oe]})});/* @__PURE__ */
10
- return k(i,{label:P,htmlFor:ve,hint:$,error:fe,required:U,className:z,children:[Z&&/* @__PURE__ */x("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */x(a,{value:se,onChange:e=>Z(e),options:[{value:"image",label:te.image,icon:/* @__PURE__ */x(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:je},{value:"video",label:te.video,icon:/* @__PURE__ */x(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:je}],block:!0,size:"md",label:"string"==typeof P&&P?P:te.upload})}),w?He:Se,!R&&/* @__PURE__ */x("input",{...Ce.inputProps}),
6
+ /* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:ne}),I&&/* @__PURE__ */x("span",{className:"text-xs text-ink-faintest",children:I})]}),Se=/* @__PURE__ */k("button",{type:"button",id:ve,onClick:()=>$e(),disabled:Ne,"aria-label":"string"==typeof we?we:te.upload,"aria-busy":pe||void 0,"aria-invalid":!!fe||void 0,"aria-required":z||void 0,"aria-describedby":fe?`${ve}-error`:$?`${ve}-hint`:void 0,...Ce.zoneProps,"data-media-circle":"",className:["group/zone flex w-full items-center gap-4 rounded-lg text-left",Ne?"cursor-not-allowed opacity-60":"cursor-pointer",c(Ne)].join(" "),children:[
7
+ /* @__PURE__ */x("span",{className:["flex shrink-0 items-center justify-center rounded-full border-2 border-dashed text-ink-faintest transition-colors",Ue?"border-accent-fill bg-accent-tint":"border-line-strong bg-surface-sunken group-hover/zone:bg-accent-tint"].join(" "),style:{height:oe,width:oe},children:/* @__PURE__ */x(l,{})}),
8
+ /* @__PURE__ */x("span",{className:"flex min-w-0 flex-col items-start gap-1 [&>span]:px-0",children:pe?/* @__PURE__ */x(u,{state:"busy",verb:be,pct:Q}):He})]}),Be=re?Se:/* @__PURE__ */x("button",{type:"button",id:ve,onClick:()=>$e(),disabled:Ne,"aria-label":"string"==typeof we?we:te.upload,"aria-busy":pe||void 0,"aria-invalid":!!fe||void 0,"aria-required":z||void 0,"aria-describedby":fe?`${ve}-error`:$?`${ve}-hint`:void 0,...Ce.zoneProps,className:d(Ue,Ne,c(Ne)),style:{minHeight:oe},children:pe?/* @__PURE__ */x(u,{state:"busy",verb:be,pct:Q}):/* @__PURE__ */k(N,{children:[
9
+ /* @__PURE__ */x("span",{className:"text-ink-faintest",children:/* @__PURE__ */x(l,{})}),He]})});/* @__PURE__ */
10
+ return k(i,{label:U,htmlFor:ve,hint:$,error:fe,required:z,className:P,children:[Z&&/* @__PURE__ */x("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */x(a,{value:se,onChange:e=>Z(e),options:[{value:"image",label:te.image,icon:/* @__PURE__ */x(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:Ne},{value:"video",label:te.video,icon:/* @__PURE__ */x(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:Ne}],block:!0,size:"md",label:"string"==typeof U&&U?U:te.upload})}),w?Oe:Be,!R&&/* @__PURE__ */x("input",{...Ce.inputProps}),
11
11
  /* @__PURE__ */x(h,{rejections:Ce.rejections})]})}export{w as MediaUploadField};
@@ -1,16 +1,16 @@
1
- import{useClickOutside as e}from"./chunk-SI26KESU.js";import{useColumnConfig as t}from"./chunk-U6DRRCCG.js";import{useShellAuth as r}from"./chunk-2QY5BJLA.js";import{useIsMobile as o}from"./chunk-UGTRSRIW.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{TH_ONE_LINE as n}from"./chunk-G67CJAQ2.js";import{shellHttp as a}from"./chunk-STKJA4PV.js";import{glassStyle as s}from"./chunk-5FYDNH4Y.js";import{useShellStrings as i}from"./chunk-IUVGHHR3.js";import{useState as c,useMemo as d,useRef as m,useCallback as h}from"react";import{jsxs as u,jsx as p}from"react/jsx-runtime";function f({tableId:f,columns:g,sort:x,onSort:y,footer:b,afterBody:v,saveDefaultPerms:k=["change_numberingconfig"],children:N}){const w=o(),[D,j]=c(!1),C=d(()=>w&&!D?g.filter(e=>"_select"!==e.key):g,[g,w,D]),{orderedColumns:S,allColumns:R,onResizeStart:_,onDragStart:z,onDragOver:I,onDrop:$,onDragEnd:G,toggleColumn:P,resetColumns:A,draggedIdx:L,dropGap:T}=t(f,C),{hasAnyPerm:U}=r(),E=i().columns,[H,J]=c(!1),[O,V]=c(!1),[W,Y]=c(!1),B=m(null),F=k.length>0&&U(k);e(B,h(()=>{H&&J(!1)},[H]));const K=S.reduce((e,t)=>e+t.width,0),Q=S.map(e=>`${e.width}px`),M={tableLayout:"fixed",width:K,minWidth:"100%"},q=m(null),X=h(e=>{const t=q.current;t&&(t.scrollLeft=e.currentTarget.scrollLeft)},[]),Z=d(()=>g.some(e=>"_select"===e.key),[g]);/* @__PURE__ */
1
+ import{useClickOutside as e}from"./chunk-SI26KESU.js";import{useColumnConfig as t}from"./chunk-C5OPAULN.js";import{useShellAuth as r}from"./chunk-2QY5BJLA.js";import{useIsMobile as o}from"./chunk-UGTRSRIW.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{TH_ONE_LINE as n}from"./chunk-TD3ZQD5R.js";import{shellHttp as a}from"./chunk-STKJA4PV.js";import{glassStyle as s}from"./chunk-5FYDNH4Y.js";import{useShellStrings as i}from"./chunk-IUVGHHR3.js";import{useState as c,useMemo as d,useRef as m,useCallback as h}from"react";import{jsxs as u,jsx as p}from"react/jsx-runtime";function f({tableId:f,columns:g,sort:x,onSort:y,footer:b,afterBody:v,saveDefaultPerms:k=["change_numberingconfig"],children:N}){const w=o(),[D,j]=c(!1),S=d(()=>w&&!D?g.filter(e=>"_select"!==e.key):g,[g,w,D]),{orderedColumns:C,allColumns:_,onResizeStart:z,onDragStart:R,onDragOver:I,onDrop:P,onDragEnd:$,toggleColumn:L,resetColumns:T,draggedIdx:A,dropGap:O}=t(f,S),{hasAnyPerm:U}=r(),E=i().columns,[G,H]=c(!1),[V,W]=c(!1),[Y,B]=c(!1),F=m(null),J=k.length>0&&U(k);e(F,h(()=>{G&&H(!1)},[G]));const K=C.reduce((e,t)=>e+t.width,0),Q=C.map(e=>`${e.width}px`),M={tableLayout:"fixed",width:K,minWidth:"100%"},Z=m(null),q=h(e=>{const t=Z.current;t&&(t.scrollLeft=e.currentTarget.scrollLeft)},[]),X=d(()=>g.some(e=>"_select"===e.key),[g]);/* @__PURE__ */
2
2
  return u("div",{className:"flex flex-col flex-1 min-h-0 "+(w?"-mx-4":""),children:[
3
- /* @__PURE__ */p("div",{ref:q,className:"shrink-0 overflow-x-hidden",children:/* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:M,children:[
4
- /* @__PURE__ */p("colgroup",{children:S.map((e,t)=>/* @__PURE__ */p("col",{style:{width:Q[t]}},e.key))}),
5
- /* @__PURE__ */p("thead",{className:"bg-gray-50",children:/* @__PURE__ */p("tr",{children:S.map((e,t)=>{const r=g.find(t=>t.key===e.key),o=r?.sortField??("_select"!==e.key?e.key:void 0),l=x&&o&&x.field===o,a="_select"===e.key;/* @__PURE__ */
6
- return u("th",{className:`${n} px-4 py-3 text-left text-xs font-medium text-ink-faint uppercase select-none relative ${L===t?"bg-accent-tint":""}`,draggable:!a,onDragStart:a?void 0:()=>z(t),onDragOver:a?void 0:e=>I(t,e),onDrop:a?void 0:e=>$(t,e),onDragEnd:a?void 0:G,style:a?void 0:{cursor:"grab"},children:[
7
- /* @__PURE__ */u("span",{className:`${a?"":"truncate pr-3"} block ${o&&y?"cursor-pointer hover:text-gray-700":""}`,onClick:o&&y?e=>{e.stopPropagation(),y(o)}:void 0,children:[e.headerNode??e.label,l&&/* @__PURE__ */p("span",{className:"ml-1",children:"asc"===x.direction?"▲":"▼"})]}),!a&&/* @__PURE__ */p("div",{className:"absolute right-0 top-0 bottom-0 w-4 cursor-col-resize flex items-center justify-center z-10",onMouseDown:e=>_(t,e),style:{marginRight:-8},children:/* @__PURE__ */p("div",{className:"w-0.5 h-full bg-gray-200 hover:bg-blue-500 transition-colors"})}),T===t&&/* @__PURE__ */p("div",{className:"absolute left-0 top-0 bottom-0 w-0.5 bg-blue-500 z-20 pointer-events-none"}),t===S.length-1&&T===S.length&&/* @__PURE__ */p("div",{className:"absolute right-0 top-0 bottom-0 w-0.5 bg-blue-500 z-20 pointer-events-none"})]},e.key)})})})]})}),
8
- /* @__PURE__ */u("div",{className:"flex-1 overflow-y-auto overflow-x-auto min-h-0",onScroll:X,children:[
3
+ /* @__PURE__ */p("div",{ref:Z,className:"shrink-0 overflow-x-hidden",children:/* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:M,children:[
4
+ /* @__PURE__ */p("colgroup",{children:C.map((e,t)=>/* @__PURE__ */p("col",{style:{width:Q[t]}},e.key))}),
5
+ /* @__PURE__ */p("thead",{className:"bg-gray-50",children:/* @__PURE__ */p("tr",{children:C.map((e,t)=>{const r=g.find(t=>t.key===e.key),o=r?.sortField??("_select"!==e.key?e.key:void 0),l=x&&o&&x.field===o,a="_select"===e.key;/* @__PURE__ */
6
+ return u("th",{className:`${n} px-4 py-3 text-left text-xs font-medium text-ink-faint uppercase select-none relative ${A===t?"bg-accent-tint":""}`,draggable:!a,onDragStart:a?void 0:()=>R(t),onDragOver:a?void 0:e=>I(t,e),onDrop:a?void 0:e=>P(t,e),onDragEnd:a?void 0:$,style:a?void 0:{cursor:"grab"},children:[
7
+ /* @__PURE__ */u("span",{className:`${a?"":"truncate pr-3"} block ${o&&y?"cursor-pointer hover:text-gray-700":""}`,onClick:o&&y?e=>{e.stopPropagation(),y(o)}:void 0,children:[e.headerNode??e.label,l&&/* @__PURE__ */p("span",{className:"ml-1",children:"asc"===x.direction?"▲":"▼"})]}),!a&&/* @__PURE__ */p("div",{className:"absolute right-0 top-0 bottom-0 w-4 cursor-col-resize flex items-center justify-center z-10",onMouseDown:e=>z(t,e),style:{marginRight:-8},children:/* @__PURE__ */p("div",{className:"w-0.5 h-full bg-gray-200 hover:bg-blue-500 transition-colors"})}),O===t&&/* @__PURE__ */p("div",{className:"absolute left-0 top-0 bottom-0 w-0.5 bg-blue-500 z-20 pointer-events-none"}),t===C.length-1&&O===C.length&&/* @__PURE__ */p("div",{className:"absolute right-0 top-0 bottom-0 w-0.5 bg-blue-500 z-20 pointer-events-none"})]},e.key)})})})]})}),
8
+ /* @__PURE__ */u("div",{className:"flex-1 overflow-y-auto overflow-x-auto min-h-0",onScroll:q,children:[
9
9
  /* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:M,children:[
10
- /* @__PURE__ */p("colgroup",{children:S.map((e,t)=>/* @__PURE__ */p("col",{style:{width:Q[t]}},e.key))}),N(S)]}),v]}),void 0!==b&&/* @__PURE__ */u("div",{className:"border-t border-gray-200 px-4 py-2 text-sm text-gray-500 shrink-0 flex items-center justify-between",children:[
10
+ /* @__PURE__ */p("colgroup",{children:C.map((e,t)=>/* @__PURE__ */p("col",{style:{width:Q[t]}},e.key))}),N(C)]}),v]}),void 0!==b&&/* @__PURE__ */u("div",{className:"border-t border-gray-200 px-4 py-2 text-sm text-gray-500 shrink-0 flex items-center justify-between",children:[
11
11
  /* @__PURE__ */p("span",{children:b}),
12
- /* @__PURE__ */u("div",{className:"flex items-center gap-3 relative",ref:B,children:[w&&Z&&/* @__PURE__ */p("button",{onClick:()=>j(e=>!e),className:"text-2xs px-2 py-0.5 rounded "+(D?"bg-accent-fill text-on-accent":"text-ink-faint hover:text-ink border border-line-strong"),title:D?E.hideSelection:E.showSelection,children:D?E.selectDone:E.select}),
13
- /* @__PURE__ */p("button",{onClick:A,className:"text-2xs text-ink-faintest hover:text-gray-600",children:E.reset}),
14
- /* @__PURE__ */p("button",{onClick:()=>J(!H),className:"text-gray-400 hover:text-gray-600",title:E.choose,children:/* @__PURE__ */p(l,{name:"adjust",className:"w-4 h-4",strokeWidth:"1.5"})}),H&&/* @__PURE__ */u("div",{className:"absolute bottom-full right-0 mb-1 w-52 rounded-(--radius-popup) z-(--z-popup) py-1 max-h-80 overflow-y-auto",style:s(),children:[
15
- /* @__PURE__ */p("p",{className:"px-3 py-2 text-3xs font-semibold text-ink-faintest uppercase",children:E.heading}),R.filter(e=>"_select"!==e.key).map(e=>/* @__PURE__ */u("label",{className:"flex items-center gap-2 px-3 py-1 text-sm text-gray-700 hover:bg-gray-50 cursor-pointer",children:[
16
- /* @__PURE__ */p("input",{type:"checkbox",checked:!e.hidden,onChange:()=>P(e.key),className:"h-3.5 w-3.5 rounded border-gray-300 text-blue-600"}),e.label]},e.key)),F&&/* @__PURE__ */p("div",{className:"border-t border-gray-100 mt-1 pt-1 px-3 pb-1",children:/* @__PURE__ */p("button",{onClick:async()=>{V(!0);const e=R.filter(e=>!e.hidden).map(e=>e.key),t=w?"mobile":"desktop",r={visible_columns:e};x&&(r.sort=x);try{await a.patch(`/auth/default-columns/${f}/`,r,{params:{viewport:t}}).catch(()=>a.post("/auth/default-columns/",{table_id:f,viewport:t,...r})),Y(!0),setTimeout(()=>Y(!1),2e3)}catch{}V(!1)},disabled:O,className:"text-2xs w-full text-center py-1 rounded "+(W?"text-green-600":"text-ink-faint hover:text-blue-600"),children:O?"...":W?E.savedDefault:E.saveDefault})})]})]})]})]})}export{f as ResizableTable};
12
+ /* @__PURE__ */u("div",{className:"flex items-center gap-3 relative",ref:F,children:[w&&X&&/* @__PURE__ */p("button",{onClick:()=>j(e=>!e),className:"text-2xs px-2 py-0.5 rounded "+(D?"bg-accent-fill text-on-accent":"text-ink-faint hover:text-ink border border-line-strong"),title:D?E.hideSelection:E.showSelection,children:D?E.selectDone:E.select}),
13
+ /* @__PURE__ */p("button",{onClick:T,className:"text-2xs text-ink-faintest hover:text-gray-600",children:E.reset}),
14
+ /* @__PURE__ */p("button",{onClick:()=>H(!G),className:"text-gray-400 hover:text-gray-600",title:E.choose,children:/* @__PURE__ */p(l,{name:"adjust",className:"w-4 h-4",strokeWidth:"1.5"})}),G&&/* @__PURE__ */u("div",{className:"absolute bottom-full right-0 mb-1 w-52 rounded-(--radius-popup) z-(--z-popup) py-1 max-h-80 overflow-y-auto",style:s(),children:[
15
+ /* @__PURE__ */p("p",{className:"px-3 py-2 text-3xs font-semibold text-ink-faintest uppercase",children:E.heading}),_.filter(e=>"_select"!==e.key).map(e=>/* @__PURE__ */u("label",{className:"flex items-center gap-2 px-3 py-1 text-sm text-gray-700 hover:bg-gray-50 cursor-pointer",children:[
16
+ /* @__PURE__ */p("input",{type:"checkbox",checked:!e.hidden,onChange:()=>L(e.key),className:"h-3.5 w-3.5 rounded border-gray-300 text-blue-600"}),e.label]},e.key)),J&&/* @__PURE__ */p("div",{className:"border-t border-gray-100 mt-1 pt-1 px-3 pb-1",children:/* @__PURE__ */p("button",{onClick:async()=>{W(!0);const e=_.filter(e=>!e.hidden).map(e=>e.key),t=w?"mobile":"desktop",r={visible_columns:e};x&&(r.sort=x);try{await a.patch(`/auth/default-columns/${f}/`,r,{params:{viewport:t}}).catch(()=>a.post("/auth/default-columns/",{table_id:f,viewport:t,...r})),B(!0),setTimeout(()=>B(!1),2e3)}catch{}W(!1)},disabled:V,className:"text-2xs w-full text-center py-1 rounded "+(Y?"text-green-600":"text-ink-faint hover:text-blue-600"),children:V?"...":Y?E.savedDefault:E.saveDefault})})]})]})]})]})}export{f as ResizableTable};
@@ -1 +1 @@
1
- import{loadIconSet as t,iconSetFor as e}from"./chunk-VQCKMT5F.js";import{hexToRgb as n}from"./chunk-S6OB6HJB.js";import{useShellPrefs as o}from"./chunk-KC3EX26K.js";import{setIconSet as c}from"./chunk-J75ZT2JQ.js";import{useSyncExternalStore as r,useEffect as s}from"react";function u(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}function m(t){const e=u();return e?(e.addEventListener("change",t),()=>e.removeEventListener("change",t)):()=>{}}function a(){return u()?.matches??!1}function l(){return!1}function i(t){const e=parseInt(t.slice(1,3),16)/255,n=parseInt(t.slice(3,5),16)/255,o=parseInt(t.slice(5,7),16)/255,c=Math.max(e,n,o),r=Math.min(e,n,o);let s=0,u=0;const m=(c+r)/2;if(c!==r){const t=c-r;u=m>.5?t/(2-c-r):t/(c+r),s=c===e?((n-o)/t+(n<o?6:0))/6:c===n?((o-e)/t+2)/6:((e-n)/t+4)/6}return[360*s,100*u,100*m]}function d(t,e,n){n/=100;const o=(e/=100)*Math.min(n,1-n),c=e=>{const c=(e+t/30)%12;return n-o*Math.max(Math.min(c-3,9-c,1),-1)},r=t=>Math.round(255*t).toString(16).padStart(2,"0");return`#${r(c(0))}${r(c(8))}${r(c(4))}`}function h(t){const e=t||"system";return"system"===e?a()?"dark":"light":e}function f(t){const e=document.documentElement;if(t&&/^#[0-9a-fA-F]{6}$/.test(t)){const[n,o,c]=i(t);e.setAttribute("data-custom-accent","true"),e.style.setProperty("--accent-600",t),e.style.setProperty("--accent-700",d(n,o,Math.max(c-10,5))),e.style.setProperty("--accent-500",d(n,o,Math.min(c+10,95))),e.style.setProperty("--accent-400",d(n,o,Math.min(c+20,95))),e.style.setProperty("--accent-300",d(n,Math.min(o+10,100),Math.min(c+30,92))),e.style.setProperty("--accent-200",d(n,Math.min(o+15,100),Math.min(c+38,94))),e.style.setProperty("--accent-100",d(n,Math.min(o+20,100),Math.min(c+42,96))),e.style.setProperty("--accent-50",d(n,Math.min(o+20,100),Math.min(c+46,98)))}else e.removeAttribute("data-custom-accent"),["--accent-600","--accent-700","--accent-500","--accent-400","--accent-300","--accent-200","--accent-100","--accent-50"].forEach(t=>e.style.removeProperty(t))}function y(t,e,o,c,r){const s=document.documentElement;if(t){const t=(t,e)=>{const o=n(e);o?s.style.setProperty(t,`${o.r} ${o.g} ${o.b}`):s.style.removeProperty(t)};if(e&&s.style.setProperty("--custom-bg-color",e),o&&(t("--window-header-rgb",o),t("--window-footer-rgb",o)),c&&t("--window-content-rgb",c),r){s.style.setProperty("--custom-button-color",r);const[t,e,n]=i(r);s.style.setProperty("--custom-button-hover",d(t,e,Math.max(n-10,5)))}}else["--custom-bg-color","--custom-button-color","--custom-button-hover"].forEach(t=>s.style.removeProperty(t))}var p=["square","soft","round"];function _(t){return"square"===t||"round"===t?t:"soft"}var b={pink:"round",grey:"square"};function M(t,e,n){return n?"square"===e||"round"===e?e:"soft":b[t]??"soft"}function g(t){const e=_(t);"soft"===e?document.documentElement.removeAttribute("data-corners"):document.documentElement.setAttribute("data-corners",e)}function v(e){const n="string"==typeof e&&e?e:null;c(n),n&&t(n),n?document.documentElement.setAttribute("data-icon-set",n):document.documentElement.removeAttribute("data-icon-set")}function w(t){const n=!!t.accent_color;"corners"in t&&g(M(h(t.theme),t.corners,n)),"icon_set"in t&&v(e(h(t.theme),t.icon_set,n)),document.documentElement.setAttribute("data-theme",h(t.theme)),f(t.accent_color??null),y(t.accent_color??null,t.custom_bg_color??null,t.custom_title_color??null,t.custom_window_color??null,t.custom_button_color??null)}function E(){const{prefs:t}=o(),n=r(m,a,l),c=t.theme||"system",u=t.accent_color||null,i=t.custom_bg_color||null,d=t.custom_title_color||null,h=t.custom_window_color||null,p=t.custom_button_color||null,_=t.corners,b="string"==typeof t.icon_set&&t.icon_set?t.icon_set:null,w="system"===c?n?"dark":"light":c,E=M(w,_,!!u);s(()=>(document.documentElement.setAttribute("data-theme",w),()=>document.documentElement.removeAttribute("data-theme")),[w]),s(()=>(g(E),()=>document.documentElement.removeAttribute("data-corners")),[E]);const P=e(w,b,!!u);return s(()=>(v(P),()=>v(null)),[P]),s(()=>{f(u)},[u]),s(()=>{y(u,i,d,h,p)},[u,i,d,h,p]),{theme:c,resolved:w,corners:E,iconSet:b}}export{p as CORNERS,b as CORNERS_FOR_THEME,g as applyCorners,v as applyIconSet,w as applyThemePrefs,M as cornersFor,_ as resolveCorners,h as resolveTheme,E as useTheme};
1
+ import{loadIconSet as t,iconSetFor as e}from"./chunk-VQCKMT5F.js";import{hexToRgb as n}from"./chunk-S6OB6HJB.js";import{useShellPrefs as o}from"./chunk-DPFEQQQU.js";import{setIconSet as c}from"./chunk-J75ZT2JQ.js";import{useSyncExternalStore as r,useEffect as s}from"react";function u(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}function m(t){const e=u();return e?(e.addEventListener("change",t),()=>e.removeEventListener("change",t)):()=>{}}function a(){return u()?.matches??!1}function l(){return!1}function i(t){const e=parseInt(t.slice(1,3),16)/255,n=parseInt(t.slice(3,5),16)/255,o=parseInt(t.slice(5,7),16)/255,c=Math.max(e,n,o),r=Math.min(e,n,o);let s=0,u=0;const m=(c+r)/2;if(c!==r){const t=c-r;u=m>.5?t/(2-c-r):t/(c+r),s=c===e?((n-o)/t+(n<o?6:0))/6:c===n?((o-e)/t+2)/6:((e-n)/t+4)/6}return[360*s,100*u,100*m]}function d(t,e,n){n/=100;const o=(e/=100)*Math.min(n,1-n),c=e=>{const c=(e+t/30)%12;return n-o*Math.max(Math.min(c-3,9-c,1),-1)},r=t=>Math.round(255*t).toString(16).padStart(2,"0");return`#${r(c(0))}${r(c(8))}${r(c(4))}`}function h(t){const e=t||"system";return"system"===e?a()?"dark":"light":e}function f(t){const e=document.documentElement;if(t&&/^#[0-9a-fA-F]{6}$/.test(t)){const[n,o,c]=i(t);e.setAttribute("data-custom-accent","true"),e.style.setProperty("--accent-600",t),e.style.setProperty("--accent-700",d(n,o,Math.max(c-10,5))),e.style.setProperty("--accent-500",d(n,o,Math.min(c+10,95))),e.style.setProperty("--accent-400",d(n,o,Math.min(c+20,95))),e.style.setProperty("--accent-300",d(n,Math.min(o+10,100),Math.min(c+30,92))),e.style.setProperty("--accent-200",d(n,Math.min(o+15,100),Math.min(c+38,94))),e.style.setProperty("--accent-100",d(n,Math.min(o+20,100),Math.min(c+42,96))),e.style.setProperty("--accent-50",d(n,Math.min(o+20,100),Math.min(c+46,98)))}else e.removeAttribute("data-custom-accent"),["--accent-600","--accent-700","--accent-500","--accent-400","--accent-300","--accent-200","--accent-100","--accent-50"].forEach(t=>e.style.removeProperty(t))}function y(t,e,o,c,r){const s=document.documentElement;if(t){const t=(t,e)=>{const o=n(e);o?s.style.setProperty(t,`${o.r} ${o.g} ${o.b}`):s.style.removeProperty(t)};if(e&&s.style.setProperty("--custom-bg-color",e),o&&(t("--window-header-rgb",o),t("--window-footer-rgb",o)),c&&t("--window-content-rgb",c),r){s.style.setProperty("--custom-button-color",r);const[t,e,n]=i(r);s.style.setProperty("--custom-button-hover",d(t,e,Math.max(n-10,5)))}}else["--custom-bg-color","--custom-button-color","--custom-button-hover"].forEach(t=>s.style.removeProperty(t))}var p=["square","soft","round"];function _(t){return"square"===t||"round"===t?t:"soft"}var b={pink:"round",grey:"square"};function M(t,e,n){return n?"square"===e||"round"===e?e:"soft":b[t]??"soft"}function g(t){const e=_(t);"soft"===e?document.documentElement.removeAttribute("data-corners"):document.documentElement.setAttribute("data-corners",e)}function v(e){const n="string"==typeof e&&e?e:null;c(n),n&&t(n),n?document.documentElement.setAttribute("data-icon-set",n):document.documentElement.removeAttribute("data-icon-set")}function w(t){const n=!!t.accent_color;"corners"in t&&g(M(h(t.theme),t.corners,n)),"icon_set"in t&&v(e(h(t.theme),t.icon_set,n)),document.documentElement.setAttribute("data-theme",h(t.theme)),f(t.accent_color??null),y(t.accent_color??null,t.custom_bg_color??null,t.custom_title_color??null,t.custom_window_color??null,t.custom_button_color??null)}function P(){const{prefs:t}=o(),n=r(m,a,l),c=t.theme||"system",u=t.accent_color||null,i=t.custom_bg_color||null,d=t.custom_title_color||null,h=t.custom_window_color||null,p=t.custom_button_color||null,_=t.corners,b="string"==typeof t.icon_set&&t.icon_set?t.icon_set:null,w="system"===c?n?"dark":"light":c,P=M(w,_,!!u);s(()=>(document.documentElement.setAttribute("data-theme",w),()=>document.documentElement.removeAttribute("data-theme")),[w]),s(()=>(g(P),()=>document.documentElement.removeAttribute("data-corners")),[P]);const E=e(w,b,!!u);return s(()=>(v(E),()=>v(null)),[E]),s(()=>{f(u)},[u]),s(()=>{y(u,i,d,h,p)},[u,i,d,h,p]),{theme:c,resolved:w,corners:P,iconSet:b}}export{p as CORNERS,b as CORNERS_FOR_THEME,g as applyCorners,v as applyIconSet,w as applyThemePrefs,M as cornersFor,_ as resolveCorners,h as resolveTheme,P as useTheme};
@@ -0,0 +1,14 @@
1
+ import{SearchableSelect as e}from"./chunk-G2JPTPRS.js";import{labelClasses as a}from"./chunk-EQKUFYX6.js";import{Select_default as l}from"./chunk-GEITUFYK.js";import{isSafeLinkHref as t}from"./chunk-Z5TE3MEG.js";import{Input_default as r}from"./chunk-3SIRRK3F.js";import{INPUT_SIZES as n}from"./chunk-AYZY3YNC.js";import{Button_default as i}from"./chunk-UTISUEO4.js";import{Icon as o}from"./chunk-ISVODSRP.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as u}from"./chunk-IUVGHHR3.js";import{useId as d,useRef as c,useState as p,useEffect as m}from"react";import{jsx as f,jsxs as v,Fragment as g}from"react/jsx-runtime";function h(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var b="address",x={kindOf:()=>b,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},k=e=>t(e.trim());function y(t){const{value:n,kinds:o,rules:y=x,filtersFor:w,label:N,readOnly:C,placeholder:F,className:O="",tidyAddress:j,addressAddon:E}=t,T=void 0!==t.onApply,U=u().link,$=y.isSafe??k,R=d(),S=c(null),z=c(null),[A,P]=p({url:n}),D=T?A.url:n,[I,K]=p(!1),[Y,G]=p(null),[H,M]=p(null),[V,W]=p(!1),B=c(null),L=c(()=>{});L.current=T?t.onCancel:()=>{},m(()=>{if(T)return s(e=>{const a=S.current;return!!("Escape"===e.key&&a&&e.target instanceof Node&&a.contains(e.target))&&(L.current(),!0)},()=>S.current)},[T]),m(()=>{if(!T)return;const e=z.current;e?(e.focus(),e.select()):S.current?.querySelector("button, input")?.focus()},[]);const Q=o??[{value:b,label:U.address,target:{type:"text"}}],Z=Y&&Y.against===D?Y.kind:y.kindOf(D),q=Q.filter(e=>!e.hideWhenEmpty||h(e.target).length>0||e.value===Z),J=q.find(e=>"text"===e.target.type),X=q.find(e=>e.value===Z)??J??q[0];if(!X)return null;const _="text"!==X.target.type,ee=_?y.targetOf(D):D,ae=h(X.target),le=ae.find(e=>e.value===ee),te=e=>({value:e,label:U.unavailable(e)}),re="select"===X.target.type&&ee&&w?w(ee):null,ne=re?y.readFilter(D):null,ie=ne?re?.find(e=>e.param===ne.param):void 0,oe=H&&H.against===D?H.text:D,se=_?D:j?j(oe.trim()).trim():oe.trim(),ue=T&&j?se:oe,de=!_&&""!==ue.trim()&&!$(ue),ce=de&&(!T||I);_&&V&&W(!1);const pe=(e,a)=>{T?P({url:e,name:a}):void 0===a?t.onChange(e):t.onChange(e,a)},me=(e,a)=>{G(a=>a?{...a,against:e}:a),pe(e,a)},fe=e=>{if(!e)return me("");const a=ae.find(a=>a.value===e);me(e,a?.label)},ve=e=>{K(!1);const a=e.trim();a?$(e)?(M({text:e,against:a}),me(a)):M({text:e,against:D}):(M({text:e,against:""}),me(""))},ge=e=>{const a=e.relatedTarget;if(a&&(a===z.current||B.current?.contains(a)))return;if(W(!1),T||!j||C)return;const l=j(oe.trim());l.trim()!==oe.trim()&&ve(l)},he=()=>{if(!T||!se)return;if(!_&&de)return void K(!0);const e=_&&A.url===se?A.name:void 0,a=t.onApply;void 0===e?a(se):a(se,e)},be=(e,a)=>a&&!e.some(e=>e.value===a)?[te(a),...e]:[...e],xe=(a,t,r,n,i)=>{const o=[];for(const e of r){const a=o[o.length-1],l={value:e.value,label:e.label};e.group?a&&"options"in a&&a.label===e.group?a.options.push(l):o.push({label:e.group,options:[l]}):o.push(l)}if(i){const l=r.some(e=>""===e.value);/* @__PURE__ */
2
+ return f(e,{"aria-label":a,value:t,options:o,disabled:C,clearable:l,placeholder:r.find(e=>""===e.value)?.label,onChange:n})}/* @__PURE__ */
3
+ return f(l,{size:"sm","aria-label":a,value:t,options:o,readOnly:C,onChange:n})};let ke;if("text"===X.target.type)ke=/* @__PURE__ */f(r,{ref:z,id:`${R}-address`,size:"sm",type:"text",invalid:ce,"aria-label":U.address,"aria-describedby":ce?`${R}-why`:void 0,placeholder:F??U.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:oe,readOnly:C,onChange:e=>ve(e.target.value),onFocus:()=>W(!0),onBlur:ge,onKeyDown:j&&!T?e=>{"Enter"===e.key&&e.currentTarget.blur()}:void 0});else{const e="groups"===X.target.type?X.target.groups.flatMap(e=>e.options.map(a=>({value:a.value,label:a.label,group:e.label}))):X.target.options.map(e=>({value:e.value,label:e.label})),a=[{value:"",label:X.target.placeholder},...be(e,ee)];ke=xe(X.label,ee,a,fe,e.length>10)}const ye=/* @__PURE__ */v(g,{children:[o&&xe(U.linkType,X.value,q.map(e=>({value:e.value,label:e.label})),e=>{M(null),K(!1);const a=q.find(a=>a.value===e);if(!a||"text"===a.target.type)return void G({kind:e,against:D});const l=h(a.target)[0];G({kind:e,against:l?l.value:""}),l?pe(l.value,l.label):pe("")},!1),ke,E&&V&&!C&&"text"===X.target.type&&/* @__PURE__ */f("div",{ref:B,onBlur:ge,children:E({url:oe,onChange:ve})}),re&&xe(U.filter,ne?.param??"",[{value:"",label:U.noFilter},...ne&&!ie?[te(ne.param)]:[],...re.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return me(ee,le?.label);const a=re?.find(a=>a.param===e),l=a?.values[0];l&&me(y.withFilter(ee,{param:e,value:l.value}),l.label)},!1),re&&ne&&xe(U.value,ne.value,be((ie?.values??[]).map(e=>({value:e.value,label:e.label})),ne.value),e=>{if(!ne)return;const a=ie?.values.find(a=>a.value===e);me(y.withFilter(ee,{param:ne.param,value:e}),a?.label)},(ie?.values.length??0)>10),ce&&/* @__PURE__ */f("p",{id:`${R}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:U.unsafe}),X.hint&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:X.hint}),re&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:U.filterHint})]});if(!T)/* @__PURE__ */
4
+ return f("div",{ref:S,className:`flex min-w-0 flex-auto flex-col gap-2 ${O}`.trim(),role:N?"group":void 0,"aria-label":N,children:ye});const we=t.onRemove;/* @__PURE__ */
5
+ return v("div",{ref:S,role:"dialog","aria-label":N??U.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-line bg-surface p-3 shadow-lg ${O}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),he())},children:[_?/* @__PURE__ */f("span",{className:a({inline:!0}),children:U.title}):/* @__PURE__ */f("label",{htmlFor:`${R}-address`,className:a({inline:!0}),children:U.title}),ye,
6
+ /* @__PURE__ */v("div",{className:"flex items-center justify-between gap-2",children:[we?/* @__PURE__ */f(i,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onClick:we,children:U.remove}):null,
7
+ /* @__PURE__ */v("span",{className:"ml-auto flex gap-1",children:[
8
+ /* @__PURE__ */f(i,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>L.current(),children:U.cancel}),
9
+ /* @__PURE__ */f(i,{variant:"primary",size:"sm","data-window-action":"apply",onClick:he,disabled:C||""===se,children:U.apply})]})]})]})}function w({label:e,text:a,onTextChange:l,link:t,onLinkChange:i,kinds:s,rules:m,filtersFor:g,textPlaceholder:h,readOnly:b,className:x=""}){const k=u().link,[w,N]=p(!1),C=c(null),F=d(),O=()=>{N(!1),C.current?.focus()};/* @__PURE__ */
10
+ return v("div",{className:`flex min-w-0 flex-auto flex-col ${x}`.trim(),children:[
11
+ /* @__PURE__ */f(r,{size:"md",type:"text",className:"rounded-b-none","aria-label":k.text(e),placeholder:h,value:a,readOnly:b,onChange:e=>l(e.target.value)}),
12
+ /* @__PURE__ */v("button",{ref:C,type:"button","aria-label":k.linkOf(e,t),"aria-expanded":w,"aria-controls":w?F:void 0,disabled:b,onClick:()=>N(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded-b-(--radius-control) border border-t-0 border-line-strong bg-surface-sunken ${n.md} text-left hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60`,children:[
13
+ /* @__PURE__ */f(o,{name:"link",strokeWidth:1.5,className:"h-4 w-4 shrink-0 "+(t?"text-blue-600":"text-ink-faintest")}),
14
+ /* @__PURE__ */f("span",{className:"min-w-0 truncate "+(t?"text-blue-600":"text-ink-faintest"),children:t||k.addLink})]}),w&&/* @__PURE__ */f("div",{id:F,className:"mt-2",children:/* @__PURE__ */f(y,{value:t,label:k.linkOf(e,t),kinds:s,rules:m,filtersFor:g,onApply:(e,a)=>{void 0===a?i(e):i(e,a),O()},onRemove:t?()=>{i(""),O()}:void 0,onCancel:O})})]})}export{y as LinkPicker,w as TextLinkField};
@@ -1,7 +1,7 @@
1
- import{writeClipboard as e}from"./chunk-UFX7F3KG.js";import{IconButton_default as r}from"./chunk-SV5RRBVA.js";import{Icon as t}from"./chunk-ISVODSRP.js";import{toast_default as n}from"./chunk-VQ35LXDC.js";import{useShellStrings as a}from"./chunk-IUVGHHR3.js";import{useState as i,useRef as o,useEffect as c,useCallback as l}from"react";import{jsxs as m,jsx as s,Fragment as d}from"react/jsx-runtime";var u={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},p={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function b(){/* @__PURE__ */
1
+ import{writeClipboard as e}from"./chunk-UFX7F3KG.js";import{IconButton_default as r}from"./chunk-NWS5G7FE.js";import{Icon as t}from"./chunk-ISVODSRP.js";import{toast_default as n}from"./chunk-VQ35LXDC.js";import{useShellStrings as a}from"./chunk-IUVGHHR3.js";import{useState as i,useRef as o,useEffect as c,useCallback as l}from"react";import{jsxs as m,jsx as s,Fragment as d}from"react/jsx-runtime";var u={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},p={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function b(){/* @__PURE__ */
2
2
  return s(t,{name:"copy",className:"h-4 w-4","aria-hidden":"true"})}function h(){/* @__PURE__ */
3
- return s(t,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:t,children:y,symbol:f,label:x,size:g="md",variant:k="bordered",hideCopyButton:v=!1,onCopy:w,multiline:N=!1,id:j,"aria-describedby":V,className:C=""}){const[R,B]=i(!1),S=o(null),T=a().copy;c(()=>()=>{S.current&&clearTimeout(S.current)},[]);const D=l(async()=>{await e(t)?(B(!0),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{B(!1),S.current=null},2e3),w?.(t)):n.error(T.failed)},[t,w,T]),{box:F,button:G}=p[g],H=!v;/* @__PURE__ */
4
- return m("div",{id:H?void 0:j,"aria-describedby":H?void 0:V,className:["inline-flex max-w-full items-center rounded-md",u[k],F,C].filter(Boolean).join(" "),children:[null!=f&&""!==f&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:f}),
5
- /* @__PURE__ */s("span",{className:"min-w-0 font-mono text-gray-800 "+(N?"whitespace-pre-wrap break-all":"truncate"),title:N?void 0:t,children:y??t}),!v&&/* @__PURE__ */m(d,{children:[
6
- /* @__PURE__ */s(r,{id:j,"aria-label":x?T.copyLabel(x):T.copy,"aria-describedby":V,onClick:D,className:`${G} text-gray-400`,children:/* @__PURE__ */s(R?h:b,{})}),
7
- /* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:R?T.copied:""})]})]})}export{y as Snippet};
3
+ return s(t,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:t,children:y,symbol:f,label:x,size:g="md",variant:k="bordered",hideCopyButton:N=!1,onCopy:v,multiline:w=!1,id:j,"aria-describedby":C,className:F=""}){const[G,S]=i(!1),T=o(null),V=a().copy;c(()=>()=>{T.current&&clearTimeout(T.current)},[]);const B=l(async()=>{await e(t)?(S(!0),T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{S(!1),T.current=null},2e3),v?.(t)):n.error(V.failed)},[t,v,V]),{box:D,button:H}=p[g],I=!N;/* @__PURE__ */
4
+ return m("div",{id:I?void 0:j,"aria-describedby":I?void 0:C,className:["inline-flex max-w-full items-center rounded-md",u[k],D,F].filter(Boolean).join(" "),children:[null!=f&&""!==f&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:f}),
5
+ /* @__PURE__ */s("span",{className:"min-w-0 font-mono text-gray-800 "+(w?"whitespace-pre-wrap break-all":"truncate"),title:w?void 0:t,children:y??t}),!N&&/* @__PURE__ */m(d,{children:[
6
+ /* @__PURE__ */s(r,{id:j,"aria-label":x?V.copyLabel(x):V.copy,"aria-describedby":C,onClick:B,className:`${H} text-gray-400`,children:/* @__PURE__ */s(G?h:b,{})}),
7
+ /* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:G?V.copied:""})]})]})}export{y as Snippet};
@@ -1,2 +1,2 @@
1
- import{InputNumber_default as a,stepRounding as e}from"./chunk-F5B5WOQ7.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{jsxs as n,jsx as i}from"react/jsx-runtime";var l="h-3.5 w-3.5",s={x:/* @__PURE__ */i(r,{name:"nudge-x","aria-hidden":"true",className:l}),y:/* @__PURE__ */i(r,{name:"nudge-y","aria-hidden":"true",className:l})};function m({label:r,value:l,onChange:m,words:t,placeholder:d,min:o=-200,max:c=200,step:u=1,readOnly:p,units:h}){const x=r=>/* @__PURE__ */i("div",{"data-axis":r,className:"min-w-0",children:/* @__PURE__ */i(a,{value:l[r],onChange:a=>m({...l,[r]:a}),min:o,max:c,step:u,...e(u),steppers:"compact",readOnly:p,placeholder:d[r],prefix:s[r],suffix:t.unit,units:h,"aria-label":t[r]})});/* @__PURE__ */
1
+ import{InputNumber_default as a,stepRounding as e}from"./chunk-FKMARSJZ.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{jsxs as n,jsx as i}from"react/jsx-runtime";var l="h-3.5 w-3.5",s={x:/* @__PURE__ */i(r,{name:"nudge-x","aria-hidden":"true",className:l}),y:/* @__PURE__ */i(r,{name:"nudge-y","aria-hidden":"true",className:l})};function m({label:r,value:l,onChange:m,words:t,placeholder:d,min:o=-200,max:c=200,step:u=1,readOnly:p,units:h}){const x=r=>/* @__PURE__ */i("div",{"data-axis":r,className:"min-w-0",children:/* @__PURE__ */i(a,{value:l[r],onChange:a=>m({...l,[r]:a}),min:o,max:c,step:u,...e(u),steppers:"compact",readOnly:p,placeholder:d[r],prefix:s[r],suffix:t.unit,units:h,"aria-label":t[r]})});/* @__PURE__ */
2
2
  return n("div",{role:"group","aria-label":r,className:"grid min-w-0 grid-cols-2 gap-2",children:[x("x"),x("y")]})}export{m as PositionInput};
@@ -1,6 +1,6 @@
1
- import{TEXT_ALIGNS as e,textAlignWords as l,textAlignIcon as r}from"./chunk-F4VILY3O.js";import{IconButton_default as a}from"./chunk-SV5RRBVA.js";import{Icon as o}from"./chunk-ISVODSRP.js";import{Tooltip as n}from"./chunk-SOZCWT6I.js";import{useShellStrings as s}from"./chunk-IUVGHHR3.js";import{jsx as i,jsxs as t,Fragment as d}from"react/jsx-runtime";var c=e=>e.preventDefault(),u=e=>null!=e&&!1!==e,h=["bold","italic","underline","strike","link","sup","sub","code"];function p(e,l,r){const a={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1,Home:"first",End:"last"}[e.key];if(void 0===a||0===l.length)return;const o=[...e.currentTarget.querySelectorAll('[role="radio"]')],n=o.findIndex(l=>l===e.target||l.contains(e.target));if(n<0)return;e.preventDefault();const s=o.length,i="first"===a?0:"last"===a?s-1:(n+a+s)%s;o[i].disabled||(r(l[i]),o[i].focus())}function b(e,l){const r=["bold","italic","underline","strike"].filter(l=>e.has(l)).length;return{color:r,link:r+(l?1:0)}}function m(e,l,r,a){const o=h.filter(l=>"link"!==l&&e.has(l)).length+(l?1:0);return r&&0!==o?a>0?"paragraph":"words":null}function w({offered:l,color:r,last:a,alignment:o,list:n,letterCase:s,clear:i}){let t=h.filter(e=>l.has(e)).length+(r?1:0)+(u(a)?1:0),d=(o?e.filter(e=>o.allow.includes(e)).length:0)+(n&&l.has("bullet")?1:0)+(n&&l.has("number")?1:0)+(l.has("quote")?1:0)+(s?3:0);const c=m(l,r,i,d);return"paragraph"===c&&(d+=1),"words"===c&&(t+=1),{words:t>0,paragraph:d>0,oneRow:t>0&&d>0&&t+1+d<=9,flow:t>0&&d>0&&t+1+d>9&&t<=7,cells:{words:t,paragraph:d}}}function g(e,l){/* @__PURE__ */
2
- return i(n,{content:e,children:l},l.key??void 0)}function f({offered:n,pressed:h,onMark:f,color:k,linkOpen:v=!1,last:N,alignment:C,list:D,letterCase:M,clear:x,disabled:y=!1,"aria-label":I,windows:R,className:S="",layout:j="grid"}){const A=s().textToolbar,q=w({offered:n,color:k,last:N,alignment:C,list:D,letterCase:M,clear:x});if(!q.words&&!q.paragraph)return null;const B=m(n,k,x,q.cells.paragraph),L=(e,l="")=>`rosh-tb-btn${e?" is-on":""}${l?` ${l}`:""}`,V=(e,l,r,o)=>n.has(e)?g(l,/* @__PURE__ */i(a,"link"===e?{pressed:v,className:L(v),"aria-label":l,"aria-haspopup":"dialog","aria-expanded":v,"aria-keyshortcuts":o,disabled:y,onMouseDown:c,onClick:()=>f(e),children:r}:{className:L(Boolean(h[e])),"aria-label":l,"aria-pressed":Boolean(h[e]),"aria-keyshortcuts":o,disabled:y,onMouseDown:c,onClick:()=>f(e),children:r},e)):null,$=l(A),O=e.map(e=>[e,$[e],r(e)]),T=C?e.filter(e=>C.allow.includes(e)):[],U=C&&T.includes(C.value)?C.value:T[0],H=[["none",A.caseNone,/* @__PURE__ */i(o,{name:"case-normal"})],["upper",A.caseUpper,/* @__PURE__ */i(o,{name:"case-upper"})],["lower",A.caseLower,/* @__PURE__ */i(o,{name:"case-lower"})]],K=x&&B?g(A.clear,/* @__PURE__ */i(a,{className:L(!1),"aria-label":A.clear,disabled:y,onMouseDown:c,onClick:x.onClear,children:/* @__PURE__ */i(o,{name:"revert"})},"clear")):null,E=/* @__PURE__ */t(d,{children:[V("bold",A.bold,/* @__PURE__ */i(o,{name:"bold"}),"Meta+B"),V("italic",A.italic,/* @__PURE__ */i(o,{name:"italic"}),"Meta+I"),V("underline",A.underline,/* @__PURE__ */i(o,{name:"underline"}),"Meta+U"),V("strike",A.strike,/* @__PURE__ */i(o,{name:"strike"})),k?g(A.color,/* @__PURE__ */i(a,{pressed:k.open,className:L(k.open,"rosh-tb-color"),"aria-label":A.color,"aria-haspopup":"dialog","aria-expanded":k.open,disabled:y,style:k.run?{"--rosh-tb-run":k.run}:void 0,onMouseDown:c,onClick:k.onToggle,children:/* @__PURE__ */i(o,{name:"text-color"})},"color")):null,V("link",A.link,/* @__PURE__ */i(o,{name:"link"}),"Meta+K"),V("sup",A.sup,/* @__PURE__ */i(o,{name:"superscript"})),V("sub",A.sub,/* @__PURE__ */i(o,{name:"subscript"})),V("code",A.code,/* @__PURE__ */i(o,{name:"code"})),u(N)?N:null,"words"===B?K:null]}),F=/* @__PURE__ */t(d,{children:[C&&T.length>0?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":A.alignment,onKeyDown:e=>p(e,T,e=>C.onChange(e)),children:O.map(([e,l,r])=>C.allow.includes(e)?g(l,/* @__PURE__ */i(a,{role:"radio",pressed:C.value===e,className:L(C.value===e),"aria-checked":C.value===e,"aria-label":l,tabIndex:e===U?0:-1,disabled:y||C.disabled,onMouseDown:c,onClick:()=>C.onChange(e),children:r},e)):null)}):null,D&&n.has("bullet")?g(A.bullet,/* @__PURE__ */i(a,{className:L("bullet"===D.pressed),"aria-label":A.bullet,"aria-pressed":"bullet"===D.pressed,disabled:y,onMouseDown:c,onClick:()=>D.onList("bullet"),children:/* @__PURE__ */i(o,{name:"list"})},"bullet")):null,D&&n.has("number")?g(A.number,/* @__PURE__ */i(a,{className:L("number"===D.pressed),"aria-label":A.number,"aria-pressed":"number"===D.pressed,disabled:y,onMouseDown:c,onClick:()=>D.onList("number"),children:/* @__PURE__ */i(o,{name:"numbered-list"})},"number")):null,V("quote",A.quote,/* @__PURE__ */i(o,{name:"quote"})),M?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":A.letterCase,onKeyDown:e=>p(e,H.map(([e])=>e),e=>M.onChange(e)),children:H.map(([e,l,r])=>g(l,/* @__PURE__ */i(a,{role:"radio",pressed:M.value===e,className:L(M.value===e),"aria-checked":M.value===e,"aria-label":l,tabIndex:e===(M.value||"none")?0:-1,disabled:y||M.disabled,onMouseDown:c,onClick:()=>M.onChange(M.value===e?"":e),children:r},e)))}):null,"paragraph"===B?K:null]}),G="row"===j,P=G?" is-row":q.flow?" is-flow":q.oneRow?" is-one-row":q.words&&void 0===N&&"words"!==B?" is-eight":"",W=b(n,Boolean(k)),Y={"--rosh-tb-color-col":String(W.color),"--rosh-tb-link-col":String(W.link),...G?{"--rosh-tb-cells":String(q.cells.words+q.cells.paragraph),"--rosh-tb-groupgap":q.words&&q.paragraph?"var(--space-8, 0.5rem)":"0px"}:{}};let Z;return Z=G?/* @__PURE__ */t("div",{className:"rosh-tb-row is-row",children:[q.words?/* @__PURE__ */i("div",{className:"rosh-tb-words",children:E}):null,q.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-para",children:F}):null]}):q.flow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-flow",children:[E,
3
- /* @__PURE__ */i("span",{className:"rosh-tb-flowgap","aria-hidden":"true"}),F]}):q.oneRow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-one-row",children:[
4
- /* @__PURE__ */i("div",{className:"rosh-tb-words",children:E}),
5
- /* @__PURE__ */i("div",{className:"rosh-tb-para",children:F})]}):/* @__PURE__ */t(d,{children:[q.words?/* @__PURE__ */i("div",{className:"rosh-tb-row"+(void 0===N&&"words"!==B?" is-eight":""),children:E}):null,q.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-row",children:F}):null]}),/* @__PURE__ */t("div",{className:`rosh-tb-wrap${P} ${S}`.trim(),style:Y,children:[
6
- /* @__PURE__ */i("div",{className:"rosh-tb",role:"toolbar","aria-label":I??A.formatting,children:Z}),R]})}export{f as TextToolbar,w as textToolbarRows,b as textToolbarWindowColumns};
1
+ import{TEXT_ALIGNS as e,textAlignWords as l,textAlignIcon as r}from"./chunk-F4VILY3O.js";import{IconButton_default as a}from"./chunk-NWS5G7FE.js";import{Icon as o}from"./chunk-ISVODSRP.js";import{Tooltip as n}from"./chunk-F2RAIGCG.js";import{useShellStrings as s}from"./chunk-IUVGHHR3.js";import{jsx as i,jsxs as t,Fragment as d}from"react/jsx-runtime";var c=e=>e.preventDefault(),u=e=>null!=e&&!1!==e,h=["bold","italic","underline","strike","link","sup","sub","code"];function p(e,l,r){const a={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1,Home:"first",End:"last"}[e.key];if(void 0===a||0===l.length)return;const o=[...e.currentTarget.querySelectorAll('[role="radio"]')],n=o.findIndex(l=>l===e.target||l.contains(e.target));if(n<0)return;e.preventDefault();const s=o.length,i="first"===a?0:"last"===a?s-1:(n+a+s)%s;o[i].disabled||(r(l[i]),o[i].focus())}function b(e,l){const r=["bold","italic","underline","strike"].filter(l=>e.has(l)).length;return{color:r,link:r+(l?1:0)}}function m(e,l,r,a){const o=h.filter(l=>"link"!==l&&e.has(l)).length+(l?1:0);return r&&0!==o?a>0?"paragraph":"words":null}function w({offered:l,color:r,last:a,alignment:o,list:n,letterCase:s,clear:i}){let t=h.filter(e=>l.has(e)).length+(r?1:0)+(u(a)?1:0),d=(o?e.filter(e=>o.allow.includes(e)).length:0)+(n&&l.has("bullet")?1:0)+(n&&l.has("number")?1:0)+(l.has("quote")?1:0)+(s?3:0);const c=m(l,r,i,d);return"paragraph"===c&&(d+=1),"words"===c&&(t+=1),{words:t>0,paragraph:d>0,oneRow:t>0&&d>0&&t+1+d<=9,flow:t>0&&d>0&&t+1+d>9&&t<=7,cells:{words:t,paragraph:d}}}function g(e,l){/* @__PURE__ */
2
+ return i(n,{content:e,children:l},l.key??void 0)}function f({offered:n,pressed:h,onMark:f,color:k,linkOpen:v=!1,last:N,alignment:C,list:D,letterCase:M,clear:x,disabled:y=!1,"aria-label":I,windows:R,className:S="",layout:j="grid"}){const A=s().textToolbar,q=w({offered:n,color:k,last:N,alignment:C,list:D,letterCase:M,clear:x});if(!q.words&&!q.paragraph)return null;const L=m(n,k,x,q.cells.paragraph),$=(e,l="")=>`rosh-tb-btn${e?" is-on":""}${l?` ${l}`:""}`,B=(e,l,r,o)=>n.has(e)?g(l,/* @__PURE__ */i(a,"link"===e?{pressed:v,className:$(v),"aria-label":l,"aria-haspopup":"dialog","aria-expanded":v,"aria-keyshortcuts":o,disabled:y,onMouseDown:c,onClick:()=>f(e),children:r}:{className:$(Boolean(h[e])),"aria-label":l,"aria-pressed":Boolean(h[e]),"aria-keyshortcuts":o,disabled:y,onMouseDown:c,onClick:()=>f(e),children:r},e)):null,G=l(A),U=e.map(e=>[e,G[e],r(e)]),F=C?e.filter(e=>C.allow.includes(e)):[],H=C&&F.includes(C.value)?C.value:F[0],K=[["none",A.caseNone,/* @__PURE__ */i(o,{name:"case-normal"})],["upper",A.caseUpper,/* @__PURE__ */i(o,{name:"case-upper"})],["lower",A.caseLower,/* @__PURE__ */i(o,{name:"case-lower"})]],O=x&&L?g(A.clear,/* @__PURE__ */i(a,{className:$(!1),"aria-label":A.clear,disabled:y,onMouseDown:c,onClick:x.onClear,children:/* @__PURE__ */i(o,{name:"revert"})},"clear")):null,T=/* @__PURE__ */t(d,{children:[B("bold",A.bold,/* @__PURE__ */i(o,{name:"bold"}),"Meta+B"),B("italic",A.italic,/* @__PURE__ */i(o,{name:"italic"}),"Meta+I"),B("underline",A.underline,/* @__PURE__ */i(o,{name:"underline"}),"Meta+U"),B("strike",A.strike,/* @__PURE__ */i(o,{name:"strike"})),k?g(A.color,/* @__PURE__ */i(a,{pressed:k.open,className:$(k.open,"rosh-tb-color"),"aria-label":A.color,"aria-haspopup":"dialog","aria-expanded":k.open,disabled:y,style:k.run?{"--rosh-tb-run":k.run}:void 0,onMouseDown:c,onClick:k.onToggle,children:/* @__PURE__ */i(o,{name:"text-color"})},"color")):null,B("link",A.link,/* @__PURE__ */i(o,{name:"link"}),"Meta+K"),B("sup",A.sup,/* @__PURE__ */i(o,{name:"superscript"})),B("sub",A.sub,/* @__PURE__ */i(o,{name:"subscript"})),B("code",A.code,/* @__PURE__ */i(o,{name:"code"})),u(N)?N:null,"words"===L?O:null]}),V=/* @__PURE__ */t(d,{children:[C&&F.length>0?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":A.alignment,onKeyDown:e=>p(e,F,e=>C.onChange(e)),children:U.map(([e,l,r])=>C.allow.includes(e)?g(l,/* @__PURE__ */i(a,{role:"radio",pressed:C.value===e,className:$(C.value===e),"aria-checked":C.value===e,"aria-label":l,tabIndex:e===H?0:-1,disabled:y||C.disabled,onMouseDown:c,onClick:()=>C.onChange(e),children:r},e)):null)}):null,D&&n.has("bullet")?g(A.bullet,/* @__PURE__ */i(a,{className:$("bullet"===D.pressed),"aria-label":A.bullet,"aria-pressed":"bullet"===D.pressed,disabled:y,onMouseDown:c,onClick:()=>D.onList("bullet"),children:/* @__PURE__ */i(o,{name:"list"})},"bullet")):null,D&&n.has("number")?g(A.number,/* @__PURE__ */i(a,{className:$("number"===D.pressed),"aria-label":A.number,"aria-pressed":"number"===D.pressed,disabled:y,onMouseDown:c,onClick:()=>D.onList("number"),children:/* @__PURE__ */i(o,{name:"numbered-list"})},"number")):null,B("quote",A.quote,/* @__PURE__ */i(o,{name:"quote"})),M?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":A.letterCase,onKeyDown:e=>p(e,K.map(([e])=>e),e=>M.onChange(e)),children:K.map(([e,l,r])=>g(l,/* @__PURE__ */i(a,{role:"radio",pressed:M.value===e,className:$(M.value===e),"aria-checked":M.value===e,"aria-label":l,tabIndex:e===(M.value||"none")?0:-1,disabled:y||M.disabled,onMouseDown:c,onClick:()=>M.onChange(M.value===e?"":e),children:r},e)))}):null,"paragraph"===L?O:null]}),E="row"===j,P=E?" is-row":q.flow?" is-flow":q.oneRow?" is-one-row":q.words&&void 0===N&&"words"!==L?" is-eight":"",W=b(n,Boolean(k)),Y={"--rosh-tb-color-col":String(W.color),"--rosh-tb-link-col":String(W.link),...E?{"--rosh-tb-cells":String(q.cells.words+q.cells.paragraph),"--rosh-tb-groupgap":q.words&&q.paragraph?"var(--space-8, 0.5rem)":"0px"}:{}};let z;return z=E?/* @__PURE__ */t("div",{className:"rosh-tb-row is-row",children:[q.words?/* @__PURE__ */i("div",{className:"rosh-tb-words",children:T}):null,q.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-para",children:V}):null]}):q.flow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-flow",children:[T,
3
+ /* @__PURE__ */i("span",{className:"rosh-tb-flowgap","aria-hidden":"true"}),V]}):q.oneRow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-one-row",children:[
4
+ /* @__PURE__ */i("div",{className:"rosh-tb-words",children:T}),
5
+ /* @__PURE__ */i("div",{className:"rosh-tb-para",children:V})]}):/* @__PURE__ */t(d,{children:[q.words?/* @__PURE__ */i("div",{className:"rosh-tb-row"+(void 0===N&&"words"!==L?" is-eight":""),children:T}):null,q.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-row",children:V}):null]}),/* @__PURE__ */t("div",{className:`rosh-tb-wrap${P} ${S}`.trim(),style:Y,children:[
6
+ /* @__PURE__ */i("div",{className:"rosh-tb",role:"toolbar","aria-label":I??A.formatting,children:z}),R]})}export{f as TextToolbar,w as textToolbarRows,b as textToolbarWindowColumns};
@@ -1,7 +1,7 @@
1
- import{MOVE_KEYS as e,MoveHint as r,moveFromKey as t}from"./chunk-WF4A2HSB.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{createContext as o,useContext as n,useRef as l,useId as s}from"react";import{jsx as d,jsxs as c,Fragment as m}from"react/jsx-runtime";var u=o("compact");function f({"aria-label":e,"aria-labelledby":r,children:t,spacing:i="compact",className:a="",rootProps:o}){/* @__PURE__ */
2
- return d(u.Provider,{value:i,children:/* @__PURE__ */d("div",{...o,role:"list","aria-label":r?void 0:e,"aria-labelledby":r,"data-sortable-list":i,className:`flex min-w-0 flex-col ${"comfortable"===i?"gap-2":"gap-1"} ${a}`.trim(),children:t})})}function b({children:o,title:f,thumb:b,expanded:p,onToggle:h,actions:g,below:v,active:x=!1,flat:w=!1,draggable:y=!1,dragging:N=!1,drop:k,onMove:j,rowProps:D,rowRef:P,className:B=""}){const S=x||!!p,A=n(u),I=l(null),$=s(),H=[D?.["aria-describedby"],j?$:void 0].filter(Boolean).join(" ")||void 0,K=D?.tabIndex;a(()=>{const e=I.current;if(!e||void 0!==K)return;const r=[...e.querySelectorAll('a[href], button, input, select, textarea, [contenteditable]:not([contenteditable="false"]), [tabindex]')].some(r=>r!==e);j&&!r?e.tabIndex=0:e.removeAttribute("tabindex")});const R="comfortable"===A?{before:"-top-[5px]",after:"-bottom-[5px]"}:{before:"-top-0.5",after:"-bottom-0.5"},T=null!=f&&/* @__PURE__ */c(m,{children:[null!=b&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"inline-flex h-6 w-6 shrink-0 overflow-hidden rounded-sm",children:b}),
1
+ import{MOVE_KEYS as e,MoveHint as r,moveFromKey as t}from"./chunk-ZCN5BU4U.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{useBrowserLayoutEffect as a}from"./chunk-ZDXRSY2Y.js";import{createContext as o,useContext as n,useRef as l,useId as s}from"react";import{jsx as d,jsxs as c,Fragment as m}from"react/jsx-runtime";var u=o("compact");function f({"aria-label":e,"aria-labelledby":r,children:t,spacing:i="compact",className:a="",rootProps:o}){/* @__PURE__ */
2
+ return d(u.Provider,{value:i,children:/* @__PURE__ */d("div",{...o,role:"list","aria-label":r?void 0:e,"aria-labelledby":r,"data-sortable-list":i,className:`flex min-w-0 flex-col ${"comfortable"===i?"gap-2":"gap-1"} ${a}`.trim(),children:t})})}function b({children:o,title:f,thumb:b,expanded:p,onToggle:h,actions:g,below:v,active:x=!1,flat:w=!1,draggable:y=!1,dragging:N=!1,drop:k,onMove:j,rowProps:D,rowRef:P,className:B=""}){const S=x||!!p,I=n(u),R=l(null),$=s(),A=[D?.["aria-describedby"],j?$:void 0].filter(Boolean).join(" ")||void 0,C=D?.tabIndex;a(()=>{const e=R.current;if(!e||void 0!==C)return;const r=[...e.querySelectorAll('a[href], button, input, select, textarea, [contenteditable]:not([contenteditable="false"]), [tabindex]')].some(r=>r!==e);j&&!r?e.tabIndex=0:e.removeAttribute("tabindex")});const K="comfortable"===I?{before:"-top-[5px]",after:"-bottom-[5px]"}:{before:"-top-0.5",after:"-bottom-0.5"},U=null!=f&&/* @__PURE__ */c(m,{children:[null!=b&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"inline-flex h-6 w-6 shrink-0 overflow-hidden rounded-sm",children:b}),
3
3
  /* @__PURE__ */d("span",{"data-list-row-name":"",className:"min-w-0 flex-1 break-words font-semibold text-(--ink-strongest)",children:f})]});/* @__PURE__ */
4
- return c("div",{role:"listitem","data-list-item":"","data-drop":k,"data-open":S||void 0,className:["relative flex min-w-0 flex-col",w?"":"rounded-(--radius-card) border bg-surface transition-colors duration-(--motion-fast)",w?"":S?"border-blue-300":"border-line hover:border-gray-300"].filter(Boolean).join(" "),children:[k&&/* @__PURE__ */d("span",{"aria-hidden":"true","data-list-drop-line":"",className:`pointer-events-none absolute inset-x-2 z-10 h-0.5 rounded-full bg-blue-500 ${R[k]}`}),
5
- /* @__PURE__ */c("div",{...D,ref:e=>{var r,t;I.current=e,t=e,"function"==typeof(r=P)?r(t):r&&(r.current=t)},"data-list-row":"","data-draggable":y||void 0,"aria-keyshortcuts":D?.["aria-keyshortcuts"]??(j?e:void 0),"aria-describedby":H,onKeyDown:e=>{if(D?.onKeyDown?.(e),e.defaultPrevented||!j)return;const r=t(e);r&&!e.target.closest?.("select")&&(e.preventDefault(),j(r))},className:["group/listrow relative flex min-h-8 min-w-0 items-center gap-1 rounded-md text-sm",w?"":"min-h-10 pl-3",y?"cursor-grab active:cursor-grabbing":"","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",null!=g&&!1!==g?"":"pr-2",N?"opacity-40":"",B].filter(Boolean).join(" "),children:[
6
- /* @__PURE__ */c("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:[T&&(h?/* @__PURE__ */c("button",{type:"button","aria-expanded":!!p,onClick:h,"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 self-stretch rounded-sm py-2 text-left text-(--ink-strongest) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[T,
7
- /* @__PURE__ */d(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:"2",className:"h-4 w-4 shrink-0 transition-transform duration-(--motion-base) motion-reduce:transition-none "+(p?"rotate-90":"")})]}):/* @__PURE__ */d("span",{"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 py-2",children:T})),o]}),null!=g&&!1!==g&&/* @__PURE__ */d("div",{"data-list-actions":"",className:"flex shrink-0 items-center gap-0.5",children:g}),j&&/* @__PURE__ */d(r,{id:$})]}),null!=v&&!1!==v&&/* @__PURE__ */d("div",{"data-list-below":"",className:w?"":"px-3 pb-3",children:v})]})}export{b as ListRow,f as SortableList};
4
+ return c("div",{role:"listitem","data-list-item":"","data-drop":k,"data-open":S||void 0,className:["relative flex min-w-0 flex-col",w?"":"rounded-(--radius-card) border bg-surface transition-colors duration-(--motion-fast)",w?"":S?"border-blue-300":"border-line hover:border-gray-300"].filter(Boolean).join(" "),children:[k&&/* @__PURE__ */d("span",{"aria-hidden":"true","data-list-drop-line":"",className:`pointer-events-none absolute inset-x-2 z-10 h-0.5 rounded-full bg-blue-500 ${K[k]}`}),
5
+ /* @__PURE__ */c("div",{...D,ref:e=>{var r,t;R.current=e,t=e,"function"==typeof(r=P)?r(t):r&&(r.current=t)},"data-list-row":"","data-draggable":y||void 0,"aria-keyshortcuts":D?.["aria-keyshortcuts"]??(j?e:void 0),"aria-describedby":A,onKeyDown:e=>{if(D?.onKeyDown?.(e),e.defaultPrevented||!j)return;const r=t(e);r&&!e.target.closest?.("select")&&(e.preventDefault(),j(r))},className:["group/listrow relative flex min-h-8 min-w-0 items-center gap-1 rounded-md text-sm",w?"":"min-h-10 pl-3",y?"cursor-grab active:cursor-grabbing":"","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",null!=g&&!1!==g?"":"pr-2",N?"opacity-40":"",B].filter(Boolean).join(" "),children:[
6
+ /* @__PURE__ */c("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:[U&&(h?/* @__PURE__ */c("button",{type:"button","aria-expanded":!!p,onClick:h,"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 self-stretch rounded-sm py-2 text-left text-(--ink-strongest) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[U,
7
+ /* @__PURE__ */d(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:"2",className:"h-4 w-4 shrink-0 transition-transform duration-(--motion-base) motion-reduce:transition-none "+(p?"rotate-90":"")})]}):/* @__PURE__ */d("span",{"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 py-2",children:U})),o]}),null!=g&&!1!==g&&/* @__PURE__ */d("div",{"data-list-actions":"",className:"flex shrink-0 items-center gap-0.5",children:g}),j&&/* @__PURE__ */d(r,{id:$})]}),null!=v&&!1!==v&&/* @__PURE__ */d("div",{"data-list-below":"",className:w?"":"px-3 pb-3",children:v})]})}export{b as ListRow,f as SortableList};
@@ -1,12 +1,12 @@
1
- import{arcPath as e}from"./chunk-VFC6QUEN.js";import{MOTION as t,stagger as l}from"./chunk-465RRWBY.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{usePlotWidth as r}from"./chunk-MAFUXCPZ.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{ChartTooltip as o}from"./chunk-WDQI3FV6.js";import{CHART_INK as s,resolveSeriesColor as i}from"./chunk-TZFACUMR.js";import{useShellStrings as h,useShellLocale as c}from"./chunk-IUVGHHR3.js";import{formatPercent as m,formatPlain as u}from"./chunk-C3QOHMR6.js";import{useId as d,useState as f,useRef as y}from"react";import{jsx as p,jsxs as g}from"react/jsx-runtime";function x({segments:x,variant:v="pie",size:k=280,innerRadius:M,padAngle:b=.012,maxSegments:N=6,otherLabel:I,formatValue:$,centerLabel:j,animate:F=!0,labels:w="none",labelMinShare:P=.04,className:S,emptyLabel:A}){const C=h().charts,R=c(),W=$??(e=>u(e,R)),V=I??C.other,z=A??C.nothingToBreakDown,E=d(),[T,U]=f(null),{highlighted:_}=a(),H=y(null),L=r(H,Number.POSITIVE_INFINITY),Y=x.map((e,t)=>({...e,slot:t})).filter(e=>e.value>0);if(0===Y.length)/* @__PURE__ */return p("p",{className:`text-sm text-gray-500 ${S??""}`,children:z});const B=[...Y].sort((e,t)=>t.value-e.value),O=B.slice(0,N),Q=B.slice(N),D=Q.length>0?[...O,{key:"__other__",label:V,value:Q.reduce((e,t)=>e+t.value,0),slot:-1,color:s.muted}]:O,Z=e=>i(e.slot,e.color,e.tone),q=D.reduce((e,t)=>e+t.value,0),G=Math.ceil(.62*Math.max(...D.map(e=>String(e.label).length),4)*11)+24,J="outside"===w&&L>=120+2*G,X=J?G:0,K=J?Math.max(120,Math.min(k,L-2*X)):k,ee=K+2*X,te=X+K/2,le=K/2,ae=K/2-12,re=M??("ring"===v?.58*ae:0),ne=n(D.length,b),oe=Math.max(...D.map(e=>e.value)),se=e=>re+(ae-re)*Math.sqrt(Math.max(0,e)/oe);let ie=-Math.PI/2;const he=(()=>{if(!J)return[];let e=-Math.PI/2;const t=D.map((t,l)=>{const a="rose"===v?n(D.length,b).step:t.value/q*Math.PI*2,r="rose"===v?n(D.length,b).center(l):e+a/2;e+=a;const o="rose"===v?se(t.value):ae;return{key:t.key,label:t.label,share:t.value/q,right:Math.cos(r)>=0,anchor:[te+o*Math.cos(r),le+o*Math.sin(r)],y:le+(o+14)*Math.sin(r),index:l}}).filter(e=>e.share>=P),l=Math.max(1,Math.floor((K-11-13)/26)+1),a=/* @__PURE__ */new Set;for(const e of[!0,!1]){const r=t.filter(t=>t.right===e).sort((e,t)=>t.share-e.share).slice(0,l).sort((e,t)=>e.y-t.y);for(let e=1;e<r.length;e+=1)r[e].y-r[e-1].y<26&&(r[e].y=r[e-1].y+26);for(let e=r.length-1;e>=0;e-=1){const t=e===r.length-1?K-13:r[e+1].y-26;r[e].y=Math.min(r[e].y,t)}r.forEach((e,t)=>{e.y=Math.max(e.y,0===t?11:r[t-1].y+26),a.add(e.key)})}return t.filter(e=>a.has(e.key))})(),ce=(e,t)=>null!==T?T!==e:null!==_&&_!==t,me=null!==T?D[T]:void 0;/* @__PURE__ */
1
+ import{MOTION as e,stagger as t}from"./chunk-465RRWBY.js";import{arcPath as l}from"./chunk-VFC6QUEN.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{angleScale as r}from"./chunk-2JWPNR2U.js";import{ChartTooltip as n}from"./chunk-WDQI3FV6.js";import{CHART_INK as o,resolveSeriesColor as s}from"./chunk-TZFACUMR.js";import{usePlotWidth as i}from"./chunk-MAFUXCPZ.js";import{useShellStrings as h,useShellLocale as c}from"./chunk-IUVGHHR3.js";import{formatPercent as m,formatPlain as u}from"./chunk-C3QOHMR6.js";import{useId as d,useState as f,useRef as y}from"react";import{jsx as p,jsxs as g}from"react/jsx-runtime";function x({segments:x,variant:v="pie",size:k=280,innerRadius:M,padAngle:b=.012,maxSegments:N=6,otherLabel:I,formatValue:$,centerLabel:j,animate:F=!0,labels:w="none",labelMinShare:P=.04,className:S,emptyLabel:A}){const C=h().charts,R=c(),W=$??(e=>u(e,R)),V=I??C.other,z=A??C.nothingToBreakDown,E=d(),[T,U]=f(null),{highlighted:_}=a(),H=y(null),L=i(H,Number.POSITIVE_INFINITY),Y=x.map((e,t)=>({...e,slot:t})).filter(e=>e.value>0);if(0===Y.length)/* @__PURE__ */return p("p",{className:`text-sm text-gray-500 ${S??""}`,children:z});const B=[...Y].sort((e,t)=>t.value-e.value),O=B.slice(0,N),Q=B.slice(N),D=Q.length>0?[...O,{key:"__other__",label:V,value:Q.reduce((e,t)=>e+t.value,0),slot:-1,color:o.muted}]:O,Z=e=>s(e.slot,e.color,e.tone),q=D.reduce((e,t)=>e+t.value,0),G=Math.ceil(.62*Math.max(...D.map(e=>String(e.label).length),4)*11)+24,J="outside"===w&&L>=120+2*G,X=J?G:0,K=J?Math.max(120,Math.min(k,L-2*X)):k,ee=K+2*X,te=X+K/2,le=K/2,ae=K/2-12,re=M??("ring"===v?.58*ae:0),ne=r(D.length,b),oe=Math.max(...D.map(e=>e.value)),se=e=>re+(ae-re)*Math.sqrt(Math.max(0,e)/oe);let ie=-Math.PI/2;const he=(()=>{if(!J)return[];let e=-Math.PI/2;const t=D.map((t,l)=>{const a="rose"===v?r(D.length,b).step:t.value/q*Math.PI*2,n="rose"===v?r(D.length,b).center(l):e+a/2;e+=a;const o="rose"===v?se(t.value):ae;return{key:t.key,label:t.label,share:t.value/q,right:Math.cos(n)>=0,anchor:[te+o*Math.cos(n),le+o*Math.sin(n)],y:le+(o+14)*Math.sin(n),index:l}}).filter(e=>e.share>=P),l=Math.max(1,Math.floor((K-11-13)/26)+1),a=/* @__PURE__ */new Set;for(const e of[!0,!1]){const r=t.filter(t=>t.right===e).sort((e,t)=>t.share-e.share).slice(0,l).sort((e,t)=>e.y-t.y);for(let e=1;e<r.length;e+=1)r[e].y-r[e-1].y<26&&(r[e].y=r[e-1].y+26);for(let e=r.length-1;e>=0;e-=1){const t=e===r.length-1?K-13:r[e+1].y-26;r[e].y=Math.min(r[e].y,t)}r.forEach((e,t)=>{e.y=Math.max(e.y,0===t?11:r[t-1].y+26),a.add(e.key)})}return t.filter(e=>a.has(e.key))})(),ce=(e,t)=>null!==T?T!==e:null!==_&&_!==t,me=null!==T?D[T]:void 0;/* @__PURE__ */
2
2
  return g("div",{className:`relative ${S??""}`,ref:H,children:[
3
3
  /* @__PURE__ */g("svg",{width:"100%",height:K,viewBox:`0 0 ${ee} ${K}`,role:"img","aria-labelledby":E,onMouseLeave:()=>U(null),children:[
4
- /* @__PURE__ */p("title",{id:E,children:C.breakdown(W(q),D.length)}),D.map((a,r)=>{const n=Z(a),o="rose"===v?ne(r):ie,i="rose"===v?ne.step:a.value/q*Math.PI*2-b;"rose"!==v&&(ie+=a.value/q*Math.PI*2);const h=o+Math.max(.001,i),c="rose"===v?se(a.value):ae;/* @__PURE__ */
5
- return p("path",{d:e(te,le,re,c,o,h),fill:n,fillOpacity:ce(r,a.key)?.4:1,stroke:s.surface,strokeWidth:1,className:F?t.sweep:void 0,style:F?l(r,55):void 0,onMouseEnter:()=>U(r)},a.key)}),he.map(e=>{const t=e.right?ee-6:6,l=e.right?te+ae+14:te-ae-14;/* @__PURE__ */
4
+ /* @__PURE__ */p("title",{id:E,children:C.breakdown(W(q),D.length)}),D.map((a,r)=>{const n=Z(a),s="rose"===v?ne(r):ie,i="rose"===v?ne.step:a.value/q*Math.PI*2-b;"rose"!==v&&(ie+=a.value/q*Math.PI*2);const h=s+Math.max(.001,i),c="rose"===v?se(a.value):ae;/* @__PURE__ */
5
+ return p("path",{d:l(te,le,re,c,s,h),fill:n,fillOpacity:ce(r,a.key)?.4:1,stroke:o.surface,strokeWidth:1,className:F?e.sweep:void 0,style:F?t(r,55):void 0,onMouseEnter:()=>U(r)},a.key)}),he.map(e=>{const t=e.right?ee-6:6,l=e.right?te+ae+14:te-ae-14;/* @__PURE__ */
6
6
  return g("g",{children:[
7
- /* @__PURE__ */p("polyline",{points:`${e.anchor[0].toFixed(1)},${e.anchor[1].toFixed(1)} ${l},${e.y.toFixed(1)} ${t},${e.y.toFixed(1)}`,fill:"none",stroke:s.grid,strokeWidth:1}),
8
- /* @__PURE__ */p("text",{x:t,y:e.y-2,fontSize:11,fill:s.label,textAnchor:e.right?"end":"start",children:e.label}),
9
- /* @__PURE__ */p("text",{x:t,y:e.y+10,fontSize:11,fontWeight:600,fill:s.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:m(100*e.share,1,R)})]},`lbl-${e.key}`)}),j&&re>0&&/* @__PURE__ */p("text",{x:te,y:le+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:s.label,children:j})]}),me&&null!==T&&/* @__PURE__ */p("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */p(o,{title:me.label,rows:[{key:"value",label:C.value,color:Z(me),value:W(me.value)},{key:"share",label:C.share,color:s.muted,value:m(me.value/q*100,1,R)}]})}),
7
+ /* @__PURE__ */p("polyline",{points:`${e.anchor[0].toFixed(1)},${e.anchor[1].toFixed(1)} ${l},${e.y.toFixed(1)} ${t},${e.y.toFixed(1)}`,fill:"none",stroke:o.grid,strokeWidth:1}),
8
+ /* @__PURE__ */p("text",{x:t,y:e.y-2,fontSize:11,fill:o.label,textAnchor:e.right?"end":"start",children:e.label}),
9
+ /* @__PURE__ */p("text",{x:t,y:e.y+10,fontSize:11,fontWeight:600,fill:o.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:m(100*e.share,1,R)})]},`lbl-${e.key}`)}),j&&re>0&&/* @__PURE__ */p("text",{x:te,y:le+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:o.label,children:j})]}),me&&null!==T&&/* @__PURE__ */p("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */p(n,{title:me.label,rows:[{key:"value",label:C.value,color:Z(me),value:W(me.value)},{key:"share",label:C.share,color:o.muted,value:m(me.value/q*100,1,R)}]})}),
10
10
  /* @__PURE__ */p("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:D.map((e,t)=>/* @__PURE__ */g("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
11
11
  /* @__PURE__ */p("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:Z(e)}}),
12
12
  /* @__PURE__ */p("span",{className:"flex-1 truncate",children:e.label}),
@@ -1,4 +1,4 @@
1
- import{Popover as e}from"./chunk-KXPXLUNM.js";import{IconButton_default as r}from"./chunk-SV5RRBVA.js";import{Icon as n}from"./chunk-ISVODSRP.js";import{Tooltip as a}from"./chunk-SOZCWT6I.js";import{useShellStrings as t}from"./chunk-IUVGHHR3.js";import{useRef as i}from"react";import{jsx as l,jsxs as o,Fragment as s}from"react/jsx-runtime";var c={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]},u={alignItems:"flex-start",paddingTop:"var(--space-8)",paddingBottom:"var(--space-4)"};function d({value:d,onChange:m,options:h,label:p,emptyValue:f,columns:g=5,cell:v,header:w,onPreview:b,tooltips:x=!0,disabled:N=!1,className:k=""}){const j=t(),y=j.iconPicker,A=j.iconNames,I=e=>e.label??A[e.value]??e.value,C=i([]),R=Math.max(0,h.findIndex(e=>e.value===d)),V=h[R],D=V?.value===f,M=i(null);/* @__PURE__ */
2
- return l(e,{className:k,disabled:N,triggerLabel:V?y.button(p,I(V)):p,"aria-label":p,initialFocus:M,panelClassName:"!p-2",trigger:/* @__PURE__ */o("span",{className:"inline-flex items-center gap-2",children:[/* @__PURE__ */l("span",D||!V?{className:"text-sm",children:V?I(V):""}:{"aria-hidden":"true",className:"inline-flex [&_svg]:h-4 [&_svg]:w-4",children:V.icon}),
1
+ import{Popover as e}from"./chunk-RJVIKGHJ.js";import{IconButton_default as r}from"./chunk-NWS5G7FE.js";import{Icon as n}from"./chunk-ISVODSRP.js";import{Tooltip as a}from"./chunk-F2RAIGCG.js";import{useShellStrings as t}from"./chunk-IUVGHHR3.js";import{useRef as i}from"react";import{jsx as l,jsxs as o,Fragment as s}from"react/jsx-runtime";var c={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]},u={alignItems:"flex-start",paddingTop:"var(--space-8)",paddingBottom:"var(--space-4)"};function d({value:d,onChange:m,options:h,label:p,emptyValue:f,columns:g=5,cell:v,header:w,onPreview:b,tooltips:x=!0,disabled:N=!1,className:k=""}){const I=t(),j=I.iconPicker,y=I.iconNames,A=e=>e.label??y[e.value]??e.value,C=i([]),G=Math.max(0,h.findIndex(e=>e.value===d)),R=h[G],D=R?.value===f,H=i(null);/* @__PURE__ */
2
+ return l(e,{className:k,disabled:N,triggerLabel:R?j.button(p,A(R)):p,"aria-label":p,initialFocus:H,panelClassName:"!p-2",trigger:/* @__PURE__ */o("span",{className:"inline-flex items-center gap-2",children:[/* @__PURE__ */l("span",D||!R?{className:"text-sm",children:R?A(R):""}:{"aria-hidden":"true",className:"inline-flex [&_svg]:h-4 [&_svg]:w-4",children:R.icon}),
3
3
  /* @__PURE__ */l(n,{name:"chevron-down",className:"h-4 w-4"})]}),children:({close:e})=>/* @__PURE__ */o(s,{children:["function"==typeof w?w({close:e}):w,
4
- /* @__PURE__ */l("div",{role:"listbox","aria-label":p,className:v?"grid gap-1 rosh-one-height-rows":"grid gap-1",style:{gridTemplateColumns:`repeat(${g}, ${v?.width??"2rem"})`},children:h.map((n,t)=>{const i=n.value===d,o=/* @__PURE__ */l(r,{ref:e=>{C.current[t]=e,t===R&&(M.current=e)},role:"option","aria-selected":i,"aria-label":I(n),pressed:i,tabIndex:t===R?0:-1,onKeyDown:e=>((e,r)=>{const n=c[r.key];if(!n)return;r.preventDefault();const a=Math.floor(e/g)+n[0],t=e%g+n[1];if(a<0||t<0||t>=g)return;const i=a*g+t;if(!(i>=h.length)){for(const[e,r]of C.current.entries())r?.setAttribute("tabindex",e===i?"0":"-1");C.current[i]?.focus()}})(t,e),onClick:()=>{m(n.value),e()},onMouseEnter:b?e=>b(n.value,e.currentTarget):void 0,style:v?{width:v.width,height:"auto",minHeight:v.height,...v.words?u:null}:void 0,children:/* @__PURE__ */l("span",{"aria-hidden":"true",className:v?"inline-flex":"inline-flex [&_svg]:h-4 [&_svg]:w-4",children:n.icon})},n.value);return x?/* @__PURE__ */l(a,{content:I(n),children:o},n.value):o})})]})})}export{d as IconPicker};
4
+ /* @__PURE__ */l("div",{role:"listbox","aria-label":p,className:v?"grid gap-1 rosh-one-height-rows":"grid gap-1",style:{gridTemplateColumns:`repeat(${g}, ${v?.width??"2rem"})`},children:h.map((n,t)=>{const i=n.value===d,o=/* @__PURE__ */l(r,{ref:e=>{C.current[t]=e,t===G&&(H.current=e)},role:"option","aria-selected":i,"aria-label":A(n),pressed:i,tabIndex:t===G?0:-1,onKeyDown:e=>((e,r)=>{const n=c[r.key];if(!n)return;r.preventDefault();const a=Math.floor(e/g)+n[0],t=e%g+n[1];if(a<0||t<0||t>=g)return;const i=a*g+t;if(!(i>=h.length)){for(const[e,r]of C.current.entries())r?.setAttribute("tabindex",e===i?"0":"-1");C.current[i]?.focus()}})(t,e),onClick:()=>{m(n.value),e()},onMouseEnter:b?e=>b(n.value,e.currentTarget):void 0,style:v?{width:v.width,height:"auto",minHeight:v.height,...v.words?u:null}:void 0,children:/* @__PURE__ */l("span",{"aria-hidden":"true",className:v?"inline-flex":"inline-flex [&_svg]:h-4 [&_svg]:w-4",children:n.icon})},n.value);return x?/* @__PURE__ */l(a,{content:A(n),children:o},n.value):o})})]})})}export{d as IconPicker};
@@ -0,0 +1,9 @@
1
+ import{AccessibleTable as e}from"./chunk-ZDFMYAQB.js";import{bumpPath as t}from"./chunk-VFC6QUEN.js";import{useHighlight as n}from"./chunk-CNYAHYE6.js";import{ChartTooltip as o}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as l,CHART_INK as r}from"./chunk-TZFACUMR.js";import{usePlotWidth as a}from"./chunk-MAFUXCPZ.js";import{useShellStrings as i,useShellLocale as s}from"./chunk-IUVGHHR3.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useRef as c,useState as m}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function f({nodes:f,links:k,height:p=320,width:x,nodeWidth:g=14,nodePadding:y=12,formatValue:v,className:M,emptyLabel:w}){const b=i().charts,j=s(),$=v??(e=>h(e,j)),N=w??b.noFlows,F=c(null),A=a(F),C=x??A,[E,H]=m(null),{highlighted:Q}=n();if(0===f.length||0===k.length)/* @__PURE__ */
2
+ return d("div",{className:M,ref:F,children:/* @__PURE__ */d("p",{className:"py-8 text-center text-sm text-gray-500",children:N})});const U=[...new Set(f.map(e=>e.depth))].sort((e,t)=>e-t),V=e=>U.length<=1?0:U.indexOf(e)/(U.length-1)*(C-g-140)+70,z=new Map(f.map(e=>{const t=k.filter(t=>t.from===e.key).reduce((e,t)=>e+t.value,0),n=k.filter(t=>t.to===e.key).reduce((e,t)=>e+t.value,0);return[e.key,Math.max(t,n,e.value??0)]})),O=/* @__PURE__ */new Map;for(const e of f)O.set(e.depth,[...O.get(e.depth)??[],e]);const R=Math.max(...[...O.values()].map(e=>e.reduce((e,t)=>e+(z.get(t.key)??0),0))),W=p-20,Y=R>0?(W-y*(Math.max(...[...O.values()].map(e=>e.length))-1))/R:0,Z=/* @__PURE__ */new Map;for(const[e,t]of O){const n=t.map(e=>Math.max(2,(z.get(e.key)??0)*Y)),o=n.reduce((e,t)=>e+t,0)+y*(t.length-1),l=n.reduce((e,t)=>e+Math.max(0,t-2),0),r=o>W&&l>0?Math.max(0,1-(o-W)/l):1;let a=10;t.forEach((t,o)=>{const l=2+Math.max(0,n[o]-2)*r;Z.set(t.key,{x:V(e),y:a,h:l,index:o}),a+=l+y})}const B=/* @__PURE__ */new Map,D=/* @__PURE__ */new Map,I=/* @__PURE__ */new Map,L=(e,t)=>e.from===t||e.to===t,P="link"===E?.kind?k[E.index]:void 0,S="node"===E?.kind?f.find(e=>e.key===E.key):void 0;/* @__PURE__ */
3
+ return u("div",{className:`relative ${M??""}`,ref:F,children:[
4
+ /* @__PURE__ */u("svg",{width:"100%",height:p,viewBox:`0 0 ${C} ${p}`,role:"img","aria-label":b.sankey(f.length,k.length),onMouseLeave:()=>H(null),children:[k.map((e,n)=>{const o=Z.get(e.from),r=Z.get(e.to);if(!o||!r)return null;const a=Math.max(1,e.value*Y),i=o.y+(B.get(e.from)??0)+a/2,s=r.y+(D.get(e.to)??0)+a/2;B.set(e.from,(B.get(e.from)??0)+a),D.set(e.to,(D.get(e.to)??0)+a);const h=o.x+g,c=r.x,m=l(o.index,e.color),u=`${e.from}→${e.to}`,f=I.get(u)??0;I.set(u,f+1);const k=((e,t)=>E?"link"===E.kind?E.index===t:L(e,E.key):null!==Q?L(e,Q):null)(e,n);/* @__PURE__ */
5
+ return d("path",{d:t([[h,i],[c,s]]),fill:"none",stroke:m,strokeWidth:a,strokeOpacity:null===k||k?.42:.12,onMouseEnter:()=>H({kind:"link",index:n})},f?`${u}#${f}`:u)}),f.map(e=>{const t=Z.get(e.key);if(!t)return null;const n=t.x>C/2,o=(a=e.key,E?"node"===E.kind?E.key===a:L(k[E.index],a):null!==Q?Q===a:null);var a;/* @__PURE__ */
6
+ return u("g",{opacity:null===o||o?1:.45,onMouseEnter:()=>H({kind:"node",key:e.key}),children:[
7
+ /* @__PURE__ */d("rect",{x:t.x,y:t.y,width:g,height:t.h,rx:2,fill:l(t.index,e.color,e.tone)}),
8
+ /* @__PURE__ */d("text",{x:n?t.x-8:t.x+g+8,y:t.y+t.h/2+4,textAnchor:n?"end":"start",fontSize:11,fill:r.label,children:e.label})]},e.key)})]}),P&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(o,{title:`${P.from} → ${P.to}`,rows:[{key:"value",label:b.flow,color:l(Z.get(P.from)?.index??0,P.color),value:$(P.value)}]})}),S&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(o,{title:S.label,rows:[{key:"value",label:b.throughput,color:l(Z.get(S.key)?.index??0,S.color,S.tone),value:$(z.get(S.key)??0)}]})}),
9
+ /* @__PURE__ */d(e,{caption:b.sankey(f.length,k.length),head:[b.tableFrom,b.tableTo,b.value],rows:k.map(e=>[e.from,e.to,$(e.value)])})]})}export{f as SankeyChart};