@kong-ui-public/entities-plugins 9.263.1 → 9.264.0

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 (57) hide show
  1. package/dist/entities-plugins.es.js +6549 -6521
  2. package/dist/entities-plugins.umd.js +116 -116
  3. package/dist/filler/cypress/index.js +1 -1
  4. package/dist/filler/field-walker-C98yyxw9.js +22105 -0
  5. package/dist/filler/packages/entities/entities-plugins/src/components/free-form/shared/composables/field.d.ts +3 -1
  6. package/dist/filler/packages/entities/entities-plugins/src/components/free-form/shared/composables/field.d.ts.map +1 -1
  7. package/dist/filler/packages/entities/entities-plugins/src/components/free-form/shared/composables/form-context.d.ts +6 -4
  8. package/dist/filler/packages/entities/entities-plugins/src/components/free-form/shared/composables/form-context.d.ts.map +1 -1
  9. package/dist/filler/packages/entities/entities-plugins/src/components/free-form/shared/composables/schema.d.ts +12 -2
  10. package/dist/filler/packages/entities/entities-plugins/src/components/free-form/shared/composables/schema.d.ts.map +1 -1
  11. package/dist/filler/packages/entities/entities-plugins/src/components/free-form/shared/composables/useMapField.d.ts +4 -1
  12. package/dist/filler/packages/entities/entities-plugins/src/components/free-form/shared/composables/useMapField.d.ts.map +1 -1
  13. package/dist/filler/packages/entities/entities-plugins/src/components/free-form/shared/types.d.ts +15 -0
  14. package/dist/filler/packages/entities/entities-plugins/src/components/free-form/shared/types.d.ts.map +1 -1
  15. package/dist/filler/playwright/index.js +1 -1
  16. package/dist/freeform/index.js +1040 -1019
  17. package/dist/freeform/style.css +1 -1
  18. package/dist/style.css +1 -1
  19. package/dist/types/components/free-form/plugins/datakit/CaCertificatesField.vue.d.ts.map +1 -1
  20. package/dist/types/components/free-form/plugins/datakit/flow-editor/FlowEditor.vue.d.ts.map +1 -1
  21. package/dist/types/components/free-form/plugins/openid-connect/PrincipalLookupSettings.vue.d.ts.map +1 -1
  22. package/dist/types/components/free-form/plugins/rate-limiting-advanced/RedisField.vue.d.ts.map +1 -1
  23. package/dist/types/components/free-form/plugins/rate-limiting-advanced/RequestLimitsForm.vue.d.ts.map +1 -1
  24. package/dist/types/components/free-form/plugins/service-protection/RedisField.vue.d.ts.map +1 -1
  25. package/dist/types/components/free-form/plugins/service-protection/RequestLimitsForm.vue.d.ts.map +1 -1
  26. package/dist/types/components/free-form/shared/ArrayField.vue.d.ts.map +1 -1
  27. package/dist/types/components/free-form/shared/CredentialSecretField.vue.d.ts +3 -3
  28. package/dist/types/components/free-form/shared/CredentialSecretField.vue.d.ts.map +1 -1
  29. package/dist/types/components/free-form/shared/EnumField.vue.d.ts +2 -2
  30. package/dist/types/components/free-form/shared/EnumField.vue.d.ts.map +1 -1
  31. package/dist/types/components/free-form/shared/ForeignField.vue.d.ts +2 -2
  32. package/dist/types/components/free-form/shared/ForeignField.vue.d.ts.map +1 -1
  33. package/dist/types/components/free-form/shared/Form.vue.d.ts +1 -0
  34. package/dist/types/components/free-form/shared/Form.vue.d.ts.map +1 -1
  35. package/dist/types/components/free-form/shared/JsonField.vue.d.ts +2 -2
  36. package/dist/types/components/free-form/shared/JsonField.vue.d.ts.map +1 -1
  37. package/dist/types/components/free-form/shared/NumberField.vue.d.ts +3 -3
  38. package/dist/types/components/free-form/shared/NumberField.vue.d.ts.map +1 -1
  39. package/dist/types/components/free-form/shared/ScopeEntityField.vue.d.ts.map +1 -1
  40. package/dist/types/components/free-form/shared/StringArrayField.vue.d.ts +3 -3
  41. package/dist/types/components/free-form/shared/StringArrayField.vue.d.ts.map +1 -1
  42. package/dist/types/components/free-form/shared/StringField.vue.d.ts +3 -3
  43. package/dist/types/components/free-form/shared/StringField.vue.d.ts.map +1 -1
  44. package/dist/types/components/free-form/shared/composables/field.d.ts +3 -1
  45. package/dist/types/components/free-form/shared/composables/field.d.ts.map +1 -1
  46. package/dist/types/components/free-form/shared/composables/form-context.d.ts +6 -4
  47. package/dist/types/components/free-form/shared/composables/form-context.d.ts.map +1 -1
  48. package/dist/types/components/free-form/shared/composables/schema.d.ts +12 -2
  49. package/dist/types/components/free-form/shared/composables/schema.d.ts.map +1 -1
  50. package/dist/types/components/free-form/shared/composables/useMapField.d.ts +4 -1
  51. package/dist/types/components/free-form/shared/composables/useMapField.d.ts.map +1 -1
  52. package/dist/types/components/free-form/shared/layout/PluginConfigurationForm.vue.d.ts +1 -0
  53. package/dist/types/components/free-form/shared/layout/PluginConfigurationForm.vue.d.ts.map +1 -1
  54. package/dist/types/components/free-form/shared/types.d.ts +15 -0
  55. package/dist/types/components/free-form/shared/types.d.ts.map +1 -1
  56. package/package.json +7 -7
  57. package/dist/filler/field-walker-DBmR0kkP.js +0 -4915
