document-model 1.0.31 → 1.0.33

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 (35) hide show
  1. package/dist/browser/document-model.cjs +1 -1
  2. package/dist/browser/document-model.js +2 -2
  3. package/dist/browser/document.cjs +1 -1
  4. package/dist/browser/document.js +2 -2
  5. package/dist/browser/index.cjs +1 -1
  6. package/dist/browser/index.js +3 -3
  7. package/dist/browser/internal/index-CBO7uxzK.js +41 -0
  8. package/dist/browser/internal/index-CTCFa4de.js +1 -0
  9. package/dist/browser/internal/{index-B7qIPXoz.js → index-DTIvFQBH.js} +1 -1
  10. package/dist/browser/internal/{index-BFOiHt6I.js → index-i5s_5m9e.js} +1 -1
  11. package/dist/browser/internal/object-BOMJbn2Y.js +7 -0
  12. package/dist/browser/internal/{object-Diya-yJS.js → object-CqQGngpx.js} +728 -720
  13. package/dist/browser/src/document/types.d.ts +3 -1
  14. package/dist/browser/src/document/utils/base.d.ts +1 -0
  15. package/dist/node/document-model.cjs +1 -1
  16. package/dist/node/document-model.js +2 -2
  17. package/dist/node/document.cjs +1 -1
  18. package/dist/node/document.js +3 -3
  19. package/dist/node/index.cjs +1 -1
  20. package/dist/node/index.js +3 -3
  21. package/dist/node/internal/index-C21AbOFE.js +41 -0
  22. package/dist/node/internal/{index-CsNA2GBY.js → index-CP5hMjbq.js} +1 -1
  23. package/dist/node/internal/index-CW5xQQ7a.js +1 -0
  24. package/dist/node/internal/{index-C-NbJIDm.js → index-rIcx-JJZ.js} +1 -1
  25. package/dist/node/internal/{object-usT57J9v.js → object-BIG1wTk-.js} +331 -323
  26. package/dist/node/internal/object-C778ylvS.js +2 -0
  27. package/dist/node/src/document/types.d.ts +3 -1
  28. package/dist/node/src/document/utils/base.d.ts +1 -0
  29. package/package.json +1 -1
  30. package/dist/browser/internal/index-BVR8cGlp.js +0 -1
  31. package/dist/browser/internal/index-DtMGoFXU.js +0 -40
  32. package/dist/browser/internal/object-O_qdzVL-.js +0 -7
  33. package/dist/node/internal/index-Bxw-tgFs.js +0 -1
  34. package/dist/node/internal/index-Ly6V0vGQ.js +0 -40
  35. package/dist/node/internal/object-DyU92wWO.js +0 -2
