efficient-shell 8.18.1 → 8.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (336) hide show
  1. package/README.md +25 -8
  2. package/dist/{Browser-EE7TUWTN.js → Browser-KK4DSPFA.js} +14 -14
  3. package/dist/Calculator-PH6NVEEZ.js +29 -0
  4. package/dist/{CurrencyConverter-NDMWLX7M.js → CurrencyConverter-PD2CEL6V.js} +8 -8
  5. package/dist/{Documents-XSDBD4T7.js → Documents-QRU3INP2.js} +5 -5
  6. package/dist/Files-NQBM46JA.js +87 -0
  7. package/dist/{Notepad-2SXHFPFX.js → Notepad-KU2VK5QB.js} +10 -10
  8. package/dist/{PdfViewer-456B27TB.js → PdfViewer-GODDA4GG.js} +1 -1
  9. package/dist/{PomodoroTimer-L72X22QZ.js → PomodoroTimer-JEQTTMGA.js} +57 -57
  10. package/dist/{Preview-DJHBCRKW.js → Preview-C6VU5P3N.js} +49 -49
  11. package/dist/Sidebar-SJMMY2Y2.js +43 -0
  12. package/dist/{Spreadsheet-VHFYYFLK.js → Spreadsheet-HLH3EHCX.js} +14 -14
  13. package/dist/{Stock-C3DDF3V3.js → Stock-VCMJMUCW.js} +7 -7
  14. package/dist/{Weather-2XG5AIW2.js → Weather-HF3E3N3M.js} +16 -16
  15. package/dist/{WorldClock-2MU5CFUN.js → WorldClock-PM5CJQSL.js} +6 -6
  16. package/dist/ai/index.js +11 -11
  17. package/dist/apps/index.js +1 -1
  18. package/dist/bin/media-host-check.js +1 -1
  19. package/dist/bin/ui-check.js +1 -1
  20. package/dist/brand.css +1 -1
  21. package/dist/charts/BoxPlotChart.js +1 -1
  22. package/dist/charts/CandlestickChart.js +1 -1
  23. package/dist/charts/CartesianPlot.js +1 -1
  24. package/dist/charts/ChartBrush.js +1 -1
  25. package/dist/charts/ChartFrame.js +1 -1
  26. package/dist/charts/ChartSkeleton.js +1 -1
  27. package/dist/charts/ChordChart.js +1 -1
  28. package/dist/charts/ColumnChart.js +1 -1
  29. package/dist/charts/FunnelChart.js +1 -1
  30. package/dist/charts/HeatmapChart.js +1 -1
  31. package/dist/charts/HistogramChart.js +1 -1
  32. package/dist/charts/Meter.js +1 -1
  33. package/dist/charts/PieChart.js +1 -1
  34. package/dist/charts/RadarChart.js +1 -1
  35. package/dist/charts/RadialBarChart.js +1 -1
  36. package/dist/charts/RangeChart.js +1 -1
  37. package/dist/charts/RankedBars.js +1 -1
  38. package/dist/charts/SankeyChart.js +1 -1
  39. package/dist/charts/ScatterChart.js +1 -1
  40. package/dist/charts/StatTile.js +1 -1
  41. package/dist/charts/SunburstChart.js +1 -1
  42. package/dist/charts/TimeSeriesChart.js +1 -1
  43. package/dist/charts/TreemapChart.js +1 -1
  44. package/dist/charts/WaterfallChart.js +1 -1
  45. package/dist/{chunk-KH6GERFP.js → chunk-2GPXC6JX.js} +1 -1
  46. package/dist/{chunk-WDIFRAQM.js → chunk-2SHDXTB6.js} +4 -4
  47. package/dist/{chunk-QTNPOMXM.js → chunk-36DYXGQI.js} +5 -5
  48. package/dist/{chunk-O5PJELY7.js → chunk-3AVHOYQZ.js} +1 -1
  49. package/dist/{chunk-KW4VUPJV.js → chunk-3KDY6V6I.js} +8 -8
  50. package/dist/{chunk-Z7PS4QUO.js → chunk-3NWCVZRK.js} +6 -6
  51. package/dist/{chunk-JSVYN6D6.js → chunk-3P7SBAKK.js} +1 -1
  52. package/dist/{chunk-YFY2LSWZ.js → chunk-3RM3D2P3.js} +6 -6
  53. package/dist/{chunk-DQEST7MN.js → chunk-3V6UFR7M.js} +1 -1
  54. package/dist/{chunk-2ZIVFBJN.js → chunk-3WM23XSR.js} +6 -6
  55. package/dist/{chunk-TDAFCJY7.js → chunk-47MFBFIX.js} +4 -4
  56. package/dist/{chunk-2YZ3ITNG.js → chunk-4FOTTLL7.js} +2 -2
  57. package/dist/{chunk-BVDGHZ4H.js → chunk-4MTC6HA5.js} +2 -2
  58. package/dist/{chunk-DBBUHXRT.js → chunk-4TER5BHR.js} +1 -1
  59. package/dist/chunk-4YARHVZH.js +6 -0
  60. package/dist/{chunk-3NU2B2WM.js → chunk-55DONELU.js} +9 -9
  61. package/dist/{chunk-F2HM7SV4.js → chunk-5GMWOYTF.js} +1 -1
  62. package/dist/{chunk-EA37JL6P.js → chunk-5JQCPUEO.js} +1 -1
  63. package/dist/{chunk-YGITR6I5.js → chunk-5TVF4BCM.js} +1 -1
  64. package/dist/{chunk-XW56UIDQ.js → chunk-5VUVKP55.js} +6 -6
  65. package/dist/{chunk-NQ46AZ3D.js → chunk-6SBPGUSR.js} +1 -1
  66. package/dist/chunk-6UOMJ7E4.js +2 -0
  67. package/dist/{chunk-4JCNWUVZ.js → chunk-7HTURXIA.js} +2 -2
  68. package/dist/{chunk-A3MOA3T7.js → chunk-7RD623PT.js} +1 -1
  69. package/dist/{chunk-FJUFQXDS.js → chunk-7SPX7DLO.js} +21 -21
  70. package/dist/{chunk-DGTP6BGV.js → chunk-ABD5X73I.js} +1 -1
  71. package/dist/chunk-ABDT4M5L.js +19 -0
  72. package/dist/{chunk-UNDHDLWB.js → chunk-AILWMDWP.js} +1 -1
  73. package/dist/{chunk-HKAWQF7O.js → chunk-AK632G3F.js} +7 -7
  74. package/dist/{chunk-SACUPX6L.js → chunk-AZWEWGYG.js} +3 -3
  75. package/dist/chunk-B36HEVMT.js +28 -0
  76. package/dist/{chunk-ABD34D3N.js → chunk-B5MOPSMW.js} +3 -3
  77. package/dist/{chunk-R6WJ2NTT.js → chunk-BIEKHPZ5.js} +72 -72
  78. package/dist/chunk-BTWEZX3M.js +5 -0
  79. package/dist/chunk-BZWTFLQD.js +15 -0
  80. package/dist/{chunk-LWGNNVDA.js → chunk-CDBS47XI.js} +1 -1
  81. package/dist/{chunk-K2DUF2AR.js → chunk-CHOMUTLT.js} +1 -1
  82. package/dist/{chunk-U5YJREQJ.js → chunk-CIGHIX6Z.js} +10 -10
  83. package/dist/{chunk-P5ILG2DA.js → chunk-CQAXN3HN.js} +1 -1
  84. package/dist/{chunk-QTK5NV7L.js → chunk-CQXKO5PB.js} +1 -1
  85. package/dist/{chunk-6JLZMVVE.js → chunk-CVNM25BM.js} +5 -5
  86. package/dist/{chunk-TPDOOCFS.js → chunk-CY5N5OA3.js} +1 -1
  87. package/dist/{chunk-5WYCXSUM.js → chunk-D6FSZBJ5.js} +1 -1
  88. package/dist/chunk-DAJTVAWO.js +11 -0
  89. package/dist/{chunk-2MMEGCYI.js → chunk-DAV7SMCJ.js} +1 -1
  90. package/dist/{chunk-QCP4F6EF.js → chunk-DBDJQVQM.js} +1 -1
  91. package/dist/{chunk-HBBTB6RW.js → chunk-DBLJIK5J.js} +1 -1
  92. package/dist/{chunk-2VFRVO3N.js → chunk-DCNXCFAD.js} +28 -28
  93. package/dist/{chunk-TSOK3QNK.js → chunk-E2YGQAFU.js} +1 -1
  94. package/dist/{chunk-K5UPORAA.js → chunk-E4O2ZMXF.js} +1 -1
  95. package/dist/{chunk-VSQSBY2P.js → chunk-ENVCMR3M.js} +5 -5
  96. package/dist/{chunk-ZQGPJZY4.js → chunk-EQZAHIUG.js} +2 -2
  97. package/dist/{chunk-Y67ILJVG.js → chunk-EVPOZQOI.js} +1 -1
  98. package/dist/{chunk-WVWIRII2.js → chunk-EXVR3BWW.js} +9 -9
  99. package/dist/{chunk-HIDOSOI4.js → chunk-F22KWATP.js} +1 -1
  100. package/dist/{chunk-AAYACT5T.js → chunk-F4PESM6A.js} +4 -4
  101. package/dist/{chunk-KAELFRN4.js → chunk-F5VXS5JO.js} +1 -1
  102. package/dist/{chunk-EOPPYQIT.js → chunk-FBSQABH2.js} +1 -1
  103. package/dist/{chunk-BG5BCF64.js → chunk-FFZ7KPIV.js} +7 -7
  104. package/dist/{chunk-UB6TIA2R.js → chunk-FOSCSAJZ.js} +1 -1
  105. package/dist/{chunk-NU55QIUV.js → chunk-G3IG4X4Z.js} +1 -1
  106. package/dist/chunk-GSS4E7X3.js +1 -0
  107. package/dist/{chunk-ZVK74ERI.js → chunk-H5GQWWPA.js} +1 -1
  108. package/dist/chunk-H5VGRHNT.js +9 -0
  109. package/dist/chunk-HLGE6TVE.js +4 -0
  110. package/dist/{chunk-HNFLUVVM.js → chunk-HME2P5VX.js} +22 -22
  111. package/dist/chunk-HXJZ46JT.js +1 -0
  112. package/dist/{chunk-37DRDM4D.js → chunk-IGH6DECG.js} +13 -13
  113. package/dist/{chunk-EO2XHSIK.js → chunk-IH4SVMXJ.js} +2 -2
  114. package/dist/{chunk-CG4KTWP4.js → chunk-IM7QHAXT.js} +5 -5
  115. package/dist/{chunk-HQIUFRWO.js → chunk-J324R2BM.js} +1 -1
  116. package/dist/{chunk-I5T3A4KI.js → chunk-J67YIQEN.js} +1 -1
  117. package/dist/chunk-JH4W3R4Q.js +11 -0
  118. package/dist/{chunk-A3R6DKQ5.js → chunk-JJ6IUIYX.js} +1 -1
  119. package/dist/{chunk-7NOU275V.js → chunk-JSB5G2XQ.js} +2 -2
  120. package/dist/{chunk-LDHYCVMV.js → chunk-KATRRQD5.js} +1 -1
  121. package/dist/{chunk-APMBWBD7.js → chunk-KB6BGPQK.js} +1 -1
  122. package/dist/{chunk-MVYOBV4I.js → chunk-KE6NYTGF.js} +2 -2
  123. package/dist/chunk-KKZZAK76.js +1 -0
  124. package/dist/chunk-KS3AQKHD.js +8 -0
  125. package/dist/chunk-KSSIZW3C.js +6 -0
  126. package/dist/{chunk-DTJQHW3Q.js → chunk-KZ6P7WC6.js} +1 -1
  127. package/dist/chunk-LKRQXIOG.js +4 -0
  128. package/dist/{chunk-2QYQDCJE.js → chunk-LMOPRRQY.js} +10 -10
  129. package/dist/chunk-LV2YFFA6.js +6 -0
  130. package/dist/chunk-LYLEH25Y.js +1 -0
  131. package/dist/{chunk-3XLDWJDG.js → chunk-MBXTOYMX.js} +6 -6
  132. package/dist/{chunk-BJGD2ZWK.js → chunk-MQADQ4YF.js} +1 -1
  133. package/dist/{chunk-SGVIMTN6.js → chunk-MRBC7GLE.js} +17 -17
  134. package/dist/{chunk-CGY5RNAF.js → chunk-MVCNSGM4.js} +2 -2
  135. package/dist/{chunk-SLC3KT7F.js → chunk-N7KL336H.js} +6 -6
  136. package/dist/{chunk-NADUURUA.js → chunk-NGVODCMV.js} +1 -1
  137. package/dist/chunk-NI76QOA2.js +2 -0
  138. package/dist/{chunk-GVYJYXVH.js → chunk-NZ67C5OK.js} +10 -10
  139. package/dist/{chunk-2RKTVTJJ.js → chunk-O3HXASSH.js} +1 -1
  140. package/dist/{chunk-HQNR4JQG.js → chunk-O43QLNPL.js} +1 -1
  141. package/dist/{chunk-Q6BY4BME.js → chunk-OAYHU7YN.js} +1 -1
  142. package/dist/{chunk-QMLG5XKP.js → chunk-OHSJWKNV.js} +5 -5
  143. package/dist/{chunk-SS7BG7BS.js → chunk-PXCARPLZ.js} +1 -1
  144. package/dist/{chunk-73FD77RD.js → chunk-Q2S76TZH.js} +1 -1
  145. package/dist/{chunk-KIYO4U4T.js → chunk-Q6YPDR7U.js} +12 -12
  146. package/dist/{chunk-AG3ALTVD.js → chunk-Q75PSCZ5.js} +10 -10
  147. package/dist/{chunk-6EAVTBKE.js → chunk-QKHTL3FQ.js} +4 -4
  148. package/dist/{chunk-LJVLMM3Q.js → chunk-QSPW43OC.js} +7 -7
  149. package/dist/{chunk-ZXI4CWTI.js → chunk-R6L6PKQP.js} +1 -1
  150. package/dist/{chunk-Z3ZIVVKE.js → chunk-RC5SGXXR.js} +1 -1
  151. package/dist/{chunk-LAHK4WVH.js → chunk-RHYMHVFS.js} +8 -8
  152. package/dist/{chunk-MWGVFDEV.js → chunk-RQ5RVKRO.js} +2 -2
  153. package/dist/chunk-RYC3ZHXM.js +8 -0
  154. package/dist/{chunk-JBMGI5YX.js → chunk-RZT7QES5.js} +4 -4
  155. package/dist/{chunk-S2PKTGHB.js → chunk-SIQSD3QT.js} +6 -6
  156. package/dist/chunk-TCB2J3PS.js +9 -0
  157. package/dist/chunk-THPTJGV5.js +8 -0
  158. package/dist/{chunk-JLDGZFNY.js → chunk-TKBP5HRY.js} +12 -12
  159. package/dist/{chunk-RPY7FBYY.js → chunk-U62AWCZR.js} +1 -1
  160. package/dist/{chunk-EFUQ4KAH.js → chunk-UELYZT4T.js} +1 -1
  161. package/dist/{chunk-HKTU536H.js → chunk-UEMGH6EO.js} +1 -1
  162. package/dist/{chunk-FJ72DO6A.js → chunk-UEUCGC6G.js} +1 -1
  163. package/dist/{chunk-HMA4ZSCS.js → chunk-VO3HT6IK.js} +1 -1
  164. package/dist/{chunk-5N6VSOZV.js → chunk-VWVFKMU7.js} +1 -1
  165. package/dist/{chunk-PEEVPAIJ.js → chunk-VXWCX65A.js} +1 -1
  166. package/dist/chunk-VYKITRFG.js +12 -0
  167. package/dist/{chunk-56CQPUIJ.js → chunk-WGSIYW63.js} +14 -14
  168. package/dist/chunk-WMO2JQNL.js +8 -0
  169. package/dist/chunk-X7ZBGXUU.js +1 -0
  170. package/dist/{chunk-WVSLFX37.js → chunk-XBXEK6XP.js} +7 -7
  171. package/dist/{chunk-6MN2JR25.js → chunk-XDAR2DSX.js} +10 -10
  172. package/dist/{chunk-V7NVQ3Z7.js → chunk-XSFQR374.js} +1 -1
  173. package/dist/{chunk-QAR4NYW6.js → chunk-XUK35DKG.js} +1 -1
  174. package/dist/{chunk-USE4HNZ2.js → chunk-XXBGWT7L.js} +1 -1
  175. package/dist/chunk-Y2P5HTP5.js +4 -0
  176. package/dist/{chunk-I74FRKHQ.js → chunk-Y65MPP3M.js} +1 -1
  177. package/dist/chunk-YKDKVSAL.js +4 -0
  178. package/dist/{chunk-4NB3WHWK.js → chunk-YUIWG2QT.js} +1 -1
  179. package/dist/{chunk-4S724CEA.js → chunk-YZCRHDOB.js} +1 -1
  180. package/dist/{chunk-V5GDA4I6.js → chunk-Z6V3EY6F.js} +3 -3
  181. package/dist/{chunk-UJULZQM2.js → chunk-ZDJNTOUS.js} +1 -1
  182. package/dist/{chunk-ZVY4J3PU.js → chunk-ZLHF5XRR.js} +7 -7
  183. package/dist/{chunk-MPN267PR.js → chunk-ZNZDV6SN.js} +1 -1
  184. package/dist/data/DataTable.js +1 -1
  185. package/dist/data/Kanban.js +1 -1
  186. package/dist/data/ListFooter.js +1 -1
  187. package/dist/data/ListLoadError.js +1 -1
  188. package/dist/data/Pagination.js +1 -1
  189. package/dist/file-intake/index.js +1 -1
  190. package/dist/forms/BorderInput.js +1 -1
  191. package/dist/forms/BrandAssetEditor.js +1 -1
  192. package/dist/forms/Calendar.js +1 -1
  193. package/dist/forms/ColorPicker.js +1 -1
  194. package/dist/forms/ComposerAttachments.js +1 -1
  195. package/dist/forms/CornersInput.js +1 -1
  196. package/dist/forms/DatePicker.js +1 -1
  197. package/dist/forms/DateRangePicker.js +1 -1
  198. package/dist/forms/DateTimePicker.js +1 -1
  199. package/dist/forms/DisplayChips.js +1 -1
  200. package/dist/forms/FilePicker.js +1 -1
  201. package/dist/forms/FormErrorSummary.js +1 -1
  202. package/dist/forms/IconPicker.js +1 -1
  203. package/dist/forms/ImageFocusPoint.js +1 -1
  204. package/dist/forms/InputNumber.js +1 -1
  205. package/dist/forms/LinkPicker.js +1 -1
  206. package/dist/forms/MediaUploadField.js +1 -1
  207. package/dist/forms/MediaUploadGrid.js +1 -1
  208. package/dist/forms/MediaUsedInList.js +1 -1
  209. package/dist/forms/NumericKeypad.js +1 -1
  210. package/dist/forms/PositionInput.js +1 -1
  211. package/dist/forms/Select.d.ts +1 -1
  212. package/dist/forms/Select.js +1 -1
  213. package/dist/forms/SidesInput.js +1 -1
  214. package/dist/forms/Slider.js +1 -1
  215. package/dist/forms/Snippet.js +1 -1
  216. package/dist/forms/TagInput.js +1 -1
  217. package/dist/forms/TextToolbar.js +1 -1
  218. package/dist/forms/TimePicker.js +1 -1
  219. package/dist/forms/WidthsBar.js +1 -1
  220. package/dist/forms/mediaMoveItems.js +1 -1
  221. package/dist/forms/useFileIntake.js +1 -1
  222. package/dist/icons/efficient-glyphs.d.ts +2 -0
  223. package/dist/icons/efficient-glyphs.js +1 -1
  224. package/dist/icons/efficient-looks.d.ts +4 -0
  225. package/dist/icons/efficient-looks.js +1 -1
  226. package/dist/icons/efficient-meanings.d.ts +2 -0
  227. package/dist/icons/efficient-meanings.js +1 -1
  228. package/dist/icons/efficient.d.ts +2 -0
  229. package/dist/icons/efficient.js +1 -1
  230. package/dist/icons/glyphs/DetachIcon.d.ts +8 -0
  231. package/dist/icons/glyphs/DetachIcon.js +1 -0
  232. package/dist/icons/glyphs/SharedIcon.d.ts +8 -0
  233. package/dist/icons/glyphs/SharedIcon.js +1 -0
  234. package/dist/icons/index.d.ts +2 -2
  235. package/dist/icons/index.js +1 -1
  236. package/dist/icons/looks/DetachMiniIcon.d.ts +8 -0
  237. package/dist/icons/looks/DetachMiniIcon.js +1 -0
  238. package/dist/icons/looks/DetachSolidIcon.d.ts +8 -0
  239. package/dist/icons/looks/DetachSolidIcon.js +1 -0
  240. package/dist/icons/looks/SharedMiniIcon.d.ts +8 -0
  241. package/dist/icons/looks/SharedMiniIcon.js +1 -0
  242. package/dist/icons/looks/SharedSolidIcon.d.ts +8 -0
  243. package/dist/icons/looks/SharedSolidIcon.js +1 -0
  244. package/dist/icons/looks/map.js +1 -1
  245. package/dist/icons/sets.js +1 -1
  246. package/dist/index.d.ts +17 -2
  247. package/dist/index.js +695 -695
  248. package/dist/locales/zh-Hans.js +1 -1
  249. package/dist/map/index.js +2 -2
  250. package/dist/{names-DcR-HlYV.d.ts → names-DYWfNBkN.d.ts} +1 -1
  251. package/dist/page-tabs/index.js +4 -4
  252. package/dist/pdf/index.js +1 -1
  253. package/dist/shell/Accordion.js +1 -1
  254. package/dist/shell/AppUpdateBanner.js +1 -1
  255. package/dist/shell/Avatar.js +1 -1
  256. package/dist/shell/Banner.js +1 -1
  257. package/dist/shell/Breadcrumbs.js +1 -1
  258. package/dist/shell/BudgetBar.js +1 -1
  259. package/dist/shell/Card.js +1 -1
  260. package/dist/shell/ColoredBadge.js +1 -1
  261. package/dist/shell/ConfirmDialog.js +1 -1
  262. package/dist/shell/ContainerFillChart.js +1 -1
  263. package/dist/shell/CountBadge.js +1 -1
  264. package/dist/shell/Dialog.js +1 -1
  265. package/dist/shell/Drawer.js +1 -1
  266. package/dist/shell/EditableGrid.js +1 -1
  267. package/dist/shell/EmptyState.js +1 -1
  268. package/dist/shell/GlobalSearch.js +1 -1
  269. package/dist/shell/HelpCenter.js +1 -1
  270. package/dist/shell/IconRail.js +1 -1
  271. package/dist/shell/ImageLightbox.js +1 -1
  272. package/dist/shell/LanguageSelect.js +1 -1
  273. package/dist/shell/Markdown.js +1 -1
  274. package/dist/shell/MetricBar.js +1 -1
  275. package/dist/shell/MetricBarLegend.js +1 -1
  276. package/dist/shell/MilestoneTimeline.js +1 -1
  277. package/dist/shell/PageHeader.js +1 -1
  278. package/dist/shell/ProductionTimeline.js +1 -1
  279. package/dist/shell/ResizeHandle.js +1 -1
  280. package/dist/shell/Result.js +1 -1
  281. package/dist/shell/SearchableSelect.js +1 -1
  282. package/dist/shell/SettingReset.js +1 -1
  283. package/dist/shell/SettingRow.js +1 -1
  284. package/dist/shell/SidebarLayout.js +1 -1
  285. package/dist/shell/SidebarNav.js +1 -1
  286. package/dist/shell/SortableList.js +1 -1
  287. package/dist/shell/Statistic.js +1 -1
  288. package/dist/shell/TimeAgo.js +1 -1
  289. package/dist/shell/TimelineTrack.js +1 -1
  290. package/dist/shell/TransferProgress.js +1 -1
  291. package/dist/shell/Tree.d.ts +10 -1
  292. package/dist/shell/Tree.js +1 -1
  293. package/dist/shell/language.js +1 -1
  294. package/dist/shell/strings.d.ts +3 -0
  295. package/dist/shell/strings.js +1 -1
  296. package/dist/shell/toast.js +1 -1
  297. package/dist/telemetry/index.js +1 -1
  298. package/dist/templates/AuthScreen.js +1 -1
  299. package/dist/templates/ChatTemplate.js +1 -1
  300. package/dist/templates/CheckoutTemplate.js +1 -1
  301. package/dist/templates/DashboardTemplate.js +1 -1
  302. package/dist/templates/DataTablePage.js +1 -1
  303. package/dist/templates/EmailTemplate.js +1 -1
  304. package/dist/templates/ErrorBoundary.js +1 -1
  305. package/dist/templates/ErrorPage.js +1 -1
  306. package/dist/templates/FormLayoutPage.js +1 -1
  307. package/dist/templates/GalleryTemplate.js +1 -1
  308. package/dist/ui/index.d.ts +1 -1
  309. package/dist/ui/index.js +1 -1
  310. package/dist/version.js +1 -1
  311. package/package.json +1 -1
  312. package/dist/Calculator-YTIRFXXR.js +0 -29
  313. package/dist/Files-B5HKRQN3.js +0 -87
  314. package/dist/Sidebar-YCSGGCLW.js +0 -43
  315. package/dist/chunk-7GCBMTP2.js +0 -4
  316. package/dist/chunk-B6BE4WSP.js +0 -8
  317. package/dist/chunk-BE4APEUI.js +0 -2
  318. package/dist/chunk-CKDFXYYY.js +0 -8
  319. package/dist/chunk-EUFALBK3.js +0 -1
  320. package/dist/chunk-F6RM7RLQ.js +0 -1
  321. package/dist/chunk-FNQJO3HZ.js +0 -11
  322. package/dist/chunk-FTQ5DH5U.js +0 -8
  323. package/dist/chunk-GTRUBA2R.js +0 -1
  324. package/dist/chunk-GVKFLNRP.js +0 -12
  325. package/dist/chunk-MNQ6EPAR.js +0 -9
  326. package/dist/chunk-QSVKEONU.js +0 -2
  327. package/dist/chunk-QYGBWH5J.js +0 -15
  328. package/dist/chunk-R362N2RJ.js +0 -1
  329. package/dist/chunk-SXPBOX32.js +0 -1
  330. package/dist/chunk-VKLVHULL.js +0 -22
  331. package/dist/chunk-W4YNYZDQ.js +0 -6
  332. package/dist/chunk-WEJFTUS7.js +0 -9
  333. package/dist/chunk-YULJ7F6Z.js +0 -19
  334. package/dist/chunk-ZGCLFQS5.js +0 -8
  335. package/dist/chunk-ZWQRFYE6.js +0 -11
  336. /package/dist/{chunk-A6L6FYG4.js → chunk-WYHRPXEX.js} +0 -0
