efficient-shell 10.15.0 → 10.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (400) hide show
  1. package/README.md +14 -0
  2. package/dist/{Browser-WR4GMYE7.js → Browser-Q5BYSSW3.js} +14 -14
  3. package/dist/Calculator-6NJNSIRN.js +29 -0
  4. package/dist/{CurrencyConverter-HEAAQX23.js → CurrencyConverter-42IHLJVV.js} +9 -9
  5. package/dist/{Documents-NSPKXCTF.js → Documents-GGEPMWB5.js} +27 -27
  6. package/dist/Files-OVNXUYOV.js +88 -0
  7. package/dist/{Notepad-5LSFAYXO.js → Notepad-L2LOWTSE.js} +9 -9
  8. package/dist/{PdfViewer-LU5JKHSG.js → PdfViewer-Y3SAVADX.js} +1 -1
  9. package/dist/{PomodoroTimer-5V32QOCZ.js → PomodoroTimer-PD7POYX5.js} +19 -19
  10. package/dist/{Preview-PDVZZRSK.js → Preview-HM2Z3EJO.js} +30 -30
  11. package/dist/Sidebar-2HHICMZZ.js +44 -0
  12. package/dist/{Spreadsheet-K4IAI3A2.js → Spreadsheet-2E4TQ64O.js} +13 -13
  13. package/dist/{Stock-AOCHAKUF.js → Stock-IABQRSXZ.js} +3 -3
  14. package/dist/{Weather-F2QHTG32.js → Weather-4QPYOENN.js} +22 -22
  15. package/dist/{WorldClock-G72577HU.js → WorldClock-3ZVRBLEW.js} +6 -6
  16. package/dist/ai/index.d.ts +77 -2
  17. package/dist/ai/index.js +80 -62
  18. package/dist/ai.css +1 -1
  19. package/dist/apps/index.js +1 -1
  20. package/dist/bin/media-host-check.js +1 -1
  21. package/dist/bin/ui-check.js +1 -1
  22. package/dist/brand.css +1 -1
  23. package/dist/charts/BoxPlotChart.js +1 -1
  24. package/dist/charts/CandlestickChart.js +1 -1
  25. package/dist/charts/CartesianPlot.js +1 -1
  26. package/dist/charts/ChartBrush.js +1 -1
  27. package/dist/charts/ChartFrame.js +1 -1
  28. package/dist/charts/ChartSkeleton.js +1 -1
  29. package/dist/charts/ChartTooltip.js +1 -1
  30. package/dist/charts/ChordChart.js +1 -1
  31. package/dist/charts/ColumnChart.js +1 -1
  32. package/dist/charts/FunnelChart.js +1 -1
  33. package/dist/charts/HeatmapChart.js +1 -1
  34. package/dist/charts/HistogramChart.js +1 -1
  35. package/dist/charts/Meter.js +1 -1
  36. package/dist/charts/PieChart.js +1 -1
  37. package/dist/charts/RadarChart.js +1 -1
  38. package/dist/charts/RadialBarChart.js +1 -1
  39. package/dist/charts/RangeChart.js +1 -1
  40. package/dist/charts/RankedBars.js +1 -1
  41. package/dist/charts/SankeyChart.js +1 -1
  42. package/dist/charts/ScatterChart.js +1 -1
  43. package/dist/charts/SpecChart.js +1 -1
  44. package/dist/charts/StatTile.js +1 -1
  45. package/dist/charts/SunburstChart.js +1 -1
  46. package/dist/charts/TimeSeriesChart.js +1 -1
  47. package/dist/charts/TreemapChart.js +1 -1
  48. package/dist/charts/WaterfallChart.js +1 -1
  49. package/dist/chunk-22RQC4EW.js +20 -0
  50. package/dist/chunk-26RTJKHD.js +2 -0
  51. package/dist/{chunk-F2R3UFNQ.js → chunk-2E2SUEEE.js} +1 -1
  52. package/dist/chunk-2H6YNMBE.js +14 -0
  53. package/dist/{chunk-N2RHM432.js → chunk-2VGQS6CW.js} +1 -1
  54. package/dist/{chunk-B25RVAVS.js → chunk-2YSGXZOL.js} +63 -63
  55. package/dist/{chunk-SQCUN2DX.js → chunk-34URULVW.js} +1 -1
  56. package/dist/{chunk-5LCDCO46.js → chunk-3ELLBQPS.js} +1 -1
  57. package/dist/{chunk-M22B3Y5Y.js → chunk-3IUPYCW3.js} +1 -1
  58. package/dist/{chunk-NZQCDFDG.js → chunk-3NW5LD7D.js} +3 -3
  59. package/dist/{chunk-POQ4ETLL.js → chunk-3PR5YMWZ.js} +1 -1
  60. package/dist/{chunk-FGJOGBGZ.js → chunk-3UXXA2CS.js} +8 -8
  61. package/dist/{chunk-XDBG4HPV.js → chunk-4EZIWLJJ.js} +1 -1
  62. package/dist/{chunk-EYEB3J77.js → chunk-4HBSQGRI.js} +5 -5
  63. package/dist/{chunk-V2MIQ4GJ.js → chunk-4UKGVLFP.js} +2 -2
  64. package/dist/{chunk-EZEYKCI6.js → chunk-4ULRP4Y4.js} +1 -1
  65. package/dist/{chunk-FRVNDEV2.js → chunk-4WEFGKJL.js} +8 -8
  66. package/dist/{chunk-FUVVO6YP.js → chunk-54NMFQMW.js} +4 -4
  67. package/dist/{chunk-KJCTXWF7.js → chunk-5QGBVTGS.js} +2 -2
  68. package/dist/{chunk-LVBO2OMQ.js → chunk-5SIOCKCK.js} +1 -1
  69. package/dist/{chunk-OSVY6SUO.js → chunk-5TDQPZDB.js} +11 -11
  70. package/dist/chunk-5TQLUPZD.js +6 -0
  71. package/dist/{chunk-7PSIPTOE.js → chunk-5WYRAJ5F.js} +1 -1
  72. package/dist/chunk-67MQ5S32.js +8 -0
  73. package/dist/chunk-6JSXIEH2.js +4 -0
  74. package/dist/{chunk-36R3R3IB.js → chunk-6V4INP7J.js} +10 -10
  75. package/dist/{chunk-Q3IR5SKD.js → chunk-6XBWM453.js} +1 -1
  76. package/dist/{chunk-RFEET2LS.js → chunk-77AQNJE2.js} +8 -8
  77. package/dist/chunk-77MOYIQW.js +15 -0
  78. package/dist/{chunk-AKM6JBMD.js → chunk-7ELJQL7J.js} +1 -1
  79. package/dist/chunk-7INZ7O3A.js +5 -0
  80. package/dist/{chunk-G4JTO5PB.js → chunk-7JGR7WPD.js} +1 -1
  81. package/dist/{chunk-UPQW4GCT.js → chunk-7TZV6G2F.js} +1 -1
  82. package/dist/{chunk-A267MPGS.js → chunk-7VBXIIEC.js} +3 -3
  83. package/dist/{chunk-MCYFUIXH.js → chunk-A42MKJA3.js} +1 -1
  84. package/dist/{chunk-DKGZPVLL.js → chunk-AFYLVV74.js} +1 -1
  85. package/dist/{chunk-H4HB5OET.js → chunk-AWKJZSTO.js} +1 -1
  86. package/dist/{chunk-FFZREKEF.js → chunk-AYDW63LV.js} +7 -7
  87. package/dist/chunk-B23RG53S.js +14 -0
  88. package/dist/chunk-B3CN55UI.js +2 -0
  89. package/dist/{chunk-ZLSUQAD3.js → chunk-C6Y7B73Q.js} +1 -1
  90. package/dist/{chunk-QP4UPCXQ.js → chunk-C764JODK.js} +1 -1
  91. package/dist/{chunk-LEDUD23S.js → chunk-CLTRQ7AQ.js} +1 -1
  92. package/dist/chunk-CUHUZBFH.js +29 -0
  93. package/dist/chunk-CXYHFGUY.js +9 -0
  94. package/dist/{chunk-EHGGSUXA.js → chunk-DCRLJMQ6.js} +1 -1
  95. package/dist/chunk-DESWIPOZ.js +3 -0
  96. package/dist/{chunk-4XS32UWF.js → chunk-DGZAQXTW.js} +4 -4
  97. package/dist/{chunk-SP2AUVIU.js → chunk-DHIQ46C5.js} +3 -3
  98. package/dist/{chunk-IOJNSX4N.js → chunk-DQQKG46I.js} +7 -7
  99. package/dist/chunk-DYNJ2H6R.js +8 -0
  100. package/dist/{chunk-INNIWRVU.js → chunk-E6GDAV5R.js} +2 -2
  101. package/dist/{chunk-ID6WFAXW.js → chunk-ECJKIPWU.js} +1 -1
  102. package/dist/chunk-EJUNGVK2.js +22 -0
  103. package/dist/{chunk-3EJ64VKE.js → chunk-EN5NXWT6.js} +1 -1
  104. package/dist/{chunk-MCDM2G4W.js → chunk-EOWUUOVE.js} +1 -1
  105. package/dist/{chunk-S52GQQVB.js → chunk-EPY34L26.js} +1 -1
  106. package/dist/{chunk-AJVUND5A.js → chunk-FACWYKL6.js} +4 -4
  107. package/dist/{chunk-ZL5OSF26.js → chunk-FKRPQDFX.js} +19 -19
  108. package/dist/{chunk-4VTJEKHX.js → chunk-FOFZI62F.js} +1 -1
  109. package/dist/{chunk-IC7BEFE3.js → chunk-FS6EOU4G.js} +1 -1
  110. package/dist/{chunk-WZ5QSSUM.js → chunk-G4GVLK44.js} +6 -6
  111. package/dist/chunk-GDQJBQ5B.js +1 -0
  112. package/dist/{chunk-XJUREXYW.js → chunk-GEP4FROW.js} +1 -1
  113. package/dist/{chunk-5N5AAYQV.js → chunk-GISDIVFK.js} +1 -1
  114. package/dist/chunk-HJCUDXLV.js +1 -0
  115. package/dist/{chunk-ESYYKGN4.js → chunk-HJW67KA7.js} +1 -1
  116. package/dist/{chunk-NBB2RKDH.js → chunk-HV47GP2C.js} +5 -5
  117. package/dist/chunk-I33SVQ7P.js +8 -0
  118. package/dist/chunk-I4VIEGCX.js +2 -0
  119. package/dist/{chunk-KJ4CBZEQ.js → chunk-IMDGMUE3.js} +1 -1
  120. package/dist/{chunk-HNBGLF4B.js → chunk-JFV5CQN4.js} +1 -1
  121. package/dist/{chunk-7MSC3Z5H.js → chunk-JH4ZCPHW.js} +8 -8
  122. package/dist/chunk-JIGFR7Z3.js +11 -0
  123. package/dist/chunk-JNQKBN5M.js +7 -0
  124. package/dist/{chunk-OOLPDASG.js → chunk-JSG2AKCG.js} +1 -1
  125. package/dist/{chunk-6RX4PVBU.js → chunk-JTMEFXRL.js} +1 -1
  126. package/dist/{chunk-FQIA5BTN.js → chunk-JYIH2EBG.js} +7 -7
  127. package/dist/chunk-K4JQ3FQI.js +2 -0
  128. package/dist/{chunk-ULAGXDOL.js → chunk-LXL2UCUR.js} +1 -1
  129. package/dist/{chunk-PUBJ5YHQ.js → chunk-LYHJHUQH.js} +1 -1
  130. package/dist/chunk-MJGK6QTO.js +7 -0
  131. package/dist/{chunk-B37JVKW5.js → chunk-MNNZGO2E.js} +1 -1
  132. package/dist/{chunk-XTCXX5LJ.js → chunk-MS5APD3V.js} +1 -1
  133. package/dist/chunk-MUXGWDEH.js +2 -0
  134. package/dist/{chunk-S5SRXI4V.js → chunk-MVZRZTQP.js} +1 -1
  135. package/dist/{chunk-MMQ6ETRD.js → chunk-N67QX3WW.js} +2 -2
  136. package/dist/{chunk-G7QK7WAK.js → chunk-N6CS2FO2.js} +1 -1
  137. package/dist/{chunk-4U57ANZF.js → chunk-NFB7PARJ.js} +4 -4
  138. package/dist/{chunk-HRPXJ4EI.js → chunk-NNZFC4O7.js} +1 -1
  139. package/dist/{chunk-ZI6SMZJ4.js → chunk-NU5HN3FZ.js} +12 -12
  140. package/dist/{chunk-66XPG5G3.js → chunk-NVD4AI5Y.js} +1 -1
  141. package/dist/{chunk-YLGQ6ACR.js → chunk-O47HKK6E.js} +2 -2
  142. package/dist/{chunk-M5LR7ZZX.js → chunk-O6JJIR4H.js} +1 -1
  143. package/dist/{chunk-BJXDOM2N.js → chunk-OBJGUJIE.js} +1 -1
  144. package/dist/{chunk-AUWTGM65.js → chunk-OH5L6HYW.js} +3 -3
  145. package/dist/{chunk-XPPLCLYK.js → chunk-OORL6BIG.js} +1 -1
  146. package/dist/{chunk-CHAWFMV4.js → chunk-OP5DOO3K.js} +4 -4
  147. package/dist/{chunk-ZURB2DCM.js → chunk-OPN4I565.js} +1 -1
  148. package/dist/{chunk-7SMV6G4Z.js → chunk-ORIXCEKO.js} +1 -1
  149. package/dist/{chunk-TOVKWNI2.js → chunk-P3RXXWXN.js} +6 -6
  150. package/dist/{chunk-ON67HF5K.js → chunk-PCTOL2FX.js} +8 -8
  151. package/dist/chunk-PLK2WHZG.js +27 -0
  152. package/dist/chunk-PN5FQVMB.js +7 -0
  153. package/dist/chunk-PUF75SMJ.js +1 -0
  154. package/dist/{chunk-YFMZKTJC.js → chunk-PW52RXPI.js} +1 -1
  155. package/dist/chunk-QDKAA3HR.js +2 -0
  156. package/dist/{chunk-SOGQZVPJ.js → chunk-QHPVAXHR.js} +5 -5
  157. package/dist/chunk-QO5E33DH.js +8 -0
  158. package/dist/{chunk-ARCQYF7G.js → chunk-QRYSL6QU.js} +17 -17
  159. package/dist/{chunk-LPXMHYTM.js → chunk-QVZKRROQ.js} +1 -1
  160. package/dist/{chunk-EXJXOKUU.js → chunk-QYL26AB4.js} +1 -1
  161. package/dist/{chunk-5FRFSPQ2.js → chunk-RBBIAIPH.js} +8 -8
  162. package/dist/{chunk-GKIU55T5.js → chunk-REWKL7MX.js} +2 -2
  163. package/dist/{chunk-CFAELIKH.js → chunk-RT4WOEVS.js} +6 -6
  164. package/dist/{chunk-PB3OC4BO.js → chunk-RUGQO7YF.js} +10 -10
  165. package/dist/{chunk-AJFWBEIG.js → chunk-RVRDDTEG.js} +9 -9
  166. package/dist/{chunk-5LXT3IUL.js → chunk-RXCGE2AY.js} +1 -1
  167. package/dist/{chunk-KKOADH55.js → chunk-S74LKSUB.js} +1 -1
  168. package/dist/{chunk-QYRMFGES.js → chunk-SAP4YI2Y.js} +1 -1
  169. package/dist/{chunk-NWURIQI3.js → chunk-SDDV3UCN.js} +18 -18
  170. package/dist/{chunk-KEPJWZJZ.js → chunk-SL77N7VT.js} +3 -3
  171. package/dist/chunk-SLU45G5J.js +19 -0
  172. package/dist/{chunk-5RE6R3XC.js → chunk-SXNQHIBY.js} +1 -1
  173. package/dist/{chunk-GGK27H67.js → chunk-TGGUYAWA.js} +1 -1
  174. package/dist/chunk-TGXO3CDO.js +2 -0
  175. package/dist/{chunk-ZMRGHVKS.js → chunk-TKJBZIHT.js} +1 -1
  176. package/dist/chunk-TLMFVEMC.js +9 -0
  177. package/dist/{chunk-MQU3PZUS.js → chunk-TMMNCXQT.js} +1 -1
  178. package/dist/{chunk-EQZZ4V5X.js → chunk-TXDA7TTP.js} +1 -1
  179. package/dist/{chunk-ZL7O4KGQ.js → chunk-UDKTAG57.js} +1 -1
  180. package/dist/{chunk-UTWJKSET.js → chunk-UEISJFZH.js} +5 -5
  181. package/dist/{chunk-HL3DJTIC.js → chunk-UYRMW5MO.js} +7 -7
  182. package/dist/chunk-V6Y4OC6K.js +9 -0
  183. package/dist/{chunk-W5CJD54C.js → chunk-VAK5FQXH.js} +1 -1
  184. package/dist/{chunk-EK5WJQTR.js → chunk-VDUXPMOQ.js} +1 -1
  185. package/dist/{chunk-O7DW2BKY.js → chunk-VHF3CJVO.js} +28 -28
  186. package/dist/{chunk-OAT7OEWP.js → chunk-VIQ6OME2.js} +8 -8
  187. package/dist/{chunk-AJFR35CO.js → chunk-VN4KSRZ5.js} +4 -4
  188. package/dist/chunk-VQCSHJEF.js +6 -0
  189. package/dist/chunk-VWIYC2NB.js +13 -0
  190. package/dist/{chunk-UPCLAEKC.js → chunk-W3OWPBQL.js} +2 -2
  191. package/dist/chunk-WRQ4A5QY.js +1 -0
  192. package/dist/{chunk-NZCSLS4O.js → chunk-WTYQF7XJ.js} +3 -3
  193. package/dist/{chunk-N4REWGMM.js → chunk-WYFMSL4Q.js} +8 -8
  194. package/dist/{chunk-55W5TTKS.js → chunk-XCHAU2UN.js} +5 -5
  195. package/dist/chunk-XGJQVIEG.js +2 -0
  196. package/dist/{chunk-UWIFXNH6.js → chunk-XLWMM53L.js} +3 -3
  197. package/dist/{chunk-VKKK4WLS.js → chunk-XQZL6JDD.js} +6 -6
  198. package/dist/{chunk-JEH5EVIG.js → chunk-XSJHN2GD.js} +1 -1
  199. package/dist/chunk-XYBI57KO.js +12 -0
  200. package/dist/{chunk-3AH524CN.js → chunk-XYECIBVX.js} +1 -1
  201. package/dist/{chunk-TXNCDDB4.js → chunk-Y62TTKSY.js} +3 -3
  202. package/dist/{chunk-6C6TRDNI.js → chunk-YG2TWBDH.js} +1 -1
  203. package/dist/{chunk-U2WCV56F.js → chunk-YILGAEW3.js} +1 -1
  204. package/dist/chunk-YJ5IHIAI.js +2 -0
  205. package/dist/{chunk-LWEWURFT.js → chunk-YJXS7BR5.js} +13 -13
  206. package/dist/{chunk-NBVHJZVS.js → chunk-YQFGRYEF.js} +12 -12
  207. package/dist/{chunk-N3YBOXOF.js → chunk-YSDPFDAG.js} +1 -1
  208. package/dist/{chunk-SSM3EN7G.js → chunk-Z5A4EY2R.js} +1 -1
  209. package/dist/{chunk-ZW3IDCP2.js → chunk-ZGOHRLXG.js} +1 -1
  210. package/dist/{chunk-2RAOWHHM.js → chunk-ZHAWOZA7.js} +12 -12
  211. package/dist/chunk-ZQKA2XKH.js +12 -0
  212. package/dist/data/DataTable.js +1 -1
  213. package/dist/data/Kanban.js +1 -1
  214. package/dist/data/ListFooter.js +1 -1
  215. package/dist/data/ListLoadError.js +1 -1
  216. package/dist/data/Pagination.js +1 -1
  217. package/dist/file-intake/index.js +1 -1
  218. package/dist/format/index.js +1 -1
  219. package/dist/forms/AlignmentGrid.js +1 -1
  220. package/dist/forms/BorderInput.js +1 -1
  221. package/dist/forms/BrandAssetEditor.js +1 -1
  222. package/dist/forms/Button.js +1 -1
  223. package/dist/forms/Calendar.js +1 -1
  224. package/dist/forms/ColorPicker.js +1 -1
  225. package/dist/forms/ComposerAttachments.js +1 -1
  226. package/dist/forms/CornersInput.js +1 -1
  227. package/dist/forms/DatePicker.js +1 -1
  228. package/dist/forms/DateRangePicker.js +1 -1
  229. package/dist/forms/DateTimePicker.js +1 -1
  230. package/dist/forms/DisplayChips.js +1 -1
  231. package/dist/forms/FilePicker.js +1 -1
  232. package/dist/forms/FormErrorSummary.js +1 -1
  233. package/dist/forms/IconButton.js +1 -1
  234. package/dist/forms/IconPicker.js +1 -1
  235. package/dist/forms/ImageFocusPoint.js +1 -1
  236. package/dist/forms/InputNumber.js +1 -1
  237. package/dist/forms/LinkPicker.js +1 -1
  238. package/dist/forms/MediaLibrary.js +1 -1
  239. package/dist/forms/MediaUploadField.js +1 -1
  240. package/dist/forms/MediaUploadGrid.js +1 -1
  241. package/dist/forms/MediaUsedInList.js +1 -1
  242. package/dist/forms/NumericKeypad.js +1 -1
  243. package/dist/forms/PictureTiles.js +1 -1
  244. package/dist/forms/PositionInput.js +1 -1
  245. package/dist/forms/Segmented.js +1 -1
  246. package/dist/forms/Select.d.ts +1 -1
  247. package/dist/forms/Select.js +1 -1
  248. package/dist/forms/SidesInput.js +1 -1
  249. package/dist/forms/Slider.js +1 -1
  250. package/dist/forms/Snippet.js +1 -1
  251. package/dist/forms/SplitButton.js +1 -1
  252. package/dist/forms/TagInput.js +1 -1
  253. package/dist/forms/TextToolbar.d.ts +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.d.ts +1 -1
  260. package/dist/forms/textAlign.js +1 -1
  261. package/dist/forms/useFileIntake.js +1 -1
  262. package/dist/icons/efficient-glyphs.d.ts +2 -0
  263. package/dist/icons/efficient-glyphs.js +1 -1
  264. package/dist/icons/efficient-looks.d.ts +4 -0
  265. package/dist/icons/efficient-looks.js +1 -1
  266. package/dist/icons/efficient-meanings.d.ts +2 -0
  267. package/dist/icons/efficient-meanings.js +1 -1
  268. package/dist/icons/efficient.d.ts +2 -0
  269. package/dist/icons/efficient.js +1 -1
  270. package/dist/icons/glyphs/SeparatorSlashIcon.d.ts +8 -0
  271. package/dist/icons/glyphs/SeparatorSlashIcon.js +1 -0
  272. package/dist/icons/glyphs/SeparatorTriangleIcon.d.ts +8 -0
  273. package/dist/icons/glyphs/SeparatorTriangleIcon.js +1 -0
  274. package/dist/icons/index.d.ts +2 -2
  275. package/dist/icons/index.js +1 -1
  276. package/dist/icons/looks/SeparatorSlashMiniIcon.d.ts +8 -0
  277. package/dist/icons/looks/SeparatorSlashMiniIcon.js +1 -0
  278. package/dist/icons/looks/SeparatorSlashSolidIcon.d.ts +8 -0
  279. package/dist/icons/looks/SeparatorSlashSolidIcon.js +1 -0
  280. package/dist/icons/looks/SeparatorTriangleMiniIcon.d.ts +8 -0
  281. package/dist/icons/looks/SeparatorTriangleMiniIcon.js +1 -0
  282. package/dist/icons/looks/SeparatorTriangleSolidIcon.d.ts +8 -0
  283. package/dist/icons/looks/SeparatorTriangleSolidIcon.js +1 -0
  284. package/dist/icons/looks/map.js +1 -1
  285. package/dist/icons/sets.js +1 -1
  286. package/dist/index.d.ts +1 -1
  287. package/dist/index.js +300 -300
  288. package/dist/locales/zh-Hans.js +1 -1
  289. package/dist/map/index.js +4 -4
  290. package/dist/{names-Bmx_9y41.d.ts → names-CkQuQ47O.d.ts} +1 -1
  291. package/dist/page-tabs/index.js +5 -5
  292. package/dist/pdf/index.js +1 -1
  293. package/dist/shell/Accordion.js +1 -1
  294. package/dist/shell/AppUpdateBanner.js +1 -1
  295. package/dist/shell/Avatar.js +1 -1
  296. package/dist/shell/Banner.js +1 -1
  297. package/dist/shell/Breadcrumbs.js +1 -1
  298. package/dist/shell/BudgetBar.js +1 -1
  299. package/dist/shell/Card.js +1 -1
  300. package/dist/shell/ColoredBadge.js +1 -1
  301. package/dist/shell/ConfirmDialog.js +1 -1
  302. package/dist/shell/ContainerFillChart.js +1 -1
  303. package/dist/shell/ContextMenu.js +1 -1
  304. package/dist/shell/CountBadge.js +1 -1
  305. package/dist/shell/Dialog.js +1 -1
  306. package/dist/shell/Drawer.js +1 -1
  307. package/dist/shell/DropdownMenu.js +1 -1
  308. package/dist/shell/EditableGrid.js +1 -1
  309. package/dist/shell/EmptyState.js +1 -1
  310. package/dist/shell/FloatingBar.js +1 -1
  311. package/dist/shell/GlobalSearch.js +1 -1
  312. package/dist/shell/HelpCenter.js +1 -1
  313. package/dist/shell/IconRail.js +1 -1
  314. package/dist/shell/ImageLightbox.js +1 -1
  315. package/dist/shell/ItemCount.js +1 -1
  316. package/dist/shell/LanguageSelect.js +1 -1
  317. package/dist/shell/Markdown.d.ts +1 -1
  318. package/dist/shell/Markdown.js +1 -1
  319. package/dist/shell/MetricBar.js +1 -1
  320. package/dist/shell/MetricBarLegend.js +1 -1
  321. package/dist/shell/MilestoneTimeline.js +1 -1
  322. package/dist/shell/PageHeader.js +1 -1
  323. package/dist/shell/Popover.js +1 -1
  324. package/dist/shell/PopupMenu.js +1 -1
  325. package/dist/shell/ProductionTimeline.js +1 -1
  326. package/dist/shell/ResizeHandle.js +1 -1
  327. package/dist/shell/Result.js +1 -1
  328. package/dist/shell/SearchableSelect.js +1 -1
  329. package/dist/shell/SettingReset.js +1 -1
  330. package/dist/shell/SettingRow.js +1 -1
  331. package/dist/shell/SidebarLayout.js +1 -1
  332. package/dist/shell/SidebarNav.js +1 -1
  333. package/dist/shell/SortableList.js +1 -1
  334. package/dist/shell/Statistic.js +1 -1
  335. package/dist/shell/StatusBadge.js +1 -1
  336. package/dist/shell/Tabs.js +1 -1
  337. package/dist/shell/TimeAgo.js +1 -1
  338. package/dist/shell/TimelineTrack.js +1 -1
  339. package/dist/shell/Tooltip.js +1 -1
  340. package/dist/shell/TopNav.js +1 -1
  341. package/dist/shell/TransferProgress.js +1 -1
  342. package/dist/shell/Tree.js +1 -1
  343. package/dist/shell/discardGuard.js +1 -1
  344. package/dist/shell/language.js +1 -1
  345. package/dist/shell/strings.d.ts +6 -0
  346. package/dist/shell/strings.js +1 -1
  347. package/dist/shell/toast.js +1 -1
  348. package/dist/telemetry/index.js +1 -1
  349. package/dist/templates/AuthScreen.js +1 -1
  350. package/dist/templates/ChatTemplate.js +1 -1
  351. package/dist/templates/CheckoutTemplate.js +1 -1
  352. package/dist/templates/DashboardTemplate.js +1 -1
  353. package/dist/templates/DataTablePage.js +1 -1
  354. package/dist/templates/EmailTemplate.js +1 -1
  355. package/dist/templates/ErrorBoundary.js +1 -1
  356. package/dist/templates/ErrorPage.js +1 -1
  357. package/dist/templates/FormLayoutPage.js +1 -1
  358. package/dist/templates/GalleryTemplate.js +1 -1
  359. package/dist/ui/index.d.ts +1 -1
  360. package/dist/ui/index.js +1 -1
  361. package/dist/version.js +1 -1
  362. package/package.json +1 -1
  363. package/dist/Calculator-MV5JVQBS.js +0 -29
  364. package/dist/Files-5HAUE2PR.js +0 -88
  365. package/dist/Sidebar-E3VDFBF6.js +0 -44
  366. package/dist/chunk-25M7CYCR.js +0 -9
  367. package/dist/chunk-2JG5JU4M.js +0 -8
  368. package/dist/chunk-3GHTOSJP.js +0 -14
  369. package/dist/chunk-4AQ67NP2.js +0 -15
  370. package/dist/chunk-4PAWQEXM.js +0 -1
  371. package/dist/chunk-5JU53T3U.js +0 -27
  372. package/dist/chunk-6BB6A5OB.js +0 -6
  373. package/dist/chunk-6WSH6D5N.js +0 -29
  374. package/dist/chunk-7LQGPMRP.js +0 -3
  375. package/dist/chunk-CDA2VXBN.js +0 -8
  376. package/dist/chunk-CNLYFW47.js +0 -9
  377. package/dist/chunk-EFU4Z66K.js +0 -8
  378. package/dist/chunk-FJYTYW6M.js +0 -7
  379. package/dist/chunk-FX6DBXXD.js +0 -1
  380. package/dist/chunk-HXNMRJQ4.js +0 -2
  381. package/dist/chunk-IFA2EOAF.js +0 -4
  382. package/dist/chunk-KMEERBZV.js +0 -2
  383. package/dist/chunk-KORKSPHQ.js +0 -6
  384. package/dist/chunk-LWWMRL2Y.js +0 -5
  385. package/dist/chunk-M4K6FLIY.js +0 -1
  386. package/dist/chunk-NLGMJGD6.js +0 -14
  387. package/dist/chunk-OET2Q7P6.js +0 -19
  388. package/dist/chunk-RSS2ALHH.js +0 -9
  389. package/dist/chunk-SCYL5V5X.js +0 -20
  390. package/dist/chunk-SM7IDX7Y.js +0 -1
  391. package/dist/chunk-TIPU74XW.js +0 -22
  392. package/dist/chunk-UUKTYAWY.js +0 -7
  393. package/dist/chunk-V6F42DX3.js +0 -11
  394. package/dist/chunk-VWEG2WM4.js +0 -12
  395. package/dist/chunk-XIB72X74.js +0 -2
  396. package/dist/chunk-ZE5TNYWX.js +0 -7
  397. package/dist/chunk-ZHPHNQKM.js +0 -13
  398. package/dist/chunk-ZO244TWH.js +0 -8
  399. package/dist/chunk-ZZTCYEQ4.js +0 -12
  400. /package/dist/{chunk-6V6ANLHW.js → chunk-Y2AGVGOP.js} +0 -0
