@das-fed/web 6.3.0-beta.0 → 6.3.0-beta.10

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 (40) hide show
  1. package/esm-map.json +27 -0
  2. package/index.js +2078 -9818
  3. package/index.js.gz +0 -0
  4. package/package.json +32 -16
  5. package/packages/create-das-web-app/index.js +799 -0
  6. package/packages/create-das-web-app/index.js.gz +0 -0
  7. package/packages/i18n/index.js +35 -0
  8. package/packages/layout/index.js +736 -0
  9. package/packages/layout/index.js.gz +0 -0
  10. package/packages/layout/style.css +7 -0
  11. package/packages/layout/style.css.gz +0 -0
  12. package/packages/micro-frontend/index.js +820 -0
  13. package/packages/micro-frontend/index.js.gz +0 -0
  14. package/packages/micro-frontend/style.css +1 -0
  15. package/packages/style/index.js +2 -0
  16. package/packages/style/style.css +1 -0
  17. package/packages/style/style.css.gz +0 -0
  18. package/packages/theme/index.js +76 -0
  19. package/packages/theme/index.js.gz +0 -0
  20. package/style.css +2 -2
  21. package/style.css.gz +0 -0
  22. package/types/create-das-web-app/get-global-config.d.ts +2 -0
  23. package/types/create-das-web-app/index.d.ts +9 -0
  24. package/types/create-das-web-app/plugins/index.d.ts +4 -0
  25. package/types/create-das-web-app/router/index.d.ts +4 -0
  26. package/types/create-das-web-app/store/index.d.ts +2 -0
  27. package/types/i18n/index.d.ts +21 -0
  28. package/types/index.d.ts +5 -0
  29. package/types/layout/index.d.ts +5 -0
  30. package/types/layout/store/iframe-view.d.ts +12 -0
  31. package/types/layout/store/index.d.ts +70 -0
  32. package/types/layout/store/menu.d.ts +16 -0
  33. package/types/layout/store/nav.d.ts +26 -0
  34. package/types/layout/store/overlay.d.ts +5 -0
  35. package/types/layout/store/tab.d.ts +17 -0
  36. package/types/micro-frontend/bus.d.ts +33 -0
  37. package/types/micro-frontend/index.d.ts +7 -0
  38. package/types/micro-frontend/store.d.ts +5 -0
  39. package/types/theme/index.d.ts +13 -0
  40. package/index.umd.cjs +0 -41
