efficient-shell 11.8.0 → 11.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (374) hide show
  1. package/README.md +9 -0
  2. package/dist/{Browser-NMILHEUX.js → Browser-FIRNNCSC.js} +17 -17
  3. package/dist/Calculator-ELI5Z3XW.js +29 -0
  4. package/dist/{CurrencyConverter-TAWZDMT4.js → CurrencyConverter-LU7QXMOI.js} +9 -9
  5. package/dist/{Documents-SDOY3ZA3.js → Documents-CE7YKNJM.js} +24 -24
  6. package/dist/Files-ARRIIZZ6.js +88 -0
  7. package/dist/{Notepad-DZSDABU7.js → Notepad-HNED2SWM.js} +10 -10
  8. package/dist/PdfViewer-ZRDIG2L2.js +1 -0
  9. package/dist/PomodoroTimer-ZJ432VPC.js +91 -0
  10. package/dist/{Preview-6Z6K5QLK.js → Preview-OGSYTTKC.js} +38 -38
  11. package/dist/Sidebar-ETWHTFNP.js +44 -0
  12. package/dist/Spreadsheet-4HZR2TUV.js +75 -0
  13. package/dist/{Stock-HJN2BSAD.js → Stock-4BOTUHWE.js} +3 -3
  14. package/dist/{Weather-G7AOUS36.js → Weather-NDUOK3P3.js} +21 -21
  15. package/dist/{WorldClock-GE3DGYYU.js → WorldClock-FH6NFTOM.js} +4 -4
  16. package/dist/ai/index.js +78 -78
  17. package/dist/apps/index.js +1 -1
  18. package/dist/bin/media-host-check.js +1 -1
  19. package/dist/bin/ui-check.js +1 -1
  20. package/dist/brand.css +1 -1
  21. package/dist/charts/BoxPlotChart.js +1 -1
  22. package/dist/charts/CandlestickChart.js +1 -1
  23. package/dist/charts/CartesianPlot.js +1 -1
  24. package/dist/charts/ChartBrush.js +1 -1
  25. package/dist/charts/ChartFrame.js +1 -1
  26. package/dist/charts/ChartSkeleton.js +1 -1
  27. package/dist/charts/ChartTooltip.js +1 -1
  28. package/dist/charts/ChordChart.js +1 -1
  29. package/dist/charts/ColumnChart.js +1 -1
  30. package/dist/charts/FunnelChart.js +1 -1
  31. package/dist/charts/HeatmapChart.js +1 -1
  32. package/dist/charts/HistogramChart.js +1 -1
  33. package/dist/charts/Meter.js +1 -1
  34. package/dist/charts/PieChart.js +1 -1
  35. package/dist/charts/RadarChart.js +1 -1
  36. package/dist/charts/RadialBarChart.js +1 -1
  37. package/dist/charts/RangeChart.js +1 -1
  38. package/dist/charts/RankedBars.js +1 -1
  39. package/dist/charts/SankeyChart.js +1 -1
  40. package/dist/charts/ScatterChart.js +1 -1
  41. package/dist/charts/SpecChart.js +1 -1
  42. package/dist/charts/StatTile.js +1 -1
  43. package/dist/charts/SunburstChart.js +1 -1
  44. package/dist/charts/TimeSeriesChart.js +1 -1
  45. package/dist/charts/TreemapChart.js +1 -1
  46. package/dist/charts/WaterfallChart.js +1 -1
  47. package/dist/{chunk-CD7UWMPX.js → chunk-276JUQXK.js} +1 -1
  48. package/dist/{chunk-6EIZOX6W.js → chunk-2CPYXRR2.js} +8 -8
  49. package/dist/{chunk-SXNQHIBY.js → chunk-2JTG3U5L.js} +1 -1
  50. package/dist/{chunk-NGLU2GKE.js → chunk-2UTCGWMZ.js} +3 -3
  51. package/dist/{chunk-JNQF5CBB.js → chunk-2V3LKX7G.js} +5 -5
  52. package/dist/{chunk-WDQI3FV6.js → chunk-36VIGB6J.js} +6 -6
  53. package/dist/{chunk-4XNVIKZZ.js → chunk-37JAU3U7.js} +3 -3
  54. package/dist/{chunk-DU4WEVNS.js → chunk-4L4GQW7P.js} +1 -1
  55. package/dist/chunk-4LQRLYB4.js +22 -0
  56. package/dist/{chunk-4EZIWLJJ.js → chunk-4UKPDURO.js} +1 -1
  57. package/dist/{chunk-SDDV3UCN.js → chunk-4VF66WBB.js} +12 -12
  58. package/dist/chunk-5CPRZ27M.js +28 -0
  59. package/dist/{chunk-YCWALB3A.js → chunk-5DZN6ZDE.js} +9 -9
  60. package/dist/{chunk-SS5SQMIB.js → chunk-5MGNT7XM.js} +2 -2
  61. package/dist/{chunk-EYPKBJYG.js → chunk-5PP435FL.js} +1 -1
  62. package/dist/chunk-5XVXYBIQ.js +8 -0
  63. package/dist/{chunk-EOWUUOVE.js → chunk-7N4P6LGD.js} +1 -1
  64. package/dist/chunk-7QRKZOXR.js +12 -0
  65. package/dist/{chunk-7TZV6G2F.js → chunk-A2SP4IZV.js} +1 -1
  66. package/dist/chunk-A4FCXZSY.js +8 -0
  67. package/dist/{chunk-JFV5CQN4.js → chunk-A65PRSKV.js} +4 -4
  68. package/dist/chunk-ABKCC7VB.js +9 -0
  69. package/dist/chunk-ABKFALDE.js +8 -0
  70. package/dist/{chunk-X5TZHOTI.js → chunk-AFROFSDW.js} +1 -1
  71. package/dist/chunk-AJ6HMM4P.js +20 -0
  72. package/dist/chunk-ALMBY7QO.js +6 -0
  73. package/dist/{chunk-72LJMEL6.js → chunk-B4D23ZLJ.js} +1 -1
  74. package/dist/{chunk-FXOYA2VJ.js → chunk-BAT5B2LE.js} +1 -1
  75. package/dist/{chunk-SHO35OPO.js → chunk-BXTSBORU.js} +3 -3
  76. package/dist/{chunk-47DO42IW.js → chunk-CFFT5OCV.js} +1 -1
  77. package/dist/{chunk-WOXQODYQ.js → chunk-D2BXHFYK.js} +1 -1
  78. package/dist/{chunk-RHDM7HRD.js → chunk-DGA4SO27.js} +2 -2
  79. package/dist/{chunk-OTVK7DJM.js → chunk-DH2DKQKS.js} +1 -1
  80. package/dist/{chunk-VAK5FQXH.js → chunk-DWR6RVX5.js} +4 -4
  81. package/dist/{chunk-LT6PG6UW.js → chunk-DXFG4H4V.js} +1 -1
  82. package/dist/{chunk-4TYIYL56.js → chunk-E2LRAOCL.js} +10 -10
  83. package/dist/{chunk-MS5APD3V.js → chunk-ED6HJBCO.js} +1 -1
  84. package/dist/{chunk-C764JODK.js → chunk-EMUZJMR3.js} +1 -1
  85. package/dist/chunk-EOVXFXVV.js +2 -0
  86. package/dist/{chunk-MXGDFO6A.js → chunk-EOYGTVNS.js} +5 -5
  87. package/dist/{chunk-FA5FBNWF.js → chunk-EP5BHBZQ.js} +1 -1
  88. package/dist/chunk-FBACFP4U.js +4 -0
  89. package/dist/{chunk-JFBL4PR3.js → chunk-FNMF42DQ.js} +2 -2
  90. package/dist/{chunk-ORIXCEKO.js → chunk-FOHOSUK3.js} +1 -1
  91. package/dist/{chunk-ECJKIPWU.js → chunk-FRNSCVPN.js} +1 -1
  92. package/dist/chunk-FSRHVB4A.js +9 -0
  93. package/dist/{chunk-YQFGRYEF.js → chunk-FTGA5IPI.js} +14 -14
  94. package/dist/{chunk-JPNAEN53.js → chunk-FZM3ZPW3.js} +1 -1
  95. package/dist/chunk-G2BZ7NCM.js +19 -0
  96. package/dist/{chunk-IXOL7Y3Z.js → chunk-GNWK77U7.js} +1 -1
  97. package/dist/{chunk-OPN4I565.js → chunk-GPCTDEXQ.js} +1 -1
  98. package/dist/{chunk-C6YAFZG3.js → chunk-GV5VNWPG.js} +2 -2
  99. package/dist/{chunk-JSG2AKCG.js → chunk-H5YD72OP.js} +1 -1
  100. package/dist/{chunk-RDYFZHT3.js → chunk-HBS4HYQM.js} +1 -1
  101. package/dist/{chunk-TQE6O2JA.js → chunk-HRXQCHKI.js} +3 -3
  102. package/dist/chunk-HTTICQBP.js +27 -0
  103. package/dist/{chunk-LJN77RG6.js → chunk-HWFBNYNI.js} +1 -1
  104. package/dist/chunk-HYNUJY6W.js +13 -0
  105. package/dist/{chunk-5CXFABVD.js → chunk-HYXDKY2L.js} +1 -1
  106. package/dist/{chunk-5F2AIDPY.js → chunk-IAUEISDQ.js} +9 -9
  107. package/dist/{chunk-OBJGUJIE.js → chunk-IDRAW6MT.js} +2 -2
  108. package/dist/chunk-IEHTZR5M.js +7 -0
  109. package/dist/chunk-IH2KC3NQ.js +5 -0
  110. package/dist/{chunk-RYLTVHCV.js → chunk-IKKQ4P4R.js} +12 -12
  111. package/dist/{chunk-MDYJVXWD.js → chunk-IW2QNPDG.js} +2 -2
  112. package/dist/chunk-IXSSBGRD.js +13 -0
  113. package/dist/{chunk-54NMFQMW.js → chunk-JADBOQ7S.js} +5 -5
  114. package/dist/{chunk-ZGOHRLXG.js → chunk-JGVKGEIV.js} +1 -1
  115. package/dist/{chunk-XYECIBVX.js → chunk-JJHPPTM6.js} +1 -1
  116. package/dist/{chunk-TMMNCXQT.js → chunk-KMSK6QQB.js} +1 -1
  117. package/dist/{chunk-4MBYFQOI.js → chunk-KPFYXVCO.js} +9 -9
  118. package/dist/{chunk-ZXVJL7MS.js → chunk-KZ6JVHFI.js} +1 -1
  119. package/dist/{chunk-4ULRP4Y4.js → chunk-L3RLB37Y.js} +1 -1
  120. package/dist/{chunk-ZD36QKQS.js → chunk-L433UT5E.js} +1 -1
  121. package/dist/{chunk-V6Y4OC6K.js → chunk-LCHU3ZG4.js} +8 -8
  122. package/dist/{chunk-VCMHBUKI.js → chunk-LE5LWALR.js} +1 -1
  123. package/dist/{chunk-VHF3CJVO.js → chunk-LLNWE7DR.js} +30 -30
  124. package/dist/{chunk-B634WHJ2.js → chunk-LNGLJA6K.js} +2 -2
  125. package/dist/{chunk-QVZKRROQ.js → chunk-LPTN55KO.js} +1 -1
  126. package/dist/chunk-LVHQJ5TW.js +9 -0
  127. package/dist/{chunk-AFYLVV74.js → chunk-LZJCULO7.js} +1 -1
  128. package/dist/{chunk-E6GDAV5R.js → chunk-MFDOGLFO.js} +3 -3
  129. package/dist/chunk-MG4IUKVP.js +11 -0
  130. package/dist/{chunk-SXQZ5GTA.js → chunk-MOL2ND6G.js} +6 -6
  131. package/dist/{chunk-4QK4WNPB.js → chunk-MQHUVZWM.js} +1 -1
  132. package/dist/{chunk-7ELJQL7J.js → chunk-MWKLLAJT.js} +1 -1
  133. package/dist/chunk-N3OJ47VK.js +1 -0
  134. package/dist/{chunk-RQDVAUXD.js → chunk-N5KO2IHG.js} +4 -4
  135. package/dist/chunk-N7645DNN.js +6 -0
  136. package/dist/{chunk-DGNAUGZ3.js → chunk-NFNDXE5O.js} +4 -4
  137. package/dist/{chunk-IDI3IOY4.js → chunk-NGUXPP5Q.js} +65 -65
  138. package/dist/{chunk-QQ2LDC6C.js → chunk-NJN5IKWO.js} +1 -1
  139. package/dist/{chunk-QYL26AB4.js → chunk-NSYCJTHE.js} +1 -1
  140. package/dist/chunk-NTKNM25F.js +15 -0
  141. package/dist/{chunk-IMDGMUE3.js → chunk-O4OFURPC.js} +1 -1
  142. package/dist/{chunk-5H4SWQGM.js → chunk-OE77XFOV.js} +1 -1
  143. package/dist/{chunk-DJW7CM3W.js → chunk-ONIL7WXO.js} +1 -1
  144. package/dist/{chunk-2E2SUEEE.js → chunk-OQG3XO4Y.js} +1 -1
  145. package/dist/{chunk-PVPMJ5G2.js → chunk-OS2KE6QG.js} +4 -4
  146. package/dist/{chunk-VQBEZNHC.js → chunk-OUXSI6X4.js} +1 -1
  147. package/dist/{chunk-CLTRQ7AQ.js → chunk-OYTRB237.js} +1 -1
  148. package/dist/{chunk-KTCM64DQ.js → chunk-OZEPYQ7E.js} +1 -1
  149. package/dist/{chunk-3NRQNKVP.js → chunk-P7NO3NGC.js} +11 -11
  150. package/dist/{chunk-SX5BSWTN.js → chunk-PAC4LK2N.js} +5 -5
  151. package/dist/{chunk-UEISJFZH.js → chunk-PBMAMVSE.js} +5 -5
  152. package/dist/{chunk-O3MBPAWZ.js → chunk-PC44XTGN.js} +1 -1
  153. package/dist/chunk-PEVWAJUR.js +7 -0
  154. package/dist/{chunk-6UBOLLBC.js → chunk-PMKR2BF2.js} +21 -21
  155. package/dist/{chunk-JH4ZCPHW.js → chunk-PR42NIDL.js} +10 -10
  156. package/dist/{chunk-FT3QRQWY.js → chunk-PTWKG635.js} +3 -3
  157. package/dist/{chunk-ESZHN7PV.js → chunk-QIEAZN6Z.js} +1 -1
  158. package/dist/{chunk-DQQKG46I.js → chunk-QIVIQUKB.js} +7 -7
  159. package/dist/{chunk-KQOY4RGP.js → chunk-QL5E3MU3.js} +1 -1
  160. package/dist/chunk-QRZBLNOQ.js +4 -0
  161. package/dist/{chunk-G3KXB7SP.js → chunk-QVAOSKFO.js} +11 -11
  162. package/dist/{chunk-2UO47XB4.js → chunk-R64OZ6TC.js} +26 -12
  163. package/dist/{chunk-SYZLS2JA.js → chunk-RDKIYORS.js} +1 -1
  164. package/dist/{chunk-JTMEFXRL.js → chunk-RDTKMSEK.js} +1 -1
  165. package/dist/{chunk-RRE2NNFS.js → chunk-RKL47W7I.js} +6 -6
  166. package/dist/{chunk-3V5GSTZI.js → chunk-RPTOAKLB.js} +1 -1
  167. package/dist/{chunk-LJAYUDN2.js → chunk-RQ6TC6RM.js} +1 -1
  168. package/dist/{chunk-T7PVHIXI.js → chunk-RSJLN3EG.js} +1 -1
  169. package/dist/{chunk-JQBVSPF5.js → chunk-S4FPYCUU.js} +3 -3
  170. package/dist/{chunk-SAP4YI2Y.js → chunk-SDAX6BXF.js} +1 -1
  171. package/dist/{chunk-KGSOOXA7.js → chunk-SIA3W7VE.js} +6 -6
  172. package/dist/{chunk-MTIP5DH2.js → chunk-SJQKEIS7.js} +3 -3
  173. package/dist/{chunk-OH5L6HYW.js → chunk-SXBOODCJ.js} +4 -4
  174. package/dist/{chunk-3IUPYCW3.js → chunk-SZTIP6T7.js} +1 -1
  175. package/dist/{chunk-IBS7647X.js → chunk-T2ZFXPQV.js} +21 -21
  176. package/dist/{chunk-XWFLIGDQ.js → chunk-TE6R53YD.js} +1 -1
  177. package/dist/{chunk-M4BPHBKI.js → chunk-TKE3EF2U.js} +1 -1
  178. package/dist/{chunk-XQZL6JDD.js → chunk-TURECNEK.js} +4 -4
  179. package/dist/{chunk-AWKJZSTO.js → chunk-U6IJL4Q5.js} +1 -1
  180. package/dist/{chunk-DUGYWX2R.js → chunk-U7T2ONAY.js} +2 -2
  181. package/dist/chunk-UGOSZLCD.js +14 -0
  182. package/dist/{chunk-355CRSFS.js → chunk-UIN2LUCZ.js} +13 -13
  183. package/dist/{chunk-P4VKU3SL.js → chunk-UZ7TKJRO.js} +1 -1
  184. package/dist/{chunk-BTRV3SMB.js → chunk-V6LPIDZ6.js} +1 -1
  185. package/dist/chunk-VNTJ7QO5.js +1 -0
  186. package/dist/{chunk-SL77N7VT.js → chunk-VTXCCFJ4.js} +3 -3
  187. package/dist/chunk-WB6E6CSH.js +14 -0
  188. package/dist/{chunk-CRILBBSU.js → chunk-WDZUPDNC.js} +1 -1
  189. package/dist/{chunk-CJH2BGXY.js → chunk-WGLHB6WE.js} +1 -1
  190. package/dist/{chunk-MDV7UQJD.js → chunk-WMS2DCRV.js} +10 -10
  191. package/dist/chunk-WQGBYFS3.js +8 -0
  192. package/dist/{chunk-PCTOL2FX.js → chunk-WTTXLWMK.js} +8 -8
  193. package/dist/{chunk-UGBYAVJV.js → chunk-WYSNMIZN.js} +1 -1
  194. package/dist/{chunk-EKCQ7XBZ.js → chunk-WZMZ3N5B.js} +2 -2
  195. package/dist/chunk-Y2LWUBXX.js +2 -0
  196. package/dist/{chunk-BW47XJLH.js → chunk-YGCVMPIU.js} +1 -1
  197. package/dist/{chunk-3XTSXZAC.js → chunk-YIFRSPUM.js} +10 -10
  198. package/dist/{chunk-EN5NXWT6.js → chunk-YKEB576T.js} +1 -1
  199. package/dist/{chunk-4TGZODSH.js → chunk-YM4XIO4K.js} +5 -5
  200. package/dist/chunk-YMBNVMFU.js +11 -0
  201. package/dist/{chunk-N7U622NC.js → chunk-YY5TUQS4.js} +3 -3
  202. package/dist/{chunk-LXL2UCUR.js → chunk-Z32K3LIJ.js} +1 -1
  203. package/dist/{chunk-P3RXXWXN.js → chunk-ZDDYTXPK.js} +6 -6
  204. package/dist/{chunk-X55LUERI.js → chunk-ZGQ6H2PU.js} +4 -4
  205. package/dist/{chunk-NU5HN3FZ.js → chunk-ZM2NOLT6.js} +12 -12
  206. package/dist/chunk-ZQJTLJUF.js +2 -0
  207. package/dist/{chunk-DANLBFBD.js → chunk-ZRLWE3JM.js} +1 -1
  208. package/dist/chunk-ZVEDA462.js +3 -0
  209. package/dist/{chunk-TGGUYAWA.js → chunk-ZWLOVJWN.js} +1 -1
  210. package/dist/data/DataTable.js +1 -1
  211. package/dist/data/EntityList.js +1 -1
  212. package/dist/data/Kanban.js +1 -1
  213. package/dist/data/ListFooter.js +1 -1
  214. package/dist/data/ListLoadError.js +1 -1
  215. package/dist/data/Pagination.js +1 -1
  216. package/dist/data/ResizableTable.js +1 -1
  217. package/dist/file-intake/index.js +1 -1
  218. package/dist/forms/AlignmentGrid.js +1 -1
  219. package/dist/forms/BorderInput.js +1 -1
  220. package/dist/forms/BrandAssetEditor.js +1 -1
  221. package/dist/forms/Button.js +1 -1
  222. package/dist/forms/Calendar.js +1 -1
  223. package/dist/forms/ColorPicker.js +1 -1
  224. package/dist/forms/ComposerAttachments.js +1 -1
  225. package/dist/forms/CornersInput.js +1 -1
  226. package/dist/forms/DatePicker.js +1 -1
  227. package/dist/forms/DateRangePicker.js +1 -1
  228. package/dist/forms/DateTimePicker.js +1 -1
  229. package/dist/forms/DisplayChips.js +1 -1
  230. package/dist/forms/FilePicker.js +1 -1
  231. package/dist/forms/FormErrorSummary.js +1 -1
  232. package/dist/forms/IconButton.js +1 -1
  233. package/dist/forms/IconPicker.js +1 -1
  234. package/dist/forms/ImageFocusPoint.js +1 -1
  235. package/dist/forms/Input.js +1 -1
  236. package/dist/forms/InputNumber.js +1 -1
  237. package/dist/forms/LinkPicker.d.ts +22 -0
  238. package/dist/forms/LinkPicker.js +1 -1
  239. package/dist/forms/MediaLibrary.js +1 -1
  240. package/dist/forms/MediaUploadField.js +1 -1
  241. package/dist/forms/MediaUploadGrid.js +1 -1
  242. package/dist/forms/MediaUsedInList.js +1 -1
  243. package/dist/forms/NumericKeypad.js +1 -1
  244. package/dist/forms/PictureTiles.js +1 -1
  245. package/dist/forms/PositionInput.js +1 -1
  246. package/dist/forms/RenameField.js +1 -1
  247. package/dist/forms/Segmented.js +1 -1
  248. package/dist/forms/Select.js +1 -1
  249. package/dist/forms/SidesInput.js +1 -1
  250. package/dist/forms/Slider.js +1 -1
  251. package/dist/forms/Snippet.js +1 -1
  252. package/dist/forms/SplitButton.js +1 -1
  253. package/dist/forms/TagInput.js +1 -1
  254. package/dist/forms/TextToolbar.js +1 -1
  255. package/dist/forms/TimePicker.js +1 -1
  256. package/dist/forms/WidthsBar.js +1 -1
  257. package/dist/forms/mediaLibraryMenu.js +1 -1
  258. package/dist/forms/mediaMoveItems.js +1 -1
  259. package/dist/forms/textAlign.js +1 -1
  260. package/dist/forms/useFileIntake.js +1 -1
  261. package/dist/icons/index.js +1 -1
  262. package/dist/index.js +666 -666
  263. package/dist/locales/zh-Hans.js +1 -1
  264. package/dist/map/index.js +3 -3
  265. package/dist/markdown/index.js +1 -1
  266. package/dist/page-tabs/index.js +5 -5
  267. package/dist/pdf/index.js +1 -1
  268. package/dist/shell/Accordion.js +1 -1
  269. package/dist/shell/AppUpdateBanner.js +1 -1
  270. package/dist/shell/Avatar.js +1 -1
  271. package/dist/shell/Banner.js +1 -1
  272. package/dist/shell/Breadcrumbs.js +1 -1
  273. package/dist/shell/BudgetBar.js +1 -1
  274. package/dist/shell/Card.js +1 -1
  275. package/dist/shell/ColoredBadge.js +1 -1
  276. package/dist/shell/ConfirmDialog.js +1 -1
  277. package/dist/shell/ContainerFillChart.js +1 -1
  278. package/dist/shell/ContextMenu.js +1 -1
  279. package/dist/shell/CountBadge.js +1 -1
  280. package/dist/shell/Dialog.js +1 -1
  281. package/dist/shell/Drawer.js +1 -1
  282. package/dist/shell/DropdownMenu.js +1 -1
  283. package/dist/shell/EditableGrid.js +1 -1
  284. package/dist/shell/EmptyState.js +1 -1
  285. package/dist/shell/GlobalSearch.js +1 -1
  286. package/dist/shell/HelpCenter.js +1 -1
  287. package/dist/shell/IconRail.js +1 -1
  288. package/dist/shell/ImageLightbox.js +1 -1
  289. package/dist/shell/ItemCount.js +1 -1
  290. package/dist/shell/LanguageSelect.js +1 -1
  291. package/dist/shell/Markdown.js +1 -1
  292. package/dist/shell/MetricBar.js +1 -1
  293. package/dist/shell/MetricBarLegend.js +1 -1
  294. package/dist/shell/MilestoneTimeline.js +1 -1
  295. package/dist/shell/PageHeader.js +1 -1
  296. package/dist/shell/PopupMenu.js +1 -1
  297. package/dist/shell/ProductionTimeline.js +1 -1
  298. package/dist/shell/ResizeHandle.js +1 -1
  299. package/dist/shell/Result.js +1 -1
  300. package/dist/shell/SearchableSelect.js +1 -1
  301. package/dist/shell/SettingReset.js +1 -1
  302. package/dist/shell/SettingRow.js +1 -1
  303. package/dist/shell/SidebarLayout.js +1 -1
  304. package/dist/shell/SidebarNav.js +1 -1
  305. package/dist/shell/SortableList.js +1 -1
  306. package/dist/shell/Statistic.js +1 -1
  307. package/dist/shell/StatusBadge.js +1 -1
  308. package/dist/shell/StepChain.js +1 -1
  309. package/dist/shell/Stepper.js +1 -1
  310. package/dist/shell/Tabs.js +1 -1
  311. package/dist/shell/TimeAgo.js +1 -1
  312. package/dist/shell/TimelineTrack.js +1 -1
  313. package/dist/shell/Tooltip.js +1 -1
  314. package/dist/shell/TopNav.js +1 -1
  315. package/dist/shell/TransferProgress.js +1 -1
  316. package/dist/shell/Tree.js +1 -1
  317. package/dist/shell/discardGuard.js +1 -1
  318. package/dist/shell/language.js +1 -1
  319. package/dist/shell/strings.d.ts +129 -0
  320. package/dist/shell/strings.js +1 -1
  321. package/dist/shell/toast.js +1 -1
  322. package/dist/telemetry/index.js +1 -1
  323. package/dist/templates/AuthScreen.js +1 -1
  324. package/dist/templates/ChatTemplate.js +1 -1
  325. package/dist/templates/CheckoutTemplate.js +1 -1
  326. package/dist/templates/DashboardTemplate.js +1 -1
  327. package/dist/templates/DataTablePage.js +1 -1
  328. package/dist/templates/EmailTemplate.js +1 -1
  329. package/dist/templates/ErrorBoundary.js +1 -1
  330. package/dist/templates/ErrorPage.js +1 -1
  331. package/dist/templates/FormLayoutPage.js +1 -1
  332. package/dist/templates/GalleryTemplate.js +1 -1
  333. package/dist/ui/index.js +1 -1
  334. package/dist/version.js +1 -1
  335. package/package.json +1 -1
  336. package/dist/Calculator-E7AMPGD5.js +0 -29
  337. package/dist/Files-YQWVU6KZ.js +0 -88
  338. package/dist/PdfViewer-Y3SAVADX.js +0 -1
  339. package/dist/PomodoroTimer-RAZE37BO.js +0 -91
  340. package/dist/Sidebar-GQX7UM3M.js +0 -44
  341. package/dist/Spreadsheet-Q5N5KXGP.js +0 -37
  342. package/dist/chunk-34H3CK7R.js +0 -22
  343. package/dist/chunk-56KADF2B.js +0 -11
  344. package/dist/chunk-77AQNJE2.js +0 -9
  345. package/dist/chunk-7DI3VQCF.js +0 -2
  346. package/dist/chunk-7GTUUBS2.js +0 -28
  347. package/dist/chunk-7INZ7O3A.js +0 -5
  348. package/dist/chunk-CZMSOB2T.js +0 -9
  349. package/dist/chunk-EUAC2T5D.js +0 -2
  350. package/dist/chunk-F3ZFCQGP.js +0 -4
  351. package/dist/chunk-FO6UPEZH.js +0 -7
  352. package/dist/chunk-FSUQTN34.js +0 -14
  353. package/dist/chunk-GDQJBQ5B.js +0 -1
  354. package/dist/chunk-GELPD7EY.js +0 -12
  355. package/dist/chunk-GOZO6LU2.js +0 -8
  356. package/dist/chunk-HCXIXV4E.js +0 -8
  357. package/dist/chunk-IYXNRNAF.js +0 -8
  358. package/dist/chunk-K4JQ3FQI.js +0 -2
  359. package/dist/chunk-L7XIGRIT.js +0 -6
  360. package/dist/chunk-LGDMGDSV.js +0 -14
  361. package/dist/chunk-LKTUUNGJ.js +0 -1
  362. package/dist/chunk-M3JNILT2.js +0 -19
  363. package/dist/chunk-PFKXPSOM.js +0 -6
  364. package/dist/chunk-PLK2WHZG.js +0 -27
  365. package/dist/chunk-RABYGQQU.js +0 -8
  366. package/dist/chunk-RK7MN5L5.js +0 -3
  367. package/dist/chunk-RPL4H6LE.js +0 -9
  368. package/dist/chunk-UGGHQYDN.js +0 -11
  369. package/dist/chunk-VAPSWR5Q.js +0 -13
  370. package/dist/chunk-WMHZA4EO.js +0 -4
  371. package/dist/chunk-WUAKIM2B.js +0 -7
  372. package/dist/chunk-XZAEEX2H.js +0 -13
  373. package/dist/chunk-YDMXW2Q4.js +0 -15
  374. package/dist/chunk-ZS3TIQQ4.js +0 -20