package/README.md CHANGED
@@ -4415,6 +4415,20 @@ import { AssistantChat } from 'efficient-shell/ai';
4415
4415
  rebuilds them from each message's `attachments`. Each file shows above its
4416
4416
  question; a click hands it to the host's `onOpen` (the admin portal: Preview,
4417
4417
  UI-18). Without the prop there is no **+** and the request is unchanged.
4418
+ * **The Details panel.** `details` (`AssistantChatDetails`) draws a panel on
4419
+ the chat's right, as Claude's context panel, on the `window` variant only
4420
+ (it shows what tools ran, so staff only). The host owns the toggle, in its
4421
+ own header, and passes `open`. Four cards that fold: **Chat** (the host's
4422
+ `facts`, rows of `AssistantDetailFact`: who is in it, the record it is about,
4423
+ when it began; left out without any), **Usage** (answers, tokens in and out,
4424
+ average tok/s), **Files** (each file the assistant made and each one someone
4425
+ attached, once, with who it came from; a click opens it through `onOpenFile`
4426
+ or `attachments.onOpen`) and **Tools used** (each finished call counted once,
4427
+ by its done label, most used first). All but the facts is read from the
4428
+ thread (`summarizeChat`), so it follows the chat as it streams. A restored
4429
+ thread brings back each answer's words and files but not its counts or its
4430
+ tool calls, so Usage and Tools used cover the answers written while the
4431
+ window was open, and say so (`labels.detailsUsagePartial`).
4418
4432
  * **Rating answers.** With `onRate`, a finished answer the server named a run
