document-model 1.0.18 → 1.0.20
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/dist/browser/document/actions/creators.d.ts +4 -4
- package/dist/browser/document/actions/index.d.ts +4 -4
- package/dist/browser/document/object.d.ts +119 -13
- package/dist/browser/document/schema/types.d.ts +5 -4
- package/dist/browser/document/schema/zod.d.ts +14 -12
- package/dist/browser/document/types.d.ts +2 -5
- package/dist/browser/document/utils/base.d.ts +6 -2
- package/dist/browser/document-model/gen/schema/zod.d.ts +5 -3
- package/dist/browser/document-model/index.d.ts +3 -3
- package/dist/browser/document-model.cjs +1 -1
- package/dist/browser/document-model.js +2 -2
- package/dist/browser/document.cjs +1 -1
- package/dist/browser/document.js +6 -6
- package/dist/browser/index.cjs +1 -1
- package/dist/browser/index.js +4 -4
- package/dist/browser/internal/{index-10a12861.js → index-22f88bf2.js} +361 -357
- package/dist/browser/internal/index-3607fd07.js +34 -0
- package/dist/browser/internal/index-79fde5f3.js +1 -0
- package/dist/browser/internal/index-dda5d688.js +22 -0
- package/dist/browser/internal/object-32802eed.js +6 -0
- package/dist/browser/internal/object-d03c84c9.js +1779 -0
- package/dist/node/document/actions/creators.d.ts +4 -4
- package/dist/node/document/actions/index.d.ts +4 -4
- package/dist/node/document/object.d.ts +119 -13
- package/dist/node/document/schema/types.d.ts +5 -4
- package/dist/node/document/schema/zod.d.ts +14 -12
- package/dist/node/document/types.d.ts +2 -5
- package/dist/node/document/utils/base.d.ts +6 -2
- package/dist/node/document-model/gen/schema/zod.d.ts +5 -3
- package/dist/node/document-model/index.d.ts +3 -3
- package/dist/node/document-model.cjs +1 -1
- package/dist/node/document-model.js +3 -3
- package/dist/node/document.cjs +1 -1
- package/dist/node/document.js +5 -5
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.js +4 -4
- package/dist/node/internal/{index-09364517.js → index-14279b3a.js} +362 -358
- package/dist/node/internal/index-4b25c8a5.js +1 -0
- package/dist/node/internal/index-bfc402ef.js +22 -0
- package/dist/node/internal/index-e02d7854.js +34 -0
- package/dist/node/internal/object-ac706c4a.js +1 -0
- package/dist/node/internal/{object-c32ea0a0.js → object-b97efc1b.js} +469 -402
- package/package.json +1 -1
- package/dist/browser/internal/index-2aee8ea9.js +0 -1
- package/dist/browser/internal/index-a1282d5c.js +0 -31
- package/dist/browser/internal/index-ec8cd58f.js +0 -22
- package/dist/browser/internal/object-24df9d92.js +0 -6
- package/dist/browser/internal/object-7e8eaff4.js +0 -1712
- package/dist/node/internal/index-284511b8.js +0 -22
- package/dist/node/internal/index-2d4783d9.js +0 -1
- package/dist/node/internal/index-5ef0c6b0.js +0 -31
- package/dist/node/internal/object-21f3d2ee.js +0 -1
|
@@ -1,157 +1,255 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
import { produce as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
const
|
|
13
|
-
function
|
|
14
|
-
return
|
|
15
|
-
__typename:
|
|
16
|
-
type:
|
|
1
|
+
var rt = Object.defineProperty;
|
|
2
|
+
var mt = (t, e, i) => e in t ? rt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i;
|
|
3
|
+
var j = (t, e, i) => (mt(t, typeof e != "symbol" ? e + "" : e, i), i);
|
|
4
|
+
import ut from "json-stringify-deterministic";
|
|
5
|
+
import { produce as P, castDraft as dt, castImmutable as xt, freeze as gt } from "immer";
|
|
6
|
+
import { z as o } from "zod";
|
|
7
|
+
import M from "jszip";
|
|
8
|
+
import ft from "crypto";
|
|
9
|
+
import k from "fs";
|
|
10
|
+
import ht from "https";
|
|
11
|
+
import { join as bt } from "path";
|
|
12
|
+
const R = (t) => t != null, vt = o.any().refine((t) => R(t)), L = o.enum(["LOAD_STATE"]), U = o.enum(["PRUNE"]), J = o.enum(["REDO"]), $ = o.enum(["SET_NAME"]), C = o.enum(["UNDO"]);
|
|
13
|
+
function yt() {
|
|
14
|
+
return o.object({
|
|
15
|
+
__typename: o.literal("Action").optional(),
|
|
16
|
+
type: o.string()
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
function x() {
|
|
20
|
+
return o.literal("global").or(o.literal("local"));
|
|
21
|
+
}
|
|
22
|
+
function B() {
|
|
23
|
+
return o.union([
|
|
24
24
|
Z(),
|
|
25
|
-
|
|
25
|
+
K(),
|
|
26
|
+
W(),
|
|
27
|
+
G(),
|
|
28
|
+
Q()
|
|
26
29
|
]);
|
|
27
30
|
}
|
|
28
|
-
function
|
|
29
|
-
return
|
|
30
|
-
__typename:
|
|
31
|
-
data:
|
|
32
|
-
extension:
|
|
33
|
-
fileName:
|
|
34
|
-
mimeType:
|
|
31
|
+
function jt() {
|
|
32
|
+
return o.object({
|
|
33
|
+
__typename: o.literal("DocumentFile").optional(),
|
|
34
|
+
data: o.string(),
|
|
35
|
+
extension: o.string().nullable(),
|
|
36
|
+
fileName: o.string().nullable(),
|
|
37
|
+
mimeType: o.string()
|
|
35
38
|
});
|
|
36
39
|
}
|
|
37
|
-
function
|
|
38
|
-
return
|
|
39
|
-
input:
|
|
40
|
-
type:
|
|
41
|
-
scope:
|
|
40
|
+
function Z() {
|
|
41
|
+
return o.object({
|
|
42
|
+
input: o.lazy(() => E()),
|
|
43
|
+
type: L,
|
|
44
|
+
scope: x()
|
|
42
45
|
});
|
|
43
46
|
}
|
|
44
|
-
function
|
|
45
|
-
return
|
|
46
|
-
operations:
|
|
47
|
-
state:
|
|
47
|
+
function E() {
|
|
48
|
+
return o.object({
|
|
49
|
+
operations: o.number(),
|
|
50
|
+
state: o.lazy(() => H())
|
|
48
51
|
});
|
|
49
52
|
}
|
|
50
|
-
function
|
|
51
|
-
return
|
|
52
|
-
data:
|
|
53
|
-
name:
|
|
53
|
+
function H() {
|
|
54
|
+
return o.object({
|
|
55
|
+
data: o.unknown().nullish(),
|
|
56
|
+
name: o.string()
|
|
54
57
|
});
|
|
55
58
|
}
|
|
56
|
-
function
|
|
57
|
-
return
|
|
58
|
-
__typename:
|
|
59
|
-
hash:
|
|
60
|
-
index:
|
|
61
|
-
timestamp:
|
|
62
|
-
type:
|
|
59
|
+
function wt() {
|
|
60
|
+
return o.object({
|
|
61
|
+
__typename: o.literal("Operation").optional(),
|
|
62
|
+
hash: o.string(),
|
|
63
|
+
index: o.number(),
|
|
64
|
+
timestamp: o.string().datetime(),
|
|
65
|
+
type: o.string()
|
|
63
66
|
});
|
|
64
67
|
}
|
|
65
|
-
function
|
|
66
|
-
return
|
|
67
|
-
input:
|
|
68
|
-
type:
|
|
69
|
-
scope:
|
|
68
|
+
function K() {
|
|
69
|
+
return o.object({
|
|
70
|
+
input: o.lazy(() => N()),
|
|
71
|
+
type: U,
|
|
72
|
+
scope: x()
|
|
70
73
|
});
|
|
71
74
|
}
|
|
72
|
-
function
|
|
73
|
-
return
|
|
74
|
-
end:
|
|
75
|
-
start:
|
|
75
|
+
function N() {
|
|
76
|
+
return o.object({
|
|
77
|
+
end: o.number().nullish(),
|
|
78
|
+
start: o.number().nullish()
|
|
76
79
|
});
|
|
77
80
|
}
|
|
78
|
-
const
|
|
79
|
-
function
|
|
80
|
-
return
|
|
81
|
-
input:
|
|
82
|
-
type:
|
|
83
|
-
scope:
|
|
81
|
+
const A = o.number;
|
|
82
|
+
function W() {
|
|
83
|
+
return o.object({
|
|
84
|
+
input: A(),
|
|
85
|
+
type: J,
|
|
86
|
+
scope: x()
|
|
84
87
|
});
|
|
85
88
|
}
|
|
86
|
-
const
|
|
87
|
-
function
|
|
88
|
-
return
|
|
89
|
-
input:
|
|
90
|
-
type:
|
|
91
|
-
scope:
|
|
89
|
+
const T = o.string;
|
|
90
|
+
function G() {
|
|
91
|
+
return o.object({
|
|
92
|
+
input: T(),
|
|
93
|
+
type: $,
|
|
94
|
+
scope: o.literal("global")
|
|
92
95
|
});
|
|
93
96
|
}
|
|
94
|
-
function
|
|
95
|
-
return
|
|
96
|
-
__typename:
|
|
97
|
-
hash:
|
|
98
|
-
index:
|
|
99
|
-
input:
|
|
100
|
-
timestamp:
|
|
101
|
-
type:
|
|
97
|
+
function St() {
|
|
98
|
+
return o.object({
|
|
99
|
+
__typename: o.literal("SetNameOperation").optional(),
|
|
100
|
+
hash: o.string(),
|
|
101
|
+
index: o.number(),
|
|
102
|
+
input: o.string(),
|
|
103
|
+
timestamp: o.string().datetime(),
|
|
104
|
+
type: o.string()
|
|
102
105
|
});
|
|
103
106
|
}
|
|
104
|
-
const
|
|
105
|
-
function
|
|
106
|
-
return
|
|
107
|
-
input:
|
|
108
|
-
type:
|
|
109
|
-
scope:
|
|
107
|
+
const z = o.number;
|
|
108
|
+
function Q() {
|
|
109
|
+
return o.object({
|
|
110
|
+
input: z(),
|
|
111
|
+
type: C,
|
|
112
|
+
scope: x()
|
|
110
113
|
});
|
|
111
114
|
}
|
|
112
|
-
const
|
|
115
|
+
const oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
113
116
|
__proto__: null,
|
|
114
|
-
ActionSchema:
|
|
115
|
-
BaseActionSchema:
|
|
116
|
-
DocumentFileSchema:
|
|
117
|
-
LoadStateActionInputSchema:
|
|
118
|
-
LoadStateActionSchema:
|
|
119
|
-
LoadStateActionStateInputSchema:
|
|
120
|
-
Load_StateSchema:
|
|
121
|
-
OperationSchema:
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
117
|
+
ActionSchema: yt,
|
|
118
|
+
BaseActionSchema: B,
|
|
119
|
+
DocumentFileSchema: jt,
|
|
120
|
+
LoadStateActionInputSchema: E,
|
|
121
|
+
LoadStateActionSchema: Z,
|
|
122
|
+
LoadStateActionStateInputSchema: H,
|
|
123
|
+
Load_StateSchema: L,
|
|
124
|
+
OperationSchema: wt,
|
|
125
|
+
OperationScopeSchema: x,
|
|
126
|
+
PruneActionInputSchema: N,
|
|
127
|
+
PruneActionSchema: K,
|
|
128
|
+
PruneSchema: U,
|
|
129
|
+
RedoActionInputSchema: A,
|
|
130
|
+
RedoActionSchema: W,
|
|
131
|
+
RedoSchema: J,
|
|
132
|
+
SetNameActionInputSchema: T,
|
|
133
|
+
SetNameActionSchema: G,
|
|
134
|
+
SetNameOperationSchema: St,
|
|
135
|
+
Set_NameSchema: $,
|
|
136
|
+
UndoActionInputSchema: z,
|
|
137
|
+
UndoActionSchema: Q,
|
|
138
|
+
UndoSchema: C,
|
|
139
|
+
definedNonNullAnySchema: vt,
|
|
140
|
+
isDefinedNonNullAny: R
|
|
137
141
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
138
|
-
function
|
|
142
|
+
function Ot(t, e) {
|
|
143
|
+
return { ...t, name: e };
|
|
144
|
+
}
|
|
145
|
+
function _t(t, e, i) {
|
|
146
|
+
const { scope: a, input: n } = e, s = t.revision[e.scope], p = Math.min(n, s), l = t.operations[a].slice(
|
|
147
|
+
0,
|
|
148
|
+
s - p
|
|
149
|
+
);
|
|
150
|
+
return {
|
|
151
|
+
...S(
|
|
152
|
+
t.initialState,
|
|
153
|
+
{
|
|
154
|
+
...t.operations,
|
|
155
|
+
[a]: l
|
|
156
|
+
},
|
|
157
|
+
i
|
|
158
|
+
),
|
|
159
|
+
operations: t.operations,
|
|
160
|
+
revision: {
|
|
161
|
+
...t.revision,
|
|
162
|
+
[a]: t.revision[a] - p
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
function Dt(t, e, i) {
|
|
167
|
+
const { scope: a, input: n } = e, s = t.operations[a].length - t.revision[a];
|
|
168
|
+
if (!s)
|
|
169
|
+
throw new Error("There is no UNDO operation to REDO");
|
|
170
|
+
const p = n < s ? n : s, l = t.operations[a].slice(
|
|
171
|
+
0,
|
|
172
|
+
t.revision[a] + p
|
|
173
|
+
);
|
|
174
|
+
return {
|
|
175
|
+
...S(
|
|
176
|
+
t.initialState,
|
|
177
|
+
{
|
|
178
|
+
...t.operations,
|
|
179
|
+
[a]: l
|
|
180
|
+
},
|
|
181
|
+
i
|
|
182
|
+
),
|
|
183
|
+
operations: t.operations,
|
|
184
|
+
revision: {
|
|
185
|
+
...t.revision,
|
|
186
|
+
[a]: t.revision[a] + p
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
function kt(t, e, i) {
|
|
191
|
+
const { scope: a } = e, n = t.operations[a];
|
|
192
|
+
let {
|
|
193
|
+
input: { start: s, end: p }
|
|
194
|
+
} = e;
|
|
195
|
+
s = s || 0, p = p || n.length;
|
|
196
|
+
const l = n.slice(s, p), r = n.slice(0, s), c = n.slice(p), u = S(
|
|
197
|
+
t.initialState,
|
|
198
|
+
{
|
|
199
|
+
...t.operations,
|
|
200
|
+
[a]: r.concat(l)
|
|
201
|
+
},
|
|
202
|
+
i
|
|
203
|
+
), { name: m, state: v } = u, d = r.length, D = r.length ? r[r.length - 1].timestamp : c.length ? c[0].timestamp : (/* @__PURE__ */ new Date()).toISOString();
|
|
204
|
+
return S(
|
|
205
|
+
t.initialState,
|
|
206
|
+
{
|
|
207
|
+
...t.operations,
|
|
208
|
+
[a]: [
|
|
209
|
+
...r,
|
|
210
|
+
{
|
|
211
|
+
...F(
|
|
212
|
+
{ name: m, state: v },
|
|
213
|
+
l.length
|
|
214
|
+
),
|
|
215
|
+
timestamp: D,
|
|
216
|
+
index: d,
|
|
217
|
+
hash: at({ state: v }, "global")
|
|
218
|
+
},
|
|
219
|
+
...c.map((y, ct) => ({
|
|
220
|
+
...y,
|
|
221
|
+
index: d + ct + 1
|
|
222
|
+
}))
|
|
223
|
+
]
|
|
224
|
+
},
|
|
225
|
+
i
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
function Et(t, e) {
|
|
229
|
+
return {
|
|
230
|
+
...t,
|
|
231
|
+
name: e.name,
|
|
232
|
+
state: e.state ?? { global: {}, local: {} }
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
const V = "SET_NAME", g = "UNDO", f = "REDO", h = "PRUNE", X = "LOAD_STATE";
|
|
236
|
+
function Nt(t) {
|
|
139
237
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
140
238
|
}
|
|
141
|
-
function
|
|
239
|
+
function O() {
|
|
142
240
|
this._types = /* @__PURE__ */ Object.create(null), this._extensions = /* @__PURE__ */ Object.create(null);
|
|
143
241
|
for (let t = 0; t < arguments.length; t++)
|
|
144
242
|
this.define(arguments[t]);
|
|
145
243
|
this.define = this.define.bind(this), this.getType = this.getType.bind(this), this.getExtension = this.getExtension.bind(this);
|
|
146
244
|
}
|
|
147
|
-
|
|
245
|
+
O.prototype.define = function(t, e) {
|
|
148
246
|
for (let i in t) {
|
|
149
|
-
let a = t[i].map(function(
|
|
150
|
-
return
|
|
247
|
+
let a = t[i].map(function(n) {
|
|
248
|
+
return n.toLowerCase();
|
|
151
249
|
});
|
|
152
250
|
i = i.toLowerCase();
|
|
153
|
-
for (let
|
|
154
|
-
const s = a[
|
|
251
|
+
for (let n = 0; n < a.length; n++) {
|
|
252
|
+
const s = a[n];
|
|
155
253
|
if (s[0] !== "*") {
|
|
156
254
|
if (!e && s in this._types)
|
|
157
255
|
throw new Error(
|
|
@@ -161,334 +259,240 @@ h.prototype.define = function(t, e) {
|
|
|
161
259
|
}
|
|
162
260
|
}
|
|
163
261
|
if (e || !this._extensions[i]) {
|
|
164
|
-
const
|
|
165
|
-
this._extensions[i] =
|
|
262
|
+
const n = a[0];
|
|
263
|
+
this._extensions[i] = n[0] !== "*" ? n : n.substr(1);
|
|
166
264
|
}
|
|
167
265
|
}
|
|
168
266
|
};
|
|
169
|
-
|
|
267
|
+
O.prototype.getType = function(t) {
|
|
170
268
|
t = String(t);
|
|
171
269
|
let e = t.replace(/^.*[/\\]/, "").toLowerCase(), i = e.replace(/^.*\./, "").toLowerCase(), a = e.length < t.length;
|
|
172
270
|
return (i.length < e.length - 1 || !a) && this._types[i] || null;
|
|
173
271
|
};
|
|
174
|
-
|
|
272
|
+
O.prototype.getExtension = function(t) {
|
|
175
273
|
return t = /^\s*([^;\s]*)/.test(t) && RegExp.$1, t && this._extensions[t.toLowerCase()] || null;
|
|
176
274
|
};
|
|
177
|
-
var bt = h, vt = { "application/andrew-inset": ["ez"], "application/applixware": ["aw"], "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/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/cu-seeme": ["cu"], "application/dash+xml": ["mpd"], "application/davmount+xml": ["davmount"], "application/docbook+xml": ["dbk"], "application/dssc+der": ["dssc"], "application/dssc+xml": ["xdssc"], "application/ecmascript": ["es", "ecma"], "application/emma+xml": ["emma"], "application/emotionml+xml": ["emotionml"], "application/epub+zip": ["epub"], "application/exi": ["exi"], "application/express": ["exp"], "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", "mjs"], "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/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": ["mp4s", "m4p"], "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-signature": ["asc", "sig"], "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/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/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/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/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/avif": ["avif"], "image/bmp": ["bmp"], "image/cgm": ["cgm"], "image/dicom-rle": ["drle"], "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"], "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/mesh": ["msh", "mesh", "silo"], "model/mtl": ["mtl"], "model/obj": ["obj"], "model/step+xml": ["stpx"], "model/step+zip": ["stpz"], "model/step-xml+zip": ["stpxz"], "model/stl": ["stl"], "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/jsx": ["jsx"], "text/less": ["less"], "text/markdown": ["markdown", "md"], "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/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"] };
|
|
178
|
-
let
|
|
179
|
-
var
|
|
180
|
-
const
|
|
181
|
-
function
|
|
182
|
-
const a =
|
|
183
|
-
return
|
|
275
|
+
var At = O, Tt = { "application/andrew-inset": ["ez"], "application/applixware": ["aw"], "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/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/cu-seeme": ["cu"], "application/dash+xml": ["mpd"], "application/davmount+xml": ["davmount"], "application/docbook+xml": ["dbk"], "application/dssc+der": ["dssc"], "application/dssc+xml": ["xdssc"], "application/ecmascript": ["es", "ecma"], "application/emma+xml": ["emma"], "application/emotionml+xml": ["emotionml"], "application/epub+zip": ["epub"], "application/exi": ["exi"], "application/express": ["exp"], "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", "mjs"], "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/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": ["mp4s", "m4p"], "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-signature": ["asc", "sig"], "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/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/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/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/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/avif": ["avif"], "image/bmp": ["bmp"], "image/cgm": ["cgm"], "image/dicom-rle": ["drle"], "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"], "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/mesh": ["msh", "mesh", "silo"], "model/mtl": ["mtl"], "model/obj": ["obj"], "model/step+xml": ["stpx"], "model/step+zip": ["stpz"], "model/step-xml+zip": ["stpxz"], "model/stl": ["stl"], "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/jsx": ["jsx"], "text/less": ["less"], "text/markdown": ["markdown", "md"], "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/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"] };
|
|
276
|
+
let zt = At;
|
|
277
|
+
var Ft = new zt(Tt);
|
|
278
|
+
const Pt = /* @__PURE__ */ Nt(Ft);
|
|
279
|
+
function qt(t, e, i) {
|
|
280
|
+
const a = bt(t, e);
|
|
281
|
+
return k.mkdirSync(t, { recursive: !0 }), new Promise((n, s) => {
|
|
184
282
|
try {
|
|
185
|
-
|
|
186
|
-
|
|
283
|
+
k.writeFile(a, i, {}, (p) => {
|
|
284
|
+
p ? s(p) : n(a);
|
|
187
285
|
});
|
|
188
|
-
} catch (
|
|
189
|
-
s(
|
|
286
|
+
} catch (p) {
|
|
287
|
+
s(p);
|
|
190
288
|
}
|
|
191
289
|
});
|
|
192
290
|
}
|
|
193
|
-
function
|
|
194
|
-
return
|
|
291
|
+
function Y(t) {
|
|
292
|
+
return k.readFileSync(t);
|
|
195
293
|
}
|
|
196
|
-
function
|
|
294
|
+
function It(t) {
|
|
197
295
|
return new Promise((e, i) => {
|
|
198
|
-
|
|
199
|
-
const
|
|
200
|
-
a.on("data", (
|
|
201
|
-
|
|
296
|
+
ht.get(t, (a) => {
|
|
297
|
+
const n = [], s = a.headers["content-type"];
|
|
298
|
+
a.on("data", (p) => {
|
|
299
|
+
n.push(p);
|
|
202
300
|
}), a.on("end", () => {
|
|
203
|
-
e({ buffer: Buffer.concat(
|
|
301
|
+
e({ buffer: Buffer.concat(n), mimeType: s });
|
|
204
302
|
});
|
|
205
303
|
}).on("error", (a) => {
|
|
206
304
|
i(a);
|
|
207
305
|
});
|
|
208
306
|
});
|
|
209
307
|
}
|
|
210
|
-
const
|
|
211
|
-
const e = new
|
|
308
|
+
const Mt = async (t) => Y(t), _ = (t, e = "sha1") => ft.createHash(e).update(t).digest("base64"), tt = async (t) => {
|
|
309
|
+
const e = new M(), { name: i, revision: a, documentType: n, created: s, lastModified: p } = t, l = {
|
|
212
310
|
name: i,
|
|
213
311
|
revision: a,
|
|
214
|
-
documentType:
|
|
312
|
+
documentType: n,
|
|
215
313
|
created: s,
|
|
216
|
-
lastModified:
|
|
314
|
+
lastModified: p
|
|
217
315
|
};
|
|
218
|
-
return e.file("header.json", JSON.stringify(
|
|
316
|
+
return e.file("header.json", JSON.stringify(l, null, 2)), e.file(
|
|
219
317
|
"state.json",
|
|
220
318
|
JSON.stringify(t.initialState || {}, null, 2)
|
|
221
|
-
), e.file("operations.json", JSON.stringify(t.operations, null, 2)), Object.keys(t.attachments).forEach((
|
|
222
|
-
const { data:
|
|
223
|
-
e.file(
|
|
319
|
+
), e.file("operations.json", JSON.stringify(t.operations, null, 2)), Object.keys(t.attachments).forEach((c) => {
|
|
320
|
+
const { data: u, ...m } = t.attachments[c];
|
|
321
|
+
e.file(c, u, {
|
|
224
322
|
base64: !0,
|
|
225
323
|
createFolders: !0,
|
|
226
|
-
comment: JSON.stringify(
|
|
324
|
+
comment: JSON.stringify(m)
|
|
227
325
|
});
|
|
228
326
|
}), e;
|
|
229
|
-
},
|
|
230
|
-
const s = await (await
|
|
327
|
+
}, Rt = async (t, e, i, a) => {
|
|
328
|
+
const s = await (await tt(t)).generateAsync({
|
|
231
329
|
type: "uint8array",
|
|
232
330
|
streamFiles: !0
|
|
233
|
-
}),
|
|
234
|
-
return
|
|
331
|
+
}), p = a ?? t.name, l = `.${i}.zip`;
|
|
332
|
+
return qt(
|
|
235
333
|
e,
|
|
236
|
-
|
|
334
|
+
p.endsWith(l) ? p : `${p}${l}`,
|
|
237
335
|
s
|
|
238
336
|
);
|
|
239
|
-
},
|
|
240
|
-
const a = await (await
|
|
241
|
-
await
|
|
242
|
-
},
|
|
243
|
-
const i =
|
|
244
|
-
return
|
|
245
|
-
},
|
|
246
|
-
const i = new
|
|
247
|
-
return await i.loadAsync(t),
|
|
337
|
+
}, se = async (t, e) => {
|
|
338
|
+
const a = await (await tt(t)).generateAsync({ type: "blob" }), n = await e.createWritable();
|
|
339
|
+
await n.write(a), await n.close();
|
|
340
|
+
}, q = async (t, e) => {
|
|
341
|
+
const i = Y(t);
|
|
342
|
+
return Lt(i, e);
|
|
343
|
+
}, Lt = async (t, e) => {
|
|
344
|
+
const i = new M();
|
|
345
|
+
return await i.loadAsync(t), Ut(i, e);
|
|
248
346
|
};
|
|
249
|
-
async function
|
|
347
|
+
async function Ut(t, e) {
|
|
250
348
|
const i = t.file("state.json");
|
|
251
349
|
if (!i)
|
|
252
350
|
throw new Error("Initial state not found");
|
|
253
|
-
const a = await i.async("string"),
|
|
254
|
-
let
|
|
255
|
-
s && (
|
|
256
|
-
const
|
|
257
|
-
if (!
|
|
351
|
+
const a = await i.async("string"), n = JSON.parse(a), s = t.file("header.json");
|
|
352
|
+
let p;
|
|
353
|
+
s && (p = JSON.parse(await s.async("string")));
|
|
354
|
+
const l = t.file("operations.json");
|
|
355
|
+
if (!l)
|
|
258
356
|
throw new Error("Operations history not found");
|
|
259
|
-
const
|
|
260
|
-
await
|
|
261
|
-
), m = {
|
|
262
|
-
...o,
|
|
263
|
-
...l,
|
|
264
|
-
initialState: o,
|
|
265
|
-
operations: { global: [], local: [] },
|
|
266
|
-
attachments: { ...o.attachments }
|
|
267
|
-
};
|
|
268
|
-
let r = c.global.concat(c.local).slice(0, l == null ? void 0 : l.revision).reduce(
|
|
269
|
-
(j, it) => e(j, it),
|
|
270
|
-
m
|
|
357
|
+
const r = JSON.parse(
|
|
358
|
+
await l.async("string")
|
|
271
359
|
);
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
}),
|
|
360
|
+
let c = nt(
|
|
361
|
+
n,
|
|
362
|
+
r,
|
|
363
|
+
e,
|
|
364
|
+
void 0,
|
|
365
|
+
p
|
|
366
|
+
);
|
|
367
|
+
return p && (c = {
|
|
368
|
+
...c,
|
|
369
|
+
...p
|
|
370
|
+
}), c;
|
|
283
371
|
}
|
|
284
|
-
function
|
|
372
|
+
function et(t) {
|
|
285
373
|
const e = t.replace(/^.*\./, "") || void 0, i = t.replace(/^.*[/\\]/, "") || void 0;
|
|
286
374
|
return { extension: e, fileName: i };
|
|
287
375
|
}
|
|
288
|
-
async function
|
|
289
|
-
const { buffer: e, mimeType: i = "application/octet-stream" } = await
|
|
376
|
+
async function pe(t) {
|
|
377
|
+
const { buffer: e, mimeType: i = "application/octet-stream" } = await It(t), a = et(t), n = e.toString("base64");
|
|
290
378
|
return {
|
|
291
|
-
data:
|
|
292
|
-
hash:
|
|
379
|
+
data: n,
|
|
380
|
+
hash: _(n),
|
|
293
381
|
mimeType: i,
|
|
294
382
|
...a
|
|
295
383
|
};
|
|
296
384
|
}
|
|
297
|
-
async function
|
|
298
|
-
const e = await
|
|
299
|
-
return { data:
|
|
300
|
-
}
|
|
301
|
-
function f(t, e, i, a) {
|
|
302
|
-
const o = $t(t), s = Ut(i);
|
|
303
|
-
return e.global.concat(e.local).reduce(
|
|
304
|
-
(l, p) => s(l, p, a),
|
|
305
|
-
o
|
|
306
|
-
);
|
|
385
|
+
async function le(t) {
|
|
386
|
+
const e = await Mt(t), i = Pt.getType(t) || "application/octet-stream", a = et(t), n = e.toString("base64");
|
|
387
|
+
return { data: n, hash: _(n), mimeType: i, ...a };
|
|
307
388
|
}
|
|
308
|
-
function
|
|
309
|
-
|
|
389
|
+
function Jt(t, e) {
|
|
390
|
+
const i = t.revision[e.scope];
|
|
391
|
+
return [g, f, h].includes(e.type) ? i : i + 1;
|
|
310
392
|
}
|
|
311
|
-
function
|
|
312
|
-
const a = Math.min(e, t.revision), o = t.operations.global.slice(
|
|
313
|
-
0,
|
|
314
|
-
t.revision - a
|
|
315
|
-
);
|
|
316
|
-
return {
|
|
317
|
-
...f(
|
|
318
|
-
t.initialState,
|
|
319
|
-
{
|
|
320
|
-
global: o,
|
|
321
|
-
local: t.operations.local
|
|
322
|
-
},
|
|
323
|
-
i
|
|
324
|
-
),
|
|
325
|
-
operations: t.operations,
|
|
326
|
-
revision: t.revision - a
|
|
327
|
-
};
|
|
328
|
-
}
|
|
329
|
-
function Tt(t, e, i) {
|
|
330
|
-
const a = t.operations.global.length - t.revision;
|
|
331
|
-
if (!a)
|
|
332
|
-
throw new Error("There is no UNDO operation to REDO");
|
|
333
|
-
const o = e < a ? e : a, s = t.operations.global.slice(
|
|
334
|
-
0,
|
|
335
|
-
t.revision + o
|
|
336
|
-
);
|
|
337
|
-
return {
|
|
338
|
-
...f(
|
|
339
|
-
t.initialState,
|
|
340
|
-
{
|
|
341
|
-
global: s,
|
|
342
|
-
local: t.operations.local
|
|
343
|
-
},
|
|
344
|
-
i
|
|
345
|
-
),
|
|
346
|
-
operations: t.operations,
|
|
347
|
-
revision: t.revision + o
|
|
348
|
-
};
|
|
349
|
-
}
|
|
350
|
-
function zt(t, e, i, a) {
|
|
351
|
-
e = e || 0, i = i || t.operations.global.length;
|
|
352
|
-
const o = t.operations.global.slice(e, i), s = t.operations.global.slice(0, e), l = t.operations.global.slice(i), p = f(
|
|
353
|
-
t.initialState,
|
|
354
|
-
{
|
|
355
|
-
global: s.concat(o),
|
|
356
|
-
local: t.operations.local
|
|
357
|
-
},
|
|
358
|
-
a
|
|
359
|
-
), { name: c, state: m } = p;
|
|
360
|
-
return f(
|
|
361
|
-
t.initialState,
|
|
362
|
-
{
|
|
363
|
-
global: [
|
|
364
|
-
...s,
|
|
365
|
-
E({ name: c, state: m }, o.length),
|
|
366
|
-
...l
|
|
367
|
-
],
|
|
368
|
-
local: t.operations.local
|
|
369
|
-
},
|
|
370
|
-
a
|
|
371
|
-
);
|
|
372
|
-
}
|
|
373
|
-
function Ft(t, e) {
|
|
393
|
+
function $t(t, e) {
|
|
374
394
|
return {
|
|
375
395
|
...t,
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
}
|
|
380
|
-
const Q = "SET_NAME", v = "UNDO", y = "REDO", u = "PRUNE", V = "LOAD_STATE";
|
|
381
|
-
function Pt(t, e) {
|
|
382
|
-
return [v, y, u].includes(e.type) ? t.revision : t.revision + 1;
|
|
383
|
-
}
|
|
384
|
-
function qt(t, e) {
|
|
385
|
-
return {
|
|
386
|
-
...t,
|
|
387
|
-
revision: Pt(t, e),
|
|
396
|
+
revision: {
|
|
397
|
+
...t.revision,
|
|
398
|
+
[e.scope]: Jt(t, e)
|
|
399
|
+
},
|
|
388
400
|
lastModified: (/* @__PURE__ */ new Date()).toISOString()
|
|
389
401
|
};
|
|
390
402
|
}
|
|
391
|
-
function
|
|
392
|
-
if ([
|
|
403
|
+
function Ct(t, e) {
|
|
404
|
+
if ([g, f, h].includes(e.type))
|
|
393
405
|
return t;
|
|
394
|
-
const i = t.operations.
|
|
406
|
+
const { scope: i } = e, a = t.operations[i].slice(
|
|
395
407
|
0,
|
|
396
|
-
t.revision
|
|
397
|
-
)
|
|
398
|
-
return
|
|
399
|
-
...e,
|
|
400
|
-
index: i.length,
|
|
401
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
402
|
-
hash: "",
|
|
403
|
-
scope: "global"
|
|
404
|
-
}) : e.scope === "local" && a.push({
|
|
408
|
+
t.revision[i]
|
|
409
|
+
);
|
|
410
|
+
return a.push({
|
|
405
411
|
...e,
|
|
406
412
|
index: a.length,
|
|
407
413
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
408
414
|
hash: "",
|
|
409
|
-
scope:
|
|
415
|
+
scope: i
|
|
410
416
|
}), {
|
|
411
417
|
...t,
|
|
412
|
-
operations: {
|
|
413
|
-
global: i,
|
|
414
|
-
local: a
|
|
415
|
-
}
|
|
418
|
+
operations: { ...t.operations, [i]: a }
|
|
416
419
|
};
|
|
417
420
|
}
|
|
418
|
-
function
|
|
419
|
-
let i =
|
|
420
|
-
return
|
|
421
|
-
}
|
|
422
|
-
function
|
|
423
|
-
switch (
|
|
424
|
-
case Q:
|
|
425
|
-
return Nt(t, e.input);
|
|
426
|
-
case v:
|
|
427
|
-
return At(t, e.input, i);
|
|
428
|
-
case y:
|
|
429
|
-
return Tt(t, e.input, i);
|
|
430
|
-
case u:
|
|
431
|
-
return zt(
|
|
432
|
-
t,
|
|
433
|
-
e.input.start,
|
|
434
|
-
e.input.end,
|
|
435
|
-
i
|
|
436
|
-
);
|
|
421
|
+
function Bt(t, e) {
|
|
422
|
+
let i = Ct(t, e);
|
|
423
|
+
return i = $t(i, e), i;
|
|
424
|
+
}
|
|
425
|
+
function Zt(t, e, i) {
|
|
426
|
+
switch (B().parse(e), e.type) {
|
|
437
427
|
case V:
|
|
438
|
-
return
|
|
428
|
+
return Ot(t, e.input);
|
|
429
|
+
case g:
|
|
430
|
+
return _t(t, e, i);
|
|
431
|
+
case f:
|
|
432
|
+
return Dt(t, e, i);
|
|
433
|
+
case h:
|
|
434
|
+
return kt(t, e, i);
|
|
435
|
+
case X:
|
|
436
|
+
return Et(t, e.input.state);
|
|
439
437
|
default:
|
|
440
438
|
return t;
|
|
441
439
|
}
|
|
442
440
|
}
|
|
443
|
-
function
|
|
444
|
-
let
|
|
445
|
-
return
|
|
446
|
-
const
|
|
447
|
-
if (
|
|
448
|
-
return
|
|
449
|
-
...
|
|
450
|
-
state:
|
|
441
|
+
function it(t, e, i, a) {
|
|
442
|
+
let n = t;
|
|
443
|
+
return I(e) && (n = Zt(n, e, i)), n = Bt(n, e), n = P(n, (s) => {
|
|
444
|
+
const p = i(s.state, e, a);
|
|
445
|
+
if (p)
|
|
446
|
+
return dt({
|
|
447
|
+
...n,
|
|
448
|
+
state: p
|
|
451
449
|
});
|
|
452
|
-
}),
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
450
|
+
}), P(n, (s) => {
|
|
451
|
+
if ([g, f, h].includes(e.type))
|
|
452
|
+
return s;
|
|
453
|
+
const p = e.scope || "global";
|
|
454
|
+
s.operations[p][s.operations[p].length - 1].hash = at(s, p), !I(e) && e.attachments && e.attachments.forEach((l) => {
|
|
455
|
+
const { hash: r, ...c } = l;
|
|
456
|
+
s.attachments[r] = {
|
|
456
457
|
...c
|
|
457
458
|
};
|
|
458
459
|
});
|
|
459
460
|
});
|
|
460
461
|
}
|
|
461
|
-
function
|
|
462
|
-
return [
|
|
462
|
+
function I(t) {
|
|
463
|
+
return [V, g, f, h, X].includes(t.type);
|
|
463
464
|
}
|
|
464
|
-
function
|
|
465
|
+
function b(t, e, i, a, n = "global") {
|
|
465
466
|
if (!t)
|
|
466
467
|
throw new Error("Empty action type");
|
|
467
468
|
if (typeof t != "string")
|
|
468
469
|
throw new Error(`Invalid action type: ${t}`);
|
|
469
|
-
const s = { type: t, input: e, scope:
|
|
470
|
+
const s = { type: t, input: e, scope: n };
|
|
470
471
|
i && (s.attachments = i);
|
|
471
472
|
try {
|
|
472
473
|
a == null || a().parse(s.input);
|
|
473
|
-
} catch (
|
|
474
|
-
throw new Error(`Invalid action input: ${
|
|
474
|
+
} catch (p) {
|
|
475
|
+
throw new Error(`Invalid action input: ${p}`);
|
|
475
476
|
}
|
|
476
477
|
return s;
|
|
477
478
|
}
|
|
478
|
-
function
|
|
479
|
-
return (i, a,
|
|
479
|
+
function Ht(t, e = it) {
|
|
480
|
+
return (i, a, n) => e(i, a, t, n);
|
|
480
481
|
}
|
|
481
|
-
const
|
|
482
|
+
const Kt = (t, e) => ({
|
|
482
483
|
name: "",
|
|
483
484
|
documentType: "",
|
|
484
|
-
revision:
|
|
485
|
+
revision: {
|
|
486
|
+
global: 0,
|
|
487
|
+
local: 0
|
|
488
|
+
},
|
|
485
489
|
created: (/* @__PURE__ */ new Date()).toISOString(),
|
|
486
490
|
lastModified: (/* @__PURE__ */ new Date()).toISOString(),
|
|
487
491
|
attachments: {},
|
|
488
492
|
...t,
|
|
489
493
|
state: (e == null ? void 0 : e(t == null ? void 0 : t.state)) ?? (t == null ? void 0 : t.state) ?? { global: {}, local: {} }
|
|
490
|
-
}),
|
|
491
|
-
const i =
|
|
494
|
+
}), Wt = (t, e) => {
|
|
495
|
+
const i = Kt(
|
|
492
496
|
t,
|
|
493
497
|
e
|
|
494
498
|
);
|
|
@@ -497,50 +501,107 @@ const Jt = (t, e) => ({
|
|
|
497
501
|
initialState: i,
|
|
498
502
|
operations: { global: [], local: [] }
|
|
499
503
|
};
|
|
500
|
-
},
|
|
501
|
-
nt(
|
|
502
|
-
e === "local" ? t.state.local : t.state.global
|
|
503
|
-
)
|
|
504
|
-
), ie = (t, e = 1e3) => {
|
|
504
|
+
}, at = (t, e = "global") => _(ut(t.state[e])), ce = (t, e = 1e3) => {
|
|
505
505
|
const i = Math.random() * e;
|
|
506
|
-
return
|
|
506
|
+
return _(`${(t ?? /* @__PURE__ */ new Date()).toISOString()}${i}`);
|
|
507
507
|
};
|
|
508
|
-
function
|
|
509
|
-
return
|
|
508
|
+
function w(t) {
|
|
509
|
+
return xt(gt(t, !0));
|
|
510
|
+
}
|
|
511
|
+
function Gt(t) {
|
|
512
|
+
return Object.values(t).flatMap((e) => e).sort(
|
|
513
|
+
(e, i) => new Date(e.timestamp).getTime() - new Date(i.timestamp).getTime()
|
|
514
|
+
);
|
|
510
515
|
}
|
|
511
|
-
|
|
516
|
+
function S(t, e, i, a, n, s = it) {
|
|
517
|
+
const p = Ht(i, s);
|
|
518
|
+
return nt(
|
|
519
|
+
t,
|
|
520
|
+
e,
|
|
521
|
+
p,
|
|
522
|
+
a,
|
|
523
|
+
n
|
|
524
|
+
);
|
|
525
|
+
}
|
|
526
|
+
function nt(t, e, i, a, n) {
|
|
527
|
+
const s = Wt(t), p = Object.keys(e).reduce((c, u) => {
|
|
528
|
+
const m = u;
|
|
529
|
+
return {
|
|
530
|
+
...c,
|
|
531
|
+
[m]: e[m].slice(0, n == null ? void 0 : n.revision[m])
|
|
532
|
+
};
|
|
533
|
+
}, {}), l = Gt(p).reduce(
|
|
534
|
+
(c, u) => i(c, u, a),
|
|
535
|
+
s
|
|
536
|
+
), r = Object.keys(
|
|
537
|
+
l.operations
|
|
538
|
+
).reduce(
|
|
539
|
+
(c, u) => {
|
|
540
|
+
const m = u, v = n && n.revision[m] < e[m].length ? e[m].slice(n.revision[m]) : [];
|
|
541
|
+
return {
|
|
542
|
+
...c,
|
|
543
|
+
[m]: [
|
|
544
|
+
...l.operations[m].map((d, D) => {
|
|
545
|
+
var y;
|
|
546
|
+
return {
|
|
547
|
+
...d,
|
|
548
|
+
timestamp: ((y = e[m][D]) == null ? void 0 : y.timestamp) ?? d.timestamp
|
|
549
|
+
};
|
|
550
|
+
}),
|
|
551
|
+
...v
|
|
552
|
+
]
|
|
553
|
+
};
|
|
554
|
+
},
|
|
555
|
+
{ global: [], local: [] }
|
|
556
|
+
);
|
|
557
|
+
return { ...l, operations: r };
|
|
558
|
+
}
|
|
559
|
+
const ot = (t) => b(
|
|
512
560
|
"SET_NAME",
|
|
513
561
|
t,
|
|
514
562
|
void 0,
|
|
515
|
-
|
|
516
|
-
),
|
|
563
|
+
T
|
|
564
|
+
), st = (t = 1, e = "global") => b(
|
|
565
|
+
"UNDO",
|
|
566
|
+
t,
|
|
567
|
+
void 0,
|
|
568
|
+
z,
|
|
569
|
+
e
|
|
570
|
+
), pt = (t = 1, e = "global") => b(
|
|
571
|
+
"REDO",
|
|
572
|
+
t,
|
|
573
|
+
void 0,
|
|
574
|
+
A,
|
|
575
|
+
e
|
|
576
|
+
), lt = (t, e, i = "global") => b(
|
|
517
577
|
"PRUNE",
|
|
518
578
|
{ start: t, end: e },
|
|
519
579
|
void 0,
|
|
520
|
-
|
|
521
|
-
|
|
580
|
+
N,
|
|
581
|
+
i
|
|
582
|
+
), F = (t, e) => b(
|
|
522
583
|
"LOAD_STATE",
|
|
523
584
|
{ state: t, operations: e },
|
|
524
585
|
void 0,
|
|
525
|
-
|
|
526
|
-
),
|
|
586
|
+
E
|
|
587
|
+
), re = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
527
588
|
__proto__: null,
|
|
528
|
-
loadState:
|
|
529
|
-
prune:
|
|
530
|
-
redo:
|
|
531
|
-
setName:
|
|
532
|
-
undo:
|
|
589
|
+
loadState: F,
|
|
590
|
+
prune: lt,
|
|
591
|
+
redo: pt,
|
|
592
|
+
setName: ot,
|
|
593
|
+
undo: st
|
|
533
594
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
534
|
-
class
|
|
595
|
+
class me {
|
|
535
596
|
/**
|
|
536
597
|
* Constructs a BaseDocument instance with an initial state.
|
|
537
598
|
* @param reducer - The reducer function that updates the state.
|
|
538
599
|
* @param document - The initial state of the document.
|
|
539
600
|
*/
|
|
540
601
|
constructor(e, i, a) {
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
602
|
+
j(this, "_document");
|
|
603
|
+
j(this, "_reducer");
|
|
604
|
+
j(this, "_signalDispatch");
|
|
544
605
|
this._reducer = e, this._document = i, this._signalDispatch = a;
|
|
545
606
|
}
|
|
546
607
|
/**
|
|
@@ -562,14 +623,14 @@ class oe {
|
|
|
562
623
|
* @returns The file path where the state was saved.
|
|
563
624
|
*/
|
|
564
625
|
saveToFile(e, i, a) {
|
|
565
|
-
return
|
|
626
|
+
return Rt(this._document, e, i, a);
|
|
566
627
|
}
|
|
567
628
|
/**
|
|
568
629
|
* Loads the state of the document from a file.
|
|
569
630
|
* @param path - The file path where the state is stored.
|
|
570
631
|
*/
|
|
571
632
|
async loadFromFile(e) {
|
|
572
|
-
this._document = await
|
|
633
|
+
this._document = await q(e, this._reducer);
|
|
573
634
|
}
|
|
574
635
|
/**
|
|
575
636
|
* Loads the state of the document from a file and returns it.
|
|
@@ -578,19 +639,19 @@ class oe {
|
|
|
578
639
|
* @returns The state of the document.
|
|
579
640
|
*/
|
|
580
641
|
static async stateFromFile(e, i) {
|
|
581
|
-
return await
|
|
642
|
+
return await q(e, i);
|
|
582
643
|
}
|
|
583
644
|
/**
|
|
584
645
|
* Gets the current state of the document.
|
|
585
646
|
*/
|
|
586
647
|
get state() {
|
|
587
|
-
return
|
|
648
|
+
return w(this._document.state);
|
|
588
649
|
}
|
|
589
650
|
/**
|
|
590
651
|
* Gets the list of operations performed on the document.
|
|
591
652
|
*/
|
|
592
653
|
get operations() {
|
|
593
|
-
return
|
|
654
|
+
return w(this._document.operations);
|
|
594
655
|
}
|
|
595
656
|
/**
|
|
596
657
|
* Gets the name of the document.
|
|
@@ -617,22 +678,25 @@ class oe {
|
|
|
617
678
|
return this._document.lastModified;
|
|
618
679
|
}
|
|
619
680
|
/**
|
|
620
|
-
* Gets the revision number of the document.
|
|
681
|
+
* Gets the global revision number of the document.
|
|
621
682
|
*/
|
|
622
683
|
get revision() {
|
|
623
|
-
return this._document.revision;
|
|
684
|
+
return this._document.revision.global;
|
|
685
|
+
}
|
|
686
|
+
getRevision(e) {
|
|
687
|
+
return this._document.revision[e];
|
|
624
688
|
}
|
|
625
689
|
/**
|
|
626
690
|
* Gets the initial state of the document.
|
|
627
691
|
*/
|
|
628
692
|
get initialState() {
|
|
629
|
-
return
|
|
693
|
+
return w(this._document.initialState);
|
|
630
694
|
}
|
|
631
695
|
/**
|
|
632
696
|
* Returns the current document as an object
|
|
633
697
|
*/
|
|
634
698
|
toDocument() {
|
|
635
|
-
return
|
|
699
|
+
return w(this._document);
|
|
636
700
|
}
|
|
637
701
|
/**
|
|
638
702
|
* Gets the attachment associated with the given key.
|
|
@@ -646,21 +710,21 @@ class oe {
|
|
|
646
710
|
* @param name - The new name of the document.
|
|
647
711
|
*/
|
|
648
712
|
setName(e) {
|
|
649
|
-
return this.dispatch(
|
|
713
|
+
return this.dispatch(ot(e)), this;
|
|
650
714
|
}
|
|
651
715
|
/**
|
|
652
716
|
* Reverts a number of actions from the document.
|
|
653
717
|
* @param count - The number of actions to revert.
|
|
654
718
|
*/
|
|
655
719
|
undo(e) {
|
|
656
|
-
return this.dispatch(
|
|
720
|
+
return this.dispatch(st(e)), this;
|
|
657
721
|
}
|
|
658
722
|
/**
|
|
659
723
|
* Reapplies a number of actions to the document.
|
|
660
724
|
* @param count - The number of actions to reapply.
|
|
661
725
|
*/
|
|
662
726
|
redo(e) {
|
|
663
|
-
return this.dispatch(
|
|
727
|
+
return this.dispatch(pt(e)), this;
|
|
664
728
|
}
|
|
665
729
|
/**
|
|
666
730
|
* Removes a range of operations from the document.
|
|
@@ -668,7 +732,7 @@ class oe {
|
|
|
668
732
|
* @param end - The ending index of the range to remove.
|
|
669
733
|
*/
|
|
670
734
|
prune(e, i) {
|
|
671
|
-
return this.dispatch(
|
|
735
|
+
return this.dispatch(lt(e, i)), this;
|
|
672
736
|
}
|
|
673
737
|
/**
|
|
674
738
|
* Loads a document state and a set of operations.
|
|
@@ -676,10 +740,10 @@ class oe {
|
|
|
676
740
|
* @param operations - The operations to apply to the document.
|
|
677
741
|
*/
|
|
678
742
|
loadState(e, i) {
|
|
679
|
-
return this.dispatch(
|
|
743
|
+
return this.dispatch(F(e, i)), this;
|
|
680
744
|
}
|
|
681
745
|
}
|
|
682
|
-
function
|
|
746
|
+
function ue(t, e) {
|
|
683
747
|
e.forEach((i) => {
|
|
684
748
|
Object.getOwnPropertyNames(i.prototype).forEach((a) => {
|
|
685
749
|
Object.defineProperty(
|
|
@@ -691,24 +755,27 @@ function ne(t, e) {
|
|
|
691
755
|
});
|
|
692
756
|
}
|
|
693
757
|
export {
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
758
|
+
me as B,
|
|
759
|
+
Kt as a,
|
|
760
|
+
Wt as b,
|
|
761
|
+
Ht as c,
|
|
762
|
+
se as d,
|
|
763
|
+
Lt as e,
|
|
764
|
+
b as f,
|
|
765
|
+
ue as g,
|
|
766
|
+
re as h,
|
|
767
|
+
I as i,
|
|
768
|
+
tt as j,
|
|
769
|
+
le as k,
|
|
770
|
+
q as l,
|
|
771
|
+
pe as m,
|
|
772
|
+
at as n,
|
|
773
|
+
ce as o,
|
|
774
|
+
nt as p,
|
|
775
|
+
S as q,
|
|
776
|
+
w as r,
|
|
777
|
+
Rt as s,
|
|
778
|
+
Gt as t,
|
|
779
|
+
it as u,
|
|
780
|
+
oe as z
|
|
714
781
|
};
|