efficient-shell 8.22.0 → 8.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (299) hide show
  1. package/README.md +31 -0
  2. package/dist/{Browser-VZU2MTSA.js → Browser-NSOMITHS.js} +14 -14
  3. package/dist/Calculator-WZIBSVDK.js +29 -0
  4. package/dist/{CurrencyConverter-BSQCX3HS.js → CurrencyConverter-BX5HDEX6.js} +8 -8
  5. package/dist/{Documents-NR3T434J.js → Documents-LEB2ZSZD.js} +20 -20
  6. package/dist/{Files-QMV2E74S.js → Files-4P5YEYDE.js} +23 -23
  7. package/dist/{Notepad-M5MCY5DV.js → Notepad-UNPC3Q4F.js} +10 -10
  8. package/dist/{PdfViewer-OODU3XIT.js → PdfViewer-67VBUIRD.js} +1 -1
  9. package/dist/PomodoroTimer-LBFYGZHA.js +91 -0
  10. package/dist/{Preview-QTDCPMCL.js → Preview-3FABZUXV.js} +27 -27
  11. package/dist/Sidebar-OIWVKYUU.js +43 -0
  12. package/dist/{Spreadsheet-V2EWOJML.js → Spreadsheet-AADGH3IX.js} +14 -14
  13. package/dist/{Stock-U3G45T36.js → Stock-5TKATE4I.js} +3 -3
  14. package/dist/{Weather-GEC4VHLM.js → Weather-NQJCUUUN.js} +17 -17
  15. package/dist/{WorldClock-6ORV4NHF.js → WorldClock-QYZF2JCO.js} +6 -6
  16. package/dist/ai/index.js +13 -13
  17. package/dist/apps/index.d.ts +1 -1
  18. package/dist/apps/index.js +1 -1
  19. package/dist/bin/media-host-check.js +1 -1
  20. package/dist/bin/ui-check.js +1 -1
  21. package/dist/brand.css +1 -1
  22. package/dist/charts/BoxPlotChart.js +1 -1
  23. package/dist/charts/CandlestickChart.js +1 -1
  24. package/dist/charts/CartesianPlot.js +1 -1
  25. package/dist/charts/ChartBrush.js +1 -1
  26. package/dist/charts/ChartFrame.js +1 -1
  27. package/dist/charts/ChartSkeleton.js +1 -1
  28. package/dist/charts/ChordChart.js +1 -1
  29. package/dist/charts/ColumnChart.js +1 -1
  30. package/dist/charts/FunnelChart.js +1 -1
  31. package/dist/charts/HeatmapChart.js +1 -1
  32. package/dist/charts/HistogramChart.js +1 -1
  33. package/dist/charts/Meter.js +1 -1
  34. package/dist/charts/PieChart.js +1 -1
  35. package/dist/charts/RadarChart.js +1 -1
  36. package/dist/charts/RadialBarChart.js +1 -1
  37. package/dist/charts/RangeChart.js +1 -1
  38. package/dist/charts/RankedBars.js +1 -1
  39. package/dist/charts/SankeyChart.js +1 -1
  40. package/dist/charts/ScatterChart.js +1 -1
  41. package/dist/charts/StatTile.js +1 -1
  42. package/dist/charts/SunburstChart.js +1 -1
  43. package/dist/charts/TimeSeriesChart.js +1 -1
  44. package/dist/charts/TreemapChart.js +1 -1
  45. package/dist/charts/WaterfallChart.js +1 -1
  46. package/dist/{chunk-74QAQXSB.js → chunk-2C6IG7LG.js} +1 -1
  47. package/dist/{chunk-XUQQCKKD.js → chunk-37CCKGHU.js} +1 -1
  48. package/dist/chunk-3EKWDVBV.js +29 -0
  49. package/dist/{chunk-W7ZAFS7C.js → chunk-3GHBY2FP.js} +7 -7
  50. package/dist/{chunk-C3ZZDCBU.js → chunk-3IYMTPGR.js} +18 -18
  51. package/dist/{chunk-WXIEWJF7.js → chunk-3PGK3VFS.js} +1 -1
  52. package/dist/{chunk-I2FHDMIN.js → chunk-3PNKI44X.js} +6 -6
  53. package/dist/{chunk-KFSNSDTW.js → chunk-3V5Z2BJY.js} +12 -12
  54. package/dist/{chunk-Q6A6W3DI.js → chunk-3XQGEILM.js} +1 -1
  55. package/dist/{chunk-QSN7X27F.js → chunk-4CFOKYVR.js} +7 -7
  56. package/dist/{chunk-D3BDPSVV.js → chunk-4F3IKYUO.js} +6 -6
  57. package/dist/{chunk-QUS3C264.js → chunk-4NXMMWL6.js} +1 -1
  58. package/dist/{chunk-PHYI7M45.js → chunk-4VLKDANH.js} +1 -1
  59. package/dist/{chunk-6AJM3QNG.js → chunk-4YUCXIRP.js} +1 -1
  60. package/dist/{chunk-VWMTQLVS.js → chunk-5PY4H4ZJ.js} +1 -1
  61. package/dist/{chunk-R4JU7MU2.js → chunk-64FIE4SX.js} +7 -7
  62. package/dist/chunk-6CRERVSV.js +1 -0
  63. package/dist/chunk-6NMDKOQA.js +7 -0
  64. package/dist/{chunk-PFB2NSSS.js → chunk-6WSTN5A3.js} +5 -5
  65. package/dist/{chunk-R5FFVK2W.js → chunk-72YFU346.js} +1 -1
  66. package/dist/{chunk-SDORX5C2.js → chunk-77FLITYM.js} +6 -6
  67. package/dist/{chunk-DIZW2GZP.js → chunk-7CFH6Y4T.js} +1 -1
  68. package/dist/{chunk-3UL7IB25.js → chunk-BI6ZLD4X.js} +7 -7
  69. package/dist/{chunk-X2U5XB7J.js → chunk-BMZSMXE6.js} +1 -1
  70. package/dist/chunk-BOBUSE33.js +2 -0
  71. package/dist/{chunk-VNYFGNHO.js → chunk-BRHIRE4D.js} +4 -4
  72. package/dist/{chunk-QZRH7L2E.js → chunk-BSNWVZHW.js} +1 -1
  73. package/dist/{chunk-74HUZZPT.js → chunk-BY2OWWKC.js} +1 -1
  74. package/dist/chunk-CRLSG5AY.js +9 -0
  75. package/dist/{chunk-F6YMKW5G.js → chunk-CZ25A5RS.js} +1 -1
  76. package/dist/{chunk-V4WNEJ63.js → chunk-D2AUUIKG.js} +1 -1
  77. package/dist/{chunk-RIGW3E5M.js → chunk-D7FT2PXG.js} +5 -5
  78. package/dist/{chunk-SSOLRTVS.js → chunk-DFDDRKIJ.js} +1 -1
  79. package/dist/{chunk-5EK4DFB5.js → chunk-DISSJYKV.js} +7 -7
  80. package/dist/{chunk-BUWOFJGM.js → chunk-DITCVBR7.js} +10 -10
  81. package/dist/chunk-DODH46ZQ.js +8 -0
  82. package/dist/{chunk-IMDLBXO3.js → chunk-DTSCO7VM.js} +1 -1
  83. package/dist/{chunk-ZY62UQI2.js → chunk-DZNG34DC.js} +19 -19
  84. package/dist/{chunk-YF7A3BWA.js → chunk-E5ALJIXV.js} +4 -4
  85. package/dist/chunk-E6UCGCOC.js +1 -0
  86. package/dist/{chunk-PZFETJAG.js → chunk-EJUR35JG.js} +1 -1
  87. package/dist/{chunk-DIW6WT5L.js → chunk-ERMZ75FO.js} +1 -1
  88. package/dist/{chunk-F3AROMIU.js → chunk-ETF7LAYZ.js} +6 -6
  89. package/dist/{chunk-F6YIUCIJ.js → chunk-EYKUKN32.js} +4 -4
  90. package/dist/{chunk-NYLXA2EG.js → chunk-EZ3BQ6PK.js} +7 -7
  91. package/dist/{chunk-SFWIYB4T.js → chunk-FL2PUQX7.js} +1 -1
  92. package/dist/{chunk-X7JK22X2.js → chunk-GATKJSGL.js} +5 -5
  93. package/dist/{chunk-56C5SEZ7.js → chunk-GIM2422N.js} +1 -1
  94. package/dist/{chunk-HLZZ5Q5E.js → chunk-GQACKEKW.js} +16 -16
  95. package/dist/{chunk-TCN7XUCY.js → chunk-GWIPZKZJ.js} +4 -4
  96. package/dist/chunk-H33Z4ZIY.js +11 -0
  97. package/dist/{chunk-GVNDUNQL.js → chunk-H3BC4KDE.js} +1 -1
  98. package/dist/{chunk-IUBWN3OA.js → chunk-HVX37PKU.js} +1 -1
  99. package/dist/chunk-I4VD5D43.js +8 -0
  100. package/dist/chunk-IFDW5QW6.js +2 -0
  101. package/dist/{chunk-OPFCLDVM.js → chunk-IHQX4GYD.js} +1 -1
  102. package/dist/{chunk-6PWLY2LQ.js → chunk-IZCODCSC.js} +1 -1
  103. package/dist/{chunk-KBLMTCTD.js → chunk-JEXXJK7H.js} +1 -1
  104. package/dist/{chunk-MRLQH2GZ.js → chunk-JNDBRSYZ.js} +2 -2
  105. package/dist/{chunk-ONEF47LG.js → chunk-JPP7UWQA.js} +3 -3
  106. package/dist/{chunk-TYZ4IY7F.js → chunk-JUGPTBMS.js} +2 -2
  107. package/dist/{chunk-SH6ZLK4K.js → chunk-JWIKHVF4.js} +8 -8
  108. package/dist/{chunk-L2JOLPJR.js → chunk-JYLVX2FW.js} +1 -1
  109. package/dist/{chunk-SO4WAMVA.js → chunk-K7KQDPLW.js} +5 -5
  110. package/dist/{chunk-5OGWWBJY.js → chunk-KDZUWQEG.js} +1 -1
  111. package/dist/{chunk-CJKDYVNE.js → chunk-KKSW5IZ7.js} +6 -6
  112. package/dist/{chunk-POMS7YQN.js → chunk-KZHPX4FM.js} +2 -2
  113. package/dist/{chunk-35VA5UFB.js → chunk-LK2SICMI.js} +1 -1
  114. package/dist/{chunk-3APQ5V6P.js → chunk-LLLAIPFX.js} +1 -1
  115. package/dist/{chunk-WBU7NZBP.js → chunk-M5P6A7KS.js} +1 -1
  116. package/dist/{chunk-52L6IBTN.js → chunk-MAOJENIB.js} +1 -1
  117. package/dist/{chunk-ZLGU4VYO.js → chunk-MEYYQC43.js} +5 -5
  118. package/dist/{chunk-7AINUMUA.js → chunk-MMFJBWJC.js} +1 -1
  119. package/dist/{chunk-MIZO6SQ3.js → chunk-MTXTJLFK.js} +2 -2
  120. package/dist/{chunk-BJKZYQFA.js → chunk-MXHEREC6.js} +3 -3
  121. package/dist/{chunk-BBYHBN3R.js → chunk-NHCRQ7SW.js} +1 -1
  122. package/dist/chunk-NID6MGGC.js +13 -0
  123. package/dist/{chunk-SLORZA7W.js → chunk-NMK4UQXZ.js} +12 -12
  124. package/dist/{chunk-QLAQ6ASB.js → chunk-NT26CWMZ.js} +5 -5
  125. package/dist/{chunk-GTKNEJ3X.js → chunk-NVE6L27I.js} +8 -8
  126. package/dist/{chunk-CQZEO4UV.js → chunk-NWP6IJYK.js} +9 -9
  127. package/dist/{chunk-AXQBQH55.js → chunk-OFOLUFNB.js} +15 -15
  128. package/dist/{chunk-LQHWFL5Y.js → chunk-OHVAD3NO.js} +2 -2
  129. package/dist/{chunk-IOESXYEI.js → chunk-OVVXSAGE.js} +8 -8
  130. package/dist/{chunk-Z4UKLPGE.js → chunk-PDXD6DT7.js} +1 -1
  131. package/dist/{chunk-ALYBCDHU.js → chunk-PNGL4ZW2.js} +6 -6
  132. package/dist/{chunk-2TBC254V.js → chunk-PNQ4EYYM.js} +3 -3
  133. package/dist/{chunk-JXGYIV44.js → chunk-PPFMXLEX.js} +9 -9
  134. package/dist/{chunk-IJICE6KT.js → chunk-Q3OCGLW7.js} +2 -2
  135. package/dist/{chunk-TSOBVLV5.js → chunk-QEV346OG.js} +1 -1
  136. package/dist/{chunk-D7AA5WE2.js → chunk-QFA5COE6.js} +1 -1
  137. package/dist/{chunk-ZI7P5YGF.js → chunk-QQCHLRKG.js} +1 -1
  138. package/dist/{chunk-XCHY6QVH.js → chunk-QQK3XS6H.js} +8 -8
  139. package/dist/{chunk-46M6AYFJ.js → chunk-R6DGLGB3.js} +1 -1
  140. package/dist/chunk-RGBX3EVC.js +11 -0
  141. package/dist/{chunk-GKTCCPME.js → chunk-RUQEB2ZC.js} +3 -3
  142. package/dist/{chunk-5LNFW5E4.js → chunk-RYBJ6MMM.js} +1 -1
  143. package/dist/{chunk-2RJKMYON.js → chunk-S7VSXUKS.js} +3 -3
  144. package/dist/{chunk-O3NLPJH2.js → chunk-SB7OTZI4.js} +19 -19
  145. package/dist/{chunk-5B73MLXV.js → chunk-SBHFEWR6.js} +1 -1
  146. package/dist/chunk-SG2MTCA2.js +100 -0
  147. package/dist/chunk-SXORVKIZ.js +9 -0
  148. package/dist/{chunk-CREVU3AF.js → chunk-TW7TA2AB.js} +1 -1
  149. package/dist/{chunk-JLPTSC66.js → chunk-TXS6JKFV.js} +1 -1
  150. package/dist/{chunk-DQB3ORB7.js → chunk-UB4BTRSB.js} +5 -5
  151. package/dist/{chunk-4ELYV3L6.js → chunk-UKB2I3UK.js} +1 -1
  152. package/dist/{chunk-XFIMTNUH.js → chunk-UVUBZL7K.js} +1 -1
  153. package/dist/{chunk-JGZLLQAN.js → chunk-UX6HNRFV.js} +7 -7
  154. package/dist/chunk-VTVOQS5L.js +20 -0
  155. package/dist/{chunk-V23TPYHO.js → chunk-VU6VPKM3.js} +6 -6
  156. package/dist/{chunk-WQKGBPOQ.js → chunk-WJ3XSJ6B.js} +1 -1
  157. package/dist/chunk-WSPO4N72.js +19 -0
  158. package/dist/{chunk-TJPPV7KZ.js → chunk-WTY3SXO7.js} +1 -1
  159. package/dist/{chunk-2IV4XF3Y.js → chunk-WYN5KVU4.js} +3 -3
  160. package/dist/chunk-X6PPP6NX.js +14 -0
  161. package/dist/{chunk-6DT7HG3F.js → chunk-XHBQPVNG.js} +1 -1
  162. package/dist/{chunk-5BBDUKQP.js → chunk-Y2D2YMFY.js} +12 -12
  163. package/dist/{chunk-ZVTOB4RE.js → chunk-Y4MI6NRI.js} +1 -1
  164. package/dist/{chunk-ZMLRNHMS.js → chunk-Y5T257HX.js} +3 -3
  165. package/dist/{chunk-FW2EEIDB.js → chunk-YCQVEJOT.js} +2 -2
  166. package/dist/{chunk-JACPHDTK.js → chunk-YDYDR72S.js} +1 -1
  167. package/dist/chunk-YSFLXPUS.js +7 -0
  168. package/dist/{chunk-BJEBOXTR.js → chunk-YW2DH6YQ.js} +3 -3
  169. package/dist/{chunk-U4QZIU7X.js → chunk-ZEKM6HAA.js} +2 -2
  170. package/dist/{chunk-352MVBF7.js → chunk-ZN3O2KJ7.js} +18 -18
  171. package/dist/chunk-ZNCU3UIW.js +8 -0
  172. package/dist/{chunk-FDENTKSM.js → chunk-ZNXBKFV7.js} +5 -5
  173. package/dist/{chunk-SRMRRJ5K.js → chunk-ZSRRV44J.js} +1 -1
  174. package/dist/{chunk-2JYQF3PJ.js → chunk-ZTB6EMC7.js} +1 -1
  175. package/dist/data/DataTable.js +1 -1
  176. package/dist/data/Kanban.js +1 -1
  177. package/dist/data/ListFooter.js +1 -1
  178. package/dist/data/ListLoadError.js +1 -1
  179. package/dist/data/Pagination.js +1 -1
  180. package/dist/file-intake/index.js +1 -1
  181. package/dist/forms/BorderInput.js +1 -1
  182. package/dist/forms/BrandAssetEditor.js +1 -1
  183. package/dist/forms/Calendar.js +1 -1
  184. package/dist/forms/ColorPicker.js +1 -1
  185. package/dist/forms/ComposerAttachments.js +1 -1
  186. package/dist/forms/CornersInput.js +1 -1
  187. package/dist/forms/DatePicker.js +1 -1
  188. package/dist/forms/DateRangePicker.js +1 -1
  189. package/dist/forms/DateTimePicker.js +1 -1
  190. package/dist/forms/DisplayChips.js +1 -1
  191. package/dist/forms/FilePicker.js +1 -1
  192. package/dist/forms/FormErrorSummary.js +1 -1
  193. package/dist/forms/IconPicker.js +1 -1
  194. package/dist/forms/ImageFocusPoint.js +1 -1
  195. package/dist/forms/InputNumber.js +1 -1
  196. package/dist/forms/LinkPicker.js +1 -1
  197. package/dist/forms/MediaLibrary.js +1 -1
  198. package/dist/forms/MediaUploadField.js +1 -1
  199. package/dist/forms/MediaUploadGrid.js +1 -1
  200. package/dist/forms/MediaUsedInList.js +1 -1
  201. package/dist/forms/NumericKeypad.js +1 -1
  202. package/dist/forms/PositionInput.js +1 -1
  203. package/dist/forms/Select.js +1 -1
  204. package/dist/forms/SidesInput.js +1 -1
  205. package/dist/forms/Slider.js +1 -1
  206. package/dist/forms/Snippet.js +1 -1
  207. package/dist/forms/TagInput.js +1 -1
  208. package/dist/forms/TextToolbar.js +1 -1
  209. package/dist/forms/TimePicker.js +1 -1
  210. package/dist/forms/WidthsBar.js +1 -1
  211. package/dist/forms/mediaLibraryMenu.js +1 -1
  212. package/dist/forms/mediaMoveItems.js +1 -1
  213. package/dist/forms/useFileIntake.js +1 -1
  214. package/dist/index.d.ts +18 -4
  215. package/dist/index.js +377 -377
  216. package/dist/locales/zh-Hans.js +1 -1
  217. package/dist/map/index.js +2 -2
  218. package/dist/page-tabs/index.js +5 -5
  219. package/dist/pdf/index.js +1 -1
  220. package/dist/shell/Accordion.js +1 -1
  221. package/dist/shell/AppUpdateBanner.js +1 -1
  222. package/dist/shell/Avatar.js +1 -1
  223. package/dist/shell/Banner.js +1 -1
  224. package/dist/shell/Breadcrumbs.js +1 -1
  225. package/dist/shell/BudgetBar.js +1 -1
  226. package/dist/shell/Card.js +1 -1
  227. package/dist/shell/ColoredBadge.js +1 -1
  228. package/dist/shell/ConfirmDialog.js +1 -1
  229. package/dist/shell/ContainerFillChart.js +1 -1
  230. package/dist/shell/CountBadge.js +1 -1
  231. package/dist/shell/Dialog.js +1 -1
  232. package/dist/shell/Drawer.js +1 -1
  233. package/dist/shell/EditableGrid.js +1 -1
  234. package/dist/shell/EmptyState.js +1 -1
  235. package/dist/shell/GlobalSearch.js +1 -1
  236. package/dist/shell/HelpCenter.js +1 -1
  237. package/dist/shell/IconRail.js +1 -1
  238. package/dist/shell/ImageLightbox.js +1 -1
  239. package/dist/shell/LanguageSelect.js +1 -1
  240. package/dist/shell/Markdown.js +1 -1
  241. package/dist/shell/MetricBar.js +1 -1
  242. package/dist/shell/MetricBarLegend.js +1 -1
  243. package/dist/shell/MilestoneTimeline.js +1 -1
  244. package/dist/shell/PageHeader.js +1 -1
  245. package/dist/shell/ProductionTimeline.js +1 -1
  246. package/dist/shell/ResizeHandle.js +1 -1
  247. package/dist/shell/Result.js +1 -1
  248. package/dist/shell/SearchableSelect.js +1 -1
  249. package/dist/shell/SettingReset.js +1 -1
  250. package/dist/shell/SettingRow.js +1 -1
  251. package/dist/shell/SidebarLayout.js +1 -1
  252. package/dist/shell/SidebarNav.js +1 -1
  253. package/dist/shell/SortableList.js +1 -1
  254. package/dist/shell/Statistic.js +1 -1
  255. package/dist/shell/TimeAgo.js +1 -1
  256. package/dist/shell/TimelineTrack.js +1 -1
  257. package/dist/shell/TransferProgress.js +1 -1
  258. package/dist/shell/Tree.js +1 -1
  259. package/dist/shell/language.js +1 -1
  260. package/dist/shell/strings.d.ts +5 -0
  261. package/dist/shell/strings.js +1 -1
  262. package/dist/shell/toast.js +1 -1
  263. package/dist/telemetry/index.js +1 -1
  264. package/dist/templates/AuthScreen.js +1 -1
  265. package/dist/templates/ChatTemplate.js +1 -1
  266. package/dist/templates/CheckoutTemplate.js +1 -1
  267. package/dist/templates/DashboardTemplate.js +1 -1
  268. package/dist/templates/DataTablePage.js +1 -1
  269. package/dist/templates/EmailTemplate.js +1 -1
  270. package/dist/templates/ErrorBoundary.js +1 -1
  271. package/dist/templates/ErrorPage.js +1 -1
  272. package/dist/templates/FormLayoutPage.js +1 -1
  273. package/dist/templates/GalleryTemplate.js +1 -1
  274. package/dist/{types-BOinJXUf.d.ts → types-ClT92-8Z.d.ts} +13 -1
  275. package/dist/ui/index.js +1 -1
  276. package/dist/version.js +1 -1
  277. package/package.json +1 -1
  278. package/dist/Calculator-DKZHOHOD.js +0 -29
  279. package/dist/PomodoroTimer-I423ZZOQ.js +0 -91
  280. package/dist/Sidebar-UVBEI4DQ.js +0 -43
  281. package/dist/chunk-6JCIQ7XL.js +0 -8
  282. package/dist/chunk-6UBBY54N.js +0 -2
  283. package/dist/chunk-B73YLHD2.js +0 -99
  284. package/dist/chunk-CPM3BQGV.js +0 -14
  285. package/dist/chunk-DSYIKLOK.js +0 -11
  286. package/dist/chunk-EUOFKZI3.js +0 -19
  287. package/dist/chunk-LVAGFIWK.js +0 -2
  288. package/dist/chunk-MWNZY33B.js +0 -13
  289. package/dist/chunk-NE42BDQX.js +0 -9
  290. package/dist/chunk-NHFLTKPK.js +0 -11
  291. package/dist/chunk-O5KDTFK5.js +0 -8
  292. package/dist/chunk-PMOGQHYX.js +0 -20
  293. package/dist/chunk-RPK3U2K2.js +0 -9
  294. package/dist/chunk-RPTQCFLR.js +0 -29
  295. package/dist/chunk-URFWJZTV.js +0 -7
  296. package/dist/chunk-VKMEQKYT.js +0 -1
  297. package/dist/chunk-W7NZKU27.js +0 -7
  298. package/dist/chunk-YPXVOPL4.js +0 -1
  299. package/dist/chunk-Z5TCGLCM.js +0 -8