@@ -1,4915 +0,0 @@
1
- import { get as $s, uniqueId as ao, isEqual as an, omit as co, cloneDeep as ls, isFunction as as } from "lodash-es";
2
- const xc = {
3
- // Common
4
- field: (t) => `[data-testid="ff-${t}"]`,
5
- label: (t) => `[data-testid="ff-label-${t}"]`,
6
- // EnumField
7
- selectTrigger: (t) => `[data-testid="ff-enum-${t}-items"]`,
8
- multiSelectItem: (t) => `[data-testid="multiselect-item-${t}"]`,
9
- selectItem: (t) => `[data-testid="select-item-${t}"]`,
10
- // ArrayField
11
- array: (t) => `[data-testid="ff-array-${t}"]`,
12
- arrayTabContainer: (t) => `[data-appearance="tabs"][data-testid="ff-array-${t}"]`,
13
- arrayBasicContainer: (t) => `[data-testid="ff-array-${t}"]:not([data-appearance="tabs"])`,
14
- arrayTabs: (t) => `[data-testid="ff-array-tabs-${t}"]`,
15
- arrayItem: (t, e) => `[data-testid="ff-array-item-${t}.${e}"]`,
16
- arrayAddBtn: (t) => `[data-testid="ff-add-item-btn-${t}"]`,
17
- arrayRemoveBtns: (t) => `[data-testid^="ff-array-remove-item-btn-${t}"]`,
18
- arrayRemoveBtn: (t, e) => `[data-testid="ff-array-remove-item-btn-${t}.${e}"]`,
19
- // ObjectField
20
- object: (t) => `[data-testid="ff-object-${t}"]`,
21
- objectToggleBtn: (t) => `[data-testid="ff-object-toggle-btn-${t}"]`,
22
- objectSwitch: (t) => `[data-testid="ff-object-switch-${t}"]`,
23
- objectContent: (t) => `[data-testid="ff-object-content-${t}"]`,
24
- // MapField
25
- map: (t) => `[data-testid="ff-map-${t}"]`,
26
- mapContainer: (t, e) => `[data-testid="ff-map-container-${t}.${e}"]`,
27
- mapKey: (t, e) => `[data-testid="ff-map-key-${t}.${e}"]`,
28
- mapRemoveBtns: (t) => `[data-testid^="ff-map-remove-btn-${t}"]`,
29
- mapRemoveBtn: (t, e) => `[data-testid="ff-map-remove-btn-${t}.${e}"]`,
30
- mapAddBtn: (t) => `[data-testid="ff-map-add-btn-${t}"]`,
31
- // StringArrayField
32
- tag: (t) => `[data-testid="ff-tag-${t}"]`,
33
- tagInput: (t) => `[data-testid="ff-tag-${t}"] input`,
34
- // JsonField
35
- json: (t) => `[data-testid="ff-json-${t}"]`
36
- };
37
- // @__NO_SIDE_EFFECTS__
38
- function uo(t) {
39
- const e = /* @__PURE__ */ Object.create(null);
40
- for (const n of t.split(",")) e[n] = 1;
41
- return (n) => n in e;
42
- }
43
- const Ct = process.env.NODE_ENV !== "production" ? Object.freeze({}) : {};
44
- process.env.NODE_ENV !== "production" && Object.freeze([]);
45
- const ft = () => {
46
- }, fo = (t) => t.charCodeAt(0) === 111 && t.charCodeAt(1) === 110 && // uppercase letter
47
- (t.charCodeAt(2) > 122 || t.charCodeAt(2) < 97), po = (t) => t.startsWith("onUpdate:"), Ne = Object.assign, ho = Object.prototype.hasOwnProperty, ir = (t, e) => ho.call(t, e), X = Array.isArray, pt = (t) => wn(t) === "[object Map]", go = (t) => wn(t) === "[object Set]", te = (t) => typeof t == "function", Ie = (t) => typeof t == "string", Ke = (t) => typeof t == "symbol", ae = (t) => t !== null && typeof t == "object", mo = (t) => (ae(t) || te(t)) && te(t.then) && te(t.catch), _o = Object.prototype.toString, wn = (t) => _o.call(t), Ls = (t) => wn(t).slice(8, -1), bo = (t) => wn(t) === "[object Object]", En = (t) => Ie(t) && t !== "NaN" && t[0] !== "-" && "" + parseInt(t, 10) === t, zs = (t) => {
48
- const e = /* @__PURE__ */ Object.create(null);
49
- return ((n) => e[n] || (e[n] = t(n)));
50
- }, Fs = zs((t) => t.charAt(0).toUpperCase() + t.slice(1)), yo = zs(
51
- (t) => t ? `on${Fs(t)}` : ""
52
- ), Se = (t, e) => !Object.is(t, e);
53
- let cs;
54
- const Tn = () => cs || (cs = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {});
55
- function _r(t) {
56
- if (X(t)) {
57
- const e = {};
58
- for (let n = 0; n < t.length; n++) {
59
- const r = t[n], s = Ie(r) ? ko(r) : _r(r);
60
- if (s)
61
- for (const i in s)
62
- e[i] = s[i];
63
- }
64
- return e;
65
- } else if (Ie(t) || ae(t))
66
- return t;
67
- }
68
- const wo = /;(?![^(]*\))/g, Eo = /:([^]+)/, To = /\/\*[^]*?\*\//g;
69
- function ko(t) {
70
- const e = {};
71
- return t.replace(To, "").split(wo).forEach((n) => {
72
- if (n) {
73
- const r = n.split(Eo);
74
- r.length > 1 && (e[r[0].trim()] = r[1].trim());
75
- }
76
- }), e;
77
- }
78
- function br(t) {
79
- let e = "";
80
- if (Ie(t))
81
- e = t;
82
- else if (X(t))
83
- for (let n = 0; n < t.length; n++) {
84
- const r = br(t[n]);
85
- r && (e += r + " ");
86
- }
87
- else if (ae(t))
88
- for (const n in t)
89
- t[n] && (e += n + " ");
90
- return e.trim();
91
- }
92
- function ve(t, ...e) {
93
- console.warn(`[Vue warn] ${t}`, ...e);
94
- }
95
- let xo;
96
- function js() {
97
- return xo;
98
- }
99
- let $;
100
- const Kn = /* @__PURE__ */ new WeakSet();
101
- class So {
102
- constructor(e) {
103
- this.fn = e, this.deps = void 0, this.depsTail = void 0, this.flags = 5, this.next = void 0, this.cleanup = void 0, this.scheduler = void 0;
104
- }
105
- pause() {
106
- this.flags |= 64;
107
- }
108
- resume() {
109
- this.flags & 64 && (this.flags &= -65, Kn.has(this) && (Kn.delete(this), this.trigger()));
110
- }
111
- /**
112
- * @internal
113
- */
114
- notify() {
115
- this.flags & 2 && !(this.flags & 32) || this.flags & 8 || Hs(this);
116
- }
117
- run() {
118
- if (!(this.flags & 1))
119
- return this.fn();
120
- this.flags |= 2, us(this), Us(this);
121
- const e = $, n = we;
122
- $ = this, we = !0;
123
- try {
124
- return this.fn();
125
- } finally {
126
- process.env.NODE_ENV !== "production" && $ !== this && ve(
127
- "Active effect was not restored correctly - this is likely a Vue internal bug."
128
- ), Bs(this), $ = e, we = n, this.flags &= -3;
129
- }
130
- }
131
- stop() {
132
- if (this.flags & 1) {
133
- for (let e = this.deps; e; e = e.nextDep)
134
- Er(e);
135
- this.deps = this.depsTail = void 0, us(this), this.onStop && this.onStop(), this.flags &= -2;
136
- }
137
- }
138
- trigger() {
139
- this.flags & 64 ? Kn.add(this) : this.scheduler ? this.scheduler() : this.runIfDirty();
140
- }
141
- /**
142
- * @internal
143
- */
144
- runIfDirty() {
145
- or(this) && this.run();
146
- }
147
- get dirty() {
148
- return or(this);
149
- }
150
- }
151
- let Vs = 0, Nt, It;
152
- function Hs(t, e = !1) {
153
- if (t.flags |= 8, e) {
154
- t.next = It, It = t;
155
- return;
156
- }
157
- t.next = Nt, Nt = t;
158
- }
159
- function yr() {
160
- Vs++;
161
- }
162
- function wr() {
163
- if (--Vs > 0)
164
- return;
165
- if (It) {
166
- let e = It;
167
- for (It = void 0; e; ) {
168
- const n = e.next;
169
- e.next = void 0, e.flags &= -9, e = n;
170
- }
171
- }
172
- let t;
173
- for (; Nt; ) {
174
- let e = Nt;
175
- for (Nt = void 0; e; ) {
176
- const n = e.next;
177
- if (e.next = void 0, e.flags &= -9, e.flags & 1)
178
- try {
179
- e.trigger();
180
- } catch (r) {
181
- t || (t = r);
182
- }
183
- e = n;
184
- }
185
- }
186
- if (t) throw t;
187
- }
188
- function Us(t) {
189
- for (let e = t.deps; e; e = e.nextDep)
190
- e.version = -1, e.prevActiveLink = e.dep.activeLink, e.dep.activeLink = e;
191
- }
192
- function Bs(t) {
193
- let e, n = t.depsTail, r = n;
194
- for (; r; ) {
195
- const s = r.prevDep;
196
- r.version === -1 ? (r === n && (n = s), Er(r), vo(r)) : e = r, r.dep.activeLink = r.prevActiveLink, r.prevActiveLink = void 0, r = s;
197
- }
198
- t.deps = e, t.depsTail = n;
199
- }
200
- function or(t) {
201
- for (let e = t.deps; e; e = e.nextDep)
202
- if (e.dep.version !== e.version || e.dep.computed && (Ws(e.dep.computed) || e.dep.version !== e.version))
203
- return !0;
204
- return !!t._dirty;
205
- }
206
- function Ws(t) {
207
- if (t.flags & 4 && !(t.flags & 16) || (t.flags &= -17, t.globalVersion === Mt) || (t.globalVersion = Mt, !t.isSSR && t.flags & 128 && (!t.deps && !t._dirty || !or(t))))
208
- return;
209
- t.flags |= 2;
210
- const e = t.dep, n = $, r = we;
211
- $ = t, we = !0;
212
- try {
213
- Us(t);
214
- const s = t.fn(t._value);
215
- (e.version === 0 || Se(s, t._value)) && (t.flags |= 128, t._value = s, e.version++);
216
- } catch (s) {
217
- throw e.version++, s;
218
- } finally {
219
- $ = n, we = r, Bs(t), t.flags &= -3;
220
- }
221
- }
222
- function Er(t, e = !1) {
223
- const { dep: n, prevSub: r, nextSub: s } = t;
224
- if (r && (r.nextSub = s, t.prevSub = void 0), s && (s.prevSub = r, t.nextSub = void 0), process.env.NODE_ENV !== "production" && n.subsHead === t && (n.subsHead = s), n.subs === t && (n.subs = r, !r && n.computed)) {
225
- n.computed.flags &= -5;
226
- for (let i = n.computed.deps; i; i = i.nextDep)
227
- Er(i, !0);
228
- }
229
- !e && !--n.sc && n.map && n.map.delete(n.key);
230
- }
231
- function vo(t) {
232
- const { prevDep: e, nextDep: n } = t;
233
- e && (e.nextDep = n, t.prevDep = void 0), n && (n.prevDep = e, t.nextDep = void 0);
234
- }
235
- let we = !0;
236
- const Gs = [];
237
- function _t() {
238
- Gs.push(we), we = !1;
239
- }
240
- function bt() {
241
- const t = Gs.pop();
242
- we = t === void 0 ? !0 : t;
243
- }
244
- function us(t) {
245
- const { cleanup: e } = t;
246
- if (t.cleanup = void 0, e) {
247
- const n = $;
248
- $ = void 0;
249
- try {
250
- e();
251
- } finally {
252
- $ = n;
253
- }
254
- }
255
- }
256
- let Mt = 0;
257
- class Ao {
258
- constructor(e, n) {
259
- this.sub = e, this.dep = n, this.version = n.version, this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
260
- }
261
- }
262
- class Tr {
263
- // TODO isolatedDeclarations "__v_skip"
264
- constructor(e) {
265
- this.computed = e, this.version = 0, this.activeLink = void 0, this.subs = void 0, this.map = void 0, this.key = void 0, this.sc = 0, this.__v_skip = !0, process.env.NODE_ENV !== "production" && (this.subsHead = void 0);
266
- }
267
- track(e) {
268
- if (!$ || !we || $ === this.computed)
269
- return;
270
- let n = this.activeLink;
271
- if (n === void 0 || n.sub !== $)
272
- n = this.activeLink = new Ao($, this), $.deps ? (n.prevDep = $.depsTail, $.depsTail.nextDep = n, $.depsTail = n) : $.deps = $.depsTail = n, qs(n);
273
- else if (n.version === -1 && (n.version = this.version, n.nextDep)) {
274
- const r = n.nextDep;
275
- r.prevDep = n.prevDep, n.prevDep && (n.prevDep.nextDep = r), n.prevDep = $.depsTail, n.nextDep = void 0, $.depsTail.nextDep = n, $.depsTail = n, $.deps === n && ($.deps = r);
276
- }
277
- return process.env.NODE_ENV !== "production" && $.onTrack && $.onTrack(
278
- Ne(
279
- {
280
- effect: $
281
- },
282
- e
283
- )
284
- ), n;
285
- }
286
- trigger(e) {
287
- this.version++, Mt++, this.notify(e);
288
- }
289
- notify(e) {
290
- yr();
291
- try {
292
- if (process.env.NODE_ENV !== "production")
293
- for (let n = this.subsHead; n; n = n.nextSub)
294
- n.sub.onTrigger && !(n.sub.flags & 8) && n.sub.onTrigger(
295
- Ne(
296
- {
297
- effect: n.sub
298
- },
299
- e
300
- )
301
- );
302
- for (let n = this.subs; n; n = n.prevSub)
303
- n.sub.notify() && n.sub.dep.notify();
304
- } finally {
305
- wr();
306
- }
307
- }
308
- }
309
- function qs(t) {
310
- if (t.dep.sc++, t.sub.flags & 4) {
311
- const e = t.dep.computed;
312
- if (e && !t.dep.subs) {
313
- e.flags |= 20;
314
- for (let r = e.deps; r; r = r.nextDep)
315
- qs(r);
316
- }
317
- const n = t.dep.subs;
318
- n !== t && (t.prevSub = n, n && (n.nextSub = t)), process.env.NODE_ENV !== "production" && t.dep.subsHead === void 0 && (t.dep.subsHead = t), t.dep.subs = t;
319
- }
320
- }
321
- const pn = /* @__PURE__ */ new WeakMap(), Ge = /* @__PURE__ */ Symbol(
322
- process.env.NODE_ENV !== "production" ? "Object iterate" : ""
323
- ), lr = /* @__PURE__ */ Symbol(
324
- process.env.NODE_ENV !== "production" ? "Map keys iterate" : ""
325
- ), Pt = /* @__PURE__ */ Symbol(
326
- process.env.NODE_ENV !== "production" ? "Array iterate" : ""
327
- );
328
- function ne(t, e, n) {
329
- if (we && $) {
330
- let r = pn.get(t);
331
- r || pn.set(t, r = /* @__PURE__ */ new Map());
332
- let s = r.get(n);
333
- s || (r.set(n, s = new Tr()), s.map = r, s.key = n), process.env.NODE_ENV !== "production" ? s.track({
334
- target: t,
335
- type: e,
336
- key: n
337
- }) : s.track();
338
- }
339
- }
340
- function Fe(t, e, n, r, s, i) {
341
- const o = pn.get(t);
342
- if (!o) {
343
- Mt++;
344
- return;
345
- }
346
- const a = (c) => {
347
- c && (process.env.NODE_ENV !== "production" ? c.trigger({
348
- target: t,
349
- type: e,
350
- key: n,
351
- newValue: r,
352
- oldValue: s,
353
- oldTarget: i
354
- }) : c.trigger());
355
- };
356
- if (yr(), e === "clear")
357
- o.forEach(a);
358
- else {
359
- const c = X(t), p = c && En(n);
360
- if (c && n === "length") {
361
- const h = Number(r);
362
- o.forEach((u, d) => {
363
- (d === "length" || d === Pt || !Ke(d) && d >= h) && a(u);
364
- });
365
- } else
366
- switch ((n !== void 0 || o.has(void 0)) && a(o.get(n)), p && a(o.get(Pt)), e) {
367
- case "add":
368
- c ? p && a(o.get("length")) : (a(o.get(Ge)), pt(t) && a(o.get(lr)));
369
- break;
370
- case "delete":
371
- c || (a(o.get(Ge)), pt(t) && a(o.get(lr)));
372
- break;
373
- case "set":
374
- pt(t) && a(o.get(Ge));
375
- break;
376
- }
377
- }
378
- wr();
379
- }
380
- function Ro(t, e) {
381
- const n = pn.get(t);
382
- return n && n.get(e);
383
- }
384
- function rt(t) {
385
- const e = /* @__PURE__ */ N(t);
386
- return e === t ? e : (ne(e, "iterate", Pt), /* @__PURE__ */ ce(t) ? e : e.map(De));
387
- }
388
- function kr(t) {
389
- return ne(t = /* @__PURE__ */ N(t), "iterate", Pt), t;
390
- }
391
- function xe(t, e) {
392
- return /* @__PURE__ */ Ae(t) ? Lt(/* @__PURE__ */ ht(t) ? De(e) : e) : De(e);
393
- }
394
- const Oo = {
395
- __proto__: null,
396
- [Symbol.iterator]() {
397
- return Yn(this, Symbol.iterator, (t) => xe(this, t));
398
- },
399
- concat(...t) {
400
- return rt(this).concat(
401
- ...t.map((e) => X(e) ? rt(e) : e)
402
- );
403
- },
404
- entries() {
405
- return Yn(this, "entries", (t) => (t[1] = xe(this, t[1]), t));
406
- },
407
- every(t, e) {
408
- return Re(this, "every", t, e, void 0, arguments);
409
- },
410
- filter(t, e) {
411
- return Re(
412
- this,
413
- "filter",
414
- t,
415
- e,
416
- (n) => n.map((r) => xe(this, r)),
417
- arguments
418
- );
419
- },
420
- find(t, e) {
421
- return Re(
422
- this,
423
- "find",
424
- t,
425
- e,
426
- (n) => xe(this, n),
427
- arguments
428
- );
429
- },
430
- findIndex(t, e) {
431
- return Re(this, "findIndex", t, e, void 0, arguments);
432
- },
433
- findLast(t, e) {
434
- return Re(
435
- this,
436
- "findLast",
437
- t,
438
- e,
439
- (n) => xe(this, n),
440
- arguments
441
- );
442
- },
443
- findLastIndex(t, e) {
444
- return Re(this, "findLastIndex", t, e, void 0, arguments);
445
- },
446
- // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement
447
- forEach(t, e) {
448
- return Re(this, "forEach", t, e, void 0, arguments);
449
- },
450
- includes(...t) {
451
- return Zn(this, "includes", t);
452
- },
453
- indexOf(...t) {
454
- return Zn(this, "indexOf", t);
455
- },
456
- join(t) {
457
- return rt(this).join(t);
458
- },
459
- // keys() iterator only reads `length`, no optimization required
460
- lastIndexOf(...t) {
461
- return Zn(this, "lastIndexOf", t);
462
- },
463
- map(t, e) {
464
- return Re(this, "map", t, e, void 0, arguments);
465
- },
466
- pop() {
467
- return xt(this, "pop");
468
- },
469
- push(...t) {
470
- return xt(this, "push", t);
471
- },
472
- reduce(t, ...e) {
473
- return fs(this, "reduce", t, e);
474
- },
475
- reduceRight(t, ...e) {
476
- return fs(this, "reduceRight", t, e);
477
- },
478
- shift() {
479
- return xt(this, "shift");
480
- },
481
- // slice could use ARRAY_ITERATE but also seems to beg for range tracking
482
- some(t, e) {
483
- return Re(this, "some", t, e, void 0, arguments);
484
- },
485
- splice(...t) {
486
- return xt(this, "splice", t);
487
- },
488
- toReversed() {
489
- return rt(this).toReversed();
490
- },
491
- toSorted(t) {
492
- return rt(this).toSorted(t);
493
- },
494
- toSpliced(...t) {
495
- return rt(this).toSpliced(...t);
496
- },
497
- unshift(...t) {
498
- return xt(this, "unshift", t);
499
- },
500
- values() {
501
- return Yn(this, "values", (t) => xe(this, t));
502
- }
503
- };
504
- function Yn(t, e, n) {
505
- const r = kr(t), s = r[e]();
506
- return r !== t && !/* @__PURE__ */ ce(t) && (s._next = s.next, s.next = () => {
507
- const i = s._next();
508
- return i.done || (i.value = n(i.value)), i;
509
- }), s;
510
- }
511
- const No = Array.prototype;
512
- function Re(t, e, n, r, s, i) {
513
- const o = kr(t), a = o !== t && !/* @__PURE__ */ ce(t), c = o[e];
514
- if (c !== No[e]) {
515
- const u = c.apply(t, i);
516
- return a ? De(u) : u;
517
- }
518
- let p = n;
519
- o !== t && (a ? p = function(u, d) {
520
- return n.call(this, xe(t, u), d, t);
521
- } : n.length > 2 && (p = function(u, d) {
522
- return n.call(this, u, d, t);
523
- }));
524
- const h = c.call(o, p, r);
525
- return a && s ? s(h) : h;
526
- }
527
- function fs(t, e, n, r) {
528
- const s = kr(t), i = s !== t && !/* @__PURE__ */ ce(t);
529
- let o = n, a = !1;
530
- s !== t && (i ? (a = r.length === 0, o = function(p, h, u) {
531
- return a && (a = !1, p = xe(t, p)), n.call(this, p, xe(t, h), u, t);
532
- }) : n.length > 3 && (o = function(p, h, u) {
533
- return n.call(this, p, h, u, t);
534
- }));
535
- const c = s[e](o, ...r);
536
- return a ? xe(t, c) : c;
537
- }
538
- function Zn(t, e, n) {
539
- const r = /* @__PURE__ */ N(t);
540
- ne(r, "iterate", Pt);
541
- const s = r[e](...n);
542
- return (s === -1 || s === !1) && /* @__PURE__ */ $t(n[0]) ? (n[0] = /* @__PURE__ */ N(n[0]), r[e](...n)) : s;
543
- }
544
- function xt(t, e, n = []) {
545
- _t(), yr();
546
- const r = (/* @__PURE__ */ N(t))[e].apply(t, n);
547
- return wr(), bt(), r;
548
- }
549
- const Io = /* @__PURE__ */ uo("__proto__,__v_isRef,__isVue"), Ks = new Set(
550
- /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((t) => t !== "arguments" && t !== "caller").map((t) => Symbol[t]).filter(Ke)
551
- );
552
- function Do(t) {
553
- Ke(t) || (t = String(t));
554
- const e = /* @__PURE__ */ N(this);
555
- return ne(e, "has", t), e.hasOwnProperty(t);
556
- }
557
- class Ys {
558
- constructor(e = !1, n = !1) {
559
- this._isReadonly = e, this._isShallow = n;
560
- }
561
- get(e, n, r) {
562
- if (n === "__v_skip") return e.__v_skip;
563
- const s = this._isReadonly, i = this._isShallow;
564
- if (n === "__v_isReactive")
565
- return !s;
566
- if (n === "__v_isReadonly")
567
- return s;
568
- if (n === "__v_isShallow")
569
- return i;
570
- if (n === "__v_raw")
571
- return r === (s ? i ? Ho : Qs : i ? Vo : Xs).get(e) || // receiver is not the reactive proxy, but has the same prototype
572
- // this means the receiver is a user proxy of the reactive proxy
573
- Object.getPrototypeOf(e) === Object.getPrototypeOf(r) ? e : void 0;
574
- const o = X(e);
575
- if (!s) {
576
- let c;
577
- if (o && (c = Oo[n]))
578
- return c;
579
- if (n === "hasOwnProperty")
580
- return Do;
581
- }
582
- const a = Reflect.get(
583
- e,
584
- n,
585
- // if this is a proxy wrapping a ref, return methods using the raw ref
586
- // as receiver so that we don't have to call `toRaw` on the ref in all
587
- // its class methods
588
- /* @__PURE__ */ se(e) ? e : r
589
- );
590
- if ((Ke(n) ? Ks.has(n) : Io(n)) || (s || ne(e, "get", n), i))
591
- return a;
592
- if (/* @__PURE__ */ se(a)) {
593
- const c = o && En(n) ? a : a.value;
594
- return s && ae(c) ? /* @__PURE__ */ cr(c) : c;
595
- }
596
- return ae(a) ? s ? /* @__PURE__ */ cr(a) : /* @__PURE__ */ kn(a) : a;
597
- }
598
- }
599
- class Co extends Ys {
600
- constructor(e = !1) {
601
- super(!1, e);
602
- }
603
- set(e, n, r, s) {
604
- let i = e[n];
605
- const o = X(e) && En(n);
606
- if (!this._isShallow) {
607
- const p = /* @__PURE__ */ Ae(i);
608
- if (!/* @__PURE__ */ ce(r) && !/* @__PURE__ */ Ae(r) && (i = /* @__PURE__ */ N(i), r = /* @__PURE__ */ N(r)), !o && /* @__PURE__ */ se(i) && !/* @__PURE__ */ se(r))
609
- return p ? (process.env.NODE_ENV !== "production" && ve(
610
- `Set operation on key "${String(n)}" failed: target is readonly.`,
611
- e[n]
612
- ), !0) : (i.value = r, !0);
613
- }
614
- const a = o ? Number(n) < e.length : ir(e, n), c = Reflect.set(
615
- e,
616
- n,
617
- r,
618
- /* @__PURE__ */ se(e) ? e : s
619
- );
620
- return e === /* @__PURE__ */ N(s) && (a ? Se(r, i) && Fe(e, "set", n, r, i) : Fe(e, "add", n, r)), c;
621
- }
622
- deleteProperty(e, n) {
623
- const r = ir(e, n), s = e[n], i = Reflect.deleteProperty(e, n);
624
- return i && r && Fe(e, "delete", n, void 0, s), i;
625
- }
626
- has(e, n) {
627
- const r = Reflect.has(e, n);
628
- return (!Ke(n) || !Ks.has(n)) && ne(e, "has", n), r;
629
- }
630
- ownKeys(e) {
631
- return ne(
632
- e,
633
- "iterate",
634
- X(e) ? "length" : Ge
635
- ), Reflect.ownKeys(e);
636
- }
637
- }
638
- class Mo extends Ys {
639
- constructor(e = !1) {
640
- super(!0, e);
641
- }
642
- set(e, n) {
643
- return process.env.NODE_ENV !== "production" && ve(
644
- `Set operation on key "${String(n)}" failed: target is readonly.`,
645
- e
646
- ), !0;
647
- }
648
- deleteProperty(e, n) {
649
- return process.env.NODE_ENV !== "production" && ve(
650
- `Delete operation on key "${String(n)}" failed: target is readonly.`,
651
- e
652
- ), !0;
653
- }
654
- }
655
- const Po = /* @__PURE__ */ new Co(), $o = /* @__PURE__ */ new Mo(), ar = (t) => t, tn = (t) => Reflect.getPrototypeOf(t);
656
- function Lo(t, e, n) {
657
- return function(...r) {
658
- const s = this.__v_raw, i = /* @__PURE__ */ N(s), o = pt(i), a = t === "entries" || t === Symbol.iterator && o, c = t === "keys" && o, p = s[t](...r), h = n ? ar : e ? Lt : De;
659
- return !e && ne(
660
- i,
661
- "iterate",
662
- c ? lr : Ge
663
- ), Ne(
664
- // inheriting all iterator properties
665
- Object.create(p),
666
- {
667
- // iterator protocol
668
- next() {
669
- const { value: u, done: d } = p.next();
670
- return d ? { value: u, done: d } : {
671
- value: a ? [h(u[0]), h(u[1])] : h(u),
672
- done: d
673
- };
674
- }
675
- }
676
- );
677
- };
678
- }
679
- function nn(t) {
680
- return function(...e) {
681
- if (process.env.NODE_ENV !== "production") {
682
- const n = e[0] ? `on key "${e[0]}" ` : "";
683
- ve(
684
- `${Fs(t)} operation ${n}failed: target is readonly.`,
685
- /* @__PURE__ */ N(this)
686
- );
687
- }
688
- return t === "delete" ? !1 : t === "clear" ? void 0 : this;
689
- };
690
- }
691
- function zo(t, e) {
692
- const n = {
693
- get(s) {
694
- const i = this.__v_raw, o = /* @__PURE__ */ N(i), a = /* @__PURE__ */ N(s);
695
- t || (Se(s, a) && ne(o, "get", s), ne(o, "get", a));
696
- const { has: c } = tn(o), p = e ? ar : t ? Lt : De;
697
- if (c.call(o, s))
698
- return p(i.get(s));
699
- if (c.call(o, a))
700
- return p(i.get(a));
701
- i !== o && i.get(s);
702
- },
703
- get size() {
704
- const s = this.__v_raw;
705
- return !t && ne(/* @__PURE__ */ N(s), "iterate", Ge), s.size;
706
- },
707
- has(s) {
708
- const i = this.__v_raw, o = /* @__PURE__ */ N(i), a = /* @__PURE__ */ N(s);
709
- return t || (Se(s, a) && ne(o, "has", s), ne(o, "has", a)), s === a ? i.has(s) : i.has(s) || i.has(a);
710
- },
711
- forEach(s, i) {
712
- const o = this, a = o.__v_raw, c = /* @__PURE__ */ N(a), p = e ? ar : t ? Lt : De;
713
- return !t && ne(c, "iterate", Ge), a.forEach((h, u) => s.call(i, p(h), p(u), o));
714
- }
715
- };
716
- return Ne(
717
- n,
718
- t ? {
719
- add: nn("add"),
720
- set: nn("set"),
721
- delete: nn("delete"),
722
- clear: nn("clear")
723
- } : {
724
- add(s) {
725
- const i = /* @__PURE__ */ N(this), o = tn(i), a = /* @__PURE__ */ N(s), c = !e && !/* @__PURE__ */ ce(s) && !/* @__PURE__ */ Ae(s) ? a : s;
726
- return o.has.call(i, c) || Se(s, c) && o.has.call(i, s) || Se(a, c) && o.has.call(i, a) || (i.add(c), Fe(i, "add", c, c)), this;
727
- },
728
- set(s, i) {
729
- !e && !/* @__PURE__ */ ce(i) && !/* @__PURE__ */ Ae(i) && (i = /* @__PURE__ */ N(i));
730
- const o = /* @__PURE__ */ N(this), { has: a, get: c } = tn(o);
731
- let p = a.call(o, s);
732
- p ? process.env.NODE_ENV !== "production" && ps(o, a, s) : (s = /* @__PURE__ */ N(s), p = a.call(o, s));
733
- const h = c.call(o, s);
734
- return o.set(s, i), p ? Se(i, h) && Fe(o, "set", s, i, h) : Fe(o, "add", s, i), this;
735
- },
736
- delete(s) {
737
- const i = /* @__PURE__ */ N(this), { has: o, get: a } = tn(i);
738
- let c = o.call(i, s);
739
- c ? process.env.NODE_ENV !== "production" && ps(i, o, s) : (s = /* @__PURE__ */ N(s), c = o.call(i, s));
740
- const p = a ? a.call(i, s) : void 0, h = i.delete(s);
741
- return c && Fe(i, "delete", s, void 0, p), h;
742
- },
743
- clear() {
744
- const s = /* @__PURE__ */ N(this), i = s.size !== 0, o = process.env.NODE_ENV !== "production" ? pt(s) ? new Map(s) : new Set(s) : void 0, a = s.clear();
745
- return i && Fe(
746
- s,
747
- "clear",
748
- void 0,
749
- void 0,
750
- o
751
- ), a;
752
- }
753
- }
754
- ), [
755
- "keys",
756
- "values",
757
- "entries",
758
- Symbol.iterator
759
- ].forEach((s) => {
760
- n[s] = Lo(s, t, e);
761
- }), n;
762
- }
763
- function Zs(t, e) {
764
- const n = zo(t, e);
765
- return (r, s, i) => s === "__v_isReactive" ? !t : s === "__v_isReadonly" ? t : s === "__v_raw" ? r : Reflect.get(
766
- ir(n, s) && s in r ? n : r,
767
- s,
768
- i
769
- );
770
- }
771
- const Fo = {
772
- get: /* @__PURE__ */ Zs(!1, !1)
773
- }, jo = {
774
- get: /* @__PURE__ */ Zs(!0, !1)
775
- };
776
- function ps(t, e, n) {
777
- const r = /* @__PURE__ */ N(n);
778
- if (r !== n && e.call(t, r)) {
779
- const s = Ls(t);
780
- ve(
781
- `Reactive ${s} contains both the raw and reactive versions of the same object${s === "Map" ? " as keys" : ""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`
782
- );
783
- }
784
- }
785
- const Xs = /* @__PURE__ */ new WeakMap(), Vo = /* @__PURE__ */ new WeakMap(), Qs = /* @__PURE__ */ new WeakMap(), Ho = /* @__PURE__ */ new WeakMap();
786
- function Uo(t) {
787
- switch (t) {
788
- case "Object":
789
- case "Array":
790
- return 1;
791
- case "Map":
792
- case "Set":
793
- case "WeakMap":
794
- case "WeakSet":
795
- return 2;
796
- default:
797
- return 0;
798
- }
799
- }
800
- // @__NO_SIDE_EFFECTS__
801
- function kn(t) {
802
- return /* @__PURE__ */ Ae(t) ? t : Js(
803
- t,
804
- !1,
805
- Po,
806
- Fo,
807
- Xs
808
- );
809
- }
810
- // @__NO_SIDE_EFFECTS__
811
- function cr(t) {
812
- return Js(
813
- t,
814
- !0,
815
- $o,
816
- jo,
817
- Qs
818
- );
819
- }
820
- function Js(t, e, n, r, s) {
821
- if (!ae(t))
822
- return process.env.NODE_ENV !== "production" && ve(
823
- `value cannot be made ${e ? "readonly" : "reactive"}: ${String(
824
- t
825
- )}`
826
- ), t;
827
- if (t.__v_raw && !(e && t.__v_isReactive) || t.__v_skip || !Object.isExtensible(t))
828
- return t;
829
- const i = s.get(t);
830
- if (i)
831
- return i;
832
- const o = Uo(Ls(t));
833
- if (o === 0)
834
- return t;
835
- const a = new Proxy(
836
- t,
837
- o === 2 ? r : n
838
- );
839
- return s.set(t, a), a;
840
- }
841
- // @__NO_SIDE_EFFECTS__
842
- function ht(t) {
843
- return /* @__PURE__ */ Ae(t) ? /* @__PURE__ */ ht(t.__v_raw) : !!(t && t.__v_isReactive);
844
- }
845
- // @__NO_SIDE_EFFECTS__
846
- function Ae(t) {
847
- return !!(t && t.__v_isReadonly);
848
- }
849
- // @__NO_SIDE_EFFECTS__
850
- function ce(t) {
851
- return !!(t && t.__v_isShallow);
852
- }
853
- // @__NO_SIDE_EFFECTS__
854
- function $t(t) {
855
- return t ? !!t.__v_raw : !1;
856
- }
857
- // @__NO_SIDE_EFFECTS__
858
- function N(t) {
859
- const e = t && t.__v_raw;
860
- return e ? /* @__PURE__ */ N(e) : t;
861
- }
862
- const De = (t) => ae(t) ? /* @__PURE__ */ kn(t) : t, Lt = (t) => ae(t) ? /* @__PURE__ */ cr(t) : t;
863
- // @__NO_SIDE_EFFECTS__
864
- function se(t) {
865
- return t ? t.__v_isRef === !0 : !1;
866
- }
867
- // @__NO_SIDE_EFFECTS__
868
- function ur(t) {
869
- return Bo(t, !1);
870
- }
871
- function Bo(t, e) {
872
- return /* @__PURE__ */ se(t) ? t : new Wo(t, e);
873
- }
874
- class Wo {
875
- constructor(e, n) {
876
- this.dep = new Tr(), this.__v_isRef = !0, this.__v_isShallow = !1, this._rawValue = n ? e : /* @__PURE__ */ N(e), this._value = n ? e : De(e), this.__v_isShallow = n;
877
- }
878
- get value() {
879
- return process.env.NODE_ENV !== "production" ? this.dep.track({
880
- target: this,
881
- type: "get",
882
- key: "value"
883
- }) : this.dep.track(), this._value;
884
- }
885
- set value(e) {
886
- const n = this._rawValue, r = this.__v_isShallow || /* @__PURE__ */ ce(e) || /* @__PURE__ */ Ae(e);
887
- e = r ? e : /* @__PURE__ */ N(e), Se(e, n) && (this._rawValue = e, this._value = r ? e : De(e), process.env.NODE_ENV !== "production" ? this.dep.trigger({
888
- target: this,
889
- type: "set",
890
- key: "value",
891
- newValue: e,
892
- oldValue: n
893
- }) : this.dep.trigger());
894
- }
895
- }
896
- function ei(t) {
897
- return /* @__PURE__ */ se(t) ? t.value : t;
898
- }
899
- function ye(t) {
900
- return te(t) ? t() : ei(t);
901
- }
902
- class Go {
903
- constructor(e, n, r) {
904
- this._object = e, this._defaultValue = r, this.__v_isRef = !0, this._value = void 0, this._key = Ke(n) ? n : String(n), this._raw = /* @__PURE__ */ N(e);
905
- let s = !0, i = e;
906
- if (!X(e) || Ke(this._key) || !En(this._key))
907
- do
908
- s = !/* @__PURE__ */ $t(i) || /* @__PURE__ */ ce(i);
909
- while (s && (i = i.__v_raw));
910
- this._shallow = s;
911
- }
912
- get value() {
913
- let e = this._object[this._key];
914
- return this._shallow && (e = ei(e)), this._value = e === void 0 ? this._defaultValue : e;
915
- }
916
- set value(e) {
917
- if (this._shallow && /* @__PURE__ */ se(this._raw[this._key])) {
918
- const n = this._object[this._key];
919
- if (/* @__PURE__ */ se(n)) {
920
- n.value = e;
921
- return;
922
- }
923
- }
924
- this._object[this._key] = e;
925
- }
926
- get dep() {
927
- return Ro(this._raw, this._key);
928
- }
929
- }
930
- class qo {
931
- constructor(e) {
932
- this._getter = e, this.__v_isRef = !0, this.__v_isReadonly = !0, this._value = void 0;
933
- }
934
- get value() {
935
- return this._value = this._getter();
936
- }
937
- }
938
- // @__NO_SIDE_EFFECTS__
939
- function Ko(t, e, n) {
940
- return /* @__PURE__ */ se(t) ? t : te(t) ? new qo(t) : ae(t) && arguments.length > 1 ? Yo(t, e, n) : /* @__PURE__ */ ur(t);
941
- }
942
- function Yo(t, e, n) {
943
- return new Go(t, e, n);
944
- }
945
- class Zo {
946
- constructor(e, n, r) {
947
- this.fn = e, this.setter = n, this._value = void 0, this.dep = new Tr(this), this.__v_isRef = !0, this.deps = void 0, this.depsTail = void 0, this.flags = 16, this.globalVersion = Mt - 1, this.next = void 0, this.effect = this, this.__v_isReadonly = !n, this.isSSR = r;
948
- }
949
- /**
950
- * @internal
951
- */
952
- notify() {
953
- if (this.flags |= 16, !(this.flags & 8) && // avoid infinite self recursion
954
- $ !== this)
955
- return Hs(this, !0), !0;
956
- process.env.NODE_ENV;
957
- }
958
- get value() {
959
- const e = process.env.NODE_ENV !== "production" ? this.dep.track({
960
- target: this,
961
- type: "get",
962
- key: "value"
963
- }) : this.dep.track();
964
- return Ws(this), e && (e.version = this.dep.version), this._value;
965
- }
966
- set value(e) {
967
- this.setter ? this.setter(e) : process.env.NODE_ENV !== "production" && ve("Write operation failed: computed value is readonly");
968
- }
969
- }
970
- // @__NO_SIDE_EFFECTS__
971
- function Xo(t, e, n = !1) {
972
- let r, s;
973
- te(t) ? r = t : (r = t.get, s = t.set);
974
- const i = new Zo(r, s, n);
975
- return process.env.NODE_ENV, i;
976
- }
977
- const rn = {}, hn = /* @__PURE__ */ new WeakMap();
978
- let We;
979
- function Qo(t, e = !1, n = We) {
980
- if (n) {
981
- let r = hn.get(n);
982
- r || hn.set(n, r = []), r.push(t);
983
- } else process.env.NODE_ENV !== "production" && !e && ve(
984
- "onWatcherCleanup() was called when there was no active watcher to associate with."
985
- );
986
- }
987
- function Jo(t, e, n = Ct) {
988
- const { immediate: r, deep: s, once: i, scheduler: o, augmentJob: a, call: c } = n, p = (_) => {
989
- (n.onWarn || ve)(
990
- "Invalid watch source: ",
991
- _,
992
- "A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types."
993
- );
994
- }, h = (_) => s ? _ : /* @__PURE__ */ ce(_) || s === !1 || s === 0 ? je(_, 1) : je(_);
995
- let u, d, m, y, A = !1, P = !1;
996
- if (/* @__PURE__ */ se(t) ? (d = () => t.value, A = /* @__PURE__ */ ce(t)) : /* @__PURE__ */ ht(t) ? (d = () => h(t), A = !0) : X(t) ? (P = !0, A = t.some((_) => /* @__PURE__ */ ht(_) || /* @__PURE__ */ ce(_)), d = () => t.map((_) => {
997
- if (/* @__PURE__ */ se(_))
998
- return _.value;
999
- if (/* @__PURE__ */ ht(_))
1000
- return h(_);
1001
- if (te(_))
1002
- return c ? c(_, 2) : _();
1003
- process.env.NODE_ENV !== "production" && p(_);
1004
- })) : te(t) ? e ? d = c ? () => c(t, 2) : t : d = () => {
1005
- if (m) {
1006
- _t();
1007
- try {
1008
- m();
1009
- } finally {
1010
- bt();
1011
- }
1012
- }
1013
- const _ = We;
1014
- We = u;
1015
- try {
1016
- return c ? c(t, 3, [y]) : t(y);
1017
- } finally {
1018
- We = _;
1019
- }
1020
- } : (d = ft, process.env.NODE_ENV !== "production" && p(t)), e && s) {
1021
- const _ = d, T = s === !0 ? 1 / 0 : s;
1022
- d = () => je(_(), T);
1023
- }
1024
- const j = () => {
1025
- u.stop();
1026
- };
1027
- if (i && e) {
1028
- const _ = e;
1029
- e = (...T) => {
1030
- const S = _(...T);
1031
- return j(), S;
1032
- };
1033
- }
1034
- let Y = P ? new Array(t.length).fill(rn) : rn;
1035
- const E = (_) => {
1036
- if (!(!(u.flags & 1) || !u.dirty && !_))
1037
- if (e) {
1038
- const T = u.run();
1039
- if (_ || s || A || (P ? T.some((S, w) => Se(S, Y[w])) : Se(T, Y))) {
1040
- m && m();
1041
- const S = We;
1042
- We = u;
1043
- try {
1044
- const w = [
1045
- T,
1046
- // pass undefined as the old value when it's changed for the first time
1047
- Y === rn ? void 0 : P && Y[0] === rn ? [] : Y,
1048
- y
1049
- ];
1050
- Y = T, c ? c(e, 3, w) : (
1051
- // @ts-expect-error
1052
- e(...w)
1053
- );
1054
- } finally {
1055
- We = S;
1056
- }
1057
- }
1058
- } else
1059
- u.run();
1060
- };
1061
- return a && a(E), u = new So(d), u.scheduler = o ? () => o(E, !1) : E, y = (_) => Qo(_, !1, u), m = u.onStop = () => {
1062
- const _ = hn.get(u);
1063
- if (_) {
1064
- if (c)
1065
- c(_, 4);
1066
- else
1067
- for (const T of _) T();
1068
- hn.delete(u);
1069
- }
1070
- }, process.env.NODE_ENV !== "production" && (u.onTrack = n.onTrack, u.onTrigger = n.onTrigger), e ? r ? E(!0) : Y = u.run() : o ? o(E.bind(null, !0), !0) : u.run(), j.pause = u.pause.bind(u), j.resume = u.resume.bind(u), j.stop = j, j;
1071
- }
1072
- function je(t, e = 1 / 0, n) {
1073
- if (e <= 0 || !ae(t) || t.__v_skip || (n = n || /* @__PURE__ */ new Map(), (n.get(t) || 0) >= e))
1074
- return t;
1075
- if (n.set(t, e), e--, /* @__PURE__ */ se(t))
1076
- je(t.value, e, n);
1077
- else if (X(t))
1078
- for (let r = 0; r < t.length; r++)
1079
- je(t[r], e, n);
1080
- else if (go(t) || pt(t))
1081
- t.forEach((r) => {
1082
- je(r, e, n);
1083
- });
1084
- else if (bo(t)) {
1085
- for (const r in t)
1086
- je(t[r], e, n);
1087
- for (const r of Object.getOwnPropertySymbols(t))
1088
- Object.prototype.propertyIsEnumerable.call(t, r) && je(t[r], e, n);
1089
- }
1090
- return t;
1091
- }
1092
- const qe = [];
1093
- function el(t) {
1094
- qe.push(t);
1095
- }
1096
- function tl() {
1097
- qe.pop();
1098
- }
1099
- let Xn = !1;
1100
- function K(t, ...e) {
1101
- if (Xn) return;
1102
- Xn = !0, _t();
1103
- const n = qe.length ? qe[qe.length - 1].component : null, r = n && n.appContext.config.warnHandler, s = nl();
1104
- if (r)
1105
- xn(
1106
- r,
1107
- n,
1108
- 11,
1109
- [
1110
- // eslint-disable-next-line no-restricted-syntax
1111
- t + e.map((i) => {
1112
- var o, a;
1113
- return (a = (o = i.toString) == null ? void 0 : o.call(i)) != null ? a : JSON.stringify(i);
1114
- }).join(""),
1115
- n && n.proxy,
1116
- s.map(
1117
- ({ vnode: i }) => `at <${bi(n, i.type)}>`
1118
- ).join(`
1119
- `),
1120
- s
1121
- ]
1122
- );
1123
- else {
1124
- const i = [`[Vue warn]: ${t}`, ...e];
1125
- s.length && i.push(`
1126
- `, ...rl(s)), console.warn(...i);
1127
- }
1128
- bt(), Xn = !1;
1129
- }
1130
- function nl() {
1131
- let t = qe[qe.length - 1];
1132
- if (!t)
1133
- return [];
1134
- const e = [];
1135
- for (; t; ) {
1136
- const n = e[0];
1137
- n && n.vnode === t ? n.recurseCount++ : e.push({
1138
- vnode: t,
1139
- recurseCount: 0
1140
- });
1141
- const r = t.component && t.component.parent;
1142
- t = r && r.vnode;
1143
- }
1144
- return e;
1145
- }
1146
- function rl(t) {
1147
- const e = [];
1148
- return t.forEach((n, r) => {
1149
- e.push(...r === 0 ? [] : [`
1150
- `], ...sl(n));
1151
- }), e;
1152
- }
1153
- function sl({ vnode: t, recurseCount: e }) {
1154
- const n = e > 0 ? `... (${e} recursive calls)` : "", r = t.component ? t.component.parent == null : !1, s = ` at <${bi(
1155
- t.component,
1156
- t.type,
1157
- r
1158
- )}`, i = ">" + n;
1159
- return t.props ? [s, ...il(t.props), i] : [s + i];
1160
- }
1161
- function il(t) {
1162
- const e = [], n = Object.keys(t);
1163
- return n.slice(0, 3).forEach((r) => {
1164
- e.push(...ti(r, t[r]));
1165
- }), n.length > 3 && e.push(" ..."), e;
1166
- }
1167
- function ti(t, e, n) {
1168
- return Ie(e) ? (e = JSON.stringify(e), n ? e : [`${t}=${e}`]) : typeof e == "number" || typeof e == "boolean" || e == null ? n ? e : [`${t}=${e}`] : /* @__PURE__ */ se(e) ? (e = ti(t, /* @__PURE__ */ N(e.value), !0), n ? e : [`${t}=Ref<`, e, ">"]) : te(e) ? [`${t}=fn${e.name ? `<${e.name}>` : ""}`] : (e = /* @__PURE__ */ N(e), n ? e : [`${t}=`, e]);
1169
- }
1170
- const xr = {
1171
- sp: "serverPrefetch hook",
1172
- bc: "beforeCreate hook",
1173
- c: "created hook",
1174
- bm: "beforeMount hook",
1175
- m: "mounted hook",
1176
- bu: "beforeUpdate hook",
1177
- u: "updated",
1178
- bum: "beforeUnmount hook",
1179
- um: "unmounted hook",
1180
- a: "activated hook",
1181
- da: "deactivated hook",
1182
- ec: "errorCaptured hook",
1183
- rtc: "renderTracked hook",
1184
- rtg: "renderTriggered hook",
1185
- 0: "setup function",
1186
- 1: "render function",
1187
- 2: "watcher getter",
1188
- 3: "watcher callback",
1189
- 4: "watcher cleanup function",
1190
- 5: "native event handler",
1191
- 6: "component event handler",
1192
- 7: "vnode hook",
1193
- 8: "directive hook",
1194
- 9: "transition hook",
1195
- 10: "app errorHandler",
1196
- 11: "app warnHandler",
1197
- 12: "ref function",
1198
- 13: "async component loader",
1199
- 14: "scheduler flush",
1200
- 15: "component update",
1201
- 16: "app unmount cleanup function"
1202
- };
1203
- function xn(t, e, n, r) {
1204
- try {
1205
- return r ? t(...r) : t();
1206
- } catch (s) {
1207
- vr(s, e, n);
1208
- }
1209
- }
1210
- function Sr(t, e, n, r) {
1211
- if (te(t)) {
1212
- const s = xn(t, e, n, r);
1213
- return s && mo(s) && s.catch((i) => {
1214
- vr(i, e, n);
1215
- }), s;
1216
- }
1217
- if (X(t)) {
1218
- const s = [];
1219
- for (let i = 0; i < t.length; i++)
1220
- s.push(Sr(t[i], e, n, r));
1221
- return s;
1222
- } else process.env.NODE_ENV !== "production" && K(
1223
- `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof t}`
1224
- );
1225
- }
1226
- function vr(t, e, n, r = !0) {
1227
- const s = e ? e.vnode : null, { errorHandler: i, throwUnhandledErrorInProduction: o } = e && e.appContext.config || Ct;
1228
- if (e) {
1229
- let a = e.parent;
1230
- const c = e.proxy, p = process.env.NODE_ENV !== "production" ? xr[n] : `https://vuejs.org/error-reference/#runtime-${n}`;
1231
- for (; a; ) {
1232
- const h = a.ec;
1233
- if (h) {
1234
- for (let u = 0; u < h.length; u++)
1235
- if (h[u](t, c, p) === !1)
1236
- return;
1237
- }
1238
- a = a.parent;
1239
- }
1240
- if (i) {
1241
- _t(), xn(i, null, 10, [
1242
- t,
1243
- c,
1244
- p
1245
- ]), bt();
1246
- return;
1247
- }
1248
- }
1249
- ol(t, n, s, r, o);
1250
- }
1251
- function ol(t, e, n, r = !0, s = !1) {
1252
- if (process.env.NODE_ENV !== "production") {
1253
- const i = xr[e];
1254
- if (n && el(n), K(`Unhandled error${i ? ` during execution of ${i}` : ""}`), n && tl(), r)
1255
- throw t;
1256
- console.error(t);
1257
- } else {
1258
- if (s)
1259
- throw t;
1260
- console.error(t);
1261
- }
1262
- }
1263
- const ge = [];
1264
- let Oe = -1;
1265
- const dt = [];
1266
- let ze = null, ot = 0;
1267
- const ll = /* @__PURE__ */ Promise.resolve();
1268
- let fr = null;
1269
- const al = 100;
1270
- function cl(t) {
1271
- let e = Oe + 1, n = ge.length;
1272
- for (; e < n; ) {
1273
- const r = e + n >>> 1, s = ge[r], i = zt(s);
1274
- i < t || i === t && s.flags & 2 ? e = r + 1 : n = r;
1275
- }
1276
- return e;
1277
- }
1278
- function ni(t) {
1279
- if (!(t.flags & 1)) {
1280
- const e = zt(t), n = ge[ge.length - 1];
1281
- !n || // fast path when the job id is larger than the tail
1282
- !(t.flags & 2) && e >= zt(n) ? ge.push(t) : ge.splice(cl(e), 0, t), t.flags |= 1, ri();
1283
- }
1284
- }
1285
- function ri() {
1286
- fr || (fr = ll.then(ii));
1287
- }
1288
- function si(t) {
1289
- X(t) ? dt.push(...t) : ze && t.id === -1 ? ze.splice(ot + 1, 0, t) : t.flags & 1 || (dt.push(t), t.flags |= 1), ri();
1290
- }
1291
- function ul(t) {
1292
- if (dt.length) {
1293
- const e = [...new Set(dt)].sort(
1294
- (n, r) => zt(n) - zt(r)
1295
- );
1296
- if (dt.length = 0, ze) {
1297
- ze.push(...e);
1298
- return;
1299
- }
1300
- for (ze = e, process.env.NODE_ENV !== "production" && (t = t || /* @__PURE__ */ new Map()), ot = 0; ot < ze.length; ot++) {
1301
- const n = ze[ot];
1302
- process.env.NODE_ENV !== "production" && oi(t, n) || (n.flags & 4 && (n.flags &= -2), n.flags & 8 || n(), n.flags &= -2);
1303
- }
1304
- ze = null, ot = 0;
1305
- }
1306
- }
1307
- const zt = (t) => t.id == null ? t.flags & 2 ? -1 : 1 / 0 : t.id;
1308
- function ii(t) {
1309
- process.env.NODE_ENV !== "production" && (t = t || /* @__PURE__ */ new Map());
1310
- const e = process.env.NODE_ENV !== "production" ? (n) => oi(t, n) : ft;
1311
- try {
1312
- for (Oe = 0; Oe < ge.length; Oe++) {
1313
- const n = ge[Oe];
1314
- if (n && !(n.flags & 8)) {
1315
- if (process.env.NODE_ENV !== "production" && e(n))
1316
- continue;
1317
- n.flags & 4 && (n.flags &= -2), xn(
1318
- n,
1319
- n.i,
1320
- n.i ? 15 : 14
1321
- ), n.flags & 4 || (n.flags &= -2);
1322
- }
1323
- }
1324
- } finally {
1325
- for (; Oe < ge.length; Oe++) {
1326
- const n = ge[Oe];
1327
- n && (n.flags &= -2);
1328
- }
1329
- Oe = -1, ge.length = 0, ul(t), fr = null, (ge.length || dt.length) && ii(t);
1330
- }
1331
- }
1332
- function oi(t, e) {
1333
- const n = t.get(e) || 0;
1334
- if (n > al) {
1335
- const r = e.i, s = r && _i(r.type);
1336
- return vr(
1337
- `Maximum recursive updates exceeded${s ? ` in component <${s}>` : ""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
1338
- null,
1339
- 10
1340
- ), !0;
1341
- }
1342
- return t.set(e, n + 1), !1;
1343
- }
1344
- const Qn = /* @__PURE__ */ new Map();
1345
- process.env.NODE_ENV !== "production" && (Tn().__VUE_HMR_RUNTIME__ = {
1346
- createRecord: Jn(fl),
1347
- rerender: Jn(pl),
1348
- reload: Jn(hl)
1349
- });
1350
- const dn = /* @__PURE__ */ new Map();
1351
- function fl(t, e) {
1352
- return dn.has(t) ? !1 : (dn.set(t, {
1353
- initialDef: gn(e),
1354
- instances: /* @__PURE__ */ new Set()
1355
- }), !0);
1356
- }
1357
- function gn(t) {
1358
- return yi(t) ? t.__vccOpts : t;
1359
- }
1360
- function pl(t, e) {
1361
- const n = dn.get(t);
1362
- n && (n.initialDef.render = e, [...n.instances].forEach((r) => {
1363
- e && (r.render = e, gn(r.type).render = e), r.renderCache = [], r.job.flags & 8 || r.update();
1364
- }));
1365
- }
1366
- function hl(t, e) {
1367
- const n = dn.get(t);
1368
- if (!n) return;
1369
- e = gn(e), hs(n.initialDef, e);
1370
- const r = [...n.instances];
1371
- for (let s = 0; s < r.length; s++) {
1372
- const i = r[s], o = gn(i.type);
1373
- let a = Qn.get(o);
1374
- a || (o !== n.initialDef && hs(o, e), Qn.set(o, a = /* @__PURE__ */ new Set())), a.add(i), i.appContext.propsCache.delete(i.type), i.appContext.emitsCache.delete(i.type), i.appContext.optionsCache.delete(i.type), i.ceReload ? (a.add(i), i.ceReload(e.styles), a.delete(i)) : i.parent ? ni(() => {
1375
- i.job.flags & 8 || (i.parent.update(), a.delete(i));
1376
- }) : i.appContext.reload ? i.appContext.reload() : typeof window < "u" ? window.location.reload() : console.warn(
1377
- "[HMR] Root or manually mounted instance modified. Full reload required."
1378
- ), i.root.ce && i !== i.root && i.root.ce._removeChildStyle(o);
1379
- }
1380
- si(() => {
1381
- Qn.clear();
1382
- });
1383
- }
1384
- function hs(t, e) {
1385
- Ne(t, e);
1386
- for (const n in t)
1387
- n !== "__file" && !(n in e) && delete t[n];
1388
- }
1389
- function Jn(t) {
1390
- return (e, n) => {
1391
- try {
1392
- return t(e, n);
1393
- } catch (r) {
1394
- console.error(r), console.warn(
1395
- "[HMR] Something went wrong during Vue component hot-reload. Full reload required."
1396
- );
1397
- }
1398
- };
1399
- }
1400
- let lt, sn = [];
1401
- function li(t, e) {
1402
- var n, r;
1403
- lt = t, lt ? (lt.enabled = !0, sn.forEach(({ event: s, args: i }) => lt.emit(s, ...i)), sn = []) : /* handle late devtools injection - only do this if we are in an actual */ /* browser environment to avoid the timer handle stalling test runner exit */ /* (#4815) */ typeof window < "u" && // some envs mock window but not fully
1404
- window.HTMLElement && // also exclude jsdom
1405
- // eslint-disable-next-line no-restricted-syntax
1406
- !((r = (n = window.navigator) == null ? void 0 : n.userAgent) != null && r.includes("jsdom")) ? ((e.__VUE_DEVTOOLS_HOOK_REPLAY__ = e.__VUE_DEVTOOLS_HOOK_REPLAY__ || []).push((i) => {
1407
- li(i, e);
1408
- }), setTimeout(() => {
1409
- lt || (e.__VUE_DEVTOOLS_HOOK_REPLAY__ = null, sn = []);
1410
- }, 3e3)) : sn = [];
1411
- }
1412
- let Ft = null, dl = null;
1413
- function ai(t, e) {
1414
- if (process.env.NODE_ENV !== "production" && (!he || he.isMounted) && K("provide() can only be used inside setup()."), he) {
1415
- let n = he.provides;
1416
- const r = he.parent && he.parent.provides;
1417
- r === n && (n = he.provides = Object.create(r)), n[t] = e;
1418
- }
1419
- }
1420
- function ci(t, e, n = !1) {
1421
- const r = yt();
1422
- if (r || fi) {
1423
- let s = r ? r.parent == null || r.ce ? r.vnode.appContext && r.vnode.appContext.provides : r.parent.provides : void 0;
1424
- if (s && t in s)
1425
- return s[t];
1426
- if (arguments.length > 1)
1427
- return n && te(e) ? e.call(r && r.proxy) : e;
1428
- process.env.NODE_ENV !== "production" && K(`injection "${String(t)}" not found.`);
1429
- } else process.env.NODE_ENV !== "production" && K("inject() can only be used inside setup() or functional components.");
1430
- }
1431
- function gl() {
1432
- return !!(yt() || fi);
1433
- }
1434
- const ml = /* @__PURE__ */ Symbol.for("v-scx"), _l = () => {
1435
- {
1436
- const t = ci(ml);
1437
- return t || process.env.NODE_ENV !== "production" && K(
1438
- "Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."
1439
- ), t;
1440
- }
1441
- };
1442
- function pr(t, e, n) {
1443
- return process.env.NODE_ENV !== "production" && !te(e) && K(
1444
- "`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."
1445
- ), bl(t, e, n);
1446
- }
1447
- function bl(t, e, n = Ct) {
1448
- const { immediate: r, deep: s, flush: i, once: o } = n;
1449
- process.env.NODE_ENV !== "production" && !e && (r !== void 0 && K(
1450
- 'watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'
1451
- ), s !== void 0 && K(
1452
- 'watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'
1453
- ), o !== void 0 && K(
1454
- 'watch() "once" option is only respected when using the watch(source, callback, options?) signature.'
1455
- ));
1456
- const a = Ne({}, n);
1457
- process.env.NODE_ENV !== "production" && (a.onWarn = K);
1458
- const c = e && r || !e && i !== "post";
1459
- let p;
1460
- if (jt) {
1461
- if (i === "sync") {
1462
- const m = _l();
1463
- p = m.__watcherHandles || (m.__watcherHandles = []);
1464
- } else if (!c) {
1465
- const m = () => {
1466
- };
1467
- return m.stop = ft, m.resume = ft, m.pause = ft, m;
1468
- }
1469
- }
1470
- const h = he;
1471
- a.call = (m, y, A) => Sr(m, h, y, A);
1472
- let u = !1;
1473
- i === "post" ? a.scheduler = (m) => {
1474
- Rl(m, h && h.suspense);
1475
- } : i !== "sync" && (u = !0, a.scheduler = (m, y) => {
1476
- y ? m() : ni(m);
1477
- }), a.augmentJob = (m) => {
1478
- e && (m.flags |= 4), u && (m.flags |= 2, h && (m.id = h.uid, m.i = h));
1479
- };
1480
- const d = Jo(t, e, a);
1481
- return jt && (p ? p.push(d) : c && d()), d;
1482
- }
1483
- const yl = (t) => t.__isTeleport;
1484
- function ui(t, e) {
1485
- t.shapeFlag & 6 && t.component ? (t.transition = e, ui(t.component.subTree, e)) : t.shapeFlag & 128 ? (t.ssContent.transition = e.clone(t.ssContent), t.ssFallback.transition = e.clone(t.ssFallback)) : t.transition = e;
1486
- }
1487
- Tn().requestIdleCallback;
1488
- Tn().cancelIdleCallback;
1489
- function wl(t, e, n = he, r = !1) {
1490
- if (n) {
1491
- const s = n[t] || (n[t] = []), i = e.__weh || (e.__weh = (...o) => {
1492
- _t();
1493
- const a = jl(n), c = Sr(e, n, t, o);
1494
- return a(), bt(), c;
1495
- });
1496
- return r ? s.unshift(i) : s.push(i), i;
1497
- } else if (process.env.NODE_ENV !== "production") {
1498
- const s = yo(xr[t].replace(/ hook$/, ""));
1499
- K(
1500
- `${s} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`
1501
- );
1502
- }
1503
- }
1504
- const El = (t) => (e, n = he) => {
1505
- (!jt || t === "sp") && wl(t, (...r) => e(...r), n);
1506
- }, Tl = El(
1507
- "bum"
1508
- ), kl = /* @__PURE__ */ Symbol.for("v-ndc"), xl = {};
1509
- process.env.NODE_ENV !== "production" && (xl.ownKeys = (t) => (K(
1510
- "Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."
1511
- ), Reflect.ownKeys(t)));
1512
- function Sl() {
1513
- return vl("useSlots").slots;
1514
- }
1515
- function vl(t) {
1516
- const e = yt();
1517
- return process.env.NODE_ENV !== "production" && !e && K(`${t}() called without active instance.`), e.setupContext || (e.setupContext = Hl(e));
1518
- }
1519
- let fi = null;
1520
- const Al = {}, pi = (t) => Object.getPrototypeOf(t) === Al, Rl = Nl, Ol = (t) => t.__isSuspense;
1521
- function Nl(t, e) {
1522
- e && e.pendingBranch ? X(t) ? e.effects.push(...t) : e.effects.push(t) : si(t);
1523
- }
1524
- const hi = /* @__PURE__ */ Symbol.for("v-fgt"), Il = /* @__PURE__ */ Symbol.for("v-txt"), Dl = /* @__PURE__ */ Symbol.for("v-cmt");
1525
- function Cl(t) {
1526
- return t ? t.__v_isVNode === !0 : !1;
1527
- }
1528
- const Ml = (...t) => gi(
1529
- ...t
1530
- ), di = ({ key: t }) => t ?? null, cn = ({
1531
- ref: t,
1532
- ref_key: e,
1533
- ref_for: n
1534
- }) => (typeof t == "number" && (t = "" + t), t != null ? Ie(t) || /* @__PURE__ */ se(t) || te(t) ? { i: Ft, r: t, k: e, f: !!n } : t : null);
1535
- function Pl(t, e = null, n = null, r = 0, s = null, i = t === hi ? 0 : 1, o = !1, a = !1) {
1536
- const c = {
1537
- __v_isVNode: !0,
1538
- __v_skip: !0,
1539
- type: t,
1540
- props: e,
1541
- key: e && di(e),
1542
- ref: e && cn(e),
1543
- scopeId: dl,
1544
- slotScopeIds: null,
1545
- children: n,
1546
- component: null,
1547
- suspense: null,
1548
- ssContent: null,
1549
- ssFallback: null,
1550
- dirs: null,
1551
- transition: null,
1552
- el: null,
1553
- anchor: null,
1554
- target: null,
1555
- targetStart: null,
1556
- targetAnchor: null,
1557
- staticCount: 0,
1558
- shapeFlag: i,
1559
- patchFlag: r,
1560
- dynamicProps: s,
1561
- dynamicChildren: null,
1562
- appContext: null,
1563
- ctx: Ft
1564
- };
1565
- return a ? (Ar(c, n), i & 128 && t.normalize(c)) : n && (c.shapeFlag |= Ie(n) ? 8 : 16), process.env.NODE_ENV !== "production" && c.key !== c.key && K("VNode created with invalid key (NaN). VNode type:", c.type), c;
1566
- }
1567
- const $l = process.env.NODE_ENV !== "production" ? Ml : gi;
1568
- function gi(t, e = null, n = null, r = 0, s = null, i = !1) {
1569
- if ((!t || t === kl) && (process.env.NODE_ENV !== "production" && !t && K(`Invalid vnode type when creating vnode: ${t}.`), t = Dl), Cl(t)) {
1570
- const a = mn(
1571
- t,
1572
- e,
1573
- !0
1574
- /* mergeRef: true */
1575
- );
1576
- return n && Ar(a, n), a.patchFlag = -2, a;
1577
- }
1578
- if (yi(t) && (t = t.__vccOpts), e) {
1579
- e = Ll(e);
1580
- let { class: a, style: c } = e;
1581
- a && !Ie(a) && (e.class = br(a)), ae(c) && (/* @__PURE__ */ $t(c) && !X(c) && (c = Ne({}, c)), e.style = _r(c));
1582
- }
1583
- const o = Ie(t) ? 1 : Ol(t) ? 128 : yl(t) ? 64 : ae(t) ? 4 : te(t) ? 2 : 0;
1584
- return process.env.NODE_ENV !== "production" && o & 4 && /* @__PURE__ */ $t(t) && (t = /* @__PURE__ */ N(t), K(
1585
- "Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",
1586
- `
1587
- Component that was made reactive: `,
1588
- t
1589
- )), Pl(
1590
- t,
1591
- e,
1592
- n,
1593
- r,
1594
- s,
1595
- o,
1596
- i,
1597
- !0
1598
- );
1599
- }
1600
- function Ll(t) {
1601
- return t ? /* @__PURE__ */ $t(t) || pi(t) ? Ne({}, t) : t : null;
1602
- }
1603
- function mn(t, e, n = !1, r = !1) {
1604
- const { props: s, ref: i, patchFlag: o, children: a, transition: c } = t, p = e ? Fl(s || {}, e) : s, h = {
1605
- __v_isVNode: !0,
1606
- __v_skip: !0,
1607
- type: t.type,
1608
- props: p,
1609
- key: p && di(p),
1610
- ref: e && e.ref ? (
1611
- // #2078 in the case of <component :is="vnode" ref="extra"/>
1612
- // if the vnode itself already has a ref, cloneVNode will need to merge
1613
- // the refs so the single vnode can be set on multiple refs
1614
- n && i ? X(i) ? i.concat(cn(e)) : [i, cn(e)] : cn(e)
1615
- ) : i,
1616
- scopeId: t.scopeId,
1617
- slotScopeIds: t.slotScopeIds,
1618
- children: process.env.NODE_ENV !== "production" && o === -1 && X(a) ? a.map(mi) : a,
1619
- target: t.target,
1620
- targetStart: t.targetStart,
1621
- targetAnchor: t.targetAnchor,
1622
- staticCount: t.staticCount,
1623
- shapeFlag: t.shapeFlag,
1624
- // if the vnode is cloned with extra props, we can no longer assume its
1625
- // existing patch flag to be reliable and need to add the FULL_PROPS flag.
1626
- // note: preserve flag for fragments since they use the flag for children
1627
- // fast paths only.
1628
- patchFlag: e && t.type !== hi ? o === -1 ? 16 : o | 16 : o,
1629
- dynamicProps: t.dynamicProps,
1630
- dynamicChildren: t.dynamicChildren,
1631
- appContext: t.appContext,
1632
- dirs: t.dirs,
1633
- transition: c,
1634
- // These should technically only be non-null on mounted VNodes. However,
1635
- // they *should* be copied for kept-alive vnodes. So we just always copy
1636
- // them since them being non-null during a mount doesn't affect the logic as
1637
- // they will simply be overwritten.
1638
- component: t.component,
1639
- suspense: t.suspense,
1640
- ssContent: t.ssContent && mn(t.ssContent),
1641
- ssFallback: t.ssFallback && mn(t.ssFallback),
1642
- placeholder: t.placeholder,
1643
- el: t.el,
1644
- anchor: t.anchor,
1645
- ctx: t.ctx,
1646
- ce: t.ce
1647
- };
1648
- return c && r && ui(
1649
- h,
1650
- c.clone(h)
1651
- ), h;
1652
- }
1653
- function mi(t) {
1654
- const e = mn(t);
1655
- return X(t.children) && (e.children = t.children.map(mi)), e;
1656
- }
1657
- function zl(t = " ", e = 0) {
1658
- return $l(Il, null, t, e);
1659
- }
1660
- function Ar(t, e) {
1661
- let n = 0;
1662
- const { shapeFlag: r } = t;
1663
- if (e == null)
1664
- e = null;
1665
- else if (X(e))
1666
- n = 16;
1667
- else if (typeof e == "object")
1668
- if (r & 65) {
1669
- const s = e.default;
1670
- s && (s._c && (s._d = !1), Ar(t, s()), s._c && (s._d = !0));
1671
- return;
1672
- } else
1673
- n = 32, !e._ && !pi(e) && (e._ctx = Ft);
1674
- else te(e) ? (e = { default: e, _ctx: Ft }, n = 32) : (e = String(e), r & 64 ? (n = 16, e = [zl(e)]) : n = 8);
1675
- t.children = e, t.shapeFlag |= n;
1676
- }
1677
- function Fl(...t) {
1678
- const e = {};
1679
- for (let n = 0; n < t.length; n++) {
1680
- const r = t[n];
1681
- for (const s in r)
1682
- if (s === "class")
1683
- e.class !== r.class && (e.class = br([e.class, r.class]));
1684
- else if (s === "style")
1685
- e.style = _r([e.style, r.style]);
1686
- else if (fo(s)) {
1687
- const i = e[s], o = r[s];
1688
- o && i !== o && !(X(i) && i.includes(o)) ? e[s] = i ? [].concat(i, o) : o : o == null && i == null && // mergeProps({ 'onUpdate:modelValue': undefined }) should not retain
1689
- // the model listener.
1690
- !po(s) && (e[s] = o);
1691
- } else s !== "" && (e[s] = r[s]);
1692
- }
1693
- return e;
1694
- }
1695
- let he = null;
1696
- const yt = () => he || Ft;
1697
- let hr;
1698
- {
1699
- const t = Tn(), e = (n, r) => {
1700
- let s;
1701
- return (s = t[n]) || (s = t[n] = []), s.push(r), (i) => {
1702
- s.length > 1 ? s.forEach((o) => o(i)) : s[0](i);
1703
- };
1704
- };
1705
- hr = e(
1706
- "__VUE_INSTANCE_SETTERS__",
1707
- (n) => he = n
1708
- ), e(
1709
- "__VUE_SSR_SETTERS__",
1710
- (n) => jt = n
1711
- );
1712
- }
1713
- const jl = (t) => {
1714
- const e = he;
1715
- return hr(t), t.scope.on(), () => {
1716
- t.scope.off(), hr(e);
1717
- };
1718
- };
1719
- let jt = !1;
1720
- const ds = process.env.NODE_ENV !== "production" ? {
1721
- get(t, e) {
1722
- return ne(t, "get", ""), t[e];
1723
- },
1724
- set() {
1725
- return K("setupContext.attrs is readonly."), !1;
1726
- },
1727
- deleteProperty() {
1728
- return K("setupContext.attrs is readonly."), !1;
1729
- }
1730
- } : {
1731
- get(t, e) {
1732
- return ne(t, "get", ""), t[e];
1733
- }
1734
- };
1735
- function Vl(t) {
1736
- return new Proxy(t.slots, {
1737
- get(e, n) {
1738
- return ne(t, "get", "$slots"), e[n];
1739
- }
1740
- });
1741
- }
1742
- function Hl(t) {
1743
- const e = (n) => {
1744
- if (process.env.NODE_ENV !== "production" && (t.exposed && K("expose() should be called only once per setup()."), n != null)) {
1745
- let r = typeof n;
1746
- r === "object" && (X(n) ? r = "array" : /* @__PURE__ */ se(n) && (r = "ref")), r !== "object" && K(
1747
- `expose() should be passed a plain object, received ${r}.`
1748
- );
1749
- }
1750
- t.exposed = n || {};
1751
- };
1752
- if (process.env.NODE_ENV !== "production") {
1753
- let n, r;
1754
- return Object.freeze({
1755
- get attrs() {
1756
- return n || (n = new Proxy(t.attrs, ds));
1757
- },
1758
- get slots() {
1759
- return r || (r = Vl(t));
1760
- },
1761
- get emit() {
1762
- return (s, ...i) => t.emit(s, ...i);
1763
- },
1764
- expose: e
1765
- });
1766
- } else
1767
- return {
1768
- attrs: new Proxy(t.attrs, ds),
1769
- slots: t.slots,
1770
- emit: t.emit,
1771
- expose: e
1772
- };
1773
- }
1774
- const Ul = /(?:^|[-_])\w/g, Bl = (t) => t.replace(Ul, (e) => e.toUpperCase()).replace(/[-_]/g, "");
1775
- function _i(t, e = !0) {
1776
- return te(t) ? t.displayName || t.name : t.name || e && t.__name;
1777
- }
1778
- function bi(t, e, n = !1) {
1779
- let r = _i(e);
1780
- if (!r && e.__file) {
1781
- const s = e.__file.match(/([^/\\]+)\.\w+$/);
1782
- s && (r = s[1]);
1783
- }
1784
- if (!r && t) {
1785
- const s = (i) => {
1786
- for (const o in i)
1787
- if (i[o] === e)
1788
- return o;
1789
- };
1790
- r = s(t.components) || t.parent && s(
1791
- t.parent.type.components
1792
- ) || s(t.appContext.components);
1793
- }
1794
- return r ? Bl(r) : n ? "App" : "Anonymous";
1795
- }
1796
- function yi(t) {
1797
- return te(t) && "__vccOpts" in t;
1798
- }
1799
- const un = (t, e) => {
1800
- const n = /* @__PURE__ */ Xo(t, e, jt);
1801
- if (process.env.NODE_ENV !== "production") {
1802
- const r = yt();
1803
- r && r.appContext.config.warnRecursiveComputed && (n._warnRecursive = !0);
1804
- }
1805
- return n;
1806
- };
1807
- function Wl() {
1808
- if (process.env.NODE_ENV === "production" || typeof window > "u")
1809
- return;
1810
- const t = { style: "color:#3ba776" }, e = { style: "color:#1677ff" }, n = { style: "color:#f5222d" }, r = { style: "color:#eb2f96" }, s = {
1811
- __vue_custom_formatter: !0,
1812
- header(u) {
1813
- if (!ae(u))
1814
- return null;
1815
- if (u.__isVue)
1816
- return ["div", t, "VueInstance"];
1817
- if (/* @__PURE__ */ se(u)) {
1818
- _t();
1819
- const d = u.value;
1820
- return bt(), [
1821
- "div",
1822
- {},
1823
- ["span", t, h(u)],
1824
- "<",
1825
- a(d),
1826
- ">"
1827
- ];
1828
- } else {
1829
- if (/* @__PURE__ */ ht(u))
1830
- return [
1831
- "div",
1832
- {},
1833
- ["span", t, /* @__PURE__ */ ce(u) ? "ShallowReactive" : "Reactive"],
1834
- "<",
1835
- a(u),
1836
- `>${/* @__PURE__ */ Ae(u) ? " (readonly)" : ""}`
1837
- ];
1838
- if (/* @__PURE__ */ Ae(u))
1839
- return [
1840
- "div",
1841
- {},
1842
- ["span", t, /* @__PURE__ */ ce(u) ? "ShallowReadonly" : "Readonly"],
1843
- "<",
1844
- a(u),
1845
- ">"
1846
- ];
1847
- }
1848
- return null;
1849
- },
1850
- hasBody(u) {
1851
- return u && u.__isVue;
1852
- },
1853
- body(u) {
1854
- if (u && u.__isVue)
1855
- return [
1856
- "div",
1857
- {},
1858
- ...i(u.$)
1859
- ];
1860
- }
1861
- };
1862
- function i(u) {
1863
- const d = [];
1864
- u.type.props && u.props && d.push(o("props", /* @__PURE__ */ N(u.props))), u.setupState !== Ct && d.push(o("setup", u.setupState)), u.data !== Ct && d.push(o("data", /* @__PURE__ */ N(u.data)));
1865
- const m = c(u, "computed");
1866
- m && d.push(o("computed", m));
1867
- const y = c(u, "inject");
1868
- return y && d.push(o("injected", y)), d.push([
1869
- "div",
1870
- {},
1871
- [
1872
- "span",
1873
- {
1874
- style: r.style + ";opacity:0.66"
1875
- },
1876
- "$ (internal): "
1877
- ],
1878
- ["object", { object: u }]
1879
- ]), d;
1880
- }
1881
- function o(u, d) {
1882
- return d = Ne({}, d), Object.keys(d).length ? [
1883
- "div",
1884
- { style: "line-height:1.25em;margin-bottom:0.6em" },
1885
- [
1886
- "div",
1887
- {
1888
- style: "color:#476582"
1889
- },
1890
- u
1891
- ],
1892
- [
1893
- "div",
1894
- {
1895
- style: "padding-left:1.25em"
1896
- },
1897
- ...Object.keys(d).map((m) => [
1898
- "div",
1899
- {},
1900
- ["span", r, m + ": "],
1901
- a(d[m], !1)
1902
- ])
1903
- ]
1904
- ] : ["span", {}];
1905
- }
1906
- function a(u, d = !0) {
1907
- return typeof u == "number" ? ["span", e, u] : typeof u == "string" ? ["span", n, JSON.stringify(u)] : typeof u == "boolean" ? ["span", r, u] : ae(u) ? ["object", { object: d ? /* @__PURE__ */ N(u) : u }] : ["span", n, String(u)];
1908
- }
1909
- function c(u, d) {
1910
- const m = u.type;
1911
- if (te(m))
1912
- return;
1913
- const y = {};
1914
- for (const A in u.ctx)
1915
- p(m, A, d) && (y[A] = u.ctx[A]);
1916
- return y;
1917
- }
1918
- function p(u, d, m) {
1919
- const y = u[m];
1920
- if (X(y) && y.includes(d) || ae(y) && d in y || u.extends && p(u.extends, d, m) || u.mixins && u.mixins.some((A) => p(A, d, m)))
1921
- return !0;
1922
- }
1923
- function h(u) {
1924
- return /* @__PURE__ */ ce(u) ? "ShallowRef" : u.effect ? "ComputedRef" : "Ref";
1925
- }
1926
- window.devtoolsFormatters ? window.devtoolsFormatters.push(s) : window.devtoolsFormatters = [s];
1927
- }
1928
- process.env.NODE_ENV;
1929
- process.env.NODE_ENV;
1930
- process.env.NODE_ENV;
1931
- function Gl() {
1932
- Wl();
1933
- }
1934
- process.env.NODE_ENV !== "production" && Gl();
1935
- function ql(t) {
1936
- return t.map((e) => ({ value: e, label: `${e}` }));
1937
- }
1938
- const wi = "*", Rr = "#", ut = "$", Sn = ".";
1939
- function G(...t) {
1940
- return t.join(Sn);
1941
- }
1942
- function at(t) {
1943
- return t.split(Sn).filter((e) => e !== "");
1944
- }
1945
- function Ei(t, e, n, r = "") {
1946
- if (t == null || typeof t != "object") return;
1947
- const s = Array.isArray(t) ? t.map((i, o) => String(o)) : Object.keys(t);
1948
- for (const i of s) {
1949
- const o = r ? G(r, i) : i;
1950
- e(o) ? t[i] = n(o) : Ei(t[i], e, n, o);
1951
- }
1952
- }
1953
- function Kl(t) {
1954
- const e = ye(t);
1955
- return e ? e.type === "set" && e.elements.type === "string" && !e.elements.one_of : !1;
1956
- }
1957
- function Yl(t) {
1958
- return "one_of" in t && Array.isArray(t.one_of);
1959
- }
1960
- function Sc(t) {
1961
- return t.type === "set" && "elements" in t && "one_of" in t.elements;
1962
- }
1963
- const Zl = /* @__PURE__ */ Symbol("free-form-field-renderer-slots"), Xl = "free-form-field-renderers-slot";
1964
- function Or() {
1965
- return {
1966
- async: !1,
1967
- breaks: !1,
1968
- extensions: null,
1969
- gfm: !0,
1970
- hooks: null,
1971
- pedantic: !1,
1972
- renderer: null,
1973
- silent: !1,
1974
- tokenizer: null,
1975
- walkTokens: null
1976
- };
1977
- }
1978
- let Ze = Or();
1979
- function Ti(t) {
1980
- Ze = t;
1981
- }
1982
- const ki = /[&<>"']/, Ql = new RegExp(ki.source, "g"), xi = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, Jl = new RegExp(xi.source, "g"), ea = {
1983
- "&": "&amp;",
1984
- "<": "&lt;",
1985
- ">": "&gt;",
1986
- '"': "&quot;",
1987
- "'": "&#39;"
1988
- }, gs = (t) => ea[t];
1989
- function de(t, e) {
1990
- if (e) {
1991
- if (ki.test(t))
1992
- return t.replace(Ql, gs);
1993
- } else if (xi.test(t))
1994
- return t.replace(Jl, gs);
1995
- return t;
1996
- }
1997
- const ta = /(^|[^\[])\^/g;
1998
- function F(t, e) {
1999
- let n = typeof t == "string" ? t : t.source;
2000
- e = e || "";
2001
- const r = {
2002
- replace: (s, i) => {
2003
- let o = typeof i == "string" ? i : i.source;
2004
- return o = o.replace(ta, "$1"), n = n.replace(s, o), r;
2005
- },
2006
- getRegex: () => new RegExp(n, e)
2007
- };
2008
- return r;
2009
- }
2010
- function ms(t) {
2011
- try {
2012
- t = encodeURI(t).replace(/%25/g, "%");
2013
- } catch {
2014
- return null;
2015
- }
2016
- return t;
2017
- }
2018
- const Dt = { exec: () => null };
2019
- function _s(t, e) {
2020
- const n = t.replace(/\|/g, (i, o, a) => {
2021
- let c = !1, p = o;
2022
- for (; --p >= 0 && a[p] === "\\"; )
2023
- c = !c;
2024
- return c ? "|" : " |";
2025
- }), r = n.split(/ \|/);
2026
- let s = 0;
2027
- if (r[0].trim() || r.shift(), r.length > 0 && !r[r.length - 1].trim() && r.pop(), e)
2028
- if (r.length > e)
2029
- r.splice(e);
2030
- else
2031
- for (; r.length < e; )
2032
- r.push("");
2033
- for (; s < r.length; s++)
2034
- r[s] = r[s].trim().replace(/\\\|/g, "|");
2035
- return r;
2036
- }
2037
- function St(t, e, n) {
2038
- const r = t.length;
2039
- if (r === 0)
2040
- return "";
2041
- let s = 0;
2042
- for (; s < r && t.charAt(r - s - 1) === e; )
2043
- s++;
2044
- return t.slice(0, r - s);
2045
- }
2046
- function na(t, e) {
2047
- if (t.indexOf(e[1]) === -1)
2048
- return -1;
2049
- let n = 0;
2050
- for (let r = 0; r < t.length; r++)
2051
- if (t[r] === "\\")
2052
- r++;
2053
- else if (t[r] === e[0])
2054
- n++;
2055
- else if (t[r] === e[1] && (n--, n < 0))
2056
- return r;
2057
- return -1;
2058
- }
2059
- function bs(t, e, n, r) {
2060
- const s = e.href, i = e.title ? de(e.title) : null, o = t[1].replace(/\\([\[\]])/g, "$1");
2061
- if (t[0].charAt(0) !== "!") {
2062
- r.state.inLink = !0;
2063
- const a = {
2064
- type: "link",
2065
- raw: n,
2066
- href: s,
2067
- title: i,
2068
- text: o,
2069
- tokens: r.inlineTokens(o)
2070
- };
2071
- return r.state.inLink = !1, a;
2072
- }
2073
- return {
2074
- type: "image",
2075
- raw: n,
2076
- href: s,
2077
- title: i,
2078
- text: de(o)
2079
- };
2080
- }
2081
- function ra(t, e) {
2082
- const n = t.match(/^(\s+)(?:```)/);
2083
- if (n === null)
2084
- return e;
2085
- const r = n[1];
2086
- return e.split(`
2087
- `).map((s) => {
2088
- const i = s.match(/^\s+/);
2089
- if (i === null)
2090
- return s;
2091
- const [o] = i;
2092
- return o.length >= r.length ? s.slice(r.length) : s;
2093
- }).join(`
2094
- `);
2095
- }
2096
- class _n {
2097
- options;
2098
- rules;
2099
- // set by the lexer
2100
- lexer;
2101
- // set by the lexer
2102
- constructor(e) {
2103
- this.options = e || Ze;
2104
- }
2105
- space(e) {
2106
- const n = this.rules.block.newline.exec(e);
2107
- if (n && n[0].length > 0)
2108
- return {
2109
- type: "space",
2110
- raw: n[0]
2111
- };
2112
- }
2113
- code(e) {
2114
- const n = this.rules.block.code.exec(e);
2115
- if (n) {
2116
- const r = n[0].replace(/^(?: {1,4}| {0,3}\t)/gm, "");
2117
- return {
2118
- type: "code",
2119
- raw: n[0],
2120
- codeBlockStyle: "indented",
2121
- text: this.options.pedantic ? r : St(r, `
2122
- `)
2123
- };
2124
- }
2125
- }
2126
- fences(e) {
2127
- const n = this.rules.block.fences.exec(e);
2128
- if (n) {
2129
- const r = n[0], s = ra(r, n[3] || "");
2130
- return {
2131
- type: "code",
2132
- raw: r,
2133
- lang: n[2] ? n[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : n[2],
2134
- text: s
2135
- };
2136
- }
2137
- }
2138
- heading(e) {
2139
- const n = this.rules.block.heading.exec(e);
2140
- if (n) {
2141
- let r = n[2].trim();
2142
- if (/#$/.test(r)) {
2143
- const s = St(r, "#");
2144
- (this.options.pedantic || !s || / $/.test(s)) && (r = s.trim());
2145
- }
2146
- return {
2147
- type: "heading",
2148
- raw: n[0],
2149
- depth: n[1].length,
2150
- text: r,
2151
- tokens: this.lexer.inline(r)
2152
- };
2153
- }
2154
- }
2155
- hr(e) {
2156
- const n = this.rules.block.hr.exec(e);
2157
- if (n)
2158
- return {
2159
- type: "hr",
2160
- raw: St(n[0], `
2161
- `)
2162
- };
2163
- }
2164
- blockquote(e) {
2165
- const n = this.rules.block.blockquote.exec(e);
2166
- if (n) {
2167
- let r = St(n[0], `
2168
- `).split(`
2169
- `), s = "", i = "";
2170
- const o = [];
2171
- for (; r.length > 0; ) {
2172
- let a = !1;
2173
- const c = [];
2174
- let p;
2175
- for (p = 0; p < r.length; p++)
2176
- if (/^ {0,3}>/.test(r[p]))
2177
- c.push(r[p]), a = !0;
2178
- else if (!a)
2179
- c.push(r[p]);
2180
- else
2181
- break;
2182
- r = r.slice(p);
2183
- const h = c.join(`
2184
- `), u = h.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g, `
2185
- $1`).replace(/^ {0,3}>[ \t]?/gm, "");
2186
- s = s ? `${s}
2187
- ${h}` : h, i = i ? `${i}
2188
- ${u}` : u;
2189
- const d = this.lexer.state.top;
2190
- if (this.lexer.state.top = !0, this.lexer.blockTokens(u, o, !0), this.lexer.state.top = d, r.length === 0)
2191
- break;
2192
- const m = o[o.length - 1];
2193
- if (m?.type === "code")
2194
- break;
2195
- if (m?.type === "blockquote") {
2196
- const y = m, A = y.raw + `
2197
- ` + r.join(`
2198
- `), P = this.blockquote(A);
2199
- o[o.length - 1] = P, s = s.substring(0, s.length - y.raw.length) + P.raw, i = i.substring(0, i.length - y.text.length) + P.text;
2200
- break;
2201
- } else if (m?.type === "list") {
2202
- const y = m, A = y.raw + `
2203
- ` + r.join(`
2204
- `), P = this.list(A);
2205
- o[o.length - 1] = P, s = s.substring(0, s.length - m.raw.length) + P.raw, i = i.substring(0, i.length - y.raw.length) + P.raw, r = A.substring(o[o.length - 1].raw.length).split(`
2206
- `);
2207
- continue;
2208
- }
2209
- }
2210
- return {
2211
- type: "blockquote",
2212
- raw: s,
2213
- tokens: o,
2214
- text: i
2215
- };
2216
- }
2217
- }
2218
- list(e) {
2219
- let n = this.rules.block.list.exec(e);
2220
- if (n) {
2221
- let r = n[1].trim();
2222
- const s = r.length > 1, i = {
2223
- type: "list",
2224
- raw: "",
2225
- ordered: s,
2226
- start: s ? +r.slice(0, -1) : "",
2227
- loose: !1,
2228
- items: []
2229
- };
2230
- r = s ? `\\d{1,9}\\${r.slice(-1)}` : `\\${r}`, this.options.pedantic && (r = s ? r : "[*+-]");
2231
- const o = new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`);
2232
- let a = !1;
2233
- for (; e; ) {
2234
- let c = !1, p = "", h = "";
2235
- if (!(n = o.exec(e)) || this.rules.block.hr.test(e))
2236
- break;
2237
- p = n[0], e = e.substring(p.length);
2238
- let u = n[2].split(`
2239
- `, 1)[0].replace(/^\t+/, (j) => " ".repeat(3 * j.length)), d = e.split(`
2240
- `, 1)[0], m = !u.trim(), y = 0;
2241
- if (this.options.pedantic ? (y = 2, h = u.trimStart()) : m ? y = n[1].length + 1 : (y = n[2].search(/[^ ]/), y = y > 4 ? 1 : y, h = u.slice(y), y += n[1].length), m && /^[ \t]*$/.test(d) && (p += d + `
2242
- `, e = e.substring(d.length + 1), c = !0), !c) {
2243
- const j = new RegExp(`^ {0,${Math.min(3, y - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), Y = new RegExp(`^ {0,${Math.min(3, y - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), E = new RegExp(`^ {0,${Math.min(3, y - 1)}}(?:\`\`\`|~~~)`), _ = new RegExp(`^ {0,${Math.min(3, y - 1)}}#`), T = new RegExp(`^ {0,${Math.min(3, y - 1)}}<(?:[a-z].*>|!--)`, "i");
2244
- for (; e; ) {
2245
- const S = e.split(`
2246
- `, 1)[0];
2247
- let w;
2248
- if (d = S, this.options.pedantic ? (d = d.replace(/^ {1,4}(?=( {4})*[^ ])/g, " "), w = d) : w = d.replace(/\t/g, " "), E.test(d) || _.test(d) || T.test(d) || j.test(d) || Y.test(d))
2249
- break;
2250
- if (w.search(/[^ ]/) >= y || !d.trim())
2251
- h += `
2252
- ` + w.slice(y);
2253
- else {
2254
- if (m || u.replace(/\t/g, " ").search(/[^ ]/) >= 4 || E.test(u) || _.test(u) || Y.test(u))
2255
- break;
2256
- h += `
2257
- ` + d;
2258
- }
2259
- !m && !d.trim() && (m = !0), p += S + `
2260
- `, e = e.substring(S.length + 1), u = w.slice(y);
2261
- }
2262
- }
2263
- i.loose || (a ? i.loose = !0 : /\n[ \t]*\n[ \t]*$/.test(p) && (a = !0));
2264
- let A = null, P;
2265
- this.options.gfm && (A = /^\[[ xX]\] /.exec(h), A && (P = A[0] !== "[ ] ", h = h.replace(/^\[[ xX]\] +/, ""))), i.items.push({
2266
- type: "list_item",
2267
- raw: p,
2268
- task: !!A,
2269
- checked: P,
2270
- loose: !1,
2271
- text: h,
2272
- tokens: []
2273
- }), i.raw += p;
2274
- }
2275
- i.items[i.items.length - 1].raw = i.items[i.items.length - 1].raw.trimEnd(), i.items[i.items.length - 1].text = i.items[i.items.length - 1].text.trimEnd(), i.raw = i.raw.trimEnd();
2276
- for (let c = 0; c < i.items.length; c++)
2277
- if (this.lexer.state.top = !1, i.items[c].tokens = this.lexer.blockTokens(i.items[c].text, []), !i.loose) {
2278
- const p = i.items[c].tokens.filter((u) => u.type === "space"), h = p.length > 0 && p.some((u) => /\n.*\n/.test(u.raw));
2279
- i.loose = h;
2280
- }
2281
- if (i.loose)
2282
- for (let c = 0; c < i.items.length; c++)
2283
- i.items[c].loose = !0;
2284
- return i;
2285
- }
2286
- }
2287
- html(e) {
2288
- const n = this.rules.block.html.exec(e);
2289
- if (n)
2290
- return {
2291
- type: "html",
2292
- block: !0,
2293
- raw: n[0],
2294
- pre: n[1] === "pre" || n[1] === "script" || n[1] === "style",
2295
- text: n[0]
2296
- };
2297
- }
2298
- def(e) {
2299
- const n = this.rules.block.def.exec(e);
2300
- if (n) {
2301
- const r = n[1].toLowerCase().replace(/\s+/g, " "), s = n[2] ? n[2].replace(/^<(.*)>$/, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", i = n[3] ? n[3].substring(1, n[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : n[3];
2302
- return {
2303
- type: "def",
2304
- tag: r,
2305
- raw: n[0],
2306
- href: s,
2307
- title: i
2308
- };
2309
- }
2310
- }
2311
- table(e) {
2312
- const n = this.rules.block.table.exec(e);
2313
- if (!n || !/[:|]/.test(n[2]))
2314
- return;
2315
- const r = _s(n[1]), s = n[2].replace(/^\||\| *$/g, "").split("|"), i = n[3] && n[3].trim() ? n[3].replace(/\n[ \t]*$/, "").split(`
2316
- `) : [], o = {
2317
- type: "table",
2318
- raw: n[0],
2319
- header: [],
2320
- align: [],
2321
- rows: []
2322
- };
2323
- if (r.length === s.length) {
2324
- for (const a of s)
2325
- /^ *-+: *$/.test(a) ? o.align.push("right") : /^ *:-+: *$/.test(a) ? o.align.push("center") : /^ *:-+ *$/.test(a) ? o.align.push("left") : o.align.push(null);
2326
- for (let a = 0; a < r.length; a++)
2327
- o.header.push({
2328
- text: r[a],
2329
- tokens: this.lexer.inline(r[a]),
2330
- header: !0,
2331
- align: o.align[a]
2332
- });
2333
- for (const a of i)
2334
- o.rows.push(_s(a, o.header.length).map((c, p) => ({
2335
- text: c,
2336
- tokens: this.lexer.inline(c),
2337
- header: !1,
2338
- align: o.align[p]
2339
- })));
2340
- return o;
2341
- }
2342
- }
2343
- lheading(e) {
2344
- const n = this.rules.block.lheading.exec(e);
2345
- if (n)
2346
- return {
2347
- type: "heading",
2348
- raw: n[0],
2349
- depth: n[2].charAt(0) === "=" ? 1 : 2,
2350
- text: n[1],
2351
- tokens: this.lexer.inline(n[1])
2352
- };
2353
- }
2354
- paragraph(e) {
2355
- const n = this.rules.block.paragraph.exec(e);
2356
- if (n) {
2357
- const r = n[1].charAt(n[1].length - 1) === `
2358
- ` ? n[1].slice(0, -1) : n[1];
2359
- return {
2360
- type: "paragraph",
2361
- raw: n[0],
2362
- text: r,
2363
- tokens: this.lexer.inline(r)
2364
- };
2365
- }
2366
- }
2367
- text(e) {
2368
- const n = this.rules.block.text.exec(e);
2369
- if (n)
2370
- return {
2371
- type: "text",
2372
- raw: n[0],
2373
- text: n[0],
2374
- tokens: this.lexer.inline(n[0])
2375
- };
2376
- }
2377
- escape(e) {
2378
- const n = this.rules.inline.escape.exec(e);
2379
- if (n)
2380
- return {
2381
- type: "escape",
2382
- raw: n[0],
2383
- text: de(n[1])
2384
- };
2385
- }
2386
- tag(e) {
2387
- const n = this.rules.inline.tag.exec(e);
2388
- if (n)
2389
- return !this.lexer.state.inLink && /^<a /i.test(n[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && /^<\/a>/i.test(n[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(n[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0]) && (this.lexer.state.inRawBlock = !1), {
2390
- type: "html",
2391
- raw: n[0],
2392
- inLink: this.lexer.state.inLink,
2393
- inRawBlock: this.lexer.state.inRawBlock,
2394
- block: !1,
2395
- text: n[0]
2396
- };
2397
- }
2398
- link(e) {
2399
- const n = this.rules.inline.link.exec(e);
2400
- if (n) {
2401
- const r = n[2].trim();
2402
- if (!this.options.pedantic && /^</.test(r)) {
2403
- if (!/>$/.test(r))
2404
- return;
2405
- const o = St(r.slice(0, -1), "\\");
2406
- if ((r.length - o.length) % 2 === 0)
2407
- return;
2408
- } else {
2409
- const o = na(n[2], "()");
2410
- if (o > -1) {
2411
- const c = (n[0].indexOf("!") === 0 ? 5 : 4) + n[1].length + o;
2412
- n[2] = n[2].substring(0, o), n[0] = n[0].substring(0, c).trim(), n[3] = "";
2413
- }
2414
- }
2415
- let s = n[2], i = "";
2416
- if (this.options.pedantic) {
2417
- const o = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(s);
2418
- o && (s = o[1], i = o[3]);
2419
- } else
2420
- i = n[3] ? n[3].slice(1, -1) : "";
2421
- return s = s.trim(), /^</.test(s) && (this.options.pedantic && !/>$/.test(r) ? s = s.slice(1) : s = s.slice(1, -1)), bs(n, {
2422
- href: s && s.replace(this.rules.inline.anyPunctuation, "$1"),
2423
- title: i && i.replace(this.rules.inline.anyPunctuation, "$1")
2424
- }, n[0], this.lexer);
2425
- }
2426
- }
2427
- reflink(e, n) {
2428
- let r;
2429
- if ((r = this.rules.inline.reflink.exec(e)) || (r = this.rules.inline.nolink.exec(e))) {
2430
- const s = (r[2] || r[1]).replace(/\s+/g, " "), i = n[s.toLowerCase()];
2431
- if (!i) {
2432
- const o = r[0].charAt(0);
2433
- return {
2434
- type: "text",
2435
- raw: o,
2436
- text: o
2437
- };
2438
- }
2439
- return bs(r, i, r[0], this.lexer);
2440
- }
2441
- }
2442
- emStrong(e, n, r = "") {
2443
- let s = this.rules.inline.emStrongLDelim.exec(e);
2444
- if (!s || s[3] && r.match(/[\p{L}\p{N}]/u))
2445
- return;
2446
- if (!(s[1] || s[2] || "") || !r || this.rules.inline.punctuation.exec(r)) {
2447
- const o = [...s[0]].length - 1;
2448
- let a, c, p = o, h = 0;
2449
- const u = s[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
2450
- for (u.lastIndex = 0, n = n.slice(-1 * e.length + o); (s = u.exec(n)) != null; ) {
2451
- if (a = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !a)
2452
- continue;
2453
- if (c = [...a].length, s[3] || s[4]) {
2454
- p += c;
2455
- continue;
2456
- } else if ((s[5] || s[6]) && o % 3 && !((o + c) % 3)) {
2457
- h += c;
2458
- continue;
2459
- }
2460
- if (p -= c, p > 0)
2461
- continue;
2462
- c = Math.min(c, c + p + h);
2463
- const d = [...s[0]][0].length, m = e.slice(0, o + s.index + d + c);
2464
- if (Math.min(o, c) % 2) {
2465
- const A = m.slice(1, -1);
2466
- return {
2467
- type: "em",
2468
- raw: m,
2469
- text: A,
2470
- tokens: this.lexer.inlineTokens(A)
2471
- };
2472
- }
2473
- const y = m.slice(2, -2);
2474
- return {
2475
- type: "strong",
2476
- raw: m,
2477
- text: y,
2478
- tokens: this.lexer.inlineTokens(y)
2479
- };
2480
- }
2481
- }
2482
- }
2483
- codespan(e) {
2484
- const n = this.rules.inline.code.exec(e);
2485
- if (n) {
2486
- let r = n[2].replace(/\n/g, " ");
2487
- const s = /[^ ]/.test(r), i = /^ /.test(r) && / $/.test(r);
2488
- return s && i && (r = r.substring(1, r.length - 1)), r = de(r, !0), {
2489
- type: "codespan",
2490
- raw: n[0],
2491
- text: r
2492
- };
2493
- }
2494
- }
2495
- br(e) {
2496
- const n = this.rules.inline.br.exec(e);
2497
- if (n)
2498
- return {
2499
- type: "br",
2500
- raw: n[0]
2501
- };
2502
- }
2503
- del(e) {
2504
- const n = this.rules.inline.del.exec(e);
2505
- if (n)
2506
- return {
2507
- type: "del",
2508
- raw: n[0],
2509
- text: n[2],
2510
- tokens: this.lexer.inlineTokens(n[2])
2511
- };
2512
- }
2513
- autolink(e) {
2514
- const n = this.rules.inline.autolink.exec(e);
2515
- if (n) {
2516
- let r, s;
2517
- return n[2] === "@" ? (r = de(n[1]), s = "mailto:" + r) : (r = de(n[1]), s = r), {
2518
- type: "link",
2519
- raw: n[0],
2520
- text: r,
2521
- href: s,
2522
- tokens: [
2523
- {
2524
- type: "text",
2525
- raw: r,
2526
- text: r
2527
- }
2528
- ]
2529
- };
2530
- }
2531
- }
2532
- url(e) {
2533
- let n;
2534
- if (n = this.rules.inline.url.exec(e)) {
2535
- let r, s;
2536
- if (n[2] === "@")
2537
- r = de(n[0]), s = "mailto:" + r;
2538
- else {
2539
- let i;
2540
- do
2541
- i = n[0], n[0] = this.rules.inline._backpedal.exec(n[0])?.[0] ?? "";
2542
- while (i !== n[0]);
2543
- r = de(n[0]), n[1] === "www." ? s = "http://" + n[0] : s = n[0];
2544
- }
2545
- return {
2546
- type: "link",
2547
- raw: n[0],
2548
- text: r,
2549
- href: s,
2550
- tokens: [
2551
- {
2552
- type: "text",
2553
- raw: r,
2554
- text: r
2555
- }
2556
- ]
2557
- };
2558
- }
2559
- }
2560
- inlineText(e) {
2561
- const n = this.rules.inline.text.exec(e);
2562
- if (n) {
2563
- let r;
2564
- return this.lexer.state.inRawBlock ? r = n[0] : r = de(n[0]), {
2565
- type: "text",
2566
- raw: n[0],
2567
- text: r
2568
- };
2569
- }
2570
- }
2571
- }
2572
- const sa = /^(?:[ \t]*(?:\n|$))+/, ia = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, oa = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, Vt = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, la = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Si = /(?:[*+-]|\d{1,9}[.)])/, vi = F(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, Si).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).getRegex(), Nr = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, aa = /^[^\n]+/, Ir = /(?!\s*\])(?:\\.|[^\[\]\\])+/, ca = F(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Ir).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), ua = F(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Si).getRegex(), vn = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", Dr = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, fa = F("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", Dr).replace("tag", vn).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Ai = F(Nr).replace("hr", Vt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", vn).getRegex(), pa = F(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Ai).getRegex(), Cr = {
2573
- blockquote: pa,
2574
- code: ia,
2575
- def: ca,
2576
- fences: oa,
2577
- heading: la,
2578
- hr: Vt,
2579
- html: fa,
2580
- lheading: vi,
2581
- list: ua,
2582
- newline: sa,
2583
- paragraph: Ai,
2584
- table: Dt,
2585
- text: aa
2586
- }, ys = F("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", Vt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", vn).getRegex(), ha = {
2587
- ...Cr,
2588
- table: ys,
2589
- paragraph: F(Nr).replace("hr", Vt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", ys).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", vn).getRegex()
2590
- }, da = {
2591
- ...Cr,
2592
- html: F(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", Dr).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
2593
- def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
2594
- heading: /^(#{1,6})(.*)(?:\n+|$)/,
2595
- fences: Dt,
2596
- // fences not supported
2597
- lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
2598
- paragraph: F(Nr).replace("hr", Vt).replace("heading", ` *#{1,6} *[^
2599
- ]`).replace("lheading", vi).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
2600
- }, Ri = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, ga = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Oi = /^( {2,}|\\)\n(?!\s*$)/, ma = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Ht = "\\p{P}\\p{S}", _a = F(/^((?![*_])[\spunctuation])/, "u").replace(/punctuation/g, Ht).getRegex(), ba = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g, ya = F(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u").replace(/punct/g, Ht).getRegex(), wa = F("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])", "gu").replace(/punct/g, Ht).getRegex(), Ea = F("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, Ht).getRegex(), Ta = F(/\\([punct])/, "gu").replace(/punct/g, Ht).getRegex(), ka = F(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), xa = F(Dr).replace("(?:-->|$)", "-->").getRegex(), Sa = F("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", xa).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), bn = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, va = F(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", bn).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Ni = F(/^!?\[(label)\]\[(ref)\]/).replace("label", bn).replace("ref", Ir).getRegex(), Ii = F(/^!?\[(ref)\](?:\[\])?/).replace("ref", Ir).getRegex(), Aa = F("reflink|nolink(?!\\()", "g").replace("reflink", Ni).replace("nolink", Ii).getRegex(), Mr = {
2601
- _backpedal: Dt,
2602
- // only used for GFM url
2603
- anyPunctuation: Ta,
2604
- autolink: ka,
2605
- blockSkip: ba,
2606
- br: Oi,
2607
- code: ga,
2608
- del: Dt,
2609
- emStrongLDelim: ya,
2610
- emStrongRDelimAst: wa,
2611
- emStrongRDelimUnd: Ea,
2612
- escape: Ri,
2613
- link: va,
2614
- nolink: Ii,
2615
- punctuation: _a,
2616
- reflink: Ni,
2617
- reflinkSearch: Aa,
2618
- tag: Sa,
2619
- text: ma,
2620
- url: Dt
2621
- }, Ra = {
2622
- ...Mr,
2623
- link: F(/^!?\[(label)\]\((.*?)\)/).replace("label", bn).getRegex(),
2624
- reflink: F(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", bn).getRegex()
2625
- }, dr = {
2626
- ...Mr,
2627
- escape: F(Ri).replace("])", "~|])").getRegex(),
2628
- url: F(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
2629
- _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
2630
- del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,
2631
- text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
2632
- }, Oa = {
2633
- ...dr,
2634
- br: F(Oi).replace("{2,}", "*").getRegex(),
2635
- text: F(dr.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
2636
- }, on = {
2637
- normal: Cr,
2638
- gfm: ha,
2639
- pedantic: da
2640
- }, vt = {
2641
- normal: Mr,
2642
- gfm: dr,
2643
- breaks: Oa,
2644
- pedantic: Ra
2645
- };
2646
- class me {
2647
- tokens;
2648
- options;
2649
- state;
2650
- tokenizer;
2651
- inlineQueue;
2652
- constructor(e) {
2653
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || Ze, this.options.tokenizer = this.options.tokenizer || new _n(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
2654
- inLink: !1,
2655
- inRawBlock: !1,
2656
- top: !0
2657
- };
2658
- const n = {
2659
- block: on.normal,
2660
- inline: vt.normal
2661
- };
2662
- this.options.pedantic ? (n.block = on.pedantic, n.inline = vt.pedantic) : this.options.gfm && (n.block = on.gfm, this.options.breaks ? n.inline = vt.breaks : n.inline = vt.gfm), this.tokenizer.rules = n;
2663
- }
2664
- /**
2665
- * Expose Rules
2666
- */
2667
- static get rules() {
2668
- return {
2669
- block: on,
2670
- inline: vt
2671
- };
2672
- }
2673
- /**
2674
- * Static Lex Method
2675
- */
2676
- static lex(e, n) {
2677
- return new me(n).lex(e);
2678
- }
2679
- /**
2680
- * Static Lex Inline Method
2681
- */
2682
- static lexInline(e, n) {
2683
- return new me(n).inlineTokens(e);
2684
- }
2685
- /**
2686
- * Preprocessing
2687
- */
2688
- lex(e) {
2689
- e = e.replace(/\r\n|\r/g, `
2690
- `), this.blockTokens(e, this.tokens);
2691
- for (let n = 0; n < this.inlineQueue.length; n++) {
2692
- const r = this.inlineQueue[n];
2693
- this.inlineTokens(r.src, r.tokens);
2694
- }
2695
- return this.inlineQueue = [], this.tokens;
2696
- }
2697
- blockTokens(e, n = [], r = !1) {
2698
- this.options.pedantic && (e = e.replace(/\t/g, " ").replace(/^ +$/gm, ""));
2699
- let s, i, o;
2700
- for (; e; )
2701
- if (!(this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((a) => (s = a.call({ lexer: this }, e, n)) ? (e = e.substring(s.raw.length), n.push(s), !0) : !1))) {
2702
- if (s = this.tokenizer.space(e)) {
2703
- e = e.substring(s.raw.length), s.raw.length === 1 && n.length > 0 ? n[n.length - 1].raw += `
2704
- ` : n.push(s);
2705
- continue;
2706
- }
2707
- if (s = this.tokenizer.code(e)) {
2708
- e = e.substring(s.raw.length), i = n[n.length - 1], i && (i.type === "paragraph" || i.type === "text") ? (i.raw += `
2709
- ` + s.raw, i.text += `
2710
- ` + s.text, this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : n.push(s);
2711
- continue;
2712
- }
2713
- if (s = this.tokenizer.fences(e)) {
2714
- e = e.substring(s.raw.length), n.push(s);
2715
- continue;
2716
- }
2717
- if (s = this.tokenizer.heading(e)) {
2718
- e = e.substring(s.raw.length), n.push(s);
2719
- continue;
2720
- }
2721
- if (s = this.tokenizer.hr(e)) {
2722
- e = e.substring(s.raw.length), n.push(s);
2723
- continue;
2724
- }
2725
- if (s = this.tokenizer.blockquote(e)) {
2726
- e = e.substring(s.raw.length), n.push(s);
2727
- continue;
2728
- }
2729
- if (s = this.tokenizer.list(e)) {
2730
- e = e.substring(s.raw.length), n.push(s);
2731
- continue;
2732
- }
2733
- if (s = this.tokenizer.html(e)) {
2734
- e = e.substring(s.raw.length), n.push(s);
2735
- continue;
2736
- }
2737
- if (s = this.tokenizer.def(e)) {
2738
- e = e.substring(s.raw.length), i = n[n.length - 1], i && (i.type === "paragraph" || i.type === "text") ? (i.raw += `
2739
- ` + s.raw, i.text += `
2740
- ` + s.raw, this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : this.tokens.links[s.tag] || (this.tokens.links[s.tag] = {
2741
- href: s.href,
2742
- title: s.title
2743
- });
2744
- continue;
2745
- }
2746
- if (s = this.tokenizer.table(e)) {
2747
- e = e.substring(s.raw.length), n.push(s);
2748
- continue;
2749
- }
2750
- if (s = this.tokenizer.lheading(e)) {
2751
- e = e.substring(s.raw.length), n.push(s);
2752
- continue;
2753
- }
2754
- if (o = e, this.options.extensions && this.options.extensions.startBlock) {
2755
- let a = 1 / 0;
2756
- const c = e.slice(1);
2757
- let p;
2758
- this.options.extensions.startBlock.forEach((h) => {
2759
- p = h.call({ lexer: this }, c), typeof p == "number" && p >= 0 && (a = Math.min(a, p));
2760
- }), a < 1 / 0 && a >= 0 && (o = e.substring(0, a + 1));
2761
- }
2762
- if (this.state.top && (s = this.tokenizer.paragraph(o))) {
2763
- i = n[n.length - 1], r && i?.type === "paragraph" ? (i.raw += `
2764
- ` + s.raw, i.text += `
2765
- ` + s.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : n.push(s), r = o.length !== e.length, e = e.substring(s.raw.length);
2766
- continue;
2767
- }
2768
- if (s = this.tokenizer.text(e)) {
2769
- e = e.substring(s.raw.length), i = n[n.length - 1], i && i.type === "text" ? (i.raw += `
2770
- ` + s.raw, i.text += `
2771
- ` + s.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : n.push(s);
2772
- continue;
2773
- }
2774
- if (e) {
2775
- const a = "Infinite loop on byte: " + e.charCodeAt(0);
2776
- if (this.options.silent) {
2777
- console.error(a);
2778
- break;
2779
- } else
2780
- throw new Error(a);
2781
- }
2782
- }
2783
- return this.state.top = !0, n;
2784
- }
2785
- inline(e, n = []) {
2786
- return this.inlineQueue.push({ src: e, tokens: n }), n;
2787
- }
2788
- /**
2789
- * Lexing/Compiling
2790
- */
2791
- inlineTokens(e, n = []) {
2792
- let r, s, i, o = e, a, c, p;
2793
- if (this.tokens.links) {
2794
- const h = Object.keys(this.tokens.links);
2795
- if (h.length > 0)
2796
- for (; (a = this.tokenizer.rules.inline.reflinkSearch.exec(o)) != null; )
2797
- h.includes(a[0].slice(a[0].lastIndexOf("[") + 1, -1)) && (o = o.slice(0, a.index) + "[" + "a".repeat(a[0].length - 2) + "]" + o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
2798
- }
2799
- for (; (a = this.tokenizer.rules.inline.blockSkip.exec(o)) != null; )
2800
- o = o.slice(0, a.index) + "[" + "a".repeat(a[0].length - 2) + "]" + o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
2801
- for (; (a = this.tokenizer.rules.inline.anyPunctuation.exec(o)) != null; )
2802
- o = o.slice(0, a.index) + "++" + o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
2803
- for (; e; )
2804
- if (c || (p = ""), c = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((h) => (r = h.call({ lexer: this }, e, n)) ? (e = e.substring(r.raw.length), n.push(r), !0) : !1))) {
2805
- if (r = this.tokenizer.escape(e)) {
2806
- e = e.substring(r.raw.length), n.push(r);
2807
- continue;
2808
- }
2809
- if (r = this.tokenizer.tag(e)) {
2810
- e = e.substring(r.raw.length), s = n[n.length - 1], s && r.type === "text" && s.type === "text" ? (s.raw += r.raw, s.text += r.text) : n.push(r);
2811
- continue;
2812
- }
2813
- if (r = this.tokenizer.link(e)) {
2814
- e = e.substring(r.raw.length), n.push(r);
2815
- continue;
2816
- }
2817
- if (r = this.tokenizer.reflink(e, this.tokens.links)) {
2818
- e = e.substring(r.raw.length), s = n[n.length - 1], s && r.type === "text" && s.type === "text" ? (s.raw += r.raw, s.text += r.text) : n.push(r);
2819
- continue;
2820
- }
2821
- if (r = this.tokenizer.emStrong(e, o, p)) {
2822
- e = e.substring(r.raw.length), n.push(r);
2823
- continue;
2824
- }
2825
- if (r = this.tokenizer.codespan(e)) {
2826
- e = e.substring(r.raw.length), n.push(r);
2827
- continue;
2828
- }
2829
- if (r = this.tokenizer.br(e)) {
2830
- e = e.substring(r.raw.length), n.push(r);
2831
- continue;
2832
- }
2833
- if (r = this.tokenizer.del(e)) {
2834
- e = e.substring(r.raw.length), n.push(r);
2835
- continue;
2836
- }
2837
- if (r = this.tokenizer.autolink(e)) {
2838
- e = e.substring(r.raw.length), n.push(r);
2839
- continue;
2840
- }
2841
- if (!this.state.inLink && (r = this.tokenizer.url(e))) {
2842
- e = e.substring(r.raw.length), n.push(r);
2843
- continue;
2844
- }
2845
- if (i = e, this.options.extensions && this.options.extensions.startInline) {
2846
- let h = 1 / 0;
2847
- const u = e.slice(1);
2848
- let d;
2849
- this.options.extensions.startInline.forEach((m) => {
2850
- d = m.call({ lexer: this }, u), typeof d == "number" && d >= 0 && (h = Math.min(h, d));
2851
- }), h < 1 / 0 && h >= 0 && (i = e.substring(0, h + 1));
2852
- }
2853
- if (r = this.tokenizer.inlineText(i)) {
2854
- e = e.substring(r.raw.length), r.raw.slice(-1) !== "_" && (p = r.raw.slice(-1)), c = !0, s = n[n.length - 1], s && s.type === "text" ? (s.raw += r.raw, s.text += r.text) : n.push(r);
2855
- continue;
2856
- }
2857
- if (e) {
2858
- const h = "Infinite loop on byte: " + e.charCodeAt(0);
2859
- if (this.options.silent) {
2860
- console.error(h);
2861
- break;
2862
- } else
2863
- throw new Error(h);
2864
- }
2865
- }
2866
- return n;
2867
- }
2868
- }
2869
- class yn {
2870
- options;
2871
- parser;
2872
- // set by the parser
2873
- constructor(e) {
2874
- this.options = e || Ze;
2875
- }
2876
- space(e) {
2877
- return "";
2878
- }
2879
- code({ text: e, lang: n, escaped: r }) {
2880
- const s = (n || "").match(/^\S*/)?.[0], i = e.replace(/\n$/, "") + `
2881
- `;
2882
- return s ? '<pre><code class="language-' + de(s) + '">' + (r ? i : de(i, !0)) + `</code></pre>
2883
- ` : "<pre><code>" + (r ? i : de(i, !0)) + `</code></pre>
2884
- `;
2885
- }
2886
- blockquote({ tokens: e }) {
2887
- return `<blockquote>
2888
- ${this.parser.parse(e)}</blockquote>
2889
- `;
2890
- }
2891
- html({ text: e }) {
2892
- return e;
2893
- }
2894
- heading({ tokens: e, depth: n }) {
2895
- return `<h${n}>${this.parser.parseInline(e)}</h${n}>
2896
- `;
2897
- }
2898
- hr(e) {
2899
- return `<hr>
2900
- `;
2901
- }
2902
- list(e) {
2903
- const n = e.ordered, r = e.start;
2904
- let s = "";
2905
- for (let a = 0; a < e.items.length; a++) {
2906
- const c = e.items[a];
2907
- s += this.listitem(c);
2908
- }
2909
- const i = n ? "ol" : "ul", o = n && r !== 1 ? ' start="' + r + '"' : "";
2910
- return "<" + i + o + `>
2911
- ` + s + "</" + i + `>
2912
- `;
2913
- }
2914
- listitem(e) {
2915
- let n = "";
2916
- if (e.task) {
2917
- const r = this.checkbox({ checked: !!e.checked });
2918
- e.loose ? e.tokens.length > 0 && e.tokens[0].type === "paragraph" ? (e.tokens[0].text = r + " " + e.tokens[0].text, e.tokens[0].tokens && e.tokens[0].tokens.length > 0 && e.tokens[0].tokens[0].type === "text" && (e.tokens[0].tokens[0].text = r + " " + e.tokens[0].tokens[0].text)) : e.tokens.unshift({
2919
- type: "text",
2920
- raw: r + " ",
2921
- text: r + " "
2922
- }) : n += r + " ";
2923
- }
2924
- return n += this.parser.parse(e.tokens, !!e.loose), `<li>${n}</li>
2925
- `;
2926
- }
2927
- checkbox({ checked: e }) {
2928
- return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
2929
- }
2930
- paragraph({ tokens: e }) {
2931
- return `<p>${this.parser.parseInline(e)}</p>
2932
- `;
2933
- }
2934
- table(e) {
2935
- let n = "", r = "";
2936
- for (let i = 0; i < e.header.length; i++)
2937
- r += this.tablecell(e.header[i]);
2938
- n += this.tablerow({ text: r });
2939
- let s = "";
2940
- for (let i = 0; i < e.rows.length; i++) {
2941
- const o = e.rows[i];
2942
- r = "";
2943
- for (let a = 0; a < o.length; a++)
2944
- r += this.tablecell(o[a]);
2945
- s += this.tablerow({ text: r });
2946
- }
2947
- return s && (s = `<tbody>${s}</tbody>`), `<table>
2948
- <thead>
2949
- ` + n + `</thead>
2950
- ` + s + `</table>
2951
- `;
2952
- }
2953
- tablerow({ text: e }) {
2954
- return `<tr>
2955
- ${e}</tr>
2956
- `;
2957
- }
2958
- tablecell(e) {
2959
- const n = this.parser.parseInline(e.tokens), r = e.header ? "th" : "td";
2960
- return (e.align ? `<${r} align="${e.align}">` : `<${r}>`) + n + `</${r}>
2961
- `;
2962
- }
2963
- /**
2964
- * span level renderer
2965
- */
2966
- strong({ tokens: e }) {
2967
- return `<strong>${this.parser.parseInline(e)}</strong>`;
2968
- }
2969
- em({ tokens: e }) {
2970
- return `<em>${this.parser.parseInline(e)}</em>`;
2971
- }
2972
- codespan({ text: e }) {
2973
- return `<code>${e}</code>`;
2974
- }
2975
- br(e) {
2976
- return "<br>";
2977
- }
2978
- del({ tokens: e }) {
2979
- return `<del>${this.parser.parseInline(e)}</del>`;
2980
- }
2981
- link({ href: e, title: n, tokens: r }) {
2982
- const s = this.parser.parseInline(r), i = ms(e);
2983
- if (i === null)
2984
- return s;
2985
- e = i;
2986
- let o = '<a href="' + e + '"';
2987
- return n && (o += ' title="' + n + '"'), o += ">" + s + "</a>", o;
2988
- }
2989
- image({ href: e, title: n, text: r }) {
2990
- const s = ms(e);
2991
- if (s === null)
2992
- return r;
2993
- e = s;
2994
- let i = `<img src="${e}" alt="${r}"`;
2995
- return n && (i += ` title="${n}"`), i += ">", i;
2996
- }
2997
- text(e) {
2998
- return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : e.text;
2999
- }
3000
- }
3001
- class Pr {
3002
- // no need for block level renderers
3003
- strong({ text: e }) {
3004
- return e;
3005
- }
3006
- em({ text: e }) {
3007
- return e;
3008
- }
3009
- codespan({ text: e }) {
3010
- return e;
3011
- }
3012
- del({ text: e }) {
3013
- return e;
3014
- }
3015
- html({ text: e }) {
3016
- return e;
3017
- }
3018
- text({ text: e }) {
3019
- return e;
3020
- }
3021
- link({ text: e }) {
3022
- return "" + e;
3023
- }
3024
- image({ text: e }) {
3025
- return "" + e;
3026
- }
3027
- br() {
3028
- return "";
3029
- }
3030
- }
3031
- class _e {
3032
- options;
3033
- renderer;
3034
- textRenderer;
3035
- constructor(e) {
3036
- this.options = e || Ze, this.options.renderer = this.options.renderer || new yn(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Pr();
3037
- }
3038
- /**
3039
- * Static Parse Method
3040
- */
3041
- static parse(e, n) {
3042
- return new _e(n).parse(e);
3043
- }
3044
- /**
3045
- * Static Parse Inline Method
3046
- */
3047
- static parseInline(e, n) {
3048
- return new _e(n).parseInline(e);
3049
- }
3050
- /**
3051
- * Parse Loop
3052
- */
3053
- parse(e, n = !0) {
3054
- let r = "";
3055
- for (let s = 0; s < e.length; s++) {
3056
- const i = e[s];
3057
- if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[i.type]) {
3058
- const a = i, c = this.options.extensions.renderers[a.type].call({ parser: this }, a);
3059
- if (c !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(a.type)) {
3060
- r += c || "";
3061
- continue;
3062
- }
3063
- }
3064
- const o = i;
3065
- switch (o.type) {
3066
- case "space": {
3067
- r += this.renderer.space(o);
3068
- continue;
3069
- }
3070
- case "hr": {
3071
- r += this.renderer.hr(o);
3072
- continue;
3073
- }
3074
- case "heading": {
3075
- r += this.renderer.heading(o);
3076
- continue;
3077
- }
3078
- case "code": {
3079
- r += this.renderer.code(o);
3080
- continue;
3081
- }
3082
- case "table": {
3083
- r += this.renderer.table(o);
3084
- continue;
3085
- }
3086
- case "blockquote": {
3087
- r += this.renderer.blockquote(o);
3088
- continue;
3089
- }
3090
- case "list": {
3091
- r += this.renderer.list(o);
3092
- continue;
3093
- }
3094
- case "html": {
3095
- r += this.renderer.html(o);
3096
- continue;
3097
- }
3098
- case "paragraph": {
3099
- r += this.renderer.paragraph(o);
3100
- continue;
3101
- }
3102
- case "text": {
3103
- let a = o, c = this.renderer.text(a);
3104
- for (; s + 1 < e.length && e[s + 1].type === "text"; )
3105
- a = e[++s], c += `
3106
- ` + this.renderer.text(a);
3107
- n ? r += this.renderer.paragraph({
3108
- type: "paragraph",
3109
- raw: c,
3110
- text: c,
3111
- tokens: [{ type: "text", raw: c, text: c }]
3112
- }) : r += c;
3113
- continue;
3114
- }
3115
- default: {
3116
- const a = 'Token with "' + o.type + '" type was not found.';
3117
- if (this.options.silent)
3118
- return console.error(a), "";
3119
- throw new Error(a);
3120
- }
3121
- }
3122
- }
3123
- return r;
3124
- }
3125
- /**
3126
- * Parse Inline Tokens
3127
- */
3128
- parseInline(e, n) {
3129
- n = n || this.renderer;
3130
- let r = "";
3131
- for (let s = 0; s < e.length; s++) {
3132
- const i = e[s];
3133
- if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[i.type]) {
3134
- const a = this.options.extensions.renderers[i.type].call({ parser: this }, i);
3135
- if (a !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i.type)) {
3136
- r += a || "";
3137
- continue;
3138
- }
3139
- }
3140
- const o = i;
3141
- switch (o.type) {
3142
- case "escape": {
3143
- r += n.text(o);
3144
- break;
3145
- }
3146
- case "html": {
3147
- r += n.html(o);
3148
- break;
3149
- }
3150
- case "link": {
3151
- r += n.link(o);
3152
- break;
3153
- }
3154
- case "image": {
3155
- r += n.image(o);
3156
- break;
3157
- }
3158
- case "strong": {
3159
- r += n.strong(o);
3160
- break;
3161
- }
3162
- case "em": {
3163
- r += n.em(o);
3164
- break;
3165
- }
3166
- case "codespan": {
3167
- r += n.codespan(o);
3168
- break;
3169
- }
3170
- case "br": {
3171
- r += n.br(o);
3172
- break;
3173
- }
3174
- case "del": {
3175
- r += n.del(o);
3176
- break;
3177
- }
3178
- case "text": {
3179
- r += n.text(o);
3180
- break;
3181
- }
3182
- default: {
3183
- const a = 'Token with "' + o.type + '" type was not found.';
3184
- if (this.options.silent)
3185
- return console.error(a), "";
3186
- throw new Error(a);
3187
- }
3188
- }
3189
- }
3190
- return r;
3191
- }
3192
- }
3193
- class fn {
3194
- options;
3195
- block;
3196
- constructor(e) {
3197
- this.options = e || Ze;
3198
- }
3199
- static passThroughHooks = /* @__PURE__ */ new Set([
3200
- "preprocess",
3201
- "postprocess",
3202
- "processAllTokens"
3203
- ]);
3204
- /**
3205
- * Process markdown before marked
3206
- */
3207
- preprocess(e) {
3208
- return e;
3209
- }
3210
- /**
3211
- * Process HTML after marked is finished
3212
- */
3213
- postprocess(e) {
3214
- return e;
3215
- }
3216
- /**
3217
- * Process all tokens before walk tokens
3218
- */
3219
- processAllTokens(e) {
3220
- return e;
3221
- }
3222
- /**
3223
- * Provide function to tokenize markdown
3224
- */
3225
- provideLexer() {
3226
- return this.block ? me.lex : me.lexInline;
3227
- }
3228
- /**
3229
- * Provide function to parse tokens
3230
- */
3231
- provideParser() {
3232
- return this.block ? _e.parse : _e.parseInline;
3233
- }
3234
- }
3235
- class Na {
3236
- defaults = Or();
3237
- options = this.setOptions;
3238
- parse = this.parseMarkdown(!0);
3239
- parseInline = this.parseMarkdown(!1);
3240
- Parser = _e;
3241
- Renderer = yn;
3242
- TextRenderer = Pr;
3243
- Lexer = me;
3244
- Tokenizer = _n;
3245
- Hooks = fn;
3246
- constructor(...e) {
3247
- this.use(...e);
3248
- }
3249
- /**
3250
- * Run callback for every token
3251
- */
3252
- walkTokens(e, n) {
3253
- let r = [];
3254
- for (const s of e)
3255
- switch (r = r.concat(n.call(this, s)), s.type) {
3256
- case "table": {
3257
- const i = s;
3258
- for (const o of i.header)
3259
- r = r.concat(this.walkTokens(o.tokens, n));
3260
- for (const o of i.rows)
3261
- for (const a of o)
3262
- r = r.concat(this.walkTokens(a.tokens, n));
3263
- break;
3264
- }
3265
- case "list": {
3266
- const i = s;
3267
- r = r.concat(this.walkTokens(i.items, n));
3268
- break;
3269
- }
3270
- default: {
3271
- const i = s;
3272
- this.defaults.extensions?.childTokens?.[i.type] ? this.defaults.extensions.childTokens[i.type].forEach((o) => {
3273
- const a = i[o].flat(1 / 0);
3274
- r = r.concat(this.walkTokens(a, n));
3275
- }) : i.tokens && (r = r.concat(this.walkTokens(i.tokens, n)));
3276
- }
3277
- }
3278
- return r;
3279
- }
3280
- use(...e) {
3281
- const n = this.defaults.extensions || { renderers: {}, childTokens: {} };
3282
- return e.forEach((r) => {
3283
- const s = { ...r };
3284
- if (s.async = this.defaults.async || s.async || !1, r.extensions && (r.extensions.forEach((i) => {
3285
- if (!i.name)
3286
- throw new Error("extension name required");
3287
- if ("renderer" in i) {
3288
- const o = n.renderers[i.name];
3289
- o ? n.renderers[i.name] = function(...a) {
3290
- let c = i.renderer.apply(this, a);
3291
- return c === !1 && (c = o.apply(this, a)), c;
3292
- } : n.renderers[i.name] = i.renderer;
3293
- }
3294
- if ("tokenizer" in i) {
3295
- if (!i.level || i.level !== "block" && i.level !== "inline")
3296
- throw new Error("extension level must be 'block' or 'inline'");
3297
- const o = n[i.level];
3298
- o ? o.unshift(i.tokenizer) : n[i.level] = [i.tokenizer], i.start && (i.level === "block" ? n.startBlock ? n.startBlock.push(i.start) : n.startBlock = [i.start] : i.level === "inline" && (n.startInline ? n.startInline.push(i.start) : n.startInline = [i.start]));
3299
- }
3300
- "childTokens" in i && i.childTokens && (n.childTokens[i.name] = i.childTokens);
3301
- }), s.extensions = n), r.renderer) {
3302
- const i = this.defaults.renderer || new yn(this.defaults);
3303
- for (const o in r.renderer) {
3304
- if (!(o in i))
3305
- throw new Error(`renderer '${o}' does not exist`);
3306
- if (["options", "parser"].includes(o))
3307
- continue;
3308
- const a = o, c = r.renderer[a], p = i[a];
3309
- i[a] = (...h) => {
3310
- let u = c.apply(i, h);
3311
- return u === !1 && (u = p.apply(i, h)), u || "";
3312
- };
3313
- }
3314
- s.renderer = i;
3315
- }
3316
- if (r.tokenizer) {
3317
- const i = this.defaults.tokenizer || new _n(this.defaults);
3318
- for (const o in r.tokenizer) {
3319
- if (!(o in i))
3320
- throw new Error(`tokenizer '${o}' does not exist`);
3321
- if (["options", "rules", "lexer"].includes(o))
3322
- continue;
3323
- const a = o, c = r.tokenizer[a], p = i[a];
3324
- i[a] = (...h) => {
3325
- let u = c.apply(i, h);
3326
- return u === !1 && (u = p.apply(i, h)), u;
3327
- };
3328
- }
3329
- s.tokenizer = i;
3330
- }
3331
- if (r.hooks) {
3332
- const i = this.defaults.hooks || new fn();
3333
- for (const o in r.hooks) {
3334
- if (!(o in i))
3335
- throw new Error(`hook '${o}' does not exist`);
3336
- if (["options", "block"].includes(o))
3337
- continue;
3338
- const a = o, c = r.hooks[a], p = i[a];
3339
- fn.passThroughHooks.has(o) ? i[a] = (h) => {
3340
- if (this.defaults.async)
3341
- return Promise.resolve(c.call(i, h)).then((d) => p.call(i, d));
3342
- const u = c.call(i, h);
3343
- return p.call(i, u);
3344
- } : i[a] = (...h) => {
3345
- let u = c.apply(i, h);
3346
- return u === !1 && (u = p.apply(i, h)), u;
3347
- };
3348
- }
3349
- s.hooks = i;
3350
- }
3351
- if (r.walkTokens) {
3352
- const i = this.defaults.walkTokens, o = r.walkTokens;
3353
- s.walkTokens = function(a) {
3354
- let c = [];
3355
- return c.push(o.call(this, a)), i && (c = c.concat(i.call(this, a))), c;
3356
- };
3357
- }
3358
- this.defaults = { ...this.defaults, ...s };
3359
- }), this;
3360
- }
3361
- setOptions(e) {
3362
- return this.defaults = { ...this.defaults, ...e }, this;
3363
- }
3364
- lexer(e, n) {
3365
- return me.lex(e, n ?? this.defaults);
3366
- }
3367
- parser(e, n) {
3368
- return _e.parse(e, n ?? this.defaults);
3369
- }
3370
- parseMarkdown(e) {
3371
- return (r, s) => {
3372
- const i = { ...s }, o = { ...this.defaults, ...i }, a = this.onError(!!o.silent, !!o.async);
3373
- if (this.defaults.async === !0 && i.async === !1)
3374
- return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
3375
- if (typeof r > "u" || r === null)
3376
- return a(new Error("marked(): input parameter is undefined or null"));
3377
- if (typeof r != "string")
3378
- return a(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(r) + ", string expected"));
3379
- o.hooks && (o.hooks.options = o, o.hooks.block = e);
3380
- const c = o.hooks ? o.hooks.provideLexer() : e ? me.lex : me.lexInline, p = o.hooks ? o.hooks.provideParser() : e ? _e.parse : _e.parseInline;
3381
- if (o.async)
3382
- return Promise.resolve(o.hooks ? o.hooks.preprocess(r) : r).then((h) => c(h, o)).then((h) => o.hooks ? o.hooks.processAllTokens(h) : h).then((h) => o.walkTokens ? Promise.all(this.walkTokens(h, o.walkTokens)).then(() => h) : h).then((h) => p(h, o)).then((h) => o.hooks ? o.hooks.postprocess(h) : h).catch(a);
3383
- try {
3384
- o.hooks && (r = o.hooks.preprocess(r));
3385
- let h = c(r, o);
3386
- o.hooks && (h = o.hooks.processAllTokens(h)), o.walkTokens && this.walkTokens(h, o.walkTokens);
3387
- let u = p(h, o);
3388
- return o.hooks && (u = o.hooks.postprocess(u)), u;
3389
- } catch (h) {
3390
- return a(h);
3391
- }
3392
- };
3393
- }
3394
- onError(e, n) {
3395
- return (r) => {
3396
- if (r.message += `
3397
- Please report this to https://github.com/markedjs/marked.`, e) {
3398
- const s = "<p>An error occurred:</p><pre>" + de(r.message + "", !0) + "</pre>";
3399
- return n ? Promise.resolve(s) : s;
3400
- }
3401
- if (n)
3402
- return Promise.reject(r);
3403
- throw r;
3404
- };
3405
- }
3406
- }
3407
- const Ye = new Na();
3408
- function L(t, e) {
3409
- return Ye.parse(t, e);
3410
- }
3411
- L.options = L.setOptions = function(t) {
3412
- return Ye.setOptions(t), L.defaults = Ye.defaults, Ti(L.defaults), L;
3413
- };
3414
- L.getDefaults = Or;
3415
- L.defaults = Ze;
3416
- L.use = function(...t) {
3417
- return Ye.use(...t), L.defaults = Ye.defaults, Ti(L.defaults), L;
3418
- };
3419
- L.walkTokens = function(t, e) {
3420
- return Ye.walkTokens(t, e);
3421
- };
3422
- L.parseInline = Ye.parseInline;
3423
- L.Parser = _e;
3424
- L.parser = _e.parse;
3425
- L.Renderer = yn;
3426
- L.TextRenderer = Pr;
3427
- L.Lexer = me;
3428
- L.lexer = me.lex;
3429
- L.Tokenizer = _n;
3430
- L.Hooks = fn;
3431
- L.parse = L;
3432
- L.options;
3433
- L.setOptions;
3434
- L.use;
3435
- L.walkTokens;
3436
- L.parseInline;
3437
- _e.parse;
3438
- me.lex;
3439
- function ws(t, e) {
3440
- (e == null || e > t.length) && (e = t.length);
3441
- for (var n = 0, r = Array(e); n < e; n++) r[n] = t[n];
3442
- return r;
3443
- }
3444
- function Ia(t) {
3445
- if (Array.isArray(t)) return t;
3446
- }
3447
- function Da(t, e) {
3448
- var n = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
3449
- if (n != null) {
3450
- var r, s, i, o, a = [], c = !0, p = !1;
3451
- try {
3452
- if (i = (n = n.call(t)).next, e !== 0) for (; !(c = (r = i.call(n)).done) && (a.push(r.value), a.length !== e); c = !0) ;
3453
- } catch (h) {
3454
- p = !0, s = h;
3455
- } finally {
3456
- try {
3457
- if (!c && n.return != null && (o = n.return(), Object(o) !== o)) return;
3458
- } finally {
3459
- if (p) throw s;
3460
- }
3461
- }
3462
- return a;
3463
- }
3464
- }
3465
- function Ca() {
3466
- throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3467
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
3468
- }
3469
- function Ma(t, e) {
3470
- return Ia(t) || Da(t, e) || Pa(t, e) || Ca();
3471
- }
3472
- function Pa(t, e) {
3473
- if (t) {
3474
- if (typeof t == "string") return ws(t, e);
3475
- var n = {}.toString.call(t).slice(8, -1);
3476
- return n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set" ? Array.from(t) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? ws(t, e) : void 0;
3477
- }
3478
- }
3479
- const Di = Object.entries, Es = Object.setPrototypeOf, $a = Object.isFrozen, La = Object.getPrototypeOf, za = Object.getOwnPropertyDescriptor;
3480
- let re = Object.freeze, ie = Object.seal, ct = Object.create, Ci = typeof Reflect < "u" && Reflect, gr = Ci.apply, mr = Ci.construct;
3481
- re || (re = function(e) {
3482
- return e;
3483
- });
3484
- ie || (ie = function(e) {
3485
- return e;
3486
- });
3487
- gr || (gr = function(e, n) {
3488
- for (var r = arguments.length, s = new Array(r > 2 ? r - 2 : 0), i = 2; i < r; i++)
3489
- s[i - 2] = arguments[i];
3490
- return e.apply(n, s);
3491
- });
3492
- mr || (mr = function(e) {
3493
- for (var n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), s = 1; s < n; s++)
3494
- r[s - 1] = arguments[s];
3495
- return new e(...r);
3496
- });
3497
- const st = Q(Array.prototype.forEach), Fa = Q(Array.prototype.lastIndexOf), Ts = Q(Array.prototype.pop), it = Q(Array.prototype.push), ja = Q(Array.prototype.splice), Ve = Array.isArray, Ot = Q(String.prototype.toLowerCase), er = Q(String.prototype.toString), ks = Q(String.prototype.match), At = Q(String.prototype.replace), xs = Q(String.prototype.indexOf), Va = Q(String.prototype.trim), Ha = Q(Number.prototype.toString), Ua = Q(Boolean.prototype.toString), Ss = typeof BigInt > "u" ? null : Q(BigInt.prototype.toString), vs = typeof Symbol > "u" ? null : Q(Symbol.prototype.toString), ee = Q(Object.prototype.hasOwnProperty), Rt = Q(Object.prototype.toString), J = Q(RegExp.prototype.test), Be = Ba(TypeError);
3498
- function Q(t) {
3499
- return function(e) {
3500
- e instanceof RegExp && (e.lastIndex = 0);
3501
- for (var n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), s = 1; s < n; s++)
3502
- r[s - 1] = arguments[s];
3503
- return gr(t, e, r);
3504
- };
3505
- }
3506
- function Ba(t) {
3507
- return function() {
3508
- for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++)
3509
- n[r] = arguments[r];
3510
- return mr(t, n);
3511
- };
3512
- }
3513
- function C(t, e) {
3514
- let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Ot;
3515
- if (Es && Es(t, null), !Ve(e))
3516
- return t;
3517
- let r = e.length;
3518
- for (; r--; ) {
3519
- let s = e[r];
3520
- if (typeof s == "string") {
3521
- const i = n(s);
3522
- i !== s && ($a(e) || (e[r] = i), s = i);
3523
- }
3524
- t[s] = !0;
3525
- }
3526
- return t;
3527
- }
3528
- function Wa(t) {
3529
- for (let e = 0; e < t.length; e++)
3530
- ee(t, e) || (t[e] = null);
3531
- return t;
3532
- }
3533
- function oe(t) {
3534
- const e = ct(null);
3535
- for (const r of Di(t)) {
3536
- var n = Ma(r, 2);
3537
- const s = n[0], i = n[1];
3538
- ee(t, s) && (Ve(i) ? e[s] = Wa(i) : i && typeof i == "object" && i.constructor === Object ? e[s] = oe(i) : e[s] = i);
3539
- }
3540
- return e;
3541
- }
3542
- function Ga(t) {
3543
- switch (typeof t) {
3544
- case "string":
3545
- return t;
3546
- case "number":
3547
- return Ha(t);
3548
- case "boolean":
3549
- return Ua(t);
3550
- case "bigint":
3551
- return Ss ? Ss(t) : "0";
3552
- case "symbol":
3553
- return vs ? vs(t) : "Symbol()";
3554
- case "undefined":
3555
- return Rt(t);
3556
- case "function":
3557
- case "object": {
3558
- if (t === null)
3559
- return Rt(t);
3560
- const e = t, n = be(e, "toString");
3561
- if (typeof n == "function") {
3562
- const r = n(e);
3563
- return typeof r == "string" ? r : Rt(r);
3564
- }
3565
- return Rt(t);
3566
- }
3567
- default:
3568
- return Rt(t);
3569
- }
3570
- }
3571
- function be(t, e) {
3572
- for (; t !== null; ) {
3573
- const r = za(t, e);
3574
- if (r) {
3575
- if (r.get)
3576
- return Q(r.get);
3577
- if (typeof r.value == "function")
3578
- return Q(r.value);
3579
- }
3580
- t = La(t);
3581
- }
3582
- function n() {
3583
- return null;
3584
- }
3585
- return n;
3586
- }
3587
- function qa(t) {
3588
- try {
3589
- return J(t, ""), !0;
3590
- } catch {
3591
- return !1;
3592
- }
3593
- }
3594
- const As = re(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), tr = re(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), nr = re(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), Ka = re(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), rr = re(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), Ya = re(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Rs = re(["#text"]), Os = re(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "command", "commandfor", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]), sr = re(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dominant-baseline", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-orientation", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), Ns = re(["accent", "accentunder", "align", "bevelled", "close", "columnalign", "columnlines", "columnspacing", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lquote", "lspace", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), ln = re(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Za = ie(/{{[\w\W]*|^[\w\W]*}}/g), Xa = ie(/<%[\w\W]*|^[\w\W]*%>/g), Qa = ie(/\${[\w\W]*/g), Ja = ie(/^data-[\-\w.\u00B7-\uFFFF]+$/), ec = ie(/^aria-[\-\w]+$/), Is = ie(
3595
- /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
3596
- // eslint-disable-line no-useless-escape
3597
- ), tc = ie(/^(?:\w+script|data):/i), nc = ie(
3598
- /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
3599
- // eslint-disable-line no-control-regex
3600
- ), rc = ie(/^html$/i), sc = ie(/^[a-z][.\w]*(-[.\w]+)+$/i), Ds = ie(/<[/\w!]/g), Cs = ie(/<[/\w]/g), ic = ie(/<\/no(script|embed|frames)/i), oc = ie(/\/>/i), pe = {
3601
- element: 1,
3602
- attribute: 2,
3603
- text: 3,
3604
- cdataSection: 4,
3605
- entityReference: 5,
3606
- // Deprecated
3607
- entityNode: 6,
3608
- // Deprecated
3609
- processingInstruction: 7,
3610
- comment: 8,
3611
- document: 9,
3612
- documentType: 10,
3613
- documentFragment: 11,
3614
- notation: 12
3615
- // Deprecated
3616
- }, lc = function() {
3617
- return typeof window > "u" ? null : window;
3618
- }, ac = function(e, n) {
3619
- if (typeof e != "object" || typeof e.createPolicy != "function")
3620
- return null;
3621
- let r = null;
3622
- const s = "data-tt-policy-suffix";
3623
- n && n.hasAttribute(s) && (r = n.getAttribute(s));
3624
- const i = "dompurify" + (r ? "#" + r : "");
3625
- try {
3626
- return e.createPolicy(i, {
3627
- createHTML(o) {
3628
- return o;
3629
- },
3630
- createScriptURL(o) {
3631
- return o;
3632
- }
3633
- });
3634
- } catch {
3635
- return console.warn("TrustedTypes policy " + i + " could not be created."), null;
3636
- }
3637
- }, Ms = function() {
3638
- return {
3639
- afterSanitizeAttributes: [],
3640
- afterSanitizeElements: [],
3641
- afterSanitizeShadowDOM: [],
3642
- beforeSanitizeAttributes: [],
3643
- beforeSanitizeElements: [],
3644
- beforeSanitizeShadowDOM: [],
3645
- uponSanitizeAttribute: [],
3646
- uponSanitizeElement: [],
3647
- uponSanitizeShadowNode: []
3648
- };
3649
- }, Le = function(e, n, r, s) {
3650
- return ee(e, n) && Ve(e[n]) ? C(s.base ? oe(s.base) : {}, e[n], s.transform) : r;
3651
- };
3652
- function Mi() {
3653
- let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : lc();
3654
- const e = (b) => Mi(b);
3655
- if (e.version = "3.4.13", e.removed = [], !t || !t.document || t.document.nodeType !== pe.document || !t.Element)
3656
- return e.isSupported = !1, e;
3657
- let n = t.document;
3658
- const r = n, s = r.currentScript;
3659
- t.DocumentFragment;
3660
- const i = t.HTMLTemplateElement, o = t.Node, a = t.Element, c = t.NodeFilter, p = t.NamedNodeMap;
3661
- p === void 0 && (t.NamedNodeMap || t.MozNamedAttrMap), t.HTMLFormElement;
3662
- const h = t.DOMParser, u = t.trustedTypes, d = a.prototype, m = be(d, "cloneNode"), y = be(d, "remove"), A = be(d, "nextSibling"), P = be(d, "childNodes"), j = be(d, "parentNode"), Y = be(d, "shadowRoot"), E = be(d, "attributes"), _ = o && o.prototype ? be(o.prototype, "nodeType") : null, T = o && o.prototype ? be(o.prototype, "nodeName") : null, S = o && o.prototype ? be(o.prototype, "ownerDocument") : null;
3663
- if (typeof i == "function") {
3664
- const b = n.createElement("template");
3665
- b.content && b.content.ownerDocument && (n = b.content.ownerDocument);
3666
- }
3667
- let w, I = "", O, D = !1, M = 0;
3668
- const v = function() {
3669
- if (M > 0)
3670
- throw Be('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');
3671
- }, Z = function(l) {
3672
- v(), M++;
3673
- try {
3674
- return w.createHTML(l);
3675
- } finally {
3676
- M--;
3677
- }
3678
- }, Xe = function(l) {
3679
- v(), M++;
3680
- try {
3681
- return w.createScriptURL(l);
3682
- } finally {
3683
- M--;
3684
- }
3685
- }, Nn = function() {
3686
- return D || (O = ac(u, s), D = !0), O;
3687
- }, Ut = n, In = Ut.implementation, $r = Ut.createNodeIterator, $i = Ut.createDocumentFragment, Li = Ut.getElementsByTagName, zi = r.importNode;
3688
- let V = Ms();
3689
- e.isSupported = typeof Di == "function" && typeof j == "function" && In && In.createHTMLDocument !== void 0;
3690
- const Fi = Za, ji = Xa, Vi = Qa, Hi = Ja, Ui = ec, Bi = tc, Lr = nc, Wi = sc;
3691
- let zr = Is, H = null;
3692
- const Dn = C({}, [...As, ...tr, ...nr, ...rr, ...Rs]);
3693
- let U = null;
3694
- const Cn = C({}, [...Os, ...sr, ...Ns, ...ln]);
3695
- let q = Object.seal(ct(null, {
3696
- tagNameCheck: {
3697
- writable: !0,
3698
- configurable: !1,
3699
- enumerable: !0,
3700
- value: null
3701
- },
3702
- attributeNameCheck: {
3703
- writable: !0,
3704
- configurable: !1,
3705
- enumerable: !0,
3706
- value: null
3707
- },
3708
- allowCustomizedBuiltInElements: {
3709
- writable: !0,
3710
- configurable: !1,
3711
- enumerable: !0,
3712
- value: !1
3713
- }
3714
- })), wt = null, Fr = null;
3715
- const Ce = Object.seal(ct(null, {
3716
- tagCheck: {
3717
- writable: !0,
3718
- configurable: !1,
3719
- enumerable: !0,
3720
- value: null
3721
- },
3722
- attributeCheck: {
3723
- writable: !0,
3724
- configurable: !1,
3725
- enumerable: !0,
3726
- value: null
3727
- }
3728
- }));
3729
- let jr = !0, Mn = !0, Vr = !1, Hr = !0, Me = !1, Pe = !0, He = !1, Pn = !1, Bt = null, Wt = null, $n = !1, Qe = !1, Gt = !1, qt = !1, Ur = !0, Br = !1;
3730
- const Wr = "user-content-";
3731
- let Ln = !0, Kt = !1, Je = {}, Ee = null;
3732
- const zn = C({}, [
3733
- "annotation-xml",
3734
- "audio",
3735
- "colgroup",
3736
- "desc",
3737
- "foreignobject",
3738
- "head",
3739
- "iframe",
3740
- "math",
3741
- "mi",
3742
- "mn",
3743
- "mo",
3744
- "ms",
3745
- "mtext",
3746
- "noembed",
3747
- "noframes",
3748
- "noscript",
3749
- "plaintext",
3750
- "script",
3751
- // <selectedcontent> mirrors the selected <option>'s subtree, cloned by
3752
- // the UA (customizable <select>) — including any on* handlers — and the
3753
- // engine re-mirrors synchronously whenever a removal changes which
3754
- // option/selectedcontent is current, even inside DOMPurify's inert
3755
- // DOMParser document. Hoisting its children on removal re-inserts a fresh
3756
- // mirror target ahead of the walk, which the engine refills, looping
3757
- // forever (DoS) and amplifying output. Dropping its content on removal
3758
- // (rather than hoisting) breaks that cascade; the content is a duplicate
3759
- // of the option, which is sanitized on its own. See campaign-3 F1/F6.
3760
- "selectedcontent",
3761
- "style",
3762
- "svg",
3763
- "template",
3764
- "thead",
3765
- "title",
3766
- "video",
3767
- "xmp"
3768
- ]);
3769
- let Gr = null;
3770
- const qr = C({}, ["audio", "video", "img", "source", "image", "track"]);
3771
- let Fn = null;
3772
- const Kr = C({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Yt = "http://www.w3.org/1998/Math/MathML", Zt = "http://www.w3.org/2000/svg", Te = "http://www.w3.org/1999/xhtml";
3773
- let et = Te, jn = !1, Vn = null;
3774
- const Gi = C({}, [Yt, Zt, Te], er), Yr = re(["mi", "mo", "mn", "ms", "mtext"]);
3775
- let Hn = C({}, Yr);
3776
- const Zr = re(["annotation-xml"]);
3777
- let Un = C({}, Zr);
3778
- const qi = C({}, ["title", "style", "font", "a", "script"]);
3779
- let Et = null;
3780
- const Ki = ["application/xhtml+xml", "text/html"], Yi = "text/html";
3781
- let B = null, tt = null;
3782
- const Zi = n.createElement("form"), Xr = function(l) {
3783
- return l instanceof RegExp || l instanceof Function;
3784
- }, Bn = function() {
3785
- let l = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
3786
- if (tt && tt === l)
3787
- return;
3788
- (!l || typeof l != "object") && (l = {}), l = oe(l), Et = // eslint-disable-next-line unicorn/prefer-includes
3789
- Ki.indexOf(l.PARSER_MEDIA_TYPE) === -1 ? Yi : l.PARSER_MEDIA_TYPE, B = Et === "application/xhtml+xml" ? er : Ot, H = Le(l, "ALLOWED_TAGS", Dn, {
3790
- transform: B
3791
- }), U = Le(l, "ALLOWED_ATTR", Cn, {
3792
- transform: B
3793
- }), Vn = Le(l, "ALLOWED_NAMESPACES", Gi, {
3794
- transform: er
3795
- }), Fn = Le(l, "ADD_URI_SAFE_ATTR", Kr, {
3796
- transform: B,
3797
- base: Kr
3798
- }), Gr = Le(l, "ADD_DATA_URI_TAGS", qr, {
3799
- transform: B,
3800
- base: qr
3801
- }), Ee = Le(l, "FORBID_CONTENTS", zn, {
3802
- transform: B
3803
- }), wt = Le(l, "FORBID_TAGS", oe({}), {
3804
- transform: B
3805
- }), Fr = Le(l, "FORBID_ATTR", oe({}), {
3806
- transform: B
3807
- }), Je = ee(l, "USE_PROFILES") ? l.USE_PROFILES && typeof l.USE_PROFILES == "object" ? oe(l.USE_PROFILES) : l.USE_PROFILES : !1, jr = l.ALLOW_ARIA_ATTR !== !1, Mn = l.ALLOW_DATA_ATTR !== !1, Vr = l.ALLOW_UNKNOWN_PROTOCOLS || !1, Hr = l.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Me = l.SAFE_FOR_TEMPLATES || !1, Pe = l.SAFE_FOR_XML !== !1, He = l.WHOLE_DOCUMENT || !1, Qe = l.RETURN_DOM || !1, Gt = l.RETURN_DOM_FRAGMENT || !1, qt = l.RETURN_TRUSTED_TYPE || !1, $n = l.FORCE_BODY || !1, Ur = l.SANITIZE_DOM !== !1, Br = l.SANITIZE_NAMED_PROPS || !1, Ln = l.KEEP_CONTENT !== !1, Kt = l.IN_PLACE || !1, zr = qa(l.ALLOWED_URI_REGEXP) ? l.ALLOWED_URI_REGEXP : Is, et = typeof l.NAMESPACE == "string" ? l.NAMESPACE : Te, Hn = ee(l, "MATHML_TEXT_INTEGRATION_POINTS") && l.MATHML_TEXT_INTEGRATION_POINTS && typeof l.MATHML_TEXT_INTEGRATION_POINTS == "object" ? oe(l.MATHML_TEXT_INTEGRATION_POINTS) : C({}, Yr), Un = ee(l, "HTML_INTEGRATION_POINTS") && l.HTML_INTEGRATION_POINTS && typeof l.HTML_INTEGRATION_POINTS == "object" ? oe(l.HTML_INTEGRATION_POINTS) : C({}, Zr);
3808
- const f = ee(l, "CUSTOM_ELEMENT_HANDLING") && l.CUSTOM_ELEMENT_HANDLING && typeof l.CUSTOM_ELEMENT_HANDLING == "object" ? oe(l.CUSTOM_ELEMENT_HANDLING) : ct(null);
3809
- if (q = ct(null), ee(f, "tagNameCheck") && Xr(f.tagNameCheck) && (q.tagNameCheck = f.tagNameCheck), ee(f, "attributeNameCheck") && Xr(f.attributeNameCheck) && (q.attributeNameCheck = f.attributeNameCheck), ee(f, "allowCustomizedBuiltInElements") && typeof f.allowCustomizedBuiltInElements == "boolean" && (q.allowCustomizedBuiltInElements = f.allowCustomizedBuiltInElements), ie(q), Me && (Mn = !1), Gt && (Qe = !0), Je && (H = C({}, Rs), U = ct(null), Je.html === !0 && (C(H, As), C(U, Os)), Je.svg === !0 && (C(H, tr), C(U, sr), C(U, ln)), Je.svgFilters === !0 && (C(H, nr), C(U, sr), C(U, ln)), Je.mathMl === !0 && (C(H, rr), C(U, Ns), C(U, ln))), Ce.tagCheck = null, Ce.attributeCheck = null, ee(l, "ADD_TAGS") && (typeof l.ADD_TAGS == "function" ? Ce.tagCheck = l.ADD_TAGS : Ve(l.ADD_TAGS) && (H === Dn && (H = oe(H)), C(H, l.ADD_TAGS, B))), ee(l, "ADD_ATTR") && (typeof l.ADD_ATTR == "function" ? Ce.attributeCheck = l.ADD_ATTR : Ve(l.ADD_ATTR) && (U === Cn && (U = oe(U)), C(U, l.ADD_ATTR, B))), ee(l, "ADD_URI_SAFE_ATTR") && Ve(l.ADD_URI_SAFE_ATTR) && C(Fn, l.ADD_URI_SAFE_ATTR, B), ee(l, "FORBID_CONTENTS") && Ve(l.FORBID_CONTENTS) && (Ee === zn && (Ee = oe(Ee)), C(Ee, l.FORBID_CONTENTS, B)), ee(l, "ADD_FORBID_CONTENTS") && Ve(l.ADD_FORBID_CONTENTS) && (Ee === zn && (Ee = oe(Ee)), C(Ee, l.ADD_FORBID_CONTENTS, B)), Ln && (H["#text"] = !0), He && C(H, ["html", "head", "body"]), H.table && (C(H, ["tbody"]), delete wt.tbody), l.TRUSTED_TYPES_POLICY) {
3810
- if (typeof l.TRUSTED_TYPES_POLICY.createHTML != "function")
3811
- throw Be('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
3812
- if (typeof l.TRUSTED_TYPES_POLICY.createScriptURL != "function")
3813
- throw Be('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
3814
- const g = w;
3815
- w = l.TRUSTED_TYPES_POLICY;
3816
- try {
3817
- I = Z("");
3818
- } catch (k) {
3819
- throw w = g, k;
3820
- }
3821
- } else l.TRUSTED_TYPES_POLICY === null ? (w = void 0, I = "") : (w === void 0 && (w = Nn()), w && typeof I == "string" && (I = Z("")));
3822
- re && re(l), tt = l;
3823
- }, Qr = C({}, [...tr, ...nr, ...Ka]), Jr = C({}, [...rr, ...Ya]), Xi = function(l, f, g) {
3824
- return f.namespaceURI === Te ? l === "svg" : f.namespaceURI === Yt ? l === "svg" && (g === "annotation-xml" || Hn[g]) : !!Qr[l];
3825
- }, Qi = function(l, f, g) {
3826
- return f.namespaceURI === Te ? l === "math" : f.namespaceURI === Zt ? l === "math" && Un[g] : !!Jr[l];
3827
- }, Ji = function(l, f, g) {
3828
- return f.namespaceURI === Zt && !Un[g] || f.namespaceURI === Yt && !Hn[g] ? !1 : !Jr[l] && (qi[l] || !Qr[l]);
3829
- }, eo = function(l) {
3830
- let f = j(l);
3831
- (!f || !f.tagName) && (f = {
3832
- namespaceURI: et,
3833
- tagName: "template"
3834
- });
3835
- const g = Ot(l.tagName), k = Ot(f.tagName);
3836
- return Vn[l.namespaceURI] ? l.namespaceURI === Zt ? Xi(g, f, k) : l.namespaceURI === Yt ? Qi(g, f, k) : l.namespaceURI === Te ? Ji(g, f, k) : !!(Et === "application/xhtml+xml" && Vn[l.namespaceURI]) : !1;
3837
- }, $e = function(l) {
3838
- it(e.removed, {
3839
- element: l
3840
- });
3841
- try {
3842
- j(l).removeChild(l);
3843
- } catch {
3844
- if (y(l), !j(l))
3845
- throw Be("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
3846
- }
3847
- }, Xt = function(l) {
3848
- Tt(l);
3849
- const f = P(l);
3850
- if (f) {
3851
- const k = [];
3852
- st(f, (x) => {
3853
- it(k, x);
3854
- }), st(k, (x) => {
3855
- try {
3856
- y(x);
3857
- } catch {
3858
- }
3859
- });
3860
- }
3861
- const g = E(l);
3862
- if (g)
3863
- for (let k = g.length - 1; k >= 0; --k) {
3864
- const x = g[k], R = x && x.name;
3865
- if (typeof R == "string")
3866
- try {
3867
- l.removeAttribute(R);
3868
- } catch {
3869
- }
3870
- }
3871
- }, Ue = function(l, f) {
3872
- try {
3873
- it(e.removed, {
3874
- attribute: f.getAttributeNode(l),
3875
- from: f
3876
- });
3877
- } catch {
3878
- it(e.removed, {
3879
- attribute: null,
3880
- from: f
3881
- });
3882
- }
3883
- if (f.removeAttribute(l), l === "is")
3884
- if (Qe || Gt)
3885
- try {
3886
- $e(f);
3887
- } catch {
3888
- }
3889
- else
3890
- try {
3891
- f.setAttribute(l, "");
3892
- } catch {
3893
- }
3894
- }, to = function(l) {
3895
- const f = E(l);
3896
- if (f)
3897
- for (let g = f.length - 1; g >= 0; --g) {
3898
- const k = f[g], x = k && k.name;
3899
- if (!(typeof x != "string" || U[B(x)]))
3900
- try {
3901
- l.removeAttribute(x);
3902
- } catch {
3903
- }
3904
- }
3905
- }, Tt = function(l) {
3906
- const f = [l];
3907
- for (; f.length > 0; ) {
3908
- const g = f.pop();
3909
- (_ ? _(g) : g.nodeType) === pe.element && to(g);
3910
- const x = P(g);
3911
- if (x)
3912
- for (let R = x.length - 1; R >= 0; --R)
3913
- f.push(x[R]);
3914
- }
3915
- }, no = function(l) {
3916
- if (!Pe)
3917
- return;
3918
- const f = [l];
3919
- for (; f.length > 0; ) {
3920
- const g = f.pop(), k = _ ? _(g) : g.nodeType;
3921
- if (k === pe.processingInstruction || k === pe.comment && J(Cs, g.data)) {
3922
- try {
3923
- y(g);
3924
- } catch {
3925
- }
3926
- continue;
3927
- }
3928
- if (k === pe.element) {
3929
- const R = g, z = B(T ? T(g) : g.nodeName);
3930
- try {
3931
- R.hasAttribute && R.hasAttribute("patchsrc") && R.removeAttribute("patchsrc"), R.hasAttribute && R.hasAttribute("for") && z !== "label" && z !== "output" && R.removeAttribute("for");
3932
- } catch {
3933
- }
3934
- }
3935
- const x = P(g);
3936
- if (x)
3937
- for (let R = x.length - 1; R >= 0; --R)
3938
- f.push(x[R]);
3939
- }
3940
- }, es = function(l) {
3941
- let f = null, g = null;
3942
- if ($n)
3943
- l = "<remove></remove>" + l;
3944
- else {
3945
- const R = ks(l, /^[\r\n\t ]+/);
3946
- g = R && R[0];
3947
- }
3948
- Et === "application/xhtml+xml" && et === Te && (l = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + l + "</body></html>");
3949
- const k = w ? Z(l) : l;
3950
- if (et === Te)
3951
- try {
3952
- f = new h().parseFromString(k, Et);
3953
- } catch {
3954
- }
3955
- if (!f || !f.documentElement) {
3956
- f = In.createDocument(et, "template", null);
3957
- try {
3958
- f.documentElement.innerHTML = jn ? I : k;
3959
- } catch {
3960
- }
3961
- }
3962
- const x = f.body || f.documentElement;
3963
- return l && g && x.insertBefore(n.createTextNode(g), x.childNodes[0] || null), et === Te ? Li.call(f, He ? "html" : "body")[0] : He ? f.documentElement : x;
3964
- }, ts = function(l) {
3965
- const f = S ? S(l) : l.ownerDocument;
3966
- return $r.call(
3967
- f || l,
3968
- l,
3969
- // eslint-disable-next-line no-bitwise
3970
- c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION,
3971
- null
3972
- );
3973
- }, Qt = function(l) {
3974
- return l = At(l, Fi, " "), l = At(l, ji, " "), l = At(l, Vi, " "), l;
3975
- }, Wn = function(l) {
3976
- var f;
3977
- l.normalize();
3978
- const g = S ? S(l) : l.ownerDocument, k = $r.call(
3979
- g || l,
3980
- l,
3981
- // eslint-disable-next-line no-bitwise
3982
- c.SHOW_TEXT | c.SHOW_COMMENT | c.SHOW_CDATA_SECTION | c.SHOW_PROCESSING_INSTRUCTION,
3983
- null
3984
- );
3985
- let x = k.nextNode();
3986
- for (; x; )
3987
- x.data = Qt(x.data), x = k.nextNode();
3988
- const R = (f = l.querySelectorAll) === null || f === void 0 ? void 0 : f.call(l, "template");
3989
- R && st(R, (z) => {
3990
- nt(z.content) && Wn(z.content);
3991
- });
3992
- }, Jt = function(l) {
3993
- const f = T ? T(l) : null;
3994
- return typeof f != "string" || B(f) !== "form" ? !1 : typeof l.nodeName != "string" || typeof l.textContent != "string" || typeof l.removeChild != "function" || // Realm-safe NamedNodeMap detection: equality against the cached
3995
- // prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
3996
- // makes the direct read diverge from the cached read; a clean form
3997
- // (same-realm OR foreign-realm) has both reads pointing at the same
3998
- // canonical NamedNodeMap.
3999
- l.attributes !== E(l) || typeof l.removeAttribute != "function" || typeof l.setAttribute != "function" || typeof l.namespaceURI != "string" || typeof l.insertBefore != "function" || typeof l.hasChildNodes != "function" || // NodeType clobbering probe. Cached Node.prototype.nodeType getter
4000
- // returns the integer 1 for any Element regardless of realm; direct
4001
- // read on a clobbered form (e.g. <input name="nodeType">) returns
4002
- // the named child element. Cheap addition — nodeType is read from
4003
- // an internal slot, no serialization cost — and removes a residual
4004
- // clobbering surface used by several mXSS / PI / comment branches
4005
- // in _sanitizeElements that compare currentNode.nodeType directly.
4006
- l.nodeType !== _(l) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
4007
- // "childNodes" shadows the prototype getter. Direct reads of
4008
- // form.childNodes from a clobbered form return the named child
4009
- // instead of the real NodeList, so any walk that reads it directly
4010
- // skips the form's real children. Compare the direct read to the
4011
- // cached Node.prototype getter — when the form's named-property
4012
- // getter intercepts the read, the two values differ and we flag
4013
- // the form. This catches every clobbering child type (input,
4014
- // select, etc.) regardless of whether the named child happens to
4015
- // carry a numeric .length, which a typeof-based probe would miss
4016
- // (e.g. HTMLSelectElement.length is a defined unsigned-long).
4017
- l.childNodes !== P(l);
4018
- }, nt = function(l) {
4019
- if (!_ || typeof l != "object" || l === null)
4020
- return !1;
4021
- try {
4022
- return _(l) === pe.documentFragment;
4023
- } catch {
4024
- return !1;
4025
- }
4026
- }, kt = function(l) {
4027
- if (!_ || typeof l != "object" || l === null)
4028
- return !1;
4029
- try {
4030
- return typeof _(l) == "number";
4031
- } catch {
4032
- return !1;
4033
- }
4034
- };
4035
- function ke(b, l, f) {
4036
- b.length !== 0 && st(b, (g) => {
4037
- g.call(e, l, f, tt);
4038
- });
4039
- }
4040
- const ro = function(l, f) {
4041
- return !!(Pe && l.hasChildNodes() && !kt(l.firstElementChild) && J(Ds, l.textContent) && J(Ds, l.innerHTML) || Pe && l.namespaceURI === Te && f === "style" && kt(l.firstElementChild) || l.nodeType === pe.processingInstruction || Pe && l.nodeType === pe.comment && J(Cs, l.data));
4042
- }, so = function(l, f, g) {
4043
- if (!wt[f] && is(f) && (q.tagNameCheck instanceof RegExp && J(q.tagNameCheck, f) || q.tagNameCheck instanceof Function && q.tagNameCheck(f)))
4044
- return !1;
4045
- if (Ln && !Ee[f]) {
4046
- const k = j(l), x = P(l);
4047
- if (x && k) {
4048
- const R = x.length;
4049
- for (let z = R - 1; z >= 0; --z) {
4050
- const W = l === g ? m(x[z], !0) : x[z];
4051
- k.insertBefore(W, A(l));
4052
- }
4053
- }
4054
- }
4055
- return $e(l), !0;
4056
- }, ns = function(l, f, g, k) {
4057
- return l.length === 0 ? f : f === g || f === k ? oe(f) : f;
4058
- }, rs = function(l, f) {
4059
- if (ke(V.beforeSanitizeElements, l, null), l !== f && j(l) === null)
4060
- return Kt && Tt(l), !0;
4061
- if (Jt(l))
4062
- return $e(l), !0;
4063
- const g = B(T ? T(l) : l.nodeName);
4064
- if (H = ns(V.uponSanitizeElement, H, Dn, Bt), ke(V.uponSanitizeElement, l, {
4065
- tagName: g,
4066
- allowedTags: H
4067
- }), l !== f && j(l) === null)
4068
- return Kt && Tt(l), !0;
4069
- if (ro(l, g))
4070
- return $e(l), !0;
4071
- if (wt[g] || !(Ce.tagCheck instanceof Function && Ce.tagCheck(g)) && !H[g]) {
4072
- const x = so(l, g, f);
4073
- return x === !1 && ke(V.afterSanitizeElements, l, null), x;
4074
- }
4075
- if ((_ ? _(l) : l.nodeType) === pe.element && !eo(l) || (g === "noscript" || g === "noembed" || g === "noframes") && J(ic, l.innerHTML))
4076
- return $e(l), !0;
4077
- if (Me && l.nodeType === pe.text) {
4078
- const x = Qt(l.textContent);
4079
- l.textContent !== x && (it(e.removed, {
4080
- element: l.cloneNode()
4081
- }), l.textContent = x);
4082
- }
4083
- return ke(V.afterSanitizeElements, l, null), !1;
4084
- }, ss = function(l, f, g) {
4085
- if (Fr[f] || Pe && f === "patchsrc" || Pe && f === "for" && l !== "label" && l !== "output" || Ur && (f === "id" || f === "name") && (g in n || g in Zi))
4086
- return !1;
4087
- const k = U[f] || Ce.attributeCheck instanceof Function && Ce.attributeCheck(f, l);
4088
- if (!(Mn && J(Hi, f))) {
4089
- if (!(jr && J(Ui, f))) {
4090
- if (k) {
4091
- if (!Fn[f]) {
4092
- if (!J(zr, At(g, Lr, ""))) {
4093
- if (!((f === "src" || f === "xlink:href" || f === "href") && l !== "script" && xs(g, "data:") === 0 && Gr[l])) {
4094
- if (!(Vr && !J(Bi, At(g, Lr, "")))) {
4095
- if (g)
4096
- return !1;
4097
- }
4098
- }
4099
- }
4100
- }
4101
- } else if (
4102
- // First condition does a very basic check if a) it's basically a valid custom element tagname AND
4103
- // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
4104
- // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
4105
- !(is(l) && (q.tagNameCheck instanceof RegExp && J(q.tagNameCheck, l) || q.tagNameCheck instanceof Function && q.tagNameCheck(l)) && (q.attributeNameCheck instanceof RegExp && J(q.attributeNameCheck, f) || q.attributeNameCheck instanceof Function && q.attributeNameCheck(f, l)) || // Alternative, second condition checks if it's an `is`-attribute, AND
4106
- // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
4107
- f === "is" && q.allowCustomizedBuiltInElements && (q.tagNameCheck instanceof RegExp && J(q.tagNameCheck, g) || q.tagNameCheck instanceof Function && q.tagNameCheck(g)))
4108
- ) return !1;
4109
- }
4110
- }
4111
- return !0;
4112
- }, io = C({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), is = function(l) {
4113
- return !io[Ot(l)] && J(Wi, l);
4114
- }, oo = function(l, f, g, k) {
4115
- if (w && typeof u == "object" && typeof u.getAttributeType == "function" && !g)
4116
- switch (u.getAttributeType(l, f)) {
4117
- case "TrustedHTML":
4118
- return Z(k);
4119
- case "TrustedScriptURL":
4120
- return Xe(k);
4121
- }
4122
- return k;
4123
- }, lo = function(l, f, g, k) {
4124
- try {
4125
- g ? l.setAttributeNS(g, f, k) : l.setAttribute(f, k), Jt(l) ? $e(l) : Ts(e.removed);
4126
- } catch {
4127
- Ue(f, l);
4128
- }
4129
- }, os = function(l) {
4130
- ke(V.beforeSanitizeAttributes, l, null);
4131
- const f = l.attributes;
4132
- if (!f || Jt(l))
4133
- return;
4134
- U = ns(V.uponSanitizeAttribute, U, Cn, Wt);
4135
- const g = {
4136
- attrName: "",
4137
- attrValue: "",
4138
- keepAttr: !0,
4139
- allowedAttributes: U,
4140
- forceKeepAttr: void 0
4141
- };
4142
- let k = f.length;
4143
- const x = B(l.nodeName);
4144
- for (; k--; ) {
4145
- const R = f[k], z = R.name, W = R.namespaceURI, ue = R.value, fe = B(z), qn = ue;
4146
- let le = z === "value" ? qn : Va(qn);
4147
- if (g.attrName = fe, g.attrValue = le, g.keepAttr = !0, g.forceKeepAttr = void 0, ke(V.uponSanitizeAttribute, l, g), le = g.attrValue, Br && (fe === "id" || fe === "name") && xs(le, Wr) !== 0 && (Ue(z, l), le = Wr + le), Pe && J(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, le)) {
4148
- Ue(z, l);
4149
- continue;
4150
- }
4151
- if (fe === "attributename" && ks(le, "href")) {
4152
- Ue(z, l);
4153
- continue;
4154
- }
4155
- if (!g.forceKeepAttr) {
4156
- if (!g.keepAttr) {
4157
- Ue(z, l);
4158
- continue;
4159
- }
4160
- if (!Hr && J(oc, le)) {
4161
- Ue(z, l);
4162
- continue;
4163
- }
4164
- if (Me && (le = Qt(le)), !ss(x, fe, le)) {
4165
- Ue(z, l);
4166
- continue;
4167
- }
4168
- le = oo(x, fe, W, le), le !== qn && lo(l, z, W, le);
4169
- }
4170
- }
4171
- ke(V.afterSanitizeAttributes, l, null);
4172
- }, en = function(l) {
4173
- let f = null;
4174
- const g = ts(l);
4175
- for (ke(V.beforeSanitizeShadowDOM, l, null); f = g.nextNode(); )
4176
- if (ke(V.uponSanitizeShadowNode, f, null), rs(f, l), os(f), nt(f.content) && en(f.content), (_ ? _(f) : f.nodeType) === pe.element) {
4177
- const x = Y(f);
4178
- nt(x) && (Gn(x), en(x));
4179
- }
4180
- ke(V.afterSanitizeShadowDOM, l, null);
4181
- }, Gn = function(l) {
4182
- const f = [{
4183
- node: l,
4184
- shadow: null
4185
- }];
4186
- for (; f.length > 0; ) {
4187
- const g = f.pop();
4188
- if (g.shadow) {
4189
- en(g.shadow);
4190
- continue;
4191
- }
4192
- const k = g.node, R = (_ ? _(k) : k.nodeType) === pe.element, z = P(k);
4193
- if (z)
4194
- for (let W = z.length - 1; W >= 0; --W)
4195
- f.push({
4196
- node: z[W],
4197
- shadow: null
4198
- });
4199
- if (R) {
4200
- const W = T ? T(k) : null;
4201
- if (typeof W == "string" && B(W) === "template") {
4202
- const ue = k.content;
4203
- nt(ue) && f.push({
4204
- node: ue,
4205
- shadow: null
4206
- });
4207
- }
4208
- }
4209
- if (R) {
4210
- const W = Y(k);
4211
- nt(W) && f.push({
4212
- node: null,
4213
- shadow: W
4214
- }, {
4215
- node: W,
4216
- shadow: null
4217
- });
4218
- }
4219
- }
4220
- };
4221
- return e.sanitize = function(b) {
4222
- let l = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, f = null, g = null, k = null, x = null;
4223
- if (jn = !b, jn && (b = "<!-->"), typeof b != "string" && !kt(b) && (b = Ga(b), typeof b != "string"))
4224
- throw Be("dirty is not a string, aborting");
4225
- if (!e.isSupported)
4226
- return b;
4227
- Pn ? (H = Bt, U = Wt) : Bn(l), (V.uponSanitizeElement.length > 0 || V.uponSanitizeAttribute.length > 0) && (H = oe(H)), V.uponSanitizeAttribute.length > 0 && (U = oe(U)), e.removed = [];
4228
- const R = Kt && typeof b != "string" && kt(b);
4229
- if (R) {
4230
- no(b);
4231
- const ue = T ? T(b) : b.nodeName;
4232
- if (typeof ue == "string") {
4233
- const fe = B(ue);
4234
- if (!H[fe] || wt[fe])
4235
- throw Xt(b), Be("root node is forbidden and cannot be sanitized in-place");
4236
- }
4237
- if (Jt(b))
4238
- throw Xt(b), Be("root node is clobbered and cannot be sanitized in-place");
4239
- try {
4240
- Gn(b);
4241
- } catch (fe) {
4242
- throw Xt(b), fe;
4243
- }
4244
- } else if (kt(b))
4245
- f = es("<!---->"), g = f.ownerDocument.importNode(b, !0), g.nodeType === pe.element && g.nodeName === "BODY" || g.nodeName === "HTML" ? f = g : f.appendChild(g), Gn(g);
4246
- else {
4247
- if (!Qe && !Me && !He && // eslint-disable-next-line unicorn/prefer-includes
4248
- b.indexOf("<") === -1)
4249
- return w && qt ? Z(b) : b;
4250
- if (f = es(b), !f)
4251
- return Qe ? null : qt ? I : "";
4252
- }
4253
- f && $n && $e(f.firstChild);
4254
- const z = R ? b : f;
4255
- try {
4256
- const ue = ts(z);
4257
- for (; k = ue.nextNode(); )
4258
- rs(k, z), os(k), nt(k.content) && en(k.content);
4259
- } catch (ue) {
4260
- throw R && (Xt(b), st(e.removed, (fe) => {
4261
- fe.element && Tt(fe.element);
4262
- })), ue;
4263
- }
4264
- if (R)
4265
- return st(e.removed, (ue) => {
4266
- ue.element && Tt(ue.element);
4267
- }), Me && Wn(b), b;
4268
- if (Qe) {
4269
- if (Me && Wn(f), Gt)
4270
- for (x = $i.call(f.ownerDocument); f.firstChild; )
4271
- x.appendChild(f.firstChild);
4272
- else
4273
- x = f;
4274
- return (U.shadowroot || U.shadowrootmode) && (x = zi.call(r, x, !0)), x;
4275
- }
4276
- let W = He ? f.outerHTML : f.innerHTML;
4277
- return He && H["!doctype"] && f.ownerDocument && f.ownerDocument.doctype && f.ownerDocument.doctype.name && J(rc, f.ownerDocument.doctype.name) && (W = "<!DOCTYPE " + f.ownerDocument.doctype.name + `>
4278
- ` + W), Me && (W = Qt(W)), w && qt ? Z(W) : W;
4279
- }, e.setConfig = function() {
4280
- let b = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
4281
- Bn(b), Pn = !0, Bt = H, Wt = U;
4282
- }, e.clearConfig = function() {
4283
- tt = null, Pn = !1, Bt = null, Wt = null, w = O, I = "";
4284
- }, e.isValidAttribute = function(b, l, f) {
4285
- tt || Bn({});
4286
- const g = B(b), k = B(l);
4287
- return ss(g, k, f);
4288
- }, e.addHook = function(b, l) {
4289
- typeof l == "function" && ee(V, b) && it(V[b], l);
4290
- }, e.removeHook = function(b, l) {
4291
- if (ee(V, b)) {
4292
- if (l !== void 0) {
4293
- const f = Fa(V[b], l);
4294
- return f === -1 ? void 0 : ja(V[b], f, 1)[0];
4295
- }
4296
- return Ts(V[b]);
4297
- }
4298
- }, e.removeHooks = function(b) {
4299
- ee(V, b) && (V[b] = []);
4300
- }, e.removeAllHooks = function() {
4301
- V = Ms();
4302
- }, e;
4303
- }
4304
- var cc = Mi();
4305
- const uc = {
4306
- tooltipAttributes: {
4307
- maxWidth: "300px",
4308
- placement: "top"
4309
- }
4310
- };
4311
- function Pi(t, e = "") {
4312
- const n = {}, r = t;
4313
- return Array.isArray(r.fields) ? Object.assign(n, An(r, e)) : t.type === "array" && t.elements ? Object.assign(n, Rn(t, e)) : t.type === "map" && t.values && Object.assign(n, On(t, e)), n;
4314
- }
4315
- function An(t, e = "") {
4316
- const n = {};
4317
- if (Array.isArray(t.fields))
4318
- for (const r of t.fields) {
4319
- const s = Object.keys(r)[0], i = r[s], o = e ? G(e, s) : s;
4320
- if (n[o] = i, i.type === "record" && Array.isArray(i.fields)) {
4321
- const a = An(i, o);
4322
- Object.assign(n, a);
4323
- } else if (i.type === "array" && i.elements) {
4324
- const a = Rn(i, o);
4325
- Object.assign(n, a);
4326
- } else if (i.type === "map" && i.values) {
4327
- const a = On(i, o);
4328
- Object.assign(n, a);
4329
- }
4330
- }
4331
- return n;
4332
- }
4333
- function Rn(t, e = "") {
4334
- const n = {};
4335
- if (t.elements) {
4336
- let r = t.elements;
4337
- const s = G(e, wi);
4338
- if (t.encrypted && r.type === "string" && (r = { ...r, encrypted: !0 }), n[s] = r, r.type === "record" && Array.isArray(r.fields)) {
4339
- const i = An(r, s);
4340
- Object.assign(n, i);
4341
- } else if (r.type === "array" && r.elements) {
4342
- const i = Rn(r, s);
4343
- Object.assign(n, i);
4344
- } else if (r.type === "map" && r.values) {
4345
- const i = On(r, s);
4346
- Object.assign(n, i);
4347
- }
4348
- }
4349
- return n;
4350
- }
4351
- function On(t, e = "") {
4352
- const n = {}, r = G(e, Rr);
4353
- if (n[r] = t.values, t.values.type === "record" && Array.isArray(t.values.fields)) {
4354
- const s = An(t.values, r);
4355
- Object.assign(n, s);
4356
- } else if ((t.values.type === "array" || t.values.type === "set") && t.values.elements) {
4357
- const s = Rn(t.values, r);
4358
- Object.assign(n, s);
4359
- } else if (t.values.type === "map" && t.values.values) {
4360
- const s = On(t.values, r);
4361
- Object.assign(n, s);
4362
- }
4363
- return n;
4364
- }
4365
- function mt(t, e) {
4366
- const n = at(t), r = [];
4367
- for (let s = 0; s < n.length; s++) {
4368
- const i = n[s], o = r.length > 0 ? G(...r) : "", a = o ? e[o] : void 0;
4369
- a?.type === "map" ? r.push(Rr) : a?.type === "array" ? r.push(wi) : r.push(i);
4370
- }
4371
- return G(...r);
4372
- }
4373
- function fc(t) {
4374
- const e = ye(t), n = un(() => e ? Pi(e) : {});
4375
- function r(d) {
4376
- if (d) {
4377
- let m = mt(d, n.value || {});
4378
- return m.startsWith(`${ut}${Sn}`) && (m = m.slice(2)), n.value?.[m];
4379
- }
4380
- return e;
4381
- }
4382
- function s(d, m = !1) {
4383
- const y = r(d);
4384
- if (!y)
4385
- return null;
4386
- if (y.default !== void 0)
4387
- return y.default;
4388
- if (!y.auto)
4389
- return m || y.required ? y.type === "record" ? i(y, d) : y.type === "array" ? [] : y.type === "map" ? {} : null : null;
4390
- }
4391
- function i(d, m) {
4392
- const y = {};
4393
- if (Array.isArray(d.fields))
4394
- for (const A of d.fields) {
4395
- const P = Object.keys(A)[0], j = m ? `${m}.${P}` : P, Y = s(j, !1);
4396
- Y !== void 0 && (y[P] = Y);
4397
- }
4398
- return y;
4399
- }
4400
- function o(d) {
4401
- return d ? s(d, !0) : i(r(), "");
4402
- }
4403
- function a(d) {
4404
- const m = r(d), y = m?.description ? cc.sanitize(L.parse(m.description, { async: !1 })) : void 0;
4405
- return {
4406
- ...uc,
4407
- "data-testid": `ff-label-${d}`,
4408
- info: y
4409
- };
4410
- }
4411
- function c(d) {
4412
- const m = r(d);
4413
- return ql(m?.one_of || m.elements?.one_of || []);
4414
- }
4415
- function p(d) {
4416
- const m = r(d), y = m?.default;
4417
- let A = null;
4418
- if (m?.type === "foreign" && y?.id)
4419
- A = y.id;
4420
- else {
4421
- if (y == null || typeof y == "object" || y === "")
4422
- return null;
4423
- if (Array.isArray(y)) {
4424
- if (y.length === 0)
4425
- return null;
4426
- A = y.join(", ");
4427
- } else
4428
- A = y.toString();
4429
- }
4430
- return `Default: ${A}`;
4431
- }
4432
- function h() {
4433
- return n.value;
4434
- }
4435
- function u(d) {
4436
- return r(d)?.required ? o(d) : null;
4437
- }
4438
- return {
4439
- getSchemaMap: h,
4440
- getSchema: r,
4441
- getDefault: o,
4442
- getSelectItems: c,
4443
- getLabelAttributes: a,
4444
- getPlaceholder: p,
4445
- getEmptyOrDefault: u
4446
- };
4447
- }
4448
- const gt = /* @__PURE__ */ new WeakMap(), pc = /* @__NO_SIDE_EFFECTS__ */ (...t) => {
4449
- var e;
4450
- const n = t[0], r = (e = yt()) === null || e === void 0 ? void 0 : e.proxy, s = r ?? js();
4451
- if (s == null && !gl()) throw new Error("injectLocal must be called in setup");
4452
- return s && gt.has(s) && n in gt.get(s) ? gt.get(s)[n] : ci(...t);
4453
- };
4454
- function hc(t, e) {
4455
- var n;
4456
- const r = (n = yt()) === null || n === void 0 ? void 0 : n.proxy, s = r ?? js();
4457
- if (s == null) throw new Error("provideLocal must be called in setup");
4458
- gt.has(s) || gt.set(s, /* @__PURE__ */ Object.create(null));
4459
- const i = gt.get(s);
4460
- return i[t] = e, ai(t, e);
4461
- }
4462
- function dc(t, e) {
4463
- const n = Symbol(t.name || "InjectionState"), r = void 0;
4464
- return [(...o) => {
4465
- const a = t(...o);
4466
- return hc(n, a), a;
4467
- }, () => /* @__PURE__ */ pc(n, r)];
4468
- }
4469
- typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
4470
- const Ps = /* @__PURE__ */ Symbol("ff-render-rule-exact-match");
4471
- function gc(t, e) {
4472
- return typeof e == "object" && e !== null && Ps in e ? an(t, e[Ps]) : Array.isArray(e) ? e.some((r) => an(t, r)) : an(t, e);
4473
- }
4474
- function mc(t, e) {
4475
- const n = /* @__PURE__ */ ur({}), r = /* @__PURE__ */ ur({});
4476
- function s(E, _, T) {
4477
- r.value[E] = { ...r.value[E], [_]: T ? [...T] : [] };
4478
- }
4479
- function i(E, _) {
4480
- const T = r.value[E];
4481
- if (!T || !(_ in T)) return;
4482
- const S = { ...T };
4483
- delete S[_], Object.keys(S).length ? r.value[E] = S : delete r.value[E];
4484
- }
4485
- function o(E, _) {
4486
- const T = E.map((w) => at(w).length), S = T[0];
4487
- if (!T.every((w) => w === S)) {
4488
- const w = E.map((I, O) => ` - '${I}' is at level ${T[O]}`).join(`
4489
- `);
4490
- throw new Error(
4491
- `${_}: Fields must be at the same level. Found mixed levels:
4492
- ${w}`
4493
- );
4494
- }
4495
- }
4496
- function a(E) {
4497
- for (const [_, T] of Object.entries(E)) {
4498
- if (!T.bundles) continue;
4499
- for (const w of T.bundles)
4500
- if (new Set(w).size !== w.length) {
4501
- const O = w.filter((D, M) => w.indexOf(D) !== M);
4502
- throw new Error(
4503
- `Self-cycle detected in bundle: field '${O[0]}' appears multiple times in [${w.join(", ")}]`
4504
- );
4505
- }
4506
- const S = /* @__PURE__ */ new Map();
4507
- for (const w of T.bundles)
4508
- for (let I = 1; I < w.length; I++) {
4509
- const O = w[I], D = w[I - 1];
4510
- S.has(O) || S.set(O, /* @__PURE__ */ new Set()), S.get(O).add(D);
4511
- }
4512
- for (const w of S.keys()) {
4513
- let I = function(M) {
4514
- if (D.includes(M)) {
4515
- const Z = [...D, M].join(" -> ");
4516
- throw new Error(
4517
- `Circular bundle detected in path '${_}':
4518
- ${Z}`
4519
- );
4520
- }
4521
- if (O.has(M)) return;
4522
- O.add(M), D.push(M);
4523
- const v = S.get(M);
4524
- if (v)
4525
- for (const Z of v)
4526
- I(Z);
4527
- D.pop();
4528
- };
4529
- const O = /* @__PURE__ */ new Set(), D = [];
4530
- I(w);
4531
- }
4532
- }
4533
- }
4534
- function c(E) {
4535
- for (const [_, T] of Object.entries(E))
4536
- if (T.dependencies)
4537
- for (const S of Object.keys(T.dependencies)) {
4538
- let w = function(D) {
4539
- if (O.includes(D)) {
4540
- const v = [...O, D].join(" -> ");
4541
- throw new Error(
4542
- `Circular dependency detected in path '${_}':
4543
- ${v}`
4544
- );
4545
- }
4546
- if (I.has(D)) return;
4547
- I.add(D), O.push(D);
4548
- const M = T.dependencies[D];
4549
- if (M) {
4550
- const [v] = M;
4551
- T.dependencies[v] && w(v);
4552
- }
4553
- O.pop();
4554
- };
4555
- const I = /* @__PURE__ */ new Set(), O = [];
4556
- w(S);
4557
- }
4558
- }
4559
- function p(E, _) {
4560
- const T = E.map((w) => _ ? G(_, w) : w), S = at(T[0]);
4561
- return S.pop(), G(...S);
4562
- }
4563
- function h(E, _) {
4564
- if (!_) return E;
4565
- const T = `${_}${Sn}`;
4566
- return E.startsWith(T) ? E.slice(T.length) : E;
4567
- }
4568
- function u(E) {
4569
- const _ = at(E);
4570
- return _.pop(), G(..._);
4571
- }
4572
- function d() {
4573
- const E = {};
4574
- for (const [_, T] of Object.entries(n.value)) {
4575
- const S = _ === ut ? "" : _;
4576
- if (T.bundles)
4577
- for (const w of T.bundles) {
4578
- if (w.length < 2)
4579
- throw new Error(
4580
- `Bundle must contain at least 2 fields. Found ${w.length} field(s) in bundle: [${w.join(", ")}]`
4581
- );
4582
- const I = w.map((M) => S ? G(S, M) : M);
4583
- o(I, `Bundle [${w.join(", ")}]`);
4584
- const O = p(w, S) || ut;
4585
- E[O] || (E[O] = {}), E[O].bundles || (E[O].bundles = []);
4586
- const D = I.map((M) => h(M, O));
4587
- E[O].bundles.push(D);
4588
- }
4589
- if (T.dependencies)
4590
- for (const [w, [I, O]] of Object.entries(T.dependencies)) {
4591
- const D = S ? G(S, w) : w, M = S ? G(S, I) : I;
4592
- o(
4593
- [D, M],
4594
- `Dependency '${w}' -> '${I}'`
4595
- );
4596
- const v = u(D) || ut;
4597
- E[v] || (E[v] = {}), E[v].dependencies || (E[v].dependencies = {});
4598
- const Z = h(D, v), Xe = h(M, v);
4599
- E[v].dependencies[Z] = [Xe, O];
4600
- }
4601
- }
4602
- return a(E), c(E), E;
4603
- }
4604
- const m = un(() => {
4605
- try {
4606
- return d();
4607
- } catch (E) {
4608
- return console.error("Invalid render rules:", E instanceof Error ? E.message : String(E)), {};
4609
- }
4610
- });
4611
- function y(E) {
4612
- if (!E)
4613
- return m.value;
4614
- const _ = mt(E, t());
4615
- return m.value[_];
4616
- }
4617
- function A(E) {
4618
- let _ = !1;
4619
- return un(() => {
4620
- if (_) return;
4621
- const T = ye(E);
4622
- try {
4623
- return y(T);
4624
- } catch (S) {
4625
- _ = !0, console.error(`Failed to get render rules for path: \`${T}\`,`, S instanceof Error ? S.message : "");
4626
- return;
4627
- }
4628
- });
4629
- }
4630
- const P = un(
4631
- () => Object.values(m.value).some(
4632
- (E) => E.dependencies && Object.keys(E.dependencies).length > 0
4633
- )
4634
- );
4635
- function j(E) {
4636
- const {
4637
- fieldPath: _,
4638
- rules: T,
4639
- omittedFields: S
4640
- } = E, w = ao("omit-");
4641
- pr([
4642
- () => ye(T),
4643
- () => ye(_),
4644
- () => ye(S)
4645
- ], ([O, D, M], [, v]) => {
4646
- O ? n.value[D] = O : delete n.value[D], s(D, w, M), v && v !== D && (delete n.value[v], i(v, w));
4647
- }, { immediate: !0, deep: !0 });
4648
- const I = A(_);
4649
- return Tl(() => {
4650
- const O = ye(_);
4651
- delete n.value[O], i(O, w);
4652
- }), I;
4653
- }
4654
- function Y(E) {
4655
- const _ = at(E);
4656
- if (!_.length) return !1;
4657
- const T = _[_.length - 1], S = G(..._.slice(0, -1)), w = r.value[S];
4658
- if (w) {
4659
- const Xe = Object.values(w);
4660
- if (Xe.length && Xe.every((Nn) => Nn.includes(T))) return !1;
4661
- }
4662
- const I = S === "" ? ut : mt(S, t()), O = m.value[I]?.dependencies?.[T];
4663
- if (!O) return !1;
4664
- const [D, M] = O, v = S ? G(S, D) : D, Z = $s(e(), at(v));
4665
- return !gc(Z, M);
4666
- }
4667
- return {
4668
- useCurrentRules: j,
4669
- createComputedRules: A,
4670
- hasDependencies: P,
4671
- isFieldHidden: Y
4672
- };
4673
- }
4674
- let _c = 0;
4675
- function bc() {
4676
- return `kid:${++_c}`;
4677
- }
4678
- function yc(t) {
4679
- const e = /* @__PURE__ */ kn(/* @__PURE__ */ new Map());
4680
- function n(p = "") {
4681
- const h = bc();
4682
- return e.set(h, p), h;
4683
- }
4684
- function r(p) {
4685
- return e.get(p);
4686
- }
4687
- function s(p, h) {
4688
- e.has(p) && e.set(p, h);
4689
- }
4690
- function i(p) {
4691
- e.delete(p);
4692
- }
4693
- function o(p) {
4694
- return wc(p, t, n);
4695
- }
4696
- function a(p) {
4697
- return Ec(p, t, r);
4698
- }
4699
- function c() {
4700
- e.clear();
4701
- }
4702
- return {
4703
- createKey: n,
4704
- getKey: r,
4705
- updateKey: s,
4706
- deleteKey: i,
4707
- serialize: o,
4708
- deserialize: a,
4709
- clear: c
4710
- };
4711
- }
4712
- function wc(t, e, n) {
4713
- const r = (s, i) => {
4714
- if (s == null || typeof s != "object")
4715
- return s;
4716
- if (Array.isArray(s))
4717
- return s.map((c, p) => {
4718
- const h = i ? G(i, `${p}`) : `${p}`;
4719
- return r(c, h);
4720
- });
4721
- if ((i ? e(i) : e())?.type === "map") {
4722
- const c = s, p = {};
4723
- return Object.keys(c).forEach((h) => {
4724
- const u = n(h), d = c[h], m = i ? G(i, h) : h;
4725
- p[u] = r(d, m);
4726
- }), p;
4727
- }
4728
- const a = {};
4729
- return Object.keys(s).forEach((c) => {
4730
- const p = i ? G(i, c) : c;
4731
- a[c] = r(s[c], p);
4732
- }), a;
4733
- };
4734
- return r(t);
4735
- }
4736
- function Ec(t, e, n) {
4737
- const r = (s, i) => {
4738
- if (s == null || typeof s != "object")
4739
- return s;
4740
- if (Array.isArray(s))
4741
- return s.map((c, p) => {
4742
- const h = i ? G(i, `${p}`) : `${p}`;
4743
- return r(c, h);
4744
- });
4745
- if ((i ? e(i) : e())?.type === "map") {
4746
- const c = s, p = {};
4747
- return Object.keys(c).forEach((h) => {
4748
- const u = h, d = c[u], m = n(u);
4749
- if (m == null) {
4750
- console.error(`[FreeForm] Missing name for key ID: ${String(u)}`);
4751
- return;
4752
- }
4753
- const y = m || Rr, A = i ? G(i, y) : y;
4754
- p[m] = r(d, A);
4755
- }), p;
4756
- }
4757
- const a = {};
4758
- return Object.keys(s).forEach((c) => {
4759
- const p = i ? G(i, c) : c;
4760
- a[c] = r(s[c], p);
4761
- }), a;
4762
- };
4763
- return r(t);
4764
- }
4765
- dc(
4766
- function(e) {
4767
- const {
4768
- schema: n,
4769
- propsData: r,
4770
- onChange: s,
4771
- propsRenderRules: i,
4772
- propsConfig: o
4773
- } = e, {
4774
- getDefault: a,
4775
- getEmptyOrDefault: c,
4776
- ...p
4777
- } = fc(n), h = yc(p.getSchema), u = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ kn({}), m = /* @__PURE__ */ Ko(() => o ?? {}), y = Sl();
4778
- ai(Zl, co(y, "default", Xl));
4779
- const {
4780
- useCurrentRules: A,
4781
- createComputedRules: P,
4782
- hasDependencies: j,
4783
- isFieldHidden: Y
4784
- } = mc(p.getSchemaMap, () => d), E = A({
4785
- fieldPath: ut,
4786
- rules: i
4787
- });
4788
- function _(v) {
4789
- Object.keys(d).forEach((Z) => {
4790
- delete d[Z];
4791
- }), h.clear(), Object.assign(d, h.serialize(v));
4792
- }
4793
- function T(v) {
4794
- let Z;
4795
- !v || !S(ye(v)) ? Z = a() : Z = ls(ye(v)), as(m.value.prepareFormData) ? _(m.value.prepareFormData(Z)) : _(Z);
4796
- }
4797
- function S(v) {
4798
- return as(m.value.hasValue) ? m.value.hasValue(v) : !!v;
4799
- }
4800
- function w() {
4801
- const v = ls(ye(d));
4802
- return j.value && Ei(
4803
- v,
4804
- Y,
4805
- c
4806
- ), h.deserialize(v);
4807
- }
4808
- pr(d, () => {
4809
- s?.(w());
4810
- }, { deep: !0 });
4811
- let I = !1;
4812
- pr(() => r?.value, (v) => {
4813
- I && an(w(), ye(v)) || (T(v), I = !0);
4814
- }, { deep: !0, immediate: !0 });
4815
- function O(v) {
4816
- return v != null && typeof v == "object" && !Array.isArray(v) ? h.serialize(v) : v;
4817
- }
4818
- function D(v) {
4819
- return O(a(v));
4820
- }
4821
- function M(v) {
4822
- return O(c(v));
4823
- }
4824
- return {
4825
- /**
4826
- * The reactive form data object
4827
- */
4828
- formData: d,
4829
- schema: n,
4830
- config: m,
4831
- fieldRendererRegistry: u,
4832
- setValue: _,
4833
- useCurrentRenderRules: A,
4834
- rootRenderRules: E,
4835
- createComputedRenderRules: P,
4836
- ...p,
4837
- getValue: w,
4838
- isFieldHidden: Y,
4839
- keyIdMap: h,
4840
- getDefault: D,
4841
- getEmptyOrDefault: M
4842
- };
4843
- }
4844
- );
4845
- function Tc(t) {
4846
- if (Yl(t)) return "enum";
4847
- switch (t.type) {
4848
- case "string":
4849
- return "string";
4850
- case "number":
4851
- case "integer":
4852
- return "number";
4853
- case "boolean":
4854
- return "boolean";
4855
- case "set":
4856
- return Kl(t) ? "tag" : "enum";
4857
- case "array":
4858
- return "array";
4859
- case "record":
4860
- return "record";
4861
- case "map":
4862
- return "map";
4863
- case "json":
4864
- return "json";
4865
- case "foreign":
4866
- return "foreign";
4867
- default:
4868
- throw new Error(`Unknown field type: ${t.type}`);
4869
- }
4870
- }
4871
- function* vc(t, e, n, r = "") {
4872
- for (const s of t) {
4873
- const i = Object.keys(s)[0], o = r ? G(r, i) : i, a = $s(e, i);
4874
- if (a === void 0) continue;
4875
- const c = mt(o, n.schemaMap), p = n.schemaMap[c];
4876
- if (!p)
4877
- throw new Error(`Field schema for "${o}" not found in schema map`);
4878
- yield {
4879
- handlerType: Tc(p),
4880
- fieldKey: o,
4881
- fieldSchema: p,
4882
- value: a
4883
- };
4884
- }
4885
- }
4886
- function Ac(t, e, n) {
4887
- const r = G(t, String(e)), s = mt(r, n.schemaMap), i = n.schemaMap[s];
4888
- if (!i)
4889
- throw new Error(`Item schema for "${r}" not found in schema map`);
4890
- return { itemKey: r, itemSchema: i };
4891
- }
4892
- function Rc(t, e, n) {
4893
- const r = G(t, e), s = mt(r, n.schemaMap), i = n.schemaMap[s];
4894
- if (!i)
4895
- throw new Error(`Map entry schema for "${r}" not found in schema map`);
4896
- return { entryKey: r, entrySchema: i };
4897
- }
4898
- function Oc(t) {
4899
- return t.type === "record" && Array.isArray(t.fields);
4900
- }
4901
- function Nc(t) {
4902
- return {
4903
- schemaMap: Pi(t)
4904
- };
4905
- }
4906
- export {
4907
- Ac as a,
4908
- Oc as b,
4909
- Nc as c,
4910
- Rc as d,
4911
- Tc as g,
4912
- Sc as i,
4913
- xc as s,
4914
- vc as w
4915
- };