@@ -0,0 +1,820 @@
1
+ import { defineComponent as x, computed as _, watch as M, openBlock as E, createElementBlock as N, ref as w, Fragment as $, renderList as oe, unref as S, withDirectives as ce, createBlock as Z, vShow as le, createCommentVNode as ue, nextTick as ee, mergeProps as de, withCtx as F, renderSlot as V, createVNode as R, onActivated as pe, reactive as C, getCurrentScope as me, onScopeDispose as fe, getCurrentInstance as ve, onMounted as Ae } from "vue";
2
+ import { DasWebLayout as he, DasWebNav as we, DasWebMenu as ge, DasWebTabs as _e } from "@das-fed/web/packages/layout/index";
3
+ const ye = ["src", "entry", "name"], Me = /* @__PURE__ */ x({
4
+ __name: "das-micro-app",
5
+ props: {
6
+ src: {},
7
+ name: {},
8
+ actived: { type: Boolean }
9
+ },
10
+ emits: ["onLoaded", "onActivated", "onDeactivated"],
11
+ setup(e, { emit: t }) {
12
+ const n = e, r = t, c = (s) => {
13
+ r("onLoaded", s);
14
+ }, o = _(() => n.actived);
15
+ return M(() => o.value, (s) => {
16
+ s && r("onActivated"), s || r("onDeactivated");
17
+ }), (s, a) => (E(), N("iframe", {
18
+ class: "das-micro-app",
19
+ src: n.src,
20
+ entry: n.src,
21
+ name: n.name,
22
+ frameborder: "0",
23
+ onLoad: c
24
+ }, null, 40, ye));
25
+ }
26
+ }), te = (e, t) => {
27
+ const n = e.__vccOpts || e;
28
+ for (const [r, c] of t)
29
+ n[r] = c;
30
+ return n;
31
+ }, Le = /* @__PURE__ */ te(Me, [["__scopeId", "data-v-2266bab0"]]), z = w("/das-micro-app"), f = w([]), k = w(!1), T = w([]), D = w(!0);
32
+ let A = null, h = null, b = null;
33
+ const I = (e, t, n) => {
34
+ var c, o, i, s;
35
+ const r = f.value.find((a) => a.name === e);
36
+ if (r) {
37
+ if (r.entry.startsWith("/") || r.entry.match(location.origin)) {
38
+ (o = (c = r.dom) == null ? void 0 : c.contentWindow) == null || o.postMessage({ type: t, data: n });
39
+ return;
40
+ }
41
+ (s = (i = r.dom) == null ? void 0 : i.contentWindow) == null || s.postMessage({ type: t, data: n }, r.entry);
42
+ }
43
+ }, q = (e, t) => {
44
+ var o;
45
+ const { __IN_DAS_MICRO_APP: n, __DAS_MAIN_APP_HREF: r } = window;
46
+ if (!n || !r) return;
47
+ const { origin: c } = new URL(r);
48
+ (o = window.top) == null || o.postMessage({ type: e, data: t }, c);
49
+ }, be = () => {
50
+ h || (h || (h = {}), window.addEventListener(
51
+ "message",
52
+ (e) => {
53
+ const { type: t, source: n } = e.data || {};
54
+ if (n !== "react-devtools-content-script" && h[t])
55
+ for (const r in h[t])
56
+ h[t][r](e.data);
57
+ },
58
+ !1
59
+ ));
60
+ }, Ie = () => {
61
+ A || (A || (A = {}), window.addEventListener(
62
+ "message",
63
+ (e) => {
64
+ const { type: t } = e.data || {};
65
+ if (A[t])
66
+ for (const n in A[t])
67
+ A[t][n](e.data);
68
+ },
69
+ !1
70
+ ));
71
+ }, Ee = (e, t) => {
72
+ Ie();
73
+ const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8);
74
+ return A[e] || (A[e] = {}), A[e][n] = t, {
75
+ remove: () => {
76
+ A[e] && A[e][n] && delete A[e][n];
77
+ }
78
+ };
79
+ }, Se = (e, t) => {
80
+ be();
81
+ const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8);
82
+ return h[e] || (h[e] = {}), h[e][n] = t, {
83
+ remove: () => {
84
+ h[e] && h[e][n] && delete h[e][n];
85
+ }
86
+ };
87
+ }, Q = async (e) => {
88
+ await Promise.all(
89
+ f.value.filter((t) => t.loaded).map((t) => new Promise(async (n) => {
90
+ t.dom || await new Promise((r) => M(() => t.dom, r)), setTimeout(() => {
91
+ I(t.name, "sessionStorage", e), n(!0);
92
+ }, 0);
93
+ }))
94
+ );
95
+ }, d = {
96
+ loadMicroApp: (e) => {
97
+ k.value = !0;
98
+ const t = f.value.find((i) => i.name === e), n = f.value.find((i) => i.actived), r = !!t, c = !(t != null && t.loaded), o = t == null ? void 0 : t.actived;
99
+ if (!r) {
100
+ n && (n.actived = !1);
101
+ return;
102
+ }
103
+ if (t.isFirstActived = !0, c) {
104
+ t.src = t.entry;
105
+ const i = f.value.find((s) => s.actived);
106
+ i && (i.actived = !1), t.loaded = !0, t.actived = !0;
107
+ return;
108
+ }
109
+ if (!o) {
110
+ n && (n.actived = !1), t.actived = !0;
111
+ return;
112
+ }
113
+ },
114
+ hideMicroApp: async (e) => {
115
+ const t = f.value.find((n) => n.name === e);
116
+ t && t.loaded && (t.dom || await new Promise((n) => M(() => t.dom, n)), I(e, "router", {
117
+ cmd: "push",
118
+ route: {
119
+ name: "das-micro-app-ghost",
120
+ microAppName: e
121
+ }
122
+ }));
123
+ },
124
+ hideAllMicroApp: () => {
125
+ k.value = !1, f.value.map((e) => {
126
+ e.actived = !1;
127
+ });
128
+ },
129
+ unloadMicroApp: (e) => {
130
+ const t = f.value.find((n) => n.name === e);
131
+ t && (t.loaded = !1, t.actived = !1, t.dom = void 0);
132
+ },
133
+ unloadAllMicroApp: () => {
134
+ k.value = !1, f.value.map((e) => {
135
+ e.loaded = !1, e.actived = !1, e.dom = void 0;
136
+ });
137
+ },
138
+ setMicroAppRoute: async (e, t, n) => {
139
+ const r = f.value.find((s) => s.name === t);
140
+ if (!r || !r.loaded || !r.actived || (r.dom || await new Promise((s) => M(() => r.dom, s)), !r.actived)) return r;
141
+ const c = n.path || n, o = n.query || {}, i = n.params || {};
142
+ return e.push({
143
+ path: `/${t}${c}`,
144
+ query: o,
145
+ // @ts-ignore
146
+ params: i
147
+ }), setTimeout(() => {
148
+ const { isFirstActived: s } = r;
149
+ I(t, "router", {
150
+ cmd: s ? "replace" : "push",
151
+ route: n,
152
+ microAppName: t
153
+ }), s && (r.isFirstActived = !1);
154
+ }, 0), r;
155
+ },
156
+ sendMessageToMicroApp: I,
157
+ sendMessageToMainApp: q,
158
+ addEventListenerFromMainApp: Ee,
159
+ addEventListenerFromMicroApp: Se,
160
+ setMainAppOverlay: (e, t) => {
161
+ q("bodyOverlay", { visible: e, style: t });
162
+ },
163
+ sessionStorage: {
164
+ key: window.sessionStorage.key,
165
+ getItem: window.sessionStorage.getItem,
166
+ setItem: (e, t) => {
167
+ window.sessionStorage.setItem(e, t), Q({ cmd: "setItem", key: e, value: t });
168
+ },
169
+ removeItem: (e) => {
170
+ window.sessionStorage.removeItem(e), Q({ cmd: "removeItem", key: e });
171
+ },
172
+ clear: () => {
173
+ window.sessionStorage.clear(), Q({ cmd: "clear" });
174
+ }
175
+ },
176
+ addMicroAppLifeCycleListener: (e, t) => {
177
+ const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8);
178
+ b || (b = {});
179
+ const r = () => {
180
+ b[n] && delete b[n];
181
+ };
182
+ return b[n] = {
183
+ type: e,
184
+ handler: async (c) => await t(c),
185
+ remove: r
186
+ }, { remove: r };
187
+ },
188
+ triggerMicroAppLifeCycleListener: (e, t, n) => {
189
+ var o;
190
+ const r = b, { autoRemove: c = !1 } = n || {};
191
+ for (const i in r) {
192
+ const s = r[i];
193
+ s.type === e && ((o = s == null ? void 0 : s.handler) == null || o.call(s, t).then(() => {
194
+ c && s.remove();
195
+ }));
196
+ }
197
+ },
198
+ reloadMicroAppRoute: async (e, t) => {
199
+ const n = f.value.find((r) => r.name === e);
200
+ n && (!n.loaded || !n.actived || (n.dom || await new Promise((r) => M(() => n.dom, r)), I(e, "route", { cmd: "reload", path: t })));
201
+ },
202
+ unloadMicroAppRoute: async (e, t) => {
203
+ const n = f.value.find((r) => r.name === e);
204
+ n && (!n.loaded || !n.actived || (n.dom || await new Promise((r) => M(() => n.dom, r)), I(e, "route", { cmd: "unload", path: t })));
205
+ },
206
+ setMainAppLayoutVisible: (e) => {
207
+ q("layoutVisible", { visible: e });
208
+ }
209
+ }, Pe = /* @__PURE__ */ x({
210
+ __name: "das-micro-apps",
211
+ setup(e) {
212
+ const t = w(null), n = async (o, i) => {
213
+ const s = f.value.find((m) => m.name === i);
214
+ if (!s) return;
215
+ s.dom = o.target, await ee(), await new Promise((m) => setTimeout(m, 50));
216
+ const a = () => {
217
+ const m = t.value.getBoundingClientRect() || {};
218
+ return m.width = t.value.clientWidth, m.height = t.value.clientHeight, m;
219
+ };
220
+ d.sendMessageToMicroApp(i, "onLoaded", {
221
+ href: location.href,
222
+ microAppContainerRect: a(),
223
+ entry: s.entry,
224
+ name: s.name
225
+ });
226
+ const { dom: p, ...l } = s;
227
+ d.triggerMicroAppLifeCycleListener("onLoaded", l), new ResizeObserver(() => {
228
+ d.sendMessageToMicroApp(i, "resize", a());
229
+ }).observe(t.value), d.sendMessageToMicroApp(i, "setProxyMessageStatus", { visible: !0, parentHref: location.href }), d.sendMessageToMicroApp(i, "setProxSsoStatus", { visible: !0, parentHref: location.href });
230
+ }, r = (o, i) => {
231
+ const s = f.value.find((l) => l.name === i);
232
+ if (!s) return;
233
+ const { dom: a, ...p } = s;
234
+ d.sendMessageToMicroApp(i, "onActivated"), d.triggerMicroAppLifeCycleListener("onActivated", p);
235
+ }, c = (o, i) => {
236
+ const s = f.value.find((l) => l.name === i);
237
+ if (!s) return;
238
+ const { dom: a, ...p } = s;
239
+ d.sendMessageToMicroApp(i, "onDeactivated"), d.triggerMicroAppLifeCycleListener("onDeactivated", p);
240
+ };
241
+ return (o, i) => (E(), N(
242
+ "div",
243
+ {
244
+ ref_key: "containerRef",
245
+ ref: t,
246
+ class: "das-micro-app-container"
247
+ },
248
+ [
249
+ (E(!0), N(
250
+ $,
251
+ null,
252
+ oe(S(f), (s) => (E(), N(
253
+ $,
254
+ null,
255
+ [
256
+ s.loaded ? ce((E(), Z(Le, {
257
+ key: 0,
258
+ src: s.src || "",
259
+ name: s.name,
260
+ actived: s.actived,
261
+ onOnLoaded: (a) => n(a, s.name),
262
+ onOnActivated: (a) => r(a, s.name),
263
+ onOnDeactivated: (a) => c(a, s.name)
264
+ }, null, 8, ["src", "name", "actived", "onOnLoaded", "onOnActivated", "onOnDeactivated"])), [
265
+ [le, s.actived]
266
+ ]) : ue("v-if", !0)
267
+ ],
268
+ 64
269
+ /* STABLE_FRAGMENT */
270
+ ))),
271
+ 256
272
+ /* UNKEYED_FRAGMENT */
273
+ ))
274
+ ],
275
+ 512
276
+ /* NEED_PATCH */
277
+ ));
278
+ }
279
+ }), Oe = /* @__PURE__ */ te(Pe, [["__scopeId", "data-v-2e3798bc"]]), Ze = /* @__PURE__ */ x({
280
+ __name: "das-main-app-layout",
281
+ props: {
282
+ transitionConfig: {},
283
+ showLayout: { type: Boolean },
284
+ showAside: { type: Boolean },
285
+ showTabs: { type: Boolean },
286
+ menuAttr: {},
287
+ tabsAttr: {}
288
+ },
289
+ setup(e) {
290
+ const t = e, n = _(() => !k.value), r = _(() => t.showLayout ?? !0), c = _(() => t.showAside ?? !0), o = _(() => t.showTabs ?? !0), i = _(() => t.menuAttr ?? {}), s = _(() => t.tabsAttr ?? {}), a = _(() => ({
291
+ "enter-active-class": "animate__animated animate__fadeInLeft",
292
+ ...t.transitionConfig || {}
293
+ })), p = _(() => ({ showLayout: r.value, showAside: c.value, showTabs: o.value }));
294
+ return (l, g) => (E(), Z(S(he), de({
295
+ "transition-config": a.value,
296
+ "router-view-visible": n.value
297
+ }, p.value), {
298
+ header: F(() => [
299
+ V(l.$slots, "header", {}, () => [
300
+ R(S(we))
301
+ ])
302
+ ]),
303
+ aside: F(() => [
304
+ V(l.$slots, "aside", {}, () => [
305
+ R(S(ge), { menuAttr: i.value }, null, 8, ["menuAttr"])
306
+ ])
307
+ ]),
308
+ tab: F(() => [
309
+ V(l.$slots, "tab", {}, () => [
310
+ R(S(_e), { tabsAttr: s.value }, null, 8, ["tabsAttr"])
311
+ ])
312
+ ]),
313
+ default: F(() => [
314
+ R(Oe)
315
+ ]),
316
+ _: 3
317
+ /* FORWARDED */
318
+ }, 16, ["transition-config", "router-view-visible"]));
319
+ }
320
+ }), ne = /* @__PURE__ */ x({
321
+ __name: "das-micro-app-ghost",
322
+ setup(e) {
323
+ return pe(() => {
324
+ setTimeout(() => {
325
+ document.documentElement.checkVisibility() && history.back();
326
+ }, 300);
327
+ }), (t, n) => null;
328
+ }
329
+ }), u = C({
330
+ visible: !1,
331
+ logo: "",
332
+ items: [],
333
+ projects: [],
334
+ userInfo: {},
335
+ config: {},
336
+ searchConfig: {},
337
+ // activeItem: '',
338
+ // activeProject: {},
339
+ eventListeners: {}
340
+ }), Ce = {
341
+ show: () => {
342
+ u.visible = !0;
343
+ },
344
+ hide: () => {
345
+ u.visible = !1;
346
+ },
347
+ setLogo: (e) => {
348
+ u.logo = e;
349
+ },
350
+ setItems: (e) => {
351
+ u.visible || (u.visible = !0), u.items = e;
352
+ },
353
+ getItems: () => u.items,
354
+ removeItem: (e) => {
355
+ const t = u.items.filter((n) => n.value !== e);
356
+ u.items = t;
357
+ },
358
+ appendItem: (e) => {
359
+ u.visible || (u.visible = !0), !u.items.find((n) => n.value == e.value) && u.items.push(e);
360
+ },
361
+ setActiveItem: (e) => {
362
+ u.activeItem = e;
363
+ },
364
+ setConfig: (e) => {
365
+ u.config = e;
366
+ },
367
+ setProjects: (e) => {
368
+ u.projects = e;
369
+ },
370
+ setProjectConfig: (e) => {
371
+ u.projectConfig = e;
372
+ },
373
+ setActiveProject: (e) => {
374
+ u.activeProject = e;
375
+ },
376
+ setUserInfo: (e) => {
377
+ u.userInfo = e;
378
+ },
379
+ setSearchConfig: (e) => {
380
+ u.searchConfig = e;
381
+ },
382
+ triggerEventListener: (e, t, n) => {
383
+ var i;
384
+ const r = u.eventListeners, { autoRemove: c = !1 } = n || {}, o = [];
385
+ for (const s in r) {
386
+ const a = r[s];
387
+ a.type === e && o.push(
388
+ (i = a == null ? void 0 : a.handler) == null ? void 0 : i.call(a, t).then(() => {
389
+ c && a.remove();
390
+ })
391
+ );
392
+ }
393
+ return Promise.all(o).then(() => !0).catch(() => !1);
394
+ },
395
+ addEventListener: (e, t) => {
396
+ const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8), r = () => {
397
+ u.eventListeners[n] && delete u.eventListeners[n];
398
+ };
399
+ return u.eventListeners[n] = {
400
+ type: e,
401
+ handler: async (c) => {
402
+ try {
403
+ await t(c);
404
+ } catch (o) {
405
+ throw o;
406
+ }
407
+ },
408
+ remove: r
409
+ }, {
410
+ remove: r
411
+ };
412
+ }
413
+ }, y = C({
414
+ items: [],
415
+ eventListeners: {}
416
+ }), Fe = {
417
+ setItems: (e) => {
418
+ y.items = e;
419
+ },
420
+ getItems: () => y.items,
421
+ setActiveItem: (e) => {
422
+ y.activeItem = e;
423
+ },
424
+ setPopupClassName: (e) => {
425
+ y.popupClassName = e;
426
+ },
427
+ triggerEventListener: (e, t, n) => {
428
+ var i;
429
+ const r = y.eventListeners, { autoRemove: c = !1 } = n || {}, o = [];
430
+ for (const s in r) {
431
+ const a = r[s];
432
+ a.type === e && o.push(
433
+ (i = a == null ? void 0 : a.handler) == null ? void 0 : i.call(a, t).then(() => {
434
+ c && a.remove();
435
+ })
436
+ );
437
+ }
438
+ return Promise.all(o).then(() => !0).catch(() => !1);
439
+ },
440
+ addEventListener: (e, t) => {
441
+ const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8), r = () => {
442
+ y.eventListeners[n] && delete y.eventListeners[n];
443
+ };
444
+ return y.eventListeners[n] = {
445
+ type: e,
446
+ handler: async (c) => {
447
+ try {
448
+ await t(c);
449
+ } catch (o) {
450
+ throw o;
451
+ }
452
+ },
453
+ remove: r
454
+ }, {
455
+ remove: r
456
+ };
457
+ }
458
+ }, v = C({
459
+ items: [],
460
+ eventListeners: {}
461
+ }), Re = {
462
+ setItems: (e) => {
463
+ v.items = e;
464
+ },
465
+ getItems: () => v.items,
466
+ removeItem: (e) => {
467
+ const t = v.items.filter((n) => n.value !== e);
468
+ v.items = t;
469
+ },
470
+ appendItem: (e) => {
471
+ const t = v.items.findIndex((n) => n.value == e.value);
472
+ t !== -1 ? v.items.splice(t, 1, e) : v.items.push(e);
473
+ },
474
+ setActiveItem: (e) => {
475
+ v.activeItem = e;
476
+ },
477
+ triggerEventListener: (e, t, n) => {
478
+ var i;
479
+ const r = v.eventListeners, { autoRemove: c = !1 } = n || {}, o = [];
480
+ for (const s in r) {
481
+ const a = r[s];
482
+ a.type === e && o.push(
483
+ (i = a == null ? void 0 : a.handler) == null ? void 0 : i.call(a, t).then(() => {
484
+ c && a.remove();
485
+ })
486
+ );
487
+ }
488
+ return Promise.all(o).then(() => !0).catch(() => !1);
489
+ },
490
+ addEventListener: (e, t) => {
491
+ const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8), r = () => {
492
+ v.eventListeners[n] && delete v.eventListeners[n];
493
+ };
494
+ return v.eventListeners[n] = {
495
+ type: e,
496
+ handler: async (c) => {
497
+ try {
498
+ await t(c);
499
+ } catch (o) {
500
+ throw o;
501
+ }
502
+ },
503
+ remove: r
504
+ }, {
505
+ remove: r
506
+ };
507
+ }
508
+ }, O = C({
509
+ eventListeners: {}
510
+ }), Te = {
511
+ triggerEventListener: (e, t, n) => {
512
+ var i;
513
+ const r = O.eventListeners, { autoRemove: c = !1 } = n || {}, o = [];
514
+ for (const s in r) {
515
+ const a = r[s];
516
+ a.type === e && o.push(
517
+ (i = a == null ? void 0 : a.handler) == null ? void 0 : i.call(a, t).then(() => {
518
+ c && a.remove();
519
+ })
520
+ );
521
+ }
522
+ return Promise.all(o).then(() => !0).catch(() => !1);
523
+ },
524
+ addEventListener: (e, t) => {
525
+ const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8), r = () => {
526
+ O.eventListeners[n] && delete O.eventListeners[n];
527
+ };
528
+ return O.eventListeners[n] = {
529
+ type: e,
530
+ handler: async (c) => {
531
+ try {
532
+ await t(c);
533
+ } catch (o) {
534
+ throw o;
535
+ }
536
+ },
537
+ remove: r
538
+ }, {
539
+ remove: r
540
+ };
541
+ }
542
+ }, W = C({
543
+ visible: !1,
544
+ style: {}
545
+ }), De = {
546
+ set: (e, t) => {
547
+ W.visible = e, t || (t = {}), t.transition || (t.transition = "all 0.3s"), t && (W.style = t);
548
+ }
549
+ }, Ne = {
550
+ nav: u,
551
+ menu: y,
552
+ tab: v,
553
+ overlay: W,
554
+ iframeView: O,
555
+ visible: w(!0)
556
+ }, j = {
557
+ nav: Ce,
558
+ menu: Fe,
559
+ tab: Re,
560
+ overlay: De,
561
+ iframeView: Te,
562
+ setVisible: (e) => Ne.visible.value = e
563
+ };
564
+ var H;
565
+ const B = typeof window < "u", ke = (e) => typeof e == "string", xe = () => {
566
+ };
567
+ B && ((H = window == null ? void 0 : window.navigator) != null && H.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
568
+ function re(e) {
569
+ return typeof e == "function" ? e() : S(e);
570
+ }
571
+ function Ve(e) {
572
+ return e;
573
+ }
574
+ function se(e) {
575
+ return me() ? (fe(e), !0) : !1;
576
+ }
577
+ function qe(e, t = !0) {
578
+ ve() ? Ae(e) : t ? e() : ee(e);
579
+ }
580
+ function ae(e) {
581
+ var t;
582
+ const n = re(e);
583
+ return (t = n == null ? void 0 : n.$el) != null ? t : n;
584
+ }
585
+ const Qe = B ? window : void 0, We = B ? window.document : void 0;
586
+ function Be(...e) {
587
+ let t, n, r, c;
588
+ if (ke(e[0]) || Array.isArray(e[0]) ? ([n, r, c] = e, t = Qe) : [t, n, r, c] = e, !t)
589
+ return xe;
590
+ Array.isArray(n) || (n = [n]), Array.isArray(r) || (r = [r]);
591
+ const o = [], i = () => {
592
+ o.forEach((l) => l()), o.length = 0;
593
+ }, s = (l, g, m, L) => (l.addEventListener(g, m, L), () => l.removeEventListener(g, m, L)), a = M(() => [ae(t), re(c)], ([l, g]) => {
594
+ i(), l && o.push(...n.flatMap((m) => r.map((L) => s(l, m, L, g))));
595
+ }, { immediate: !0, flush: "post" }), p = () => {
596
+ a(), i();
597
+ };
598
+ return se(p), p;
599
+ }
600
+ function $e(e, t = !1) {
601
+ const n = w(), r = () => n.value = !!e();
602
+ return r(), qe(r, t), n;
603
+ }
604
+ const U = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, G = "__vueuse_ssr_handlers__";
605
+ U[G] = U[G] || {};
606
+ const J = [
607
+ [
608
+ "requestFullscreen",
609
+ "exitFullscreen",
610
+ "fullscreenElement",
611
+ "fullscreenEnabled",
612
+ "fullscreenchange",
613
+ "fullscreenerror"
614
+ ],
615
+ [
616
+ "webkitRequestFullscreen",
617
+ "webkitExitFullscreen",
618
+ "webkitFullscreenElement",
619
+ "webkitFullscreenEnabled",
620
+ "webkitfullscreenchange",
621
+ "webkitfullscreenerror"
622
+ ],
623
+ [
624
+ "webkitRequestFullScreen",
625
+ "webkitCancelFullScreen",
626
+ "webkitCurrentFullScreenElement",
627
+ "webkitCancelFullScreen",
628
+ "webkitfullscreenchange",
629
+ "webkitfullscreenerror"
630
+ ],
631
+ [
632
+ "mozRequestFullScreen",
633
+ "mozCancelFullScreen",
634
+ "mozFullScreenElement",
635
+ "mozFullScreenEnabled",
636
+ "mozfullscreenchange",
637
+ "mozfullscreenerror"
638
+ ],
639
+ [
640
+ "msRequestFullscreen",
641
+ "msExitFullscreen",
642
+ "msFullscreenElement",
643
+ "msFullscreenEnabled",
644
+ "MSFullscreenChange",
645
+ "MSFullscreenError"
646
+ ]
647
+ ];
648
+ function ze(e, t = {}) {
649
+ const { document: n = We, autoExit: r = !1 } = t, c = n == null ? void 0 : n.querySelector("html"), o = w(!1);
650
+ let i = J[0];
651
+ const s = $e(() => {
652
+ if (n) {
653
+ for (const P of J)
654
+ if (P[1] in n)
655
+ return i = P, !0;
656
+ } else
657
+ return !1;
658
+ return !1;
659
+ }), [a, p, l, , g] = i;
660
+ async function m() {
661
+ s.value && (n != null && n[l] && await n[p](), o.value = !1);
662
+ }
663
+ async function L() {
664
+ if (!s.value)
665
+ return;
666
+ await m();
667
+ const P = ae(c);
668
+ P && (await P[a](), o.value = !0);
669
+ }
670
+ async function ie() {
671
+ o.value ? await m() : await L();
672
+ }
673
+ return n && Be(n, g, () => {
674
+ o.value = !!(n != null && n[l]);
675
+ }, !1), r && se(m), {
676
+ isSupported: s,
677
+ isFullscreen: o,
678
+ enter: L,
679
+ exit: m,
680
+ toggle: ie
681
+ };
682
+ }
683
+ var K;
684
+ (function(e) {
685
+ e.UP = "UP", e.RIGHT = "RIGHT", e.DOWN = "DOWN", e.LEFT = "LEFT", e.NONE = "NONE";
686
+ })(K || (K = {}));
687
+ var je = Object.defineProperty, X = Object.getOwnPropertySymbols, He = Object.prototype.hasOwnProperty, Ue = Object.prototype.propertyIsEnumerable, Y = (e, t, n) => t in e ? je(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Ge = (e, t) => {
688
+ for (var n in t || (t = {}))
689
+ He.call(t, n) && Y(e, n, t[n]);
690
+ if (X)
691
+ for (var n of X(t))
692
+ Ue.call(t, n) && Y(e, n, t[n]);
693
+ return e;
694
+ };
695
+ const Je = {
696
+ easeInSine: [0.12, 0, 0.39, 0],
697
+ easeOutSine: [0.61, 1, 0.88, 1],
698
+ easeInOutSine: [0.37, 0, 0.63, 1],
699
+ easeInQuad: [0.11, 0, 0.5, 0],
700
+ easeOutQuad: [0.5, 1, 0.89, 1],
701
+ easeInOutQuad: [0.45, 0, 0.55, 1],
702
+ easeInCubic: [0.32, 0, 0.67, 0],
703
+ easeOutCubic: [0.33, 1, 0.68, 1],
704
+ easeInOutCubic: [0.65, 0, 0.35, 1],
705
+ easeInQuart: [0.5, 0, 0.75, 0],
706
+ easeOutQuart: [0.25, 1, 0.5, 1],
707
+ easeInOutQuart: [0.76, 0, 0.24, 1],
708
+ easeInQuint: [0.64, 0, 0.78, 0],
709
+ easeOutQuint: [0.22, 1, 0.36, 1],
710
+ easeInOutQuint: [0.83, 0, 0.17, 1],
711
+ easeInExpo: [0.7, 0, 0.84, 0],
712
+ easeOutExpo: [0.16, 1, 0.3, 1],
713
+ easeInOutExpo: [0.87, 0, 0.13, 1],
714
+ easeInCirc: [0.55, 0, 1, 0.45],
715
+ easeOutCirc: [0, 0.55, 0.45, 1],
716
+ easeInOutCirc: [0.85, 0, 0.15, 1],
717
+ easeInBack: [0.36, 0, 0.66, -0.56],
718
+ easeOutBack: [0.34, 1.56, 0.64, 1],
719
+ easeInOutBack: [0.68, -0.6, 0.32, 1.6]
720
+ };
721
+ Ge({
722
+ linear: Ve
723
+ }, Je);
724
+ const Ke = (e) => ["http://", "https://", "ws://", "wss://", "/"].find((n) => e.startsWith(n)) ? e : `/${e}`, et = (e, t) => {
725
+ if (!(e != null && e.microApps) || !Array.isArray(e.microApps)) return;
726
+ window.__IN_DAS_MAIN_APP = !0, e != null && e.microAppRouterPrefix && (z.value = e.microAppRouterPrefix), f.value = (e.microApps || []).filter((c) => !!c.name).map((c) => ({ ...c, entry: Ke(c.entry || c.name) })), t == null || t.addRoute({
727
+ name: "das-micro-app",
728
+ path: `${z.value}/:pathMatch(.*)*`,
729
+ component: ne,
730
+ meta: { isMicroApp: !0, keepAlive: !0 }
731
+ }), d.addEventListenerFromMicroApp("bodyOverlay", (c) => {
732
+ const { visible: o, style: i } = c.data;
733
+ j.overlay.set(o, i);
734
+ }), d.addEventListenerFromMicroApp("layoutVisible", (c) => {
735
+ const { visible: o } = c.data;
736
+ j.setVisible(o);
737
+ }), d.addEventListenerFromMicroApp("route", (c) => {
738
+ const { name: o, cmd: i, path: s } = c.data;
739
+ i === "reload" && d.reloadMicroAppRoute(o, s), i === "unload" && d.unloadMicroAppRoute(o, s);
740
+ });
741
+ const { enter: n, exit: r } = ze();
742
+ d.addEventListenerFromMicroApp("fullscreen", (c) => {
743
+ const o = c.data;
744
+ o && n(), o || r();
745
+ }), d.addEventListenerFromMicroApp("location", (c) => {
746
+ const { cmd: o, isAutoCloseApp: i } = c.data || {};
747
+ o === "reload" && (i !== void 0 && (window.__isAutoCloseApp = i), location.reload());
748
+ });
749
+ }, tt = (e, t) => {
750
+ if (!(e != null && e.microAppName)) return;
751
+ window.config.microAppName = e.microAppName, window.self !== window.top && e.microAppName && (window.__IN_DAS_MICRO_APP = !0);
752
+ const n = "das-micro-app-ghost";
753
+ t == null || t.addRoute({
754
+ name: n,
755
+ path: `/${n}/:pathMatch(.*)*`,
756
+ component: ne,
757
+ meta: { isMicroApp: !0, keepAlive: !0 }
758
+ });
759
+ const r = w(!1), c = w(!1), o = w("");
760
+ M(
761
+ () => t.currentRoute.value,
762
+ (i) => {
763
+ if (r.value) {
764
+ r.value = !1;
765
+ return;
766
+ }
767
+ if (c.value) {
768
+ c.value = !1;
769
+ return;
770
+ }
771
+ const { path: s, query: a, params: p, meta: l } = i;
772
+ if (o.value.includes(i.path)) {
773
+ o.value = "";
774
+ return;
775
+ }
776
+ d.sendMessageToMainApp("router", {
777
+ cmd: "push",
778
+ route: {
779
+ path: s,
780
+ query: { ...a, microAppName: e.microAppName },
781
+ params: p,
782
+ meta: l
783
+ }
784
+ });
785
+ }
786
+ ), d.addEventListenerFromMainApp("router", async (i) => {
787
+ var l;
788
+ const { cmd: s, route: a, microAppName: p = "" } = i.data;
789
+ o.value = ("/" + p + a.path).replace(/\/\//g, "/"), (l = t == null ? void 0 : t[s]) == null || l.call(t, a);
790
+ }), d.addEventListenerFromMainApp("onLoaded", (i) => {
791
+ const { href: s, microAppContainerRect: a } = i.data;
792
+ window.__IN_DAS_MICRO_APP = !0, window.__DAS_MICRO_APP_NAME = e.microAppName, window.__DAS_MAIN_APP_HREF = s, window.__DAS_MICRO_APP_CONTAINER_RECT = a;
793
+ }), d.addEventListenerFromMainApp("onDeactivated", (i) => {
794
+ const { name: s = "", path: a, params: p = {}, query: l = {} } = t.currentRoute.value;
795
+ c.value = !0, t == null || t.push({
796
+ name: n,
797
+ query: { microAppName: e.microAppName, fromQuery: JSON.stringify(l), fromPath: a },
798
+ params: p
799
+ });
800
+ }), d.addEventListenerFromMainApp("onActivated", (i) => {
801
+ const { name: s = "", params: a = {}, query: p = {} } = t.currentRoute.value, { fromPath: l = "", fromQuery: g = "{}" } = p || {};
802
+ r.value = !0, t == null || t.push({ path: l, query: JSON.parse(g), params: a });
803
+ }), d.addEventListenerFromMainApp("sessionStorage", (i) => {
804
+ const { cmd: s, key: a, value: p } = i.data;
805
+ s === "setItem" && window.sessionStorage.setItem(a, p), s === "getItem" && window.sessionStorage.getItem(a), s === "removeItem" && window.sessionStorage.removeItem(a), s === "clear" && window.sessionStorage.clear();
806
+ }), d.addEventListenerFromMainApp("route", (i) => {
807
+ const { cmd: s, path: a } = i.data;
808
+ s === "reload" && (T.value.push(a), D.value = !1, setTimeout(() => {
809
+ D.value = !0, T.value = [];
810
+ }, 300)), s === "unload" && (T.value.push(a), D.value = !1, setTimeout(() => {
811
+ D.value = !0, T.value = [];
812
+ }, 100));
813
+ });
814
+ };
815
+ export {
816
+ Ze as DasMainAppLayout,
817
+ et as initMainApp,
818
+ tt as initMicroApp,
819
+ d as microFrontend
820
+ };