package/README.md CHANGED
@@ -162,6 +162,37 @@ Every window the shell can open lives in a `WindowRegistry` map. Two entry shape
162
162
  - **Page** — `{ component: LazyExoticComponent, label, size?, widget?, compact?, appStyle?, flushBody?, … }`. Opened via `openPage(routeKey)`. `flushBody` keeps the standard title bar + footer but drops the body padding (pair it with `<SidebarLayout>` for two-pane apps).
163
163
  - **Entity** — `{ endpoint, render(entity, …), title(entity), footer?, … }`. Opened via `openEntity(typeKey, id)`. The shell GETs `${endpoint}${id}/` (via the consumer-supplied entity fetcher) and hands the result to `render`.
164
164
 
165
+ #### Edit in the footer
166
+
167
+ A record's Edit is drawn by the shell, in the window footer — never by the
168
+ portal, and never in the title bar (harness UI-1, Detail Popup Requirements).
169
+ An entity entry says whether its record can be edited now with `useEdit`, a
170
+ hook called on every render of the window:
171
+
172
+ ```ts
173
+ supplier: {
174
+ endpoint: '/suppliers/',
175
+ render: (e, onClose, _id, editing, setEditing) => editing ? <SupplierForm … /> : <SupplierDetail … />,
176
+ title: (e) => `Supplier ${e.mid} — ${e.company_name}`,
177
+ useEdit: (e) => {
178
+ const { hasPerm } = useAuth();
179
+ if (!e) return 'hidden';
180
+ return hasPerm('change_supplier') ? 'enabled' : { disabledReason: SUPPLIER_EDIT_DENIED };
181
+ },
182
+ },
183
+ ```
184
+
185
+ `'enabled'` shows Edit in the footer's right-hand group, left of the window's
186
+ primary action; `'hidden'` shows nothing; `{ disabledReason }` shows it off,
187
+ with the sentence that says why. Alt+Shift+E presses it. While the window is
188
+ editing, **Discard** takes Edit's place: it asks the window's "Discard
189
+ changes?" question when there is something to lose, then leaves edit mode. The
190
+ form's own Update stays the far-right button. A window that draws its own
191
+ `Modal` passes the same thing as `edit={{ state, editing, onEdit, onDiscard }}`.
192
+
193
+ The footer's facts (`footer`) give way to its buttons: they stay on one line,
194
+ and when the buttons leave them too little room — a phone — they hide.
195
+
165
196
  Compose multiple partial maps with `createWindowRegistry(...maps)`:
