document-model 1.1.0-experimental.2 → 1.1.0-experimental.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/dist/browser/cjs/document-model.js +1 -1
- package/dist/browser/cjs/document.js +1 -1
- package/dist/browser/cjs/index.js +1 -1
- package/dist/{node/cjs/internal/index-CTavCc1t.js → browser/cjs/internal/index-BLpgsifL.js} +1 -1
- package/dist/browser/cjs/internal/{index-DLodkpOq.js → index-BTG_-qY6.js} +1 -1
- package/dist/browser/cjs/internal/{object-CMr-_AP8.js → object-BHB7lY3H.js} +19 -19
- package/dist/browser/es/document-model.js +2 -2
- package/dist/browser/es/document.js +9 -7
- package/dist/browser/es/index.js +3 -3
- package/dist/browser/es/internal/index-2Qq00NLA.js +46 -0
- package/dist/browser/es/internal/{index-CL_1ivGq.js → index-BD2hB9El.js} +1 -1
- package/dist/browser/es/internal/{object-FFc9n_3I.js → object-BW-G4r5m.js} +354 -345
- package/dist/browser/src/document/reducer.d.ts +17 -0
- package/dist/node/cjs/document-model.js +1 -1
- package/dist/node/cjs/document.js +1 -1
- package/dist/node/cjs/index.js +1 -1
- package/dist/{browser/cjs/internal/index-azT4DEce.js → node/cjs/internal/index-B31DqWHj.js} +1 -1
- package/dist/node/cjs/internal/{index-CPeTtUsk.js → index-BBm_wnUa.js} +1 -1
- package/dist/node/cjs/internal/{object-DhI24-1e.js → object-CxVzP-Xe.js} +17 -17
- package/dist/node/es/document-model.js +2 -2
- package/dist/node/es/document.js +10 -8
- package/dist/node/es/index.js +3 -3
- package/dist/node/es/internal/{index-A880In4b.js → index-BPCSW4M1.js} +1 -1
- package/dist/node/es/internal/index-C7I4OGkU.js +46 -0
- package/dist/node/es/internal/{object-C9n9Ijnt.js → object-C-_SkpQ0.js} +511 -502
- package/dist/node/src/document/reducer.d.ts +17 -0
- package/dist/src/document/actions/creators.d.ts +47 -0
- package/dist/src/document/actions/index.d.ts +14 -0
- package/dist/src/document/actions/types.d.ts +15 -0
- package/dist/src/document/index.d.ts +6 -0
- package/dist/src/document/object.d.ts +1210 -0
- package/dist/src/document/reducer.d.ts +60 -0
- package/dist/src/document/schema/index.d.ts +2 -0
- package/dist/src/document/schema/types.d.ts +176 -0
- package/dist/src/document/schema/zod.d.ts +113 -0
- package/dist/src/document/signal.d.ts +29 -0
- package/dist/src/document/types.d.ts +255 -0
- package/dist/src/document/utils/base.d.ts +86 -0
- package/dist/src/document/utils/document-helpers.d.ts +53 -0
- package/dist/src/document/utils/file.d.ts +48 -0
- package/dist/src/document/utils/index.d.ts +5 -0
- package/dist/src/document/utils/node.d.ts +9 -0
- package/dist/src/document/utils/validation.d.ts +2 -0
- package/dist/src/document-model/custom/reducers/header.d.ts +2 -0
- package/dist/src/document-model/custom/reducers/module.d.ts +2 -0
- package/dist/src/document-model/custom/reducers/operation-error.d.ts +2 -0
- package/dist/src/document-model/custom/reducers/operation-example.d.ts +2 -0
- package/dist/src/document-model/custom/reducers/operation.d.ts +2 -0
- package/dist/src/document-model/custom/reducers/state.d.ts +2 -0
- package/dist/src/document-model/custom/reducers/versioning.d.ts +7 -0
- package/dist/src/document-model/custom/utils.d.ts +7 -0
- package/dist/src/document-model/gen/actions.d.ts +15 -0
- package/dist/src/document-model/gen/creators.d.ts +7 -0
- package/dist/src/document-model/gen/document-model.d.ts +2 -0
- package/dist/src/document-model/gen/header/actions.d.ts +9 -0
- package/dist/src/document-model/gen/header/creators.d.ts +8 -0
- package/dist/src/document-model/gen/header/object.d.ts +12 -0
- package/dist/src/document-model/gen/header/operations.d.ts +10 -0
- package/dist/src/document-model/gen/index.d.ts +5 -0
- package/dist/src/document-model/gen/module/actions.d.ts +8 -0
- package/dist/src/document-model/gen/module/creators.d.ts +7 -0
- package/dist/src/document-model/gen/module/object.d.ts +11 -0
- package/dist/src/document-model/gen/module/operations.d.ts +9 -0
- package/dist/src/document-model/gen/object.d.ts +28 -0
- package/dist/src/document-model/gen/operation/actions.d.ts +13 -0
- package/dist/src/document-model/gen/operation/creators.d.ts +12 -0
- package/dist/src/document-model/gen/operation/object.d.ts +16 -0
- package/dist/src/document-model/gen/operation/operations.d.ts +14 -0
- package/dist/src/document-model/gen/operation-error/actions.d.ts +10 -0
- package/dist/src/document-model/gen/operation-error/creators.d.ts +9 -0
- package/dist/src/document-model/gen/operation-error/object.d.ts +13 -0
- package/dist/src/document-model/gen/operation-error/operations.d.ts +11 -0
- package/dist/src/document-model/gen/operation-example/actions.d.ts +7 -0
- package/dist/src/document-model/gen/operation-example/creators.d.ts +6 -0
- package/dist/src/document-model/gen/operation-example/object.d.ts +10 -0
- package/dist/src/document-model/gen/operation-example/operations.d.ts +8 -0
- package/dist/src/document-model/gen/reducer.d.ts +5 -0
- package/dist/src/document-model/gen/schema/index.d.ts +2 -0
- package/dist/src/document-model/gen/schema/types.d.ts +453 -0
- package/dist/src/document-model/gen/schema/zod.d.ts +453 -0
- package/dist/src/document-model/gen/state/actions.d.ts +9 -0
- package/dist/src/document-model/gen/state/creators.d.ts +8 -0
- package/dist/src/document-model/gen/state/object.d.ts +12 -0
- package/dist/src/document-model/gen/state/operations.d.ts +10 -0
- package/dist/src/document-model/gen/types.d.ts +8 -0
- package/dist/src/document-model/gen/utils.d.ts +6 -0
- package/dist/src/document-model/gen/versioning/actions.d.ts +8 -0
- package/dist/src/document-model/gen/versioning/creators.d.ts +7 -0
- package/dist/src/document-model/gen/versioning/object.d.ts +11 -0
- package/dist/src/document-model/gen/versioning/operations.d.ts +9 -0
- package/dist/src/document-model/index.d.ts +80 -0
- package/dist/src/index.d.ts +25 -0
- package/dist/vite.config.d.ts +2 -0
- package/dist/vitest.config.d.ts +2 -0
- package/package.json +1 -1
- package/dist/browser/es/internal/index-BzNpRs2a.js +0 -44
- package/dist/node/es/internal/index-8lUz8qED.js +0 -44
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var At = (i, r, o) => (
|
|
4
|
-
import { produce as
|
|
1
|
+
var Ve = Object.defineProperty;
|
|
2
|
+
var Ke = (i, r, o) => r in i ? Ve(i, r, { enumerable: !0, configurable: !0, writable: !0, value: o }) : i[r] = o;
|
|
3
|
+
var At = (i, r, o) => (Ke(i, typeof r != "symbol" ? r + "" : r, o), o);
|
|
4
|
+
import { produce as Bt, castDraft as Ot, castImmutable as Ge, freeze as Ze } from "immer";
|
|
5
5
|
import { z as _ } from "zod";
|
|
6
6
|
import oe from "jszip";
|
|
7
|
-
const ae = (i) => i != null,
|
|
8
|
-
function
|
|
7
|
+
const ae = (i) => i != null, Ye = _.any().refine((i) => ae(i)), se = _.enum(["LOAD_STATE"]), pe = _.enum(["PRUNE"]), ce = _.enum(["REDO"]), le = _.enum(["SET_NAME"]), ue = _.enum(["UNDO"]);
|
|
8
|
+
function Qe() {
|
|
9
9
|
return _.object({
|
|
10
10
|
__typename: _.literal("Action").optional(),
|
|
11
11
|
type: _.string()
|
|
@@ -23,7 +23,7 @@ function fe() {
|
|
|
23
23
|
ye()
|
|
24
24
|
]);
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function ti() {
|
|
27
27
|
return _.object({
|
|
28
28
|
__typename: _.literal("DocumentFile").optional(),
|
|
29
29
|
data: _.string(),
|
|
@@ -51,7 +51,7 @@ function me() {
|
|
|
51
51
|
name: _.string()
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function ei() {
|
|
55
55
|
return _.object({
|
|
56
56
|
__typename: _.literal("Operation").optional(),
|
|
57
57
|
hash: _.string(),
|
|
@@ -73,23 +73,23 @@ function qt() {
|
|
|
73
73
|
start: _.number().nullish()
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
-
const
|
|
76
|
+
const Ht = _.number;
|
|
77
77
|
function de() {
|
|
78
78
|
return _.object({
|
|
79
|
-
input:
|
|
79
|
+
input: Ht(),
|
|
80
80
|
type: ce,
|
|
81
81
|
scope: yt()
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
-
const
|
|
84
|
+
const Jt = _.string;
|
|
85
85
|
function ge() {
|
|
86
86
|
return _.object({
|
|
87
|
-
input:
|
|
87
|
+
input: Jt(),
|
|
88
88
|
type: le,
|
|
89
89
|
scope: _.literal("global")
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function ii() {
|
|
93
93
|
return _.object({
|
|
94
94
|
__typename: _.literal("SetNameOperation").optional(),
|
|
95
95
|
hash: _.string(),
|
|
@@ -109,29 +109,29 @@ function ye() {
|
|
|
109
109
|
}
|
|
110
110
|
const gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
111
111
|
__proto__: null,
|
|
112
|
-
ActionSchema:
|
|
112
|
+
ActionSchema: Qe,
|
|
113
113
|
BaseActionSchema: fe,
|
|
114
|
-
DocumentFileSchema:
|
|
114
|
+
DocumentFileSchema: ti,
|
|
115
115
|
LoadStateActionInputSchema: zt,
|
|
116
116
|
LoadStateActionSchema: he,
|
|
117
117
|
LoadStateActionStateInputSchema: me,
|
|
118
118
|
Load_StateSchema: se,
|
|
119
|
-
OperationSchema:
|
|
119
|
+
OperationSchema: ei,
|
|
120
120
|
OperationScopeSchema: yt,
|
|
121
121
|
PruneActionInputSchema: qt,
|
|
122
122
|
PruneActionSchema: xe,
|
|
123
123
|
PruneSchema: pe,
|
|
124
|
-
RedoActionInputSchema:
|
|
124
|
+
RedoActionInputSchema: Ht,
|
|
125
125
|
RedoActionSchema: de,
|
|
126
126
|
RedoSchema: ce,
|
|
127
|
-
SetNameActionInputSchema:
|
|
127
|
+
SetNameActionInputSchema: Jt,
|
|
128
128
|
SetNameActionSchema: ge,
|
|
129
|
-
SetNameOperationSchema:
|
|
129
|
+
SetNameOperationSchema: ii,
|
|
130
130
|
Set_NameSchema: le,
|
|
131
131
|
UndoActionInputSchema: Wt,
|
|
132
132
|
UndoActionSchema: ye,
|
|
133
133
|
UndoSchema: ue,
|
|
134
|
-
definedNonNullAnySchema:
|
|
134
|
+
definedNonNullAnySchema: Ye,
|
|
135
135
|
isDefinedNonNullAny: ae
|
|
136
136
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
137
137
|
function Xt(i) {
|
|
@@ -150,10 +150,10 @@ var Nt = { exports: {} };
|
|
|
150
150
|
return w.sort();
|
|
151
151
|
for (let E = 1; E < w.length; E++) {
|
|
152
152
|
const v = w[E];
|
|
153
|
-
let
|
|
154
|
-
for (;
|
|
155
|
-
w[
|
|
156
|
-
w[
|
|
153
|
+
let M = E;
|
|
154
|
+
for (; M !== 0 && w[M - 1] > v; )
|
|
155
|
+
w[M] = w[M - 1], M--;
|
|
156
|
+
w[M] = v;
|
|
157
157
|
}
|
|
158
158
|
return w;
|
|
159
159
|
}
|
|
@@ -170,11 +170,11 @@ var Nt = { exports: {} };
|
|
|
170
170
|
}
|
|
171
171
|
function g(w, E, v) {
|
|
172
172
|
w.length < v && (v = w.length);
|
|
173
|
-
const
|
|
174
|
-
let
|
|
173
|
+
const M = E === "," ? "" : " ";
|
|
174
|
+
let J = `"0":${M}${w[0]}`;
|
|
175
175
|
for (let W = 1; W < v; W++)
|
|
176
|
-
|
|
177
|
-
return
|
|
176
|
+
J += `${E}"${W}":${M}${w[W]}`;
|
|
177
|
+
return J;
|
|
178
178
|
}
|
|
179
179
|
function y(w) {
|
|
180
180
|
if (o.call(w, "circularValue")) {
|
|
@@ -214,7 +214,7 @@ var Nt = { exports: {} };
|
|
|
214
214
|
function j(w) {
|
|
215
215
|
return w === 1 ? "1 item" : `${w} items`;
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function C(w) {
|
|
218
218
|
const E = /* @__PURE__ */ new Set();
|
|
219
219
|
for (const v of w)
|
|
220
220
|
(typeof v == "string" || typeof v == "number") && E.add(String(v));
|
|
@@ -227,8 +227,8 @@ var Nt = { exports: {} };
|
|
|
227
227
|
throw new TypeError('The "strict" argument must be of type boolean');
|
|
228
228
|
if (E)
|
|
229
229
|
return (v) => {
|
|
230
|
-
let
|
|
231
|
-
throw typeof v != "function" && (
|
|
230
|
+
let M = `Object can not safely be stringified. Received type ${typeof v}`;
|
|
231
|
+
throw typeof v != "function" && (M += ` (${v.toString()})`), new Error(M);
|
|
232
232
|
};
|
|
233
233
|
}
|
|
234
234
|
}
|
|
@@ -236,8 +236,8 @@ var Nt = { exports: {} };
|
|
|
236
236
|
w = { ...w };
|
|
237
237
|
const E = q(w);
|
|
238
238
|
E && (w.bigint === void 0 && (w.bigint = !1), "circularValue" in w || (w.circularValue = Error));
|
|
239
|
-
const v = y(w),
|
|
240
|
-
function ut(X, m, S, T,
|
|
239
|
+
const v = y(w), M = b(w, "bigint"), J = b(w, "deterministic"), W = F(w, "maximumDepth"), R = F(w, "maximumBreadth");
|
|
240
|
+
function ut(X, m, S, T, B, U) {
|
|
241
241
|
let A = m[X];
|
|
242
242
|
switch (typeof A == "object" && A !== null && typeof A.toJSON == "function" && (A = A.toJSON(X)), A = T.call(m, X, A), typeof A) {
|
|
243
243
|
case "string":
|
|
@@ -247,51 +247,51 @@ var Nt = { exports: {} };
|
|
|
247
247
|
return "null";
|
|
248
248
|
if (S.indexOf(A) !== -1)
|
|
249
249
|
return v;
|
|
250
|
-
let k = "",
|
|
251
|
-
const I =
|
|
250
|
+
let k = "", O = ",";
|
|
251
|
+
const I = U;
|
|
252
252
|
if (Array.isArray(A)) {
|
|
253
253
|
if (A.length === 0)
|
|
254
254
|
return "[]";
|
|
255
255
|
if (W < S.length + 1)
|
|
256
256
|
return '"[Array]"';
|
|
257
|
-
S.push(A),
|
|
258
|
-
${
|
|
259
|
-
${
|
|
260
|
-
const V = Math.min(A.length,
|
|
257
|
+
S.push(A), B !== "" && (U += B, k += `
|
|
258
|
+
${U}`, O = `,
|
|
259
|
+
${U}`);
|
|
260
|
+
const V = Math.min(A.length, R);
|
|
261
261
|
let Q = 0;
|
|
262
262
|
for (; Q < V - 1; Q++) {
|
|
263
|
-
const ct = ut(String(Q), A, S, T,
|
|
264
|
-
k += ct !== void 0 ? ct : "null", k +=
|
|
263
|
+
const ct = ut(String(Q), A, S, T, B, U);
|
|
264
|
+
k += ct !== void 0 ? ct : "null", k += O;
|
|
265
265
|
}
|
|
266
|
-
const tt = ut(String(Q), A, S, T,
|
|
267
|
-
if (k += tt !== void 0 ? tt : "null", A.length - 1 >
|
|
268
|
-
const ct = A.length -
|
|
269
|
-
k += `${
|
|
266
|
+
const tt = ut(String(Q), A, S, T, B, U);
|
|
267
|
+
if (k += tt !== void 0 ? tt : "null", A.length - 1 > R) {
|
|
268
|
+
const ct = A.length - R - 1;
|
|
269
|
+
k += `${O}"... ${j(ct)} not stringified"`;
|
|
270
270
|
}
|
|
271
|
-
return
|
|
271
|
+
return B !== "" && (k += `
|
|
272
272
|
${I}`), S.pop(), `[${k}]`;
|
|
273
273
|
}
|
|
274
274
|
let L = Object.keys(A);
|
|
275
|
-
const
|
|
276
|
-
if (
|
|
275
|
+
const H = L.length;
|
|
276
|
+
if (H === 0)
|
|
277
277
|
return "{}";
|
|
278
278
|
if (W < S.length + 1)
|
|
279
279
|
return '"[Object]"';
|
|
280
|
-
let
|
|
281
|
-
|
|
282
|
-
${
|
|
283
|
-
const Y = Math.min(
|
|
284
|
-
|
|
280
|
+
let $ = "", K = "";
|
|
281
|
+
B !== "" && (U += B, O = `,
|
|
282
|
+
${U}`, $ = " ");
|
|
283
|
+
const Y = Math.min(H, R);
|
|
284
|
+
J && !h(A) && (L = c(L)), S.push(A);
|
|
285
285
|
for (let V = 0; V < Y; V++) {
|
|
286
|
-
const Q = L[V], tt = ut(Q, A, S, T,
|
|
287
|
-
tt !== void 0 && (k += `${K}${f(Q)}:${
|
|
286
|
+
const Q = L[V], tt = ut(Q, A, S, T, B, U);
|
|
287
|
+
tt !== void 0 && (k += `${K}${f(Q)}:${$}${tt}`, K = O);
|
|
288
288
|
}
|
|
289
|
-
if (
|
|
290
|
-
const V =
|
|
291
|
-
k += `${K}"...":${
|
|
289
|
+
if (H > R) {
|
|
290
|
+
const V = H - R;
|
|
291
|
+
k += `${K}"...":${$}"${j(V)} not stringified"`, K = O;
|
|
292
292
|
}
|
|
293
|
-
return
|
|
294
|
-
${
|
|
293
|
+
return B !== "" && K.length > 1 && (k = `
|
|
294
|
+
${U}${k}
|
|
295
295
|
${I}`), S.pop(), `{${k}}`;
|
|
296
296
|
}
|
|
297
297
|
case "number":
|
|
@@ -301,13 +301,13 @@ ${I}`), S.pop(), `{${k}}`;
|
|
|
301
301
|
case "undefined":
|
|
302
302
|
return;
|
|
303
303
|
case "bigint":
|
|
304
|
-
if (
|
|
304
|
+
if (M)
|
|
305
305
|
return String(A);
|
|
306
306
|
default:
|
|
307
307
|
return E ? E(A) : void 0;
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
|
-
function ft(X, m, S, T,
|
|
310
|
+
function ft(X, m, S, T, B, U) {
|
|
311
311
|
switch (typeof m == "object" && m !== null && typeof m.toJSON == "function" && (m = m.toJSON(X)), typeof m) {
|
|
312
312
|
case "string":
|
|
313
313
|
return f(m);
|
|
@@ -316,41 +316,41 @@ ${I}`), S.pop(), `{${k}}`;
|
|
|
316
316
|
return "null";
|
|
317
317
|
if (S.indexOf(m) !== -1)
|
|
318
318
|
return v;
|
|
319
|
-
const A =
|
|
320
|
-
let k = "",
|
|
319
|
+
const A = U;
|
|
320
|
+
let k = "", O = ",";
|
|
321
321
|
if (Array.isArray(m)) {
|
|
322
322
|
if (m.length === 0)
|
|
323
323
|
return "[]";
|
|
324
324
|
if (W < S.length + 1)
|
|
325
325
|
return '"[Array]"';
|
|
326
|
-
S.push(m),
|
|
327
|
-
${
|
|
328
|
-
${
|
|
329
|
-
const
|
|
330
|
-
let
|
|
331
|
-
for (;
|
|
332
|
-
const Y = ft(String(
|
|
333
|
-
k += Y !== void 0 ? Y : "null", k +=
|
|
326
|
+
S.push(m), B !== "" && (U += B, k += `
|
|
327
|
+
${U}`, O = `,
|
|
328
|
+
${U}`);
|
|
329
|
+
const H = Math.min(m.length, R);
|
|
330
|
+
let $ = 0;
|
|
331
|
+
for (; $ < H - 1; $++) {
|
|
332
|
+
const Y = ft(String($), m[$], S, T, B, U);
|
|
333
|
+
k += Y !== void 0 ? Y : "null", k += O;
|
|
334
334
|
}
|
|
335
|
-
const K = ft(String(
|
|
336
|
-
if (k += K !== void 0 ? K : "null", m.length - 1 >
|
|
337
|
-
const Y = m.length -
|
|
338
|
-
k += `${
|
|
335
|
+
const K = ft(String($), m[$], S, T, B, U);
|
|
336
|
+
if (k += K !== void 0 ? K : "null", m.length - 1 > R) {
|
|
337
|
+
const Y = m.length - R - 1;
|
|
338
|
+
k += `${O}"... ${j(Y)} not stringified"`;
|
|
339
339
|
}
|
|
340
|
-
return
|
|
340
|
+
return B !== "" && (k += `
|
|
341
341
|
${A}`), S.pop(), `[${k}]`;
|
|
342
342
|
}
|
|
343
343
|
S.push(m);
|
|
344
344
|
let I = "";
|
|
345
|
-
|
|
346
|
-
${
|
|
345
|
+
B !== "" && (U += B, O = `,
|
|
346
|
+
${U}`, I = " ");
|
|
347
347
|
let L = "";
|
|
348
|
-
for (const
|
|
349
|
-
const
|
|
350
|
-
|
|
348
|
+
for (const H of T) {
|
|
349
|
+
const $ = ft(H, m[H], S, T, B, U);
|
|
350
|
+
$ !== void 0 && (k += `${L}${f(H)}:${I}${$}`, L = O);
|
|
351
351
|
}
|
|
352
|
-
return
|
|
353
|
-
${
|
|
352
|
+
return B !== "" && L.length > 1 && (k = `
|
|
353
|
+
${U}${k}
|
|
354
354
|
${A}`), S.pop(), `{${k}}`;
|
|
355
355
|
}
|
|
356
356
|
case "number":
|
|
@@ -360,13 +360,13 @@ ${A}`), S.pop(), `{${k}}`;
|
|
|
360
360
|
case "undefined":
|
|
361
361
|
return;
|
|
362
362
|
case "bigint":
|
|
363
|
-
if (
|
|
363
|
+
if (M)
|
|
364
364
|
return String(m);
|
|
365
365
|
default:
|
|
366
366
|
return E ? E(m) : void 0;
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
|
-
function st(X, m, S, T,
|
|
369
|
+
function st(X, m, S, T, B) {
|
|
370
370
|
switch (typeof m) {
|
|
371
371
|
case "string":
|
|
372
372
|
return f(m);
|
|
@@ -375,35 +375,35 @@ ${A}`), S.pop(), `{${k}}`;
|
|
|
375
375
|
return "null";
|
|
376
376
|
if (typeof m.toJSON == "function") {
|
|
377
377
|
if (m = m.toJSON(X), typeof m != "object")
|
|
378
|
-
return st(X, m, S, T,
|
|
378
|
+
return st(X, m, S, T, B);
|
|
379
379
|
if (m === null)
|
|
380
380
|
return "null";
|
|
381
381
|
}
|
|
382
382
|
if (S.indexOf(m) !== -1)
|
|
383
383
|
return v;
|
|
384
|
-
const
|
|
384
|
+
const U = B;
|
|
385
385
|
if (Array.isArray(m)) {
|
|
386
386
|
if (m.length === 0)
|
|
387
387
|
return "[]";
|
|
388
388
|
if (W < S.length + 1)
|
|
389
389
|
return '"[Array]"';
|
|
390
|
-
S.push(m),
|
|
391
|
-
let
|
|
392
|
-
${
|
|
390
|
+
S.push(m), B += T;
|
|
391
|
+
let $ = `
|
|
392
|
+
${B}`;
|
|
393
393
|
const K = `,
|
|
394
|
-
${
|
|
394
|
+
${B}`, Y = Math.min(m.length, R);
|
|
395
395
|
let V = 0;
|
|
396
396
|
for (; V < Y - 1; V++) {
|
|
397
|
-
const tt = st(String(V), m[V], S, T,
|
|
398
|
-
|
|
397
|
+
const tt = st(String(V), m[V], S, T, B);
|
|
398
|
+
$ += tt !== void 0 ? tt : "null", $ += K;
|
|
399
399
|
}
|
|
400
|
-
const Q = st(String(V), m[V], S, T,
|
|
401
|
-
if (
|
|
402
|
-
const tt = m.length -
|
|
403
|
-
|
|
400
|
+
const Q = st(String(V), m[V], S, T, B);
|
|
401
|
+
if ($ += Q !== void 0 ? Q : "null", m.length - 1 > R) {
|
|
402
|
+
const tt = m.length - R - 1;
|
|
403
|
+
$ += `${K}"... ${j(tt)} not stringified"`;
|
|
404
404
|
}
|
|
405
|
-
return
|
|
406
|
-
${
|
|
405
|
+
return $ += `
|
|
406
|
+
${U}`, S.pop(), `[${$}]`;
|
|
407
407
|
}
|
|
408
408
|
let A = Object.keys(m);
|
|
409
409
|
const k = A.length;
|
|
@@ -411,22 +411,22 @@ ${C}`, S.pop(), `[${U}]`;
|
|
|
411
411
|
return "{}";
|
|
412
412
|
if (W < S.length + 1)
|
|
413
413
|
return '"[Object]"';
|
|
414
|
-
|
|
415
|
-
const
|
|
416
|
-
${
|
|
417
|
-
let I = "", L = "",
|
|
418
|
-
h(m) && (I += g(m,
|
|
419
|
-
for (let
|
|
420
|
-
const K = A[
|
|
421
|
-
Y !== void 0 && (I += `${L}${f(K)}: ${Y}`, L =
|
|
414
|
+
B += T;
|
|
415
|
+
const O = `,
|
|
416
|
+
${B}`;
|
|
417
|
+
let I = "", L = "", H = Math.min(k, R);
|
|
418
|
+
h(m) && (I += g(m, O, R), A = A.slice(m.length), H -= m.length, L = O), J && (A = c(A)), S.push(m);
|
|
419
|
+
for (let $ = 0; $ < H; $++) {
|
|
420
|
+
const K = A[$], Y = st(K, m[K], S, T, B);
|
|
421
|
+
Y !== void 0 && (I += `${L}${f(K)}: ${Y}`, L = O);
|
|
422
422
|
}
|
|
423
|
-
if (k >
|
|
424
|
-
const
|
|
425
|
-
I += `${L}"...": "${j(
|
|
423
|
+
if (k > R) {
|
|
424
|
+
const $ = k - R;
|
|
425
|
+
I += `${L}"...": "${j($)} not stringified"`, L = O;
|
|
426
426
|
}
|
|
427
427
|
return L !== "" && (I = `
|
|
428
|
-
${
|
|
429
|
-
${
|
|
428
|
+
${B}${I}
|
|
429
|
+
${U}`), S.pop(), `{${I}}`;
|
|
430
430
|
}
|
|
431
431
|
case "number":
|
|
432
432
|
return isFinite(m) ? String(m) : E ? E(m) : "null";
|
|
@@ -435,7 +435,7 @@ ${C}`), S.pop(), `{${I}}`;
|
|
|
435
435
|
case "undefined":
|
|
436
436
|
return;
|
|
437
437
|
case "bigint":
|
|
438
|
-
if (
|
|
438
|
+
if (M)
|
|
439
439
|
return String(m);
|
|
440
440
|
default:
|
|
441
441
|
return E ? E(m) : void 0;
|
|
@@ -463,34 +463,34 @@ ${C}`), S.pop(), `{${I}}`;
|
|
|
463
463
|
if (W < S.length + 1)
|
|
464
464
|
return '"[Array]"';
|
|
465
465
|
S.push(m);
|
|
466
|
-
const
|
|
466
|
+
const O = Math.min(m.length, R);
|
|
467
467
|
let I = 0;
|
|
468
|
-
for (; I <
|
|
469
|
-
const
|
|
470
|
-
T +=
|
|
468
|
+
for (; I < O - 1; I++) {
|
|
469
|
+
const H = pt(String(I), m[I], S);
|
|
470
|
+
T += H !== void 0 ? H : "null", T += ",";
|
|
471
471
|
}
|
|
472
472
|
const L = pt(String(I), m[I], S);
|
|
473
|
-
if (T += L !== void 0 ? L : "null", m.length - 1 >
|
|
474
|
-
const
|
|
475
|
-
T += `,"... ${j(
|
|
473
|
+
if (T += L !== void 0 ? L : "null", m.length - 1 > R) {
|
|
474
|
+
const H = m.length - R - 1;
|
|
475
|
+
T += `,"... ${j(H)} not stringified"`;
|
|
476
476
|
}
|
|
477
477
|
return S.pop(), `[${T}]`;
|
|
478
478
|
}
|
|
479
|
-
let
|
|
480
|
-
const
|
|
481
|
-
if (
|
|
479
|
+
let B = Object.keys(m);
|
|
480
|
+
const U = B.length;
|
|
481
|
+
if (U === 0)
|
|
482
482
|
return "{}";
|
|
483
483
|
if (W < S.length + 1)
|
|
484
484
|
return '"[Object]"';
|
|
485
|
-
let A = "", k = Math.min(
|
|
486
|
-
h(m) && (T += g(m, ",",
|
|
487
|
-
for (let
|
|
488
|
-
const I = O
|
|
485
|
+
let A = "", k = Math.min(U, R);
|
|
486
|
+
h(m) && (T += g(m, ",", R), B = B.slice(m.length), k -= m.length, A = ","), J && (B = c(B)), S.push(m);
|
|
487
|
+
for (let O = 0; O < k; O++) {
|
|
488
|
+
const I = B[O], L = pt(I, m[I], S);
|
|
489
489
|
L !== void 0 && (T += `${A}${f(I)}:${L}`, A = ",");
|
|
490
490
|
}
|
|
491
|
-
if (
|
|
492
|
-
const
|
|
493
|
-
T += `${A}"...":"${j(
|
|
491
|
+
if (U > R) {
|
|
492
|
+
const O = U - R;
|
|
493
|
+
T += `${A}"...":"${j(O)} not stringified"`;
|
|
494
494
|
}
|
|
495
495
|
return S.pop(), `{${T}}`;
|
|
496
496
|
}
|
|
@@ -501,7 +501,7 @@ ${C}`), S.pop(), `{${I}}`;
|
|
|
501
501
|
case "undefined":
|
|
502
502
|
return;
|
|
503
503
|
case "bigint":
|
|
504
|
-
if (
|
|
504
|
+
if (M)
|
|
505
505
|
return String(m);
|
|
506
506
|
default:
|
|
507
507
|
return E ? E(m) : void 0;
|
|
@@ -514,7 +514,7 @@ ${C}`), S.pop(), `{${I}}`;
|
|
|
514
514
|
if (typeof m == "function")
|
|
515
515
|
return ut("", { "": X }, [], m, T, "");
|
|
516
516
|
if (Array.isArray(m))
|
|
517
|
-
return ft("", X, [],
|
|
517
|
+
return ft("", X, [], C(m), T, "");
|
|
518
518
|
}
|
|
519
519
|
if (T.length !== 0)
|
|
520
520
|
return st("", X, [], T, "");
|
|
@@ -524,15 +524,15 @@ ${C}`), S.pop(), `{${I}}`;
|
|
|
524
524
|
return Dt;
|
|
525
525
|
}
|
|
526
526
|
})(Nt, Nt.exports);
|
|
527
|
-
var
|
|
528
|
-
const xt = /* @__PURE__ */ Xt(
|
|
527
|
+
var ri = Nt.exports;
|
|
528
|
+
const xt = /* @__PURE__ */ Xt(ri);
|
|
529
529
|
xt.configure;
|
|
530
|
-
function
|
|
530
|
+
function ni(i, r) {
|
|
531
531
|
return { ...i, name: r };
|
|
532
532
|
}
|
|
533
|
-
function
|
|
533
|
+
function oi(i, r, o) {
|
|
534
534
|
const { scope: p, input: u } = r;
|
|
535
|
-
return
|
|
535
|
+
return Bt({
|
|
536
536
|
document: i,
|
|
537
537
|
action: r,
|
|
538
538
|
skip: o
|
|
@@ -569,12 +569,12 @@ function ni(i, r, o) {
|
|
|
569
569
|
}
|
|
570
570
|
F.type === "NOOP" && F.skip > 0 ? (b = b - (F.skip + 1), c.skip += F.skip + 1) : (c.document.clipboard.push({ ...F }), y--, b--);
|
|
571
571
|
}
|
|
572
|
-
c.action =
|
|
572
|
+
c.action = We(p);
|
|
573
573
|
});
|
|
574
574
|
}
|
|
575
|
-
function
|
|
575
|
+
function ai(i, r, o) {
|
|
576
576
|
const { scope: p, input: u } = r;
|
|
577
|
-
return
|
|
577
|
+
return Bt({
|
|
578
578
|
document: i,
|
|
579
579
|
action: r,
|
|
580
580
|
skip: o
|
|
@@ -599,14 +599,14 @@ function oi(i, r, o) {
|
|
|
599
599
|
`Cannot redo: no operations in clipboard for scope "${p}"`
|
|
600
600
|
);
|
|
601
601
|
const h = c.document.clipboard.splice(s, 1)[0];
|
|
602
|
-
c.action =
|
|
602
|
+
c.action = Ot({
|
|
603
603
|
type: h.type,
|
|
604
604
|
scope: h.scope,
|
|
605
605
|
input: h.input
|
|
606
606
|
});
|
|
607
607
|
});
|
|
608
608
|
}
|
|
609
|
-
function
|
|
609
|
+
function si(i, r, o) {
|
|
610
610
|
const { scope: p } = r, u = i.operations[p];
|
|
611
611
|
let {
|
|
612
612
|
input: { start: f, end: c }
|
|
@@ -619,7 +619,7 @@ function ai(i, r, o) {
|
|
|
619
619
|
[p]: h.concat(s)
|
|
620
620
|
},
|
|
621
621
|
o
|
|
622
|
-
), { name: b, state: F } = y, j = h.length,
|
|
622
|
+
), { name: b, state: F } = y, j = h.length, C = h.length ? h[h.length - 1].timestamp : g.length ? g[0].timestamp : (/* @__PURE__ */ new Date()).toISOString();
|
|
623
623
|
return Pt(
|
|
624
624
|
i.initialState,
|
|
625
625
|
{
|
|
@@ -631,7 +631,7 @@ function ai(i, r, o) {
|
|
|
631
631
|
{ name: b, state: F },
|
|
632
632
|
s.length
|
|
633
633
|
),
|
|
634
|
-
timestamp:
|
|
634
|
+
timestamp: C,
|
|
635
635
|
index: j,
|
|
636
636
|
hash: Qt({ state: F }, "global")
|
|
637
637
|
},
|
|
@@ -644,14 +644,14 @@ function ai(i, r, o) {
|
|
|
644
644
|
o
|
|
645
645
|
);
|
|
646
646
|
}
|
|
647
|
-
function
|
|
647
|
+
function pi(i, r) {
|
|
648
648
|
return {
|
|
649
649
|
...i,
|
|
650
650
|
name: r.name,
|
|
651
651
|
state: r.state ?? { global: {}, local: {} }
|
|
652
652
|
};
|
|
653
653
|
}
|
|
654
|
-
const we = "SET_NAME", wt = "UNDO", Et = "REDO", It = "PRUNE", Ee = "LOAD_STATE", pi = "NOOP", be = { "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"] };
|
|
654
|
+
const we = "SET_NAME", wt = "UNDO", Et = "REDO", It = "PRUNE", Ee = "LOAD_STATE", ci = "NOOP", be = { "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"] };
|
|
655
655
|
Object.freeze(be);
|
|
656
656
|
var et = function(i, r, o, p) {
|
|
657
657
|
if (o === "a" && !p)
|
|
@@ -660,7 +660,7 @@ var et = function(i, r, o, p) {
|
|
|
660
660
|
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
661
661
|
return o === "m" ? p : o === "a" ? p.call(i) : p ? p.value : r.get(i);
|
|
662
662
|
}, mt, gt, lt;
|
|
663
|
-
class
|
|
663
|
+
class li {
|
|
664
664
|
constructor(...r) {
|
|
665
665
|
mt.set(this, /* @__PURE__ */ new Map()), gt.set(this, /* @__PURE__ */ new Map()), lt.set(this, /* @__PURE__ */ new Map());
|
|
666
666
|
for (const o of r)
|
|
@@ -712,7 +712,7 @@ class ci {
|
|
|
712
712
|
}
|
|
713
713
|
}
|
|
714
714
|
mt = /* @__PURE__ */ new WeakMap(), gt = /* @__PURE__ */ new WeakMap(), lt = /* @__PURE__ */ new WeakMap();
|
|
715
|
-
const
|
|
715
|
+
const ui = new li(be)._freeze();
|
|
716
716
|
var Mt = { exports: {} };
|
|
717
717
|
typeof Object.create == "function" ? Mt.exports = function(r, o) {
|
|
718
718
|
o && (r.super_ = o, r.prototype = Object.create(o.prototype, {
|
|
@@ -732,11 +732,11 @@ typeof Object.create == "function" ? Mt.exports = function(r, o) {
|
|
|
732
732
|
}
|
|
733
733
|
};
|
|
734
734
|
var ve = Mt.exports, Rt = { exports: {} }, Se = {}, jt = {};
|
|
735
|
-
jt.byteLength =
|
|
736
|
-
jt.toByteArray =
|
|
737
|
-
jt.fromByteArray =
|
|
738
|
-
var nt = [], it = [],
|
|
739
|
-
for (var ht = 0,
|
|
735
|
+
jt.byteLength = mi;
|
|
736
|
+
jt.toByteArray = di;
|
|
737
|
+
jt.fromByteArray = wi;
|
|
738
|
+
var nt = [], it = [], fi = typeof Uint8Array < "u" ? Uint8Array : Array, Ut = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
739
|
+
for (var ht = 0, hi = Ut.length; ht < hi; ++ht)
|
|
740
740
|
nt[ht] = Ut[ht], it[Ut.charCodeAt(ht)] = ht;
|
|
741
741
|
it[45] = 62;
|
|
742
742
|
it[95] = 63;
|
|
@@ -749,30 +749,30 @@ function _e(i) {
|
|
|
749
749
|
var p = o === r ? 0 : 4 - o % 4;
|
|
750
750
|
return [o, p];
|
|
751
751
|
}
|
|
752
|
-
function
|
|
752
|
+
function mi(i) {
|
|
753
753
|
var r = _e(i), o = r[0], p = r[1];
|
|
754
754
|
return (o + p) * 3 / 4 - p;
|
|
755
755
|
}
|
|
756
|
-
function
|
|
756
|
+
function xi(i, r, o) {
|
|
757
757
|
return (r + o) * 3 / 4 - o;
|
|
758
758
|
}
|
|
759
|
-
function
|
|
760
|
-
var r, o = _e(i), p = o[0], u = o[1], f = new
|
|
759
|
+
function di(i) {
|
|
760
|
+
var r, o = _e(i), p = o[0], u = o[1], f = new fi(xi(i, p, u)), c = 0, s = u > 0 ? p - 4 : p, h;
|
|
761
761
|
for (h = 0; h < s; h += 4)
|
|
762
762
|
r = it[i.charCodeAt(h)] << 18 | it[i.charCodeAt(h + 1)] << 12 | it[i.charCodeAt(h + 2)] << 6 | it[i.charCodeAt(h + 3)], f[c++] = r >> 16 & 255, f[c++] = r >> 8 & 255, f[c++] = r & 255;
|
|
763
763
|
return u === 2 && (r = it[i.charCodeAt(h)] << 2 | it[i.charCodeAt(h + 1)] >> 4, f[c++] = r & 255), u === 1 && (r = it[i.charCodeAt(h)] << 10 | it[i.charCodeAt(h + 1)] << 4 | it[i.charCodeAt(h + 2)] >> 2, f[c++] = r >> 8 & 255, f[c++] = r & 255), f;
|
|
764
764
|
}
|
|
765
|
-
function
|
|
765
|
+
function gi(i) {
|
|
766
766
|
return nt[i >> 18 & 63] + nt[i >> 12 & 63] + nt[i >> 6 & 63] + nt[i & 63];
|
|
767
767
|
}
|
|
768
|
-
function
|
|
768
|
+
function yi(i, r, o) {
|
|
769
769
|
for (var p, u = [], f = r; f < o; f += 3)
|
|
770
|
-
p = (i[f] << 16 & 16711680) + (i[f + 1] << 8 & 65280) + (i[f + 2] & 255), u.push(
|
|
770
|
+
p = (i[f] << 16 & 16711680) + (i[f + 1] << 8 & 65280) + (i[f + 2] & 255), u.push(gi(p));
|
|
771
771
|
return u.join("");
|
|
772
772
|
}
|
|
773
|
-
function
|
|
773
|
+
function wi(i) {
|
|
774
774
|
for (var r, o = i.length, p = o % 3, u = [], f = 16383, c = 0, s = o - p; c < s; c += f)
|
|
775
|
-
u.push(
|
|
775
|
+
u.push(yi(i, c, c + f > s ? s : c + f));
|
|
776
776
|
return p === 1 ? (r = i[o - 1], u.push(
|
|
777
777
|
nt[r >> 2] + nt[r << 4 & 63] + "=="
|
|
778
778
|
)) : p === 2 && (r = (i[o - 2] << 8) + i[o - 1], u.push(
|
|
@@ -797,12 +797,12 @@ Vt.read = function(i, r, o, p, u) {
|
|
|
797
797
|
return (j ? -1 : 1) * c * Math.pow(2, f - p);
|
|
798
798
|
};
|
|
799
799
|
Vt.write = function(i, r, o, p, u, f) {
|
|
800
|
-
var c, s, h, g = f * 8 - u - 1, y = (1 << g) - 1, b = y >> 1, F = u === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, j = p ? 0 : f - 1,
|
|
801
|
-
for (r = Math.abs(r), isNaN(r) || r === 1 / 0 ? (s = isNaN(r) ? 1 : 0, c = y) : (c = Math.floor(Math.log(r) / Math.LN2), r * (h = Math.pow(2, -c)) < 1 && (c--, h *= 2), c + b >= 1 ? r += F / h : r += F * Math.pow(2, 1 - b), r * h >= 2 && (c++, h /= 2), c + b >= y ? (s = 0, c = y) : c + b >= 1 ? (s = (r * h - 1) * Math.pow(2, u), c = c + b) : (s = r * Math.pow(2, b - 1) * Math.pow(2, u), c = 0)); u >= 8; i[o + j] = s & 255, j +=
|
|
800
|
+
var c, s, h, g = f * 8 - u - 1, y = (1 << g) - 1, b = y >> 1, F = u === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, j = p ? 0 : f - 1, C = p ? 1 : -1, q = r < 0 || r === 0 && 1 / r < 0 ? 1 : 0;
|
|
801
|
+
for (r = Math.abs(r), isNaN(r) || r === 1 / 0 ? (s = isNaN(r) ? 1 : 0, c = y) : (c = Math.floor(Math.log(r) / Math.LN2), r * (h = Math.pow(2, -c)) < 1 && (c--, h *= 2), c + b >= 1 ? r += F / h : r += F * Math.pow(2, 1 - b), r * h >= 2 && (c++, h /= 2), c + b >= y ? (s = 0, c = y) : c + b >= 1 ? (s = (r * h - 1) * Math.pow(2, u), c = c + b) : (s = r * Math.pow(2, b - 1) * Math.pow(2, u), c = 0)); u >= 8; i[o + j] = s & 255, j += C, s /= 256, u -= 8)
|
|
802
802
|
;
|
|
803
|
-
for (c = c << u | s, g += u; g > 0; i[o + j] = c & 255, j +=
|
|
803
|
+
for (c = c << u | s, g += u; g > 0; i[o + j] = c & 255, j += C, c /= 256, g -= 8)
|
|
804
804
|
;
|
|
805
|
-
i[o + j -
|
|
805
|
+
i[o + j - C] |= q * 128;
|
|
806
806
|
};
|
|
807
807
|
/*!
|
|
808
808
|
* The buffer module from node.js, for the browser.
|
|
@@ -861,7 +861,7 @@ Vt.write = function(i, r, o, p, u, f) {
|
|
|
861
861
|
if (typeof n == "string")
|
|
862
862
|
return F(n, t);
|
|
863
863
|
if (ArrayBuffer.isView(n))
|
|
864
|
-
return
|
|
864
|
+
return C(n);
|
|
865
865
|
if (n == null)
|
|
866
866
|
throw new TypeError(
|
|
867
867
|
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof n
|
|
@@ -922,7 +922,7 @@ Vt.write = function(i, r, o, p, u, f) {
|
|
|
922
922
|
e[a] = n[a] & 255;
|
|
923
923
|
return e;
|
|
924
924
|
}
|
|
925
|
-
function
|
|
925
|
+
function C(n) {
|
|
926
926
|
if (rt(n, Uint8Array)) {
|
|
927
927
|
var t = new Uint8Array(n);
|
|
928
928
|
return q(t.buffer, t.byteOffset, t.byteLength);
|
|
@@ -1050,7 +1050,7 @@ Vt.write = function(i, r, o, p, u, f) {
|
|
|
1050
1050
|
}
|
|
1051
1051
|
}
|
|
1052
1052
|
s.byteLength = v;
|
|
1053
|
-
function
|
|
1053
|
+
function M(n, t, e) {
|
|
1054
1054
|
var a = !1;
|
|
1055
1055
|
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))
|
|
1056
1056
|
return "";
|
|
@@ -1062,10 +1062,10 @@ Vt.write = function(i, r, o, p, u, f) {
|
|
|
1062
1062
|
case "utf-8":
|
|
1063
1063
|
return m(this, t, e);
|
|
1064
1064
|
case "ascii":
|
|
1065
|
-
return
|
|
1065
|
+
return B(this, t, e);
|
|
1066
1066
|
case "latin1":
|
|
1067
1067
|
case "binary":
|
|
1068
|
-
return
|
|
1068
|
+
return U(this, t, e);
|
|
1069
1069
|
case "base64":
|
|
1070
1070
|
return X(this, t, e);
|
|
1071
1071
|
case "ucs2":
|
|
@@ -1080,7 +1080,7 @@ Vt.write = function(i, r, o, p, u, f) {
|
|
|
1080
1080
|
}
|
|
1081
1081
|
}
|
|
1082
1082
|
s.prototype._isBuffer = !0;
|
|
1083
|
-
function
|
|
1083
|
+
function J(n, t, e) {
|
|
1084
1084
|
var a = n[t];
|
|
1085
1085
|
n[t] = n[e], n[e] = a;
|
|
1086
1086
|
}
|
|
@@ -1089,25 +1089,25 @@ Vt.write = function(i, r, o, p, u, f) {
|
|
|
1089
1089
|
if (t % 2 !== 0)
|
|
1090
1090
|
throw new RangeError("Buffer size must be a multiple of 16-bits");
|
|
1091
1091
|
for (var e = 0; e < t; e += 2)
|
|
1092
|
-
|
|
1092
|
+
J(this, e, e + 1);
|
|
1093
1093
|
return this;
|
|
1094
1094
|
}, s.prototype.swap32 = function() {
|
|
1095
1095
|
var t = this.length;
|
|
1096
1096
|
if (t % 4 !== 0)
|
|
1097
1097
|
throw new RangeError("Buffer size must be a multiple of 32-bits");
|
|
1098
1098
|
for (var e = 0; e < t; e += 4)
|
|
1099
|
-
|
|
1099
|
+
J(this, e, e + 3), J(this, e + 1, e + 2);
|
|
1100
1100
|
return this;
|
|
1101
1101
|
}, s.prototype.swap64 = function() {
|
|
1102
1102
|
var t = this.length;
|
|
1103
1103
|
if (t % 8 !== 0)
|
|
1104
1104
|
throw new RangeError("Buffer size must be a multiple of 64-bits");
|
|
1105
1105
|
for (var e = 0; e < t; e += 8)
|
|
1106
|
-
|
|
1106
|
+
J(this, e, e + 7), J(this, e + 1, e + 6), J(this, e + 2, e + 5), J(this, e + 3, e + 4);
|
|
1107
1107
|
return this;
|
|
1108
1108
|
}, s.prototype.toString = function() {
|
|
1109
1109
|
var t = this.length;
|
|
1110
|
-
return t === 0 ? "" : arguments.length === 0 ? m(this, 0, t) :
|
|
1110
|
+
return t === 0 ? "" : arguments.length === 0 ? m(this, 0, t) : M.apply(this, arguments);
|
|
1111
1111
|
}, s.prototype.toLocaleString = s.prototype.toString, s.prototype.equals = function(t) {
|
|
1112
1112
|
if (!s.isBuffer(t))
|
|
1113
1113
|
throw new TypeError("Argument must be a Buffer");
|
|
@@ -1150,12 +1150,12 @@ Vt.write = function(i, r, o, p, u, f) {
|
|
|
1150
1150
|
else
|
|
1151
1151
|
return -1;
|
|
1152
1152
|
if (typeof t == "string" && (t = s.from(t, a)), s.isBuffer(t))
|
|
1153
|
-
return t.length === 0 ? -1 :
|
|
1153
|
+
return t.length === 0 ? -1 : R(n, t, e, a, l);
|
|
1154
1154
|
if (typeof t == "number")
|
|
1155
|
-
return t = t & 255, typeof Uint8Array.prototype.indexOf == "function" ? l ? Uint8Array.prototype.indexOf.call(n, t, e) : Uint8Array.prototype.lastIndexOf.call(n, t, e) :
|
|
1155
|
+
return t = t & 255, typeof Uint8Array.prototype.indexOf == "function" ? l ? Uint8Array.prototype.indexOf.call(n, t, e) : Uint8Array.prototype.lastIndexOf.call(n, t, e) : R(n, [t], e, a, l);
|
|
1156
1156
|
throw new TypeError("val must be string, number or Buffer");
|
|
1157
1157
|
}
|
|
1158
|
-
function
|
|
1158
|
+
function R(n, t, e, a, l) {
|
|
1159
1159
|
var x = 1, d = n.length, D = t.length;
|
|
1160
1160
|
if (a !== void 0 && (a = String(a).toLowerCase(), a === "ucs2" || a === "ucs-2" || a === "utf16le" || a === "utf-16le")) {
|
|
1161
1161
|
if (n.length < 2 || t.length < 2)
|
|
@@ -1302,14 +1302,14 @@ Vt.write = function(i, r, o, p, u, f) {
|
|
|
1302
1302
|
);
|
|
1303
1303
|
return e;
|
|
1304
1304
|
}
|
|
1305
|
-
function
|
|
1305
|
+
function B(n, t, e) {
|
|
1306
1306
|
var a = "";
|
|
1307
1307
|
e = Math.min(n.length, e);
|
|
1308
1308
|
for (var l = t; l < e; ++l)
|
|
1309
1309
|
a += String.fromCharCode(n[l] & 127);
|
|
1310
1310
|
return a;
|
|
1311
1311
|
}
|
|
1312
|
-
function
|
|
1312
|
+
function U(n, t, e) {
|
|
1313
1313
|
var a = "";
|
|
1314
1314
|
e = Math.min(n.length, e);
|
|
1315
1315
|
for (var l = t; l < e; ++l)
|
|
@@ -1320,7 +1320,7 @@ Vt.write = function(i, r, o, p, u, f) {
|
|
|
1320
1320
|
var a = n.length;
|
|
1321
1321
|
(!t || t < 0) && (t = 0), (!e || e < 0 || e > a) && (e = a);
|
|
1322
1322
|
for (var l = "", x = t; x < e; ++x)
|
|
1323
|
-
l +=
|
|
1323
|
+
l += Xe[n[x]];
|
|
1324
1324
|
return l;
|
|
1325
1325
|
}
|
|
1326
1326
|
function k(n, t, e) {
|
|
@@ -1334,64 +1334,64 @@ Vt.write = function(i, r, o, p, u, f) {
|
|
|
1334
1334
|
var l = this.subarray(t, e);
|
|
1335
1335
|
return Object.setPrototypeOf(l, s.prototype), l;
|
|
1336
1336
|
};
|
|
1337
|
-
function
|
|
1337
|
+
function O(n, t, e) {
|
|
1338
1338
|
if (n % 1 !== 0 || n < 0)
|
|
1339
1339
|
throw new RangeError("offset is not uint");
|
|
1340
1340
|
if (n + t > e)
|
|
1341
1341
|
throw new RangeError("Trying to access beyond buffer length");
|
|
1342
1342
|
}
|
|
1343
1343
|
s.prototype.readUintLE = s.prototype.readUIntLE = function(t, e, a) {
|
|
1344
|
-
t = t >>> 0, e = e >>> 0, a ||
|
|
1344
|
+
t = t >>> 0, e = e >>> 0, a || O(t, e, this.length);
|
|
1345
1345
|
for (var l = this[t], x = 1, d = 0; ++d < e && (x *= 256); )
|
|
1346
1346
|
l += this[t + d] * x;
|
|
1347
1347
|
return l;
|
|
1348
1348
|
}, s.prototype.readUintBE = s.prototype.readUIntBE = function(t, e, a) {
|
|
1349
|
-
t = t >>> 0, e = e >>> 0, a ||
|
|
1349
|
+
t = t >>> 0, e = e >>> 0, a || O(t, e, this.length);
|
|
1350
1350
|
for (var l = this[t + --e], x = 1; e > 0 && (x *= 256); )
|
|
1351
1351
|
l += this[t + --e] * x;
|
|
1352
1352
|
return l;
|
|
1353
1353
|
}, s.prototype.readUint8 = s.prototype.readUInt8 = function(t, e) {
|
|
1354
|
-
return t = t >>> 0, e ||
|
|
1354
|
+
return t = t >>> 0, e || O(t, 1, this.length), this[t];
|
|
1355
1355
|
}, s.prototype.readUint16LE = s.prototype.readUInt16LE = function(t, e) {
|
|
1356
|
-
return t = t >>> 0, e ||
|
|
1356
|
+
return t = t >>> 0, e || O(t, 2, this.length), this[t] | this[t + 1] << 8;
|
|
1357
1357
|
}, s.prototype.readUint16BE = s.prototype.readUInt16BE = function(t, e) {
|
|
1358
|
-
return t = t >>> 0, e ||
|
|
1358
|
+
return t = t >>> 0, e || O(t, 2, this.length), this[t] << 8 | this[t + 1];
|
|
1359
1359
|
}, s.prototype.readUint32LE = s.prototype.readUInt32LE = function(t, e) {
|
|
1360
|
-
return t = t >>> 0, e ||
|
|
1360
|
+
return t = t >>> 0, e || O(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + this[t + 3] * 16777216;
|
|
1361
1361
|
}, s.prototype.readUint32BE = s.prototype.readUInt32BE = function(t, e) {
|
|
1362
|
-
return t = t >>> 0, e ||
|
|
1362
|
+
return t = t >>> 0, e || O(t, 4, this.length), this[t] * 16777216 + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]);
|
|
1363
1363
|
}, s.prototype.readIntLE = function(t, e, a) {
|
|
1364
|
-
t = t >>> 0, e = e >>> 0, a ||
|
|
1364
|
+
t = t >>> 0, e = e >>> 0, a || O(t, e, this.length);
|
|
1365
1365
|
for (var l = this[t], x = 1, d = 0; ++d < e && (x *= 256); )
|
|
1366
1366
|
l += this[t + d] * x;
|
|
1367
1367
|
return x *= 128, l >= x && (l -= Math.pow(2, 8 * e)), l;
|
|
1368
1368
|
}, s.prototype.readIntBE = function(t, e, a) {
|
|
1369
|
-
t = t >>> 0, e = e >>> 0, a ||
|
|
1369
|
+
t = t >>> 0, e = e >>> 0, a || O(t, e, this.length);
|
|
1370
1370
|
for (var l = e, x = 1, d = this[t + --l]; l > 0 && (x *= 256); )
|
|
1371
1371
|
d += this[t + --l] * x;
|
|
1372
1372
|
return x *= 128, d >= x && (d -= Math.pow(2, 8 * e)), d;
|
|
1373
1373
|
}, s.prototype.readInt8 = function(t, e) {
|
|
1374
|
-
return t = t >>> 0, e ||
|
|
1374
|
+
return t = t >>> 0, e || O(t, 1, this.length), this[t] & 128 ? (255 - this[t] + 1) * -1 : this[t];
|
|
1375
1375
|
}, s.prototype.readInt16LE = function(t, e) {
|
|
1376
|
-
t = t >>> 0, e ||
|
|
1376
|
+
t = t >>> 0, e || O(t, 2, this.length);
|
|
1377
1377
|
var a = this[t] | this[t + 1] << 8;
|
|
1378
1378
|
return a & 32768 ? a | 4294901760 : a;
|
|
1379
1379
|
}, s.prototype.readInt16BE = function(t, e) {
|
|
1380
|
-
t = t >>> 0, e ||
|
|
1380
|
+
t = t >>> 0, e || O(t, 2, this.length);
|
|
1381
1381
|
var a = this[t + 1] | this[t] << 8;
|
|
1382
1382
|
return a & 32768 ? a | 4294901760 : a;
|
|
1383
1383
|
}, s.prototype.readInt32LE = function(t, e) {
|
|
1384
|
-
return t = t >>> 0, e ||
|
|
1384
|
+
return t = t >>> 0, e || O(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24;
|
|
1385
1385
|
}, s.prototype.readInt32BE = function(t, e) {
|
|
1386
|
-
return t = t >>> 0, e ||
|
|
1386
|
+
return t = t >>> 0, e || O(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3];
|
|
1387
1387
|
}, s.prototype.readFloatLE = function(t, e) {
|
|
1388
|
-
return t = t >>> 0, e ||
|
|
1388
|
+
return t = t >>> 0, e || O(t, 4, this.length), o.read(this, t, !0, 23, 4);
|
|
1389
1389
|
}, s.prototype.readFloatBE = function(t, e) {
|
|
1390
|
-
return t = t >>> 0, e ||
|
|
1390
|
+
return t = t >>> 0, e || O(t, 4, this.length), o.read(this, t, !1, 23, 4);
|
|
1391
1391
|
}, s.prototype.readDoubleLE = function(t, e) {
|
|
1392
|
-
return t = t >>> 0, e ||
|
|
1392
|
+
return t = t >>> 0, e || O(t, 8, this.length), o.read(this, t, !0, 52, 8);
|
|
1393
1393
|
}, s.prototype.readDoubleBE = function(t, e) {
|
|
1394
|
-
return t = t >>> 0, e ||
|
|
1394
|
+
return t = t >>> 0, e || O(t, 8, this.length), o.read(this, t, !1, 52, 8);
|
|
1395
1395
|
};
|
|
1396
1396
|
function I(n, t, e, a, l, x) {
|
|
1397
1397
|
if (!s.isBuffer(n))
|
|
@@ -1464,21 +1464,21 @@ Vt.write = function(i, r, o, p, u, f) {
|
|
|
1464
1464
|
if (e < 0)
|
|
1465
1465
|
throw new RangeError("Index out of range");
|
|
1466
1466
|
}
|
|
1467
|
-
function
|
|
1467
|
+
function H(n, t, e, a, l) {
|
|
1468
1468
|
return t = +t, e = e >>> 0, l || L(n, t, e, 4), o.write(n, t, e, a, 23, 4), e + 4;
|
|
1469
1469
|
}
|
|
1470
1470
|
s.prototype.writeFloatLE = function(t, e, a) {
|
|
1471
|
-
return
|
|
1471
|
+
return H(this, t, e, !0, a);
|
|
1472
1472
|
}, s.prototype.writeFloatBE = function(t, e, a) {
|
|
1473
|
-
return
|
|
1473
|
+
return H(this, t, e, !1, a);
|
|
1474
1474
|
};
|
|
1475
|
-
function
|
|
1475
|
+
function $(n, t, e, a, l) {
|
|
1476
1476
|
return t = +t, e = e >>> 0, l || L(n, t, e, 8), o.write(n, t, e, a, 52, 8), e + 8;
|
|
1477
1477
|
}
|
|
1478
1478
|
s.prototype.writeDoubleLE = function(t, e, a) {
|
|
1479
|
-
return
|
|
1479
|
+
return $(this, t, e, !0, a);
|
|
1480
1480
|
}, s.prototype.writeDoubleBE = function(t, e, a) {
|
|
1481
|
-
return
|
|
1481
|
+
return $(this, t, e, !1, a);
|
|
1482
1482
|
}, s.prototype.copy = function(t, e, a, l) {
|
|
1483
1483
|
if (!s.isBuffer(t))
|
|
1484
1484
|
throw new TypeError("argument should be a Buffer");
|
|
@@ -1614,7 +1614,7 @@ Vt.write = function(i, r, o, p, u, f) {
|
|
|
1614
1614
|
function Ct(n) {
|
|
1615
1615
|
return n !== n;
|
|
1616
1616
|
}
|
|
1617
|
-
var
|
|
1617
|
+
var Xe = function() {
|
|
1618
1618
|
for (var n = "0123456789abcdef", t = new Array(256), e = 0; e < 16; ++e)
|
|
1619
1619
|
for (var a = e * 16, l = 0; l < 16; ++l)
|
|
1620
1620
|
t[a + l] = n[e] + n[l];
|
|
@@ -1681,49 +1681,49 @@ Tt.prototype.digest = function(i) {
|
|
|
1681
1681
|
Tt.prototype._update = function() {
|
|
1682
1682
|
throw new Error("_update must be implemented by subclass");
|
|
1683
1683
|
};
|
|
1684
|
-
var Fe = Tt,
|
|
1684
|
+
var Fe = Tt, Ei = ve, Oe = Fe, bi = Kt.Buffer, vi = [
|
|
1685
1685
|
1518500249,
|
|
1686
1686
|
1859775393,
|
|
1687
1687
|
-1894007588,
|
|
1688
1688
|
-899497514
|
|
1689
|
-
],
|
|
1689
|
+
], Si = new Array(80);
|
|
1690
1690
|
function bt() {
|
|
1691
|
-
this.init(), this._w =
|
|
1691
|
+
this.init(), this._w = Si, Oe.call(this, 64, 56);
|
|
1692
1692
|
}
|
|
1693
|
-
|
|
1693
|
+
Ei(bt, Oe);
|
|
1694
1694
|
bt.prototype.init = function() {
|
|
1695
1695
|
return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;
|
|
1696
1696
|
};
|
|
1697
|
-
function
|
|
1697
|
+
function _i(i) {
|
|
1698
1698
|
return i << 1 | i >>> 31;
|
|
1699
1699
|
}
|
|
1700
|
-
function
|
|
1700
|
+
function Ai(i) {
|
|
1701
1701
|
return i << 5 | i >>> 27;
|
|
1702
1702
|
}
|
|
1703
|
-
function
|
|
1703
|
+
function Fi(i) {
|
|
1704
1704
|
return i << 30 | i >>> 2;
|
|
1705
1705
|
}
|
|
1706
|
-
function
|
|
1706
|
+
function Oi(i, r, o, p) {
|
|
1707
1707
|
return i === 0 ? r & o | ~r & p : i === 2 ? r & o | r & p | o & p : r ^ o ^ p;
|
|
1708
1708
|
}
|
|
1709
1709
|
bt.prototype._update = function(i) {
|
|
1710
1710
|
for (var r = this._w, o = this._a | 0, p = this._b | 0, u = this._c | 0, f = this._d | 0, c = this._e | 0, s = 0; s < 16; ++s)
|
|
1711
1711
|
r[s] = i.readInt32BE(s * 4);
|
|
1712
1712
|
for (; s < 80; ++s)
|
|
1713
|
-
r[s] =
|
|
1713
|
+
r[s] = _i(r[s - 3] ^ r[s - 8] ^ r[s - 14] ^ r[s - 16]);
|
|
1714
1714
|
for (var h = 0; h < 80; ++h) {
|
|
1715
|
-
var g = ~~(h / 20), y =
|
|
1716
|
-
c = f, f = u, u =
|
|
1715
|
+
var g = ~~(h / 20), y = Ai(o) + Oi(g, p, u, f) + c + r[h] + vi[g] | 0;
|
|
1716
|
+
c = f, f = u, u = Fi(p), p = o, o = y;
|
|
1717
1717
|
}
|
|
1718
1718
|
this._a = o + this._a | 0, this._b = p + this._b | 0, this._c = u + this._c | 0, this._d = f + this._d | 0, this._e = c + this._e | 0;
|
|
1719
1719
|
};
|
|
1720
1720
|
bt.prototype._hash = function() {
|
|
1721
|
-
var i =
|
|
1721
|
+
var i = bi.allocUnsafe(20);
|
|
1722
1722
|
return i.writeInt32BE(this._a | 0, 0), i.writeInt32BE(this._b | 0, 4), i.writeInt32BE(this._c | 0, 8), i.writeInt32BE(this._d | 0, 12), i.writeInt32BE(this._e | 0, 16), i;
|
|
1723
1723
|
};
|
|
1724
1724
|
var Bi = bt;
|
|
1725
|
-
const
|
|
1726
|
-
var
|
|
1725
|
+
const Ii = /* @__PURE__ */ Xt(Bi);
|
|
1726
|
+
var ji = ve, Be = Fe, Ti = Kt.Buffer, ki = [
|
|
1727
1727
|
1116352408,
|
|
1728
1728
|
1899447441,
|
|
1729
1729
|
3049323471,
|
|
@@ -1788,68 +1788,68 @@ var Ii = ve, Oe = Fe, ji = Kt.Buffer, Ti = [
|
|
|
1788
1788
|
2756734187,
|
|
1789
1789
|
3204031479,
|
|
1790
1790
|
3329325298
|
|
1791
|
-
],
|
|
1791
|
+
], Di = new Array(64);
|
|
1792
1792
|
function vt() {
|
|
1793
|
-
this.init(), this._w =
|
|
1793
|
+
this.init(), this._w = Di, Be.call(this, 64, 56);
|
|
1794
1794
|
}
|
|
1795
|
-
|
|
1795
|
+
ji(vt, Be);
|
|
1796
1796
|
vt.prototype.init = function() {
|
|
1797
1797
|
return this._a = 1779033703, this._b = 3144134277, this._c = 1013904242, this._d = 2773480762, this._e = 1359893119, this._f = 2600822924, this._g = 528734635, this._h = 1541459225, this;
|
|
1798
1798
|
};
|
|
1799
|
-
function
|
|
1799
|
+
function Ci(i, r, o) {
|
|
1800
1800
|
return o ^ i & (r ^ o);
|
|
1801
1801
|
}
|
|
1802
|
-
function
|
|
1802
|
+
function Ui(i, r, o) {
|
|
1803
1803
|
return i & r | o & (i | r);
|
|
1804
1804
|
}
|
|
1805
|
-
function
|
|
1805
|
+
function $i(i) {
|
|
1806
1806
|
return (i >>> 2 | i << 30) ^ (i >>> 13 | i << 19) ^ (i >>> 22 | i << 10);
|
|
1807
1807
|
}
|
|
1808
|
-
function
|
|
1808
|
+
function Ni(i) {
|
|
1809
1809
|
return (i >>> 6 | i << 26) ^ (i >>> 11 | i << 21) ^ (i >>> 25 | i << 7);
|
|
1810
1810
|
}
|
|
1811
|
-
function
|
|
1811
|
+
function Mi(i) {
|
|
1812
1812
|
return (i >>> 7 | i << 25) ^ (i >>> 18 | i << 14) ^ i >>> 3;
|
|
1813
1813
|
}
|
|
1814
|
-
function
|
|
1814
|
+
function Ri(i) {
|
|
1815
1815
|
return (i >>> 17 | i << 15) ^ (i >>> 19 | i << 13) ^ i >>> 10;
|
|
1816
1816
|
}
|
|
1817
1817
|
vt.prototype._update = function(i) {
|
|
1818
1818
|
for (var r = this._w, o = this._a | 0, p = this._b | 0, u = this._c | 0, f = this._d | 0, c = this._e | 0, s = this._f | 0, h = this._g | 0, g = this._h | 0, y = 0; y < 16; ++y)
|
|
1819
1819
|
r[y] = i.readInt32BE(y * 4);
|
|
1820
1820
|
for (; y < 64; ++y)
|
|
1821
|
-
r[y] =
|
|
1821
|
+
r[y] = Ri(r[y - 2]) + r[y - 7] + Mi(r[y - 15]) + r[y - 16] | 0;
|
|
1822
1822
|
for (var b = 0; b < 64; ++b) {
|
|
1823
|
-
var F = g +
|
|
1823
|
+
var F = g + Ni(c) + Ci(c, s, h) + ki[b] + r[b] | 0, j = $i(o) + Ui(o, p, u) | 0;
|
|
1824
1824
|
g = h, h = s, s = c, c = f + F | 0, f = u, u = p, p = o, o = F + j | 0;
|
|
1825
1825
|
}
|
|
1826
1826
|
this._a = o + this._a | 0, this._b = p + this._b | 0, this._c = u + this._c | 0, this._d = f + this._d | 0, this._e = c + this._e | 0, this._f = s + this._f | 0, this._g = h + this._g | 0, this._h = g + this._h | 0;
|
|
1827
1827
|
};
|
|
1828
1828
|
vt.prototype._hash = function() {
|
|
1829
|
-
var i =
|
|
1829
|
+
var i = Ti.allocUnsafe(32);
|
|
1830
1830
|
return i.writeInt32BE(this._a, 0), i.writeInt32BE(this._b, 4), i.writeInt32BE(this._c, 8), i.writeInt32BE(this._d, 12), i.writeInt32BE(this._e, 16), i.writeInt32BE(this._f, 20), i.writeInt32BE(this._g, 24), i.writeInt32BE(this._h, 28), i;
|
|
1831
1831
|
};
|
|
1832
|
-
var
|
|
1833
|
-
const
|
|
1834
|
-
function
|
|
1832
|
+
var Li = vt;
|
|
1833
|
+
const Pi = /* @__PURE__ */ Xt(Li), Gt = new Error("File system not available.");
|
|
1834
|
+
function zi(i, r, o) {
|
|
1835
1835
|
throw Gt;
|
|
1836
1836
|
}
|
|
1837
1837
|
function Ie(i) {
|
|
1838
1838
|
throw Gt;
|
|
1839
1839
|
}
|
|
1840
|
-
function
|
|
1840
|
+
function qi(i) {
|
|
1841
1841
|
throw Gt;
|
|
1842
1842
|
}
|
|
1843
|
-
const
|
|
1844
|
-
sha1:
|
|
1845
|
-
sha256:
|
|
1843
|
+
const Hi = async (i) => Ie(), Ji = {
|
|
1844
|
+
sha1: Ii,
|
|
1845
|
+
sha256: Pi
|
|
1846
1846
|
}, kt = (i, r = "sha1") => {
|
|
1847
1847
|
if (!["sha1", "sha256"].includes(r))
|
|
1848
1848
|
throw new Error("Hashing algorithm not supported: Available: sha1, sha256");
|
|
1849
1849
|
const o = Ji[r];
|
|
1850
1850
|
return new o().update(i).digest("base64");
|
|
1851
1851
|
};
|
|
1852
|
-
function
|
|
1852
|
+
function Wi(i) {
|
|
1853
1853
|
const r = [], o = Object.keys(i);
|
|
1854
1854
|
for (const p of o) {
|
|
1855
1855
|
const u = i[p].sort((f, c) => f.index - c.index);
|
|
@@ -1884,13 +1884,13 @@ const je = async (i) => {
|
|
|
1884
1884
|
comment: JSON.stringify(b)
|
|
1885
1885
|
});
|
|
1886
1886
|
}), r;
|
|
1887
|
-
},
|
|
1887
|
+
}, Xi = async (i, r, o, p) => {
|
|
1888
1888
|
await (await je(i)).generateAsync({
|
|
1889
1889
|
type: "uint8array",
|
|
1890
1890
|
streamFiles: !0
|
|
1891
1891
|
});
|
|
1892
1892
|
const f = p ?? i.name, c = `.${o}.zip`;
|
|
1893
|
-
return
|
|
1893
|
+
return zi(
|
|
1894
1894
|
r,
|
|
1895
1895
|
f.endsWith(c) ? f : `${f}${c}`
|
|
1896
1896
|
);
|
|
@@ -1899,12 +1899,12 @@ const je = async (i) => {
|
|
|
1899
1899
|
await u.write(p), await u.close();
|
|
1900
1900
|
}, re = async (i, r, o) => {
|
|
1901
1901
|
const p = Ie();
|
|
1902
|
-
return
|
|
1903
|
-
},
|
|
1902
|
+
return Vi(p, r, o);
|
|
1903
|
+
}, Vi = async (i, r, o) => {
|
|
1904
1904
|
const p = new oe();
|
|
1905
|
-
return await p.loadAsync(i),
|
|
1905
|
+
return await p.loadAsync(i), Ki(p, r, o);
|
|
1906
1906
|
};
|
|
1907
|
-
async function
|
|
1907
|
+
async function Ki(i, r, o) {
|
|
1908
1908
|
const p = i.file("state.json");
|
|
1909
1909
|
if (!p)
|
|
1910
1910
|
throw new Error("Initial state not found");
|
|
@@ -1916,13 +1916,13 @@ async function Vi(i, r, o) {
|
|
|
1916
1916
|
throw new Error("Operations history not found");
|
|
1917
1917
|
const g = JSON.parse(
|
|
1918
1918
|
await h.async("string")
|
|
1919
|
-
), y =
|
|
1919
|
+
), y = Wi(g);
|
|
1920
1920
|
if (y.length) {
|
|
1921
1921
|
const F = y.map((j) => j.message);
|
|
1922
1922
|
throw new Error(F.join(`
|
|
1923
1923
|
`));
|
|
1924
1924
|
}
|
|
1925
|
-
let b =
|
|
1925
|
+
let b = Le(
|
|
1926
1926
|
f,
|
|
1927
1927
|
g,
|
|
1928
1928
|
r,
|
|
@@ -1941,7 +1941,7 @@ function Te(i) {
|
|
|
1941
1941
|
return { extension: r, fileName: o };
|
|
1942
1942
|
}
|
|
1943
1943
|
async function wr(i) {
|
|
1944
|
-
const { buffer: r, mimeType: o = "application/octet-stream" } = await
|
|
1944
|
+
const { buffer: r, mimeType: o = "application/octet-stream" } = await qi(), p = Te(i), u = r.toString("base64");
|
|
1945
1945
|
return {
|
|
1946
1946
|
data: u,
|
|
1947
1947
|
hash: kt(u),
|
|
@@ -1950,7 +1950,7 @@ async function wr(i) {
|
|
|
1950
1950
|
};
|
|
1951
1951
|
}
|
|
1952
1952
|
async function Er(i) {
|
|
1953
|
-
const r = await
|
|
1953
|
+
const r = await Hi(), o = ui.getType(i) || "application/octet-stream", p = Te(i), u = r.toString("base64");
|
|
1954
1954
|
return { data: u, hash: kt(u), mimeType: o, ...p };
|
|
1955
1955
|
}
|
|
1956
1956
|
var ke = /* @__PURE__ */ ((i) => (i.UNEXPECTED_INDEX = "UNEXPECTED_INDEX", i))(ke || {}), De = /* @__PURE__ */ ((i) => (i.DUPLICATED_INDEX = "DUPLICATED_INDEX", i.MISSING_INDEX = "MISSING_INDEX", i))(De || {});
|
|
@@ -1985,7 +1985,7 @@ function ot(i) {
|
|
|
1985
1985
|
}
|
|
1986
1986
|
return r;
|
|
1987
1987
|
}
|
|
1988
|
-
function
|
|
1988
|
+
function Gi(i) {
|
|
1989
1989
|
const r = [...i], o = r[r.length - 1];
|
|
1990
1990
|
return o && (o.type === "NOOP" ? r.push({
|
|
1991
1991
|
...o,
|
|
@@ -2005,13 +2005,13 @@ function Ki(i) {
|
|
|
2005
2005
|
function at(i) {
|
|
2006
2006
|
return i.slice().sort((r, o) => r.skip - o.skip).sort((r, o) => r.index - o.index);
|
|
2007
2007
|
}
|
|
2008
|
-
const
|
|
2008
|
+
const Zi = (i, r, o) => [...r, ...o].sort(
|
|
2009
2009
|
(p, u) => new Date(p.timestamp).getTime() - new Date(u.timestamp).getTime()
|
|
2010
2010
|
).map((p, u) => ({
|
|
2011
2011
|
...p,
|
|
2012
2012
|
index: i.index + u,
|
|
2013
2013
|
skip: u === 0 ? i.skip : 0
|
|
2014
|
-
})),
|
|
2014
|
+
})), Yi = (i, r, o) => [...r, ...o].sort(
|
|
2015
2015
|
(p, u) => new Date(p.timestamp).getTime() - new Date(u.timestamp).getTime()
|
|
2016
2016
|
).sort((p, u) => p.index - u.index).map((p, u) => ({
|
|
2017
2017
|
...p,
|
|
@@ -2021,7 +2021,7 @@ const Gi = (i, r, o) => [...r, ...o].sort(
|
|
|
2021
2021
|
function Yt(i, r) {
|
|
2022
2022
|
return xt(i) === xt(r);
|
|
2023
2023
|
}
|
|
2024
|
-
function
|
|
2024
|
+
function Qi(i, r) {
|
|
2025
2025
|
const o = ot(at(i.slice())), p = ot(at(r.slice()));
|
|
2026
2026
|
if (o.length < 1)
|
|
2027
2027
|
return [p, []];
|
|
@@ -2060,7 +2060,7 @@ function Ue(i, r) {
|
|
|
2060
2060
|
}
|
|
2061
2061
|
return [o, p, u];
|
|
2062
2062
|
}
|
|
2063
|
-
function
|
|
2063
|
+
function tr(i, r, o) {
|
|
2064
2064
|
const [p, u, f] = Ue(
|
|
2065
2065
|
ot(i),
|
|
2066
2066
|
ot(r)
|
|
@@ -2090,12 +2090,12 @@ function $e(i) {
|
|
|
2090
2090
|
let o = (((p = r[r.length - 1]) == null ? void 0 : p.skip) || 0) + 1;
|
|
2091
2091
|
return r.length > 1 && (o += ((u = r[r.length - 2]) == null ? void 0 : u.skip) || 0), (((f = r[r.length - 1]) == null ? void 0 : f.index) || -1) < o ? -1 : o;
|
|
2092
2092
|
}
|
|
2093
|
-
const
|
|
2093
|
+
const er = (i) => Zt(
|
|
2094
2094
|
ot(at(i))
|
|
2095
|
-
),
|
|
2095
|
+
), ir = (i) => i.reduce((o, p) => {
|
|
2096
2096
|
var u;
|
|
2097
2097
|
return o[p.scope] || (o[p.scope] = []), (u = o[p.scope]) == null || u.push(p), o;
|
|
2098
|
-
}, {}),
|
|
2098
|
+
}, {}), rr = (i, r) => {
|
|
2099
2099
|
var h;
|
|
2100
2100
|
const o = {
|
|
2101
2101
|
integrityIssues: [],
|
|
@@ -2122,7 +2122,7 @@ const tr = (i) => Zt(
|
|
|
2122
2122
|
}
|
|
2123
2123
|
return o.integrityIssues.push(...f), o;
|
|
2124
2124
|
};
|
|
2125
|
-
function
|
|
2125
|
+
function nr(i, r) {
|
|
2126
2126
|
return i.filter((o) => !r.some((p) => o.type === "NOOP" && o.skip === 0 && o.index === p.index || o.index === p.index && o.skip === p.skip && o.scope === p.scope && o.hash === p.hash && o.type === p.type));
|
|
2127
2127
|
}
|
|
2128
2128
|
function Ne(i, r) {
|
|
@@ -2156,35 +2156,35 @@ const br = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2156
2156
|
__proto__: null,
|
|
2157
2157
|
IntegrityIssueSubType: De,
|
|
2158
2158
|
IntegrityIssueType: ke,
|
|
2159
|
-
addUndo:
|
|
2160
|
-
attachBranch:
|
|
2159
|
+
addUndo: Gi,
|
|
2160
|
+
attachBranch: Qi,
|
|
2161
2161
|
checkCleanedOperationsIntegrity: Zt,
|
|
2162
|
-
checkOperationsIntegrity:
|
|
2162
|
+
checkOperationsIntegrity: er,
|
|
2163
2163
|
garbageCollect: ot,
|
|
2164
2164
|
garbageCollectDocumentOperations: Lt,
|
|
2165
|
-
groupOperationsByScope:
|
|
2166
|
-
merge:
|
|
2165
|
+
groupOperationsByScope: ir,
|
|
2166
|
+
merge: tr,
|
|
2167
2167
|
nextSkipNumber: $e,
|
|
2168
2168
|
operationsAreEqual: Yt,
|
|
2169
2169
|
precedes: Ce,
|
|
2170
|
-
prepareOperations:
|
|
2171
|
-
removeExistingOperations:
|
|
2172
|
-
reshuffleByTimestamp:
|
|
2173
|
-
reshuffleByTimestampAndIndex:
|
|
2170
|
+
prepareOperations: rr,
|
|
2171
|
+
removeExistingOperations: nr,
|
|
2172
|
+
reshuffleByTimestamp: Zi,
|
|
2173
|
+
reshuffleByTimestampAndIndex: Yi,
|
|
2174
2174
|
skipHeaderOperations: Ne,
|
|
2175
2175
|
sortOperations: at,
|
|
2176
2176
|
split: Ue
|
|
2177
2177
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2178
|
-
function
|
|
2178
|
+
function or(i, r) {
|
|
2179
2179
|
let o;
|
|
2180
2180
|
return "index" in r ? o = { ...r } : o = i.operations[r.scope].at(-1), ((o == null ? void 0 : o.index) ?? -1) + 1;
|
|
2181
2181
|
}
|
|
2182
|
-
function
|
|
2182
|
+
function Me(i, r) {
|
|
2183
2183
|
return {
|
|
2184
2184
|
...i,
|
|
2185
2185
|
revision: {
|
|
2186
2186
|
...i.revision,
|
|
2187
|
-
[r.scope]:
|
|
2187
|
+
[r.scope]: or(i, r)
|
|
2188
2188
|
},
|
|
2189
2189
|
lastModified: (/* @__PURE__ */ new Date()).toISOString()
|
|
2190
2190
|
};
|
|
@@ -2216,16 +2216,16 @@ function ar(i, r, o = 0) {
|
|
|
2216
2216
|
}
|
|
2217
2217
|
function sr(i, r, o = 0) {
|
|
2218
2218
|
let p = ar(i, r, o);
|
|
2219
|
-
return p =
|
|
2219
|
+
return p = Me(p, r), p;
|
|
2220
2220
|
}
|
|
2221
2221
|
function pr(i, r, o) {
|
|
2222
2222
|
switch (fe().parse(r), r.type) {
|
|
2223
2223
|
case we:
|
|
2224
|
-
return
|
|
2224
|
+
return ni(i, r.input);
|
|
2225
2225
|
case It:
|
|
2226
|
-
return
|
|
2226
|
+
return si(i, r, o);
|
|
2227
2227
|
case Ee:
|
|
2228
|
-
return
|
|
2228
|
+
return pi(i, r.input.state);
|
|
2229
2229
|
default:
|
|
2230
2230
|
return i;
|
|
2231
2231
|
}
|
|
@@ -2233,14 +2233,14 @@ function pr(i, r, o) {
|
|
|
2233
2233
|
function vr(i, r, o) {
|
|
2234
2234
|
switch (r.type) {
|
|
2235
2235
|
case wt:
|
|
2236
|
-
return ni(i, r, o);
|
|
2237
|
-
case Et:
|
|
2238
2236
|
return oi(i, r, o);
|
|
2237
|
+
case Et:
|
|
2238
|
+
return ai(i, r, o);
|
|
2239
2239
|
default:
|
|
2240
2240
|
return { document: i, action: r, skip: o };
|
|
2241
2241
|
}
|
|
2242
2242
|
}
|
|
2243
|
-
function cr(i, r, o, p, u = !1, f =
|
|
2243
|
+
function cr(i, r, o, p, u = !1, f = Pe) {
|
|
2244
2244
|
const c = r.scope, s = i.operations[c].at(-1);
|
|
2245
2245
|
if (!s)
|
|
2246
2246
|
return i;
|
|
@@ -2287,7 +2287,7 @@ function cr(i, r, o, p, u = !1, f = Le) {
|
|
|
2287
2287
|
})
|
|
2288
2288
|
};
|
|
2289
2289
|
}
|
|
2290
|
-
function
|
|
2290
|
+
function Re(i, r, o, p, u = {}) {
|
|
2291
2291
|
const {
|
|
2292
2292
|
skip: f,
|
|
2293
2293
|
ignoreSkipOperations: c = !1,
|
|
@@ -2304,45 +2304,45 @@ function Me(i, r, o, p, u = {}) {
|
|
|
2304
2304
|
b,
|
|
2305
2305
|
h,
|
|
2306
2306
|
g
|
|
2307
|
-
)), F =
|
|
2307
|
+
)), F = Bt(F, (C) => {
|
|
2308
2308
|
try {
|
|
2309
2309
|
const q = o(
|
|
2310
|
-
|
|
2310
|
+
C.state,
|
|
2311
2311
|
y,
|
|
2312
2312
|
p
|
|
2313
2313
|
);
|
|
2314
2314
|
if (q)
|
|
2315
|
-
return
|
|
2315
|
+
return Ot({
|
|
2316
2316
|
...F,
|
|
2317
2317
|
// clipboard: [...clipboardValue],
|
|
2318
2318
|
state: q
|
|
2319
2319
|
});
|
|
2320
2320
|
} catch (q) {
|
|
2321
2321
|
const Z = F.operations[y.scope].length - 1;
|
|
2322
|
-
|
|
2322
|
+
C.operations[y.scope][Z].error = q.message, C.operations[y.scope][Z].skip = 0, j && (C.state = Ot({ ...i.state }), C.operations = Ot({
|
|
2323
2323
|
...i.operations,
|
|
2324
2324
|
[y.scope]: [
|
|
2325
2325
|
...i.operations[y.scope],
|
|
2326
2326
|
{
|
|
2327
|
-
|
|
2327
|
+
...C.operations[y.scope][Z]
|
|
2328
2328
|
}
|
|
2329
2329
|
]
|
|
2330
2330
|
}));
|
|
2331
2331
|
}
|
|
2332
|
-
}),
|
|
2332
|
+
}), Bt(F, (C) => {
|
|
2333
2333
|
if ([wt, Et, It].includes(y.type))
|
|
2334
|
-
return
|
|
2335
|
-
const q = y.scope || "global", Z = s && Object.prototype.hasOwnProperty.call(y, "hash") ? y.hash : Qt(
|
|
2336
|
-
|
|
2337
|
-
const { hash:
|
|
2338
|
-
|
|
2339
|
-
...
|
|
2334
|
+
return C;
|
|
2335
|
+
const q = y.scope || "global", Z = s && Object.prototype.hasOwnProperty.call(y, "hash") ? y.hash : Qt(C, q), w = C.operations[q].at(-1);
|
|
2336
|
+
w && (w.hash = Z, h && (w.resultingState = C.state[q]), !ne(y) && y.attachments && y.attachments.forEach((E) => {
|
|
2337
|
+
const { hash: v, ...M } = E;
|
|
2338
|
+
C.attachments[v] = {
|
|
2339
|
+
...M
|
|
2340
2340
|
};
|
|
2341
|
-
});
|
|
2341
|
+
}));
|
|
2342
2342
|
});
|
|
2343
2343
|
}
|
|
2344
2344
|
function Sr(i) {
|
|
2345
|
-
return i.type ===
|
|
2345
|
+
return i.type === ci && i.skip !== void 0 && i.skip > 0 && i.hash !== void 0;
|
|
2346
2346
|
}
|
|
2347
2347
|
function _r(i) {
|
|
2348
2348
|
return [wt, Et].includes(i.type);
|
|
@@ -2364,7 +2364,7 @@ function dt(i, r, o, p, u = "global") {
|
|
|
2364
2364
|
}
|
|
2365
2365
|
return f;
|
|
2366
2366
|
}
|
|
2367
|
-
function lr(i, r =
|
|
2367
|
+
function lr(i, r = Re) {
|
|
2368
2368
|
return (o, p, u, f) => r(o, p, i, u, f);
|
|
2369
2369
|
}
|
|
2370
2370
|
const ur = (i, r) => ({
|
|
@@ -2395,7 +2395,7 @@ const ur = (i, r) => ({
|
|
|
2395
2395
|
return kt(`${(i ?? /* @__PURE__ */ new Date()).toISOString()}${o}`);
|
|
2396
2396
|
};
|
|
2397
2397
|
function Ft(i) {
|
|
2398
|
-
return
|
|
2398
|
+
return Ge(Ze(i, !0));
|
|
2399
2399
|
}
|
|
2400
2400
|
function Fr(i, r) {
|
|
2401
2401
|
const o = [...i];
|
|
@@ -2420,7 +2420,7 @@ function Fr(i, r) {
|
|
|
2420
2420
|
}
|
|
2421
2421
|
return f.reverse();
|
|
2422
2422
|
}
|
|
2423
|
-
function
|
|
2423
|
+
function Or(i, r, o) {
|
|
2424
2424
|
const p = i.slice().sort((s, h) => s.skip - h.skip).sort((s, h) => s.index - h.index);
|
|
2425
2425
|
let u = o, f = 0, c = r;
|
|
2426
2426
|
for (const s of p.reverse()) {
|
|
@@ -2432,7 +2432,7 @@ function Br(i, r, o) {
|
|
|
2432
2432
|
}
|
|
2433
2433
|
return f;
|
|
2434
2434
|
}
|
|
2435
|
-
function
|
|
2435
|
+
function Br(i) {
|
|
2436
2436
|
return Object.values(i).flatMap((r) => r).sort(
|
|
2437
2437
|
(r, o) => new Date(r.timestamp).getTime() - new Date(o.timestamp).getTime()
|
|
2438
2438
|
);
|
|
@@ -2442,9 +2442,9 @@ function Ir(i) {
|
|
|
2442
2442
|
(r, o) => new Date(r.operation.timestamp).getTime() - new Date(o.operation.timestamp).getTime()
|
|
2443
2443
|
);
|
|
2444
2444
|
}
|
|
2445
|
-
function Pt(i, r, o, p, u, f =
|
|
2445
|
+
function Pt(i, r, o, p, u, f = Re, c = {}, s) {
|
|
2446
2446
|
const h = lr(o, f);
|
|
2447
|
-
return
|
|
2447
|
+
return Le(
|
|
2448
2448
|
i,
|
|
2449
2449
|
r,
|
|
2450
2450
|
h,
|
|
@@ -2454,11 +2454,11 @@ function Pt(i, r, o, p, u, f = Me, c = {}, s) {
|
|
|
2454
2454
|
s
|
|
2455
2455
|
);
|
|
2456
2456
|
}
|
|
2457
|
-
function
|
|
2457
|
+
function Le(i, r, o, p, u, f = {}, c) {
|
|
2458
2458
|
const {
|
|
2459
2459
|
checkHashes: s = !0,
|
|
2460
2460
|
reuseOperationResultingState: h,
|
|
2461
|
-
operationResultingStateParser: g =
|
|
2461
|
+
operationResultingStateParser: g = Pe
|
|
2462
2462
|
} = c || {};
|
|
2463
2463
|
let y = i;
|
|
2464
2464
|
const b = [], F = {
|
|
@@ -2468,24 +2468,24 @@ function Re(i, r, o, p, u, f = {}, c) {
|
|
|
2468
2468
|
if (h)
|
|
2469
2469
|
for (const [w, E] of Object.entries(r)) {
|
|
2470
2470
|
const v = E.findLastIndex(
|
|
2471
|
-
(
|
|
2471
|
+
(J) => !!J.resultingState
|
|
2472
2472
|
);
|
|
2473
2473
|
if (v < 0) {
|
|
2474
2474
|
b.push(...E);
|
|
2475
2475
|
continue;
|
|
2476
2476
|
}
|
|
2477
|
-
const
|
|
2477
|
+
const M = E[v];
|
|
2478
2478
|
try {
|
|
2479
|
-
const
|
|
2479
|
+
const J = g(
|
|
2480
2480
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-unnecessary-type-assertion
|
|
2481
|
-
|
|
2481
|
+
M.resultingState
|
|
2482
2482
|
);
|
|
2483
2483
|
y = {
|
|
2484
2484
|
...y,
|
|
2485
2485
|
state: {
|
|
2486
2486
|
...y.state,
|
|
2487
2487
|
// TODO how to deal with attachments?
|
|
2488
|
-
[w]:
|
|
2488
|
+
[w]: J
|
|
2489
2489
|
}
|
|
2490
2490
|
}, F[w].push(
|
|
2491
2491
|
...E.slice(0, v + 1)
|
|
@@ -2498,34 +2498,41 @@ function Re(i, r, o, p, u, f = {}, c) {
|
|
|
2498
2498
|
b.push(...Object.values(r).flat());
|
|
2499
2499
|
const j = fr(y);
|
|
2500
2500
|
j.initialState = i, j.operations = F;
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2501
|
+
let C = j;
|
|
2502
|
+
if (b.length)
|
|
2503
|
+
C = b.reduce((w, E) => o(w, E, p, {
|
|
2504
|
+
skip: E.skip,
|
|
2505
|
+
ignoreSkipOperations: !0,
|
|
2506
|
+
reuseHash: !s
|
|
2507
|
+
}), j);
|
|
2508
|
+
else
|
|
2509
|
+
for (const w of Object.values(F)) {
|
|
2510
|
+
const E = w.at(-1);
|
|
2511
|
+
E && (C = Me(C, E));
|
|
2512
|
+
}
|
|
2506
2513
|
if (!s)
|
|
2507
|
-
for (const w of Object.keys(
|
|
2514
|
+
for (const w of Object.keys(C.state))
|
|
2508
2515
|
for (let E = b.length - 1; E >= 0; E--) {
|
|
2509
2516
|
const v = b[E];
|
|
2510
2517
|
if (v.scope === w) {
|
|
2511
|
-
if (v.hash !== Qt(
|
|
2518
|
+
if (v.hash !== Qt(C, w))
|
|
2512
2519
|
throw new Error(`Hash mismatch for scope ${w}`);
|
|
2513
2520
|
break;
|
|
2514
2521
|
}
|
|
2515
2522
|
}
|
|
2516
2523
|
const q = Object.keys(
|
|
2517
|
-
|
|
2524
|
+
C.operations
|
|
2518
2525
|
).reduce(
|
|
2519
2526
|
(w, E) => {
|
|
2520
2527
|
const v = E;
|
|
2521
2528
|
return {
|
|
2522
2529
|
...w,
|
|
2523
2530
|
[v]: [
|
|
2524
|
-
|
|
2531
|
+
...C.operations[v].map((M, J) => {
|
|
2525
2532
|
var W;
|
|
2526
2533
|
return {
|
|
2527
|
-
...
|
|
2528
|
-
timestamp: ((W = r[v][
|
|
2534
|
+
...M,
|
|
2535
|
+
timestamp: ((W = r[v][J]) == null ? void 0 : W.timestamp) ?? M.timestamp
|
|
2529
2536
|
};
|
|
2530
2537
|
})
|
|
2531
2538
|
]
|
|
@@ -2536,12 +2543,12 @@ function Re(i, r, o, p, u, f = {}, c) {
|
|
|
2536
2543
|
const v = E[E.length - 1];
|
|
2537
2544
|
return (v == null ? void 0 : v.timestamp) > w && (w = v.timestamp), w;
|
|
2538
2545
|
}, i.lastModified);
|
|
2539
|
-
return {
|
|
2546
|
+
return { ...C, operations: q, lastModified: Z };
|
|
2540
2547
|
}
|
|
2541
2548
|
function jr(i, r) {
|
|
2542
2549
|
return xt(i) === xt(r);
|
|
2543
2550
|
}
|
|
2544
|
-
function
|
|
2551
|
+
function Pe(i) {
|
|
2545
2552
|
const r = typeof i;
|
|
2546
2553
|
if (r === "string")
|
|
2547
2554
|
return JSON.parse(i);
|
|
@@ -2549,23 +2556,23 @@ function Le(i) {
|
|
|
2549
2556
|
return i;
|
|
2550
2557
|
throw new Error(`Providing resulting state is of type: ${r}`);
|
|
2551
2558
|
}
|
|
2552
|
-
const
|
|
2559
|
+
const ze = (i) => dt(
|
|
2553
2560
|
"SET_NAME",
|
|
2554
2561
|
i,
|
|
2555
2562
|
void 0,
|
|
2556
|
-
|
|
2563
|
+
Jt,
|
|
2557
2564
|
void 0
|
|
2558
|
-
),
|
|
2565
|
+
), qe = (i = 1, r = "global") => dt(
|
|
2559
2566
|
"UNDO",
|
|
2560
2567
|
i,
|
|
2561
2568
|
void 0,
|
|
2562
2569
|
Wt,
|
|
2563
2570
|
r
|
|
2564
|
-
),
|
|
2571
|
+
), He = (i = 1, r = "global") => dt(
|
|
2565
2572
|
"REDO",
|
|
2566
2573
|
i,
|
|
2567
2574
|
void 0,
|
|
2568
|
-
|
|
2575
|
+
Ht,
|
|
2569
2576
|
r
|
|
2570
2577
|
), Je = (i, r, o = "global") => dt(
|
|
2571
2578
|
"PRUNE",
|
|
@@ -2578,14 +2585,14 @@ const Pe = (i) => dt(
|
|
|
2578
2585
|
{ state: i, operations: r },
|
|
2579
2586
|
void 0,
|
|
2580
2587
|
zt
|
|
2581
|
-
),
|
|
2588
|
+
), We = (i = "global") => dt("NOOP", {}, void 0, void 0, i), Tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2582
2589
|
__proto__: null,
|
|
2583
2590
|
loadState: te,
|
|
2584
|
-
noop:
|
|
2591
|
+
noop: We,
|
|
2585
2592
|
prune: Je,
|
|
2586
|
-
redo:
|
|
2587
|
-
setName:
|
|
2588
|
-
undo:
|
|
2593
|
+
redo: He,
|
|
2594
|
+
setName: ze,
|
|
2595
|
+
undo: qe
|
|
2589
2596
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2590
2597
|
class kr {
|
|
2591
2598
|
/**
|
|
@@ -2619,7 +2626,7 @@ class kr {
|
|
|
2619
2626
|
* @returns The file path where the state was saved.
|
|
2620
2627
|
*/
|
|
2621
2628
|
saveToFile(r, o, p) {
|
|
2622
|
-
return
|
|
2629
|
+
return Xi(this._document, r, o, p);
|
|
2623
2630
|
}
|
|
2624
2631
|
/**
|
|
2625
2632
|
* Loads the state of the document from a file.
|
|
@@ -2706,21 +2713,21 @@ class kr {
|
|
|
2706
2713
|
* @param name - The new name of the document.
|
|
2707
2714
|
*/
|
|
2708
2715
|
setName(r) {
|
|
2709
|
-
return this.dispatch(
|
|
2716
|
+
return this.dispatch(ze(r)), this;
|
|
2710
2717
|
}
|
|
2711
2718
|
/**
|
|
2712
2719
|
* Reverts a number of actions from the document.
|
|
2713
2720
|
* @param count - The number of actions to revert.
|
|
2714
2721
|
*/
|
|
2715
2722
|
undo(r) {
|
|
2716
|
-
return this.dispatch(
|
|
2723
|
+
return this.dispatch(qe(r)), this;
|
|
2717
2724
|
}
|
|
2718
2725
|
/**
|
|
2719
2726
|
* Reapplies a number of actions to the document.
|
|
2720
2727
|
* @param count - The number of actions to reapply.
|
|
2721
2728
|
*/
|
|
2722
2729
|
redo(r) {
|
|
2723
|
-
return this.dispatch(
|
|
2730
|
+
return this.dispatch(He(r)), this;
|
|
2724
2731
|
}
|
|
2725
2732
|
/**
|
|
2726
2733
|
* Removes a range of operations from the document.
|
|
@@ -2755,21 +2762,23 @@ function Dr(i, r) {
|
|
|
2755
2762
|
export {
|
|
2756
2763
|
Ir as A,
|
|
2757
2764
|
kr as B,
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2765
|
+
Br as C,
|
|
2766
|
+
Wi as D,
|
|
2767
|
+
Re as E,
|
|
2761
2768
|
vr as F,
|
|
2762
|
-
|
|
2769
|
+
sr as G,
|
|
2770
|
+
Me as H,
|
|
2771
|
+
gr as I,
|
|
2763
2772
|
ur as a,
|
|
2764
2773
|
fr as b,
|
|
2765
2774
|
lr as c,
|
|
2766
2775
|
yr as d,
|
|
2767
|
-
|
|
2776
|
+
Vi as e,
|
|
2768
2777
|
dt as f,
|
|
2769
2778
|
Dr as g,
|
|
2770
2779
|
Tr as h,
|
|
2771
2780
|
ne as i,
|
|
2772
|
-
|
|
2781
|
+
Or as j,
|
|
2773
2782
|
je as k,
|
|
2774
2783
|
re as l,
|
|
2775
2784
|
br as m,
|
|
@@ -2778,12 +2787,12 @@ export {
|
|
|
2778
2787
|
Qt as p,
|
|
2779
2788
|
Ar as q,
|
|
2780
2789
|
Sr as r,
|
|
2781
|
-
|
|
2790
|
+
Xi as s,
|
|
2782
2791
|
jr as t,
|
|
2783
2792
|
_r as u,
|
|
2784
2793
|
Fr as v,
|
|
2785
|
-
|
|
2794
|
+
Pe as w,
|
|
2786
2795
|
Ft as x,
|
|
2787
|
-
|
|
2796
|
+
Le as y,
|
|
2788
2797
|
Pt as z
|
|
2789
2798
|
};
|