efficient-shell 11.12.0 → 12.1.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 (342) hide show
  1. package/README.md +52 -11
  2. package/dist/{Browser-LPGSKKLU.js → Browser-U3SO6PSV.js} +14 -14
  3. package/dist/Calculator-6XGTP5OQ.js +29 -0
  4. package/dist/{CurrencyConverter-N2HQT7IR.js → CurrencyConverter-XNWE5MQW.js} +7 -7
  5. package/dist/Files-S4AFZX4N.js +121 -0
  6. package/dist/{Notepad-JCWNOQET.js → Notepad-YYNH67EN.js} +9 -9
  7. package/dist/PdfViewer-ZI3QOG4G.js +1 -0
  8. package/dist/{PomodoroTimer-356JUEM3.js → PomodoroTimer-SBV43YX6.js} +63 -63
  9. package/dist/{Preview-X7XNDI6X.js → Preview-KV3L22LT.js} +20 -20
  10. package/dist/Sidebar-XVVZJ7PR.js +44 -0
  11. package/dist/{Stock-2XOOZNRR.js → Stock-GODZPUR3.js} +3 -3
  12. package/dist/{Weather-ZDU2722T.js → Weather-2IIV4CFT.js} +19 -19
  13. package/dist/{WorldClock-PQGERFCH.js → WorldClock-JW4MLMCB.js} +7 -7
  14. package/dist/ai/index.js +30 -30
  15. package/dist/apps/index.d.ts +133 -27
  16. package/dist/apps/index.js +1 -1
  17. package/dist/bin/media-host-check.js +1 -1
  18. package/dist/bin/ui-check.js +1 -1
  19. package/dist/brand.css +1 -1
  20. package/dist/charts/BoxPlotChart.js +1 -1
  21. package/dist/charts/CandlestickChart.js +1 -1
  22. package/dist/charts/CartesianPlot.js +1 -1
  23. package/dist/charts/ChartBrush.js +1 -1
  24. package/dist/charts/ChartFrame.js +1 -1
  25. package/dist/charts/ChartSkeleton.js +1 -1
  26. package/dist/charts/ChordChart.js +1 -1
  27. package/dist/charts/ColumnChart.js +1 -1
  28. package/dist/charts/FunnelChart.js +1 -1
  29. package/dist/charts/HeatmapChart.js +1 -1
  30. package/dist/charts/HistogramChart.js +1 -1
  31. package/dist/charts/Meter.js +1 -1
  32. package/dist/charts/PieChart.js +1 -1
  33. package/dist/charts/RadarChart.js +1 -1
  34. package/dist/charts/RadialBarChart.js +1 -1
  35. package/dist/charts/RangeChart.js +1 -1
  36. package/dist/charts/RankedBars.js +1 -1
  37. package/dist/charts/SankeyChart.js +1 -1
  38. package/dist/charts/ScatterChart.js +1 -1
  39. package/dist/charts/SpecChart.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-SSM6P43S.js → chunk-27XV4TAU.js} +5 -5
  46. package/dist/{chunk-HJM4LSMM.js → chunk-2DOMIOYR.js} +1 -1
  47. package/dist/{chunk-YQLKZ5UQ.js → chunk-2OMM2AG3.js} +1 -1
  48. package/dist/chunk-2T7MZ77B.js +3 -0
  49. package/dist/{chunk-UEWB6IOD.js → chunk-2XQOK3CT.js} +2 -2
  50. package/dist/{chunk-7A2Y3W55.js → chunk-2YBJQUYQ.js} +1 -1
  51. package/dist/{chunk-UTITWGVW.js → chunk-32WEY6O5.js} +1 -1
  52. package/dist/{chunk-RMSF4UCJ.js → chunk-3CMCGOOV.js} +4 -4
  53. package/dist/{chunk-KYHDDVTR.js → chunk-3WFJ4PYV.js} +4 -4
  54. package/dist/chunk-43MCNASD.js +1 -0
  55. package/dist/{chunk-D4RVWSUT.js → chunk-4H5NTMOF.js} +1 -1
  56. package/dist/{chunk-L2IPWMLI.js → chunk-4KJ7MLWO.js} +6 -6
  57. package/dist/chunk-4RTDZSGH.js +27 -0
  58. package/dist/{chunk-HDABS36W.js → chunk-4UGFNTZ3.js} +12 -12
  59. package/dist/{chunk-VZ52KKNA.js → chunk-53EW4M5S.js} +5 -5
  60. package/dist/{chunk-GS74BABV.js → chunk-56ESGDIC.js} +1 -1
  61. package/dist/{chunk-PETBAYS5.js → chunk-5F6KJAF3.js} +14 -14
  62. package/dist/{chunk-AQ7CNPEE.js → chunk-5N6AC3LN.js} +11 -11
  63. package/dist/{chunk-PDFV3YQB.js → chunk-5NDONLH5.js} +3 -3
  64. package/dist/{chunk-LJJ7FDAQ.js → chunk-5THF6BJS.js} +5 -5
  65. package/dist/{chunk-6S6FJJKP.js → chunk-5V6SA77P.js} +6 -6
  66. package/dist/{chunk-5IESW4PM.js → chunk-63QLZYMN.js} +3 -3
  67. package/dist/{chunk-DMBA6KYQ.js → chunk-6XC3XX7F.js} +6 -6
  68. package/dist/{chunk-LWFH5QTJ.js → chunk-7EK7JNR4.js} +1 -1
  69. package/dist/{chunk-NPT6EXHK.js → chunk-7F4U43YN.js} +4 -4
  70. package/dist/{chunk-225LCPO7.js → chunk-7FBAZLBX.js} +1 -1
  71. package/dist/{chunk-NTUZT37J.js → chunk-7H7U3HC6.js} +4 -4
  72. package/dist/{chunk-ZKBGUDNB.js → chunk-7KIDOIPY.js} +1 -1
  73. package/dist/{chunk-R6TDZ7T5.js → chunk-7ZYEDXZX.js} +1 -1
  74. package/dist/{chunk-MD6EPKOR.js → chunk-A2ZEGD2S.js} +10 -10
  75. package/dist/{chunk-LLSLY6BT.js → chunk-ACNDPAAT.js} +1 -1
  76. package/dist/{chunk-XOH6QERF.js → chunk-AJ5NU7UH.js} +9 -9
  77. package/dist/{chunk-L74WV4RJ.js → chunk-AJO55X66.js} +6 -6
  78. package/dist/{chunk-ZMC25LRC.js → chunk-ANSQT5ZS.js} +1 -1
  79. package/dist/{chunk-HT7SOOMD.js → chunk-AQULCKKZ.js} +11 -11
  80. package/dist/{chunk-LP45EML2.js → chunk-B5OYS65L.js} +1 -1
  81. package/dist/chunk-BD4OHYQB.js +13 -0
  82. package/dist/{chunk-4TB4CSLB.js → chunk-BFA5U5JF.js} +11 -11
  83. package/dist/{chunk-Y4RHGLXB.js → chunk-BFO72WQB.js} +1 -1
  84. package/dist/{chunk-HOEEFFE3.js → chunk-BPECY7I7.js} +9 -9
  85. package/dist/{chunk-IFWXC323.js → chunk-BXZNMSTZ.js} +1 -1
  86. package/dist/{chunk-6ETRVCMH.js → chunk-BXZSLRNO.js} +10 -10
  87. package/dist/{chunk-YOXR3VKO.js → chunk-C4XV42QP.js} +1 -1
  88. package/dist/chunk-CC42UKIT.js +1 -0
  89. package/dist/{chunk-GRC46C4V.js → chunk-CD7P34VC.js} +7 -7
  90. package/dist/{chunk-4EVYK6DR.js → chunk-CENTHUBD.js} +7 -7
  91. package/dist/{chunk-TTQJQKCE.js → chunk-CF4YOJUQ.js} +10 -10
  92. package/dist/{chunk-O6VIHWYU.js → chunk-CNVYM3HP.js} +1 -1
  93. package/dist/{chunk-IJ6HZXZY.js → chunk-COMV3Z2U.js} +1 -1
  94. package/dist/chunk-CQCMJHDM.js +9 -0
  95. package/dist/{chunk-FD6XZRWA.js → chunk-CRB5GM4W.js} +1 -1
  96. package/dist/{chunk-JJLAI6GL.js → chunk-CRU2BNEM.js} +7 -7
  97. package/dist/{chunk-4APQHXLI.js → chunk-CTW2OKYS.js} +2 -2
  98. package/dist/chunk-CWTY4GTU.js +5 -0
  99. package/dist/{chunk-FEUTN4GK.js → chunk-DKUF7BD5.js} +1 -1
  100. package/dist/{chunk-HGMQOHMK.js → chunk-DSHEOC2O.js} +1 -1
  101. package/dist/{chunk-LXBBJNBQ.js → chunk-DU5IBIZQ.js} +1 -1
  102. package/dist/{chunk-5KKJAYKT.js → chunk-DZBGJ6X4.js} +1 -1
  103. package/dist/{chunk-FRH2AHPI.js → chunk-E227NVFX.js} +1 -1
  104. package/dist/{chunk-RBAC26J7.js → chunk-EEVKJJ5S.js} +4 -4
  105. package/dist/{chunk-WEEQDPU3.js → chunk-EOGXCGQF.js} +6 -6
  106. package/dist/{chunk-P75N466Z.js → chunk-ESDWHHQY.js} +2 -2
  107. package/dist/{chunk-AO7XAAGG.js → chunk-FAIHSCOG.js} +1 -1
  108. package/dist/chunk-FEJFGFPF.js +8 -0
  109. package/dist/{chunk-ZA2RBNRA.js → chunk-FLYOI6EW.js} +1 -1
  110. package/dist/{chunk-WOOKUEED.js → chunk-FOTDGSY5.js} +1 -1
  111. package/dist/{chunk-UBQUXUD2.js → chunk-FUUJJ7OH.js} +5 -5
  112. package/dist/chunk-FWUXYNWF.js +13 -0
  113. package/dist/{chunk-2ZAFRGRF.js → chunk-G2X5YYIQ.js} +2 -2
  114. package/dist/{chunk-KU4IWX6F.js → chunk-GEZ45J4Z.js} +2 -2
  115. package/dist/{chunk-HJBR73GS.js → chunk-GFBQ53WN.js} +1 -1
  116. package/dist/chunk-GGSPY3Q4.js +23 -0
  117. package/dist/chunk-GIUX7WUS.js +7 -0
  118. package/dist/{chunk-PVVHWLNX.js → chunk-GJ23UZDQ.js} +1 -1
  119. package/dist/{chunk-BPJ3CQH7.js → chunk-GJJKWGBX.js} +11 -11
  120. package/dist/chunk-GMLGR4R6.js +8 -0
  121. package/dist/{chunk-IKKR2TYY.js → chunk-GRB4LKZC.js} +5 -5
  122. package/dist/{chunk-K3IUUZO5.js → chunk-GZJ5F7SB.js} +8 -8
  123. package/dist/{chunk-WZJPASST.js → chunk-HB2XXIQG.js} +5 -5
  124. package/dist/chunk-HGZZXA2N.js +9 -0
  125. package/dist/{chunk-Q7UTGO73.js → chunk-HICNRXYB.js} +10 -10
  126. package/dist/{chunk-PTVTNCD6.js → chunk-HNQKXOFU.js} +4 -4
  127. package/dist/{chunk-OCWWEHNR.js → chunk-HS4EWT6L.js} +2 -2
  128. package/dist/{chunk-2NRNKF46.js → chunk-HTDZ3XAJ.js} +7 -7
  129. package/dist/chunk-HY3JYAUH.js +19 -0
  130. package/dist/{chunk-UVMM7AYO.js → chunk-I3QFYBOP.js} +1 -1
  131. package/dist/{chunk-GJFTO7D4.js → chunk-I7H3OIYX.js} +1 -1
  132. package/dist/{chunk-7FCIFHO7.js → chunk-IRZ6XM5A.js} +1 -1
  133. package/dist/{chunk-PL4HKGYP.js → chunk-IYPRFUTT.js} +1 -1
  134. package/dist/{chunk-TZXAW32T.js → chunk-J5ISQYVM.js} +1 -1
  135. package/dist/{chunk-DXKXETTT.js → chunk-JCTOQOVO.js} +1 -1
  136. package/dist/{chunk-IIKPM3F4.js → chunk-JCUG572K.js} +1 -1
  137. package/dist/{chunk-CXZ7PHHF.js → chunk-KHVECW4M.js} +6 -6
  138. package/dist/{chunk-CR3YDABU.js → chunk-L75RBQFH.js} +1 -1
  139. package/dist/{chunk-6CK44QWU.js → chunk-LJJSFJA2.js} +26 -26
  140. package/dist/{chunk-34AHNPW7.js → chunk-LLBH6PHE.js} +1 -1
  141. package/dist/{chunk-PMKBWDXO.js → chunk-LOEOCZCN.js} +1 -1
  142. package/dist/{chunk-VVDK7XPH.js → chunk-LTESFDTF.js} +1 -1
  143. package/dist/{chunk-6WPKLF6G.js → chunk-LUSIZ2BK.js} +15 -15
  144. package/dist/{chunk-JGWUSJDD.js → chunk-M7DFM2N7.js} +60 -60
  145. package/dist/{chunk-7V32O5NF.js → chunk-MRFNJZRR.js} +16 -31
  146. package/dist/{chunk-FFNPAJLS.js → chunk-NC36LJCA.js} +9 -9
  147. package/dist/{chunk-N75MPMLD.js → chunk-NHBDLW52.js} +1 -1
  148. package/dist/{chunk-SEP35R2E.js → chunk-NHWDB7R6.js} +1 -1
  149. package/dist/{chunk-NMQGAP3H.js → chunk-NJTFI7AA.js} +1 -1
  150. package/dist/chunk-NPQBJJLP.js +9 -0
  151. package/dist/{chunk-UHGAT5MH.js → chunk-NZYI4XV5.js} +2 -2
  152. package/dist/{chunk-SKRFI6WB.js → chunk-ONYPN3JY.js} +11 -11
  153. package/dist/{chunk-F33L4J3P.js → chunk-ORLQUGIN.js} +6 -6
  154. package/dist/{chunk-JJZAYAVL.js → chunk-PH3P54QQ.js} +1 -1
  155. package/dist/chunk-PKNHSZWK.js +8 -0
  156. package/dist/{chunk-IUG4Z2ND.js → chunk-PXIP246B.js} +1 -1
  157. package/dist/{chunk-GJVGGYQ2.js → chunk-QBD7V4TK.js} +1 -1
  158. package/dist/{chunk-OMROEVOP.js → chunk-QN56R4V4.js} +1 -1
  159. package/dist/{chunk-6UJYRGWY.js → chunk-QTMRW6DK.js} +1 -1
  160. package/dist/{chunk-LXQHTY3A.js → chunk-R3JKZXII.js} +5 -5
  161. package/dist/{chunk-6C6M3QXL.js → chunk-R3K3LVVS.js} +1 -1
  162. package/dist/{chunk-AWQ5SOC5.js → chunk-RIXX6NRV.js} +1 -1
  163. package/dist/{chunk-CAIKDX2M.js → chunk-RM74EAMV.js} +2 -2
  164. package/dist/{chunk-3N2MNOV5.js → chunk-RXHTIJ64.js} +1 -1
  165. package/dist/chunk-S3C3XJG7.js +1 -0
  166. package/dist/{chunk-OLJUPBY4.js → chunk-SCCAMJB4.js} +1 -1
  167. package/dist/{chunk-3PZI2C4R.js → chunk-SCGBCBXP.js} +1 -1
  168. package/dist/chunk-SX5CSXZO.js +8 -0
  169. package/dist/chunk-TBBG2AWY.js +9 -0
  170. package/dist/{chunk-KVVZLEUG.js → chunk-TRWHVG3A.js} +1 -1
  171. package/dist/{chunk-VIDT4JLR.js → chunk-TTSZSLQL.js} +1 -1
  172. package/dist/{chunk-SAASFWKB.js → chunk-UDJLRTQB.js} +1 -1
  173. package/dist/{chunk-G3FHFWC2.js → chunk-UDL2A2GT.js} +3 -3
  174. package/dist/chunk-UE54EN4C.js +2 -0
  175. package/dist/{chunk-VU5P4ZM5.js → chunk-VFBBGLRA.js} +12 -12
  176. package/dist/{chunk-ZHS2VQU7.js → chunk-VGWYAYHB.js} +3 -3
  177. package/dist/chunk-VPYD7UJM.js +22 -0
  178. package/dist/{chunk-UCAMOW53.js → chunk-VQPZDZ3R.js} +4 -4
  179. package/dist/{chunk-2XORVHF2.js → chunk-VW7W6LCV.js} +1 -1
  180. package/dist/{chunk-FUHURDBL.js → chunk-VZLYB5LX.js} +1 -1
  181. package/dist/{chunk-BOJEZKYS.js → chunk-WD3I7AEZ.js} +11 -11
  182. package/dist/{chunk-JRCFOZEU.js → chunk-WMLBMR4E.js} +3 -3
  183. package/dist/{chunk-UOGF37Z4.js → chunk-XARBHOEZ.js} +1 -1
  184. package/dist/{chunk-ELIWGIR7.js → chunk-XBDHRMQI.js} +9 -9
  185. package/dist/{chunk-RXVFAFEB.js → chunk-XQUXL75F.js} +1 -1
  186. package/dist/{chunk-5UCRYSQJ.js → chunk-XZH5PEML.js} +5 -5
  187. package/dist/{chunk-T74FGTLW.js → chunk-Y46WPTKY.js} +6 -6
  188. package/dist/chunk-YAD7TML2.js +28 -0
  189. package/dist/{chunk-M4AOQYSP.js → chunk-YKHAI5IZ.js} +1 -1
  190. package/dist/{chunk-D5MN3LXC.js → chunk-YRZP7JN4.js} +17 -17
  191. package/dist/{chunk-EQ72AP5E.js → chunk-Z43XVU2P.js} +1 -1
  192. package/dist/{chunk-4JJ5WT4D.js → chunk-ZACNIKIQ.js} +1 -1
  193. package/dist/{chunk-VEATEVMV.js → chunk-ZG3RF2VE.js} +1 -1
  194. package/dist/{chunk-JFCCI5L2.js → chunk-ZUBTNUVE.js} +1 -1
  195. package/dist/{chunk-I5GDAQYL.js → chunk-ZYFBV4C7.js} +2 -2
  196. package/dist/data/DataTable.js +1 -1
  197. package/dist/data/EntityList.js +1 -1
  198. package/dist/data/Kanban.js +1 -1
  199. package/dist/data/ListFooter.js +1 -1
  200. package/dist/data/ListLoadError.js +1 -1
  201. package/dist/data/Pagination.js +1 -1
  202. package/dist/data/ResizableTable.js +1 -1
  203. package/dist/file-intake/index.js +1 -1
  204. package/dist/forms/BorderInput.js +1 -1
  205. package/dist/forms/BrandAssetEditor.js +1 -1
  206. package/dist/forms/Calendar.js +1 -1
  207. package/dist/forms/ColorPicker.js +1 -1
  208. package/dist/forms/ComposerAttachments.js +1 -1
  209. package/dist/forms/CornersInput.js +1 -1
  210. package/dist/forms/DatePicker.js +1 -1
  211. package/dist/forms/DateRangePicker.js +1 -1
  212. package/dist/forms/DateTimePicker.js +1 -1
  213. package/dist/forms/DisplayChips.js +1 -1
  214. package/dist/forms/FilePicker.js +1 -1
  215. package/dist/forms/FormErrorSummary.js +1 -1
  216. package/dist/forms/IconPicker.js +1 -1
  217. package/dist/forms/ImageFocusPoint.js +1 -1
  218. package/dist/forms/Input.js +1 -1
  219. package/dist/forms/InputNumber.js +1 -1
  220. package/dist/forms/LinkPicker.js +1 -1
  221. package/dist/forms/MediaLibrary.js +1 -1
  222. package/dist/forms/MediaUploadField.js +1 -1
  223. package/dist/forms/MediaUploadGrid.js +1 -1
  224. package/dist/forms/MediaUsedInList.js +1 -1
  225. package/dist/forms/NumericKeypad.js +1 -1
  226. package/dist/forms/PositionInput.js +1 -1
  227. package/dist/forms/RenameField.js +1 -1
  228. package/dist/forms/Select.js +1 -1
  229. package/dist/forms/SidesInput.js +1 -1
  230. package/dist/forms/Slider.js +1 -1
  231. package/dist/forms/Snippet.js +1 -1
  232. package/dist/forms/SplitButton.js +1 -1
  233. package/dist/forms/TagInput.js +1 -1
  234. package/dist/forms/TextToolbar.js +1 -1
  235. package/dist/forms/TimePicker.js +1 -1
  236. package/dist/forms/WidthsBar.js +1 -1
  237. package/dist/forms/mediaLibraryMenu.js +1 -1
  238. package/dist/forms/mediaMoveItems.js +1 -1
  239. package/dist/forms/textAlign.js +1 -1
  240. package/dist/forms/useFileIntake.js +1 -1
  241. package/dist/icons/index.js +1 -1
  242. package/dist/index.js +666 -666
  243. package/dist/locales/zh-Hans.js +1 -1
  244. package/dist/map/index.js +3 -3
  245. package/dist/markdown/index.js +1 -1
  246. package/dist/page-tabs/index.js +5 -5
  247. package/dist/pdf/index.js +1 -1
  248. package/dist/shell/Accordion.js +1 -1
  249. package/dist/shell/AppUpdateBanner.js +1 -1
  250. package/dist/shell/Avatar.js +1 -1
  251. package/dist/shell/Banner.js +1 -1
  252. package/dist/shell/Breadcrumbs.js +1 -1
  253. package/dist/shell/BudgetBar.js +1 -1
  254. package/dist/shell/Card.js +1 -1
  255. package/dist/shell/ColoredBadge.js +1 -1
  256. package/dist/shell/ConfirmDialog.js +1 -1
  257. package/dist/shell/ContainerFillChart.js +1 -1
  258. package/dist/shell/ContextMenu.js +1 -1
  259. package/dist/shell/CountBadge.js +1 -1
  260. package/dist/shell/Dialog.js +1 -1
  261. package/dist/shell/Drawer.js +1 -1
  262. package/dist/shell/DropdownMenu.js +1 -1
  263. package/dist/shell/EditableGrid.js +1 -1
  264. package/dist/shell/EmptyState.js +1 -1
  265. package/dist/shell/GlobalSearch.js +1 -1
  266. package/dist/shell/HelpCenter.js +1 -1
  267. package/dist/shell/IconRail.js +1 -1
  268. package/dist/shell/ImageLightbox.js +1 -1
  269. package/dist/shell/ItemCount.js +1 -1
  270. package/dist/shell/LanguageSelect.js +1 -1
  271. package/dist/shell/Markdown.js +1 -1
  272. package/dist/shell/MetricBar.js +1 -1
  273. package/dist/shell/MetricBarLegend.js +1 -1
  274. package/dist/shell/MilestoneTimeline.js +1 -1
  275. package/dist/shell/PageHeader.js +1 -1
  276. package/dist/shell/PopupMenu.js +1 -1
  277. package/dist/shell/ProductionTimeline.js +1 -1
  278. package/dist/shell/ResizeHandle.js +1 -1
  279. package/dist/shell/Result.js +1 -1
  280. package/dist/shell/SearchableSelect.js +1 -1
  281. package/dist/shell/SettingReset.js +1 -1
  282. package/dist/shell/SettingRow.js +1 -1
  283. package/dist/shell/SidebarLayout.js +1 -1
  284. package/dist/shell/SidebarNav.js +1 -1
  285. package/dist/shell/SortableList.js +1 -1
  286. package/dist/shell/Statistic.js +1 -1
  287. package/dist/shell/StepChain.js +1 -1
  288. package/dist/shell/Stepper.js +1 -1
  289. package/dist/shell/TimeAgo.js +1 -1
  290. package/dist/shell/TimelineTrack.js +1 -1
  291. package/dist/shell/TopNav.js +1 -1
  292. package/dist/shell/TransferProgress.js +1 -1
  293. package/dist/shell/Tree.js +1 -1
  294. package/dist/shell/discardGuard.js +1 -1
  295. package/dist/shell/language.js +1 -1
  296. package/dist/shell/strings.d.ts +0 -265
  297. package/dist/shell/strings.js +1 -1
  298. package/dist/shell/toast.js +1 -1
  299. package/dist/shell.css +1 -12
  300. package/dist/telemetry/index.js +1 -1
  301. package/dist/templates/AuthScreen.js +1 -1
  302. package/dist/templates/ChatTemplate.js +1 -1
  303. package/dist/templates/CheckoutTemplate.js +1 -1
  304. package/dist/templates/DashboardTemplate.js +1 -1
  305. package/dist/templates/DataTablePage.js +1 -1
  306. package/dist/templates/EmailTemplate.js +1 -1
  307. package/dist/templates/ErrorBoundary.js +1 -1
  308. package/dist/templates/ErrorPage.js +1 -1
  309. package/dist/templates/FormLayoutPage.js +1 -1
  310. package/dist/templates/GalleryTemplate.js +1 -1
  311. package/dist/ui/index.js +1 -1
  312. package/dist/version.js +1 -1
  313. package/package.json +3 -8
  314. package/dist/Calculator-XUV5JV3O.js +0 -29
  315. package/dist/Documents-IRPS3N5T.js +0 -84
  316. package/dist/Files-VN2IOPHX.js +0 -88
  317. package/dist/PdfViewer-M4RTCNNE.js +0 -1
  318. package/dist/Sidebar-OZMJNAXN.js +0 -44
  319. package/dist/Spreadsheet-YQOVGIU7.js +0 -75
  320. package/dist/chunk-2E3K4FSQ.js +0 -13
  321. package/dist/chunk-2XOH3NJZ.js +0 -27
  322. package/dist/chunk-5W3U3EVG.js +0 -7
  323. package/dist/chunk-5YP7MFPK.js +0 -1
  324. package/dist/chunk-64KZ74CS.js +0 -8
  325. package/dist/chunk-7TVGP2SX.js +0 -8
  326. package/dist/chunk-AD27M3ZH.js +0 -9
  327. package/dist/chunk-B2AYI45X.js +0 -9
  328. package/dist/chunk-CGA6RTVI.js +0 -9
  329. package/dist/chunk-CR42APAY.js +0 -8
  330. package/dist/chunk-DHMOJX2Z.js +0 -1
  331. package/dist/chunk-EBGOENC3.js +0 -3
  332. package/dist/chunk-ES2LUEPN.js +0 -22
  333. package/dist/chunk-FZWSP7KJ.js +0 -28
  334. package/dist/chunk-KV4QPU6U.js +0 -23
  335. package/dist/chunk-MFP5KOQW.js +0 -9
  336. package/dist/chunk-QDL2FNP7.js +0 -8
  337. package/dist/chunk-R7KRBKFH.js +0 -5
  338. package/dist/chunk-SI33IE7G.js +0 -2
  339. package/dist/chunk-SPMD7UZO.js +0 -19
  340. package/dist/chunk-UZTKBA7Z.js +0 -13
  341. package/dist/chunk-VTVSMRFX.js +0 -1
  342. package/dist/chunk-YXSGMPNW.js +0 -1
