@das-fed/web 6.4.0-dev.7 → 6.4.0-dev.71

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 (88) hide show
  1. package/esm-map.json +4 -1
  2. package/index-0ov_NXnz.js +82 -0
  3. package/index-0ov_NXnz.js.gz +0 -0
  4. package/index-B-PFV4G5.js +13651 -0
  5. package/index-B-PFV4G5.js.gz +0 -0
  6. package/{packages/main-app-framework/index-Cg3QA-m6.js → index-BttHmPh0.js} +1 -1
  7. package/index.js +24 -21
  8. package/package.json +8 -6
  9. package/packages/create-das-web-app/index.js +48 -805
  10. package/packages/create-das-web-app/index.js.gz +0 -0
  11. package/packages/i18n/index.js +76 -31
  12. package/packages/i18n/index.js.gz +0 -0
  13. package/packages/layout/index.js +479 -441
  14. package/packages/layout/index.js.gz +0 -0
  15. package/packages/layout/style.css +2 -2
  16. package/packages/layout/style.css.gz +0 -0
  17. package/packages/main-app-framework/index-BJcosks8.js +12269 -0
  18. package/packages/main-app-framework/index-BJcosks8.js.gz +0 -0
  19. package/{index-Bxc6TFIP.js → packages/main-app-framework/index-D40_ihAE.js} +1 -1
  20. package/packages/main-app-framework/index-DGvGNdo-.js +82 -0
  21. package/packages/main-app-framework/index-DGvGNdo-.js.gz +0 -0
  22. package/packages/main-app-framework/index.js +3 -2
  23. package/packages/main-app-framework/style.css +1 -1
  24. package/packages/main-app-framework/style.css.gz +0 -0
  25. package/packages/micro-frontend/index.js +181 -164
  26. package/packages/micro-frontend/index.js.gz +0 -0
  27. package/packages/style/style.css +1 -1
  28. package/packages/style/style.css.gz +0 -0
  29. package/style.css +2 -2
  30. package/style.css.gz +0 -0
  31. package/types/create-das-web-app/index.d.ts +1 -1
  32. package/types/i18n/global.d.ts +118 -0
  33. package/types/i18n/index.d.ts +6 -4
  34. package/types/layout/index.d.ts +1 -1
  35. package/types/layout/store/index.d.ts +6 -1
  36. package/types/layout/store/menu.d.ts +2 -0
  37. package/types/layout/store/nav.d.ts +1 -0
  38. package/types/layout/store/tab.d.ts +1 -0
  39. package/types/main-app-framework/business/alarm/use-alarm.d.ts +4 -4
  40. package/types/main-app-framework/business/video-link/api.d.ts +2 -0
  41. package/types/main-app-framework/business/video-link/index.d.ts +3 -3
  42. package/types/main-app-framework/business/video-link/video-dialog/hooks/PlayerProvider.d.ts +3 -3
  43. package/types/main-app-framework/components/iframe-page/index.d.ts +3 -0
  44. package/types/main-app-framework/components/index.d.ts +1 -0
  45. package/types/main-app-framework/components/person-set-dialog/index.d.ts +1 -1
  46. package/types/main-app-framework/components/person-set-dialog/src/api.d.ts +2 -0
  47. package/types/main-app-framework/components/person-set-dialog/src/components/index.d.ts +2 -0
  48. package/types/main-app-framework/components/person-set-dialog/src/components/set-home/api.d.ts +20 -0
  49. package/types/main-app-framework/components/person-set-dialog/src/components/set-home/use-link-form/hooks/use-builtIn-dialog.d.ts +19 -0
  50. package/types/main-app-framework/components/person-set-dialog/src/components/set-home/use-link-form/hooks/use-notBuiltIn-dialog.d.ts +22 -0
  51. package/types/main-app-framework/constant/index.d.ts +1 -1
  52. package/types/main-app-framework/data-track/api.d.ts +2 -0
  53. package/types/main-app-framework/data-track/index.d.ts +2 -0
  54. package/types/main-app-framework/i18n/index.d.ts +513 -0
  55. package/types/main-app-framework/index.d.ts +2 -1
  56. package/types/main-app-framework/init-config/get-nav-config/api.d.ts +2 -0
  57. package/types/main-app-framework/init-config/get-nav-config/index.d.ts +4 -3
  58. package/types/main-app-framework/init-config/get-project-config/api.d.ts +3 -2
  59. package/types/main-app-framework/init-config/get-system-config/api.d.ts +2 -0
  60. package/types/main-app-framework/init-config/get-system-config/index.d.ts +4 -4
  61. package/types/main-app-framework/init-config/get-tenant-config/api.d.ts +1 -1
  62. package/types/main-app-framework/init-layout/hooks/nav-slots/use-change-enterprises.d.ts +3 -3
  63. package/types/main-app-framework/init-layout/hooks/nav-slots/use-user-command.d.ts +2 -2
  64. package/types/main-app-framework/init-layout/hooks/use-initialization.d.ts +4 -4
  65. package/types/main-app-framework/init-layout/hooks/use-tabs.d.ts +3 -3
  66. package/types/main-app-framework/init-platform/index.d.ts +1 -1
  67. package/types/main-app-framework/utils/src/get-portal-url/crypto.d.ts +14 -0
  68. package/types/main-app-framework/utils/src/get-portal-url/encrypt.d.ts +42 -0
  69. package/types/main-app-framework/utils/src/get-portal-url/generate-url.d.ts +4 -0
  70. package/types/main-app-framework/utils/src/get-portal-url/handle-portal-params.d.ts +2 -0
  71. package/types/main-app-framework/utils/src/get-portal-url/index.d.ts +2 -0
  72. package/types/main-app-framework/utils/src/get-portal-url/type.d.ts +16 -0
  73. package/types/main-app-framework/utils/src/set-common-info.d.ts +4 -2
  74. package/types/main-app-framework/utils/src/tools.d.ts +5 -1
  75. package/types/micro-frontend/store.d.ts +5 -5
  76. package/types/theme/index.d.ts +1 -1
  77. package/index-BVFBG18b.js +0 -70
  78. package/index-BVFBG18b.js.gz +0 -0
  79. package/index-DjvYNTdd.js +0 -7952
  80. package/index-DjvYNTdd.js.gz +0 -0
  81. package/index-KF0qlXuZ.js +0 -68
  82. package/index-KF0qlXuZ.js.gz +0 -0
  83. package/packages/main-app-framework/index-B-mymH8S.js +0 -70
  84. package/packages/main-app-framework/index-B-mymH8S.js.gz +0 -0
  85. package/packages/main-app-framework/index-C0DqSXpB.js +0 -5915
  86. package/packages/main-app-framework/index-C0DqSXpB.js.gz +0 -0
  87. package/packages/main-app-framework/index-C7g0JYXU.js +0 -68
  88. package/packages/main-app-framework/index-C7g0JYXU.js.gz +0 -0
