@opendesign-plus-test/composables 0.0.1-rc.10 → 0.0.1-rc.12
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.
- package/dist/index.js +124 -111
- package/dist/index.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { onBeforeUnmount as $, reactive as
|
|
5
|
-
import
|
|
1
|
+
var eu = Object.defineProperty;
|
|
2
|
+
var tu = (u, D, e) => D in u ? eu(u, D, { enumerable: !0, configurable: !0, writable: !0, value: e }) : u[D] = e;
|
|
3
|
+
var v = (u, D, e) => tu(u, typeof D != "symbol" ? D + "" : D, e);
|
|
4
|
+
import { onBeforeUnmount as $, reactive as nu, ref as M, computed as s, onMounted as W, nextTick as z, onUnmounted as j, getCurrentInstance as Eu, watch as R, inject as p, unref as U, isRef as ou, provide as Cu } from "vue";
|
|
5
|
+
import su from "markdown-it-async";
|
|
6
6
|
import Au from "markdown-it-anchor";
|
|
7
|
-
import { bundledLanguages as ru, bundledThemes as K, createHighlighter as
|
|
8
|
-
import { useI18n as
|
|
9
|
-
import { isClient as
|
|
7
|
+
import { bundledLanguages as ru, bundledThemes as K, createHighlighter as iu } from "shiki";
|
|
8
|
+
import { useI18n as au } from "vue-i18n";
|
|
9
|
+
import { isClient as Y, isUndefined as cu } from "@opensig/opendesign";
|
|
10
10
|
import b from "js-cookie";
|
|
11
|
-
import { defineStore as
|
|
12
|
-
const
|
|
11
|
+
import { defineStore as lu } from "pinia";
|
|
12
|
+
const Bu = new Set(Object.keys(ru));
|
|
13
13
|
async function Ku(u = {}) {
|
|
14
14
|
const { anchor: D = !0, anchorType: e = "vitepress", copy: F = !0, wrapMarkdownBodyDiv: t = !0, theme: n = {}, ...o } = u, E = typeof (n == null ? void 0 : n.light) == "string" && n.light in K ? n.light : "light-plus", C = typeof (n == null ? void 0 : n.dark) == "string" && n.dark in K ? n.dark : "dark-plus", r = /* @__PURE__ */ new Set(["text"]);
|
|
15
15
|
$(() => {
|
|
16
|
-
|
|
16
|
+
c && c.dispose();
|
|
17
17
|
});
|
|
18
|
-
const
|
|
18
|
+
const c = await iu({
|
|
19
19
|
themes: [E, C],
|
|
20
20
|
langs: ["text"]
|
|
21
|
-
}),
|
|
22
|
-
async highlight(
|
|
23
|
-
return
|
|
24
|
-
lang:
|
|
21
|
+
}), a = su({
|
|
22
|
+
async highlight(B, A) {
|
|
23
|
+
return Bu.has(A) || (A = "text"), r.has(A) || (await c.loadLanguage(A), r.add(A)), c.codeToHtml(B, {
|
|
24
|
+
lang: A,
|
|
25
25
|
themes: {
|
|
26
26
|
light: E,
|
|
27
27
|
dark: C
|
|
@@ -30,25 +30,25 @@ async function Ku(u = {}) {
|
|
|
30
30
|
},
|
|
31
31
|
...o
|
|
32
32
|
});
|
|
33
|
-
if (D &&
|
|
34
|
-
slugify: (
|
|
33
|
+
if (D && a.use(Au, {
|
|
34
|
+
slugify: (B) => e === "github" ? du(B) : mu(B)
|
|
35
35
|
}), F) {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
var
|
|
39
|
-
const [
|
|
40
|
-
return `<div class="language-${((
|
|
36
|
+
const B = a.renderer.rules.fence;
|
|
37
|
+
a.renderer.rules.fence = (...A) => {
|
|
38
|
+
var m;
|
|
39
|
+
const [d, f] = A, l = d[f], i = a.utils.escapeHtml(l.content || "");
|
|
40
|
+
return `<div class="language-${((m = l.info) == null ? void 0 : m.trim()) || ""}"><div class="copy" data-clipboard-text="${i}"></div>` + B(...A) + "</div>";
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
if (t) {
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
|
|
44
|
+
const B = a.render;
|
|
45
|
+
a.render = (d, f) => `<div class="markdown-body">${B.call(a, d, f)}</div>`;
|
|
46
|
+
const A = a.renderInline;
|
|
47
|
+
a.renderInline = (d, f) => `<div class="markdown-body">${A.call(a, d, f)}</div>`;
|
|
48
48
|
}
|
|
49
49
|
return {
|
|
50
|
-
shiki:
|
|
51
|
-
markdwon:
|
|
50
|
+
shiki: c,
|
|
51
|
+
markdwon: a
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
function du(u) {
|
|
@@ -58,10 +58,10 @@ function du(u) {
|
|
|
58
58
|
);
|
|
59
59
|
return `user-content-${u.toLowerCase().replace(D, "").replace(/ /g, "-")}`;
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function mu(u) {
|
|
62
62
|
return u.normalize("NFKD").replace(/[\u0300-\u036F]/g, "").replace(/[\u0000-\u001f]/g, "").replace(/[\s~`!@#$%^&*()\-_+=[\]{}|\\;:"'“”‘’<>,.?/]+/g, "-").replace(/-{2,}/g, "-").replace(/^-+|-+$/g, "").replace(/^(\d)/, "_$1").toLowerCase();
|
|
63
63
|
}
|
|
64
|
-
var
|
|
64
|
+
var fu = /* @__PURE__ */ ((u) => (u.Phone = "phone", u.PadV = "pad_v", u.PadH = "pad_h", u.Laptop = "laptop", u))(fu || {});
|
|
65
65
|
const L = {
|
|
66
66
|
phone: 600,
|
|
67
67
|
pad_v: 840,
|
|
@@ -75,24 +75,24 @@ const L = {
|
|
|
75
75
|
ge: (u, D) => u >= D,
|
|
76
76
|
gt: (u, D) => u > D
|
|
77
77
|
}, Pu = () => {
|
|
78
|
-
const u =
|
|
78
|
+
const u = nu({
|
|
79
79
|
width: 1440,
|
|
80
80
|
height: 0
|
|
81
81
|
}), D = M(
|
|
82
82
|
"laptop"
|
|
83
83
|
/* Laptop */
|
|
84
|
-
), e = (h) => (typeof h > "u" && (h = u.width), h < L.phone ? "phone" : h < L.pad_v ? "pad_v" : h < L.pad_h ? "pad_h" : "laptop"), F = (h = "eq",
|
|
85
|
-
const
|
|
86
|
-
return
|
|
87
|
-
}, t =
|
|
84
|
+
), e = (h) => (typeof h > "u" && (h = u.width), h < L.phone ? "phone" : h < L.pad_v ? "pad_v" : h < L.pad_h ? "pad_h" : "laptop"), F = (h = "eq", T) => {
|
|
85
|
+
const uu = u.width, Du = L[T], Fu = hu[h];
|
|
86
|
+
return Fu(uu, Du);
|
|
87
|
+
}, t = s(() => F(
|
|
88
88
|
"le",
|
|
89
89
|
"phone"
|
|
90
90
|
/* Phone */
|
|
91
|
-
)), n =
|
|
91
|
+
)), n = s(() => F(
|
|
92
92
|
"gt",
|
|
93
93
|
"phone"
|
|
94
94
|
/* Phone */
|
|
95
|
-
)), o =
|
|
95
|
+
)), o = s(() => F(
|
|
96
96
|
"gt",
|
|
97
97
|
"phone"
|
|
98
98
|
/* Phone */
|
|
@@ -100,15 +100,15 @@ const L = {
|
|
|
100
100
|
"le",
|
|
101
101
|
"pad_h"
|
|
102
102
|
/* PadH */
|
|
103
|
-
)), E =
|
|
103
|
+
)), E = s(() => F(
|
|
104
104
|
"le",
|
|
105
105
|
"pad_h"
|
|
106
106
|
/* PadH */
|
|
107
|
-
)), C =
|
|
107
|
+
)), C = s(() => F(
|
|
108
108
|
"gt",
|
|
109
109
|
"pad_h"
|
|
110
110
|
/* PadH */
|
|
111
|
-
)), r =
|
|
111
|
+
)), r = s(() => F(
|
|
112
112
|
"gt",
|
|
113
113
|
"phone"
|
|
114
114
|
/* Phone */
|
|
@@ -116,15 +116,15 @@ const L = {
|
|
|
116
116
|
"le",
|
|
117
117
|
"pad_v"
|
|
118
118
|
/* PadV */
|
|
119
|
-
)),
|
|
119
|
+
)), c = s(() => F(
|
|
120
120
|
"le",
|
|
121
121
|
"pad_v"
|
|
122
122
|
/* PadV */
|
|
123
|
-
)),
|
|
123
|
+
)), a = s(() => F(
|
|
124
124
|
"gt",
|
|
125
125
|
"pad_v"
|
|
126
126
|
/* PadV */
|
|
127
|
-
)),
|
|
127
|
+
)), B = s(() => F(
|
|
128
128
|
"gt",
|
|
129
129
|
"pad_v"
|
|
130
130
|
/* PadV */
|
|
@@ -132,7 +132,7 @@ const L = {
|
|
|
132
132
|
"le",
|
|
133
133
|
"pad_h"
|
|
134
134
|
/* PadH */
|
|
135
|
-
)),
|
|
135
|
+
)), A = s(() => F(
|
|
136
136
|
"gt",
|
|
137
137
|
"pad_h"
|
|
138
138
|
/* PadH */
|
|
@@ -140,15 +140,15 @@ const L = {
|
|
|
140
140
|
"le",
|
|
141
141
|
"laptop"
|
|
142
142
|
/* Laptop */
|
|
143
|
-
)),
|
|
143
|
+
)), d = s(() => F(
|
|
144
144
|
"le",
|
|
145
145
|
"laptop"
|
|
146
146
|
/* Laptop */
|
|
147
|
-
)),
|
|
147
|
+
)), f = s(() => F(
|
|
148
148
|
"gt",
|
|
149
149
|
"laptop"
|
|
150
150
|
/* Laptop */
|
|
151
|
-
)),
|
|
151
|
+
)), l = s(() => F(
|
|
152
152
|
"gt",
|
|
153
153
|
"phone"
|
|
154
154
|
/* Phone */
|
|
@@ -156,7 +156,7 @@ const L = {
|
|
|
156
156
|
"le",
|
|
157
157
|
"laptop"
|
|
158
158
|
/* Laptop */
|
|
159
|
-
)),
|
|
159
|
+
)), i = s(() => F(
|
|
160
160
|
"gt",
|
|
161
161
|
"pad_v"
|
|
162
162
|
/* PadV */
|
|
@@ -164,14 +164,14 @@ const L = {
|
|
|
164
164
|
"le",
|
|
165
165
|
"laptop"
|
|
166
166
|
/* Laptop */
|
|
167
|
-
)),
|
|
168
|
-
const { innerWidth: h, innerHeight:
|
|
169
|
-
u.width = h, u.height =
|
|
167
|
+
)), m = () => {
|
|
168
|
+
const { innerWidth: h, innerHeight: T } = window;
|
|
169
|
+
u.width = h, u.height = T, D.value = e();
|
|
170
170
|
};
|
|
171
171
|
return W(() => {
|
|
172
|
-
typeof window < "u" && (window.addEventListener("resize",
|
|
172
|
+
typeof window < "u" && (window.addEventListener("resize", m), m(), z(() => m()));
|
|
173
173
|
}), j(() => {
|
|
174
|
-
typeof window < "u" && window.removeEventListener("resize",
|
|
174
|
+
typeof window < "u" && window.removeEventListener("resize", m);
|
|
175
175
|
}), {
|
|
176
176
|
// 获取屏幕宽度分级
|
|
177
177
|
getSize: e,
|
|
@@ -191,29 +191,29 @@ const L = {
|
|
|
191
191
|
// [1201, -]
|
|
192
192
|
isPadV: r,
|
|
193
193
|
// [601, 840]
|
|
194
|
-
lePadV:
|
|
194
|
+
lePadV: c,
|
|
195
195
|
// [0, 840]
|
|
196
|
-
gtPadV:
|
|
196
|
+
gtPadV: a,
|
|
197
197
|
// [841, -]
|
|
198
|
-
isPadH:
|
|
198
|
+
isPadH: B,
|
|
199
199
|
// [841, 1200]
|
|
200
|
-
isLaptop:
|
|
200
|
+
isLaptop: A,
|
|
201
201
|
// [1201, 1440]
|
|
202
|
-
leLaptop:
|
|
202
|
+
leLaptop: d,
|
|
203
203
|
// [0, 1440]
|
|
204
|
-
gtLaptop:
|
|
204
|
+
gtLaptop: f,
|
|
205
205
|
// [1441, -]
|
|
206
|
-
isPadToLaptop:
|
|
206
|
+
isPadToLaptop: l,
|
|
207
207
|
// [601, 1440]
|
|
208
|
-
isPadVToLaptop:
|
|
208
|
+
isPadVToLaptop: i
|
|
209
209
|
// [841, 1440]
|
|
210
210
|
};
|
|
211
211
|
}, Iu = () => {
|
|
212
|
-
const { t: u, locale: D } =
|
|
213
|
-
return
|
|
212
|
+
const { t: u, locale: D } = au(), e = Eu(), F = s(() => D.value === "zh"), t = s(() => D.value === "en");
|
|
213
|
+
return R(
|
|
214
214
|
() => D.value,
|
|
215
215
|
(o) => {
|
|
216
|
-
|
|
216
|
+
Y && (document.documentElement.lang = o, localStorage.setItem("locale", o));
|
|
217
217
|
},
|
|
218
218
|
{
|
|
219
219
|
immediate: !0
|
|
@@ -230,7 +230,7 @@ const L = {
|
|
|
230
230
|
D.value !== E && (D.value = E, await z(), (C = e == null ? void 0 : e.proxy) != null && C.$forceUpdate && e.proxy.$forceUpdate());
|
|
231
231
|
}
|
|
232
232
|
};
|
|
233
|
-
}, pu = "[警告] 请在项目中注入主题配置项:app.use(createTheme(options))", gu = "[警告] 缺少参数 cookieKey 和 cookieDomain,请在 createTheme 传入 cookieKey 和 cookieDomain 参数",
|
|
233
|
+
}, pu = "[警告] 请在项目中注入主题配置项:app.use(createTheme(options))", gu = "[警告] 缺少参数 cookieKey 和 cookieDomain,请在 createTheme 传入 cookieKey 和 cookieDomain 参数", G = Symbol("theme"), q = Symbol("isLight"), Q = Symbol("isDark"), J = Symbol("setTheme"), Z = Symbol("toggleTheme");
|
|
234
234
|
function Hu(u) {
|
|
235
235
|
const {
|
|
236
236
|
cookieKey: D,
|
|
@@ -242,39 +242,52 @@ function Hu(u) {
|
|
|
242
242
|
attributeDarkValue: E = t,
|
|
243
243
|
classLightValue: C = F,
|
|
244
244
|
classDarkValue: r = t
|
|
245
|
-
} = u || {},
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
}
|
|
249
|
-
|
|
245
|
+
} = u || {}, c = M(F), a = s(() => c.value === F), B = s(() => c.value === t), A = s(() => c.value), d = (l, i = !0) => {
|
|
246
|
+
const m = l === t ? t : F;
|
|
247
|
+
c.value = m, !(typeof window > "u") && (m === t ? (document.documentElement.setAttribute(n, E), document.documentElement.classList.add(r), document.documentElement.classList.remove(C)) : (document.documentElement.setAttribute(n, o), document.documentElement.classList.add(C), document.documentElement.classList.remove(r)), i && (D && e ? b.set(D, m, { domain: e }) : console.warn(gu)));
|
|
248
|
+
};
|
|
249
|
+
R(
|
|
250
|
+
() => A == null ? void 0 : A.value,
|
|
251
|
+
(l) => {
|
|
252
|
+
if (!Y)
|
|
253
|
+
return;
|
|
254
|
+
const i = document.documentElement;
|
|
255
|
+
l === t ? (i.setAttribute(n, E), i.classList.remove(F), i.classList.add(t)) : (i.setAttribute(n, o), i.classList.remove(t), i.classList.add(F));
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
immediate: !0
|
|
259
|
+
}
|
|
260
|
+
);
|
|
261
|
+
const f = () => {
|
|
262
|
+
d(A.value === t ? F : t);
|
|
250
263
|
};
|
|
251
264
|
return {
|
|
252
|
-
install(
|
|
253
|
-
if (
|
|
265
|
+
install(l) {
|
|
266
|
+
if (l.provide(G, A), l.provide(q, a), l.provide(Q, B), l.provide(J, d), l.provide(Z, f), typeof window > "u")
|
|
254
267
|
return;
|
|
255
|
-
let
|
|
256
|
-
D && (
|
|
268
|
+
let i;
|
|
269
|
+
D && (i = b.get(D)), i || (i = window.matchMedia("(prefers-color-scheme: dark)").matches ? t : F), d(i === t ? t : F, !1);
|
|
257
270
|
}
|
|
258
271
|
};
|
|
259
272
|
}
|
|
260
273
|
function Vu() {
|
|
261
|
-
const u = p(
|
|
274
|
+
const u = p(G);
|
|
262
275
|
return u || console.warn(pu), {
|
|
263
276
|
theme: u,
|
|
264
|
-
isLight: p(
|
|
265
|
-
isDark: p(
|
|
266
|
-
setTheme: p(
|
|
267
|
-
toggleTheme: p(
|
|
277
|
+
isLight: p(q),
|
|
278
|
+
isDark: p(Q),
|
|
279
|
+
setTheme: p(J),
|
|
280
|
+
toggleTheme: p(Z)
|
|
268
281
|
};
|
|
269
282
|
}
|
|
270
283
|
async function $u(u) {
|
|
271
284
|
try {
|
|
272
|
-
return navigator.clipboard ? (await navigator.clipboard.writeText(u), !0) :
|
|
285
|
+
return navigator.clipboard ? (await navigator.clipboard.writeText(u), !0) : vu(u);
|
|
273
286
|
} catch {
|
|
274
287
|
return !1;
|
|
275
288
|
}
|
|
276
289
|
}
|
|
277
|
-
function
|
|
290
|
+
function vu(u) {
|
|
278
291
|
const D = document.createElement("textarea");
|
|
279
292
|
D.value = u, D.style.top = "0", D.style.left = "0", D.style.width = "1px", D.style.height = "1px", D.style.position = "fixed", D.style.opacity = "0", document.body.appendChild(D), D.focus(), D.select();
|
|
280
293
|
try {
|
|
@@ -286,18 +299,18 @@ function yu(u) {
|
|
|
286
299
|
}
|
|
287
300
|
class w {
|
|
288
301
|
constructor(D) {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
302
|
+
v(this, "prev", null);
|
|
303
|
+
v(this, "next", null);
|
|
304
|
+
v(this, "data", null);
|
|
292
305
|
this.data = D;
|
|
293
306
|
}
|
|
294
307
|
removeSelf() {
|
|
295
308
|
this.data = null, this.prev && (this.prev.next = this.next), this.next && (this.next.prev = this.prev), this.prev = null, this.next = null;
|
|
296
309
|
}
|
|
297
310
|
}
|
|
298
|
-
class
|
|
311
|
+
class yu {
|
|
299
312
|
constructor() {
|
|
300
|
-
|
|
313
|
+
v(this, "dummyHead", new w(null));
|
|
301
314
|
}
|
|
302
315
|
shift(D) {
|
|
303
316
|
const e = new w(D), F = this.dummyHead.next;
|
|
@@ -315,16 +328,16 @@ class vu {
|
|
|
315
328
|
this.dummyHead.next = null;
|
|
316
329
|
}
|
|
317
330
|
}
|
|
318
|
-
const P = Symbol(), _ = Symbol(), k = async (u, ...D) => typeof u == "function" ? await u(...D) : U(u), x = (u) => typeof u == "object" && u !== null,
|
|
331
|
+
const P = Symbol(), _ = Symbol(), k = async (u, ...D) => typeof u == "function" ? await u(...D) : U(u), x = (u) => typeof u == "object" && u !== null, O = (u) => typeof u.event == "string" && x(u.properties);
|
|
319
332
|
function S(u, D) {
|
|
320
333
|
let e, F;
|
|
321
334
|
if (D != null && D.catchBubble)
|
|
322
|
-
e = new
|
|
335
|
+
e = new yu(), F = e.shift(async (t) => {
|
|
323
336
|
var n, o;
|
|
324
337
|
if (x(t))
|
|
325
338
|
if (t[_]) {
|
|
326
339
|
const E = await k(u);
|
|
327
|
-
if (!
|
|
340
|
+
if (!O(E)) return;
|
|
328
341
|
delete t[_];
|
|
329
342
|
const C = {
|
|
330
343
|
...E,
|
|
@@ -334,8 +347,8 @@ function S(u, D) {
|
|
|
334
347
|
}
|
|
335
348
|
};
|
|
336
349
|
(n = window.__OA_REPORT__) == null || n.call(window, C.event, C.properties);
|
|
337
|
-
} else
|
|
338
|
-
}),
|
|
350
|
+
} else O(t) && ((o = window.__OA_REPORT__) == null || o.call(window, t.event, t.properties));
|
|
351
|
+
}), Cu((D == null ? void 0 : D.key) ?? P, e);
|
|
339
352
|
else if (D != null && D.bubble) {
|
|
340
353
|
if (e = p((D == null ? void 0 : D.key) ?? P), !e) return;
|
|
341
354
|
F = e.shift(async (t) => {
|
|
@@ -344,27 +357,27 @@ function S(u, D) {
|
|
|
344
357
|
if (t[_]) {
|
|
345
358
|
const r = await k(u);
|
|
346
359
|
if (!x(r)) return;
|
|
347
|
-
const
|
|
360
|
+
const c = {
|
|
348
361
|
...r,
|
|
349
362
|
...t
|
|
350
363
|
};
|
|
351
|
-
(o = (n = F.next) == null ? void 0 : n.data) == null || o.call(n,
|
|
364
|
+
(o = (n = F.next) == null ? void 0 : n.data) == null || o.call(n, c);
|
|
352
365
|
} else
|
|
353
366
|
(C = (E = F.next) == null ? void 0 : E.data) == null || C.call(E, { ...t, [_]: !0 });
|
|
354
367
|
});
|
|
355
368
|
} else
|
|
356
369
|
F = (t) => {
|
|
357
370
|
var n;
|
|
358
|
-
|
|
371
|
+
O(t) && ((n = window.__OA_REPORT__) == null || n.call(window, t.event, t.properties));
|
|
359
372
|
};
|
|
360
373
|
return j(() => {
|
|
361
374
|
e = null, F instanceof w && F.removeSelf(), F = null;
|
|
362
375
|
}), F;
|
|
363
376
|
}
|
|
364
377
|
function Mu(u, D, e) {
|
|
365
|
-
if (!
|
|
378
|
+
if (!ou(u) && typeof u != "function") return;
|
|
366
379
|
const F = S(D, e);
|
|
367
|
-
|
|
380
|
+
R(u, async (t, n) => {
|
|
368
381
|
var E;
|
|
369
382
|
const o = await k(D, t, n);
|
|
370
383
|
F instanceof w ? (E = F.data) == null || E.call(F, o) : typeof F == "function" && F(o);
|
|
@@ -372,7 +385,7 @@ function Mu(u, D, e) {
|
|
|
372
385
|
}
|
|
373
386
|
const I = /* @__PURE__ */ new WeakSet();
|
|
374
387
|
function Wu(u, D, e, F) {
|
|
375
|
-
const t =
|
|
388
|
+
const t = s(() => U(u)), n = S(e, { ...F, key: D }), o = async (E) => {
|
|
376
389
|
var r;
|
|
377
390
|
if (F != null && F.bubble && I.has(E)) return;
|
|
378
391
|
I.add(E);
|
|
@@ -390,7 +403,7 @@ function Wu(u, D, e, F) {
|
|
|
390
403
|
function zu(u, D) {
|
|
391
404
|
S(u, D);
|
|
392
405
|
}
|
|
393
|
-
const
|
|
406
|
+
const X = lu("login", {
|
|
394
407
|
state: () => ({
|
|
395
408
|
loginStatus: g.NOT
|
|
396
409
|
}),
|
|
@@ -433,29 +446,29 @@ const N = {
|
|
|
433
446
|
b.remove(N.CSRF_TOKEN);
|
|
434
447
|
}, Uu = (u) => {
|
|
435
448
|
window.location.href = u;
|
|
436
|
-
},
|
|
437
|
-
|
|
449
|
+
}, y = (u) => {
|
|
450
|
+
X().setLoginStatus(u);
|
|
438
451
|
}, V = async (u, D = !1) => {
|
|
439
452
|
const { csrfCookie: e } = Lu();
|
|
440
453
|
if (!(!e || D))
|
|
441
454
|
try {
|
|
442
|
-
|
|
455
|
+
y(
|
|
443
456
|
1
|
|
444
457
|
/* DOING */
|
|
445
458
|
);
|
|
446
459
|
const F = await u();
|
|
447
460
|
if (F != null && F.data)
|
|
448
|
-
return
|
|
461
|
+
return y(
|
|
449
462
|
2
|
|
450
463
|
/* DONE */
|
|
451
464
|
), F.data;
|
|
452
|
-
|
|
465
|
+
y(
|
|
453
466
|
-1
|
|
454
467
|
/* FAILED */
|
|
455
468
|
), H();
|
|
456
469
|
return;
|
|
457
470
|
} catch {
|
|
458
|
-
|
|
471
|
+
y(
|
|
459
472
|
-1
|
|
460
473
|
/* FAILED */
|
|
461
474
|
), H();
|
|
@@ -463,14 +476,14 @@ const N = {
|
|
|
463
476
|
}
|
|
464
477
|
}, Yu = (u) => {
|
|
465
478
|
window.location.href = u, setTimeout(() => {
|
|
466
|
-
|
|
479
|
+
y(
|
|
467
480
|
0
|
|
468
481
|
/* NOT */
|
|
469
482
|
);
|
|
470
483
|
}, wu);
|
|
471
484
|
}, Gu = (u, D, e, F, t = !1) => {
|
|
472
|
-
const n =
|
|
473
|
-
|
|
485
|
+
const n = X();
|
|
486
|
+
R(
|
|
474
487
|
() => F.path,
|
|
475
488
|
async (o, E) => {
|
|
476
489
|
if (o === E || n.isLogined) return;
|
|
@@ -484,20 +497,20 @@ const N = {
|
|
|
484
497
|
export {
|
|
485
498
|
g as LOGIN_STATUS,
|
|
486
499
|
L as ScreenConfig,
|
|
487
|
-
|
|
500
|
+
fu as Size,
|
|
488
501
|
H as clearUserAuth,
|
|
489
502
|
Hu as createTheme,
|
|
490
503
|
Uu as doLogin,
|
|
491
504
|
Yu as doLogout,
|
|
492
505
|
Lu as getUserAuth,
|
|
493
506
|
ju as setLoginKeys,
|
|
494
|
-
|
|
507
|
+
y as setStatus,
|
|
495
508
|
V as tryLogin,
|
|
496
509
|
zu as useAnalytics,
|
|
497
510
|
$u as useClipboard,
|
|
498
511
|
Wu as useElementEventAnalytics,
|
|
499
512
|
Iu as useLocale,
|
|
500
|
-
|
|
513
|
+
X as useLoginStore,
|
|
501
514
|
Gu as useLoginWatcher,
|
|
502
515
|
Ku as useMdRender,
|
|
503
516
|
Pu as useScreen,
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(n,F){typeof exports=="object"&&typeof module<"u"?F(exports,require("vue"),require("markdown-it-async"),require("markdown-it-anchor"),require("shiki"),require("vue-i18n"),require("@opensig/opendesign"),require("js-cookie"),require("pinia")):typeof define=="function"&&define.amd?define(["exports","vue","markdown-it-async","markdown-it-anchor","shiki","vue-i18n","@opensig/opendesign","js-cookie","pinia"],F):(n=typeof globalThis<"u"?globalThis:n||self,F(n.OpenDesignPlusComposables={},n.Vue,n.MarkdownItAsync,n.markdownItAnchor,n.shiki,n.VueI18n,n.OpenDesign,n.Cookies,n.Pinia))})(this,(function(n,F,y,Q,v,J,H,b,Z){"use strict";var wu=Object.defineProperty;var Lu=(n,F,y)=>F in n?wu(n,F,{enumerable:!0,configurable:!0,writable:!0,value:y}):n[F]=y;var k=(n,F,y)=>Lu(n,typeof F!="symbol"?F+"":F,y);const X=new Set(Object.keys(v.bundledLanguages));async function uu(u={}){const{anchor:D=!0,anchorType:o="vitepress",copy:e=!0,wrapMarkdownBodyDiv:t=!0,theme:E={},...C}=u,i=typeof(E==null?void 0:E.light)=="string"&&E.light in v.bundledThemes?E.light:"light-plus",A=typeof(E==null?void 0:E.dark)=="string"&&E.dark in v.bundledThemes?E.dark:"dark-plus",s=new Set(["text"]);F.onBeforeUnmount(()=>{a&&a.dispose()});const a=await v.createHighlighter({themes:[i,A],langs:["text"]}),c=y({async highlight(d,r){return X.has(r)||(r="text"),s.has(r)||(await a.loadLanguage(r),s.add(r)),a.codeToHtml(d,{lang:r,themes:{light:i,dark:A}})},...C});if(D&&c.use(Q,{slugify:d=>o==="github"?Du(d):eu(d)}),e){const d=c.renderer.rules.fence;c.renderer.rules.fence=(...r)=>{var m;const[l,f]=r,B=l[f],h=c.utils.escapeHtml(B.content||"");return`<div class="language-${((m=B.info)==null?void 0:m.trim())||""}"><div class="copy" data-clipboard-text="${h}"></div>`+d(...r)+"</div>"}}if(t){const d=c.render;c.render=(l,f)=>`<div class="markdown-body">${d.call(c,l,f)}</div>`;const r=c.renderInline;c.renderInline=(l,f)=>`<div class="markdown-body">${r.call(c,l,f)}</div>`}return{shiki:a,markdwon:c}}function Du(u){const D=/[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A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51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g;return`user-content-${u.toLowerCase().replace(D,"").replace(/ /g,"-")}`}function eu(u){return u.normalize("NFKD").replace(/[\u0300-\u036F]/g,"").replace(/[\u0000-\u001f]/g,"").replace(/[\s~`!@#$%^&*()\-_+=[\]{}|\\;:"'“”‘’<>,.?/]+/g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/^(\d)/,"_$1").toLowerCase()}var V=(u=>(u.Phone="phone",u.PadV="pad_v",u.PadH="pad_h",u.Laptop="laptop",u))(V||{});const L={phone:600,pad_v:840,pad_h:1200,laptop:1440},Fu={lt:(u,D)=>u<D,le:(u,D)=>u<=D,eq:(u,D)=>u===D,ne:(u,D)=>u!==D,ge:(u,D)=>u>=D,gt:(u,D)=>u>D},tu=()=>{const u=F.reactive({width:1440,height:0}),D=F.ref("laptop"),o=p=>(typeof p>"u"&&(p=u.width),p<L.phone?"phone":p<L.pad_v?"pad_v":p<L.pad_h?"pad_h":"laptop"),e=(p="eq",j)=>{const pu=u.width,gu=L[j],yu=Fu[p];return yu(pu,gu)},t=F.computed(()=>e("le","phone")),E=F.computed(()=>e("gt","phone")),C=F.computed(()=>e("gt","phone")&&e("le","pad_h")),i=F.computed(()=>e("le","pad_h")),A=F.computed(()=>e("gt","pad_h")),s=F.computed(()=>e("gt","phone")&&e("le","pad_v")),a=F.computed(()=>e("le","pad_v")),c=F.computed(()=>e("gt","pad_v")),d=F.computed(()=>e("gt","pad_v")&&e("le","pad_h")),r=F.computed(()=>e("gt","pad_h")&&e("le","laptop")),l=F.computed(()=>e("le","laptop")),f=F.computed(()=>e("gt","laptop")),B=F.computed(()=>e("gt","phone")&&e("le","laptop")),h=F.computed(()=>e("gt","pad_v")&&e("le","laptop")),m=()=>{const{innerWidth:p,innerHeight:j}=window;u.width=p,u.height=j,D.value=o()};return F.onMounted(()=>{typeof window<"u"&&(window.addEventListener("resize",m),m(),F.nextTick(()=>m()))}),F.onUnmounted(()=>{typeof window<"u"&&window.removeEventListener("resize",m)}),{getSize:o,current:D,size:u,isPhone:t,gtPhone:E,isPad:C,lePad:i,gtPad:A,isPadV:s,lePadV:a,gtPadV:c,isPadH:d,isLaptop:r,leLaptop:l,gtLaptop:f,isPadToLaptop:B,isPadVToLaptop:h}},nu=()=>{const{t:u,locale:D}=J.useI18n(),o=F.getCurrentInstance(),e=F.computed(()=>D.value==="zh"),t=F.computed(()=>D.value==="en");return F.watch(()=>D.value,C=>{H.isClient&&(document.documentElement.lang=C,localStorage.setItem("locale",C))},{immediate:!0}),{t:u,$t:u,locale:D,isZh:e,isEn:t,changeLocale:async C=>{var A;const i=H.isUndefined(C)?e.value?"en":"zh":C;D.value!==i&&(D.value=i,await F.nextTick(),(A=o==null?void 0:o.proxy)!=null&&A.$forceUpdate&&o.proxy.$forceUpdate())}}},ou="[警告] 请在项目中注入主题配置项:app.use(createTheme(options))",Eu="[警告] 缺少参数 cookieKey 和 cookieDomain,请在 createTheme 传入 cookieKey 和 cookieDomain 参数",$=Symbol("theme"),q=Symbol("isLight"),M=Symbol("isDark"),U=Symbol("setTheme"),W=Symbol("toggleTheme");function iu(u){const{cookieKey:D,cookieDomain:o,lightValue:e="light",darkValue:t="dark",attribute:E="data-o-theme",attributeLightValue:C=e,attributeDarkValue:i=t,classLightValue:A=e,classDarkValue:s=t}=u||{},a=F.ref(e),c=F.computed(()=>a.value===e),d=F.computed(()=>a.value===t),r=F.computed(()=>a.value),l=(B,h=!0)=>{const m=B===t?t:e;a.value=m,!(typeof window>"u")&&(m===t?(document.documentElement.setAttribute(E,i),document.documentElement.classList.add(s),document.documentElement.classList.remove(A)):(document.documentElement.setAttribute(E,C),document.documentElement.classList.add(A),document.documentElement.classList.remove(s)),h&&(D&&o?b.set(D,m,{domain:o}):console.warn(Eu)))},f=()=>{l(r.value===t?e:t)};return{install(B){if(B.provide($,r),B.provide(q,c),B.provide(M,d),B.provide(U,l),B.provide(W,f),typeof window>"u")return;let h;D&&(h=b.get(D)),h||(h=window.matchMedia("(prefers-color-scheme: dark)").matches?t:e),l(h===t?t:e,!1)}}}function Cu(){const u=F.inject($);return u||console.warn(ou),{theme:u,isLight:F.inject(q),isDark:F.inject(M),setTheme:F.inject(U),toggleTheme:F.inject(W)}}async function Au(u){try{return navigator.clipboard?(await navigator.clipboard.writeText(u),!0):su(u)}catch{return!1}}function su(u){const D=document.createElement("textarea");D.value=u,D.style.top="0",D.style.left="0",D.style.width="1px",D.style.height="1px",D.style.position="fixed",D.style.opacity="0",document.body.appendChild(D),D.focus(),D.select();try{const o=document.execCommand("copy");return document.body.removeChild(D),o}catch{return document.body.removeChild(D),!1}}class _{constructor(D){k(this,"prev",null);k(this,"next",null);k(this,"data",null);this.data=D}removeSelf(){this.data=null,this.prev&&(this.prev.next=this.next),this.next&&(this.next.prev=this.prev),this.prev=null,this.next=null}}class ru{constructor(){k(this,"dummyHead",new _(null))}shift(D){const o=new _(D),e=this.dummyHead.next;return o.prev=this.dummyHead,this.dummyHead.next=o,e&&(o.next=e,e.prev=o),o}remove(D){D.removeSelf()}clear(){let D=this.dummyHead.next;for(;D;){const o=D.next;D.removeSelf(),D=o}this.dummyHead.next=null}}const z=Symbol(),T=Symbol(),S=async(u,...D)=>typeof u=="function"?await u(...D):F.unref(u),x=u=>typeof u=="object"&&u!==null,O=u=>typeof u.event=="string"&&x(u.properties);function R(u,D){let o,e;if(D!=null&&D.catchBubble)o=new ru,e=o.shift(async t=>{var E,C;if(x(t))if(t[T]){const i=await S(u);if(!O(i))return;delete t[T];const A={...i,properties:{...i.properties,...t}};(E=window.__OA_REPORT__)==null||E.call(window,A.event,A.properties)}else O(t)&&((C=window.__OA_REPORT__)==null||C.call(window,t.event,t.properties))}),F.provide((D==null?void 0:D.key)??z,o);else if(D!=null&&D.bubble){if(o=F.inject((D==null?void 0:D.key)??z),!o)return;e=o.shift(async t=>{var E,C,i,A;if(x(t))if(t[T]){const s=await S(u);if(!x(s))return;const a={...s,...t};(C=(E=e.next)==null?void 0:E.data)==null||C.call(E,a)}else(A=(i=e.next)==null?void 0:i.data)==null||A.call(i,{...t,[T]:!0})})}else e=t=>{var E;O(t)&&((E=window.__OA_REPORT__)==null||E.call(window,t.event,t.properties))};return F.onUnmounted(()=>{o=null,e instanceof _&&e.removeSelf(),e=null}),e}function cu(u,D,o){if(!F.isRef(u)&&typeof u!="function")return;const e=R(D,o);F.watch(u,async(t,E)=>{var i;const C=await S(D,t,E);e instanceof _?(i=e.data)==null||i.call(e,C):typeof e=="function"&&e(C)})}const G=new WeakSet;function au(u,D,o,e){const t=F.computed(()=>F.unref(u)),E=R(o,{...e,key:D}),C=async i=>{var s;if(e!=null&&e.bubble&&G.has(i))return;G.add(i);const A=await S(o,i);typeof A=="object"&&A!==null&&(E instanceof _?(s=E.data)==null||s.call(E,A):typeof E=="function"&&E(A))};F.onMounted(()=>{var i;return(i=t.value)==null?void 0:i.addEventListener(D,C)}),F.onBeforeUnmount(()=>{var i;return(i=t.value)==null?void 0:i.removeEventListener(D,C)})}function du(u,D){R(u,D)}const N=Z.defineStore("login",{state:()=>({loginStatus:g.NOT}),actions:{setLoginStatus(u){this.loginStatus=u}},getters:{isLoginFailed(){return this.loginStatus===g.FAILED},isLoginNot(){return this.loginStatus===g.NOT},isLoggingIn(){return this.loginStatus===g.DOING},isLogined(){return this.loginStatus===g.DONE}}});var g=(u=>(u[u.FAILED=-1]="FAILED",u[u.NOT=0]="NOT",u[u.DOING=1]="DOING",u[u.DONE=2]="DONE",u))(g||{});const P={CSRF_TOKEN:"_U_T_"},Bu=300,lu=u=>{P.CSRF_TOKEN=u},Y=()=>({csrfCookie:b.get(P.CSRF_TOKEN)}),K=()=>{b.remove(P.CSRF_TOKEN)},mu=u=>{window.location.href=u},w=u=>{N().setLoginStatus(u)},I=async(u,D=!1)=>{const{csrfCookie:o}=Y();if(!(!o||D))try{w(1);const e=await u();if(e!=null&&e.data)return w(2),e.data;w(-1),K();return}catch{w(-1),K();return}},hu=u=>{window.location.href=u,setTimeout(()=>{w(0)},Bu)},fu=(u,D,o,e,t=!1)=>{const E=N();F.watch(()=>e.path,async(C,i)=>{if(C===i||E.isLogined)return;u.some(s=>C.includes(s))?o.value=await I(D,t):I(D,t).then(s=>{o.value=s})},{immediate:!0})};n.LOGIN_STATUS=g,n.ScreenConfig=L,n.Size=V,n.clearUserAuth=K,n.createTheme=iu,n.doLogin=mu,n.doLogout=hu,n.getUserAuth=Y,n.setLoginKeys=lu,n.setStatus=w,n.tryLogin=I,n.useAnalytics=du,n.useClipboard=Au,n.useElementEventAnalytics=au,n.useLocale=nu,n.useLoginStore=N,n.useLoginWatcher=fu,n.useMdRender=uu,n.useScreen=tu,n.useTheme=Cu,n.useWatchAnalytics=cu,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})}));
|
|
1
|
+
(function(n,F){typeof exports=="object"&&typeof module<"u"?F(exports,require("vue"),require("markdown-it-async"),require("markdown-it-anchor"),require("shiki"),require("vue-i18n"),require("@opensig/opendesign"),require("js-cookie"),require("pinia")):typeof define=="function"&&define.amd?define(["exports","vue","markdown-it-async","markdown-it-anchor","shiki","vue-i18n","@opensig/opendesign","js-cookie","pinia"],F):(n=typeof globalThis<"u"?globalThis:n||self,F(n.OpenDesignPlusComposables={},n.Vue,n.MarkdownItAsync,n.markdownItAnchor,n.shiki,n.VueI18n,n.OpenDesign,n.Cookies,n.Pinia))})(this,(function(n,F,y,Q,v,J,O,b,Z){"use strict";var wu=Object.defineProperty;var Lu=(n,F,y)=>F in n?wu(n,F,{enumerable:!0,configurable:!0,writable:!0,value:y}):n[F]=y;var k=(n,F,y)=>Lu(n,typeof F!="symbol"?F+"":F,y);const X=new Set(Object.keys(v.bundledLanguages));async function uu(u={}){const{anchor:D=!0,anchorType:o="vitepress",copy:e=!0,wrapMarkdownBodyDiv:t=!0,theme:i={},...C}=u,E=typeof(i==null?void 0:i.light)=="string"&&i.light in v.bundledThemes?i.light:"light-plus",s=typeof(i==null?void 0:i.dark)=="string"&&i.dark in v.bundledThemes?i.dark:"dark-plus",r=new Set(["text"]);F.onBeforeUnmount(()=>{d&&d.dispose()});const d=await v.createHighlighter({themes:[E,s],langs:["text"]}),a=y({async highlight(B,A){return X.has(A)||(A="text"),r.has(A)||(await d.loadLanguage(A),r.add(A)),d.codeToHtml(B,{lang:A,themes:{light:E,dark:s}})},...C});if(D&&a.use(Q,{slugify:B=>o==="github"?Du(B):eu(B)}),e){const B=a.renderer.rules.fence;a.renderer.rules.fence=(...A)=>{var f;const[m,h]=A,l=m[h],c=a.utils.escapeHtml(l.content||"");return`<div class="language-${((f=l.info)==null?void 0:f.trim())||""}"><div class="copy" data-clipboard-text="${c}"></div>`+B(...A)+"</div>"}}if(t){const B=a.render;a.render=(m,h)=>`<div class="markdown-body">${B.call(a,m,h)}</div>`;const A=a.renderInline;a.renderInline=(m,h)=>`<div class="markdown-body">${A.call(a,m,h)}</div>`}return{shiki:d,markdwon:a}}function Du(u){const D=/[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0AC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249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-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\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g;return`user-content-${u.toLowerCase().replace(D,"").replace(/ /g,"-")}`}function eu(u){return u.normalize("NFKD").replace(/[\u0300-\u036F]/g,"").replace(/[\u0000-\u001f]/g,"").replace(/[\s~`!@#$%^&*()\-_+=[\]{}|\\;:"'“”‘’<>,.?/]+/g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/^(\d)/,"_$1").toLowerCase()}var V=(u=>(u.Phone="phone",u.PadV="pad_v",u.PadH="pad_h",u.Laptop="laptop",u))(V||{});const L={phone:600,pad_v:840,pad_h:1200,laptop:1440},Fu={lt:(u,D)=>u<D,le:(u,D)=>u<=D,eq:(u,D)=>u===D,ne:(u,D)=>u!==D,ge:(u,D)=>u>=D,gt:(u,D)=>u>D},tu=()=>{const u=F.reactive({width:1440,height:0}),D=F.ref("laptop"),o=p=>(typeof p>"u"&&(p=u.width),p<L.phone?"phone":p<L.pad_v?"pad_v":p<L.pad_h?"pad_h":"laptop"),e=(p="eq",H)=>{const pu=u.width,gu=L[H],yu=Fu[p];return yu(pu,gu)},t=F.computed(()=>e("le","phone")),i=F.computed(()=>e("gt","phone")),C=F.computed(()=>e("gt","phone")&&e("le","pad_h")),E=F.computed(()=>e("le","pad_h")),s=F.computed(()=>e("gt","pad_h")),r=F.computed(()=>e("gt","phone")&&e("le","pad_v")),d=F.computed(()=>e("le","pad_v")),a=F.computed(()=>e("gt","pad_v")),B=F.computed(()=>e("gt","pad_v")&&e("le","pad_h")),A=F.computed(()=>e("gt","pad_h")&&e("le","laptop")),m=F.computed(()=>e("le","laptop")),h=F.computed(()=>e("gt","laptop")),l=F.computed(()=>e("gt","phone")&&e("le","laptop")),c=F.computed(()=>e("gt","pad_v")&&e("le","laptop")),f=()=>{const{innerWidth:p,innerHeight:H}=window;u.width=p,u.height=H,D.value=o()};return F.onMounted(()=>{typeof window<"u"&&(window.addEventListener("resize",f),f(),F.nextTick(()=>f()))}),F.onUnmounted(()=>{typeof window<"u"&&window.removeEventListener("resize",f)}),{getSize:o,current:D,size:u,isPhone:t,gtPhone:i,isPad:C,lePad:E,gtPad:s,isPadV:r,lePadV:d,gtPadV:a,isPadH:B,isLaptop:A,leLaptop:m,gtLaptop:h,isPadToLaptop:l,isPadVToLaptop:c}},nu=()=>{const{t:u,locale:D}=J.useI18n(),o=F.getCurrentInstance(),e=F.computed(()=>D.value==="zh"),t=F.computed(()=>D.value==="en");return F.watch(()=>D.value,C=>{O.isClient&&(document.documentElement.lang=C,localStorage.setItem("locale",C))},{immediate:!0}),{t:u,$t:u,locale:D,isZh:e,isEn:t,changeLocale:async C=>{var s;const E=O.isUndefined(C)?e.value?"en":"zh":C;D.value!==E&&(D.value=E,await F.nextTick(),(s=o==null?void 0:o.proxy)!=null&&s.$forceUpdate&&o.proxy.$forceUpdate())}}},ou="[警告] 请在项目中注入主题配置项:app.use(createTheme(options))",iu="[警告] 缺少参数 cookieKey 和 cookieDomain,请在 createTheme 传入 cookieKey 和 cookieDomain 参数",$=Symbol("theme"),q=Symbol("isLight"),M=Symbol("isDark"),U=Symbol("setTheme"),W=Symbol("toggleTheme");function Eu(u){const{cookieKey:D,cookieDomain:o,lightValue:e="light",darkValue:t="dark",attribute:i="data-o-theme",attributeLightValue:C=e,attributeDarkValue:E=t,classLightValue:s=e,classDarkValue:r=t}=u||{},d=F.ref(e),a=F.computed(()=>d.value===e),B=F.computed(()=>d.value===t),A=F.computed(()=>d.value),m=(l,c=!0)=>{const f=l===t?t:e;d.value=f,!(typeof window>"u")&&(f===t?(document.documentElement.setAttribute(i,E),document.documentElement.classList.add(r),document.documentElement.classList.remove(s)):(document.documentElement.setAttribute(i,C),document.documentElement.classList.add(s),document.documentElement.classList.remove(r)),c&&(D&&o?b.set(D,f,{domain:o}):console.warn(iu)))};F.watch(()=>A==null?void 0:A.value,l=>{if(!O.isClient)return;const c=document.documentElement;l===t?(c.setAttribute(i,E),c.classList.remove(e),c.classList.add(t)):(c.setAttribute(i,C),c.classList.remove(t),c.classList.add(e))},{immediate:!0});const h=()=>{m(A.value===t?e:t)};return{install(l){if(l.provide($,A),l.provide(q,a),l.provide(M,B),l.provide(U,m),l.provide(W,h),typeof window>"u")return;let c;D&&(c=b.get(D)),c||(c=window.matchMedia("(prefers-color-scheme: dark)").matches?t:e),m(c===t?t:e,!1)}}}function Cu(){const u=F.inject($);return u||console.warn(ou),{theme:u,isLight:F.inject(q),isDark:F.inject(M),setTheme:F.inject(U),toggleTheme:F.inject(W)}}async function su(u){try{return navigator.clipboard?(await navigator.clipboard.writeText(u),!0):Au(u)}catch{return!1}}function Au(u){const D=document.createElement("textarea");D.value=u,D.style.top="0",D.style.left="0",D.style.width="1px",D.style.height="1px",D.style.position="fixed",D.style.opacity="0",document.body.appendChild(D),D.focus(),D.select();try{const o=document.execCommand("copy");return document.body.removeChild(D),o}catch{return document.body.removeChild(D),!1}}class _{constructor(D){k(this,"prev",null);k(this,"next",null);k(this,"data",null);this.data=D}removeSelf(){this.data=null,this.prev&&(this.prev.next=this.next),this.next&&(this.next.prev=this.prev),this.prev=null,this.next=null}}class ru{constructor(){k(this,"dummyHead",new _(null))}shift(D){const o=new _(D),e=this.dummyHead.next;return o.prev=this.dummyHead,this.dummyHead.next=o,e&&(o.next=e,e.prev=o),o}remove(D){D.removeSelf()}clear(){let D=this.dummyHead.next;for(;D;){const o=D.next;D.removeSelf(),D=o}this.dummyHead.next=null}}const z=Symbol(),T=Symbol(),S=async(u,...D)=>typeof u=="function"?await u(...D):F.unref(u),x=u=>typeof u=="object"&&u!==null,R=u=>typeof u.event=="string"&&x(u.properties);function N(u,D){let o,e;if(D!=null&&D.catchBubble)o=new ru,e=o.shift(async t=>{var i,C;if(x(t))if(t[T]){const E=await S(u);if(!R(E))return;delete t[T];const s={...E,properties:{...E.properties,...t}};(i=window.__OA_REPORT__)==null||i.call(window,s.event,s.properties)}else R(t)&&((C=window.__OA_REPORT__)==null||C.call(window,t.event,t.properties))}),F.provide((D==null?void 0:D.key)??z,o);else if(D!=null&&D.bubble){if(o=F.inject((D==null?void 0:D.key)??z),!o)return;e=o.shift(async t=>{var i,C,E,s;if(x(t))if(t[T]){const r=await S(u);if(!x(r))return;const d={...r,...t};(C=(i=e.next)==null?void 0:i.data)==null||C.call(i,d)}else(s=(E=e.next)==null?void 0:E.data)==null||s.call(E,{...t,[T]:!0})})}else e=t=>{var i;R(t)&&((i=window.__OA_REPORT__)==null||i.call(window,t.event,t.properties))};return F.onUnmounted(()=>{o=null,e instanceof _&&e.removeSelf(),e=null}),e}function cu(u,D,o){if(!F.isRef(u)&&typeof u!="function")return;const e=N(D,o);F.watch(u,async(t,i)=>{var E;const C=await S(D,t,i);e instanceof _?(E=e.data)==null||E.call(e,C):typeof e=="function"&&e(C)})}const G=new WeakSet;function au(u,D,o,e){const t=F.computed(()=>F.unref(u)),i=N(o,{...e,key:D}),C=async E=>{var r;if(e!=null&&e.bubble&&G.has(E))return;G.add(E);const s=await S(o,E);typeof s=="object"&&s!==null&&(i instanceof _?(r=i.data)==null||r.call(i,s):typeof i=="function"&&i(s))};F.onMounted(()=>{var E;return(E=t.value)==null?void 0:E.addEventListener(D,C)}),F.onBeforeUnmount(()=>{var E;return(E=t.value)==null?void 0:E.removeEventListener(D,C)})}function du(u,D){N(u,D)}const P=Z.defineStore("login",{state:()=>({loginStatus:g.NOT}),actions:{setLoginStatus(u){this.loginStatus=u}},getters:{isLoginFailed(){return this.loginStatus===g.FAILED},isLoginNot(){return this.loginStatus===g.NOT},isLoggingIn(){return this.loginStatus===g.DOING},isLogined(){return this.loginStatus===g.DONE}}});var g=(u=>(u[u.FAILED=-1]="FAILED",u[u.NOT=0]="NOT",u[u.DOING=1]="DOING",u[u.DONE=2]="DONE",u))(g||{});const K={CSRF_TOKEN:"_U_T_"},lu=300,Bu=u=>{K.CSRF_TOKEN=u},Y=()=>({csrfCookie:b.get(K.CSRF_TOKEN)}),I=()=>{b.remove(K.CSRF_TOKEN)},mu=u=>{window.location.href=u},w=u=>{P().setLoginStatus(u)},j=async(u,D=!1)=>{const{csrfCookie:o}=Y();if(!(!o||D))try{w(1);const e=await u();if(e!=null&&e.data)return w(2),e.data;w(-1),I();return}catch{w(-1),I();return}},fu=u=>{window.location.href=u,setTimeout(()=>{w(0)},lu)},hu=(u,D,o,e,t=!1)=>{const i=P();F.watch(()=>e.path,async(C,E)=>{if(C===E||i.isLogined)return;u.some(r=>C.includes(r))?o.value=await j(D,t):j(D,t).then(r=>{o.value=r})},{immediate:!0})};n.LOGIN_STATUS=g,n.ScreenConfig=L,n.Size=V,n.clearUserAuth=I,n.createTheme=Eu,n.doLogin=mu,n.doLogout=fu,n.getUserAuth=Y,n.setLoginKeys=Bu,n.setStatus=w,n.tryLogin=j,n.useAnalytics=du,n.useClipboard=su,n.useElementEventAnalytics=au,n.useLocale=nu,n.useLoginStore=P,n.useLoginWatcher=hu,n.useMdRender=uu,n.useScreen=tu,n.useTheme=Cu,n.useWatchAnalytics=cu,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})}));
|