4419
4433
  for (`run_id` on the stream's `finish` metadata, and on each answer of a
4420
4434
  restored thread, with the person's `rating`) gets thumbs up and down under
@@ -1,29 +1,29 @@
1
- import{peekBrowserStartUrl as e,claimBrowserStartUrl as t}from"./chunk-LWLCNQY7.js";import{AboutApp as o}from"./chunk-ESYYKGN4.js";import{WindowTitle as r}from"./chunk-B25RVAVS.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-EXJXOKUU.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-F2R3UFNQ.js";import{confirm as n}from"./chunk-5JU53T3U.js";import"./chunk-LWWMRL2Y.js";import"./chunk-4VTJEKHX.js";import"./chunk-3DVNXNTF.js";import"./chunk-ID6WFAXW.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-S52GQQVB.js";import"./chunk-UGTRSRIW.js";import"./chunk-CDAJKLGL.js";import"./chunk-KC3EX26K.js";import"./chunk-SM7IDX7Y.js";import"./chunk-FRVNDEV2.js";import"./chunk-5QFPTDQF.js";import"./chunk-URHGHXDN.js";import"./chunk-EQZZ4V5X.js";import"./chunk-HXNMRJQ4.js";import"./chunk-UQYNPYF4.js";import{Icon as s}from"./chunk-2UO47XB4.js";import"./chunk-J75ZT2JQ.js";import"./chunk-SQCUN2DX.js";import"./chunk-S5SRXI4V.js";import"./chunk-Q3IR5SKD.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-F27JJHNJ.js";import"./chunk-TWVUQUUD.js";import"./chunk-D65T4H6J.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-4PAWQEXM.js";import"./chunk-C3QOHMR6.js";import{useRef as a,useEffect as i,useState as l}from"react";import{jsxs as c,jsx as m,Fragment as u}from"react/jsx-runtime";var d="react-os-shell:browser-bookmarks",h="react-os-shell:browser-homepage",p="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"}],k=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 g(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&&k.has(t[2].toLowerCase())}(t)?"https://"+t:"https://duckduckgo.com/?q="+encodeURIComponent(t):""}var f=["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 w(){return"undefined"==typeof window?p:localStorage.getItem(h)||p}function y(){const u=a(void 0);void 0===u.current&&(u.current=e()),i(()=>{null!=u.current&&t(u.current)},[]);const p=u.current?g(u.current.url):"",[b,k]=l(w),[f,y]=l(p||b),[j,C]=l(f),[W,R]=l([f]),[S,z]=l(0),[D,U]=l(0),[E,X]=l(x),[L,H]=l(!1),[J,M]=l(null),Q=a(null),T=a(null);i(()=>{try{localStorage.setItem(d,JSON.stringify(E))}catch{}},[E]);const V=e=>{const t=g(e);t&&(y(t),C(t),R(e=>{const o=e.slice(0,S+1);return o.push(t),o}),z(e=>e+1),H(!1))},F=()=>{"undefined"!=typeof window&&window.open(f,"_blank","noopener,noreferrer")},G=()=>{const e=J?.trim();e?(X(t=>[...t,{label:e,url:f}]),M(null)):M(null)};i(()=>{if(null===J)return;Q.current?.focus(),Q.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||M(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==J]);const K=e=>{X(t=>t.filter((t,o)=>o!==e))},A=S>0,I=S<W.length-1,O=E.some(e=>e.url===f),P="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
1
+ import{peekBrowserStartUrl as e,claimBrowserStartUrl as t}from"./chunk-LWLCNQY7.js";import{AboutApp as o}from"./chunk-HJW67KA7.js";import{WindowTitle as r}from"./chunk-2YSGXZOL.js";import"./chunk-CY5N5OA3.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 n}from"./chunk-PLK2WHZG.js";import"./chunk-7INZ7O3A.js";import"./chunk-KC3EX26K.js";import"./chunk-FOFZI62F.js";import"./chunk-3DVNXNTF.js";import"./chunk-ECJKIPWU.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-UGTRSRIW.js";import"./chunk-EPY34L26.js";import"./chunk-CDAJKLGL.js";import"./chunk-WRQ4A5QY.js";import"./chunk-4WEFGKJL.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-TXDA7TTP.js";import"./chunk-I4VIEGCX.js";import"./chunk-UQYNPYF4.js";import"./chunk-34URULVW.js";import{Icon as s}from"./chunk-2UO47XB4.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-MVZRZTQP.js";import"./chunk-6XBWM453.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-F27JJHNJ.js";import"./chunk-TWVUQUUD.js";import"./chunk-GDQJBQ5B.js";import"./chunk-C3QOHMR6.js";import{useRef as a,useEffect as i,useState as l}from"react";import{jsxs as c,jsx as m,Fragment as u}from"react/jsx-runtime";var d="react-os-shell:browser-bookmarks",h="react-os-shell:browser-homepage",p="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"}],k=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 g(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&&k.has(t[2].toLowerCase())}(t)?"https://"+t:"https://duckduckgo.com/?q="+encodeURIComponent(t):""}var f=["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 w(){return"undefined"==typeof window?p:localStorage.getItem(h)||p}function y(){const u=a(void 0);void 0===u.current&&(u.current=e()),i(()=>{null!=u.current&&t(u.current)},[]);const p=u.current?g(u.current.url):"",[b,k]=l(w),[f,y]=l(p||b),[j,C]=l(f),[W,z]=l([f]),[R,E]=l(0),[L,S]=l(0),[U,D]=l(x),[T,H]=l(!1),[J,G]=l(null),P=a(null),M=a(null);i(()=>{try{localStorage.setItem(d,JSON.stringify(U))}catch{}},[U]);const Q=e=>{const t=g(e);t&&(y(t),C(t),z(e=>{const o=e.slice(0,R+1);return o.push(t),o}),E(e=>e+1),H(!1))},A=()=>{"undefined"!=typeof window&&window.open(f,"_blank","noopener,noreferrer")},F=()=>{const e=J?.trim();e?(D(t=>[...t,{label:e,url:f}]),G(null)):G(null)};i(()=>{if(null===J)return;P.current?.focus(),P.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||G(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==J]);const K=e=>{D(t=>t.filter((t,o)=>o!==e))},O=R>0,X=R<W.length-1,I=U.some(e=>e.url===f),Z="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
2
2
  return c("div",{className:"relative flex flex-col h-full bg-white",children:[
3
3
  /* @__PURE__ */m(r,{title:`Browser - ${v(f)}`}),
4
4
  /* @__PURE__ */m(o,{app:"browser"}),
5
5
  /* @__PURE__ */c("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-line bg-surface-sunken shrink-0",children:[
6
- /* @__PURE__ */m("button",{onClick:()=>{if(S>0){const e=S-1;z(e),y(W[e]),C(W[e]),H(!1)}},disabled:!A,className:P,title:"Back",children:/* @__PURE__ */m(s,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
- /* @__PURE__ */m("button",{onClick:()=>{if(S<W.length-1){const e=S+1;z(e),y(W[e]),C(W[e]),H(!1)}},disabled:!I,className:P,title:"Forward",children:/* @__PURE__ */m(s,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
- /* @__PURE__ */m("button",{onClick:()=>U(e=>e+1),className:P,title:"Refresh",children:/* @__PURE__ */m(s,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
- /* @__PURE__ */m("button",{onClick:()=>V(b),className:P,title:"Home",children:/* @__PURE__ */m(s,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
- /* @__PURE__ */m("form",{onSubmit:e=>{e.preventDefault(),V(j)},className:"flex-1 flex items-center mx-1",children:/* @__PURE__ */c("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__ */m("button",{onClick:()=>{if(R>0){const e=R-1;E(e),y(W[e]),C(W[e]),H(!1)}},disabled:!O,className:Z,title:"Back",children:/* @__PURE__ */m(s,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
+ /* @__PURE__ */m("button",{onClick:()=>{if(R<W.length-1){const e=R+1;E(e),y(W[e]),C(W[e]),H(!1)}},disabled:!X,className:Z,title:"Forward",children:/* @__PURE__ */m(s,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
+ /* @__PURE__ */m("button",{onClick:()=>S(e=>e+1),className:Z,title:"Refresh",children:/* @__PURE__ */m(s,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
+ /* @__PURE__ */m("button",{onClick:()=>Q(b),className:Z,title:"Home",children:/* @__PURE__ */m(s,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
+ /* @__PURE__ */m("form",{onSubmit:e=>{e.preventDefault(),Q(j)},className:"flex-1 flex items-center mx-1",children:/* @__PURE__ */c("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__ */m("span",{className:"px-2 text-gray-400 text-xs",children:f.startsWith("https://")?"🔒":"⚠️"}),
12
12
  /* @__PURE__ */m("input",{type:"text",value:j,onChange:e=>C(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…"}),f!==j&&/* @__PURE__ */m("button",{type:"button",onClick:()=>C(f),className:"px-2 text-2xs text-ink-faintest hover:text-ink",title:"Reset to current URL",children:"×"})]})}),
13
- /* @__PURE__ */m("button",{"data-bookmark-popover":!0,onClick:()=>O?K(E.findIndex(e=>e.url===f)):void M(v(f)),className:P+" "+(O?"text-yellow-500":""),title:O?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */m(s,{name:"star",className:"h-4 w-4",fill:O?"currentColor":"none",strokeWidth:1.5})}),
14
- /* @__PURE__ */m("button",{onClick:F,className:P,title:"Open in new tab",children:/* @__PURE__ */m(s,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
15
- /* @__PURE__ */m("button",{onClick:()=>H(e=>!e),className:P,title:"Embedding help",children:/* @__PURE__ */m(s,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==J&&/* @__PURE__ */c("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:[
13
+ /* @__PURE__ */m("button",{"data-bookmark-popover":!0,onClick:()=>I?K(U.findIndex(e=>e.url===f)):void G(v(f)),className:Z+" "+(I?"text-yellow-500":""),title:I?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */m(s,{name:"star",className:"h-4 w-4",fill:I?"currentColor":"none",strokeWidth:1.5})}),
14
+ /* @__PURE__ */m("button",{onClick:A,className:Z,title:"Open in new tab",children:/* @__PURE__ */m(s,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
15
+ /* @__PURE__ */m("button",{onClick:()=>H(e=>!e),className:Z,title:"Embedding help",children:/* @__PURE__ */m(s,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==J&&/* @__PURE__ */c("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:[
16
16
  /* @__PURE__ */m("div",{className:"text-2xs font-semibold uppercase tracking-wide text-ink-faint mb-1",children:"Bookmark this page"}),
17
17
  /* @__PURE__ */m("div",{className:"text-2xs text-ink-faintest truncate mb-2 font-mono",title:f,children:f}),
18
- /* @__PURE__ */m("input",{ref:Q,type:"text",value:J,onChange:e=>M(e.target.value),onKeyDown:e=>{"Enter"===e.key?G():"Escape"===e.key&&M(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"}),
18
+ /* @__PURE__ */m("input",{ref:P,type:"text",value:J,onChange:e=>G(e.target.value),onKeyDown:e=>{"Enter"===e.key?F():"Escape"===e.key&&G(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
19
  /* @__PURE__ */c("div",{className:"flex justify-end gap-1 mt-2",children:[
20
- /* @__PURE__ */m("button",{onClick:()=>M(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
21
- /* @__PURE__ */m("button",{onClick:G,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"})]})]}),
22
- /* @__PURE__ */c("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===E.length&&/* @__PURE__ */m("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),E.map((e,t)=>/* @__PURE__ */c("button",{onClick:()=>V(e.url),onContextMenu:async o=>{o.preventDefault();await n({title:"Remove bookmark",message:`"${e.label}" will be removed from your bookmarks.`,confirmLabel:"Remove",variant:"danger"})&&K(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:[
20
+ /* @__PURE__ */m("button",{onClick:()=>G(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
21
+ /* @__PURE__ */m("button",{onClick:F,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"})]})]}),
22
+ /* @__PURE__ */c("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===U.length&&/* @__PURE__ */m("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),U.map((e,t)=>/* @__PURE__ */c("button",{onClick:()=>Q(e.url),onContextMenu:async o=>{o.preventDefault();await n({title:"Remove bookmark",message:`"${e.label}" will be removed from your bookmarks.`,confirmLabel:"Remove",variant:"danger"})&&K(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:[
23
23
  /* @__PURE__ */m("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)),
24
24
  /* @__PURE__ */m("div",{className:"flex-1"}),
25
25
  /* @__PURE__ */m("button",{onClick:()=>{k(f);try{localStorage.setItem(h,f)}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"})]}),
26
- /* @__PURE__ */m("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */m(N,{url:f,iframeKey:D,iframeRef:T,openExternal:F,showHelp:L,dismissHelp:()=>H(!1)})})]})}function v(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function N({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:n,dismissHelp:a}){const[d,h]=l(!1);i(()=>{h(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return f.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!d?/* @__PURE__ */m("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */c("div",{className:"max-w-md text-center",children:[
26
+ /* @__PURE__ */m("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */m(N,{url:f,iframeKey:L,iframeRef:M,openExternal:A,showHelp:T,dismissHelp:()=>H(!1)})})]})}function v(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function N({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:n,dismissHelp:a}){const[d,h]=l(!1);i(()=>{h(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return f.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!d?/* @__PURE__ */m("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */c("div",{className:"max-w-md text-center",children:[
27
27
  /* @__PURE__ */m(s,{name:"no-symbol",className:"h-14 w-14 mx-auto text-gray-300 mb-3",strokeWidth:1.2}),
28
28
  /* @__PURE__ */c("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:[v(e)," can't be embedded"]}),
29
29
  /* @__PURE__ */c("p",{className:"text-sm text-gray-500 mb-4",children:["This site sends an ",
@@ -0,0 +1,29 @@
1
+ import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-DCRLJMQ6.js";import{useWidgetSettings as n}from"./chunk-2YSGXZOL.js";import"./chunk-CY5N5OA3.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-KC3EX26K.js";import"./chunk-FOFZI62F.js";import"./chunk-3DVNXNTF.js";import"./chunk-ECJKIPWU.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-UGTRSRIW.js";import"./chunk-EPY34L26.js";import"./chunk-CDAJKLGL.js";import"./chunk-4WEFGKJL.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-TXDA7TTP.js";import"./chunk-I4VIEGCX.js";import"./chunk-UQYNPYF4.js";import"./chunk-34URULVW.js";import{Icon as r}from"./chunk-2UO47XB4.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-MVZRZTQP.js";import"./chunk-6XBWM453.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-F27JJHNJ.js";import"./chunk-TWVUQUUD.js";import"./chunk-GDQJBQ5B.js";import"./chunk-C3QOHMR6.js";import{useState as c,useRef as i,useCallback as l,useEffect as o}from"react";import{jsxs as s,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),[j,N]=c(!1),[y,x]=c(""),[f,C]=c([]),[v,$]=c(!1),[E,W]=c(()=>e(h)),[T,J]=c(!1),[D,U]=c(E),w=i(null);n(l(()=>{U({...E}),J(!0)},[E]));const F=l(e=>{x(""),k(t=>j||"0"===t?(N(!1),"."===e?"0.":e):"."===e&&t.includes(".")?t:t+e)},[j]),L=l(()=>{k("0"),d(null),g(null),N(!1)},[]),S=l((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}},[]),G=l(e=>{const t=parseFloat(m);if(null!==p&&b&&!j){const e=S(p,t,b);k(String(e)),d(e),C(n=>[`${p} ${b} ${t} = ${e}`,...n].slice(0,20))}else d(t);g(e),N(!0)},[m,p,b,j,S]),A=l(()=>{if(null===p||!b)return;const e=parseFloat(m),t=S(p,e,b),n=`${p} ${b} ${e} =`;C(e=>[`${n} ${t}`,...e].slice(0,20)),x(n),k(String(t)),d(null),g(null),N(!0)},[m,p,b,S]),M=l(()=>{k(e=>String(parseFloat(e)/100))},[]),Q=l(()=>{k(e=>e.startsWith("-")?e.slice(1):"0"===e?e:"-"+e)},[]);o(()=>{const e=e=>{const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.key>="0"&&e.key<="9"?F(e.key):"."===e.key?F("."):"+"===e.key?G("+"):"-"===e.key?G("-"):"*"===e.key?G("×"):"/"===e.key?(e.preventDefault(),G("÷")):"Enter"===e.key||"="===e.key?("Enter"===e.key&&e.target instanceof Node&&w.current?.contains(e.target)&&e.preventDefault(),A()):"Escape"===e.key?L():"Backspace"===e.key?k(e=>e.length>1?e.slice(0,-1):"0"):"%"===e.key&&M())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[F,G,A,L,M]);const X="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",Z=`${X} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,B=`${X} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,P=`${X} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,R=`${X} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
2
+ return s(a,{children:[
3
+ /* @__PURE__ */s("div",{ref:w,className:"flex flex-col h-full",style:{opacity:E.activeOpacity/100,backdropFilter:E.activeBlur>0?`blur(${E.activeBlur}px)`:void 0},children:[
4
+ /* @__PURE__ */s("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:f.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} ${j?"":m}`}),
6
+ /* @__PURE__ */s("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__ */s("div",{className:"grid grid-cols-4 grid-rows-5 gap-2 flex-1 min-h-0 p-2",children:[
10
+ /* @__PURE__ */u("button",{onClick:L,className:P,children:"AC"}),
11
+ /* @__PURE__ */u("button",{onClick:Q,className:P,children:"+/−"}),
12
+ /* @__PURE__ */u("button",{onClick:M,className:P,children:"%"}),
13
+ /* @__PURE__ */u("button",{onClick:()=>G("÷"),className:`${B} ${"÷"===b?"ring-2 ring-blue-400":""}`,children:"÷"}),
14
+ /* @__PURE__ */u("button",{onClick:()=>F("7"),className:Z,children:"7"}),
15
+ /* @__PURE__ */u("button",{onClick:()=>F("8"),className:Z,children:"8"}),
16
+ /* @__PURE__ */u("button",{onClick:()=>F("9"),className:Z,children:"9"}),
17
+ /* @__PURE__ */u("button",{onClick:()=>G("×"),className:`${B} ${"×"===b?"ring-2 ring-blue-400":""}`,children:"×"}),
18
+ /* @__PURE__ */u("button",{onClick:()=>F("4"),className:Z,children:"4"}),
19
+ /* @__PURE__ */u("button",{onClick:()=>F("5"),className:Z,children:"5"}),
20
+ /* @__PURE__ */u("button",{onClick:()=>F("6"),className:Z,children:"6"}),
21
+ /* @__PURE__ */u("button",{onClick:()=>G("-"),className:`${B} ${"-"===b?"ring-2 ring-blue-400":""}`,children:"−"}),
22
+ /* @__PURE__ */u("button",{onClick:()=>F("1"),className:Z,children:"1"}),
23
+ /* @__PURE__ */u("button",{onClick:()=>F("2"),className:Z,children:"2"}),
24
+ /* @__PURE__ */u("button",{onClick:()=>F("3"),className:Z,children:"3"}),
25
+ /* @__PURE__ */u("button",{onClick:()=>G("+"),className:`${B} ${"+"===b?"ring-2 ring-blue-400":""}`,children:"+"}),
26
+ /* @__PURE__ */u("button",{onClick:()=>F("0"),className:`${Z} col-span-2`,children:"0"}),
27
+ /* @__PURE__ */u("button",{onClick:()=>F("."),className:Z,children:"."}),
28
+ /* @__PURE__ */u("button",{onClick:A,className:R,children:"="})]})]}),
29
+ /* @__PURE__ */u(t,{open:T,onClose:()=>J(!1),title:"Calculator Settings",appearance:D,onAppearanceChange:U,onSave:()=>{W(D),localStorage.setItem(h,JSON.stringify(D)),J(!1)}})]})}export{m as default};
@@ -1,6 +1,6 @@
1
- import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-EHGGSUXA.js";import{useWidgetSettings as r}from"./chunk-B25RVAVS.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-EXJXOKUU.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-F2R3UFNQ.js";import"./chunk-5JU53T3U.js";import"./chunk-LWWMRL2Y.js";import"./chunk-4VTJEKHX.js";import"./chunk-3DVNXNTF.js";import"./chunk-ID6WFAXW.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-S52GQQVB.js";import"./chunk-UGTRSRIW.js";import"./chunk-CDAJKLGL.js";import"./chunk-KC3EX26K.js";import"./chunk-FRVNDEV2.js";import"./chunk-5QFPTDQF.js";import"./chunk-URHGHXDN.js";import"./chunk-EQZZ4V5X.js";import"./chunk-HXNMRJQ4.js";import"./chunk-UQYNPYF4.js";import"./chunk-2UO47XB4.js";import"./chunk-J75ZT2JQ.js";import"./chunk-SQCUN2DX.js";import"./chunk-S5SRXI4V.js";import"./chunk-Q3IR5SKD.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-F27JJHNJ.js";import"./chunk-TWVUQUUD.js";import"./chunk-D65T4H6J.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-4PAWQEXM.js";import"./chunk-C3QOHMR6.js";import{useState as s,useCallback as o,useEffect as c}from"react";import{jsxs as a,Fragment as i,jsx as l}from"react/jsx-runtime";var m=["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 g(t){try{const e=JSON.parse(localStorage.getItem(d)||"{}")[t];if(e&&Date.now()-e.timestamp<36e5)return e.rates}catch{}return null}function k(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({}),[S,D]=s(!1),[v,U]=s(!1),[C,J]=s([]),[R,X]=s(f),[A,H]=s("USD"),[W,B]=s("CNY");r(o(()=>{J([...u]),X({...f}),U(!0)},[u,f])),c(()=>{const t=[...new Set(u.map(([t])=>t))];let e=!0;return async function(){D(!0);const r={};for(const e of t){const t=g(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,k(e,n.rates))}catch{}}e&&(b(r),D(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
1
+ import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-DCRLJMQ6.js";import{useWidgetSettings as r}from"./chunk-2YSGXZOL.js";import"./chunk-CY5N5OA3.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-KC3EX26K.js";import"./chunk-FOFZI62F.js";import"./chunk-3DVNXNTF.js";import"./chunk-ECJKIPWU.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-UGTRSRIW.js";import"./chunk-EPY34L26.js";import"./chunk-CDAJKLGL.js";import"./chunk-4WEFGKJL.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-TXDA7TTP.js";import"./chunk-I4VIEGCX.js";import"./chunk-UQYNPYF4.js";import"./chunk-34URULVW.js";import"./chunk-2UO47XB4.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-MVZRZTQP.js";import"./chunk-6XBWM453.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-F27JJHNJ.js";import"./chunk-TWVUQUUD.js";import"./chunk-GDQJBQ5B.js";import"./chunk-C3QOHMR6.js";import{useState as s,useCallback as o,useEffect as c}from"react";import{jsxs as a,Fragment as i,jsx as l}from"react/jsx-runtime";var m=["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 g(t){try{const e=JSON.parse(localStorage.getItem(d)||"{}")[t];if(e&&Date.now()-e.timestamp<36e5)return e.rates}catch{}return null}function k(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),[v,C]=s(!1),[U,J]=s([]),[B,G]=s(f),[L,R]=s("USD"),[A,P]=s("CNY");r(o(()=>{J([...u]),G({...f}),C(!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=g(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,k(e,n.rates))}catch{}}e&&(b(r),S(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
2
2
  return a(i,{children:[
3
- /* @__PURE__ */l("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__ */a("div",{className:"px-4 py-3 space-y-1",children:[S&&/* @__PURE__ */l(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([t,e],r)=>{const n=y[t]?.[e];/* @__PURE__ */
3
+ /* @__PURE__ */l("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__ */a("div",{className:"px-4 py-3 space-y-1",children:[D&&/* @__PURE__ */l(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([t,e],r)=>{const n=y[t]?.[e];/* @__PURE__ */
4
4
  return a("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__ */a("div",{className:"flex items-center gap-2",children:[
6
6
  /* @__PURE__ */l("span",{className:"text-base",children:j[t]||""}),
@@ -9,13 +9,13 @@ return a("button",{onClick:()=>{const t=u.map((t,e)=>e===r?[t[1],t[0]]:t);d(t),l
9
9
  /* @__PURE__ */l("span",{className:"text-base",children:j[e]||""}),
10
10
  /* @__PURE__ */l("span",{className:"text-sm font-semibold text-gray-700",children:e})]}),
11
11
  /* @__PURE__ */l("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__ */l(e,{open:v,onClose:()=>U(!1),title:"Currency Settings",appearance:R,onAppearanceChange:X,onSave:()=>{if(0===C.length)return;const t=C.slice(0,4);d(t),x(R),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(R)),U(!1)},children:/* @__PURE__ */a("div",{children:[
12
+ /* @__PURE__ */l(e,{open:v,onClose:()=>C(!1),title:"Currency Settings",appearance:B,onAppearanceChange:G,onSave:()=>{if(0===U.length)return;const t=U.slice(0,4);d(t),x(B),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(B)),C(!1)},children:/* @__PURE__ */a("div",{children:[
13
13
  /* @__PURE__ */a("h3",{className:"text-sm font-semibold text-ink mb-2",children:["Currency Pairs ",
14
- /* @__PURE__ */a("span",{className:"text-2xs font-normal text-ink-faintest",children:["(",C.length,"/",4,")"]})]}),
15
- /* @__PURE__ */l("div",{className:"space-y-1 mb-2",children:C.map(([t,e],r)=>/* @__PURE__ */a("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
14
+ /* @__PURE__ */a("span",{className:"text-2xs font-normal text-ink-faintest",children:["(",U.length,"/",4,")"]})]}),
15
+ /* @__PURE__ */l("div",{className:"space-y-1 mb-2",children:U.map(([t,e],r)=>/* @__PURE__ */a("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
16
16
  /* @__PURE__ */a("span",{className:"text-sm",children:[j[t]||""," ",t," → ",j[e]||""," ",e]}),
17
- /* @__PURE__ */l("button",{onClick:()=>J(t=>t.filter((t,e)=>e!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),C.length<4?/* @__PURE__ */a("div",{className:"flex items-center gap-2",children:[
18
- /* @__PURE__ */l("select",{value:A,onChange:t=>H(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:m.map(t=>/* @__PURE__ */l("option",{children:t},t))}),
17
+ /* @__PURE__ */l("button",{onClick:()=>J(t=>t.filter((t,e)=>e!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),U.length<4?/* @__PURE__ */a("div",{className:"flex items-center gap-2",children:[
18
+ /* @__PURE__ */l("select",{value:L,onChange:t=>R(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:m.map(t=>/* @__PURE__ */l("option",{children:t},t))}),
19
19
  /* @__PURE__ */l("span",{className:"text-gray-400",children:"→"}),
20
- /* @__PURE__ */l("select",{value:W,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:m.map(t=>/* @__PURE__ */l("option",{children:t},t))}),
21
- /* @__PURE__ */l("button",{onClick:()=>{A!==W&&C.length<4&&J(t=>[...t,[A,W]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */a("p",{className:"text-2xs text-ink-faintest italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{f as default};
20
+ /* @__PURE__ */l("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:m.map(t=>/* @__PURE__ */l("option",{children:t},t))}),
21
+ /* @__PURE__ */l("button",{onClick:()=>{L!==A&&U.length<4&&J(t=>[...t,[L,A]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */a("p",{className:"text-2xs text-ink-faintest italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{f as default};
@@ -1,12 +1,12 @@
1
- import{escapeHtml as e}from"./chunk-G6DKCCWH.js";import{AboutApp as t}from"./chunk-ESYYKGN4.js";import{WindowTitle as n}from"./chunk-B25RVAVS.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-EXJXOKUU.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-F2R3UFNQ.js";import"./chunk-5JU53T3U.js";import"./chunk-LWWMRL2Y.js";import"./chunk-4VTJEKHX.js";import"./chunk-3DVNXNTF.js";import"./chunk-ID6WFAXW.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import{toast_default as r}from"./chunk-AKM6JBMD.js";import"./chunk-S52GQQVB.js";import"./chunk-UGTRSRIW.js";import"./chunk-CDAJKLGL.js";import"./chunk-KC3EX26K.js";import"./chunk-SM7IDX7Y.js";import{PopupMenu as o,PopupMenuLabel as i,PopupMenuItem as l,PopupMenuDivider as a}from"./chunk-FRVNDEV2.js";import"./chunk-5QFPTDQF.js";import"./chunk-URHGHXDN.js";import"./chunk-EQZZ4V5X.js";import"./chunk-HXNMRJQ4.js";import"./chunk-UQYNPYF4.js";import{Icon as s}from"./chunk-2UO47XB4.js";import"./chunk-J75ZT2JQ.js";import"./chunk-SQCUN2DX.js";import"./chunk-S5SRXI4V.js";import"./chunk-Q3IR5SKD.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-F27JJHNJ.js";import"./chunk-TWVUQUUD.js";import"./chunk-D65T4H6J.js";import{LoadingSpinner as c}from"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-4PAWQEXM.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,y]=m(x),[k,v]=m(!1),[b,j]=m(!1),[w,N]=m(!1),[D,C]=m(null),M=h(null),L=h(null),U=h(null),R=(e,t)=>{U.current?.focus(),document.execCommand(e,!1,t),N(!0)},W=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)}},S=e=>{D&&(D.el.removeAttribute("width"),D.el.removeAttribute("height"),D.el.style.width=e??"",D.el.style.height=e?"auto":"",N(!0),C(null))},X=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>");y({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-HJW67KA7.js";import{WindowTitle as n}from"./chunk-2YSGXZOL.js";import"./chunk-CY5N5OA3.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-KC3EX26K.js";import"./chunk-FOFZI62F.js";import"./chunk-3DVNXNTF.js";import"./chunk-ECJKIPWU.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import{toast_default as r}from"./chunk-7ELJQL7J.js";import"./chunk-UGTRSRIW.js";import"./chunk-EPY34L26.js";import"./chunk-CDAJKLGL.js";import"./chunk-WRQ4A5QY.js";import{PopupMenu as o,PopupMenuLabel as i,PopupMenuItem as l,PopupMenuDivider as a}from"./chunk-4WEFGKJL.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-TXDA7TTP.js";import"./chunk-I4VIEGCX.js";import"./chunk-UQYNPYF4.js";import"./chunk-34URULVW.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-MVZRZTQP.js";import"./chunk-6XBWM453.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-F27JJHNJ.js";import"./chunk-TWVUQUUD.js";import"./chunk-GDQJBQ5B.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,y]=m(x),[k,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)},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)}},T=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))},A=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>");y({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});y({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)}},T=f?.filename?(A=f.filename).length>24?`${A.slice(0,23)}…`:A:"Untitled";var A;/* @__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/"))?W(t):X(t[0]))},children:[
5
- /* @__PURE__ */d(n,{title:`${T}${w?" •":""} - Documents`}),
3
+ "mammoth")),r=await t.arrayBuffer(),o=await e.convertToHtml({arrayBuffer:r});y({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)}},B=f?.filename?(E=f.filename).length>24?`${E.slice(0,23)}…`:E:"Untitled";var E;/* @__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):A(t[0]))},children:[
5
+ /* @__PURE__ */d(n,{title:`${B}${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:M,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&&X(t),M.current&&(M.current.value="")},className:"hidden"}),
9
- /* @__PURE__ */u("button",{onClick:()=>M.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:[
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&&A(t),L.current&&(L.current.value="")},className:"hidden"}),
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"}),
12
12
  /* @__PURE__ */d("span",{className:"text-2xs text-ink-faintest ml-1",children:"TXT · DOCX · Code"}),
@@ -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:()=>R("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:()=>R("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:()=>R("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:()=>R("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:()=>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"})]}),
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=>{R("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=>{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:[
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=>R("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=>W("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:()=>R("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:()=>R("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:()=>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."}),
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:()=>R("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:()=>R("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:()=>R("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:()=>R("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:()=>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"})})})]}),
40
40
  /* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
41
- /* @__PURE__ */d("input",{ref:L,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&W(Array.from(e.target.files)),L.current&&(L.current.value="")}}),
42
- /* @__PURE__ */u("button",{onClick:()=>L.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:[
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
+ /* @__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:k?/* @__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(),W(t))},onClick:e=>{const t=e.target;"IMG"===t.tagName&&(e.preventDefault(),C({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"})}),D&&/* @__PURE__ */u(o,{minWidth:150,style:{left:D.x,top:D.y},onClose:()=>C(null),children:[
44
+ /* @__PURE__ */d("div",{className:"flex-1 min-h-0 overflow-hidden",children:k?/* @__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:()=>S("25%"),children:"25%"}),
47
- /* @__PURE__ */d(l,{onClick:()=>S("50%"),children:"50%"}),
48
- /* @__PURE__ */d(l,{onClick:()=>S("75%"),children:"75%"}),
49
- /* @__PURE__ */d(l,{onClick:()=>S("100%"),children:"100%"}),
50
- /* @__PURE__ */d(l,{onClick:()=>S(null),children:"Original size"}),
46
+ /* @__PURE__ */d(l,{onClick:()=>T("25%"),children:"25%"}),
47
+ /* @__PURE__ */d(l,{onClick:()=>T("50%"),children:"50%"}),
48
+ /* @__PURE__ */d(l,{onClick:()=>T("75%"),children:"75%"}),
49
+ /* @__PURE__ */d(l,{onClick:()=>T("100%"),children:"100%"}),
50
+ /* @__PURE__ */d(l,{onClick:()=>T(null),children:"Original size"}),
51
51
  /* @__PURE__ */d(a,{}),
52
- /* @__PURE__ */d(l,{danger:!0,onClick:()=>{D?.el.remove(),N(!0),C(null)},children:"Remove image"})]})]})}export{f as default};
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-EOWUUOVE.js";import{SidebarLayout as t}from"./chunk-XCHAU2UN.js";import"./chunk-QWK6DRSN.js";import"./chunk-5QGBVTGS.js";import{Breadcrumbs as a}from"./chunk-XYECIBVX.js";import{formatBytes as n}from"./chunk-GEYM4WN3.js";import"./chunk-Y3JW2GW5.js";import"./chunk-36BRD5J3.js";import"./chunk-LF27WIN2.js";import{getFilesDemoTree as r}from"./chunk-U2RFKQVA.js";import{AboutApp as i}from"./chunk-HJW67KA7.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-E5QPXEKN.js";import"./chunk-ESL5TDNA.js";import"./chunk-VTVSMRFX.js";import{useWindowManager as f,WindowTitle as x}from"./chunk-2YSGXZOL.js";import"./chunk-CY5N5OA3.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 g,prompt as k}from"./chunk-PLK2WHZG.js";import"./chunk-7INZ7O3A.js";import"./chunk-KC3EX26K.js";import{ItemCount as b}from"./chunk-FOFZI62F.js";import"./chunk-3DVNXNTF.js";import"./chunk-ECJKIPWU.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import{toast_default as y}from"./chunk-7ELJQL7J.js";import"./chunk-UGTRSRIW.js";import"./chunk-EPY34L26.js";import"./chunk-CDAJKLGL.js";import"./chunk-WRQ4A5QY.js";import"./chunk-4WEFGKJL.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-TXDA7TTP.js";import"./chunk-I4VIEGCX.js";import"./chunk-UQYNPYF4.js";import"./chunk-34URULVW.js";import{Icon as N}from"./chunk-2UO47XB4.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-MVZRZTQP.js";import"./chunk-6XBWM453.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-F27JJHNJ.js";import"./chunk-TWVUQUUD.js";import"./chunk-GDQJBQ5B.js";import"./chunk-C3QOHMR6.js";import{useState as j,useEffect as $,useSyncExternalStore as C,useRef as E,useCallback as L}from"react";import{jsxs as D,jsx as T,Fragment as R}from"react/jsx-runtime";var W="undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000",U={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 P(e,t){return"/"===e||""===e?"/"+t:e.replace(/\/$/,"")+"/"+t}function F(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 S(){const S=W.replace(/\/$/,""),A=null!==r(),[I,M]=j("/"),[O,J]=j([]),[V,Q]=j([]),[B,G]=j(null),[K,X]=j(!0),[H,Z]=j(!1),[z,Y]=j(null),[_,q]=j(!1),[ee,te]=j(()=>{const e=s();return"trash"===e?"trash":e?{desktopFolderId:e.folderId}:"files"});$(()=>{o()},[]);const[ae,ne]=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=E(0),ce=E(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=L((e,t={})=>fetch(e,{...t,credentials:"include"}),[]),ue=L(async()=>{try{const e=await pe(`${S}/api/quota`);if(e.ok){const t=await e.json();Y({used:t.used,limit:t.limit})}}catch{}},[pe,S]),fe=L(async e=>{if(G(null),A){const t=function(e){const t=r();if(!t)return[];let a=t;for(const t of e.split("/").filter(Boolean)){const e=a.find(e=>"folder"===e.kind&&e.name===t);if(!e||!e.children)return[];a=e.children}return a.map(e=>({name:e.name,kind:e.kind,size:e.size??0,modifiedAt:e.modifiedAt??""}))}(e);return J(t),M(e),Z(!1),X(!1),void("/"===e&&Q(t.filter(e=>"folder"===e.kind).map(e=>e.name)))}X(!0);try{const t=await pe(`${S}/api/files?path=${encodeURIComponent(e)}`);if(!t.ok){const e=await t.json().catch(()=>({}));return void y.error(e.error||`Failed to list (${t.status})`)}const a=await t.json(),n=a.entries||[];J(n),M(a.path||e),Z(!1),"/"===(a.path||e)&&Q(n.filter(e=>"folder"===e.kind).map(e=>e.name))}catch(e){Z(!0)}finally{X(!1)}ue()},[pe,S,ue,A]),xe=L(async()=>{if(A)return ne([]),void X(!1);X(!0),G(null);try{const e=await pe(`${S}/api/trash`);if(!e.ok){const t=await e.json().catch(()=>({}));return void y.error(t.error||`Failed to list trash (${e.status})`)}const t=await e.json();ne(t.entries||[]),Z(!1)}catch{Z(!0)}finally{X(!1)}ue()},[pe,S,ue,A]);$(()=>{"files"===ee?fe(I):"trash"===ee&&xe()},[I,ee]);const ge=async e=>{const t=P(I,e.name);try{const a=await pe(`${S}/api/file?path=${encodeURIComponent(t)}`);if(!a.ok)return void y.error(`Download failed (${a.status})`);const n=await a.blob(),r=URL.createObjectURL(n),i=document.createElement("a");i.href=r,i.download=e.name,i.click(),setTimeout(()=>URL.revokeObjectURL(r),1e3)}catch(e){y.error(e?.message||"Download failed")}},ke=async e=>{const t=Array.from(e);for(const e of t){const t=new FormData;t.append("file",e);try{const a=await pe(`${S}/api/upload?path=${encodeURIComponent(I)}`,{method:"POST",body:t});if(!a.ok){const t=await a.json().catch(()=>({}));if(413===a.status){const a=Math.max(0,(t.limit||0)-(t.used||0));y.error(`Quota exceeded — ${n(a)} free, ${e.name} is ${n(t.attempted||e.size)}`)}else y.error(`Upload ${e.name}: ${t.error||a.status}`)}}catch(t){y.error(`Upload ${e.name}: ${t?.message||"failed"}`)}}fe(I)},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)}},[]),H)/* @__PURE__ */
2
+ return D("div",{className:"flex flex-col h-full bg-white",children:[
3
+ /* @__PURE__ */T(x,{title:"Files - offline"}),
4
+ /* @__PURE__ */T("div",{className:"flex-1 flex items-center justify-center p-8 text-center",children:/* @__PURE__ */D("div",{className:"max-w-md",children:[
5
+ /* @__PURE__ */T(N,{name:"close-circle",className:"h-12 w-12 mx-auto text-gray-300 mb-3",strokeWidth:1.4}),
6
+ /* @__PURE__ */T("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:"Can't reach the file server"}),
7
+ /* @__PURE__ */D("p",{className:"text-sm text-gray-500 mb-3",children:["No response from ",
8
+ /* @__PURE__ */T("span",{className:"font-mono",children:S}),". Make sure the server is running — see ",
9
+ /* @__PURE__ */T("span",{className:"font-mono",children:"examples/file-server/README.md"}),"."]}),
10
+ /* @__PURE__ */T("button",{onClick:()=>fe(I),className:"px-3 h-8 text-sm bg-blue-500 text-on-accent rounded hover:bg-blue-600",children:"Retry"})]})})]});const ye="/"===I?[]:I.split("/").filter(Boolean),Ne=z&&z.limit>0?Math.min(100,Math.round(z.used/z.limit*100)):0,we=Ne>90?"bg-red-500":Ne>75?"bg-amber-500":"bg-blue-500",ve=[{label:"My files",onClick:()=>M("/")},...ye.map((e,t)=>({label:e,onClick:()=>M("/"+ye.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__ */T("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__ */T("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})}),Ce=/* @__PURE__ */D("nav",{className:"p-2",children:[
11
+ /* @__PURE__ */T("div",{className:"px-2 py-2 text-2xs font-semibold uppercase tracking-wide text-ink-faintest",children:"Locations"}),
12
+ /* @__PURE__ */D("button",{onClick:()=>{te("files"),M("/")},className:je("files"===ee&&"/"===I),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"]}),V.map(e=>/* @__PURE__ */D("button",{onClick:()=>{te("files"),M("/"+e)},className:je("files"===ee&&I==="/"+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__ */T("span",{className:"truncate",children:e})]},e)),!A&&/* @__PURE__ */D("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__ */D(R,{children:[
14
+ /* @__PURE__ */T("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__ */D("button",{onClick:()=>te({desktopFolderId:e.id}),className:je(ie===e.id),children:[
15
+ /* @__PURE__ */T(h,{className:"h-4 w-4 shrink-0 text-amber-500"}),
16
+ /* @__PURE__ */T("span",{className:"truncate",children:e.name}),
17
+ /* @__PURE__ */T(b,{count:e.itemCount,active:ie===e.id,className:"ml-auto"})]},e.id))]})]});/* @__PURE__ */
18
+ return D("div",{className:"relative flex flex-col h-full bg-white",onDragEnter:e=>{A||"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(),A||"object"==typeof ee||e.dataTransfer.files?.length&&ke(e.dataTransfer.files)},children:[
19
+ /* @__PURE__ */T(x,{title:se?`Files - ${se.name}`:"Files"+("/"===I?"":" - "+I)}),
20
+ /* @__PURE__ */T(i,{app:"files"}),
21
+ /* @__PURE__ */T("input",{ref:ce,type:"file",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&ke(e.target.files),ce.current&&(ce.current.value="")}}),
22
+ /* @__PURE__ */T("div",{className:"flex-1 min-h-0",children:/* @__PURE__ */T(t,{sidebar:Ce,storageKey:"files.sidebarWidth",defaultWidth:200,minWidth:150,maxWidth:320,children:/* @__PURE__ */D("div",{className:"flex h-full min-w-0 flex-col",children:[
23
+ /* @__PURE__ */D("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-line bg-surface-sunken shrink-0 text-xs",children:[/* @__PURE__ */D(R,"files"===ee?{children:[
24
+ /* @__PURE__ */T("button",{onClick:()=>M(function(e){if("/"===e||""===e)return"/";const t=e.replace(/\/$/,""),a=t.lastIndexOf("/");return a<=0?"/":t.slice(0,a)}(I)),disabled:"/"===I,className:"px-2 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",title:"Parent folder",children:/* @__PURE__ */T(N,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
25
+ /* @__PURE__ */T("div",{className:"flex-1 min-w-0",children:/* @__PURE__ */T(a,{items:ve,maxItems:5})}),
26
+ /* @__PURE__ */T("button",{onClick:()=>fe(I),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Refresh",children:/* @__PURE__ */T(N,{name:"refresh",className:"h-3.5 w-3.5",strokeWidth:1.8})}),!A&&/* @__PURE__ */D(R,{children:[
27
+ /* @__PURE__ */D("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__ */T(N,{name:"trash",className:"h-3.5 w-3.5",strokeWidth:1.5}),"Trash"]}),
29
+ /* @__PURE__ */D("button",{onClick:async()=>{const e=await k({title:"New folder",placeholder:"Folder name",confirmLabel:"Create"});if(!e)return;if(/[\\/]/.test(e))return void y.error("Folder names cannot contain slashes");const t=P(I,e),a=await pe(`${S}/api/folder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t})});if(!a.ok){const e=await a.json().catch(()=>({}));return void y.error(e.error||`Create folder failed (${a.status})`)}fe(I)},className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600 flex items-center gap-1",children:[
30
+ /* @__PURE__ */T(N,{name:"folder-plus",className:"h-3.5 w-3.5",strokeWidth:1.5}),"New Folder"]}),
31
+ /* @__PURE__ */D("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__ */T(N,{name:"upload",className:"h-3.5 w-3.5",strokeWidth:1.8}),"Upload"]})]})]}:"trash"===ee?{children:[
33
+ /* @__PURE__ */T("button",{onClick:()=>te("files"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Back to files",children:/* @__PURE__ */T(N,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
34
+ /* @__PURE__ */T("span",{className:"flex-1 text-gray-700 font-medium px-2",children:"Trash"}),
35
+ /* @__PURE__ */T("button",{onClick:xe,className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Refresh",children:/* @__PURE__ */T(N,{name:"refresh",className:"h-3.5 w-3.5",strokeWidth:1.8})}),
36
+ /* @__PURE__ */T("button",{onClick:async()=>{if(0===ae.length)return;if(!await g({title:"Empty trash",message:`${ae.length} item${1===ae.length?"":"s"} will be permanently removed. This can't be undone.`,confirmLabel:"Empty trash",variant:"danger"}))return;const e=await pe(`${S}/api/trash`,{method:"DELETE"});if(!e.ok){const t=await e.json().catch(()=>({}));return void y.error(t.error||`Empty trash failed (${e.status})`)}xe()},disabled:0===ae.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__ */T("button",{onClick:()=>te("files"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Back to files",children:/* @__PURE__ */T(N,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
38
+ /* @__PURE__ */T(h,{className:"h-4 w-4 text-amber-500 ml-1"}),
39
+ /* @__PURE__ */T("span",{className:"flex-1 text-gray-700 font-medium px-1 truncate",children:se?.name??"Desktop folder"}),
40
+ /* @__PURE__ */T("span",{className:"text-2xs text-ink-faintest px-2",children:"Desktop shortcuts"})]}),z&&/* @__PURE__ */D(R,{children:[
41
+ /* @__PURE__ */T("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
42
+ /* @__PURE__ */D("div",{className:"flex items-center gap-2",title:`${n(z.used)} of ${n(z.limit)} used`,children:[
43
+ /* @__PURE__ */T("div",{className:"w-20 h-1.5 rounded-full bg-gray-200 overflow-hidden",children:/* @__PURE__ */T("div",{className:`h-full ${we} transition-all`,style:{width:`${Ne}%`}})}),
44
+ /* @__PURE__ */D("span",{className:"text-2xs text-ink-faint tabular-nums whitespace-nowrap",children:[n(z.used)," / ",n(z.limit)]})]})]})]}),
45
+ /* @__PURE__ */T("div",{className:"flex-1 overflow-auto",children:"object"==typeof ee?0===oe.length?/* @__PURE__ */T("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__ */D("table",{className:"w-full text-sm",children:[
46
+ /* @__PURE__ */T("thead",{className:"bg-surface-sunken text-2xs uppercase tracking-wide text-ink-faint",children:/* @__PURE__ */D("tr",{children:[
47
+ /* @__PURE__ */T("th",{className:`${v} text-left font-medium px-3 h-8`,children:"Name"}),
48
+ /* @__PURE__ */T("th",{className:`${v} text-left font-medium px-3 h-8 w-28`,children:"Type"}),
49
+ /* @__PURE__ */T("th",{className:`${v} w-56`})]})}),
50
+ /* @__PURE__ */T("tbody",{children:oe.map(e=>{const t=`${e.entityType}|${e.entityId}`;/* @__PURE__ */
51
+ return D("tr",{onClick:()=>G(t),onDoubleClick:()=>he(e),className:"cursor-default border-b border-gray-100 "+(B===t?"bg-blue-50":"hover:bg-gray-50"),children:[
52
+ /* @__PURE__ */D("td",{className:"px-3 h-8 flex items-center gap-2",children:[
53
+ /* @__PURE__ */T(p,{item:e}),
54
+ /* @__PURE__ */T("span",{className:"truncate",title:e.label,children:e.label})]}),
55
+ /* @__PURE__ */T("td",{className:"px-3 h-8 text-xs text-ink-faint",children:u(e)}),
56
+ /* @__PURE__ */D("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:[
57
+ /* @__PURE__ */T("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__ */T("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__ */T("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?K&&0===ae.length?/* @__PURE__ */T(w,{size:"sm",padding:"p-6",label:"Loading"}):0===ae.length?/* @__PURE__ */T("div",{className:"p-10 text-center text-sm text-gray-400",children:"Trash is empty."}):/* @__PURE__ */D("table",{className:"w-full text-sm",children:[
60
+ /* @__PURE__ */T("thead",{className:"bg-surface-sunken text-2xs uppercase tracking-wide text-ink-faint",children:/* @__PURE__ */D("tr",{children:[
61
+ /* @__PURE__ */T("th",{className:`${v} text-left font-medium px-3 h-8`,children:"Name"}),
62
+ /* @__PURE__ */T("th",{className:`${v} text-left font-medium px-3 h-8`,children:"Original location"}),
63
+ /* @__PURE__ */T("th",{className:`${v} text-right font-medium px-3 h-8 w-24`,children:"Size"}),
64
+ /* @__PURE__ */T("th",{className:`${v} text-right font-medium px-3 h-8 w-40`,children:"Deleted"}),
65
+ /* @__PURE__ */T("th",{className:`${v} w-44`})]})}),
66
+ /* @__PURE__ */T("tbody",{children:ae.map(e=>/* @__PURE__ */D("tr",{className:"border-b border-gray-100 hover:bg-gray-50",children:[
67
+ /* @__PURE__ */D("td",{className:"px-3 h-8 flex items-center gap-2",children:["folder"===e.kind?/* @__PURE__ */T(N,{name:"folder",look:"solid",className:"h-4 w-4 text-amber-500 shrink-0"}):/* @__PURE__ */T(N,{name:"page",className:"h-4 w-4 text-ink-faintest shrink-0",strokeWidth:1.5}),
68
+ /* @__PURE__ */T("span",{className:"truncate",title:e.name,children:e.name})]}),
69
+ /* @__PURE__ */T("td",{className:"px-3 h-8 text-ink-faint text-xs font-mono truncate",title:e.originalPath,children:e.originalPath||"—"}),
70
+ /* @__PURE__ */T("td",{className:"px-3 h-8 text-right tabular-nums text-ink-faint",children:n(e.size)}),
71
+ /* @__PURE__ */T("td",{className:"px-3 h-8 text-right text-ink-faint tabular-nums",children:e.deletedAt?F(e.deletedAt):"—"}),
72
+ /* @__PURE__ */D("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:[
73
+ /* @__PURE__ */T("button",{onClick:()=>(async e=>{const t=await pe(`${S}/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 y.error(e.error||`Restore failed (${t.status})`)}y.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__ */T("button",{onClick:()=>(async e=>{if(!await g({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(`${S}/api/trash/${encodeURIComponent(e.id)}`,{method:"DELETE"});if(!t.ok){const e=await t.json().catch(()=>({}));return void y.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))})]}):K&&0===O.length?/* @__PURE__ */T(w,{size:"sm",padding:"p-6",label:"Loading"}):0===O.length?/* @__PURE__ */D("div",{className:"p-10 text-center text-sm text-gray-400",children:["Empty folder.",!A&&/* @__PURE__ */D(R,{children:[" Drop files here or click ",
75
+ /* @__PURE__ */T("span",{className:"font-medium",children:"Upload"}),"."]})]}):/* @__PURE__ */D("table",{className:"w-full text-sm",children:[
76
+ /* @__PURE__ */T("thead",{className:"bg-surface-sunken text-2xs uppercase tracking-wide text-ink-faint",children:/* @__PURE__ */D("tr",{children:[
77
+ /* @__PURE__ */T("th",{className:`${v} text-left font-medium px-3 h-8`,children:"Name"}),
78
+ /* @__PURE__ */T("th",{className:`${v} text-right font-medium px-3 h-8 w-24`,children:"Size"}),
79
+ /* @__PURE__ */T("th",{className:`${v} text-right font-medium px-3 h-8 w-40`,children:"Modified"}),
80
+ /* @__PURE__ */T("th",{className:`${v} w-32`})]})}),
81
+ /* @__PURE__ */T("tbody",{children:O.map(t=>/* @__PURE__ */D("tr",{onClick:()=>G(t.name),onDoubleClick:()=>{"folder"===t.kind?M(P(I,t.name)):(async t=>{if(A)return;const a=P(I,t.name),n=(t.name.split(".").pop()||"").toLowerCase(),r=U[n];r?await e({filePath:a,filename:t.name,kind:r,onStaged:e=>de(e)}):ge(t)})(t)},className:"cursor-default border-b border-gray-100 "+(B===t.name?"bg-blue-50":"hover:bg-gray-50"),children:[
82
+ /* @__PURE__ */D("td",{className:"px-3 h-8 flex items-center gap-2",children:["folder"===t.kind?/* @__PURE__ */T(N,{name:"folder",look:"solid",className:"h-4 w-4 text-amber-500 shrink-0"}):/* @__PURE__ */T(N,{name:"page",className:"h-4 w-4 text-ink-faintest shrink-0",strokeWidth:1.5}),
83
+ /* @__PURE__ */T("span",{className:"truncate",title:t.name,children:t.name})]}),
84
+ /* @__PURE__ */T("td",{className:"px-3 h-8 text-right tabular-nums text-ink-faint",children:"folder"===t.kind?"—":n(t.size)}),
85
+ /* @__PURE__ */T("td",{className:"px-3 h-8 text-right text-ink-faint tabular-nums",children:F(t.modifiedAt)}),
86
+ /* @__PURE__ */T("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:!A&&/* @__PURE__ */D(R,{children:["file"===t.kind&&/* @__PURE__ */T("button",{onClick:e=>{e.stopPropagation(),ge(t)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-ink-faint text-2xs",children:"Download"}),
87
+ /* @__PURE__ */T("button",{onClick:e=>{e.stopPropagation(),(async e=>{const t=await k({title:`Rename ${e.kind}`,defaultValue:e.name,confirmLabel:"Rename"});if(!t||t===e.name)return;if(/[\\/]/.test(t))return void y.error("Names cannot contain slashes");const a=P(I,e.name),n=P(I,t),r=await pe(`${S}/api/rename`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:a,to:n})});if(!r.ok){const e=await r.json().catch(()=>({}));return void y.error(e.error||`Rename failed (${r.status})`)}fe(I)})(t)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-ink-faint text-2xs ml-1",children:"Rename"}),
88
+ /* @__PURE__ */T("button",{onClick:e=>{e.stopPropagation(),(async e=>{if(!await g({title:`Delete ${e.kind}`,message:`"${e.name}"${"folder"===e.kind?" and everything inside":""} will be permanently removed.`,confirmLabel:"Delete",variant:"danger"}))return;const t=P(I,e.name),a=await pe(`${S}/api/files?path=${encodeURIComponent(t)}`,{method:"DELETE"});if(!a.ok){const e=await a.json().catch(()=>({}));return void y.error(e.error||`Delete failed (${a.status})`)}fe(I)})(t)},className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Delete"})]})})]},t.name))})]})})]})})}),_&&/* @__PURE__ */T("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__ */T("div",{className:"px-4 py-2 rounded-md bg-blue-600 text-white text-sm font-medium shadow-lg",children:"Drop to upload"})})]})}export{S as default};