@@ -1,157 +1,157 @@
1
- var Be = Object.defineProperty;
2
- var je = (o, r, p) => r in o ? Be(o, r, { enumerable: !0, configurable: !0, writable: !0, value: p }) : o[r] = p;
3
- var V = (o, r, p) => (je(o, typeof r != "symbol" ? r + "" : r, p), p);
4
- import { produce as J, castDraft as ot, castImmutable as Ie, freeze as Oe } from "immer";
5
- import Ue from "json-stringify-deterministic";
6
- import { z as g } from "zod";
7
- import Ut from "jszip";
8
- const Tt = (o) => o != null, Te = g.any().refine((o) => Tt(o)), Dt = g.enum(["LOAD_STATE"]), Nt = g.enum(["PRUNE"]), Mt = g.enum(["REDO"]), Rt = g.enum(["SET_NAME"]), Ct = g.enum(["UNDO"]);
1
+ var je = Object.defineProperty;
2
+ var Ie = (n, r, p) => r in n ? je(n, r, { enumerable: !0, configurable: !0, writable: !0, value: p }) : n[r] = p;
3
+ var X = (n, r, p) => (Ie(n, typeof r != "symbol" ? r + "" : r, p), p);
4
+ import { produce as J, castDraft as at, castImmutable as Oe, freeze as Ue } from "immer";
5
+ import pt from "json-stringify-deterministic";
6
+ import { z as w } from "zod";
7
+ import Dt from "jszip";
8
+ const Nt = (n) => n != null, Te = w.any().refine((n) => Nt(n)), Mt = w.enum(["LOAD_STATE"]), Rt = w.enum(["PRUNE"]), Ct = w.enum(["REDO"]), Lt = w.enum(["SET_NAME"]), zt = w.enum(["UNDO"]);
9
9
  function De() {
10
- return g.object({
11
- __typename: g.literal("Action").optional(),
12
- type: g.string()
10
+ return w.object({
11
+ __typename: w.literal("Action").optional(),
12
+ type: w.string()
13
13
  });
14
14
  }
15
15
  function H() {
16
- return g.literal("global").or(g.literal("local"));
16
+ return w.literal("global").or(w.literal("local"));
17
17
  }
18
- function Lt() {
19
- return g.union([
20
- zt(),
18
+ function Pt() {
19
+ return w.union([
21
20
  qt(),
22
- $t(),
23
21
  Wt(),
24
- Jt()
22
+ Jt(),
23
+ Ht(),
24
+ Zt()
25
25
  ]);
26
26
  }
27
27
  function Ne() {
28
- return g.object({
29
- __typename: g.literal("DocumentFile").optional(),
30
- data: g.string(),
31
- extension: g.string().nullable(),
32
- fileName: g.string().nullable(),
33
- mimeType: g.string()
28
+ return w.object({
29
+ __typename: w.literal("DocumentFile").optional(),
30
+ data: w.string(),
31
+ extension: w.string().nullable(),
32
+ fileName: w.string().nullable(),
33
+ mimeType: w.string()
34
34
  });
35
35
  }
36
- function zt() {
37
- return g.object({
38
- input: g.lazy(() => ct()),
39
- type: Dt,
36
+ function qt() {
37
+ return w.object({
38
+ input: w.lazy(() => ut()),
39
+ type: Mt,
40
40
  scope: H()
41
41
  });
42
42
  }
43
- function ct() {
44
- return g.object({
45
- operations: g.number(),
46
- state: g.lazy(() => Pt())
43
+ function ut() {
44
+ return w.object({
45
+ operations: w.number(),
46
+ state: w.lazy(() => $t())
47
47
  });
48
48
  }
49
- function Pt() {
50
- return g.object({
51
- data: g.unknown().nullish(),
52
- name: g.string()
49
+ function $t() {
50
+ return w.object({
51
+ data: w.unknown().nullish(),
52
+ name: w.string()
53
53
  });
54
54
  }
55
55
  function Me() {
56
- return g.object({
57
- __typename: g.literal("Operation").optional(),
58
- hash: g.string(),
59
- index: g.number(),
60
- timestamp: g.string().datetime(),
61
- type: g.string()
56
+ return w.object({
57
+ __typename: w.literal("Operation").optional(),
58
+ hash: w.string(),
59
+ index: w.number(),
60
+ timestamp: w.string().datetime(),
61
+ type: w.string()
62
62
  });
63
63
  }
64
- function qt() {
65
- return g.object({
66
- input: g.lazy(() => lt()),
67
- type: Nt,
64
+ function Wt() {
65
+ return w.object({
66
+ input: w.lazy(() => ft()),
67
+ type: Rt,
68
68
  scope: H()
69
69
  });
70
70
  }
71
- function lt() {
72
- return g.object({
73
- end: g.number().nullish(),
74
- start: g.number().nullish()
71
+ function ft() {
72
+ return w.object({
73
+ end: w.number().nullish(),
74
+ start: w.number().nullish()
75
75
  });
76
76
  }
77
- const ut = g.number;
78
- function $t() {
79
- return g.object({
80
- input: ut(),
81
- type: Mt,
77
+ const mt = w.number;
78
+ function Jt() {
79
+ return w.object({
80
+ input: mt(),
81
+ type: Ct,
82
82
  scope: H()
83
83
  });
84
84
  }
85
- const ft = g.string;
86
- function Wt() {
87
- return g.object({
88
- input: ft(),
89
- type: Rt,
90
- scope: g.literal("global")
85
+ const ht = w.string;
86
+ function Ht() {
87
+ return w.object({
88
+ input: ht(),
89
+ type: Lt,
90
+ scope: w.literal("global")
91
91
  });
92
92
  }
93
93
  function Re() {
94
- return g.object({
95
- __typename: g.literal("SetNameOperation").optional(),
96
- hash: g.string(),
97
- index: g.number(),
98
- input: g.string(),
99
- timestamp: g.string().datetime(),
100
- type: g.string()
94
+ return w.object({
95
+ __typename: w.literal("SetNameOperation").optional(),
96
+ hash: w.string(),
97
+ index: w.number(),
98
+ input: w.string(),
99
+ timestamp: w.string().datetime(),
100
+ type: w.string()
101
101
  });
102
102
  }
103
- const mt = g.number;
104
- function Jt() {
105
- return g.object({
106
- input: mt(),
107
- type: Ct,
103
+ const xt = w.number;
104
+ function Zt() {
105
+ return w.object({
106
+ input: xt(),
107
+ type: zt,
108
108
  scope: H()
109
109
  });
110
110
  }
111
111
  const Li = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
112
112
  __proto__: null,
113
113
  ActionSchema: De,
114
- BaseActionSchema: Lt,
114
+ BaseActionSchema: Pt,
115
115
  DocumentFileSchema: Ne,
116
- LoadStateActionInputSchema: ct,
117
- LoadStateActionSchema: zt,
118
- LoadStateActionStateInputSchema: Pt,
119
- Load_StateSchema: Dt,
116
+ LoadStateActionInputSchema: ut,
117
+ LoadStateActionSchema: qt,
118
+ LoadStateActionStateInputSchema: $t,
119
+ Load_StateSchema: Mt,
120
120
  OperationSchema: Me,
121
121
  OperationScopeSchema: H,
122
- PruneActionInputSchema: lt,
123
- PruneActionSchema: qt,
124
- PruneSchema: Nt,
125
- RedoActionInputSchema: ut,
126
- RedoActionSchema: $t,
127
- RedoSchema: Mt,
128
- SetNameActionInputSchema: ft,
129
- SetNameActionSchema: Wt,
122
+ PruneActionInputSchema: ft,
123
+ PruneActionSchema: Wt,
124
+ PruneSchema: Rt,
125
+ RedoActionInputSchema: mt,
126
+ RedoActionSchema: Jt,
127
+ RedoSchema: Ct,
128
+ SetNameActionInputSchema: ht,
129
+ SetNameActionSchema: Ht,
130
130
  SetNameOperationSchema: Re,
131
- Set_NameSchema: Rt,
132
- UndoActionInputSchema: mt,
133
- UndoActionSchema: Jt,
134
- UndoSchema: Ct,
131
+ Set_NameSchema: Lt,
132
+ UndoActionInputSchema: xt,
133
+ UndoActionSchema: Zt,
134
+ UndoSchema: zt,
135
135
  definedNonNullAnySchema: Te,
136
- isDefinedNonNullAny: Tt
136
+ isDefinedNonNullAny: Nt
137
137
  }, Symbol.toStringTag, { value: "Module" }));
138
- function Ce(o, r) {
139
- return { ...o, name: r };
138
+ function Ce(n, r) {
139
+ return { ...n, name: r };
140
140
  }
141
- function Le(o, r, p) {
141
+ function Le(n, r, p) {
142
142
  const c = {
143
143
  skip: p,
144
- document: o
144
+ document: n
145
145
  }, { scope: u } = r;
146
146
  return !u || r.skip === void 0 ? c : J(c, (f) => {
147
147
  const [l] = f.document.operations[u].slice(-1);
148
148
  r.skip && r.skip > 0 && (f.skip = r.skip), l.type === "NOOP" && r.index === l.index && f.skip > l.skip && f.document.operations[u].pop();
149
149
  });
150
150
  }
151
- function ze(o, r, p) {
151
+ function ze(n, r, p) {
152
152
  const { scope: c, input: u } = r;
153
153
  return J({
154
- document: o,
154
+ document: n,
155
155
  action: r,
156
156
  skip: p
157
157
  }, (l) => {
@@ -173,18 +173,18 @@ function ze(o, r, p) {
173
173
  "Cannot undo: you can't undo more operations than the ones in the scope history"
174
174
  );
175
175
  const d = l.document.operations[c].length - 1;
176
- let b = u, w = x ? d - a.skip : d;
177
- for (; b > 0 && w >= 0; ) {
178
- const v = l.document.operations[c][w];
179
- v.type === "NOOP" && v.skip > 0 ? (w = w - (v.skip + 1), l.skip += v.skip + 1) : (l.document.clipboard.push({ ...v }), b--, w--);
176
+ let v = u, g = x ? d - a.skip : d;
177
+ for (; v > 0 && g >= 0; ) {
178
+ const y = l.document.operations[c][g];
179
+ y.type === "NOOP" && y.skip > 0 ? (g = g - (y.skip + 1), l.skip += y.skip + 1) : (l.document.clipboard.push({ ...y }), v--, g--);
180
180
  }
181
- l.action = wt(c);
181
+ l.action = yt(c);
182
182
  });
183
183
  }
184
- function Pe(o, r, p) {
184
+ function Pe(n, r, p) {
185
185
  const { scope: c, input: u } = r;
186
186
  return J({
187
- document: o,
187
+ document: n,
188
188
  action: r,
189
189
  skip: p
190
190
  }, (l) => {
@@ -208,79 +208,79 @@ function Pe(o, r, p) {
208
208
  `Cannot redo: no operations in clipboard for scope "${c}"`
209
209
  );
210
210
  const x = l.document.clipboard.splice(a, 1)[0];
211
- l.action = ot({
211
+ l.action = at({
212
212
  type: x.type,
213
213
  scope: x.scope,
214
214
  input: x.input
215
215
  });
216
216
  });
217
217
  }
218
- function qe(o, r, p) {
219
- const { scope: c } = r, u = o.operations[c];
218
+ function qe(n, r, p) {
219
+ const { scope: c } = r, u = n.operations[c];
220
220
  let {
221
221
  input: { start: f, end: l }
222
222
  } = r;
223
223
  f = f || 0, l = l || u.length;
224
- const a = u.slice(f, l), x = u.slice(0, f), d = u.slice(l), b = st(
225
- o.initialState,
224
+ const a = u.slice(f, l), x = u.slice(0, f), d = u.slice(l), v = lt(
225
+ n.initialState,
226
226
  {
227
- ...o.operations,
227
+ ...n.operations,
228
228
  [c]: x.concat(a)
229
229
  },
230
230
  p
231
- ), { name: w, state: v } = b, y = x.length, U = x.length ? x[x.length - 1].timestamp : d.length ? d[0].timestamp : (/* @__PURE__ */ new Date()).toISOString();
232
- return st(
233
- o.initialState,
231
+ ), { name: g, state: y } = v, b = x.length, E = x.length ? x[x.length - 1].timestamp : d.length ? d[0].timestamp : (/* @__PURE__ */ new Date()).toISOString();
232
+ return lt(
233
+ n.initialState,
234
234
  {
235
- ...o.operations,
235
+ ...n.operations,
236
236
  [c]: [
237
237
  ...x,
238
238
  {
239
- ...dt(
240
- { name: w, state: v },
239
+ ...gt(
240
+ { name: g, state: y },
241
241
  a.length
242
242
  ),
243
- timestamp: U,
244
- index: y,
245
- hash: ee({ state: v }, "global")
243
+ timestamp: E,
244
+ index: b,
245
+ hash: re({ state: y }, "global")
246
246
  },
247
- ...d.map((j, $) => ({
248
- ...j,
249
- index: y + $ + 1
247
+ ...d.map((U, R) => ({
248
+ ...U,
249
+ index: b + R + 1
250
250
  }))
251
251
  ]
252
252
  },
253
253
  p
254
254
  );
255
255
  }
256
- function $e(o, r) {
256
+ function $e(n, r) {
257
257
  return {
258
- ...o,
258
+ ...n,
259
259
  name: r.name,
260
260
  state: r.state ?? { global: {}, local: {} }
261
261
  };
262
262
  }
263
- const Ht = "SET_NAME", z = "UNDO", P = "REDO", Z = "PRUNE", Zt = "LOAD_STATE", We = "NOOP";
264
- function Je(o, r) {
265
- const p = o.revision[r.scope];
263
+ const Yt = "SET_NAME", z = "UNDO", P = "REDO", Z = "PRUNE", Gt = "LOAD_STATE", We = "NOOP";
264
+ function Je(n, r) {
265
+ const p = n.revision[r.scope];
266
266
  return [z, P, Z].includes(r.type) ? p : p + 1;
267
267
  }
268
- function He(o, r) {
268
+ function He(n, r) {
269
269
  return {
270
- ...o,
270
+ ...n,
271
271
  revision: {
272
- ...o.revision,
273
- [r.scope]: Je(o, r)
272
+ ...n.revision,
273
+ [r.scope]: Je(n, r)
274
274
  },
275
275
  lastModified: (/* @__PURE__ */ new Date()).toISOString()
276
276
  };
277
277
  }
278
- function Ze(o, r, p = 0) {
278
+ function Ze(n, r, p = 0) {
279
279
  if ([z, P, Z].includes(r.type))
280
- return o;
281
- const { scope: c } = r, u = o.operations[c].slice(
280
+ return n;
281
+ const { scope: c } = r, u = n.operations[c].slice(
282
282
  0,
283
- o.revision[c]
283
+ n.revision[c]
284
284
  );
285
285
  return u.push({
286
286
  ...r,
@@ -290,52 +290,52 @@ function Ze(o, r, p = 0) {
290
290
  scope: c,
291
291
  skip: p
292
292
  }), {
293
- ...o,
294
- operations: { ...o.operations, [c]: u }
293
+ ...n,
294
+ operations: { ...n.operations, [c]: u }
295
295
  };
296
296
  }
297
- function Ye(o, r, p = 0) {
298
- let c = Ze(o, r, p);
297
+ function Ye(n, r, p = 0) {
298
+ let c = Ze(n, r, p);
299
299
  return c = He(c, r), c;
300
300
  }
301
- function Ge(o, r, p) {
302
- switch (Lt().parse(r), r.type) {
303
- case Ht:
304
- return Ce(o, r.input);
301
+ function Ge(n, r, p) {
302
+ switch (Pt().parse(r), r.type) {
303
+ case Yt:
304
+ return Ce(n, r.input);
305
305
  case Z:
306
- return qe(o, r, p);
307
- case Zt:
308
- return $e(o, r.input.state);
306
+ return qe(n, r, p);
307
+ case Gt:
308
+ return $e(n, r.input.state);
309
309
  default:
310
- return o;
310
+ return n;
311
311
  }
312
312
  }
313
- function Ke(o, r, p) {
313
+ function Ke(n, r, p) {
314
314
  switch (r.type) {
315
315
  case z:
316
- return ze(o, r, p);
316
+ return ze(n, r, p);
317
317
  case P:
318
- return Pe(o, r, p);
318
+ return Pe(n, r, p);
319
319
  default:
320
- return { document: o, action: r, skip: p };
320
+ return { document: n, action: r, skip: p };
321
321
  }
322
322
  }
323
- function Yt(o, r, p, c, u = {}) {
323
+ function Kt(n, r, p, c, u = {}) {
324
324
  const { skip: f, ignoreSkipOperations: l = !1 } = u;
325
- let a = { ...r }, x = f || 0, d = o, b = [...o.clipboard];
325
+ let a = { ...r }, x = f || 0, d = n, v = [...n.clipboard];
326
326
  if (Ei(a)) {
327
- const { document: w, skip: v } = Le(d, a, x);
328
- x = v, d = w;
327
+ const { document: g, skip: y } = Le(d, a, x);
328
+ x = y, d = g;
329
329
  }
330
- if (jt(a)) {
330
+ if (Ot(a)) {
331
331
  const {
332
- skip: w,
333
- action: v,
334
- document: y
335
- } = Ke(o, a, x);
336
- a = v, x = w, d = y, b = [...d.clipboard];
332
+ skip: g,
333
+ action: y,
334
+ document: b
335
+ } = Ke(n, a, x);
336
+ a = y, x = g, d = b, v = [...d.clipboard];
337
337
  }
338
- return It(a) && (d = Ge(d, a, p)), x > 0 && !l && (d = st(
338
+ return Ut(a) && (d = Ge(d, a, p)), x > 0 && !l && (d = lt(
339
339
  d.initialState,
340
340
  d.operations,
341
341
  p,
@@ -343,36 +343,36 @@ function Yt(o, r, p, c, u = {}) {
343
343
  void 0,
344
344
  void 0,
345
345
  { [a.scope]: x }
346
- )), d = Ye(d, a, x), d = J(d, (w) => {
347
- const v = p(
348
- w.state,
346
+ )), d = Ye(d, a, x), d = J(d, (g) => {
347
+ const y = p(
348
+ g.state,
349
349
  a,
350
350
  c
351
- ), y = jt(r) ? [...b] : [];
352
- if (v)
353
- return ot({
351
+ ), b = Ot(r) ? [...v] : [];
352
+ if (y)
353
+ return at({
354
354
  ...d,
355
- clipboard: [...y],
356
- state: v
355
+ clipboard: [...b],
356
+ state: y
357
357
  });
358
- w.clipboard = ot([...y]);
359
- }), J(d, (w) => {
358
+ g.clipboard = at([...b]);
359
+ }), J(d, (g) => {
360
360
  if ([z, P, Z].includes(a.type))
361
- return w;
362
- const v = a.scope || "global";
363
- w.operations[v][w.operations[v].length - 1].hash = ee(w, v), !It(a) && a.attachments && a.attachments.forEach((y) => {
364
- const { hash: U, ...j } = y;
365
- w.attachments[U] = {
366
- ...j
361
+ return g;
362
+ const y = a.scope || "global";
363
+ g.operations[y][g.operations[y].length - 1].hash = re(g, y), !Ut(a) && a.attachments && a.attachments.forEach((b) => {
364
+ const { hash: E, ...U } = b;
365
+ g.attachments[E] = {
366
+ ...U
367
367
  };
368
368
  });
369
369
  });
370
370
  }
371
- function Ve(o) {
372
- return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
371
+ function Ve(n) {
372
+ return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
373
373
  }
374
- var at = { exports: {} };
375
- typeof Object.create == "function" ? at.exports = function(r, p) {
374
+ var st = { exports: {} };
375
+ typeof Object.create == "function" ? st.exports = function(r, p) {
376
376
  p && (r.super_ = p, r.prototype = Object.create(p.prototype, {
377
377
  constructor: {
378
378
  value: r,
@@ -381,7 +381,7 @@ typeof Object.create == "function" ? at.exports = function(r, p) {
381
381
  configurable: !0
382
382
  }
383
383
  }));
384
- } : at.exports = function(r, p) {
384
+ } : st.exports = function(r, p) {
385
385
  if (p) {
386
386
  r.super_ = p;
387
387
  var c = function() {
@@ -389,78 +389,78 @@ typeof Object.create == "function" ? at.exports = function(r, p) {
389
389
  c.prototype = p.prototype, r.prototype = new c(), r.prototype.constructor = r;
390
390
  }
391
391
  };
392
- var Xe = at.exports, pt = { exports: {} }, Gt = {}, Q = {};
393
- Q.byteLength = ei;
394
- Q.toByteArray = ri;
395
- Q.fromByteArray = ai;
396
- var D = [], O = [], Qe = typeof Uint8Array < "u" ? Uint8Array : Array, nt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
397
- for (var C = 0, ti = nt.length; C < ti; ++C)
398
- D[C] = nt[C], O[nt.charCodeAt(C)] = C;
392
+ var Xe = st.exports, ct = { exports: {} }, Vt = {}, tt = {};
393
+ tt.byteLength = ei;
394
+ tt.toByteArray = ri;
395
+ tt.fromByteArray = ai;
396
+ var D = [], O = [], Qe = typeof Uint8Array < "u" ? Uint8Array : Array, ot = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
397
+ for (var C = 0, ti = ot.length; C < ti; ++C)
398
+ D[C] = ot[C], O[ot.charCodeAt(C)] = C;
399
399
  O[45] = 62;
400
400
  O[95] = 63;
401
- function Kt(o) {
402
- var r = o.length;
401
+ function Xt(n) {
402
+ var r = n.length;
403
403
  if (r % 4 > 0)
404
404
  throw new Error("Invalid string. Length must be a multiple of 4");
405
- var p = o.indexOf("=");
405
+ var p = n.indexOf("=");
406
406
  p === -1 && (p = r);
407
407
  var c = p === r ? 0 : 4 - p % 4;
408
408
  return [p, c];
409
409
  }
410
- function ei(o) {
411
- var r = Kt(o), p = r[0], c = r[1];
410
+ function ei(n) {
411
+ var r = Xt(n), p = r[0], c = r[1];
412
412
  return (p + c) * 3 / 4 - c;
413
413
  }
414
- function ii(o, r, p) {
414
+ function ii(n, r, p) {
415
415
  return (r + p) * 3 / 4 - p;
416
416
  }
417
- function ri(o) {
418
- var r, p = Kt(o), c = p[0], u = p[1], f = new Qe(ii(o, c, u)), l = 0, a = u > 0 ? c - 4 : c, x;
417
+ function ri(n) {
418
+ var r, p = Xt(n), c = p[0], u = p[1], f = new Qe(ii(n, c, u)), l = 0, a = u > 0 ? c - 4 : c, x;
419
419
  for (x = 0; x < a; x += 4)
420
- r = O[o.charCodeAt(x)] << 18 | O[o.charCodeAt(x + 1)] << 12 | O[o.charCodeAt(x + 2)] << 6 | O[o.charCodeAt(x + 3)], f[l++] = r >> 16 & 255, f[l++] = r >> 8 & 255, f[l++] = r & 255;
421
- return u === 2 && (r = O[o.charCodeAt(x)] << 2 | O[o.charCodeAt(x + 1)] >> 4, f[l++] = r & 255), u === 1 && (r = O[o.charCodeAt(x)] << 10 | O[o.charCodeAt(x + 1)] << 4 | O[o.charCodeAt(x + 2)] >> 2, f[l++] = r >> 8 & 255, f[l++] = r & 255), f;
420
+ r = O[n.charCodeAt(x)] << 18 | O[n.charCodeAt(x + 1)] << 12 | O[n.charCodeAt(x + 2)] << 6 | O[n.charCodeAt(x + 3)], f[l++] = r >> 16 & 255, f[l++] = r >> 8 & 255, f[l++] = r & 255;
421
+ return u === 2 && (r = O[n.charCodeAt(x)] << 2 | O[n.charCodeAt(x + 1)] >> 4, f[l++] = r & 255), u === 1 && (r = O[n.charCodeAt(x)] << 10 | O[n.charCodeAt(x + 1)] << 4 | O[n.charCodeAt(x + 2)] >> 2, f[l++] = r >> 8 & 255, f[l++] = r & 255), f;
422
422
  }
423
- function ni(o) {
424
- return D[o >> 18 & 63] + D[o >> 12 & 63] + D[o >> 6 & 63] + D[o & 63];
423
+ function ni(n) {
424
+ return D[n >> 18 & 63] + D[n >> 12 & 63] + D[n >> 6 & 63] + D[n & 63];
425
425
  }
426
- function oi(o, r, p) {
426
+ function oi(n, r, p) {
427
427
  for (var c, u = [], f = r; f < p; f += 3)
428
- c = (o[f] << 16 & 16711680) + (o[f + 1] << 8 & 65280) + (o[f + 2] & 255), u.push(ni(c));
428
+ c = (n[f] << 16 & 16711680) + (n[f + 1] << 8 & 65280) + (n[f + 2] & 255), u.push(ni(c));
429
429
  return u.join("");
430
430
  }
431
- function ai(o) {
432
- for (var r, p = o.length, c = p % 3, u = [], f = 16383, l = 0, a = p - c; l < a; l += f)
433
- u.push(oi(o, l, l + f > a ? a : l + f));
434
- return c === 1 ? (r = o[p - 1], u.push(
431
+ function ai(n) {
432
+ for (var r, p = n.length, c = p % 3, u = [], f = 16383, l = 0, a = p - c; l < a; l += f)
433
+ u.push(oi(n, l, l + f > a ? a : l + f));
434
+ return c === 1 ? (r = n[p - 1], u.push(
435
435
  D[r >> 2] + D[r << 4 & 63] + "=="
436
- )) : c === 2 && (r = (o[p - 2] << 8) + o[p - 1], u.push(
436
+ )) : c === 2 && (r = (n[p - 2] << 8) + n[p - 1], u.push(
437
437
  D[r >> 10] + D[r >> 4 & 63] + D[r << 2 & 63] + "="
438
438
  )), u.join("");
439
439
  }
440
- var ht = {};
440
+ var dt = {};
441
441
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
442
- ht.read = function(o, r, p, c, u) {
443
- var f, l, a = u * 8 - c - 1, x = (1 << a) - 1, d = x >> 1, b = -7, w = p ? u - 1 : 0, v = p ? -1 : 1, y = o[r + w];
444
- for (w += v, f = y & (1 << -b) - 1, y >>= -b, b += a; b > 0; f = f * 256 + o[r + w], w += v, b -= 8)
442
+ dt.read = function(n, r, p, c, u) {
443
+ var f, l, a = u * 8 - c - 1, x = (1 << a) - 1, d = x >> 1, v = -7, g = p ? u - 1 : 0, y = p ? -1 : 1, b = n[r + g];
444
+ for (g += y, f = b & (1 << -v) - 1, b >>= -v, v += a; v > 0; f = f * 256 + n[r + g], g += y, v -= 8)
445
445
  ;
446
- for (l = f & (1 << -b) - 1, f >>= -b, b += c; b > 0; l = l * 256 + o[r + w], w += v, b -= 8)
446
+ for (l = f & (1 << -v) - 1, f >>= -v, v += c; v > 0; l = l * 256 + n[r + g], g += y, v -= 8)
447
447
  ;
448
448
  if (f === 0)
449
449
  f = 1 - d;
450
450
  else {
451
451
  if (f === x)
452
- return l ? NaN : (y ? -1 : 1) * (1 / 0);
452
+ return l ? NaN : (b ? -1 : 1) * (1 / 0);
453
453
  l = l + Math.pow(2, c), f = f - d;
454
454
  }
455
- return (y ? -1 : 1) * l * Math.pow(2, f - c);
455
+ return (b ? -1 : 1) * l * Math.pow(2, f - c);
456
456
  };
457
- ht.write = function(o, r, p, c, u, f) {
458
- var l, a, x, d = f * 8 - u - 1, b = (1 << d) - 1, w = b >> 1, v = u === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, y = c ? 0 : f - 1, U = c ? 1 : -1, j = r < 0 || r === 0 && 1 / r < 0 ? 1 : 0;
459
- for (r = Math.abs(r), isNaN(r) || r === 1 / 0 ? (a = isNaN(r) ? 1 : 0, l = b) : (l = Math.floor(Math.log(r) / Math.LN2), r * (x = Math.pow(2, -l)) < 1 && (l--, x *= 2), l + w >= 1 ? r += v / x : r += v * Math.pow(2, 1 - w), r * x >= 2 && (l++, x /= 2), l + w >= b ? (a = 0, l = b) : l + w >= 1 ? (a = (r * x - 1) * Math.pow(2, u), l = l + w) : (a = r * Math.pow(2, w - 1) * Math.pow(2, u), l = 0)); u >= 8; o[p + y] = a & 255, y += U, a /= 256, u -= 8)
457
+ dt.write = function(n, r, p, c, u, f) {
458
+ var l, a, x, d = f * 8 - u - 1, v = (1 << d) - 1, g = v >> 1, y = u === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, b = c ? 0 : f - 1, E = c ? 1 : -1, U = r < 0 || r === 0 && 1 / r < 0 ? 1 : 0;
459
+ for (r = Math.abs(r), isNaN(r) || r === 1 / 0 ? (a = isNaN(r) ? 1 : 0, l = v) : (l = Math.floor(Math.log(r) / Math.LN2), r * (x = Math.pow(2, -l)) < 1 && (l--, x *= 2), l + g >= 1 ? r += y / x : r += y * Math.pow(2, 1 - g), r * x >= 2 && (l++, x /= 2), l + g >= v ? (a = 0, l = v) : l + g >= 1 ? (a = (r * x - 1) * Math.pow(2, u), l = l + g) : (a = r * Math.pow(2, g - 1) * Math.pow(2, u), l = 0)); u >= 8; n[p + b] = a & 255, b += E, a /= 256, u -= 8)
460
460
  ;
461
- for (l = l << u | a, d += u; d > 0; o[p + y] = l & 255, y += U, l /= 256, d -= 8)
461
+ for (l = l << u | a, d += u; d > 0; n[p + b] = l & 255, b += E, l /= 256, d -= 8)
462
462
  ;
463
- o[p + y - U] |= j * 128;
463
+ n[p + b - E] |= U * 128;
464
464
  };
465
465
  /*!
466
466
  * The buffer module from node.js, for the browser.
@@ -468,11 +468,11 @@ ht.write = function(o, r, p, c, u, f) {
468
468
  * @author Feross Aboukhadijeh <https://feross.org>
469
469
  * @license MIT
470
470
  */
471
- (function(o) {
472
- var r = Q, p = ht, c = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
473
- o.Buffer = a, o.SlowBuffer = le, o.INSPECT_MAX_BYTES = 50;
471
+ (function(n) {
472
+ var r = tt, p = dt, c = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
473
+ n.Buffer = a, n.SlowBuffer = G, n.INSPECT_MAX_BYTES = 50;
474
474
  var u = 2147483647;
475
- o.kMaxLength = u, a.TYPED_ARRAY_SUPPORT = f(), !a.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
475
+ n.kMaxLength = u, a.TYPED_ARRAY_SUPPORT = f(), !a.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
476
476
  "This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
477
477
  );
478
478
  function f() {
@@ -510,30 +510,30 @@ ht.write = function(o, r, p, c, u, f) {
510
510
  throw new TypeError(
511
511
  'The "string" argument must be of type string. Received type number'
512
512
  );
513
- return w(i);
513
+ return g(i);
514
514
  }
515
515
  return x(i, t, e);
516
516
  }
517
517
  a.poolSize = 8192;
518
518
  function x(i, t, e) {
519
519
  if (typeof i == "string")
520
- return v(i, t);
520
+ return y(i, t);
521
521
  if (ArrayBuffer.isView(i))
522
- return U(i);
522
+ return E(i);
523
523
  if (i == null)
524
524
  throw new TypeError(
525
525
  "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof i
526
526
  );
527
527
  if (T(i, ArrayBuffer) || i && T(i.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (T(i, SharedArrayBuffer) || i && T(i.buffer, SharedArrayBuffer)))
528
- return j(i, t, e);
528
+ return U(i, t, e);
529
529
  if (typeof i == "number")
530
530
  throw new TypeError(
531
531
  'The "value" argument must not be of type number. Received type number'
532
532
  );
533
- var n = i.valueOf && i.valueOf();
534
- if (n != null && n !== i)
535
- return a.from(n, t, e);
536
- var s = $(i);
533
+ var o = i.valueOf && i.valueOf();
534
+ if (o != null && o !== i)
535
+ return a.from(o, t, e);
536
+ var s = R(i);
537
537
  if (s)
538
538
  return s;
539
539
  if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof i[Symbol.toPrimitive] == "function")
@@ -555,62 +555,62 @@ ht.write = function(o, r, p, c, u, f) {
555
555
  if (i < 0)
556
556
  throw new RangeError('The value "' + i + '" is invalid for option "size"');
557
557
  }
558
- function b(i, t, e) {
558
+ function v(i, t, e) {
559
559
  return d(i), i <= 0 ? l(i) : t !== void 0 ? typeof e == "string" ? l(i).fill(t, e) : l(i).fill(t) : l(i);
560
560
  }
561
561
  a.alloc = function(i, t, e) {
562
- return b(i, t, e);
562
+ return v(i, t, e);
563
563
  };
564
- function w(i) {
565
- return d(i), l(i < 0 ? 0 : R(i) | 0);
564
+ function g(i) {
565
+ return d(i), l(i < 0 ? 0 : $(i) | 0);
566
566
  }
567
567
  a.allocUnsafe = function(i) {
568
- return w(i);
568
+ return g(i);
569
569
  }, a.allocUnsafeSlow = function(i) {
570
- return w(i);
570
+ return g(i);
571
571
  };
572
- function v(i, t) {
572
+ function y(i, t) {
573
573
  if ((typeof t != "string" || t === "") && (t = "utf8"), !a.isEncoding(t))
574
574
  throw new TypeError("Unknown encoding: " + t);
575
- var e = gt(i, t) | 0, n = l(e), s = n.write(i, t);
576
- return s !== e && (n = n.slice(0, s)), n;
575
+ var e = vt(i, t) | 0, o = l(e), s = o.write(i, t);
576
+ return s !== e && (o = o.slice(0, s)), o;
577
577
  }
578
- function y(i) {
579
- for (var t = i.length < 0 ? 0 : R(i.length) | 0, e = l(t), n = 0; n < t; n += 1)
580
- e[n] = i[n] & 255;
578
+ function b(i) {
579
+ for (var t = i.length < 0 ? 0 : $(i.length) | 0, e = l(t), o = 0; o < t; o += 1)
580
+ e[o] = i[o] & 255;
581
581
  return e;
582
582
  }
583
- function U(i) {
583
+ function E(i) {
584
584
  if (T(i, Uint8Array)) {
585
585
  var t = new Uint8Array(i);
586
- return j(t.buffer, t.byteOffset, t.byteLength);
586
+ return U(t.buffer, t.byteOffset, t.byteLength);
587
587
  }
588
- return y(i);
588
+ return b(i);
589
589
  }
590
- function j(i, t, e) {
590
+ function U(i, t, e) {
591
591
  if (t < 0 || i.byteLength < t)
592
592
  throw new RangeError('"offset" is outside of buffer bounds');
593
593
  if (i.byteLength < t + (e || 0))
594
594
  throw new RangeError('"length" is outside of buffer bounds');
595
- var n;
596
- return t === void 0 && e === void 0 ? n = new Uint8Array(i) : e === void 0 ? n = new Uint8Array(i, t) : n = new Uint8Array(i, t, e), Object.setPrototypeOf(n, a.prototype), n;
595
+ var o;
596
+ return t === void 0 && e === void 0 ? o = new Uint8Array(i) : e === void 0 ? o = new Uint8Array(i, t) : o = new Uint8Array(i, t, e), Object.setPrototypeOf(o, a.prototype), o;
597
597
  }
598
- function $(i) {
598
+ function R(i) {
599
599
  if (a.isBuffer(i)) {
600
- var t = R(i.length) | 0, e = l(t);
600
+ var t = $(i.length) | 0, e = l(t);
601
601
  return e.length === 0 || i.copy(e, 0, 0, t), e;
602
602
  }
603
603
  if (i.length !== void 0)
604
- return typeof i.length != "number" || rt(i.length) ? l(0) : y(i);
604
+ return typeof i.length != "number" || nt(i.length) ? l(0) : b(i);
605
605
  if (i.type === "Buffer" && Array.isArray(i.data))
606
- return y(i.data);
606
+ return b(i.data);
607
607
  }
608
- function R(i) {
608
+ function $(i) {
609
609
  if (i >= u)
610
610
  throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + u.toString(16) + " bytes");
611
611
  return i | 0;
612
612
  }
613
- function le(i) {
613
+ function G(i) {
614
614
  return +i != i && (i = 0), a.alloc(+i);
615
615
  }
616
616
  a.isBuffer = function(t) {
@@ -622,12 +622,12 @@ ht.write = function(o, r, p, c, u, f) {
622
622
  );
623
623
  if (t === e)
624
624
  return 0;
625
- for (var n = t.length, s = e.length, m = 0, h = Math.min(n, s); m < h; ++m)
625
+ for (var o = t.length, s = e.length, m = 0, h = Math.min(o, s); m < h; ++m)
626
626
  if (t[m] !== e[m]) {
627
- n = t[m], s = e[m];
627
+ o = t[m], s = e[m];
628
628
  break;
629
629
  }
630
- return n < s ? -1 : s < n ? 1 : 0;
630
+ return o < s ? -1 : s < o ? 1 : 0;
631
631
  }, a.isEncoding = function(t) {
632
632
  switch (String(t).toLowerCase()) {
633
633
  case "hex":
@@ -650,13 +650,13 @@ ht.write = function(o, r, p, c, u, f) {
650
650
  throw new TypeError('"list" argument must be an Array of Buffers');
651
651
  if (t.length === 0)
652
652
  return a.alloc(0);
653
- var n;
653
+ var o;
654
654
  if (e === void 0)
655
- for (e = 0, n = 0; n < t.length; ++n)
656
- e += t[n].length;
655
+ for (e = 0, o = 0; o < t.length; ++o)
656
+ e += t[o].length;
657
657
  var s = a.allocUnsafe(e), m = 0;
658
- for (n = 0; n < t.length; ++n) {
659
- var h = t[n];
658
+ for (o = 0; o < t.length; ++o) {
659
+ var h = t[o];
660
660
  if (T(h, Uint8Array))
661
661
  m + h.length > s.length ? a.from(h).copy(s, m) : Uint8Array.prototype.set.call(
662
662
  s,
@@ -671,7 +671,7 @@ ht.write = function(o, r, p, c, u, f) {
671
671
  }
672
672
  return s;
673
673
  };
674
- function gt(i, t) {
674
+ function vt(i, t) {
675
675
  if (a.isBuffer(i))
676
676
  return i.length;
677
677
  if (ArrayBuffer.isView(i) || T(i, ArrayBuffer))
@@ -680,8 +680,8 @@ ht.write = function(o, r, p, c, u, f) {
680
680
  throw new TypeError(
681
681
  'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof i
682
682
  );
683
- var e = i.length, n = arguments.length > 2 && arguments[2] === !0;
684
- if (!n && e === 0)
683
+ var e = i.length, o = arguments.length > 2 && arguments[2] === !0;
684
+ if (!o && e === 0)
685
685
  return 0;
686
686
  for (var s = !1; ; )
687
687
  switch (t) {
@@ -691,7 +691,7 @@ ht.write = function(o, r, p, c, u, f) {
691
691
  return e;
692
692
  case "utf8":
693
693
  case "utf-8":
694
- return it(i).length;
694
+ return rt(i).length;
695
695
  case "ucs2":
696
696
  case "ucs-2":
697
697
  case "utf16le":
@@ -700,47 +700,47 @@ ht.write = function(o, r, p, c, u, f) {
700
700
  case "hex":
701
701
  return e >>> 1;
702
702
  case "base64":
703
- return St(i).length;
703
+ return Bt(i).length;
704
704
  default:
705
705
  if (s)
706
- return n ? -1 : it(i).length;
706
+ return o ? -1 : rt(i).length;
707
707
  t = ("" + t).toLowerCase(), s = !0;
708
708
  }
709
709
  }
710
- a.byteLength = gt;
711
- function ue(i, t, e) {
712
- var n = !1;
710
+ a.byteLength = vt;
711
+ function fe(i, t, e) {
712
+ var o = !1;
713
713
  if ((t === void 0 || t < 0) && (t = 0), t > this.length || ((e === void 0 || e > this.length) && (e = this.length), e <= 0) || (e >>>= 0, t >>>= 0, e <= t))
714
714
  return "";
715
715
  for (i || (i = "utf8"); ; )
716
716
  switch (i) {
717
717
  case "hex":
718
- return be(this, t, e);
718
+ return Ee(this, t, e);
719
719
  case "utf8":
720
720
  case "utf-8":
721
- return bt(this, t, e);
721
+ return _t(this, t, e);
722
722
  case "ascii":
723
- return ye(this, t, e);
723
+ return ve(this, t, e);
724
724
  case "latin1":
725
725
  case "binary":
726
- return ve(this, t, e);
726
+ return be(this, t, e);
727
727
  case "base64":
728
- return we(this, t, e);
728
+ return ge(this, t, e);
729
729
  case "ucs2":
730
730
  case "ucs-2":
731
731
  case "utf16le":
732
732
  case "utf-16le":
733
- return Ee(this, t, e);
733
+ return _e(this, t, e);
734
734
  default:
735
- if (n)
735
+ if (o)
736
736
  throw new TypeError("Unknown encoding: " + i);
737
- i = (i + "").toLowerCase(), n = !0;
737
+ i = (i + "").toLowerCase(), o = !0;
738
738
  }
739
739
  }
740
740
  a.prototype._isBuffer = !0;
741
741
  function N(i, t, e) {
742
- var n = i[t];
743
- i[t] = i[e], i[e] = n;
742
+ var o = i[t];
743
+ i[t] = i[e], i[e] = o;
744
744
  }
745
745
  a.prototype.swap16 = function() {
746
746
  var t = this.length;
@@ -765,40 +765,40 @@ ht.write = function(o, r, p, c, u, f) {
765
765
  return this;
766
766
  }, a.prototype.toString = function() {
767
767
  var t = this.length;
768
- return t === 0 ? "" : arguments.length === 0 ? bt(this, 0, t) : ue.apply(this, arguments);
768
+ return t === 0 ? "" : arguments.length === 0 ? _t(this, 0, t) : fe.apply(this, arguments);
769
769
  }, a.prototype.toLocaleString = a.prototype.toString, a.prototype.equals = function(t) {
770
770
  if (!a.isBuffer(t))
771
771
  throw new TypeError("Argument must be a Buffer");
772
772
  return this === t ? !0 : a.compare(this, t) === 0;
773
773
  }, a.prototype.inspect = function() {
774
- var t = "", e = o.INSPECT_MAX_BYTES;
774
+ var t = "", e = n.INSPECT_MAX_BYTES;
775
775
  return t = this.toString("hex", 0, e).replace(/(.{2})/g, "$1 ").trim(), this.length > e && (t += " ... "), "<Buffer " + t + ">";
776
- }, c && (a.prototype[c] = a.prototype.inspect), a.prototype.compare = function(t, e, n, s, m) {
776
+ }, c && (a.prototype[c] = a.prototype.inspect), a.prototype.compare = function(t, e, o, s, m) {
777
777
  if (T(t, Uint8Array) && (t = a.from(t, t.offset, t.byteLength)), !a.isBuffer(t))
778
778
  throw new TypeError(
779
779
  'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof t
780
780
  );
781
- if (e === void 0 && (e = 0), n === void 0 && (n = t ? t.length : 0), s === void 0 && (s = 0), m === void 0 && (m = this.length), e < 0 || n > t.length || s < 0 || m > this.length)
781
+ if (e === void 0 && (e = 0), o === void 0 && (o = t ? t.length : 0), s === void 0 && (s = 0), m === void 0 && (m = this.length), e < 0 || o > t.length || s < 0 || m > this.length)
782
782
  throw new RangeError("out of range index");
783
- if (s >= m && e >= n)
783
+ if (s >= m && e >= o)
784
784
  return 0;
785
785
  if (s >= m)
786
786
  return -1;
787
- if (e >= n)
787
+ if (e >= o)
788
788
  return 1;
789
- if (e >>>= 0, n >>>= 0, s >>>= 0, m >>>= 0, this === t)
789
+ if (e >>>= 0, o >>>= 0, s >>>= 0, m >>>= 0, this === t)
790
790
  return 0;
791
- for (var h = m - s, E = n - e, _ = Math.min(h, E), F = this.slice(s, m), k = t.slice(e, n), A = 0; A < _; ++A)
792
- if (F[A] !== k[A]) {
793
- h = F[A], E = k[A];
791
+ for (var h = m - s, _ = o - e, F = Math.min(h, _), A = this.slice(s, m), B = t.slice(e, o), S = 0; S < F; ++S)
792
+ if (A[S] !== B[S]) {
793
+ h = A[S], _ = B[S];
794
794
  break;
795
795
  }
796
- return h < E ? -1 : E < h ? 1 : 0;
796
+ return h < _ ? -1 : _ < h ? 1 : 0;
797
797
  };
798
- function yt(i, t, e, n, s) {
798
+ function bt(i, t, e, o, s) {
799
799
  if (i.length === 0)
800
800
  return -1;
801
- if (typeof e == "string" ? (n = e, e = 0) : e > 2147483647 ? e = 2147483647 : e < -2147483648 && (e = -2147483648), e = +e, rt(e) && (e = s ? 0 : i.length - 1), e < 0 && (e = i.length + e), e >= i.length) {
801
+ if (typeof e == "string" ? (o = e, e = 0) : e > 2147483647 ? e = 2147483647 : e < -2147483648 && (e = -2147483648), e = +e, nt(e) && (e = s ? 0 : i.length - 1), e < 0 && (e = i.length + e), e >= i.length) {
802
802
  if (s)
803
803
  return -1;
804
804
  e = i.length - 1;
@@ -807,109 +807,109 @@ ht.write = function(o, r, p, c, u, f) {
807
807
  e = 0;
808
808
  else
809
809
  return -1;
810
- if (typeof t == "string" && (t = a.from(t, n)), a.isBuffer(t))
811
- return t.length === 0 ? -1 : vt(i, t, e, n, s);
810
+ if (typeof t == "string" && (t = a.from(t, o)), a.isBuffer(t))
811
+ return t.length === 0 ? -1 : Et(i, t, e, o, s);
812
812
  if (typeof t == "number")
813
- return t = t & 255, typeof Uint8Array.prototype.indexOf == "function" ? s ? Uint8Array.prototype.indexOf.call(i, t, e) : Uint8Array.prototype.lastIndexOf.call(i, t, e) : vt(i, [t], e, n, s);
813
+ return t = t & 255, typeof Uint8Array.prototype.indexOf == "function" ? s ? Uint8Array.prototype.indexOf.call(i, t, e) : Uint8Array.prototype.lastIndexOf.call(i, t, e) : Et(i, [t], e, o, s);
814
814
  throw new TypeError("val must be string, number or Buffer");
815
815
  }
816
- function vt(i, t, e, n, s) {
817
- var m = 1, h = i.length, E = t.length;
818
- if (n !== void 0 && (n = String(n).toLowerCase(), n === "ucs2" || n === "ucs-2" || n === "utf16le" || n === "utf-16le")) {
816
+ function Et(i, t, e, o, s) {
817
+ var m = 1, h = i.length, _ = t.length;
818
+ if (o !== void 0 && (o = String(o).toLowerCase(), o === "ucs2" || o === "ucs-2" || o === "utf16le" || o === "utf-16le")) {
819
819
  if (i.length < 2 || t.length < 2)
820
820
  return -1;
821
- m = 2, h /= 2, E /= 2, e /= 2;
821
+ m = 2, h /= 2, _ /= 2, e /= 2;
822
822
  }
823
- function _(kt, Bt) {
824
- return m === 1 ? kt[Bt] : kt.readUInt16BE(Bt * m);
823
+ function F(jt, It) {
824
+ return m === 1 ? jt[It] : jt.readUInt16BE(It * m);
825
825
  }
826
- var F;
826
+ var A;
827
827
  if (s) {
828
- var k = -1;
829
- for (F = e; F < h; F++)
830
- if (_(i, F) === _(t, k === -1 ? 0 : F - k)) {
831
- if (k === -1 && (k = F), F - k + 1 === E)
832
- return k * m;
828
+ var B = -1;
829
+ for (A = e; A < h; A++)
830
+ if (F(i, A) === F(t, B === -1 ? 0 : A - B)) {
831
+ if (B === -1 && (B = A), A - B + 1 === _)
832
+ return B * m;
833
833
  } else
834
- k !== -1 && (F -= F - k), k = -1;
834
+ B !== -1 && (A -= A - B), B = -1;
835
835
  } else
836
- for (e + E > h && (e = h - E), F = e; F >= 0; F--) {
837
- for (var A = !0, K = 0; K < E; K++)
838
- if (_(i, F + K) !== _(t, K)) {
839
- A = !1;
836
+ for (e + _ > h && (e = h - _), A = e; A >= 0; A--) {
837
+ for (var S = !0, V = 0; V < _; V++)
838
+ if (F(i, A + V) !== F(t, V)) {
839
+ S = !1;
840
840
  break;
841
841
  }
842
- if (A)
843
- return F;
842
+ if (S)
843
+ return A;
844
844
  }
845
845
  return -1;
846
846
  }
847
- a.prototype.includes = function(t, e, n) {
848
- return this.indexOf(t, e, n) !== -1;
849
- }, a.prototype.indexOf = function(t, e, n) {
850
- return yt(this, t, e, n, !0);
851
- }, a.prototype.lastIndexOf = function(t, e, n) {
852
- return yt(this, t, e, n, !1);
847
+ a.prototype.includes = function(t, e, o) {
848
+ return this.indexOf(t, e, o) !== -1;
849
+ }, a.prototype.indexOf = function(t, e, o) {
850
+ return bt(this, t, e, o, !0);
851
+ }, a.prototype.lastIndexOf = function(t, e, o) {
852
+ return bt(this, t, e, o, !1);
853
853
  };
854
- function fe(i, t, e, n) {
854
+ function me(i, t, e, o) {
855
855
  e = Number(e) || 0;
856
856
  var s = i.length - e;
857
- n ? (n = Number(n), n > s && (n = s)) : n = s;
857
+ o ? (o = Number(o), o > s && (o = s)) : o = s;
858
858
  var m = t.length;
859
- n > m / 2 && (n = m / 2);
860
- for (var h = 0; h < n; ++h) {
861
- var E = parseInt(t.substr(h * 2, 2), 16);
862
- if (rt(E))
859
+ o > m / 2 && (o = m / 2);
860
+ for (var h = 0; h < o; ++h) {
861
+ var _ = parseInt(t.substr(h * 2, 2), 16);
862
+ if (nt(_))
863
863
  return h;
864
- i[e + h] = E;
864
+ i[e + h] = _;
865
865
  }
866
866
  return h;
867
867
  }
868
- function me(i, t, e, n) {
869
- return G(it(t, i.length - e), i, e, n);
868
+ function he(i, t, e, o) {
869
+ return K(rt(t, i.length - e), i, e, o);
870
870
  }
871
- function he(i, t, e, n) {
872
- return G(Ae(t), i, e, n);
871
+ function xe(i, t, e, o) {
872
+ return K(Se(t), i, e, o);
873
873
  }
874
- function xe(i, t, e, n) {
875
- return G(St(t), i, e, n);
874
+ function de(i, t, e, o) {
875
+ return K(Bt(t), i, e, o);
876
876
  }
877
- function de(i, t, e, n) {
878
- return G(Se(t, i.length - e), i, e, n);
877
+ function we(i, t, e, o) {
878
+ return K(ke(t, i.length - e), i, e, o);
879
879
  }
880
- a.prototype.write = function(t, e, n, s) {
880
+ a.prototype.write = function(t, e, o, s) {
881
881
  if (e === void 0)
882
- s = "utf8", n = this.length, e = 0;
883
- else if (n === void 0 && typeof e == "string")
884
- s = e, n = this.length, e = 0;
882
+ s = "utf8", o = this.length, e = 0;
883
+ else if (o === void 0 && typeof e == "string")
884
+ s = e, o = this.length, e = 0;
885
885
  else if (isFinite(e))
886
- e = e >>> 0, isFinite(n) ? (n = n >>> 0, s === void 0 && (s = "utf8")) : (s = n, n = void 0);
886
+ e = e >>> 0, isFinite(o) ? (o = o >>> 0, s === void 0 && (s = "utf8")) : (s = o, o = void 0);
887
887
  else
888
888
  throw new Error(
889
889
  "Buffer.write(string, encoding, offset[, length]) is no longer supported"
890
890
  );
891
891
  var m = this.length - e;
892
- if ((n === void 0 || n > m) && (n = m), t.length > 0 && (n < 0 || e < 0) || e > this.length)
892
+ if ((o === void 0 || o > m) && (o = m), t.length > 0 && (o < 0 || e < 0) || e > this.length)
893
893
  throw new RangeError("Attempt to write outside buffer bounds");
894
894
  s || (s = "utf8");
895
895
  for (var h = !1; ; )
896
896
  switch (s) {
897
897
  case "hex":
898
- return fe(this, t, e, n);
898
+ return me(this, t, e, o);
899
899
  case "utf8":
900
900
  case "utf-8":
901
- return me(this, t, e, n);
901
+ return he(this, t, e, o);
902
902
  case "ascii":
903
903
  case "latin1":
904
904
  case "binary":
905
- return he(this, t, e, n);
905
+ return xe(this, t, e, o);
906
906
  case "base64":
907
- return xe(this, t, e, n);
907
+ return de(this, t, e, o);
908
908
  case "ucs2":
909
909
  case "ucs-2":
910
910
  case "utf16le":
911
911
  case "utf-16le":
912
- return de(this, t, e, n);
912
+ return we(this, t, e, o);
913
913
  default:
914
914
  if (h)
915
915
  throw new TypeError("Unknown encoding: " + s);
@@ -921,243 +921,243 @@ ht.write = function(o, r, p, c, u, f) {
921
921
  data: Array.prototype.slice.call(this._arr || this, 0)
922
922
  };
923
923
  };
924
- function we(i, t, e) {
924
+ function ge(i, t, e) {
925
925
  return t === 0 && e === i.length ? r.fromByteArray(i) : r.fromByteArray(i.slice(t, e));
926
926
  }
927
- function bt(i, t, e) {
927
+ function _t(i, t, e) {
928
928
  e = Math.min(i.length, e);
929
- for (var n = [], s = t; s < e; ) {
930
- var m = i[s], h = null, E = m > 239 ? 4 : m > 223 ? 3 : m > 191 ? 2 : 1;
931
- if (s + E <= e) {
932
- var _, F, k, A;
933
- switch (E) {
929
+ for (var o = [], s = t; s < e; ) {
930
+ var m = i[s], h = null, _ = m > 239 ? 4 : m > 223 ? 3 : m > 191 ? 2 : 1;
931
+ if (s + _ <= e) {
932
+ var F, A, B, S;
933
+ switch (_) {
934
934
  case 1:
935
935
  m < 128 && (h = m);
936
936
  break;
937
937
  case 2:
938
- _ = i[s + 1], (_ & 192) === 128 && (A = (m & 31) << 6 | _ & 63, A > 127 && (h = A));
938
+ F = i[s + 1], (F & 192) === 128 && (S = (m & 31) << 6 | F & 63, S > 127 && (h = S));
939
939
  break;
940
940
  case 3:
941
- _ = i[s + 1], F = i[s + 2], (_ & 192) === 128 && (F & 192) === 128 && (A = (m & 15) << 12 | (_ & 63) << 6 | F & 63, A > 2047 && (A < 55296 || A > 57343) && (h = A));
941
+ F = i[s + 1], A = i[s + 2], (F & 192) === 128 && (A & 192) === 128 && (S = (m & 15) << 12 | (F & 63) << 6 | A & 63, S > 2047 && (S < 55296 || S > 57343) && (h = S));
942
942
  break;
943
943
  case 4:
944
- _ = i[s + 1], F = i[s + 2], k = i[s + 3], (_ & 192) === 128 && (F & 192) === 128 && (k & 192) === 128 && (A = (m & 15) << 18 | (_ & 63) << 12 | (F & 63) << 6 | k & 63, A > 65535 && A < 1114112 && (h = A));
944
+ F = i[s + 1], A = i[s + 2], B = i[s + 3], (F & 192) === 128 && (A & 192) === 128 && (B & 192) === 128 && (S = (m & 15) << 18 | (F & 63) << 12 | (A & 63) << 6 | B & 63, S > 65535 && S < 1114112 && (h = S));
945
945
  }
946
946
  }
947
- h === null ? (h = 65533, E = 1) : h > 65535 && (h -= 65536, n.push(h >>> 10 & 1023 | 55296), h = 56320 | h & 1023), n.push(h), s += E;
947
+ h === null ? (h = 65533, _ = 1) : h > 65535 && (h -= 65536, o.push(h >>> 10 & 1023 | 55296), h = 56320 | h & 1023), o.push(h), s += _;
948
948
  }
949
- return ge(n);
949
+ return ye(o);
950
950
  }
951
- var Et = 4096;
952
- function ge(i) {
951
+ var Ft = 4096;
952
+ function ye(i) {
953
953
  var t = i.length;
954
- if (t <= Et)
954
+ if (t <= Ft)
955
955
  return String.fromCharCode.apply(String, i);
956
- for (var e = "", n = 0; n < t; )
956
+ for (var e = "", o = 0; o < t; )
957
957
  e += String.fromCharCode.apply(
958
958
  String,
959
- i.slice(n, n += Et)
959
+ i.slice(o, o += Ft)
960
960
  );
961
961
  return e;
962
962
  }
963
- function ye(i, t, e) {
964
- var n = "";
963
+ function ve(i, t, e) {
964
+ var o = "";
965
965
  e = Math.min(i.length, e);
966
966
  for (var s = t; s < e; ++s)
967
- n += String.fromCharCode(i[s] & 127);
968
- return n;
967
+ o += String.fromCharCode(i[s] & 127);
968
+ return o;
969
969
  }
970
- function ve(i, t, e) {
971
- var n = "";
970
+ function be(i, t, e) {
971
+ var o = "";
972
972
  e = Math.min(i.length, e);
973
973
  for (var s = t; s < e; ++s)
974
- n += String.fromCharCode(i[s]);
975
- return n;
974
+ o += String.fromCharCode(i[s]);
975
+ return o;
976
976
  }
977
- function be(i, t, e) {
978
- var n = i.length;
979
- (!t || t < 0) && (t = 0), (!e || e < 0 || e > n) && (e = n);
977
+ function Ee(i, t, e) {
978
+ var o = i.length;
979
+ (!t || t < 0) && (t = 0), (!e || e < 0 || e > o) && (e = o);
980
980
  for (var s = "", m = t; m < e; ++m)
981
- s += ke[i[m]];
981
+ s += Be[i[m]];
982
982
  return s;
983
983
  }
984
- function Ee(i, t, e) {
985
- for (var n = i.slice(t, e), s = "", m = 0; m < n.length - 1; m += 2)
986
- s += String.fromCharCode(n[m] + n[m + 1] * 256);
984
+ function _e(i, t, e) {
985
+ for (var o = i.slice(t, e), s = "", m = 0; m < o.length - 1; m += 2)
986
+ s += String.fromCharCode(o[m] + o[m + 1] * 256);
987
987
  return s;
988
988
  }
989
989
  a.prototype.slice = function(t, e) {
990
- var n = this.length;
991
- t = ~~t, e = e === void 0 ? n : ~~e, t < 0 ? (t += n, t < 0 && (t = 0)) : t > n && (t = n), e < 0 ? (e += n, e < 0 && (e = 0)) : e > n && (e = n), e < t && (e = t);
990
+ var o = this.length;
991
+ t = ~~t, e = e === void 0 ? o : ~~e, t < 0 ? (t += o, t < 0 && (t = 0)) : t > o && (t = o), e < 0 ? (e += o, e < 0 && (e = 0)) : e > o && (e = o), e < t && (e = t);
992
992
  var s = this.subarray(t, e);
993
993
  return Object.setPrototypeOf(s, a.prototype), s;
994
994
  };
995
- function S(i, t, e) {
995
+ function k(i, t, e) {
996
996
  if (i % 1 !== 0 || i < 0)
997
997
  throw new RangeError("offset is not uint");
998
998
  if (i + t > e)
999
999
  throw new RangeError("Trying to access beyond buffer length");
1000
1000
  }
1001
- a.prototype.readUintLE = a.prototype.readUIntLE = function(t, e, n) {
1002
- t = t >>> 0, e = e >>> 0, n || S(t, e, this.length);
1001
+ a.prototype.readUintLE = a.prototype.readUIntLE = function(t, e, o) {
1002
+ t = t >>> 0, e = e >>> 0, o || k(t, e, this.length);
1003
1003
  for (var s = this[t], m = 1, h = 0; ++h < e && (m *= 256); )
1004
1004
  s += this[t + h] * m;
1005
1005
  return s;
1006
- }, a.prototype.readUintBE = a.prototype.readUIntBE = function(t, e, n) {
1007
- t = t >>> 0, e = e >>> 0, n || S(t, e, this.length);
1006
+ }, a.prototype.readUintBE = a.prototype.readUIntBE = function(t, e, o) {
1007
+ t = t >>> 0, e = e >>> 0, o || k(t, e, this.length);
1008
1008
  for (var s = this[t + --e], m = 1; e > 0 && (m *= 256); )
1009
1009
  s += this[t + --e] * m;
1010
1010
  return s;
1011
1011
  }, a.prototype.readUint8 = a.prototype.readUInt8 = function(t, e) {
1012
- return t = t >>> 0, e || S(t, 1, this.length), this[t];
1012
+ return t = t >>> 0, e || k(t, 1, this.length), this[t];
1013
1013
  }, a.prototype.readUint16LE = a.prototype.readUInt16LE = function(t, e) {
1014
- return t = t >>> 0, e || S(t, 2, this.length), this[t] | this[t + 1] << 8;
1014
+ return t = t >>> 0, e || k(t, 2, this.length), this[t] | this[t + 1] << 8;
1015
1015
  }, a.prototype.readUint16BE = a.prototype.readUInt16BE = function(t, e) {
1016
- return t = t >>> 0, e || S(t, 2, this.length), this[t] << 8 | this[t + 1];
1016
+ return t = t >>> 0, e || k(t, 2, this.length), this[t] << 8 | this[t + 1];
1017
1017
  }, a.prototype.readUint32LE = a.prototype.readUInt32LE = function(t, e) {
1018
- return t = t >>> 0, e || S(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + this[t + 3] * 16777216;
1018
+ return t = t >>> 0, e || k(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + this[t + 3] * 16777216;
1019
1019
  }, a.prototype.readUint32BE = a.prototype.readUInt32BE = function(t, e) {
1020
- return t = t >>> 0, e || S(t, 4, this.length), this[t] * 16777216 + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]);
1021
- }, a.prototype.readIntLE = function(t, e, n) {
1022
- t = t >>> 0, e = e >>> 0, n || S(t, e, this.length);
1020
+ return t = t >>> 0, e || k(t, 4, this.length), this[t] * 16777216 + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]);
1021
+ }, a.prototype.readIntLE = function(t, e, o) {
1022
+ t = t >>> 0, e = e >>> 0, o || k(t, e, this.length);
1023
1023
  for (var s = this[t], m = 1, h = 0; ++h < e && (m *= 256); )
1024
1024
  s += this[t + h] * m;
1025
1025
  return m *= 128, s >= m && (s -= Math.pow(2, 8 * e)), s;
1026
- }, a.prototype.readIntBE = function(t, e, n) {
1027
- t = t >>> 0, e = e >>> 0, n || S(t, e, this.length);
1026
+ }, a.prototype.readIntBE = function(t, e, o) {
1027
+ t = t >>> 0, e = e >>> 0, o || k(t, e, this.length);
1028
1028
  for (var s = e, m = 1, h = this[t + --s]; s > 0 && (m *= 256); )
1029
1029
  h += this[t + --s] * m;
1030
1030
  return m *= 128, h >= m && (h -= Math.pow(2, 8 * e)), h;
1031
1031
  }, a.prototype.readInt8 = function(t, e) {
1032
- return t = t >>> 0, e || S(t, 1, this.length), this[t] & 128 ? (255 - this[t] + 1) * -1 : this[t];
1032
+ return t = t >>> 0, e || k(t, 1, this.length), this[t] & 128 ? (255 - this[t] + 1) * -1 : this[t];
1033
1033
  }, a.prototype.readInt16LE = function(t, e) {
1034
- t = t >>> 0, e || S(t, 2, this.length);
1035
- var n = this[t] | this[t + 1] << 8;
1036
- return n & 32768 ? n | 4294901760 : n;
1034
+ t = t >>> 0, e || k(t, 2, this.length);
1035
+ var o = this[t] | this[t + 1] << 8;
1036
+ return o & 32768 ? o | 4294901760 : o;
1037
1037
  }, a.prototype.readInt16BE = function(t, e) {
1038
- t = t >>> 0, e || S(t, 2, this.length);
1039
- var n = this[t + 1] | this[t] << 8;
1040
- return n & 32768 ? n | 4294901760 : n;
1038
+ t = t >>> 0, e || k(t, 2, this.length);
1039
+ var o = this[t + 1] | this[t] << 8;
1040
+ return o & 32768 ? o | 4294901760 : o;
1041
1041
  }, a.prototype.readInt32LE = function(t, e) {
1042
- return t = t >>> 0, e || S(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24;
1042
+ return t = t >>> 0, e || k(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24;
1043
1043
  }, a.prototype.readInt32BE = function(t, e) {
1044
- return t = t >>> 0, e || S(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3];
1044
+ return t = t >>> 0, e || k(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3];
1045
1045
  }, a.prototype.readFloatLE = function(t, e) {
1046
- return t = t >>> 0, e || S(t, 4, this.length), p.read(this, t, !0, 23, 4);
1046
+ return t = t >>> 0, e || k(t, 4, this.length), p.read(this, t, !0, 23, 4);
1047
1047
  }, a.prototype.readFloatBE = function(t, e) {
1048
- return t = t >>> 0, e || S(t, 4, this.length), p.read(this, t, !1, 23, 4);
1048
+ return t = t >>> 0, e || k(t, 4, this.length), p.read(this, t, !1, 23, 4);
1049
1049
  }, a.prototype.readDoubleLE = function(t, e) {
1050
- return t = t >>> 0, e || S(t, 8, this.length), p.read(this, t, !0, 52, 8);
1050
+ return t = t >>> 0, e || k(t, 8, this.length), p.read(this, t, !0, 52, 8);
1051
1051
  }, a.prototype.readDoubleBE = function(t, e) {
1052
- return t = t >>> 0, e || S(t, 8, this.length), p.read(this, t, !1, 52, 8);
1052
+ return t = t >>> 0, e || k(t, 8, this.length), p.read(this, t, !1, 52, 8);
1053
1053
  };
1054
- function B(i, t, e, n, s, m) {
1054
+ function j(i, t, e, o, s, m) {
1055
1055
  if (!a.isBuffer(i))
1056
1056
  throw new TypeError('"buffer" argument must be a Buffer instance');
1057
1057
  if (t > s || t < m)
1058
1058
  throw new RangeError('"value" argument is out of bounds');
1059
- if (e + n > i.length)
1059
+ if (e + o > i.length)
1060
1060
  throw new RangeError("Index out of range");
1061
1061
  }
1062
- a.prototype.writeUintLE = a.prototype.writeUIntLE = function(t, e, n, s) {
1063
- if (t = +t, e = e >>> 0, n = n >>> 0, !s) {
1064
- var m = Math.pow(2, 8 * n) - 1;
1065
- B(this, t, e, n, m, 0);
1062
+ a.prototype.writeUintLE = a.prototype.writeUIntLE = function(t, e, o, s) {
1063
+ if (t = +t, e = e >>> 0, o = o >>> 0, !s) {
1064
+ var m = Math.pow(2, 8 * o) - 1;
1065
+ j(this, t, e, o, m, 0);
1066
1066
  }
1067
- var h = 1, E = 0;
1068
- for (this[e] = t & 255; ++E < n && (h *= 256); )
1069
- this[e + E] = t / h & 255;
1070
- return e + n;
1071
- }, a.prototype.writeUintBE = a.prototype.writeUIntBE = function(t, e, n, s) {
1072
- if (t = +t, e = e >>> 0, n = n >>> 0, !s) {
1073
- var m = Math.pow(2, 8 * n) - 1;
1074
- B(this, t, e, n, m, 0);
1067
+ var h = 1, _ = 0;
1068
+ for (this[e] = t & 255; ++_ < o && (h *= 256); )
1069
+ this[e + _] = t / h & 255;
1070
+ return e + o;
1071
+ }, a.prototype.writeUintBE = a.prototype.writeUIntBE = function(t, e, o, s) {
1072
+ if (t = +t, e = e >>> 0, o = o >>> 0, !s) {
1073
+ var m = Math.pow(2, 8 * o) - 1;
1074
+ j(this, t, e, o, m, 0);
1075
1075
  }
1076
- var h = n - 1, E = 1;
1077
- for (this[e + h] = t & 255; --h >= 0 && (E *= 256); )
1078
- this[e + h] = t / E & 255;
1079
- return e + n;
1080
- }, a.prototype.writeUint8 = a.prototype.writeUInt8 = function(t, e, n) {
1081
- return t = +t, e = e >>> 0, n || B(this, t, e, 1, 255, 0), this[e] = t & 255, e + 1;
1082
- }, a.prototype.writeUint16LE = a.prototype.writeUInt16LE = function(t, e, n) {
1083
- return t = +t, e = e >>> 0, n || B(this, t, e, 2, 65535, 0), this[e] = t & 255, this[e + 1] = t >>> 8, e + 2;
1084
- }, a.prototype.writeUint16BE = a.prototype.writeUInt16BE = function(t, e, n) {
1085
- return t = +t, e = e >>> 0, n || B(this, t, e, 2, 65535, 0), this[e] = t >>> 8, this[e + 1] = t & 255, e + 2;
1086
- }, a.prototype.writeUint32LE = a.prototype.writeUInt32LE = function(t, e, n) {
1087
- return t = +t, e = e >>> 0, n || B(this, t, e, 4, 4294967295, 0), this[e + 3] = t >>> 24, this[e + 2] = t >>> 16, this[e + 1] = t >>> 8, this[e] = t & 255, e + 4;
1088
- }, a.prototype.writeUint32BE = a.prototype.writeUInt32BE = function(t, e, n) {
1089
- return t = +t, e = e >>> 0, n || B(this, t, e, 4, 4294967295, 0), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = t & 255, e + 4;
1090
- }, a.prototype.writeIntLE = function(t, e, n, s) {
1076
+ var h = o - 1, _ = 1;
1077
+ for (this[e + h] = t & 255; --h >= 0 && (_ *= 256); )
1078
+ this[e + h] = t / _ & 255;
1079
+ return e + o;
1080
+ }, a.prototype.writeUint8 = a.prototype.writeUInt8 = function(t, e, o) {
1081
+ return t = +t, e = e >>> 0, o || j(this, t, e, 1, 255, 0), this[e] = t & 255, e + 1;
1082
+ }, a.prototype.writeUint16LE = a.prototype.writeUInt16LE = function(t, e, o) {
1083
+ return t = +t, e = e >>> 0, o || j(this, t, e, 2, 65535, 0), this[e] = t & 255, this[e + 1] = t >>> 8, e + 2;
1084
+ }, a.prototype.writeUint16BE = a.prototype.writeUInt16BE = function(t, e, o) {
1085
+ return t = +t, e = e >>> 0, o || j(this, t, e, 2, 65535, 0), this[e] = t >>> 8, this[e + 1] = t & 255, e + 2;
1086
+ }, a.prototype.writeUint32LE = a.prototype.writeUInt32LE = function(t, e, o) {
1087
+ return t = +t, e = e >>> 0, o || j(this, t, e, 4, 4294967295, 0), this[e + 3] = t >>> 24, this[e + 2] = t >>> 16, this[e + 1] = t >>> 8, this[e] = t & 255, e + 4;
1088
+ }, a.prototype.writeUint32BE = a.prototype.writeUInt32BE = function(t, e, o) {
1089
+ return t = +t, e = e >>> 0, o || j(this, t, e, 4, 4294967295, 0), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = t & 255, e + 4;
1090
+ }, a.prototype.writeIntLE = function(t, e, o, s) {
1091
1091
  if (t = +t, e = e >>> 0, !s) {
1092
- var m = Math.pow(2, 8 * n - 1);
1093
- B(this, t, e, n, m - 1, -m);
1092
+ var m = Math.pow(2, 8 * o - 1);
1093
+ j(this, t, e, o, m - 1, -m);
1094
1094
  }
1095
- var h = 0, E = 1, _ = 0;
1096
- for (this[e] = t & 255; ++h < n && (E *= 256); )
1097
- t < 0 && _ === 0 && this[e + h - 1] !== 0 && (_ = 1), this[e + h] = (t / E >> 0) - _ & 255;
1098
- return e + n;
1099
- }, a.prototype.writeIntBE = function(t, e, n, s) {
1095
+ var h = 0, _ = 1, F = 0;
1096
+ for (this[e] = t & 255; ++h < o && (_ *= 256); )
1097
+ t < 0 && F === 0 && this[e + h - 1] !== 0 && (F = 1), this[e + h] = (t / _ >> 0) - F & 255;
1098
+ return e + o;
1099
+ }, a.prototype.writeIntBE = function(t, e, o, s) {
1100
1100
  if (t = +t, e = e >>> 0, !s) {
1101
- var m = Math.pow(2, 8 * n - 1);
1102
- B(this, t, e, n, m - 1, -m);
1101
+ var m = Math.pow(2, 8 * o - 1);
1102
+ j(this, t, e, o, m - 1, -m);
1103
1103
  }
1104
- var h = n - 1, E = 1, _ = 0;
1105
- for (this[e + h] = t & 255; --h >= 0 && (E *= 256); )
1106
- t < 0 && _ === 0 && this[e + h + 1] !== 0 && (_ = 1), this[e + h] = (t / E >> 0) - _ & 255;
1107
- return e + n;
1108
- }, a.prototype.writeInt8 = function(t, e, n) {
1109
- return t = +t, e = e >>> 0, n || B(this, t, e, 1, 127, -128), t < 0 && (t = 255 + t + 1), this[e] = t & 255, e + 1;
1110
- }, a.prototype.writeInt16LE = function(t, e, n) {
1111
- return t = +t, e = e >>> 0, n || B(this, t, e, 2, 32767, -32768), this[e] = t & 255, this[e + 1] = t >>> 8, e + 2;
1112
- }, a.prototype.writeInt16BE = function(t, e, n) {
1113
- return t = +t, e = e >>> 0, n || B(this, t, e, 2, 32767, -32768), this[e] = t >>> 8, this[e + 1] = t & 255, e + 2;
1114
- }, a.prototype.writeInt32LE = function(t, e, n) {
1115
- return t = +t, e = e >>> 0, n || B(this, t, e, 4, 2147483647, -2147483648), this[e] = t & 255, this[e + 1] = t >>> 8, this[e + 2] = t >>> 16, this[e + 3] = t >>> 24, e + 4;
1116
- }, a.prototype.writeInt32BE = function(t, e, n) {
1117
- return t = +t, e = e >>> 0, n || B(this, t, e, 4, 2147483647, -2147483648), t < 0 && (t = 4294967295 + t + 1), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = t & 255, e + 4;
1104
+ var h = o - 1, _ = 1, F = 0;
1105
+ for (this[e + h] = t & 255; --h >= 0 && (_ *= 256); )
1106
+ t < 0 && F === 0 && this[e + h + 1] !== 0 && (F = 1), this[e + h] = (t / _ >> 0) - F & 255;
1107
+ return e + o;
1108
+ }, a.prototype.writeInt8 = function(t, e, o) {
1109
+ return t = +t, e = e >>> 0, o || j(this, t, e, 1, 127, -128), t < 0 && (t = 255 + t + 1), this[e] = t & 255, e + 1;
1110
+ }, a.prototype.writeInt16LE = function(t, e, o) {
1111
+ return t = +t, e = e >>> 0, o || j(this, t, e, 2, 32767, -32768), this[e] = t & 255, this[e + 1] = t >>> 8, e + 2;
1112
+ }, a.prototype.writeInt16BE = function(t, e, o) {
1113
+ return t = +t, e = e >>> 0, o || j(this, t, e, 2, 32767, -32768), this[e] = t >>> 8, this[e + 1] = t & 255, e + 2;
1114
+ }, a.prototype.writeInt32LE = function(t, e, o) {
1115
+ return t = +t, e = e >>> 0, o || j(this, t, e, 4, 2147483647, -2147483648), this[e] = t & 255, this[e + 1] = t >>> 8, this[e + 2] = t >>> 16, this[e + 3] = t >>> 24, e + 4;
1116
+ }, a.prototype.writeInt32BE = function(t, e, o) {
1117
+ return t = +t, e = e >>> 0, o || j(this, t, e, 4, 2147483647, -2147483648), t < 0 && (t = 4294967295 + t + 1), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = t & 255, e + 4;
1118
1118
  };
1119
- function _t(i, t, e, n, s, m) {
1120
- if (e + n > i.length)
1119
+ function At(i, t, e, o, s, m) {
1120
+ if (e + o > i.length)
1121
1121
  throw new RangeError("Index out of range");
1122
1122
  if (e < 0)
1123
1123
  throw new RangeError("Index out of range");
1124
1124
  }
1125
- function Ft(i, t, e, n, s) {
1126
- return t = +t, e = e >>> 0, s || _t(i, t, e, 4), p.write(i, t, e, n, 23, 4), e + 4;
1125
+ function St(i, t, e, o, s) {
1126
+ return t = +t, e = e >>> 0, s || At(i, t, e, 4), p.write(i, t, e, o, 23, 4), e + 4;
1127
1127
  }
1128
- a.prototype.writeFloatLE = function(t, e, n) {
1129
- return Ft(this, t, e, !0, n);
1130
- }, a.prototype.writeFloatBE = function(t, e, n) {
1131
- return Ft(this, t, e, !1, n);
1128
+ a.prototype.writeFloatLE = function(t, e, o) {
1129
+ return St(this, t, e, !0, o);
1130
+ }, a.prototype.writeFloatBE = function(t, e, o) {
1131
+ return St(this, t, e, !1, o);
1132
1132
  };
1133
- function At(i, t, e, n, s) {
1134
- return t = +t, e = e >>> 0, s || _t(i, t, e, 8), p.write(i, t, e, n, 52, 8), e + 8;
1135
- }
1136
- a.prototype.writeDoubleLE = function(t, e, n) {
1137
- return At(this, t, e, !0, n);
1138
- }, a.prototype.writeDoubleBE = function(t, e, n) {
1139
- return At(this, t, e, !1, n);
1140
- }, a.prototype.copy = function(t, e, n, s) {
1133
+ function kt(i, t, e, o, s) {
1134
+ return t = +t, e = e >>> 0, s || At(i, t, e, 8), p.write(i, t, e, o, 52, 8), e + 8;
1135
+ }
1136
+ a.prototype.writeDoubleLE = function(t, e, o) {
1137
+ return kt(this, t, e, !0, o);
1138
+ }, a.prototype.writeDoubleBE = function(t, e, o) {
1139
+ return kt(this, t, e, !1, o);
1140
+ }, a.prototype.copy = function(t, e, o, s) {
1141
1141
  if (!a.isBuffer(t))
1142
1142
  throw new TypeError("argument should be a Buffer");
1143
- if (n || (n = 0), !s && s !== 0 && (s = this.length), e >= t.length && (e = t.length), e || (e = 0), s > 0 && s < n && (s = n), s === n || t.length === 0 || this.length === 0)
1143
+ if (o || (o = 0), !s && s !== 0 && (s = this.length), e >= t.length && (e = t.length), e || (e = 0), s > 0 && s < o && (s = o), s === o || t.length === 0 || this.length === 0)
1144
1144
  return 0;
1145
1145
  if (e < 0)
1146
1146
  throw new RangeError("targetStart out of bounds");
1147
- if (n < 0 || n >= this.length)
1147
+ if (o < 0 || o >= this.length)
1148
1148
  throw new RangeError("Index out of range");
1149
1149
  if (s < 0)
1150
1150
  throw new RangeError("sourceEnd out of bounds");
1151
- s > this.length && (s = this.length), t.length - e < s - n && (s = t.length - e + n);
1152
- var m = s - n;
1153
- return this === t && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(e, n, s) : Uint8Array.prototype.set.call(
1151
+ s > this.length && (s = this.length), t.length - e < s - o && (s = t.length - e + o);
1152
+ var m = s - o;
1153
+ return this === t && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(e, o, s) : Uint8Array.prototype.set.call(
1154
1154
  t,
1155
- this.subarray(n, s),
1155
+ this.subarray(o, s),
1156
1156
  e
1157
1157
  ), m;
1158
- }, a.prototype.fill = function(t, e, n, s) {
1158
+ }, a.prototype.fill = function(t, e, o, s) {
1159
1159
  if (typeof t == "string") {
1160
- if (typeof e == "string" ? (s = e, e = 0, n = this.length) : typeof n == "string" && (s = n, n = this.length), s !== void 0 && typeof s != "string")
1160
+ if (typeof e == "string" ? (s = e, e = 0, o = this.length) : typeof o == "string" && (s = o, o = this.length), s !== void 0 && typeof s != "string")
1161
1161
  throw new TypeError("encoding must be a string");
1162
1162
  if (typeof s == "string" && !a.isEncoding(s))
1163
1163
  throw new TypeError("Unknown encoding: " + s);
@@ -1167,41 +1167,41 @@ ht.write = function(o, r, p, c, u, f) {
1167
1167
  }
1168
1168
  } else
1169
1169
  typeof t == "number" ? t = t & 255 : typeof t == "boolean" && (t = Number(t));
1170
- if (e < 0 || this.length < e || this.length < n)
1170
+ if (e < 0 || this.length < e || this.length < o)
1171
1171
  throw new RangeError("Out of range index");
1172
- if (n <= e)
1172
+ if (o <= e)
1173
1173
  return this;
1174
- e = e >>> 0, n = n === void 0 ? this.length : n >>> 0, t || (t = 0);
1174
+ e = e >>> 0, o = o === void 0 ? this.length : o >>> 0, t || (t = 0);
1175
1175
  var h;
1176
1176
  if (typeof t == "number")
1177
- for (h = e; h < n; ++h)
1177
+ for (h = e; h < o; ++h)
1178
1178
  this[h] = t;
1179
1179
  else {
1180
- var E = a.isBuffer(t) ? t : a.from(t, s), _ = E.length;
1181
- if (_ === 0)
1180
+ var _ = a.isBuffer(t) ? t : a.from(t, s), F = _.length;
1181
+ if (F === 0)
1182
1182
  throw new TypeError('The value "' + t + '" is invalid for argument "value"');
1183
- for (h = 0; h < n - e; ++h)
1184
- this[h + e] = E[h % _];
1183
+ for (h = 0; h < o - e; ++h)
1184
+ this[h + e] = _[h % F];
1185
1185
  }
1186
1186
  return this;
1187
1187
  };
1188
- var _e = /[^+/0-9A-Za-z-_]/g;
1189
- function Fe(i) {
1190
- if (i = i.split("=")[0], i = i.trim().replace(_e, ""), i.length < 2)
1188
+ var Fe = /[^+/0-9A-Za-z-_]/g;
1189
+ function Ae(i) {
1190
+ if (i = i.split("=")[0], i = i.trim().replace(Fe, ""), i.length < 2)
1191
1191
  return "";
1192
1192
  for (; i.length % 4 !== 0; )
1193
1193
  i = i + "=";
1194
1194
  return i;
1195
1195
  }
1196
- function it(i, t) {
1196
+ function rt(i, t) {
1197
1197
  t = t || 1 / 0;
1198
- for (var e, n = i.length, s = null, m = [], h = 0; h < n; ++h) {
1198
+ for (var e, o = i.length, s = null, m = [], h = 0; h < o; ++h) {
1199
1199
  if (e = i.charCodeAt(h), e > 55295 && e < 57344) {
1200
1200
  if (!s) {
1201
1201
  if (e > 56319) {
1202
1202
  (t -= 3) > -1 && m.push(239, 191, 189);
1203
1203
  continue;
1204
- } else if (h + 1 === n) {
1204
+ } else if (h + 1 === o) {
1205
1205
  (t -= 3) > -1 && m.push(239, 191, 189);
1206
1206
  continue;
1207
1207
  }
@@ -1248,45 +1248,45 @@ ht.write = function(o, r, p, c, u, f) {
1248
1248
  }
1249
1249
  return m;
1250
1250
  }
1251
- function Ae(i) {
1251
+ function Se(i) {
1252
1252
  for (var t = [], e = 0; e < i.length; ++e)
1253
1253
  t.push(i.charCodeAt(e) & 255);
1254
1254
  return t;
1255
1255
  }
1256
- function Se(i, t) {
1257
- for (var e, n, s, m = [], h = 0; h < i.length && !((t -= 2) < 0); ++h)
1258
- e = i.charCodeAt(h), n = e >> 8, s = e % 256, m.push(s), m.push(n);
1256
+ function ke(i, t) {
1257
+ for (var e, o, s, m = [], h = 0; h < i.length && !((t -= 2) < 0); ++h)
1258
+ e = i.charCodeAt(h), o = e >> 8, s = e % 256, m.push(s), m.push(o);
1259
1259
  return m;
1260
1260
  }
1261
- function St(i) {
1262
- return r.toByteArray(Fe(i));
1261
+ function Bt(i) {
1262
+ return r.toByteArray(Ae(i));
1263
1263
  }
1264
- function G(i, t, e, n) {
1265
- for (var s = 0; s < n && !(s + e >= t.length || s >= i.length); ++s)
1264
+ function K(i, t, e, o) {
1265
+ for (var s = 0; s < o && !(s + e >= t.length || s >= i.length); ++s)
1266
1266
  t[s + e] = i[s];
1267
1267
  return s;
1268
1268
  }
1269
1269
  function T(i, t) {
1270
1270
  return i instanceof t || i != null && i.constructor != null && i.constructor.name != null && i.constructor.name === t.name;
1271
1271
  }
1272
- function rt(i) {
1272
+ function nt(i) {
1273
1273
  return i !== i;
1274
1274
  }
1275
- var ke = function() {
1275
+ var Be = function() {
1276
1276
  for (var i = "0123456789abcdef", t = new Array(256), e = 0; e < 16; ++e)
1277
- for (var n = e * 16, s = 0; s < 16; ++s)
1278
- t[n + s] = i[e] + i[s];
1277
+ for (var o = e * 16, s = 0; s < 16; ++s)
1278
+ t[o + s] = i[e] + i[s];
1279
1279
  return t;
1280
1280
  }();
1281
- })(Gt);
1281
+ })(Vt);
1282
1282
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
1283
- (function(o, r) {
1284
- var p = Gt, c = p.Buffer;
1283
+ (function(n, r) {
1284
+ var p = Vt, c = p.Buffer;
1285
1285
  function u(l, a) {
1286
1286
  for (var x in l)
1287
1287
  a[x] = l[x];
1288
1288
  }
1289
- c.from && c.alloc && c.allocUnsafe && c.allocUnsafeSlow ? o.exports = p : (u(p, r), r.Buffer = f);
1289
+ c.from && c.alloc && c.allocUnsafe && c.allocUnsafeSlow ? n.exports = p : (u(p, r), r.Buffer = f);
1290
1290
  function f(l, a, x) {
1291
1291
  return c(l, a, x);
1292
1292
  }
@@ -1308,21 +1308,21 @@ ht.write = function(o, r, p, c, u, f) {
1308
1308
  throw new TypeError("Argument must be a number");
1309
1309
  return p.SlowBuffer(l);
1310
1310
  };
1311
- })(pt, pt.exports);
1312
- var Vt = pt.exports, Xt = Vt.Buffer;
1313
- function tt(o, r) {
1314
- this._block = Xt.alloc(o), this._finalSize = r, this._blockSize = o, this._len = 0;
1315
- }
1316
- tt.prototype.update = function(o, r) {
1317
- typeof o == "string" && (r = r || "utf8", o = Xt.from(o, r));
1318
- for (var p = this._block, c = this._blockSize, u = o.length, f = this._len, l = 0; l < u; ) {
1311
+ })(ct, ct.exports);
1312
+ var Qt = ct.exports, te = Qt.Buffer;
1313
+ function et(n, r) {
1314
+ this._block = te.alloc(n), this._finalSize = r, this._blockSize = n, this._len = 0;
1315
+ }
1316
+ et.prototype.update = function(n, r) {
1317
+ typeof n == "string" && (r = r || "utf8", n = te.from(n, r));
1318
+ for (var p = this._block, c = this._blockSize, u = n.length, f = this._len, l = 0; l < u; ) {
1319
1319
  for (var a = f % c, x = Math.min(u - l, c - a), d = 0; d < x; d++)
1320
- p[a + d] = o[l + d];
1320
+ p[a + d] = n[l + d];
1321
1321
  f += x, l += x, f % c === 0 && this._update(p);
1322
1322
  }
1323
1323
  return this._len += u, this;
1324
1324
  };
1325
- tt.prototype.digest = function(o) {
1325
+ et.prototype.digest = function(n) {
1326
1326
  var r = this._len % this._blockSize;
1327
1327
  this._block[r] = 128, this._block.fill(0, r + 1), r >= this._finalSize && (this._update(this._block), this._block.fill(0));
1328
1328
  var p = this._len * 8;
@@ -1334,90 +1334,90 @@ tt.prototype.digest = function(o) {
1334
1334
  }
1335
1335
  this._update(this._block);
1336
1336
  var f = this._hash();
1337
- return o ? f.toString(o) : f;
1337
+ return n ? f.toString(n) : f;
1338
1338
  };
1339
- tt.prototype._update = function() {
1339
+ et.prototype._update = function() {
1340
1340
  throw new Error("_update must be implemented by subclass");
1341
1341
  };
1342
- var pi = tt, si = Xe, Qt = pi, ci = Vt.Buffer, li = [
1342
+ var pi = et, si = Xe, ee = pi, ci = Qt.Buffer, li = [
1343
1343
  1518500249,
1344
1344
  1859775393,
1345
1345
  -1894007588,
1346
1346
  -899497514
1347
1347
  ], ui = new Array(80);
1348
1348
  function Y() {
1349
- this.init(), this._w = ui, Qt.call(this, 64, 56);
1349
+ this.init(), this._w = ui, ee.call(this, 64, 56);
1350
1350
  }
1351
- si(Y, Qt);
1351
+ si(Y, ee);
1352
1352
  Y.prototype.init = function() {
1353
1353
  return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;
1354
1354
  };
1355
- function fi(o) {
1356
- return o << 1 | o >>> 31;
1355
+ function fi(n) {
1356
+ return n << 1 | n >>> 31;
1357
1357
  }
1358
- function mi(o) {
1359
- return o << 5 | o >>> 27;
1358
+ function mi(n) {
1359
+ return n << 5 | n >>> 27;
1360
1360
  }
1361
- function hi(o) {
1362
- return o << 30 | o >>> 2;
1361
+ function hi(n) {
1362
+ return n << 30 | n >>> 2;
1363
1363
  }
1364
- function xi(o, r, p, c) {
1365
- return o === 0 ? r & p | ~r & c : o === 2 ? r & p | r & c | p & c : r ^ p ^ c;
1364
+ function xi(n, r, p, c) {
1365
+ return n === 0 ? r & p | ~r & c : n === 2 ? r & p | r & c | p & c : r ^ p ^ c;
1366
1366
  }
1367
- Y.prototype._update = function(o) {
1367
+ Y.prototype._update = function(n) {
1368
1368
  for (var r = this._w, p = this._a | 0, c = this._b | 0, u = this._c | 0, f = this._d | 0, l = this._e | 0, a = 0; a < 16; ++a)
1369
- r[a] = o.readInt32BE(a * 4);
1369
+ r[a] = n.readInt32BE(a * 4);
1370
1370
  for (; a < 80; ++a)
1371
1371
  r[a] = fi(r[a - 3] ^ r[a - 8] ^ r[a - 14] ^ r[a - 16]);
1372
1372
  for (var x = 0; x < 80; ++x) {
1373
- var d = ~~(x / 20), b = mi(p) + xi(d, c, u, f) + l + r[x] + li[d] | 0;
1374
- l = f, f = u, u = hi(c), c = p, p = b;
1373
+ var d = ~~(x / 20), v = mi(p) + xi(d, c, u, f) + l + r[x] + li[d] | 0;
1374
+ l = f, f = u, u = hi(c), c = p, p = v;
1375
1375
  }
1376
1376
  this._a = p + this._a | 0, this._b = c + this._b | 0, this._c = u + this._c | 0, this._d = f + this._d | 0, this._e = l + this._e | 0;
1377
1377
  };
1378
1378
  Y.prototype._hash = function() {
1379
- var o = ci.allocUnsafe(20);
1380
- return o.writeInt32BE(this._a | 0, 0), o.writeInt32BE(this._b | 0, 4), o.writeInt32BE(this._c | 0, 8), o.writeInt32BE(this._d | 0, 12), o.writeInt32BE(this._e | 0, 16), o;
1379
+ var n = ci.allocUnsafe(20);
1380
+ return n.writeInt32BE(this._a | 0, 0), n.writeInt32BE(this._b | 0, 4), n.writeInt32BE(this._c | 0, 8), n.writeInt32BE(this._d | 0, 12), n.writeInt32BE(this._e | 0, 16), n;
1381
1381
  };
1382
1382
  var di = Y;
1383
- const wi = /* @__PURE__ */ Ve(di), xt = new Error("File system not available.");
1384
- function gi(o, r, p) {
1385
- throw xt;
1383
+ const wi = /* @__PURE__ */ Ve(di), wt = new Error("File system not available.");
1384
+ function gi(n, r, p) {
1385
+ throw wt;
1386
1386
  }
1387
- function te(o) {
1388
- throw xt;
1387
+ function ie(n) {
1388
+ throw wt;
1389
1389
  }
1390
- function yi(o) {
1391
- throw xt;
1390
+ function yi(n) {
1391
+ throw wt;
1392
1392
  }
1393
- const vi = async (o) => te();
1394
- function bi(o) {
1393
+ const vi = async (n) => ie();
1394
+ function bi(n) {
1395
1395
  let r = "";
1396
- for (let p = 0; p < o.length; p += 2)
1397
- r += String.fromCharCode(parseInt(o.substr(p, 2), 16));
1396
+ for (let p = 0; p < n.length; p += 2)
1397
+ r += String.fromCharCode(parseInt(n.substr(p, 2), 16));
1398
1398
  return btoa(r);
1399
1399
  }
1400
- const et = (o, r = "sha1") => {
1400
+ const it = (n, r = "sha1") => {
1401
1401
  if (r !== "sha1")
1402
1402
  throw new Error("Only sha1 algorithm is available.");
1403
1403
  const p = new wi();
1404
- return bi(p.update(o).digest("hex"));
1404
+ return bi(p.update(n).digest("hex"));
1405
1405
  };
1406
- function Ei(o) {
1407
- return o.type === We && o.skip !== void 0 && o.skip > 0 && o.hash !== void 0;
1406
+ function Ei(n) {
1407
+ return n.type === We && n.skip !== void 0 && n.skip > 0 && n.hash !== void 0;
1408
1408
  }
1409
- function jt(o) {
1410
- return [z, P].includes(o.type);
1409
+ function Ot(n) {
1410
+ return [z, P].includes(n.type);
1411
1411
  }
1412
- function It(o) {
1413
- return [Ht, z, P, Z, Zt].includes(o.type);
1412
+ function Ut(n) {
1413
+ return [Yt, z, P, Z, Gt].includes(n.type);
1414
1414
  }
1415
- function q(o, r, p, c, u = "global") {
1416
- if (!o)
1415
+ function q(n, r, p, c, u = "global") {
1416
+ if (!n)
1417
1417
  throw new Error("Empty action type");
1418
- if (typeof o != "string")
1419
- throw new Error(`Invalid action type: ${o}`);
1420
- const f = { type: o, input: r, scope: u };
1418
+ if (typeof n != "string")
1419
+ throw new Error(`Invalid action type: ${n}`);
1420
+ const f = { type: n, input: r, scope: u };
1421
1421
  p && (f.attachments = p);
1422
1422
  try {
1423
1423
  c == null || c().parse(f.input);
@@ -1426,10 +1426,10 @@ function q(o, r, p, c, u = "global") {
1426
1426
  }
1427
1427
  return f;
1428
1428
  }
1429
- function _i(o, r = Yt) {
1430
- return (p, c, u, f) => r(p, c, o, u, f);
1429
+ function _i(n, r = Kt) {
1430
+ return (p, c, u, f) => r(p, c, n, u, f);
1431
1431
  }
1432
- const Fi = (o, r) => ({
1432
+ const Fi = (n, r) => ({
1433
1433
  name: "",
1434
1434
  documentType: "",
1435
1435
  revision: {
@@ -1439,11 +1439,11 @@ const Fi = (o, r) => ({
1439
1439
  created: (/* @__PURE__ */ new Date()).toISOString(),
1440
1440
  lastModified: (/* @__PURE__ */ new Date()).toISOString(),
1441
1441
  attachments: {},
1442
- ...o,
1443
- state: (r == null ? void 0 : r(o == null ? void 0 : o.state)) ?? (o == null ? void 0 : o.state) ?? { global: {}, local: {} }
1444
- }), Ai = (o, r) => {
1442
+ ...n,
1443
+ state: (r == null ? void 0 : r(n == null ? void 0 : n.state)) ?? (n == null ? void 0 : n.state) ?? { global: {}, local: {} }
1444
+ }), Ai = (n, r) => {
1445
1445
  const p = Fi(
1446
- o,
1446
+ n,
1447
1447
  r
1448
1448
  );
1449
1449
  return {
@@ -1452,15 +1452,15 @@ const Fi = (o, r) => ({
1452
1452
  operations: { global: [], local: [] },
1453
1453
  clipboard: []
1454
1454
  };
1455
- }, ee = (o, r = "global") => et(Ue(o.state[r])), zi = (o, r = 1e3) => {
1455
+ }, re = (n, r = "global") => it(pt(n.state[r])), zi = (n, r = 1e3) => {
1456
1456
  const p = Math.random() * r;
1457
- return et(`${(o ?? /* @__PURE__ */ new Date()).toISOString()}${p}`);
1457
+ return it(`${(n ?? /* @__PURE__ */ new Date()).toISOString()}${p}`);
1458
1458
  };
1459
- function X(o) {
1460
- return Ie(Oe(o, !0));
1459
+ function Q(n) {
1460
+ return Oe(Ue(n, !0));
1461
1461
  }
1462
- function Si(o, r) {
1463
- const p = [...o];
1462
+ function Si(n, r) {
1463
+ const p = [...n];
1464
1464
  let c = r || 0, u = p.length > 0 ? p[p.length - 1].index : 0;
1465
1465
  const f = [];
1466
1466
  for (const l of p.reverse()) {
@@ -1482,20 +1482,20 @@ function Si(o, r) {
1482
1482
  }
1483
1483
  return f.reverse();
1484
1484
  }
1485
- function Pi(o) {
1486
- return Object.values(o).flatMap((r) => r).sort(
1485
+ function Pi(n) {
1486
+ return Object.values(n).flatMap((r) => r).sort(
1487
1487
  (r, p) => new Date(r.timestamp).getTime() - new Date(p.timestamp).getTime()
1488
1488
  );
1489
1489
  }
1490
- function ki(o) {
1491
- return Object.values(o).flatMap((r) => r).sort(
1490
+ function ki(n) {
1491
+ return Object.values(n).flatMap((r) => r).sort(
1492
1492
  (r, p) => new Date(r.operation.timestamp).getTime() - new Date(p.operation.timestamp).getTime()
1493
1493
  );
1494
1494
  }
1495
- function st(o, r, p, c, u, f = Yt, l = {}) {
1495
+ function lt(n, r, p, c, u, f = Kt, l = {}) {
1496
1496
  const a = _i(p, f);
1497
- return ie(
1498
- o,
1497
+ return ne(
1498
+ n,
1499
1499
  r,
1500
1500
  a,
1501
1501
  c,
@@ -1503,47 +1503,47 @@ function st(o, r, p, c, u, f = Yt, l = {}) {
1503
1503
  l
1504
1504
  );
1505
1505
  }
1506
- function ie(o, r, p, c, u, f = {}) {
1507
- const l = Ai(o), a = Object.keys(r).reduce((w, v) => {
1508
- const y = v;
1506
+ function ne(n, r, p, c, u, f = {}) {
1507
+ const l = Ai(n), a = Object.keys(r).reduce((y, b) => {
1508
+ const E = b;
1509
1509
  return {
1510
- ...w,
1511
- [y]: r[y].slice(0, u == null ? void 0 : u.revision[y])
1510
+ ...y,
1511
+ [E]: r[E].slice(0, u == null ? void 0 : u.revision[E])
1512
1512
  };
1513
1513
  }, {}), x = Object.keys(a).reduce(
1514
- (w, v) => {
1515
- const y = v;
1514
+ (y, b) => {
1515
+ const E = b;
1516
1516
  return {
1517
- ...w,
1518
- [y]: Si(
1519
- a[y],
1520
- f[y]
1517
+ ...y,
1518
+ [E]: Si(
1519
+ a[E],
1520
+ f[E]
1521
1521
  )
1522
1522
  };
1523
1523
  },
1524
1524
  {}
1525
1525
  ), d = ki(x).reduce(
1526
- (w, { ignore: v, operation: y }) => v ? p(w, wt(y.scope), c, {
1527
- skip: y.skip,
1526
+ (y, { ignore: b, operation: E }) => b ? p(y, yt(E.scope), c, {
1527
+ skip: E.skip,
1528
1528
  ignoreSkipOperations: !0
1529
- }) : p(w, y, c, {
1530
- skip: y.skip,
1529
+ }) : p(y, E, c, {
1530
+ skip: E.skip,
1531
1531
  ignoreSkipOperations: !0
1532
1532
  }),
1533
1533
  l
1534
- ), b = Object.keys(
1534
+ ), v = Object.keys(
1535
1535
  d.operations
1536
1536
  ).reduce(
1537
- (w, v) => {
1538
- const y = v, U = u && u.revision[y] < r[y].length ? r[y].slice(u.revision[y]) : [];
1537
+ (y, b) => {
1538
+ const E = b, U = u && u.revision[E] < r[E].length ? r[E].slice(u.revision[E]) : [];
1539
1539
  return {
1540
- ...w,
1541
- [y]: [
1542
- ...d.operations[y].map((j, $) => {
1543
- var R;
1540
+ ...y,
1541
+ [E]: [
1542
+ ...d.operations[E].map((R, $) => {
1543
+ var G;
1544
1544
  return {
1545
- ...j,
1546
- timestamp: ((R = r[y][$]) == null ? void 0 : R.timestamp) ?? j.timestamp
1545
+ ...R,
1546
+ timestamp: ((G = r[E][$]) == null ? void 0 : G.timestamp) ?? R.timestamp
1547
1547
  };
1548
1548
  }),
1549
1549
  ...U
@@ -1551,54 +1551,61 @@ function ie(o, r, p, c, u, f = {}) {
1551
1551
  };
1552
1552
  },
1553
1553
  { global: [], local: [] }
1554
- );
1555
- return { ...d, operations: b };
1554
+ ), g = Object.values(v).reduce((y, b) => {
1555
+ for (const E of b)
1556
+ E.timestamp > y && (y = E.timestamp);
1557
+ return y;
1558
+ }, "0");
1559
+ return { ...d, operations: v, lastModified: g };
1560
+ }
1561
+ function qi(n, r) {
1562
+ return pt(n) === pt(r);
1556
1563
  }
1557
- const re = (o) => q(
1564
+ const oe = (n) => q(
1558
1565
  "SET_NAME",
1559
- o,
1566
+ n,
1560
1567
  void 0,
1561
- ft,
1568
+ ht,
1562
1569
  void 0
1563
- ), ne = (o = 1, r = "global") => q(
1570
+ ), ae = (n = 1, r = "global") => q(
1564
1571
  "UNDO",
1565
- o,
1572
+ n,
1566
1573
  void 0,
1567
- mt,
1574
+ xt,
1568
1575
  r
1569
- ), oe = (o = 1, r = "global") => q(
1576
+ ), pe = (n = 1, r = "global") => q(
1570
1577
  "REDO",
1571
- o,
1578
+ n,
1572
1579
  void 0,
1573
- ut,
1580
+ mt,
1574
1581
  r
1575
- ), ae = (o, r, p = "global") => q(
1582
+ ), se = (n, r, p = "global") => q(
1576
1583
  "PRUNE",
1577
- { start: o, end: r },
1584
+ { start: n, end: r },
1578
1585
  void 0,
1579
- lt,
1586
+ ft,
1580
1587
  p
1581
- ), dt = (o, r) => q(
1588
+ ), gt = (n, r) => q(
1582
1589
  "LOAD_STATE",
1583
- { state: o, operations: r },
1590
+ { state: n, operations: r },
1584
1591
  void 0,
1585
- ct
1586
- ), wt = (o = "global") => q("NOOP", {}, void 0, void 0, o), qi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1592
+ ut
1593
+ ), yt = (n = "global") => q("NOOP", {}, void 0, void 0, n), $i = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1587
1594
  __proto__: null,
1588
- loadState: dt,
1589
- noop: wt,
1590
- prune: ae,
1591
- redo: oe,
1592
- setName: re,
1593
- undo: ne
1594
- }, Symbol.toStringTag, { value: "Module" })), pe = { "application/andrew-inset": ["ez"], "application/appinstaller": ["appinstaller"], "application/applixware": ["aw"], "application/appx": ["appx"], "application/appxbundle": ["appxbundle"], "application/atom+xml": ["atom"], "application/atomcat+xml": ["atomcat"], "application/atomdeleted+xml": ["atomdeleted"], "application/atomsvc+xml": ["atomsvc"], "application/atsc-dwd+xml": ["dwd"], "application/atsc-held+xml": ["held"], "application/atsc-rsat+xml": ["rsat"], "application/automationml-aml+xml": ["aml"], "application/automationml-amlx+zip": ["amlx"], "application/bdoc": ["bdoc"], "application/calendar+xml": ["xcs"], "application/ccxml+xml": ["ccxml"], "application/cdfx+xml": ["cdfx"], "application/cdmi-capability": ["cdmia"], "application/cdmi-container": ["cdmic"], "application/cdmi-domain": ["cdmid"], "application/cdmi-object": ["cdmio"], "application/cdmi-queue": ["cdmiq"], "application/cpl+xml": ["cpl"], "application/cu-seeme": ["cu"], "application/cwl": ["cwl"], "application/dash+xml": ["mpd"], "application/dash-patch+xml": ["mpp"], "application/davmount+xml": ["davmount"], "application/docbook+xml": ["dbk"], "application/dssc+der": ["dssc"], "application/dssc+xml": ["xdssc"], "application/ecmascript": ["ecma"], "application/emma+xml": ["emma"], "application/emotionml+xml": ["emotionml"], "application/epub+zip": ["epub"], "application/exi": ["exi"], "application/express": ["exp"], "application/fdf": ["fdf"], "application/fdt+xml": ["fdt"], "application/font-tdpfr": ["pfr"], "application/geo+json": ["geojson"], "application/gml+xml": ["gml"], "application/gpx+xml": ["gpx"], "application/gxf": ["gxf"], "application/gzip": ["gz"], "application/hjson": ["hjson"], "application/hyperstudio": ["stk"], "application/inkml+xml": ["ink", "inkml"], "application/ipfix": ["ipfix"], "application/its+xml": ["its"], "application/java-archive": ["jar", "war", "ear"], "application/java-serialized-object": ["ser"], "application/java-vm": ["class"], "application/javascript": ["*js"], "application/json": ["json", "map"], "application/json5": ["json5"], "application/jsonml+json": ["jsonml"], "application/ld+json": ["jsonld"], "application/lgr+xml": ["lgr"], "application/lost+xml": ["lostxml"], "application/mac-binhex40": ["hqx"], "application/mac-compactpro": ["cpt"], "application/mads+xml": ["mads"], "application/manifest+json": ["webmanifest"], "application/marc": ["mrc"], "application/marcxml+xml": ["mrcx"], "application/mathematica": ["ma", "nb", "mb"], "application/mathml+xml": ["mathml"], "application/mbox": ["mbox"], "application/media-policy-dataset+xml": ["mpf"], "application/mediaservercontrol+xml": ["mscml"], "application/metalink+xml": ["metalink"], "application/metalink4+xml": ["meta4"], "application/mets+xml": ["mets"], "application/mmt-aei+xml": ["maei"], "application/mmt-usd+xml": ["musd"], "application/mods+xml": ["mods"], "application/mp21": ["m21", "mp21"], "application/mp4": ["*mp4", "*mpg4", "mp4s", "m4p"], "application/msix": ["msix"], "application/msixbundle": ["msixbundle"], "application/msword": ["doc", "dot"], "application/mxf": ["mxf"], "application/n-quads": ["nq"], "application/n-triples": ["nt"], "application/node": ["cjs"], "application/octet-stream": ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"], "application/oda": ["oda"], "application/oebps-package+xml": ["opf"], "application/ogg": ["ogx"], "application/omdoc+xml": ["omdoc"], "application/onenote": ["onetoc", "onetoc2", "onetmp", "onepkg"], "application/oxps": ["oxps"], "application/p2p-overlay+xml": ["relo"], "application/patch-ops-error+xml": ["xer"], "application/pdf": ["pdf"], "application/pgp-encrypted": ["pgp"], "application/pgp-keys": ["asc"], "application/pgp-signature": ["sig", "*asc"], "application/pics-rules": ["prf"], "application/pkcs10": ["p10"], "application/pkcs7-mime": ["p7m", "p7c"], "application/pkcs7-signature": ["p7s"], "application/pkcs8": ["p8"], "application/pkix-attr-cert": ["ac"], "application/pkix-cert": ["cer"], "application/pkix-crl": ["crl"], "application/pkix-pkipath": ["pkipath"], "application/pkixcmp": ["pki"], "application/pls+xml": ["pls"], "application/postscript": ["ai", "eps", "ps"], "application/provenance+xml": ["provx"], "application/pskc+xml": ["pskcxml"], "application/raml+yaml": ["raml"], "application/rdf+xml": ["rdf", "owl"], "application/reginfo+xml": ["rif"], "application/relax-ng-compact-syntax": ["rnc"], "application/resource-lists+xml": ["rl"], "application/resource-lists-diff+xml": ["rld"], "application/rls-services+xml": ["rs"], "application/route-apd+xml": ["rapd"], "application/route-s-tsid+xml": ["sls"], "application/route-usd+xml": ["rusd"], "application/rpki-ghostbusters": ["gbr"], "application/rpki-manifest": ["mft"], "application/rpki-roa": ["roa"], "application/rsd+xml": ["rsd"], "application/rss+xml": ["rss"], "application/rtf": ["rtf"], "application/sbml+xml": ["sbml"], "application/scvp-cv-request": ["scq"], "application/scvp-cv-response": ["scs"], "application/scvp-vp-request": ["spq"], "application/scvp-vp-response": ["spp"], "application/sdp": ["sdp"], "application/senml+xml": ["senmlx"], "application/sensml+xml": ["sensmlx"], "application/set-payment-initiation": ["setpay"], "application/set-registration-initiation": ["setreg"], "application/shf+xml": ["shf"], "application/sieve": ["siv", "sieve"], "application/smil+xml": ["smi", "smil"], "application/sparql-query": ["rq"], "application/sparql-results+xml": ["srx"], "application/sql": ["sql"], "application/srgs": ["gram"], "application/srgs+xml": ["grxml"], "application/sru+xml": ["sru"], "application/ssdl+xml": ["ssdl"], "application/ssml+xml": ["ssml"], "application/swid+xml": ["swidtag"], "application/tei+xml": ["tei", "teicorpus"], "application/thraud+xml": ["tfi"], "application/timestamped-data": ["tsd"], "application/toml": ["toml"], "application/trig": ["trig"], "application/ttml+xml": ["ttml"], "application/ubjson": ["ubj"], "application/urc-ressheet+xml": ["rsheet"], "application/urc-targetdesc+xml": ["td"], "application/voicexml+xml": ["vxml"], "application/wasm": ["wasm"], "application/watcherinfo+xml": ["wif"], "application/widget": ["wgt"], "application/winhlp": ["hlp"], "application/wsdl+xml": ["wsdl"], "application/wspolicy+xml": ["wspolicy"], "application/xaml+xml": ["xaml"], "application/xcap-att+xml": ["xav"], "application/xcap-caps+xml": ["xca"], "application/xcap-diff+xml": ["xdf"], "application/xcap-el+xml": ["xel"], "application/xcap-ns+xml": ["xns"], "application/xenc+xml": ["xenc"], "application/xfdf": ["xfdf"], "application/xhtml+xml": ["xhtml", "xht"], "application/xliff+xml": ["xlf"], "application/xml": ["xml", "xsl", "xsd", "rng"], "application/xml-dtd": ["dtd"], "application/xop+xml": ["xop"], "application/xproc+xml": ["xpl"], "application/xslt+xml": ["*xsl", "xslt"], "application/xspf+xml": ["xspf"], "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"], "application/yang": ["yang"], "application/yin+xml": ["yin"], "application/zip": ["zip"], "audio/3gpp": ["*3gpp"], "audio/aac": ["adts", "aac"], "audio/adpcm": ["adp"], "audio/amr": ["amr"], "audio/basic": ["au", "snd"], "audio/midi": ["mid", "midi", "kar", "rmi"], "audio/mobile-xmf": ["mxmf"], "audio/mp3": ["*mp3"], "audio/mp4": ["m4a", "mp4a"], "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"], "audio/ogg": ["oga", "ogg", "spx", "opus"], "audio/s3m": ["s3m"], "audio/silk": ["sil"], "audio/wav": ["wav"], "audio/wave": ["*wav"], "audio/webm": ["weba"], "audio/xm": ["xm"], "font/collection": ["ttc"], "font/otf": ["otf"], "font/ttf": ["ttf"], "font/woff": ["woff"], "font/woff2": ["woff2"], "image/aces": ["exr"], "image/apng": ["apng"], "image/avci": ["avci"], "image/avcs": ["avcs"], "image/avif": ["avif"], "image/bmp": ["bmp", "dib"], "image/cgm": ["cgm"], "image/dicom-rle": ["drle"], "image/dpx": ["dpx"], "image/emf": ["emf"], "image/fits": ["fits"], "image/g3fax": ["g3"], "image/gif": ["gif"], "image/heic": ["heic"], "image/heic-sequence": ["heics"], "image/heif": ["heif"], "image/heif-sequence": ["heifs"], "image/hej2k": ["hej2"], "image/hsj2": ["hsj2"], "image/ief": ["ief"], "image/jls": ["jls"], "image/jp2": ["jp2", "jpg2"], "image/jpeg": ["jpeg", "jpg", "jpe"], "image/jph": ["jph"], "image/jphc": ["jhc"], "image/jpm": ["jpm", "jpgm"], "image/jpx": ["jpx", "jpf"], "image/jxr": ["jxr"], "image/jxra": ["jxra"], "image/jxrs": ["jxrs"], "image/jxs": ["jxs"], "image/jxsc": ["jxsc"], "image/jxsi": ["jxsi"], "image/jxss": ["jxss"], "image/ktx": ["ktx"], "image/ktx2": ["ktx2"], "image/png": ["png"], "image/sgi": ["sgi"], "image/svg+xml": ["svg", "svgz"], "image/t38": ["t38"], "image/tiff": ["tif", "tiff"], "image/tiff-fx": ["tfx"], "image/webp": ["webp"], "image/wmf": ["wmf"], "message/disposition-notification": ["disposition-notification"], "message/global": ["u8msg"], "message/global-delivery-status": ["u8dsn"], "message/global-disposition-notification": ["u8mdn"], "message/global-headers": ["u8hdr"], "message/rfc822": ["eml", "mime"], "model/3mf": ["3mf"], "model/gltf+json": ["gltf"], "model/gltf-binary": ["glb"], "model/iges": ["igs", "iges"], "model/jt": ["jt"], "model/mesh": ["msh", "mesh", "silo"], "model/mtl": ["mtl"], "model/obj": ["obj"], "model/prc": ["prc"], "model/step+xml": ["stpx"], "model/step+zip": ["stpz"], "model/step-xml+zip": ["stpxz"], "model/stl": ["stl"], "model/u3d": ["u3d"], "model/vrml": ["wrl", "vrml"], "model/x3d+binary": ["*x3db", "x3dbz"], "model/x3d+fastinfoset": ["x3db"], "model/x3d+vrml": ["*x3dv", "x3dvz"], "model/x3d+xml": ["x3d", "x3dz"], "model/x3d-vrml": ["x3dv"], "text/cache-manifest": ["appcache", "manifest"], "text/calendar": ["ics", "ifb"], "text/coffeescript": ["coffee", "litcoffee"], "text/css": ["css"], "text/csv": ["csv"], "text/html": ["html", "htm", "shtml"], "text/jade": ["jade"], "text/javascript": ["js", "mjs"], "text/jsx": ["jsx"], "text/less": ["less"], "text/markdown": ["md", "markdown"], "text/mathml": ["mml"], "text/mdx": ["mdx"], "text/n3": ["n3"], "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"], "text/richtext": ["rtx"], "text/rtf": ["*rtf"], "text/sgml": ["sgml", "sgm"], "text/shex": ["shex"], "text/slim": ["slim", "slm"], "text/spdx": ["spdx"], "text/stylus": ["stylus", "styl"], "text/tab-separated-values": ["tsv"], "text/troff": ["t", "tr", "roff", "man", "me", "ms"], "text/turtle": ["ttl"], "text/uri-list": ["uri", "uris", "urls"], "text/vcard": ["vcard"], "text/vtt": ["vtt"], "text/wgsl": ["wgsl"], "text/xml": ["*xml"], "text/yaml": ["yaml", "yml"], "video/3gpp": ["3gp", "3gpp"], "video/3gpp2": ["3g2"], "video/h261": ["h261"], "video/h263": ["h263"], "video/h264": ["h264"], "video/iso.segment": ["m4s"], "video/jpeg": ["jpgv"], "video/jpm": ["*jpm", "*jpgm"], "video/mj2": ["mj2", "mjp2"], "video/mp2t": ["ts"], "video/mp4": ["mp4", "mp4v", "mpg4"], "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"], "video/ogg": ["ogv"], "video/quicktime": ["qt", "mov"], "video/webm": ["webm"] };
1595
- Object.freeze(pe);
1596
- var I = function(o, r, p, c) {
1595
+ loadState: gt,
1596
+ noop: yt,
1597
+ prune: se,
1598
+ redo: pe,
1599
+ setName: oe,
1600
+ undo: ae
1601
+ }, Symbol.toStringTag, { value: "Module" })), ce = { "application/andrew-inset": ["ez"], "application/appinstaller": ["appinstaller"], "application/applixware": ["aw"], "application/appx": ["appx"], "application/appxbundle": ["appxbundle"], "application/atom+xml": ["atom"], "application/atomcat+xml": ["atomcat"], "application/atomdeleted+xml": ["atomdeleted"], "application/atomsvc+xml": ["atomsvc"], "application/atsc-dwd+xml": ["dwd"], "application/atsc-held+xml": ["held"], "application/atsc-rsat+xml": ["rsat"], "application/automationml-aml+xml": ["aml"], "application/automationml-amlx+zip": ["amlx"], "application/bdoc": ["bdoc"], "application/calendar+xml": ["xcs"], "application/ccxml+xml": ["ccxml"], "application/cdfx+xml": ["cdfx"], "application/cdmi-capability": ["cdmia"], "application/cdmi-container": ["cdmic"], "application/cdmi-domain": ["cdmid"], "application/cdmi-object": ["cdmio"], "application/cdmi-queue": ["cdmiq"], "application/cpl+xml": ["cpl"], "application/cu-seeme": ["cu"], "application/cwl": ["cwl"], "application/dash+xml": ["mpd"], "application/dash-patch+xml": ["mpp"], "application/davmount+xml": ["davmount"], "application/docbook+xml": ["dbk"], "application/dssc+der": ["dssc"], "application/dssc+xml": ["xdssc"], "application/ecmascript": ["ecma"], "application/emma+xml": ["emma"], "application/emotionml+xml": ["emotionml"], "application/epub+zip": ["epub"], "application/exi": ["exi"], "application/express": ["exp"], "application/fdf": ["fdf"], "application/fdt+xml": ["fdt"], "application/font-tdpfr": ["pfr"], "application/geo+json": ["geojson"], "application/gml+xml": ["gml"], "application/gpx+xml": ["gpx"], "application/gxf": ["gxf"], "application/gzip": ["gz"], "application/hjson": ["hjson"], "application/hyperstudio": ["stk"], "application/inkml+xml": ["ink", "inkml"], "application/ipfix": ["ipfix"], "application/its+xml": ["its"], "application/java-archive": ["jar", "war", "ear"], "application/java-serialized-object": ["ser"], "application/java-vm": ["class"], "application/javascript": ["*js"], "application/json": ["json", "map"], "application/json5": ["json5"], "application/jsonml+json": ["jsonml"], "application/ld+json": ["jsonld"], "application/lgr+xml": ["lgr"], "application/lost+xml": ["lostxml"], "application/mac-binhex40": ["hqx"], "application/mac-compactpro": ["cpt"], "application/mads+xml": ["mads"], "application/manifest+json": ["webmanifest"], "application/marc": ["mrc"], "application/marcxml+xml": ["mrcx"], "application/mathematica": ["ma", "nb", "mb"], "application/mathml+xml": ["mathml"], "application/mbox": ["mbox"], "application/media-policy-dataset+xml": ["mpf"], "application/mediaservercontrol+xml": ["mscml"], "application/metalink+xml": ["metalink"], "application/metalink4+xml": ["meta4"], "application/mets+xml": ["mets"], "application/mmt-aei+xml": ["maei"], "application/mmt-usd+xml": ["musd"], "application/mods+xml": ["mods"], "application/mp21": ["m21", "mp21"], "application/mp4": ["*mp4", "*mpg4", "mp4s", "m4p"], "application/msix": ["msix"], "application/msixbundle": ["msixbundle"], "application/msword": ["doc", "dot"], "application/mxf": ["mxf"], "application/n-quads": ["nq"], "application/n-triples": ["nt"], "application/node": ["cjs"], "application/octet-stream": ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"], "application/oda": ["oda"], "application/oebps-package+xml": ["opf"], "application/ogg": ["ogx"], "application/omdoc+xml": ["omdoc"], "application/onenote": ["onetoc", "onetoc2", "onetmp", "onepkg"], "application/oxps": ["oxps"], "application/p2p-overlay+xml": ["relo"], "application/patch-ops-error+xml": ["xer"], "application/pdf": ["pdf"], "application/pgp-encrypted": ["pgp"], "application/pgp-keys": ["asc"], "application/pgp-signature": ["sig", "*asc"], "application/pics-rules": ["prf"], "application/pkcs10": ["p10"], "application/pkcs7-mime": ["p7m", "p7c"], "application/pkcs7-signature": ["p7s"], "application/pkcs8": ["p8"], "application/pkix-attr-cert": ["ac"], "application/pkix-cert": ["cer"], "application/pkix-crl": ["crl"], "application/pkix-pkipath": ["pkipath"], "application/pkixcmp": ["pki"], "application/pls+xml": ["pls"], "application/postscript": ["ai", "eps", "ps"], "application/provenance+xml": ["provx"], "application/pskc+xml": ["pskcxml"], "application/raml+yaml": ["raml"], "application/rdf+xml": ["rdf", "owl"], "application/reginfo+xml": ["rif"], "application/relax-ng-compact-syntax": ["rnc"], "application/resource-lists+xml": ["rl"], "application/resource-lists-diff+xml": ["rld"], "application/rls-services+xml": ["rs"], "application/route-apd+xml": ["rapd"], "application/route-s-tsid+xml": ["sls"], "application/route-usd+xml": ["rusd"], "application/rpki-ghostbusters": ["gbr"], "application/rpki-manifest": ["mft"], "application/rpki-roa": ["roa"], "application/rsd+xml": ["rsd"], "application/rss+xml": ["rss"], "application/rtf": ["rtf"], "application/sbml+xml": ["sbml"], "application/scvp-cv-request": ["scq"], "application/scvp-cv-response": ["scs"], "application/scvp-vp-request": ["spq"], "application/scvp-vp-response": ["spp"], "application/sdp": ["sdp"], "application/senml+xml": ["senmlx"], "application/sensml+xml": ["sensmlx"], "application/set-payment-initiation": ["setpay"], "application/set-registration-initiation": ["setreg"], "application/shf+xml": ["shf"], "application/sieve": ["siv", "sieve"], "application/smil+xml": ["smi", "smil"], "application/sparql-query": ["rq"], "application/sparql-results+xml": ["srx"], "application/sql": ["sql"], "application/srgs": ["gram"], "application/srgs+xml": ["grxml"], "application/sru+xml": ["sru"], "application/ssdl+xml": ["ssdl"], "application/ssml+xml": ["ssml"], "application/swid+xml": ["swidtag"], "application/tei+xml": ["tei", "teicorpus"], "application/thraud+xml": ["tfi"], "application/timestamped-data": ["tsd"], "application/toml": ["toml"], "application/trig": ["trig"], "application/ttml+xml": ["ttml"], "application/ubjson": ["ubj"], "application/urc-ressheet+xml": ["rsheet"], "application/urc-targetdesc+xml": ["td"], "application/voicexml+xml": ["vxml"], "application/wasm": ["wasm"], "application/watcherinfo+xml": ["wif"], "application/widget": ["wgt"], "application/winhlp": ["hlp"], "application/wsdl+xml": ["wsdl"], "application/wspolicy+xml": ["wspolicy"], "application/xaml+xml": ["xaml"], "application/xcap-att+xml": ["xav"], "application/xcap-caps+xml": ["xca"], "application/xcap-diff+xml": ["xdf"], "application/xcap-el+xml": ["xel"], "application/xcap-ns+xml": ["xns"], "application/xenc+xml": ["xenc"], "application/xfdf": ["xfdf"], "application/xhtml+xml": ["xhtml", "xht"], "application/xliff+xml": ["xlf"], "application/xml": ["xml", "xsl", "xsd", "rng"], "application/xml-dtd": ["dtd"], "application/xop+xml": ["xop"], "application/xproc+xml": ["xpl"], "application/xslt+xml": ["*xsl", "xslt"], "application/xspf+xml": ["xspf"], "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"], "application/yang": ["yang"], "application/yin+xml": ["yin"], "application/zip": ["zip"], "audio/3gpp": ["*3gpp"], "audio/aac": ["adts", "aac"], "audio/adpcm": ["adp"], "audio/amr": ["amr"], "audio/basic": ["au", "snd"], "audio/midi": ["mid", "midi", "kar", "rmi"], "audio/mobile-xmf": ["mxmf"], "audio/mp3": ["*mp3"], "audio/mp4": ["m4a", "mp4a"], "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"], "audio/ogg": ["oga", "ogg", "spx", "opus"], "audio/s3m": ["s3m"], "audio/silk": ["sil"], "audio/wav": ["wav"], "audio/wave": ["*wav"], "audio/webm": ["weba"], "audio/xm": ["xm"], "font/collection": ["ttc"], "font/otf": ["otf"], "font/ttf": ["ttf"], "font/woff": ["woff"], "font/woff2": ["woff2"], "image/aces": ["exr"], "image/apng": ["apng"], "image/avci": ["avci"], "image/avcs": ["avcs"], "image/avif": ["avif"], "image/bmp": ["bmp", "dib"], "image/cgm": ["cgm"], "image/dicom-rle": ["drle"], "image/dpx": ["dpx"], "image/emf": ["emf"], "image/fits": ["fits"], "image/g3fax": ["g3"], "image/gif": ["gif"], "image/heic": ["heic"], "image/heic-sequence": ["heics"], "image/heif": ["heif"], "image/heif-sequence": ["heifs"], "image/hej2k": ["hej2"], "image/hsj2": ["hsj2"], "image/ief": ["ief"], "image/jls": ["jls"], "image/jp2": ["jp2", "jpg2"], "image/jpeg": ["jpeg", "jpg", "jpe"], "image/jph": ["jph"], "image/jphc": ["jhc"], "image/jpm": ["jpm", "jpgm"], "image/jpx": ["jpx", "jpf"], "image/jxr": ["jxr"], "image/jxra": ["jxra"], "image/jxrs": ["jxrs"], "image/jxs": ["jxs"], "image/jxsc": ["jxsc"], "image/jxsi": ["jxsi"], "image/jxss": ["jxss"], "image/ktx": ["ktx"], "image/ktx2": ["ktx2"], "image/png": ["png"], "image/sgi": ["sgi"], "image/svg+xml": ["svg", "svgz"], "image/t38": ["t38"], "image/tiff": ["tif", "tiff"], "image/tiff-fx": ["tfx"], "image/webp": ["webp"], "image/wmf": ["wmf"], "message/disposition-notification": ["disposition-notification"], "message/global": ["u8msg"], "message/global-delivery-status": ["u8dsn"], "message/global-disposition-notification": ["u8mdn"], "message/global-headers": ["u8hdr"], "message/rfc822": ["eml", "mime"], "model/3mf": ["3mf"], "model/gltf+json": ["gltf"], "model/gltf-binary": ["glb"], "model/iges": ["igs", "iges"], "model/jt": ["jt"], "model/mesh": ["msh", "mesh", "silo"], "model/mtl": ["mtl"], "model/obj": ["obj"], "model/prc": ["prc"], "model/step+xml": ["stpx"], "model/step+zip": ["stpz"], "model/step-xml+zip": ["stpxz"], "model/stl": ["stl"], "model/u3d": ["u3d"], "model/vrml": ["wrl", "vrml"], "model/x3d+binary": ["*x3db", "x3dbz"], "model/x3d+fastinfoset": ["x3db"], "model/x3d+vrml": ["*x3dv", "x3dvz"], "model/x3d+xml": ["x3d", "x3dz"], "model/x3d-vrml": ["x3dv"], "text/cache-manifest": ["appcache", "manifest"], "text/calendar": ["ics", "ifb"], "text/coffeescript": ["coffee", "litcoffee"], "text/css": ["css"], "text/csv": ["csv"], "text/html": ["html", "htm", "shtml"], "text/jade": ["jade"], "text/javascript": ["js", "mjs"], "text/jsx": ["jsx"], "text/less": ["less"], "text/markdown": ["md", "markdown"], "text/mathml": ["mml"], "text/mdx": ["mdx"], "text/n3": ["n3"], "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"], "text/richtext": ["rtx"], "text/rtf": ["*rtf"], "text/sgml": ["sgml", "sgm"], "text/shex": ["shex"], "text/slim": ["slim", "slm"], "text/spdx": ["spdx"], "text/stylus": ["stylus", "styl"], "text/tab-separated-values": ["tsv"], "text/troff": ["t", "tr", "roff", "man", "me", "ms"], "text/turtle": ["ttl"], "text/uri-list": ["uri", "uris", "urls"], "text/vcard": ["vcard"], "text/vtt": ["vtt"], "text/wgsl": ["wgsl"], "text/xml": ["*xml"], "text/yaml": ["yaml", "yml"], "video/3gpp": ["3gp", "3gpp"], "video/3gpp2": ["3g2"], "video/h261": ["h261"], "video/h263": ["h263"], "video/h264": ["h264"], "video/iso.segment": ["m4s"], "video/jpeg": ["jpgv"], "video/jpm": ["*jpm", "*jpgm"], "video/mj2": ["mj2", "mjp2"], "video/mp2t": ["ts"], "video/mp4": ["mp4", "mp4v", "mpg4"], "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"], "video/ogg": ["ogv"], "video/quicktime": ["qt", "mov"], "video/webm": ["webm"] };
1602
+ Object.freeze(ce);
1603
+ var I = function(n, r, p, c) {
1597
1604
  if (p === "a" && !c)
1598
1605
  throw new TypeError("Private accessor was defined without a getter");
1599
- if (typeof r == "function" ? o !== r || !c : !r.has(o))
1606
+ if (typeof r == "function" ? n !== r || !c : !r.has(n))
1600
1607
  throw new TypeError("Cannot read private member from an object whose class did not declare it");
1601
- return p === "m" ? c : p === "a" ? c.call(o) : c ? c.value : r.get(o);
1608
+ return p === "m" ? c : p === "a" ? c.call(n) : c ? c.value : r.get(n);
1602
1609
  }, L, W, M;
1603
1610
  class Bi {
1604
1611
  constructor(...r) {
@@ -1652,11 +1659,11 @@ class Bi {
1652
1659
  }
1653
1660
  }
1654
1661
  L = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap();
1655
- const ji = new Bi(pe)._freeze();
1656
- function Ii(o) {
1657
- const r = [], p = Object.keys(o);
1662
+ const ji = new Bi(ce)._freeze();
1663
+ function Ii(n) {
1664
+ const r = [], p = Object.keys(n);
1658
1665
  for (const c of p) {
1659
- const u = o[c].sort((f, l) => f.index - l.index);
1666
+ const u = n[c].sort((f, l) => f.index - l.index);
1660
1667
  for (let f = 0; f < u.length; f++)
1661
1668
  u[f].index !== f && r.push({
1662
1669
  message: `Invalid operation index ${u[f].index} at position ${f}`,
@@ -1669,8 +1676,8 @@ function Ii(o) {
1669
1676
  }
1670
1677
  return r;
1671
1678
  }
1672
- const se = async (o) => {
1673
- const r = new Ut(), { name: p, revision: c, documentType: u, created: f, lastModified: l } = o, a = {
1679
+ const le = async (n) => {
1680
+ const r = new Dt(), { name: p, revision: c, documentType: u, created: f, lastModified: l } = n, a = {
1674
1681
  name: p,
1675
1682
  revision: c,
1676
1683
  documentType: u,
@@ -1679,92 +1686,92 @@ const se = async (o) => {
1679
1686
  };
1680
1687
  return r.file("header.json", JSON.stringify(a, null, 2)), r.file(
1681
1688
  "state.json",
1682
- JSON.stringify(o.initialState || {}, null, 2)
1683
- ), r.file("operations.json", JSON.stringify(o.operations, null, 2)), Object.keys(o.attachments).forEach((d) => {
1684
- const { data: b, ...w } = o.attachments[d];
1685
- r.file(d, b, {
1689
+ JSON.stringify(n.initialState || {}, null, 2)
1690
+ ), r.file("operations.json", JSON.stringify(n.operations, null, 2)), Object.keys(n.attachments).forEach((d) => {
1691
+ const { data: v, ...g } = n.attachments[d];
1692
+ r.file(d, v, {
1686
1693
  base64: !0,
1687
1694
  createFolders: !0,
1688
- comment: JSON.stringify(w)
1695
+ comment: JSON.stringify(g)
1689
1696
  });
1690
1697
  }), r;
1691
- }, Oi = async (o, r, p, c) => {
1692
- await (await se(o)).generateAsync({
1698
+ }, Oi = async (n, r, p, c) => {
1699
+ await (await le(n)).generateAsync({
1693
1700
  type: "uint8array",
1694
1701
  streamFiles: !0
1695
1702
  });
1696
- const f = c ?? o.name, l = `.${p}.zip`;
1703
+ const f = c ?? n.name, l = `.${p}.zip`;
1697
1704
  return gi(
1698
1705
  r,
1699
1706
  f.endsWith(l) ? f : `${f}${l}`
1700
1707
  );
1701
- }, $i = async (o, r) => {
1702
- const c = await (await se(o)).generateAsync({ type: "blob" }), u = await r.createWritable();
1708
+ }, Wi = async (n, r) => {
1709
+ const c = await (await le(n)).generateAsync({ type: "blob" }), u = await r.createWritable();
1703
1710
  await u.write(c), await u.close();
1704
- }, Ot = async (o, r) => {
1705
- const p = te();
1711
+ }, Tt = async (n, r) => {
1712
+ const p = ie();
1706
1713
  return Ui(p, r);
1707
- }, Ui = async (o, r) => {
1708
- const p = new Ut();
1709
- return await p.loadAsync(o), Ti(p, r);
1714
+ }, Ui = async (n, r) => {
1715
+ const p = new Dt();
1716
+ return await p.loadAsync(n), Ti(p, r);
1710
1717
  };
1711
- async function Ti(o, r) {
1712
- const p = o.file("state.json");
1718
+ async function Ti(n, r) {
1719
+ const p = n.file("state.json");
1713
1720
  if (!p)
1714
1721
  throw new Error("Initial state not found");
1715
- const c = await p.async("string"), u = JSON.parse(c), f = o.file("header.json");
1722
+ const c = await p.async("string"), u = JSON.parse(c), f = n.file("header.json");
1716
1723
  let l;
1717
1724
  f && (l = JSON.parse(await f.async("string")));
1718
- const a = o.file("operations.json");
1725
+ const a = n.file("operations.json");
1719
1726
  if (!a)
1720
1727
  throw new Error("Operations history not found");
1721
1728
  const x = JSON.parse(
1722
1729
  await a.async("string")
1723
1730
  ), d = Ii(x);
1724
1731
  if (d.length) {
1725
- const w = d.map((v) => v.message);
1726
- throw new Error(w.join(`
1732
+ const g = d.map((y) => y.message);
1733
+ throw new Error(g.join(`
1727
1734
  `));
1728
1735
  }
1729
- let b = ie(
1736
+ let v = ne(
1730
1737
  u,
1731
1738
  x,
1732
1739
  r,
1733
1740
  void 0,
1734
1741
  l
1735
1742
  );
1736
- return l && (b = {
1737
- ...b,
1743
+ return l && (v = {
1744
+ ...v,
1738
1745
  ...l
1739
- }), b;
1746
+ }), v;
1740
1747
  }
1741
- function ce(o) {
1742
- const r = o.replace(/^.*\./, "") || void 0, p = o.replace(/^.*[/\\]/, "") || void 0;
1748
+ function ue(n) {
1749
+ const r = n.replace(/^.*\./, "") || void 0, p = n.replace(/^.*[/\\]/, "") || void 0;
1743
1750
  return { extension: r, fileName: p };
1744
1751
  }
1745
- async function Wi(o) {
1746
- const { buffer: r, mimeType: p = "application/octet-stream" } = await yi(), c = ce(o), u = r.toString("base64");
1752
+ async function Ji(n) {
1753
+ const { buffer: r, mimeType: p = "application/octet-stream" } = await yi(), c = ue(n), u = r.toString("base64");
1747
1754
  return {
1748
1755
  data: u,
1749
- hash: et(u),
1756
+ hash: it(u),
1750
1757
  mimeType: p,
1751
1758
  ...c
1752
1759
  };
1753
1760
  }
1754
- async function Ji(o) {
1755
- const r = await vi(), p = ji.getType(o) || "application/octet-stream", c = ce(o), u = r.toString("base64");
1756
- return { data: u, hash: et(u), mimeType: p, ...c };
1761
+ async function Hi(n) {
1762
+ const r = await vi(), p = ji.getType(n) || "application/octet-stream", c = ue(n), u = r.toString("base64");
1763
+ return { data: u, hash: it(u), mimeType: p, ...c };
1757
1764
  }
1758
- class Hi {
1765
+ class Zi {
1759
1766
  /**
1760
1767
  * Constructs a BaseDocument instance with an initial state.
1761
1768
  * @param reducer - The reducer function that updates the state.
1762
1769
  * @param document - The initial state of the document.
1763
1770
  */
1764
1771
  constructor(r, p, c) {
1765
- V(this, "_document");
1766
- V(this, "_reducer");
1767
- V(this, "_signalDispatch");
1772
+ X(this, "_document");
1773
+ X(this, "_reducer");
1774
+ X(this, "_signalDispatch");
1768
1775
  this._reducer = r, this._document = p, this._signalDispatch = c;
1769
1776
  }
1770
1777
  /**
@@ -1794,7 +1801,7 @@ class Hi {
1794
1801
  * @param path - The file path where the state is stored.
1795
1802
  */
1796
1803
  async loadFromFile(r) {
1797
- this._document = await Ot(r, this._reducer);
1804
+ this._document = await Tt(r, this._reducer);
1798
1805
  }
1799
1806
  /**
1800
1807
  * Loads the state of the document from a file and returns it.
@@ -1803,19 +1810,19 @@ class Hi {
1803
1810
  * @returns The state of the document.
1804
1811
  */
1805
1812
  static async stateFromFile(r, p) {
1806
- return await Ot(r, p);
1813
+ return await Tt(r, p);
1807
1814
  }
1808
1815
  /**
1809
1816
  * Gets the current state of the document.
1810
1817
  */
1811
1818
  get state() {
1812
- return X(this._document.state);
1819
+ return Q(this._document.state);
1813
1820
  }
1814
1821
  /**
1815
1822
  * Gets the list of operations performed on the document.
1816
1823
  */
1817
1824
  get operations() {
1818
- return X(this._document.operations);
1825
+ return Q(this._document.operations);
1819
1826
  }
1820
1827
  /**
1821
1828
  * Gets the name of the document.
@@ -1854,13 +1861,13 @@ class Hi {
1854
1861
  * Gets the initial state of the document.
1855
1862
  */
1856
1863
  get initialState() {
1857
- return X(this._document.initialState);
1864
+ return Q(this._document.initialState);
1858
1865
  }
1859
1866
  /**
1860
1867
  * Returns the current document as an object
1861
1868
  */
1862
1869
  toDocument() {
1863
- return X(this._document);
1870
+ return Q(this._document);
1864
1871
  }
1865
1872
  /**
1866
1873
  * Gets the attachment associated with the given key.
@@ -1874,21 +1881,21 @@ class Hi {
1874
1881
  * @param name - The new name of the document.
1875
1882
  */
1876
1883
  setName(r) {
1877
- return this.dispatch(re(r)), this;
1884
+ return this.dispatch(oe(r)), this;
1878
1885
  }
1879
1886
  /**
1880
1887
  * Reverts a number of actions from the document.
1881
1888
  * @param count - The number of actions to revert.
1882
1889
  */
1883
1890
  undo(r) {
1884
- return this.dispatch(ne(r)), this;
1891
+ return this.dispatch(ae(r)), this;
1885
1892
  }
1886
1893
  /**
1887
1894
  * Reapplies a number of actions to the document.
1888
1895
  * @param count - The number of actions to reapply.
1889
1896
  */
1890
1897
  redo(r) {
1891
- return this.dispatch(oe(r)), this;
1898
+ return this.dispatch(pe(r)), this;
1892
1899
  }
1893
1900
  /**
1894
1901
  * Removes a range of operations from the document.
@@ -1896,7 +1903,7 @@ class Hi {
1896
1903
  * @param end - The ending index of the range to remove.
1897
1904
  */
1898
1905
  prune(r, p) {
1899
- return this.dispatch(ae(r, p)), this;
1906
+ return this.dispatch(se(r, p)), this;
1900
1907
  }
1901
1908
  /**
1902
1909
  * Loads a document state and a set of operations.
@@ -1904,15 +1911,15 @@ class Hi {
1904
1911
  * @param operations - The operations to apply to the document.
1905
1912
  */
1906
1913
  loadState(r, p) {
1907
- return this.dispatch(dt(r, p)), this;
1914
+ return this.dispatch(gt(r, p)), this;
1908
1915
  }
1909
1916
  }
1910
- function Zi(o, r) {
1917
+ function Yi(n, r) {
1911
1918
  r.forEach((p) => {
1912
1919
  Object.getOwnPropertyNames(p.prototype).forEach((c) => {
1913
1920
  Object.defineProperty(
1914
1921
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
1915
- o.prototype,
1922
+ n.prototype,
1916
1923
  c,
1917
1924
  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
1918
1925
  Object.getOwnPropertyDescriptor(p.prototype, c) || /* @__PURE__ */ Object.create(null)
@@ -1921,33 +1928,34 @@ function Zi(o, r) {
1921
1928
  });
1922
1929
  }
1923
1930
  export {
1924
- Ke as A,
1925
- Hi as B,
1926
- Li as C,
1931
+ Kt as A,
1932
+ Zi as B,
1933
+ Ke as C,
1934
+ Li as D,
1927
1935
  Fi as a,
1928
1936
  Ai as b,
1929
1937
  _i as c,
1930
- $i as d,
1938
+ Wi as d,
1931
1939
  Ui as e,
1932
1940
  q as f,
1933
- Zi as g,
1934
- qi as h,
1935
- It as i,
1936
- se as j,
1937
- Ji as k,
1938
- Ot as l,
1939
- Wi as m,
1940
- ee as n,
1941
+ Yi as g,
1942
+ $i as h,
1943
+ Ut as i,
1944
+ le as j,
1945
+ Hi as k,
1946
+ Tt as l,
1947
+ Ji as m,
1948
+ re as n,
1941
1949
  zi as o,
1942
1950
  Ei as p,
1943
- jt as q,
1944
- Si as r,
1951
+ qi as q,
1952
+ Ot as r,
1945
1953
  Oi as s,
1946
- X as t,
1947
- ie as u,
1948
- st as v,
1949
- ki as w,
1950
- Pi as x,
1951
- Ii as y,
1952
- Yt as z
1954
+ Si as t,
1955
+ Q as u,
1956
+ ne as v,
1957
+ lt as w,
1958
+ ki as x,
1959
+ Pi as y,
1960
+ Ii as z
1953
1961
  };