@fde-desktop/fde-core 0.4.10 → 0.4.13

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 (221) hide show
  1. package/dist/AppEmptyState-Boej96TB.js +49 -0
  2. package/dist/AppEmptyState-CLc00OOG.cjs +1 -0
  3. package/dist/AppIcon-C8vHUVcb.cjs +1 -0
  4. package/dist/AppIcon-mtEoyzOb.js +22 -0
  5. package/dist/AppMenuBar-CAlkNHjj.cjs +1 -0
  6. package/dist/AppMenuBar-DmSfQRXU.js +197 -0
  7. package/dist/CalendarApp-DOmjWbpl.js +10 -0
  8. package/dist/CalendarApp-Z0bCCYsK.cjs +1 -0
  9. package/dist/ColorPicker-CQRRwY-y.cjs +1 -0
  10. package/dist/ColorPicker-WCeD3Wjf.js +35 -0
  11. package/dist/CreateItemApp-BkFFFdX1.cjs +1 -0
  12. package/dist/CreateItemApp-DR8Y4bwo.js +202 -0
  13. package/dist/DeviceInfoApp-BXQ9uOwF.cjs +1 -0
  14. package/dist/DeviceInfoApp-I63mJRWy.js +195 -0
  15. package/dist/DownloadProgress-CkTGTf0z.cjs +1 -0
  16. package/dist/DownloadProgress-DnVASsv5.js +39 -0
  17. package/dist/FilePickerApp-By6-vbag.cjs +1 -0
  18. package/dist/FilePickerApp-ClHuhm6Z.js +390 -0
  19. package/dist/FilesApp-BRK2OqkQ.cjs +1 -0
  20. package/dist/FilesApp-BuoFP_KA.js +212 -0
  21. package/dist/ImageViewerApp-B1niWF75.cjs +1 -0
  22. package/dist/{ImageViewerApp-CWiP6zx-.js → ImageViewerApp-iojtyFEf.js} +18 -17
  23. package/dist/{ImageViewerMenuBar-BULkh_Ku.js → ImageViewerMenuBar-BIsUokxV.js} +15 -14
  24. package/dist/ImageViewerMenuBar-BgzgSF3v.cjs +1 -0
  25. package/dist/MenuEditApp-BHptoJbz.cjs +1 -0
  26. package/dist/MenuEditApp-CJUbJaqh.js +492 -0
  27. package/dist/MenuEditMenuBar-CCOSPAUe.cjs +1 -0
  28. package/dist/{MenuEditMenuBar-B94z4Umw.js → MenuEditMenuBar-DnCL-kaZ.js} +13 -12
  29. package/dist/NotesApp-BmQIBtJ2.cjs +1 -0
  30. package/dist/NotesApp-DJ2dGt4-.js +364 -0
  31. package/dist/NotesMenuBar-BzojwMtH.cjs +1 -0
  32. package/dist/{NotesMenuBar-BB4NkKGf.js → NotesMenuBar-DILZTjnT.js} +10 -9
  33. package/dist/PdfApp-IjY_GtnW.js +39 -0
  34. package/dist/PdfApp-krW8UI97.cjs +1 -0
  35. package/dist/PdfMenuBar-Bd5MTZcZ.js +39 -0
  36. package/dist/PdfMenuBar-DWD0Qa3F.cjs +1 -0
  37. package/dist/SettingsApp-BE22l5UP.cjs +1 -0
  38. package/dist/SettingsApp-BTFtTFY_.js +1228 -0
  39. package/dist/SettingsMenuBar-CZE2evG2.cjs +1 -0
  40. package/dist/SettingsMenuBar-ktC0viTd.js +42 -0
  41. package/dist/UploaderApp-Bboc4KZ1.js +263 -0
  42. package/dist/UploaderApp-Dr1mF7oj.cjs +1 -0
  43. package/dist/{VscIcon-DueRJVTe.js → VscIcon-AEENjKOE.js} +1 -1
  44. package/dist/VscIcon-BYb_Soyy.cjs +1 -0
  45. package/dist/buildBreadcrumbs-Ccd8i11b.cjs +1 -0
  46. package/dist/buildBreadcrumbs-noWhu8os.js +45 -0
  47. package/dist/{desktopStore-B0R1-BeA.js → desktopStore-8cSZlj7s.js} +342 -549
  48. package/dist/desktopStore-C1jR6Fdb.cjs +1 -0
  49. package/dist/{imageViewerStore-CJMRXaQh.js → imageViewerStore-COrD02Zu.js} +1 -1
  50. package/dist/imageViewerStore-Dfylg59V.cjs +1 -0
  51. package/dist/index.cjs +1 -53
  52. package/dist/index.css +1 -1
  53. package/dist/index.d.ts +16 -6
  54. package/dist/index.js +3033 -7513
  55. package/dist/menuEditStore-CYwtfD6H.cjs +1 -0
  56. package/dist/{menuEditStore-C8S_EedM.js → menuEditStore-CxsgLiQu.js} +1 -1
  57. package/dist/notesStore-CrWTO6oB.cjs +1 -0
  58. package/dist/{notesStore-DKRgTTFn.js → notesStore-Dgah46U5.js} +1 -1
  59. package/dist/rolldown-runtime-CAFD8bLK.js +11 -0
  60. package/dist/{settingsAppStore-KOeWRO6h.js → settingsAppStore-DHZhi6Rl.js} +1 -1
  61. package/dist/settingsAppStore-DuYZNeFf.cjs +1 -0
  62. package/dist/useAdaptiveDimensions-3Lz4X0Tc.cjs +1 -0
  63. package/dist/{useAdaptiveDimensions-CunsU0mn.js → useAdaptiveDimensions-DxNLJ7R5.js} +1 -1
  64. package/dist/{useCloseInterceptor-CuKAAFnj.js → useCloseInterceptor-CIxhOZx1.js} +12 -12
  65. package/dist/useCloseInterceptor-CdX-09Ib.cjs +1 -0
  66. package/dist/useDynamicIcon-CK6SjEv5.cjs +1 -0
  67. package/dist/{useDynamicIcon-GJg3vWsJ.js → useDynamicIcon-_wGeWu-b.js} +1 -1
  68. package/dist/useOpenApp-ChDhsL9h.cjs +1 -0
  69. package/dist/{useOpenApp-BVpSfNrG.js → useOpenApp-uguTLkyl.js} +51 -67
  70. package/dist/{useResolvedUrl-DFKXq598.js → useResolvedUrl-B6x4xy0x.js} +1 -2
  71. package/dist/useResolvedUrl-Bb39DpVy.cjs +1 -0
  72. package/package.json +3 -4
  73. package/dist/AccordionChevron-CJXAq5o5.js +0 -26
  74. package/dist/AccordionChevron-DBXp38Lm.cjs +0 -1
  75. package/dist/ActionIcon-C_SfdBfx.cjs +0 -1
  76. package/dist/ActionIcon-CtVbYlGY.js +0 -145
  77. package/dist/AppEmptyState-BTujnL_b.js +0 -4962
  78. package/dist/AppEmptyState-Dc4GaDfu.cjs +0 -1
  79. package/dist/AppIcon--qzR4sgf.cjs +0 -1
  80. package/dist/AppIcon-DCDuaU-t.js +0 -80
  81. package/dist/AppMenuBar-BiHbNg9V.cjs +0 -9
  82. package/dist/AppMenuBar-CHJy8OF0.js +0 -2639
  83. package/dist/Box-DRm8EabO.js +0 -1593
  84. package/dist/Box-D_64wv6n.cjs +0 -1
  85. package/dist/Button-D0FXpkur.cjs +0 -1
  86. package/dist/Button-k7SxX1Xl.js +0 -178
  87. package/dist/CalendarApp-C1HvuJoa.cjs +0 -1
  88. package/dist/CalendarApp-DBEQqsS_.js +0 -1721
  89. package/dist/Center-CyryG5zn.js +0 -25
  90. package/dist/Center-T4No_FAa.cjs +0 -1
  91. package/dist/CheckIcon-C3WjIR2i.js +0 -25
  92. package/dist/CheckIcon-CBMLR6Gc.cjs +0 -1
  93. package/dist/CodeServerApp-B3l5QPuG.cjs +0 -1
  94. package/dist/CodeServerApp-BpeALSaX.js +0 -2
  95. package/dist/CodeServerApp-CRjCngFv.cjs +0 -1
  96. package/dist/CodeServerApp-DY94cy1a.js +0 -149
  97. package/dist/ColorPicker-BL4UbKCV.cjs +0 -1
  98. package/dist/ColorPicker-DvRR-wlQ.js +0 -997
  99. package/dist/CreateItemApp-BU9wmjKM.cjs +0 -1
  100. package/dist/CreateItemApp-CtdH1K1g.js +0 -400
  101. package/dist/CreateItemApp-t9F-a6wD.cjs +0 -1
  102. package/dist/DeviceInfoApp-C306YvtZ.js +0 -223
  103. package/dist/DeviceInfoApp-Cdju_LIB.cjs +0 -1
  104. package/dist/DeviceInfoApp-CyB01v4D.cjs +0 -1
  105. package/dist/DownloadProgress-IRw1dzLX.cjs +0 -1
  106. package/dist/DownloadProgress-hdupSUBT.js +0 -174
  107. package/dist/FileIcon-BCpGMI5U.js +0 -88
  108. package/dist/FileIcon-BCrsxmtt.cjs +0 -1
  109. package/dist/FilePickerApp-DMGuvahM.js +0 -409
  110. package/dist/FilePickerApp-Eu0cr2Cm.cjs +0 -1
  111. package/dist/FilesApp-BQFVHkEn.js +0 -225
  112. package/dist/FilesApp-BZ_dzZnF.cjs +0 -1
  113. package/dist/FilesApp-SIWXFPXt.cjs +0 -1
  114. package/dist/Group-BzwlMeob.js +0 -48
  115. package/dist/Group-DhwePB84.cjs +0 -1
  116. package/dist/ImageViewerApp-BOz59TGc.cjs +0 -1
  117. package/dist/ImageViewerApp-BeqY6voE.cjs +0 -1
  118. package/dist/ImageViewerApp-DBAfJPSo.js +0 -2
  119. package/dist/ImageViewerMenuBar-Cb0Nr5-M.js +0 -2
  120. package/dist/ImageViewerMenuBar-CoEp0RxK.cjs +0 -1
  121. package/dist/ImageViewerMenuBar-zOkJtqKo.cjs +0 -1
  122. package/dist/MenuEditApp-BoKtj2GH.js +0 -2
  123. package/dist/MenuEditApp-D21sEp86.js +0 -2615
  124. package/dist/MenuEditApp-k3cPfTG9.cjs +0 -1
  125. package/dist/MenuEditApp-sz9GlLVH.cjs +0 -5
  126. package/dist/MenuEditMenuBar-6QxlIDpl.cjs +0 -1
  127. package/dist/MenuEditMenuBar-Bv6R42lf.js +0 -2
  128. package/dist/MenuEditMenuBar-CBsmH_-T.cjs +0 -1
  129. package/dist/NotesApp-BtR55Hva.cjs +0 -207
  130. package/dist/NotesApp-C59exz_9.js +0 -16154
  131. package/dist/NotesApp-D47I5LS_.js +0 -2
  132. package/dist/NotesApp-lOwsi2sg.cjs +0 -1
  133. package/dist/NotesMenuBar-BZITC74y.cjs +0 -1
  134. package/dist/NotesMenuBar-Bp0sPqyR.cjs +0 -1
  135. package/dist/NotesMenuBar-xlfODmMA.js +0 -2
  136. package/dist/Paper-DtUYKmYn.js +0 -30
  137. package/dist/Paper-DwCpwWwH.cjs +0 -1
  138. package/dist/PdfApp-1XbFGfoY.cjs +0 -1
  139. package/dist/PdfApp-BhIoJWeK.cjs +0 -1
  140. package/dist/PdfApp-C5Rt1Zaw.js +0 -2
  141. package/dist/PdfApp-C8Hwxxqh.js +0 -38
  142. package/dist/PdfMenuBar-BA9rKuMP.cjs +0 -1
  143. package/dist/PdfMenuBar-JXHqwxhZ.cjs +0 -1
  144. package/dist/PdfMenuBar-R0fu7oYF.js +0 -2
  145. package/dist/PdfMenuBar-sd-9Vk3h.js +0 -38
  146. package/dist/SettingsApp-7EhpjzUE.cjs +0 -1
  147. package/dist/SettingsApp-ByiPAj1I.cjs +0 -1
  148. package/dist/SettingsApp-d6fmBHxR.js +0 -1829
  149. package/dist/SettingsApp-qKJmC0lj.js +0 -2
  150. package/dist/SettingsMenuBar-BPwv8JQK.js +0 -41
  151. package/dist/SettingsMenuBar-D8R7hOik.js +0 -2
  152. package/dist/SettingsMenuBar-DDrjZLmg.cjs +0 -1
  153. package/dist/SettingsMenuBar-DQjUa8g1.cjs +0 -1
  154. package/dist/Slider-BNO-vDFn.js +0 -1175
  155. package/dist/Slider-Bg_EIBg6.cjs +0 -1
  156. package/dist/Stack-BOaJgV3N.cjs +0 -1
  157. package/dist/Stack-CuDEaP7e.js +0 -34
  158. package/dist/StorybookApp-Bkr-7mXp.cjs +0 -1
  159. package/dist/StorybookApp-WYninkJo.js +0 -10
  160. package/dist/TerminalApp-8XbsKAWa.js +0 -10041
  161. package/dist/TerminalApp-Bq2e7QQu.cjs +0 -1
  162. package/dist/TerminalApp-CVu3Axc9.js +0 -2
  163. package/dist/TerminalApp-b7_d0jRO.cjs +0 -36
  164. package/dist/TerminalMenuBar-Cb8x9laS.js +0 -2
  165. package/dist/TerminalMenuBar-De-FH5AE.cjs +0 -1
  166. package/dist/TerminalMenuBar-iKLydNda.js +0 -112
  167. package/dist/TerminalMenuBar-yOaWd-hn.cjs +0 -1
  168. package/dist/TextInput-C3qfxxWI.js +0 -980
  169. package/dist/TextInput-DcYns3hz.cjs +0 -1
  170. package/dist/Tooltip-CAOO-qdx.js +0 -3185
  171. package/dist/Tooltip-DDh_x-CB.cjs +0 -1
  172. package/dist/UnstyledButton-CI3kyRck.js +0 -25
  173. package/dist/UnstyledButton-Cl5RuIid.cjs +0 -1
  174. package/dist/UploaderApp-C76ydsd8.js +0 -487
  175. package/dist/UploaderApp-CHACW8Yr.js +0 -2
  176. package/dist/UploaderApp-Q_a3mBik.cjs +0 -1
  177. package/dist/UploaderApp-htj59ppo.cjs +0 -1
  178. package/dist/VscIcon-CxEmqD80.cjs +0 -1
  179. package/dist/chunk-BQCxAhux.js +0 -23
  180. package/dist/chunk-CiTBaPhY.cjs +0 -1
  181. package/dist/create-safe-context-95P-Bfg3.cjs +0 -1
  182. package/dist/create-safe-context-XT2cxc14.js +0 -12
  183. package/dist/desktopStore-Cox-Og1z.cjs +0 -1
  184. package/dist/fc-DejOsQyD.cjs +0 -1
  185. package/dist/fc-kd8WzIER.js +0 -20536
  186. package/dist/fc-xJ_v2ayq.cjs +0 -184
  187. package/dist/fi-BahYsbim.js +0 -9993
  188. package/dist/fi-BkhyTcZo.cjs +0 -1
  189. package/dist/getRuntime-BLXyQZBB.cjs +0 -1
  190. package/dist/getRuntime-CCRXVzJH.js +0 -63
  191. package/dist/iconBase-B4UCuSvv.cjs +0 -1
  192. package/dist/iconBase-D7iPes7B.js +0 -108
  193. package/dist/imageViewerStore-CH1qW6md.cjs +0 -1
  194. package/dist/is-element-BocgicRg.cjs +0 -1
  195. package/dist/is-element-Bu_JY8Qy.js +0 -7
  196. package/dist/menuEditStore-CU7IAg3L.cjs +0 -1
  197. package/dist/notesStore-zKmChTfF.cjs +0 -1
  198. package/dist/react-DYmzHD0X.js +0 -27
  199. package/dist/react-Dldg32sN.cjs +0 -1
  200. package/dist/settingsAppStore-BrlImdAH.cjs +0 -1
  201. package/dist/terminalStore-LWWjCvCe.js +0 -30
  202. package/dist/terminalStore-fZe5t7Ty.cjs +0 -1
  203. package/dist/use-merged-ref-BI9n1hUK.cjs +0 -1
  204. package/dist/use-merged-ref-BT8_u6vW.js +0 -25
  205. package/dist/use-resolved-styles-api-AVDygMKo.cjs +0 -1
  206. package/dist/use-resolved-styles-api-pEOi2wiK.js +0 -21
  207. package/dist/use-uncontrolled-A4hm9ATM.js +0 -23
  208. package/dist/use-uncontrolled-BPrfGv0W.cjs +0 -1
  209. package/dist/useAdaptiveDimensions-Btp0m5Pm.cjs +0 -1
  210. package/dist/useCloseInterceptor-a_6Lcuqj.cjs +0 -1
  211. package/dist/useDynamicIcon-SytdL1Tu.cjs +0 -1
  212. package/dist/useOpenApp-Br0jo4-y.cjs +0 -1
  213. package/dist/useResolvedUrl-Be5ZlCX7.cjs +0 -1
  214. package/dist/useTranslation-DMRGdqZi.js +0 -279
  215. package/dist/useTranslation-D_O7S4RJ.cjs +0 -1
  216. package/dist/vsc-Ciibqbxo.cjs +0 -1
  217. package/dist/vsc-DGKSpOAR.js +0 -9574
  218. /package/dist/{Colors-BxX4G8kX.cjs → Colors-CNJbU7oq.cjs} +0 -0
  219. /package/dist/{Colors-hca6raEG.js → Colors-CuABn2W4.js} +0 -0
  220. /package/dist/{useMenuBarUtils-ChmpZjwu.js → useMenuBarUtils-ChAfI7OA.js} +0 -0
  221. /package/dist/{useMenuBarUtils-Bp5PiztD.cjs → useMenuBarUtils-DAap0ukp.cjs} +0 -0
