@deot/docs-client 1.1.3 → 1.1.5
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/README.md +88 -4
- package/dist/chunks/browser-Cmwcvs-d.js +505 -0
- package/dist/chunks/cdn-DQoETju_-DS-873Vi.js +38 -0
- package/dist/chunks/chunk-rhk8Qtmk-CUgXtmq_.js +14 -0
- package/dist/chunks/compile-BHD98Ttf-BJaenUUQ.js +79915 -0
- package/dist/chunks/compiler-sfc.esm-browser-B4_kBkG5.js +24975 -0
- package/dist/chunks/dayjs.min-B3g34Qcz.js +300 -0
- package/dist/chunks/dist-0ySyXNpo.js +415 -0
- package/dist/chunks/dist-9UPCn_ag.js +24601 -0
- package/dist/chunks/dist-B44jICwZ.js +22 -0
- package/dist/chunks/dist-BQyOK8Qy.js +17 -0
- package/dist/chunks/dist-BUw25nXJ.js +65 -0
- package/dist/chunks/dist-BeOE8qTX.js +345 -0
- package/dist/chunks/dist-C3V7reR4.js +197 -0
- package/dist/chunks/dist-C8z9l0mA.js +58 -0
- package/dist/chunks/dist-CI9Lp9Cj.js +247 -0
- package/dist/chunks/dist-COjpr4FU.js +426 -0
- package/dist/chunks/dist-CQir6D4y.js +244 -0
- package/dist/chunks/dist-Cxf7_ocf.js +44 -0
- package/dist/chunks/dist-DF4kisl2.js +43 -0
- package/dist/chunks/dist-DLj8yJdm.js +38 -0
- package/dist/chunks/dist-DWn6r6un.js +76 -0
- package/dist/chunks/dist-DWqBe2Ah.js +132 -0
- package/dist/chunks/dist-D_Uqh6m9.js +80 -0
- package/dist/chunks/dist-DcIU51zW.js +166 -0
- package/dist/chunks/dist-kiZUqqzR.js +27 -0
- package/dist/chunks/dist-oZ12SGqg.js +6 -0
- package/dist/chunks/dist-uXnwGrO3.js +76 -0
- package/dist/chunks/dist-va7FmnW4.js +156 -0
- package/dist/chunks/{echarts-I1Rk_oCV.js → echarts-Dk-pu7GM.js} +450 -398
- package/dist/chunks/files-BqucFldk-B-hTQ-ip.js +148 -0
- package/dist/chunks/html2canvas-Deo0mM5K.js +4022 -0
- package/dist/chunks/index.es-UlJ0gfdF.js +5757 -0
- package/dist/chunks/jspdf.es.min-CJc40v7q.js +17873 -0
- package/dist/chunks/jsx-CwMPlI4_-CAiik-V7.js +128454 -0
- package/dist/chunks/jszip.min-BbVwZKYP.js +3044 -0
- package/dist/chunks/linker-xqjVl0X0-CWWI367H.js +118 -0
- package/dist/chunks/local-sandbox-DvcgaBOa-CzJxrdVx.js +298 -0
- package/dist/chunks/lodash-Cxf6dD_I.js +5161 -0
- package/dist/chunks/modules-BGzPcoRR-C9BWX8hC.js +154 -0
- package/dist/chunks/{photoswipe.esm-CT37djgx.js → photoswipe.esm-B0V-xGTB.js} +36 -31
- package/dist/chunks/pinia-pDJilYOg.js +326 -0
- package/dist/chunks/purify.es-BiqY1C6m.js +867 -0
- package/dist/chunks/remote-mq4zvrI1-Bib9tTkb.js +104 -0
- package/dist/chunks/script-DjUf9uWK-Cu5Kla_E.js +15055 -0
- package/dist/chunks/store-BOyC8F2y-CbodPye0.js +17037 -0
- package/dist/chunks/vue-router-C0mj8Ot5.js +1196 -0
- package/dist/chunks/vue.runtime.esm-bundler-XxHGOLq2.js +4879 -0
- package/dist/index.cjs +997 -340
- package/dist/index.d.ts +2 -1
- package/dist/index.js +42205 -103464
- package/dist/index.style.css +3 -4
- package/package.json +9 -9
- package/dist/chunks/_commonjsHelpers-BFTU3MAI-D_7z5o6A.js +0 -8
- package/dist/chunks/jsx-H2PmTOgp-C0GVSSMR.js +0 -128281
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
globalThis.process;
|
|
2
|
+
import { n as e } from "./rolldown-runtime-Ce3zPWPd.js";
|
|
3
|
+
import { i as t, n, r, t as i } from "./browser-Cmwcvs-d.js";
|
|
4
|
+
//#region node_modules/.pnpm/@deot+helper-unicode@1.1.4/node_modules/@deot/helper-unicode/dist/index.js
|
|
5
|
+
var a = /* @__PURE__ */ e({
|
|
6
|
+
atou: () => s,
|
|
7
|
+
decode: () => l,
|
|
8
|
+
encode: () => c,
|
|
9
|
+
utoa: () => o
|
|
10
|
+
}), o = (e) => {
|
|
11
|
+
let r = n(e), a = t(r, { level: 9 }), o = i(a, !0);
|
|
12
|
+
return btoa(o);
|
|
13
|
+
}, s = (e) => {
|
|
14
|
+
let t = atob(e);
|
|
15
|
+
if (t.startsWith("xÚ")) {
|
|
16
|
+
let e = n(t, !0), a = r(e);
|
|
17
|
+
return i(a);
|
|
18
|
+
}
|
|
19
|
+
return decodeURIComponent(escape(t));
|
|
20
|
+
}, c = o, l = s;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { a as n, c as r, l as t };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
globalThis.process;
|
|
2
|
+
import { r as e } from "./dist-C3V7reR4.js";
|
|
3
|
+
import { i as t } from "./dist-va7FmnW4.js";
|
|
4
|
+
import { t as n } from "./dist-DWn6r6un.js";
|
|
5
|
+
import { t as r } from "./dist-CI9Lp9Cj.js";
|
|
6
|
+
import { t as i } from "./dist-D_Uqh6m9.js";
|
|
7
|
+
import { i as a, r as o, t as s } from "./dist-DcIU51zW.js";
|
|
8
|
+
import { t as c } from "./dist-Cxf7_ocf.js";
|
|
9
|
+
import { i as l, n as u, r as d, t as f } from "./dist-COjpr4FU.js";
|
|
10
|
+
import { t as p } from "./dist-C8z9l0mA.js";
|
|
11
|
+
import { i as m, n as h, r as g, t as _ } from "./dist-CQir6D4y.js";
|
|
12
|
+
import { o as v } from "./dist-DLj8yJdm.js";
|
|
13
|
+
import { n as y } from "./dist-B44jICwZ.js";
|
|
14
|
+
import { Device as b } from "./dist-kiZUqqzR.js";
|
|
15
|
+
import { t as x } from "./dist-DF4kisl2.js";
|
|
16
|
+
import { t as S } from "./dist-oZ12SGqg.js";
|
|
17
|
+
export { t as $, _ as Cookie, b as Device, c as Emitter, l as FP, h as IndexedDB, g as IndexedDBStore, p as Interrupter, v as Is, f as Job, i as Load, u as Parallel, a as RegExps, n as Resize, x as Route, o as RuleHelper, S as Shared, m as Storage, d as Task, y as Unicode, e as Utils, s as Validator, r as Wheel };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
globalThis.process;
|
|
2
|
+
import { n as e } from "./rolldown-runtime-Ce3zPWPd.js";
|
|
3
|
+
import { o as t } from "./dist-C3V7reR4.js";
|
|
4
|
+
import { a as n, c as r, d as i, f as a, h as o, i as s, l as c, m as l, n as u, p as d, r as f, s as p, t as m, u as h } from "./dist-DLj8yJdm.js";
|
|
5
|
+
//#region node_modules/.pnpm/@deot+http-hooks@1.1.8/node_modules/@deot/http-hooks/dist/index.js
|
|
6
|
+
var g = /* @__PURE__ */ e({
|
|
7
|
+
onRequest: () => C,
|
|
8
|
+
onResponse: () => _
|
|
9
|
+
}), _ = (e) => {
|
|
10
|
+
let { body: t } = e.response;
|
|
11
|
+
if (o(t)) try {
|
|
12
|
+
t = JSON.parse(t.toString());
|
|
13
|
+
} catch {}
|
|
14
|
+
return e.response.body = t, e;
|
|
15
|
+
}, v = "application/json", y = "application/x-www-form-urlencoded", b = "multipart/form-data", x = (e) => e || e === !1 || e === 0 || e === "", S = (e) => {
|
|
16
|
+
let t = [];
|
|
17
|
+
for (let n in e) x(e[n]) && t.push(n + "=" + encodeURIComponent(d(e[n]) ? JSON.stringify(e[n]) : e[n]));
|
|
18
|
+
return t.join("&");
|
|
19
|
+
}, C = (e) => {
|
|
20
|
+
let { url: g, body: _, headers: C, method: w, dynamic: T } = e.request, E = w.toLowerCase(), D = g, O = _;
|
|
21
|
+
if (T && d(O)) {
|
|
22
|
+
let e = O, n = /(\/?{[^?\/\&]+|\/?:[^\d][^?\/\&]+)/g, r = "", i = D.replace(/[a-zA-z]+:\/\/[^\/{]*/, (e) => (r = e, ""));
|
|
23
|
+
if (n.test(i)) {
|
|
24
|
+
let a = [];
|
|
25
|
+
i = i.replace(n, (n) => {
|
|
26
|
+
let r = n.replace(/({|}|\s|:|\/)/g, ""), i = t(e, r);
|
|
27
|
+
return a.push(i), i.v ? `${n.indexOf("/") === 0 ? "/" : ""}${i.v}` : "";
|
|
28
|
+
}), a.forEach((e) => e.o[e.k] !== void 0 && delete e.o[e.k]), D = r + i;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (["get"].includes(E) && d(O)) {
|
|
32
|
+
let e = S(O);
|
|
33
|
+
e.length > 0 && (D += (D.includes("?") ? "&" : "?") + e), O = null;
|
|
34
|
+
} else {
|
|
35
|
+
let e = C.get("Content-Type") || "", t = e.includes(v);
|
|
36
|
+
if (i(O) && h(O) && (O = new FormData(O)), c(O) && t) throw Error("expected 'json', received 'FormData', need formDataToJSON");
|
|
37
|
+
if (!(u(O) || n(O) || l(O) || p(O) || s(O) || c(O) || o(O) || !O)) {
|
|
38
|
+
if (f(O)) O = O.buffer;
|
|
39
|
+
else if (a(O)) C.set("Content-Type", y, !1), O = O.toString();
|
|
40
|
+
else if (r(O)) {
|
|
41
|
+
let e = O;
|
|
42
|
+
O = new FormData(), Array.from(e).forEach((e) => {
|
|
43
|
+
O.append("files[]", e);
|
|
44
|
+
});
|
|
45
|
+
} else if (d(O) || m(O)) {
|
|
46
|
+
if (e.includes(y)) O = S(O);
|
|
47
|
+
else if (e.includes(b)) {
|
|
48
|
+
let e = O;
|
|
49
|
+
O = new FormData(), Object.keys(e).forEach((t) => {
|
|
50
|
+
let n = [t, e[t]];
|
|
51
|
+
p(n[1]) && n[1].name && n.push(n[1].name), d(n[1]) && (n[1] = JSON.stringify(n[1])), x(n[1]) && O.append.apply(O, n);
|
|
52
|
+
});
|
|
53
|
+
} else C.set("Content-Type", v, !1), O = JSON.stringify(O);
|
|
54
|
+
} else O = JSON.stringify(O);
|
|
55
|
+
}
|
|
56
|
+
!c(O) && [
|
|
57
|
+
"post",
|
|
58
|
+
"put",
|
|
59
|
+
"patch"
|
|
60
|
+
].includes(E) && C.set("Content-Type", y, !1);
|
|
61
|
+
}
|
|
62
|
+
return c(O) && C.set("Content-Type", null, !0), e.request.url = D, e.request.body = O, e.request.headers = C, e;
|
|
63
|
+
};
|
|
64
|
+
//#endregion
|
|
65
|
+
export { C as n, _ as r, g as t };
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
globalThis.process;
|
|
2
|
+
import { n as e } from "./rolldown-runtime-Ce3zPWPd.js";
|
|
3
|
+
//#region node_modules/.pnpm/@deot+http-core@1.1.7/node_modules/@deot/http-core/dist/index.js
|
|
4
|
+
var t = /* @__PURE__ */ e({
|
|
5
|
+
ERROR_CODE: () => f,
|
|
6
|
+
HTTPController: () => m,
|
|
7
|
+
HTTPHeaders: () => n,
|
|
8
|
+
HTTPRequest: () => a,
|
|
9
|
+
HTTPResponse: () => r,
|
|
10
|
+
HTTPShell: () => p,
|
|
11
|
+
HTTPShellLeaf: () => d
|
|
12
|
+
}), n = class e {
|
|
13
|
+
constructor(e) {
|
|
14
|
+
typeof e == "object" && this.set(e, !0);
|
|
15
|
+
}
|
|
16
|
+
set(t, n, r) {
|
|
17
|
+
if (typeof t == "string") {
|
|
18
|
+
let e = t, i = n;
|
|
19
|
+
this[e] = r ? i : this[e] || i;
|
|
20
|
+
} else {
|
|
21
|
+
let i = t;
|
|
22
|
+
r = n, i = i instanceof e ? i.toJSON() : { ...i }, Object.keys(i).forEach((e) => {
|
|
23
|
+
this.set(e, i[e], r);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return this;
|
|
27
|
+
}
|
|
28
|
+
has(e) {
|
|
29
|
+
return !!this[e];
|
|
30
|
+
}
|
|
31
|
+
get(e) {
|
|
32
|
+
return this[e];
|
|
33
|
+
}
|
|
34
|
+
toJSON() {
|
|
35
|
+
let e = /* @__PURE__ */ Object.create(null);
|
|
36
|
+
for (let t in this) Object.hasOwnProperty.call(this, t) && this[t] && (e[t] = this[t]);
|
|
37
|
+
return e;
|
|
38
|
+
}
|
|
39
|
+
get [Symbol.toStringTag]() {
|
|
40
|
+
return "HTTPHeaders";
|
|
41
|
+
}
|
|
42
|
+
}, r = class e {
|
|
43
|
+
url;
|
|
44
|
+
body;
|
|
45
|
+
headers;
|
|
46
|
+
status;
|
|
47
|
+
statusText;
|
|
48
|
+
redirected;
|
|
49
|
+
type;
|
|
50
|
+
ok;
|
|
51
|
+
bodyUsed;
|
|
52
|
+
constructor(t, r) {
|
|
53
|
+
let i = {
|
|
54
|
+
body: null,
|
|
55
|
+
headers: {},
|
|
56
|
+
ok: !0,
|
|
57
|
+
redirected: !1,
|
|
58
|
+
status: 200,
|
|
59
|
+
statusText: "",
|
|
60
|
+
type: "default",
|
|
61
|
+
url: ""
|
|
62
|
+
}, a = t && (t.constructor === Object || t instanceof e) ? {
|
|
63
|
+
...i,
|
|
64
|
+
...t,
|
|
65
|
+
...r
|
|
66
|
+
} : {
|
|
67
|
+
...i,
|
|
68
|
+
body: t,
|
|
69
|
+
...r
|
|
70
|
+
};
|
|
71
|
+
Object.keys(a).forEach((e) => {
|
|
72
|
+
let t = a[e] === void 0 ? i[e] : a[e];
|
|
73
|
+
this[e] = e === "headers" ? new n(t) : t;
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
static error(t, n) {
|
|
77
|
+
return new e(null, {
|
|
78
|
+
...n,
|
|
79
|
+
status: n?.status || 0,
|
|
80
|
+
type: "error",
|
|
81
|
+
ok: !1,
|
|
82
|
+
statusText: t
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}, i = (e) => new r({ body: e.body }), a = class e {
|
|
86
|
+
url;
|
|
87
|
+
method;
|
|
88
|
+
headers;
|
|
89
|
+
body;
|
|
90
|
+
mode;
|
|
91
|
+
credentials;
|
|
92
|
+
cache;
|
|
93
|
+
redirect;
|
|
94
|
+
referrer;
|
|
95
|
+
integrity;
|
|
96
|
+
keepalive;
|
|
97
|
+
referrerPolicy;
|
|
98
|
+
bodyUsed;
|
|
99
|
+
localData = null;
|
|
100
|
+
onStart;
|
|
101
|
+
onFinish;
|
|
102
|
+
onRequest;
|
|
103
|
+
onResponse;
|
|
104
|
+
timeout;
|
|
105
|
+
maxTries;
|
|
106
|
+
interval;
|
|
107
|
+
shared = null;
|
|
108
|
+
provider;
|
|
109
|
+
constructor(t, r, a) {
|
|
110
|
+
let o = {
|
|
111
|
+
method: "GET",
|
|
112
|
+
headers: {},
|
|
113
|
+
body: null,
|
|
114
|
+
mode: "cors",
|
|
115
|
+
credentials: "same-origin",
|
|
116
|
+
cache: "default",
|
|
117
|
+
redirect: "follow",
|
|
118
|
+
integrity: "",
|
|
119
|
+
keepalive: !1,
|
|
120
|
+
referrer: "about:client",
|
|
121
|
+
referrerPolicy: "",
|
|
122
|
+
localData: null,
|
|
123
|
+
timeout: 6e4,
|
|
124
|
+
maxTries: 1,
|
|
125
|
+
interval: 0,
|
|
126
|
+
shared: null,
|
|
127
|
+
provider: i
|
|
128
|
+
}, s = t && (t.constructor === Object || t instanceof e) ? {
|
|
129
|
+
...o,
|
|
130
|
+
...a,
|
|
131
|
+
...t,
|
|
132
|
+
...r
|
|
133
|
+
} : {
|
|
134
|
+
...o,
|
|
135
|
+
...a,
|
|
136
|
+
url: t,
|
|
137
|
+
...r
|
|
138
|
+
};
|
|
139
|
+
Object.keys(s).forEach((e) => {
|
|
140
|
+
let t = s[e] === void 0 ? o[e] : s[e];
|
|
141
|
+
this[e] = e === "headers" ? new n(t) : t;
|
|
142
|
+
});
|
|
143
|
+
let c = (t && typeof t == "object" ? t : r) || {};
|
|
144
|
+
[
|
|
145
|
+
"onStart",
|
|
146
|
+
"onFinish",
|
|
147
|
+
"onRequest",
|
|
148
|
+
"onResponse"
|
|
149
|
+
].forEach((e) => {
|
|
150
|
+
let t = c[e], n = Array.isArray(t) ? t : t ? [t] : [];
|
|
151
|
+
this[e] = (a ? n.concat(a[e]) : n).filter((e, t, n) => n.indexOf(e) === t);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}, o = +/* @__PURE__ */ new Date(), s = 0, c = (e) => `${e}-${o}-${++s}`, l = (e) => {
|
|
155
|
+
let t = 0;
|
|
156
|
+
return typeof e == "object" && e.enforce && (t = e.enforce === "pre" ? -1 : 1), t;
|
|
157
|
+
}, u = (e) => [...e].sort((e, t) => l(e) - l(t)).map((e) => typeof e == "object" ? e.handler : e), d = class {
|
|
158
|
+
id = c("shell.leaf");
|
|
159
|
+
cancel;
|
|
160
|
+
timeout;
|
|
161
|
+
target;
|
|
162
|
+
originalRequest;
|
|
163
|
+
originalResponse;
|
|
164
|
+
request;
|
|
165
|
+
response;
|
|
166
|
+
constructor(e) {
|
|
167
|
+
this.originalRequest = e, this.request = new a(e);
|
|
168
|
+
}
|
|
169
|
+
then(e, t) {
|
|
170
|
+
return this.target.then(e, t);
|
|
171
|
+
}
|
|
172
|
+
catch(e) {
|
|
173
|
+
return this.target.catch(e);
|
|
174
|
+
}
|
|
175
|
+
finally(e) {
|
|
176
|
+
return this.target.finally(e);
|
|
177
|
+
}
|
|
178
|
+
}, f = {
|
|
179
|
+
HTTP_URL_EMPTY: "HTTP_URL_EMPTY",
|
|
180
|
+
HTTP_RESPONSE_REBUILD_FAILED: "HTTP_RESPONSE_REBUILD_FAILED",
|
|
181
|
+
HTTP_OPTIONS_REBUILD_FAILED: "HTTP_OPTIONS_REBUILD_FAILED",
|
|
182
|
+
HTTP_CANCEL: "HTTP_CANCEL",
|
|
183
|
+
HTTP_REQUEST_TIMEOUT: "HTTP_REQUEST_TIMEOUT",
|
|
184
|
+
HTTP_STATUS_ERROR: "HTTP_STATUS_ERROR",
|
|
185
|
+
HTTP_CODE_ILLEGAL: "HTTP_CODE_ILLEGAL",
|
|
186
|
+
HTTP_RESPONSE_PARSING_FAILED: "HTTP_RESPONSE_PARSING_FAILED"
|
|
187
|
+
}, p = class {
|
|
188
|
+
parent;
|
|
189
|
+
request;
|
|
190
|
+
leafs = {};
|
|
191
|
+
isPending = !1;
|
|
192
|
+
constructor(e, t, n) {
|
|
193
|
+
this.request = new a(e, t, n.request), this.parent = n;
|
|
194
|
+
}
|
|
195
|
+
send() {
|
|
196
|
+
let e = Object.keys(this.leafs);
|
|
197
|
+
if (this.request.shared && e.length) return this.leafs[e[0]];
|
|
198
|
+
this.parent._add(this);
|
|
199
|
+
let t = new d(this.request);
|
|
200
|
+
this.leafs[t.id] = t;
|
|
201
|
+
let n = new Promise((e, n) => {
|
|
202
|
+
t.cancel = async () => {
|
|
203
|
+
n(this.error(t, f.HTTP_CANCEL)), await new Promise((e) => {
|
|
204
|
+
t.target.catch(() => {}).finally(e);
|
|
205
|
+
});
|
|
206
|
+
};
|
|
207
|
+
}), r, i;
|
|
208
|
+
return t.target = new Promise((e, o) => {
|
|
209
|
+
Promise.resolve().then(() => this.loading(t)).then(() => this.before(t)).then(() => {
|
|
210
|
+
let e = this.after(t), { timeout: r } = t.originalRequest, i = [e, n];
|
|
211
|
+
return r && i.push(new Promise((e, n) => {
|
|
212
|
+
t.timeout = setTimeout(() => n(this.error(t, f.HTTP_REQUEST_TIMEOUT)), r);
|
|
213
|
+
})), Promise.race(i);
|
|
214
|
+
}).then(() => i = t.response).catch((e) => r = e).then(() => {
|
|
215
|
+
let n = (n) => {
|
|
216
|
+
this.clear(t).then(() => e(n));
|
|
217
|
+
}, s = async (e) => {
|
|
218
|
+
this.clear(t).then(() => o(e));
|
|
219
|
+
}, c = r || i.type === "error", l = new a(this.request);
|
|
220
|
+
return --l.maxTries, c && l.maxTries >= 1 ? (l.onStart = [], l.onFinish = [], Promise.resolve().then(() => l.interval && new Promise((e) => setTimeout(e, l.interval))).then(() => this.parent.http(l)).then(n).catch(s)) : c ? s(r || i) : n(i);
|
|
221
|
+
});
|
|
222
|
+
}), t;
|
|
223
|
+
}
|
|
224
|
+
async task(e, t, n) {
|
|
225
|
+
if (!t.length) return;
|
|
226
|
+
let r = !1;
|
|
227
|
+
return u(t).reduce((t, i) => (t = t.then(() => {
|
|
228
|
+
if (!r) {
|
|
229
|
+
let t = i(e);
|
|
230
|
+
return t === e || t;
|
|
231
|
+
}
|
|
232
|
+
return !1;
|
|
233
|
+
}).then((e) => {
|
|
234
|
+
!r && n && n(e), e === !1 && (r = !0);
|
|
235
|
+
}), t), Promise.resolve());
|
|
236
|
+
}
|
|
237
|
+
async clear(e) {
|
|
238
|
+
let { timeout: t, id: n, response: r } = e;
|
|
239
|
+
t && clearTimeout(t), await this.loaded(e), !(r?.type !== "error" && this.request.shared) && this.clearByLeafId(n);
|
|
240
|
+
}
|
|
241
|
+
clearByLeafId(e) {
|
|
242
|
+
let t = this.leafs[e];
|
|
243
|
+
t && (Object.keys(t).forEach((e) => delete t[e]), delete this.leafs[e], Object.keys(this.leafs).length || this.parent._remove(this));
|
|
244
|
+
}
|
|
245
|
+
async removeIfShared(e) {
|
|
246
|
+
let t;
|
|
247
|
+
this.request.shared && (!e || this.request.shared === e) && (t = Object.keys(this.leafs)[0]) && (await this.cancel(t), this.clearByLeafId(t));
|
|
248
|
+
}
|
|
249
|
+
async cancel(e) {
|
|
250
|
+
if (e) {
|
|
251
|
+
let t = typeof e == "string" ? this.leafs[e] : e;
|
|
252
|
+
t?.cancel && await t.cancel();
|
|
253
|
+
} else await Object.keys(this.leafs).reduce((e, t) => (e = e.then(() => this.cancel(t)), e), Promise.resolve());
|
|
254
|
+
}
|
|
255
|
+
async loading(e) {
|
|
256
|
+
let { localData: t, onStart: n } = e.originalRequest;
|
|
257
|
+
!t && !this.isPending && (this.isPending = !0, await this.task(e, n));
|
|
258
|
+
}
|
|
259
|
+
async loaded(e) {
|
|
260
|
+
let { localData: t, onFinish: n } = e.originalRequest, r = Object.keys(this.leafs).length === 1;
|
|
261
|
+
!t && r && this.isPending && (this.isPending = !1, await this.task(e, n));
|
|
262
|
+
}
|
|
263
|
+
async before(e) {
|
|
264
|
+
let { onRequest: t } = e.originalRequest;
|
|
265
|
+
try {
|
|
266
|
+
await this.task(e, t, (t) => {
|
|
267
|
+
let n;
|
|
268
|
+
n = t instanceof a ? new a(t) : t === !0 ? e.request : new a(e.request, t), e.request = n;
|
|
269
|
+
});
|
|
270
|
+
} catch (t) {
|
|
271
|
+
throw this.error(e, f.HTTP_OPTIONS_REBUILD_FAILED, t);
|
|
272
|
+
}
|
|
273
|
+
if (!e.request.url && !e.request.localData) throw this.error(e, f.HTTP_URL_EMPTY);
|
|
274
|
+
}
|
|
275
|
+
async after(e) {
|
|
276
|
+
let { localData: t, onResponse: n, provider: i } = e.request, a = t ? Promise.resolve(new r({ body: t })) : i(e.request, e), o;
|
|
277
|
+
try {
|
|
278
|
+
o = await a;
|
|
279
|
+
} catch (e) {
|
|
280
|
+
o = e;
|
|
281
|
+
}
|
|
282
|
+
e.originalResponse = o, e.response = new r(o);
|
|
283
|
+
try {
|
|
284
|
+
await this.task(e, n, (t) => {
|
|
285
|
+
let n;
|
|
286
|
+
n = t instanceof r ? new r(t) : t === !0 ? e.response : new r(e.response, t), e.response = n;
|
|
287
|
+
});
|
|
288
|
+
} catch (t) {
|
|
289
|
+
throw this.error(e, f.HTTP_RESPONSE_REBUILD_FAILED, t);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
error(e, t, n) {
|
|
293
|
+
return r.error(t, {
|
|
294
|
+
body: n,
|
|
295
|
+
"@@internal": {
|
|
296
|
+
request: {
|
|
297
|
+
input: this.request,
|
|
298
|
+
used: e?.request
|
|
299
|
+
},
|
|
300
|
+
response: {
|
|
301
|
+
input: e?.originalResponse,
|
|
302
|
+
used: e?.response
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
}, m = class {
|
|
308
|
+
request;
|
|
309
|
+
shells;
|
|
310
|
+
constructor(e) {
|
|
311
|
+
this.request = new a(e || {}), this.shells = [];
|
|
312
|
+
}
|
|
313
|
+
http(e, t) {
|
|
314
|
+
return this._getShell(e, t).send();
|
|
315
|
+
}
|
|
316
|
+
custom(e, t) {
|
|
317
|
+
return this._getShell(e, t);
|
|
318
|
+
}
|
|
319
|
+
async cancel(e) {
|
|
320
|
+
await this.shells.reduce((t, n) => (t = t.then(() => n.cancel(e)), t), Promise.resolve()), e || (this.shells = this.shells.filter((e) => !!e.request.shared));
|
|
321
|
+
}
|
|
322
|
+
async removeShared(e) {
|
|
323
|
+
await this.shells.reduce((t, n) => (t = t.then(() => n.removeIfShared(e)), t), Promise.resolve());
|
|
324
|
+
}
|
|
325
|
+
async clear() {
|
|
326
|
+
await this.cancel(), await this.removeShared();
|
|
327
|
+
}
|
|
328
|
+
_getShell(e, t) {
|
|
329
|
+
let n = new p(e, t, this);
|
|
330
|
+
return n.request.shared && (n = this.shells.find((e) => {
|
|
331
|
+
if (e.request.shared !== n.request.shared) return !1;
|
|
332
|
+
try {
|
|
333
|
+
return JSON.stringify(e.request) === JSON.stringify(n.request);
|
|
334
|
+
} catch {}
|
|
335
|
+
}) || n), n;
|
|
336
|
+
}
|
|
337
|
+
_add(e) {
|
|
338
|
+
this.shells.includes(e) || this.shells.push(e);
|
|
339
|
+
}
|
|
340
|
+
_remove(e) {
|
|
341
|
+
this.shells = this.shells.filter((t) => t !== e);
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
//#endregion
|
|
345
|
+
export { t as a, r as i, m as n, n as r, f as t };
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
globalThis.process;
|
|
2
|
+
import { n as e } from "./rolldown-runtime-Ce3zPWPd.js";
|
|
3
|
+
//#region node_modules/.pnpm/@deot+helper-utils@1.1.9/node_modules/@deot/helper-utils/dist/index.js
|
|
4
|
+
var t = /* @__PURE__ */ e({
|
|
5
|
+
asterisk: () => n,
|
|
6
|
+
autoCatch: () => r,
|
|
7
|
+
cAF: () => x,
|
|
8
|
+
cIC: () => T,
|
|
9
|
+
caf: () => C,
|
|
10
|
+
canvasToImage: () => o,
|
|
11
|
+
cic: () => D,
|
|
12
|
+
cloneDeepEasier: () => s,
|
|
13
|
+
compressImage: () => c,
|
|
14
|
+
dataURLToFile: () => a,
|
|
15
|
+
debounce: () => l,
|
|
16
|
+
def: () => u,
|
|
17
|
+
flatten: () => M,
|
|
18
|
+
flattenJSONParse: () => N,
|
|
19
|
+
generateString: () => I,
|
|
20
|
+
getPropByPath: () => d,
|
|
21
|
+
getUid: () => m,
|
|
22
|
+
hasOwn: () => h,
|
|
23
|
+
numberToUnit: () => v,
|
|
24
|
+
preZero: () => y,
|
|
25
|
+
probs: () => k,
|
|
26
|
+
rAF: () => b,
|
|
27
|
+
rIC: () => w,
|
|
28
|
+
raf: () => S,
|
|
29
|
+
range: () => O,
|
|
30
|
+
ric: () => E,
|
|
31
|
+
sleep: () => A,
|
|
32
|
+
throttle: () => j,
|
|
33
|
+
toPromise: () => L
|
|
34
|
+
}), n = (e, t, n) => {
|
|
35
|
+
t ||= 3, n ||= 4;
|
|
36
|
+
let r = n, i = e.substring(0, t);
|
|
37
|
+
for (; r;) i += "*", r--;
|
|
38
|
+
return i += e.substring(t + n), i;
|
|
39
|
+
}, r = async (e, t = {}) => {
|
|
40
|
+
let { onError: n = console.error } = t;
|
|
41
|
+
try {
|
|
42
|
+
let t = e;
|
|
43
|
+
return typeof t == "function" && (t = t()), await t;
|
|
44
|
+
} catch (e) {
|
|
45
|
+
n(e);
|
|
46
|
+
}
|
|
47
|
+
}, i = (e) => {
|
|
48
|
+
let t;
|
|
49
|
+
return typeof e == "string" && e.includes(".") && (t = e.split(".").pop()), t ? `image/${t}` : "image/jpeg";
|
|
50
|
+
}, a = (e, t, n) => {
|
|
51
|
+
/data:[^;]+;[^,]+,/g.test(e) || (e = `data:${n || i(t)};base64,${e}`);
|
|
52
|
+
let [r, a] = e.split(","), o = r.match(/:(.*?);/)?.[1], s = window.atob(a), c = s.length, l = new Uint8Array(c);
|
|
53
|
+
for (; c--;) l[c] = s.charCodeAt(c);
|
|
54
|
+
return new File([l], t || "__filename", { type: o });
|
|
55
|
+
}, o = (e, t) => {
|
|
56
|
+
let n = e.toDataURL("image/png");
|
|
57
|
+
return new Promise((e) => {
|
|
58
|
+
let r = { dataURL: n };
|
|
59
|
+
typeof t == "string" && (r.file = a(n, t)), e(r);
|
|
60
|
+
});
|
|
61
|
+
}, s = (e) => JSON.parse(JSON.stringify(e)), c = (e, t) => {
|
|
62
|
+
let { width: n, height: r, filetype: i = "image/jpeg", encoderOptions: o } = t || {};
|
|
63
|
+
return new Promise((t, s) => {
|
|
64
|
+
let c = new Image(), l = new FileReader();
|
|
65
|
+
l.readAsDataURL(e), l.onload = (e) => {
|
|
66
|
+
c.src = e.target.result;
|
|
67
|
+
};
|
|
68
|
+
let u = document.createElement("canvas"), d = u.getContext("2d");
|
|
69
|
+
c.onload = () => {
|
|
70
|
+
let s = c.width, l = c.height, f = n || s, p = r || l, m = s, h = l;
|
|
71
|
+
(s > f || l > p) && (s / l > f / p ? (m = f, h = Math.round(l / s * f)) : (h = p, m = Math.round(s / l * p))), u.width = m, u.height = h, d.clearRect(0, 0, m, h), d.drawImage(c, 0, 0, m, h);
|
|
72
|
+
let g = u.toDataURL(i, o);
|
|
73
|
+
t({
|
|
74
|
+
dataURL: g,
|
|
75
|
+
file: a(g, e.name)
|
|
76
|
+
});
|
|
77
|
+
}, c.onerror = (e) => {
|
|
78
|
+
s(e);
|
|
79
|
+
};
|
|
80
|
+
});
|
|
81
|
+
}, l = (e, t, n) => {
|
|
82
|
+
let { leading: r, trailing: i = !0, throttle: a } = n || {}, o, s, c = () => {
|
|
83
|
+
o && clearTimeout(o), o = null;
|
|
84
|
+
}, l = () => {
|
|
85
|
+
o = setTimeout(() => {
|
|
86
|
+
o = null, i && s && s();
|
|
87
|
+
}, t);
|
|
88
|
+
}, u = function(...n) {
|
|
89
|
+
if (s = () => {
|
|
90
|
+
e.apply(this, n), s = null;
|
|
91
|
+
}, !t && a) return s();
|
|
92
|
+
o ? a || (c(), l()) : (r && s(), l());
|
|
93
|
+
};
|
|
94
|
+
return u.cancel = () => {
|
|
95
|
+
c(), s = null;
|
|
96
|
+
}, u.flush = () => {
|
|
97
|
+
c(), i && s && s();
|
|
98
|
+
}, u;
|
|
99
|
+
}, u = (e, t, n, r) => Object.defineProperty(e, t, {
|
|
100
|
+
value: n,
|
|
101
|
+
enumerable: !1,
|
|
102
|
+
writable: !0,
|
|
103
|
+
configurable: !0,
|
|
104
|
+
...r
|
|
105
|
+
}), d = (e, t) => {
|
|
106
|
+
let n = e;
|
|
107
|
+
t = t.replace(/\[(\w+)\]/g, ".$1"), t = t.replace(/^\./, "");
|
|
108
|
+
let r = t.split("."), i = 0;
|
|
109
|
+
for (let e = r.length; i < e - 1; ++i) {
|
|
110
|
+
let e = r[i];
|
|
111
|
+
try {
|
|
112
|
+
if (e in n) n = n[e];
|
|
113
|
+
else throw Error();
|
|
114
|
+
} catch {
|
|
115
|
+
throw Error("无效路径!");
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return {
|
|
119
|
+
o: n,
|
|
120
|
+
k: r[i],
|
|
121
|
+
v: n[r[i]]
|
|
122
|
+
};
|
|
123
|
+
}, f = +/* @__PURE__ */ new Date(), p = 0, m = (e) => `${e ? `${e}-` : ""}${f}-${++p}`, h = (e, t) => Object.prototype.hasOwnProperty.call(e, t), g = (e) => {
|
|
124
|
+
let t = -1;
|
|
125
|
+
for (; e >= 1;) t++, e /= 10;
|
|
126
|
+
return t;
|
|
127
|
+
}, _ = (e, t, n, r) => {
|
|
128
|
+
let i = g(e);
|
|
129
|
+
if (i > 3) {
|
|
130
|
+
let e = i % 8;
|
|
131
|
+
return e >= 5 && (e = 4), Math.round(t / 10 ** (e + n - r)) / 10 ** r + "万";
|
|
132
|
+
}
|
|
133
|
+
return Math.round(t / 10 ** (n - r)) / 10 ** r + "";
|
|
134
|
+
}, v = (e, t) => {
|
|
135
|
+
e > 2 ** 53 - 1 && (e = 2 ** 53 - 1), t ??= 2;
|
|
136
|
+
let n = Math.floor(e), r = g(n), i = [];
|
|
137
|
+
if (r > 3) {
|
|
138
|
+
let a = Math.floor(r / 8);
|
|
139
|
+
if (a >= 1) {
|
|
140
|
+
let r = Math.round(n / 10 ** (8 * a));
|
|
141
|
+
i.push(_(r, e, 8 * a, t));
|
|
142
|
+
for (let e = 0; e < a; e++) i.push("亿");
|
|
143
|
+
return i.join("");
|
|
144
|
+
}
|
|
145
|
+
return _(n, e, 0, t);
|
|
146
|
+
}
|
|
147
|
+
return e;
|
|
148
|
+
}, y = (e) => e < 10 && e > 0 ? "0" + e : e <= 0 ? "00" : "" + e, b = typeof window < "u" && window.requestAnimationFrame || ((e) => setTimeout(e, 16)), x = typeof window < "u" && window.cancelAnimationFrame || ((e) => clearTimeout(e)), S = b, C = x, w = typeof window < "u" && window.requestIdleCallback || ((e) => {
|
|
149
|
+
let t = Date.now();
|
|
150
|
+
return setTimeout(() => e({
|
|
151
|
+
didTimeout: !1,
|
|
152
|
+
timeRemaining: () => Math.max(0, 50 - (Date.now() - t))
|
|
153
|
+
}), 1);
|
|
154
|
+
}), T = typeof window < "u" && window.cancelIdleCallback || ((e) => clearTimeout(e)), E = w, D = T, O = (e, t) => Math.floor(Math.random() * (t - e + 1) + e), k = (e) => {
|
|
155
|
+
let t = e.reduce((e, t) => e + (!t || t <= 0 ? 0 : t), 0);
|
|
156
|
+
if (!t) throw Error("不可能得到索引值");
|
|
157
|
+
let n = e.map((e) => e / t), r = 0, i = Math.random();
|
|
158
|
+
for (; i > 0;) i -= n[r], r++;
|
|
159
|
+
return r--, r;
|
|
160
|
+
}, A = (e, t) => {
|
|
161
|
+
let n;
|
|
162
|
+
return n = typeof e == "object" ? O(e.min, e.max) : e || 0, new Promise((e) => {
|
|
163
|
+
let r = setTimeout(e, n);
|
|
164
|
+
t && t(r, n, e);
|
|
165
|
+
});
|
|
166
|
+
}, j = (e, t, n) => {
|
|
167
|
+
let { leading: r = !0, trailing: i = !0 } = n || {};
|
|
168
|
+
return l(e, t, {
|
|
169
|
+
leading: r,
|
|
170
|
+
trailing: i,
|
|
171
|
+
throttle: !0
|
|
172
|
+
});
|
|
173
|
+
}, M = (e, t, n) => {
|
|
174
|
+
let r = !0, i = 1, a = e;
|
|
175
|
+
for (; r;) {
|
|
176
|
+
if (i > 1e3) throw Error(e);
|
|
177
|
+
try {
|
|
178
|
+
let e = (t || decodeURIComponent)(a);
|
|
179
|
+
(a === e || typeof n == "function" && n(e)) && (r = !1), a = e;
|
|
180
|
+
} catch {
|
|
181
|
+
r = !1;
|
|
182
|
+
}
|
|
183
|
+
i++;
|
|
184
|
+
}
|
|
185
|
+
return a;
|
|
186
|
+
}, N = (e) => e === null ? null : /^-?\d+[eE]\d+$/.test(e) || /^\d+$/.test(e) && e.length >= 16 && +e > 2 ** 53 - 1 ? e : M(e, JSON.parse, (e) => typeof e == "object"), P = "abcdefghijklmnopqrstuvwxyz", F = P + P.toUpperCase() + "0123456789-_", I = (e, t) => {
|
|
187
|
+
e ||= 16, t ||= F;
|
|
188
|
+
let n = "", { length: r } = t;
|
|
189
|
+
for (; e--;) n += t[Math.random() * r | 0];
|
|
190
|
+
return n;
|
|
191
|
+
}, L = (e, t) => {
|
|
192
|
+
let n = e, r = e;
|
|
193
|
+
if (!r || r.then || r.catch || r.finally) throw Error("TypeError");
|
|
194
|
+
return n.then = (e, n) => t.then(e, n), n.catch = (e) => t.catch(e), n.finally = (e) => t.finally(e), n;
|
|
195
|
+
};
|
|
196
|
+
//#endregion
|
|
197
|
+
export { N as a, h as c, j as d, M as i, y as l, o as n, d as o, t as r, m as s, C as t, S as u };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
globalThis.process;
|
|
2
|
+
import { n as e } from "./rolldown-runtime-Ce3zPWPd.js";
|
|
3
|
+
import { n as t, r as n, t as r } from "./dist-COjpr4FU.js";
|
|
4
|
+
//#region node_modules/.pnpm/@deot+helper-scheduler@1.1.9/node_modules/@deot/helper-scheduler/dist/index.js
|
|
5
|
+
var i = /* @__PURE__ */ e({
|
|
6
|
+
Interrupter: () => a,
|
|
7
|
+
Job: () => r,
|
|
8
|
+
Parallel: () => t,
|
|
9
|
+
Task: () => n
|
|
10
|
+
}), a = class e {
|
|
11
|
+
static of(t) {
|
|
12
|
+
return new e(t);
|
|
13
|
+
}
|
|
14
|
+
options = {};
|
|
15
|
+
_success;
|
|
16
|
+
_fail;
|
|
17
|
+
_task;
|
|
18
|
+
_finish = !1;
|
|
19
|
+
constructor(e) {
|
|
20
|
+
e && (this.options = e), this._generateTask();
|
|
21
|
+
}
|
|
22
|
+
_generateTask = () => {
|
|
23
|
+
this._task = new Promise((e, t) => {
|
|
24
|
+
this._success = (t) => {
|
|
25
|
+
this._fail = void 0, e(t);
|
|
26
|
+
}, this._fail = (e) => {
|
|
27
|
+
this._success = void 0, t(e);
|
|
28
|
+
};
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
next = async (e) => {
|
|
32
|
+
this._finish ? await this._task : (this._success?.(e), await this._task, await Promise.resolve(), this._generateTask());
|
|
33
|
+
};
|
|
34
|
+
nextWithError = async (e) => {
|
|
35
|
+
if (this._finish) await this._task;
|
|
36
|
+
else {
|
|
37
|
+
this._fail?.(e);
|
|
38
|
+
try {
|
|
39
|
+
await this._task;
|
|
40
|
+
} catch {
|
|
41
|
+
await Promise.resolve(), this._generateTask();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
finish = (e) => (this._success?.(e), this._finish = !0, this);
|
|
46
|
+
finishWithError = (e) => (this._fail?.(e), this._finish = !0, this);
|
|
47
|
+
then(e, t) {
|
|
48
|
+
return this._task.then(e, t);
|
|
49
|
+
}
|
|
50
|
+
catch(e) {
|
|
51
|
+
return this._task.catch(e);
|
|
52
|
+
}
|
|
53
|
+
finally(e) {
|
|
54
|
+
return this._task.finally(e);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
//#endregion
|
|
58
|
+
export { i as n, a as t };
|