@deot/docs-client 1.1.2 → 1.1.4

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 (55) hide show
  1. package/README.md +2 -3
  2. package/dist/chunks/browser-Cmwcvs-d.js +505 -0
  3. package/dist/chunks/cdn-DEvdGJu2-bmlgKy4E.js +38 -0
  4. package/dist/chunks/chunk-rhk8Qtmk-CUgXtmq_.js +14 -0
  5. package/dist/chunks/compile-Bw7v7QE--Dd1-R95H.js +79920 -0
  6. package/dist/chunks/compiler-sfc.esm-browser-B4_kBkG5.js +24975 -0
  7. package/dist/chunks/dayjs.min-B3g34Qcz.js +300 -0
  8. package/dist/chunks/dist-0ySyXNpo.js +415 -0
  9. package/dist/chunks/dist-BUw25nXJ.js +65 -0
  10. package/dist/chunks/dist-BeOE8qTX.js +345 -0
  11. package/dist/chunks/dist-Bm7SK-km.js +24517 -0
  12. package/dist/chunks/dist-C3V7reR4.js +197 -0
  13. package/dist/chunks/dist-C8z9l0mA.js +58 -0
  14. package/dist/chunks/dist-CI9Lp9Cj.js +247 -0
  15. package/dist/chunks/dist-COjpr4FU.js +426 -0
  16. package/dist/chunks/dist-CQir6D4y.js +244 -0
  17. package/dist/chunks/dist-CuJyl-ef.js +17 -0
  18. package/dist/chunks/dist-Cxf7_ocf.js +44 -0
  19. package/dist/chunks/dist-DF4kisl2.js +43 -0
  20. package/dist/chunks/dist-DLj8yJdm.js +38 -0
  21. package/dist/chunks/dist-DN0sqx7H.js +39 -0
  22. package/dist/chunks/dist-DWqBe2Ah.js +132 -0
  23. package/dist/chunks/dist-D_Uqh6m9.js +80 -0
  24. package/dist/chunks/dist-DcIU51zW.js +166 -0
  25. package/dist/chunks/dist-DlmO7OlF.js +22 -0
  26. package/dist/chunks/dist-kiZUqqzR.js +27 -0
  27. package/dist/chunks/dist-oZ12SGqg.js +6 -0
  28. package/dist/chunks/dist-uXnwGrO3.js +76 -0
  29. package/dist/chunks/dist-va7FmnW4.js +156 -0
  30. package/dist/chunks/{echarts-I1Rk_oCV.js → echarts-Dk-pu7GM.js} +450 -398
  31. package/dist/chunks/files-C5UMzYxA-q9oJ4PrI.js +110 -0
  32. package/dist/chunks/html2canvas-Deo0mM5K.js +4022 -0
  33. package/dist/chunks/index.es-UlJ0gfdF.js +5757 -0
  34. package/dist/chunks/jspdf.es.min-CJc40v7q.js +17873 -0
  35. package/dist/chunks/jsx-CwMPlI4_-CAiik-V7.js +128454 -0
  36. package/dist/chunks/jszip.min-BbVwZKYP.js +3044 -0
  37. package/dist/chunks/linker-JHdz37DK-CWgUtxZ5.js +118 -0
  38. package/dist/chunks/local-sandbox-B8IJ5jWb-BgfU3iQ4.js +300 -0
  39. package/dist/chunks/lodash-Cxf6dD_I.js +5161 -0
  40. package/dist/chunks/modules-DlLJF_vd-DcNdL6sc.js +153 -0
  41. package/dist/chunks/{photoswipe.esm-CT37djgx.js → photoswipe.esm-B0V-xGTB.js} +36 -31
  42. package/dist/chunks/pinia-pDJilYOg.js +326 -0
  43. package/dist/chunks/purify.es-BiqY1C6m.js +867 -0
  44. package/dist/chunks/remote-DfXAsO9n-C_MtPVYr.js +75 -0
  45. package/dist/chunks/script-xKUjE8pf-oF69rg-w.js +14941 -0
  46. package/dist/chunks/store-D8vwi-HV-RFStijWr.js +16936 -0
  47. package/dist/chunks/vue-router-C0mj8Ot5.js +1196 -0
  48. package/dist/chunks/vue.runtime.esm-bundler-XxHGOLq2.js +4879 -0
  49. package/dist/index.cjs +17 -17
  50. package/dist/index.d.ts +1 -1
  51. package/dist/index.js +41759 -103263
  52. package/dist/index.style.css +3 -4
  53. package/package.json +9 -9
  54. package/dist/chunks/_commonjsHelpers-BFTU3MAI-D_7z5o6A.js +0 -8
  55. package/dist/chunks/jsx-H2PmTOgp-C0GVSSMR.js +0 -128281