package/README.md CHANGED
@@ -6,7 +6,7 @@ A desktop-style React UI shell — windows, taskbar, start menu, sticky notes, f
6
6
 
7
7
  ### → [Live demo](https://efficient-pty-ltd.github.io/efficient-shell/)
8
8
 
9
- A backend-less playground hosted on GitHub Pages. Wallpapers, themes, sticky notes, the spreadsheet, all wired to `localStorage` so the page survives a refresh. Source is in [`examples/demo/`](examples/demo/).
9
+ A backend-less playground hosted on GitHub Pages. Wallpapers, themes, sticky notes, the notepad, all wired to `localStorage` so the page survives a refresh. Source is in [`examples/demo/`](examples/demo/).
10
10
 
11
11
  [![efficient-shell demo](docs/hero.png)](https://efficient-pty-ltd.github.io/efficient-shell/)
12
12
 
@@ -21,8 +21,10 @@ A backend-less playground hosted on GitHub Pages. Wallpapers, themes, sticky not
21
21
  **Page templates:** ready-made screens composed from the primitives — `<DashboardTemplate>`, `<DataTablePage>`, `<FormLayoutPage>`, `<CheckoutTemplate>`, `<EmailTemplate>`, `<ChatTemplate>`, `<GalleryTemplate>`, `<AuthScreen>`, `<ErrorPage>`. `<ErrorBoundary>` catches a render crash and shows the 500 page in place of a blank screen.
22
22
 
23
23
  **Apps:**
24
- - **Utilities:** Calculator, Notepad, Spreadsheet, Weather, CurrencyConverter, PomodoroTimer, WorldClock, TodoList
25
- - **Documents / Web:** Preview, Documents, Files, Browser
24
+ - **Utilities:** Calculator, Notepad, Weather, CurrencyConverter, PomodoroTimer, WorldClock, TodoList
25
+ - **Documents / Web:** Preview, Files, Browser
26
+
27
+ Documents and Spreadsheets are in [`efficient-office`](https://github.com/Efficient-Pty-Ltd/efficient-office) since 12.0.0.
26
28
 
27
29
  Most apps ship in the `bundledApps` registry; a few (WorldClock, Notepad) want consumer-supplied prefs wiring to persist content across reloads. The bundled `Customization` settings page is also exported separately for consumers to register at `/settings/customization`.
28
30
 
@@ -1755,15 +1757,56 @@ All exports are named — `import { Modal, ... } from 'efficient-shell'`.
1755
1757
 
1756
1758
  | Export | Type |
1757
1759
  |---|---|
1758
- | `bundledApps` | `WindowRegistry` — 12 ready-to-mount apps. |
1760
+ | `bundledApps` | `WindowRegistry` — 10 ready-to-mount apps. |
1759
1761
  | `utilityApps`, `documentApps`, `webApps` | Subsets of `bundledApps`. |
1760
- | `Calculator`, `Spreadsheet`, `Weather`, `CurrencyConverter`, `PomodoroTimer`, `TodoList`, `Browser` | Lazy components — use directly in custom registry entries. |
1762
+ | `Calculator`, `Weather`, `CurrencyConverter`, `PomodoroTimer`, `TodoList`, `Browser` | Lazy components — use directly in custom registry entries. |
1761
1763
  | `PdfViewer` | Lazy component — the PDF reader on its own, for embedding. See below. |
1762
- | `BUILTIN_APP_INFO` | Per-app metadata for the document/web apps (Spreadsheets, Notepad, Documents, Preview, Files, Browser): display name, independent app version and one-line description. Drives each app's "About" dialog (window title menu → About <App>), which also shows the shell version. The dialog's words, and each app's description, are the strings catalog's `aboutApp` section; `description` here is its English default. |
1764
+ | `BUILTIN_APP_INFO` | Per-app metadata for the document/web apps (Notepad, Preview, Files, Browser): display name, independent app version and one-line description. Drives each app's "About" dialog (window title menu → About <App>), which also shows the shell version. The dialog's words, and each app's description, are the strings catalog's `aboutApp` section; `description` here is its English default. |
1765
+
1766
+ | `setFilesStore`, `createFileServerStore`, `FilesQuotaError`, `FilesStore` (+ `FilesEntry`, `FilesListing`, `FilesFolder`, `FilesTrashEntry`, `FilesQuota`, `FilesShare`, `FilesPerson`, `FilesRole`) | Where the Files app keeps a person's files. See below. |
1767
+
1768
+ **Documents and Spreadsheets moved to `efficient-office` in 12.0.0.** `utilityApps` no longer has `/spreadsheet`, `documentApps` no longer has `/documents`, and `Documents`, `Spreadsheet`, their `BUILTIN_APP_INFO` entries and the `documents` / `spreadsheet` string sections are gone. A host registers Office's apps at those two routes itself (`efficient-office/documents`, `efficient-office/spreadsheet`). The spreadsheet stage stays here — `setSpreadsheetPreview`, `peekSpreadsheetPreviewStage`, `claimSpreadsheetPreviewStage`, `SPREADSHEET_PREVIEW_UPDATE_EVENT`, `PendingSpreadsheetStage` — and `openAttachment` still opens CSV at `/spreadsheet`, so it reaches Office's window.
1769
+
1770
+ #### Where Files keeps files — `setFilesStore`
1763
1771
 
1764
- **Spreadsheets** computes and formats like Excel or Google Sheets: about 120 functions, references across sheets, a formula bar with autocomplete, number formats as Excel format codes, borders, merged cells, frozen rows and columns, sort, column filters, and find and replace. `.xlsx` opens and saves with formulas and formatting and needs no dependency; `.xls` and `.ods` open through the optional `xlsx` peer. A function the engine lacks shows `#NAME?` on screen, and the formula itself is kept and saved. A formula returns one value: no spilled dynamic arrays, charts or pivot tables.
1772
+ Files reads and writes through a `FilesStore`. With none set it uses
1773
+ `createFileServerStore()`, the example server in `examples/file-server`
1774
+ (`window.__REACT_OS_SHELL_FILE_SERVER__`, then `http://localhost:4000`), so a
1775
+ host that ran that server sees no change. A host whose files live behind its
1776
+ own API hands Files its own store once at startup:
1777
+
1778
+ ```ts
1779
+ import { setFilesStore, FilesQuotaError, type FilesStore } from 'efficient-shell/apps';
1780
+
1781
+ const driveStore: FilesStore = {
1782
+ quota: () => api.get('/drive/quota/').then(r => r.data), // { used, limit } in bytes
1783
+ list: folderId => getFolder(folderId), // { folder, entries }
1784
+ upload: async (folderId, file) => {
1785
+ const res = await postFile(folderId, file);
1786
+ if (res.status === 413) throw new FilesQuotaError(res.data.limit, res.data.used, res.data.attempted);
1787
+ },
1788
+ // createFolder, rename, remove (to Trash), read (a Blob), trash, restore, purge, emptyTrash …
1789
+ };
1790
+ setFilesStore(driveStore);
1791
+ ```
1765
1792
 
1766
- **Documents** opens and saves real `.docx` files with no peer dependency (it needs only the browser's `CompressionStream`): paragraph styles, fonts, sizes, colour and highlight, lists, alignment, line spacing, tables with merged cells, pictures, links, page breaks, page size, orientation and margins, headers and footers with page numbers, find and replace, word count, zoom, and print (PDF comes from the browser's print dialog). What the page cannot edit survives: a paragraph or table you did not change is written back byte for byte, a changed one keeps the properties the app has no control for, and everything else in the package passes through, so a file saved with no edits is the file that was opened. Tracked changes are shown and locked, comments stay anchored as the text around them is edited, and text boxes, charts, equations and fields are shown as locked objects; a notice says when a file holds any of these. New documents are A4. The page estimates where pages break, and only Word lays the file out exactly. Plain text and code files open in a plain editor with no formatting, and keep their encoding and line endings. The optional `mammoth` peer is gone: remove it from a host if nothing else there uses it.
1793
+ - **Ids are the store's.** The file-server store uses paths; a database-backed
1794
+ store uses its row ids. `null` is the person's own root ("My files").
1795
+ - **A listing carries its folder:** `role` (`owner`, `editor`, `viewer`),
1796
+ `owner`, and `path` from the topmost ancestor the person can see. A folder
1797
+ shared as Viewer is read-only — no Upload, New Folder, Rename or Delete, and
1798
+ no drop-to-upload — and says "View only" and "Shared by …".
1799
+ - **Sharing is optional.** Give the store `sharedWithMe`, `shares`, `share`,
1800
+ `unshare` and `searchPeople` and Files adds a "Shared with me" location, a
1801
+ Shared column, and a Share action (Viewer or Editor) on what the person
1802
+ owns. Without them Files looks as it always has.
1803
+ - **Quota.** `upload` rejects with `FilesQuotaError` when the file would take
1804
+ the owner over their quota; Files words it ("Not enough space for … You've
1805
+ used … of …"). Every other rejection's `message` is shown as it is.
1806
+ - **Recent Documents.** Opening a file records a desktop shortcut. Give the
1807
+ store `shortcutPath(id)` (a stable path such as `drive:42`, never a
1808
+ presigned URL that expires) and `readShortcut(path)` (the bytes, or `null`
1809
+ for a path that is not the store's), and the shortcut reopens after a reload.
1767
1810
 
1768
1811
  #### An embedded PDF — `PdfViewer`
1769
1812
 
@@ -3926,7 +3969,7 @@ with sample arguments.
3926
3969
 
3927
3970
  </details>
3928
3971
 
3929
- <details><summary><code>aboutApp</code> — 10 keys</summary>
3972
+ <details><summary><code>aboutApp</code> — 8 keys</summary>
3930
3973
 
3931
3974
  | Key | Type | English default |
3932
3975
  |---|---|---|
@@ -3934,9 +3977,7 @@ with sample arguments.
3934
3977
  | `version` | `(version: string) => string` | `Version {version}` |
3935
3978
  | `partOf` | `(shell: string) => string` | `Part of the {shell} desktop environment` |
3936
3979
  | `shellVersion` | `(version: string) => string` | `shell v{version}` |
3937
- | `spreadsheet` | `string` | `Multi-sheet spreadsheet editor with CSV / TSV import and export.` |
3938
3980
  | `notepad` | `string` | `Color-coded notes with checklists, desktop stickies and entity autolinking.` |
3939
- | `documents` | `string` | `Word processor that opens and saves Word files, with styles, tables, page setup and find and replace, and a plain editor for text files.` |
3940
3981
  | `preview` | `string` | `Viewer for PDF documents, images, DXF drawings and 3D models — CAD-style measuring with object snap and an AutoCAD-like command bar.` |
3941
3982
  | `files` | `string` | `Personal file manager with folders, uploads, quota, trash and desktop shortcut folders.` |
3942
3983
  | `browser` | `string` | `Minimal web browser with bookmarks, history and navigation bar.` |
@@ -1,30 +1,30 @@
1
- import{InputEndActionButton as e}from"./chunk-GS74BABV.js";import"./chunk-UBQUXUD2.js";import"./chunk-34AHNPW7.js";import"./chunk-AYZY3YNC.js";import"./chunk-LE5LWALR.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-AD27M3ZH.js";import{WindowTitle as n}from"./chunk-JGWUSJDD.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PMKBWDXO.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-OLJUPBY4.js";import{confirm as s}from"./chunk-2XOH3NJZ.js";import"./chunk-R7KRBKFH.js";import"./chunk-3N2MNOV5.js";import"./chunk-3DVNXNTF.js";import"./chunk-YOXR3VKO.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-CR3YDABU.js";import"./chunk-3PZI2C4R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-F3ZOO23R.js";import"./chunk-YXSGMPNW.js";import"./chunk-FZM3ZPW3.js";import"./chunk-CDAJKLGL.js";import"./chunk-4TB4CSLB.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EOVXFXVV.js";import"./chunk-UQYNPYF4.js";import"./chunk-TE6R53YD.js";import{Icon as a}from"./chunk-7V32O5NF.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-WGLHB6WE.js";import"./chunk-NJN5IKWO.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-TWVUQUUD.js";import"./chunk-5YP7MFPK.js";import"./chunk-C3QOHMR6.js";import{useRef as i,useEffect as l,useState as c}from"react";import{jsxs as m,jsx as u,Fragment as h}from"react/jsx-runtime";var d="react-os-shell:browser-bookmarks",p="react-os-shell:browser-homepage",k="https://en.wikipedia.org/wiki/Main_Page",b=[{label:"Wikipedia",url:"https://en.wikipedia.org/wiki/Main_Page"},{label:"DevDocs",url:"https://devdocs.io"},{label:"Example",url:"https://example.com"}],g=new Set(["ac ad ae af ag ai al am ao aq ar as at au aw ax az ba bb bd be bf bg bh bi","bj bm bn bo br bs bt bw by bz ca cc cd cf cg ch ci ck cl cm cn co cr cu cv","cw cx cy cz de dj dk dm do dz ec ee eg er es et eu fi fj fk fm fo fr ga gd","ge gf gg gh gi gl gm gn gp gq gr gs gt gu gw gy hk hm hn hr ht hu id ie il","im in io iq ir is it je jm jo jp ke kg kh ki km kn kp kr kw ky kz la lb lc","li lk lr ls lt lu lv ly ma mc md me mg mh mk ml mm mn mo mp mq mr ms mt mu","mv mw mx my mz na nc ne nf ng ni nl no np nr nu nz om pa pe pf pg ph pk pl","pm pn pr ps pt pw py qa re ro rs ru rw sa sb sc sd se sg sh si sk sl sm sn","so sr ss st su sv sx sy sz tc td tf tg th tj tk tl tm tn to tr tt tv tw tz","ua ug uk us uy uz va vc ve vg vi vn vu wf ws ye yt za zm zw","com net org edu gov mil int info biz name pro app dev xyz online site tech","store shop cloud design digital agency studio media news blog live life","world today email systems solutions services software page link space host","press wiki team group works careers finance capital energy academy"].join(" ").split(" "));function f(e){let t=e.trim();return t?/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:function(e){const t=/^([\w-]+\.)+([a-z]{2,})(\/.*)?$/i.exec(e);return null!==t&&g.has(t[2].toLowerCase())}(t)?"https://"+t:"https://duckduckgo.com/?q="+encodeURIComponent(t):""}var w=["duckduckgo.com","developer.mozilla.org","google.com","gmail.com","youtube.com","facebook.com","instagram.com","whatsapp.com","twitter.com","x.com","github.com","gitlab.com","linkedin.com","reddit.com","pinterest.com","amazon.com","amazon.ca","amazon.co.uk","apple.com","icloud.com","microsoft.com","outlook.com","live.com","office.com","netflix.com","spotify.com","paypal.com","stripe.com","chat.openai.com","chatgpt.com","claude.ai"];function x(){if("undefined"==typeof window)return b;try{const e=localStorage.getItem(d);if(!e)return b;const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e?.url))return t}catch{}return b}function y(){return"undefined"==typeof window?k:localStorage.getItem(p)||k}function v(){const h=i(void 0);void 0===h.current&&(h.current=t()),l(()=>{null!=h.current&&o(h.current)},[]);const k=h.current?f(h.current.url):"",[b,g]=c(y),[w,v]=c(k||b),[C,W]=c(w),[R,D]=c([w]),[L,z]=c(0),[S,U]=c(0),[H,M]=c(x),[O,P]=c(!1),[B,E]=c(null),T=i(null),J=i(null);l(()=>{try{localStorage.setItem(d,JSON.stringify(H))}catch{}},[H]);const K=e=>{const t=f(e);t&&(v(t),W(t),D(e=>{const o=e.slice(0,L+1);return o.push(t),o}),z(e=>e+1),P(!1))},X=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},Y=()=>{const e=B?.trim();e?(M(t=>[...t,{label:e,url:w}]),E(null)):E(null)};l(()=>{if(null===B)return;T.current?.focus(),T.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||E(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==B]);const A=e=>{M(t=>t.filter((t,o)=>o!==e))},F=L>0,G=L<R.length-1,V=H.some(e=>e.url===w),Z="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
1
+ import{InputEndActionButton as e}from"./chunk-56ESGDIC.js";import"./chunk-FUUJJ7OH.js";import"./chunk-LLBH6PHE.js";import"./chunk-AYZY3YNC.js";import"./chunk-LE5LWALR.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-TBBG2AWY.js";import{WindowTitle as n}from"./chunk-M7DFM2N7.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-LOEOCZCN.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-SCCAMJB4.js";import{confirm as s}from"./chunk-4RTDZSGH.js";import"./chunk-CWTY4GTU.js";import"./chunk-RXHTIJ64.js";import"./chunk-3DVNXNTF.js";import"./chunk-C4XV42QP.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-L75RBQFH.js";import"./chunk-SCGBCBXP.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-F3ZOO23R.js";import"./chunk-S3C3XJG7.js";import"./chunk-FZM3ZPW3.js";import"./chunk-CDAJKLGL.js";import"./chunk-BFA5U5JF.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EOVXFXVV.js";import"./chunk-UQYNPYF4.js";import"./chunk-TE6R53YD.js";import{Icon as a}from"./chunk-MRFNJZRR.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-WGLHB6WE.js";import"./chunk-NJN5IKWO.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-TWVUQUUD.js";import"./chunk-43MCNASD.js";import"./chunk-C3QOHMR6.js";import{useRef as i,useEffect as l,useState as c}from"react";import{jsxs as m,jsx as u,Fragment as h}from"react/jsx-runtime";var d="react-os-shell:browser-bookmarks",p="react-os-shell:browser-homepage",k="https://en.wikipedia.org/wiki/Main_Page",b=[{label:"Wikipedia",url:"https://en.wikipedia.org/wiki/Main_Page"},{label:"DevDocs",url:"https://devdocs.io"},{label:"Example",url:"https://example.com"}],g=new Set(["ac ad ae af ag ai al am ao aq ar as at au aw ax az ba bb bd be bf bg bh bi","bj bm bn bo br bs bt bw by bz ca cc cd cf cg ch ci ck cl cm cn co cr cu cv","cw cx cy cz de dj dk dm do dz ec ee eg er es et eu fi fj fk fm fo fr ga gd","ge gf gg gh gi gl gm gn gp gq gr gs gt gu gw gy hk hm hn hr ht hu id ie il","im in io iq ir is it je jm jo jp ke kg kh ki km kn kp kr kw ky kz la lb lc","li lk lr ls lt lu lv ly ma mc md me mg mh mk ml mm mn mo mp mq mr ms mt mu","mv mw mx my mz na nc ne nf ng ni nl no np nr nu nz om pa pe pf pg ph pk pl","pm pn pr ps pt pw py qa re ro rs ru rw sa sb sc sd se sg sh si sk sl sm sn","so sr ss st su sv sx sy sz tc td tf tg th tj tk tl tm tn to tr tt tv tw tz","ua ug uk us uy uz va vc ve vg vi vn vu wf ws ye yt za zm zw","com net org edu gov mil int info biz name pro app dev xyz online site tech","store shop cloud design digital agency studio media news blog live life","world today email systems solutions services software page link space host","press wiki team group works careers finance capital energy academy"].join(" ").split(" "));function f(e){let t=e.trim();return t?/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:function(e){const t=/^([\w-]+\.)+([a-z]{2,})(\/.*)?$/i.exec(e);return null!==t&&g.has(t[2].toLowerCase())}(t)?"https://"+t:"https://duckduckgo.com/?q="+encodeURIComponent(t):""}var w=["duckduckgo.com","developer.mozilla.org","google.com","gmail.com","youtube.com","facebook.com","instagram.com","whatsapp.com","twitter.com","x.com","github.com","gitlab.com","linkedin.com","reddit.com","pinterest.com","amazon.com","amazon.ca","amazon.co.uk","apple.com","icloud.com","microsoft.com","outlook.com","live.com","office.com","netflix.com","spotify.com","paypal.com","stripe.com","chat.openai.com","chatgpt.com","claude.ai"];function x(){if("undefined"==typeof window)return b;try{const e=localStorage.getItem(d);if(!e)return b;const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e?.url))return t}catch{}return b}function y(){return"undefined"==typeof window?k:localStorage.getItem(p)||k}function v(){const h=i(void 0);void 0===h.current&&(h.current=t()),l(()=>{null!=h.current&&o(h.current)},[]);const k=h.current?f(h.current.url):"",[b,g]=c(y),[w,v]=c(k||b),[C,W]=c(w),[R,L]=c([w]),[S,z]=c(0),[D,H]=c(0),[T,E]=c(x),[J,M]=c(!1),[U,F]=c(null),G=i(null),B=i(null);l(()=>{try{localStorage.setItem(d,JSON.stringify(T))}catch{}},[T]);const X=e=>{const t=f(e);t&&(v(t),W(t),L(e=>{const o=e.slice(0,S+1);return o.push(t),o}),z(e=>e+1),M(!1))},A=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},O=()=>{const e=U?.trim();e?(E(t=>[...t,{label:e,url:w}]),F(null)):F(null)};l(()=>{if(null===U)return;G.current?.focus(),G.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||F(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==U]);const P=e=>{E(t=>t.filter((t,o)=>o!==e))},Z=S>0,Y=S<R.length-1,K=T.some(e=>e.url===w),Q="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
2
2
  return m("div",{className:"relative flex flex-col h-full bg-white",children:[
3
3
  /* @__PURE__ */u(n,{title:`Browser - ${N(w)}`}),
4
4
  /* @__PURE__ */u(r,{app:"browser"}),
5
5
  /* @__PURE__ */m("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-line bg-surface-sunken shrink-0",children:[
6
- /* @__PURE__ */u("button",{onClick:()=>{if(L>0){const e=L-1;z(e),v(R[e]),W(R[e]),P(!1)}},disabled:!F,className:Z,title:"Back",children:/* @__PURE__ */u(a,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
- /* @__PURE__ */u("button",{onClick:()=>{if(L<R.length-1){const e=L+1;z(e),v(R[e]),W(R[e]),P(!1)}},disabled:!G,className:Z,title:"Forward",children:/* @__PURE__ */u(a,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
- /* @__PURE__ */u("button",{onClick:()=>U(e=>e+1),className:Z,title:"Refresh",children:/* @__PURE__ */u(a,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
- /* @__PURE__ */u("button",{onClick:()=>K(b),className:Z,title:"Home",children:/* @__PURE__ */u(a,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
- /* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),K(C)},className:"flex-1 flex items-center mx-1",children:/* @__PURE__ */m("div",{className:"flex items-center w-full bg-white border border-gray-300 rounded focus-within:border-blue-400 focus-within:ring-1 focus-within:ring-blue-200",children:[
6
+ /* @__PURE__ */u("button",{onClick:()=>{if(S>0){const e=S-1;z(e),v(R[e]),W(R[e]),M(!1)}},disabled:!Z,className:Q,title:"Back",children:/* @__PURE__ */u(a,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
+ /* @__PURE__ */u("button",{onClick:()=>{if(S<R.length-1){const e=S+1;z(e),v(R[e]),W(R[e]),M(!1)}},disabled:!Y,className:Q,title:"Forward",children:/* @__PURE__ */u(a,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
+ /* @__PURE__ */u("button",{onClick:()=>H(e=>e+1),className:Q,title:"Refresh",children:/* @__PURE__ */u(a,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
+ /* @__PURE__ */u("button",{onClick:()=>X(b),className:Q,title:"Home",children:/* @__PURE__ */u(a,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
+ /* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),X(C)},className:"flex-1 flex items-center mx-1",children:/* @__PURE__ */m("div",{className:"flex items-center w-full bg-white border border-gray-300 rounded focus-within:border-blue-400 focus-within:ring-1 focus-within:ring-blue-200",children:[
11
11
  /* @__PURE__ */u("span",{className:"px-2 text-gray-400 text-xs",children:w.startsWith("https://")?"🔒":"⚠️"}),
12
12
  /* @__PURE__ */u("input",{type:"text",value:C,onChange:e=>W(e.target.value),onFocus:e=>e.target.select(),className:"flex-1 px-1 py-1 text-sm bg-transparent outline-none font-mono",spellCheck:!1,placeholder:"Enter URL or search…"}),w!==C&&
13
13
  /* @__PURE__ */u("span",{className:"flex pr-1",children:/* @__PURE__ */u(e,{action:{label:"Reset to current URL",icon:/* @__PURE__ */u(a,{name:"close"}),onClick:()=>W(w)}})})]})}),
14
- /* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>V?A(H.findIndex(e=>e.url===w)):void E(N(w)),className:Z+" "+(V?"text-yellow-500":""),title:V?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */u(a,{name:"star",className:"h-4 w-4",fill:V?"currentColor":"none",strokeWidth:1.5})}),
15
- /* @__PURE__ */u("button",{onClick:X,className:Z,title:"Open in new tab",children:/* @__PURE__ */u(a,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
16
- /* @__PURE__ */u("button",{onClick:()=>P(e=>!e),className:Z,title:"Embedding help",children:/* @__PURE__ */u(a,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==B&&/* @__PURE__ */m("div",{"data-bookmark-popover":!0,className:"absolute right-3 top-12 z-30 w-72 bg-white border border-gray-200 rounded-md shadow-lg p-3",children:[
14
+ /* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>K?P(T.findIndex(e=>e.url===w)):void F(N(w)),className:Q+" "+(K?"text-yellow-500":""),title:K?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */u(a,{name:"star",className:"h-4 w-4",fill:K?"currentColor":"none",strokeWidth:1.5})}),
15
+ /* @__PURE__ */u("button",{onClick:A,className:Q,title:"Open in new tab",children:/* @__PURE__ */u(a,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
16
+ /* @__PURE__ */u("button",{onClick:()=>M(e=>!e),className:Q,title:"Embedding help",children:/* @__PURE__ */u(a,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==U&&/* @__PURE__ */m("div",{"data-bookmark-popover":!0,className:"absolute right-3 top-12 z-30 w-72 bg-white border border-gray-200 rounded-md shadow-lg p-3",children:[
17
17
  /* @__PURE__ */u("div",{className:"text-2xs font-semibold uppercase tracking-wide text-ink-faint mb-1",children:"Bookmark this page"}),
18
18
  /* @__PURE__ */u("div",{className:"text-2xs text-ink-faintest truncate mb-2 font-mono",title:w,children:w}),
19
- /* @__PURE__ */u("input",{ref:T,type:"text",value:B,onChange:e=>E(e.target.value),onKeyDown:e=>{"Enter"===e.key?Y():"Escape"===e.key&&E(null)},placeholder:"Name",className:"w-full text-sm px-2 h-8 border border-line-strong rounded focus:outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200"}),
19
+ /* @__PURE__ */u("input",{ref:G,type:"text",value:U,onChange:e=>F(e.target.value),onKeyDown:e=>{"Enter"===e.key?O():"Escape"===e.key&&F(null)},placeholder:"Name",className:"w-full text-sm px-2 h-8 border border-line-strong rounded focus:outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200"}),
20
20
  /* @__PURE__ */m("div",{className:"flex justify-end gap-1 mt-2",children:[
21
- /* @__PURE__ */u("button",{onClick:()=>E(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
22
- /* @__PURE__ */u("button",{onClick:Y,disabled:!B.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
23
- /* @__PURE__ */m("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-gray-200 bg-white shrink-0 overflow-x-auto",children:[0===H.length&&/* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),H.map((e,t)=>/* @__PURE__ */m("button",{onClick:()=>K(e.url),onContextMenu:async o=>{o.preventDefault();await s({title:"Remove bookmark",message:`"${e.label}" will be removed from your bookmarks.`,confirmLabel:"Remove",variant:"danger"})&&A(t)},className:"flex items-center gap-2 px-2 py-0.5 rounded text-xs text-ink hover:bg-gray-100 whitespace-nowrap",title:`${e.url}\n(right-click to remove)`,children:[
21
+ /* @__PURE__ */u("button",{onClick:()=>F(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
22
+ /* @__PURE__ */u("button",{onClick:O,disabled:!U.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
23
+ /* @__PURE__ */m("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-gray-200 bg-white shrink-0 overflow-x-auto",children:[0===T.length&&/* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),T.map((e,t)=>/* @__PURE__ */m("button",{onClick:()=>X(e.url),onContextMenu:async o=>{o.preventDefault();await s({title:"Remove bookmark",message:`"${e.label}" will be removed from your bookmarks.`,confirmLabel:"Remove",variant:"danger"})&&P(t)},className:"flex items-center gap-2 px-2 py-0.5 rounded text-xs text-ink hover:bg-gray-100 whitespace-nowrap",title:`${e.url}\n(right-click to remove)`,children:[
24
24
  /* @__PURE__ */u("img",{src:`https://icons.duckduckgo.com/ip3/${new URL(e.url).hostname}.ico`,alt:"",className:"h-3.5 w-3.5",onError:e=>{e.target.style.visibility="hidden"}}),e.label]},t)),
25
25
  /* @__PURE__ */u("div",{className:"flex-1"}),
26
26
  /* @__PURE__ */u("button",{onClick:()=>{g(w);try{localStorage.setItem(p,w)}catch{}},className:"px-2 py-0.5 text-2xs text-ink-faint hover:text-ink-strong",title:"Set current page as homepage",children:"Set as home"})]}),
27
- /* @__PURE__ */u("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */u(j,{url:w,iframeKey:S,iframeRef:J,openExternal:X,showHelp:O,dismissHelp:()=>P(!1)})})]})}function N(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function j({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:n,dismissHelp:s}){const[i,d]=c(!1);l(()=>{d(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return w.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!i?/* @__PURE__ */u("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */m("div",{className:"max-w-md text-center",children:[
27
+ /* @__PURE__ */u("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */u(j,{url:w,iframeKey:D,iframeRef:B,openExternal:A,showHelp:J,dismissHelp:()=>M(!1)})})]})}function N(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function j({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:n,dismissHelp:s}){const[i,d]=c(!1);l(()=>{d(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return w.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!i?/* @__PURE__ */u("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */m("div",{className:"max-w-md text-center",children:[
28
28
  /* @__PURE__ */u(a,{name:"no-symbol",className:"h-14 w-14 mx-auto text-gray-300 mb-3",strokeWidth:1.2}),
29
29
  /* @__PURE__ */m("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:[N(e)," can't be embedded"]}),
30
30
  /* @__PURE__ */m("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-CRB5GM4W.js";import{useWidgetSettings as n}from"./chunk-M7DFM2N7.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-LOEOCZCN.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-SCCAMJB4.js";import"./chunk-4RTDZSGH.js";import"./chunk-CWTY4GTU.js";import"./chunk-RXHTIJ64.js";import"./chunk-3DVNXNTF.js";import"./chunk-C4XV42QP.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-L75RBQFH.js";import"./chunk-SCGBCBXP.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-F3ZOO23R.js";import"./chunk-FZM3ZPW3.js";import"./chunk-CDAJKLGL.js";import"./chunk-BFA5U5JF.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EOVXFXVV.js";import"./chunk-UQYNPYF4.js";import"./chunk-TE6R53YD.js";import{Icon as r}from"./chunk-MRFNJZRR.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-WGLHB6WE.js";import"./chunk-NJN5IKWO.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-TWVUQUUD.js";import"./chunk-43MCNASD.js";import"./chunk-C3QOHMR6.js";import{useState as c,useRef as i,useCallback as o,useEffect as s}from"react";import{jsxs as l,Fragment as a,jsx as u}from"react/jsx-runtime";var h="calc_appearance";function m(){const[m,k]=c("0"),[p,d]=c(null),[b,g]=c(null),[j,N]=c(!1),[C,y]=c(""),[x,f]=c([]),[v,$]=c(!1),[T,W]=c(()=>e(h)),[D,E]=c(!1),[F,M]=c(T),R=i(null);n(o(()=>{M({...T}),E(!0)},[T]));const S=o(e=>{y(""),k(t=>j||"0"===t?(N(!1),"."===e?"0.":e):"."===e&&t.includes(".")?t:t+e)},[j]),J=o(()=>{k("0"),d(null),g(null),N(!1)},[]),B=o((e,t,n)=>{switch(n){case"+":return e+t;case"-":return e-t;case"×":return e*t;case"÷":return 0===t?0:e/t;default:return t}},[]),w=o(e=>{const t=parseFloat(m);if(null!==p&&b&&!j){const e=B(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,B]),X=o(()=>{if(null===p||!b)return;const e=parseFloat(m),t=B(p,e,b),n=`${p} ${b} ${e} =`;f(e=>[`${n} ${t}`,...e].slice(0,20)),y(n),k(String(t)),d(null),g(null),N(!0)},[m,p,b,B]),A=o(()=>{k(e=>String(parseFloat(e)/100))},[]),G=o(()=>{k(e=>e.startsWith("-")?e.slice(1):"0"===e?e:"-"+e)},[]);s(()=>{const e=e=>{const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.key>="0"&&e.key<="9"?S(e.key):"."===e.key?S("."):"+"===e.key?w("+"):"-"===e.key?w("-"):"*"===e.key?w("×"):"/"===e.key?(e.preventDefault(),w("÷")):"Enter"===e.key||"="===e.key?("Enter"===e.key&&e.target instanceof Node&&R.current?.contains(e.target)&&e.preventDefault(),X()):"Escape"===e.key?J():"Backspace"===e.key?k(e=>e.length>1?e.slice(0,-1):"0"):"%"===e.key&&A())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[S,w,X,J,A]);const L="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",Z=`${L} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,H=`${L} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,U=`${L} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,Q=`${L} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
2
+ return l(a,{children:[
3
+ /* @__PURE__ */l("div",{ref:R,className:"flex flex-col h-full",style:{opacity:T.activeOpacity/100,backdropFilter:T.activeBlur>0?`blur(${T.activeBlur}px)`:void 0},children:[
4
+ /* @__PURE__ */l("div",{className:"bg-slate-200 rounded-t-lg px-4 py-2 group/display relative flex flex-col justify-end min-h-[120px] border-b border-slate-300",children:[
5
+ /* @__PURE__ */u("div",{className:"flex flex-col justify-end flex-1 overflow-hidden",children:x.slice(0,3).reverse().map((e,t)=>/* @__PURE__ */u("div",{className:"text-2xs text-slate-400 text-right font-mono truncate",children:e},t))}),(C||b&&null!==p)&&/* @__PURE__ */u("div",{className:"text-base text-slate-600 text-right font-mono",children:C||`${p} ${b} ${j?"":m}`}),
6
+ /* @__PURE__ */l("div",{className:"flex items-center gap-2",children:[
7
+ /* @__PURE__ */u("button",{onClick:()=>{navigator.clipboard.writeText(m),$(!0),setTimeout(()=>$(!1),1200)},title:"Copy result",className:"shrink-0 text-slate-300 hover:text-slate-500 transition-colors opacity-0 group-hover/display:opacity-100",children:/* @__PURE__ */u(r,v?{name:"check",className:"h-5 w-5 text-green-500",strokeWidth:2}:{name:"copy",className:"h-5 w-5",strokeWidth:2})}),
8
+ /* @__PURE__ */u("div",{className:"text-right text-4xl font-mono font-bold text-slate-800 truncate flex-1",children:(e=>{const t=parseFloat(e);return isNaN(t)||e.endsWith(".")||e.endsWith(".0")||Math.abs(t)<1e15&&e.length<16?e:t.toExponential(6)})(m)})]})]}),
9
+ /* @__PURE__ */l("div",{className:"grid grid-cols-4 grid-rows-5 gap-2 flex-1 min-h-0 p-2",children:[
10
+ /* @__PURE__ */u("button",{onClick:J,className:U,children:"AC"}),
11
+ /* @__PURE__ */u("button",{onClick:G,className:U,children:"+/−"}),
12
+ /* @__PURE__ */u("button",{onClick:A,className:U,children:"%"}),
13
+ /* @__PURE__ */u("button",{onClick:()=>w("÷"),className:`${H} ${"÷"===b?"ring-2 ring-blue-400":""}`,children:"÷"}),
14
+ /* @__PURE__ */u("button",{onClick:()=>S("7"),className:Z,children:"7"}),
15
+ /* @__PURE__ */u("button",{onClick:()=>S("8"),className:Z,children:"8"}),
16
+ /* @__PURE__ */u("button",{onClick:()=>S("9"),className:Z,children:"9"}),
17
+ /* @__PURE__ */u("button",{onClick:()=>w("×"),className:`${H} ${"×"===b?"ring-2 ring-blue-400":""}`,children:"×"}),
18
+ /* @__PURE__ */u("button",{onClick:()=>S("4"),className:Z,children:"4"}),
19
+ /* @__PURE__ */u("button",{onClick:()=>S("5"),className:Z,children:"5"}),
20
+ /* @__PURE__ */u("button",{onClick:()=>S("6"),className:Z,children:"6"}),
21
+ /* @__PURE__ */u("button",{onClick:()=>w("-"),className:`${H} ${"-"===b?"ring-2 ring-blue-400":""}`,children:"−"}),
22
+ /* @__PURE__ */u("button",{onClick:()=>S("1"),className:Z,children:"1"}),
23
+ /* @__PURE__ */u("button",{onClick:()=>S("2"),className:Z,children:"2"}),
24
+ /* @__PURE__ */u("button",{onClick:()=>S("3"),className:Z,children:"3"}),
25
+ /* @__PURE__ */u("button",{onClick:()=>w("+"),className:`${H} ${"+"===b?"ring-2 ring-blue-400":""}`,children:"+"}),
26
+ /* @__PURE__ */u("button",{onClick:()=>S("0"),className:`${Z} col-span-2`,children:"0"}),
27
+ /* @__PURE__ */u("button",{onClick:()=>S("."),className:Z,children:"."}),
28
+ /* @__PURE__ */u("button",{onClick:X,className:Q,children:"="})]})]}),
29
+ /* @__PURE__ */u(t,{open:D,onClose:()=>E(!1),title:"Calculator Settings",appearance:F,onAppearanceChange:M,onSave:()=>{W(F),localStorage.setItem(h,JSON.stringify(F)),E(!1)}})]})}export{m as default};
@@ -1,6 +1,6 @@
1
- import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-FD6XZRWA.js";import{useWidgetSettings as r}from"./chunk-JGWUSJDD.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PMKBWDXO.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-OLJUPBY4.js";import"./chunk-2XOH3NJZ.js";import"./chunk-R7KRBKFH.js";import"./chunk-3N2MNOV5.js";import"./chunk-3DVNXNTF.js";import"./chunk-YOXR3VKO.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-CR3YDABU.js";import"./chunk-3PZI2C4R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-F3ZOO23R.js";import"./chunk-FZM3ZPW3.js";import"./chunk-CDAJKLGL.js";import"./chunk-4TB4CSLB.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EOVXFXVV.js";import"./chunk-UQYNPYF4.js";import"./chunk-TE6R53YD.js";import"./chunk-7V32O5NF.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-WGLHB6WE.js";import"./chunk-NJN5IKWO.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-TWVUQUUD.js";import"./chunk-5YP7MFPK.js";import"./chunk-C3QOHMR6.js";import{useState as s,useCallback as o,useEffect as c}from"react";import{jsxs as i,Fragment as a,jsx as m}from"react/jsx-runtime";var l=["USD","CNY","AUD","GBP","EUR","JPY","CAD","THB","NZD","SGD","HKD","CHF","KRW","INR","MXN","BRL"],u=[["USD","CNY"],["USD","AUD"],["GBP","USD"],["USD","JPY"]],p="currency_pairs",h="currency_appearance",d="currency_rates_cache";function k(t){try{const e=JSON.parse(localStorage.getItem(d)||"{}")[t];if(e&&Date.now()-e.timestamp<36e5)return e.rates}catch{}return null}function g(t,e){try{const r=JSON.parse(localStorage.getItem(d)||"{}");r[t]={rates:e,timestamp:Date.now()},localStorage.setItem(d,JSON.stringify(r))}catch{}}function N(){try{const t=JSON.parse(localStorage.getItem(p)||"");if(Array.isArray(t)&&t.length)return t.slice(0,4)}catch{}return u}var j={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function f(){const[u,d]=s(N),[f,x]=s(()=>t(h)),[y,D]=s({}),[b,S]=s(!1),[v,C]=s(!1),[J,U]=s([]),[R,B]=s(f),[O,P]=s("USD"),[W,K]=s("CNY");r(o(()=>{U([...u]),B({...f}),C(!0)},[u,f])),c(()=>{const t=[...new Set(u.map(([t])=>t))];let e=!0;return async function(){S(!0);const r={};for(const e of t){const t=k(e);if(t)r[e]=t;else try{const t=await fetch(`https://open.er-api.com/v6/latest/${e}`),n=await t.json();n.rates&&(r[e]=n.rates,g(e,n.rates))}catch{}}e&&(D(r),S(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
1
+ import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-CRB5GM4W.js";import{useWidgetSettings as r}from"./chunk-M7DFM2N7.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-LOEOCZCN.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-SCCAMJB4.js";import"./chunk-4RTDZSGH.js";import"./chunk-CWTY4GTU.js";import"./chunk-RXHTIJ64.js";import"./chunk-3DVNXNTF.js";import"./chunk-C4XV42QP.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-L75RBQFH.js";import"./chunk-SCGBCBXP.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-F3ZOO23R.js";import"./chunk-FZM3ZPW3.js";import"./chunk-CDAJKLGL.js";import"./chunk-BFA5U5JF.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EOVXFXVV.js";import"./chunk-UQYNPYF4.js";import"./chunk-TE6R53YD.js";import"./chunk-MRFNJZRR.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-WGLHB6WE.js";import"./chunk-NJN5IKWO.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-TWVUQUUD.js";import"./chunk-43MCNASD.js";import"./chunk-C3QOHMR6.js";import{useState as s,useCallback as o,useEffect as c}from"react";import{jsxs as i,Fragment as a,jsx as m}from"react/jsx-runtime";var l=["USD","CNY","AUD","GBP","EUR","JPY","CAD","THB","NZD","SGD","HKD","CHF","KRW","INR","MXN","BRL"],u=[["USD","CNY"],["USD","AUD"],["GBP","USD"],["USD","JPY"]],p="currency_pairs",h="currency_appearance",d="currency_rates_cache";function k(t){try{const e=JSON.parse(localStorage.getItem(d)||"{}")[t];if(e&&Date.now()-e.timestamp<36e5)return e.rates}catch{}return null}function g(t,e){try{const r=JSON.parse(localStorage.getItem(d)||"{}");r[t]={rates:e,timestamp:Date.now()},localStorage.setItem(d,JSON.stringify(r))}catch{}}function N(){try{const t=JSON.parse(localStorage.getItem(p)||"");if(Array.isArray(t)&&t.length)return t.slice(0,4)}catch{}return u}var j={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function f(){const[u,d]=s(N),[f,x]=s(()=>t(h)),[y,b]=s({}),[D,S]=s(!1),[C,v]=s(!1),[J,R]=s([]),[U,B]=s(f),[M,A]=s("USD"),[F,G]=s("CNY");r(o(()=>{R([...u]),B({...f}),v(!0)},[u,f])),c(()=>{const t=[...new Set(u.map(([t])=>t))];let e=!0;return async function(){S(!0);const r={};for(const e of t){const t=k(e);if(t)r[e]=t;else try{const t=await fetch(`https://open.er-api.com/v6/latest/${e}`),n=await t.json();n.rates&&(r[e]=n.rates,g(e,n.rates))}catch{}}e&&(b(r),S(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
2
2
  return i(a,{children:[
3
- /* @__PURE__ */m("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${f.activeOpacity/100})`,backdropFilter:f.activeBlur>0?`blur(${f.activeBlur}px)`:void 0},children:/* @__PURE__ */i("div",{className:"px-4 py-3 space-y-1",children:[b&&/* @__PURE__ */m(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([t,e],r)=>{const n=y[t]?.[e];/* @__PURE__ */
3
+ /* @__PURE__ */m("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${f.activeOpacity/100})`,backdropFilter:f.activeBlur>0?`blur(${f.activeBlur}px)`:void 0},children:/* @__PURE__ */i("div",{className:"px-4 py-3 space-y-1",children:[D&&/* @__PURE__ */m(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([t,e],r)=>{const n=y[t]?.[e];/* @__PURE__ */
4
4
  return i("button",{onClick:()=>{const t=u.map((t,e)=>e===r?[t[1],t[0]]:t);d(t),localStorage.setItem(p,JSON.stringify(t))},className:"flex items-center justify-between px-2 py-2 border-b border-gray-200 last:border-0 w-full hover:bg-gray-100 rounded transition-colors cursor-pointer",children:[
5
5
  /* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
6
6
  /* @__PURE__ */m("span",{className:"text-base",children:j[t]||""}),
@@ -9,13 +9,13 @@ return i("button",{onClick:()=>{const t=u.map((t,e)=>e===r?[t[1],t[0]]:t);d(t),l
9
9
  /* @__PURE__ */m("span",{className:"text-base",children:j[e]||""}),
10
10
  /* @__PURE__ */m("span",{className:"text-sm font-semibold text-gray-700",children:e})]}),
11
11
  /* @__PURE__ */m("div",{className:"text-base font-mono font-semibold text-gray-900 tabular-nums",children:null!=n?n.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:4}):"—"})]},`${t}-${e}-${r}`)})]})}),
12
- /* @__PURE__ */m(e,{open:v,onClose:()=>C(!1),title:"Currency Settings",appearance:R,onAppearanceChange:B,onSave:()=>{if(0===J.length)return;const t=J.slice(0,4);d(t),x(R),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(R)),C(!1)},children:/* @__PURE__ */i("div",{children:[
12
+ /* @__PURE__ */m(e,{open:C,onClose:()=>v(!1),title:"Currency Settings",appearance:U,onAppearanceChange:B,onSave:()=>{if(0===J.length)return;const t=J.slice(0,4);d(t),x(U),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(U)),v(!1)},children:/* @__PURE__ */i("div",{children:[
13
13
  /* @__PURE__ */i("h3",{className:"text-sm font-semibold text-ink mb-2",children:["Currency Pairs ",
14
14
  /* @__PURE__ */i("span",{className:"text-2xs font-normal text-ink-faintest",children:["(",J.length,"/",4,")"]})]}),
15
15
  /* @__PURE__ */m("div",{className:"space-y-1 mb-2",children:J.map(([t,e],r)=>/* @__PURE__ */i("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
16
16
  /* @__PURE__ */i("span",{className:"text-sm",children:[j[t]||""," ",t," → ",j[e]||""," ",e]}),
17
- /* @__PURE__ */m("button",{onClick:()=>U(t=>t.filter((t,e)=>e!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),J.length<4?/* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
18
- /* @__PURE__ */m("select",{value:O,onChange:t=>P(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
17
+ /* @__PURE__ */m("button",{onClick:()=>R(t=>t.filter((t,e)=>e!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),J.length<4?/* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
18
+ /* @__PURE__ */m("select",{value:M,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:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
19
19
  /* @__PURE__ */m("span",{className:"text-gray-400",children:"→"}),
20
- /* @__PURE__ */m("select",{value:W,onChange:t=>K(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
21
- /* @__PURE__ */m("button",{onClick:()=>{O!==W&&J.length<4&&U(t=>[...t,[O,W]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */i("p",{className:"text-2xs text-ink-faintest italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{f as default};
20
+ /* @__PURE__ */m("select",{value:F,onChange:t=>G(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
21
+ /* @__PURE__ */m("button",{onClick:()=>{M!==F&&J.length<4&&R(t=>[...t,[M,F]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */i("p",{className:"text-2xs text-ink-faintest italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{f as default};
@@ -0,0 +1,121 @@
1
+ import{openPreviewFile as e}from"./chunk-CC42UKIT.js";import{SidebarLayout as t}from"./chunk-5V6SA77P.js";import"./chunk-QWK6DRSN.js";import"./chunk-2XQOK3CT.js";import{SearchableSelect as n}from"./chunk-BD4OHYQB.js";import{Breadcrumbs as a}from"./chunk-PXIP246B.js";import{Select_default as r}from"./chunk-HY3JYAUH.js";import"./chunk-EO5RLFRX.js";import"./chunk-GFBQ53WN.js";import"./chunk-2NMW66P5.js";import"./chunk-56ESGDIC.js";import"./chunk-FUUJJ7OH.js";import"./chunk-LLBH6PHE.js";import"./chunk-AYZY3YNC.js";import{IconButton_default as i}from"./chunk-LE5LWALR.js";import{formatBytes as s}from"./chunk-GEYM4WN3.js";import"./chunk-Y3JW2GW5.js";import"./chunk-36BRD5J3.js";import"./chunk-LF27WIN2.js";import{getFilesDemoTree as l}from"./chunk-VZLYB5LX.js";import{AboutApp as o}from"./chunk-TBBG2AWY.js";import{getFilesStore as c,peekFilesViewRequest as d,consumeFilesViewRequest as h,FILES_SHOW_TRASH_EVENT as m,FILES_OPEN_DESKTOP_FOLDER_EVENT as p,subscribeDesktopFolders as u,getDesktopFoldersSnapshot as f,hasHostFilesStore as x,FolderGlyph as k,DesktopItemMiniIcon as g,desktopItemTypeLabel as N,FilesQuotaError as w}from"./chunk-FWUXYNWF.js";import"./chunk-ESL5TDNA.js";import{useWindowManager as b,WindowTitle as v}from"./chunk-M7DFM2N7.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-LOEOCZCN.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-SCCAMJB4.js";import{confirm as y,prompt as j}from"./chunk-4RTDZSGH.js";import{Dialog as C}from"./chunk-CWTY4GTU.js";import{ItemCount as D}from"./chunk-RXHTIJ64.js";import"./chunk-3DVNXNTF.js";import"./chunk-C4XV42QP.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-L75RBQFH.js";import"./chunk-SCGBCBXP.js";import{toast_default as L}from"./chunk-TRWHVG3A.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-F3ZOO23R.js";import"./chunk-S3C3XJG7.js";import"./chunk-FZM3ZPW3.js";import"./chunk-CDAJKLGL.js";import"./chunk-BFA5U5JF.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import{Button_default as W}from"./chunk-EOVXFXVV.js";import"./chunk-UQYNPYF4.js";import"./chunk-TE6R53YD.js";import{Icon as T}from"./chunk-MRFNJZRR.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as $}from"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import{TH_ONE_LINE as E}from"./chunk-WGLHB6WE.js";import"./chunk-NJN5IKWO.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-TWVUQUUD.js";import"./chunk-43MCNASD.js";import"./chunk-C3QOHMR6.js";import{useState as F,useEffect as R,useSyncExternalStore as P,useRef as S,useCallback as M}from"react";import{jsxs as A,jsx as B,Fragment as U}from"react/jsx-runtime";var V=[{value:"viewer",label:"Viewer"},{value:"editor",label:"Editor"}];function H({store:e,entry:t,onClose:a,onChanged:s}){const[l,o]=F(null),[c,d]=F(""),[h,m]=F([]),[p,u]=F(!1),[f,x]=F(""),[k,g]=F("viewer"),[N,w]=F(!1),b=S(/* @__PURE__ */new Map),v=t?.id??null;if(R(()=>{if(o(null),x(""),d(""),!v||!e.shares)return;let t=!0;return e.shares(v).then(e=>{t&&o(e)}).catch(e=>{t&&(L.error(e.message),o([]))}),()=>{t=!1}},[v,e]),R(()=>{if(!e.searchPeople||!v)return;let t=!0;u(!0);const n=setTimeout(()=>{e.searchPeople(c).then(e=>{if(t){for(const t of e)b.current.set(t.id,t);m(e)}}).catch(()=>{t&&m([])}).finally(()=>{t&&u(!1)})},250);return()=>{t=!1,clearTimeout(n)}},[c,v,e]),!t)return null;const y=new Set((l??[]).map(e=>e.person.id)),j=h.filter(e=>!y.has(e.id)).map(e=>({value:e.id,label:e.name})),D=async n=>{w(!0);try{await n(),o(await e.shares(t.id)),s()}catch(e){L.error(e.message)}finally{w(!1)}};/* @__PURE__ */
2
+ return A(C,{open:!0,onClose:a,size:"md",title:`Share “${t.name}”`,description:"folder"===t.kind?"Everything inside this folder is shared too. Editors’ uploads count toward your quota.":"Viewers can open and download it. Editors can also replace, rename and delete it.",footer:/* @__PURE__ */B(W,{variant:"secondary",onClick:a,children:"Done"}),children:[
3
+ /* @__PURE__ */A("div",{className:"flex items-center gap-2",children:[
4
+ /* @__PURE__ */B("div",{className:"min-w-0 flex-1",children:/* @__PURE__ */B(n,{value:f,onChange:x,onSearchChange:d,loading:p&&0===h.length,options:j,placeholder:"Search colleagues by name","aria-label":"Colleague to share with"})}),
5
+ /* @__PURE__ */B("div",{className:"w-28 shrink-0",children:/* @__PURE__ */B(r,{value:k,onChange:e=>g(e),options:V,"aria-label":"Access"})}),
6
+ /* @__PURE__ */B(W,{variant:"primary",onClick:()=>{if(!f||!e.share)return;const n=b.current.get(f);D(async()=>{await e.share(t.id,f,k),x(""),d(""),n&&L.success(`Shared with ${n.name}`)})},disabled:!f||N,children:"Add"})]}),
7
+ /* @__PURE__ */B("div",{className:"mt-4 mb-1 text-2xs font-semibold uppercase tracking-wide text-ink-faintest",children:"Who has access"}),null===l?/* @__PURE__ */B($,{size:"sm",padding:"p-4",label:"Loading"}):/* @__PURE__ */A("ul",{className:"divide-y divide-line-subtle text-sm",children:[
8
+ /* @__PURE__ */A("li",{className:"flex items-center gap-2 h-10",children:[
9
+ /* @__PURE__ */B("span",{className:"flex-1 truncate",children:"You"}),
10
+ /* @__PURE__ */B("span",{className:"text-xs text-ink-faint",children:"Owner"})]}),l.map(n=>/* @__PURE__ */A("li",{className:"flex items-center gap-2 h-10",children:[
11
+ /* @__PURE__ */B("span",{className:"flex-1 truncate",title:n.person.name,children:n.person.name}),
12
+ /* @__PURE__ */B("div",{className:"w-28 shrink-0",children:/* @__PURE__ */B(r,{value:n.role,onChange:a=>D(()=>e.share(t.id,n.person.id,a)),options:V,"aria-label":`Access for ${n.person.name}`,disabled:N})}),
13
+ /* @__PURE__ */B(i,{"aria-label":`Remove ${n.person.name}`,variant:"ghost",size:"sm",disabled:N,onClick:()=>D(()=>e.unshare(t.id,n.person.id)),children:/* @__PURE__ */B(T,{name:"close",className:"h-4 w-4",strokeWidth:1.8})})]},n.person.id))]})]})}var Y={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 J(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 O(e,t){return`Not enough space for “${e}” (${s(t.attempted)}). You've used ${s(t.used)} of ${s(t.limit)}. Empty Trash or ask an administrator for more space.`}var G=(e,t)=>e instanceof Error&&e.message||t;function X(){const n=c(),r=null!==l(),i=!r&&!!n.shares&&!!n.sharedWithMe,[C,W]=F(null),[V,X]=F(null),[I,z]=F([]),[K,Q]=F([]),[Z,q]=F(null),[_,ee]=F(!0),[te,ne]=F(!1),[ae,re]=F(null),[ie,se]=F(!1),[le,oe]=F(null),[ce,de]=F(()=>{const e=d();return"trash"===e?"trash":e?{desktopFolderId:e.folderId}:"files"});R(()=>{h()},[]);const[he,me]=F([]);R(()=>{const e=()=>{h(),de("trash")},t=e=>{h();const t=e.detail?.folderId;t&&de({desktopFolderId:t})};return window.addEventListener(m,e),window.addEventListener(p,t),()=>{window.removeEventListener(m,e),window.removeEventListener(p,t)}},[]);const pe=P(u,f,f),ue="object"==typeof ce?ce.desktopFolderId:null,fe=ue?pe?.folders.find(e=>e.id===ue)??null:null,xe=ue&&pe?.itemsByFolder[ue]||[];R(()=>{ue&&pe&&!pe.folders.some(e=>e.id===ue)&&de("files")},[ue,pe]);const ke=S(0),ge=S(null),{openPage:Ne,openEntity:we}=b(),be=t=>{"preview-file"===t.entityType&&t.filePath&&t.fileKind?e({filePath:t.filePath,filename:t.label,kind:t.fileKind,onStaged:e=>Ne(e)}):"page"===t.entityType?Ne(t.entityId):we(t.entityType,t.entityId,null,t.label)},ve=M(async()=>{if(!r)try{re(await n.quota())}catch{}},[n,r]),ye=M(async e=>{if(q(null),r){const t=function(e){const t=e??"/",n=t.split("/").filter(Boolean);let a=l()??[];for(const e of n){const t=a.find(t=>"folder"===t.kind&&t.name===e);a=t?.children??[]}return{folder:{id:e,name:n[n.length-1]??"",role:"owner",path:[{id:null,name:""},...n.map((e,t)=>({id:"/"+n.slice(0,t+1).join("/"),name:e}))]},entries:a.map(e=>({id:("/"===t?"":t)+"/"+e.name,name:e.name,kind:e.kind,size:e.size??0,modifiedAt:e.modifiedAt??""}))}}(e);return X(t),ne(!1),ee(!1),void(null===e&&z(t.entries.filter(e=>"folder"===e.kind)))}ee(!0);try{const t=await n.list(e);X(t),ne(!1),null===e&&z(t.entries.filter(e=>"folder"===e.kind))}catch(e){e instanceof TypeError?ne(!0):L.error(G(e,"Failed to list"))}finally{ee(!1)}ve()},[n,ve,r]),je=M(async()=>{if(n.sharedWithMe){ee(!0),q(null);try{Q(await n.sharedWithMe()),ne(!1)}catch(e){e instanceof TypeError?ne(!0):L.error(G(e,"Failed to list shared files"))}finally{ee(!1)}}},[n]),Ce=M(async()=>{if(r)return me([]),void ee(!1);ee(!0),q(null);try{me(await n.trash()),ne(!1)}catch(e){e instanceof TypeError?ne(!0):L.error(G(e,"Failed to list trash"))}finally{ee(!1)}ve()},[n,ve,r]),De=()=>{"files"===ce?ye(C):"shared"===ce?je():"trash"===ce&&Ce()};R(()=>{De()},[C,ce]);const Le=e=>{de("files"),W(e)},We=async(e,t)=>{try{await e()}catch(e){L.error(G(e,t))}De()},Te=async e=>{try{const t=await n.read(e.id),a=URL.createObjectURL(t),r=document.createElement("a");r.href=a,r.download=e.name,r.click(),setTimeout(()=>URL.revokeObjectURL(a),1e3)}catch(e){L.error(G(e,"Download failed"))}},$e=async e=>{for(const t of Array.from(e))try{await n.upload(C,t)}catch(e){e instanceof w?L.error(O(t.name,e)):L.error(`Upload ${t.name}: ${G(e,"failed")}`)}ye(C)},Ee=()=>{ke.current=0,se(!1)};if(R(()=>{const e=()=>Ee();return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[]),te)/* @__PURE__ */
14
+ return A("div",{className:"flex flex-col h-full bg-surface",children:[
15
+ /* @__PURE__ */B(v,{title:"Files - offline"}),
16
+ /* @__PURE__ */B("div",{className:"flex-1 flex items-center justify-center p-8 text-center",children:/* @__PURE__ */A("div",{className:"max-w-md",children:[
17
+ /* @__PURE__ */B(T,{name:"close-circle",className:"h-12 w-12 mx-auto text-ink-faintest mb-3",strokeWidth:1.4}),x()?/* @__PURE__ */A(U,{children:[
18
+ /* @__PURE__ */B("h3",{className:"text-base font-semibold text-ink-strong mb-1",children:"Can't reach your files"}),
19
+ /* @__PURE__ */B("p",{className:"text-sm text-ink-faint mb-3",children:"Check your connection and try again."})]}):/* @__PURE__ */A(U,{children:[
20
+ /* @__PURE__ */B("h3",{className:"text-base font-semibold text-ink-strong mb-1",children:"Can't reach the file server"}),
21
+ /* @__PURE__ */A("p",{className:"text-sm text-ink-faint mb-3",children:["No response from the file server. Make sure the server is running — see ",
22
+ /* @__PURE__ */B("span",{className:"font-mono",children:"examples/file-server/README.md"}),"."]})]}),
23
+ /* @__PURE__ */B("button",{onClick:De,className:"px-3 h-8 text-sm bg-accent-fill text-on-accent rounded hover:bg-accent-fill-hover",children:"Retry"})]})})]});const Fe="files"===ce?V?.folder??null:null,Re=Fe?.role??"owner",Pe="owner"!==Re,Se=!r&&"files"===ce&&"viewer"!==Re,Me="files"===ce?V?.entries??[]:[],Ae=ae&&ae.limit>0?Math.min(100,Math.round(ae.used/ae.limit*100)):0,Be=Ae>90?"bg-danger":Ae>75?"bg-warning":"bg-accent-fill",Ue=(Fe?.path??[]).filter(e=>null!==e.id),Ve=[Pe?{label:"Shared with me",onClick:()=>de("shared")}:{label:"My files",onClick:()=>Le(null)},...Ue.map(e=>({label:e.name,onClick:()=>Le(e.id)}))],He=Ue.length>1?Ue[Ue.length-2].id:null,Ye=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-accent-tint font-medium text-accent-text":"text-ink hover:bg-row-hover"),Je=e=>/* @__PURE__ */B("svg",{className:"h-4 w-4 shrink-0 text-ink-faintest",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.6,children:/* @__PURE__ */B("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})}),Oe=/* @__PURE__ */A("nav",{className:"p-2",children:[
24
+ /* @__PURE__ */B("div",{className:"px-2 py-2 text-2xs font-semibold uppercase tracking-wide text-ink-faintest",children:"Locations"}),
25
+ /* @__PURE__ */A("button",{onClick:()=>Le(null),className:Ye("files"===ce&&null===C),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"]}),I.map(e=>/* @__PURE__ */A("button",{onClick:()=>Le(e.id),className:Ye("files"===ce&&C===e.id),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"),
26
+ /* @__PURE__ */B("span",{className:"truncate",children:e.name})]},e.id)),i&&/* @__PURE__ */A("button",{onClick:()=>de("shared"),className:Ye("shared"===ce||"files"===ce&&Pe),children:[
27
+ /* @__PURE__ */B(T,{name:"team",className:"h-4 w-4 shrink-0 text-ink-faintest",strokeWidth:1.6}),"Shared with me"]}),!r&&/* @__PURE__ */A("button",{onClick:()=>de("trash"),className:Ye("trash"===ce),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"]}),pe&&pe.folders.length>0&&/* @__PURE__ */A(U,{children:[
28
+ /* @__PURE__ */B("div",{className:"px-2 pt-3 pb-2 text-2xs font-semibold uppercase tracking-wide text-ink-faintest",children:"Desktop"}),pe.folders.map(e=>/* @__PURE__ */A("button",{onClick:()=>de({desktopFolderId:e.id}),className:Ye(ue===e.id),children:[
29
+ /* @__PURE__ */B(k,{className:"h-4 w-4 shrink-0 text-amber-500"}),
30
+ /* @__PURE__ */B("span",{className:"truncate",children:e.name}),
31
+ /* @__PURE__ */B(D,{count:e.itemCount,active:ue===e.id,className:"ml-auto"})]},e.id))]})]}),Ge=e=>/* @__PURE__ */B(T,"folder"===e?{name:"folder",look:"solid",className:"h-4 w-4 text-amber-500 shrink-0"}:{name:"page",className:"h-4 w-4 text-ink-faintest shrink-0",strokeWidth:1.5}),Xe="px-2 py-0.5 rounded hover:bg-row-hover text-ink-faint text-2xs ml-1",Ie=t=>{"folder"===t.kind?Le(t.id):(async t=>{if(r)return;const a=(t.name.split(".").pop()||"").toLowerCase(),i=Y[a];i?await e({filePath:n.shortcutPath?.(t.id)??t.id,filename:t.name,kind:i,load:()=>n.read(t.id),onStaged:e=>Ne(e)}):Te(t)})(t)},ze=fe?`Files - ${fe.name}`:"shared"===ce?"Files - Shared with me":"trash"===ce?"Files - Trash":Fe&&null!==Fe.id?`Files - ${Fe.name}`:"Files";/* @__PURE__ */
32
+ return A("div",{className:"relative flex flex-col h-full bg-surface",onDragEnter:e=>{Se&&e.dataTransfer?.types?.includes?.("Files")&&(e.preventDefault(),ke.current++,ie||se(!0))},onDragOver:e=>{e.dataTransfer?.types?.includes?.("Files")&&e.preventDefault()},onDragLeave:()=>{ke.current>0&&ke.current--,0===ke.current&&se(!1)},onDrop:e=>{e.preventDefault(),Ee(),Se&&e.dataTransfer.files?.length&&$e(e.dataTransfer.files)},children:[
33
+ /* @__PURE__ */B(v,{title:ze}),
34
+ /* @__PURE__ */B(o,{app:"files"}),
35
+ /* @__PURE__ */B("input",{ref:ge,type:"file",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&$e(e.target.files),ge.current&&(ge.current.value="")}}),
36
+ /* @__PURE__ */B("div",{className:"flex-1 min-h-0",children:/* @__PURE__ */B(t,{sidebar:Oe,storageKey:"files.sidebarWidth",defaultWidth:200,minWidth:150,maxWidth:320,children:/* @__PURE__ */A("div",{className:"flex h-full min-w-0 flex-col",children:[
37
+ /* @__PURE__ */A("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-line bg-surface-sunken shrink-0 text-xs",children:[/* @__PURE__ */A(U,"files"===ce?{children:[
38
+ /* @__PURE__ */B("button",{onClick:()=>{Pe&&Ue.length<=1?de("shared"):Le(He)},disabled:!Pe&&null===C,className:"px-2 py-1 rounded hover:bg-row-hover disabled:opacity-30 text-ink-muted",title:"Parent folder",children:/* @__PURE__ */B(T,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
39
+ /* @__PURE__ */A("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[
40
+ /* @__PURE__ */B("div",{className:"min-w-0 flex-1",children:/* @__PURE__ */B(a,{items:Ve,maxItems:5})}),Pe&&"viewer"===Re&&/* @__PURE__ */A("span",{className:"shrink-0 inline-flex items-center gap-1 rounded-full bg-surface-sunken px-2 py-0.5 text-2xs text-ink-faint whitespace-nowrap",children:[
41
+ /* @__PURE__ */B(T,{name:"eye",className:"h-3 w-3",strokeWidth:1.8}),"View only"]}),Pe&&Fe?.owner&&/* @__PURE__ */A("span",{className:"shrink-0 text-2xs text-ink-faint whitespace-nowrap",children:["Shared by ",Fe.owner.name]})]}),
42
+ /* @__PURE__ */B("button",{onClick:De,className:"px-2 py-1 rounded hover:bg-row-hover text-ink-muted",title:"Refresh",children:/* @__PURE__ */B(T,{name:"refresh",className:"h-3.5 w-3.5",strokeWidth:1.8})}),Se&&/* @__PURE__ */A(U,{children:[!Pe&&/* @__PURE__ */A("button",{onClick:()=>de("trash"),className:"px-2 py-1 rounded hover:bg-row-hover text-ink-muted flex items-center gap-1",title:"Open trash",children:[
43
+ /* @__PURE__ */B(T,{name:"trash",className:"h-3.5 w-3.5",strokeWidth:1.5}),"Trash"]}),
44
+ /* @__PURE__ */A("button",{onClick:async()=>{const e=await j({title:"New folder",placeholder:"Folder name",confirmLabel:"Create"});e&&(/[\\/]/.test(e)?L.error("Folder names cannot contain slashes"):We(()=>n.createFolder(C,e),"Create folder failed"))},className:"px-2 py-1 rounded hover:bg-row-hover text-ink-muted flex items-center gap-1",children:[
45
+ /* @__PURE__ */B(T,{name:"folder-plus",className:"h-3.5 w-3.5",strokeWidth:1.5}),"New Folder"]}),
46
+ /* @__PURE__ */A("button",{onClick:()=>ge.current?.click(),className:"px-2 py-1 rounded bg-accent-fill text-on-accent hover:bg-accent-fill-hover flex items-center gap-1",children:[
47
+ /* @__PURE__ */B(T,{name:"upload",className:"h-3.5 w-3.5",strokeWidth:1.8}),"Upload"]})]})]}:"shared"===ce?{children:[
48
+ /* @__PURE__ */B(T,{name:"team",className:"h-4 w-4 ml-1",strokeWidth:1.6}),
49
+ /* @__PURE__ */B("span",{className:"flex-1 text-ink font-medium px-1",children:"Shared with me"}),
50
+ /* @__PURE__ */B("button",{onClick:je,className:"px-2 py-1 rounded hover:bg-row-hover text-ink-muted",title:"Refresh",children:/* @__PURE__ */B(T,{name:"refresh",className:"h-3.5 w-3.5",strokeWidth:1.8})})]}:"trash"===ce?{children:[
51
+ /* @__PURE__ */B("button",{onClick:()=>de("files"),className:"px-2 py-1 rounded hover:bg-row-hover text-ink-muted",title:"Back to files",children:/* @__PURE__ */B(T,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
52
+ /* @__PURE__ */B("span",{className:"flex-1 text-ink font-medium px-2",children:"Trash"}),
53
+ /* @__PURE__ */B("button",{onClick:Ce,className:"px-2 py-1 rounded hover:bg-row-hover text-ink-muted",title:"Refresh",children:/* @__PURE__ */B(T,{name:"refresh",className:"h-3.5 w-3.5",strokeWidth:1.8})}),
54
+ /* @__PURE__ */B("button",{onClick:async()=>{if(0===he.length)return;await y({title:"Empty trash",message:`${he.length} item${1===he.length?"":"s"} will be permanently removed. This can't be undone.`,confirmLabel:"Empty trash",variant:"danger"})&&We(()=>n.emptyTrash(),"Empty trash failed")},disabled:0===he.length,className:"px-2 py-1 rounded text-danger-text hover:bg-status-danger-soft disabled:opacity-30 flex items-center gap-1",children:"Empty trash"})]}:{children:[
55
+ /* @__PURE__ */B("button",{onClick:()=>de("files"),className:"px-2 py-1 rounded hover:bg-row-hover text-ink-muted",title:"Back to files",children:/* @__PURE__ */B(T,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
56
+ /* @__PURE__ */B(k,{className:"h-4 w-4 text-amber-500 ml-1"}),
57
+ /* @__PURE__ */B("span",{className:"flex-1 text-ink font-medium px-1 truncate",children:fe?.name??"Desktop folder"}),
58
+ /* @__PURE__ */B("span",{className:"text-2xs text-ink-faintest px-2",children:"Desktop shortcuts"})]}),ae&&/* @__PURE__ */A(U,{children:[
59
+ /* @__PURE__ */B("div",{className:"h-4 w-px bg-line-strong mx-1"}),
60
+ /* @__PURE__ */A("div",{className:"flex items-center gap-2",title:`${s(ae.used)} of ${s(ae.limit)} used`,children:[
61
+ /* @__PURE__ */B("div",{className:"w-20 h-1.5 rounded-full bg-line overflow-hidden",children:/* @__PURE__ */B("div",{className:`h-full ${Be} transition-all`,style:{width:`${Ae}%`}})}),
62
+ /* @__PURE__ */A("span",{className:"text-2xs text-ink-faint tabular-nums whitespace-nowrap",children:[s(ae.used)," / ",s(ae.limit)]})]})]})]}),
63
+ /* @__PURE__ */B("div",{className:"flex-1 overflow-auto",children:"object"==typeof ce?0===xe.length?/* @__PURE__ */B("div",{className:"p-10 text-center text-sm text-ink-faintest",children:"This desktop folder is empty. Drag shortcuts onto it on the desktop."}):/* @__PURE__ */A("table",{className:"w-full text-sm",children:[
64
+ /* @__PURE__ */B("thead",{className:"bg-surface-sunken text-2xs uppercase tracking-wide text-ink-faint",children:/* @__PURE__ */A("tr",{children:[
65
+ /* @__PURE__ */B("th",{className:`${E} text-left font-medium px-3 h-8`,children:"Name"}),
66
+ /* @__PURE__ */B("th",{className:`${E} text-left font-medium px-3 h-8 w-28`,children:"Type"}),
67
+ /* @__PURE__ */B("th",{className:`${E} w-56`})]})}),
68
+ /* @__PURE__ */B("tbody",{children:xe.map(e=>{const t=`${e.entityType}|${e.entityId}`;/* @__PURE__ */
69
+ return A("tr",{onClick:()=>q(t),onDoubleClick:()=>be(e),className:"cursor-default border-b border-line-subtle "+(Z===t?"bg-accent-tint":"hover:bg-row-hover"),children:[
70
+ /* @__PURE__ */A("td",{className:"px-3 h-8 flex items-center gap-2",children:[
71
+ /* @__PURE__ */B(g,{item:e}),
72
+ /* @__PURE__ */B("span",{className:"truncate",title:e.label,children:e.label})]}),
73
+ /* @__PURE__ */B("td",{className:"px-3 h-8 text-xs text-ink-faint",children:N(e)}),
74
+ /* @__PURE__ */A("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:[
75
+ /* @__PURE__ */B("button",{onClick:t=>{t.stopPropagation(),be(e)},className:"px-2 py-0.5 rounded hover:bg-row-hover text-accent-text text-2xs",children:"Open"}),
76
+ /* @__PURE__ */B("button",{onClick:t=>{t.stopPropagation(),pe?.moveToDesktop([e])},className:"px-2 py-0.5 rounded hover:bg-row-hover text-ink-faint text-2xs ml-1",children:"Move to desktop"}),
77
+ /* @__PURE__ */B("button",{onClick:t=>{t.stopPropagation(),pe?.removeShortcuts([e])},className:"px-2 py-0.5 rounded hover:bg-status-danger-soft text-danger-text text-2xs ml-1",children:"Remove"})]})]},t)})})]}):"shared"===ce?_&&0===K.length?/* @__PURE__ */B($,{size:"sm",padding:"p-6",label:"Loading"}):0===K.length?/* @__PURE__ */B("div",{className:"p-10 text-center text-sm text-ink-faintest",children:"Nothing has been shared with you yet. Files and folders colleagues share with you show here."}):/* @__PURE__ */A("table",{className:"w-full text-sm",children:[
78
+ /* @__PURE__ */B("thead",{className:"bg-surface-sunken text-2xs uppercase tracking-wide text-ink-faint",children:/* @__PURE__ */A("tr",{children:[
79
+ /* @__PURE__ */B("th",{className:`${E} text-left font-medium px-3 h-8`,children:"Name"}),
80
+ /* @__PURE__ */B("th",{className:`${E} text-left font-medium px-3 h-8 w-40`,children:"Owner"}),
81
+ /* @__PURE__ */B("th",{className:`${E} text-left font-medium px-3 h-8 w-24`,children:"Access"}),
82
+ /* @__PURE__ */B("th",{className:`${E} text-right font-medium px-3 h-8 w-24`,children:"Size"}),
83
+ /* @__PURE__ */B("th",{className:`${E} w-32`})]})}),
84
+ /* @__PURE__ */B("tbody",{children:K.map(e=>/* @__PURE__ */A("tr",{onClick:()=>q(e.id),onDoubleClick:()=>Ie(e),className:"cursor-default border-b border-line-subtle "+(Z===e.id?"bg-accent-tint":"hover:bg-row-hover"),children:[
85
+ /* @__PURE__ */A("td",{className:"px-3 h-8 flex items-center gap-2",children:[Ge(e.kind),
86
+ /* @__PURE__ */B("span",{className:"truncate",title:e.name,children:e.name})]}),
87
+ /* @__PURE__ */B("td",{className:"px-3 h-8 text-ink-faint truncate",children:e.owner?.name??"—"}),
88
+ /* @__PURE__ */B("td",{className:"px-3 h-8 text-ink-faint",children:"editor"===e.role?"Editor":"Viewer"}),
89
+ /* @__PURE__ */B("td",{className:"px-3 h-8 text-right tabular-nums text-ink-faint",children:"folder"===e.kind?"—":s(e.size)}),
90
+ /* @__PURE__ */A("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:[
91
+ /* @__PURE__ */B("button",{onClick:t=>{t.stopPropagation(),Ie(e)},className:"px-2 py-0.5 rounded hover:bg-row-hover text-accent-text text-2xs",children:"Open"}),"file"===e.kind&&/* @__PURE__ */B("button",{onClick:t=>{t.stopPropagation(),Te(e)},className:Xe,children:"Download"})]})]},e.id))})]}):"trash"===ce?_&&0===he.length?/* @__PURE__ */B($,{size:"sm",padding:"p-6",label:"Loading"}):0===he.length?/* @__PURE__ */B("div",{className:"p-10 text-center text-sm text-ink-faintest",children:"Trash is empty."}):/* @__PURE__ */A("table",{className:"w-full text-sm",children:[
92
+ /* @__PURE__ */B("thead",{className:"bg-surface-sunken text-2xs uppercase tracking-wide text-ink-faint",children:/* @__PURE__ */A("tr",{children:[
93
+ /* @__PURE__ */B("th",{className:`${E} text-left font-medium px-3 h-8`,children:"Name"}),
94
+ /* @__PURE__ */B("th",{className:`${E} text-left font-medium px-3 h-8`,children:"Original location"}),
95
+ /* @__PURE__ */B("th",{className:`${E} text-right font-medium px-3 h-8 w-24`,children:"Size"}),
96
+ /* @__PURE__ */B("th",{className:`${E} text-right font-medium px-3 h-8 w-40`,children:"Deleted"}),
97
+ /* @__PURE__ */B("th",{className:`${E} w-44`})]})}),
98
+ /* @__PURE__ */B("tbody",{children:he.map(e=>/* @__PURE__ */A("tr",{className:"border-b border-line-subtle hover:bg-row-hover",children:[
99
+ /* @__PURE__ */A("td",{className:"px-3 h-8 flex items-center gap-2",children:[Ge(e.kind),
100
+ /* @__PURE__ */B("span",{className:"truncate",title:e.name,children:e.name})]}),
101
+ /* @__PURE__ */B("td",{className:"px-3 h-8 text-ink-faint text-xs font-mono truncate",title:e.originalPath,children:e.originalPath||"—"}),
102
+ /* @__PURE__ */B("td",{className:"px-3 h-8 text-right tabular-nums text-ink-faint",children:s(e.size)}),
103
+ /* @__PURE__ */B("td",{className:"px-3 h-8 text-right text-ink-faint tabular-nums",children:e.deletedAt?J(e.deletedAt):"—"}),
104
+ /* @__PURE__ */A("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:[
105
+ /* @__PURE__ */B("button",{onClick:()=>{return t=e,We(async()=>{await n.restore(t.id),L.success(`Restored "${t.name}"`)},"Restore failed");var t},className:"px-2 py-0.5 rounded hover:bg-row-hover text-accent-text text-2xs",children:"Restore"}),
106
+ /* @__PURE__ */B("button",{onClick:()=>(async e=>{await y({title:"Permanently delete",message:`"${e.name}" will be permanently removed. This can't be undone.`,confirmLabel:"Delete forever",variant:"danger"})&&We(()=>n.purge(e.id),"Delete failed")})(e),className:"px-2 py-0.5 rounded hover:bg-status-danger-soft text-danger-text text-2xs ml-1",children:"Delete forever"})]})]},e.id))})]}):_&&0===Me.length?/* @__PURE__ */B($,{size:"sm",padding:"p-6",label:"Loading"}):0===Me.length?/* @__PURE__ */A("div",{className:"p-10 text-center text-sm text-ink-faintest",children:["Empty folder.",Se&&/* @__PURE__ */A(U,{children:[" Drop files here or click ",
107
+ /* @__PURE__ */B("span",{className:"font-medium",children:"Upload"}),"."]})]}):/* @__PURE__ */A("table",{className:"w-full text-sm",children:[
108
+ /* @__PURE__ */B("thead",{className:"bg-surface-sunken text-2xs uppercase tracking-wide text-ink-faint",children:/* @__PURE__ */A("tr",{children:[
109
+ /* @__PURE__ */B("th",{className:`${E} text-left font-medium px-3 h-8`,children:"Name"}),
110
+ /* @__PURE__ */B("th",{className:`${E} text-right font-medium px-3 h-8 w-24`,children:"Size"}),
111
+ /* @__PURE__ */B("th",{className:`${E} text-right font-medium px-3 h-8 w-40`,children:"Modified"}),i&&!Pe&&/* @__PURE__ */B("th",{className:`${E} text-left font-medium px-3 h-8 w-28`,children:"Shared"}),
112
+ /* @__PURE__ */B("th",{className:`${E} w-48`})]})}),
113
+ /* @__PURE__ */B("tbody",{children:Me.map(e=>{const t=e.role??Re,a="owner"===t,l=Se&&"viewer"!==t;/* @__PURE__ */
114
+ return A("tr",{onClick:()=>q(e.id),onDoubleClick:()=>Ie(e),className:"cursor-default border-b border-line-subtle "+(Z===e.id?"bg-accent-tint":"hover:bg-row-hover"),children:[
115
+ /* @__PURE__ */A("td",{className:"px-3 h-8 flex items-center gap-2",children:[Ge(e.kind),
116
+ /* @__PURE__ */B("span",{className:"truncate",title:e.name,children:e.name})]}),
117
+ /* @__PURE__ */B("td",{className:"px-3 h-8 text-right tabular-nums text-ink-faint whitespace-nowrap",children:"folder"===e.kind?"—":s(e.size)}),
118
+ /* @__PURE__ */B("td",{className:"px-3 h-8 text-right text-ink-faint tabular-nums whitespace-nowrap",children:J(e.modifiedAt)}),i&&!Pe&&/* @__PURE__ */B("td",{className:"px-3 h-8",children:e.shareCount?/* @__PURE__ */B("span",{className:"inline-flex rounded-full bg-accent-tint px-2 py-0.5 text-2xs text-accent-text whitespace-nowrap",children:1===e.shareCount?"1 person":`${e.shareCount} people`}):/* @__PURE__ */B("span",{className:"text-ink-faintest",children:"—"})}),
119
+ /* @__PURE__ */B("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:!r&&/* @__PURE__ */A(U,{children:["file"===e.kind&&/* @__PURE__ */B("button",{onClick:t=>{t.stopPropagation(),Te(e)},className:Xe,children:"Download"}),i&&a&&/* @__PURE__ */B("button",{onClick:t=>{t.stopPropagation(),oe(e)},className:Xe,children:"Share"}),l&&/* @__PURE__ */A(U,{children:[
120
+ /* @__PURE__ */B("button",{onClick:t=>{t.stopPropagation(),(async e=>{const t=await j({title:`Rename ${e.kind}`,defaultValue:e.name,confirmLabel:"Rename"});t&&t!==e.name&&(/[\\/]/.test(t)?L.error("Names cannot contain slashes"):We(()=>n.rename(e.id,t),"Rename failed"))})(e)},className:Xe,children:"Rename"}),
121
+ /* @__PURE__ */B("button",{onClick:t=>{t.stopPropagation(),(async e=>{const t="owner"!==(e.role??"owner");await y({title:`Delete ${e.kind}`,message:`"${e.name}"${"folder"===e.kind?" and everything inside":""} will move to `+(t?`${(e.owner??V?.folder.owner)?.name??"its owner"}'s Trash.`:"Trash. You can restore it from there."),confirmLabel:"Delete",variant:"danger"})&&We(()=>n.remove(e.id),"Delete failed")})(e)},className:"px-2 py-0.5 rounded hover:bg-status-danger-soft text-danger-text text-2xs ml-1",children:"Delete"})]})]})})]},e.id)})})]})})]})})}),i&&/* @__PURE__ */B(H,{store:n,entry:le,onClose:()=>oe(null),onChanged:()=>ye(C)}),ie&&/* @__PURE__ */B("div",{className:"absolute inset-0 bg-accent-tint border-4 border-dashed border-accent-border pointer-events-none flex items-center justify-center z-20",children:/* @__PURE__ */B("div",{className:"px-4 py-2 rounded-md bg-accent-fill text-on-accent text-sm font-medium shadow-lg",children:"Drop to upload"})})]})}export{X as default,O as quotaExceededMessage};
@@ -1,8 +1,8 @@
1
- import{getNumberingConfigs as e}from"./chunk-LLSLY6BT.js";import{SidebarLayout as t}from"./chunk-6S6FJJKP.js";import"./chunk-QWK6DRSN.js";import"./chunk-UEWB6IOD.js";import{timeAgo as r}from"./chunk-GEYM4WN3.js";import"./chunk-Y3JW2GW5.js";import"./chunk-36BRD5J3.js";import"./chunk-LF27WIN2.js";import{AboutApp as n}from"./chunk-AD27M3ZH.js";import{useWindowManager as o,client_default as i}from"./chunk-JGWUSJDD.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-PMKBWDXO.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-OLJUPBY4.js";import"./chunk-2XOH3NJZ.js";import"./chunk-R7KRBKFH.js";import"./chunk-3N2MNOV5.js";import"./chunk-3DVNXNTF.js";import"./chunk-YOXR3VKO.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-CR3YDABU.js";import"./chunk-3PZI2C4R.js";import{toast_default as c}from"./chunk-KVVZLEUG.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import{useShellPrefs as s}from"./chunk-KC3EX26K.js";import"./chunk-F3ZOO23R.js";import"./chunk-YXSGMPNW.js";import"./chunk-FZM3ZPW3.js";import"./chunk-CDAJKLGL.js";import"./chunk-4TB4CSLB.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EOVXFXVV.js";import"./chunk-UQYNPYF4.js";import"./chunk-TE6R53YD.js";import{Icon as l}from"./chunk-7V32O5NF.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-WGLHB6WE.js";import"./chunk-NJN5IKWO.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-TWVUQUUD.js";import"./chunk-5YP7MFPK.js";import"./chunk-C3QOHMR6.js";import{useRef as a,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 g,jsx as x}from"react/jsx-runtime";var y=[{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:j,save:N}=s(),{data:v}=u({queryKey:["numbering-configs"],queryFn:()=>e(),retry:!1}),w=a({});p(()=>{if(!v)return;const e={};for(const t of v){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},[v]);const T=j.notepad_notes||[],[W,_]=d(null),[D,C]=d(""),[S,X]=d(""),[O,J]=d("yellow"),[K,$]=d(!1),[M,U]=d(!1),B=a(null),L=a();p(()=>{if(!W&&T.length>0){const e=T[0];_(e.id),C(e.title),X(e.content),J(e.color)}},[T.length]);const P=m(e=>{N({notepad_notes:e})},[N]),R=m(()=>{if(!W||!K)return;const e=T.map(e=>e.id===W?{...e,title:D,content:S,color:O,updated_at:/* @__PURE__ */(new Date).toISOString()}:e);P(e),$(!1)},[W,K,D,S,O,T,P]);p(()=>{if(K)return L.current&&clearTimeout(L.current),L.current=setTimeout(R,800),()=>{L.current&&clearTimeout(L.current)}},[K,R]),p(()=>()=>{K&&R()},[]);const V=e=>{K&&R(),_(e.id),C(e.title),X(e.content),J(e.color),$(!1),U(!1)},F=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),$(!0)},Y=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}`)}},Z="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.)",G=/* @__PURE__ */h(g,{children:[
2
- /* @__PURE__ */x("div",{className:"p-2 border-b border-gray-200",children:/* @__PURE__ */h("button",{onClick:()=>{K&&R();const e={id:`note-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,title:"",content:"",color:"yellow",updated_at:/* @__PURE__ */(new Date).toISOString()},t=[e,...T];P(t),_(e.id),C(""),X(""),J("yellow"),$(!1),U(!0),setTimeout(()=>B.current?.focus(),50)},className:"w-full flex items-center justify-center gap-2 rounded-lg bg-accent-fill text-on-accent px-3 min-h-8 py-1 text-sm font-medium hover:bg-accent-fill-hover transition-colors",children:[
1
+ import{getNumberingConfigs as e}from"./chunk-ACNDPAAT.js";import{SidebarLayout as t}from"./chunk-5V6SA77P.js";import"./chunk-QWK6DRSN.js";import"./chunk-2XQOK3CT.js";import{timeAgo as r}from"./chunk-GEYM4WN3.js";import"./chunk-Y3JW2GW5.js";import"./chunk-36BRD5J3.js";import"./chunk-LF27WIN2.js";import{AboutApp as n}from"./chunk-TBBG2AWY.js";import{useWindowManager as o,client_default as i}from"./chunk-M7DFM2N7.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-LOEOCZCN.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-SCCAMJB4.js";import"./chunk-4RTDZSGH.js";import"./chunk-CWTY4GTU.js";import"./chunk-RXHTIJ64.js";import"./chunk-3DVNXNTF.js";import"./chunk-C4XV42QP.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-L75RBQFH.js";import"./chunk-SCGBCBXP.js";import{toast_default as c}from"./chunk-TRWHVG3A.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import{useShellPrefs as s}from"./chunk-KC3EX26K.js";import"./chunk-F3ZOO23R.js";import"./chunk-S3C3XJG7.js";import"./chunk-FZM3ZPW3.js";import"./chunk-CDAJKLGL.js";import"./chunk-BFA5U5JF.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EOVXFXVV.js";import"./chunk-UQYNPYF4.js";import"./chunk-TE6R53YD.js";import{Icon as l}from"./chunk-MRFNJZRR.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-WGLHB6WE.js";import"./chunk-NJN5IKWO.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-TWVUQUUD.js";import"./chunk-43MCNASD.js";import"./chunk-C3QOHMR6.js";import{useRef as a,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 g,jsx as x}from"react/jsx-runtime";var y=[{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:j,save:N}=s(),{data:v}=u({queryKey:["numbering-configs"],queryFn:()=>e(),retry:!1}),T=a({});p(()=>{if(!v)return;const e={};for(const t of v){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})}}T.current=e},[v]);const w=j.notepad_notes||[],[C,_]=d(null),[W,D]=d(""),[S,X]=d(""),[$,J]=d("yellow"),[R,G]=d(!1),[M,A]=d(!1),F=a(null),B=a();p(()=>{if(!C&&w.length>0){const e=w[0];_(e.id),D(e.title),X(e.content),J(e.color)}},[w.length]);const O=m(e=>{N({notepad_notes:e})},[N]),U=m(()=>{if(!C||!R)return;const e=w.map(e=>e.id===C?{...e,title:W,content:S,color:$,updated_at:/* @__PURE__ */(new Date).toISOString()}:e);O(e),G(!1)},[C,R,W,S,$,w,O]);p(()=>{if(R)return B.current&&clearTimeout(B.current),B.current=setTimeout(U,800),()=>{B.current&&clearTimeout(B.current)}},[R,U]),p(()=>()=>{R&&U()},[]);const V=e=>{R&&U(),_(e.id),D(e.title),X(e.content),J(e.color),G(!1),A(!1)},Z=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),G(!0)},H=async(e,t)=>{const r=T.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}`)}},K="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.)",P=/* @__PURE__ */h(g,{children:[
2
+ /* @__PURE__ */x("div",{className:"p-2 border-b border-gray-200",children:/* @__PURE__ */h("button",{onClick:()=>{R&&U();const e={id:`note-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,title:"",content:"",color:"yellow",updated_at:/* @__PURE__ */(new Date).toISOString()},t=[e,...w];O(t),_(e.id),D(""),X(""),J("yellow"),G(!1),A(!0),setTimeout(()=>F.current?.focus(),50)},className:"w-full flex items-center justify-center gap-2 rounded-lg bg-accent-fill text-on-accent px-3 min-h-8 py-1 text-sm font-medium hover:bg-accent-fill-hover transition-colors",children:[
3
3
  /* @__PURE__ */x(l,{name:"add",className:"h-4 w-4",strokeWidth:2}),"New Note"]})}),
4
- /* @__PURE__ */x("div",{className:"flex-1 overflow-y-auto",children:0===T.length?/* @__PURE__ */x("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,y.find(e=>e.key===n)||y[0]);var n;/* @__PURE__ */
5
- return h("button",{onClick:()=>V(e),className:"w-full text-left px-3 py-3 border-b border-line-subtle transition-colors "+(W===e.id?"bg-accent-tint":"hover:bg-row-hover"),children:[
4
+ /* @__PURE__ */x("div",{className:"flex-1 overflow-y-auto",children:0===w.length?/* @__PURE__ */x("p",{className:"text-sm text-gray-400 text-center py-8 px-4",children:"No notes yet. Create one to get started."}):w.map(e=>{const t=(n=e.color,y.find(e=>e.key===n)||y[0]);var n;/* @__PURE__ */
5
+ return h("button",{onClick:()=>V(e),className:"w-full text-left px-3 py-3 border-b border-line-subtle transition-colors "+(C===e.id?"bg-accent-tint":"hover:bg-row-hover"),children:[
6
6
  /* @__PURE__ */h("div",{className:"flex items-center gap-2",children:[
7
7
  /* @__PURE__ */x("div",{className:`w-3 h-3 rounded-full shrink-0 ${t.dot}`}),
8
8
  /* @__PURE__ */x("span",{className:"text-sm font-medium text-gray-900 truncate flex-1",children:e.title||"Untitled"})]}),
@@ -10,12 +10,12 @@ return h("button",{onClick:()=>V(e),className:"w-full text-left px-3 py-3 border
10
10
  /* @__PURE__ */x("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__ */x(n,{app:"notepad"}),
13
- /* @__PURE__ */x(t,{sidebar:G,storageKey:"notepad.sidebarWidth",defaultWidth:224,minWidth:180,maxWidth:360,children:W?/* @__PURE__ */h("div",{className:"flex-1 flex flex-col min-w-0",children:[
13
+ /* @__PURE__ */x(t,{sidebar:P,storageKey:"notepad.sidebarWidth",defaultWidth:224,minWidth:180,maxWidth:360,children:C?/* @__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__ */x("input",{value:D,onChange:e=>{C(e.target.value),$(!0)},placeholder:"Note title...",className:"flex-1 text-lg font-semibold text-gray-900 outline-none bg-transparent placeholder:text-gray-300"}),
16
- /* @__PURE__ */x("div",{className:"flex gap-1",children:y.map(e=>/* @__PURE__ */x("button",{onClick:()=>{J(e.key),$(!0)},className:`w-5 h-5 rounded-full border-2 transition-all ${e.dot} ${O===e.key?"border-gray-600 scale-110":"border-transparent hover:border-gray-400"}`,title:e.key},e.key))}),
17
- /* @__PURE__ */x("button",{onClick:()=>(e=>{const t=T.filter(t=>t.id!==e);if(P(t),W===e){const e=t[0];e?V(e):(_(null),C(""),X(""))}})(W),title:"Delete note",className:"p-1 rounded text-gray-300 hover:text-red-500 transition-colors",children:/* @__PURE__ */x(l,{name:"trash",className:"h-4 w-4",strokeWidth:1.5})})]}),M?/* @__PURE__ */x("textarea",{ref:B,value:S,onChange:e=>{X(e.target.value),$(!0)},onBlur:()=>{U(!1),K&&R()},placeholder:Z,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__ */x("div",{onClick:()=>{U(!0),setTimeout(()=>B.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=[],c=/([A-Z]{2,4})#(\d{4,6})/g;let s;for(;null!==(s=c.exec(e));){const e=s[1],t=s[2];if(w.current[e]){const n=s.index,o=s[0];i.push({idx:n,len:o.length,render:()=>/* @__PURE__ */x("button",{onClick:()=>Y(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 a=0;for(let e=0;e<r;e++)a+=t[e].length+1;for(;null!==(s=b.exec(e));){const e="x"===s[1]||"X"===s[1],t=s.index,n=a+t;i.push({idx:t,len:s[0].length,render:()=>/* @__PURE__ */x("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__ */x(l,{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__ */x("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__ */x("span",{children:e.slice(o)},`t-${r}-${o}`)),0===n.length&&n.push(/* @__PURE__ */x("span",{children:"​"},`empty-${r}`));const p=/^\[x\]/i.test(e.trimStart());/* @__PURE__ */
18
- return x("div",{className:p?"line-through text-gray-400":"",children:n},r)})})(S):/* @__PURE__ */x("p",{className:"text-gray-300 whitespace-pre-line",children:Z})}),
15
+ /* @__PURE__ */x("input",{value:W,onChange:e=>{D(e.target.value),G(!0)},placeholder:"Note title...",className:"flex-1 text-lg font-semibold text-gray-900 outline-none bg-transparent placeholder:text-gray-300"}),
16
+ /* @__PURE__ */x("div",{className:"flex gap-1",children:y.map(e=>/* @__PURE__ */x("button",{onClick:()=>{J(e.key),G(!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__ */x("button",{onClick:()=>(e=>{const t=w.filter(t=>t.id!==e);if(O(t),C===e){const e=t[0];e?V(e):(_(null),D(""),X(""))}})(C),title:"Delete note",className:"p-1 rounded text-gray-300 hover:text-red-500 transition-colors",children:/* @__PURE__ */x(l,{name:"trash",className:"h-4 w-4",strokeWidth:1.5})})]}),M?/* @__PURE__ */x("textarea",{ref:F,value:S,onChange:e=>{X(e.target.value),G(!0)},onBlur:()=>{A(!1),R&&U()},placeholder:K,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__ */x("div",{onClick:()=>{A(!0),setTimeout(()=>F.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=[],c=/([A-Z]{2,4})#(\d{4,6})/g;let s;for(;null!==(s=c.exec(e));){const e=s[1],t=s[2];if(T.current[e]){const n=s.index,o=s[0];i.push({idx:n,len:o.length,render:()=>/* @__PURE__ */x("button",{onClick:()=>H(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 a=0;for(let e=0;e<r;e++)a+=t[e].length+1;for(;null!==(s=b.exec(e));){const e="x"===s[1]||"X"===s[1],t=s.index,n=a+t;i.push({idx:t,len:s[0].length,render:()=>/* @__PURE__ */x("button",{onClick:()=>Z(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__ */x(l,{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__ */x("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__ */x("span",{children:e.slice(o)},`t-${r}-${o}`)),0===n.length&&n.push(/* @__PURE__ */x("span",{children:"​"},`empty-${r}`));const p=/^\[x\]/i.test(e.trimStart());/* @__PURE__ */
18
+ return x("div",{className:p?"line-through text-gray-400":"",children:n},r)})})(S):/* @__PURE__ */x("p",{className:"text-gray-300 whitespace-pre-line",children:K})}),
19
19
  /* @__PURE__ */h("div",{className:"px-4 min-h-8 py-1 border-t border-line-subtle flex items-center gap-4 text-2xs text-ink-faintest",children:[
20
20
  /* @__PURE__ */x("span",{children:"[] checkbox"}),
21
21
  /* @__PURE__ */x("span",{children:"SO#35001 entity link"}),
@@ -0,0 +1 @@
1
+ export{PdfViewer as default,fitScale,pdfWasmParams}from"./chunk-5F6KJAF3.js";import"./chunk-TRWHVG3A.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRFNJZRR.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-43MCNASD.js";import"./chunk-C3QOHMR6.js";