@das-fed/web 7.1.0-dev.9 → 7.1.0-jiangling.1

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 (60) hide show
  1. package/{index-BTrOjYni.js → index-B0B38Zrc.js} +1 -1
  2. package/index-B0B38Zrc.js.gz +0 -0
  3. package/{packages/main-app-framework/index-BCpLlVaK.js → index-B4nLIEw7.js} +1 -1
  4. package/{index-Dk1ujHU4.js → index-C0V1mmhY.js} +7102 -6909
  5. package/index-C0V1mmhY.js.gz +0 -0
  6. package/index.js +1 -1
  7. package/package.json +12 -8
  8. package/packages/create-das-web-app/index.js +144 -58
  9. package/packages/create-das-web-app/index.js.gz +0 -0
  10. package/packages/i18n/index.js +48 -54
  11. package/packages/i18n/index.js.gz +0 -0
  12. package/packages/layout/index.js +287 -281
  13. package/packages/layout/index.js.gz +0 -0
  14. package/packages/layout/style.css +1 -1
  15. package/packages/layout/style.css.gz +0 -0
  16. package/packages/main-app-framework/assets/black-logo-B-Qipuvf.png +0 -0
  17. package/packages/main-app-framework/assets/cjb-CTZzysmN.png +0 -0
  18. package/packages/main-app-framework/assets/cjb-preview-Cz6ZEp0h.png +0 -0
  19. package/packages/main-app-framework/assets/cjb-preview-DWYaDhQb.png +0 -0
  20. package/packages/main-app-framework/assets/default-DOjV2jIm.png +0 -0
  21. package/packages/main-app-framework/assets/default-preview-DEfMZxi2.png +0 -0
  22. package/packages/main-app-framework/assets/default-preview-HZjPO_Oz.png +0 -0
  23. package/packages/main-app-framework/assets/dkh-DkyUTuR0.png +0 -0
  24. package/packages/main-app-framework/assets/dkh-preview-DQZDuJfb.png +0 -0
  25. package/packages/main-app-framework/assets/dkh-preview-SJ0YoU2z.png +0 -0
  26. package/packages/main-app-framework/assets/feedback-QNGIKgWm.png +0 -0
  27. package/packages/main-app-framework/assets/hengxian-CyCsW-Hu.png +0 -0
  28. package/packages/main-app-framework/assets/kjl-DozNzlyC.png +0 -0
  29. package/packages/main-app-framework/assets/kjl-preview-CCoSuYDK.png +0 -0
  30. package/packages/main-app-framework/assets/kjl-preview-xHIEscys.png +0 -0
  31. package/packages/main-app-framework/assets/noIconurl-7L4lHbul.png +0 -0
  32. package/packages/main-app-framework/assets/qianru-Bsf1Lhh2.png +0 -0
  33. package/packages/main-app-framework/assets/setected-tvECHVG9.svg +31 -0
  34. package/packages/main-app-framework/assets/ssl-XnQ4A9bQ.png +0 -0
  35. package/packages/main-app-framework/assets/ssl-preview-C4BD2d61.png +0 -0
  36. package/packages/main-app-framework/assets/ssl-preview-DI5pA3Df.png +0 -0
  37. package/packages/main-app-framework/assets/unselected-C4QVkFPL.svg +39 -0
  38. package/packages/main-app-framework/assets/white-logo-D7bqAkJL.png +0 -0
  39. package/packages/main-app-framework/{index-8vwv2GaV.js → index-KrpfKz6n.js} +1 -1
  40. package/packages/main-app-framework/index-KrpfKz6n.js.gz +0 -0
  41. package/packages/main-app-framework/index-TlWCq0Vp.js +16724 -0
  42. package/packages/main-app-framework/index-TlWCq0Vp.js.gz +0 -0
  43. package/{index-CVxuymbs.js → packages/main-app-framework/index-mcZhp5kH.js} +1 -1
  44. package/packages/main-app-framework/index.js +1 -1
  45. package/packages/main-app-framework/style.css +1 -1
  46. package/packages/main-app-framework/style.css.gz +0 -0
  47. package/style.css +1 -1
  48. package/style.css.gz +0 -0
  49. package/types/create-das-web-app/router/namespace.d.ts +19 -0
  50. package/types/i18n/index.d.ts +4 -0
  51. package/types/main-app-framework/i18n/index.d.ts +10 -0
  52. package/types/main-app-framework/init-platform/api.d.ts +1 -0
  53. package/types/main-app-framework/init-sso/useTokenRefresh.d.ts +9 -0
  54. package/types/main-app-framework/utils/src/set-common-info.d.ts +10 -10
  55. package/index-BTrOjYni.js.gz +0 -0
  56. package/index-Dk1ujHU4.js.gz +0 -0
  57. package/packages/main-app-framework/index-8vwv2GaV.js.gz +0 -0
  58. package/packages/main-app-framework/index-DaGISUL8.js +0 -16618
  59. package/packages/main-app-framework/index-DaGISUL8.js.gz +0 -0
  60. package/types/create-das-web-app/get-web-config.d.ts +0 -1