package/README.md CHANGED
@@ -277,10 +277,24 @@ values predate the labels and are kept so nobody's choice resets).
277
277
  Copies of a page are separate tabs, utility apps float over the page, and
278
278
  dialogs a window opens stay above their own tab. Widgets belong on the
279
279
  wallpaper, so they hide while a tab covers it and come back when no tab is
280
- on screen. The user's favourite apps (`favorite_pages`, the taskbar's
281
- favourites) are icons after the Home tab; an open one has no icon, its tab
282
- leads the tabs with a star after its title, the one opened last at the far
283
- left, and closing it brings the icon back. Esc does not
280
+ on screen.
281
+
282
+ The tabs are in the user's order. A tab drags to a new place (or moves with
283
+ Ctrl/⌘ + Shift + ← / → while it has focus), and the session keeps the
284
+ order. A new tab opens right of the tab it was opened from, after the ones
285
+ already opened from it; anything else opens at the end. Tabs of one family
286
+ are **grouped** by the taskbar's rule (a page's `taskbarGroup`, else its
287
+ route — a record files under the list route it was opened with): they sit
288
+ side by side under a chip naming the group, with a line along their foot.
289
+ The chip folds the group to the chip and its tab on screen, and drags the
290
+ whole group; a grouped tab drags only within its group, and nothing is
291
+ dropped inside another group (it lands beside it). A new member of a group
292
+ joins its end, wherever it was opened from.
293
+
294
+ The user's favourite apps (`favorite_pages`, the taskbar's favourites) are
295
+ icons after the Home tab; an open one has no icon, its tab carries a star
296
+ after its title and opens first (after a Home tab that is still first), and
297
+ closing it brings the icon back. Esc does not
284
298
  close a tab. ⌘K also finds pages by name, which is what the rail's search