@@ -0,0 +1,426 @@
1
+ globalThis.process;
2
+ import { n as e } from "./rolldown-runtime-Ce3zPWPd.js";
3
+ import { t } from "./dist-Cxf7_ocf.js";
4
+ //#region node_modules/.pnpm/@deot+helper-fp@1.1.6/node_modules/@deot/helper-fp/dist/index.js
5
+ var n = /* @__PURE__ */ e({
6
+ AMonad: () => T,
7
+ APointed: () => E,
8
+ ATask: () => D,
9
+ Either: () => N,
10
+ IO: () => P,
11
+ Job: () => L,
12
+ Maybe: () => k,
13
+ Monad: () => O,
14
+ Parallel: () => R,
15
+ Pointed: () => I,
16
+ Task: () => F,
17
+ add: () => g,
18
+ alternation: () => b,
19
+ catch$: () => l,
20
+ compose: () => o,
21
+ curry: () => i,
22
+ divide: () => v,
23
+ filter: () => p,
24
+ fork: () => x,
25
+ identity: () => S,
26
+ map: () => f,
27
+ memoize: () => u,
28
+ multiply: () => y,
29
+ partial: () => d,
30
+ pipe: () => s,
31
+ reduce: () => m,
32
+ reverse: () => h,
33
+ sequence: () => C,
34
+ subtract: () => _,
35
+ tap: () => w,
36
+ then$: () => c
37
+ }), r = (e, t, n) => (e = e.map((e) => e === n && t.length ? t.shift() : e), e.concat(t)), i = (e) => function t(...n) {
38
+ return n.length >= e.length && !n.includes(i) ? e.apply(this, n) : function(...e) {
39
+ let a = r(n, e, i);
40
+ return t.apply(this, a);
41
+ };
42
+ };
43
+ i.placeholder = i;
44
+ var a = (e) => (...t) => t.length === 0 ? (e) => e : t.length === 1 ? t[0] : t[e]((e, t) => function(...n) {
45
+ return e.call(this, t.apply(this, n));
46
+ }), o = a("reduce"), s = a("reduceRight"), c = i(function(e, t) {
47
+ return t.then(e);
48
+ }), l = i(function(e, t) {
49
+ return t.catch(e);
50
+ }), u = (e, t) => {
51
+ if (e.length === 0) return e;
52
+ let n = function(...r) {
53
+ let i = t ? t.apply(this, r) : r[0];
54
+ return n.cache.has(i) || n.cache.set(i, e.apply(this, r)), n.cache.get(i);
55
+ };
56
+ return n.cache = /* @__PURE__ */ new Map(), n;
57
+ }, d = (e, ...t) => function(...n) {
58
+ return e.apply(this, r(t, n, d));
59
+ };
60
+ d.placeholder = d;
61
+ var f = i((e, t) => t instanceof Array ? t.map((t) => e(t)) : Object.keys(t).reduce((n, r) => (n[r] = e(t[r]), n), {})), p = i((e, t) => t instanceof Array ? t.filter((t) => e(t)) : Object.keys(t).reduce((n, r) => (e(t[r]) && (n[r] = t[r]), n), {})), m = i((e, t, n) => n.reduce(e, t)), h = (e) => typeof e == "string" ? e.split("").reverse().join("") : e instanceof Array ? e.slice().reverse() : e, g = i((e, t) => {
62
+ let n, r;
63
+ try {
64
+ n = e.toString().split(".")[1].length;
65
+ } catch {
66
+ n = 0;
67
+ }
68
+ try {
69
+ r = t.toString().split(".")[1].length;
70
+ } catch {
71
+ r = 0;
72
+ }
73
+ let i = Math.abs(n - r), a = 10 ** Math.max(n, r);
74
+ if (i > 0) {
75
+ let a = 10 ** i;
76
+ n > r ? (e = Number(e.toString().replace(".", "")), t = Number(t.toString().replace(".", "")) * a) : (e = Number(e.toString().replace(".", "")) * a, t = Number(t.toString().replace(".", "")));
77
+ } else e = Number(e.toString().replace(".", "")), t = Number(t.toString().replace(".", ""));
78
+ return (e + t) / a;
79
+ }), _ = i((e, t) => {
80
+ let n, r;
81
+ try {
82
+ n = e.toString().split(".")[1].length;
83
+ } catch {
84
+ n = 0;
85
+ }
86
+ try {
87
+ r = t.toString().split(".")[1].length;
88
+ } catch {
89
+ r = 0;
90
+ }
91
+ let i = 10 ** Math.max(n, r), a = n >= r ? n : r;
92
+ return +((e * i - t * i) / i).toFixed(a);
93
+ }), v = i((e, t) => {
94
+ let n = 0, r = 0;
95
+ try {
96
+ n = e.toString().split(".")[1].length;
97
+ } catch {}
98
+ try {
99
+ r = t.toString().split(".")[1].length;
100
+ } catch {}
101
+ let i = 10 ** Math.max(n, r);
102
+ return e * i / (t * i);
103
+ }), y = i((e, t) => {
104
+ let n = 0, r = e.toString(), i = t.toString();
105
+ try {
106
+ n += r.split(".")[1].length;
107
+ } catch {}
108
+ try {
109
+ n += i.split(".")[1].length;
110
+ } catch {}
111
+ return Number(r.replace(".", "")) * Number(i.replace(".", "")) / 10 ** n;
112
+ }), b = i((e, t) => (n) => e(n) || t(n)), x = i((e, t, n) => (r) => e(t(r), n(r))), S = (e) => e, C = (...e) => (t) => {
113
+ e.forEach((e) => e(t));
114
+ }, w = i((e, t) => (e(t), t)), T = class e {
115
+ value;
116
+ constructor(e) {
117
+ this.value = e;
118
+ }
119
+ flatMap(e) {
120
+ let t = this.join();
121
+ return this.value = t.value, this.map(e);
122
+ }
123
+ join() {
124
+ return this.value instanceof e ? this.value.join() : this;
125
+ }
126
+ valueOf() {
127
+ return this.value;
128
+ }
129
+ }, E = class {
130
+ value;
131
+ constructor(e) {
132
+ this.value = e;
133
+ }
134
+ valueOf() {
135
+ return this.value;
136
+ }
137
+ }, D = class extends t {
138
+ _pasuer;
139
+ pasuer = Promise.resolve();
140
+ canceler = Promise.resolve();
141
+ isCancel = !1;
142
+ isPasue = !1;
143
+ async suspend(e, t) {
144
+ return t && t.then && await t, e;
145
+ }
146
+ setPasueStatus(e) {
147
+ this.isPasue = e, this.isPasue ? this.pasuer = new Promise((e) => {
148
+ this._pasuer = e;
149
+ }) : this._pasuer();
150
+ }
151
+ setCancelStatus(e) {
152
+ this.isCancel = e, this.canceler = this.isCancel ? new Promise(() => {}) : Promise.resolve();
153
+ }
154
+ end() {
155
+ return this.cancel();
156
+ }
157
+ immediate() {
158
+ return this.start();
159
+ }
160
+ }, O = class e extends T {
161
+ static of(t) {
162
+ return new e(t);
163
+ }
164
+ map(t) {
165
+ return e.of(t(this.value));
166
+ }
167
+ toString() {
168
+ return `Monad(${this.value})`;
169
+ }
170
+ }, k = class e extends T {
171
+ static of(t) {
172
+ return new e(t);
173
+ }
174
+ map(t) {
175
+ return this.isNothing() ? e.of(this.value) : e.of(t(this.value));
176
+ }
177
+ toString() {
178
+ return this.isNothing() ? "Maybe.Nothing" : `Maybe.Just(${this.value})`;
179
+ }
180
+ isNothing() {
181
+ return this.value === null || this.value === void 0;
182
+ }
183
+ isJust() {
184
+ return !this.isNothing();
185
+ }
186
+ valueOf(e) {
187
+ return e !== void 0 && this.isNothing() ? e : this.value;
188
+ }
189
+ }, A = (e) => new N(e), j = (e) => new N(e, !0), M = (e) => {
190
+ try {
191
+ return A(e());
192
+ } catch (e) {
193
+ return j(e);
194
+ }
195
+ }, N = class e extends T {
196
+ static of = M;
197
+ static try = M;
198
+ static ok = A;
199
+ static right = A;
200
+ static left = j;
201
+ static error = j;
202
+ isLeft;
203
+ isRight;
204
+ constructor(e, t) {
205
+ super(e), this.isLeft = !!t, this.isRight = !t;
206
+ }
207
+ map(t) {
208
+ return this.isLeft ? e.left(this.value) : e.right(t(this.value));
209
+ }
210
+ toString() {
211
+ return `Either.${this.isLeft ? "Left" : "Right"}(${this.value})`;
212
+ }
213
+ }, P = class e extends T {
214
+ static of(t) {
215
+ return new e(t);
216
+ }
217
+ map(t) {
218
+ let n = o(t, this.value._isIO ? this.value : () => this.value);
219
+ return n._isIO = !0, e.of(n);
220
+ }
221
+ toString() {
222
+ return `IO(${this.value()})`;
223
+ }
224
+ valueOf() {
225
+ return this.value();
226
+ }
227
+ }, F = class e extends T {
228
+ static of(t, n) {
229
+ return new e(t, n);
230
+ }
231
+ result = "";
232
+ cancelHooks = [];
233
+ isCancel = !1;
234
+ isComplete = !1;
235
+ isStart;
236
+ parent;
237
+ child = null;
238
+ record = null;
239
+ ready;
240
+ _ready;
241
+ pasuer = Promise.resolve();
242
+ _pasuer;
243
+ constructor(e, t) {
244
+ super(e), this.parent = t, this.isStart = t?.isStart || !1, this.ready = this.isStart ? Promise.resolve() : new Promise((e) => {
245
+ this._ready = e;
246
+ });
247
+ }
248
+ map(t) {
249
+ this.record ||= ["map", t];
250
+ let n = e.of(this.ready.then(() => this.value).then((e) => this.pasuer.then(() => e)).then((e) => new Promise((r, i) => {
251
+ let a, o;
252
+ n.isCancel || (async () => {
253
+ try {
254
+ o = await Promise.race([new Promise((e, t) => {
255
+ n.cancelHooks.push(t);
256
+ }), t(e)]);
257
+ } catch (e) {
258
+ a = e;
259
+ } finally {
260
+ n.isCancel || (n.isComplete = !0, a ? i(a) : (n.result = o, r(o)));
261
+ }
262
+ })();
263
+ })), this);
264
+ return this.child = n, n;
265
+ }
266
+ flatMap(e) {
267
+ return this.record = ["flatMap", e], super.flatMap(e);
268
+ }
269
+ reduce(e, t) {
270
+ return this.map(async (n) => (typeof e == "function" && (e = await e(n)), e.reduce((e, n, r, i) => e.then((e) => t(e, n, r, i)), Promise.resolve(n))));
271
+ }
272
+ start() {
273
+ return this.isStart ? this : (this.isStart = !0, this.parent?.start(), this._ready(), this);
274
+ }
275
+ pasue() {
276
+ return this.parent?.pasue(), this.pasuer = new Promise((e) => {
277
+ this._pasuer = e;
278
+ }), this;
279
+ }
280
+ resume() {
281
+ return this._pasuer(), this.parent?.resume(), this;
282
+ }
283
+ cancel() {
284
+ return this.isCancel || this.isComplete ? this : (this.isCancel = !0, this.cancelHooks.forEach((e) => e()), this.parent?.cancel(), this);
285
+ }
286
+ end() {
287
+ return this.cancel();
288
+ }
289
+ immediate() {
290
+ return this.start();
291
+ }
292
+ restart(t) {
293
+ this.cancel();
294
+ let n = this, r = n.parent || n;
295
+ for (; r && r.parent;) r = r.parent;
296
+ n = e.of(t || r.value);
297
+ let i = r;
298
+ for (; i && i.child;) {
299
+ let [e, t] = i.record;
300
+ e && (n = n[e](t)), i = i.child;
301
+ }
302
+ return n.isStart || n.start(), n;
303
+ }
304
+ toPromise() {
305
+ return this.isStart || this.start(), this.value;
306
+ }
307
+ toString() {
308
+ return `Task(${this.result})`;
309
+ }
310
+ valueOf() {
311
+ return this.result;
312
+ }
313
+ }, I = class e extends E {
314
+ static of(t) {
315
+ return new e(t);
316
+ }
317
+ map(t) {
318
+ return e.of(t(this.value));
319
+ }
320
+ toString() {
321
+ return `Pointed(${this.value})`;
322
+ }
323
+ }, L = class e extends D {
324
+ static of(t, n) {
325
+ return new e(t, n);
326
+ }
327
+ original;
328
+ task;
329
+ interval;
330
+ isStart = !1;
331
+ constructor(e, t) {
332
+ super(), this.task = e, this.original = e, this.interval = t || 0, this.task instanceof F && this.task.isStart && this.start();
333
+ }
334
+ process(e) {
335
+ e ||= this.original, this.task !== e && (this.task = e);
336
+ let t = (e) => Promise.resolve(e).then((e) => this.suspend(e, new Promise((e) => {
337
+ setTimeout(e, this.interval);
338
+ }))).then((e) => this.suspend(e, this.canceler)).then((e) => this.suspend(e, this.pasuer));
339
+ return this.original instanceof F ? Promise.resolve().then(() => e.isCancel ? Promise.resolve() : e.value).then((e) => this.suspend(e, this.emit("fulfilled", e))).catch((e) => this.suspend(e, this.emit("rejected", e))).then((e) => t(e)).then(() => e.restart()).then((e) => this.process(e)) : Promise.resolve().then(() => this.original()).then((e) => this.suspend(e, this.emit("fulfilled", e))).catch((e) => this.suspend(e, this.emit("rejected", e))).then((e) => t(e)).then((e) => this.process(e));
340
+ }
341
+ start() {
342
+ this.isStart || (this.isStart = !0, this.original instanceof F && !this.original.isStart && this.original.start(), this.process());
343
+ }
344
+ pasue() {
345
+ this.task instanceof F && this.task.pasue(), this.setPasueStatus(!0);
346
+ }
347
+ resume() {
348
+ this.task instanceof F && this.task.resume(), this.setPasueStatus(!1);
349
+ }
350
+ cancel() {
351
+ this.task instanceof F && this.task.cancel(), this.setCancelStatus(!0);
352
+ }
353
+ restart() {
354
+ this.task instanceof F && (this.task.pasue(), this.task.cancel()), this.setCancelStatus(!1), this.isStart = !1, this.process();
355
+ }
356
+ }, R = class e extends D {
357
+ static of(t, n, r) {
358
+ return new e(t, n, r);
359
+ }
360
+ original;
361
+ task;
362
+ isStart = !1;
363
+ target = null;
364
+ _target = null;
365
+ tasks = [];
366
+ concurrency;
367
+ options;
368
+ constructor(e, t, n) {
369
+ super(), this.options = {
370
+ skipError: !0,
371
+ ...n
372
+ }, this.task = e, this.original = e instanceof Array ? [...e] : e, this.concurrency = t || 1;
373
+ }
374
+ setConcurrency(e) {
375
+ return typeof e == "number" && e > 0 && (this.concurrency = e, this.target && this.process()), this.concurrency;
376
+ }
377
+ process() {
378
+ for (; this.tasks.length < this.concurrency && (typeof this.task == "function" || this.task instanceof F || this.task instanceof Array && this.task.length);) {
379
+ let e;
380
+ if (this.task instanceof Array) {
381
+ let t = this.task.pop();
382
+ /* istanbul ignore else -- @preserve */
383
+ typeof t == "function" ? e = t() : t instanceof F && (e = t.restart());
384
+ } else e = this.task instanceof F ? this.task.restart() : this.task();
385
+ this.tasks.push(e), Promise.resolve().then(() => e instanceof F ? e.value : e).then((e) => this.suspend(e, this.canceler)).then((e) => this.suspend(e, this.pasuer)).finally(() => {
386
+ this.tasks = this.tasks.filter((t) => t !== e);
387
+ }).then(this.onFulfilled).catch(this.onRejected);
388
+ }
389
+ this.task instanceof Array && !this.task.length && this.tasks.length === 0 && (this._target.resolve(), this.target = null, this.tasks = []);
390
+ }
391
+ onFulfilled = (e) => {
392
+ /* istanbul ignore if -- @preserve */
393
+ this.target && (this.emit("fulfilled", e), this.process());
394
+ };
395
+ onRejected = (e) => {
396
+ /* istanbul ignore if -- @preserve */
397
+ this.target && (this.emit("rejected", e), this.options.skipError ? this.process() : (this._target.reject(e), this.target = null, this.tasks = []));
398
+ };
399
+ start() {
400
+ return this.target ||= new Promise((e, t) => {
401
+ this._target = {
402
+ reject: t,
403
+ resolve: e
404
+ }, this.process();
405
+ }), this.target;
406
+ }
407
+ async cancel() {
408
+ if (!this.target) return;
409
+ let e = this.tasks;
410
+ this.setCancelStatus(!0), this.target = null, this.tasks = [], e.some((e) => e instanceof F) ? e.forEach((e) => e.cancel()) : await Promise.allSettled(e);
411
+ }
412
+ async pasue() {
413
+ let e = this.tasks;
414
+ this.setPasueStatus(!0), e.some((e) => e instanceof F) ? e.forEach((e) => e.pasue()) : await Promise.allSettled(e);
415
+ }
416
+ resume() {
417
+ this.setPasueStatus(!1);
418
+ let e = this.tasks;
419
+ e.some((e) => e instanceof F) && e.forEach((e) => e.resume());
420
+ }
421
+ async restart() {
422
+ return await this.cancel(), this.setCancelStatus(!1), this.original instanceof Array && (this.task = [...this.original]), this.start();
423
+ }
424
+ };
425
+ //#endregion
426
+ export { n as i, R as n, F as r, L as t };
@@ -0,0 +1,244 @@
1
+ globalThis.process;
2
+ import { n as e } from "./rolldown-runtime-Ce3zPWPd.js";
3
+ import { a as t } from "./dist-C3V7reR4.js";
4
+ //#region node_modules/.pnpm/@deot+helper-cache@1.1.11/node_modules/@deot/helper-cache/dist/index.js
5
+ var n = /* @__PURE__ */ e({
6
+ Cookie: () => a,
7
+ IndexedDB: () => p,
8
+ IndexedDBStore: () => f,
9
+ Storage: () => u
10
+ }), r = class {
11
+ options;
12
+ constructor() {
13
+ this.options = {
14
+ version: "",
15
+ versions: [],
16
+ get: (e) => t(e),
17
+ set: (e) => e
18
+ };
19
+ }
20
+ configure(e) {
21
+ typeof window < "u" && (this.options = {
22
+ ...this.options,
23
+ ...e
24
+ });
25
+ }
26
+ }, i = (() => {
27
+ try {
28
+ return document.cookie = "test", !0;
29
+ } catch {
30
+ return !1;
31
+ }
32
+ })(), a = new class extends r {
33
+ get(e) {
34
+ if (!i) return null;
35
+ let t = RegExp("(?:^|;+|\\s+)" + e + "=([^;]*)"), n = window.document.cookie.match(t), r = n ? decodeURIComponent(n[1]) : null;
36
+ return this.options.get(r);
37
+ }
38
+ set(e, t, n) {
39
+ if (!i) return;
40
+ let { days: r, path: a, domain: o } = n || {}, s = /* @__PURE__ */ new Date();
41
+ s.setTime(s.getTime() + (r ? 864e5 * r : 432e5)), t = this.options.set(typeof t == "string" ? t : JSON.stringify(t)), document.cookie = `${e}=${encodeURIComponent(t)};expires=${s.toString()};path=${a || "/"};${o ? `domain=${o};` : ""}`;
42
+ }
43
+ remove(e, t) {
44
+ if (!i) return;
45
+ let { path: n, domain: r } = t || {};
46
+ document.cookie = `${e}=;expires=${(/* @__PURE__ */ new Date(0)).toUTCString()};path=${n || "/"};${r ? `domain=${r};` : ""}`;
47
+ }
48
+ }(), o = class {
49
+ store = {};
50
+ getItem(e) {
51
+ return this.store[e] || null;
52
+ }
53
+ setItem(e, t) {
54
+ this.store[e] = t;
55
+ }
56
+ removeItem(e) {
57
+ delete this.store[e];
58
+ }
59
+ }, s = "@deot/helper/", c = (e, t) => {
60
+ let n = t.filter((e) => e !== void 0)[0];
61
+ return `${n ? `${s}${n}:` : ""}${e}`;
62
+ }, l = (() => {
63
+ let e = "test";
64
+ try {
65
+ return window.localStorage.setItem(e, e), window.localStorage.removeItem(e), !0;
66
+ } catch {
67
+ return !1;
68
+ }
69
+ })(), u = new class extends r {
70
+ sessionStorage = new o();
71
+ localStorage = new o();
72
+ getInvoke(e) {
73
+ return e?.session ? "sessionStorage" : "localStorage";
74
+ }
75
+ configure(e) {
76
+ if (super.configure(e), !l) return;
77
+ let { version: t, versions: n } = this.options, r = [t, ...n];
78
+ Object.keys(window.localStorage).forEach((e) => {
79
+ /* istanbul ignore else -- @preserve */
80
+ e.includes(s) && !r.some((t) => e.includes(`${s}${t}`)) && window.localStorage.removeItem(e);
81
+ });
82
+ }
83
+ set(e, t, n) {
84
+ if (!l) return;
85
+ let r = this.getInvoke(n);
86
+ e = c(e, [n?.version, this.options.version]), t = this.options.set(typeof t == "string" ? t : JSON.stringify(t));
87
+ try {
88
+ window[r].setItem(e, t);
89
+ } catch {
90
+ this[r].setItem(e, t);
91
+ }
92
+ }
93
+ get(e, t) {
94
+ if (!l) return null;
95
+ let n = this.getInvoke(t);
96
+ e = c(e, [t?.version, this.options.version]);
97
+ let r = this[n].getItem(e) || window[n].getItem(e);
98
+ return this.options.get(r);
99
+ }
100
+ remove(e, t) {
101
+ if (!l) return;
102
+ let n = this.getInvoke(t);
103
+ e = c(e, [t?.version, this.options.version]), this[n].removeItem(e), window[n].removeItem(e);
104
+ }
105
+ }(), d = (() => {
106
+ try {
107
+ return window.indexedDB.open, !0;
108
+ } catch {
109
+ return !1;
110
+ }
111
+ })(), f = class extends r {
112
+ timestramp = (/* @__PURE__ */ new Date()).getTime();
113
+ count = 0;
114
+ db = null;
115
+ pending = [];
116
+ constructor(e) {
117
+ super(), this.options = {
118
+ ...this.options,
119
+ keyPath: "__id",
120
+ name: "default-db",
121
+ storeName: "default-store",
122
+ version: 1
123
+ }, e && this.configure(e);
124
+ }
125
+ getUid() {
126
+ return `${this.timestramp}${this.count++}`;
127
+ }
128
+ configure(e) {
129
+ super.configure(e), typeof this.options.version == "string" && (this.options.version = parseInt(this.options.version, 10));
130
+ }
131
+ concurrent(e) {
132
+ let t = new Promise((t, n) => {
133
+ e().then(t).catch(n);
134
+ });
135
+ return this.pending.push(t), t.finally(() => this.close(t)), t;
136
+ }
137
+ async task(e) {
138
+ return new Promise((t, n) => {
139
+ e.onsuccess = t, e.onerror = n;
140
+ });
141
+ }
142
+ async close(e) {
143
+ if (e) this.pending = this.pending.filter((t) => t !== e);
144
+ else {
145
+ let e = async (t) => {
146
+ t.length && (await Promise.allSettled(t), await e(this.pending));
147
+ };
148
+ await e(this.pending);
149
+ }
150
+ if (!this.pending.length && this.db) {
151
+ let e = this.db;
152
+ this.db = null, (await e).close();
153
+ }
154
+ }
155
+ openDatabase() {
156
+ return this.db = this.db || (async () => {
157
+ let { name: e, version: t, keyPath: n, storeName: r } = this.options, i = () => new Promise((i, a) => {
158
+ let o = window.indexedDB.open(e, t);
159
+ o.onsuccess = () => {
160
+ i(o.result);
161
+ }, o.onerror = () => {
162
+ a(/* @__PURE__ */ Error("IndexedDB Open Failed. DeleteDatabase first!"));
163
+ }, o.onupgradeneeded = () => {
164
+ let e = o.result;
165
+ e.objectStoreNames.contains(r) && e.deleteObjectStore(r), e.createObjectStore(r, { keyPath: n });
166
+ };
167
+ }), a;
168
+ for (let e = 0; e < 3; e++) {
169
+ try {
170
+ a = await i();
171
+ } catch {}
172
+ /* istanbul ignore next -- @preserve */
173
+ if (a || e === 2) break;
174
+ }
175
+ return a ||= (await this.deleteDatabase(), await i()), a;
176
+ })(), this.db;
177
+ }
178
+ async openObjectStore(e) {
179
+ let { storeName: t } = this.options;
180
+ return (await this.openDatabase()).transaction([t], e || "readwrite").objectStore(t);
181
+ }
182
+ async deleteDatabase() {
183
+ let { name: e } = this.options, t = window.indexedDB.deleteDatabase(e);
184
+ await new Promise((e, n) => {
185
+ t.onsuccess = e, t.onerror = n;
186
+ });
187
+ }
188
+ write(e) {
189
+ return this.concurrent(async () => {
190
+ let { keyPath: t } = this.options, n = await this.openObjectStore(), r = {
191
+ [t]: this.getUid(),
192
+ ...e
193
+ }, i = n.add(r);
194
+ return await new Promise((e, t) => {
195
+ i.onsuccess = e, i.onerror = t;
196
+ }), r;
197
+ });
198
+ }
199
+ read(e) {
200
+ return this.concurrent(async () => {
201
+ let t = (await this.openObjectStore()).get(e);
202
+ return await this.task(t), t.result;
203
+ });
204
+ }
205
+ update(e, t) {
206
+ return this.concurrent(async () => {
207
+ let { keyPath: n } = this.options, r = await this.openObjectStore(), i = {
208
+ [n]: e,
209
+ ...t
210
+ }, a = r.put(i);
211
+ return await this.task(a), i;
212
+ });
213
+ }
214
+ async delete(e) {
215
+ return this.concurrent(async () => {
216
+ let t = (await this.openObjectStore()).delete(e);
217
+ await this.task(t);
218
+ });
219
+ }
220
+ search() {
221
+ return this.concurrent(async () => {
222
+ let e = (await this.openObjectStore()).openCursor(), t = [];
223
+ return await new Promise((n, r) => {
224
+ e.onsuccess = () => {
225
+ let r = e.result;
226
+ r ? (t.push(r.value), r.continue()) : n(t);
227
+ }, e.onerror = r;
228
+ }), t;
229
+ });
230
+ }
231
+ async get(e) {
232
+ if (!d) return null;
233
+ let t = await this.read(e);
234
+ return this.options.get(t ? t.data : null);
235
+ }
236
+ async set(e, t) {
237
+ d && await this.update(e, { data: this.options.set(typeof t == "string" ? t : JSON.stringify(t)) });
238
+ }
239
+ async remove(e) {
240
+ d && await this.delete(e);
241
+ }
242
+ }, p = new f();
243
+ //#endregion
244
+ export { n as a, u as i, p as n, f as r, a 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-DN0sqx7H.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 { Device as y } from "./dist-kiZUqqzR.js";
14
+ import { t as b } from "./dist-DF4kisl2.js";
15
+ import { t as x } from "./dist-oZ12SGqg.js";
16
+ import { t as S } from "./dist-DlmO7OlF.js";
17
+ export { t as $, _ as Cookie, y 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, b as Route, o as RuleHelper, x as Shared, m as Storage, d as Task, S as Unicode, e as Utils, s as Validator, r as Wheel };