@@ -1,162 +1,127 @@
1
- import { i as e, n as t } from "./getRuntime-CCRXVzJH.js";
2
- import { t as n } from "./react-DYmzHD0X.js";
3
- //#region ../../node_modules/.bun/zustand@5.0.12+10f197a4cef36846/node_modules/zustand/esm/middleware.mjs
4
- function r(e, t) {
5
- let n;
6
- try {
7
- n = e();
8
- } catch {
9
- return;
10
- }
11
- return {
12
- getItem: (e) => {
13
- let r = (e) => e === null ? null : JSON.parse(e, t?.reviver), i = n.getItem(e) ?? null;
14
- return i instanceof Promise ? i.then(r) : r(i);
15
- },
16
- setItem: (e, r) => n.setItem(e, JSON.stringify(r, t?.replacer)),
17
- removeItem: (e) => n.removeItem(e)
18
- };
19
- }
20
- var i = (e) => (t) => {
21
- try {
22
- let n = e(t);
23
- return n instanceof Promise ? n : {
24
- then(e) {
25
- return i(e)(n);
26
- },
27
- catch(e) {
28
- return this;
29
- }
30
- };
31
- } catch (e) {
32
- return {
33
- then(e) {
34
- return this;
35
- },
36
- catch(t) {
37
- return i(t)(e);
38
- }
39
- };
40
- }
41
- }, a = (e, t) => (n, a, o) => {
42
- let s = {
43
- storage: r(() => window.localStorage),
44
- partialize: (e) => e,
45
- version: 0,
46
- merge: (e, t) => ({
47
- ...t,
48
- ...e
49
- }),
50
- ...t
51
- }, c = !1, l = 0, u = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set(), f = s.storage;
52
- if (!f) return e((...e) => {
53
- console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`), n(...e);
54
- }, a, o);
55
- let p = () => {
56
- let e = s.partialize({ ...a() });
57
- return f.setItem(s.name, {
58
- state: e,
59
- version: s.version
60
- });
61
- }, m = o.setState;
62
- o.setState = (e, t) => (m(e, t), p());
63
- let h = e((...e) => (n(...e), p()), a, o);
64
- o.getInitialState = () => h;
65
- let g, _ = () => {
66
- if (!f) return;
67
- let e = ++l;
68
- c = !1, u.forEach((e) => e(a() ?? h));
69
- let t = s.onRehydrateStorage?.call(s, a() ?? h) || void 0;
70
- return i(f.getItem.bind(f))(s.name).then((e) => {
71
- if (e) if (typeof e.version == "number" && e.version !== s.version) {
72
- if (s.migrate) {
73
- let t = s.migrate(e.state, e.version);
74
- return t instanceof Promise ? t.then((e) => [!0, e]) : [!0, t];
75
- }
76
- console.error("State loaded from storage couldn't be migrated since no migrate function was provided");
77
- } else return [!1, e.state];
78
- return [!1, void 0];
79
- }).then((t) => {
80
- if (e !== l) return;
81
- let [r, i] = t;
82
- if (g = s.merge(i, a() ?? h), n(g, !0), r) return p();
83
- }).then(() => {
84
- e === l && (t?.(a(), void 0), g = a(), c = !0, d.forEach((e) => e(g)));
85
- }).catch((n) => {
86
- e === l && t?.(void 0, n);
87
- });
88
- };
89
- return o.persist = {
90
- setOptions: (e) => {
91
- s = {
92
- ...s,
93
- ...e
94
- }, e.storage && (f = e.storage);
95
- },
96
- clearStorage: () => {
97
- f?.removeItem(s.name);
98
- },
99
- getOptions: () => s,
100
- rehydrate: () => _(),
101
- hasHydrated: () => c,
102
- onHydrate: (e) => (u.add(e), () => {
103
- u.delete(e);
104
- }),
105
- onFinishHydration: (e) => (d.add(e), () => {
106
- d.delete(e);
107
- })
108
- }, s.skipHydration || _(), g || h;
109
- }, o = [];
110
- for (let e = 0; e < 256; ++e) o.push((e + 256).toString(16).slice(1));
111
- function s(e, t = 0) {
112
- return (o[e[t + 0]] + o[e[t + 1]] + o[e[t + 2]] + o[e[t + 3]] + "-" + o[e[t + 4]] + o[e[t + 5]] + "-" + o[e[t + 6]] + o[e[t + 7]] + "-" + o[e[t + 8]] + o[e[t + 9]] + "-" + o[e[t + 10]] + o[e[t + 11]] + o[e[t + 12]] + o[e[t + 13]] + o[e[t + 14]] + o[e[t + 15]]).toLowerCase();
113
- }
114
- //#endregion
115
- //#region ../../node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist/rng.js
116
- var c, l = new Uint8Array(16);
117
- function u() {
118
- if (!c) {
119
- if (typeof crypto > "u" || !crypto.getRandomValues) throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
120
- c = crypto.getRandomValues.bind(crypto);
121
- }
122
- return c(l);
123
- }
124
- var d = { randomUUID: typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto) };
125
- //#endregion
126
- //#region ../../node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist/v4.js
127
- function f(e, t, n) {
128
- e ||= {};
129
- let r = e.random ?? e.rng?.() ?? u();
130
- if (r.length < 16) throw Error("Random bytes length must be >= 16");
131
- if (r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, t) {
132
- if (n ||= 0, n < 0 || n + 16 > t.length) throw RangeError(`UUID byte range ${n}:${n + 15} is out of buffer bounds`);
133
- for (let e = 0; e < 16; ++e) t[n + e] = r[e];
134
- return t;
1
+ import { create as e } from "zustand";
2
+ import { createJSONStorage as t, persist as n } from "zustand/middleware";
3
+ import { v4 as r, v4 as i } from "uuid";
4
+ //#region src/constants/coreApps.ts
5
+ var a = {
6
+ defaultWidth: 800,
7
+ defaultHeight: 600,
8
+ minWidth: 640,
9
+ minHeight: 480
10
+ }, o = [
11
+ {
12
+ id: "files",
13
+ name: "FilesApp",
14
+ icon: "📁",
15
+ fcIcon: "FcOpenedFolder",
16
+ hasContextMenu: !0,
17
+ ...a
18
+ },
19
+ {
20
+ id: "settings",
21
+ name: "Settings",
22
+ icon: "⚙️",
23
+ fcIcon: "FcSettings",
24
+ singleWindow: !0,
25
+ ...a
26
+ },
27
+ {
28
+ id: "notepad",
29
+ name: "Notepad",
30
+ icon: "📝",
31
+ fcIcon: "FcEditImage",
32
+ ...a
33
+ },
34
+ {
35
+ id: "image-viewer",
36
+ name: "Image Viewer",
37
+ icon: "🖼️",
38
+ fcIcon: "FcPicture",
39
+ defaultWidth: 700,
40
+ defaultHeight: 520,
41
+ minWidth: 640,
42
+ minHeight: 480
43
+ },
44
+ {
45
+ id: "pdf",
46
+ name: "PDF Viewer",
47
+ icon: "📄",
48
+ fcIcon: "FcDocument",
49
+ defaultWidth: 780,
50
+ defaultHeight: 580,
51
+ minWidth: 640,
52
+ minHeight: 480
53
+ },
54
+ {
55
+ id: "uploader",
56
+ name: "Uploader",
57
+ icon: "📤",
58
+ fcIcon: "FcUpload",
59
+ ...a
60
+ },
61
+ {
62
+ id: "menuedit",
63
+ name: "MenuEdit",
64
+ icon: "📁",
65
+ fcIcon: "FcFolder",
66
+ singleWindow: !0,
67
+ ...a
68
+ },
69
+ {
70
+ id: "device-info",
71
+ name: "Device Info",
72
+ icon: "📊",
73
+ fcIcon: "FcBarChart",
74
+ defaultWidth: 300,
75
+ defaultHeight: 400,
76
+ minWidth: 280,
77
+ minHeight: 350,
78
+ canMaximize: !1,
79
+ alwaysOnTop: !0,
80
+ singleWindow: !0
81
+ },
82
+ {
83
+ id: "calendar",
84
+ name: "Calendar",
85
+ icon: "📅",
86
+ fcIcon: "FcCalendar",
87
+ defaultWidth: 320,
88
+ defaultHeight: 370,
89
+ minWidth: !1,
90
+ minHeight: !1,
91
+ canMaximize: !1,
92
+ singleWindow: !0
135
93
  }
136
- return s(r);
94
+ ], s = o.map((e) => e.id), c = [...o], l = [
95
+ "uploader",
96
+ "settings",
97
+ "notepad",
98
+ "files"
99
+ ];
100
+ function u(e) {
101
+ for (let t of e) c.find((e) => e.id === t.id) || c.push(t);
137
102
  }
138
- function p(e, t, n) {
139
- return d.randomUUID && !t && !e ? d.randomUUID() : f(e, t, n);
103
+ function d(e) {
104
+ for (let t of e) l.includes(t) || l.push(t);
140
105
  }
141
106
  //#endregion
142
107
  //#region src/utils/uuid.ts
143
- function m() {
144
- return p();
108
+ function f() {
109
+ return r();
145
110
  }
146
111
  //#endregion
147
112
  //#region src/domain/entities/Window.ts
148
- var h = (e) => ({
113
+ var p = (e) => ({
149
114
  alwaysOnTop: !1,
150
115
  ...e,
151
- id: m(),
116
+ id: f(),
152
117
  isOpen: !0,
153
118
  state: "normal",
154
119
  zIndex: 0
155
- }), g = (e) => ({
120
+ }), m = (e) => ({
156
121
  ...e,
157
- id: m()
158
- }), _ = (e) => ({
159
- id: m(),
122
+ id: f()
123
+ }), h = (e) => ({
124
+ id: f(),
160
125
  name: e.name,
161
126
  fcIcon: e.fcIcon,
162
127
  appIds: e.appIds ?? [],
@@ -164,18 +129,18 @@ var h = (e) => ({
164
129
  isPredefined: e.isPredefined ?? !1,
165
130
  order: e.order ?? 0
166
131
  }), ee = (e) => ({
167
- id: m(),
132
+ id: f(),
168
133
  name: e.name,
169
134
  fcIcon: e.fcIcon,
170
135
  appIds: e.appIds ?? [],
171
136
  isExpanded: e.isExpanded ?? !1,
172
137
  isPredefined: !0,
173
138
  order: e.order ?? 0
174
- }), te = (e, t) => ({
139
+ }), g = (e, t) => ({
175
140
  ...e,
176
141
  ...t
177
- }), v = (e, t = null, n = {}) => ({
178
- id: m(),
142
+ }), _ = (e, t = null, n = {}) => ({
143
+ id: f(),
179
144
  name: e,
180
145
  type: "folder",
181
146
  parentId: t,
@@ -183,8 +148,8 @@ var h = (e) => ({
183
148
  createdAt: /* @__PURE__ */ new Date(),
184
149
  updatedAt: /* @__PURE__ */ new Date(),
185
150
  ...n
186
- }), y = (e, t, n = null, r, i) => ({
187
- id: m(),
151
+ }), v = (e, t, n = null, r, i) => ({
152
+ id: f(),
188
153
  name: e,
189
154
  type: "file",
190
155
  content: t,
@@ -193,12 +158,12 @@ var h = (e) => ({
193
158
  createdAt: /* @__PURE__ */ new Date(),
194
159
  updatedAt: /* @__PURE__ */ new Date(),
195
160
  ...i === void 0 ? {} : { url: i }
196
- }), ne = 1e4, re = class {
161
+ }), y = 1e4, te = class {
197
162
  windows = /* @__PURE__ */ new Map();
198
163
  nextZIndex = 1;
199
164
  assignZIndex(e) {
200
165
  let t = this.nextZIndex++;
201
- return e ? ne + t : t;
166
+ return e ? y + t : t;
202
167
  }
203
168
  reset() {
204
169
  this.windows.clear(), this.nextZIndex = 1;
@@ -208,7 +173,7 @@ var h = (e) => ({
208
173
  let t = 0;
209
174
  for (let n of e) {
210
175
  this.windows.set(n.id, n);
211
- let e = n.alwaysOnTop ?? !1 ? n.zIndex - ne : n.zIndex;
176
+ let e = n.alwaysOnTop ?? !1 ? n.zIndex - y : n.zIndex;
212
177
  e > t && (t = e);
213
178
  }
214
179
  this.nextZIndex = t + 1;
@@ -220,7 +185,7 @@ var h = (e) => ({
220
185
  return this.windows.get(e);
221
186
  }
222
187
  open(e) {
223
- let t = h(e);
188
+ let t = p(e);
224
189
  return t.zIndex = this.assignZIndex(t.alwaysOnTop ?? !1), this.windows.set(t.id, t), t;
225
190
  }
226
191
  close(e) {
@@ -260,7 +225,7 @@ var h = (e) => ({
260
225
  ...t
261
226
  });
262
227
  }
263
- }, ie = {
228
+ }, ne = {
264
229
  ".txt": "text/plain",
265
230
  ".md": "text/markdown",
266
231
  ".markdown": "text/markdown",
@@ -283,11 +248,11 @@ var h = (e) => ({
283
248
  };
284
249
  function b(e) {
285
250
  let t = e.lastIndexOf(".");
286
- if (!(t === -1 || t === e.length - 1)) return ie[e.slice(t).toLowerCase()];
251
+ if (!(t === -1 || t === e.length - 1)) return ne[e.slice(t).toLowerCase()];
287
252
  }
288
253
  //#endregion
289
254
  //#region src/utils/hashBlob.ts
290
- function ae(e) {
255
+ function re(e) {
291
256
  let t = 5381;
292
257
  for (let n = 0; n < e.length; n++) t = (t << 5) + t ^ e[n], t >>>= 0;
293
258
  return t.toString(16).padStart(8, "0") + e.length.toString(16).padStart(8, "0");
@@ -298,11 +263,11 @@ async function x(e) {
298
263
  let e = await crypto.subtle.digest("SHA-256", n);
299
264
  return Array.from(new Uint8Array(e)).map((e) => e.toString(16).padStart(2, "0")).join("");
300
265
  }
301
- return console.warn("[hashBlob] crypto.subtle unavailable (non-secure context), using fallback hash"), ae(n);
266
+ return console.warn("[hashBlob] crypto.subtle unavailable (non-secure context), using fallback hash"), re(n);
302
267
  }
303
268
  //#endregion
304
269
  //#region src/infrastructure/adapters/IndexedDBFileSystem.ts
305
- var oe = "fde-desktop-fs", S = "nodes", C = "blobs", w = "metadata", se = 2, T = class {
270
+ var ie = "fde-desktop-fs", S = "nodes", C = "blobs", w = "metadata", ae = 2, T = class {
306
271
  db = null;
307
272
  nodes = /* @__PURE__ */ new Map();
308
273
  ready = !1;
@@ -317,7 +282,7 @@ var oe = "fde-desktop-fs", S = "nodes", C = "blobs", w = "metadata", se = 2, T =
317
282
  }
318
283
  openDatabase() {
319
284
  return new Promise((e, t) => {
320
- let n = indexedDB.open(oe, se);
285
+ let n = indexedDB.open(ie, ae);
321
286
  n.onerror = () => t(n.error), n.onsuccess = () => {
322
287
  this.db = n.result, e();
323
288
  }, n.onupgradeneeded = () => {
@@ -439,11 +404,11 @@ var oe = "fde-desktop-fs", S = "nodes", C = "blobs", w = "metadata", se = 2, T =
439
404
  return this.nodes.size === 0;
440
405
  }
441
406
  async createFile(e, t, n, r) {
442
- let i = y(e, t, n, b(e), r);
407
+ let i = v(e, t, n, b(e), r);
443
408
  return this.nodes.set(i.id, i), n && this.addChildToFolder(n, i.id), this.persistNode(i.id, i), i;
444
409
  }
445
410
  async createFolder(e, t, n, r) {
446
- let i = v(e, t, {
411
+ let i = _(e, t, {
447
412
  iconName: n,
448
413
  iconColor: r
449
414
  });
@@ -512,7 +477,7 @@ var oe = "fde-desktop-fs", S = "nodes", C = "blobs", w = "metadata", se = 2, T =
512
477
  async seed(e) {
513
478
  let t = this.buildFolderMapFromManifest(e);
514
479
  for (let n of e.files) {
515
- let e = t.get(n.folder), r = y(n.name, "", e?.id ?? null, n.mimeType, n.url);
480
+ let e = t.get(n.folder), r = v(n.name, "", e?.id ?? null, n.mimeType, n.url);
516
481
  if (this.nodes.set(r.id, r), e) {
517
482
  let i = {
518
483
  ...e,
@@ -539,7 +504,7 @@ var oe = "fde-desktop-fs", S = "nodes", C = "blobs", w = "metadata", se = 2, T =
539
504
  }
540
505
  continue;
541
506
  }
542
- let i = y(n.name, "", e.id, n.mimeType, n.url);
507
+ let i = v(n.name, "", e.id, n.mimeType, n.url);
543
508
  this.nodes.set(i.id, i);
544
509
  let a = {
545
510
  ...e,
@@ -560,7 +525,7 @@ var oe = "fde-desktop-fs", S = "nodes", C = "blobs", w = "metadata", se = 2, T =
560
525
  continue;
561
526
  }
562
527
  }
563
- let c = v(i, s);
528
+ let c = _(i, s);
564
529
  if (this.nodes.set(c.id, c), n.set(e, c), o) {
565
530
  let e = {
566
531
  ...o,
@@ -596,8 +561,8 @@ var oe = "fde-desktop-fs", S = "nodes", C = "blobs", w = "metadata", se = 2, T =
596
561
  e && (e.type === "folder" && this.deleteRecursive(e), this.nodes.delete(t), this.deleteNodeFromPersist(t));
597
562
  }
598
563
  }
599
- }, ce = "/api/fs", le = 6e4;
600
- async function ue(e, t = {}, n = le) {
564
+ }, oe = "/api/fs", se = 6e4;
565
+ async function ce(e, t = {}, n = se) {
601
566
  let r = new AbortController(), i = setTimeout(() => r.abort(), n);
602
567
  try {
603
568
  return await fetch(e, {
@@ -608,18 +573,18 @@ async function ue(e, t = {}, n = le) {
608
573
  clearTimeout(i);
609
574
  }
610
575
  }
611
- var E = ce;
612
- function de(e) {
576
+ var E = oe;
577
+ function le(e) {
613
578
  E = e;
614
579
  }
615
- var fe = class {
580
+ var ue = class {
616
581
  nodes = /* @__PURE__ */ new Map();
617
582
  pathToId = /* @__PURE__ */ new Map();
618
583
  ready = !1;
619
584
  rootFolderId;
620
585
  initPromise = null;
621
586
  constructor() {
622
- this.rootFolderId = m(), this.pathToId.set("/", this.rootFolderId);
587
+ this.rootFolderId = f(), this.pathToId.set("/", this.rootFolderId);
623
588
  }
624
589
  async initialize() {
625
590
  return this.initPromise ||= this.doInitialize(), this.initPromise;
@@ -637,7 +602,7 @@ var fe = class {
637
602
  this.ready = !0;
638
603
  }
639
604
  async reinitialize() {
640
- this.ready = !1, this.nodes.clear(), this.pathToId.clear(), this.rootFolderId = m(), this.pathToId.set("/", this.rootFolderId), this.initPromise = null, await this.initialize();
605
+ this.ready = !1, this.nodes.clear(), this.pathToId.clear(), this.rootFolderId = f(), this.pathToId.set("/", this.rootFolderId), this.initPromise = null, await this.initialize();
641
606
  }
642
607
  isReady() {
643
608
  return this.ready;
@@ -660,8 +625,8 @@ var fe = class {
660
625
  return Array.from(this.nodes.values());
661
626
  }
662
627
  async createFile(e, t, n, r) {
663
- let i = m(), a = n ? this.getPathFromId(n) : "/", o = a ? `${a}/${e}`.replace("//", "/") : `/${e}`, s = r ?? `/api/fs?action=file&path=${encodeURIComponent(o)}`, c = {
664
- ...y(e, t, n, this.getMimeType(e), s),
628
+ let i = f(), a = n ? this.getPathFromId(n) : "/", o = a ? `${a}/${e}`.replace("//", "/") : `/${e}`, s = r ?? `/api/fs?action=file&path=${encodeURIComponent(o)}`, c = {
629
+ ...v(e, t, n, this.getMimeType(e), s),
665
630
  id: i
666
631
  };
667
632
  this.nodes.set(i, c), this.pathToId.set(o, i);
@@ -673,10 +638,10 @@ var fe = class {
673
638
  return c;
674
639
  }
675
640
  async createFolder(e, t, n, r) {
676
- let i = m(), a = t ? this.getPathFromId(t) : "/", o = a ? `${a}/${e}`.replace("//", "/") : `/${e}`, s = {};
641
+ let i = f(), a = t ? this.getPathFromId(t) : "/", o = a ? `${a}/${e}`.replace("//", "/") : `/${e}`, s = {};
677
642
  n && (s.iconName = n), r && (s.iconColor = r);
678
643
  let c = {
679
- ...v(e, t, s),
644
+ ..._(e, t, s),
680
645
  id: i
681
646
  };
682
647
  this.nodes.set(i, c), this.pathToId.set(o, i);
@@ -713,7 +678,7 @@ var fe = class {
713
678
  let r = this.getPathFromId(e), i = t ? this.getPathFromId(t) : "/", a = i ? `${i}/${n.name}`.replace("//", "/") : `/${n.name}`;
714
679
  if (!r) throw Error(`Cannot determine path for node ${e}`);
715
680
  if (!i && t !== null) throw Error(`Cannot determine parent path for ${t}`);
716
- let o = await ue(`${E}?action=move&oldPath=${encodeURIComponent(r)}&newPath=${encodeURIComponent(a)}`);
681
+ let o = await ce(`${E}?action=move&oldPath=${encodeURIComponent(r)}&newPath=${encodeURIComponent(a)}`);
717
682
  if (!o.ok) {
718
683
  let e = await o.json().catch(() => ({}));
719
684
  throw Error(e.error || `HTTP ${o.status}`);
@@ -787,7 +752,7 @@ var fe = class {
787
752
  return Promise.resolve();
788
753
  }
789
754
  async clearAll() {
790
- this.nodes.clear(), this.pathToId.clear(), this.ready = !1, this.initPromise = null, this.rootFolderId = m(), this.pathToId.set("/", this.rootFolderId);
755
+ this.nodes.clear(), this.pathToId.clear(), this.ready = !1, this.initPromise = null, this.rootFolderId = f(), this.pathToId.set("/", this.rootFolderId);
791
756
  }
792
757
  getMimeType(e) {
793
758
  return b(e) || "application/octet-stream";
@@ -808,9 +773,9 @@ var fe = class {
808
773
  }
809
774
  async syncFromEntries(e, t) {
810
775
  for (let n of e) {
811
- let e = m();
776
+ let e = f();
812
777
  if (n.type === "directory") {
813
- let r = v(n.name, t);
778
+ let r = _(n.name, t);
814
779
  this.nodes.set(e, {
815
780
  ...r,
816
781
  id: e
@@ -818,7 +783,7 @@ var fe = class {
818
783
  let i = await this.fetchReaddir(n.path);
819
784
  await this.syncFromEntries(i, e);
820
785
  } else {
821
- let r = `/api/fs?action=file&path=${encodeURIComponent(n.path)}`, i = y(n.name, "", t, this.getMimeType(n.name), r);
786
+ let r = `/api/fs?action=file&path=${encodeURIComponent(n.path)}`, i = v(n.name, "", t, this.getMimeType(n.name), r);
822
787
  this.nodes.set(e, {
823
788
  ...i,
824
789
  id: e
@@ -864,7 +829,27 @@ var fe = class {
864
829
  console.warn(`[DockerFS] Failed to delete ${e}:`, t);
865
830
  }
866
831
  }
867
- }, pe = "launcher-folder-custom-apps", me = [
832
+ };
833
+ //#endregion
834
+ //#region src/utils/getRuntime.ts
835
+ function D() {
836
+ return typeof window > "u" ? "browser" : window.__FDE_IN_DOCKER__ === !0 ? "docker" : typeof navigator < "u" && /Electron/i.test(navigator.userAgent) ? "electron" : "browser";
837
+ }
838
+ function de() {
839
+ return D() === "docker";
840
+ }
841
+ function fe() {
842
+ return D() === "electron";
843
+ }
844
+ function O() {
845
+ return D() === "browser";
846
+ }
847
+ function pe() {
848
+ return typeof window > "u" ? !1 : window.__IS_DEV__ === !0 ? !0 : window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1";
849
+ }
850
+ //#endregion
851
+ //#region src/constants/launcherFolders.ts
852
+ var me = "launcher-folder-custom-apps", he = [
868
853
  {
869
854
  id: "launcher-folder-social-links",
870
855
  name: "Social Links",
@@ -911,7 +896,7 @@ var fe = class {
911
896
  order: 3
912
897
  },
913
898
  {
914
- id: pe,
899
+ id: me,
915
900
  name: "Custom Apps",
916
901
  fcIcon: "VscExtensions",
917
902
  appIds: [],
@@ -919,59 +904,59 @@ var fe = class {
919
904
  isPredefined: !0,
920
905
  order: 4
921
906
  }
922
- ], D = [...me], O = null, k = null, A = 0, he = 5e3, ge = "/dist-apps/apps-manifest.json";
923
- async function j(e = !1) {
907
+ ], k = [...he], A = null, j = null, M = 0, ge = 5e3, N = "/dist-apps/apps-manifest.json";
908
+ async function P(e = !1) {
924
909
  let t = Date.now();
925
- if (!e && O && t - A < he) return O;
926
- if (k) return k;
927
- let n = `${ge}?t=${t}`;
928
- return k = fetch(n).then(async (e) => {
910
+ if (!e && A && t - M < ge) return A;
911
+ if (j) return j;
912
+ let n = `${N}?t=${t}`;
913
+ return j = fetch(n).then(async (e) => {
929
914
  if (!e.ok) {
930
- if (e.status === 404) return console.warn("[CustomApps] No apps manifest found at", ge), null;
915
+ if (e.status === 404) return console.warn("[CustomApps] No apps manifest found at", N), null;
931
916
  throw Error(`Failed to fetch manifest: ${e.status}`);
932
917
  }
933
918
  return e.json();
934
- }).then((e) => (O = e, A = Date.now(), k = null, console.log(`[CustomApps] Loaded manifest with ${e.apps.length} apps`), e)).catch((e) => (console.error("[CustomApps] Error fetching manifest:", e), k = null, null)), k;
919
+ }).then((e) => (A = e, M = Date.now(), j = null, console.log(`[CustomApps] Loaded manifest with ${e.apps.length} apps`), e)).catch((e) => (console.error("[CustomApps] Error fetching manifest:", e), j = null, null)), j;
935
920
  }
936
921
  function _e() {
937
- return O;
922
+ return A;
938
923
  }
939
- function ve() {
940
- O = null, A = 0;
924
+ function F() {
925
+ A = null, M = 0;
941
926
  }
942
- function ye(e) {
943
- if (!O) {
944
- O = {
927
+ function ve(e) {
928
+ if (!A) {
929
+ A = {
945
930
  version: "1.0.0",
946
931
  generated: (/* @__PURE__ */ new Date()).toISOString(),
947
932
  apps: [e]
948
933
  };
949
934
  return;
950
935
  }
951
- O = O.apps.some((t) => t.id === e.id) ? {
952
- ...O,
953
- apps: O.apps.map((t) => t.id === e.id ? e : t)
936
+ A = A.apps.some((t) => t.id === e.id) ? {
937
+ ...A,
938
+ apps: A.apps.map((t) => t.id === e.id ? e : t)
954
939
  } : {
955
- ...O,
956
- apps: [...O.apps, e]
940
+ ...A,
941
+ apps: [...A.apps, e]
957
942
  };
958
943
  }
959
- function be(e) {
960
- O &&= {
961
- ...O,
962
- apps: O.apps.filter((t) => t.id !== e)
944
+ function ye(e) {
945
+ A &&= {
946
+ ...A,
947
+ apps: A.apps.filter((t) => t.id !== e)
963
948
  };
964
949
  }
965
- async function M() {
966
- return (await j())?.apps ?? [];
950
+ async function I() {
951
+ return (await P())?.apps ?? [];
967
952
  }
968
- async function xe(e) {
969
- return (await M()).find((t) => t.id === e);
953
+ async function be(e) {
954
+ return (await I()).find((t) => t.id === e);
970
955
  }
971
- function Se(e) {
972
- return O ? O.apps.some((t) => t.id === e) : !1;
956
+ function xe(e) {
957
+ return A ? A.apps.some((t) => t.id === e) : !1;
973
958
  }
974
- function Ce(e) {
959
+ function Se(e) {
975
960
  return {
976
961
  id: e.id,
977
962
  name: e.name,
@@ -985,7 +970,7 @@ function Ce(e) {
985
970
  alwaysOnTop: e.window.alwaysOnTop
986
971
  };
987
972
  }
988
- function we(e, t) {
973
+ function Ce(e, t) {
989
974
  let n = new Set(t.map((e) => e.id)), r = e.filter((e) => !n.has(e.id)), i = t.map((e) => {
990
975
  let t = {
991
976
  id: e.id,
@@ -1002,9 +987,9 @@ function we(e, t) {
1002
987
  });
1003
988
  return [...r, ...i];
1004
989
  }
1005
- async function Te(e) {
1006
- ve();
1007
- let t = await j(!0);
990
+ async function we(e) {
991
+ F();
992
+ let t = await P(!0);
1008
993
  if (!t) return {
1009
994
  added: [],
1010
995
  removed: [],
@@ -1019,26 +1004,26 @@ async function Te(e) {
1019
1004
  }
1020
1005
  //#endregion
1021
1006
  //#region src/utils/sortNodes.ts
1022
- var N = (e) => {
1007
+ var L = (e) => {
1023
1008
  let t = e.filter((e) => e.type === "folder"), n = e.filter((e) => e.type === "file"), r = (e, t) => e.name.localeCompare(t.name);
1024
1009
  return [...t.sort(r), ...n.sort(r)];
1025
- }, Ee = {
1010
+ }, Te = {
1026
1011
  BY_TYPE: "byType",
1027
1012
  BY_NAME: "byName",
1028
1013
  BY_DATE: "byDate"
1029
1014
  };
1030
- function P(e) {
1015
+ function R(e) {
1031
1016
  return e.nodeId ? e.appId === "files" ? "folder" : "file" : "app";
1032
1017
  }
1033
- var F = {
1018
+ var z = {
1034
1019
  app: 0,
1035
1020
  folder: 1,
1036
1021
  file: 2
1037
1022
  };
1038
- function I(e, t) {
1023
+ function B(e, t) {
1039
1024
  return [...e].sort((e, n) => {
1040
- let r = P(e), i = P(n);
1041
- if (r !== i) return F[r] - F[i];
1025
+ let r = R(e), i = R(n);
1026
+ if (r !== i) return z[r] - z[i];
1042
1027
  if (r === "app") {
1043
1028
  if (!t) return e.name.localeCompare(n.name);
1044
1029
  let r = t.indexOf(e.appId), i = t.indexOf(n.appId);
@@ -1047,227 +1032,35 @@ function I(e, t) {
1047
1032
  return e.name.localeCompare(n.name);
1048
1033
  });
1049
1034
  }
1050
- var De = (e, t) => {
1035
+ var V = (e, t) => {
1051
1036
  switch (t) {
1052
- case "default": return I(e);
1037
+ case "default": return B(e);
1053
1038
  case "name-asc": return [...e].sort((e, t) => e.name.localeCompare(t.name));
1054
1039
  case "name-desc": return [...e].sort((e, t) => t.name.localeCompare(e.name));
1055
1040
  case "type": return [...e].sort((e, t) => {
1056
- let n = P(e), r = P(t);
1057
- return n === r ? e.name.localeCompare(t.name) : F[n] - F[r];
1041
+ let n = R(e), r = R(t);
1042
+ return n === r ? e.name.localeCompare(t.name) : z[n] - z[r];
1058
1043
  });
1059
- default: return I(e);
1044
+ default: return B(e);
1060
1045
  }
1061
- }, Oe = (e, t) => {
1046
+ }, Ee = (e, t) => {
1062
1047
  switch (t) {
1063
1048
  case "default":
1064
- case "type": return N(e);
1049
+ case "type": return L(e);
1065
1050
  case "name-asc": return [...e].sort((e, t) => e.name.localeCompare(t.name));
1066
1051
  case "name-desc": return [...e].sort((e, t) => t.name.localeCompare(e.name));
1067
- default: return N(e);
1052
+ default: return L(e);
1068
1053
  }
1069
- }, L = {
1070
- defaultWidth: 800,
1071
- defaultHeight: 600,
1072
- minWidth: 640,
1073
- minHeight: 480
1074
- }, R = [
1075
- {
1076
- id: "files",
1077
- name: "FilesApp",
1078
- icon: "📁",
1079
- fcIcon: "FcOpenedFolder",
1080
- hasContextMenu: !0,
1081
- ...L
1082
- },
1083
- {
1084
- id: "settings",
1085
- name: "Settings",
1086
- icon: "⚙️",
1087
- fcIcon: "FcSettings",
1088
- singleWindow: !0,
1089
- ...L
1090
- },
1091
- {
1092
- id: "notepad",
1093
- name: "Notepad",
1094
- icon: "📝",
1095
- fcIcon: "FcEditImage",
1096
- ...L
1097
- },
1098
- {
1099
- id: "image-viewer",
1100
- name: "Image Viewer",
1101
- icon: "🖼️",
1102
- fcIcon: "FcPicture",
1103
- defaultWidth: 700,
1104
- defaultHeight: 520,
1105
- minWidth: 640,
1106
- minHeight: 480
1107
- },
1108
- {
1109
- id: "pdf",
1110
- name: "PDF Viewer",
1111
- icon: "📄",
1112
- fcIcon: "FcDocument",
1113
- defaultWidth: 780,
1114
- defaultHeight: 580,
1115
- minWidth: 640,
1116
- minHeight: 480
1117
- },
1118
- {
1119
- id: "uploader",
1120
- name: "Uploader",
1121
- icon: "📤",
1122
- fcIcon: "FcUpload",
1123
- ...L
1124
- },
1125
- {
1126
- id: "menuedit",
1127
- name: "MenuEdit",
1128
- icon: "📁",
1129
- fcIcon: "FcFolder",
1130
- singleWindow: !0,
1131
- ...L
1132
- },
1133
- {
1134
- id: "device-info",
1135
- name: "Device Info",
1136
- icon: "📊",
1137
- fcIcon: "FcBarChart",
1138
- defaultWidth: 300,
1139
- defaultHeight: 400,
1140
- minWidth: 280,
1141
- minHeight: 350,
1142
- canMaximize: !1,
1143
- alwaysOnTop: !0,
1144
- singleWindow: !0
1145
- },
1146
- {
1147
- id: "calendar",
1148
- name: "Calendar",
1149
- icon: "📅",
1150
- fcIcon: "FcCalendar",
1151
- defaultWidth: 320,
1152
- defaultHeight: 370,
1153
- minWidth: !1,
1154
- minHeight: !1,
1155
- canMaximize: !1,
1156
- singleWindow: !0
1157
- }
1158
- ], ke = R.map((e) => e.id), z = [
1159
- {
1160
- id: "welcome",
1161
- name: "Welcome",
1162
- icon: "👋",
1163
- fcIcon: "FcBusinessContact",
1164
- defaultWidth: 900,
1165
- defaultHeight: 700,
1166
- minWidth: 600,
1167
- minHeight: 500
1168
- },
1169
- {
1170
- id: "storybook",
1171
- name: "Storybook",
1172
- icon: "📖",
1173
- fcIcon: "FcReading",
1174
- defaultWidth: 1100,
1175
- defaultHeight: 700,
1176
- minWidth: 640,
1177
- minHeight: 480
1178
- },
1179
- {
1180
- id: "linkedin",
1181
- name: "LinkedinApp",
1182
- icon: "🔗",
1183
- fcIcon: "FiLinkedin",
1184
- iconColor: "#0A66C2",
1185
- defaultWidth: 1100,
1186
- defaultHeight: 700
1187
- },
1188
- {
1189
- id: "github",
1190
- name: "GithubApp",
1191
- icon: "🔗",
1192
- fcIcon: "FiGithub",
1193
- iconColor: "#000",
1194
- defaultWidth: 640,
1195
- defaultHeight: 480
1196
- },
1197
- {
1198
- id: "terminal",
1199
- name: "Terminal",
1200
- icon: "💻",
1201
- fcIcon: "FcCommandLine",
1202
- ...L
1203
- },
1204
- {
1205
- id: "code-server",
1206
- name: "VS Code",
1207
- icon: "📘",
1208
- fcIcon: "FcCodesandbox",
1209
- iconUrl: "/vscode.svg",
1210
- defaultWidth: 1200,
1211
- defaultHeight: 800,
1212
- minWidth: 800,
1213
- minHeight: 600
1214
- },
1215
- {
1216
- id: "dos-emulator",
1217
- name: "DOS Emulator",
1218
- icon: "🎮",
1219
- fcIcon: "FcGamepad",
1220
- defaultWidth: 900,
1221
- defaultHeight: 700,
1222
- minWidth: 640,
1223
- minHeight: 480
1224
- },
1225
- {
1226
- id: "doom",
1227
- name: "DOOM",
1228
- icon: "🔫",
1229
- fcIcon: "FcVideoGame",
1230
- iconUrl: "doom.png",
1231
- defaultWidth: 900,
1232
- defaultHeight: 700,
1233
- minWidth: 640,
1234
- minHeight: 480,
1235
- autoLoad: {
1236
- url: "Games/doom.jsdos",
1237
- name: "DOOM"
1238
- }
1239
- }
1240
- ], Ae = z.map((e) => e.id), B = [...R, ...z], V = [
1241
- "welcome",
1242
- "uploader",
1243
- "terminal",
1244
- "code-server",
1245
- "storybook",
1246
- "settings",
1247
- "notepad",
1248
- "linkedin",
1249
- "github",
1250
- "files",
1251
- "doom"
1252
- ];
1253
- function je(e) {
1254
- for (let t of e) B.find((e) => e.id === t.id) || B.push(t);
1255
- }
1256
- function Me(e) {
1257
- for (let t of e) V.includes(t) || V.push(t);
1258
- }
1259
- //#endregion
1260
- //#region src/utils/getAppIdForMime.ts
1261
- var Ne = [], H = (e) => {
1262
- Ne.push(e);
1263
- }, Pe = new Set([
1054
+ }, De = [], H = (e) => {
1055
+ De.push(e);
1056
+ }, Oe = new Set([
1264
1057
  "image/jpeg",
1265
1058
  "image/png",
1266
1059
  "image/gif",
1267
1060
  "image/svg+xml",
1268
1061
  "image/webp",
1269
1062
  "image/bmp"
1270
- ]), Fe = new Set([
1063
+ ]), ke = new Set([
1271
1064
  "text/plain",
1272
1065
  "text/markdown",
1273
1066
  "text/x-markdown",
@@ -1279,11 +1072,11 @@ H({
1279
1072
  transformContentData: (e) => ({ src: e.url ?? e.name })
1280
1073
  }), H({
1281
1074
  appId: "image-viewer",
1282
- mimeTypes: (e) => Pe.has(e) || e.startsWith("image/"),
1075
+ mimeTypes: (e) => Oe.has(e) || e.startsWith("image/"),
1283
1076
  transformContentData: (e) => ({ src: e.url ?? e.name })
1284
1077
  }), H({
1285
1078
  appId: "notepad",
1286
- mimeTypes: (e) => Fe.has(e) || e.startsWith("text/"),
1079
+ mimeTypes: (e) => ke.has(e) || e.startsWith("text/"),
1287
1080
  transformContentData: (e) => ({
1288
1081
  url: e.url,
1289
1082
  initialName: e.name,
@@ -1301,14 +1094,14 @@ H({
1301
1094
  name: e.name
1302
1095
  } })
1303
1096
  });
1304
- function Ie(e) {
1097
+ function Ae(e) {
1305
1098
  if (!e) return null;
1306
- for (let t of Ne) if (typeof t.mimeTypes == "function" ? t.mimeTypes(e) : t.mimeTypes.includes(e)) return t;
1099
+ for (let t of De) if (typeof t.mimeTypes == "function" ? t.mimeTypes(e) : t.mimeTypes.includes(e)) return t;
1307
1100
  return null;
1308
1101
  }
1309
1102
  function U(e) {
1310
- if (typeof e == "string" || e === void 0) return Ie(e)?.appId ?? "files";
1311
- let t = Ie(e.mimeType);
1103
+ if (typeof e == "string" || e === void 0) return Ae(e)?.appId ?? "files";
1104
+ let t = Ae(e.mimeType);
1312
1105
  return t ? {
1313
1106
  appId: t.appId,
1314
1107
  contentData: t.transformContentData(e)
@@ -1324,7 +1117,7 @@ var W = {
1324
1117
  error: void 0,
1325
1118
  mountedAt: 0,
1326
1119
  instance: void 0
1327
- }, G = n((e) => ({
1120
+ }, G = e((e) => ({
1328
1121
  mountedApps: {},
1329
1122
  registeredApps: {},
1330
1123
  hmrConnected: !1,
@@ -1390,11 +1183,11 @@ var W = {
1390
1183
  setDevServerOffline: (t) => e({ devServerOffline: t }),
1391
1184
  incrementHmrRetry: () => e((e) => ({ hmrRetryCount: e.hmrRetryCount + 1 })),
1392
1185
  resetHmrRetry: () => e({ hmrRetryCount: 0 })
1393
- })), Le = "/", K = null, q = null;
1394
- function Re(e) {
1186
+ })), je = "/", K = null, q = null;
1187
+ function Me(e) {
1395
1188
  q = e, K = null;
1396
1189
  }
1397
- function ze() {
1190
+ function Ne() {
1398
1191
  if (K !== null) return K;
1399
1192
  if (q !== null) return K = q, K;
1400
1193
  let e = document.querySelector("base[href]");
@@ -1402,36 +1195,36 @@ function ze() {
1402
1195
  let t = e.getAttribute("href");
1403
1196
  if (t) return K = t, t;
1404
1197
  }
1405
- return K = Le, K;
1198
+ return K = je, K;
1406
1199
  }
1407
- function Be() {
1200
+ function Pe() {
1408
1201
  K = null;
1409
1202
  }
1410
- function Ve(e) {
1203
+ function Fe(e) {
1411
1204
  if (!e || e.startsWith("http://") || e.startsWith("https://") || e.startsWith("idb://") || e.startsWith("blob:") || e.startsWith("/")) return e;
1412
- let t = ze();
1205
+ let t = Ne();
1413
1206
  return (t.endsWith("/") ? t : `${t}/`) + e;
1414
1207
  }
1415
1208
  //#endregion
1416
1209
  //#region src/constants/breakpoints.ts
1417
- var He = {
1210
+ var Ie = {
1418
1211
  MOBILE: 768,
1419
1212
  TABLET: 1024,
1420
1213
  DESKTOP: 1280
1421
- }, J = {
1214
+ }, Le = {
1422
1215
  WIDTH: 1280,
1423
1216
  HEIGHT: 800
1424
- }, Ue = 48, We = 80, Ge = 80, Ke = 20, qe = J.WIDTH, Je = J.HEIGHT, Ye = async () => {
1425
- let e = await fetch(Ve("fs-manifest.json")), t = e.headers.get("content-type")?.includes("application/json");
1217
+ }, Re = 48, ze = 80, Be = 80, Ve = 20, He = Le.WIDTH, J = Le.HEIGHT, Ue = async () => {
1218
+ let e = await fetch(Fe("fs-manifest.json")), t = e.headers.get("content-type")?.includes("application/json");
1426
1219
  return e.ok && t ? await e.json() : null;
1427
- }, Y = new re();
1428
- function Xe() {
1429
- return e() ? (console.log("[FileSystem] Using DockerFileSystemAdapter"), new fe()) : (console.log("[FileSystem] Using IndexedDBFileSystem"), new T());
1220
+ }, Y = new te();
1221
+ function We() {
1222
+ return de() ? (console.log("[FileSystem] Using DockerFileSystemAdapter"), new ue()) : (console.log("[FileSystem] Using IndexedDBFileSystem"), new T());
1430
1223
  }
1431
- var X = Xe(), Ze = () => {
1224
+ var X = We(), Ge = () => {
1432
1225
  X.clearAll().catch(() => {});
1433
- }, Qe = () => Y.reset();
1434
- async function $e(e, t) {
1226
+ }, Ke = () => Y.reset();
1227
+ async function qe(e, t) {
1435
1228
  if (e.startsWith("idb://")) {
1436
1229
  let t = await X.getBlob(e);
1437
1230
  return t ? t.text() : "";
@@ -1439,7 +1232,7 @@ async function $e(e, t) {
1439
1232
  let n = e.startsWith("http") || e.startsWith("/") ? e : `/${e}`, r = await fetch(n, { signal: t });
1440
1233
  return r.ok ? r.text() : "";
1441
1234
  }
1442
- var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "Desktop")?.id ?? null, et = (e, t) => {
1235
+ var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "Desktop")?.id ?? null, Je = (e, t) => {
1443
1236
  let n = new Set(e.map((e) => `${e.x},${e.y}`)), r = Math.max(1, Math.floor((t - 20) / 80));
1444
1237
  for (let e = 0;; e++) {
1445
1238
  let t = 20 + e * 80;
@@ -1451,19 +1244,19 @@ var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "De
1451
1244
  };
1452
1245
  }
1453
1246
  }
1454
- }, tt = (e, t) => {
1247
+ }, Ye = (e, t) => {
1455
1248
  let n = Math.max(1, Math.floor((t - 20) / 80)), r = Math.floor(e / n), i = e % n;
1456
1249
  return {
1457
1250
  x: 20 + r * 80,
1458
1251
  y: 20 + i * 80
1459
1252
  };
1460
1253
  }, Q = (e, t, n) => {
1461
- let r = et(e, n);
1462
- return [...e, g({
1254
+ let r = Je(e, n);
1255
+ return [...e, m({
1463
1256
  ...t,
1464
1257
  ...r
1465
1258
  })];
1466
- }, nt = () => {
1259
+ }, Xe = () => {
1467
1260
  let e = Z();
1468
1261
  if (!e || !X.isReady()) return;
1469
1262
  let t = X.getChildren(e), n = new Set(t.map((e) => e.id)), r = new Set(t.map((e) => e.name)), { icons: i, viewportHeight: a } = $.getState(), o = i.filter((e) => !e.nodeId || n.has(e.nodeId) || r.has(e.name));
@@ -1485,12 +1278,12 @@ var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "De
1485
1278
  }, a);
1486
1279
  }
1487
1280
  }
1488
- let s = I(o);
1281
+ let s = B(o);
1489
1282
  $.setState({ icons: s.map((e, t) => ({
1490
1283
  ...e,
1491
- ...tt(t, a)
1284
+ ...Ye(t, a)
1492
1285
  })) });
1493
- }, $ = n()(a((e, n) => ({
1286
+ }, $ = e()(n((e, t) => ({
1494
1287
  windows: [],
1495
1288
  openWindow: (t) => {
1496
1289
  let n = Y.open(t);
@@ -1538,7 +1331,7 @@ var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "De
1538
1331
  },
1539
1332
  icons: [],
1540
1333
  addIcon: (t) => {
1541
- let n = g(t);
1334
+ let n = m(t);
1542
1335
  e((e) => ({ icons: [...e.icons, n] }));
1543
1336
  },
1544
1337
  removeIcon: (t) => {
@@ -1550,23 +1343,23 @@ var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "De
1550
1343
  initFs: async () => {
1551
1344
  try {
1552
1345
  X.isReady() && X.reinitialize ? await X.reinitialize() : X.isReady() || await X.initialize();
1553
- let r = await Ye();
1554
- if (r) {
1555
- let e = r.sha ?? null, t = await X.getManifestSha();
1556
- X.isEmpty() ? (await X.seed(r), e && await X.saveManifestSha(e)) : t !== e && e !== null && (await X.mergeSeed(r), await X.saveManifestSha(e));
1346
+ let n = await Ue();
1347
+ if (n) {
1348
+ let e = n.sha ?? null, t = await X.getManifestSha();
1349
+ X.isEmpty() ? (await X.seed(n), e && await X.saveManifestSha(e)) : t !== e && e !== null && (await X.mergeSeed(n), await X.saveManifestSha(e));
1557
1350
  }
1558
1351
  if (e({
1559
1352
  fsNodes: X.getAllNodes(),
1560
1353
  desktopFolderId: Z(),
1561
1354
  isFsReady: !0
1562
- }), !t()) {
1563
- let t = null;
1355
+ }), !O()) {
1356
+ let n = null;
1564
1357
  try {
1565
- if (t = await j(), t?.apps?.length) {
1566
- e({ customApps: t.apps });
1567
- for (let e of t.apps) G.getState().registerApp(e);
1358
+ if (n = await P(), n?.apps?.length) {
1359
+ e({ customApps: n.apps });
1360
+ for (let e of n.apps) G.getState().registerApp(e);
1568
1361
  }
1569
- let r = new Set(t?.apps?.map((e) => e.id) ?? []), i = n().icons.filter((e) => e.appId && !B.find((t) => t.id === e.appId) && !r.has(e.appId)).map((e) => e.appId);
1362
+ let r = new Set(n?.apps?.map((e) => e.id) ?? []), i = t().icons.filter((e) => e.appId && !c.find((t) => t.id === e.appId) && !r.has(e.appId)).map((e) => e.appId);
1570
1363
  i.length > 0 && e((e) => ({
1571
1364
  icons: e.icons.filter((e) => !i.includes(e.appId)),
1572
1365
  customApps: e.customApps.filter((e) => !i.includes(e.id))
@@ -1575,43 +1368,43 @@ var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "De
1575
1368
  console.warn("[DesktopStore] Failed to load custom apps manifest:", e);
1576
1369
  }
1577
1370
  }
1578
- for (let t of V) {
1579
- let r = B.find((e) => e.id === t);
1580
- r && (n().icons.some((e) => e.appId === t) || e({ icons: Q(n().icons, {
1371
+ for (let n of l) {
1372
+ let r = c.find((e) => e.id === n);
1373
+ r && (t().icons.some((e) => e.appId === n) || e({ icons: Q(t().icons, {
1581
1374
  name: r.name,
1582
1375
  icon: r.icon,
1583
- appId: t
1584
- }, n().viewportHeight) }));
1376
+ appId: n
1377
+ }, t().viewportHeight) }));
1585
1378
  }
1586
- if (!t()) {
1587
- let t = n().customApps;
1588
- if (t.length) for (let r of t) n().icons.some((e) => e.appId === r.id) || e({ icons: Q(n().icons, {
1379
+ if (!O()) {
1380
+ let n = t().customApps;
1381
+ if (n.length) for (let r of n) t().icons.some((e) => e.appId === r.id) || e({ icons: Q(t().icons, {
1589
1382
  name: r.name,
1590
1383
  icon: r.icon,
1591
1384
  appId: r.id
1592
- }, n().viewportHeight) });
1385
+ }, t().viewportHeight) });
1593
1386
  }
1594
- let i = Z();
1595
- if (!i) return;
1596
- X.getChildren(i).forEach((t) => {
1597
- if (t.type !== "file") return;
1598
- let r = n().icons.find((e) => e.name === t.name);
1599
- r ? r.nodeId || e({ icons: n().icons.map((e) => e.name === t.name ? {
1387
+ let r = Z();
1388
+ if (!r) return;
1389
+ X.getChildren(r).forEach((n) => {
1390
+ if (n.type !== "file") return;
1391
+ let r = t().icons.find((e) => e.name === n.name);
1392
+ r ? r.nodeId || e({ icons: t().icons.map((e) => e.name === n.name ? {
1600
1393
  ...e,
1601
- nodeId: t.id
1602
- } : e) }) : e({ icons: Q(n().icons, {
1603
- name: t.name,
1394
+ nodeId: n.id
1395
+ } : e) }) : e({ icons: Q(t().icons, {
1396
+ name: n.name,
1604
1397
  icon: "📄",
1605
- appId: U(t.mimeType),
1606
- nodeId: t.id
1607
- }, n().viewportHeight) });
1608
- }), nt();
1398
+ appId: U(n.mimeType),
1399
+ nodeId: n.id
1400
+ }, t().viewportHeight) });
1401
+ }), Xe();
1609
1402
  } catch (t) {
1610
1403
  console.error("Failed to initialize filesystem:", t), e({ isFsReady: !0 });
1611
1404
  }
1612
1405
  },
1613
- createFile: async (t, r, i, a) => {
1614
- let o = await X.createFile(t, r, i, a), s = Z(), { icons: c, viewportHeight: l } = n(), u = i && i === s && !c.some((e) => e.name === o.name) ? Q(c, {
1406
+ createFile: async (n, r, i, a) => {
1407
+ let o = await X.createFile(n, r, i, a), s = Z(), { icons: c, viewportHeight: l } = t(), u = i && i === s && !c.some((e) => e.name === o.name) ? Q(c, {
1615
1408
  name: o.name,
1616
1409
  icon: "📄",
1617
1410
  appId: U(o.mimeType),
@@ -1622,8 +1415,8 @@ var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "De
1622
1415
  icons: u
1623
1416
  }), o;
1624
1417
  },
1625
- createFolder: async (t, r, i, a) => {
1626
- let o = await X.createFolder(t, r, i, a), s = Z(), { icons: c, viewportHeight: l } = n(), u = r && r === s && !c.some((e) => e.name === o.name) ? Q(c, {
1418
+ createFolder: async (n, r, i, a) => {
1419
+ let o = await X.createFolder(n, r, i, a), s = Z(), { icons: c, viewportHeight: l } = t(), u = r && r === s && !c.some((e) => e.name === o.name) ? Q(c, {
1627
1420
  name: o.name,
1628
1421
  icon: "📁",
1629
1422
  iconName: o.iconName,
@@ -1653,7 +1446,7 @@ var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "De
1653
1446
  e({ fsNodes: t });
1654
1447
  },
1655
1448
  syncIcons: () => {
1656
- nt();
1449
+ Xe();
1657
1450
  },
1658
1451
  clipboard: {
1659
1452
  content: [],
@@ -1708,33 +1501,33 @@ var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "De
1708
1501
  desktopFolderId: Z()
1709
1502
  });
1710
1503
  },
1711
- mergeDesktopApps: (t) => {
1712
- for (let r of t) {
1713
- let t = B.find((e) => e.id === r);
1714
- t && (n().icons.some((e) => e.appId === r) || e({ icons: Q(n().icons, {
1715
- name: t.name,
1716
- icon: t.icon,
1504
+ mergeDesktopApps: (n) => {
1505
+ for (let r of n) {
1506
+ let n = c.find((e) => e.id === r);
1507
+ n && (t().icons.some((e) => e.appId === r) || e({ icons: Q(t().icons, {
1508
+ name: n.name,
1509
+ icon: n.icon,
1717
1510
  appId: r
1718
- }, n().viewportHeight) }));
1511
+ }, t().viewportHeight) }));
1719
1512
  }
1720
1513
  let r = Z();
1721
- if (r) for (let t of X.getChildren(r)) t.type === "file" && (n().icons.some((e) => e.name === t.name) || e({ icons: Q(n().icons, {
1722
- name: t.name,
1514
+ if (r) for (let n of X.getChildren(r)) n.type === "file" && (t().icons.some((e) => e.name === n.name) || e({ icons: Q(t().icons, {
1515
+ name: n.name,
1723
1516
  icon: "📄",
1724
- appId: U(t.mimeType),
1725
- nodeId: t.id
1726
- }, n().viewportHeight) }));
1517
+ appId: U(n.mimeType),
1518
+ nodeId: n.id
1519
+ }, t().viewportHeight) }));
1727
1520
  },
1728
- reorderDesktopApps: (t) => {
1729
- let r = n().icons, i = [], a = [];
1521
+ reorderDesktopApps: (n) => {
1522
+ let r = t().icons, i = [], a = [];
1730
1523
  for (let e of r) e.appId && !e.nodeId ? i.push(e) : a.push(e);
1731
1524
  let o = [];
1732
- for (let e of t) {
1525
+ for (let e of n) {
1733
1526
  let t = i.findIndex((t) => t.appId === e);
1734
1527
  t !== -1 && o.push(i[t]);
1735
1528
  }
1736
1529
  for (let e of i) o.includes(e) || o.push(e);
1737
- let s = 20, c = 20, l = n().viewportHeight, u = Math.max(1, Math.floor((l - 48 - 20) / 80));
1530
+ let s = 20, c = 20, l = t().viewportHeight, u = Math.max(1, Math.floor((l - 48 - 20) / 80));
1738
1531
  for (let e = 0; e < o.length; e++) {
1739
1532
  let t = Math.floor(e / 1);
1740
1533
  t >= u && t > 0 && (c += 80, s = 20), o[e] = {
@@ -1752,22 +1545,22 @@ var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "De
1752
1545
  removeNotification: (t) => {
1753
1546
  e((e) => ({ notifications: e.notifications.filter((e) => e.id !== t) }));
1754
1547
  },
1755
- viewportWidth: qe,
1756
- viewportHeight: Je,
1548
+ viewportWidth: He,
1549
+ viewportHeight: J,
1757
1550
  isViewportInitialized: !1,
1758
- setViewportSize: (t, r) => {
1759
- let i = n().viewportWidth, a = n().viewportHeight, o = n().isViewportInitialized;
1760
- if (i === t && a === r) return;
1551
+ setViewportSize: (n, r) => {
1552
+ let i = t().viewportWidth, a = t().viewportHeight, o = t().isViewportInitialized;
1553
+ if (i === n && a === r) return;
1761
1554
  if (e({
1762
- viewportWidth: t,
1555
+ viewportWidth: n,
1763
1556
  viewportHeight: r
1764
1557
  }), !o) {
1765
1558
  e({ isViewportInitialized: !0 });
1766
1559
  return;
1767
1560
  }
1768
1561
  if (a !== r) {
1769
- let t = Math.max(1, Math.floor((a - 20) / 80)), i = Math.max(1, Math.floor((r - 20) / 80));
1770
- t !== i && e({ icons: n().icons.map((e, t) => {
1562
+ let n = Math.max(1, Math.floor((a - 20) / 80)), i = Math.max(1, Math.floor((r - 20) / 80));
1563
+ n !== i && e({ icons: t().icons.map((e, t) => {
1771
1564
  let n = Math.floor(t / i), r = t % i;
1772
1565
  return {
1773
1566
  ...e,
@@ -1776,19 +1569,19 @@ var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "De
1776
1569
  };
1777
1570
  }) });
1778
1571
  }
1779
- let s = t < 768, c = n().windows.map((e) => {
1572
+ let s = n < 768, c = t().windows.map((e) => {
1780
1573
  if (e.state !== "normal") return e;
1781
1574
  if (s) return {
1782
1575
  ...e,
1783
1576
  x: 0,
1784
1577
  y: 0,
1785
- width: t,
1578
+ width: n,
1786
1579
  height: r,
1787
1580
  minWidth: void 0,
1788
1581
  minHeight: void 0
1789
1582
  };
1790
- let n = i > 0 ? t / i : 1, o = a > 0 ? r / a : 1, c = Math.round(e.x * n), l = Math.round(e.y * o), u = e.width, d = e.height;
1791
- return u > t && (u = t), d > r && (d = r), c = Math.max(0, Math.min(c, t - Math.min(u, 100))), l = Math.max(0, Math.min(l, r - Math.min(d, 40))), {
1583
+ let t = i > 0 ? n / i : 1, o = a > 0 ? r / a : 1, c = Math.round(e.x * t), l = Math.round(e.y * o), u = e.width, d = e.height;
1584
+ return u > n && (u = n), d > r && (d = r), c = Math.max(0, Math.min(c, n - Math.min(u, 100))), l = Math.max(0, Math.min(l, r - Math.min(d, 40))), {
1792
1585
  ...e,
1793
1586
  x: c,
1794
1587
  y: l,
@@ -1801,27 +1594,27 @@ var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "De
1801
1594
  },
1802
1595
  desktopSortMode: "default",
1803
1596
  filesSortMode: "default",
1804
- setDesktopSortMode: (t) => {
1805
- e({ desktopSortMode: t });
1806
- let r = n().icons, i = De(r, t), a = n().viewportHeight;
1597
+ setDesktopSortMode: (n) => {
1598
+ e({ desktopSortMode: n });
1599
+ let r = t().icons, i = V(r, n), a = t().viewportHeight;
1807
1600
  e({ icons: i.map((e, t) => ({
1808
1601
  ...e,
1809
- ...tt(t, a)
1602
+ ...Ye(t, a)
1810
1603
  })) });
1811
1604
  },
1812
1605
  setFilesSortMode: (t) => {
1813
1606
  e({ filesSortMode: t });
1814
1607
  },
1815
- launcherFolders: D,
1608
+ launcherFolders: k,
1816
1609
  setLauncherFolders: (t) => {
1817
1610
  e({ launcherFolders: t });
1818
1611
  },
1819
1612
  createLauncherFolder: (t) => {
1820
- let n = _(t);
1613
+ let n = h(t);
1821
1614
  return e((e) => ({ launcherFolders: [...e.launcherFolders, n].sort((e, t) => e.order - t.order) })), n;
1822
1615
  },
1823
1616
  updateLauncherFolder: (t, n) => {
1824
- e((e) => ({ launcherFolders: e.launcherFolders.map((e) => e.id === t ? te(e, n) : e) }));
1617
+ e((e) => ({ launcherFolders: e.launcherFolders.map((e) => e.id === t ? g(e, n) : e) }));
1825
1618
  },
1826
1619
  deleteLauncherFolder: (t) => {
1827
1620
  e((e) => ({ launcherFolders: e.launcherFolders.filter((e) => e.id !== t || e.isPredefined) }));
@@ -1848,19 +1641,19 @@ var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "De
1848
1641
  setCustomApps: (t) => {
1849
1642
  e({ customApps: t });
1850
1643
  },
1851
- handleCustomAppRegistered: (t) => {
1852
- e((e) => ({ customApps: e.customApps.some((e) => e.id === t.id) ? e.customApps.map((e) => e.id === t.id ? t : e) : [...e.customApps, t] })), n().icons.find((e) => e.appId === t.id) || e((e) => ({ icons: Q(e.icons, {
1853
- name: t.name,
1854
- icon: t.icon || "FcDataSheet",
1855
- appId: t.id
1644
+ handleCustomAppRegistered: (n) => {
1645
+ e((e) => ({ customApps: e.customApps.some((e) => e.id === n.id) ? e.customApps.map((e) => e.id === n.id ? n : e) : [...e.customApps, n] })), t().icons.find((e) => e.appId === n.id) || e((e) => ({ icons: Q(e.icons, {
1646
+ name: n.name,
1647
+ icon: n.icon || "FcDataSheet",
1648
+ appId: n.id
1856
1649
  }, e.viewportHeight) }));
1857
1650
  },
1858
- handleCustomAppUnregistered: (t) => {
1859
- e((e) => ({ customApps: e.customApps.filter((e) => e.id !== t) })), e((e) => ({ icons: e.icons.filter((e) => e.appId !== t) })), n().windows.filter((e) => e.content === t).forEach((e) => n().closeWindow(e.id)), G.getState().clearApp(t);
1651
+ handleCustomAppUnregistered: (n) => {
1652
+ e((e) => ({ customApps: e.customApps.filter((e) => e.id !== n) })), e((e) => ({ icons: e.icons.filter((e) => e.appId !== n) })), t().windows.filter((e) => e.content === n).forEach((e) => t().closeWindow(e.id)), G.getState().clearApp(n);
1860
1653
  }
1861
1654
  }), {
1862
1655
  name: "fde-desktop",
1863
- storage: r(() => localStorage),
1656
+ storage: t(() => localStorage),
1864
1657
  partialize: (e) => ({
1865
1658
  windows: e.windows,
1866
1659
  icons: e.icons,
@@ -1873,7 +1666,7 @@ var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "De
1873
1666
  }),
1874
1667
  merge: (e, t) => {
1875
1668
  let n = e, r = ["createItem"], i = (n.windows ?? []).filter((e) => !r.includes(e.content)).map((e) => {
1876
- let r = B.find((t) => t.id === e.content), i = (n.customApps ?? t.customApps)?.find((t) => t.id === e.content);
1669
+ let r = c.find((t) => t.id === e.content), i = (n.customApps ?? t.customApps)?.find((t) => t.id === e.content);
1877
1670
  return {
1878
1671
  ...e,
1879
1672
  icon: e.icon ?? r?.icon ?? i?.icon,
@@ -1881,20 +1674,20 @@ var Z = () => X.getRootNodes().find((e) => e.type === "folder" && e.name === "De
1881
1674
  iconUrl: e.iconUrl ?? r?.iconUrl,
1882
1675
  iconColor: r?.iconColor,
1883
1676
  canMaximize: r?.canMaximize ?? i?.window?.canMaximize,
1884
- minWidth: r?.minWidth === !1 || i?.window?.minWidth === !1 ? void 0 : r?.minWidth ?? i?.window?.minWidth ?? L.minWidth,
1885
- minHeight: r?.minHeight === !1 || i?.window?.minHeight === !1 ? void 0 : r?.minHeight ?? i?.window?.minHeight ?? L.minHeight
1677
+ minWidth: r?.minWidth === !1 || i?.window?.minWidth === !1 ? void 0 : r?.minWidth ?? i?.window?.minWidth ?? a.minWidth,
1678
+ minHeight: r?.minHeight === !1 || i?.window?.minHeight === !1 ? void 0 : r?.minHeight ?? i?.window?.minHeight ?? a.minHeight
1886
1679
  };
1887
1680
  });
1888
1681
  Y.loadWindows(i);
1889
- let a = new Set(D.map((e) => e.id)), o = (n.launcherFolders ?? []).filter((e) => !a.has(e.id)), s = [...D, ...o].sort((e, t) => e.order - t.order), c = n.viewportWidth != null && n.viewportHeight != null;
1682
+ let o = new Set(k.map((e) => e.id)), s = (n.launcherFolders ?? []).filter((e) => !o.has(e.id)), l = [...k, ...s].sort((e, t) => e.order - t.order), u = n.viewportWidth != null && n.viewportHeight != null;
1890
1683
  return {
1891
1684
  ...t,
1892
1685
  ...n,
1893
1686
  windows: i,
1894
- launcherFolders: s,
1687
+ launcherFolders: l,
1895
1688
  viewportWidth: n.viewportWidth ?? t.viewportWidth,
1896
1689
  viewportHeight: n.viewportHeight ?? t.viewportHeight,
1897
- isViewportInitialized: c ? !0 : t.isViewportInitialized
1690
+ isViewportInitialized: u ? !0 : t.isViewportInitialized
1898
1691
  };
1899
1692
  }
1900
1693
  }));
@@ -1902,4 +1695,4 @@ typeof window < "u" && (window.__DESKTOP_STATE__ = $.getState(), $.subscribe((e)
1902
1695
  window.__DESKTOP_STATE__ = e;
1903
1696
  }));
1904
1697
  //#endregion
1905
- export { T as $, ke as A, _e as B, B as C, z as D, Me as E, N as F, be as G, M as H, Oe as I, pe as J, Te as K, ve as L, Ee as M, I as N, Ae as O, De as P, de as Q, Ce as R, H as S, je as T, Se as U, xe as V, we as W, me as X, D as Y, fe as Z, Re as _, $e as a, _ as at, Fe as b, qe as c, g as ct, Ge as d, p as dt, x as et, Ue as f, r as ft, Ve as g, Be as h, Qe as i, v as it, L as j, R as k, We as l, h as lt, ze as m, X as n, re as nt, $ as o, ee as ot, He as p, a as pt, ye as q, Ze as r, y as rt, Je as s, te as st, Ye as t, b as tt, Ke as u, m as ut, G as v, V as w, U as x, Pe as y, j as z };
1698
+ export { v as $, P as A, k as B, Te as C, Ee as D, L as E, Ce as F, de as G, D as H, ye as I, le as J, fe as K, we as L, be as M, I as N, F as O, xe as P, te as Q, ve as R, H as S, V as T, O as U, he as V, pe as W, x as X, T as Y, b as Z, Me as _, qe as a, p as at, ke as b, He as c, c as ct, Be as d, d as dt, _ as et, Re as f, o as ft, Fe as g, Pe as h, Ke as i, m as it, _e as j, Se as k, ze as l, l as lt, Ne as m, a as mt, X as n, ee as nt, $ as o, f as ot, Ie as p, s as pt, ue as q, Ge as r, g as rt, J as s, i as st, Ue as t, h as tt, Ve as u, u as ut, G as v, B as w, U as x, Oe as y, me as z };