166
197
 
167
198
  ```ts
@@ -1,29 +1,29 @@
1
- import{peekBrowserStartUrl as e,claimBrowserStartUrl as t}from"./chunk-LWLCNQY7.js";import{AboutApp as o}from"./chunk-LQHWFL5Y.js";import{WindowTitle as r}from"./chunk-B73YLHD2.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-JDCM2VHG.js";import"./chunk-KNUR2UEG.js";import"./chunk-IUBWN3OA.js";import"./chunk-5A7MWTXX.js";import"./chunk-Y53KNQKL.js";import"./chunk-SFWIYB4T.js";import{confirm as n}from"./chunk-352MVBF7.js";import"./chunk-FW2EEIDB.js";import"./chunk-KC3EX26K.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-O6JX6RDX.js";import"./chunk-5QFPTDQF.js";import"./chunk-74HUZZPT.js";import"./chunk-UGTRSRIW.js";import"./chunk-QR4RM7PO.js";import"./chunk-D323R2FT.js";import"./chunk-CDAJKLGL.js";import"./chunk-6KO5VTL7.js";import"./chunk-YPXVOPL4.js";import"./chunk-4IU5BSVE.js";import"./chunk-K7U4RWXJ.js";import"./chunk-VH6GB73Q.js";import{Icon as a}from"./chunk-KIBL6M3T.js";import"./chunk-J75ZT2JQ.js";import"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-22S6LG6D.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-DTJRIWFR.js";import"./chunk-TWVUQUUD.js";import"./chunk-VKMEQKYT.js";import"./chunk-C3QOHMR6.js";import{useRef as s,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",g=[{label:"Wikipedia",url:"https://en.wikipedia.org/wiki/Main_Page"},{label:"DevDocs",url:"https://devdocs.io"},{label:"Example",url:"https://example.com"}],b=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 k(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&&b.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 g;try{const e=localStorage.getItem(d);if(!e)return g;const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e?.url))return t}catch{}return g}function w(){return"undefined"==typeof window?p:localStorage.getItem(h)||p}function y(){const u=s(void 0);void 0===u.current&&(u.current=e()),i(()=>{null!=u.current&&t(u.current)},[]);const p=u.current?k(u.current.url):"",[g,b]=l(w),[f,y]=l(p||g),[j,C]=l(f),[W,R]=l([f]),[z,L]=l(0),[D,T]=l(0),[S,E]=l(x),[U,K]=l(!1),[B,H]=l(null),M=s(null),O=s(null);i(()=>{try{localStorage.setItem(d,JSON.stringify(S))}catch{}},[S]);const I=e=>{const t=k(e);t&&(y(t),C(t),R(e=>{const o=e.slice(0,z+1);return o.push(t),o}),L(e=>e+1),K(!1))},J=()=>{"undefined"!=typeof window&&window.open(f,"_blank","noopener,noreferrer")},Q=()=>{const e=B?.trim();e?(E(t=>[...t,{label:e,url:f}]),H(null)):H(null)};i(()=>{if(null===B)return;M.current?.focus(),M.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||H(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==B]);const F=e=>{E(t=>t.filter((t,o)=>o!==e))},G=z>0,P=z<W.length-1,V=S.some(e=>e.url===f),X="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-OHVAD3NO.js";import{WindowTitle as r}from"./chunk-SG2MTCA2.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-JDCM2VHG.js";import"./chunk-KNUR2UEG.js";import"./chunk-HVX37PKU.js";import"./chunk-5A7MWTXX.js";import"./chunk-Y53KNQKL.js";import"./chunk-FL2PUQX7.js";import{confirm as n}from"./chunk-ZN3O2KJ7.js";import"./chunk-YCQVEJOT.js";import"./chunk-KC3EX26K.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-O6JX6RDX.js";import"./chunk-5QFPTDQF.js";import"./chunk-BY2OWWKC.js";import"./chunk-UGTRSRIW.js";import"./chunk-QR4RM7PO.js";import"./chunk-D323R2FT.js";import"./chunk-CDAJKLGL.js";import"./chunk-6KO5VTL7.js";import"./chunk-6CRERVSV.js";import"./chunk-4IU5BSVE.js";import"./chunk-K7U4RWXJ.js";import"./chunk-VH6GB73Q.js";import{Icon as a}from"./chunk-KIBL6M3T.js";import"./chunk-J75ZT2JQ.js";import"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-22S6LG6D.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-DTJRIWFR.js";import"./chunk-TWVUQUUD.js";import"./chunk-E6UCGCOC.js";import"./chunk-C3QOHMR6.js";import{useRef as s,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",g=[{label:"Wikipedia",url:"https://en.wikipedia.org/wiki/Main_Page"},{label:"DevDocs",url:"https://devdocs.io"},{label:"Example",url:"https://example.com"}],b=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 k(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&&b.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 g;try{const e=localStorage.getItem(d);if(!e)return g;const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e?.url))return t}catch{}return g}function w(){return"undefined"==typeof window?p:localStorage.getItem(h)||p}function y(){const u=s(void 0);void 0===u.current&&(u.current=e()),i(()=>{null!=u.current&&t(u.current)},[]);const p=u.current?k(u.current.url):"",[g,b]=l(w),[f,y]=l(p||g),[j,C]=l(f),[R,W]=l([f]),[z,L]=l(0),[S,D]=l(0),[T,O]=l(x),[U,E]=l(!1),[K,J]=l(null),G=s(null),H=s(null);i(()=>{try{localStorage.setItem(d,JSON.stringify(T))}catch{}},[T]);const M=e=>{const t=k(e);t&&(y(t),C(t),W(e=>{const o=e.slice(0,z+1);return o.push(t),o}),L(e=>e+1),E(!1))},Q=()=>{"undefined"!=typeof window&&window.open(f,"_blank","noopener,noreferrer")},V=()=>{const e=K?.trim();e?(O(t=>[...t,{label:e,url:f}]),J(null)):J(null)};i(()=>{if(null===K)return;G.current?.focus(),G.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||J(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==K]);const P=e=>{O(t=>t.filter((t,o)=>o!==e))},X=z>0,A=z<R.length-1,B=T.some(e=>e.url===f),I="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-gray-200 bg-gray-50 shrink-0",children:[
6
- /* @__PURE__ */m("button",{onClick:()=>{if(z>0){const e=z-1;L(e),y(W[e]),C(W[e]),K(!1)}},disabled:!G,className:X,title:"Back",children:/* @__PURE__ */m(a,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
- /* @__PURE__ */m("button",{onClick:()=>{if(z<W.length-1){const e=z+1;L(e),y(W[e]),C(W[e]),K(!1)}},disabled:!P,className:X,title:"Forward",children:/* @__PURE__ */m(a,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
- /* @__PURE__ */m("button",{onClick:()=>T(e=>e+1),className:X,title:"Refresh",children:/* @__PURE__ */m(a,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
- /* @__PURE__ */m("button",{onClick:()=>I(g),className:X,title:"Home",children:/* @__PURE__ */m(a,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
- /* @__PURE__ */m("form",{onSubmit:e=>{e.preventDefault(),I(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(z>0){const e=z-1;L(e),y(R[e]),C(R[e]),E(!1)}},disabled:!X,className:I,title:"Back",children:/* @__PURE__ */m(a,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
+ /* @__PURE__ */m("button",{onClick:()=>{if(z<R.length-1){const e=z+1;L(e),y(R[e]),C(R[e]),E(!1)}},disabled:!A,className:I,title:"Forward",children:/* @__PURE__ */m(a,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
+ /* @__PURE__ */m("button",{onClick:()=>D(e=>e+1),className:I,title:"Refresh",children:/* @__PURE__ */m(a,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
+ /* @__PURE__ */m("button",{onClick:()=>M(g),className:I,title:"Home",children:/* @__PURE__ */m(a,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
+ /* @__PURE__ */m("form",{onSubmit:e=>{e.preventDefault(),M(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-gray-400 hover:text-gray-700",title:"Reset to current URL",children:"×"})]})}),
13
- /* @__PURE__ */m("button",{"data-bookmark-popover":!0,onClick:()=>V?F(S.findIndex(e=>e.url===f)):void H(v(f)),className:X+" "+(V?"text-yellow-500":""),title:V?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */m(a,{name:"star",className:"h-4 w-4",fill:V?"currentColor":"none",strokeWidth:1.5})}),
14
- /* @__PURE__ */m("button",{onClick:J,className:X,title:"Open in new tab",children:/* @__PURE__ */m(a,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
15
- /* @__PURE__ */m("button",{onClick:()=>K(e=>!e),className:X,title:"Embedding help",children:/* @__PURE__ */m(a,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==B&&/* @__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:()=>B?P(T.findIndex(e=>e.url===f)):void J(v(f)),className:I+" "+(B?"text-yellow-500":""),title:B?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */m(a,{name:"star",className:"h-4 w-4",fill:B?"currentColor":"none",strokeWidth:1.5})}),
14
+ /* @__PURE__ */m("button",{onClick:Q,className:I,title:"Open in new tab",children:/* @__PURE__ */m(a,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
15
+ /* @__PURE__ */m("button",{onClick:()=>E(e=>!e),className:I,title:"Embedding help",children:/* @__PURE__ */m(a,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==K&&/* @__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-gray-500 mb-1",children:"Bookmark this page"}),
17
17
  /* @__PURE__ */m("div",{className:"text-2xs text-gray-400 truncate mb-2 font-mono",title:f,children:f}),
18
- /* @__PURE__ */m("input",{ref:M,type:"text",value:B,onChange:e=>H(e.target.value),onKeyDown:e=>{"Enter"===e.key?Q():"Escape"===e.key&&H(null)},placeholder:"Name",className:"w-full text-sm px-2 h-8 border border-gray-300 rounded focus:outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200"}),
18
+ /* @__PURE__ */m("input",{ref:G,type:"text",value:K,onChange:e=>J(e.target.value),onKeyDown:e=>{"Enter"===e.key?V():"Escape"===e.key&&J(null)},placeholder:"Name",className:"w-full text-sm px-2 h-8 border border-gray-300 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:()=>H(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
21
- /* @__PURE__ */m("button",{onClick:Q,disabled:!B.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===S.length&&/* @__PURE__ */m("span",{className:"text-2xs text-gray-400 italic px-2",children:"No bookmarks yet — star the address bar to add one."}),S.map((e,t)=>/* @__PURE__ */c("button",{onClick:()=>I(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"})&&F(t)},className:"flex items-center gap-2 px-2 py-0.5 rounded text-xs text-gray-700 hover:bg-gray-100 whitespace-nowrap",title:`${e.url}\n(right-click to remove)`,children:[
20
+ /* @__PURE__ */m("button",{onClick:()=>J(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
21
+ /* @__PURE__ */m("button",{onClick:V,disabled:!K.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
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===T.length&&/* @__PURE__ */m("span",{className:"text-2xs text-gray-400 italic px-2",children:"No bookmarks yet — star the address bar to add one."}),T.map((e,t)=>/* @__PURE__ */c("button",{onClick:()=>M(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"})&&P(t)},className:"flex items-center gap-2 px-2 py-0.5 rounded text-xs text-gray-700 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:()=>{b(f);try{localStorage.setItem(h,f)}catch{}},className:"px-2 py-0.5 text-2xs text-gray-500 hover:text-gray-800",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:O,openExternal:J,showHelp:U,dismissHelp:()=>K(!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:s}){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:S,iframeRef:H,openExternal:Q,showHelp:U,dismissHelp:()=>E(!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:s}){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(a,{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-EJUR35JG.js";import{useWidgetSettings as n}from"./chunk-SG2MTCA2.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-JDCM2VHG.js";import"./chunk-KNUR2UEG.js";import"./chunk-HVX37PKU.js";import"./chunk-5A7MWTXX.js";import"./chunk-Y53KNQKL.js";import"./chunk-FL2PUQX7.js";import"./chunk-ZN3O2KJ7.js";import"./chunk-YCQVEJOT.js";import"./chunk-KC3EX26K.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-O6JX6RDX.js";import"./chunk-5QFPTDQF.js";import"./chunk-BY2OWWKC.js";import"./chunk-UGTRSRIW.js";import"./chunk-QR4RM7PO.js";import"./chunk-D323R2FT.js";import"./chunk-CDAJKLGL.js";import"./chunk-6KO5VTL7.js";import"./chunk-4IU5BSVE.js";import"./chunk-K7U4RWXJ.js";import"./chunk-VH6GB73Q.js";import{Icon as r}from"./chunk-KIBL6M3T.js";import"./chunk-J75ZT2JQ.js";import"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-22S6LG6D.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-DTJRIWFR.js";import"./chunk-TWVUQUUD.js";import"./chunk-E6UCGCOC.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,C]=c(""),[x,f]=c([]),[v,$]=c(!1),[T,W]=c(()=>e(h)),[E,J]=c(!1),[R,w]=c(T),K=i(null);n(l(()=>{w({...T}),J(!0)},[T]));const U=l(e=>{C(""),k(t=>j||"0"===t?(N(!1),"."===e?"0.":e):"."===e&&t.includes(".")?t:t+e)},[j]),D=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),f(n=>[`${p} ${b} ${t} = ${e}`,...n].slice(0,20))}else d(t);g(e),N(!0)},[m,p,b,j,S]),L=l(()=>{if(null===p||!b)return;const e=parseFloat(m),t=S(p,e,b),n=`${p} ${b} ${e} =`;f(e=>[`${n} ${t}`,...e].slice(0,20)),C(n),k(String(t)),d(null),g(null),N(!0)},[m,p,b,S]),O=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"?U(e.key):"."===e.key?U("."):"+"===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&&K.current?.contains(e.target)&&e.preventDefault(),L()):"Escape"===e.key?D():"Backspace"===e.key?k(e=>e.length>1?e.slice(0,-1):"0"):"%"===e.key&&O())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[U,G,L,D,O]);const A="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",B=`${A} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,F=`${A} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,M=`${A} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,V=`${A} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
2
+ return s(a,{children:[
3
+ /* @__PURE__ */s("div",{ref:K,className:"flex flex-col h-full",style:{opacity:T.activeOpacity/100,backdropFilter:T.activeBlur>0?`blur(${T.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:x.slice(0,3).reverse().map((e,t)=>/* @__PURE__ */u("div",{className:"text-2xs text-slate-400 text-right font-mono truncate",children:e},t))}),(y||b&&null!==p)&&/* @__PURE__ */u("div",{className:"text-base text-slate-600 text-right font-mono",children:y||`${p} ${b} ${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:D,className:M,children:"AC"}),
11
+ /* @__PURE__ */u("button",{onClick:Q,className:M,children:"+/−"}),
12
+ /* @__PURE__ */u("button",{onClick:O,className:M,children:"%"}),
13
+ /* @__PURE__ */u("button",{onClick:()=>G("÷"),className:`${F} ${"÷"===b?"ring-2 ring-blue-400":""}`,children:"÷"}),
14
+ /* @__PURE__ */u("button",{onClick:()=>U("7"),className:B,children:"7"}),
15
+ /* @__PURE__ */u("button",{onClick:()=>U("8"),className:B,children:"8"}),
16
+ /* @__PURE__ */u("button",{onClick:()=>U("9"),className:B,children:"9"}),
17
+ /* @__PURE__ */u("button",{onClick:()=>G("×"),className:`${F} ${"×"===b?"ring-2 ring-blue-400":""}`,children:"×"}),
18
+ /* @__PURE__ */u("button",{onClick:()=>U("4"),className:B,children:"4"}),
19
+ /* @__PURE__ */u("button",{onClick:()=>U("5"),className:B,children:"5"}),
20
+ /* @__PURE__ */u("button",{onClick:()=>U("6"),className:B,children:"6"}),
21
+ /* @__PURE__ */u("button",{onClick:()=>G("-"),className:`${F} ${"-"===b?"ring-2 ring-blue-400":""}`,children:"−"}),
22
+ /* @__PURE__ */u("button",{onClick:()=>U("1"),className:B,children:"1"}),
23
+ /* @__PURE__ */u("button",{onClick:()=>U("2"),className:B,children:"2"}),
24
+ /* @__PURE__ */u("button",{onClick:()=>U("3"),className:B,children:"3"}),
25
+ /* @__PURE__ */u("button",{onClick:()=>G("+"),className:`${F} ${"+"===b?"ring-2 ring-blue-400":""}`,children:"+"}),
26
+ /* @__PURE__ */u("button",{onClick:()=>U("0"),className:`${B} col-span-2`,children:"0"}),
27
+ /* @__PURE__ */u("button",{onClick:()=>U("."),className:B,children:"."}),
28
+ /* @__PURE__ */u("button",{onClick:L,className:V,children:"="})]})]}),
29
+ /* @__PURE__ */u(t,{open:E,onClose:()=>J(!1),title:"Calculator Settings",appearance:R,onAppearanceChange:w,onSave:()=>{W(R),localStorage.setItem(h,JSON.stringify(R)),J(!1)}})]})}export{m as default};
@@ -1,4 +1,4 @@
1
- import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-PZFETJAG.js";import{useWidgetSettings as r}from"./chunk-B73YLHD2.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-JDCM2VHG.js";import"./chunk-KNUR2UEG.js";import"./chunk-IUBWN3OA.js";import"./chunk-5A7MWTXX.js";import"./chunk-Y53KNQKL.js";import"./chunk-SFWIYB4T.js";import"./chunk-352MVBF7.js";import"./chunk-FW2EEIDB.js";import"./chunk-KC3EX26K.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-O6JX6RDX.js";import"./chunk-5QFPTDQF.js";import"./chunk-74HUZZPT.js";import"./chunk-UGTRSRIW.js";import"./chunk-QR4RM7PO.js";import"./chunk-D323R2FT.js";import"./chunk-CDAJKLGL.js";import"./chunk-6KO5VTL7.js";import"./chunk-4IU5BSVE.js";import"./chunk-K7U4RWXJ.js";import"./chunk-VH6GB73Q.js";import"./chunk-KIBL6M3T.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as n}from"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-22S6LG6D.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-DTJRIWFR.js";import"./chunk-TWVUQUUD.js";import"./chunk-VKMEQKYT.js";import"./chunk-C3QOHMR6.js";import{useState as s,useCallback as a,useEffect as o}from"react";import{jsxs as c,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 f={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function j(){const[u,d]=s(N),[j,y]=s(()=>t(h)),[x,b]=s({}),[D,S]=s(!1),[v,C]=s(!1),[U,J]=s([]),[B,R]=s(j),[K,T]=s("USD"),[W,A]=s("CNY");r(a(()=>{J([...u]),R({...j}),C(!0)},[u,j])),o(()=>{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__ */
1
+ import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-EJUR35JG.js";import{useWidgetSettings as r}from"./chunk-SG2MTCA2.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-JDCM2VHG.js";import"./chunk-KNUR2UEG.js";import"./chunk-HVX37PKU.js";import"./chunk-5A7MWTXX.js";import"./chunk-Y53KNQKL.js";import"./chunk-FL2PUQX7.js";import"./chunk-ZN3O2KJ7.js";import"./chunk-YCQVEJOT.js";import"./chunk-KC3EX26K.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-O6JX6RDX.js";import"./chunk-5QFPTDQF.js";import"./chunk-BY2OWWKC.js";import"./chunk-UGTRSRIW.js";import"./chunk-QR4RM7PO.js";import"./chunk-D323R2FT.js";import"./chunk-CDAJKLGL.js";import"./chunk-6KO5VTL7.js";import"./chunk-4IU5BSVE.js";import"./chunk-K7U4RWXJ.js";import"./chunk-VH6GB73Q.js";import"./chunk-KIBL6M3T.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as n}from"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-22S6LG6D.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-DTJRIWFR.js";import"./chunk-TWVUQUUD.js";import"./chunk-E6UCGCOC.js";import"./chunk-C3QOHMR6.js";import{useState as s,useCallback as a,useEffect as o}from"react";import{jsxs as c,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 f={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function j(){const[u,d]=s(N),[j,y]=s(()=>t(h)),[x,b]=s({}),[D,S]=s(!1),[C,v]=s(!1),[J,U]=s([]),[R,K]=s(j),[O,B]=s("USD"),[G,L]=s("CNY");r(a(()=>{U([...u]),K({...j}),v(!0)},[u,j])),o(()=>{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 c(i,{children:[
3
3
  /* @__PURE__ */l("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${j.activeOpacity/100})`,backdropFilter:j.activeBlur>0?`blur(${j.activeBlur}px)`:void 0},children:/* @__PURE__ */c("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=x[t]?.[e];/* @__PURE__ */
4
4
  return c("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:[
@@ -9,13 +9,13 @@ return c("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:f[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:()=>C(!1),title:"Currency Settings",appearance:B,onAppearanceChange:R,onSave:()=>{if(0===U.length)return;const t=U.slice(0,4);d(t),y(B),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(B)),C(!1)},children:/* @__PURE__ */c("div",{children:[
12
+ /* @__PURE__ */l(e,{open:C,onClose:()=>v(!1),title:"Currency Settings",appearance:R,onAppearanceChange:K,onSave:()=>{if(0===J.length)return;const t=J.slice(0,4);d(t),y(R),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(R)),v(!1)},children:/* @__PURE__ */c("div",{children:[
13
13
  /* @__PURE__ */c("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:["Currency Pairs ",
14
- /* @__PURE__ */c("span",{className:"text-2xs font-normal text-gray-400",children:["(",U.length,"/",4,")"]})]}),
15
- /* @__PURE__ */l("div",{className:"space-y-1 mb-2",children:U.map(([t,e],r)=>/* @__PURE__ */c("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
14
+ /* @__PURE__ */c("span",{className:"text-2xs font-normal text-gray-400",children:["(",J.length,"/",4,")"]})]}),
15
+ /* @__PURE__ */l("div",{className:"space-y-1 mb-2",children:J.map(([t,e],r)=>/* @__PURE__ */c("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
16
16
  /* @__PURE__ */c("span",{className:"text-sm",children:[f[t]||""," ",t," → ",f[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))}),U.length<4?/* @__PURE__ */c("div",{className:"flex items-center gap-2",children:[
18
- /* @__PURE__ */l("select",{value:K,onChange:t=>T(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:m.map(t=>/* @__PURE__ */l("option",{children:t},t))}),
17
+ /* @__PURE__ */l("button",{onClick:()=>U(t=>t.filter((t,e)=>e!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),J.length<4?/* @__PURE__ */c("div",{className:"flex items-center gap-2",children:[
18
+ /* @__PURE__ */l("select",{value:O,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))}),
19
19
  /* @__PURE__ */l("span",{className:"text-gray-400",children:"→"}),
20
- /* @__PURE__ */l("select",{value:W,onChange:t=>A(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:()=>{K!==W&&U.length<4&&J(t=>[...t,[K,W]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */c("p",{className:"text-2xs text-gray-400 italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{j as default};
20
+ /* @__PURE__ */l("select",{value:G,onChange:t=>L(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:()=>{O!==G&&J.length<4&&U(t=>[...t,[O,G]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */c("p",{className:"text-2xs text-gray-400 italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{j as default};
@@ -1,25 +1,25 @@
1
- import{escapeHtml as e}from"./chunk-BR22X7E5.js";import{AboutApp as t}from"./chunk-LQHWFL5Y.js";import{WindowTitle as n}from"./chunk-B73YLHD2.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-JDCM2VHG.js";import"./chunk-KNUR2UEG.js";import"./chunk-IUBWN3OA.js";import"./chunk-5A7MWTXX.js";import"./chunk-Y53KNQKL.js";import"./chunk-SFWIYB4T.js";import"./chunk-352MVBF7.js";import"./chunk-FW2EEIDB.js";import"./chunk-KC3EX26K.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import{toast_default as r}from"./chunk-QUS3C264.js";import{PopupMenu as o,PopupMenuLabel as i,PopupMenuItem as l,PopupMenuDivider as a}from"./chunk-O6JX6RDX.js";import"./chunk-5QFPTDQF.js";import"./chunk-74HUZZPT.js";import"./chunk-UGTRSRIW.js";import"./chunk-QR4RM7PO.js";import"./chunk-D323R2FT.js";import"./chunk-CDAJKLGL.js";import"./chunk-6KO5VTL7.js";import"./chunk-YPXVOPL4.js";import"./chunk-4IU5BSVE.js";import"./chunk-K7U4RWXJ.js";import"./chunk-VH6GB73Q.js";import{Icon as s}from"./chunk-KIBL6M3T.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as c}from"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-22S6LG6D.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-DTJRIWFR.js";import"./chunk-TWVUQUUD.js";import"./chunk-VKMEQKYT.js";import"./chunk-C3QOHMR6.js";import{useState as m,useRef as d}from"react";import{jsxs as h,jsx as u}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,w]=m(!1),[j,N]=m(!1),[D,C]=m(null),L=d(null),M=d(null),U=d(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)}},T=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))},B=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-BR22X7E5.js";import{AboutApp as t}from"./chunk-OHVAD3NO.js";import{WindowTitle as n}from"./chunk-SG2MTCA2.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-JDCM2VHG.js";import"./chunk-KNUR2UEG.js";import"./chunk-HVX37PKU.js";import"./chunk-5A7MWTXX.js";import"./chunk-Y53KNQKL.js";import"./chunk-FL2PUQX7.js";import"./chunk-ZN3O2KJ7.js";import"./chunk-YCQVEJOT.js";import"./chunk-KC3EX26K.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import{toast_default as r}from"./chunk-4NXMMWL6.js";import{PopupMenu as o,PopupMenuLabel as i,PopupMenuItem as l,PopupMenuDivider as a}from"./chunk-O6JX6RDX.js";import"./chunk-5QFPTDQF.js";import"./chunk-BY2OWWKC.js";import"./chunk-UGTRSRIW.js";import"./chunk-QR4RM7PO.js";import"./chunk-D323R2FT.js";import"./chunk-CDAJKLGL.js";import"./chunk-6KO5VTL7.js";import"./chunk-6CRERVSV.js";import"./chunk-4IU5BSVE.js";import"./chunk-K7U4RWXJ.js";import"./chunk-VH6GB73Q.js";import{Icon as s}from"./chunk-KIBL6M3T.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as c}from"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-22S6LG6D.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-DTJRIWFR.js";import"./chunk-TWVUQUUD.js";import"./chunk-E6UCGCOC.js";import"./chunk-C3QOHMR6.js";import{useState as m,useRef as d}from"react";import{jsxs as h,jsx as u}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,w]=m(!1),[j,N]=m(!1),[C,D]=m(null),L=d(null),M=d(null),R=d(null),U=(e,t)=>{R.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=()=>{R.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))},O=async t=>{const n=(t.name.split(".").pop()||"").toLowerCase();v(!0);try{if(p.has(n)||!g.has(n)&&t.type.startsWith("text/")){const r=await t.text(),o=e(r).replace(/\n/g,"<br>");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)}},O=f?.filename?(I=f.filename).length>24?`${I.slice(0,23)}…`:I:"Untitled";var I;/* @__PURE__ */
4
- return h("div",{className:"relative flex flex-col h-full",onDragOver:e=>{e.preventDefault(),b||w(!0)},onDragLeave:e=>{e.currentTarget===e.target&&w(!1)},onDrop:e=>{e.preventDefault(),w(!1);const t=Array.from(e.dataTransfer.files??[]);0!==t.length&&(t.every(e=>e.type.startsWith("image/"))?W(t):B(t[0]))},children:[
5
- /* @__PURE__ */u(n,{title:`${O}${j?" •":""} - 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?(A=f.filename).length>24?`${A.slice(0,23)}…`:A:"Untitled";var A;/* @__PURE__ */
4
+ return h("div",{className:"relative flex flex-col h-full",onDragOver:e=>{e.preventDefault(),b||w(!0)},onDragLeave:e=>{e.currentTarget===e.target&&w(!1)},onDrop:e=>{e.preventDefault(),w(!1);const t=Array.from(e.dataTransfer.files??[]);0!==t.length&&(t.every(e=>e.type.startsWith("image/"))?W(t):O(t[0]))},children:[
5
+ /* @__PURE__ */u(n,{title:`${B}${j?" •":""} - Documents`}),
6
6
  /* @__PURE__ */u(t,{app:"documents"}),
7
7
  /* @__PURE__ */h("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__ */u("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&&B(t),L.current&&(L.current.value="")},className:"hidden"}),
8
+ /* @__PURE__ */u("input",{ref:L,type:"file",accept:".txt,.md,.csv,.tsv,.log,.json,.xml,.html,.htm,.css,.js,.jsx,.ts,.tsx,.py,.rb,.go,.rs,.java,.c,.h,.cpp,.hpp,.sh,.bash,.yml,.yaml,.toml,.ini,.conf,.env,.sql,.docx,text/*",onChange:e=>{const t=e.target.files?.[0];t&&O(t),L.current&&(L.current.value="")},className:"hidden"}),
9
9
  /* @__PURE__ */h("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__ */u(s,{name:"folder-open",className:"h-3.5 w-3.5",strokeWidth:1.5}),"Open"]}),
11
- /* @__PURE__ */u("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"}),
11
+ /* @__PURE__ */u("button",{onClick:()=>{if(!f)return;const t=R.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=R.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__ */u("span",{className:"text-2xs text-gray-400 ml-1",children:"TXT · DOCX · Code"}),
13
13
  /* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
14
14
  /* @__PURE__ */h("span",{className:"text-xs font-medium text-gray-700 truncate max-w-[200px]",title:f.filename,children:[f.filename,j?" •":""]}),
15
15
  /* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
16
16
  /* @__PURE__ */h("div",{className:"flex items-center gap-0.5",children:[
17
- /* @__PURE__ */u("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__ */u("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__ */u("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__ */u("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__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("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__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("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__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("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__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("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__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
22
- /* @__PURE__ */h("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__ */h("select",{onMouseDown:e=>e.preventDefault(),onChange:e=>{U("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__ */u("option",{value:"",disabled:!0,children:"Size"}),
24
24
  /* @__PURE__ */u("option",{value:"1",children:"XS"}),
25
25
  /* @__PURE__ */u("option",{value:"2",children:"S"}),
@@ -27,21 +27,21 @@ return h("div",{className:"relative flex flex-col h-full",onDragOver:e=>{e.preve
27
27
  /* @__PURE__ */u("option",{value:"4",children:"L"}),
28
28
  /* @__PURE__ */u("option",{value:"5",children:"XL"}),
29
29
  /* @__PURE__ */u("option",{value:"6",children:"2XL"})]}),
30
- /* @__PURE__ */u("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__ */u("input",{type:"color",defaultValue:"#000000",onChange:e=>U("foreColor",e.target.value),className:"w-7 h-6 border border-gray-300 rounded cursor-pointer",title:"Text color"}),
31
31
  /* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
32
- /* @__PURE__ */u("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__ */u("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__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("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__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("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__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
35
35
  /* @__PURE__ */h("div",{className:"flex items-center gap-0.5",children:[
36
- /* @__PURE__ */u("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__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M3.75 12h9.75M3.75 18h14.25"})})}),
37
- /* @__PURE__ */u("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__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M7.125 12h9.75M4.875 18h14.25"})})}),
38
- /* @__PURE__ */u("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__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M10.5 12h9.75M6 18h14.25"})})}),
39
- /* @__PURE__ */u("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__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M3.75 12h16.5M3.75 18h16.5"})})})]}),
36
+ /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("justifyLeft"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align left",children:/* @__PURE__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M3.75 12h9.75M3.75 18h14.25"})})}),
37
+ /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("justifyCenter"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align center",children:/* @__PURE__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M7.125 12h9.75M4.875 18h14.25"})})}),
38
+ /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("justifyRight"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align right",children:/* @__PURE__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M10.5 12h9.75M6 18h14.25"})})}),
39
+ /* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("justifyFull"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Justify",children:/* @__PURE__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M3.75 12h16.5M3.75 18h16.5"})})})]}),
40
40
  /* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
41
41
  /* @__PURE__ */u("input",{ref:M,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&W(Array.from(e.target.files)),M.current&&(M.current.value="")}}),
42
42
  /* @__PURE__ */h("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__ */u(s,{name:"image",className:"h-3.5 w-3.5",strokeWidth:1.5}),"Image"]})]}),
44
- /* @__PURE__ */u("div",{className:"flex-1 min-h-0 overflow-hidden",children:k?/* @__PURE__ */u(c,{size:"sm",padding:"",className:"h-full",label:"Loading"}):/* @__PURE__ */u("div",{className:"h-full overflow-auto "+("docx"===f.kind?"bg-gray-100 px-6 py-8":"bg-white"),children:/* @__PURE__ */u("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-white p-[1in] shadow text-sm leading-relaxed text-gray-800 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-gray-800 bg-white outline-none whitespace-pre-wrap"})})}),b&&/* @__PURE__ */u("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__ */u("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__ */h(o,{minWidth:150,style:{left:D.x,top:D.y},onClose:()=>C(null),children:[
44
+ /* @__PURE__ */u("div",{className:"flex-1 min-h-0 overflow-hidden",children:k?/* @__PURE__ */u(c,{size:"sm",padding:"",className:"h-full",label:"Loading"}):/* @__PURE__ */u("div",{className:"h-full overflow-auto "+("docx"===f.kind?"bg-gray-100 px-6 py-8":"bg-white"),children:/* @__PURE__ */u("div",{ref:R,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(),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-white p-[1in] shadow text-sm leading-relaxed text-gray-800 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-gray-800 bg-white outline-none whitespace-pre-wrap"})})}),b&&/* @__PURE__ */u("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__ */u("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__ */h(o,{minWidth:150,style:{left:C.x,top:C.y},onClose:()=>D(null),children:[
45
45
  /* @__PURE__ */u(i,{children:"Image width"}),
46
46
  /* @__PURE__ */u(l,{onClick:()=>T("25%"),children:"25%"}),
47
47
  /* @__PURE__ */u(l,{onClick:()=>T("50%"),children:"50%"}),
@@ -49,4 +49,4 @@ return h("div",{className:"relative flex flex-col h-full",onDragOver:e=>{e.preve
49
49
  /* @__PURE__ */u(l,{onClick:()=>T("100%"),children:"100%"}),
50
50
  /* @__PURE__ */u(l,{onClick:()=>T(null),children:"Original size"}),
51
51
  /* @__PURE__ */u(a,{}),
52
- /* @__PURE__ */u(l,{danger:!0,onClick:()=>{D?.el.remove(),N(!0),C(null)},children:"Remove image"})]})]})}export{f as default};
52
+ /* @__PURE__ */u(l,{danger:!0,onClick:()=>{C?.el.remove(),N(!0),D(null)},children:"Remove image"})]})]})}export{f as default};
@@ -1,42 +1,42 @@
1
- import{openPreviewFile as e}from"./chunk-2JYQF3PJ.js";import{SidebarLayout as t}from"./chunk-CJKDYVNE.js";import"./chunk-QWK6DRSN.js";import"./chunk-POMS7YQN.js";import{Breadcrumbs as r}from"./chunk-WQKGBPOQ.js";import{formatBytes as a}from"./chunk-X2S2XDZI.js";import"./chunk-5OTS2G3M.js";import"./chunk-36BRD5J3.js";import{getFilesDemoTree as n}from"./chunk-IAQC775L.js";import{AboutApp as s}from"./chunk-LQHWFL5Y.js";import{peekFilesViewRequest as i,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-RAAUW5OZ.js";import"./chunk-ESL5TDNA.js";import"./chunk-VTVSMRFX.js";import{useWindowManager as f,WindowTitle as x}from"./chunk-B73YLHD2.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-JDCM2VHG.js";import"./chunk-KNUR2UEG.js";import"./chunk-IUBWN3OA.js";import"./chunk-5A7MWTXX.js";import"./chunk-Y53KNQKL.js";import"./chunk-SFWIYB4T.js";import{confirm as g,prompt as y}from"./chunk-352MVBF7.js";import"./chunk-FW2EEIDB.js";import"./chunk-KC3EX26K.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import{toast_default as b}from"./chunk-QUS3C264.js";import"./chunk-O6JX6RDX.js";import"./chunk-5QFPTDQF.js";import"./chunk-74HUZZPT.js";import"./chunk-UGTRSRIW.js";import"./chunk-QR4RM7PO.js";import"./chunk-D323R2FT.js";import"./chunk-CDAJKLGL.js";import{TH_ONE_LINE as k}from"./chunk-6KO5VTL7.js";import"./chunk-YPXVOPL4.js";import"./chunk-4IU5BSVE.js";import"./chunk-K7U4RWXJ.js";import"./chunk-VH6GB73Q.js";import{Icon as N}from"./chunk-KIBL6M3T.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as w}from"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-22S6LG6D.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-DTJRIWFR.js";import"./chunk-TWVUQUUD.js";import"./chunk-VKMEQKYT.js";import"./chunk-C3QOHMR6.js";import{useState as v,useEffect as j,useSyncExternalStore as $,useRef as C,useCallback as D}from"react";import{jsxs as L,jsx as T,Fragment as E}from"react/jsx-runtime";var R="undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000",W={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 S(e,t){return"/"===e||""===e?"/"+t:e.replace(/\/$/,"")+"/"+t}function P(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 F(){const F=R.replace(/\/$/,""),O=null!==n(),[I,M]=v("/"),[U,A]=v([]),[Q,V]=v([]),[B,K]=v(null),[J,Y]=v(!0),[z,G]=v(!1),[H,X]=v(null),[_,Z]=v(!1),[q,ee]=v(()=>{const e=i();return"trash"===e?"trash":e?{desktopFolderId:e.folderId}:"files"});j(()=>{o()},[]);const[te,re]=v([]);j(()=>{const e=()=>{o(),ee("trash")},t=e=>{o();const t=e.detail?.folderId;t&&ee({desktopFolderId:t})};return window.addEventListener(l,e),window.addEventListener(c,t),()=>{window.removeEventListener(l,e),window.removeEventListener(c,t)}},[]);const ae=$(d,m,m),ne="object"==typeof q?q.desktopFolderId:null,se=ne?ae?.folders.find(e=>e.id===ne)??null:null,ie=ne&&ae?.itemsByFolder[ne]||[];j(()=>{ne&&ae&&!ae.folders.some(e=>e.id===ne)&&ee("files")},[ne,ae]);const oe=C(0),le=C(null),{openPage:ce,openEntity:de}=f(),me=t=>{"preview-file"===t.entityType&&t.filePath&&t.fileKind?e({filePath:t.filePath,filename:t.label,kind:t.fileKind,onStaged:e=>ce(e)}):"page"===t.entityType?ce(t.entityId):de(t.entityType,t.entityId,null,t.label)},he=D((e,t={})=>fetch(e,{...t,credentials:"include"}),[]),pe=D(async()=>{try{const e=await he(`${F}/api/quota`);if(e.ok){const t=await e.json();X({used:t.used,limit:t.limit})}}catch{}},[he,F]),ue=D(async e=>{if(K(null),O){const t=function(e){const t=n();if(!t)return[];let r=t;for(const t of e.split("/").filter(Boolean)){const e=r.find(e=>"folder"===e.kind&&e.name===t);if(!e||!e.children)return[];r=e.children}return r.map(e=>({name:e.name,kind:e.kind,size:e.size??0,modifiedAt:e.modifiedAt??""}))}(e);return A(t),M(e),G(!1),Y(!1),void("/"===e&&V(t.filter(e=>"folder"===e.kind).map(e=>e.name)))}Y(!0);try{const t=await he(`${F}/api/files?path=${encodeURIComponent(e)}`);if(!t.ok){const e=await t.json().catch(()=>({}));return void b.error(e.error||`Failed to list (${t.status})`)}const r=await t.json(),a=r.entries||[];A(a),M(r.path||e),G(!1),"/"===(r.path||e)&&V(a.filter(e=>"folder"===e.kind).map(e=>e.name))}catch(e){G(!0)}finally{Y(!1)}pe()},[he,F,pe,O]),fe=D(async()=>{if(O)return re([]),void Y(!1);Y(!0),K(null);try{const e=await he(`${F}/api/trash`);if(!e.ok){const t=await e.json().catch(()=>({}));return void b.error(t.error||`Failed to list trash (${e.status})`)}const t=await e.json();re(t.entries||[]),G(!1)}catch{G(!0)}finally{Y(!1)}pe()},[he,F,pe,O]);j(()=>{"files"===q?ue(I):"trash"===q&&fe()},[I,q]);const xe=async e=>{const t=S(I,e.name);try{const r=await he(`${F}/api/file?path=${encodeURIComponent(t)}`);if(!r.ok)return void b.error(`Download failed (${r.status})`);const a=await r.blob(),n=URL.createObjectURL(a),s=document.createElement("a");s.href=n,s.download=e.name,s.click(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}catch(e){b.error(e?.message||"Download failed")}},ge=async e=>{const t=Array.from(e);for(const e of t){const t=new FormData;t.append("file",e);try{const r=await he(`${F}/api/upload?path=${encodeURIComponent(I)}`,{method:"POST",body:t});if(!r.ok){const t=await r.json().catch(()=>({}));if(413===r.status){const r=Math.max(0,(t.limit||0)-(t.used||0));b.error(`Quota exceeded — ${a(r)} free, ${e.name} is ${a(t.attempted||e.size)}`)}else b.error(`Upload ${e.name}: ${t.error||r.status}`)}}catch(t){b.error(`Upload ${e.name}: ${t?.message||"failed"}`)}}ue(I)},ye=()=>{oe.current=0,Z(!1)};if(j(()=>{const e=()=>ye();return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[]),z)/* @__PURE__ */
1
+ import{openPreviewFile as e}from"./chunk-ZTB6EMC7.js";import{SidebarLayout as t}from"./chunk-KKSW5IZ7.js";import"./chunk-QWK6DRSN.js";import"./chunk-KZHPX4FM.js";import{Breadcrumbs as r}from"./chunk-WJ3XSJ6B.js";import{formatBytes as a}from"./chunk-X2S2XDZI.js";import"./chunk-5OTS2G3M.js";import"./chunk-36BRD5J3.js";import{getFilesDemoTree as n}from"./chunk-IAQC775L.js";import{AboutApp as s}from"./chunk-OHVAD3NO.js";import{peekFilesViewRequest as i,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-RAAUW5OZ.js";import"./chunk-ESL5TDNA.js";import"./chunk-VTVSMRFX.js";import{useWindowManager as f,WindowTitle as x}from"./chunk-SG2MTCA2.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-JDCM2VHG.js";import"./chunk-KNUR2UEG.js";import"./chunk-HVX37PKU.js";import"./chunk-5A7MWTXX.js";import"./chunk-Y53KNQKL.js";import"./chunk-FL2PUQX7.js";import{confirm as g,prompt as y}from"./chunk-ZN3O2KJ7.js";import"./chunk-YCQVEJOT.js";import"./chunk-KC3EX26K.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import{toast_default as b}from"./chunk-4NXMMWL6.js";import"./chunk-O6JX6RDX.js";import"./chunk-5QFPTDQF.js";import"./chunk-BY2OWWKC.js";import"./chunk-UGTRSRIW.js";import"./chunk-QR4RM7PO.js";import"./chunk-D323R2FT.js";import"./chunk-CDAJKLGL.js";import{TH_ONE_LINE as k}from"./chunk-6KO5VTL7.js";import"./chunk-6CRERVSV.js";import"./chunk-4IU5BSVE.js";import"./chunk-K7U4RWXJ.js";import"./chunk-VH6GB73Q.js";import{Icon as N}from"./chunk-KIBL6M3T.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as w}from"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-22S6LG6D.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-DTJRIWFR.js";import"./chunk-TWVUQUUD.js";import"./chunk-E6UCGCOC.js";import"./chunk-C3QOHMR6.js";import{useState as v,useEffect as j,useSyncExternalStore as $,useRef as C,useCallback as D}from"react";import{jsxs as L,jsx as T,Fragment as R}from"react/jsx-runtime";var E="undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000",W={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 S(e,t){return"/"===e||""===e?"/"+t:e.replace(/\/$/,"")+"/"+t}function O(e){if(!e)return"—";try{const t=new Date(e);return isNaN(t.getTime())?"—":t.toLocaleString(void 0,{dateStyle:"short",timeStyle:"short"})}catch{return e}}function M(){const M=E.replace(/\/$/,""),P=null!==n(),[U,A]=v("/"),[F,I]=v([]),[K,V]=v([]),[J,B]=v(null),[Q,X]=v(!0),[G,z]=v(!1),[H,Z]=v(null),[_,Y]=v(!1),[q,ee]=v(()=>{const e=i();return"trash"===e?"trash":e?{desktopFolderId:e.folderId}:"files"});j(()=>{o()},[]);const[te,re]=v([]);j(()=>{const e=()=>{o(),ee("trash")},t=e=>{o();const t=e.detail?.folderId;t&&ee({desktopFolderId:t})};return window.addEventListener(l,e),window.addEventListener(c,t),()=>{window.removeEventListener(l,e),window.removeEventListener(c,t)}},[]);const ae=$(d,m,m),ne="object"==typeof q?q.desktopFolderId:null,se=ne?ae?.folders.find(e=>e.id===ne)??null:null,ie=ne&&ae?.itemsByFolder[ne]||[];j(()=>{ne&&ae&&!ae.folders.some(e=>e.id===ne)&&ee("files")},[ne,ae]);const oe=C(0),le=C(null),{openPage:ce,openEntity:de}=f(),me=t=>{"preview-file"===t.entityType&&t.filePath&&t.fileKind?e({filePath:t.filePath,filename:t.label,kind:t.fileKind,onStaged:e=>ce(e)}):"page"===t.entityType?ce(t.entityId):de(t.entityType,t.entityId,null,t.label)},he=D((e,t={})=>fetch(e,{...t,credentials:"include"}),[]),pe=D(async()=>{try{const e=await he(`${M}/api/quota`);if(e.ok){const t=await e.json();Z({used:t.used,limit:t.limit})}}catch{}},[he,M]),ue=D(async e=>{if(B(null),P){const t=function(e){const t=n();if(!t)return[];let r=t;for(const t of e.split("/").filter(Boolean)){const e=r.find(e=>"folder"===e.kind&&e.name===t);if(!e||!e.children)return[];r=e.children}return r.map(e=>({name:e.name,kind:e.kind,size:e.size??0,modifiedAt:e.modifiedAt??""}))}(e);return I(t),A(e),z(!1),X(!1),void("/"===e&&V(t.filter(e=>"folder"===e.kind).map(e=>e.name)))}X(!0);try{const t=await he(`${M}/api/files?path=${encodeURIComponent(e)}`);if(!t.ok){const e=await t.json().catch(()=>({}));return void b.error(e.error||`Failed to list (${t.status})`)}const r=await t.json(),a=r.entries||[];I(a),A(r.path||e),z(!1),"/"===(r.path||e)&&V(a.filter(e=>"folder"===e.kind).map(e=>e.name))}catch(e){z(!0)}finally{X(!1)}pe()},[he,M,pe,P]),fe=D(async()=>{if(P)return re([]),void X(!1);X(!0),B(null);try{const e=await he(`${M}/api/trash`);if(!e.ok){const t=await e.json().catch(()=>({}));return void b.error(t.error||`Failed to list trash (${e.status})`)}const t=await e.json();re(t.entries||[]),z(!1)}catch{z(!0)}finally{X(!1)}pe()},[he,M,pe,P]);j(()=>{"files"===q?ue(U):"trash"===q&&fe()},[U,q]);const xe=async e=>{const t=S(U,e.name);try{const r=await he(`${M}/api/file?path=${encodeURIComponent(t)}`);if(!r.ok)return void b.error(`Download failed (${r.status})`);const a=await r.blob(),n=URL.createObjectURL(a),s=document.createElement("a");s.href=n,s.download=e.name,s.click(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}catch(e){b.error(e?.message||"Download failed")}},ge=async e=>{const t=Array.from(e);for(const e of t){const t=new FormData;t.append("file",e);try{const r=await he(`${M}/api/upload?path=${encodeURIComponent(U)}`,{method:"POST",body:t});if(!r.ok){const t=await r.json().catch(()=>({}));if(413===r.status){const r=Math.max(0,(t.limit||0)-(t.used||0));b.error(`Quota exceeded — ${a(r)} free, ${e.name} is ${a(t.attempted||e.size)}`)}else b.error(`Upload ${e.name}: ${t.error||r.status}`)}}catch(t){b.error(`Upload ${e.name}: ${t?.message||"failed"}`)}}ue(U)},ye=()=>{oe.current=0,Y(!1)};if(j(()=>{const e=()=>ye();return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[]),G)/* @__PURE__ */
2
2
  return L("div",{className:"flex flex-col h-full bg-white",children:[
3
3
  /* @__PURE__ */T(x,{title:"Files - offline"}),
4
4
  /* @__PURE__ */T("div",{className:"flex-1 flex items-center justify-center p-8 text-center",children:/* @__PURE__ */L("div",{className:"max-w-md",children:[
5
5
  /* @__PURE__ */T(N,{name:"close-circle",className:"h-12 w-12 mx-auto text-gray-300 mb-3",strokeWidth:1.4}),
6
6
  /* @__PURE__ */T("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:"Can't reach the file server"}),
7
7
  /* @__PURE__ */L("p",{className:"text-sm text-gray-500 mb-3",children:["No response from ",
8
- /* @__PURE__ */T("span",{className:"font-mono",children:F}),". Make sure the server is running — see ",
8
+ /* @__PURE__ */T("span",{className:"font-mono",children:M}),". Make sure the server is running — see ",
9
9
  /* @__PURE__ */T("span",{className:"font-mono",children:"examples/file-server/README.md"}),"."]}),
10
- /* @__PURE__ */T("button",{onClick:()=>ue(I),className:"px-3 h-8 text-sm bg-blue-500 text-white rounded hover:bg-blue-600",children:"Retry"})]})})]});const be="/"===I?[]:I.split("/").filter(Boolean),ke=H&&H.limit>0?Math.min(100,Math.round(H.used/H.limit*100)):0,Ne=ke>90?"bg-red-500":ke>75?"bg-amber-500":"bg-blue-500",we=[{label:"My files",onClick:()=>M("/")},...be.map((e,t)=>({label:e,onClick:()=>M("/"+be.slice(0,t+1).join("/"))}))],ve=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"),je=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})}),$e=/* @__PURE__ */L("nav",{className:"p-2",children:[
10
+ /* @__PURE__ */T("button",{onClick:()=>ue(U),className:"px-3 h-8 text-sm bg-blue-500 text-white rounded hover:bg-blue-600",children:"Retry"})]})})]});const be="/"===U?[]:U.split("/").filter(Boolean),ke=H&&H.limit>0?Math.min(100,Math.round(H.used/H.limit*100)):0,Ne=ke>90?"bg-red-500":ke>75?"bg-amber-500":"bg-blue-500",we=[{label:"My files",onClick:()=>A("/")},...be.map((e,t)=>({label:e,onClick:()=>A("/"+be.slice(0,t+1).join("/"))}))],ve=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"),je=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})}),$e=/* @__PURE__ */L("nav",{className:"p-2",children:[
11
11
  /* @__PURE__ */T("div",{className:"px-2 py-2 text-2xs font-semibold uppercase tracking-wide text-gray-400",children:"Locations"}),
12
- /* @__PURE__ */L("button",{onClick:()=>{ee("files"),M("/")},className:ve("files"===q&&"/"===I),children:[je("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"]}),Q.map(e=>/* @__PURE__ */L("button",{onClick:()=>{ee("files"),M("/"+e)},className:ve("files"===q&&I==="/"+e),children:[je("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)),!O&&/* @__PURE__ */L("button",{onClick:()=>ee("trash"),className:ve("trash"===q),children:[je("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"]}),ae&&ae.folders.length>0&&/* @__PURE__ */L(E,{children:[
12
+ /* @__PURE__ */L("button",{onClick:()=>{ee("files"),A("/")},className:ve("files"===q&&"/"===U),children:[je("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"]}),K.map(e=>/* @__PURE__ */L("button",{onClick:()=>{ee("files"),A("/"+e)},className:ve("files"===q&&U==="/"+e),children:[je("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)),!P&&/* @__PURE__ */L("button",{onClick:()=>ee("trash"),className:ve("trash"===q),children:[je("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"]}),ae&&ae.folders.length>0&&/* @__PURE__ */L(R,{children:[
14
14
  /* @__PURE__ */T("div",{className:"px-2 pt-3 pb-2 text-2xs font-semibold uppercase tracking-wide text-gray-400",children:"Desktop"}),ae.folders.map(e=>/* @__PURE__ */L("button",{onClick:()=>ee({desktopFolderId:e.id}),className:ve(ne===e.id),children:[
15
15
  /* @__PURE__ */T(h,{className:"h-4 w-4 shrink-0 text-amber-500"}),
16
16
  /* @__PURE__ */T("span",{className:"truncate",children:e.name}),e.itemCount>0&&/* @__PURE__ */T("span",{className:"ml-auto text-2xs text-gray-400 tabular-nums",children:e.itemCount})]},e.id))]})]});/* @__PURE__ */
17
- return L("div",{className:"relative flex flex-col h-full bg-white",onDragEnter:e=>{O||"object"==typeof q||e.dataTransfer?.types?.includes?.("Files")&&(e.preventDefault(),oe.current++,_||Z(!0))},onDragOver:e=>{e.dataTransfer?.types?.includes?.("Files")&&e.preventDefault()},onDragLeave:()=>{oe.current>0&&oe.current--,0===oe.current&&Z(!1)},onDrop:e=>{e.preventDefault(),ye(),O||"object"==typeof q||e.dataTransfer.files?.length&&ge(e.dataTransfer.files)},children:[
18
- /* @__PURE__ */T(x,{title:se?`Files - ${se.name}`:"Files"+("/"===I?"":" - "+I)}),
17
+ return L("div",{className:"relative flex flex-col h-full bg-white",onDragEnter:e=>{P||"object"==typeof q||e.dataTransfer?.types?.includes?.("Files")&&(e.preventDefault(),oe.current++,_||Y(!0))},onDragOver:e=>{e.dataTransfer?.types?.includes?.("Files")&&e.preventDefault()},onDragLeave:()=>{oe.current>0&&oe.current--,0===oe.current&&Y(!1)},onDrop:e=>{e.preventDefault(),ye(),P||"object"==typeof q||e.dataTransfer.files?.length&&ge(e.dataTransfer.files)},children:[
18
+ /* @__PURE__ */T(x,{title:se?`Files - ${se.name}`:"Files"+("/"===U?"":" - "+U)}),
19
19
  /* @__PURE__ */T(s,{app:"files"}),
20
20
  /* @__PURE__ */T("input",{ref:le,type:"file",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&ge(e.target.files),le.current&&(le.current.value="")}}),
21
21
  /* @__PURE__ */T("div",{className:"flex-1 min-h-0",children:/* @__PURE__ */T(t,{sidebar:$e,storageKey:"files.sidebarWidth",defaultWidth:200,minWidth:150,maxWidth:320,children:/* @__PURE__ */L("div",{className:"flex h-full min-w-0 flex-col",children:[
22
- /* @__PURE__ */L("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-gray-200 bg-gray-50 shrink-0 text-xs",children:[/* @__PURE__ */L(E,"files"===q?{children:[
23
- /* @__PURE__ */T("button",{onClick:()=>M(function(e){if("/"===e||""===e)return"/";const t=e.replace(/\/$/,""),r=t.lastIndexOf("/");return r<=0?"/":t.slice(0,r)}(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})}),
22
+ /* @__PURE__ */L("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-gray-200 bg-gray-50 shrink-0 text-xs",children:[/* @__PURE__ */L(R,"files"===q?{children:[
23
+ /* @__PURE__ */T("button",{onClick:()=>A(function(e){if("/"===e||""===e)return"/";const t=e.replace(/\/$/,""),r=t.lastIndexOf("/");return r<=0?"/":t.slice(0,r)}(U)),disabled:"/"===U,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})}),
24
24
  /* @__PURE__ */T("div",{className:"flex-1 min-w-0",children:/* @__PURE__ */T(r,{items:we,maxItems:5})}),
25
- /* @__PURE__ */T("button",{onClick:()=>ue(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})}),!O&&/* @__PURE__ */L(E,{children:[
25
+ /* @__PURE__ */T("button",{onClick:()=>ue(U),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})}),!P&&/* @__PURE__ */L(R,{children:[
26
26
  /* @__PURE__ */L("button",{onClick:()=>ee("trash"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600 flex items-center gap-1",title:"Open trash",children:[
27
27
  /* @__PURE__ */T(N,{name:"trash",className:"h-3.5 w-3.5",strokeWidth:1.5}),"Trash"]}),
28
- /* @__PURE__ */L("button",{onClick:async()=>{const e=await y({title:"New folder",placeholder:"Folder name",confirmLabel:"Create"});if(!e)return;if(/[\\/]/.test(e))return void b.error("Folder names cannot contain slashes");const t=S(I,e),r=await he(`${F}/api/folder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t})});if(!r.ok){const e=await r.json().catch(()=>({}));return void b.error(e.error||`Create folder failed (${r.status})`)}ue(I)},className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600 flex items-center gap-1",children:[
28
+ /* @__PURE__ */L("button",{onClick:async()=>{const e=await y({title:"New folder",placeholder:"Folder name",confirmLabel:"Create"});if(!e)return;if(/[\\/]/.test(e))return void b.error("Folder names cannot contain slashes");const t=S(U,e),r=await he(`${M}/api/folder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t})});if(!r.ok){const e=await r.json().catch(()=>({}));return void b.error(e.error||`Create folder failed (${r.status})`)}ue(U)},className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600 flex items-center gap-1",children:[
29
29
  /* @__PURE__ */T(N,{name:"folder-plus",className:"h-3.5 w-3.5",strokeWidth:1.5}),"New Folder"]}),
30
30
  /* @__PURE__ */L("button",{onClick:()=>le.current?.click(),className:"px-2 py-1 rounded bg-blue-500 text-white hover:bg-blue-600 flex items-center gap-1",children:[
31
31
  /* @__PURE__ */T(N,{name:"upload",className:"h-3.5 w-3.5",strokeWidth:1.8}),"Upload"]})]})]}:"trash"===q?{children:[
32
32
  /* @__PURE__ */T("button",{onClick:()=>ee("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})}),
33
33
  /* @__PURE__ */T("span",{className:"flex-1 text-gray-700 font-medium px-2",children:"Trash"}),
34
34
  /* @__PURE__ */T("button",{onClick:fe,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})}),
35
- /* @__PURE__ */T("button",{onClick:async()=>{if(0===te.length)return;if(!await g({title:"Empty trash",message:`${te.length} item${1===te.length?"":"s"} will be permanently removed. This can't be undone.`,confirmLabel:"Empty trash",variant:"danger"}))return;const e=await he(`${F}/api/trash`,{method:"DELETE"});if(!e.ok){const t=await e.json().catch(()=>({}));return void b.error(t.error||`Empty trash failed (${e.status})`)}fe()},disabled:0===te.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:[
35
+ /* @__PURE__ */T("button",{onClick:async()=>{if(0===te.length)return;if(!await g({title:"Empty trash",message:`${te.length} item${1===te.length?"":"s"} will be permanently removed. This can't be undone.`,confirmLabel:"Empty trash",variant:"danger"}))return;const e=await he(`${M}/api/trash`,{method:"DELETE"});if(!e.ok){const t=await e.json().catch(()=>({}));return void b.error(t.error||`Empty trash failed (${e.status})`)}fe()},disabled:0===te.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:[
36
36
  /* @__PURE__ */T("button",{onClick:()=>ee("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})}),
37
37
  /* @__PURE__ */T(h,{className:"h-4 w-4 text-amber-500 ml-1"}),
38
38
  /* @__PURE__ */T("span",{className:"flex-1 text-gray-700 font-medium px-1 truncate",children:se?.name??"Desktop folder"}),
39
- /* @__PURE__ */T("span",{className:"text-2xs text-gray-400 px-2",children:"Desktop shortcuts"})]}),H&&/* @__PURE__ */L(E,{children:[
39
+ /* @__PURE__ */T("span",{className:"text-2xs text-gray-400 px-2",children:"Desktop shortcuts"})]}),H&&/* @__PURE__ */L(R,{children:[
40
40
  /* @__PURE__ */T("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
41
41
  /* @__PURE__ */L("div",{className:"flex items-center gap-2",title:`${a(H.used)} of ${a(H.limit)} used`,children:[
42
42
  /* @__PURE__ */T("div",{className:"w-20 h-1.5 rounded-full bg-gray-200 overflow-hidden",children:/* @__PURE__ */T("div",{className:`h-full ${Ne} transition-all`,style:{width:`${ke}%`}})}),
@@ -47,7 +47,7 @@ return L("div",{className:"relative flex flex-col h-full bg-white",onDragEnter:e
47
47
  /* @__PURE__ */T("th",{className:`${k} text-left font-medium px-3 h-8 w-28`,children:"Type"}),
48
48
  /* @__PURE__ */T("th",{className:`${k} w-56`})]})}),
49
49
  /* @__PURE__ */T("tbody",{children:ie.map(e=>{const t=`${e.entityType}|${e.entityId}`;/* @__PURE__ */
50
- return L("tr",{onClick:()=>K(t),onDoubleClick:()=>me(e),className:"cursor-default border-b border-gray-100 "+(B===t?"bg-blue-50":"hover:bg-gray-50"),children:[
50
+ return L("tr",{onClick:()=>B(t),onDoubleClick:()=>me(e),className:"cursor-default border-b border-gray-100 "+(J===t?"bg-blue-50":"hover:bg-gray-50"),children:[
51
51
  /* @__PURE__ */L("td",{className:"px-3 h-8 flex items-center gap-2",children:[
52
52
  /* @__PURE__ */T(p,{item:e}),
53
53
  /* @__PURE__ */T("span",{className:"truncate",title:e.label,children:e.label})]}),
@@ -55,7 +55,7 @@ return L("tr",{onClick:()=>K(t),onDoubleClick:()=>me(e),className:"cursor-defaul
55
55
  /* @__PURE__ */L("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:[
56
56
  /* @__PURE__ */T("button",{onClick:t=>{t.stopPropagation(),me(e)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-blue-600 text-2xs",children:"Open"}),
57
57
  /* @__PURE__ */T("button",{onClick:t=>{t.stopPropagation(),ae?.moveToDesktop([e])},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-gray-500 text-2xs ml-1",children:"Move to desktop"}),
58
- /* @__PURE__ */T("button",{onClick:t=>{t.stopPropagation(),ae?.removeShortcuts([e])},className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Remove"})]})]},t)})})]}):"trash"===q?J&&0===te.length?/* @__PURE__ */T(w,{size:"sm",padding:"p-6",label:"Loading"}):0===te.length?/* @__PURE__ */T("div",{className:"p-10 text-center text-sm text-gray-400",children:"Trash is empty."}):/* @__PURE__ */L("table",{className:"w-full text-sm",children:[
58
+ /* @__PURE__ */T("button",{onClick:t=>{t.stopPropagation(),ae?.removeShortcuts([e])},className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Remove"})]})]},t)})})]}):"trash"===q?Q&&0===te.length?/* @__PURE__ */T(w,{size:"sm",padding:"p-6",label:"Loading"}):0===te.length?/* @__PURE__ */T("div",{className:"p-10 text-center text-sm text-gray-400",children:"Trash is empty."}):/* @__PURE__ */L("table",{className:"w-full text-sm",children:[
59
59
  /* @__PURE__ */T("thead",{className:"bg-gray-50 text-2xs uppercase tracking-wide text-gray-500",children:/* @__PURE__ */L("tr",{children:[
60
60
  /* @__PURE__ */T("th",{className:`${k} text-left font-medium px-3 h-8`,children:"Name"}),
61
61
  /* @__PURE__ */T("th",{className:`${k} text-left font-medium px-3 h-8`,children:"Original location"}),
@@ -67,21 +67,21 @@ return L("tr",{onClick:()=>K(t),onDoubleClick:()=>me(e),className:"cursor-defaul
67
67
  /* @__PURE__ */T("span",{className:"truncate",title:e.name,children:e.name})]}),
68
68
  /* @__PURE__ */T("td",{className:"px-3 h-8 text-gray-500 text-xs font-mono truncate",title:e.originalPath,children:e.originalPath||"—"}),
69
69
  /* @__PURE__ */T("td",{className:"px-3 h-8 text-right tabular-nums text-gray-500",children:a(e.size)}),
70
- /* @__PURE__ */T("td",{className:"px-3 h-8 text-right text-gray-500 tabular-nums",children:e.deletedAt?P(e.deletedAt):"—"}),
70
+ /* @__PURE__ */T("td",{className:"px-3 h-8 text-right text-gray-500 tabular-nums",children:e.deletedAt?O(e.deletedAt):"—"}),
71
71
  /* @__PURE__ */L("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:[
72
- /* @__PURE__ */T("button",{onClick:()=>(async e=>{const t=await he(`${F}/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 b.error(e.error||`Restore failed (${t.status})`)}b.success(`Restored "${e.name}"`),fe()})(e),className:"px-2 py-0.5 rounded hover:bg-gray-200 text-blue-600 text-2xs",children:"Restore"}),
73
- /* @__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 he(`${F}/api/trash/${encodeURIComponent(e.id)}`,{method:"DELETE"});if(!t.ok){const e=await t.json().catch(()=>({}));return void b.error(e.error||`Delete failed (${t.status})`)}fe()})(e),className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Delete forever"})]})]},e.id))})]}):J&&0===U.length?/* @__PURE__ */T(w,{size:"sm",padding:"p-6",label:"Loading"}):0===U.length?/* @__PURE__ */L("div",{className:"p-10 text-center text-sm text-gray-400",children:["Empty folder.",!O&&/* @__PURE__ */L(E,{children:[" Drop files here or click ",
72
+ /* @__PURE__ */T("button",{onClick:()=>(async e=>{const t=await he(`${M}/api/trash/restore`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e.id})});if(!t.ok){const e=await t.json().catch(()=>({}));return void b.error(e.error||`Restore failed (${t.status})`)}b.success(`Restored "${e.name}"`),fe()})(e),className:"px-2 py-0.5 rounded hover:bg-gray-200 text-blue-600 text-2xs",children:"Restore"}),
73
+ /* @__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 he(`${M}/api/trash/${encodeURIComponent(e.id)}`,{method:"DELETE"});if(!t.ok){const e=await t.json().catch(()=>({}));return void b.error(e.error||`Delete failed (${t.status})`)}fe()})(e),className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Delete forever"})]})]},e.id))})]}):Q&&0===F.length?/* @__PURE__ */T(w,{size:"sm",padding:"p-6",label:"Loading"}):0===F.length?/* @__PURE__ */L("div",{className:"p-10 text-center text-sm text-gray-400",children:["Empty folder.",!P&&/* @__PURE__ */L(R,{children:[" Drop files here or click ",
74
74
  /* @__PURE__ */T("span",{className:"font-medium",children:"Upload"}),"."]})]}):/* @__PURE__ */L("table",{className:"w-full text-sm",children:[
75
75
  /* @__PURE__ */T("thead",{className:"bg-gray-50 text-2xs uppercase tracking-wide text-gray-500",children:/* @__PURE__ */L("tr",{children:[
76
76
  /* @__PURE__ */T("th",{className:`${k} text-left font-medium px-3 h-8`,children:"Name"}),
77
77
  /* @__PURE__ */T("th",{className:`${k} text-right font-medium px-3 h-8 w-24`,children:"Size"}),
78
78
  /* @__PURE__ */T("th",{className:`${k} text-right font-medium px-3 h-8 w-40`,children:"Modified"}),
79
79
  /* @__PURE__ */T("th",{className:`${k} w-32`})]})}),
80
- /* @__PURE__ */T("tbody",{children:U.map(t=>/* @__PURE__ */L("tr",{onClick:()=>K(t.name),onDoubleClick:()=>{"folder"===t.kind?M(S(I,t.name)):(async t=>{if(O)return;const r=S(I,t.name),a=(t.name.split(".").pop()||"").toLowerCase(),n=W[a];n?await e({filePath:r,filename:t.name,kind:n,onStaged:e=>ce(e)}):xe(t)})(t)},className:"cursor-default border-b border-gray-100 "+(B===t.name?"bg-blue-50":"hover:bg-gray-50"),children:[
80
+ /* @__PURE__ */T("tbody",{children:F.map(t=>/* @__PURE__ */L("tr",{onClick:()=>B(t.name),onDoubleClick:()=>{"folder"===t.kind?A(S(U,t.name)):(async t=>{if(P)return;const r=S(U,t.name),a=(t.name.split(".").pop()||"").toLowerCase(),n=W[a];n?await e({filePath:r,filename:t.name,kind:n,onStaged:e=>ce(e)}):xe(t)})(t)},className:"cursor-default border-b border-gray-100 "+(J===t.name?"bg-blue-50":"hover:bg-gray-50"),children:[
81
81
  /* @__PURE__ */L("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-gray-400 shrink-0",strokeWidth:1.5}),
82
82
  /* @__PURE__ */T("span",{className:"truncate",title:t.name,children:t.name})]}),
83
83
  /* @__PURE__ */T("td",{className:"px-3 h-8 text-right tabular-nums text-gray-500",children:"folder"===t.kind?"—":a(t.size)}),
84
- /* @__PURE__ */T("td",{className:"px-3 h-8 text-right text-gray-500 tabular-nums",children:P(t.modifiedAt)}),
85
- /* @__PURE__ */T("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:!O&&/* @__PURE__ */L(E,{children:["file"===t.kind&&/* @__PURE__ */T("button",{onClick:e=>{e.stopPropagation(),xe(t)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-gray-500 text-2xs",children:"Download"}),
86
- /* @__PURE__ */T("button",{onClick:e=>{e.stopPropagation(),(async e=>{const t=await y({title:`Rename ${e.kind}`,defaultValue:e.name,confirmLabel:"Rename"});if(!t||t===e.name)return;if(/[\\/]/.test(t))return void b.error("Names cannot contain slashes");const r=S(I,e.name),a=S(I,t),n=await he(`${F}/api/rename`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:r,to:a})});if(!n.ok){const e=await n.json().catch(()=>({}));return void b.error(e.error||`Rename failed (${n.status})`)}ue(I)})(t)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-gray-500 text-2xs ml-1",children:"Rename"}),
87
- /* @__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=S(I,e.name),r=await he(`${F}/api/files?path=${encodeURIComponent(t)}`,{method:"DELETE"});if(!r.ok){const e=await r.json().catch(()=>({}));return void b.error(e.error||`Delete failed (${r.status})`)}ue(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{F as default};
84
+ /* @__PURE__ */T("td",{className:"px-3 h-8 text-right text-gray-500 tabular-nums",children:O(t.modifiedAt)}),
85
+ /* @__PURE__ */T("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:!P&&/* @__PURE__ */L(R,{children:["file"===t.kind&&/* @__PURE__ */T("button",{onClick:e=>{e.stopPropagation(),xe(t)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-gray-500 text-2xs",children:"Download"}),
86
+ /* @__PURE__ */T("button",{onClick:e=>{e.stopPropagation(),(async e=>{const t=await y({title:`Rename ${e.kind}`,defaultValue:e.name,confirmLabel:"Rename"});if(!t||t===e.name)return;if(/[\\/]/.test(t))return void b.error("Names cannot contain slashes");const r=S(U,e.name),a=S(U,t),n=await he(`${M}/api/rename`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:r,to:a})});if(!n.ok){const e=await n.json().catch(()=>({}));return void b.error(e.error||`Rename failed (${n.status})`)}ue(U)})(t)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-gray-500 text-2xs ml-1",children:"Rename"}),
87
+ /* @__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=S(U,e.name),r=await he(`${M}/api/files?path=${encodeURIComponent(t)}`,{method:"DELETE"});if(!r.ok){const e=await r.json().catch(()=>({}));return void b.error(e.error||`Delete failed (${r.status})`)}ue(U)})(t)},className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Delete"})]})})]},t.name))})]})})]})})}),_&&/* @__PURE__ */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{M as default};