Binary file
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { J as e, A as t, C as n, B as i, D as r, e as u, m as o, w as m, o as p, f as g, k as D, v as l, y as L, z as b, h as c, i as h, G as A, H as T, q as y, E as R, F as W, K as I, I as M, s as F, j as V, n as f, r as k, x as v, t as w } from "./index-Dk1ujHU4.js";
1
+ import { J as e, A as t, C as n, B as i, D as r, e as u, m as o, w as m, o as p, f as g, k as D, v as l, y as L, z as b, h as c, i as h, G as A, H as T, q as y, E as R, F as W, K as I, I as M, s as F, j as V, n as f, r as k, x as v, t as w } from "./index-C0V1mmhY.js";
2
2
  export {
3
3
  e as DasMainAppLayout,
4
4
  t as DasWebLayout,
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@das-fed/web",
3
- "version": "7.1.0-dev.9",
3
+ "version": "7.1.0-jiangling.1",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "dependencies": {
7
- "@das-fed/ui": "7.1.0-dev.9",
8
- "@das-fed/utils": "7.1.0-dev.9",
9
- "@das-fed/web": "7.1.0-dev.9",
10
- "@das-fed/web-components": "7.1.0-dev.9",
7
+ "@das-fed/ui": "7.1.0-jiangling.1",
8
+ "@das-fed/utils": "7.1.0-jiangling.1",
9
+ "@das-fed/web": "7.1.0-jiangling.1",
10
+ "@das-fed/web-components": "7.1.0-jiangling.1",
11
11
  "@microsoft/signalr": "^8.0.7",
12
12
  "@vueuse/core": "^9.13.0",
13
13
  "animate.css": "^4.1.1",
@@ -19,10 +19,11 @@
19
19
  "vue-router": "^4.4.0"
20
20
  },
21
21
  "devDependencies": {
22
- "@das-fed/cli": "7.1.0-dev.9",
22
+ "@das-fed/cli": "7.1.0-jiangling.1",
23
23
  "@types/crypto-js": "^4.2.2",
24
24
  "@types/lodash": "^4.14.194",
25
25
  "@types/lodash-es": "^4.17.12",
26
+ "@types/js-cookie": "^3.0.6",
26
27
  "@vitejs/plugin-vue": "^5.1.0",
27
28
  "consola": "^3.2.3",
28
29
  "execa": "^9.3.0",
@@ -35,14 +36,17 @@
35
36
  "typescript": "^5.5.3",
36
37
  "vite": "^5.3.4",
37
38
  "vite-plugin-dts": "^3.9.1",
38
- "vue-tsc": "^1.8.27"
39
+ "vue-tsc": "^1.8.27",
40
+ "js-cookie": "^3.0.5"
39
41
  },
40
42
  "peerDependencies": {
41
43
  "vue": ">=3.4.21",
42
44
  "vue-router": ">=4.2.5"
43
45
  },
44
46
  "sideEffects": [
45
- "@das-fed/utils/*"
47
+ "@das-fed/utils/*",
48
+ "./packages/style/*",
49
+ "./packages/**/*.css"
46
50
  ],
47
51
  "publishConfig": {
48
52
  "access": "public",
@@ -1,67 +1,153 @@
1
- import { ref as v, createApp as w } from "vue";
2
- import { initTheme as j } from "@das-fed/web/packages/theme/index";
3
- import { initI18n as x } from "@das-fed/web/packages/i18n/index";
4
- import { DasWebLayout as W } from "@das-fed/web/packages/layout/index";
5
- import { createPinia as $ } from "pinia";
6
- import k from "pinia-plugin-persistedstate";
7
- import { createRouter as y, createWebHistory as O } from "vue-router";
8
- import { getConfig as P } from "@das-fed/utils/config";
1
+ import { ref as D, createApp as L } from "vue";
2
+ import { initTheme as H } from "@das-fed/web/packages/theme/index";
3
+ import { initI18n as G } from "@das-fed/web/packages/i18n/index";
4
+ import { DasWebLayout as N } from "@das-fed/web/packages/layout/index";
5
+ import { createPinia as Q } from "pinia";
6
+ import T from "pinia-plugin-persistedstate";
7
+ import { createRouter as U, createWebHistory as _ } from "vue-router";
9
8
  const C = {
10
- install: (e, t) => {
11
- var u;
12
- const c = (u = t == null ? void 0 : t.plugins) == null ? void 0 : u.glob;
13
- c && Object.values(c).sort((a, l) => (a.index ?? 0) - (l.index ?? 0)).filter((a) => a ? !!(a.default && a.default.install || a.install) : !1).forEach((a) => {
14
- a.default && a.default.install && e.use(a.default, t), a.install && e.use(a, t);
9
+ install: (e, s) => {
10
+ var a;
11
+ const r = (a = s == null ? void 0 : s.plugins) == null ? void 0 : a.glob;
12
+ r && Object.values(r).sort((n, t) => (n.index ?? 0) - (t.index ?? 0)).filter((n) => n ? !!(n.default && n.default.install || n.install) : !1).forEach((n) => {
13
+ n.default && n.default.install && e.use(n.default, s), n.install && e.use(n, s);
15
14
  });
16
15
  }
17
- }, m = $();
18
- m.use(k);
19
- const D = (e) => {
20
- var o, d, b, g, h;
21
- const t = ((o = e == null ? void 0 : e.router) == null ? void 0 : o.routerBase) ?? "/", c = ((d = e == null ? void 0 : e.router) == null ? void 0 : d.options) || {};
22
- let u = Object.assign(((b = e == null ? void 0 : e.router) == null ? void 0 : b.glob) || {});
23
- const a = Object.values(u).filter((s) => !!s).flat().sort((s, n) => (s.index ?? 0) - (n.index ?? 0)), l = [];
24
- (g = e == null ? void 0 : e.microApps) == null || g.map((s) => {
25
- var A;
26
- const n = Object.values(((A = s.router) == null ? void 0 : A.glob) || {}).filter((r) => !!r).flat().sort((r, R) => (r.index ?? 0) - (R.index ?? 0));
27
- l.push(
28
- ...n.map((r) => ({ ...r, path: `/${s.microAppName}${r.path}` }))
29
- ), l.push(
30
- ...n.filter((r) => !!r.path).filter((r) => r.path !== "").filter((r) => r.path !== "/").filter((r) => !r.path.startsWith(`/${r.microAppName}`)).map((r) => ({
31
- path: r.path,
32
- redirect: `/${s.microAppName}${r.path}`,
33
- meta: { ...r.meta || {}, isMicroAppRouteRedirect: !0 }
34
- }))
35
- );
36
- });
37
- const f = ((h = e == null ? void 0 : e.router) == null ? void 0 : h.routers) || [], p = [
38
- ...i(a, e),
39
- ...i(f, e),
40
- ...i(l, e)
41
- ];
42
- return { router: y({ history: O(t), routes: p, ...c }) };
43
- }, i = (e, t) => e.map((c) => {
44
- const u = c.meta || {};
45
- return u.keepAlive = u.keepAlive ?? (t == null ? void 0 : t.keepAlive) ?? !0, { ...c, meta: u };
46
- }), N = async () => {
47
- const { baseURL: e = "" } = P();
48
- try {
49
- const c = await (await fetch(`${e}/oss/resource/front-end/web/_config/config.json`)).json().catch(() => ({})), { disableSaveToken: u = !1 } = c || {};
50
- window.webConfig = { disableSaveToken: u };
51
- } catch {
52
- window.webConfig = { disableSaveToken: !1 };
16
+ }, A = Q();
17
+ A.use(T);
18
+ const d = "::", f = (e) => {
19
+ if (!e) return "";
20
+ const r = (e.startsWith("/") ? e : `/${e}`).replace(/\/{2,}/g, "/");
21
+ return r.length > 1 && r.endsWith("/") ? r.slice(0, -1) : r;
22
+ }, O = (e) => `/${e.replace(/^\/+|\/+$/g, "")}`, $ = (e, s) => {
23
+ const r = O(s), a = f(e);
24
+ return a === r || a.startsWith(`${r}/`);
25
+ }, v = (e, s) => {
26
+ const r = O(e), a = f(s);
27
+ return !a || a === "/" ? r : $(a, e) ? a : `${r}${a}`;
28
+ }, I = (e, s) => {
29
+ const r = f(e).split("/").filter(Boolean), a = f(s).split("/").filter(Boolean);
30
+ let n = 0;
31
+ for (let t = 0; t < r.length; t++) {
32
+ const i = r[t];
33
+ if (i === "*" || i.startsWith("*") || i.includes("(.*")) return !0;
34
+ const c = i.endsWith("?");
35
+ if (n >= a.length)
36
+ return c && r.slice(t).every((h) => h.endsWith("?"));
37
+ if (i.startsWith(":")) {
38
+ n += 1;
39
+ continue;
40
+ }
41
+ if (i !== a[n]) return !1;
42
+ n += 1;
43
+ }
44
+ return n === a.length;
45
+ }, z = (e, s = "") => {
46
+ const r = [];
47
+ return e.forEach((a) => {
48
+ const n = typeof (a == null ? void 0 : a.path) == "string" ? a.path : "";
49
+ let t = s;
50
+ n.startsWith("/") ? t = f(n) : n && (t = f(`${s}/${n}`)), t && r.push(t), Array.isArray(a == null ? void 0 : a.children) && a.children.length && r.push(...z(a.children, t));
51
+ }), r;
52
+ }, F = (e) => {
53
+ const s = /* @__PURE__ */ new Set(), r = (a) => {
54
+ a.forEach((n) => {
55
+ typeof (n == null ? void 0 : n.name) == "string" && n.name && s.add(n.name), Array.isArray(n == null ? void 0 : n.children) && r(n.children);
56
+ });
57
+ };
58
+ return r(e), s;
59
+ }, b = (e, s, r, a) => {
60
+ if (typeof e == "string")
61
+ return !e.startsWith("/") || $(e, s) || !r.some((t) => I(t, e)) ? e : v(s, e);
62
+ if (!e || typeof e != "object") return e;
63
+ const n = { ...e };
64
+ return typeof n.name == "string" && a.has(n.name) && !n.name.includes(d) && (n.name = `${s}${d}${n.name}`), typeof n.path == "string" && (n.path = b(n.path, s, r, a)), n;
65
+ }, B = (e, s, r, a) => {
66
+ const n = { ...e }, t = typeof e.path == "string" ? e.path : "";
67
+ t.startsWith("/") && (n.path = v(s, t));
68
+ const i = typeof e.name == "string" ? e.name : void 0;
69
+ if (i && !i.includes(d) && (n.name = `${s}${d}${i}`), n.meta = {
70
+ ...e.meta || {},
71
+ microAppName: s,
72
+ rawPath: t,
73
+ ...i ? { rawName: i } : {}
74
+ }, e.redirect != null && typeof e.redirect != "function" && (n.redirect = b(e.redirect, s, r, a)), typeof e.alias == "string" || Array.isArray(e.alias)) {
75
+ const c = Array.isArray(e.alias) ? e.alias : [e.alias];
76
+ n.alias = c.map((h) => b(h, s, r, a));
77
+ }
78
+ return Array.isArray(e.children) && (n.children = e.children.map((c) => B(c, s, r, a))), n;
79
+ }, J = (e, s) => {
80
+ const r = z(e), a = F(e);
81
+ return {
82
+ routes: e.map((n) => B(n, s, r, a)),
83
+ patterns: r,
84
+ names: a
85
+ };
86
+ }, K = (e) => {
87
+ const s = e.indexOf("#"), r = s >= 0 ? e.slice(s) : "", a = s >= 0 ? e.slice(0, s) : e, n = a.indexOf("?"), t = n >= 0 ? a.slice(0, n) : a, i = n >= 0 ? a.slice(n) : "";
88
+ return { path: t, search: i, hash: r };
89
+ }, E = (e) => (e == null ? void 0 : e.isMainApp) === !0 || (e == null ? void 0 : e.isMainApp) === "true", V = (e) => e ? new URLSearchParams(e.startsWith("?") ? e.slice(1) : e).get("isMainApp") === "true" : !1, R = (e, s) => {
90
+ const r = f(e);
91
+ return s.find((a) => $(r, a.name));
92
+ }, j = (e, s, r, a) => {
93
+ if (!e || !e.startsWith("/") || E(a) || R(e, s) || !r) return e;
94
+ const n = f(e);
95
+ return r.patterns.some((t) => I(t, n)) ? v(r.name, n) : e;
96
+ }, y = (e, s, r) => {
97
+ var t;
98
+ const a = (t = r == null ? void 0 : r.meta) == null ? void 0 : t.microAppName, n = s.find((i) => i.name === a) || R((r == null ? void 0 : r.path) || "", s);
99
+ if (typeof e == "string") {
100
+ const { path: i, search: c, hash: h } = K(e);
101
+ if (V(c)) return e;
102
+ const u = j(i, s, n);
103
+ return u === i ? e : `${u}${c}${h}`;
53
104
  }
54
- }, _ = (e) => {
105
+ if (!e || typeof e != "object" || E(e.query)) return e;
106
+ if (typeof e.name == "string")
107
+ return e.name.includes(d) ? e : n != null && n.names.has(e.name) ? { ...e, name: `${n.name}${d}${e.name}` } : e;
108
+ if (typeof e.path == "string") {
109
+ const i = j(e.path, s, n, e.query);
110
+ return i === e.path ? e : { ...e, path: i };
111
+ }
112
+ return e;
113
+ }, X = (e, s) => {
114
+ const r = e.push.bind(e), a = e.replace.bind(e), n = e.resolve.bind(e);
115
+ e.push = (t) => r(y(t, s, e.currentRoute.value)), e.replace = (t) => a(y(t, s, e.currentRoute.value)), e.resolve = (t, i) => n(y(t, s, i || e.currentRoute.value), i);
116
+ }, Y = (e) => {
117
+ var P, o, W, w, M;
118
+ const s = ((P = e == null ? void 0 : e.router) == null ? void 0 : P.routerBase) ?? "/", r = ((o = e == null ? void 0 : e.router) == null ? void 0 : o.options) || {};
119
+ let a = Object.assign(((W = e == null ? void 0 : e.router) == null ? void 0 : W.glob) || {});
120
+ const n = Object.values(a).filter((l) => !!l).flat().sort((l, m) => (l.index ?? 0) - (m.index ?? 0)), t = [], i = [];
121
+ (w = e == null ? void 0 : e.microApps) == null || w.map((l) => {
122
+ var S;
123
+ if (!(l != null && l.microAppName)) return;
124
+ const m = Object.values(((S = l.router) == null ? void 0 : S.glob) || {}).filter((g) => !!g).flat().sort((g, k) => (g.index ?? 0) - (k.index ?? 0)), p = J(m, l.microAppName);
125
+ t.push(...p.routes), i.push({
126
+ name: l.microAppName,
127
+ patterns: p.patterns,
128
+ names: p.names
129
+ });
130
+ });
131
+ const c = ((M = e == null ? void 0 : e.router) == null ? void 0 : M.routers) || [], h = [
132
+ ...x(n, e),
133
+ ...x(c, e),
134
+ ...x(t, e)
135
+ ], u = U({ history: _(s), routes: h, ...r });
136
+ return i.length && X(u, i), { router: u };
137
+ }, x = (e, s) => e.map((r) => {
138
+ const a = r.meta || {};
139
+ return a.keepAlive = a.keepAlive ?? (s == null ? void 0 : s.keepAlive) ?? !0, { ...r, meta: a };
140
+ }), te = (e) => {
55
141
  e || (e = {});
56
- const t = v(!0);
57
- Promise.all([N(), j(e), x(e)]).then(() => {
58
- t.value = !1;
142
+ const s = D(!0);
143
+ Promise.all([H(e), G(e)]).then(() => {
144
+ s.value = !1;
59
145
  });
60
- const { container: c, component: u, props: a } = (e == null ? void 0 : e.root) || {}, l = w(u || W, a);
61
- l.use(C, e), l.use(m);
62
- const { router: f } = D(e);
63
- return l.use(f), l.mount(c || "#app"), { app: l, router: f, loading: t, store: m };
146
+ const { container: r, component: a, props: n } = (e == null ? void 0 : e.root) || {}, t = L(a || N, n);
147
+ t.use(C, e), t.use(A);
148
+ const { router: i } = Y(e);
149
+ return t.use(i), t.mount(r || "#app"), { app: t, router: i, loading: s, store: A };
64
150
  };
65
151
  export {
66
- _ as createDasWebApp
152
+ te as createDasWebApp
67
153
  };
@@ -1,5 +1,5 @@
1
- import { reactive as s, ref as k, computed as _ } from "vue";
2
- const l = {
1
+ import { reactive as h, ref as z, computed as k } from "vue";
2
+ const _ = {
3
3
  // 按钮
4
4
  详情: { "zh-CN": "详情", en: "Details", _appCode: "framework" },
5
5
  下载: { "zh-CN": "下载", en: "Download", _appCode: "framework" },
@@ -119,61 +119,55 @@ const l = {
119
119
  删除失败: { "zh-CN": "删除失败", en: "Deleted Failed", _appCode: "framework" },
120
120
  操作成功: { "zh-CN": "操作成功", en: "Operated Successfully", _appCode: "framework" },
121
121
  操作失败: { "zh-CN": "操作失败", en: "Operated Failed", _appCode: "framework" }
122
- }, f = s({}), t = s({}), m = s({}), c = new URLSearchParams(window.location.search);
123
- let d = c.get("lang");
124
- d === "english" && (d = "en");
125
- d === "chinese_simplified" && (d = "zh-CN");
126
- d !== "zh-CN" && d !== "en" && (d = "");
127
- var N;
128
- const g = d || (sessionStorage.getItem("currentLang") ? sessionStorage.getItem("currentLang") : (N = navigator.language) != null && N.toLowerCase().startsWith("zh") ? "zh-CN" : "en"), w = k(g), u = "dasI18n", R = (e = {}, r) => {
129
- const C = r === "global", n = !C, p = {};
130
- for (const o in e)
131
- for (const a in e[o])
132
- p[a] || (p[a] = {}), p[a][o] = e[o][a] ?? "", C && (t[a] || (t[a] = {}), t[a][o] = p[a][o]), n && (f[a] || (f[a] = {}), f[a][o] = p[a][o]);
133
- }, i = (e = {}, r) => {
134
- var p;
135
- const C = r === "global", n = !C;
136
- for (const o in e)
137
- if (C && !t[o] && (t[o] = e[o]), n) {
138
- const a = (p = e[o]) != null && p._appCode ? e[o]._appCode.toLowerCase() : "";
139
- a && (m[a] || (m[a] = {}), m[a][o] = e[o]), f[o] || (f[o] = e[o]);
122
+ }, d = h({}), f = h({}), m = h({});
123
+ var i;
124
+ const l = sessionStorage.getItem("currentLang") ? sessionStorage.getItem("currentLang") : (i = navigator.language) != null && i.toLowerCase().startsWith("zh") ? "zh-CN" : "en", t = z(l), c = "dasI18n", S = (o = {}, r) => {
125
+ const p = r === "global", C = !p, n = {};
126
+ for (const e in o)
127
+ for (const a in o[e])
128
+ n[a] || (n[a] = {}), n[a][e] = o[e][a] ?? "", p && (f[a] || (f[a] = {}), f[a][e] = n[a][e]), C && (d[a] || (d[a] = {}), d[a][e] = n[a][e]);
129
+ }, w = (o = {}, r) => {
130
+ var n;
131
+ const p = r === "global", C = !p;
132
+ for (const e in o)
133
+ if (p && !f[e] && (f[e] = o[e]), C) {
134
+ const a = (n = o[e]) != null && n._appCode ? o[e]._appCode.toLowerCase() : "";
135
+ a && (m[a] || (m[a] = {}), m[a][e] = o[e]), d[e] || (d[e] = o[e]);
140
136
  }
141
- }, L = async (e) => {
142
- var p, o;
137
+ }, b = async (o) => {
138
+ var n;
143
139
  const r = document.documentElement;
144
- r && r.setAttribute("lang", w.value);
145
- const C = window[u];
146
- C && i(C, "global"), i(l);
147
- let n = Object.assign(((p = e == null ? void 0 : e.i18n) == null ? void 0 : p.glob) || {});
148
- (o = e == null ? void 0 : e.microApps) == null || o.map((a) => {
149
- var h;
150
- n = Object.assign(n, ((h = a.i18n) == null ? void 0 : h.glob) || {});
151
- }), Object.values(n).filter((a) => !!a).flat().map((a) => i(a));
152
- }, P = (e) => {
140
+ r && r.setAttribute("lang", t.value);
141
+ const p = window[c];
142
+ p && w(p, "global"), w(_), [(n = o == null ? void 0 : o.i18n) == null ? void 0 : n.glob, ...((o == null ? void 0 : o.microApps) ?? []).map((e) => {
143
+ var a;
144
+ return (a = e.i18n) == null ? void 0 : a.glob;
145
+ })].flatMap((e) => Object.values(e ?? {})).filter(Boolean).flat().forEach((e) => w(e));
146
+ }, u = (o) => {
153
147
  let r = "";
154
- const C = /\/([^\/]+)\/([^\/]+)\//, n = e.match(C);
155
- return n && n.length >= 3 && (r = n[1] + "/" + n[2]), r ? r.toLowerCase() : "";
156
- }, v = (e, ...r) => _(() => {
157
- const C = P(location.pathname);
158
- let n = m.framework ?? {}, p = m[C] ?? {}, o = t[e] || n[e] || p[e] || f[e] || e;
159
- if (o === e) return e;
160
- typeof o == "string" && (o = { "zh-CN": o });
161
- let a = o[w.value];
162
- return w.value === "zh-CN" && o["zh-cn"] && !o["zh-CN"] && (a = o["zh-cn"]), r.map((h, z) => {
163
- a && (a = a.replace(`$${z}`, h));
148
+ const p = /\/([^\/]+)\/([^\/]+)\//, C = o.match(p);
149
+ return C && C.length >= 3 && (r = C[1] + "/" + C[2]), r ? r.toLowerCase() : "";
150
+ }, g = (o, ...r) => k(() => {
151
+ const p = u(location.pathname);
152
+ let C = m.framework ?? {}, n = m[p] ?? {}, e = f[o] || C[o] || n[o] || d[o] || o;
153
+ if (e === o) return o;
154
+ typeof e == "string" && (e = { "zh-CN": e });
155
+ let a = e[t.value];
156
+ return t.value === "zh-CN" && e["zh-cn"] && !e["zh-CN"] && (a = e["zh-cn"]), r.map((s, N) => {
157
+ a && (a = a.replace(`$${N}`, s));
164
158
  }), a;
165
- }), S = v, D = (e, ...r) => S(e, ...r).value, A = (e) => {
166
- sessionStorage.setItem("currentLang", e), w.value = e;
167
- }, I = () => w;
159
+ }), P = g, R = (o, ...r) => P(o, ...r).value, D = (o) => {
160
+ sessionStorage.setItem("currentLang", o), t.value = o;
161
+ }, L = () => t;
168
162
  export {
169
- w as currentLang,
170
- f as customLangeData,
171
- v as getI18nRule,
172
- I as getLang,
173
- S as i18n,
174
- L as initI18n,
175
- i as setI18nRule,
176
- A as setLang,
177
- R as setLangRule,
178
- D as t
163
+ t as currentLang,
164
+ d as customLangeData,
165
+ g as getI18nRule,
166
+ L as getLang,
167
+ P as i18n,
168
+ b as initI18n,
169
+ w as setI18nRule,
170
+ D as setLang,
171
+ S as setLangRule,
172
+ R as t
179
173
  };
Binary file