285
299
  box opens.
286
300
 
@@ -290,15 +304,18 @@ returns to the box it had there. The switch is one click from either side —
290
304
  right-click menu, **Switch to Desktop** in the rail's account menu — and
291
305
  `useSetLayoutMode()` is the same switch for a host's own control.
292
306
 
293
- `home` (a page route) gives the Sidebar layout a pinned, icon-only first tab
294
- that stays open, as the routed portals' Dashboard tab does:
307
+ `home` (a page route) gives the Sidebar layout an icon-only tab that stays
308
+ open, as the routed portals' Dashboard tab does. It opens first; after that
309
+ the user can drag it like any other tab:
295
310
 
296
311
  ```tsx
297
312
  <Layout navSections={navSections} navIcons={navIcons} home="/" />
298
313
  ```
299
314
 
300
- The shell opens it behind the other windows, never saves it with the session,
301
- and closes it on the way back to the desktop. A route the registry does not
315
+ The shell opens it behind the other windows and closes it on the way back to
316
+ the desktop. The session saves only its place among the tabs (a
317
+ `session_windows` ref with `shell: true`), and the restore puts it back there
318
+ when the same `home` is the Home tab again. A route the registry does not
302
319
  hold, a widget or a utility app is ignored. Phones get the mobile landing in
303
320
  either layout.
304
321
 