package/README.md CHANGED
@@ -1112,6 +1112,13 @@ a product listing. A list over 10 options becomes a `SearchableSelect`.
1112
1112
  `onChange` and `onApply` get the picked thing's name as a second argument, so a
1113
1113
  host can fill a label with it.
1114
1114
 
1115
+ Two options for the typed address. `tidyAddress(typed)` is the host's tidy-up,
1116
+ run when the author leaves the box (blur, or Enter in the field) and on Apply —
1117
+ never while typing. The email designer passes its `https://` completion.
1118
+ `addressAddon({ url, onChange })` draws a host's part under the address box
1119
+ while the box has focus (the email designer's "Add · Coupon code" chip); a part
1120
+ that is clicked must keep the focus (prevent the default on mousedown).
1121
+
1115
1122
  A saved link is never changed just by opening it. A target, filter or value the
1116
1123
  host no longer offers shows as "(unavailable)" and is kept. A kind the author
1117
1124
  picks wins over what the URL looks like, until the link changes from outside
@@ -1754,6 +1761,8 @@ All exports are named — `import { Modal, ... } from 'efficient-shell'`.
1754
1761
  | `PdfViewer` | Lazy component — the PDF reader on its own, for embedding. See below. |
1755
1762
  | `BUILTIN_APP_INFO` | Per-app metadata for the document/web apps (Spreadsheets, Notepad, Documents, Preview, Files, Browser): display name, independent app version and one-line description. Drives each app's "About" dialog (window title menu → About <App>), which also shows the shell version. The dialog's words, and each app's description, are the strings catalog's `aboutApp` section; `description` here is its English default. |
1756
1763
 
1764
+ **Spreadsheets** computes and formats like Excel or Google Sheets: about 120 functions, references across sheets, a formula bar with autocomplete, number formats as Excel format codes, borders, merged cells, frozen rows and columns, sort, column filters, and find and replace. `.xlsx` opens and saves with formulas and formatting and needs no dependency; `.xls` and `.ods` open through the optional `xlsx` peer. A function the engine lacks shows `#NAME?` on screen, and the formula itself is kept and saved. A formula returns one value: no spilled dynamic arrays, charts or pivot tables.
1765
+
1757
1766
  #### An embedded PDF — `PdfViewer`
1758
1767
 
1759
1768
  `PdfActionButton` and `setPdfPreview` open a PDF in a Preview **window**. (An
@@ -1,32 +1,32 @@
1
- import{InputEndActionButton as e}from"./chunk-NGLU2GKE.js";import"./chunk-WUAKIM2B.js";import"./chunk-OTVK7DJM.js";import"./chunk-VCMHBUKI.js";import"./chunk-AYZY3YNC.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-N7U622NC.js";import{WindowTitle as n}from"./chunk-IDI3IOY4.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-QYL26AB4.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-2E2SUEEE.js";import{confirm as s}from"./chunk-PLK2WHZG.js";import"./chunk-7INZ7O3A.js";import"./chunk-P4VKU3SL.js";import"./chunk-3DVNXNTF.js";import"./chunk-ECJKIPWU.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-BW47XJLH.js";import"./chunk-O3MBPAWZ.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-F3ZOO23R.js";import"./chunk-LKTUUNGJ.js";import"./chunk-JPNAEN53.js";import"./chunk-CDAJKLGL.js";import"./chunk-G3KXB7SP.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-7DI3VQCF.js";import"./chunk-UQYNPYF4.js";import"./chunk-XWFLIGDQ.js";import{Icon as a}from"./chunk-2UO47XB4.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-CJH2BGXY.js";import"./chunk-QQ2LDC6C.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-TWVUQUUD.js";import"./chunk-GDQJBQ5B.js";import"./chunk-C3QOHMR6.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import{useRef as i,useEffect as l,useState as c}from"react";import{jsxs as m,jsx as u,Fragment as h}from"react/jsx-runtime";var d="react-os-shell:browser-bookmarks",p="react-os-shell:browser-homepage",k="https://en.wikipedia.org/wiki/Main_Page",b=[{label:"Wikipedia",url:"https://en.wikipedia.org/wiki/Main_Page"},{label:"DevDocs",url:"https://devdocs.io"},{label:"Example",url:"https://example.com"}],g=new Set(["ac ad ae af ag ai al am ao aq ar as at au aw ax az ba bb bd be bf bg bh bi","bj bm bn bo br bs bt bw by bz ca cc cd cf cg ch ci ck cl cm cn co cr cu cv","cw cx cy cz de dj dk dm do dz ec ee eg er es et eu fi fj fk fm fo fr ga gd","ge gf gg gh gi gl gm gn gp gq gr gs gt gu gw gy hk hm hn hr ht hu id ie il","im in io iq ir is it je jm jo jp ke kg kh ki km kn kp kr kw ky kz la lb lc","li lk lr ls lt lu lv ly ma mc md me mg mh mk ml mm mn mo mp mq mr ms mt mu","mv mw mx my mz na nc ne nf ng ni nl no np nr nu nz om pa pe pf pg ph pk pl","pm pn pr ps pt pw py qa re ro rs ru rw sa sb sc sd se sg sh si sk sl sm sn","so sr ss st su sv sx sy sz tc td tf tg th tj tk tl tm tn to tr tt tv tw tz","ua ug uk us uy uz va vc ve vg vi vn vu wf ws ye yt za zm zw","com net org edu gov mil int info biz name pro app dev xyz online site tech","store shop cloud design digital agency studio media news blog live life","world today email systems solutions services software page link space host","press wiki team group works careers finance capital energy academy"].join(" ").split(" "));function f(e){let t=e.trim();return t?/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:function(e){const t=/^([\w-]+\.)+([a-z]{2,})(\/.*)?$/i.exec(e);return null!==t&&g.has(t[2].toLowerCase())}(t)?"https://"+t:"https://duckduckgo.com/?q="+encodeURIComponent(t):""}var w=["duckduckgo.com","developer.mozilla.org","google.com","gmail.com","youtube.com","facebook.com","instagram.com","whatsapp.com","twitter.com","x.com","github.com","gitlab.com","linkedin.com","reddit.com","pinterest.com","amazon.com","amazon.ca","amazon.co.uk","apple.com","icloud.com","microsoft.com","outlook.com","live.com","office.com","netflix.com","spotify.com","paypal.com","stripe.com","chat.openai.com","chatgpt.com","claude.ai"];function x(){if("undefined"==typeof window)return b;try{const e=localStorage.getItem(d);if(!e)return b;const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e?.url))return t}catch{}return b}function y(){return"undefined"==typeof window?k:localStorage.getItem(p)||k}function v(){const h=i(void 0);void 0===h.current&&(h.current=t()),l(()=>{null!=h.current&&o(h.current)},[]);const k=h.current?f(h.current.url):"",[b,g]=c(y),[w,v]=c(k||b),[C,W]=c(w),[L,D]=c([w]),[U,z]=c(0),[S,E]=c(0),[R,K]=c(x),[G,H]=c(!1),[J,B]=c(null),T=i(null),M=i(null);l(()=>{try{localStorage.setItem(d,JSON.stringify(R))}catch{}},[R]);const P=e=>{const t=f(e);t&&(v(t),W(t),D(e=>{const o=e.slice(0,U+1);return o.push(t),o}),z(e=>e+1),H(!1))},Q=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},I=()=>{const e=J?.trim();e?(K(t=>[...t,{label:e,url:w}]),B(null)):B(null)};l(()=>{if(null===J)return;T.current?.focus(),T.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||B(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==J]);const A=e=>{K(t=>t.filter((t,o)=>o!==e))},O=U>0,X=U<L.length-1,Y=R.some(e=>e.url===w),F="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
1
+ import{InputEndActionButton as e}from"./chunk-2UTCGWMZ.js";import"./chunk-IEHTZR5M.js";import"./chunk-DH2DKQKS.js";import"./chunk-LE5LWALR.js";import"./chunk-AYZY3YNC.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-YY5TUQS4.js";import{WindowTitle as n}from"./chunk-NGUXPP5Q.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-NSYCJTHE.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-OQG3XO4Y.js";import{confirm as s}from"./chunk-HTTICQBP.js";import"./chunk-IH2KC3NQ.js";import"./chunk-UZ7TKJRO.js";import"./chunk-3DVNXNTF.js";import"./chunk-FRNSCVPN.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-YGCVMPIU.js";import"./chunk-PC44XTGN.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-F3ZOO23R.js";import"./chunk-N3OJ47VK.js";import"./chunk-FZM3ZPW3.js";import"./chunk-CDAJKLGL.js";import"./chunk-QVAOSKFO.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EOVXFXVV.js";import"./chunk-UQYNPYF4.js";import"./chunk-TE6R53YD.js";import{Icon as a}from"./chunk-R64OZ6TC.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-WGLHB6WE.js";import"./chunk-NJN5IKWO.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-TWVUQUUD.js";import"./chunk-VNTJ7QO5.js";import"./chunk-C3QOHMR6.js";import{useRef as i,useEffect as l,useState as c}from"react";import{jsxs as m,jsx as u,Fragment as h}from"react/jsx-runtime";var d="react-os-shell:browser-bookmarks",p="react-os-shell:browser-homepage",k="https://en.wikipedia.org/wiki/Main_Page",b=[{label:"Wikipedia",url:"https://en.wikipedia.org/wiki/Main_Page"},{label:"DevDocs",url:"https://devdocs.io"},{label:"Example",url:"https://example.com"}],g=new Set(["ac ad ae af ag ai al am ao aq ar as at au aw ax az ba bb bd be bf bg bh bi","bj bm bn bo br bs bt bw by bz ca cc cd cf cg ch ci ck cl cm cn co cr cu cv","cw cx cy cz de dj dk dm do dz ec ee eg er es et eu fi fj fk fm fo fr ga gd","ge gf gg gh gi gl gm gn gp gq gr gs gt gu gw gy hk hm hn hr ht hu id ie il","im in io iq ir is it je jm jo jp ke kg kh ki km kn kp kr kw ky kz la lb lc","li lk lr ls lt lu lv ly ma mc md me mg mh mk ml mm mn mo mp mq mr ms mt mu","mv mw mx my mz na nc ne nf ng ni nl no np nr nu nz om pa pe pf pg ph pk pl","pm pn pr ps pt pw py qa re ro rs ru rw sa sb sc sd se sg sh si sk sl sm sn","so sr ss st su sv sx sy sz tc td tf tg th tj tk tl tm tn to tr tt tv tw tz","ua ug uk us uy uz va vc ve vg vi vn vu wf ws ye yt za zm zw","com net org edu gov mil int info biz name pro app dev xyz online site tech","store shop cloud design digital agency studio media news blog live life","world today email systems solutions services software page link space host","press wiki team group works careers finance capital energy academy"].join(" ").split(" "));function f(e){let t=e.trim();return t?/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:function(e){const t=/^([\w-]+\.)+([a-z]{2,})(\/.*)?$/i.exec(e);return null!==t&&g.has(t[2].toLowerCase())}(t)?"https://"+t:"https://duckduckgo.com/?q="+encodeURIComponent(t):""}var w=["duckduckgo.com","developer.mozilla.org","google.com","gmail.com","youtube.com","facebook.com","instagram.com","whatsapp.com","twitter.com","x.com","github.com","gitlab.com","linkedin.com","reddit.com","pinterest.com","amazon.com","amazon.ca","amazon.co.uk","apple.com","icloud.com","microsoft.com","outlook.com","live.com","office.com","netflix.com","spotify.com","paypal.com","stripe.com","chat.openai.com","chatgpt.com","claude.ai"];function x(){if("undefined"==typeof window)return b;try{const e=localStorage.getItem(d);if(!e)return b;const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e?.url))return t}catch{}return b}function y(){return"undefined"==typeof window?k:localStorage.getItem(p)||k}function N(){const h=i(void 0);void 0===h.current&&(h.current=t()),l(()=>{null!=h.current&&o(h.current)},[]);const k=h.current?f(h.current.url):"",[b,g]=c(y),[w,N]=c(k||b),[C,W]=c(w),[R,T]=c([w]),[z,S]=c(0),[L,D]=c(0),[H,E]=c(x),[O,U]=c(!1),[K,P]=c(null),Q=i(null),G=i(null);l(()=>{try{localStorage.setItem(d,JSON.stringify(H))}catch{}},[H]);const J=e=>{const t=f(e);t&&(N(t),W(t),T(e=>{const o=e.slice(0,z+1);return o.push(t),o}),S(e=>e+1),U(!1))},M=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},Y=()=>{const e=K?.trim();e?(E(t=>[...t,{label:e,url:w}]),P(null)):P(null)};l(()=>{if(null===K)return;Q.current?.focus(),Q.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||P(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==K]);const V=e=>{E(t=>t.filter((t,o)=>o!==e))},X=z>0,Z=z<R.length-1,F=H.some(e=>e.url===w),A="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
2
2
  return m("div",{className:"relative flex flex-col h-full bg-white",children:[
3
- /* @__PURE__ */u(n,{title:`Browser - ${N(w)}`}),
3
+ /* @__PURE__ */u(n,{title:`Browser - ${v(w)}`}),
4
4
  /* @__PURE__ */u(r,{app:"browser"}),
5
5
  /* @__PURE__ */m("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-line bg-surface-sunken shrink-0",children:[
6
- /* @__PURE__ */u("button",{onClick:()=>{if(U>0){const e=U-1;z(e),v(L[e]),W(L[e]),H(!1)}},disabled:!O,className:F,title:"Back",children:/* @__PURE__ */u(a,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
- /* @__PURE__ */u("button",{onClick:()=>{if(U<L.length-1){const e=U+1;z(e),v(L[e]),W(L[e]),H(!1)}},disabled:!X,className:F,title:"Forward",children:/* @__PURE__ */u(a,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
- /* @__PURE__ */u("button",{onClick:()=>E(e=>e+1),className:F,title:"Refresh",children:/* @__PURE__ */u(a,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
- /* @__PURE__ */u("button",{onClick:()=>P(b),className:F,title:"Home",children:/* @__PURE__ */u(a,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
- /* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),P(C)},className:"flex-1 flex items-center mx-1",children:/* @__PURE__ */m("div",{className:"flex items-center w-full bg-white border border-gray-300 rounded focus-within:border-blue-400 focus-within:ring-1 focus-within:ring-blue-200",children:[
6
+ /* @__PURE__ */u("button",{onClick:()=>{if(z>0){const e=z-1;S(e),N(R[e]),W(R[e]),U(!1)}},disabled:!X,className:A,title:"Back",children:/* @__PURE__ */u(a,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
+ /* @__PURE__ */u("button",{onClick:()=>{if(z<R.length-1){const e=z+1;S(e),N(R[e]),W(R[e]),U(!1)}},disabled:!Z,className:A,title:"Forward",children:/* @__PURE__ */u(a,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
+ /* @__PURE__ */u("button",{onClick:()=>D(e=>e+1),className:A,title:"Refresh",children:/* @__PURE__ */u(a,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
+ /* @__PURE__ */u("button",{onClick:()=>J(b),className:A,title:"Home",children:/* @__PURE__ */u(a,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
+ /* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),J(C)},className:"flex-1 flex items-center mx-1",children:/* @__PURE__ */m("div",{className:"flex items-center w-full bg-white border border-gray-300 rounded focus-within:border-blue-400 focus-within:ring-1 focus-within:ring-blue-200",children:[
11
11
  /* @__PURE__ */u("span",{className:"px-2 text-gray-400 text-xs",children:w.startsWith("https://")?"🔒":"⚠️"}),
12
12
  /* @__PURE__ */u("input",{type:"text",value:C,onChange:e=>W(e.target.value),onFocus:e=>e.target.select(),className:"flex-1 px-1 py-1 text-sm bg-transparent outline-none font-mono",spellCheck:!1,placeholder:"Enter URL or search…"}),w!==C&&
13
13
  /* @__PURE__ */u("span",{className:"flex pr-1",children:/* @__PURE__ */u(e,{action:{label:"Reset to current URL",icon:/* @__PURE__ */u(a,{name:"close"}),onClick:()=>W(w)}})})]})}),
14
- /* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>Y?A(R.findIndex(e=>e.url===w)):void B(N(w)),className:F+" "+(Y?"text-yellow-500":""),title:Y?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */u(a,{name:"star",className:"h-4 w-4",fill:Y?"currentColor":"none",strokeWidth:1.5})}),
15
- /* @__PURE__ */u("button",{onClick:Q,className:F,title:"Open in new tab",children:/* @__PURE__ */u(a,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
16
- /* @__PURE__ */u("button",{onClick:()=>H(e=>!e),className:F,title:"Embedding help",children:/* @__PURE__ */u(a,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==J&&/* @__PURE__ */m("div",{"data-bookmark-popover":!0,className:"absolute right-3 top-12 z-30 w-72 bg-white border border-gray-200 rounded-md shadow-lg p-3",children:[
14
+ /* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>F?V(H.findIndex(e=>e.url===w)):void P(v(w)),className:A+" "+(F?"text-yellow-500":""),title:F?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */u(a,{name:"star",className:"h-4 w-4",fill:F?"currentColor":"none",strokeWidth:1.5})}),
15
+ /* @__PURE__ */u("button",{onClick:M,className:A,title:"Open in new tab",children:/* @__PURE__ */u(a,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
16
+ /* @__PURE__ */u("button",{onClick:()=>U(e=>!e),className:A,title:"Embedding help",children:/* @__PURE__ */u(a,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==K&&/* @__PURE__ */m("div",{"data-bookmark-popover":!0,className:"absolute right-3 top-12 z-30 w-72 bg-white border border-gray-200 rounded-md shadow-lg p-3",children:[
17
17
  /* @__PURE__ */u("div",{className:"text-2xs font-semibold uppercase tracking-wide text-ink-faint mb-1",children:"Bookmark this page"}),
18
18
  /* @__PURE__ */u("div",{className:"text-2xs text-ink-faintest truncate mb-2 font-mono",title:w,children:w}),
19
- /* @__PURE__ */u("input",{ref:T,type:"text",value:J,onChange:e=>B(e.target.value),onKeyDown:e=>{"Enter"===e.key?I():"Escape"===e.key&&B(null)},placeholder:"Name",className:"w-full text-sm px-2 h-8 border border-line-strong rounded focus:outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200"}),
19
+ /* @__PURE__ */u("input",{ref:Q,type:"text",value:K,onChange:e=>P(e.target.value),onKeyDown:e=>{"Enter"===e.key?Y():"Escape"===e.key&&P(null)},placeholder:"Name",className:"w-full text-sm px-2 h-8 border border-line-strong rounded focus:outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200"}),
20
20
  /* @__PURE__ */m("div",{className:"flex justify-end gap-1 mt-2",children:[
21
- /* @__PURE__ */u("button",{onClick:()=>B(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
22
- /* @__PURE__ */u("button",{onClick:I,disabled:!J.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
23
- /* @__PURE__ */m("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-gray-200 bg-white shrink-0 overflow-x-auto",children:[0===R.length&&/* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),R.map((e,t)=>/* @__PURE__ */m("button",{onClick:()=>P(e.url),onContextMenu:async o=>{o.preventDefault();await s({title:"Remove bookmark",message:`"${e.label}" will be removed from your bookmarks.`,confirmLabel:"Remove",variant:"danger"})&&A(t)},className:"flex items-center gap-2 px-2 py-0.5 rounded text-xs text-ink hover:bg-gray-100 whitespace-nowrap",title:`${e.url}\n(right-click to remove)`,children:[
21
+ /* @__PURE__ */u("button",{onClick:()=>P(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
22
+ /* @__PURE__ */u("button",{onClick:Y,disabled:!K.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
23
+ /* @__PURE__ */m("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-gray-200 bg-white shrink-0 overflow-x-auto",children:[0===H.length&&/* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),H.map((e,t)=>/* @__PURE__ */m("button",{onClick:()=>J(e.url),onContextMenu:async o=>{o.preventDefault();await s({title:"Remove bookmark",message:`"${e.label}" will be removed from your bookmarks.`,confirmLabel:"Remove",variant:"danger"})&&V(t)},className:"flex items-center gap-2 px-2 py-0.5 rounded text-xs text-ink hover:bg-gray-100 whitespace-nowrap",title:`${e.url}\n(right-click to remove)`,children:[
24
24
  /* @__PURE__ */u("img",{src:`https://icons.duckduckgo.com/ip3/${new URL(e.url).hostname}.ico`,alt:"",className:"h-3.5 w-3.5",onError:e=>{e.target.style.visibility="hidden"}}),e.label]},t)),
25
25
  /* @__PURE__ */u("div",{className:"flex-1"}),
26
26
  /* @__PURE__ */u("button",{onClick:()=>{g(w);try{localStorage.setItem(p,w)}catch{}},className:"px-2 py-0.5 text-2xs text-ink-faint hover:text-ink-strong",title:"Set current page as homepage",children:"Set as home"})]}),
27
- /* @__PURE__ */u("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */u(j,{url:w,iframeKey:S,iframeRef:M,openExternal:Q,showHelp:G,dismissHelp:()=>H(!1)})})]})}function N(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function j({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:n,dismissHelp:s}){const[i,d]=c(!1);l(()=>{d(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return w.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!i?/* @__PURE__ */u("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */m("div",{className:"max-w-md text-center",children:[
27
+ /* @__PURE__ */u("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */u(j,{url:w,iframeKey:L,iframeRef:G,openExternal:M,showHelp:O,dismissHelp:()=>U(!1)})})]})}function v(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function j({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:n,dismissHelp:s}){const[i,d]=c(!1);l(()=>{d(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return w.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!i?/* @__PURE__ */u("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */m("div",{className:"max-w-md text-center",children:[
28
28
  /* @__PURE__ */u(a,{name:"no-symbol",className:"h-14 w-14 mx-auto text-gray-300 mb-3",strokeWidth:1.2}),
29
- /* @__PURE__ */m("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:[N(e)," can't be embedded"]}),
29
+ /* @__PURE__ */m("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:[v(e)," can't be embedded"]}),
30
30
  /* @__PURE__ */m("p",{className:"text-sm text-gray-500 mb-4",children:["This site sends an ",
31
31
  /* @__PURE__ */u("span",{className:"font-mono text-xs",children:"X-Frame-Options"})," ","or ",
32
32
  /* @__PURE__ */u("span",{className:"font-mono text-xs",children:"Content-Security-Policy"})," header that refuses iframe embedding. The browser blocks the load before our app can do anything about it."]}),
@@ -41,4 +41,4 @@ return m("div",{className:"relative flex flex-col h-full bg-white",children:[
41
41
  /* @__PURE__ */m("p",{children:["Hit the ",
42
42
  /* @__PURE__ */u("span",{className:"font-medium",children:"↗"})," button to open the page in a real new tab. Sites that ",
43
43
  /* @__PURE__ */u("em",{children:"do"})," allow embedding (Wikipedia, DevDocs, your own apps) work fine in here."]}),
44
- /* @__PURE__ */u("button",{onClick:s,className:"mt-2 text-2xs text-blue-600 hover:underline",children:"Got it"})]})]})}export{v as default};
44
+ /* @__PURE__ */u("button",{onClick:s,className:"mt-2 text-2xs text-blue-600 hover:underline",children:"Got it"})]})]})}export{N as default};
@@ -0,0 +1,29 @@
1
+ import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-D2BXHFYK.js";import{useWidgetSettings as n}from"./chunk-NGUXPP5Q.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-NSYCJTHE.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-OQG3XO4Y.js";import"./chunk-HTTICQBP.js";import"./chunk-IH2KC3NQ.js";import"./chunk-UZ7TKJRO.js";import"./chunk-3DVNXNTF.js";import"./chunk-FRNSCVPN.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-YGCVMPIU.js";import"./chunk-PC44XTGN.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-F3ZOO23R.js";import"./chunk-FZM3ZPW3.js";import"./chunk-CDAJKLGL.js";import"./chunk-QVAOSKFO.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EOVXFXVV.js";import"./chunk-UQYNPYF4.js";import"./chunk-TE6R53YD.js";import{Icon as r}from"./chunk-R64OZ6TC.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-WGLHB6WE.js";import"./chunk-NJN5IKWO.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-TWVUQUUD.js";import"./chunk-VNTJ7QO5.js";import"./chunk-C3QOHMR6.js";import{useState as c,useRef as i,useCallback as o,useEffect as s}from"react";import{jsxs as l,Fragment as a,jsx as u}from"react/jsx-runtime";var h="calc_appearance";function m(){const[m,k]=c("0"),[p,d]=c(null),[b,g]=c(null),[N,j]=c(!1),[y,C]=c(""),[x,f]=c([]),[v,$]=c(!1),[T,E]=c(()=>e(h)),[W,D]=c(!1),[F,S]=c(T),J=i(null);n(o(()=>{S({...T}),D(!0)},[T]));const O=o(e=>{C(""),k(t=>N||"0"===t?(j(!1),"."===e?"0.":e):"."===e&&t.includes(".")?t:t+e)},[N]),Q=o(()=>{k("0"),d(null),g(null),j(!1)},[]),X=o((e,t,n)=>{switch(n){case"+":return e+t;case"-":return e-t;case"×":return e*t;case"÷":return 0===t?0:e/t;default:return t}},[]),w=o(e=>{const t=parseFloat(m);if(null!==p&&b&&!N){const e=X(p,t,b);k(String(e)),d(e),f(n=>[`${p} ${b} ${t} = ${e}`,...n].slice(0,20))}else d(t);g(e),j(!0)},[m,p,b,N,X]),P=o(()=>{if(null===p||!b)return;const e=parseFloat(m),t=X(p,e,b),n=`${p} ${b} ${e} =`;f(e=>[`${n} ${t}`,...e].slice(0,20)),C(n),k(String(t)),d(null),g(null),j(!0)},[m,p,b,X]),V=o(()=>{k(e=>String(parseFloat(e)/100))},[]),G=o(()=>{k(e=>e.startsWith("-")?e.slice(1):"0"===e?e:"-"+e)},[]);s(()=>{const e=e=>{const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.key>="0"&&e.key<="9"?O(e.key):"."===e.key?O("."):"+"===e.key?w("+"):"-"===e.key?w("-"):"*"===e.key?w("×"):"/"===e.key?(e.preventDefault(),w("÷")):"Enter"===e.key||"="===e.key?("Enter"===e.key&&e.target instanceof Node&&J.current?.contains(e.target)&&e.preventDefault(),P()):"Escape"===e.key?Q():"Backspace"===e.key?k(e=>e.length>1?e.slice(0,-1):"0"):"%"===e.key&&V())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[O,w,P,Q,V]);const H="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",K=`${H} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,R=`${H} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,U=`${H} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,M=`${H} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
2
+ return l(a,{children:[
3
+ /* @__PURE__ */l("div",{ref:J,className:"flex flex-col h-full",style:{opacity:T.activeOpacity/100,backdropFilter:T.activeBlur>0?`blur(${T.activeBlur}px)`:void 0},children:[
4
+ /* @__PURE__ */l("div",{className:"bg-slate-200 rounded-t-lg px-4 py-2 group/display relative flex flex-col justify-end min-h-[120px] border-b border-slate-300",children:[
5
+ /* @__PURE__ */u("div",{className:"flex flex-col justify-end flex-1 overflow-hidden",children:x.slice(0,3).reverse().map((e,t)=>/* @__PURE__ */u("div",{className:"text-2xs text-slate-400 text-right font-mono truncate",children:e},t))}),(y||b&&null!==p)&&/* @__PURE__ */u("div",{className:"text-base text-slate-600 text-right font-mono",children:y||`${p} ${b} ${N?"":m}`}),
6
+ /* @__PURE__ */l("div",{className:"flex items-center gap-2",children:[
7
+ /* @__PURE__ */u("button",{onClick:()=>{navigator.clipboard.writeText(m),$(!0),setTimeout(()=>$(!1),1200)},title:"Copy result",className:"shrink-0 text-slate-300 hover:text-slate-500 transition-colors opacity-0 group-hover/display:opacity-100",children:/* @__PURE__ */u(r,v?{name:"check",className:"h-5 w-5 text-green-500",strokeWidth:2}:{name:"copy",className:"h-5 w-5",strokeWidth:2})}),
8
+ /* @__PURE__ */u("div",{className:"text-right text-4xl font-mono font-bold text-slate-800 truncate flex-1",children:(e=>{const t=parseFloat(e);return isNaN(t)||e.endsWith(".")||e.endsWith(".0")||Math.abs(t)<1e15&&e.length<16?e:t.toExponential(6)})(m)})]})]}),
9
+ /* @__PURE__ */l("div",{className:"grid grid-cols-4 grid-rows-5 gap-2 flex-1 min-h-0 p-2",children:[
10
+ /* @__PURE__ */u("button",{onClick:Q,className:U,children:"AC"}),
11
+ /* @__PURE__ */u("button",{onClick:G,className:U,children:"+/−"}),
12
+ /* @__PURE__ */u("button",{onClick:V,className:U,children:"%"}),
13
+ /* @__PURE__ */u("button",{onClick:()=>w("÷"),className:`${R} ${"÷"===b?"ring-2 ring-blue-400":""}`,children:"÷"}),
14
+ /* @__PURE__ */u("button",{onClick:()=>O("7"),className:K,children:"7"}),
15
+ /* @__PURE__ */u("button",{onClick:()=>O("8"),className:K,children:"8"}),
16
+ /* @__PURE__ */u("button",{onClick:()=>O("9"),className:K,children:"9"}),
17
+ /* @__PURE__ */u("button",{onClick:()=>w("×"),className:`${R} ${"×"===b?"ring-2 ring-blue-400":""}`,children:"×"}),
18
+ /* @__PURE__ */u("button",{onClick:()=>O("4"),className:K,children:"4"}),
19
+ /* @__PURE__ */u("button",{onClick:()=>O("5"),className:K,children:"5"}),
20
+ /* @__PURE__ */u("button",{onClick:()=>O("6"),className:K,children:"6"}),
21
+ /* @__PURE__ */u("button",{onClick:()=>w("-"),className:`${R} ${"-"===b?"ring-2 ring-blue-400":""}`,children:"−"}),
22
+ /* @__PURE__ */u("button",{onClick:()=>O("1"),className:K,children:"1"}),
23
+ /* @__PURE__ */u("button",{onClick:()=>O("2"),className:K,children:"2"}),
24
+ /* @__PURE__ */u("button",{onClick:()=>O("3"),className:K,children:"3"}),
25
+ /* @__PURE__ */u("button",{onClick:()=>w("+"),className:`${R} ${"+"===b?"ring-2 ring-blue-400":""}`,children:"+"}),
26
+ /* @__PURE__ */u("button",{onClick:()=>O("0"),className:`${K} col-span-2`,children:"0"}),
27
+ /* @__PURE__ */u("button",{onClick:()=>O("."),className:K,children:"."}),
28
+ /* @__PURE__ */u("button",{onClick:P,className:M,children:"="})]})]}),
29
+ /* @__PURE__ */u(t,{open:W,onClose:()=>D(!1),title:"Calculator Settings",appearance:F,onAppearanceChange:S,onSave:()=>{E(F),localStorage.setItem(h,JSON.stringify(F)),D(!1)}})]})}export{m as default};
@@ -1,21 +1,21 @@
1
- import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-WOXQODYQ.js";import{useWidgetSettings as r}from"./chunk-IDI3IOY4.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-QYL26AB4.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-2E2SUEEE.js";import"./chunk-PLK2WHZG.js";import"./chunk-7INZ7O3A.js";import"./chunk-P4VKU3SL.js";import"./chunk-3DVNXNTF.js";import"./chunk-ECJKIPWU.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-BW47XJLH.js";import"./chunk-O3MBPAWZ.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-F3ZOO23R.js";import"./chunk-JPNAEN53.js";import"./chunk-CDAJKLGL.js";import"./chunk-G3KXB7SP.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-7DI3VQCF.js";import"./chunk-UQYNPYF4.js";import"./chunk-XWFLIGDQ.js";import"./chunk-2UO47XB4.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-CJH2BGXY.js";import"./chunk-QQ2LDC6C.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-TWVUQUUD.js";import"./chunk-GDQJBQ5B.js";import"./chunk-C3QOHMR6.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import{useState as s,useCallback as o,useEffect as c}from"react";import{jsxs as i,Fragment as a,jsx as m}from"react/jsx-runtime";var l=["USD","CNY","AUD","GBP","EUR","JPY","CAD","THB","NZD","SGD","HKD","CHF","KRW","INR","MXN","BRL"],u=[["USD","CNY"],["USD","AUD"],["GBP","USD"],["USD","JPY"]],p="currency_pairs",h="currency_appearance",d="currency_rates_cache";function k(t){try{const e=JSON.parse(localStorage.getItem(d)||"{}")[t];if(e&&Date.now()-e.timestamp<36e5)return e.rates}catch{}return null}function g(t,e){try{const r=JSON.parse(localStorage.getItem(d)||"{}");r[t]={rates:e,timestamp:Date.now()},localStorage.setItem(d,JSON.stringify(r))}catch{}}function j(){try{const t=JSON.parse(localStorage.getItem(p)||"");if(Array.isArray(t)&&t.length)return t.slice(0,4)}catch{}return u}var N={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function f(){const[u,d]=s(j),[f,x]=s(()=>t(h)),[y,D]=s({}),[b,S]=s(!1),[C,v]=s(!1),[J,U]=s([]),[B,L]=s(f),[A,P]=s("USD"),[G,O]=s("CNY");r(o(()=>{U([...u]),L({...f}),v(!0)},[u,f])),c(()=>{const t=[...new Set(u.map(([t])=>t))];let e=!0;return async function(){S(!0);const r={};for(const e of t){const t=k(e);if(t)r[e]=t;else try{const t=await fetch(`https://open.er-api.com/v6/latest/${e}`),n=await t.json();n.rates&&(r[e]=n.rates,g(e,n.rates))}catch{}}e&&(D(r),S(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
1
+ import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-D2BXHFYK.js";import{useWidgetSettings as r}from"./chunk-NGUXPP5Q.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-NSYCJTHE.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-OQG3XO4Y.js";import"./chunk-HTTICQBP.js";import"./chunk-IH2KC3NQ.js";import"./chunk-UZ7TKJRO.js";import"./chunk-3DVNXNTF.js";import"./chunk-FRNSCVPN.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-YGCVMPIU.js";import"./chunk-PC44XTGN.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-F3ZOO23R.js";import"./chunk-FZM3ZPW3.js";import"./chunk-CDAJKLGL.js";import"./chunk-QVAOSKFO.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EOVXFXVV.js";import"./chunk-UQYNPYF4.js";import"./chunk-TE6R53YD.js";import"./chunk-R64OZ6TC.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-WGLHB6WE.js";import"./chunk-NJN5IKWO.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-TWVUQUUD.js";import"./chunk-VNTJ7QO5.js";import"./chunk-C3QOHMR6.js";import{useState as s,useCallback as o,useEffect as c}from"react";import{jsxs as i,Fragment as a,jsx as m}from"react/jsx-runtime";var l=["USD","CNY","AUD","GBP","EUR","JPY","CAD","THB","NZD","SGD","HKD","CHF","KRW","INR","MXN","BRL"],u=[["USD","CNY"],["USD","AUD"],["GBP","USD"],["USD","JPY"]],p="currency_pairs",h="currency_appearance",d="currency_rates_cache";function k(t){try{const e=JSON.parse(localStorage.getItem(d)||"{}")[t];if(e&&Date.now()-e.timestamp<36e5)return e.rates}catch{}return null}function g(t,e){try{const r=JSON.parse(localStorage.getItem(d)||"{}");r[t]={rates:e,timestamp:Date.now()},localStorage.setItem(d,JSON.stringify(r))}catch{}}function N(){try{const t=JSON.parse(localStorage.getItem(p)||"");if(Array.isArray(t)&&t.length)return t.slice(0,4)}catch{}return u}var j={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function f(){const[u,d]=s(N),[f,x]=s(()=>t(h)),[y,b]=s({}),[D,S]=s(!1),[C,v]=s(!1),[J,U]=s([]),[O,P]=s(f),[R,T]=s("USD"),[H,B]=s("CNY");r(o(()=>{U([...u]),P({...f}),v(!0)},[u,f])),c(()=>{const t=[...new Set(u.map(([t])=>t))];let e=!0;return async function(){S(!0);const r={};for(const e of t){const t=k(e);if(t)r[e]=t;else try{const t=await fetch(`https://open.er-api.com/v6/latest/${e}`),n=await t.json();n.rates&&(r[e]=n.rates,g(e,n.rates))}catch{}}e&&(b(r),S(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
2
2
  return i(a,{children:[
3
- /* @__PURE__ */m("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${f.activeOpacity/100})`,backdropFilter:f.activeBlur>0?`blur(${f.activeBlur}px)`:void 0},children:/* @__PURE__ */i("div",{className:"px-4 py-3 space-y-1",children:[b&&/* @__PURE__ */m(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([t,e],r)=>{const n=y[t]?.[e];/* @__PURE__ */
3
+ /* @__PURE__ */m("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${f.activeOpacity/100})`,backdropFilter:f.activeBlur>0?`blur(${f.activeBlur}px)`:void 0},children:/* @__PURE__ */i("div",{className:"px-4 py-3 space-y-1",children:[D&&/* @__PURE__ */m(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([t,e],r)=>{const n=y[t]?.[e];/* @__PURE__ */
4
4
  return i("button",{onClick:()=>{const t=u.map((t,e)=>e===r?[t[1],t[0]]:t);d(t),localStorage.setItem(p,JSON.stringify(t))},className:"flex items-center justify-between px-2 py-2 border-b border-gray-200 last:border-0 w-full hover:bg-gray-100 rounded transition-colors cursor-pointer",children:[
5
5
  /* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
6
- /* @__PURE__ */m("span",{className:"text-base",children:N[t]||""}),
6
+ /* @__PURE__ */m("span",{className:"text-base",children:j[t]||""}),
7
7
  /* @__PURE__ */m("span",{className:"text-sm font-semibold text-gray-700",children:t}),
8
8
  /* @__PURE__ */m("svg",{className:"h-3 w-3 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */m("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"})}),
9
- /* @__PURE__ */m("span",{className:"text-base",children:N[e]||""}),
9
+ /* @__PURE__ */m("span",{className:"text-base",children:j[e]||""}),
10
10
  /* @__PURE__ */m("span",{className:"text-sm font-semibold text-gray-700",children:e})]}),
11
11
  /* @__PURE__ */m("div",{className:"text-base font-mono font-semibold text-gray-900 tabular-nums",children:null!=n?n.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:4}):"—"})]},`${t}-${e}-${r}`)})]})}),
12
- /* @__PURE__ */m(e,{open:C,onClose:()=>v(!1),title:"Currency Settings",appearance:B,onAppearanceChange:L,onSave:()=>{if(0===J.length)return;const t=J.slice(0,4);d(t),x(B),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(B)),v(!1)},children:/* @__PURE__ */i("div",{children:[
12
+ /* @__PURE__ */m(e,{open:C,onClose:()=>v(!1),title:"Currency Settings",appearance:O,onAppearanceChange:P,onSave:()=>{if(0===J.length)return;const t=J.slice(0,4);d(t),x(O),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(O)),v(!1)},children:/* @__PURE__ */i("div",{children:[
13
13
  /* @__PURE__ */i("h3",{className:"text-sm font-semibold text-ink mb-2",children:["Currency Pairs ",
14
14
  /* @__PURE__ */i("span",{className:"text-2xs font-normal text-ink-faintest",children:["(",J.length,"/",4,")"]})]}),
15
15
  /* @__PURE__ */m("div",{className:"space-y-1 mb-2",children:J.map(([t,e],r)=>/* @__PURE__ */i("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
16
- /* @__PURE__ */i("span",{className:"text-sm",children:[N[t]||""," ",t," → ",N[e]||""," ",e]}),
16
+ /* @__PURE__ */i("span",{className:"text-sm",children:[j[t]||""," ",t," → ",j[e]||""," ",e]}),
17
17
  /* @__PURE__ */m("button",{onClick:()=>U(t=>t.filter((t,e)=>e!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),J.length<4?/* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
18
- /* @__PURE__ */m("select",{value:A,onChange:t=>P(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
18
+ /* @__PURE__ */m("select",{value:R,onChange:t=>T(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
19
19
  /* @__PURE__ */m("span",{className:"text-gray-400",children:"→"}),
20
- /* @__PURE__ */m("select",{value:G,onChange:t=>O(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
21
- /* @__PURE__ */m("button",{onClick:()=>{A!==G&&J.length<4&&U(t=>[...t,[A,G]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */i("p",{className:"text-2xs text-ink-faintest italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{f as default};
20
+ /* @__PURE__ */m("select",{value:H,onChange:t=>B(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
21
+ /* @__PURE__ */m("button",{onClick:()=>{R!==H&&J.length<4&&U(t=>[...t,[R,H]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */i("p",{className:"text-2xs text-ink-faintest italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{f as default};
@@ -1,11 +1,11 @@
1
- import{escapeHtml as e}from"./chunk-G6DKCCWH.js";import{AboutApp as t}from"./chunk-N7U622NC.js";import{WindowTitle as n}from"./chunk-IDI3IOY4.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-QYL26AB4.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-2E2SUEEE.js";import"./chunk-PLK2WHZG.js";import"./chunk-7INZ7O3A.js";import"./chunk-P4VKU3SL.js";import"./chunk-3DVNXNTF.js";import"./chunk-ECJKIPWU.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-BW47XJLH.js";import"./chunk-O3MBPAWZ.js";import{toast_default as r}from"./chunk-7ELJQL7J.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-F3ZOO23R.js";import"./chunk-LKTUUNGJ.js";import"./chunk-JPNAEN53.js";import"./chunk-CDAJKLGL.js";import{PopupMenu as o,PopupMenuLabel as i,PopupMenuItem as l,PopupMenuDivider as a}from"./chunk-G3KXB7SP.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-7DI3VQCF.js";import"./chunk-UQYNPYF4.js";import"./chunk-XWFLIGDQ.js";import{Icon as s}from"./chunk-2UO47XB4.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as c}from"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-CJH2BGXY.js";import"./chunk-QQ2LDC6C.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-TWVUQUUD.js";import"./chunk-GDQJBQ5B.js";import"./chunk-C3QOHMR6.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import{useState as m,useRef as h}from"react";import{jsxs as u,jsx as d}from"react/jsx-runtime";var p=/* @__PURE__ */new Set(["txt","md","markdown","csv","tsv","log","json","xml","html","htm","css","js","jsx","ts","tsx","py","rb","go","rs","java","c","h","cpp","hpp","sh","bash","yml","yaml","toml","ini","conf","env","sql"]),g=/* @__PURE__ */new Set(["docx"]),x={filename:"Untitled",kind:"docx",content:"",ext:"docx"};function f(){const[f,k]=m(x),[y,v]=m(!1),[b,j]=m(!1),[w,N]=m(!1),[C,D]=m(null),L=h(null),M=h(null),U=h(null),W=(e,t)=>{U.current?.focus(),document.execCommand(e,!1,t),N(!0)},B=e=>{for(const t of e){if(!t.type.startsWith("image/"))continue;const e=new FileReader;e.onload=()=>{U.current?.focus(),document.execCommand("insertImage",!1,String(e.result)),N(!0)},e.readAsDataURL(t)}},R=e=>{C&&(C.el.removeAttribute("width"),C.el.removeAttribute("height"),C.el.style.width=e??"",C.el.style.height=e?"auto":"",N(!0),D(null))},T=async t=>{const n=(t.name.split(".").pop()||"").toLowerCase();v(!0);try{if(p.has(n)||!g.has(n)&&t.type.startsWith("text/")){const r=await t.text(),o=e(r).replace(/\n/g,"<br>");k({filename:t.name,kind:"text",content:o,ext:n}),N(!1)}else if(g.has(n))try{const e=await(import(
1
+ import{escapeHtml as e}from"./chunk-G6DKCCWH.js";import{AboutApp as t}from"./chunk-YY5TUQS4.js";import{WindowTitle as n}from"./chunk-NGUXPP5Q.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-NSYCJTHE.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-OQG3XO4Y.js";import"./chunk-HTTICQBP.js";import"./chunk-IH2KC3NQ.js";import"./chunk-UZ7TKJRO.js";import"./chunk-3DVNXNTF.js";import"./chunk-FRNSCVPN.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-YGCVMPIU.js";import"./chunk-PC44XTGN.js";import{toast_default as r}from"./chunk-MWKLLAJT.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-F3ZOO23R.js";import"./chunk-N3OJ47VK.js";import"./chunk-FZM3ZPW3.js";import"./chunk-CDAJKLGL.js";import{PopupMenu as o,PopupMenuLabel as i,PopupMenuItem as l,PopupMenuDivider as a}from"./chunk-QVAOSKFO.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EOVXFXVV.js";import"./chunk-UQYNPYF4.js";import"./chunk-TE6R53YD.js";import{Icon as s}from"./chunk-R64OZ6TC.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as c}from"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-WGLHB6WE.js";import"./chunk-NJN5IKWO.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-TWVUQUUD.js";import"./chunk-VNTJ7QO5.js";import"./chunk-C3QOHMR6.js";import{useState as m,useRef as h}from"react";import{jsxs as u,jsx as d}from"react/jsx-runtime";var p=/* @__PURE__ */new Set(["txt","md","markdown","csv","tsv","log","json","xml","html","htm","css","js","jsx","ts","tsx","py","rb","go","rs","java","c","h","cpp","hpp","sh","bash","yml","yaml","toml","ini","conf","env","sql"]),g=/* @__PURE__ */new Set(["docx"]),x={filename:"Untitled",kind:"docx",content:"",ext:"docx"};function f(){const[f,k]=m(x),[y,v]=m(!1),[b,j]=m(!1),[w,N]=m(!1),[C,D]=m(null),L=h(null),M=h(null),U=h(null),T=(e,t)=>{U.current?.focus(),document.execCommand(e,!1,t),N(!0)},R=e=>{for(const t of e){if(!t.type.startsWith("image/"))continue;const e=new FileReader;e.onload=()=>{U.current?.focus(),document.execCommand("insertImage",!1,String(e.result)),N(!0)},e.readAsDataURL(t)}},W=e=>{C&&(C.el.removeAttribute("width"),C.el.removeAttribute("height"),C.el.style.width=e??"",C.el.style.height=e?"auto":"",N(!0),D(null))},O=async t=>{const n=(t.name.split(".").pop()||"").toLowerCase();v(!0);try{if(p.has(n)||!g.has(n)&&t.type.startsWith("text/")){const r=await t.text(),o=e(r).replace(/\n/g,"<br>");k({filename:t.name,kind:"text",content:o,ext:n}),N(!1)}else if(g.has(n))try{const e=await(import(
2
2
  /* @vite-ignore */
3
- "mammoth")),r=await t.arrayBuffer(),o=await e.convertToHtml({arrayBuffer:r});k({filename:t.name,kind:"docx",content:o.value||"<p><em>(empty document)</em></p>",ext:n}),N(!1)}catch(e){r.error('Install the optional "mammoth" peer dep to read .docx files.')}else"doc"===n?r.error(".doc is the legacy Word binary format — convert to .docx first."):r.error(`Unsupported file type: .${n||"unknown"}`)}finally{v(!1)}},A=f?.filename?(J=f.filename).length>24?`${J.slice(0,23)}…`:J:"Untitled";var J;/* @__PURE__ */
4
- return u("div",{className:"relative flex flex-col h-full",onDragOver:e=>{e.preventDefault(),b||j(!0)},onDragLeave:e=>{e.currentTarget===e.target&&j(!1)},onDrop:e=>{e.preventDefault(),j(!1);const t=Array.from(e.dataTransfer.files??[]);0!==t.length&&(t.every(e=>e.type.startsWith("image/"))?B(t):T(t[0]))},children:[
5
- /* @__PURE__ */d(n,{title:`${A}${w?" •":""} - Documents`}),
3
+ "mammoth")),r=await t.arrayBuffer(),o=await e.convertToHtml({arrayBuffer:r});k({filename:t.name,kind:"docx",content:o.value||"<p><em>(empty document)</em></p>",ext:n}),N(!1)}catch(e){r.error('Install the optional "mammoth" peer dep to read .docx files.')}else"doc"===n?r.error(".doc is the legacy Word binary format — convert to .docx first."):r.error(`Unsupported file type: .${n||"unknown"}`)}finally{v(!1)}},S=f?.filename?(B=f.filename).length>24?`${B.slice(0,23)}…`:B:"Untitled";var B;/* @__PURE__ */
4
+ return u("div",{className:"relative flex flex-col h-full",onDragOver:e=>{e.preventDefault(),b||j(!0)},onDragLeave:e=>{e.currentTarget===e.target&&j(!1)},onDrop:e=>{e.preventDefault(),j(!1);const t=Array.from(e.dataTransfer.files??[]);0!==t.length&&(t.every(e=>e.type.startsWith("image/"))?R(t):O(t[0]))},children:[
5
+ /* @__PURE__ */d(n,{title:`${S}${w?" •":""} - Documents`}),
6
6
  /* @__PURE__ */d(t,{app:"documents"}),
7
7
  /* @__PURE__ */u("div",{className:"flex items-center flex-wrap gap-x-2 gap-y-1 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
8
- /* @__PURE__ */d("input",{ref:L,type:"file",accept:".txt,.md,.csv,.tsv,.log,.json,.xml,.html,.htm,.css,.js,.jsx,.ts,.tsx,.py,.rb,.go,.rs,.java,.c,.h,.cpp,.hpp,.sh,.bash,.yml,.yaml,.toml,.ini,.conf,.env,.sql,.docx,text/*",onChange:e=>{const t=e.target.files?.[0];t&&T(t),L.current&&(L.current.value="")},className:"hidden"}),
8
+ /* @__PURE__ */d("input",{ref:L,type:"file",accept:".txt,.md,.csv,.tsv,.log,.json,.xml,.html,.htm,.css,.js,.jsx,.ts,.tsx,.py,.rb,.go,.rs,.java,.c,.h,.cpp,.hpp,.sh,.bash,.yml,.yaml,.toml,.ini,.conf,.env,.sql,.docx,text/*",onChange:e=>{const t=e.target.files?.[0];t&&O(t),L.current&&(L.current.value="")},className:"hidden"}),
9
9
  /* @__PURE__ */u("button",{onClick:()=>L.current?.click(),className:"text-xs text-gray-700 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors flex items-center gap-1",children:[
10
10
  /* @__PURE__ */d(s,{name:"folder-open",className:"h-3.5 w-3.5",strokeWidth:1.5}),"Open"]}),
11
11
  /* @__PURE__ */d("button",{onClick:()=>{if(!f)return;const t=U.current?.innerHTML??"";if("text"===f.kind){if(/<(b|strong|i|em|u|font|span style|ul|ol|img)|style="[^"]*text-align/i.test(t)){const n=new Blob([`<!doctype html><meta charset="utf-8"><title>${e(f.filename)}</title><body style="font-family:ui-monospace,monospace;white-space:pre-wrap">${t}`],{type:"text/html"}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download=`${f.filename.replace(/\.[^.]+$/,"")}.html`,o.click(),URL.revokeObjectURL(r)}else{const e=U.current?.innerText??"",t=new Blob([e],{type:"text/plain"}),n=URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.download=f.filename,r.click(),URL.revokeObjectURL(n)}}else{const n=new Blob([`<!doctype html><meta charset="utf-8"><title>${e(f.filename)}</title>${t}`],{type:"text/html"}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download=`${f.filename.replace(/\.docx$/i,"")}.html`,o.click(),URL.revokeObjectURL(r)}},className:"text-xs text-gray-700 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Save"}),
@@ -14,12 +14,12 @@ return u("div",{className:"relative flex flex-col h-full",onDragOver:e=>{e.preve
14
14
  /* @__PURE__ */u("span",{className:"text-xs font-medium text-gray-700 truncate max-w-[200px]",title:f.filename,children:[f.filename,w?" •":""]}),
15
15
  /* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
16
16
  /* @__PURE__ */u("div",{className:"flex items-center gap-0.5",children:[
17
- /* @__PURE__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>W("bold"),className:"px-2 py-1 text-xs rounded font-bold text-gray-700 hover:bg-gray-200 transition-colors",title:"Bold",children:"B"}),
18
- /* @__PURE__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>W("italic"),className:"px-2 py-1 text-xs rounded italic text-gray-700 hover:bg-gray-200 transition-colors",title:"Italic",children:"I"}),
19
- /* @__PURE__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>W("underline"),className:"px-2 py-1 text-xs rounded underline text-gray-700 hover:bg-gray-200 transition-colors",title:"Underline",children:"U"}),
20
- /* @__PURE__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>W("strikeThrough"),className:"px-2 py-1 text-xs rounded line-through text-gray-700 hover:bg-gray-200 transition-colors",title:"Strikethrough",children:"S"})]}),
17
+ /* @__PURE__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>T("bold"),className:"px-2 py-1 text-xs rounded font-bold text-gray-700 hover:bg-gray-200 transition-colors",title:"Bold",children:"B"}),
18
+ /* @__PURE__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>T("italic"),className:"px-2 py-1 text-xs rounded italic text-gray-700 hover:bg-gray-200 transition-colors",title:"Italic",children:"I"}),
19
+ /* @__PURE__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>T("underline"),className:"px-2 py-1 text-xs rounded underline text-gray-700 hover:bg-gray-200 transition-colors",title:"Underline",children:"U"}),
20
+ /* @__PURE__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>T("strikeThrough"),className:"px-2 py-1 text-xs rounded line-through text-gray-700 hover:bg-gray-200 transition-colors",title:"Strikethrough",children:"S"})]}),
21
21
  /* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
22
- /* @__PURE__ */u("select",{onMouseDown:e=>e.preventDefault(),onChange:e=>{W("fontSize",e.target.value),e.currentTarget.value=""},defaultValue:"",className:"text-xs border border-gray-300 rounded px-1 py-0.5 bg-white",children:[
22
+ /* @__PURE__ */u("select",{onMouseDown:e=>e.preventDefault(),onChange:e=>{T("fontSize",e.target.value),e.currentTarget.value=""},defaultValue:"",className:"text-xs border border-gray-300 rounded px-1 py-0.5 bg-white",children:[
23
23
  /* @__PURE__ */d("option",{value:"",disabled:!0,children:"Size"}),
24
24
  /* @__PURE__ */d("option",{value:"1",children:"XS"}),
25
25
  /* @__PURE__ */d("option",{value:"2",children:"S"}),
@@ -27,26 +27,26 @@ return u("div",{className:"relative flex flex-col h-full",onDragOver:e=>{e.preve
27
27
  /* @__PURE__ */d("option",{value:"4",children:"L"}),
28
28
  /* @__PURE__ */d("option",{value:"5",children:"XL"}),
29
29
  /* @__PURE__ */d("option",{value:"6",children:"2XL"})]}),
30
- /* @__PURE__ */d("input",{type:"color",defaultValue:"#000000",onChange:e=>W("foreColor",e.target.value),className:"w-7 h-6 border border-gray-300 rounded cursor-pointer",title:"Text color"}),
30
+ /* @__PURE__ */d("input",{type:"color",defaultValue:"#000000",onChange:e=>T("foreColor",e.target.value),className:"w-7 h-6 border border-gray-300 rounded cursor-pointer",title:"Text color"}),
31
31
  /* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
32
- /* @__PURE__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>W("insertUnorderedList"),className:"px-2 py-1 text-xs rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Bulleted list",children:"• List"}),
33
- /* @__PURE__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>W("insertOrderedList"),className:"px-2 py-1 text-xs rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Numbered list",children:"1."}),
32
+ /* @__PURE__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>T("insertUnorderedList"),className:"px-2 py-1 text-xs rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Bulleted list",children:"• List"}),
33
+ /* @__PURE__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>T("insertOrderedList"),className:"px-2 py-1 text-xs rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Numbered list",children:"1."}),
34
34
  /* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
35
35
  /* @__PURE__ */u("div",{className:"flex items-center gap-0.5",children:[
36
- /* @__PURE__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>W("justifyLeft"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align left",children:/* @__PURE__ */d("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */d("path",{strokeLinecap:"round",d:"M3.75 6h16.5M3.75 12h9.75M3.75 18h14.25"})})}),
37
- /* @__PURE__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>W("justifyCenter"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align center",children:/* @__PURE__ */d("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */d("path",{strokeLinecap:"round",d:"M3.75 6h16.5M7.125 12h9.75M4.875 18h14.25"})})}),
38
- /* @__PURE__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>W("justifyRight"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align right",children:/* @__PURE__ */d("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */d("path",{strokeLinecap:"round",d:"M3.75 6h16.5M10.5 12h9.75M6 18h14.25"})})}),
39
- /* @__PURE__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>W("justifyFull"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Justify",children:/* @__PURE__ */d("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */d("path",{strokeLinecap:"round",d:"M3.75 6h16.5M3.75 12h16.5M3.75 18h16.5"})})})]}),
36
+ /* @__PURE__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>T("justifyLeft"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align left",children:/* @__PURE__ */d("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */d("path",{strokeLinecap:"round",d:"M3.75 6h16.5M3.75 12h9.75M3.75 18h14.25"})})}),
37
+ /* @__PURE__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>T("justifyCenter"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align center",children:/* @__PURE__ */d("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */d("path",{strokeLinecap:"round",d:"M3.75 6h16.5M7.125 12h9.75M4.875 18h14.25"})})}),
38
+ /* @__PURE__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>T("justifyRight"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align right",children:/* @__PURE__ */d("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */d("path",{strokeLinecap:"round",d:"M3.75 6h16.5M10.5 12h9.75M6 18h14.25"})})}),
39
+ /* @__PURE__ */d("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>T("justifyFull"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Justify",children:/* @__PURE__ */d("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */d("path",{strokeLinecap:"round",d:"M3.75 6h16.5M3.75 12h16.5M3.75 18h16.5"})})})]}),
40
40
  /* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
41
- /* @__PURE__ */d("input",{ref:M,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&B(Array.from(e.target.files)),M.current&&(M.current.value="")}}),
41
+ /* @__PURE__ */d("input",{ref:M,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&R(Array.from(e.target.files)),M.current&&(M.current.value="")}}),
42
42
  /* @__PURE__ */u("button",{onClick:()=>M.current?.click(),className:"px-2 py-1 text-xs rounded text-gray-700 hover:bg-gray-200 transition-colors flex items-center gap-1",title:"Insert image (or paste / drop one)",children:[
43
43
  /* @__PURE__ */d(s,{name:"image",className:"h-3.5 w-3.5",strokeWidth:1.5}),"Image"]})]}),
44
- /* @__PURE__ */d("div",{className:"flex-1 min-h-0 overflow-hidden",children:y?/* @__PURE__ */d(c,{size:"sm",padding:"",className:"h-full",label:"Loading"}):/* @__PURE__ */d("div",{className:"h-full overflow-auto "+("docx"===f.kind?"bg-gray-100 px-6 py-8":"bg-white"),children:/* @__PURE__ */d("div",{ref:U,contentEditable:!0,suppressContentEditableWarning:!0,spellCheck:!1,onInput:()=>N(!0),onPaste:e=>{const t=Array.from(e.clipboardData?.items??[]).filter(e=>"file"===e.kind&&e.type.startsWith("image/")).map(e=>e.getAsFile()).filter(e=>!!e);t.length&&(e.preventDefault(),B(t))},onClick:e=>{const t=e.target;"IMG"===t.tagName&&(e.preventDefault(),D({x:e.clientX,y:e.clientY,el:t}))},dangerouslySetInnerHTML:{__html:f.content},className:"docx"===f.kind?"docs-editor mx-auto w-[8.5in] min-h-[11in] bg-surface p-[1in] shadow text-sm leading-relaxed text-ink-strong outline-none focus:ring-2 focus:ring-blue-400/40":"docs-editor block w-full min-h-full p-4 font-mono text-sm leading-relaxed text-ink-strong bg-surface outline-none whitespace-pre-wrap"})})}),b&&/* @__PURE__ */d("div",{className:"absolute inset-0 bg-blue-500/15 border-4 border-dashed border-blue-500 pointer-events-none flex items-center justify-center z-20",children:/* @__PURE__ */d("div",{className:"px-4 py-2 rounded-md bg-blue-600 text-white text-sm font-medium shadow-lg",children:"Drop a document to open · images insert into the page"})}),C&&/* @__PURE__ */u(o,{minWidth:150,style:{left:C.x,top:C.y},onClose:()=>D(null),children:[
44
+ /* @__PURE__ */d("div",{className:"flex-1 min-h-0 overflow-hidden",children:y?/* @__PURE__ */d(c,{size:"sm",padding:"",className:"h-full",label:"Loading"}):/* @__PURE__ */d("div",{className:"h-full overflow-auto "+("docx"===f.kind?"bg-gray-100 px-6 py-8":"bg-white"),children:/* @__PURE__ */d("div",{ref:U,contentEditable:!0,suppressContentEditableWarning:!0,spellCheck:!1,onInput:()=>N(!0),onPaste:e=>{const t=Array.from(e.clipboardData?.items??[]).filter(e=>"file"===e.kind&&e.type.startsWith("image/")).map(e=>e.getAsFile()).filter(e=>!!e);t.length&&(e.preventDefault(),R(t))},onClick:e=>{const t=e.target;"IMG"===t.tagName&&(e.preventDefault(),D({x:e.clientX,y:e.clientY,el:t}))},dangerouslySetInnerHTML:{__html:f.content},className:"docx"===f.kind?"docs-editor mx-auto w-[8.5in] min-h-[11in] bg-surface p-[1in] shadow text-sm leading-relaxed text-ink-strong outline-none focus:ring-2 focus:ring-blue-400/40":"docs-editor block w-full min-h-full p-4 font-mono text-sm leading-relaxed text-ink-strong bg-surface outline-none whitespace-pre-wrap"})})}),b&&/* @__PURE__ */d("div",{className:"absolute inset-0 bg-blue-500/15 border-4 border-dashed border-blue-500 pointer-events-none flex items-center justify-center z-20",children:/* @__PURE__ */d("div",{className:"px-4 py-2 rounded-md bg-blue-600 text-white text-sm font-medium shadow-lg",children:"Drop a document to open · images insert into the page"})}),C&&/* @__PURE__ */u(o,{minWidth:150,style:{left:C.x,top:C.y},onClose:()=>D(null),children:[
45
45
  /* @__PURE__ */d(i,{children:"Image width"}),
46
- /* @__PURE__ */d(l,{onClick:()=>R("25%"),children:"25%"}),
47
- /* @__PURE__ */d(l,{onClick:()=>R("50%"),children:"50%"}),
48
- /* @__PURE__ */d(l,{onClick:()=>R("75%"),children:"75%"}),
49
- /* @__PURE__ */d(l,{onClick:()=>R("100%"),children:"100%"}),
50
- /* @__PURE__ */d(l,{onClick:()=>R(null),children:"Original size"}),
46
+ /* @__PURE__ */d(l,{onClick:()=>W("25%"),children:"25%"}),
47
+ /* @__PURE__ */d(l,{onClick:()=>W("50%"),children:"50%"}),
48
+ /* @__PURE__ */d(l,{onClick:()=>W("75%"),children:"75%"}),
49
+ /* @__PURE__ */d(l,{onClick:()=>W("100%"),children:"100%"}),
50
+ /* @__PURE__ */d(l,{onClick:()=>W(null),children:"Original size"}),
51
51
  /* @__PURE__ */d(a,{}),
52
52
  /* @__PURE__ */d(l,{danger:!0,onClick:()=>{C?.el.remove(),N(!0),D(null)},children:"Remove image"})]})]})}export{f as default};
@@ -0,0 +1,88 @@
1
+ import{openPreviewFile as e}from"./chunk-7N4P6LGD.js";import{SidebarLayout as t}from"./chunk-MOL2ND6G.js";import"./chunk-QWK6DRSN.js";import"./chunk-WZMZ3N5B.js";import{Breadcrumbs as n}from"./chunk-JJHPPTM6.js";import{formatBytes as a}from"./chunk-GEYM4WN3.js";import"./chunk-Y3JW2GW5.js";import"./chunk-36BRD5J3.js";import"./chunk-LF27WIN2.js";import{getFilesDemoTree as r}from"./chunk-OE77XFOV.js";import{AboutApp as i}from"./chunk-YY5TUQS4.js";import{peekFilesViewRequest as s,consumeFilesViewRequest as o,FILES_SHOW_TRASH_EVENT as l,FILES_OPEN_DESKTOP_FOLDER_EVENT as c,subscribeDesktopFolders as d,getDesktopFoldersSnapshot as m,FolderGlyph as h,DesktopItemMiniIcon as p,desktopItemTypeLabel as u}from"./chunk-FNMF42DQ.js";import"./chunk-ESL5TDNA.js";import"./chunk-VTVSMRFX.js";import{useWindowManager as f,WindowTitle as x}from"./chunk-NGUXPP5Q.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-NSYCJTHE.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-OQG3XO4Y.js";import{confirm as k,prompt as g}from"./chunk-HTTICQBP.js";import"./chunk-IH2KC3NQ.js";import{ItemCount as b}from"./chunk-UZ7TKJRO.js";import"./chunk-3DVNXNTF.js";import"./chunk-FRNSCVPN.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-YGCVMPIU.js";import"./chunk-PC44XTGN.js";import{toast_default as N}from"./chunk-MWKLLAJT.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-F3ZOO23R.js";import"./chunk-N3OJ47VK.js";import"./chunk-FZM3ZPW3.js";import"./chunk-CDAJKLGL.js";import"./chunk-QVAOSKFO.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EOVXFXVV.js";import"./chunk-UQYNPYF4.js";import"./chunk-TE6R53YD.js";import{Icon as y}from"./chunk-R64OZ6TC.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as w}from"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import{TH_ONE_LINE as v}from"./chunk-WGLHB6WE.js";import"./chunk-NJN5IKWO.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-TWVUQUUD.js";import"./chunk-VNTJ7QO5.js";import"./chunk-C3QOHMR6.js";import{useState as j,useEffect as $,useSyncExternalStore as C,useRef as T,useCallback as D}from"react";import{jsxs as L,jsx as E,Fragment as R}from"react/jsx-runtime";var W="undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000",P={pdf:"pdf",dxf:"dxf",csv:"csv",jpg:"image",jpeg:"image",png:"image",gif:"image",webp:"image",svg:"image",avif:"image",bmp:"image",stp:"3d",step:"3d",stl:"3d",obj:"3d",gltf:"3d",glb:"3d","3mf":"3d",iges:"3d",igs:"3d",ply:"3d",fbx:"3d"};function F(e,t){return"/"===e||""===e?"/"+t:e.replace(/\/$/,"")+"/"+t}function O(e){if(!e)return"—";try{const t=new Date(e);return isNaN(t.getTime())?"—":t.toLocaleString(void 0,{dateStyle:"short",timeStyle:"short"})}catch{return e}}function M(){const M=W.replace(/\/$/,""),S=null!==r(),[U,V]=j("/"),[I,J]=j([]),[A,Q]=j([]),[K,G]=j(null),[H,B]=j(!0),[X,Y]=j(!1),[Z,z]=j(null),[_,q]=j(!1),[ee,te]=j(()=>{const e=s();return"trash"===e?"trash":e?{desktopFolderId:e.folderId}:"files"});$(()=>{o()},[]);const[ne,ae]=j([]);$(()=>{const e=()=>{o(),te("trash")},t=e=>{o();const t=e.detail?.folderId;t&&te({desktopFolderId:t})};return window.addEventListener(l,e),window.addEventListener(c,t),()=>{window.removeEventListener(l,e),window.removeEventListener(c,t)}},[]);const re=C(d,m,m),ie="object"==typeof ee?ee.desktopFolderId:null,se=ie?re?.folders.find(e=>e.id===ie)??null:null,oe=ie&&re?.itemsByFolder[ie]||[];$(()=>{ie&&re&&!re.folders.some(e=>e.id===ie)&&te("files")},[ie,re]);const le=T(0),ce=T(null),{openPage:de,openEntity:me}=f(),he=t=>{"preview-file"===t.entityType&&t.filePath&&t.fileKind?e({filePath:t.filePath,filename:t.label,kind:t.fileKind,onStaged:e=>de(e)}):"page"===t.entityType?de(t.entityId):me(t.entityType,t.entityId,null,t.label)},pe=D((e,t={})=>fetch(e,{...t,credentials:"include"}),[]),ue=D(async()=>{try{const e=await pe(`${M}/api/quota`);if(e.ok){const t=await e.json();z({used:t.used,limit:t.limit})}}catch{}},[pe,M]),fe=D(async e=>{if(G(null),S){const t=function(e){const t=r();if(!t)return[];let n=t;for(const t of e.split("/").filter(Boolean)){const e=n.find(e=>"folder"===e.kind&&e.name===t);if(!e||!e.children)return[];n=e.children}return n.map(e=>({name:e.name,kind:e.kind,size:e.size??0,modifiedAt:e.modifiedAt??""}))}(e);return J(t),V(e),Y(!1),B(!1),void("/"===e&&Q(t.filter(e=>"folder"===e.kind).map(e=>e.name)))}B(!0);try{const t=await pe(`${M}/api/files?path=${encodeURIComponent(e)}`);if(!t.ok){const e=await t.json().catch(()=>({}));return void N.error(e.error||`Failed to list (${t.status})`)}const n=await t.json(),a=n.entries||[];J(a),V(n.path||e),Y(!1),"/"===(n.path||e)&&Q(a.filter(e=>"folder"===e.kind).map(e=>e.name))}catch(e){Y(!0)}finally{B(!1)}ue()},[pe,M,ue,S]),xe=D(async()=>{if(S)return ae([]),void B(!1);B(!0),G(null);try{const e=await pe(`${M}/api/trash`);if(!e.ok){const t=await e.json().catch(()=>({}));return void N.error(t.error||`Failed to list trash (${e.status})`)}const t=await e.json();ae(t.entries||[]),Y(!1)}catch{Y(!0)}finally{B(!1)}ue()},[pe,M,ue,S]);$(()=>{"files"===ee?fe(U):"trash"===ee&&xe()},[U,ee]);const ke=async e=>{const t=F(U,e.name);try{const n=await pe(`${M}/api/file?path=${encodeURIComponent(t)}`);if(!n.ok)return void N.error(`Download failed (${n.status})`);const a=await n.blob(),r=URL.createObjectURL(a),i=document.createElement("a");i.href=r,i.download=e.name,i.click(),setTimeout(()=>URL.revokeObjectURL(r),1e3)}catch(e){N.error(e?.message||"Download failed")}},ge=async e=>{const t=Array.from(e);for(const e of t){const t=new FormData;t.append("file",e);try{const n=await pe(`${M}/api/upload?path=${encodeURIComponent(U)}`,{method:"POST",body:t});if(!n.ok){const t=await n.json().catch(()=>({}));if(413===n.status){const n=Math.max(0,(t.limit||0)-(t.used||0));N.error(`Quota exceeded — ${a(n)} free, ${e.name} is ${a(t.attempted||e.size)}`)}else N.error(`Upload ${e.name}: ${t.error||n.status}`)}}catch(t){N.error(`Upload ${e.name}: ${t?.message||"failed"}`)}}fe(U)},be=()=>{le.current=0,q(!1)};if($(()=>{const e=()=>be();return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[]),X)/* @__PURE__ */
2
+ return L("div",{className:"flex flex-col h-full bg-white",children:[
3
+ /* @__PURE__ */E(x,{title:"Files - offline"}),
4
+ /* @__PURE__ */E("div",{className:"flex-1 flex items-center justify-center p-8 text-center",children:/* @__PURE__ */L("div",{className:"max-w-md",children:[
5
+ /* @__PURE__ */E(y,{name:"close-circle",className:"h-12 w-12 mx-auto text-gray-300 mb-3",strokeWidth:1.4}),
6
+ /* @__PURE__ */E("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:"Can't reach the file server"}),
7
+ /* @__PURE__ */L("p",{className:"text-sm text-gray-500 mb-3",children:["No response from ",
8
+ /* @__PURE__ */E("span",{className:"font-mono",children:M}),". Make sure the server is running — see ",
9
+ /* @__PURE__ */E("span",{className:"font-mono",children:"examples/file-server/README.md"}),"."]}),
10
+ /* @__PURE__ */E("button",{onClick:()=>fe(U),className:"px-3 h-8 text-sm bg-blue-500 text-on-accent rounded hover:bg-blue-600",children:"Retry"})]})})]});const Ne="/"===U?[]:U.split("/").filter(Boolean),ye=Z&&Z.limit>0?Math.min(100,Math.round(Z.used/Z.limit*100)):0,we=ye>90?"bg-red-500":ye>75?"bg-amber-500":"bg-blue-500",ve=[{label:"My files",onClick:()=>V("/")},...Ne.map((e,t)=>({label:e,onClick:()=>V("/"+Ne.slice(0,t+1).join("/"))}))],je=e=>"flex w-full items-center gap-2 rounded-md px-3 min-h-(--row-height-menu) py-2 text-left text-sm transition-colors "+(e?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),$e=e=>/* @__PURE__ */E("svg",{className:"h-4 w-4 shrink-0 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.6,children:/* @__PURE__ */E("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})}),Ce=/* @__PURE__ */L("nav",{className:"p-2",children:[
11
+ /* @__PURE__ */E("div",{className:"px-2 py-2 text-2xs font-semibold uppercase tracking-wide text-ink-faintest",children:"Locations"}),
12
+ /* @__PURE__ */L("button",{onClick:()=>{te("files"),V("/")},className:je("files"===ee&&"/"===U),children:[$e("M2.25 12l8.954-8.955a1.5 1.5 0 012.122 0L21.75 12M4.5 9.75v9.75a.75.75 0 00.75.75H9V15a.75.75 0 01.75-.75h4.5A.75.75 0 0115 15v5.25h3.75a.75.75 0 00.75-.75V9.75"),"My files"]}),A.map(e=>/* @__PURE__ */L("button",{onClick:()=>{te("files"),V("/"+e)},className:je("files"===ee&&U==="/"+e),children:[$e("M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"),
13
+ /* @__PURE__ */E("span",{className:"truncate",children:e})]},e)),!S&&/* @__PURE__ */L("button",{onClick:()=>te("trash"),className:je("trash"===ee),children:[$e("M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79"),"Trash"]}),re&&re.folders.length>0&&/* @__PURE__ */L(R,{children:[
14
+ /* @__PURE__ */E("div",{className:"px-2 pt-3 pb-2 text-2xs font-semibold uppercase tracking-wide text-ink-faintest",children:"Desktop"}),re.folders.map(e=>/* @__PURE__ */L("button",{onClick:()=>te({desktopFolderId:e.id}),className:je(ie===e.id),children:[
15
+ /* @__PURE__ */E(h,{className:"h-4 w-4 shrink-0 text-amber-500"}),
16
+ /* @__PURE__ */E("span",{className:"truncate",children:e.name}),
17
+ /* @__PURE__ */E(b,{count:e.itemCount,active:ie===e.id,className:"ml-auto"})]},e.id))]})]});/* @__PURE__ */
18
+ return L("div",{className:"relative flex flex-col h-full bg-white",onDragEnter:e=>{S||"object"==typeof ee||e.dataTransfer?.types?.includes?.("Files")&&(e.preventDefault(),le.current++,_||q(!0))},onDragOver:e=>{e.dataTransfer?.types?.includes?.("Files")&&e.preventDefault()},onDragLeave:()=>{le.current>0&&le.current--,0===le.current&&q(!1)},onDrop:e=>{e.preventDefault(),be(),S||"object"==typeof ee||e.dataTransfer.files?.length&&ge(e.dataTransfer.files)},children:[
19
+ /* @__PURE__ */E(x,{title:se?`Files - ${se.name}`:"Files"+("/"===U?"":" - "+U)}),
20
+ /* @__PURE__ */E(i,{app:"files"}),
21
+ /* @__PURE__ */E("input",{ref:ce,type:"file",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&ge(e.target.files),ce.current&&(ce.current.value="")}}),
22
+ /* @__PURE__ */E("div",{className:"flex-1 min-h-0",children:/* @__PURE__ */E(t,{sidebar:Ce,storageKey:"files.sidebarWidth",defaultWidth:200,minWidth:150,maxWidth:320,children:/* @__PURE__ */L("div",{className:"flex h-full min-w-0 flex-col",children:[
23
+ /* @__PURE__ */L("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-line bg-surface-sunken shrink-0 text-xs",children:[/* @__PURE__ */L(R,"files"===ee?{children:[
24
+ /* @__PURE__ */E("button",{onClick:()=>V(function(e){if("/"===e||""===e)return"/";const t=e.replace(/\/$/,""),n=t.lastIndexOf("/");return n<=0?"/":t.slice(0,n)}(U)),disabled:"/"===U,className:"px-2 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",title:"Parent folder",children:/* @__PURE__ */E(y,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
25
+ /* @__PURE__ */E("div",{className:"flex-1 min-w-0",children:/* @__PURE__ */E(n,{items:ve,maxItems:5})}),
26
+ /* @__PURE__ */E("button",{onClick:()=>fe(U),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Refresh",children:/* @__PURE__ */E(y,{name:"refresh",className:"h-3.5 w-3.5",strokeWidth:1.8})}),!S&&/* @__PURE__ */L(R,{children:[
27
+ /* @__PURE__ */L("button",{onClick:()=>te("trash"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600 flex items-center gap-1",title:"Open trash",children:[
28
+ /* @__PURE__ */E(y,{name:"trash",className:"h-3.5 w-3.5",strokeWidth:1.5}),"Trash"]}),
29
+ /* @__PURE__ */L("button",{onClick:async()=>{const e=await g({title:"New folder",placeholder:"Folder name",confirmLabel:"Create"});if(!e)return;if(/[\\/]/.test(e))return void N.error("Folder names cannot contain slashes");const t=F(U,e),n=await pe(`${M}/api/folder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t})});if(!n.ok){const e=await n.json().catch(()=>({}));return void N.error(e.error||`Create folder failed (${n.status})`)}fe(U)},className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600 flex items-center gap-1",children:[
30
+ /* @__PURE__ */E(y,{name:"folder-plus",className:"h-3.5 w-3.5",strokeWidth:1.5}),"New Folder"]}),
31
+ /* @__PURE__ */L("button",{onClick:()=>ce.current?.click(),className:"px-2 py-1 rounded bg-blue-500 text-white hover:bg-blue-600 flex items-center gap-1",children:[
32
+ /* @__PURE__ */E(y,{name:"upload",className:"h-3.5 w-3.5",strokeWidth:1.8}),"Upload"]})]})]}:"trash"===ee?{children:[
33
+ /* @__PURE__ */E("button",{onClick:()=>te("files"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Back to files",children:/* @__PURE__ */E(y,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
34
+ /* @__PURE__ */E("span",{className:"flex-1 text-gray-700 font-medium px-2",children:"Trash"}),
35
+ /* @__PURE__ */E("button",{onClick:xe,className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Refresh",children:/* @__PURE__ */E(y,{name:"refresh",className:"h-3.5 w-3.5",strokeWidth:1.8})}),
36
+ /* @__PURE__ */E("button",{onClick:async()=>{if(0===ne.length)return;if(!await k({title:"Empty trash",message:`${ne.length} item${1===ne.length?"":"s"} will be permanently removed. This can't be undone.`,confirmLabel:"Empty trash",variant:"danger"}))return;const e=await pe(`${M}/api/trash`,{method:"DELETE"});if(!e.ok){const t=await e.json().catch(()=>({}));return void N.error(t.error||`Empty trash failed (${e.status})`)}xe()},disabled:0===ne.length,className:"px-2 py-1 rounded text-red-600 hover:bg-red-50 disabled:opacity-30 flex items-center gap-1",children:"Empty trash"})]}:{children:[
37
+ /* @__PURE__ */E("button",{onClick:()=>te("files"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Back to files",children:/* @__PURE__ */E(y,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
38
+ /* @__PURE__ */E(h,{className:"h-4 w-4 text-amber-500 ml-1"}),
39
+ /* @__PURE__ */E("span",{className:"flex-1 text-gray-700 font-medium px-1 truncate",children:se?.name??"Desktop folder"}),
40
+ /* @__PURE__ */E("span",{className:"text-2xs text-ink-faintest px-2",children:"Desktop shortcuts"})]}),Z&&/* @__PURE__ */L(R,{children:[
41
+ /* @__PURE__ */E("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
42
+ /* @__PURE__ */L("div",{className:"flex items-center gap-2",title:`${a(Z.used)} of ${a(Z.limit)} used`,children:[
43
+ /* @__PURE__ */E("div",{className:"w-20 h-1.5 rounded-full bg-gray-200 overflow-hidden",children:/* @__PURE__ */E("div",{className:`h-full ${we} transition-all`,style:{width:`${ye}%`}})}),
44
+ /* @__PURE__ */L("span",{className:"text-2xs text-ink-faint tabular-nums whitespace-nowrap",children:[a(Z.used)," / ",a(Z.limit)]})]})]})]}),
45
+ /* @__PURE__ */E("div",{className:"flex-1 overflow-auto",children:"object"==typeof ee?0===oe.length?/* @__PURE__ */E("div",{className:"p-10 text-center text-sm text-gray-400",children:"This desktop folder is empty. Drag shortcuts onto it on the desktop."}):/* @__PURE__ */L("table",{className:"w-full text-sm",children:[
46
+ /* @__PURE__ */E("thead",{className:"bg-surface-sunken text-2xs uppercase tracking-wide text-ink-faint",children:/* @__PURE__ */L("tr",{children:[
47
+ /* @__PURE__ */E("th",{className:`${v} text-left font-medium px-3 h-8`,children:"Name"}),
48
+ /* @__PURE__ */E("th",{className:`${v} text-left font-medium px-3 h-8 w-28`,children:"Type"}),
49
+ /* @__PURE__ */E("th",{className:`${v} w-56`})]})}),
50
+ /* @__PURE__ */E("tbody",{children:oe.map(e=>{const t=`${e.entityType}|${e.entityId}`;/* @__PURE__ */
51
+ return L("tr",{onClick:()=>G(t),onDoubleClick:()=>he(e),className:"cursor-default border-b border-gray-100 "+(K===t?"bg-blue-50":"hover:bg-gray-50"),children:[
52
+ /* @__PURE__ */L("td",{className:"px-3 h-8 flex items-center gap-2",children:[
53
+ /* @__PURE__ */E(p,{item:e}),
54
+ /* @__PURE__ */E("span",{className:"truncate",title:e.label,children:e.label})]}),
55
+ /* @__PURE__ */E("td",{className:"px-3 h-8 text-xs text-ink-faint",children:u(e)}),
56
+ /* @__PURE__ */L("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:[
57
+ /* @__PURE__ */E("button",{onClick:t=>{t.stopPropagation(),he(e)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-blue-600 text-2xs",children:"Open"}),
58
+ /* @__PURE__ */E("button",{onClick:t=>{t.stopPropagation(),re?.moveToDesktop([e])},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-ink-faint text-2xs ml-1",children:"Move to desktop"}),
59
+ /* @__PURE__ */E("button",{onClick:t=>{t.stopPropagation(),re?.removeShortcuts([e])},className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Remove"})]})]},t)})})]}):"trash"===ee?H&&0===ne.length?/* @__PURE__ */E(w,{size:"sm",padding:"p-6",label:"Loading"}):0===ne.length?/* @__PURE__ */E("div",{className:"p-10 text-center text-sm text-gray-400",children:"Trash is empty."}):/* @__PURE__ */L("table",{className:"w-full text-sm",children:[
60
+ /* @__PURE__ */E("thead",{className:"bg-surface-sunken text-2xs uppercase tracking-wide text-ink-faint",children:/* @__PURE__ */L("tr",{children:[
61
+ /* @__PURE__ */E("th",{className:`${v} text-left font-medium px-3 h-8`,children:"Name"}),
62
+ /* @__PURE__ */E("th",{className:`${v} text-left font-medium px-3 h-8`,children:"Original location"}),
63
+ /* @__PURE__ */E("th",{className:`${v} text-right font-medium px-3 h-8 w-24`,children:"Size"}),
64
+ /* @__PURE__ */E("th",{className:`${v} text-right font-medium px-3 h-8 w-40`,children:"Deleted"}),
65
+ /* @__PURE__ */E("th",{className:`${v} w-44`})]})}),
66
+ /* @__PURE__ */E("tbody",{children:ne.map(e=>/* @__PURE__ */L("tr",{className:"border-b border-gray-100 hover:bg-gray-50",children:[
67
+ /* @__PURE__ */L("td",{className:"px-3 h-8 flex items-center gap-2",children:["folder"===e.kind?/* @__PURE__ */E(y,{name:"folder",look:"solid",className:"h-4 w-4 text-amber-500 shrink-0"}):/* @__PURE__ */E(y,{name:"page",className:"h-4 w-4 text-ink-faintest shrink-0",strokeWidth:1.5}),
68
+ /* @__PURE__ */E("span",{className:"truncate",title:e.name,children:e.name})]}),
69
+ /* @__PURE__ */E("td",{className:"px-3 h-8 text-ink-faint text-xs font-mono truncate",title:e.originalPath,children:e.originalPath||"—"}),
70
+ /* @__PURE__ */E("td",{className:"px-3 h-8 text-right tabular-nums text-ink-faint",children:a(e.size)}),
71
+ /* @__PURE__ */E("td",{className:"px-3 h-8 text-right text-ink-faint tabular-nums",children:e.deletedAt?O(e.deletedAt):"—"}),
72
+ /* @__PURE__ */L("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:[
73
+ /* @__PURE__ */E("button",{onClick:()=>(async e=>{const t=await pe(`${M}/api/trash/restore`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e.id})});if(!t.ok){const e=await t.json().catch(()=>({}));return void N.error(e.error||`Restore failed (${t.status})`)}N.success(`Restored "${e.name}"`),xe()})(e),className:"px-2 py-0.5 rounded hover:bg-gray-200 text-blue-600 text-2xs",children:"Restore"}),
74
+ /* @__PURE__ */E("button",{onClick:()=>(async e=>{if(!await k({title:"Permanently delete",message:`"${e.name}" will be permanently removed. This can't be undone.`,confirmLabel:"Delete forever",variant:"danger"}))return;const t=await pe(`${M}/api/trash/${encodeURIComponent(e.id)}`,{method:"DELETE"});if(!t.ok){const e=await t.json().catch(()=>({}));return void N.error(e.error||`Delete failed (${t.status})`)}xe()})(e),className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Delete forever"})]})]},e.id))})]}):H&&0===I.length?/* @__PURE__ */E(w,{size:"sm",padding:"p-6",label:"Loading"}):0===I.length?/* @__PURE__ */L("div",{className:"p-10 text-center text-sm text-gray-400",children:["Empty folder.",!S&&/* @__PURE__ */L(R,{children:[" Drop files here or click ",
75
+ /* @__PURE__ */E("span",{className:"font-medium",children:"Upload"}),"."]})]}):/* @__PURE__ */L("table",{className:"w-full text-sm",children:[
76
+ /* @__PURE__ */E("thead",{className:"bg-surface-sunken text-2xs uppercase tracking-wide text-ink-faint",children:/* @__PURE__ */L("tr",{children:[
77
+ /* @__PURE__ */E("th",{className:`${v} text-left font-medium px-3 h-8`,children:"Name"}),
78
+ /* @__PURE__ */E("th",{className:`${v} text-right font-medium px-3 h-8 w-24`,children:"Size"}),
79
+ /* @__PURE__ */E("th",{className:`${v} text-right font-medium px-3 h-8 w-40`,children:"Modified"}),
80
+ /* @__PURE__ */E("th",{className:`${v} w-32`})]})}),
81
+ /* @__PURE__ */E("tbody",{children:I.map(t=>/* @__PURE__ */L("tr",{onClick:()=>G(t.name),onDoubleClick:()=>{"folder"===t.kind?V(F(U,t.name)):(async t=>{if(S)return;const n=F(U,t.name),a=(t.name.split(".").pop()||"").toLowerCase(),r=P[a];r?await e({filePath:n,filename:t.name,kind:r,onStaged:e=>de(e)}):ke(t)})(t)},className:"cursor-default border-b border-gray-100 "+(K===t.name?"bg-blue-50":"hover:bg-gray-50"),children:[
82
+ /* @__PURE__ */L("td",{className:"px-3 h-8 flex items-center gap-2",children:["folder"===t.kind?/* @__PURE__ */E(y,{name:"folder",look:"solid",className:"h-4 w-4 text-amber-500 shrink-0"}):/* @__PURE__ */E(y,{name:"page",className:"h-4 w-4 text-ink-faintest shrink-0",strokeWidth:1.5}),
83
+ /* @__PURE__ */E("span",{className:"truncate",title:t.name,children:t.name})]}),
84
+ /* @__PURE__ */E("td",{className:"px-3 h-8 text-right tabular-nums text-ink-faint",children:"folder"===t.kind?"—":a(t.size)}),
85
+ /* @__PURE__ */E("td",{className:"px-3 h-8 text-right text-ink-faint tabular-nums",children:O(t.modifiedAt)}),
86
+ /* @__PURE__ */E("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:!S&&/* @__PURE__ */L(R,{children:["file"===t.kind&&/* @__PURE__ */E("button",{onClick:e=>{e.stopPropagation(),ke(t)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-ink-faint text-2xs",children:"Download"}),
87
+ /* @__PURE__ */E("button",{onClick:e=>{e.stopPropagation(),(async e=>{const t=await g({title:`Rename ${e.kind}`,defaultValue:e.name,confirmLabel:"Rename"});if(!t||t===e.name)return;if(/[\\/]/.test(t))return void N.error("Names cannot contain slashes");const n=F(U,e.name),a=F(U,t),r=await pe(`${M}/api/rename`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:n,to:a})});if(!r.ok){const e=await r.json().catch(()=>({}));return void N.error(e.error||`Rename failed (${r.status})`)}fe(U)})(t)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-ink-faint text-2xs ml-1",children:"Rename"}),
88
+ /* @__PURE__ */E("button",{onClick:e=>{e.stopPropagation(),(async e=>{if(!await k({title:`Delete ${e.kind}`,message:`"${e.name}"${"folder"===e.kind?" and everything inside":""} will be permanently removed.`,confirmLabel:"Delete",variant:"danger"}))return;const t=F(U,e.name),n=await pe(`${M}/api/files?path=${encodeURIComponent(t)}`,{method:"DELETE"});if(!n.ok){const e=await n.json().catch(()=>({}));return void N.error(e.error||`Delete failed (${n.status})`)}fe(U)})(t)},className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Delete"})]})})]},t.name))})]})})]})})}),_&&/* @__PURE__ */E("div",{className:"absolute inset-0 bg-blue-500/15 border-4 border-dashed border-blue-500 pointer-events-none flex items-center justify-center z-20",children:/* @__PURE__ */E("div",{className:"px-4 py-2 rounded-md bg-blue-600 text-white text-sm font-medium shadow-lg",children:"Drop to upload"})})]})}export{M as default};