@@ -1,815 +1,58 @@
1
- import { effectScope as oe, ref as B, markRaw as J, toRaw as L, watch as se, unref as ie, createApp as ae } from "vue";
2
- import { initTheme as ce } from "@das-fed/web/packages/theme/index";
3
- import { initI18n as le } from "@das-fed/web/packages/i18n/index";
4
- import { DasWebLayout as ue } from "@das-fed/web/packages/layout/index";
5
- import { createRouter as fe, createWebHistory as de } from "vue-router";
6
- const ge = {
7
- install: (e, t) => {
8
- var n;
9
- const r = (n = t == null ? void 0 : t.plugins) == null ? void 0 : n.glob;
10
- r && Object.values(r).sort((o, s) => (o.index ?? 0) - (s.index ?? 0)).filter((o) => o ? !!(o.default && o.default.install || o.install) : !1).forEach((o) => {
11
- o.default && o.default.install && e.use(o.default, t), o.install && e.use(o, t);
1
+ import { ref as x, createApp as O } from "vue";
2
+ import { initTheme as P } from "@das-fed/web/packages/theme/index";
3
+ import { initI18n as W } from "@das-fed/web/packages/i18n/index";
4
+ import { DasWebLayout as $ } from "@das-fed/web/packages/layout/index";
5
+ import { createPinia as j } from "pinia";
6
+ import k from "pinia-plugin-persistedstate";
7
+ import { createRouter as y, createWebHistory as D } from "vue-router";
8
+ const N = {
9
+ install: (e, a) => {
10
+ var l;
11
+ const c = (l = a == null ? void 0 : a.plugins) == null ? void 0 : l.glob;
12
+ c && Object.values(c).sort((t, u) => (t.index ?? 0) - (u.index ?? 0)).filter((t) => t ? !!(t.default && t.default.install || t.install) : !1).forEach((t) => {
13
+ t.default && t.default.install && e.use(t.default, a), t.install && e.use(t, a);
12
14
  });
13
15
  }
14
- };
15
- var he = !1;
16
- function pe() {
17
- return z().__VUE_DEVTOOLS_GLOBAL_HOOK__;
18
- }
19
- function z() {
20
- return typeof navigator < "u" && typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : {};
21
- }
22
- const me = typeof Proxy == "function", _e = "devtools-plugin:setup", ye = "plugin:settings:set";
23
- let v, P;
24
- function be() {
25
- var e;
26
- return v !== void 0 || (typeof window < "u" && window.performance ? (v = !0, P = window.performance) : typeof globalThis < "u" && (!((e = globalThis.perf_hooks) === null || e === void 0) && e.performance) ? (v = !0, P = globalThis.perf_hooks.performance) : v = !1), v;
27
- }
28
- function Se() {
29
- return be() ? P.now() : Date.now();
30
- }
31
- class ve {
32
- constructor(t, r) {
33
- this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = t, this.hook = r;
34
- const n = {};
35
- if (t.settings)
36
- for (const i in t.settings) {
37
- const a = t.settings[i];
38
- n[i] = a.defaultValue;
39
- }
40
- const o = `__vue-devtools-plugin-settings__${t.id}`;
41
- let s = Object.assign({}, n);
42
- try {
43
- const i = localStorage.getItem(o), a = JSON.parse(i);
44
- Object.assign(s, a);
45
- } catch {
46
- }
47
- this.fallbacks = {
48
- getSettings() {
49
- return s;
50
- },
51
- setSettings(i) {
52
- try {
53
- localStorage.setItem(o, JSON.stringify(i));
54
- } catch {
55
- }
56
- s = i;
57
- },
58
- now() {
59
- return Se();
60
- }
61
- }, r && r.on(ye, (i, a) => {
62
- i === this.plugin.id && this.fallbacks.setSettings(a);
63
- }), this.proxiedOn = new Proxy({}, {
64
- get: (i, a) => this.target ? this.target.on[a] : (...c) => {
65
- this.onQueue.push({
66
- method: a,
67
- args: c
68
- });
69
- }
70
- }), this.proxiedTarget = new Proxy({}, {
71
- get: (i, a) => this.target ? this.target[a] : a === "on" ? this.proxiedOn : Object.keys(this.fallbacks).includes(a) ? (...c) => (this.targetQueue.push({
72
- method: a,
73
- args: c,
74
- resolve: () => {
75
- }
76
- }), this.fallbacks[a](...c)) : (...c) => new Promise((l) => {
77
- this.targetQueue.push({
78
- method: a,
79
- args: c,
80
- resolve: l
81
- });
82
- })
83
- });
84
- }
85
- async setRealTarget(t) {
86
- this.target = t;
87
- for (const r of this.onQueue)
88
- this.target.on[r.method](...r.args);
89
- for (const r of this.targetQueue)
90
- r.resolve(await this.target[r.method](...r.args));
91
- }
92
- }
93
- function W(e, t) {
94
- const r = e, n = z(), o = pe(), s = me && r.enableEarlyProxy;
95
- if (o && (n.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !s))
96
- o.emit(_e, e, t);
97
- else {
98
- const i = s ? new ve(r, o) : null;
99
- (n.__VUE_DEVTOOLS_PLUGINS__ = n.__VUE_DEVTOOLS_PLUGINS__ || []).push({
100
- pluginDescriptor: r,
101
- setupFn: t,
102
- proxy: i
103
- }), i && t(i.proxiedTarget);
104
- }
105
- }
106
- /*!
107
- * pinia v2.1.7
108
- * (c) 2023 Eduardo San Martin Morote
109
- * @license MIT
110
- */
111
- const we = process.env.NODE_ENV !== "production" ? Symbol("pinia") : (
112
- /* istanbul ignore next */
113
- Symbol()
114
- );
115
- var y;
116
- (function(e) {
117
- e.direct = "direct", e.patchObject = "patch object", e.patchFunction = "patch function";
118
- })(y || (y = {}));
119
- const Q = typeof window < "u", U = (process.env.NODE_ENV !== "production" || !1) && process.env.NODE_ENV !== "test" && Q, C = typeof window == "object" && window.window === window ? window : typeof self == "object" && self.self === self ? self : typeof global == "object" && global.global === global ? global : typeof globalThis == "object" ? globalThis : { HTMLElement: null };
120
- function Oe(e, { autoBom: t = !1 } = {}) {
121
- return t && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type) ? new Blob(["\uFEFF", e], { type: e.type }) : e;
122
- }
123
- function j(e, t, r) {
124
- const n = new XMLHttpRequest();
125
- n.open("GET", e), n.responseType = "blob", n.onload = function() {
126
- q(n.response, t, r);
127
- }, n.onerror = function() {
128
- console.error("could not download file");
129
- }, n.send();
130
- }
131
- function Y(e) {
132
- const t = new XMLHttpRequest();
133
- t.open("HEAD", e, !1);
134
- try {
135
- t.send();
136
- } catch {
137
- }
138
- return t.status >= 200 && t.status <= 299;
139
- }
140
- function O(e) {
141
- try {
142
- e.dispatchEvent(new MouseEvent("click"));
143
- } catch {
144
- const r = document.createEvent("MouseEvents");
145
- r.initMouseEvent("click", !0, !0, window, 0, 0, 0, 80, 20, !1, !1, !1, !1, 0, null), e.dispatchEvent(r);
146
- }
147
- }
148
- const I = typeof navigator == "object" ? navigator : { userAgent: "" }, K = /Macintosh/.test(I.userAgent) && /AppleWebKit/.test(I.userAgent) && !/Safari/.test(I.userAgent), q = Q ? (
149
- // Use download attribute first if possible (#193 Lumia mobile) unless this is a macOS WebView or mini program
150
- typeof HTMLAnchorElement < "u" && "download" in HTMLAnchorElement.prototype && !K ? Ie : (
151
- // Use msSaveOrOpenBlob as a second approach
152
- "msSaveOrOpenBlob" in I ? Ee : (
153
- // Fallback to using FileReader and a popup
154
- Te
155
- )
156
- )
157
- ) : () => {
158
- };
159
- function Ie(e, t = "download", r) {
160
- const n = document.createElement("a");
161
- n.download = t, n.rel = "noopener", typeof e == "string" ? (n.href = e, n.origin !== location.origin ? Y(n.href) ? j(e, t, r) : (n.target = "_blank", O(n)) : O(n)) : (n.href = URL.createObjectURL(e), setTimeout(function() {
162
- URL.revokeObjectURL(n.href);
163
- }, 4e4), setTimeout(function() {
164
- O(n);
165
- }, 0));
166
- }
167
- function Ee(e, t = "download", r) {
168
- if (typeof e == "string")
169
- if (Y(e))
170
- j(e, t, r);
171
- else {
172
- const n = document.createElement("a");
173
- n.href = e, n.target = "_blank", setTimeout(function() {
174
- O(n);
175
- });
176
- }
177
- else
178
- navigator.msSaveOrOpenBlob(Oe(e, r), t);
179
- }
180
- function Te(e, t, r, n) {
181
- if (n = n || open("", "_blank"), n && (n.document.title = n.document.body.innerText = "downloading..."), typeof e == "string")
182
- return j(e, t, r);
183
- const o = e.type === "application/octet-stream", s = /constructor/i.test(String(C.HTMLElement)) || "safari" in C, i = /CriOS\/[\d]+/.test(navigator.userAgent);
184
- if ((i || o && s || K) && typeof FileReader < "u") {
185
- const a = new FileReader();
186
- a.onloadend = function() {
187
- let c = a.result;
188
- if (typeof c != "string")
189
- throw n = null, new Error("Wrong reader.result type");
190
- c = i ? c : c.replace(/^data:[^;]*;/, "data:attachment/file;"), n ? n.location.href = c : location.assign(c), n = null;
191
- }, a.readAsDataURL(e);
192
- } else {
193
- const a = URL.createObjectURL(e);
194
- n ? n.location.assign(a) : location.href = a, n = null, setTimeout(function() {
195
- URL.revokeObjectURL(a);
196
- }, 4e4);
197
- }
198
- }
199
- function u(e, t) {
200
- const r = "🍍 " + e;
201
- typeof __VUE_DEVTOOLS_TOAST__ == "function" ? __VUE_DEVTOOLS_TOAST__(r, t) : t === "error" ? console.error(r) : t === "warn" ? console.warn(r) : console.log(r);
202
- }
203
- function x(e) {
204
- return "_a" in e && "install" in e;
205
- }
206
- function X() {
207
- if (!("clipboard" in navigator))
208
- return u("Your browser doesn't support the Clipboard API", "error"), !0;
209
- }
210
- function Z(e) {
211
- return e instanceof Error && e.message.toLowerCase().includes("document is not focused") ? (u('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.', "warn"), !0) : !1;
212
- }
213
- async function $e(e) {
214
- if (!X())
215
- try {
216
- await navigator.clipboard.writeText(JSON.stringify(e.state.value)), u("Global state copied to clipboard.");
217
- } catch (t) {
218
- if (Z(t))
219
- return;
220
- u("Failed to serialize the state. Check the console for more details.", "error"), console.error(t);
221
- }
222
- }
223
- async function Ae(e) {
224
- if (!X())
225
- try {
226
- ee(e, JSON.parse(await navigator.clipboard.readText())), u("Global state pasted from clipboard.");
227
- } catch (t) {
228
- if (Z(t))
229
- return;
230
- u("Failed to deserialize the state from clipboard. Check the console for more details.", "error"), console.error(t);
231
- }
232
- }
233
- async function Pe(e) {
234
- try {
235
- q(new Blob([JSON.stringify(e.state.value)], {
236
- type: "text/plain;charset=utf-8"
237
- }), "pinia-state.json");
238
- } catch (t) {
239
- u("Failed to export the state as JSON. Check the console for more details.", "error"), console.error(t);
240
- }
241
- }
242
- let p;
243
- function ke() {
244
- p || (p = document.createElement("input"), p.type = "file", p.accept = ".json");
245
- function e() {
246
- return new Promise((t, r) => {
247
- p.onchange = async () => {
248
- const n = p.files;
249
- if (!n)
250
- return t(null);
251
- const o = n.item(0);
252
- return t(o ? { text: await o.text(), file: o } : null);
253
- }, p.oncancel = () => t(null), p.onerror = r, p.click();
254
- });
255
- }
256
- return e;
257
- }
258
- async function Re(e) {
259
- try {
260
- const r = await ke()();
261
- if (!r)
262
- return;
263
- const { text: n, file: o } = r;
264
- ee(e, JSON.parse(n)), u(`Global state imported from "${o.name}".`);
265
- } catch (t) {
266
- u("Failed to import the state from JSON. Check the console for more details.", "error"), console.error(t);
267
- }
268
- }
269
- function ee(e, t) {
270
- for (const r in t) {
271
- const n = e.state.value[r];
272
- n ? Object.assign(n, t[r]) : e.state.value[r] = t[r];
273
- }
274
- }
275
- function g(e) {
276
- return {
277
- _custom: {
278
- display: e
279
- }
280
- };
281
- }
282
- const te = "🍍 Pinia (root)", k = "_root";
283
- function Le(e) {
284
- return x(e) ? {
285
- id: k,
286
- label: te
287
- } : {
288
- id: e.$id,
289
- label: e.$id
290
- };
291
- }
292
- function je(e) {
293
- if (x(e)) {
294
- const r = Array.from(e._s.keys()), n = e._s;
295
- return {
296
- state: r.map((s) => ({
297
- editable: !0,
298
- key: s,
299
- value: e.state.value[s]
300
- })),
301
- getters: r.filter((s) => n.get(s)._getters).map((s) => {
302
- const i = n.get(s);
303
- return {
304
- editable: !1,
305
- key: s,
306
- value: i._getters.reduce((a, c) => (a[c] = i[c], a), {})
307
- };
308
- })
309
- };
310
- }
311
- const t = {
312
- state: Object.keys(e.$state).map((r) => ({
313
- editable: !0,
314
- key: r,
315
- value: e.$state[r]
316
- }))
317
- };
318
- return e._getters && e._getters.length && (t.getters = e._getters.map((r) => ({
319
- editable: !1,
320
- key: r,
321
- value: e[r]
322
- }))), e._customProperties.size && (t.customProperties = Array.from(e._customProperties).map((r) => ({
323
- editable: !0,
324
- key: r,
325
- value: e[r]
326
- }))), t;
327
- }
328
- function xe(e) {
329
- return e ? Array.isArray(e) ? e.reduce((t, r) => (t.keys.push(r.key), t.operations.push(r.type), t.oldValue[r.key] = r.oldValue, t.newValue[r.key] = r.newValue, t), {
330
- oldValue: {},
331
- keys: [],
332
- operations: [],
333
- newValue: {}
334
- }) : {
335
- operation: g(e.type),
336
- key: g(e.key),
337
- oldValue: e.oldValue,
338
- newValue: e.newValue
339
- } : {};
340
- }
341
- function Ne(e) {
342
- switch (e) {
343
- case y.direct:
344
- return "mutation";
345
- case y.patchFunction:
346
- return "$patch";
347
- case y.patchObject:
348
- return "$patch";
349
- default:
350
- return "unknown";
351
- }
352
- }
353
- let w = !0;
354
- const E = [], _ = "pinia:mutations", f = "pinia", { assign: De } = Object, T = (e) => "🍍 " + e;
355
- function Ve(e, t) {
356
- W({
357
- id: "dev.esm.pinia",
358
- label: "Pinia 🍍",
359
- logo: "https://pinia.vuejs.org/logo.svg",
360
- packageName: "pinia",
361
- homepage: "https://pinia.vuejs.org",
362
- componentStateTypes: E,
363
- app: e
364
- }, (r) => {
365
- typeof r.now != "function" && u("You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."), r.addTimelineLayer({
366
- id: _,
367
- label: "Pinia 🍍",
368
- color: 15064968
369
- }), r.addInspector({
370
- id: f,
371
- label: "Pinia 🍍",
372
- icon: "storage",
373
- treeFilterPlaceholder: "Search stores",
374
- actions: [
375
- {
376
- icon: "content_copy",
377
- action: () => {
378
- $e(t);
379
- },
380
- tooltip: "Serialize and copy the state"
381
- },
382
- {
383
- icon: "content_paste",
384
- action: async () => {
385
- await Ae(t), r.sendInspectorTree(f), r.sendInspectorState(f);
386
- },
387
- tooltip: "Replace the state with the content of your clipboard"
388
- },
389
- {
390
- icon: "save",
391
- action: () => {
392
- Pe(t);
393
- },
394
- tooltip: "Save the state as a JSON file"
395
- },
396
- {
397
- icon: "folder_open",
398
- action: async () => {
399
- await Re(t), r.sendInspectorTree(f), r.sendInspectorState(f);
400
- },
401
- tooltip: "Import the state from a JSON file"
402
- }
403
- ],
404
- nodeActions: [
405
- {
406
- icon: "restore",
407
- tooltip: 'Reset the state (with "$reset")',
408
- action: (n) => {
409
- const o = t._s.get(n);
410
- o ? typeof o.$reset != "function" ? u(`Cannot reset "${n}" store because it doesn't have a "$reset" method implemented.`, "warn") : (o.$reset(), u(`Store "${n}" reset.`)) : u(`Cannot reset "${n}" store because it wasn't found.`, "warn");
411
- }
412
- }
413
- ]
414
- }), r.on.inspectComponent((n, o) => {
415
- const s = n.componentInstance && n.componentInstance.proxy;
416
- if (s && s._pStores) {
417
- const i = n.componentInstance.proxy._pStores;
418
- Object.values(i).forEach((a) => {
419
- n.instanceData.state.push({
420
- type: T(a.$id),
421
- key: "state",
422
- editable: !0,
423
- value: a._isOptionsAPI ? {
424
- _custom: {
425
- value: L(a.$state),
426
- actions: [
427
- {
428
- icon: "restore",
429
- tooltip: "Reset the state of this store",
430
- action: () => a.$reset()
431
- }
432
- ]
433
- }
434
- } : (
435
- // NOTE: workaround to unwrap transferred refs
436
- Object.keys(a.$state).reduce((c, l) => (c[l] = a.$state[l], c), {})
437
- )
438
- }), a._getters && a._getters.length && n.instanceData.state.push({
439
- type: T(a.$id),
440
- key: "getters",
441
- editable: !1,
442
- value: a._getters.reduce((c, l) => {
443
- try {
444
- c[l] = a[l];
445
- } catch (d) {
446
- c[l] = d;
447
- }
448
- return c;
449
- }, {})
450
- });
451
- });
452
- }
453
- }), r.on.getInspectorTree((n) => {
454
- if (n.app === e && n.inspectorId === f) {
455
- let o = [t];
456
- o = o.concat(Array.from(t._s.values())), n.rootNodes = (n.filter ? o.filter((s) => "$id" in s ? s.$id.toLowerCase().includes(n.filter.toLowerCase()) : te.toLowerCase().includes(n.filter.toLowerCase())) : o).map(Le);
457
- }
458
- }), r.on.getInspectorState((n) => {
459
- if (n.app === e && n.inspectorId === f) {
460
- const o = n.nodeId === k ? t : t._s.get(n.nodeId);
461
- if (!o)
462
- return;
463
- o && (n.state = je(o));
464
- }
465
- }), r.on.editInspectorState((n, o) => {
466
- if (n.app === e && n.inspectorId === f) {
467
- const s = n.nodeId === k ? t : t._s.get(n.nodeId);
468
- if (!s)
469
- return u(`store "${n.nodeId}" not found`, "error");
470
- const { path: i } = n;
471
- x(s) ? i.unshift("state") : (i.length !== 1 || !s._customProperties.has(i[0]) || i[0] in s.$state) && i.unshift("$state"), w = !1, n.set(s, i, n.state.value), w = !0;
472
- }
473
- }), r.on.editComponentState((n) => {
474
- if (n.type.startsWith("🍍")) {
475
- const o = n.type.replace(/^🍍\s*/, ""), s = t._s.get(o);
476
- if (!s)
477
- return u(`store "${o}" not found`, "error");
478
- const { path: i } = n;
479
- if (i[0] !== "state")
480
- return u(`Invalid path for store "${o}":
481
- ${i}
482
- Only state can be modified.`);
483
- i[0] = "$state", w = !1, n.set(s, i, n.state.value), w = !0;
484
- }
485
- });
486
- });
487
- }
488
- function Ue(e, t) {
489
- E.includes(T(t.$id)) || E.push(T(t.$id)), W({
490
- id: "dev.esm.pinia",
491
- label: "Pinia 🍍",
492
- logo: "https://pinia.vuejs.org/logo.svg",
493
- packageName: "pinia",
494
- homepage: "https://pinia.vuejs.org",
495
- componentStateTypes: E,
496
- app: e,
497
- settings: {
498
- logStoreChanges: {
499
- label: "Notify about new/deleted stores",
500
- type: "boolean",
501
- defaultValue: !0
502
- }
503
- // useEmojis: {
504
- // label: 'Use emojis in messages ⚡️',
505
- // type: 'boolean',
506
- // defaultValue: true,
507
- // },
508
- }
509
- }, (r) => {
510
- const n = typeof r.now == "function" ? r.now.bind(r) : Date.now;
511
- t.$onAction(({ after: i, onError: a, name: c, args: l }) => {
512
- const d = ne++;
513
- r.addTimelineEvent({
514
- layerId: _,
515
- event: {
516
- time: n(),
517
- title: "🛫 " + c,
518
- subtitle: "start",
519
- data: {
520
- store: g(t.$id),
521
- action: g(c),
522
- args: l
523
- },
524
- groupId: d
525
- }
526
- }), i((h) => {
527
- m = void 0, r.addTimelineEvent({
528
- layerId: _,
529
- event: {
530
- time: n(),
531
- title: "🛬 " + c,
532
- subtitle: "end",
533
- data: {
534
- store: g(t.$id),
535
- action: g(c),
536
- args: l,
537
- result: h
538
- },
539
- groupId: d
540
- }
541
- });
542
- }), a((h) => {
543
- m = void 0, r.addTimelineEvent({
544
- layerId: _,
545
- event: {
546
- time: n(),
547
- logType: "error",
548
- title: "💥 " + c,
549
- subtitle: "end",
550
- data: {
551
- store: g(t.$id),
552
- action: g(c),
553
- args: l,
554
- error: h
555
- },
556
- groupId: d
557
- }
558
- });
559
- });
560
- }, !0), t._customProperties.forEach((i) => {
561
- se(() => ie(t[i]), (a, c) => {
562
- r.notifyComponentUpdate(), r.sendInspectorState(f), w && r.addTimelineEvent({
563
- layerId: _,
564
- event: {
565
- time: n(),
566
- title: "Change",
567
- subtitle: i,
568
- data: {
569
- newValue: a,
570
- oldValue: c
571
- },
572
- groupId: m
573
- }
574
- });
575
- }, { deep: !0 });
576
- }), t.$subscribe(({ events: i, type: a }, c) => {
577
- if (r.notifyComponentUpdate(), r.sendInspectorState(f), !w)
578
- return;
579
- const l = {
580
- time: n(),
581
- title: Ne(a),
582
- data: De({ store: g(t.$id) }, xe(i)),
583
- groupId: m
584
- };
585
- a === y.patchFunction ? l.subtitle = "⤵️" : a === y.patchObject ? l.subtitle = "🧩" : i && !Array.isArray(i) && (l.subtitle = i.type), i && (l.data["rawEvent(s)"] = {
586
- _custom: {
587
- display: "DebuggerEvent",
588
- type: "object",
589
- tooltip: "raw DebuggerEvent[]",
590
- value: i
591
- }
592
- }), r.addTimelineEvent({
593
- layerId: _,
594
- event: l
595
- });
596
- }, { detached: !0, flush: "sync" });
597
- const o = t._hotUpdate;
598
- t._hotUpdate = J((i) => {
599
- o(i), r.addTimelineEvent({
600
- layerId: _,
601
- event: {
602
- time: n(),
603
- title: "🔥 " + t.$id,
604
- subtitle: "HMR update",
605
- data: {
606
- store: g(t.$id),
607
- info: g("HMR update")
608
- }
609
- }
610
- }), r.notifyComponentUpdate(), r.sendInspectorTree(f), r.sendInspectorState(f);
611
- });
612
- const { $dispose: s } = t;
613
- t.$dispose = () => {
614
- s(), r.notifyComponentUpdate(), r.sendInspectorTree(f), r.sendInspectorState(f), r.getSettings().logStoreChanges && u(`Disposed "${t.$id}" store 🗑`);
615
- }, r.notifyComponentUpdate(), r.sendInspectorTree(f), r.sendInspectorState(f), r.getSettings().logStoreChanges && u(`"${t.$id}" store installed 🆕`);
616
- });
617
- }
618
- let ne = 0, m;
619
- function M(e, t, r) {
620
- const n = t.reduce((o, s) => (o[s] = L(e)[s], o), {});
621
- for (const o in n)
622
- e[o] = function() {
623
- const s = ne, i = r ? new Proxy(e, {
624
- get(...c) {
625
- return m = s, Reflect.get(...c);
626
- },
627
- set(...c) {
628
- return m = s, Reflect.set(...c);
629
- }
630
- }) : e;
631
- m = s;
632
- const a = n[o].apply(i, arguments);
633
- return m = void 0, a;
634
- };
635
- }
636
- function Ce({ app: e, store: t, options: r }) {
637
- if (t.$id.startsWith("__hot:"))
638
- return;
639
- t._isOptionsAPI = !!r.state, M(t, Object.keys(r.actions), t._isOptionsAPI);
640
- const n = t._hotUpdate;
641
- L(t)._hotUpdate = function(o) {
642
- n.apply(this, arguments), M(t, Object.keys(o._hmrPayload.actions), !!t._isOptionsAPI);
643
- }, Ue(
644
- e,
645
- // FIXME: is there a way to allow the assignment from Store<Id, S, G, A> to StoreGeneric?
646
- t
647
- );
648
- }
649
- function Me() {
650
- const e = oe(!0), t = e.run(() => B({}));
651
- let r = [], n = [];
652
- const o = J({
653
- install(s) {
654
- o._a = s, s.provide(we, o), s.config.globalProperties.$pinia = o, U && Ve(s, o), n.forEach((i) => r.push(i)), n = [];
655
- },
656
- use(s) {
657
- return !this._a && !he ? n.push(s) : r.push(s), this;
658
- },
659
- _p: r,
660
- // it's actually undefined here
661
- // @ts-expect-error
662
- _a: null,
663
- _e: e,
664
- _s: /* @__PURE__ */ new Map(),
665
- state: t
666
- });
667
- return U && typeof Proxy < "u" && o.use(Ce), o;
668
- }
669
- process.env.NODE_ENV !== "production" ? Symbol("pinia:skipHydration") : (
670
- /* istanbul ignore next */
671
- Symbol()
672
- );
673
- function Ge(e) {
674
- return typeof e == "object" && e !== null;
675
- }
676
- function G(e, t) {
677
- return e = Ge(e) ? e : /* @__PURE__ */ Object.create(null), new Proxy(e, {
678
- get(r, n, o) {
679
- return n === "key" ? Reflect.get(r, n, o) : Reflect.get(r, n, o) || Reflect.get(t, n, o);
680
- }
681
- });
682
- }
683
- function Fe(e, t) {
684
- return t.reduce((r, n) => r == null ? void 0 : r[n], e);
685
- }
686
- function He(e, t, r) {
687
- return t.slice(0, -1).reduce((n, o) => /^(__proto__)$/.test(o) ? {} : n[o] = n[o] || {}, e)[t[t.length - 1]] = r, e;
688
- }
689
- function Be(e, t) {
690
- return t.reduce((r, n) => {
691
- const o = n.split(".");
692
- return He(r, o, Fe(e, o));
693
- }, {});
694
- }
695
- function Je(e, t) {
696
- return (r) => {
697
- var n;
698
- try {
699
- const {
700
- storage: o = localStorage,
701
- beforeRestore: s = void 0,
702
- afterRestore: i = void 0,
703
- serializer: a = {
704
- serialize: JSON.stringify,
705
- deserialize: JSON.parse
706
- },
707
- key: c = t.$id,
708
- paths: l = null,
709
- debug: d = !1
710
- } = r;
711
- return {
712
- storage: o,
713
- beforeRestore: s,
714
- afterRestore: i,
715
- serializer: a,
716
- key: ((n = e.key) != null ? n : (h) => h)(typeof c == "string" ? c : c(t.$id)),
717
- paths: l,
718
- debug: d
719
- };
720
- } catch (o) {
721
- return r.debug && console.error("[pinia-plugin-persistedstate]", o), null;
722
- }
723
- };
724
- }
725
- function F(e, { storage: t, serializer: r, key: n, debug: o }) {
726
- try {
727
- const s = t == null ? void 0 : t.getItem(n);
728
- s && e.$patch(r == null ? void 0 : r.deserialize(s));
729
- } catch (s) {
730
- o && console.error("[pinia-plugin-persistedstate]", s);
731
- }
732
- }
733
- function H(e, { storage: t, serializer: r, key: n, paths: o, debug: s }) {
734
- try {
735
- const i = Array.isArray(o) ? Be(e, o) : e;
736
- t.setItem(n, r.serialize(i));
737
- } catch (i) {
738
- s && console.error("[pinia-plugin-persistedstate]", i);
739
- }
740
- }
741
- function ze(e = {}) {
742
- return (t) => {
743
- const { auto: r = !1 } = e, {
744
- options: { persist: n = r },
745
- store: o,
746
- pinia: s
747
- } = t;
748
- if (!n)
749
- return;
750
- if (!(o.$id in s.state.value)) {
751
- const a = s._s.get(o.$id.replace("__hot:", ""));
752
- a && Promise.resolve().then(() => a.$persist());
753
- return;
754
- }
755
- const i = (Array.isArray(n) ? n.map((a) => G(a, e)) : [G(n, e)]).map(Je(e, o)).filter(Boolean);
756
- o.$persist = () => {
757
- i.forEach((a) => {
758
- H(o.$state, a);
759
- });
760
- }, o.$hydrate = ({ runHooks: a = !0 } = {}) => {
761
- i.forEach((c) => {
762
- const { beforeRestore: l, afterRestore: d } = c;
763
- a && (l == null || l(t)), F(o, c), a && (d == null || d(t));
764
- });
765
- }, i.forEach((a) => {
766
- const { beforeRestore: c, afterRestore: l } = a;
767
- c == null || c(t), F(o, a), l == null || l(t), o.$subscribe(
768
- (d, h) => {
769
- H(h, a);
770
- },
771
- {
772
- detached: !0
773
- }
774
- );
775
- });
776
- };
777
- }
778
- var We = ze();
779
- const R = Me();
780
- R.use(We);
781
- const Qe = (e) => {
782
- var l, d, h, N, D;
783
- const t = ((l = e == null ? void 0 : e.router) == null ? void 0 : l.routerBase) ?? "/", r = ((d = e == null ? void 0 : e.router) == null ? void 0 : d.options) || {};
784
- let n = Object.assign(((h = e == null ? void 0 : e.router) == null ? void 0 : h.glob) || {});
785
- const o = Object.values(n).filter((b) => !!b).flat().sort((b, $) => (b.index ?? 0) - ($.index ?? 0)), s = [];
786
- (N = e == null ? void 0 : e.microApps) == null || N.map((b) => {
787
- var V;
788
- const $ = Object.values(((V = b.router) == null ? void 0 : V.glob) || {}).filter((S) => !!S).flat().sort((S, re) => (S.index ?? 0) - (re.index ?? 0));
789
- s.push(
790
- ...$.map((S) => ({ ...S, path: `/${b.microAppName}${S.path}` }))
16
+ }, d = j();
17
+ d.use(k);
18
+ const B = (e) => {
19
+ var i, h, b, A, g;
20
+ const a = ((i = e == null ? void 0 : e.router) == null ? void 0 : i.routerBase) ?? "/", c = ((h = e == null ? void 0 : e.router) == null ? void 0 : h.options) || {};
21
+ let l = Object.assign(((b = e == null ? void 0 : e.router) == null ? void 0 : b.glob) || {});
22
+ const t = Object.values(l).filter((f) => !!f).flat().sort((f, m) => (f.index ?? 0) - (m.index ?? 0)), u = [];
23
+ (A = e == null ? void 0 : e.microApps) == null || A.map((f) => {
24
+ var p;
25
+ const m = Object.values(((p = f.router) == null ? void 0 : p.glob) || {}).filter((r) => !!r).flat().sort((r, v) => (r.index ?? 0) - (v.index ?? 0));
26
+ u.push(
27
+ ...m.map((r) => ({ ...r, path: `/${f.microAppName}${r.path}` }))
28
+ ), u.push(
29
+ ...m.filter((r) => !!r.path).filter((r) => r.path !== "").filter((r) => r.path !== "/").filter((r) => !r.path.startsWith(`/${r.microAppName}`)).map((r) => ({
30
+ path: r.path,
31
+ redirect: `/${f.microAppName}${r.path}`,
32
+ meta: { ...r.meta || {}, isMicroAppRouteRedirect: !0 }
33
+ }))
791
34
  );
792
35
  });
793
- const i = ((D = e == null ? void 0 : e.router) == null ? void 0 : D.routers) || [], a = [
794
- ...A(o, e),
795
- ...A(i, e),
796
- ...A(s, e)
36
+ const s = ((g = e == null ? void 0 : e.router) == null ? void 0 : g.routers) || [], R = [
37
+ ...n(t, e),
38
+ ...n(s, e),
39
+ ...n(u, e)
797
40
  ];
798
- return { router: fe({ history: de(t), routes: a, ...r }) };
799
- }, A = (e, t) => e.map((r) => {
800
- const n = r.meta || {};
801
- return n.keepAlive = n.keepAlive ?? (t == null ? void 0 : t.keepAlive) ?? !0, { ...r, meta: n };
802
- }), et = (e) => {
41
+ return { router: y({ history: D(a), routes: R, ...c }) };
42
+ }, n = (e, a) => e.map((c) => {
43
+ const l = c.meta || {};
44
+ return l.keepAlive = l.keepAlive ?? (a == null ? void 0 : a.keepAlive) ?? !0, { ...c, meta: l };
45
+ }), w = (e) => {
803
46
  e || (e = {});
804
- const t = B(!0);
805
- Promise.all([ce(e), le(e)]).then(() => {
806
- t.value = !1;
47
+ const a = x(!0);
48
+ Promise.all([P(e), W(e)]).then(() => {
49
+ a.value = !1;
807
50
  });
808
- const { container: r, component: n, props: o } = (e == null ? void 0 : e.root) || {}, s = ae(n || ue, o);
809
- s.use(ge, e), s.use(R);
810
- const { router: i } = Qe(e);
811
- return s.use(i), s.mount(r || "#app"), { app: s, router: i, loading: t, store: R };
51
+ const { container: c, component: l, props: t } = (e == null ? void 0 : e.root) || {}, u = O(l || $, t);
52
+ u.use(N, e), u.use(d);
53
+ const { router: s } = B(e);
54
+ return u.use(s), u.mount(c || "#app"), { app: u, router: s, loading: a, store: d };
812
55
  };
813
56
  export {
814
- et as createDasWebApp
57
+ w as createDasWebApp
815
58
  };