@@ -1,29 +1,29 @@
1
- import{peekBrowserStartUrl as e,claimBrowserStartUrl as t}from"./chunk-LWLCNQY7.js";import{AboutApp as o}from"./chunk-ZQGPJZY4.js";import{WindowTitle as r}from"./chunk-R6WJ2NTT.js";import"./chunk-TPDOOCFS.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-SS7BG7BS.js";import"./chunk-Y53KNQKL.js";import"./chunk-5A7MWTXX.js";import"./chunk-O5PJELY7.js";import{confirm as n}from"./chunk-SGVIMTN6.js";import"./chunk-CGY5RNAF.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-KC3EX26K.js";import"./chunk-UPHXYWL6.js";import"./chunk-5QFPTDQF.js";import"./chunk-LWGNNVDA.js";import"./chunk-UGTRSRIW.js";import"./chunk-QR4RM7PO.js";import"./chunk-5SULG7D5.js";import"./chunk-CDAJKLGL.js";import"./chunk-7T3COEQK.js";import"./chunk-EUFALBK3.js";import"./chunk-UDD7GB4F.js";import"./chunk-K7U4RWXJ.js";import"./chunk-4TL3MRRE.js";import{Icon as a}from"./chunk-42BBJJDP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-2LXTJXWC.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-GTRUBA2R.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,T]=l(0),[D,U]=l(x),[G,J]=l(!1),[E,K]=l(null),P=s(null),B=s(null);i(()=>{try{localStorage.setItem(d,JSON.stringify(D))}catch{}},[D]);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),J(!1))},O=()=>{"undefined"!=typeof window&&window.open(f,"_blank","noopener,noreferrer")},Q=()=>{const e=E?.trim();e?(U(t=>[...t,{label:e,url:f}]),K(null)):K(null)};i(()=>{if(null===E)return;P.current?.focus(),P.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||K(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==E]);const A=e=>{U(t=>t.filter((t,o)=>o!==e))},F=z>0,H=z<R.length-1,X=D.some(e=>e.url===f),I="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-EQZAHIUG.js";import{WindowTitle as r}from"./chunk-BIEKHPZ5.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PXCARPLZ.js";import"./chunk-Y53KNQKL.js";import"./chunk-5A7MWTXX.js";import"./chunk-3AVHOYQZ.js";import{confirm as n}from"./chunk-MRBC7GLE.js";import"./chunk-MVCNSGM4.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-KC3EX26K.js";import"./chunk-UPHXYWL6.js";import"./chunk-5QFPTDQF.js";import"./chunk-CDBS47XI.js";import"./chunk-UGTRSRIW.js";import"./chunk-QR4RM7PO.js";import"./chunk-5SULG7D5.js";import"./chunk-CDAJKLGL.js";import"./chunk-7T3COEQK.js";import"./chunk-LYLEH25Y.js";import"./chunk-UDD7GB4F.js";import"./chunk-K7U4RWXJ.js";import"./chunk-4TL3MRRE.js";import{Icon as a}from"./chunk-42BBJJDP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-2LXTJXWC.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-KKZZAK76.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]),[L,z]=l(0),[D,E]=l(0),[S,U]=l(x),[K,T]=l(!1),[G,H]=l(null),J=s(null),M=s(null);i(()=>{try{localStorage.setItem(d,JSON.stringify(S))}catch{}},[S]);const P=e=>{const t=k(e);t&&(y(t),C(t),W(e=>{const o=e.slice(0,L+1);return o.push(t),o}),z(e=>e+1),T(!1))},Q=()=>{"undefined"!=typeof window&&window.open(f,"_blank","noopener,noreferrer")},A=()=>{const e=G?.trim();e?(U(t=>[...t,{label:e,url:f}]),H(null)):H(null)};i(()=>{if(null===G)return;J.current?.focus(),J.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!==G]);const B=e=>{U(t=>t.filter((t,o)=>o!==e))},O=L>0,X=L<R.length-1,I=S.some(e=>e.url===f),Y="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(R[e]),C(R[e]),J(!1)}},disabled:!F,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]),J(!1)}},disabled:!H,className:I,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: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:[
6
+ /* @__PURE__ */m("button",{onClick:()=>{if(L>0){const e=L-1;z(e),y(R[e]),C(R[e]),T(!1)}},disabled:!O,className:Y,title:"Back",children:/* @__PURE__ */m(a,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
+ /* @__PURE__ */m("button",{onClick:()=>{if(L<R.length-1){const e=L+1;z(e),y(R[e]),C(R[e]),T(!1)}},disabled:!X,className:Y,title:"Forward",children:/* @__PURE__ */m(a,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
+ /* @__PURE__ */m("button",{onClick:()=>E(e=>e+1),className:Y,title:"Refresh",children:/* @__PURE__ */m(a,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
+ /* @__PURE__ */m("button",{onClick:()=>P(g),className:Y,title:"Home",children:/* @__PURE__ */m(a,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
+ /* @__PURE__ */m("form",{onSubmit:e=>{e.preventDefault(),P(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:()=>X?A(D.findIndex(e=>e.url===f)):void K(v(f)),className:I+" "+(X?"text-yellow-500":""),title:X?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */m(a,{name:"star",className:"h-4 w-4",fill:X?"currentColor":"none",strokeWidth:1.5})}),
14
- /* @__PURE__ */m("button",{onClick:O,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:()=>J(e=>!e),className:I,title:"Embedding help",children:/* @__PURE__ */m(a,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==E&&/* @__PURE__ */c("div",{"data-bookmark-popover":!0,className:"absolute right-3 top-12 z-30 w-72 bg-white border border-gray-200 rounded-md shadow-lg p-3",children:[
13
+ /* @__PURE__ */m("button",{"data-bookmark-popover":!0,onClick:()=>I?B(S.findIndex(e=>e.url===f)):void H(v(f)),className:Y+" "+(I?"text-yellow-500":""),title:I?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */m(a,{name:"star",className:"h-4 w-4",fill:I?"currentColor":"none",strokeWidth:1.5})}),
14
+ /* @__PURE__ */m("button",{onClick:Q,className:Y,title:"Open in new tab",children:/* @__PURE__ */m(a,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
15
+ /* @__PURE__ */m("button",{onClick:()=>T(e=>!e),className:Y,title:"Embedding help",children:/* @__PURE__ */m(a,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==G&&/* @__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:P,type:"text",value:E,onChange:e=>K(e.target.value),onKeyDown:e=>{"Enter"===e.key?Q():"Escape"===e.key&&K(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:J,type:"text",value:G,onChange:e=>H(e.target.value),onKeyDown:e=>{"Enter"===e.key?A():"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"}),
19
19
  /* @__PURE__ */c("div",{className:"flex justify-end gap-1 mt-2",children:[
20
- /* @__PURE__ */m("button",{onClick:()=>K(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:!E.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===D.length&&/* @__PURE__ */m("span",{className:"text-2xs text-gray-400 italic px-2",children:"No bookmarks yet — star the address bar to add one."}),D.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"})&&A(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:()=>H(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
21
+ /* @__PURE__ */m("button",{onClick:A,disabled:!G.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:()=>P(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"})&&B(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:S,iframeRef:B,openExternal:O,showHelp:G,dismissHelp:()=>J(!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:D,iframeRef:M,openExternal:Q,showHelp:K,dismissHelp:()=>T(!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-R6L6PKQP.js";import{useWidgetSettings as n}from"./chunk-BIEKHPZ5.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PXCARPLZ.js";import"./chunk-Y53KNQKL.js";import"./chunk-5A7MWTXX.js";import"./chunk-3AVHOYQZ.js";import"./chunk-MRBC7GLE.js";import"./chunk-MVCNSGM4.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-KC3EX26K.js";import"./chunk-UPHXYWL6.js";import"./chunk-5QFPTDQF.js";import"./chunk-CDBS47XI.js";import"./chunk-UGTRSRIW.js";import"./chunk-QR4RM7PO.js";import"./chunk-5SULG7D5.js";import"./chunk-CDAJKLGL.js";import"./chunk-7T3COEQK.js";import"./chunk-UDD7GB4F.js";import"./chunk-K7U4RWXJ.js";import"./chunk-4TL3MRRE.js";import{Icon as r}from"./chunk-42BBJJDP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-2LXTJXWC.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-KKZZAK76.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),[W,E]=c(()=>e(h)),[R,T]=c(!1),[D,K]=c(W),L=i(null);n(l(()=>{K({...W}),T(!0)},[W]));const w=l(e=>{C(""),k(t=>j||"0"===t?(N(!1),"."===e?"0.":e):"."===e&&t.includes(".")?t:t+e)},[j]),J=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}},[]),A=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]),B=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]),M=l(()=>{k(e=>String(parseFloat(e)/100))},[]),P=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"?w(e.key):"."===e.key?w("."):"+"===e.key?A("+"):"-"===e.key?A("-"):"*"===e.key?A("×"):"/"===e.key?(e.preventDefault(),A("÷")):"Enter"===e.key||"="===e.key?("Enter"===e.key&&e.target instanceof Node&&L.current?.contains(e.target)&&e.preventDefault(),B()):"Escape"===e.key?J():"Backspace"===e.key?k(e=>e.length>1?e.slice(0,-1):"0"):"%"===e.key&&M())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[w,A,B,J,M]);const Q="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",U=`${Q} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,G=`${Q} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,X=`${Q} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,F=`${Q} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
2
+ return s(a,{children:[
3
+ /* @__PURE__ */s("div",{ref:L,className:"flex flex-col h-full",style:{opacity:W.activeOpacity/100,backdropFilter:W.activeBlur>0?`blur(${W.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:J,className:X,children:"AC"}),
11
+ /* @__PURE__ */u("button",{onClick:P,className:X,children:"+/−"}),
12
+ /* @__PURE__ */u("button",{onClick:M,className:X,children:"%"}),
13
+ /* @__PURE__ */u("button",{onClick:()=>A("÷"),className:`${G} ${"÷"===b?"ring-2 ring-blue-400":""}`,children:"÷"}),
14
+ /* @__PURE__ */u("button",{onClick:()=>w("7"),className:U,children:"7"}),
15
+ /* @__PURE__ */u("button",{onClick:()=>w("8"),className:U,children:"8"}),
16
+ /* @__PURE__ */u("button",{onClick:()=>w("9"),className:U,children:"9"}),
17
+ /* @__PURE__ */u("button",{onClick:()=>A("×"),className:`${G} ${"×"===b?"ring-2 ring-blue-400":""}`,children:"×"}),
18
+ /* @__PURE__ */u("button",{onClick:()=>w("4"),className:U,children:"4"}),
19
+ /* @__PURE__ */u("button",{onClick:()=>w("5"),className:U,children:"5"}),
20
+ /* @__PURE__ */u("button",{onClick:()=>w("6"),className:U,children:"6"}),
21
+ /* @__PURE__ */u("button",{onClick:()=>A("-"),className:`${G} ${"-"===b?"ring-2 ring-blue-400":""}`,children:"−"}),
22
+ /* @__PURE__ */u("button",{onClick:()=>w("1"),className:U,children:"1"}),
23
+ /* @__PURE__ */u("button",{onClick:()=>w("2"),className:U,children:"2"}),
24
+ /* @__PURE__ */u("button",{onClick:()=>w("3"),className:U,children:"3"}),
25
+ /* @__PURE__ */u("button",{onClick:()=>A("+"),className:`${G} ${"+"===b?"ring-2 ring-blue-400":""}`,children:"+"}),
26
+ /* @__PURE__ */u("button",{onClick:()=>w("0"),className:`${U} col-span-2`,children:"0"}),
27
+ /* @__PURE__ */u("button",{onClick:()=>w("."),className:U,children:"."}),
28
+ /* @__PURE__ */u("button",{onClick:B,className:F,children:"="})]})]}),
29
+ /* @__PURE__ */u(t,{open:R,onClose:()=>T(!1),title:"Calculator Settings",appearance:D,onAppearanceChange:K,onSave:()=>{E(D),localStorage.setItem(h,JSON.stringify(D)),T(!1)}})]})}export{m as default};
@@ -1,4 +1,4 @@
1
- import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-ZXI4CWTI.js";import{useWidgetSettings as r}from"./chunk-R6WJ2NTT.js";import"./chunk-TPDOOCFS.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-SS7BG7BS.js";import"./chunk-Y53KNQKL.js";import"./chunk-5A7MWTXX.js";import"./chunk-O5PJELY7.js";import"./chunk-SGVIMTN6.js";import"./chunk-CGY5RNAF.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-KC3EX26K.js";import"./chunk-UPHXYWL6.js";import"./chunk-5QFPTDQF.js";import"./chunk-LWGNNVDA.js";import"./chunk-UGTRSRIW.js";import"./chunk-QR4RM7PO.js";import"./chunk-5SULG7D5.js";import"./chunk-CDAJKLGL.js";import"./chunk-7T3COEQK.js";import"./chunk-UDD7GB4F.js";import"./chunk-K7U4RWXJ.js";import"./chunk-4TL3MRRE.js";import"./chunk-42BBJJDP.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as n}from"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-2LXTJXWC.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-GTRUBA2R.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),[J,R]=s([]),[U,B]=s(j),[G,T]=s("USD"),[W,L]=s("CNY");r(a(()=>{R([...u]),B({...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-R6L6PKQP.js";import{useWidgetSettings as r}from"./chunk-BIEKHPZ5.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PXCARPLZ.js";import"./chunk-Y53KNQKL.js";import"./chunk-5A7MWTXX.js";import"./chunk-3AVHOYQZ.js";import"./chunk-MRBC7GLE.js";import"./chunk-MVCNSGM4.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-KC3EX26K.js";import"./chunk-UPHXYWL6.js";import"./chunk-5QFPTDQF.js";import"./chunk-CDBS47XI.js";import"./chunk-UGTRSRIW.js";import"./chunk-QR4RM7PO.js";import"./chunk-5SULG7D5.js";import"./chunk-CDAJKLGL.js";import"./chunk-7T3COEQK.js";import"./chunk-UDD7GB4F.js";import"./chunk-K7U4RWXJ.js";import"./chunk-4TL3MRRE.js";import"./chunk-42BBJJDP.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as n}from"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-2LXTJXWC.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-KKZZAK76.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),[R,J]=s([]),[U,B]=s(j),[K,L]=s("USD"),[P,A]=s("CNY");r(a(()=>{J([...u]),B({...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:U,onAppearanceChange:B,onSave:()=>{if(0===J.length)return;const t=J.slice(0,4);d(t),y(U),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(U)),C(!1)},children:/* @__PURE__ */c("div",{children:[
12
+ /* @__PURE__ */l(e,{open:C,onClose:()=>v(!1),title:"Currency Settings",appearance:U,onAppearanceChange:B,onSave:()=>{if(0===R.length)return;const t=R.slice(0,4);d(t),y(U),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(U)),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:["(",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:[
14
+ /* @__PURE__ */c("span",{className:"text-2xs font-normal text-gray-400",children:["(",R.length,"/",4,")"]})]}),
15
+ /* @__PURE__ */l("div",{className:"space-y-1 mb-2",children:R.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:()=>R(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:G,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:()=>J(t=>t.filter((t,e)=>e!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),R.length<4?/* @__PURE__ */c("div",{className:"flex items-center gap-2",children:[
18
+ /* @__PURE__ */l("select",{value:K,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))}),
19
19
  /* @__PURE__ */l("span",{className:"text-gray-400",children:"→"}),
20
- /* @__PURE__ */l("select",{value:W,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:()=>{G!==W&&J.length<4&&R(t=>[...t,[G,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:P,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!==P&&R.length<4&&J(t=>[...t,[K,P]])},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,8 +1,8 @@
1
- import{escapeHtml as e}from"./chunk-BR22X7E5.js";import{AboutApp as t}from"./chunk-ZQGPJZY4.js";import{WindowTitle as n}from"./chunk-R6WJ2NTT.js";import"./chunk-TPDOOCFS.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-SS7BG7BS.js";import"./chunk-Y53KNQKL.js";import"./chunk-5A7MWTXX.js";import"./chunk-O5PJELY7.js";import"./chunk-SGVIMTN6.js";import"./chunk-CGY5RNAF.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-KC3EX26K.js";import{toast_default as r}from"./chunk-HIDOSOI4.js";import{PopupMenu as o,PopupMenuLabel as i,PopupMenuItem as l,PopupMenuDivider as a}from"./chunk-UPHXYWL6.js";import"./chunk-5QFPTDQF.js";import"./chunk-LWGNNVDA.js";import"./chunk-UGTRSRIW.js";import"./chunk-QR4RM7PO.js";import"./chunk-5SULG7D5.js";import"./chunk-CDAJKLGL.js";import"./chunk-7T3COEQK.js";import"./chunk-EUFALBK3.js";import"./chunk-UDD7GB4F.js";import"./chunk-K7U4RWXJ.js";import"./chunk-4TL3MRRE.js";import{Icon as s}from"./chunk-42BBJJDP.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as c}from"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-2LXTJXWC.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-GTRUBA2R.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),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=>{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-EQZAHIUG.js";import{WindowTitle as n}from"./chunk-BIEKHPZ5.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PXCARPLZ.js";import"./chunk-Y53KNQKL.js";import"./chunk-5A7MWTXX.js";import"./chunk-3AVHOYQZ.js";import"./chunk-MRBC7GLE.js";import"./chunk-MVCNSGM4.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-KC3EX26K.js";import{toast_default as r}from"./chunk-F22KWATP.js";import{PopupMenu as o,PopupMenuLabel as i,PopupMenuItem as l,PopupMenuDivider as a}from"./chunk-UPHXYWL6.js";import"./chunk-5QFPTDQF.js";import"./chunk-CDBS47XI.js";import"./chunk-UGTRSRIW.js";import"./chunk-QR4RM7PO.js";import"./chunk-5SULG7D5.js";import"./chunk-CDAJKLGL.js";import"./chunk-7T3COEQK.js";import"./chunk-LYLEH25Y.js";import"./chunk-UDD7GB4F.js";import"./chunk-K7U4RWXJ.js";import"./chunk-4TL3MRRE.js";import{Icon as s}from"./chunk-42BBJJDP.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as c}from"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-2LXTJXWC.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-KKZZAK76.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,C]=m(!1),[N,D]=m(null),L=d(null),M=d(null),R=d(null),U=(e,t)=>{R.current?.focus(),document.execCommand(e,!1,t),C(!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)),C(!0)},e.readAsDataURL(t)}},T=e=>{N&&(N.el.removeAttribute("width"),N.el.removeAttribute("height"),N.el.style.width=e??"",N.el.style.height=e?"auto":"",C(!0),D(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}),C(!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?(S=f.filename).length>24?`${S.slice(0,23)}…`:S:"Untitled";var S;/* @__PURE__ */
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}),C(!1)}catch(e){r.error('Install the optional "mammoth" peer dep to read .docx files.')}else"doc"===n?r.error(".doc is the legacy Word binary format — convert to .docx first."):r.error(`Unsupported file type: .${n||"unknown"}`)}finally{v(!1)}},A=f?.filename?(O=f.filename).length>24?`${O.slice(0,23)}…`:O:"Untitled";var O;/* @__PURE__ */
4
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`}),
5
+ /* @__PURE__ */u(n,{title:`${A}${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
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"}),
@@ -41,7 +41,7 @@ return h("div",{className:"relative flex flex-col h-full",onDragOver:e=>{e.preve
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: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(),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:()=>C(!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"})}),N&&/* @__PURE__ */h(o,{minWidth:150,style:{left:N.x,top:N.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:()=>{N?.el.remove(),C(!0),D(null)},children:"Remove image"})]})]})}export{f as default};
@@ -0,0 +1,87 @@
1
+ import{openPreviewFile as e}from"./chunk-U62AWCZR.js";import{SidebarLayout as t}from"./chunk-3RM3D2P3.js";import"./chunk-QWK6DRSN.js";import"./chunk-JSB5G2XQ.js";import{Breadcrumbs as r}from"./chunk-4TER5BHR.js";import{formatBytes as a}from"./chunk-X2S2XDZI.js";import"./chunk-5OTS2G3M.js";import"./chunk-36BRD5J3.js";import{getFilesDemoTree as n}from"./chunk-DBLJIK5J.js";import{AboutApp as s}from"./chunk-EQZAHIUG.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-4MTC6HA5.js";import"./chunk-ESL5TDNA.js";import"./chunk-VTVSMRFX.js";import{useWindowManager as f,WindowTitle as x}from"./chunk-BIEKHPZ5.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PXCARPLZ.js";import"./chunk-Y53KNQKL.js";import"./chunk-5A7MWTXX.js";import"./chunk-3AVHOYQZ.js";import{confirm as g,prompt as y}from"./chunk-MRBC7GLE.js";import"./chunk-MVCNSGM4.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-KC3EX26K.js";import{toast_default as b}from"./chunk-F22KWATP.js";import"./chunk-UPHXYWL6.js";import"./chunk-5QFPTDQF.js";import"./chunk-CDBS47XI.js";import"./chunk-UGTRSRIW.js";import"./chunk-QR4RM7PO.js";import"./chunk-5SULG7D5.js";import"./chunk-CDAJKLGL.js";import{TH_ONE_LINE as k}from"./chunk-7T3COEQK.js";import"./chunk-LYLEH25Y.js";import"./chunk-UDD7GB4F.js";import"./chunk-K7U4RWXJ.js";import"./chunk-4TL3MRRE.js";import{Icon as N}from"./chunk-42BBJJDP.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as w}from"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-2LXTJXWC.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-KKZZAK76.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 P(e,t){return"/"===e||""===e?"/"+t:e.replace(/\/$/,"")+"/"+t}function S(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(/\/$/,""),A=null!==n(),[U,I]=v("/"),[F,O]=v([]),[J,K]=v([]),[B,Q]=v(null),[V,G]=v(!0),[H,X]=v(!1),[z,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(Q(null),A){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 O(t),I(e),X(!1),G(!1),void("/"===e&&K(t.filter(e=>"folder"===e.kind).map(e=>e.name)))}G(!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||[];O(a),I(r.path||e),X(!1),"/"===(r.path||e)&&K(a.filter(e=>"folder"===e.kind).map(e=>e.name))}catch(e){X(!0)}finally{G(!1)}pe()},[he,M,pe,A]),fe=D(async()=>{if(A)return re([]),void G(!1);G(!0),Q(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||[]),X(!1)}catch{X(!0)}finally{G(!1)}pe()},[he,M,pe,A]);j(()=>{"files"===q?ue(U):"trash"===q&&fe()},[U,q]);const xe=async e=>{const t=P(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,_(!1)};if(j(()=>{const e=()=>ye();return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[]),H)/* @__PURE__ */
2
+ return L("div",{className:"flex flex-col h-full bg-white",children:[
3
+ /* @__PURE__ */T(x,{title:"Files - offline"}),
4
+ /* @__PURE__ */T("div",{className:"flex-1 flex items-center justify-center p-8 text-center",children:/* @__PURE__ */L("div",{className:"max-w-md",children:[
5
+ /* @__PURE__ */T(N,{name:"close-circle",className:"h-12 w-12 mx-auto text-gray-300 mb-3",strokeWidth:1.4}),
6
+ /* @__PURE__ */T("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:"Can't reach the file server"}),
7
+ /* @__PURE__ */L("p",{className:"text-sm text-gray-500 mb-3",children:["No response from ",
8
+ /* @__PURE__ */T("span",{className:"font-mono",children:M}),". Make sure the server is running — see ",
9
+ /* @__PURE__ */T("span",{className:"font-mono",children:"examples/file-server/README.md"}),"."]}),
10
+ /* @__PURE__ */T("button",{onClick:()=>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=z&&z.limit>0?Math.min(100,Math.round(z.used/z.limit*100)):0,Ne=ke>90?"bg-red-500":ke>75?"bg-amber-500":"bg-blue-500",we=[{label:"My files",onClick:()=>I("/")},...be.map((e,t)=>({label:e,onClick:()=>I("/"+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
+ /* @__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"),I("/")},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"]}),J.map(e=>/* @__PURE__ */L("button",{onClick:()=>{ee("files"),I("/"+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)),!A&&/* @__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
+ /* @__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
+ /* @__PURE__ */T(h,{className:"h-4 w-4 shrink-0 text-amber-500"}),
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=>{A||"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&&_(!1)},onDrop:e=>{e.preventDefault(),ye(),A||"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
+ /* @__PURE__ */T(s,{app:"files"}),
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
+ /* @__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(R,"files"===q?{children:[
23
+ /* @__PURE__ */T("button",{onClick:()=>I(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
+ /* @__PURE__ */T("div",{className:"flex-1 min-w-0",children:/* @__PURE__ */T(r,{items:we,maxItems:5})}),
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})}),!A&&/* @__PURE__ */L(R,{children:[
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
+ /* @__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=P(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
+ /* @__PURE__ */T(N,{name:"folder-plus",className:"h-3.5 w-3.5",strokeWidth:1.5}),"New Folder"]}),
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
+ /* @__PURE__ */T(N,{name:"upload",className:"h-3.5 w-3.5",strokeWidth:1.8}),"Upload"]})]})]}:"trash"===q?{children:[
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
+ /* @__PURE__ */T("span",{className:"flex-1 text-gray-700 font-medium px-2",children:"Trash"}),
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(`${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
+ /* @__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
+ /* @__PURE__ */T(h,{className:"h-4 w-4 text-amber-500 ml-1"}),
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"})]}),z&&/* @__PURE__ */L(R,{children:[
40
+ /* @__PURE__ */T("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
41
+ /* @__PURE__ */L("div",{className:"flex items-center gap-2",title:`${a(z.used)} of ${a(z.limit)} used`,children:[
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}%`}})}),
43
+ /* @__PURE__ */L("span",{className:"text-2xs text-gray-500 tabular-nums whitespace-nowrap",children:[a(z.used)," / ",a(z.limit)]})]})]})]}),
44
+ /* @__PURE__ */T("div",{className:"flex-1 overflow-auto",children:"object"==typeof q?0===ie.length?/* @__PURE__ */T("div",{className:"p-10 text-center text-sm text-gray-400",children:"This desktop folder is empty. Drag shortcuts onto it on the desktop."}):/* @__PURE__ */L("table",{className:"w-full text-sm",children:[
45
+ /* @__PURE__ */T("thead",{className:"bg-gray-50 text-2xs uppercase tracking-wide text-gray-500",children:/* @__PURE__ */L("tr",{children:[
46
+ /* @__PURE__ */T("th",{className:`${k} text-left font-medium px-3 h-8`,children:"Name"}),
47
+ /* @__PURE__ */T("th",{className:`${k} text-left font-medium px-3 h-8 w-28`,children:"Type"}),
48
+ /* @__PURE__ */T("th",{className:`${k} w-56`})]})}),
49
+ /* @__PURE__ */T("tbody",{children:ie.map(e=>{const t=`${e.entityType}|${e.entityId}`;/* @__PURE__ */
50
+ return L("tr",{onClick:()=>Q(t),onDoubleClick:()=>me(e),className:"cursor-default border-b border-gray-100 "+(B===t?"bg-blue-50":"hover:bg-gray-50"),children:[
51
+ /* @__PURE__ */L("td",{className:"px-3 h-8 flex items-center gap-2",children:[
52
+ /* @__PURE__ */T(p,{item:e}),
53
+ /* @__PURE__ */T("span",{className:"truncate",title:e.label,children:e.label})]}),
54
+ /* @__PURE__ */T("td",{className:"px-3 h-8 text-xs text-gray-500",children:u(e)}),
55
+ /* @__PURE__ */L("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:[
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
+ /* @__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?V&&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
+ /* @__PURE__ */T("thead",{className:"bg-gray-50 text-2xs uppercase tracking-wide text-gray-500",children:/* @__PURE__ */L("tr",{children:[
60
+ /* @__PURE__ */T("th",{className:`${k} text-left font-medium px-3 h-8`,children:"Name"}),
61
+ /* @__PURE__ */T("th",{className:`${k} text-left font-medium px-3 h-8`,children:"Original location"}),
62
+ /* @__PURE__ */T("th",{className:`${k} text-right font-medium px-3 h-8 w-24`,children:"Size"}),
63
+ /* @__PURE__ */T("th",{className:`${k} text-right font-medium px-3 h-8 w-40`,children:"Deleted"}),
64
+ /* @__PURE__ */T("th",{className:`${k} w-44`})]})}),
65
+ /* @__PURE__ */T("tbody",{children:te.map(e=>/* @__PURE__ */L("tr",{className:"border-b border-gray-100 hover:bg-gray-50",children:[
66
+ /* @__PURE__ */L("td",{className:"px-3 h-8 flex items-center gap-2",children:["folder"===e.kind?/* @__PURE__ */T(N,{name:"folder",look:"solid",className:"h-4 w-4 text-amber-500 shrink-0"}):/* @__PURE__ */T(N,{name:"page",className:"h-4 w-4 text-gray-400 shrink-0",strokeWidth:1.5}),
67
+ /* @__PURE__ */T("span",{className:"truncate",title:e.name,children:e.name})]}),
68
+ /* @__PURE__ */T("td",{className:"px-3 h-8 text-gray-500 text-xs font-mono truncate",title:e.originalPath,children:e.originalPath||"—"}),
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?S(e.deletedAt):"—"}),
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(`${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))})]}):V&&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.",!A&&/* @__PURE__ */L(R,{children:[" Drop files here or click ",
74
+ /* @__PURE__ */T("span",{className:"font-medium",children:"Upload"}),"."]})]}):/* @__PURE__ */L("table",{className:"w-full text-sm",children:[
75
+ /* @__PURE__ */T("thead",{className:"bg-gray-50 text-2xs uppercase tracking-wide text-gray-500",children:/* @__PURE__ */L("tr",{children:[
76
+ /* @__PURE__ */T("th",{className:`${k} text-left font-medium px-3 h-8`,children:"Name"}),
77
+ /* @__PURE__ */T("th",{className:`${k} text-right font-medium px-3 h-8 w-24`,children:"Size"}),
78
+ /* @__PURE__ */T("th",{className:`${k} text-right font-medium px-3 h-8 w-40`,children:"Modified"}),
79
+ /* @__PURE__ */T("th",{className:`${k} w-32`})]})}),
80
+ /* @__PURE__ */T("tbody",{children:F.map(t=>/* @__PURE__ */L("tr",{onClick:()=>Q(t.name),onDoubleClick:()=>{"folder"===t.kind?I(P(U,t.name)):(async t=>{if(A)return;const r=P(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 "+(B===t.name?"bg-blue-50":"hover:bg-gray-50"),children:[
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
+ /* @__PURE__ */T("span",{className:"truncate",title:t.name,children:t.name})]}),
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:S(t.modifiedAt)}),
85
+ /* @__PURE__ */T("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:!A&&/* @__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=P(U,e.name),a=P(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=P(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))})]})})]})})}),Y&&/* @__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};
@@ -1,8 +1,8 @@
1
- import{getNumberingConfigs as e}from"./chunk-KAELFRN4.js";import{SidebarLayout as t}from"./chunk-YFY2LSWZ.js";import"./chunk-QWK6DRSN.js";import"./chunk-7NOU275V.js";import{timeAgo as r}from"./chunk-X2S2XDZI.js";import"./chunk-5OTS2G3M.js";import"./chunk-36BRD5J3.js";import{AboutApp as n}from"./chunk-ZQGPJZY4.js";import{useWindowManager as o,client_default as i}from"./chunk-R6WJ2NTT.js";import"./chunk-TPDOOCFS.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-SS7BG7BS.js";import"./chunk-Y53KNQKL.js";import"./chunk-5A7MWTXX.js";import"./chunk-O5PJELY7.js";import"./chunk-SGVIMTN6.js";import"./chunk-CGY5RNAF.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import{useShellPrefs as s}from"./chunk-KC3EX26K.js";import{toast_default as c}from"./chunk-HIDOSOI4.js";import"./chunk-UPHXYWL6.js";import"./chunk-5QFPTDQF.js";import"./chunk-LWGNNVDA.js";import"./chunk-UGTRSRIW.js";import"./chunk-QR4RM7PO.js";import"./chunk-5SULG7D5.js";import"./chunk-CDAJKLGL.js";import"./chunk-7T3COEQK.js";import"./chunk-EUFALBK3.js";import"./chunk-UDD7GB4F.js";import"./chunk-K7U4RWXJ.js";import"./chunk-4TL3MRRE.js";import{Icon as a}from"./chunk-42BBJJDP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-2LXTJXWC.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-GTRUBA2R.js";import"./chunk-C3QOHMR6.js";import{useRef as l,useEffect as p,useState as d,useCallback as m}from"react";import{useQuery as u}from"@tanstack/react-query";import{jsxs as h,Fragment as y,jsx as g}from"react/jsx-runtime";var x=[{key:"yellow",bg:"bg-yellow-100",border:"border-yellow-300",text:"text-yellow-900",dot:"bg-yellow-400"},{key:"blue",bg:"bg-blue-100",border:"border-blue-300",text:"text-blue-900",dot:"bg-blue-400"},{key:"green",bg:"bg-green-100",border:"border-green-300",text:"text-green-900",dot:"bg-green-400"},{key:"pink",bg:"bg-pink-100",border:"border-pink-300",text:"text-pink-900",dot:"bg-pink-400"},{key:"purple",bg:"bg-purple-100",border:"border-purple-300",text:"text-purple-900",dot:"bg-purple-400"},{key:"orange",bg:"bg-orange-100",border:"border-orange-300",text:"text-orange-900",dot:"bg-orange-400"},{key:"white",bg:"bg-white",border:"border-gray-300",text:"text-gray-900",dot:"bg-gray-300"}];var k={sales_order:{entityType:"order",endpoint:"/orders/sales-orders/"},purchase_order:{entityType:"purchase_order",endpoint:"/purchase-orders/"},invoice:{entityType:"invoice",endpoint:"/invoicing/invoices/"},vendor_invoice:{entityType:"vendor_invoice",endpoint:"/invoicing/vendor-invoices/"},shipment:{entityType:"shipment",endpoint:"/shipments/delivery-notes/"},receipt:{entityType:"payment",endpoint:"/invoicing/payments/"},vendor_payment:{entityType:"vendor_payment",endpoint:"/invoicing/vendor-payments/"},vendor_price_sheet:{entityType:"vendor_price_sheet",endpoint:"/pricing/manufacturer-price-sheets/"},client_price_sheet:{entityType:"price_sheet",endpoint:"/pricing/price-sheets/"},qc_report:{entityType:"qc_report",endpoint:"/qc-reports/"},warranty_claim:{entityType:"warranty_claim",endpoint:"/warranty-claims/claims/"},vendor_shipment:{entityType:"vendor_shipment",endpoint:"/shipments/goods-receipts/"}},b=/\[([ xX]?)\]/g;function f(){const{openEntity:f}=o(),{prefs:N,save:v}=s(),{data:j}=u({queryKey:["numbering-configs"],queryFn:()=>e(),retry:!1}),w=l({});p(()=>{if(!j)return;const e={};for(const t of j){const r=k[t.entity_type];if(!r)continue;const n=(t.prefix||"").replace("#","").toUpperCase();if(n&&(e[n]={...r,prefix:t.prefix}),t.alt_prefix){const n=t.alt_prefix.replace("#","").toUpperCase();n&&(e[n]={...r,prefix:t.alt_prefix})}}w.current=e},[j]);const T=N.notepad_notes||[],[_,W]=d(null),[C,S]=d(""),[D,R]=d(""),[$,J]=d("yellow"),[O,U]=d(!1),[X,G]=d(!1),K=l(null),L=l(),P=T.find(e=>e.id===_);p(()=>{if(!_&&T.length>0){const e=T[0];W(e.id),S(e.title),R(e.content),J(e.color)}},[T.length]);const B=m(e=>{v({notepad_notes:e})},[v]),Q=m(()=>{if(!_||!O)return;const e=T.map(e=>e.id===_?{...e,title:C,content:D,color:$,updated_at:/* @__PURE__ */(new Date).toISOString()}:e);B(e),U(!1)},[_,O,C,D,$,T,B]);p(()=>{if(O)return L.current&&clearTimeout(L.current),L.current=setTimeout(Q,800),()=>{L.current&&clearTimeout(L.current)}},[O,Q]),p(()=>()=>{O&&Q()},[]);const E=e=>{O&&Q(),W(e.id),S(e.title),R(e.content),J(e.color),U(!1),G(!1)},F=e=>{const t=D.slice(0,e),r=D.slice(e).match(/^\[([ xX]?)\]/);if(!r)return;const n="x"===r[1]||"X"===r[1]?"[ ]":"[x]",o=D.slice(e+r[0].length);R(t+n+o),U(!0)},I=async(e,t)=>{const r=w.current[e];if(!r)return;const n=`${e}#${t}`;try{const{data:e}=await i.get(r.endpoint,{params:{search:n,page_size:1}}),t=(e?.results??e??[])[0];t?f(r.entityType,t.id,t,n):c.error(`${n} not found`)}catch{c.error(`Failed to look up ${n}`)}},M="Start writing...\n\nTips:\n [] Type [] for a checkbox, click to toggle\n SO#35001 Type XX#NNNNN to link entities (SO, PO, CI, VI, PL, etc.)",A=/* @__PURE__ */h(y,{children:[
2
- /* @__PURE__ */g("div",{className:"p-2 border-b border-gray-200",children:/* @__PURE__ */h("button",{onClick:()=>{O&&Q();const e={id:`note-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,title:"",content:"",color:"yellow",sticky:!1,updated_at:/* @__PURE__ */(new Date).toISOString()},t=[e,...T];B(t),W(e.id),S(""),R(""),J("yellow"),U(!1),G(!0),setTimeout(()=>K.current?.focus(),50)},className:"w-full flex items-center justify-center gap-2 rounded-lg bg-blue-600 text-white px-3 min-h-8 py-1 text-sm font-medium hover:bg-blue-700 transition-colors",children:[
1
+ import{getNumberingConfigs as e}from"./chunk-F5VXS5JO.js";import{SidebarLayout as t}from"./chunk-3RM3D2P3.js";import"./chunk-QWK6DRSN.js";import"./chunk-JSB5G2XQ.js";import{timeAgo as r}from"./chunk-X2S2XDZI.js";import"./chunk-5OTS2G3M.js";import"./chunk-36BRD5J3.js";import{AboutApp as n}from"./chunk-EQZAHIUG.js";import{useWindowManager as o,client_default as i}from"./chunk-BIEKHPZ5.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PXCARPLZ.js";import"./chunk-Y53KNQKL.js";import"./chunk-5A7MWTXX.js";import"./chunk-3AVHOYQZ.js";import"./chunk-MRBC7GLE.js";import"./chunk-MVCNSGM4.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import{useShellPrefs as s}from"./chunk-KC3EX26K.js";import{toast_default as c}from"./chunk-F22KWATP.js";import"./chunk-UPHXYWL6.js";import"./chunk-5QFPTDQF.js";import"./chunk-CDBS47XI.js";import"./chunk-UGTRSRIW.js";import"./chunk-QR4RM7PO.js";import"./chunk-5SULG7D5.js";import"./chunk-CDAJKLGL.js";import"./chunk-7T3COEQK.js";import"./chunk-LYLEH25Y.js";import"./chunk-UDD7GB4F.js";import"./chunk-K7U4RWXJ.js";import"./chunk-4TL3MRRE.js";import{Icon as a}from"./chunk-42BBJJDP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-2LXTJXWC.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-KKZZAK76.js";import"./chunk-C3QOHMR6.js";import{useRef as l,useEffect as p,useState as d,useCallback as m}from"react";import{useQuery as u}from"@tanstack/react-query";import{jsxs as h,Fragment as y,jsx as g}from"react/jsx-runtime";var x=[{key:"yellow",bg:"bg-yellow-100",border:"border-yellow-300",text:"text-yellow-900",dot:"bg-yellow-400"},{key:"blue",bg:"bg-blue-100",border:"border-blue-300",text:"text-blue-900",dot:"bg-blue-400"},{key:"green",bg:"bg-green-100",border:"border-green-300",text:"text-green-900",dot:"bg-green-400"},{key:"pink",bg:"bg-pink-100",border:"border-pink-300",text:"text-pink-900",dot:"bg-pink-400"},{key:"purple",bg:"bg-purple-100",border:"border-purple-300",text:"text-purple-900",dot:"bg-purple-400"},{key:"orange",bg:"bg-orange-100",border:"border-orange-300",text:"text-orange-900",dot:"bg-orange-400"},{key:"white",bg:"bg-white",border:"border-gray-300",text:"text-gray-900",dot:"bg-gray-300"}];var k={sales_order:{entityType:"order",endpoint:"/orders/sales-orders/"},purchase_order:{entityType:"purchase_order",endpoint:"/purchase-orders/"},invoice:{entityType:"invoice",endpoint:"/invoicing/invoices/"},vendor_invoice:{entityType:"vendor_invoice",endpoint:"/invoicing/vendor-invoices/"},shipment:{entityType:"shipment",endpoint:"/shipments/delivery-notes/"},receipt:{entityType:"payment",endpoint:"/invoicing/payments/"},vendor_payment:{entityType:"vendor_payment",endpoint:"/invoicing/vendor-payments/"},vendor_price_sheet:{entityType:"vendor_price_sheet",endpoint:"/pricing/manufacturer-price-sheets/"},client_price_sheet:{entityType:"price_sheet",endpoint:"/pricing/price-sheets/"},qc_report:{entityType:"qc_report",endpoint:"/qc-reports/"},warranty_claim:{entityType:"warranty_claim",endpoint:"/warranty-claims/claims/"},vendor_shipment:{entityType:"vendor_shipment",endpoint:"/shipments/goods-receipts/"}},b=/\[([ xX]?)\]/g;function f(){const{openEntity:f}=o(),{prefs:v,save:j}=s(),{data:N}=u({queryKey:["numbering-configs"],queryFn:()=>e(),retry:!1}),w=l({});p(()=>{if(!N)return;const e={};for(const t of N){const r=k[t.entity_type];if(!r)continue;const n=(t.prefix||"").replace("#","").toUpperCase();if(n&&(e[n]={...r,prefix:t.prefix}),t.alt_prefix){const n=t.alt_prefix.replace("#","").toUpperCase();n&&(e[n]={...r,prefix:t.alt_prefix})}}w.current=e},[N]);const T=v.notepad_notes||[],[_,C]=d(null),[W,D]=d(""),[S,X]=d(""),[R,$]=d("yellow"),[K,J]=d(!1),[P,U]=d(!1),G=l(null),L=l(),M=T.find(e=>e.id===_);p(()=>{if(!_&&T.length>0){const e=T[0];C(e.id),D(e.title),X(e.content),$(e.color)}},[T.length]);const O=m(e=>{j({notepad_notes:e})},[j]),Q=m(()=>{if(!_||!K)return;const e=T.map(e=>e.id===_?{...e,title:W,content:S,color:R,updated_at:/* @__PURE__ */(new Date).toISOString()}:e);O(e),J(!1)},[_,K,W,S,R,T,O]);p(()=>{if(K)return L.current&&clearTimeout(L.current),L.current=setTimeout(Q,800),()=>{L.current&&clearTimeout(L.current)}},[K,Q]),p(()=>()=>{K&&Q()},[]);const B=e=>{K&&Q(),C(e.id),D(e.title),X(e.content),$(e.color),J(!1),U(!1)},E=e=>{const t=S.slice(0,e),r=S.slice(e).match(/^\[([ xX]?)\]/);if(!r)return;const n="x"===r[1]||"X"===r[1]?"[ ]":"[x]",o=S.slice(e+r[0].length);X(t+n+o),J(!0)},A=async(e,t)=>{const r=w.current[e];if(!r)return;const n=`${e}#${t}`;try{const{data:e}=await i.get(r.endpoint,{params:{search:n,page_size:1}}),t=(e?.results??e??[])[0];t?f(r.entityType,t.id,t,n):c.error(`${n} not found`)}catch{c.error(`Failed to look up ${n}`)}},I="Start writing...\n\nTips:\n [] Type [] for a checkbox, click to toggle\n SO#35001 Type XX#NNNNN to link entities (SO, PO, CI, VI, PL, etc.)",Z=/* @__PURE__ */h(y,{children:[
2
+ /* @__PURE__ */g("div",{className:"p-2 border-b border-gray-200",children:/* @__PURE__ */h("button",{onClick:()=>{K&&Q();const e={id:`note-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,title:"",content:"",color:"yellow",sticky:!1,updated_at:/* @__PURE__ */(new Date).toISOString()},t=[e,...T];O(t),C(e.id),D(""),X(""),$("yellow"),J(!1),U(!0),setTimeout(()=>G.current?.focus(),50)},className:"w-full flex items-center justify-center gap-2 rounded-lg bg-blue-600 text-white px-3 min-h-8 py-1 text-sm font-medium hover:bg-blue-700 transition-colors",children:[
3
3
  /* @__PURE__ */g(a,{name:"add",className:"h-4 w-4",strokeWidth:2}),"New Note"]})}),
4
4
  /* @__PURE__ */g("div",{className:"flex-1 overflow-y-auto",children:0===T.length?/* @__PURE__ */g("p",{className:"text-sm text-gray-400 text-center py-8 px-4",children:"No notes yet. Create one to get started."}):T.map(e=>{const t=(n=e.color,x.find(e=>e.key===n)||x[0]);var n;/* @__PURE__ */
5
- return h("button",{onClick:()=>E(e),className:"w-full text-left px-3 py-3 border-b border-gray-100 transition-colors "+(_===e.id?"bg-blue-50":"hover:bg-gray-50"),children:[
5
+ return h("button",{onClick:()=>B(e),className:"w-full text-left px-3 py-3 border-b border-gray-100 transition-colors "+(_===e.id?"bg-blue-50":"hover:bg-gray-50"),children:[
6
6
  /* @__PURE__ */h("div",{className:"flex items-center gap-2",children:[
7
7
  /* @__PURE__ */g("div",{className:`w-3 h-3 rounded-full shrink-0 ${t.dot}`}),
8
8
  /* @__PURE__ */g("span",{className:"text-sm font-medium text-gray-900 truncate flex-1",children:e.title||"Untitled"}),e.sticky&&/* @__PURE__ */g(a,{name:"bookmark",look:"solid",className:"h-3 w-3 text-amber-500 shrink-0"})]}),
@@ -10,16 +10,16 @@ return h("button",{onClick:()=>E(e),className:"w-full text-left px-3 py-3 border
10
10
  /* @__PURE__ */g("p",{className:"text-2xs text-gray-300 mt-0.5 ml-5",children:r(e.updated_at)})]},e.id)})})]});/* @__PURE__ */
11
11
  return h("div",{className:"h-full",children:[
12
12
  /* @__PURE__ */g(n,{app:"notepad"}),
13
- /* @__PURE__ */g(t,{sidebar:A,storageKey:"notepad.sidebarWidth",defaultWidth:224,minWidth:180,maxWidth:360,children:_?/* @__PURE__ */h("div",{className:"flex-1 flex flex-col min-w-0",children:[
13
+ /* @__PURE__ */g(t,{sidebar:Z,storageKey:"notepad.sidebarWidth",defaultWidth:224,minWidth:180,maxWidth:360,children:_?/* @__PURE__ */h("div",{className:"flex-1 flex flex-col min-w-0",children:[
14
14
  /* @__PURE__ */h("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-gray-200",children:[
15
- /* @__PURE__ */g("input",{value:C,onChange:e=>{S(e.target.value),U(!0)},placeholder:"Note title...",className:"flex-1 text-lg font-semibold text-gray-900 outline-none bg-transparent placeholder:text-gray-300"}),
16
- /* @__PURE__ */g("div",{className:"flex gap-1",children:x.map(e=>/* @__PURE__ */g("button",{onClick:()=>{J(e.key),U(!0)},className:`w-5 h-5 rounded-full border-2 transition-all ${e.dot} ${$===e.key?"border-gray-600 scale-110":"border-transparent hover:border-gray-400"}`,title:e.key},e.key))}),
17
- /* @__PURE__ */g("button",{onClick:()=>(e=>{const t=T.map(t=>t.id===e?{...t,sticky:!t.sticky}:t);B(t);const r=t.find(t=>t.id===e);c.success(r?.sticky?"Pinned to desktop":"Removed from desktop")})(_),title:P?.sticky?"Remove from desktop":"Pin to desktop",className:"p-1 rounded transition-colors "+(P?.sticky?"text-amber-500 hover:text-amber-600":"text-gray-300 hover:text-amber-400"),children:/* @__PURE__ */g(a,{name:"bookmark",className:"h-4 w-4",fill:P?.sticky?"currentColor":"none",strokeWidth:1.5})}),
18
- /* @__PURE__ */g("button",{onClick:()=>(e=>{const t=T.filter(t=>t.id!==e);if(B(t),_===e){const e=t[0];e?E(e):(W(null),S(""),R(""))}})(_),title:"Delete note",className:"p-1 rounded text-gray-300 hover:text-red-500 transition-colors",children:/* @__PURE__ */g(a,{name:"trash",className:"h-4 w-4",strokeWidth:1.5})})]}),X?/* @__PURE__ */g("textarea",{ref:K,value:D,onChange:e=>{R(e.target.value),U(!0)},onBlur:()=>{G(!1),O&&Q()},placeholder:M,className:"flex-1 p-4 text-sm text-gray-700 outline-none resize-none bg-transparent leading-relaxed placeholder:text-gray-300 font-mono"}):/* @__PURE__ */g("div",{onClick:()=>{G(!0),setTimeout(()=>K.current?.focus(),50)},className:"flex-1 p-4 text-sm text-gray-700 overflow-y-auto leading-relaxed cursor-text",children:D?(e=>{if(!e)return[];const t=e.split("\n");return t.map((e,r)=>{const n=[];let o=0;const i=[],s=/([A-Z]{2,4})#(\d{4,6})/g;let c;for(;null!==(c=s.exec(e));){const e=c[1],t=c[2];if(w.current[e]){const n=c.index,o=c[0];i.push({idx:n,len:o.length,render:()=>/* @__PURE__ */g("button",{onClick:()=>I(e,t),className:"text-blue-600 hover:text-blue-800 hover:underline font-medium cursor-pointer",children:o},`ref-${r}-${n}`)})}}b.lastIndex=0;let l=0;for(let e=0;e<r;e++)l+=t[e].length+1;for(;null!==(c=b.exec(e));){const e="x"===c[1]||"X"===c[1],t=c.index,n=l+t;i.push({idx:t,len:c[0].length,render:()=>/* @__PURE__ */g("button",{onClick:()=>F(n),className:`inline-flex items-center justify-center w-4 h-4 rounded border ${e?"bg-blue-500 border-blue-500 text-white":"border-gray-400 bg-white hover:border-blue-400"} cursor-pointer align-text-bottom mr-0.5`,children:e&&/* @__PURE__ */g(a,{name:"check",className:"w-3 h-3",strokeWidth:3})},`cb-${r}-${t}`)})}i.sort((e,t)=>e.idx-t.idx);for(const t of i)t.idx>o&&n.push(/* @__PURE__ */g("span",{children:e.slice(o,t.idx)},`t-${r}-${o}`)),n.push(t.render()),o=t.idx+t.len;o<e.length&&n.push(/* @__PURE__ */g("span",{children:e.slice(o)},`t-${r}-${o}`)),0===n.length&&n.push(/* @__PURE__ */g("span",{children:"​"},`empty-${r}`));const p=/^\[x\]/i.test(e.trimStart());/* @__PURE__ */
19
- return g("div",{className:p?"line-through text-gray-400":"",children:n},r)})})(D):/* @__PURE__ */g("p",{className:"text-gray-300 whitespace-pre-line",children:M})}),
15
+ /* @__PURE__ */g("input",{value:W,onChange:e=>{D(e.target.value),J(!0)},placeholder:"Note title...",className:"flex-1 text-lg font-semibold text-gray-900 outline-none bg-transparent placeholder:text-gray-300"}),
16
+ /* @__PURE__ */g("div",{className:"flex gap-1",children:x.map(e=>/* @__PURE__ */g("button",{onClick:()=>{$(e.key),J(!0)},className:`w-5 h-5 rounded-full border-2 transition-all ${e.dot} ${R===e.key?"border-gray-600 scale-110":"border-transparent hover:border-gray-400"}`,title:e.key},e.key))}),
17
+ /* @__PURE__ */g("button",{onClick:()=>(e=>{const t=T.map(t=>t.id===e?{...t,sticky:!t.sticky}:t);O(t);const r=t.find(t=>t.id===e);c.success(r?.sticky?"Pinned to desktop":"Removed from desktop")})(_),title:M?.sticky?"Remove from desktop":"Pin to desktop",className:"p-1 rounded transition-colors "+(M?.sticky?"text-amber-500 hover:text-amber-600":"text-gray-300 hover:text-amber-400"),children:/* @__PURE__ */g(a,{name:"bookmark",className:"h-4 w-4",fill:M?.sticky?"currentColor":"none",strokeWidth:1.5})}),
18
+ /* @__PURE__ */g("button",{onClick:()=>(e=>{const t=T.filter(t=>t.id!==e);if(O(t),_===e){const e=t[0];e?B(e):(C(null),D(""),X(""))}})(_),title:"Delete note",className:"p-1 rounded text-gray-300 hover:text-red-500 transition-colors",children:/* @__PURE__ */g(a,{name:"trash",className:"h-4 w-4",strokeWidth:1.5})})]}),P?/* @__PURE__ */g("textarea",{ref:G,value:S,onChange:e=>{X(e.target.value),J(!0)},onBlur:()=>{U(!1),K&&Q()},placeholder:I,className:"flex-1 p-4 text-sm text-gray-700 outline-none resize-none bg-transparent leading-relaxed placeholder:text-gray-300 font-mono"}):/* @__PURE__ */g("div",{onClick:()=>{U(!0),setTimeout(()=>G.current?.focus(),50)},className:"flex-1 p-4 text-sm text-gray-700 overflow-y-auto leading-relaxed cursor-text",children:S?(e=>{if(!e)return[];const t=e.split("\n");return t.map((e,r)=>{const n=[];let o=0;const i=[],s=/([A-Z]{2,4})#(\d{4,6})/g;let c;for(;null!==(c=s.exec(e));){const e=c[1],t=c[2];if(w.current[e]){const n=c.index,o=c[0];i.push({idx:n,len:o.length,render:()=>/* @__PURE__ */g("button",{onClick:()=>A(e,t),className:"text-blue-600 hover:text-blue-800 hover:underline font-medium cursor-pointer",children:o},`ref-${r}-${n}`)})}}b.lastIndex=0;let l=0;for(let e=0;e<r;e++)l+=t[e].length+1;for(;null!==(c=b.exec(e));){const e="x"===c[1]||"X"===c[1],t=c.index,n=l+t;i.push({idx:t,len:c[0].length,render:()=>/* @__PURE__ */g("button",{onClick:()=>E(n),className:`inline-flex items-center justify-center w-4 h-4 rounded border ${e?"bg-blue-500 border-blue-500 text-white":"border-gray-400 bg-white hover:border-blue-400"} cursor-pointer align-text-bottom mr-0.5`,children:e&&/* @__PURE__ */g(a,{name:"check",className:"w-3 h-3",strokeWidth:3})},`cb-${r}-${t}`)})}i.sort((e,t)=>e.idx-t.idx);for(const t of i)t.idx>o&&n.push(/* @__PURE__ */g("span",{children:e.slice(o,t.idx)},`t-${r}-${o}`)),n.push(t.render()),o=t.idx+t.len;o<e.length&&n.push(/* @__PURE__ */g("span",{children:e.slice(o)},`t-${r}-${o}`)),0===n.length&&n.push(/* @__PURE__ */g("span",{children:"​"},`empty-${r}`));const p=/^\[x\]/i.test(e.trimStart());/* @__PURE__ */
19
+ return g("div",{className:p?"line-through text-gray-400":"",children:n},r)})})(S):/* @__PURE__ */g("p",{className:"text-gray-300 whitespace-pre-line",children:I})}),
20
20
  /* @__PURE__ */h("div",{className:"px-4 min-h-8 py-1 border-t border-gray-100 flex items-center gap-4 text-2xs text-gray-400",children:[
21
21
  /* @__PURE__ */g("span",{children:"[] checkbox"}),
22
22
  /* @__PURE__ */g("span",{children:"SO#35001 entity link"}),
23
- /* @__PURE__ */g("span",{className:"ml-auto",children:X?"Editing":"Click to edit"})]})]}):/* @__PURE__ */g("div",{className:"flex-1 flex items-center justify-center",children:/* @__PURE__ */h("div",{className:"text-center text-gray-400",children:[
23
+ /* @__PURE__ */g("span",{className:"ml-auto",children:P?"Editing":"Click to edit"})]})]}):/* @__PURE__ */g("div",{className:"flex-1 flex items-center justify-center",children:/* @__PURE__ */h("div",{className:"text-center text-gray-400",children:[
24
24
  /* @__PURE__ */g(a,{name:"page",className:"h-12 w-12 mx-auto mb-3 text-gray-300",strokeWidth:1}),
25
25
  /* @__PURE__ */g("p",{className:"text-sm",children:"Select a note or create a new one"})]})})})]})}export{f as default};
@@ -1 +1 @@
1
- export{PdfViewer as default,fitScale,pdfWasmParams}from"./chunk-2QYQDCJE.js";import"./chunk-HIDOSOI4.js";import"./chunk-K7U4RWXJ.js";import"./chunk-42BBJJDP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-GTRUBA2R.js";import"./chunk-C3QOHMR6.js";
1
+ export{PdfViewer as default,fitScale,pdfWasmParams}from"./chunk-LMOPRRQY.js";import"./chunk-F22KWATP.js";import"./chunk-K7U4RWXJ.js";import"./chunk-42BBJJDP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-KKZZAK76.js";import"./chunk-C3QOHMR6.js";