playhtml 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.d.ts +16 -1
- package/dist/playhtml.es.js +645 -610
- package/package.json +1 -1
package/dist/playhtml.es.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
var so = Object.defineProperty;
|
|
2
2
|
var ro = (e, t, n) => t in e ? so(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
-
var w = (e, t, n) => (ro(e, typeof t != "symbol" ? t + "" : t, n), n),
|
|
3
|
+
var w = (e, t, n) => (ro(e, typeof t != "symbol" ? t + "" : t, n), n), _s = (e, t, n) => {
|
|
4
4
|
if (!t.has(e))
|
|
5
5
|
throw TypeError("Cannot " + n);
|
|
6
6
|
};
|
|
7
|
-
var Oe = (e, t, n) => (
|
|
7
|
+
var Oe = (e, t, n) => (_s(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Es = (e, t, n) => {
|
|
8
8
|
if (t.has(e))
|
|
9
9
|
throw TypeError("Cannot add the same private member more than once");
|
|
10
10
|
t instanceof WeakSet ? t.add(e) : t.set(e, n);
|
|
11
|
-
},
|
|
12
|
-
var Me = 1e6, io = "y-pk-batch",
|
|
11
|
+
}, vs = (e, t, n, s) => (_s(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n);
|
|
12
|
+
var Me = 1e6, io = "y-pk-batch", As = !1, ne = (e, t) => {
|
|
13
13
|
if (e.byteLength <= Me) {
|
|
14
14
|
t.send(e);
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
As || (console.warn(
|
|
18
18
|
"[y-partykit]",
|
|
19
19
|
"The Y.js update size exceeds 1MB, which is the maximum size for an individual update. The update will be split into chunks. This is an experimental feature.",
|
|
20
20
|
`Message size: ${(e.byteLength / 1e3 / 1e3).toFixed(1)}MB`
|
|
21
|
-
),
|
|
21
|
+
), As = !0);
|
|
22
22
|
const n = (Date.now() + Math.random()).toString(36).substring(10), s = Math.ceil(e.byteLength / Me);
|
|
23
23
|
t.send(
|
|
24
|
-
|
|
24
|
+
Ds({
|
|
25
25
|
id: n,
|
|
26
26
|
type: "start",
|
|
27
27
|
size: e.byteLength,
|
|
@@ -34,7 +34,7 @@ var Me = 1e6, io = "y-pk-batch", vs = !1, ne = (e, t) => {
|
|
|
34
34
|
t.send(l), i += 1, r += l.byteLength;
|
|
35
35
|
}
|
|
36
36
|
t.send(
|
|
37
|
-
|
|
37
|
+
Ds({
|
|
38
38
|
id: n,
|
|
39
39
|
type: "end",
|
|
40
40
|
size: r,
|
|
@@ -42,10 +42,10 @@ var Me = 1e6, io = "y-pk-batch", vs = !1, ne = (e, t) => {
|
|
|
42
42
|
})
|
|
43
43
|
);
|
|
44
44
|
};
|
|
45
|
-
function
|
|
45
|
+
function Ds(e) {
|
|
46
46
|
return `${io}#${JSON.stringify(e)}`;
|
|
47
47
|
}
|
|
48
|
-
const z = () => /* @__PURE__ */ new Map(),
|
|
48
|
+
const z = () => /* @__PURE__ */ new Map(), An = (e) => {
|
|
49
49
|
const t = z();
|
|
50
50
|
return e.forEach((n, s) => {
|
|
51
51
|
t.set(s, n);
|
|
@@ -66,7 +66,7 @@ const z = () => /* @__PURE__ */ new Map(), vn = (e) => {
|
|
|
66
66
|
}, wt = () => /* @__PURE__ */ new Set(), hn = (e) => e[e.length - 1], co = (e, t) => {
|
|
67
67
|
for (let n = 0; n < t.length; n++)
|
|
68
68
|
e.push(t[n]);
|
|
69
|
-
}, ot = Array.from, ao = Array.isArray, ho = String.fromCharCode, uo = (e) => e.toLowerCase(), fo = /^\s*/g, go = (e) => e.replace(fo, ""), po = /([A-Z])/g,
|
|
69
|
+
}, ot = Array.from, ao = Array.isArray, ho = String.fromCharCode, uo = (e) => e.toLowerCase(), fo = /^\s*/g, go = (e) => e.replace(fo, ""), po = /([A-Z])/g, xs = (e, t) => go(e.replace(po, (n) => `${t}${uo(n)}`)), yo = (e) => {
|
|
70
70
|
const t = unescape(encodeURIComponent(e)), n = t.length, s = new Uint8Array(n);
|
|
71
71
|
for (let r = 0; r < n; r++)
|
|
72
72
|
s[r] = /** @type {number} */
|
|
@@ -78,7 +78,7 @@ const z = () => /* @__PURE__ */ new Map(), vn = (e) => {
|
|
|
78
78
|
), mo = (e) => ce.encode(e), wo = ce ? mo : yo;
|
|
79
79
|
let se = typeof TextDecoder > "u" ? null : new TextDecoder("utf-8", { fatal: !0, ignoreBOM: !0 });
|
|
80
80
|
se && se.decode(new Uint8Array()).length === 1 && (se = null);
|
|
81
|
-
const
|
|
81
|
+
const Os = (e) => e === void 0 ? null : e;
|
|
82
82
|
class bo {
|
|
83
83
|
constructor() {
|
|
84
84
|
this.map = /* @__PURE__ */ new Map();
|
|
@@ -97,20 +97,20 @@ class bo {
|
|
|
97
97
|
return this.map.get(t);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
let Sr = new bo(),
|
|
100
|
+
let Sr = new bo(), Wn = !0;
|
|
101
101
|
try {
|
|
102
|
-
typeof localStorage < "u" && localStorage && (Sr = localStorage,
|
|
102
|
+
typeof localStorage < "u" && localStorage && (Sr = localStorage, Wn = !1);
|
|
103
103
|
} catch {
|
|
104
104
|
}
|
|
105
|
-
const
|
|
105
|
+
const Cr = Sr, So = (e) => Wn || addEventListener(
|
|
106
106
|
"storage",
|
|
107
107
|
/** @type {any} */
|
|
108
108
|
e
|
|
109
|
-
),
|
|
109
|
+
), Co = (e) => Wn || removeEventListener(
|
|
110
110
|
"storage",
|
|
111
111
|
/** @type {any} */
|
|
112
112
|
e
|
|
113
|
-
),
|
|
113
|
+
), ko = Object.assign, kr = Object.keys, _o = (e, t) => {
|
|
114
114
|
for (const n in e)
|
|
115
115
|
t(e[n], n);
|
|
116
116
|
}, Eo = (e, t) => {
|
|
@@ -118,7 +118,7 @@ const kr = Sr, So = (e) => Gn || addEventListener(
|
|
|
118
118
|
for (const s in e)
|
|
119
119
|
n.push(t(e[s], s));
|
|
120
120
|
return n;
|
|
121
|
-
},
|
|
121
|
+
}, Ms = (e) => kr(e).length, Is = (e) => kr(e).length, vo = (e) => {
|
|
122
122
|
for (const t in e)
|
|
123
123
|
return !1;
|
|
124
124
|
return !0;
|
|
@@ -127,20 +127,20 @@ const kr = Sr, So = (e) => Gn || addEventListener(
|
|
|
127
127
|
if (!t(e[n], n))
|
|
128
128
|
return !1;
|
|
129
129
|
return !0;
|
|
130
|
-
}, _r = (e, t) => Object.prototype.hasOwnProperty.call(e, t), Do = (e, t) => e === t ||
|
|
130
|
+
}, _r = (e, t) => Object.prototype.hasOwnProperty.call(e, t), Do = (e, t) => e === t || Is(e) === Is(t) && Ao(e, (n, s) => (n !== void 0 || _r(t, s)) && t[s] === n), Ls = Symbol("Equality"), Yn = (e, t, n = 0) => {
|
|
131
131
|
try {
|
|
132
132
|
for (; n < e.length; n++)
|
|
133
133
|
e[n](...t);
|
|
134
134
|
} finally {
|
|
135
|
-
n < e.length &&
|
|
135
|
+
n < e.length && Yn(e, t, n + 1);
|
|
136
136
|
}
|
|
137
137
|
}, xo = (e) => e, re = (e, t) => {
|
|
138
138
|
if (e === t)
|
|
139
139
|
return !0;
|
|
140
140
|
if (e == null || t == null || e.constructor !== t.constructor)
|
|
141
141
|
return !1;
|
|
142
|
-
if (e[
|
|
143
|
-
return e[
|
|
142
|
+
if (e[Ls] != null)
|
|
143
|
+
return e[Ls](t);
|
|
144
144
|
switch (e.constructor) {
|
|
145
145
|
case ArrayBuffer:
|
|
146
146
|
e = new Uint8Array(e), t = new Uint8Array(t);
|
|
@@ -169,7 +169,7 @@ const kr = Sr, So = (e) => Gn || addEventListener(
|
|
|
169
169
|
break;
|
|
170
170
|
}
|
|
171
171
|
case Object:
|
|
172
|
-
if (
|
|
172
|
+
if (Ms(e) !== Ms(t))
|
|
173
173
|
return !1;
|
|
174
174
|
for (const n in e)
|
|
175
175
|
if (!_r(e, n) || !re(e[n], t[n]))
|
|
@@ -203,26 +203,26 @@ const Mo = () => {
|
|
|
203
203
|
typeof location == "object" ? (Y = z(), (location.search || "?").slice(1).split("&").forEach((e) => {
|
|
204
204
|
if (e.length !== 0) {
|
|
205
205
|
const [t, n] = e.split("=");
|
|
206
|
-
Y.set(`--${
|
|
206
|
+
Y.set(`--${xs(t, "-")}`, n), Y.set(`-${xs(t, "-")}`, n);
|
|
207
207
|
}
|
|
208
208
|
})) : Y = z();
|
|
209
209
|
return Y;
|
|
210
|
-
},
|
|
210
|
+
}, Dn = (e) => Mo().has(e), xn = (e) => Os(Kt ? process.env[e.toUpperCase().replaceAll("-", "_")] : Cr.getItem(e)), vr = (e) => Dn("--" + e) || xn(e) !== null;
|
|
211
211
|
vr("production");
|
|
212
|
-
const Io = Kt && Oo(process.env.FORCE_COLOR, ["true", "1", "2"]), Lo = Io || !
|
|
213
|
-
!vr("no-color") && (!Kt || process.stdout.isTTY) && (!Kt ||
|
|
214
|
-
class
|
|
212
|
+
const Io = Kt && Oo(process.env.FORCE_COLOR, ["true", "1", "2"]), Lo = Io || !Dn("--no-colors") && // @todo deprecate --no-colors
|
|
213
|
+
!vr("no-color") && (!Kt || process.stdout.isTTY) && (!Kt || Dn("--color") || xn("COLORTERM") !== null || (xn("TERM") || "").includes("color")), lt = Math.floor, Be = Math.abs, Jn = (e, t) => e < t ? e : t, $t = (e, t) => e > t ? e : t, To = Math.pow, Ar = (e) => e !== 0 ? e < 0 : 1 / e < 0, Ts = 1, Rs = 2, un = 4, dn = 8, ae = 32, it = 64, V = 128, Je = 31, On = 63, At = 127, Ro = 2147483647, Dr = Number.MAX_SAFE_INTEGER, Uo = Number.isInteger || ((e) => typeof e == "number" && isFinite(e) && lt(e) === e);
|
|
214
|
+
class Ce {
|
|
215
215
|
constructor() {
|
|
216
216
|
this.cpos = 0, this.cbuf = new Uint8Array(100), this.bufs = [];
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
|
-
const B = () => new
|
|
219
|
+
const B = () => new Ce(), Xn = (e) => {
|
|
220
220
|
let t = e.cpos;
|
|
221
221
|
for (let n = 0; n < e.bufs.length; n++)
|
|
222
222
|
t += e.bufs[n].length;
|
|
223
223
|
return t;
|
|
224
224
|
}, O = (e) => {
|
|
225
|
-
const t = new Uint8Array(
|
|
225
|
+
const t = new Uint8Array(Xn(e));
|
|
226
226
|
let n = 0;
|
|
227
227
|
for (let s = 0; s < e.bufs.length; s++) {
|
|
228
228
|
const r = e.bufs[s];
|
|
@@ -235,25 +235,25 @@ const B = () => new ke(), Jn = (e) => {
|
|
|
235
235
|
}, U = (e, t) => {
|
|
236
236
|
const n = e.cbuf.length;
|
|
237
237
|
e.cpos === n && (e.bufs.push(e.cbuf), e.cbuf = new Uint8Array(n * 2), e.cpos = 0), e.cbuf[e.cpos++] = t;
|
|
238
|
-
},
|
|
238
|
+
}, Mn = U, C = (e, t) => {
|
|
239
239
|
for (; t > At; )
|
|
240
240
|
U(e, V | At & t), t = lt(t / 128);
|
|
241
241
|
U(e, At & t);
|
|
242
|
-
},
|
|
242
|
+
}, qn = (e, t) => {
|
|
243
243
|
const n = Ar(t);
|
|
244
|
-
for (n && (t = -t), U(e, (t >
|
|
244
|
+
for (n && (t = -t), U(e, (t > On ? V : 0) | (n ? it : 0) | On & t), t = lt(t / 64); t > 0; )
|
|
245
245
|
U(e, (t > At ? V : 0) | At & t), t = lt(t / 128);
|
|
246
|
-
},
|
|
246
|
+
}, In = new Uint8Array(3e4), $o = In.length / 3, Bo = (e, t) => {
|
|
247
247
|
if (t.length < $o) {
|
|
248
|
-
const n = ce.encodeInto(t,
|
|
249
|
-
|
|
248
|
+
const n = ce.encodeInto(t, In).written || 0;
|
|
249
|
+
C(e, n);
|
|
250
250
|
for (let s = 0; s < n; s++)
|
|
251
|
-
U(e,
|
|
251
|
+
U(e, In[s]);
|
|
252
252
|
} else
|
|
253
253
|
I(e, wo(t));
|
|
254
254
|
}, Fo = (e, t) => {
|
|
255
255
|
const n = unescape(encodeURIComponent(t)), s = n.length;
|
|
256
|
-
|
|
256
|
+
C(e, s);
|
|
257
257
|
for (let r = 0; r < s; r++)
|
|
258
258
|
U(
|
|
259
259
|
e,
|
|
@@ -262,24 +262,24 @@ const B = () => new ke(), Jn = (e) => {
|
|
|
262
262
|
);
|
|
263
263
|
}, Dt = ce && /** @type {any} */
|
|
264
264
|
ce.encodeInto ? Bo : Fo, Xe = (e, t) => {
|
|
265
|
-
const n = e.cbuf.length, s = e.cpos, r =
|
|
265
|
+
const n = e.cbuf.length, s = e.cpos, r = Jn(n - s, t.length), i = t.length - r;
|
|
266
266
|
e.cbuf.set(t.subarray(0, r), s), e.cpos += r, i > 0 && (e.bufs.push(e.cbuf), e.cbuf = new Uint8Array($t(n * 2, i)), e.cbuf.set(t.subarray(r)), e.cpos = i);
|
|
267
267
|
}, I = (e, t) => {
|
|
268
|
-
|
|
269
|
-
},
|
|
268
|
+
C(e, t.byteLength), Xe(e, t);
|
|
269
|
+
}, Zn = (e, t) => {
|
|
270
270
|
No(e, t);
|
|
271
271
|
const n = new DataView(e.cbuf.buffer, e.cpos, t);
|
|
272
272
|
return e.cpos += t, n;
|
|
273
|
-
}, zo = (e, t) =>
|
|
273
|
+
}, zo = (e, t) => Zn(e, 4).setFloat32(0, t, !1), jo = (e, t) => Zn(e, 8).setFloat64(0, t, !1), Ho = (e, t) => (
|
|
274
274
|
/** @type {any} */
|
|
275
|
-
|
|
276
|
-
),
|
|
275
|
+
Zn(e, 8).setBigInt64(0, t, !1)
|
|
276
|
+
), Us = new DataView(new ArrayBuffer(4)), Po = (e) => (Us.setFloat32(0, e), Us.getFloat32(0) === e), he = (e, t) => {
|
|
277
277
|
switch (typeof t) {
|
|
278
278
|
case "string":
|
|
279
279
|
U(e, 119), Dt(e, t);
|
|
280
280
|
break;
|
|
281
281
|
case "number":
|
|
282
|
-
Uo(t) && Be(t) <= Ro ? (U(e, 125),
|
|
282
|
+
Uo(t) && Be(t) <= Ro ? (U(e, 125), qn(e, t)) : Po(t) ? (U(e, 124), zo(e, t)) : (U(e, 123), jo(e, t));
|
|
283
283
|
break;
|
|
284
284
|
case "bigint":
|
|
285
285
|
U(e, 122), Ho(e, t);
|
|
@@ -288,7 +288,7 @@ ce.encodeInto ? Bo : Fo, Xe = (e, t) => {
|
|
|
288
288
|
if (t === null)
|
|
289
289
|
U(e, 126);
|
|
290
290
|
else if (ao(t)) {
|
|
291
|
-
U(e, 117),
|
|
291
|
+
U(e, 117), C(e, t.length);
|
|
292
292
|
for (let n = 0; n < t.length; n++)
|
|
293
293
|
he(e, t[n]);
|
|
294
294
|
} else if (t instanceof Uint8Array)
|
|
@@ -296,7 +296,7 @@ ce.encodeInto ? Bo : Fo, Xe = (e, t) => {
|
|
|
296
296
|
else {
|
|
297
297
|
U(e, 118);
|
|
298
298
|
const n = Object.keys(t);
|
|
299
|
-
|
|
299
|
+
C(e, n.length);
|
|
300
300
|
for (let s = 0; s < n.length; s++) {
|
|
301
301
|
const r = n[s];
|
|
302
302
|
Dt(e, r), he(e, t[r]);
|
|
@@ -310,7 +310,7 @@ ce.encodeInto ? Bo : Fo, Xe = (e, t) => {
|
|
|
310
310
|
U(e, 127);
|
|
311
311
|
}
|
|
312
312
|
};
|
|
313
|
-
class
|
|
313
|
+
class Ns extends Ce {
|
|
314
314
|
/**
|
|
315
315
|
* @param {function(Encoder, T):void} writer
|
|
316
316
|
*/
|
|
@@ -321,21 +321,21 @@ class Us extends ke {
|
|
|
321
321
|
* @param {T} v
|
|
322
322
|
*/
|
|
323
323
|
write(t) {
|
|
324
|
-
this.s === t ? this.count++ : (this.count > 0 &&
|
|
324
|
+
this.s === t ? this.count++ : (this.count > 0 && C(this, this.count - 1), this.count = 1, this.w(this, t), this.s = t);
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
|
-
const
|
|
328
|
-
e.count > 0 && (
|
|
327
|
+
const $s = (e) => {
|
|
328
|
+
e.count > 0 && (qn(e.encoder, e.count === 1 ? e.s : -e.s), e.count > 1 && C(e.encoder, e.count - 2));
|
|
329
329
|
};
|
|
330
330
|
class Fe {
|
|
331
331
|
constructor() {
|
|
332
|
-
this.encoder = new
|
|
332
|
+
this.encoder = new Ce(), this.s = 0, this.count = 0;
|
|
333
333
|
}
|
|
334
334
|
/**
|
|
335
335
|
* @param {number} v
|
|
336
336
|
*/
|
|
337
337
|
write(t) {
|
|
338
|
-
this.s === t ? this.count++ : (
|
|
338
|
+
this.s === t ? this.count++ : ($s(this), this.count = 1, this.s = t);
|
|
339
339
|
}
|
|
340
340
|
/**
|
|
341
341
|
* Flush the encoded state and transform this to a Uint8Array.
|
|
@@ -343,24 +343,24 @@ class Fe {
|
|
|
343
343
|
* Note that this should only be called once.
|
|
344
344
|
*/
|
|
345
345
|
toUint8Array() {
|
|
346
|
-
return
|
|
346
|
+
return $s(this), O(this.encoder);
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
|
-
const
|
|
349
|
+
const Bs = (e) => {
|
|
350
350
|
if (e.count > 0) {
|
|
351
351
|
const t = e.diff * 2 + (e.count === 1 ? 0 : 1);
|
|
352
|
-
|
|
352
|
+
qn(e.encoder, t), e.count > 1 && C(e.encoder, e.count - 2);
|
|
353
353
|
}
|
|
354
354
|
};
|
|
355
355
|
class fn {
|
|
356
356
|
constructor() {
|
|
357
|
-
this.encoder = new
|
|
357
|
+
this.encoder = new Ce(), this.s = 0, this.count = 0, this.diff = 0;
|
|
358
358
|
}
|
|
359
359
|
/**
|
|
360
360
|
* @param {number} v
|
|
361
361
|
*/
|
|
362
362
|
write(t) {
|
|
363
|
-
this.diff === t - this.s ? (this.s = t, this.count++) : (
|
|
363
|
+
this.diff === t - this.s ? (this.s = t, this.count++) : (Bs(this), this.count = 1, this.diff = t - this.s, this.s = t);
|
|
364
364
|
}
|
|
365
365
|
/**
|
|
366
366
|
* Flush the encoded state and transform this to a Uint8Array.
|
|
@@ -368,7 +368,7 @@ class fn {
|
|
|
368
368
|
* Note that this should only be called once.
|
|
369
369
|
*/
|
|
370
370
|
toUint8Array() {
|
|
371
|
-
return
|
|
371
|
+
return Bs(this), O(this.encoder);
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
374
|
class Vo {
|
|
@@ -382,7 +382,7 @@ class Vo {
|
|
|
382
382
|
this.s += t, this.s.length > 19 && (this.sarr.push(this.s), this.s = ""), this.lensE.write(t.length);
|
|
383
383
|
}
|
|
384
384
|
toUint8Array() {
|
|
385
|
-
const t = new
|
|
385
|
+
const t = new Ce();
|
|
386
386
|
return this.sarr.push(this.s), this.s = "", Dt(t, this.sarr.join("")), Xe(t, this.lensE.toUint8Array()), O(t);
|
|
387
387
|
}
|
|
388
388
|
}
|
|
@@ -413,8 +413,8 @@ const St = (e) => new qe(e), Ko = (e) => e.pos !== e.arr.length, Go = (e, t) =>
|
|
|
413
413
|
throw Or;
|
|
414
414
|
}
|
|
415
415
|
throw xr;
|
|
416
|
-
},
|
|
417
|
-
let t = e.arr[e.pos++], n = t &
|
|
416
|
+
}, Qn = (e) => {
|
|
417
|
+
let t = e.arr[e.pos++], n = t & On, s = 64;
|
|
418
418
|
const r = (t & it) > 0 ? -1 : 1;
|
|
419
419
|
if (!(t & V))
|
|
420
420
|
return r * n;
|
|
@@ -449,19 +449,19 @@ const St = (e) => new qe(e), Ko = (e) => e.pos !== e.arr.length, Go = (e, t) =>
|
|
|
449
449
|
}, Yo = (e) => (
|
|
450
450
|
/** @type any */
|
|
451
451
|
se.decode($(e))
|
|
452
|
-
), mt = se ? Yo : Wo,
|
|
452
|
+
), mt = se ? Yo : Wo, ts = (e, t) => {
|
|
453
453
|
const n = new DataView(e.arr.buffer, e.arr.byteOffset + e.pos, t);
|
|
454
454
|
return e.pos += t, n;
|
|
455
|
-
}, Jo = (e) =>
|
|
455
|
+
}, Jo = (e) => ts(e, 4).getFloat32(0, !1), Xo = (e) => ts(e, 8).getFloat64(0, !1), qo = (e) => (
|
|
456
456
|
/** @type {any} */
|
|
457
|
-
|
|
457
|
+
ts(e, 8).getBigInt64(0, !1)
|
|
458
458
|
), Zo = [
|
|
459
459
|
(e) => {
|
|
460
460
|
},
|
|
461
461
|
// CASE 127: undefined
|
|
462
462
|
(e) => null,
|
|
463
463
|
// CASE 126: null
|
|
464
|
-
|
|
464
|
+
Qn,
|
|
465
465
|
// CASE 125: integer
|
|
466
466
|
Jo,
|
|
467
467
|
// CASE 124: float32
|
|
@@ -492,7 +492,7 @@ const St = (e) => new qe(e), Ko = (e) => e.pos !== e.arr.length, Go = (e, t) =>
|
|
|
492
492
|
$
|
|
493
493
|
// CASE 116: Uint8Array
|
|
494
494
|
], ue = (e) => Zo[127 - Gt(e)](e);
|
|
495
|
-
class
|
|
495
|
+
class Fs extends qe {
|
|
496
496
|
/**
|
|
497
497
|
* @param {Uint8Array} uint8Array
|
|
498
498
|
* @param {function(Decoder):T} reader
|
|
@@ -514,7 +514,7 @@ class ze extends qe {
|
|
|
514
514
|
}
|
|
515
515
|
read() {
|
|
516
516
|
if (this.count === 0) {
|
|
517
|
-
this.s =
|
|
517
|
+
this.s = Qn(this);
|
|
518
518
|
const t = Ar(this.s);
|
|
519
519
|
this.count = 1, t && (this.s = -this.s, this.count = _(this) + 2);
|
|
520
520
|
}
|
|
@@ -534,7 +534,7 @@ class gn extends qe {
|
|
|
534
534
|
*/
|
|
535
535
|
read() {
|
|
536
536
|
if (this.count === 0) {
|
|
537
|
-
const t =
|
|
537
|
+
const t = Qn(this), n = t & 1;
|
|
538
538
|
this.diff = lt(t / 2), this.count = 1, n && (this.count = _(this) + 2);
|
|
539
539
|
}
|
|
540
540
|
return this.s += this.diff, this.count--, this.s;
|
|
@@ -583,23 +583,23 @@ class al {
|
|
|
583
583
|
* @param {ArrayBuffer} buf
|
|
584
584
|
*/
|
|
585
585
|
postMessage(t) {
|
|
586
|
-
|
|
586
|
+
Cr.setItem(this.room, ol(el(t)));
|
|
587
587
|
}
|
|
588
588
|
close() {
|
|
589
|
-
|
|
589
|
+
Co(this._onChange);
|
|
590
590
|
}
|
|
591
591
|
}
|
|
592
|
-
const hl = typeof BroadcastChannel > "u" ? al : BroadcastChannel,
|
|
592
|
+
const hl = typeof BroadcastChannel > "u" ? al : BroadcastChannel, es = (e) => et(Ir, e, () => {
|
|
593
593
|
const t = wt(), n = new hl(e);
|
|
594
594
|
return n.onmessage = (s) => t.forEach((r) => r(s.data, "broadcastchannel")), {
|
|
595
595
|
bc: n,
|
|
596
596
|
subs: t
|
|
597
597
|
};
|
|
598
|
-
}), ul = (e, t) => (
|
|
599
|
-
const n =
|
|
598
|
+
}), ul = (e, t) => (es(e).subs.add(t), t), dl = (e, t) => {
|
|
599
|
+
const n = es(e), s = n.subs.delete(t);
|
|
600
600
|
return s && n.subs.size === 0 && (n.bc.close(), Ir.delete(e)), s;
|
|
601
601
|
}, jt = (e, t, n = null) => {
|
|
602
|
-
const s =
|
|
602
|
+
const s = es(e);
|
|
603
603
|
s.bc.postMessage(t), s.subs.forEach((r) => r(t, n));
|
|
604
604
|
};
|
|
605
605
|
class fl {
|
|
@@ -664,7 +664,7 @@ class fl {
|
|
|
664
664
|
this._observers = z();
|
|
665
665
|
}
|
|
666
666
|
}
|
|
667
|
-
class
|
|
667
|
+
class ns {
|
|
668
668
|
constructor() {
|
|
669
669
|
this._observers = z();
|
|
670
670
|
}
|
|
@@ -729,7 +729,7 @@ class wl {
|
|
|
729
729
|
}
|
|
730
730
|
const rt = (e, t) => new wl(e, t);
|
|
731
731
|
typeof DOMParser < "u" && new DOMParser();
|
|
732
|
-
const bl = (e) => oo(e, (t, n) => `${n}:${t};`).join(""), ut = Symbol, Tr = ut(), Rr = ut(), Sl = ut(),
|
|
732
|
+
const bl = (e) => oo(e, (t, n) => `${n}:${t};`).join(""), ut = Symbol, Tr = ut(), Rr = ut(), Sl = ut(), Cl = ut(), kl = ut(), Ur = ut(), _l = ut(), Nr = ut(), El = ut(), vl = (e) => {
|
|
733
733
|
var r;
|
|
734
734
|
e.length === 1 && ((r = e[0]) == null ? void 0 : r.constructor) === Function && (e = /** @type {Array<string|Symbol|Object|number>} */
|
|
735
735
|
/** @type {[function]} */
|
|
@@ -754,8 +754,8 @@ const bl = (e) => oo(e, (t, n) => `${n}:${t};`).join(""), ut = Symbol, Tr = ut()
|
|
|
754
754
|
[Tr]: rt("font-weight", "bold"),
|
|
755
755
|
[Rr]: rt("font-weight", "normal"),
|
|
756
756
|
[Sl]: rt("color", "blue"),
|
|
757
|
-
[
|
|
758
|
-
[
|
|
757
|
+
[kl]: rt("color", "green"),
|
|
758
|
+
[Cl]: rt("color", "grey"),
|
|
759
759
|
[Ur]: rt("color", "red"),
|
|
760
760
|
[_l]: rt("color", "purple"),
|
|
761
761
|
[Nr]: rt("color", "orange"),
|
|
@@ -808,7 +808,7 @@ const bl = (e) => oo(e, (t, n) => `${n}:${t};`).join(""), ut = Symbol, Tr = ut()
|
|
|
808
808
|
const { done: n, value: s } = e.next();
|
|
809
809
|
return { done: n, value: n ? void 0 : t(s) };
|
|
810
810
|
});
|
|
811
|
-
class
|
|
811
|
+
class ss {
|
|
812
812
|
/**
|
|
813
813
|
* @param {number} clock
|
|
814
814
|
* @param {number} len
|
|
@@ -817,7 +817,7 @@ class ns {
|
|
|
817
817
|
this.clock = t, this.len = n;
|
|
818
818
|
}
|
|
819
819
|
}
|
|
820
|
-
class
|
|
820
|
+
class ke {
|
|
821
821
|
constructor() {
|
|
822
822
|
this.clients = /* @__PURE__ */ new Map();
|
|
823
823
|
}
|
|
@@ -846,7 +846,7 @@ const Br = (e, t, n) => t.clients.forEach((s, r) => {
|
|
|
846
846
|
}, Fr = (e, t) => {
|
|
847
847
|
const n = e.clients.get(t.client);
|
|
848
848
|
return n !== void 0 && Ll(n, t.clock) !== null;
|
|
849
|
-
},
|
|
849
|
+
}, rs = (e) => {
|
|
850
850
|
e.clients.forEach((t) => {
|
|
851
851
|
t.sort((r, i) => r.clock - i.clock);
|
|
852
852
|
let n, s;
|
|
@@ -857,7 +857,7 @@ const Br = (e, t, n) => t.clients.forEach((s, r) => {
|
|
|
857
857
|
t.length = s;
|
|
858
858
|
});
|
|
859
859
|
}, Tl = (e) => {
|
|
860
|
-
const t = new
|
|
860
|
+
const t = new ke();
|
|
861
861
|
for (let n = 0; n < e.length; n++)
|
|
862
862
|
e[n].clients.forEach((s, r) => {
|
|
863
863
|
if (!t.clients.has(r)) {
|
|
@@ -867,13 +867,13 @@ const Br = (e, t, n) => t.clients.forEach((s, r) => {
|
|
|
867
867
|
t.clients.set(r, i);
|
|
868
868
|
}
|
|
869
869
|
});
|
|
870
|
-
return
|
|
870
|
+
return rs(t), t;
|
|
871
871
|
}, Pe = (e, t, n, s) => {
|
|
872
872
|
et(e.clients, t, () => (
|
|
873
873
|
/** @type {Array<DeleteItem>} */
|
|
874
874
|
[]
|
|
875
|
-
)).push(new
|
|
876
|
-
}, Rl = () => new
|
|
875
|
+
)).push(new ss(n, s));
|
|
876
|
+
}, Rl = () => new ke(), Ul = (e) => {
|
|
877
877
|
const t = Rl();
|
|
878
878
|
return e.clients.forEach((n, s) => {
|
|
879
879
|
const r = [];
|
|
@@ -885,23 +885,23 @@ const Br = (e, t, n) => t.clients.forEach((s, r) => {
|
|
|
885
885
|
if (i + 1 < n.length)
|
|
886
886
|
for (let a = n[i + 1]; i + 1 < n.length && a.deleted; a = n[++i + 1])
|
|
887
887
|
c += a.length;
|
|
888
|
-
r.push(new
|
|
888
|
+
r.push(new ss(l, c));
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
891
|
r.length > 0 && t.clients.set(s, r);
|
|
892
892
|
}), t;
|
|
893
893
|
}, Zt = (e, t) => {
|
|
894
|
-
|
|
895
|
-
e.resetDsCurVal(),
|
|
894
|
+
C(e.restEncoder, t.clients.size), ot(t.clients.entries()).sort((n, s) => s[0] - n[0]).forEach(([n, s]) => {
|
|
895
|
+
e.resetDsCurVal(), C(e.restEncoder, n);
|
|
896
896
|
const r = s.length;
|
|
897
|
-
|
|
897
|
+
C(e.restEncoder, r);
|
|
898
898
|
for (let i = 0; i < r; i++) {
|
|
899
899
|
const o = s[i];
|
|
900
900
|
e.writeDsClock(o.clock), e.writeDsLen(o.len);
|
|
901
901
|
}
|
|
902
902
|
});
|
|
903
|
-
},
|
|
904
|
-
const t = new
|
|
903
|
+
}, is = (e) => {
|
|
904
|
+
const t = new ke(), n = _(e.restDecoder);
|
|
905
905
|
for (let s = 0; s < n; s++) {
|
|
906
906
|
e.resetDsCurVal();
|
|
907
907
|
const r = _(e.restDecoder), i = _(e.restDecoder);
|
|
@@ -911,12 +911,12 @@ const Br = (e, t, n) => t.clients.forEach((s, r) => {
|
|
|
911
911
|
[]
|
|
912
912
|
));
|
|
913
913
|
for (let l = 0; l < i; l++)
|
|
914
|
-
o.push(new
|
|
914
|
+
o.push(new ss(e.readDsClock(), e.readDsLen()));
|
|
915
915
|
}
|
|
916
916
|
}
|
|
917
917
|
return t;
|
|
918
|
-
},
|
|
919
|
-
const s = new
|
|
918
|
+
}, zs = (e, t, n) => {
|
|
919
|
+
const s = new ke(), r = _(e.restDecoder);
|
|
920
920
|
for (let i = 0; i < r; i++) {
|
|
921
921
|
e.resetDsCurVal();
|
|
922
922
|
const o = _(e.restDecoder), l = _(e.restDecoder), c = n.clients.get(o) || [], a = N(n, o);
|
|
@@ -933,7 +933,7 @@ const Br = (e, t, n) => t.clients.forEach((s, r) => {
|
|
|
933
933
|
}
|
|
934
934
|
if (s.clients.size > 0) {
|
|
935
935
|
const i = new It();
|
|
936
|
-
return
|
|
936
|
+
return C(i.restEncoder, 0), Zt(i, s), i.toUint8Array();
|
|
937
937
|
}
|
|
938
938
|
return null;
|
|
939
939
|
}, zr = Lr;
|
|
@@ -1280,7 +1280,7 @@ class Yt extends Nl {
|
|
|
1280
1280
|
* @param {decoding.Decoder} decoder
|
|
1281
1281
|
*/
|
|
1282
1282
|
constructor(t) {
|
|
1283
|
-
super(t), this.keys = [], _(t), this.keyClockDecoder = new gn($(t)), this.clientDecoder = new ze($(t)), this.leftClockDecoder = new gn($(t)), this.rightClockDecoder = new gn($(t)), this.infoDecoder = new
|
|
1283
|
+
super(t), this.keys = [], _(t), this.keyClockDecoder = new gn($(t)), this.clientDecoder = new ze($(t)), this.leftClockDecoder = new gn($(t)), this.rightClockDecoder = new gn($(t)), this.infoDecoder = new Fs($(t), Gt), this.stringDecoder = new Qo($(t)), this.parentInfoDecoder = new Fs($(t), Gt), this.typeRefDecoder = new ze($(t)), this.lenDecoder = new ze($(t));
|
|
1284
1284
|
}
|
|
1285
1285
|
/**
|
|
1286
1286
|
* @return {ID}
|
|
@@ -1384,13 +1384,13 @@ class Pr {
|
|
|
1384
1384
|
* @param {number} clock
|
|
1385
1385
|
*/
|
|
1386
1386
|
writeDsClock(t) {
|
|
1387
|
-
|
|
1387
|
+
C(this.restEncoder, t);
|
|
1388
1388
|
}
|
|
1389
1389
|
/**
|
|
1390
1390
|
* @param {number} len
|
|
1391
1391
|
*/
|
|
1392
1392
|
writeDsLen(t) {
|
|
1393
|
-
|
|
1393
|
+
C(this.restEncoder, t);
|
|
1394
1394
|
}
|
|
1395
1395
|
}
|
|
1396
1396
|
class _e extends Pr {
|
|
@@ -1398,26 +1398,26 @@ class _e extends Pr {
|
|
|
1398
1398
|
* @param {ID} id
|
|
1399
1399
|
*/
|
|
1400
1400
|
writeLeftID(t) {
|
|
1401
|
-
|
|
1401
|
+
C(this.restEncoder, t.client), C(this.restEncoder, t.clock);
|
|
1402
1402
|
}
|
|
1403
1403
|
/**
|
|
1404
1404
|
* @param {ID} id
|
|
1405
1405
|
*/
|
|
1406
1406
|
writeRightID(t) {
|
|
1407
|
-
|
|
1407
|
+
C(this.restEncoder, t.client), C(this.restEncoder, t.clock);
|
|
1408
1408
|
}
|
|
1409
1409
|
/**
|
|
1410
1410
|
* Use writeClient and writeClock instead of writeID if possible.
|
|
1411
1411
|
* @param {number} client
|
|
1412
1412
|
*/
|
|
1413
1413
|
writeClient(t) {
|
|
1414
|
-
|
|
1414
|
+
C(this.restEncoder, t);
|
|
1415
1415
|
}
|
|
1416
1416
|
/**
|
|
1417
1417
|
* @param {number} info An unsigned 8-bit integer
|
|
1418
1418
|
*/
|
|
1419
1419
|
writeInfo(t) {
|
|
1420
|
-
|
|
1420
|
+
Mn(this.restEncoder, t);
|
|
1421
1421
|
}
|
|
1422
1422
|
/**
|
|
1423
1423
|
* @param {string} s
|
|
@@ -1429,13 +1429,13 @@ class _e extends Pr {
|
|
|
1429
1429
|
* @param {boolean} isYKey
|
|
1430
1430
|
*/
|
|
1431
1431
|
writeParentInfo(t) {
|
|
1432
|
-
|
|
1432
|
+
C(this.restEncoder, t ? 1 : 0);
|
|
1433
1433
|
}
|
|
1434
1434
|
/**
|
|
1435
1435
|
* @param {number} info An unsigned 8-bit integer
|
|
1436
1436
|
*/
|
|
1437
1437
|
writeTypeRef(t) {
|
|
1438
|
-
|
|
1438
|
+
C(this.restEncoder, t);
|
|
1439
1439
|
}
|
|
1440
1440
|
/**
|
|
1441
1441
|
* Write len of a struct - well suited for Opt RLE encoder.
|
|
@@ -1443,7 +1443,7 @@ class _e extends Pr {
|
|
|
1443
1443
|
* @param {number} len
|
|
1444
1444
|
*/
|
|
1445
1445
|
writeLen(t) {
|
|
1446
|
-
|
|
1446
|
+
C(this.restEncoder, t);
|
|
1447
1447
|
}
|
|
1448
1448
|
/**
|
|
1449
1449
|
* @param {any} any
|
|
@@ -1485,22 +1485,22 @@ class Vr {
|
|
|
1485
1485
|
*/
|
|
1486
1486
|
writeDsClock(t) {
|
|
1487
1487
|
const n = t - this.dsCurrVal;
|
|
1488
|
-
this.dsCurrVal = t,
|
|
1488
|
+
this.dsCurrVal = t, C(this.restEncoder, n);
|
|
1489
1489
|
}
|
|
1490
1490
|
/**
|
|
1491
1491
|
* @param {number} len
|
|
1492
1492
|
*/
|
|
1493
1493
|
writeDsLen(t) {
|
|
1494
|
-
t === 0 && q(),
|
|
1494
|
+
t === 0 && q(), C(this.restEncoder, t - 1), this.dsCurrVal += t;
|
|
1495
1495
|
}
|
|
1496
1496
|
}
|
|
1497
1497
|
class It extends Vr {
|
|
1498
1498
|
constructor() {
|
|
1499
|
-
super(), this.keyMap = /* @__PURE__ */ new Map(), this.keyClock = 0, this.keyClockEncoder = new fn(), this.clientEncoder = new Fe(), this.leftClockEncoder = new fn(), this.rightClockEncoder = new fn(), this.infoEncoder = new
|
|
1499
|
+
super(), this.keyMap = /* @__PURE__ */ new Map(), this.keyClock = 0, this.keyClockEncoder = new fn(), this.clientEncoder = new Fe(), this.leftClockEncoder = new fn(), this.rightClockEncoder = new fn(), this.infoEncoder = new Ns(Mn), this.stringEncoder = new Vo(), this.parentInfoEncoder = new Ns(Mn), this.typeRefEncoder = new Fe(), this.lenEncoder = new Fe();
|
|
1500
1500
|
}
|
|
1501
1501
|
toUint8Array() {
|
|
1502
1502
|
const t = B();
|
|
1503
|
-
return
|
|
1503
|
+
return C(t, 0), I(t, this.keyClockEncoder.toUint8Array()), I(t, this.clientEncoder.toUint8Array()), I(t, this.leftClockEncoder.toUint8Array()), I(t, this.rightClockEncoder.toUint8Array()), I(t, O(this.infoEncoder)), I(t, this.stringEncoder.toUint8Array()), I(t, O(this.parentInfoEncoder)), I(t, this.typeRefEncoder.toUint8Array()), I(t, this.lenEncoder.toUint8Array()), Xe(t, O(this.restEncoder)), O(t);
|
|
1504
1504
|
}
|
|
1505
1505
|
/**
|
|
1506
1506
|
* @param {ID} id
|
|
@@ -1590,18 +1590,18 @@ class It extends Vr {
|
|
|
1590
1590
|
const $l = (e, t, n, s) => {
|
|
1591
1591
|
s = $t(s, t[0].id.clock);
|
|
1592
1592
|
const r = W(t, s);
|
|
1593
|
-
|
|
1593
|
+
C(e.restEncoder, t.length - r), e.writeClient(n), C(e.restEncoder, s);
|
|
1594
1594
|
const i = t[r];
|
|
1595
1595
|
i.write(e, s - i.id.clock);
|
|
1596
1596
|
for (let o = r + 1; o < t.length; o++)
|
|
1597
1597
|
t[o].write(e, 0);
|
|
1598
|
-
},
|
|
1598
|
+
}, os = (e, t, n) => {
|
|
1599
1599
|
const s = /* @__PURE__ */ new Map();
|
|
1600
1600
|
n.forEach((r, i) => {
|
|
1601
1601
|
N(t, i) > r && s.set(i, r);
|
|
1602
1602
|
}), Ze(t).forEach((r, i) => {
|
|
1603
1603
|
n.has(i) || s.set(i, 0);
|
|
1604
|
-
}),
|
|
1604
|
+
}), C(e.restEncoder, s.size), ot(s.entries()).sort((r, i) => i[0] - r[0]).forEach(([r, i]) => {
|
|
1605
1605
|
$l(
|
|
1606
1606
|
e,
|
|
1607
1607
|
/** @type {Array<GC|Item>} */
|
|
@@ -1677,8 +1677,8 @@ const $l = (e, t, n, s) => {
|
|
|
1677
1677
|
if (o === null)
|
|
1678
1678
|
return null;
|
|
1679
1679
|
const l = new Xr(), c = /* @__PURE__ */ new Map(), a = (f, g) => {
|
|
1680
|
-
const
|
|
1681
|
-
(
|
|
1680
|
+
const b = c.get(f);
|
|
1681
|
+
(b == null || b > g) && c.set(f, g);
|
|
1682
1682
|
};
|
|
1683
1683
|
let h = (
|
|
1684
1684
|
/** @type {any} */
|
|
@@ -1689,8 +1689,8 @@ const $l = (e, t, n, s) => {
|
|
|
1689
1689
|
);
|
|
1690
1690
|
const u = /* @__PURE__ */ new Map(), d = () => {
|
|
1691
1691
|
for (const f of s) {
|
|
1692
|
-
const g = f.id.client,
|
|
1693
|
-
|
|
1692
|
+
const g = f.id.client, b = n.get(g);
|
|
1693
|
+
b ? (b.i--, l.clients.set(g, b.refs.slice(b.i)), n.delete(g), b.i = 0, b.refs = []) : l.clients.set(g, [f]), r = r.filter((v) => v !== g);
|
|
1694
1694
|
}
|
|
1695
1695
|
s.length = 0;
|
|
1696
1696
|
};
|
|
@@ -1700,18 +1700,18 @@ const $l = (e, t, n, s) => {
|
|
|
1700
1700
|
if (g < 0)
|
|
1701
1701
|
s.push(h), a(h.id.client, h.id.clock - 1), d();
|
|
1702
1702
|
else {
|
|
1703
|
-
const
|
|
1704
|
-
if (
|
|
1703
|
+
const b = h.getMissing(e, t);
|
|
1704
|
+
if (b !== null) {
|
|
1705
1705
|
s.push(h);
|
|
1706
1706
|
const v = n.get(
|
|
1707
1707
|
/** @type {number} */
|
|
1708
|
-
|
|
1708
|
+
b
|
|
1709
1709
|
) || { refs: [], i: 0 };
|
|
1710
1710
|
if (v.refs.length === v.i)
|
|
1711
1711
|
a(
|
|
1712
1712
|
/** @type {number} */
|
|
1713
|
-
|
|
1714
|
-
N(t,
|
|
1713
|
+
b,
|
|
1714
|
+
N(t, b)
|
|
1715
1715
|
), d();
|
|
1716
1716
|
else {
|
|
1717
1717
|
h = v.refs[v.i++];
|
|
@@ -1736,10 +1736,10 @@ const $l = (e, t, n, s) => {
|
|
|
1736
1736
|
}
|
|
1737
1737
|
if (l.clients.size > 0) {
|
|
1738
1738
|
const f = new It();
|
|
1739
|
-
return
|
|
1739
|
+
return os(f, l, /* @__PURE__ */ new Map()), C(f.restEncoder, 0), { missing: c, update: f.toUint8Array() };
|
|
1740
1740
|
}
|
|
1741
1741
|
return null;
|
|
1742
|
-
}, zl = (e, t) =>
|
|
1742
|
+
}, zl = (e, t) => os(e, t.doc.store, t.beforeState), jl = (e, t, n, s = new Yt(e)) => A(t, (r) => {
|
|
1743
1743
|
r.local = !1;
|
|
1744
1744
|
let i = !1;
|
|
1745
1745
|
const o = r.doc, l = o.store, c = Bl(s, o), a = Fl(r, l, c), h = l.pendingStructs;
|
|
@@ -1758,11 +1758,11 @@ const $l = (e, t, n, s) => {
|
|
|
1758
1758
|
}
|
|
1759
1759
|
} else
|
|
1760
1760
|
l.pendingStructs = a;
|
|
1761
|
-
const u =
|
|
1761
|
+
const u = zs(s, r, l);
|
|
1762
1762
|
if (l.pendingDs) {
|
|
1763
1763
|
const d = new Yt(St(l.pendingDs));
|
|
1764
1764
|
_(d.restDecoder);
|
|
1765
|
-
const f =
|
|
1765
|
+
const f = zs(d, r, l);
|
|
1766
1766
|
u && f ? l.pendingDs = Ve([u, f]) : l.pendingDs = u || f;
|
|
1767
1767
|
} else
|
|
1768
1768
|
l.pendingDs = u;
|
|
@@ -1777,7 +1777,7 @@ const $l = (e, t, n, s) => {
|
|
|
1777
1777
|
const r = St(t);
|
|
1778
1778
|
jl(r, e, n, new s(r));
|
|
1779
1779
|
}, Gr = (e, t, n) => Kr(e, t, n, Hr), Hl = (e, t, n = /* @__PURE__ */ new Map()) => {
|
|
1780
|
-
|
|
1780
|
+
os(e, t.store, n), Zt(e, Ul(t.store));
|
|
1781
1781
|
}, Pl = (e, t = new Uint8Array([0]), n = new It()) => {
|
|
1782
1782
|
const s = Wr(t);
|
|
1783
1783
|
Hl(n, e, s);
|
|
@@ -1789,25 +1789,25 @@ const $l = (e, t, n, s) => {
|
|
|
1789
1789
|
return Ve(r);
|
|
1790
1790
|
}
|
|
1791
1791
|
return r[0];
|
|
1792
|
-
},
|
|
1792
|
+
}, ls = (e, t) => Pl(e, t, new _e()), Vl = (e) => {
|
|
1793
1793
|
const t = /* @__PURE__ */ new Map(), n = _(e.restDecoder);
|
|
1794
1794
|
for (let s = 0; s < n; s++) {
|
|
1795
1795
|
const r = _(e.restDecoder), i = _(e.restDecoder);
|
|
1796
1796
|
t.set(r, i);
|
|
1797
1797
|
}
|
|
1798
1798
|
return t;
|
|
1799
|
-
}, Wr = (e) => Vl(new jr(St(e))), Yr = (e, t) => (
|
|
1800
|
-
|
|
1799
|
+
}, Wr = (e) => Vl(new jr(St(e))), Yr = (e, t) => (C(e.restEncoder, t.size), ot(t.entries()).sort((n, s) => s[0] - n[0]).forEach(([n, s]) => {
|
|
1800
|
+
C(e.restEncoder, n), C(e.restEncoder, s);
|
|
1801
1801
|
}), e), Kl = (e, t) => Yr(e, Ze(t.store)), Gl = (e, t = new Vr()) => (e instanceof Map ? Yr(t, e) : Kl(t, e), t.toUint8Array()), Wl = (e) => Gl(e, new Pr());
|
|
1802
1802
|
class Yl {
|
|
1803
1803
|
constructor() {
|
|
1804
1804
|
this.l = [];
|
|
1805
1805
|
}
|
|
1806
1806
|
}
|
|
1807
|
-
const
|
|
1807
|
+
const js = () => new Yl(), Hs = (e, t) => e.l.push(t), Ps = (e, t) => {
|
|
1808
1808
|
const n = e.l, s = n.length;
|
|
1809
1809
|
e.l = n.filter((r) => t !== r), s === e.l.length && console.error("[yjs] Tried to remove event handler that doesn't exist.");
|
|
1810
|
-
}, Jr = (e, t, n) =>
|
|
1810
|
+
}, Jr = (e, t, n) => Yn(e.l, [t, n]);
|
|
1811
1811
|
class Pt {
|
|
1812
1812
|
/**
|
|
1813
1813
|
* @param {number} client client id
|
|
@@ -1822,8 +1822,8 @@ const Ie = (e, t) => e === t || e !== null && t !== null && e.client === t.clien
|
|
|
1822
1822
|
if (n === e)
|
|
1823
1823
|
return t;
|
|
1824
1824
|
throw q();
|
|
1825
|
-
}, Ht = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.get(e.id.client) || 0) > e.id.clock && !Fr(t.ds, e.id),
|
|
1826
|
-
const n = et(e.meta,
|
|
1825
|
+
}, Ht = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.get(e.id.client) || 0) > e.id.clock && !Fr(t.ds, e.id), Ln = (e, t) => {
|
|
1826
|
+
const n = et(e.meta, Ln, wt), s = e.doc.store;
|
|
1827
1827
|
n.has(t) || (t.sv.forEach((r, i) => {
|
|
1828
1828
|
r < N(s, i) && bt(e, E(i, r));
|
|
1829
1829
|
}), Br(e, t.ds, (r) => {
|
|
@@ -1877,7 +1877,7 @@ const Ze = (e) => {
|
|
|
1877
1877
|
}, yn = (
|
|
1878
1878
|
/** @type {function(StructStore,ID):Item} */
|
|
1879
1879
|
Xl
|
|
1880
|
-
),
|
|
1880
|
+
), Tn = (e, t, n) => {
|
|
1881
1881
|
const s = W(t, n), r = t[s];
|
|
1882
1882
|
return r.id.clock < n && r instanceof L ? (t.splice(s + 1, 0, Ye(e, r, n - r.id.clock)), s + 1) : s;
|
|
1883
1883
|
}, bt = (e, t) => {
|
|
@@ -1885,8 +1885,8 @@ const Ze = (e) => {
|
|
|
1885
1885
|
/** @type {Array<Item>} */
|
|
1886
1886
|
e.doc.store.clients.get(t.client)
|
|
1887
1887
|
);
|
|
1888
|
-
return n[
|
|
1889
|
-
},
|
|
1888
|
+
return n[Tn(e, n, t.clock)];
|
|
1889
|
+
}, Vs = (e, t, n) => {
|
|
1890
1890
|
const s = t.clients.get(n.client), r = W(s, n.clock), i = s[r];
|
|
1891
1891
|
return n.clock !== i.id.clock + i.length - 1 && i.constructor !== P && s.splice(r + 1, 0, Ye(e, i, n.clock - i.id.clock + 1)), i;
|
|
1892
1892
|
}, ql = (e, t, n) => {
|
|
@@ -1899,9 +1899,9 @@ const Ze = (e) => {
|
|
|
1899
1899
|
if (s === 0)
|
|
1900
1900
|
return;
|
|
1901
1901
|
const i = n + s;
|
|
1902
|
-
let o =
|
|
1902
|
+
let o = Tn(e, t, n), l;
|
|
1903
1903
|
do
|
|
1904
|
-
l = t[o++], i < l.id.clock + l.length &&
|
|
1904
|
+
l = t[o++], i < l.id.clock + l.length && Tn(e, t, i), r(l);
|
|
1905
1905
|
while (o < t.length && t[o].id.clock < i);
|
|
1906
1906
|
};
|
|
1907
1907
|
class Zl {
|
|
@@ -1911,10 +1911,10 @@ class Zl {
|
|
|
1911
1911
|
* @param {boolean} local
|
|
1912
1912
|
*/
|
|
1913
1913
|
constructor(t, n, s) {
|
|
1914
|
-
this.doc = t, this.deleteSet = new
|
|
1914
|
+
this.doc = t, this.deleteSet = new ke(), this.beforeState = Ze(t.store), this.afterState = /* @__PURE__ */ new Map(), this.changed = /* @__PURE__ */ new Map(), this.changedParentTypes = /* @__PURE__ */ new Map(), this._mergeStructs = [], this.origin = n, this.meta = /* @__PURE__ */ new Map(), this.local = s, this.subdocsAdded = /* @__PURE__ */ new Set(), this.subdocsRemoved = /* @__PURE__ */ new Set(), this.subdocsLoaded = /* @__PURE__ */ new Set(), this._needFormattingCleanup = !1;
|
|
1915
1915
|
}
|
|
1916
1916
|
}
|
|
1917
|
-
const
|
|
1917
|
+
const Ks = (e, t) => t.deleteSet.clients.size === 0 && !lo(t.afterState, (n, s) => t.beforeState.get(s) !== n) ? !1 : (rs(t.deleteSet), zl(e, t), Zt(e, t.deleteSet), !0), Gs = (e, t, n) => {
|
|
1918
1918
|
const s = t._item;
|
|
1919
1919
|
(s === null || s.id.clock < (e.beforeState.get(s.id.client) || 0) && !s.deleted) && et(e.changed, t, wt).add(n);
|
|
1920
1920
|
}, je = (e, t) => {
|
|
@@ -1956,7 +1956,7 @@ const Vs = (e, t) => t.deleteSet.clients.size === 0 && !lo(t.afterState, (n, s)
|
|
|
1956
1956
|
t.clients.get(s)
|
|
1957
1957
|
);
|
|
1958
1958
|
for (let i = n.length - 1; i >= 0; i--) {
|
|
1959
|
-
const o = n[i], l =
|
|
1959
|
+
const o = n[i], l = Jn(r.length - 1, 1 + W(r, o.clock + o.len - 1));
|
|
1960
1960
|
for (let c = l, a = r[c]; c > 0 && a.id.clock >= o.clock; a = r[c])
|
|
1961
1961
|
c -= 1 + je(r, c);
|
|
1962
1962
|
}
|
|
@@ -1965,7 +1965,7 @@ const Vs = (e, t) => t.deleteSet.clients.size === 0 && !lo(t.afterState, (n, s)
|
|
|
1965
1965
|
if (t < e.length) {
|
|
1966
1966
|
const n = e[t], s = n.doc, r = s.store, i = n.deleteSet, o = n._mergeStructs;
|
|
1967
1967
|
try {
|
|
1968
|
-
|
|
1968
|
+
rs(i), n.afterState = Ze(n.doc.store), s.emit("beforeObserverCalls", [n, s]);
|
|
1969
1969
|
const l = [];
|
|
1970
1970
|
n.changed.forEach(
|
|
1971
1971
|
(c, a) => l.push(() => {
|
|
@@ -1979,7 +1979,7 @@ const Vs = (e, t) => t.deleteSet.clients.size === 0 && !lo(t.afterState, (n, s)
|
|
|
1979
1979
|
h.currentTarget = a, h._path = null;
|
|
1980
1980
|
}), c.sort((h, u) => h.path.length - u.path.length), Jr(a._dEH, c, n));
|
|
1981
1981
|
});
|
|
1982
|
-
}), l.push(() => s.emit("afterTransaction", [n, s])),
|
|
1982
|
+
}), l.push(() => s.emit("afterTransaction", [n, s])), Yn(l, []), n._needFormattingCleanup && Sc(n);
|
|
1983
1983
|
} finally {
|
|
1984
1984
|
s.gc && Ql(i, r, s.gcFilter), tc(i, r), n.afterState.forEach((h, u) => {
|
|
1985
1985
|
const d = n.beforeState.get(u) || 0;
|
|
@@ -1988,8 +1988,8 @@ const Vs = (e, t) => t.deleteSet.clients.size === 0 && !lo(t.afterState, (n, s)
|
|
|
1988
1988
|
/** @type {Array<GC|Item>} */
|
|
1989
1989
|
r.clients.get(u)
|
|
1990
1990
|
), g = $t(W(f, d), 1);
|
|
1991
|
-
for (let
|
|
1992
|
-
|
|
1991
|
+
for (let b = f.length - 1; b >= g; )
|
|
1992
|
+
b -= 1 + je(f, b);
|
|
1993
1993
|
}
|
|
1994
1994
|
});
|
|
1995
1995
|
for (let h = o.length - 1; h >= 0; h--) {
|
|
@@ -2001,11 +2001,11 @@ const Vs = (e, t) => t.deleteSet.clients.size === 0 && !lo(t.afterState, (n, s)
|
|
|
2001
2001
|
}
|
|
2002
2002
|
if (!n.local && n.afterState.get(s.clientID) !== n.beforeState.get(s.clientID) && (Ol(Nr, Tr, "[yjs] ", Rr, Ur, "Changed the client-id because another client seems to be using it."), s.clientID = zr()), s.emit("afterTransactionCleanup", [n, s]), s._observers.has("update")) {
|
|
2003
2003
|
const h = new _e();
|
|
2004
|
-
|
|
2004
|
+
Ks(h, n) && s.emit("update", [h.toUint8Array(), n.origin, s, n]);
|
|
2005
2005
|
}
|
|
2006
2006
|
if (s._observers.has("updateV2")) {
|
|
2007
2007
|
const h = new It();
|
|
2008
|
-
|
|
2008
|
+
Ks(h, n) && s.emit("updateV2", [h.toUint8Array(), n.origin, s, n]);
|
|
2009
2009
|
}
|
|
2010
2010
|
const { subdocsAdded: l, subdocsLoaded: c, subdocsRemoved: a } = n;
|
|
2011
2011
|
(l.size > 0 || a.size > 0 || c.size > 0) && (l.forEach((h) => {
|
|
@@ -2064,7 +2064,7 @@ function* ec(e) {
|
|
|
2064
2064
|
}
|
|
2065
2065
|
}
|
|
2066
2066
|
}
|
|
2067
|
-
class
|
|
2067
|
+
class cs {
|
|
2068
2068
|
/**
|
|
2069
2069
|
* @param {UpdateDecoderV1 | UpdateDecoderV2} decoder
|
|
2070
2070
|
* @param {boolean} filterSkips
|
|
@@ -2082,7 +2082,7 @@ class ls {
|
|
|
2082
2082
|
return this.curr;
|
|
2083
2083
|
}
|
|
2084
2084
|
}
|
|
2085
|
-
class
|
|
2085
|
+
class as {
|
|
2086
2086
|
/**
|
|
2087
2087
|
* @param {UpdateEncoderV1 | UpdateEncoderV2} encoder
|
|
2088
2088
|
*/
|
|
@@ -2117,8 +2117,8 @@ const nc = (e) => Ve(e, Hr, _e), sc = (e, t) => {
|
|
|
2117
2117
|
if (e.length === 1)
|
|
2118
2118
|
return e[0];
|
|
2119
2119
|
const s = e.map((h) => new t(St(h)));
|
|
2120
|
-
let r = s.map((h) => new
|
|
2121
|
-
const o = new n(), l = new
|
|
2120
|
+
let r = s.map((h) => new cs(h, !0)), i = null;
|
|
2121
|
+
const o = new n(), l = new as(o);
|
|
2122
2122
|
for (; r = r.filter((d) => d.curr !== null), r.sort(
|
|
2123
2123
|
/** @type {function(any,any):number} */
|
|
2124
2124
|
(d, f) => {
|
|
@@ -2169,11 +2169,11 @@ const nc = (e) => Ve(e, Hr, _e), sc = (e, t) => {
|
|
|
2169
2169
|
for (let d = h.curr; d !== null && d.id.client === u && d.id.clock === i.struct.id.clock + i.struct.length && d.constructor !== K; d = h.next())
|
|
2170
2170
|
pt(l, i.struct, i.offset), i = { struct: d, offset: 0 };
|
|
2171
2171
|
}
|
|
2172
|
-
i !== null && (pt(l, i.struct, i.offset), i = null),
|
|
2173
|
-
const c = s.map((h) =>
|
|
2172
|
+
i !== null && (pt(l, i.struct, i.offset), i = null), hs(l);
|
|
2173
|
+
const c = s.map((h) => is(h)), a = Tl(c);
|
|
2174
2174
|
return Zt(o, a), o.toUint8Array();
|
|
2175
2175
|
}, rc = (e, t, n = Yt, s = It) => {
|
|
2176
|
-
const r = Wr(t), i = new s(), o = new
|
|
2176
|
+
const r = Wr(t), i = new s(), o = new as(i), l = new n(St(e)), c = new cs(l, !1);
|
|
2177
2177
|
for (; c.curr; ) {
|
|
2178
2178
|
const h = c.curr, u = h.id.client, d = r.get(u) || 0;
|
|
2179
2179
|
if (c.curr.constructor === K) {
|
|
@@ -2187,29 +2187,29 @@ const nc = (e) => Ve(e, Hr, _e), sc = (e, t) => {
|
|
|
2187
2187
|
for (; c.curr && c.curr.id.client === u && c.curr.id.clock + c.curr.length <= d; )
|
|
2188
2188
|
c.next();
|
|
2189
2189
|
}
|
|
2190
|
-
|
|
2191
|
-
const a =
|
|
2190
|
+
hs(o);
|
|
2191
|
+
const a = is(l);
|
|
2192
2192
|
return Zt(i, a), i.toUint8Array();
|
|
2193
2193
|
}, ti = (e) => {
|
|
2194
2194
|
e.written > 0 && (e.clientStructs.push({ written: e.written, restEncoder: O(e.encoder.restEncoder) }), e.encoder.restEncoder = B(), e.written = 0);
|
|
2195
2195
|
}, pt = (e, t, n) => {
|
|
2196
|
-
e.written > 0 && e.currClient !== t.id.client && ti(e), e.written === 0 && (e.currClient = t.id.client, e.encoder.writeClient(t.id.client),
|
|
2197
|
-
},
|
|
2196
|
+
e.written > 0 && e.currClient !== t.id.client && ti(e), e.written === 0 && (e.currClient = t.id.client, e.encoder.writeClient(t.id.client), C(e.encoder.restEncoder, t.id.clock + n)), t.write(e.encoder, n), e.written++;
|
|
2197
|
+
}, hs = (e) => {
|
|
2198
2198
|
ti(e);
|
|
2199
2199
|
const t = e.encoder.restEncoder;
|
|
2200
|
-
|
|
2200
|
+
C(t, e.clientStructs.length);
|
|
2201
2201
|
for (let n = 0; n < e.clientStructs.length; n++) {
|
|
2202
2202
|
const s = e.clientStructs[n];
|
|
2203
|
-
|
|
2203
|
+
C(t, s.written), Xe(t, s.restEncoder);
|
|
2204
2204
|
}
|
|
2205
2205
|
}, ic = (e, t, n, s) => {
|
|
2206
|
-
const r = new n(St(e)), i = new
|
|
2206
|
+
const r = new n(St(e)), i = new cs(r, !1), o = new s(), l = new as(o);
|
|
2207
2207
|
for (let a = i.curr; a !== null; a = i.next())
|
|
2208
2208
|
pt(l, t(a), 0);
|
|
2209
|
-
|
|
2210
|
-
const c =
|
|
2209
|
+
hs(l);
|
|
2210
|
+
const c = is(r);
|
|
2211
2211
|
return Zt(o, c), o.toUint8Array();
|
|
2212
|
-
}, oc = (e) => ic(e, xo, Yt, _e),
|
|
2212
|
+
}, oc = (e) => ic(e, xo, Yt, _e), Ws = "You must not compute changes after the event-handler fired.";
|
|
2213
2213
|
class Qe {
|
|
2214
2214
|
/**
|
|
2215
2215
|
* @param {T} target The changed type.
|
|
@@ -2251,7 +2251,7 @@ class Qe {
|
|
|
2251
2251
|
get keys() {
|
|
2252
2252
|
if (this._keys === null) {
|
|
2253
2253
|
if (this.transaction.doc._transactionCleanups.length === 0)
|
|
2254
|
-
throw ct(
|
|
2254
|
+
throw ct(Ws);
|
|
2255
2255
|
const t = /* @__PURE__ */ new Map(), n = this.target;
|
|
2256
2256
|
/** @type Set<string|null> */
|
|
2257
2257
|
this.transaction.changed.get(n).forEach((r) => {
|
|
@@ -2319,7 +2319,7 @@ class Qe {
|
|
|
2319
2319
|
let t = this._changes;
|
|
2320
2320
|
if (t === null) {
|
|
2321
2321
|
if (this.transaction.doc._transactionCleanups.length === 0)
|
|
2322
|
-
throw ct(
|
|
2322
|
+
throw ct(Ws);
|
|
2323
2323
|
const n = this.target, s = wt(), r = wt(), i = [];
|
|
2324
2324
|
if (t = {
|
|
2325
2325
|
added: s,
|
|
@@ -2363,20 +2363,20 @@ const lc = (e, t) => {
|
|
|
2363
2363
|
}
|
|
2364
2364
|
return n;
|
|
2365
2365
|
}, ei = 80;
|
|
2366
|
-
let
|
|
2366
|
+
let us = 0;
|
|
2367
2367
|
class cc {
|
|
2368
2368
|
/**
|
|
2369
2369
|
* @param {Item} p
|
|
2370
2370
|
* @param {number} index
|
|
2371
2371
|
*/
|
|
2372
2372
|
constructor(t, n) {
|
|
2373
|
-
t.marker = !0, this.p = t, this.index = n, this.timestamp =
|
|
2373
|
+
t.marker = !0, this.p = t, this.index = n, this.timestamp = us++;
|
|
2374
2374
|
}
|
|
2375
2375
|
}
|
|
2376
2376
|
const ac = (e) => {
|
|
2377
|
-
e.timestamp =
|
|
2377
|
+
e.timestamp = us++;
|
|
2378
2378
|
}, ni = (e, t, n) => {
|
|
2379
|
-
e.p.marker = !1, e.p = t, t.marker = !0, e.index = n, e.timestamp =
|
|
2379
|
+
e.p.marker = !1, e.p = t, t.marker = !0, e.index = n, e.timestamp = us++;
|
|
2380
2380
|
}, hc = (e, t, n) => {
|
|
2381
2381
|
if (e.length >= ei) {
|
|
2382
2382
|
const s = e.reduce((r, i) => r.timestamp < i.timestamp ? r : i);
|
|
@@ -2428,7 +2428,7 @@ const ac = (e) => {
|
|
|
2428
2428
|
};
|
|
2429
2429
|
class M {
|
|
2430
2430
|
constructor() {
|
|
2431
|
-
this._item = null, this._map = /* @__PURE__ */ new Map(), this._start = null, this.doc = null, this._length = 0, this._eH =
|
|
2431
|
+
this._item = null, this._map = /* @__PURE__ */ new Map(), this._start = null, this.doc = null, this._length = 0, this._eH = js(), this._dEH = js(), this._searchMarker = null;
|
|
2432
2432
|
}
|
|
2433
2433
|
/**
|
|
2434
2434
|
* @return {AbstractType<any>|null}
|
|
@@ -2498,7 +2498,7 @@ class M {
|
|
|
2498
2498
|
* @param {function(EventType, Transaction):void} f Observer function
|
|
2499
2499
|
*/
|
|
2500
2500
|
observe(t) {
|
|
2501
|
-
|
|
2501
|
+
Hs(this._eH, t);
|
|
2502
2502
|
}
|
|
2503
2503
|
/**
|
|
2504
2504
|
* Observe all events that are created by this type and its children.
|
|
@@ -2506,7 +2506,7 @@ class M {
|
|
|
2506
2506
|
* @param {function(Array<YEvent<any>>,Transaction):void} f Observer function
|
|
2507
2507
|
*/
|
|
2508
2508
|
observeDeep(t) {
|
|
2509
|
-
|
|
2509
|
+
Hs(this._dEH, t);
|
|
2510
2510
|
}
|
|
2511
2511
|
/**
|
|
2512
2512
|
* Unregister an observer function.
|
|
@@ -2514,7 +2514,7 @@ class M {
|
|
|
2514
2514
|
* @param {function(EventType,Transaction):void} f Observer function
|
|
2515
2515
|
*/
|
|
2516
2516
|
unobserve(t) {
|
|
2517
|
-
|
|
2517
|
+
Ps(this._eH, t);
|
|
2518
2518
|
}
|
|
2519
2519
|
/**
|
|
2520
2520
|
* Unregister an observer function.
|
|
@@ -2522,7 +2522,7 @@ class M {
|
|
|
2522
2522
|
* @param {function(Array<YEvent<any>>,Transaction):void} f Observer function
|
|
2523
2523
|
*/
|
|
2524
2524
|
unobserveDeep(t) {
|
|
2525
|
-
|
|
2525
|
+
Ps(this._dEH, t);
|
|
2526
2526
|
}
|
|
2527
2527
|
/**
|
|
2528
2528
|
* @abstract
|
|
@@ -2694,7 +2694,7 @@ const si = (e, t, n) => {
|
|
|
2694
2694
|
}, Ge = (e, t, n) => {
|
|
2695
2695
|
const s = t._map.get(n);
|
|
2696
2696
|
s !== void 0 && s.delete(e);
|
|
2697
|
-
},
|
|
2697
|
+
}, ds = (e, t, n, s) => {
|
|
2698
2698
|
const r = t._map.get(n) || null, i = e.doc, o = i.clientID;
|
|
2699
2699
|
let l;
|
|
2700
2700
|
if (s == null)
|
|
@@ -2727,7 +2727,7 @@ const si = (e, t, n) => {
|
|
|
2727
2727
|
throw new Error("Unexpected content type");
|
|
2728
2728
|
}
|
|
2729
2729
|
new L(E(o, N(i.store, o)), r, r && r.lastId, null, null, t, n, l).integrate(e, 0);
|
|
2730
|
-
},
|
|
2730
|
+
}, fs = (e, t) => {
|
|
2731
2731
|
const n = e._map.get(t);
|
|
2732
2732
|
return n !== void 0 && !n.deleted ? n.content.getContent()[n.length - 1] : void 0;
|
|
2733
2733
|
}, hi = (e) => {
|
|
@@ -3118,7 +3118,7 @@ class Z extends M {
|
|
|
3118
3118
|
*/
|
|
3119
3119
|
set(t, n) {
|
|
3120
3120
|
return this.doc !== null ? A(this.doc, (s) => {
|
|
3121
|
-
|
|
3121
|
+
ds(
|
|
3122
3122
|
s,
|
|
3123
3123
|
this,
|
|
3124
3124
|
t,
|
|
@@ -3136,7 +3136,7 @@ class Z extends M {
|
|
|
3136
3136
|
get(t) {
|
|
3137
3137
|
return (
|
|
3138
3138
|
/** @type {any} */
|
|
3139
|
-
|
|
3139
|
+
fs(this, t)
|
|
3140
3140
|
);
|
|
3141
3141
|
}
|
|
3142
3142
|
/**
|
|
@@ -3166,7 +3166,7 @@ class Z extends M {
|
|
|
3166
3166
|
}
|
|
3167
3167
|
}
|
|
3168
3168
|
const mc = (e) => new Z(), yt = (e, t) => e === t || typeof e == "object" && typeof t == "object" && e && t && Do(e, t);
|
|
3169
|
-
class
|
|
3169
|
+
class Rn {
|
|
3170
3170
|
/**
|
|
3171
3171
|
* @param {Item|null} left
|
|
3172
3172
|
* @param {Item|null} right
|
|
@@ -3195,7 +3195,7 @@ class Tn {
|
|
|
3195
3195
|
this.left = this.right, this.right = this.right.right;
|
|
3196
3196
|
}
|
|
3197
3197
|
}
|
|
3198
|
-
const
|
|
3198
|
+
const Ys = (e, t, n) => {
|
|
3199
3199
|
for (; t.right !== null && n > 0; ) {
|
|
3200
3200
|
switch (t.right.content.constructor) {
|
|
3201
3201
|
case R:
|
|
@@ -3215,11 +3215,11 @@ const Ws = (e, t, n) => {
|
|
|
3215
3215
|
}, Te = (e, t, n, s) => {
|
|
3216
3216
|
const r = /* @__PURE__ */ new Map(), i = s ? tn(t, n) : null;
|
|
3217
3217
|
if (i) {
|
|
3218
|
-
const o = new
|
|
3219
|
-
return
|
|
3218
|
+
const o = new Rn(i.p.left, i.p, i.index, r);
|
|
3219
|
+
return Ys(e, o, n - i.index);
|
|
3220
3220
|
} else {
|
|
3221
|
-
const o = new
|
|
3222
|
-
return
|
|
3221
|
+
const o = new Rn(null, t._start, 0, r);
|
|
3222
|
+
return Ys(e, o, n);
|
|
3223
3223
|
}
|
|
3224
3224
|
}, di = (e, t, n, s) => {
|
|
3225
3225
|
for (; n.right !== null && (n.right.deleted === !0 || n.right.content.constructor === R && yt(
|
|
@@ -3278,7 +3278,7 @@ const Ws = (e, t, n) => {
|
|
|
3278
3278
|
) : s instanceof M ? new ft(s) : new Bt(s);
|
|
3279
3279
|
let { left: a, right: h, index: u } = n;
|
|
3280
3280
|
t._searchMarker && de(t._searchMarker, n.index, c.getLength()), h = new L(E(o, N(i.store, o)), a, a && a.lastId, h, h && h.id, t, null, c), h.integrate(e, 0), n.right = h, n.index = u, n.forward(), di(e, t, n, l);
|
|
3281
|
-
},
|
|
3281
|
+
}, Js = (e, t, n, s, r) => {
|
|
3282
3282
|
const i = e.doc, o = i.clientID;
|
|
3283
3283
|
fi(n, r);
|
|
3284
3284
|
const l = gi(e, t, n, r);
|
|
@@ -3378,7 +3378,7 @@ const Ws = (e, t, n) => {
|
|
|
3378
3378
|
/** @type {Item} */
|
|
3379
3379
|
e._start
|
|
3380
3380
|
), r = e._start, i = z();
|
|
3381
|
-
const o =
|
|
3381
|
+
const o = An(i);
|
|
3382
3382
|
for (; r; ) {
|
|
3383
3383
|
if (r.deleted === !1)
|
|
3384
3384
|
switch (r.content.constructor) {
|
|
@@ -3390,7 +3390,7 @@ const Ws = (e, t, n) => {
|
|
|
3390
3390
|
);
|
|
3391
3391
|
break;
|
|
3392
3392
|
default:
|
|
3393
|
-
t += pi(n, s, r, i, o), i =
|
|
3393
|
+
t += pi(n, s, r, i, o), i = An(o), s = r;
|
|
3394
3394
|
break;
|
|
3395
3395
|
}
|
|
3396
3396
|
r = r.right;
|
|
@@ -3433,8 +3433,8 @@ const Ws = (e, t, n) => {
|
|
|
3433
3433
|
for (const r of t)
|
|
3434
3434
|
bc(r);
|
|
3435
3435
|
});
|
|
3436
|
-
},
|
|
3437
|
-
const s = n, r =
|
|
3436
|
+
}, Xs = (e, t, n) => {
|
|
3437
|
+
const s = n, r = An(t.currentAttributes), i = t.right;
|
|
3438
3438
|
for (; n > 0 && t.right !== null; ) {
|
|
3439
3439
|
if (t.right.deleted === !1)
|
|
3440
3440
|
switch (t.right.content.constructor) {
|
|
@@ -3454,7 +3454,7 @@ const Ws = (e, t, n) => {
|
|
|
3454
3454
|
);
|
|
3455
3455
|
return o._searchMarker && de(o._searchMarker, t.index, -s + n), t;
|
|
3456
3456
|
};
|
|
3457
|
-
class
|
|
3457
|
+
class Cc extends Qe {
|
|
3458
3458
|
/**
|
|
3459
3459
|
* @param {YText} ytext
|
|
3460
3460
|
* @param {Transaction} transaction
|
|
@@ -3510,12 +3510,12 @@ class kc extends Qe {
|
|
|
3510
3510
|
u > 0 && (f = { delete: u }), u = 0;
|
|
3511
3511
|
break;
|
|
3512
3512
|
case "insert":
|
|
3513
|
-
(typeof a == "object" || a.length > 0) && (f = { insert: a }, r.size > 0 && (f.attributes = {}, r.forEach((g,
|
|
3514
|
-
g !== null && (f.attributes[
|
|
3513
|
+
(typeof a == "object" || a.length > 0) && (f = { insert: a }, r.size > 0 && (f.attributes = {}, r.forEach((g, b) => {
|
|
3514
|
+
g !== null && (f.attributes[b] = g);
|
|
3515
3515
|
}))), a = "";
|
|
3516
3516
|
break;
|
|
3517
3517
|
case "retain":
|
|
3518
|
-
h > 0 && (f = { retain: h }, vo(c) || (f.attributes =
|
|
3518
|
+
h > 0 && (f = { retain: h }, vo(c) || (f.attributes = ko({}, c))), h = 0;
|
|
3519
3519
|
break;
|
|
3520
3520
|
}
|
|
3521
3521
|
f && n.push(f), l = null;
|
|
@@ -3538,17 +3538,17 @@ class kc extends Qe {
|
|
|
3538
3538
|
);
|
|
3539
3539
|
if (this.adds(o)) {
|
|
3540
3540
|
if (!this.deletes(o)) {
|
|
3541
|
-
const
|
|
3542
|
-
yt(
|
|
3541
|
+
const b = r.get(f) ?? null;
|
|
3542
|
+
yt(b, g) ? g !== null && o.delete(s) : (l === "retain" && d(), yt(g, i.get(f) ?? null) ? delete c[f] : c[f] = g);
|
|
3543
3543
|
}
|
|
3544
3544
|
} else if (this.deletes(o)) {
|
|
3545
3545
|
i.set(f, g);
|
|
3546
|
-
const
|
|
3547
|
-
yt(
|
|
3546
|
+
const b = r.get(f) ?? null;
|
|
3547
|
+
yt(b, g) || (l === "retain" && d(), c[f] = b);
|
|
3548
3548
|
} else if (!o.deleted) {
|
|
3549
3549
|
i.set(f, g);
|
|
3550
|
-
const
|
|
3551
|
-
|
|
3550
|
+
const b = c[f];
|
|
3551
|
+
b !== void 0 && (yt(b, g) ? b !== null && o.delete(s) : (l === "retain" && d(), g === null ? delete c[f] : c[f] = g));
|
|
3552
3552
|
}
|
|
3553
3553
|
o.deleted || (l === "insert" && d(), Qt(
|
|
3554
3554
|
r,
|
|
@@ -3625,7 +3625,7 @@ class at extends M {
|
|
|
3625
3625
|
*/
|
|
3626
3626
|
_callObserver(t, n) {
|
|
3627
3627
|
super._callObserver(t, n);
|
|
3628
|
-
const s = new
|
|
3628
|
+
const s = new Cc(this, t, n);
|
|
3629
3629
|
en(this, t, s), !t.local && this._hasFormatting && (t._needFormattingCleanup = !0);
|
|
3630
3630
|
}
|
|
3631
3631
|
/**
|
|
@@ -3661,7 +3661,7 @@ class at extends M {
|
|
|
3661
3661
|
*/
|
|
3662
3662
|
applyDelta(t, { sanitize: n = !0 } = {}) {
|
|
3663
3663
|
this.doc !== null ? A(this.doc, (s) => {
|
|
3664
|
-
const r = new
|
|
3664
|
+
const r = new Rn(null, this._start, 0, /* @__PURE__ */ new Map());
|
|
3665
3665
|
for (let i = 0; i < t.length; i++) {
|
|
3666
3666
|
const o = t[i];
|
|
3667
3667
|
if (o.insert !== void 0) {
|
|
@@ -3669,7 +3669,7 @@ class at extends M {
|
|
|
3669
3669
|
` ? o.insert.slice(0, -1) : o.insert;
|
|
3670
3670
|
(typeof l != "string" || l.length > 0) && mn(s, this, r, l, o.attributes || {});
|
|
3671
3671
|
} else
|
|
3672
|
-
o.retain !== void 0 ?
|
|
3672
|
+
o.retain !== void 0 ? Js(s, this, r, o.retain, o.attributes || {}) : o.delete !== void 0 && Xs(s, r, o.delete);
|
|
3673
3673
|
}
|
|
3674
3674
|
}) : this._pending.push(() => this.applyDelta(t));
|
|
3675
3675
|
}
|
|
@@ -3693,8 +3693,8 @@ class at extends M {
|
|
|
3693
3693
|
if (l.length > 0) {
|
|
3694
3694
|
const u = {};
|
|
3695
3695
|
let d = !1;
|
|
3696
|
-
i.forEach((g,
|
|
3697
|
-
d = !0, u[
|
|
3696
|
+
i.forEach((g, b) => {
|
|
3697
|
+
d = !0, u[b] = g;
|
|
3698
3698
|
});
|
|
3699
3699
|
const f = { insert: l };
|
|
3700
3700
|
d && (f.attributes = u), r.push(f), l = "";
|
|
@@ -3741,7 +3741,7 @@ class at extends M {
|
|
|
3741
3741
|
a();
|
|
3742
3742
|
};
|
|
3743
3743
|
return t || n ? A(o, (u) => {
|
|
3744
|
-
t &&
|
|
3744
|
+
t && Ln(u, t), n && Ln(u, n), h();
|
|
3745
3745
|
}, "cleanup") : h(), r;
|
|
3746
3746
|
}
|
|
3747
3747
|
/**
|
|
@@ -3795,7 +3795,7 @@ class at extends M {
|
|
|
3795
3795
|
return;
|
|
3796
3796
|
const s = this.doc;
|
|
3797
3797
|
s !== null ? A(s, (r) => {
|
|
3798
|
-
|
|
3798
|
+
Xs(r, Te(r, this, t, !0), n);
|
|
3799
3799
|
}) : this._pending.push(() => this.delete(t, n));
|
|
3800
3800
|
}
|
|
3801
3801
|
/**
|
|
@@ -3814,7 +3814,7 @@ class at extends M {
|
|
|
3814
3814
|
const r = this.doc;
|
|
3815
3815
|
r !== null ? A(r, (i) => {
|
|
3816
3816
|
const o = Te(i, this, t, !1);
|
|
3817
|
-
o.right !== null &&
|
|
3817
|
+
o.right !== null && Js(i, this, o, n, s);
|
|
3818
3818
|
}) : this._pending.push(() => this.format(t, n, s));
|
|
3819
3819
|
}
|
|
3820
3820
|
/**
|
|
@@ -3843,7 +3843,7 @@ class at extends M {
|
|
|
3843
3843
|
*/
|
|
3844
3844
|
setAttribute(t, n) {
|
|
3845
3845
|
this.doc !== null ? A(this.doc, (s) => {
|
|
3846
|
-
|
|
3846
|
+
ds(s, this, t, n);
|
|
3847
3847
|
}) : this._pending.push(() => this.setAttribute(t, n));
|
|
3848
3848
|
}
|
|
3849
3849
|
/**
|
|
@@ -3860,7 +3860,7 @@ class at extends M {
|
|
|
3860
3860
|
getAttribute(t) {
|
|
3861
3861
|
return (
|
|
3862
3862
|
/** @type {any} */
|
|
3863
|
-
|
|
3863
|
+
fs(this, t)
|
|
3864
3864
|
);
|
|
3865
3865
|
}
|
|
3866
3866
|
/**
|
|
@@ -3882,7 +3882,7 @@ class at extends M {
|
|
|
3882
3882
|
t.writeTypeRef(zc);
|
|
3883
3883
|
}
|
|
3884
3884
|
}
|
|
3885
|
-
const
|
|
3885
|
+
const kc = (e) => new at();
|
|
3886
3886
|
class wn {
|
|
3887
3887
|
/**
|
|
3888
3888
|
* @param {YXmlFragment | YXmlElement} root
|
|
@@ -4297,7 +4297,7 @@ class ht extends Q {
|
|
|
4297
4297
|
*/
|
|
4298
4298
|
setAttribute(t, n) {
|
|
4299
4299
|
this.doc !== null ? A(this.doc, (s) => {
|
|
4300
|
-
|
|
4300
|
+
ds(s, this, t, n);
|
|
4301
4301
|
}) : this._prelimAttrs.set(t, n);
|
|
4302
4302
|
}
|
|
4303
4303
|
/**
|
|
@@ -4314,7 +4314,7 @@ class ht extends Q {
|
|
|
4314
4314
|
getAttribute(t) {
|
|
4315
4315
|
return (
|
|
4316
4316
|
/** @type {any} */
|
|
4317
|
-
|
|
4317
|
+
fs(this, t)
|
|
4318
4318
|
);
|
|
4319
4319
|
}
|
|
4320
4320
|
/**
|
|
@@ -4552,7 +4552,7 @@ class Lt extends at {
|
|
|
4552
4552
|
}
|
|
4553
4553
|
}
|
|
4554
4554
|
const Dc = (e) => new Lt();
|
|
4555
|
-
class
|
|
4555
|
+
class gs {
|
|
4556
4556
|
/**
|
|
4557
4557
|
* @param {ID} id
|
|
4558
4558
|
* @param {number} length
|
|
@@ -4593,7 +4593,7 @@ class fs {
|
|
|
4593
4593
|
}
|
|
4594
4594
|
}
|
|
4595
4595
|
const xc = 0;
|
|
4596
|
-
class P extends
|
|
4596
|
+
class P extends gs {
|
|
4597
4597
|
get deleted() {
|
|
4598
4598
|
return !0;
|
|
4599
4599
|
}
|
|
@@ -5278,7 +5278,7 @@ class tt {
|
|
|
5278
5278
|
const Nc = (e) => new tt(e.readString()), $c = [
|
|
5279
5279
|
pc,
|
|
5280
5280
|
mc,
|
|
5281
|
-
|
|
5281
|
+
kc,
|
|
5282
5282
|
Ec,
|
|
5283
5283
|
_c,
|
|
5284
5284
|
Ac,
|
|
@@ -5389,7 +5389,7 @@ const Kc = (e) => new ft($c[e.readTypeRef()](e)), Ye = (e, t, n) => {
|
|
|
5389
5389
|
);
|
|
5390
5390
|
return t.deleted && i.markDeleted(), t.keep && (i.keep = !0), t.redone !== null && (i.redone = E(t.redone.client, t.redone.clock + n)), t.right = i, i.right !== null && (i.right.left = i), e._mergeStructs.push(i), i.parentSub !== null && i.right === null && i.parent._map.set(i.parentSub, i), t.length = n, i;
|
|
5391
5391
|
};
|
|
5392
|
-
class L extends
|
|
5392
|
+
class L extends gs {
|
|
5393
5393
|
/**
|
|
5394
5394
|
* @param {ID} id
|
|
5395
5395
|
* @param {Item | null} left
|
|
@@ -5401,7 +5401,7 @@ class L extends fs {
|
|
|
5401
5401
|
* @param {AbstractContent} content
|
|
5402
5402
|
*/
|
|
5403
5403
|
constructor(t, n, s, r, i, o, l, c) {
|
|
5404
|
-
super(t, c.getLength()), this.origin = s, this.left = n, this.right = r, this.rightOrigin = i, this.parent = o, this.parentSub = l, this.redone = null, this.content = c, this.info = this.content.isCountable() ?
|
|
5404
|
+
super(t, c.getLength()), this.origin = s, this.left = n, this.right = r, this.rightOrigin = i, this.parent = o, this.parentSub = l, this.redone = null, this.content = c, this.info = this.content.isCountable() ? Rs : 0;
|
|
5405
5405
|
}
|
|
5406
5406
|
/**
|
|
5407
5407
|
* This is used to mark the item as an indexed fast-search marker
|
|
@@ -5418,13 +5418,13 @@ class L extends fs {
|
|
|
5418
5418
|
* If true, do not garbage collect this Item.
|
|
5419
5419
|
*/
|
|
5420
5420
|
get keep() {
|
|
5421
|
-
return (this.info &
|
|
5421
|
+
return (this.info & Ts) > 0;
|
|
5422
5422
|
}
|
|
5423
5423
|
set keep(t) {
|
|
5424
|
-
this.keep !== t && (this.info ^=
|
|
5424
|
+
this.keep !== t && (this.info ^= Ts);
|
|
5425
5425
|
}
|
|
5426
5426
|
get countable() {
|
|
5427
|
-
return (this.info &
|
|
5427
|
+
return (this.info & Rs) > 0;
|
|
5428
5428
|
}
|
|
5429
5429
|
/**
|
|
5430
5430
|
* Whether this item was deleted or not.
|
|
@@ -5453,7 +5453,7 @@ class L extends fs {
|
|
|
5453
5453
|
return this.rightOrigin.client;
|
|
5454
5454
|
if (this.parent && this.parent.constructor === Pt && this.id.client !== this.parent.client && this.parent.clock >= N(n, this.parent.client))
|
|
5455
5455
|
return this.parent.client;
|
|
5456
|
-
if (this.origin && (this.left =
|
|
5456
|
+
if (this.origin && (this.left = Vs(t, n, this.origin), this.origin = this.left.lastId), this.rightOrigin && (this.right = bt(t, this.rightOrigin), this.rightOrigin = this.right.id), this.left && this.left.constructor === P || this.right && this.right.constructor === P)
|
|
5457
5457
|
this.parent = null;
|
|
5458
5458
|
else if (!this.parent)
|
|
5459
5459
|
this.left && this.left.constructor === L && (this.parent = this.left.parent, this.parentSub = this.left.parentSub), this.right && this.right.constructor === L && (this.parent = this.right.parent, this.parentSub = this.right.parentSub);
|
|
@@ -5469,7 +5469,7 @@ class L extends fs {
|
|
|
5469
5469
|
* @param {number} offset
|
|
5470
5470
|
*/
|
|
5471
5471
|
integrate(t, n) {
|
|
5472
|
-
if (n > 0 && (this.id.clock += n, this.left =
|
|
5472
|
+
if (n > 0 && (this.id.clock += n, this.left = Vs(t, t.doc.store, E(this.id.client, this.id.clock - 1)), this.origin = this.left.lastId, this.content = this.content.splice(n), this.length -= n), this.parent) {
|
|
5473
5473
|
if (!this.left && (!this.right || this.right.left !== null) || this.left && this.left.right !== this.right) {
|
|
5474
5474
|
let s = this.left, r;
|
|
5475
5475
|
if (s !== null)
|
|
@@ -5510,7 +5510,7 @@ class L extends fs {
|
|
|
5510
5510
|
this.parent._start, this.parent._start = this;
|
|
5511
5511
|
this.right = s;
|
|
5512
5512
|
}
|
|
5513
|
-
this.right !== null ? this.right.left = this : this.parentSub !== null && (this.parent._map.set(this.parentSub, this), this.left !== null && this.left.delete(t)), this.parentSub === null && this.countable && !this.deleted && (this.parent._length += this.length), qr(t.doc.store, this), this.content.integrate(t, this),
|
|
5513
|
+
this.right !== null ? this.right.left = this : this.parentSub !== null && (this.parent._map.set(this.parentSub, this), this.left !== null && this.left.delete(t)), this.parentSub === null && this.countable && !this.deleted && (this.parent._length += this.length), qr(t.doc.store, this), this.content.integrate(t, this), Gs(
|
|
5514
5514
|
t,
|
|
5515
5515
|
/** @type {AbstractType<any>} */
|
|
5516
5516
|
this.parent,
|
|
@@ -5574,7 +5574,7 @@ class L extends fs {
|
|
|
5574
5574
|
/** @type {AbstractType<any>} */
|
|
5575
5575
|
this.parent
|
|
5576
5576
|
);
|
|
5577
|
-
this.countable && this.parentSub === null && (n._length -= this.length), this.markDeleted(), Pe(t.deleteSet, this.id.client, this.id.clock, this.length),
|
|
5577
|
+
this.countable && this.parentSub === null && (n._length -= this.length), this.markDeleted(), Pe(t.deleteSet, this.id.client, this.id.clock, this.length), Gs(t, n, this.parentSub), this.content.delete(t);
|
|
5578
5578
|
}
|
|
5579
5579
|
}
|
|
5580
5580
|
/**
|
|
@@ -5646,7 +5646,7 @@ const mi = (e, t) => Gc[t & Je](e), Gc = [
|
|
|
5646
5646
|
}
|
|
5647
5647
|
// 10 - Skip is not ItemContent
|
|
5648
5648
|
], Wc = 10;
|
|
5649
|
-
class K extends
|
|
5649
|
+
class K extends gs {
|
|
5650
5650
|
get deleted() {
|
|
5651
5651
|
return !0;
|
|
5652
5652
|
}
|
|
@@ -5671,7 +5671,7 @@ class K extends fs {
|
|
|
5671
5671
|
* @param {number} offset
|
|
5672
5672
|
*/
|
|
5673
5673
|
write(t, n) {
|
|
5674
|
-
t.writeInfo(Wc),
|
|
5674
|
+
t.writeInfo(Wc), C(t.restEncoder, this.length - n);
|
|
5675
5675
|
}
|
|
5676
5676
|
/**
|
|
5677
5677
|
* @param {Transaction} transaction
|
|
@@ -5694,7 +5694,7 @@ const Yc = 0, Jc = (e, t, n) => {
|
|
|
5694
5694
|
n(t, mt(e));
|
|
5695
5695
|
}
|
|
5696
5696
|
}, bn = 3e4;
|
|
5697
|
-
class Xc extends
|
|
5697
|
+
class Xc extends ns {
|
|
5698
5698
|
/**
|
|
5699
5699
|
* @param {Y.Doc} doc
|
|
5700
5700
|
*/
|
|
@@ -5707,7 +5707,7 @@ class Xc extends es {
|
|
|
5707
5707
|
const s = [];
|
|
5708
5708
|
this.meta.forEach((r, i) => {
|
|
5709
5709
|
i !== this.clientID && bn <= n - r.lastUpdated && this.states.has(i) && s.push(i);
|
|
5710
|
-
}), s.length > 0 &&
|
|
5710
|
+
}), s.length > 0 && ps(this, s, "timeout");
|
|
5711
5711
|
}, lt(bn / 10)), t.on("destroy", () => {
|
|
5712
5712
|
this.destroy();
|
|
5713
5713
|
}), this.setLocalState({});
|
|
@@ -5751,7 +5751,7 @@ class Xc extends es {
|
|
|
5751
5751
|
return this.states;
|
|
5752
5752
|
}
|
|
5753
5753
|
}
|
|
5754
|
-
const
|
|
5754
|
+
const ps = (e, t, n) => {
|
|
5755
5755
|
const s = [];
|
|
5756
5756
|
for (let r = 0; r < t.length; r++) {
|
|
5757
5757
|
const i = t[r];
|
|
@@ -5772,13 +5772,13 @@ const gs = (e, t, n) => {
|
|
|
5772
5772
|
s.length > 0 && (e.emit("change", [{ added: [], updated: [], removed: s }, n]), e.emit("update", [{ added: [], updated: [], removed: s }, n]));
|
|
5773
5773
|
}, ie = (e, t, n = e.states) => {
|
|
5774
5774
|
const s = t.length, r = B();
|
|
5775
|
-
|
|
5775
|
+
C(r, s);
|
|
5776
5776
|
for (let i = 0; i < s; i++) {
|
|
5777
5777
|
const o = t[i], l = n.get(o) || null, c = (
|
|
5778
5778
|
/** @type {MetaClientState} */
|
|
5779
5779
|
e.meta.get(o).clock
|
|
5780
5780
|
);
|
|
5781
|
-
|
|
5781
|
+
C(r, o), C(r, c), Dt(r, JSON.stringify(l));
|
|
5782
5782
|
}
|
|
5783
5783
|
return O(r);
|
|
5784
5784
|
}, qc = (e, t, n) => {
|
|
@@ -5786,11 +5786,11 @@ const gs = (e, t, n) => {
|
|
|
5786
5786
|
for (let h = 0; h < a; h++) {
|
|
5787
5787
|
const u = _(s);
|
|
5788
5788
|
let d = _(s);
|
|
5789
|
-
const f = JSON.parse(mt(s)), g = e.meta.get(u),
|
|
5789
|
+
const f = JSON.parse(mt(s)), g = e.meta.get(u), b = e.states.get(u), v = g === void 0 ? 0 : g.clock;
|
|
5790
5790
|
(v < d || v === d && f === null && e.states.has(u)) && (f === null ? u === e.clientID && e.getLocalState() != null ? d++ : e.states.delete(u) : e.states.set(u, f), e.meta.set(u, {
|
|
5791
5791
|
clock: d,
|
|
5792
5792
|
lastUpdated: r
|
|
5793
|
-
}), g === void 0 && f !== null ? i.push(u) : g !== void 0 && f === null ? c.push(u) : f !== null && (re(f,
|
|
5793
|
+
}), g === void 0 && f !== null ? i.push(u) : g !== void 0 && f === null ? c.push(u) : f !== null && (re(f, b) || l.push(u), o.push(u)));
|
|
5794
5794
|
}
|
|
5795
5795
|
(i.length > 0 || l.length > 0 || c.length > 0) && e.emit("change", [{
|
|
5796
5796
|
added: i,
|
|
@@ -5801,30 +5801,30 @@ const gs = (e, t, n) => {
|
|
|
5801
5801
|
updated: o,
|
|
5802
5802
|
removed: c
|
|
5803
5803
|
}, n]);
|
|
5804
|
-
}, Si = 0,
|
|
5805
|
-
|
|
5804
|
+
}, Si = 0, ys = 1, Ci = 2, Un = (e, t) => {
|
|
5805
|
+
C(e, Si);
|
|
5806
5806
|
const n = Wl(t);
|
|
5807
5807
|
I(e, n);
|
|
5808
|
-
},
|
|
5809
|
-
|
|
5810
|
-
}, Zc = (e, t, n) =>
|
|
5808
|
+
}, ki = (e, t, n) => {
|
|
5809
|
+
C(e, ys), I(e, ls(t, n));
|
|
5810
|
+
}, Zc = (e, t, n) => ki(t, n, $(e)), _i = (e, t, n) => {
|
|
5811
5811
|
try {
|
|
5812
5812
|
Gr(t, $(e), n);
|
|
5813
5813
|
} catch (s) {
|
|
5814
5814
|
console.error("Caught error while handling a Yjs update", s);
|
|
5815
5815
|
}
|
|
5816
5816
|
}, Qc = (e, t) => {
|
|
5817
|
-
|
|
5817
|
+
C(e, Ci), I(e, t);
|
|
5818
5818
|
}, ta = _i, ea = (e, t, n, s) => {
|
|
5819
5819
|
const r = _(e);
|
|
5820
5820
|
switch (r) {
|
|
5821
5821
|
case Si:
|
|
5822
5822
|
Zc(e, t, n);
|
|
5823
5823
|
break;
|
|
5824
|
-
case
|
|
5824
|
+
case ys:
|
|
5825
5825
|
_i(e, n, s);
|
|
5826
5826
|
break;
|
|
5827
|
-
case
|
|
5827
|
+
case Ci:
|
|
5828
5828
|
ta(e, n, s);
|
|
5829
5829
|
break;
|
|
5830
5830
|
default:
|
|
@@ -5839,17 +5839,17 @@ function ra(e, t) {
|
|
|
5839
5839
|
}
|
|
5840
5840
|
var Ae = [];
|
|
5841
5841
|
Ae[Et] = (e, t, n, s, r) => {
|
|
5842
|
-
|
|
5842
|
+
C(e, Et);
|
|
5843
5843
|
const i = ea(
|
|
5844
5844
|
t,
|
|
5845
5845
|
e,
|
|
5846
5846
|
n.doc,
|
|
5847
5847
|
n
|
|
5848
5848
|
);
|
|
5849
|
-
s && i ===
|
|
5849
|
+
s && i === ys && !n.synced && (n.synced = !0);
|
|
5850
5850
|
};
|
|
5851
5851
|
Ae[Ei] = (e, t, n, s, r) => {
|
|
5852
|
-
|
|
5852
|
+
C(e, Vt), I(
|
|
5853
5853
|
e,
|
|
5854
5854
|
ie(
|
|
5855
5855
|
n.awareness,
|
|
@@ -5871,7 +5871,7 @@ Ae[na] = (e, t, n, s, r) => {
|
|
|
5871
5871
|
(i, o) => ia(n, o)
|
|
5872
5872
|
);
|
|
5873
5873
|
};
|
|
5874
|
-
var
|
|
5874
|
+
var qs = 3e4;
|
|
5875
5875
|
function ia(e, t) {
|
|
5876
5876
|
console.warn(`Permission denied to access ${e.url}.
|
|
5877
5877
|
${t}`);
|
|
@@ -5892,11 +5892,11 @@ function Ai(e) {
|
|
|
5892
5892
|
return;
|
|
5893
5893
|
e.wsLastMessageReceived = Mt();
|
|
5894
5894
|
const s = vi(e, new Uint8Array(n.data), !0);
|
|
5895
|
-
|
|
5895
|
+
Xn(s) > 1 && ne(O(s), t);
|
|
5896
5896
|
}), t.addEventListener("error", (n) => {
|
|
5897
5897
|
e.emit("connection-error", [n, e]);
|
|
5898
5898
|
}), t.addEventListener("close", (n) => {
|
|
5899
|
-
e.emit("connection-close", [n, e]), e.ws = null, e.wsconnecting = !1, e.wsconnected ? (e.wsconnected = !1, e.synced = !1,
|
|
5899
|
+
e.emit("connection-close", [n, e]), e.ws = null, e.wsconnecting = !1, e.wsconnected ? (e.wsconnected = !1, e.synced = !1, ps(
|
|
5900
5900
|
e.awareness,
|
|
5901
5901
|
Array.from(e.awareness.getStates().keys()).filter(
|
|
5902
5902
|
(s) => s !== e.doc.clientID
|
|
@@ -5908,7 +5908,7 @@ function Ai(e) {
|
|
|
5908
5908
|
}
|
|
5909
5909
|
])) : e.wsUnsuccessfulReconnects++, setTimeout(
|
|
5910
5910
|
Ai,
|
|
5911
|
-
|
|
5911
|
+
Jn(
|
|
5912
5912
|
To(2, e.wsUnsuccessfulReconnects) * 100,
|
|
5913
5913
|
e.maxBackoffTime
|
|
5914
5914
|
),
|
|
@@ -5921,9 +5921,9 @@ function Ai(e) {
|
|
|
5921
5921
|
}
|
|
5922
5922
|
]);
|
|
5923
5923
|
const n = B();
|
|
5924
|
-
if (
|
|
5924
|
+
if (C(n, Et), Un(n, e.doc), ne(O(n), t), e.awareness.getLocalState() !== null) {
|
|
5925
5925
|
const s = B();
|
|
5926
|
-
|
|
5926
|
+
C(s, Vt), I(
|
|
5927
5927
|
s,
|
|
5928
5928
|
ie(e.awareness, [
|
|
5929
5929
|
e.doc.clientID
|
|
@@ -5941,7 +5941,7 @@ function Sn(e, t) {
|
|
|
5941
5941
|
const n = e.ws;
|
|
5942
5942
|
e.wsconnected && n && n.readyState === n.OPEN && ne(t, n), e.bcconnected && jt(e.bcChannel, t, e);
|
|
5943
5943
|
}
|
|
5944
|
-
var oa = typeof WebSocket > "u" ? null : WebSocket, la = class extends
|
|
5944
|
+
var oa = typeof WebSocket > "u" ? null : WebSocket, la = class extends ns {
|
|
5945
5945
|
constructor(t, n, s, {
|
|
5946
5946
|
connect: r = !0,
|
|
5947
5947
|
awareness: i = new Xc(s),
|
|
@@ -5988,34 +5988,34 @@ var oa = typeof WebSocket > "u" ? null : WebSocket, la = class extends es {
|
|
|
5988
5988
|
setInterval(() => {
|
|
5989
5989
|
if (this.ws && this.ws.readyState === WebSocket.OPEN) {
|
|
5990
5990
|
const f = B();
|
|
5991
|
-
|
|
5991
|
+
C(f, Et), Un(f, s), ne(O(f), this.ws);
|
|
5992
5992
|
}
|
|
5993
5993
|
}, a)), this._bcSubscriber = (f, g) => {
|
|
5994
5994
|
if (g !== this) {
|
|
5995
|
-
const
|
|
5996
|
-
|
|
5995
|
+
const b = vi(this, new Uint8Array(f), !1);
|
|
5996
|
+
Xn(b) > 1 && jt(this.bcChannel, O(b), this);
|
|
5997
5997
|
}
|
|
5998
5998
|
}, this._updateHandler = (f, g) => {
|
|
5999
5999
|
if (g !== this) {
|
|
6000
|
-
const
|
|
6001
|
-
|
|
6000
|
+
const b = B();
|
|
6001
|
+
C(b, Et), Qc(b, f), Sn(this, O(b));
|
|
6002
6002
|
}
|
|
6003
|
-
}, this.doc.on("update", this._updateHandler), this._awarenessUpdateHandler = ({ added: f, updated: g, removed:
|
|
6004
|
-
const nt = f.concat(g).concat(
|
|
6005
|
-
|
|
6003
|
+
}, this.doc.on("update", this._updateHandler), this._awarenessUpdateHandler = ({ added: f, updated: g, removed: b }, v) => {
|
|
6004
|
+
const nt = f.concat(g).concat(b), gt = B();
|
|
6005
|
+
C(gt, Vt), I(
|
|
6006
6006
|
gt,
|
|
6007
6007
|
ie(i, nt)
|
|
6008
6008
|
), Sn(this, O(gt));
|
|
6009
6009
|
}, this._unloadHandler = () => {
|
|
6010
|
-
|
|
6010
|
+
ps(
|
|
6011
6011
|
this.awareness,
|
|
6012
6012
|
[s.clientID],
|
|
6013
6013
|
"window unload"
|
|
6014
6014
|
);
|
|
6015
6015
|
}, typeof window < "u" ? window.addEventListener("unload", this._unloadHandler) : typeof process < "u" && typeof process.on == "function" && process.on("exit", this._unloadHandler), i.on("update", this._awarenessUpdateHandler), this._checkInterval = /** @type {any} */
|
|
6016
6016
|
setInterval(() => {
|
|
6017
|
-
this.wsconnected &&
|
|
6018
|
-
},
|
|
6017
|
+
this.wsconnected && qs < Mt() - this.wsLastMessageReceived && (ra(this.ws !== null, "ws must not be null"), this.ws.close());
|
|
6018
|
+
}, qs / 10), r && this.connect();
|
|
6019
6019
|
}
|
|
6020
6020
|
/**
|
|
6021
6021
|
* @type {boolean}
|
|
@@ -6034,17 +6034,17 @@ var oa = typeof WebSocket > "u" ? null : WebSocket, la = class extends es {
|
|
|
6034
6034
|
return;
|
|
6035
6035
|
this.bcconnected || (ul(this.bcChannel, this._bcSubscriber), this.bcconnected = !0);
|
|
6036
6036
|
const t = B();
|
|
6037
|
-
|
|
6037
|
+
C(t, Et), Un(t, this.doc), jt(this.bcChannel, O(t), this);
|
|
6038
6038
|
const n = B();
|
|
6039
|
-
|
|
6039
|
+
C(n, Et), ki(n, this.doc), jt(this.bcChannel, O(n), this);
|
|
6040
6040
|
const s = B();
|
|
6041
|
-
|
|
6041
|
+
C(s, Ei), jt(
|
|
6042
6042
|
this.bcChannel,
|
|
6043
6043
|
O(s),
|
|
6044
6044
|
this
|
|
6045
6045
|
);
|
|
6046
6046
|
const r = B();
|
|
6047
|
-
|
|
6047
|
+
C(r, Vt), I(
|
|
6048
6048
|
r,
|
|
6049
6049
|
ie(this.awareness, [
|
|
6050
6050
|
this.doc.clientID
|
|
@@ -6057,7 +6057,7 @@ var oa = typeof WebSocket > "u" ? null : WebSocket, la = class extends es {
|
|
|
6057
6057
|
}
|
|
6058
6058
|
disconnectBc() {
|
|
6059
6059
|
const t = B();
|
|
6060
|
-
|
|
6060
|
+
C(t, Vt), I(
|
|
6061
6061
|
t,
|
|
6062
6062
|
ie(
|
|
6063
6063
|
this.awareness,
|
|
@@ -6082,7 +6082,7 @@ function ca() {
|
|
|
6082
6082
|
return e > 0 ? (s = (e + s) % 16 | 0, e = Math.floor(e / 16)) : (s = (t + s) % 16 | 0, t = Math.floor(t / 16)), (n === "x" ? s : s & 3 | 8).toString(16);
|
|
6083
6083
|
});
|
|
6084
6084
|
}
|
|
6085
|
-
function
|
|
6085
|
+
function Zs(e, t, n) {
|
|
6086
6086
|
if (typeof e !== n)
|
|
6087
6087
|
throw new Error(
|
|
6088
6088
|
`Invalid "${t}" parameter provided to YPartyKitProvider. Expected: ${n}, received: ${e}`
|
|
@@ -6090,7 +6090,7 @@ function qs(e, t, n) {
|
|
|
6090
6090
|
}
|
|
6091
6091
|
var vt, br, aa = (br = class extends la {
|
|
6092
6092
|
constructor(t, n, s, r = {}) {
|
|
6093
|
-
|
|
6093
|
+
Zs(t, "host", "string"), Zs(n, "room", "string"), t = t.replace(/^(http|https|ws|wss):\/\//, ""), t.endsWith("/") && t.slice(0, -1);
|
|
6094
6094
|
const i = `${r.protocol || (t.startsWith("localhost:") || t.startsWith("127.0.0.1:") || t.startsWith("192.168.") || t.startsWith("10.") || t.startsWith("172.") && t.split(".")[1] >= "16" && t.split(".")[1] <= "31" ? "ws" : "wss")}://${t}${r.prefix || `/parties/${r.party || "main"}`}`, o = r.connectionId ?? ca(), { params: l, connect: c = !0, ...a } = r, h = {
|
|
6095
6095
|
...a,
|
|
6096
6096
|
isPrefixedUrl: !!r.prefix,
|
|
@@ -6098,8 +6098,8 @@ var vt, br, aa = (br = class extends la {
|
|
|
6098
6098
|
};
|
|
6099
6099
|
super(i, n, s ?? new dt(), h);
|
|
6100
6100
|
w(this, "id");
|
|
6101
|
-
|
|
6102
|
-
this.id = o,
|
|
6101
|
+
Es(this, vt, void 0);
|
|
6102
|
+
this.id = o, vs(this, vt, l), c && this.connect();
|
|
6103
6103
|
}
|
|
6104
6104
|
connect() {
|
|
6105
6105
|
Promise.resolve(
|
|
@@ -6134,7 +6134,7 @@ const Ft = (e) => Wt((t, n) => {
|
|
|
6134
6134
|
), ee = (e, t, n = "readwrite") => {
|
|
6135
6135
|
const s = e.transaction(t, n);
|
|
6136
6136
|
return t.map((r) => Sa(s, r));
|
|
6137
|
-
}, Di = (e, t) => Ft(e.count(t)), fa = (e, t) => Ft(e.get(t)), xi = (e, t) => Ft(e.delete(t)), ga = (e, t, n) => Ft(e.put(t, n)),
|
|
6137
|
+
}, Di = (e, t) => Ft(e.count(t)), fa = (e, t) => Ft(e.get(t)), xi = (e, t) => Ft(e.delete(t)), ga = (e, t, n) => Ft(e.put(t, n)), Nn = (e, t) => Ft(e.add(t)), pa = (e, t, n) => Ft(e.getAll(t, n)), ya = (e, t, n) => {
|
|
6138
6138
|
let s = null;
|
|
6139
6139
|
return ba(e, t, (r) => (s = r, !1), n).then(() => s);
|
|
6140
6140
|
}, ma = (e, t = null) => ya(e, t, "prev"), wa = (e, t) => Wt((n, s) => {
|
|
@@ -6144,7 +6144,7 @@ const Ft = (e) => Wt((t, n) => {
|
|
|
6144
6144
|
return n();
|
|
6145
6145
|
i.continue();
|
|
6146
6146
|
};
|
|
6147
|
-
}), ba = (e, t, n, s = "next") => wa(e.openKeyCursor(t, s), (r) => n(r.key)), Sa = (e, t) => e.objectStore(t),
|
|
6147
|
+
}), ba = (e, t, n, s = "next") => wa(e.openKeyCursor(t, s), (r) => n(r.key)), Sa = (e, t) => e.objectStore(t), Ca = (e, t) => IDBKeyRange.upperBound(e, t), ka = (e, t) => IDBKeyRange.lowerBound(e, t), Cn = "custom", Oi = "updates", Mi = 500, Ii = (e, t = () => {
|
|
6148
6148
|
}, n = () => {
|
|
6149
6149
|
}) => {
|
|
6150
6150
|
const [s] = ee(
|
|
@@ -6152,7 +6152,7 @@ const Ft = (e) => Wt((t, n) => {
|
|
|
6152
6152
|
e.db,
|
|
6153
6153
|
[Oi]
|
|
6154
6154
|
);
|
|
6155
|
-
return pa(s,
|
|
6155
|
+
return pa(s, ka(e._dbref, !1)).then((r) => {
|
|
6156
6156
|
e._destroyed || (t(s), A(e.doc, () => {
|
|
6157
6157
|
r.forEach((i) => Gr(e.doc, i));
|
|
6158
6158
|
}, e, !1), n(s));
|
|
@@ -6162,11 +6162,11 @@ const Ft = (e) => Wt((t, n) => {
|
|
|
6162
6162
|
e._dbsize = r;
|
|
6163
6163
|
})).then(() => s);
|
|
6164
6164
|
}, _a = (e, t = !0) => Ii(e).then((n) => {
|
|
6165
|
-
(t || e._dbsize >= Mi) &&
|
|
6165
|
+
(t || e._dbsize >= Mi) && Nn(n, ls(e.doc)).then(() => xi(n, Ca(e._dbref, !0))).then(() => Di(n).then((s) => {
|
|
6166
6166
|
e._dbsize = s;
|
|
6167
6167
|
}));
|
|
6168
6168
|
});
|
|
6169
|
-
class Ea extends
|
|
6169
|
+
class Ea extends ns {
|
|
6170
6170
|
/**
|
|
6171
6171
|
* @param {string} name
|
|
6172
6172
|
* @param {Y.Doc} doc
|
|
@@ -6179,7 +6179,7 @@ class Ea extends es {
|
|
|
6179
6179
|
["custom"]
|
|
6180
6180
|
])
|
|
6181
6181
|
), this.whenSynced = Wt((s) => this.on("synced", () => s(this))), this._db.then((s) => {
|
|
6182
|
-
this.db = s, Ii(this, (o) =>
|
|
6182
|
+
this.db = s, Ii(this, (o) => Nn(o, ls(n)), () => {
|
|
6183
6183
|
if (this._destroyed)
|
|
6184
6184
|
return this;
|
|
6185
6185
|
this.synced = !0, this.emit("synced", [this]);
|
|
@@ -6191,7 +6191,7 @@ class Ea extends es {
|
|
|
6191
6191
|
this.db,
|
|
6192
6192
|
[Oi]
|
|
6193
6193
|
);
|
|
6194
|
-
|
|
6194
|
+
Nn(i, s), ++this._dbsize >= Mi && (this._storeTimeoutId !== null && clearTimeout(this._storeTimeoutId), this._storeTimeoutId = setTimeout(() => {
|
|
6195
6195
|
_a(this, !1), this._storeTimeoutId = null;
|
|
6196
6196
|
}, this._storeTimeout));
|
|
6197
6197
|
}
|
|
@@ -6218,7 +6218,7 @@ class Ea extends es {
|
|
|
6218
6218
|
*/
|
|
6219
6219
|
get(t) {
|
|
6220
6220
|
return this._db.then((n) => {
|
|
6221
|
-
const [s] = ee(n, [
|
|
6221
|
+
const [s] = ee(n, [Cn], "readonly");
|
|
6222
6222
|
return fa(s, t);
|
|
6223
6223
|
});
|
|
6224
6224
|
}
|
|
@@ -6229,7 +6229,7 @@ class Ea extends es {
|
|
|
6229
6229
|
*/
|
|
6230
6230
|
set(t, n) {
|
|
6231
6231
|
return this._db.then((s) => {
|
|
6232
|
-
const [r] = ee(s, [
|
|
6232
|
+
const [r] = ee(s, [Cn]);
|
|
6233
6233
|
return ga(r, n, t);
|
|
6234
6234
|
});
|
|
6235
6235
|
}
|
|
@@ -6239,12 +6239,12 @@ class Ea extends es {
|
|
|
6239
6239
|
*/
|
|
6240
6240
|
del(t) {
|
|
6241
6241
|
return this._db.then((n) => {
|
|
6242
|
-
const [s] = ee(n, [
|
|
6242
|
+
const [s] = ee(n, [Cn]);
|
|
6243
6243
|
return xi(s, t);
|
|
6244
6244
|
});
|
|
6245
6245
|
}
|
|
6246
6246
|
}
|
|
6247
|
-
const va = 150
|
|
6247
|
+
const va = 150;
|
|
6248
6248
|
function Li() {
|
|
6249
6249
|
const e = crypto.getRandomValues(new Uint8Array(16)).reduce((s, r) => s + r.toString(16).padStart(2, "0"), ""), t = Math.floor(Math.random() * 360), n = [
|
|
6250
6250
|
`hsl(${t}, 70%, 60%)`,
|
|
@@ -6260,22 +6260,22 @@ function Li() {
|
|
|
6260
6260
|
createdAt: Date.now()
|
|
6261
6261
|
};
|
|
6262
6262
|
}
|
|
6263
|
-
const
|
|
6264
|
-
var
|
|
6265
|
-
function
|
|
6263
|
+
const Aa = "can-duplicate-to";
|
|
6264
|
+
var ms = /* @__PURE__ */ ((e) => (e.CanPlay = "can-play", e.CanMove = "can-move", e.CanSpin = "can-spin", e.CanGrow = "can-grow", e.CanToggle = "can-toggle", e.CanDuplicate = "can-duplicate", e.CanHover = "can-hover", e.CanResize = "can-resize", e.CanMirror = "can-mirror", e))(ms || {});
|
|
6265
|
+
function Da(e) {
|
|
6266
6266
|
return e.id;
|
|
6267
6267
|
}
|
|
6268
6268
|
const Ti = `url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='44' height='53' viewport='0 0 100 100' style='fill:black;font-size:26px;'><text y='40%'>🚿</text></svg>")
|
|
6269
6269
|
16 0,
|
|
6270
|
-
auto`,
|
|
6271
|
-
function
|
|
6270
|
+
auto`, xa = `url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='48' viewport='0 0 100 100' style='fill:black;font-size:24px;'><text y='50%'>✂️</text></svg>") 16 0,auto`;
|
|
6271
|
+
function Qs(e, { getData: t, getElement: n, getLocalData: s, setLocalData: r }) {
|
|
6272
6272
|
const i = t(), o = s(), l = n();
|
|
6273
6273
|
if (o.isHovering = !0, e.altKey) {
|
|
6274
6274
|
if (i.scale <= 0.5) {
|
|
6275
6275
|
l.style.cursor = "not-allowed";
|
|
6276
6276
|
return;
|
|
6277
6277
|
}
|
|
6278
|
-
l.style.cursor =
|
|
6278
|
+
l.style.cursor = xa;
|
|
6279
6279
|
} else {
|
|
6280
6280
|
if (i.scale >= i.maxScale) {
|
|
6281
6281
|
l.style.cursor = "not-allowed";
|
|
@@ -6292,7 +6292,7 @@ function Re(e) {
|
|
|
6292
6292
|
}
|
|
6293
6293
|
return { clientX: e.clientX, clientY: e.clientY };
|
|
6294
6294
|
}
|
|
6295
|
-
const
|
|
6295
|
+
const Oa = {
|
|
6296
6296
|
"can-move": {
|
|
6297
6297
|
defaultData: { x: 0, y: 0 },
|
|
6298
6298
|
defaultLocalData: { startMouseX: 0, startMouseY: 0 },
|
|
@@ -6367,8 +6367,8 @@ const Ma = {
|
|
|
6367
6367
|
},
|
|
6368
6368
|
onMount: (e) => {
|
|
6369
6369
|
e.getElement().addEventListener("mouseenter", (t) => {
|
|
6370
|
-
|
|
6371
|
-
const n = (s) =>
|
|
6370
|
+
Qs(t, e);
|
|
6371
|
+
const n = (s) => Qs(s, e);
|
|
6372
6372
|
document.addEventListener("keydown", n), document.addEventListener("keyup", n), e.getElement().addEventListener("mouseleave", (s) => {
|
|
6373
6373
|
document.removeEventListener("keydown", n), document.removeEventListener("keyup", n);
|
|
6374
6374
|
});
|
|
@@ -6395,7 +6395,7 @@ const Ma = {
|
|
|
6395
6395
|
);
|
|
6396
6396
|
return;
|
|
6397
6397
|
}
|
|
6398
|
-
const c = s.getAttribute(
|
|
6398
|
+
const c = s.getAttribute(Aa);
|
|
6399
6399
|
function a(u) {
|
|
6400
6400
|
if (c) {
|
|
6401
6401
|
const d = document.getElementById(c) || document.querySelector(c);
|
|
@@ -6441,9 +6441,9 @@ const Ma = {
|
|
|
6441
6441
|
defaultData: (e) => Xt(e),
|
|
6442
6442
|
onMount: ({ getElement: e, setData: t, getData: n }) => {
|
|
6443
6443
|
const s = e(), r = t;
|
|
6444
|
-
|
|
6444
|
+
Ma(s, (i) => {
|
|
6445
6445
|
r((o) => {
|
|
6446
|
-
|
|
6446
|
+
Ia(o, i);
|
|
6447
6447
|
});
|
|
6448
6448
|
});
|
|
6449
6449
|
},
|
|
@@ -6453,7 +6453,7 @@ const Ma = {
|
|
|
6453
6453
|
}
|
|
6454
6454
|
}
|
|
6455
6455
|
};
|
|
6456
|
-
function
|
|
6456
|
+
function tr(e) {
|
|
6457
6457
|
return e.nodeType === "HTMLElement";
|
|
6458
6458
|
}
|
|
6459
6459
|
function pe(e, t) {
|
|
@@ -6461,7 +6461,7 @@ function pe(e, t) {
|
|
|
6461
6461
|
return !1;
|
|
6462
6462
|
if (e.nodeType === "Text" && t.nodeType === "Text")
|
|
6463
6463
|
return e.textContent === t.textContent;
|
|
6464
|
-
if (
|
|
6464
|
+
if (tr(e) && tr(t)) {
|
|
6465
6465
|
if (e.tagName !== t.tagName || Object.keys(e.attributes).length !== Object.keys(t.attributes).length)
|
|
6466
6466
|
return !1;
|
|
6467
6467
|
for (const [n, s] of Object.entries(e.attributes))
|
|
@@ -6475,7 +6475,7 @@ function pe(e, t) {
|
|
|
6475
6475
|
}
|
|
6476
6476
|
return !0;
|
|
6477
6477
|
}
|
|
6478
|
-
function
|
|
6478
|
+
function Ma(e, t, n) {
|
|
6479
6479
|
const s = {
|
|
6480
6480
|
childList: !0,
|
|
6481
6481
|
attributes: !0,
|
|
@@ -6502,28 +6502,28 @@ function Ia(e, t, n) {
|
|
|
6502
6502
|
}, i = new MutationObserver(r);
|
|
6503
6503
|
return i.observe(e, s), i;
|
|
6504
6504
|
}
|
|
6505
|
-
function
|
|
6505
|
+
function Ia(e, t) {
|
|
6506
6506
|
t.forEach((n) => {
|
|
6507
6507
|
switch (n.type) {
|
|
6508
6508
|
case "attributes":
|
|
6509
|
-
|
|
6509
|
+
La(e, n);
|
|
6510
6510
|
break;
|
|
6511
6511
|
case "childList":
|
|
6512
|
-
|
|
6512
|
+
Ta(e, n);
|
|
6513
6513
|
break;
|
|
6514
6514
|
case "characterData":
|
|
6515
|
-
|
|
6515
|
+
Ra(e, n);
|
|
6516
6516
|
break;
|
|
6517
6517
|
}
|
|
6518
6518
|
});
|
|
6519
6519
|
}
|
|
6520
|
-
function
|
|
6520
|
+
function La(e, t) {
|
|
6521
6521
|
if (e.nodeType !== "Text" && t.target instanceof HTMLElement) {
|
|
6522
6522
|
const n = t.attributeName, s = t.target.getAttribute(n);
|
|
6523
6523
|
s !== null ? e.attributes[n] = s : delete e.attributes[n];
|
|
6524
6524
|
}
|
|
6525
6525
|
}
|
|
6526
|
-
function
|
|
6526
|
+
function Ta(e, t) {
|
|
6527
6527
|
e.nodeType !== "Text" && (t.removedNodes.length && t.removedNodes.forEach((n) => {
|
|
6528
6528
|
if (!ye(n))
|
|
6529
6529
|
return;
|
|
@@ -6538,7 +6538,7 @@ function Ra(e, t) {
|
|
|
6538
6538
|
e.children.find((r) => pe(r, s)) || e.children.push(s);
|
|
6539
6539
|
}));
|
|
6540
6540
|
}
|
|
6541
|
-
function
|
|
6541
|
+
function Ra(e, t) {
|
|
6542
6542
|
const n = t.target;
|
|
6543
6543
|
switch (e.nodeType) {
|
|
6544
6544
|
case "Text":
|
|
@@ -6570,12 +6570,12 @@ function Xt(e) {
|
|
|
6570
6570
|
}), t;
|
|
6571
6571
|
}
|
|
6572
6572
|
function Ri(e, t) {
|
|
6573
|
-
|
|
6573
|
+
Ua(e, t), t.nodeType === "HTMLElement" && (Na(e, t), t.children.length > 0 && $a(e, t));
|
|
6574
6574
|
}
|
|
6575
|
-
function
|
|
6575
|
+
function Ua(e, t) {
|
|
6576
6576
|
t && t.nodeType === "Text" && e.textContent !== t.textContent && (e.textContent = t.textContent || "");
|
|
6577
6577
|
}
|
|
6578
|
-
function
|
|
6578
|
+
function Na(e, t) {
|
|
6579
6579
|
if (!t)
|
|
6580
6580
|
return;
|
|
6581
6581
|
const n = t.attributes && typeof t.attributes == "object" ? t.attributes : {};
|
|
@@ -6585,7 +6585,7 @@ function $a(e, t) {
|
|
|
6585
6585
|
n[s.name] || e.removeAttribute(s.name);
|
|
6586
6586
|
});
|
|
6587
6587
|
}
|
|
6588
|
-
function
|
|
6588
|
+
function $a(e, t) {
|
|
6589
6589
|
const n = /* @__PURE__ */ new Set();
|
|
6590
6590
|
t.children.forEach((s) => {
|
|
6591
6591
|
let r = Array.from(
|
|
@@ -6611,15 +6611,15 @@ function me() {
|
|
|
6611
6611
|
return e;
|
|
6612
6612
|
}, me.apply(this, arguments);
|
|
6613
6613
|
}
|
|
6614
|
-
function
|
|
6615
|
-
e.prototype = Object.create(t.prototype), e.prototype.constructor = e,
|
|
6614
|
+
function Ba(e, t) {
|
|
6615
|
+
e.prototype = Object.create(t.prototype), e.prototype.constructor = e, $n(e, t);
|
|
6616
6616
|
}
|
|
6617
|
-
function
|
|
6618
|
-
return
|
|
6617
|
+
function $n(e, t) {
|
|
6618
|
+
return $n = Object.setPrototypeOf || function(s, r) {
|
|
6619
6619
|
return s.__proto__ = r, s;
|
|
6620
|
-
},
|
|
6620
|
+
}, $n(e, t);
|
|
6621
6621
|
}
|
|
6622
|
-
function
|
|
6622
|
+
function Fa(e) {
|
|
6623
6623
|
if (e === void 0)
|
|
6624
6624
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
6625
6625
|
return e;
|
|
@@ -6644,13 +6644,13 @@ var Ui = /* @__PURE__ */ function() {
|
|
|
6644
6644
|
}), this.observing.clear();
|
|
6645
6645
|
}, e;
|
|
6646
6646
|
}(), xt = [], nn = /* @__PURE__ */ function(e) {
|
|
6647
|
-
|
|
6647
|
+
Ba(t, e);
|
|
6648
6648
|
function t(s, r, i) {
|
|
6649
6649
|
var o;
|
|
6650
6650
|
if (o = e.call(this, function() {
|
|
6651
6651
|
return o._trigger();
|
|
6652
6652
|
}) || this, o.func = s, o.options = r, o.effect = i, o.isInitial = !0, o.reaction = function() {
|
|
6653
|
-
xt.push(
|
|
6653
|
+
xt.push(Fa(o));
|
|
6654
6654
|
try {
|
|
6655
6655
|
o.func();
|
|
6656
6656
|
} finally {
|
|
@@ -6674,7 +6674,7 @@ function Ni() {
|
|
|
6674
6674
|
function $i() {
|
|
6675
6675
|
return xt.length ? xt[xt.length - 1] : void 0;
|
|
6676
6676
|
}
|
|
6677
|
-
function
|
|
6677
|
+
function za(e, t, n) {
|
|
6678
6678
|
var s = me({
|
|
6679
6679
|
name: "unnamed",
|
|
6680
6680
|
fireImmediately: !0
|
|
@@ -6685,35 +6685,35 @@ var He = 0;
|
|
|
6685
6685
|
function Bi() {
|
|
6686
6686
|
return He > 0;
|
|
6687
6687
|
}
|
|
6688
|
-
function
|
|
6688
|
+
function Bn(e) {
|
|
6689
6689
|
He++;
|
|
6690
6690
|
try {
|
|
6691
6691
|
return e();
|
|
6692
6692
|
} finally {
|
|
6693
|
-
He--, He === 0 &&
|
|
6693
|
+
He--, He === 0 && Ha();
|
|
6694
6694
|
}
|
|
6695
6695
|
}
|
|
6696
|
-
var
|
|
6696
|
+
var Fn = !1;
|
|
6697
6697
|
function Fi() {
|
|
6698
|
-
return
|
|
6698
|
+
return Fn;
|
|
6699
6699
|
}
|
|
6700
6700
|
function zi(e) {
|
|
6701
|
-
|
|
6701
|
+
Fn = !0;
|
|
6702
6702
|
try {
|
|
6703
6703
|
e();
|
|
6704
6704
|
} finally {
|
|
6705
|
-
|
|
6705
|
+
Fn = !1;
|
|
6706
6706
|
}
|
|
6707
6707
|
}
|
|
6708
|
-
function
|
|
6708
|
+
function ja(e) {
|
|
6709
6709
|
return function() {
|
|
6710
6710
|
return zi(e);
|
|
6711
6711
|
};
|
|
6712
6712
|
}
|
|
6713
|
-
var
|
|
6714
|
-
function
|
|
6715
|
-
var e = [].concat(
|
|
6716
|
-
|
|
6713
|
+
var zn = [];
|
|
6714
|
+
function Ha() {
|
|
6715
|
+
var e = [].concat(zn);
|
|
6716
|
+
zn = [], ji(e);
|
|
6717
6717
|
}
|
|
6718
6718
|
function ji(e) {
|
|
6719
6719
|
var t = /* @__PURE__ */ new Set();
|
|
@@ -6730,12 +6730,12 @@ function ji(e) {
|
|
|
6730
6730
|
}
|
|
6731
6731
|
function Ue(e) {
|
|
6732
6732
|
if (Bi()) {
|
|
6733
|
-
|
|
6733
|
+
zn.push(e);
|
|
6734
6734
|
return;
|
|
6735
6735
|
}
|
|
6736
6736
|
ji([e]);
|
|
6737
6737
|
}
|
|
6738
|
-
function
|
|
6738
|
+
function er(e, t) {
|
|
6739
6739
|
if (e.type === "iterate")
|
|
6740
6740
|
e.observable[T].connections.iterate.add(t);
|
|
6741
6741
|
else {
|
|
@@ -6746,23 +6746,23 @@ function tr(e, t) {
|
|
|
6746
6746
|
function Ne(e, t) {
|
|
6747
6747
|
if (!Fi()) {
|
|
6748
6748
|
var n = $i();
|
|
6749
|
-
n && (
|
|
6749
|
+
n && (er(e, n), n.registerConnection(e)), t && (er(e, t), t.registerConnection(e));
|
|
6750
6750
|
}
|
|
6751
6751
|
}
|
|
6752
|
-
var
|
|
6752
|
+
var ws = Symbol("$skipreactive"), T = Symbol("$reactive"), G = Symbol("$reactiveproxy");
|
|
6753
6753
|
function De(e, t) {
|
|
6754
6754
|
return !!(e && e[G] && e[G].implicitObserver === t);
|
|
6755
6755
|
}
|
|
6756
|
-
function
|
|
6757
|
-
return e[
|
|
6756
|
+
function bs(e) {
|
|
6757
|
+
return e[ws] = !0, e;
|
|
6758
6758
|
}
|
|
6759
6759
|
function Hi(e) {
|
|
6760
6760
|
return !!(e && !De(e) && e[T]);
|
|
6761
6761
|
}
|
|
6762
|
-
function
|
|
6763
|
-
if (n === void 0 && (n = !1), e[
|
|
6762
|
+
function jn(e, t, n) {
|
|
6763
|
+
if (n === void 0 && (n = !1), e[ws] || De(e, t))
|
|
6764
6764
|
return e;
|
|
6765
|
-
var s =
|
|
6765
|
+
var s = Pa(e, n);
|
|
6766
6766
|
if (!t)
|
|
6767
6767
|
return s;
|
|
6768
6768
|
var r = s[T].proxiesWithImplicitObserver.get(t);
|
|
@@ -6774,8 +6774,8 @@ function zn(e, t, n) {
|
|
|
6774
6774
|
}
|
|
6775
6775
|
return r;
|
|
6776
6776
|
}
|
|
6777
|
-
var we =
|
|
6778
|
-
function
|
|
6777
|
+
var we = jn;
|
|
6778
|
+
function Pa(e, t) {
|
|
6779
6779
|
if (t === void 0 && (t = !1), De(e))
|
|
6780
6780
|
return e;
|
|
6781
6781
|
if (Hi(e))
|
|
@@ -6827,13 +6827,13 @@ var Pi = {
|
|
|
6827
6827
|
key: n,
|
|
6828
6828
|
type: "get"
|
|
6829
6829
|
}, this.implicitObserver), Hi(r))
|
|
6830
|
-
return
|
|
6830
|
+
return jn(r, this.implicitObserver);
|
|
6831
6831
|
if (t[T].shallow)
|
|
6832
6832
|
return r;
|
|
6833
6833
|
if (typeof r == "object" && r !== null && !De(r, this.implicitObserver) && !Object.isFrozen(r)) {
|
|
6834
6834
|
var i = Reflect.getOwnPropertyDescriptor(t, n);
|
|
6835
6835
|
if ((!i || !(i.writable === !1 && i.configurable === !1)) && (Ni() || this.implicitObserver))
|
|
6836
|
-
return
|
|
6836
|
+
return jn(r, this.implicitObserver);
|
|
6837
6837
|
}
|
|
6838
6838
|
return r;
|
|
6839
6839
|
},
|
|
@@ -6845,7 +6845,7 @@ var Pi = {
|
|
|
6845
6845
|
},
|
|
6846
6846
|
// Write:
|
|
6847
6847
|
set: function(t, n, s, r) {
|
|
6848
|
-
return
|
|
6848
|
+
return Bn(function() {
|
|
6849
6849
|
if (typeof n == "symbol")
|
|
6850
6850
|
return Reflect.set(t, n, s, r);
|
|
6851
6851
|
var i = Object.hasOwnProperty.call(t, n), o = Reflect.get(t, n, r), l = Reflect.set(t, n, s, r);
|
|
@@ -6878,7 +6878,7 @@ var Pi = {
|
|
|
6878
6878
|
});
|
|
6879
6879
|
},
|
|
6880
6880
|
deleteProperty: function(t, n) {
|
|
6881
|
-
return
|
|
6881
|
+
return Bn(function() {
|
|
6882
6882
|
if (typeof n == "symbol")
|
|
6883
6883
|
return Reflect.deleteProperty(t, n);
|
|
6884
6884
|
var s = Object.hasOwnProperty.call(t, n), r = Reflect.get(t, n), i = Reflect.deleteProperty(t, n);
|
|
@@ -6894,14 +6894,14 @@ var Pi = {
|
|
|
6894
6894
|
throw new Error("Dynamic observable objects cannot be frozen");
|
|
6895
6895
|
}
|
|
6896
6896
|
};
|
|
6897
|
-
function
|
|
6897
|
+
function Va(e, t) {
|
|
6898
6898
|
var n = me({
|
|
6899
6899
|
name: "unnamed",
|
|
6900
6900
|
fireImmediately: !0
|
|
6901
6901
|
}, t), s = new nn(e, n);
|
|
6902
6902
|
return s;
|
|
6903
6903
|
}
|
|
6904
|
-
function
|
|
6904
|
+
function Ka(e, t, n) {
|
|
6905
6905
|
var s = me({
|
|
6906
6906
|
name: "unnamed",
|
|
6907
6907
|
fireImmediately: !0
|
|
@@ -6923,56 +6923,56 @@ var Vi = /* @__PURE__ */ function() {
|
|
|
6923
6923
|
this._observable._key++;
|
|
6924
6924
|
}, e;
|
|
6925
6925
|
}();
|
|
6926
|
-
function
|
|
6926
|
+
function Ga(e, t, n) {
|
|
6927
6927
|
return new Vi();
|
|
6928
6928
|
}
|
|
6929
|
-
const
|
|
6929
|
+
const Wa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6930
6930
|
__proto__: null,
|
|
6931
6931
|
$reactive: T,
|
|
6932
6932
|
$reactiveproxy: G,
|
|
6933
|
-
$skipreactive:
|
|
6933
|
+
$skipreactive: ws,
|
|
6934
6934
|
Atom: Vi,
|
|
6935
6935
|
Observer: Ui,
|
|
6936
6936
|
Reaction: nn,
|
|
6937
|
-
autorun:
|
|
6938
|
-
autorunAsync:
|
|
6939
|
-
createAtom:
|
|
6937
|
+
autorun: Va,
|
|
6938
|
+
autorunAsync: Ka,
|
|
6939
|
+
createAtom: Ga,
|
|
6940
6940
|
hasRunningReaction: Ni,
|
|
6941
6941
|
isActionRunning: Bi,
|
|
6942
6942
|
isReactive: De,
|
|
6943
6943
|
isTrackingDisabled: Fi,
|
|
6944
|
-
markRaw:
|
|
6945
|
-
reaction:
|
|
6944
|
+
markRaw: bs,
|
|
6945
|
+
reaction: za,
|
|
6946
6946
|
reactive: we,
|
|
6947
|
-
runInAction:
|
|
6947
|
+
runInAction: Bn,
|
|
6948
6948
|
runningReaction: $i,
|
|
6949
6949
|
untracked: zi,
|
|
6950
|
-
untrackedCB:
|
|
6950
|
+
untrackedCB: ja
|
|
6951
6951
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
6952
|
-
let
|
|
6953
|
-
function
|
|
6954
|
-
if (
|
|
6955
|
-
return
|
|
6956
|
-
|
|
6952
|
+
let Hn, Pn, Ya = (e) => e();
|
|
6953
|
+
function Ja(e, t) {
|
|
6954
|
+
if (Pn)
|
|
6955
|
+
return Pn(e, t);
|
|
6956
|
+
Ya(e);
|
|
6957
6957
|
}
|
|
6958
6958
|
function Rt(e, t, n) {
|
|
6959
|
-
if (
|
|
6960
|
-
return
|
|
6959
|
+
if (Hn)
|
|
6960
|
+
return Hn.apply(null, arguments);
|
|
6961
6961
|
throw new Error("observable implementation not provided. Call enableReactiveBindings, enableVueBindings or enableMobxBindings.");
|
|
6962
6962
|
}
|
|
6963
|
-
function
|
|
6964
|
-
|
|
6963
|
+
function Xa(e) {
|
|
6964
|
+
Hn = function(t, n, s) {
|
|
6965
6965
|
const r = e.createAtom(t);
|
|
6966
6966
|
return n && n(), r;
|
|
6967
|
-
},
|
|
6967
|
+
}, Pn = (t, n) => e.reaction(t, n, {
|
|
6968
6968
|
fireImmediately: !1
|
|
6969
6969
|
});
|
|
6970
6970
|
}
|
|
6971
|
-
const
|
|
6972
|
-
function
|
|
6973
|
-
if (
|
|
6971
|
+
const nr = /* @__PURE__ */ new WeakSet();
|
|
6972
|
+
function qa(e) {
|
|
6973
|
+
if (nr.has(e))
|
|
6974
6974
|
return e;
|
|
6975
|
-
|
|
6975
|
+
nr.add(e);
|
|
6976
6976
|
let t;
|
|
6977
6977
|
const n = /* @__PURE__ */ new Map();
|
|
6978
6978
|
function s() {
|
|
@@ -7043,11 +7043,11 @@ function Za(e) {
|
|
|
7043
7043
|
return this._disableTracking = !1, f;
|
|
7044
7044
|
}, e;
|
|
7045
7045
|
}
|
|
7046
|
-
const
|
|
7047
|
-
function
|
|
7048
|
-
if (
|
|
7046
|
+
const sr = /* @__PURE__ */ new WeakSet();
|
|
7047
|
+
function Za(e) {
|
|
7048
|
+
if (sr.has(e))
|
|
7049
7049
|
return e;
|
|
7050
|
-
|
|
7050
|
+
sr.add(e);
|
|
7051
7051
|
let t;
|
|
7052
7052
|
function n() {
|
|
7053
7053
|
if (!t) {
|
|
@@ -7076,18 +7076,18 @@ function Qa(e) {
|
|
|
7076
7076
|
let l;
|
|
7077
7077
|
e[i] = function() {
|
|
7078
7078
|
let c, a = arguments;
|
|
7079
|
-
return n(), l && l.removeObservers(), l =
|
|
7079
|
+
return n(), l && l.removeObservers(), l = Ja(() => (c = Reflect.apply(o, e, a), c), () => t.reportChanged()), c;
|
|
7080
7080
|
};
|
|
7081
7081
|
}
|
|
7082
7082
|
return r("toJSON"), Object.defineProperty(e, "keys", {
|
|
7083
7083
|
get: () => (n(), Object.keys(e.share))
|
|
7084
7084
|
}), e;
|
|
7085
7085
|
}
|
|
7086
|
-
const
|
|
7087
|
-
function
|
|
7088
|
-
if (
|
|
7086
|
+
const rr = /* @__PURE__ */ new WeakSet();
|
|
7087
|
+
function Qa(e) {
|
|
7088
|
+
if (rr.has(e))
|
|
7089
7089
|
return e;
|
|
7090
|
-
|
|
7090
|
+
rr.add(e);
|
|
7091
7091
|
let t;
|
|
7092
7092
|
const n = /* @__PURE__ */ new Map();
|
|
7093
7093
|
function s() {
|
|
@@ -7131,11 +7131,11 @@ function th(e) {
|
|
|
7131
7131
|
}
|
|
7132
7132
|
return o("values"), o("entries"), o("keys"), o("forEach"), o("toJSON"), e;
|
|
7133
7133
|
}
|
|
7134
|
-
const
|
|
7135
|
-
function
|
|
7136
|
-
if (
|
|
7134
|
+
const ir = /* @__PURE__ */ new WeakSet();
|
|
7135
|
+
function or(e) {
|
|
7136
|
+
if (ir.has(e))
|
|
7137
7137
|
return e;
|
|
7138
|
-
|
|
7138
|
+
ir.add(e);
|
|
7139
7139
|
let t;
|
|
7140
7140
|
const n = (r) => {
|
|
7141
7141
|
t.reportChanged();
|
|
@@ -7153,11 +7153,11 @@ function ir(e) {
|
|
|
7153
7153
|
}
|
|
7154
7154
|
return s("toString"), s("toJSON"), e;
|
|
7155
7155
|
}
|
|
7156
|
-
const
|
|
7157
|
-
function
|
|
7158
|
-
if (
|
|
7156
|
+
const lr = /* @__PURE__ */ new WeakSet();
|
|
7157
|
+
function cr(e) {
|
|
7158
|
+
if (lr.has(e))
|
|
7159
7159
|
return e;
|
|
7160
|
-
|
|
7160
|
+
lr.add(e);
|
|
7161
7161
|
let t;
|
|
7162
7162
|
const n = (i) => {
|
|
7163
7163
|
(i.changes.added.size || i.changes.deleted.size || i.changes.keys.size || i.changes.delta.length) && t.reportChanged();
|
|
@@ -7185,14 +7185,14 @@ function lr(e) {
|
|
|
7185
7185
|
return s("toString"), s("toDOM"), s("toArray"), s("getAttribute"), r("firstChild"), e;
|
|
7186
7186
|
}
|
|
7187
7187
|
function sn(e) {
|
|
7188
|
-
return e instanceof Lt || e instanceof at ?
|
|
7188
|
+
return e instanceof Lt || e instanceof at ? or(e) : e instanceof X ? qa(e) : e instanceof Z ? Qa(e) : e instanceof dt || Object.prototype.hasOwnProperty.call(e, "autoLoad") ? Za(e) : e instanceof Q || e instanceof ht ? cr(e) : e;
|
|
7189
7189
|
}
|
|
7190
|
-
function
|
|
7190
|
+
function ar(e) {
|
|
7191
7191
|
e.share.forEach((t) => {
|
|
7192
7192
|
t.constructor !== M && sn(t);
|
|
7193
7193
|
});
|
|
7194
7194
|
}
|
|
7195
|
-
function
|
|
7195
|
+
function hr(e, t) {
|
|
7196
7196
|
for (let s = e.length - 1; s >= t; s--) {
|
|
7197
7197
|
let r = e[s];
|
|
7198
7198
|
if (!r.deleted) {
|
|
@@ -7205,19 +7205,19 @@ function ar(e, t) {
|
|
|
7205
7205
|
}
|
|
7206
7206
|
}
|
|
7207
7207
|
}
|
|
7208
|
-
const
|
|
7209
|
-
function
|
|
7210
|
-
|
|
7211
|
-
t &&
|
|
7212
|
-
}),
|
|
7213
|
-
|
|
7208
|
+
const ur = /* @__PURE__ */ new WeakSet();
|
|
7209
|
+
function th(e) {
|
|
7210
|
+
ur.has(e) || (ur.add(e), sn(e), e.store.clients.forEach((t) => {
|
|
7211
|
+
t && hr(t, 0);
|
|
7212
|
+
}), ar(e), e.on("beforeObserverCalls", (t) => {
|
|
7213
|
+
ar(e), t.afterState.forEach((n, s) => {
|
|
7214
7214
|
const r = t.beforeState.get(s) || 0;
|
|
7215
7215
|
if (r !== n) {
|
|
7216
7216
|
const i = t.doc.store.clients.get(s);
|
|
7217
7217
|
if (!i)
|
|
7218
7218
|
return;
|
|
7219
7219
|
const o = W(i, r);
|
|
7220
|
-
|
|
7220
|
+
hr(i, o);
|
|
7221
7221
|
}
|
|
7222
7222
|
});
|
|
7223
7223
|
}));
|
|
@@ -7227,10 +7227,10 @@ class be {
|
|
|
7227
7227
|
this.value = void 0, this.value = t;
|
|
7228
7228
|
}
|
|
7229
7229
|
}
|
|
7230
|
-
function
|
|
7230
|
+
function eh(e) {
|
|
7231
7231
|
return ArrayBuffer.isView(e) ? new be(e) : new be(Object.freeze(e));
|
|
7232
7232
|
}
|
|
7233
|
-
function
|
|
7233
|
+
function nh(e) {
|
|
7234
7234
|
const t = function() {
|
|
7235
7235
|
var l;
|
|
7236
7236
|
let c = (l = this[G]) == null ? void 0 : l.implicitObserver;
|
|
@@ -7240,7 +7240,7 @@ function sh(e) {
|
|
|
7240
7240
|
});
|
|
7241
7241
|
}, n = function(l) {
|
|
7242
7242
|
return l.map((c) => {
|
|
7243
|
-
const a =
|
|
7243
|
+
const a = Ss(c);
|
|
7244
7244
|
let h = Ut(a) || a;
|
|
7245
7245
|
if (h instanceof be && (h = h.value), h instanceof M && h.parent)
|
|
7246
7246
|
throw new Error("Not supported: reassigning object that already occurs in the tree.");
|
|
@@ -7284,7 +7284,7 @@ function sh(e) {
|
|
|
7284
7284
|
},
|
|
7285
7285
|
indexOf: function() {
|
|
7286
7286
|
const o = arguments[0];
|
|
7287
|
-
return s.call(this, (l) =>
|
|
7287
|
+
return s.call(this, (l) => lh(l, o));
|
|
7288
7288
|
},
|
|
7289
7289
|
splice: function() {
|
|
7290
7290
|
let o = arguments[0] < 0 ? e.length - Math.abs(arguments[0]) : arguments[0], l = arguments[1], c = Array.from(Array.from(arguments).slice(2)), a = t.apply(this, [o, Number.isInteger(l) ? o + l : void 0]);
|
|
@@ -7309,10 +7309,10 @@ function te(e) {
|
|
|
7309
7309
|
}
|
|
7310
7310
|
return e;
|
|
7311
7311
|
}
|
|
7312
|
-
function
|
|
7312
|
+
function dr(e, t = new X()) {
|
|
7313
7313
|
if (t[T])
|
|
7314
7314
|
throw new Error("unexpected");
|
|
7315
|
-
const n =
|
|
7315
|
+
const n = nh(t), s = new Proxy(n, {
|
|
7316
7316
|
set: (r, i, o) => {
|
|
7317
7317
|
throw typeof te(i) != "number" ? new Error() : new Error("array assignment is not implemented / supported");
|
|
7318
7318
|
},
|
|
@@ -7379,14 +7379,14 @@ function ur(e, t = new X()) {
|
|
|
7379
7379
|
});
|
|
7380
7380
|
return n.push.apply(s, e), s;
|
|
7381
7381
|
}
|
|
7382
|
-
function
|
|
7382
|
+
function fr(e, t = new Z()) {
|
|
7383
7383
|
if (t[T])
|
|
7384
7384
|
throw new Error("unexpected");
|
|
7385
7385
|
const n = new Proxy({}, {
|
|
7386
7386
|
set: (s, r, i) => {
|
|
7387
7387
|
if (typeof r != "string")
|
|
7388
7388
|
throw new Error();
|
|
7389
|
-
const o =
|
|
7389
|
+
const o = Ss(i);
|
|
7390
7390
|
let l = Ut(o) || o;
|
|
7391
7391
|
if (l instanceof be && (l = l.value), l instanceof M && l.parent)
|
|
7392
7392
|
throw new Error("Not supported: reassigning object that already occurs in the tree.");
|
|
@@ -7425,20 +7425,20 @@ function dr(e, t = new Z()) {
|
|
|
7425
7425
|
n[s] = e[s];
|
|
7426
7426
|
return n;
|
|
7427
7427
|
}
|
|
7428
|
-
function
|
|
7428
|
+
function sh(e) {
|
|
7429
7429
|
return e instanceof M;
|
|
7430
7430
|
}
|
|
7431
7431
|
const oe = /* @__PURE__ */ new WeakMap();
|
|
7432
7432
|
function rn(e, t) {
|
|
7433
|
-
if (
|
|
7433
|
+
if (sh(e)) {
|
|
7434
7434
|
if (e._implicitObserver = t, e instanceof X || e instanceof Z) {
|
|
7435
7435
|
if (!oe.has(e)) {
|
|
7436
|
-
const n =
|
|
7436
|
+
const n = Ss(e);
|
|
7437
7437
|
oe.set(e, n);
|
|
7438
7438
|
}
|
|
7439
7439
|
e = oe.get(e);
|
|
7440
7440
|
} else if (e instanceof ht || e instanceof Q || e instanceof Lt || e instanceof Jt || e instanceof at)
|
|
7441
|
-
|
|
7441
|
+
bs(e), e.__v_skip = !0;
|
|
7442
7442
|
else
|
|
7443
7443
|
throw new Error("unknown YType");
|
|
7444
7444
|
return e;
|
|
@@ -7446,32 +7446,32 @@ function rn(e, t) {
|
|
|
7446
7446
|
if (e === null)
|
|
7447
7447
|
return null;
|
|
7448
7448
|
if (typeof e == "object")
|
|
7449
|
-
return
|
|
7449
|
+
return eh(e);
|
|
7450
7450
|
}
|
|
7451
7451
|
return e;
|
|
7452
7452
|
}
|
|
7453
|
-
function
|
|
7453
|
+
function Ss(e) {
|
|
7454
7454
|
if (e == null)
|
|
7455
7455
|
return e;
|
|
7456
7456
|
if (e = Ut(e) || e, e instanceof X)
|
|
7457
|
-
return
|
|
7457
|
+
return dr([], e);
|
|
7458
7458
|
if (e instanceof Z)
|
|
7459
|
-
return
|
|
7459
|
+
return fr({}, e);
|
|
7460
7460
|
if (typeof e == "string")
|
|
7461
7461
|
return e;
|
|
7462
7462
|
if (Array.isArray(e))
|
|
7463
|
-
return
|
|
7463
|
+
return dr(e);
|
|
7464
7464
|
if (e instanceof ht || e instanceof Q || e instanceof Lt || e instanceof Jt)
|
|
7465
7465
|
return e;
|
|
7466
7466
|
if (e instanceof at)
|
|
7467
7467
|
return e;
|
|
7468
7468
|
if (typeof e == "object")
|
|
7469
|
-
return e instanceof be ? e :
|
|
7469
|
+
return e instanceof be ? e : fr(e);
|
|
7470
7470
|
if (typeof e == "number" || typeof e == "boolean")
|
|
7471
7471
|
return e;
|
|
7472
7472
|
throw new Error("invalid");
|
|
7473
7473
|
}
|
|
7474
|
-
function
|
|
7474
|
+
function rh(e) {
|
|
7475
7475
|
for (let [t, n] of Object.entries(e))
|
|
7476
7476
|
if (Array.isArray(n)) {
|
|
7477
7477
|
if (n.length !== 0)
|
|
@@ -7482,7 +7482,7 @@ function ih(e) {
|
|
|
7482
7482
|
} else if (n !== "xml" && n !== "text")
|
|
7483
7483
|
throw new Error("unknown Root initializer");
|
|
7484
7484
|
}
|
|
7485
|
-
function
|
|
7485
|
+
function gr(e, t, n) {
|
|
7486
7486
|
let s = t[n];
|
|
7487
7487
|
if (!s) {
|
|
7488
7488
|
n !== "__v_raw" && n !== "__v_isRef" && n !== "__v_isReadonly" && console.warn("property not found on root doc", n);
|
|
@@ -7490,10 +7490,10 @@ function fr(e, t, n) {
|
|
|
7490
7490
|
}
|
|
7491
7491
|
return s === "xml" ? e.getXmlFragment(n) : s === "text" ? e.getText(n) : Array.isArray(s) ? e.getArray(n) : e.getMap(n);
|
|
7492
7492
|
}
|
|
7493
|
-
function
|
|
7493
|
+
function ih(e, t) {
|
|
7494
7494
|
if (e[T])
|
|
7495
7495
|
throw new Error("unexpected");
|
|
7496
|
-
|
|
7496
|
+
rh(t);
|
|
7497
7497
|
const n = new Proxy({}, {
|
|
7498
7498
|
set: (s, r, i) => {
|
|
7499
7499
|
throw typeof r != "string" ? new Error() : new Error("cannot set new elements on root doc");
|
|
@@ -7510,10 +7510,10 @@ function oh(e, t) {
|
|
|
7510
7510
|
}
|
|
7511
7511
|
if (r === "toJSON") {
|
|
7512
7512
|
for (let h of Object.keys(t))
|
|
7513
|
-
|
|
7513
|
+
gr(e, t, h);
|
|
7514
7514
|
return Reflect.get(e, r);
|
|
7515
7515
|
}
|
|
7516
|
-
let c =
|
|
7516
|
+
let c = gr(e, t, r);
|
|
7517
7517
|
return c = rn(c, o), c;
|
|
7518
7518
|
},
|
|
7519
7519
|
deleteProperty: (s, r) => {
|
|
@@ -7531,9 +7531,9 @@ function oh(e, t) {
|
|
|
7531
7531
|
});
|
|
7532
7532
|
return oe.set(e, n), n;
|
|
7533
7533
|
}
|
|
7534
|
-
|
|
7534
|
+
Xa(Wa);
|
|
7535
7535
|
const on = Symbol("INTERNAL_SYMBOL");
|
|
7536
|
-
function
|
|
7536
|
+
function oh(e) {
|
|
7537
7537
|
const t = Ut(e);
|
|
7538
7538
|
if (!(t instanceof dt))
|
|
7539
7539
|
throw new Error("store is not a valid syncedStore that maps to a Y.Doc");
|
|
@@ -7543,9 +7543,9 @@ function Ut(e) {
|
|
|
7543
7543
|
if (typeof e != "object" || e === null)
|
|
7544
7544
|
return;
|
|
7545
7545
|
const t = e[on];
|
|
7546
|
-
return t && (
|
|
7546
|
+
return t && (bs(t), t.__v_skip = !0), t;
|
|
7547
7547
|
}
|
|
7548
|
-
function
|
|
7548
|
+
function lh(e, t) {
|
|
7549
7549
|
if (e === t)
|
|
7550
7550
|
return !0;
|
|
7551
7551
|
if (typeof e == "object" && typeof t == "object") {
|
|
@@ -7554,16 +7554,16 @@ function ch(e, t) {
|
|
|
7554
7554
|
}
|
|
7555
7555
|
return !1;
|
|
7556
7556
|
}
|
|
7557
|
-
function
|
|
7558
|
-
return
|
|
7557
|
+
function ch(e, t = new dt()) {
|
|
7558
|
+
return th(t), ih(t, e);
|
|
7559
7559
|
}
|
|
7560
|
-
const
|
|
7560
|
+
const pr = (e, t = 300) => {
|
|
7561
7561
|
let n;
|
|
7562
7562
|
return function(...s) {
|
|
7563
7563
|
clearTimeout(n), n = setTimeout(() => e.apply(this, s), t);
|
|
7564
7564
|
};
|
|
7565
7565
|
};
|
|
7566
|
-
class
|
|
7566
|
+
class ah {
|
|
7567
7567
|
constructor(t) {
|
|
7568
7568
|
w(this, "defaultData");
|
|
7569
7569
|
w(this, "localData");
|
|
@@ -7599,11 +7599,11 @@ class hh {
|
|
|
7599
7599
|
debounceMs: f,
|
|
7600
7600
|
triggerAwarenessUpdate: g
|
|
7601
7601
|
} = t;
|
|
7602
|
-
this.element = n, this.defaultData = i instanceof Function ? i(n) : i, this.localData = o instanceof Function ? o(n) : o, this.triggerAwarenessUpdate = g, this.onChange = s, this.debouncedOnChange =
|
|
7603
|
-
const
|
|
7602
|
+
this.element = n, this.defaultData = i instanceof Function ? i(n) : i, this.localData = o instanceof Function ? o(n) : o, this.triggerAwarenessUpdate = g, this.onChange = s, this.debouncedOnChange = pr(this.onChange, f), this.onAwarenessChange = r, this.updateElement = h, this.updateElementAwareness = u;
|
|
7603
|
+
const b = c === void 0 ? this.defaultData : c;
|
|
7604
7604
|
a !== void 0 && (this.__awareness = a);
|
|
7605
7605
|
const v = l instanceof Function ? l(n) : l;
|
|
7606
|
-
v !== void 0 && this.setMyAwareness(v), this._data =
|
|
7606
|
+
v !== void 0 && this.setMyAwareness(v), this._data = b, this.__data = b, this.reinitializeElementData(t), d && d(this.getSetupData());
|
|
7607
7607
|
}
|
|
7608
7608
|
reinitializeElementData({
|
|
7609
7609
|
element: t,
|
|
@@ -7618,12 +7618,12 @@ class hh {
|
|
|
7618
7618
|
debounceMs: h,
|
|
7619
7619
|
triggerAwarenessUpdate: u
|
|
7620
7620
|
}) {
|
|
7621
|
-
this.triggerAwarenessUpdate = u, this.onChange = n, this.debouncedOnChange =
|
|
7621
|
+
this.triggerAwarenessUpdate = u, this.onChange = n, this.debouncedOnChange = pr(this.onChange, h), this.onAwarenessChange = s, this.updateElement = r, this.updateElementAwareness = i, o && !this.onClick && t.addEventListener("click", (d) => {
|
|
7622
7622
|
var f;
|
|
7623
7623
|
(f = this.onClick) == null || f.call(this, d, this.getEventHandlerData());
|
|
7624
7624
|
}), this.onClick = o, l && !this.onDrag && (t.addEventListener("touchstart", (d) => {
|
|
7625
|
-
var
|
|
7626
|
-
d.preventDefault(), t.classList.add("cursordown"), (
|
|
7625
|
+
var b;
|
|
7626
|
+
d.preventDefault(), t.classList.add("cursordown"), (b = this.onDragStart) == null || b.call(this, d, this.getEventHandlerData());
|
|
7627
7627
|
const f = (v) => {
|
|
7628
7628
|
var nt;
|
|
7629
7629
|
v.preventDefault(), (nt = this.onDrag) == null || nt.call(this, v, this.getEventHandlerData());
|
|
@@ -7632,8 +7632,8 @@ class hh {
|
|
|
7632
7632
|
};
|
|
7633
7633
|
document.addEventListener("touchmove", f), document.addEventListener("touchend", g);
|
|
7634
7634
|
}), t.addEventListener("mousedown", (d) => {
|
|
7635
|
-
var
|
|
7636
|
-
d.preventDefault(), (
|
|
7635
|
+
var b;
|
|
7636
|
+
d.preventDefault(), (b = this.onDragStart) == null || b.call(this, d, this.getEventHandlerData()), t.classList.add("cursordown");
|
|
7637
7637
|
const f = (v) => {
|
|
7638
7638
|
var nt;
|
|
7639
7639
|
v.preventDefault(), (nt = this.onDrag) == null || nt.call(this, v, this.getEventHandlerData());
|
|
@@ -7753,11 +7753,11 @@ class hh {
|
|
|
7753
7753
|
this.setData(this.defaultData);
|
|
7754
7754
|
}
|
|
7755
7755
|
}
|
|
7756
|
-
async function
|
|
7756
|
+
async function hh(e, t) {
|
|
7757
7757
|
const n = new TextEncoder().encode(`${e}-${t.outerHTML}}`), s = await crypto.subtle.digest("SHA-1", n);
|
|
7758
7758
|
return Array.from(new Uint8Array(s)).map((o) => o.toString(16).padStart(2, "0")).join("");
|
|
7759
7759
|
}
|
|
7760
|
-
class
|
|
7760
|
+
class uh {
|
|
7761
7761
|
constructor(t = 200) {
|
|
7762
7762
|
w(this, "cellSize");
|
|
7763
7763
|
w(this, "grid", /* @__PURE__ */ new Map());
|
|
@@ -7826,7 +7826,7 @@ class dh {
|
|
|
7826
7826
|
return t;
|
|
7827
7827
|
}
|
|
7828
7828
|
}
|
|
7829
|
-
class
|
|
7829
|
+
class dh {
|
|
7830
7830
|
constructor(t = {}) {
|
|
7831
7831
|
w(this, "listening", !1);
|
|
7832
7832
|
w(this, "message", "");
|
|
@@ -7951,18 +7951,18 @@ class fh {
|
|
|
7951
7951
|
this.timeout && clearTimeout(this.timeout), this.chatElement && (this.chatElement.remove(), this.chatElement = null);
|
|
7952
7952
|
}
|
|
7953
7953
|
}
|
|
7954
|
-
var
|
|
7955
|
-
function
|
|
7954
|
+
var fh = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
7955
|
+
function gh(e) {
|
|
7956
7956
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
7957
7957
|
}
|
|
7958
|
-
var
|
|
7958
|
+
var Vn = { exports: {} };
|
|
7959
7959
|
(function(e, t) {
|
|
7960
7960
|
(function(n, s) {
|
|
7961
7961
|
{
|
|
7962
7962
|
var r = s();
|
|
7963
7963
|
e && e.exports && (t = e.exports = r), t.randomColor = r;
|
|
7964
7964
|
}
|
|
7965
|
-
})(
|
|
7965
|
+
})(fh, function() {
|
|
7966
7966
|
var n = null, s = {};
|
|
7967
7967
|
nt();
|
|
7968
7968
|
var r = [], i = function(p) {
|
|
@@ -7975,23 +7975,23 @@ var Pn = { exports: {} };
|
|
|
7975
7975
|
throw new TypeError("The seed value must be an integer or string");
|
|
7976
7976
|
n = null;
|
|
7977
7977
|
}
|
|
7978
|
-
var m, y,
|
|
7978
|
+
var m, y, S;
|
|
7979
7979
|
if (p.count !== null && p.count !== void 0) {
|
|
7980
|
-
for (var
|
|
7980
|
+
for (var k = p.count, D = [], x = 0; x < p.count; x++)
|
|
7981
7981
|
r.push(!1);
|
|
7982
|
-
for (p.count = null;
|
|
7983
|
-
var
|
|
7984
|
-
n !== null && (p.seed = n), D.push(
|
|
7982
|
+
for (p.count = null; k > D.length; ) {
|
|
7983
|
+
var Ct = i(p);
|
|
7984
|
+
n !== null && (p.seed = n), D.push(Ct);
|
|
7985
7985
|
}
|
|
7986
|
-
return p.count =
|
|
7986
|
+
return p.count = k, D;
|
|
7987
7987
|
}
|
|
7988
|
-
return m = o(p), y = l(m, p),
|
|
7988
|
+
return m = o(p), y = l(m, p), S = c(m, y, p), a([m, y, S], p);
|
|
7989
7989
|
};
|
|
7990
7990
|
function o(p) {
|
|
7991
7991
|
if (r.length > 0) {
|
|
7992
|
-
var m = eo(p.hue), y = g(m),
|
|
7993
|
-
r[
|
|
7994
|
-
var D = (m[0] +
|
|
7992
|
+
var m = eo(p.hue), y = g(m), S = (m[1] - m[0]) / r.length, k = parseInt((y - m[0]) / S);
|
|
7993
|
+
r[k] === !0 ? k = (k + 2) % r.length : r[k] = !0;
|
|
7994
|
+
var D = (m[0] + k * S) % 359, x = (m[0] + (k + 1) * S) % 359;
|
|
7995
7995
|
return m = [D, x], y = g(m), y < 0 && (y = 360 + y), y;
|
|
7996
7996
|
} else {
|
|
7997
7997
|
var m = u(p.hue);
|
|
@@ -8003,34 +8003,34 @@ var Pn = { exports: {} };
|
|
|
8003
8003
|
return 0;
|
|
8004
8004
|
if (m.luminosity === "random")
|
|
8005
8005
|
return g([0, 100]);
|
|
8006
|
-
var y = d(p),
|
|
8006
|
+
var y = d(p), S = y[0], k = y[1];
|
|
8007
8007
|
switch (m.luminosity) {
|
|
8008
8008
|
case "bright":
|
|
8009
|
-
|
|
8009
|
+
S = 55;
|
|
8010
8010
|
break;
|
|
8011
8011
|
case "dark":
|
|
8012
|
-
|
|
8012
|
+
S = k - 10;
|
|
8013
8013
|
break;
|
|
8014
8014
|
case "light":
|
|
8015
|
-
|
|
8015
|
+
k = 55;
|
|
8016
8016
|
break;
|
|
8017
8017
|
}
|
|
8018
|
-
return g([
|
|
8018
|
+
return g([S, k]);
|
|
8019
8019
|
}
|
|
8020
8020
|
function c(p, m, y) {
|
|
8021
|
-
var
|
|
8021
|
+
var S = h(p, m), k = 100;
|
|
8022
8022
|
switch (y.luminosity) {
|
|
8023
8023
|
case "dark":
|
|
8024
|
-
|
|
8024
|
+
k = S + 20;
|
|
8025
8025
|
break;
|
|
8026
8026
|
case "light":
|
|
8027
|
-
|
|
8027
|
+
S = (k + S) / 2;
|
|
8028
8028
|
break;
|
|
8029
8029
|
case "random":
|
|
8030
|
-
|
|
8030
|
+
S = 0, k = 100;
|
|
8031
8031
|
break;
|
|
8032
8032
|
}
|
|
8033
|
-
return g([
|
|
8033
|
+
return g([S, k]);
|
|
8034
8034
|
}
|
|
8035
8035
|
function a(p, m) {
|
|
8036
8036
|
switch (m.format) {
|
|
@@ -8042,25 +8042,25 @@ var Pn = { exports: {} };
|
|
|
8042
8042
|
var y = an(p);
|
|
8043
8043
|
return "hsl(" + y[0] + ", " + y[1] + "%, " + y[2] + "%)";
|
|
8044
8044
|
case "hsla":
|
|
8045
|
-
var
|
|
8046
|
-
return "hsla(" +
|
|
8045
|
+
var S = an(p), x = m.alpha || Math.random();
|
|
8046
|
+
return "hsla(" + S[0] + ", " + S[1] + "%, " + S[2] + "%, " + x + ")";
|
|
8047
8047
|
case "rgbArray":
|
|
8048
8048
|
return gt(p);
|
|
8049
8049
|
case "rgb":
|
|
8050
|
-
var
|
|
8051
|
-
return "rgb(" +
|
|
8050
|
+
var k = gt(p);
|
|
8051
|
+
return "rgb(" + k.join(", ") + ")";
|
|
8052
8052
|
case "rgba":
|
|
8053
8053
|
var D = gt(p), x = m.alpha || Math.random();
|
|
8054
8054
|
return "rgba(" + D.join(", ") + ", " + x + ")";
|
|
8055
8055
|
default:
|
|
8056
|
-
return
|
|
8056
|
+
return b(p);
|
|
8057
8057
|
}
|
|
8058
8058
|
}
|
|
8059
8059
|
function h(p, m) {
|
|
8060
|
-
for (var y = f(p).lowerBounds,
|
|
8061
|
-
var
|
|
8062
|
-
if (m >=
|
|
8063
|
-
var zt = (
|
|
8060
|
+
for (var y = f(p).lowerBounds, S = 0; S < y.length - 1; S++) {
|
|
8061
|
+
var k = y[S][0], D = y[S][1], x = y[S + 1][0], Ct = y[S + 1][1];
|
|
8062
|
+
if (m >= k && m <= x) {
|
|
8063
|
+
var zt = (Ct - D) / (x - k), st = D - zt * k;
|
|
8064
8064
|
return zt * m + st;
|
|
8065
8065
|
}
|
|
8066
8066
|
}
|
|
@@ -8078,8 +8078,8 @@ var Pn = { exports: {} };
|
|
|
8078
8078
|
if (y.hueRange)
|
|
8079
8079
|
return y.hueRange;
|
|
8080
8080
|
} else if (p.match(/^#?([0-9A-F]{3}|[0-9A-F]{6})$/i)) {
|
|
8081
|
-
var
|
|
8082
|
-
return [
|
|
8081
|
+
var S = ks(p)[0];
|
|
8082
|
+
return [S, S];
|
|
8083
8083
|
}
|
|
8084
8084
|
}
|
|
8085
8085
|
return [0, 360];
|
|
@@ -8101,27 +8101,27 @@ var Pn = { exports: {} };
|
|
|
8101
8101
|
var m = 0.618033988749895, y = Math.random();
|
|
8102
8102
|
return y += m, y %= 1, Math.floor(p[0] + y * (p[1] + 1 - p[0]));
|
|
8103
8103
|
} else {
|
|
8104
|
-
var
|
|
8104
|
+
var S = p[1] || 1, k = p[0] || 0;
|
|
8105
8105
|
n = (n * 9301 + 49297) % 233280;
|
|
8106
8106
|
var D = n / 233280;
|
|
8107
|
-
return Math.floor(
|
|
8107
|
+
return Math.floor(k + D * (S - k));
|
|
8108
8108
|
}
|
|
8109
8109
|
}
|
|
8110
|
-
function
|
|
8110
|
+
function b(p) {
|
|
8111
8111
|
var m = gt(p);
|
|
8112
|
-
function y(
|
|
8113
|
-
var D =
|
|
8112
|
+
function y(k) {
|
|
8113
|
+
var D = k.toString(16);
|
|
8114
8114
|
return D.length == 1 ? "0" + D : D;
|
|
8115
8115
|
}
|
|
8116
|
-
var
|
|
8117
|
-
return
|
|
8116
|
+
var S = "#" + y(m[0]) + y(m[1]) + y(m[2]);
|
|
8117
|
+
return S;
|
|
8118
8118
|
}
|
|
8119
8119
|
function v(p, m, y) {
|
|
8120
|
-
var
|
|
8120
|
+
var S = y[0][0], k = y[y.length - 1][0], D = y[y.length - 1][1], x = y[0][1];
|
|
8121
8121
|
s[p] = {
|
|
8122
8122
|
hueRange: m,
|
|
8123
8123
|
lowerBounds: y,
|
|
8124
|
-
saturationRange: [
|
|
8124
|
+
saturationRange: [S, k],
|
|
8125
8125
|
brightnessRange: [D, x]
|
|
8126
8126
|
};
|
|
8127
8127
|
}
|
|
@@ -8163,48 +8163,48 @@ var Pn = { exports: {} };
|
|
|
8163
8163
|
function gt(p) {
|
|
8164
8164
|
var m = p[0];
|
|
8165
8165
|
m === 0 && (m = 1), m === 360 && (m = 359), m = m / 360;
|
|
8166
|
-
var y = p[1] / 100,
|
|
8167
|
-
switch (
|
|
8166
|
+
var y = p[1] / 100, S = p[2] / 100, k = Math.floor(m * 6), D = m * 6 - k, x = S * (1 - y), Ct = S * (1 - D * y), zt = S * (1 - (1 - D) * y), st = 256, kt = 256, _t = 256;
|
|
8167
|
+
switch (k) {
|
|
8168
8168
|
case 0:
|
|
8169
|
-
st =
|
|
8169
|
+
st = S, kt = zt, _t = x;
|
|
8170
8170
|
break;
|
|
8171
8171
|
case 1:
|
|
8172
|
-
st =
|
|
8172
|
+
st = Ct, kt = S, _t = x;
|
|
8173
8173
|
break;
|
|
8174
8174
|
case 2:
|
|
8175
|
-
st = x,
|
|
8175
|
+
st = x, kt = S, _t = zt;
|
|
8176
8176
|
break;
|
|
8177
8177
|
case 3:
|
|
8178
|
-
st = x,
|
|
8178
|
+
st = x, kt = Ct, _t = S;
|
|
8179
8179
|
break;
|
|
8180
8180
|
case 4:
|
|
8181
|
-
st = zt,
|
|
8181
|
+
st = zt, kt = x, _t = S;
|
|
8182
8182
|
break;
|
|
8183
8183
|
case 5:
|
|
8184
|
-
st =
|
|
8184
|
+
st = S, kt = x, _t = Ct;
|
|
8185
8185
|
break;
|
|
8186
8186
|
}
|
|
8187
|
-
var no = [Math.floor(st * 255), Math.floor(
|
|
8187
|
+
var no = [Math.floor(st * 255), Math.floor(kt * 255), Math.floor(_t * 255)];
|
|
8188
8188
|
return no;
|
|
8189
8189
|
}
|
|
8190
8190
|
function ks(p) {
|
|
8191
8191
|
p = p.replace(/^#/, ""), p = p.length === 3 ? p.replace(/(.)/g, "$1$1") : p;
|
|
8192
|
-
var m = parseInt(p.substr(0, 2), 16) / 255, y = parseInt(p.substr(2, 2), 16) / 255,
|
|
8193
|
-
switch (
|
|
8192
|
+
var m = parseInt(p.substr(0, 2), 16) / 255, y = parseInt(p.substr(2, 2), 16) / 255, S = parseInt(p.substr(4, 2), 16) / 255, k = Math.max(m, y, S), D = k - Math.min(m, y, S), x = k ? D / k : 0;
|
|
8193
|
+
switch (k) {
|
|
8194
8194
|
case m:
|
|
8195
|
-
return [60 * ((y -
|
|
8195
|
+
return [60 * ((y - S) / D % 6) || 0, x, k];
|
|
8196
8196
|
case y:
|
|
8197
|
-
return [60 * ((
|
|
8198
|
-
case
|
|
8199
|
-
return [60 * ((m - y) / D + 4) || 0, x,
|
|
8197
|
+
return [60 * ((S - m) / D + 2) || 0, x, k];
|
|
8198
|
+
case S:
|
|
8199
|
+
return [60 * ((m - y) / D + 4) || 0, x, k];
|
|
8200
8200
|
}
|
|
8201
8201
|
}
|
|
8202
8202
|
function an(p) {
|
|
8203
|
-
var m = p[0], y = p[1] / 100,
|
|
8203
|
+
var m = p[0], y = p[1] / 100, S = p[2] / 100, k = (2 - y) * S;
|
|
8204
8204
|
return [
|
|
8205
8205
|
m,
|
|
8206
|
-
Math.round(y *
|
|
8207
|
-
|
|
8206
|
+
Math.round(y * S / (k < 1 ? k : 2 - k) * 1e4) / 100,
|
|
8207
|
+
k / 2 * 100
|
|
8208
8208
|
];
|
|
8209
8209
|
}
|
|
8210
8210
|
function to(p) {
|
|
@@ -8220,8 +8220,8 @@ var Pn = { exports: {} };
|
|
|
8220
8220
|
if (y.hueRange)
|
|
8221
8221
|
return y.hueRange;
|
|
8222
8222
|
} else if (p.match(/^#?([0-9A-F]{3}|[0-9A-F]{6})$/i)) {
|
|
8223
|
-
var
|
|
8224
|
-
return f(
|
|
8223
|
+
var S = ks(p)[0];
|
|
8224
|
+
return f(S).hueRange;
|
|
8225
8225
|
}
|
|
8226
8226
|
}
|
|
8227
8227
|
} else {
|
|
@@ -8233,10 +8233,10 @@ var Pn = { exports: {} };
|
|
|
8233
8233
|
}
|
|
8234
8234
|
return i;
|
|
8235
8235
|
});
|
|
8236
|
-
})(
|
|
8237
|
-
var
|
|
8238
|
-
const
|
|
8239
|
-
function
|
|
8236
|
+
})(Vn, Vn.exports);
|
|
8237
|
+
var ph = Vn.exports;
|
|
8238
|
+
const yh = /* @__PURE__ */ gh(ph), $e = "__playhtml_cursors__";
|
|
8239
|
+
function kn(e, t) {
|
|
8240
8240
|
return Math.sqrt(
|
|
8241
8241
|
Math.pow(e.x - t.x, 2) + Math.pow(e.y - t.y, 2)
|
|
8242
8242
|
);
|
|
@@ -8269,17 +8269,17 @@ function Gi(e) {
|
|
|
8269
8269
|
</g>
|
|
8270
8270
|
</svg>`;
|
|
8271
8271
|
}
|
|
8272
|
-
function
|
|
8272
|
+
function _n(e) {
|
|
8273
8273
|
return `url("data:image/svg+xml,${Ki(Gi(e))}"), auto`;
|
|
8274
8274
|
}
|
|
8275
|
-
function
|
|
8275
|
+
function mh(e) {
|
|
8276
8276
|
if (e.startsWith('url("') && (e = e.slice(5), !(!e.endsWith('"), auto') && !e.endsWith('")'))))
|
|
8277
8277
|
return e.endsWith('"), auto') ? e = e.slice(0, e.length - 8) : e = e.slice(0, e.length - 2), e;
|
|
8278
8278
|
}
|
|
8279
|
-
class
|
|
8279
|
+
class wh {
|
|
8280
8280
|
constructor(t, n = {}) {
|
|
8281
8281
|
w(this, "cursors", /* @__PURE__ */ new Map());
|
|
8282
|
-
w(this, "spatialGrid", new
|
|
8282
|
+
w(this, "spatialGrid", new uh(300));
|
|
8283
8283
|
// 300px cell size
|
|
8284
8284
|
w(this, "proximityUsers", /* @__PURE__ */ new Set());
|
|
8285
8285
|
w(this, "currentCursor", null);
|
|
@@ -8293,7 +8293,7 @@ class bh {
|
|
|
8293
8293
|
w(this, "chat", null);
|
|
8294
8294
|
w(this, "currentMessage", null);
|
|
8295
8295
|
w(this, "otherUsersWithMessages", /* @__PURE__ */ new Set());
|
|
8296
|
-
this.provider = t, this.options = n, this.playerIdentity = n.playerIdentity || Li(), this.visibilityThreshold = n.visibilityThreshold ||
|
|
8296
|
+
this.provider = t, this.options = n, this.playerIdentity = n.playerIdentity || Li(), this.visibilityThreshold = n.visibilityThreshold || void 0, this.options.enableChat === !0 && (this.chat = new dh({
|
|
8297
8297
|
onMessageUpdate: (s) => {
|
|
8298
8298
|
this.currentMessage = s, this.updateCursorAwareness();
|
|
8299
8299
|
}
|
|
@@ -8301,8 +8301,8 @@ class bh {
|
|
|
8301
8301
|
}
|
|
8302
8302
|
initialize() {
|
|
8303
8303
|
this.addCursorStyles(), this.setupCursorTracking(), this.setupAwarenessHandling();
|
|
8304
|
-
const t = this.playerIdentity.playerStyle.colorPalette[0] ||
|
|
8305
|
-
document.documentElement.style.cursor =
|
|
8304
|
+
const t = this.playerIdentity.playerStyle.colorPalette[0] || yh({ luminosity: "bright" });
|
|
8305
|
+
document.documentElement.style.cursor = _n(t);
|
|
8306
8306
|
}
|
|
8307
8307
|
setupAwarenessHandling() {
|
|
8308
8308
|
this.provider.awareness.on("change", ({ added: t, updated: n, removed: s }) => {
|
|
@@ -8353,7 +8353,13 @@ class bh {
|
|
|
8353
8353
|
const a = c.data;
|
|
8354
8354
|
if (!a.cursor)
|
|
8355
8355
|
continue;
|
|
8356
|
-
|
|
8356
|
+
if (kn(this.currentCursor, a.cursor) < n && (t.add(c.id), !this.proximityUsers.has(c.id))) {
|
|
8357
|
+
const d = {
|
|
8358
|
+
ours: { x: this.currentCursor.x, y: this.currentCursor.y },
|
|
8359
|
+
theirs: { x: a.cursor.x, y: a.cursor.y }
|
|
8360
|
+
}, f = a.cursor.x - this.currentCursor.x, g = a.cursor.y - this.currentCursor.y, b = Math.atan2(g, f);
|
|
8361
|
+
(i = (r = this.options).onProximityEntered) == null || i.call(r, a.playerIdentity, d, b);
|
|
8362
|
+
}
|
|
8357
8363
|
}
|
|
8358
8364
|
for (const c of this.proximityUsers)
|
|
8359
8365
|
t.has(c) || (l = (o = this.options).onProximityLeft) == null || l.call(o, c);
|
|
@@ -8399,14 +8405,14 @@ class bh {
|
|
|
8399
8405
|
let i = "mouse";
|
|
8400
8406
|
const o = document.elementFromPoint(r.clientX, r.clientY);
|
|
8401
8407
|
if (o) {
|
|
8402
|
-
const l = window.getComputedStyle(o), c =
|
|
8408
|
+
const l = window.getComputedStyle(o), c = mh(l.cursor);
|
|
8403
8409
|
if (c) {
|
|
8404
8410
|
const a = this.playerIdentity.playerStyle.colorPalette[0] || "#3b82f6", h = Ki(Gi(a));
|
|
8405
8411
|
c.includes(h) || (i = c);
|
|
8406
8412
|
}
|
|
8407
8413
|
}
|
|
8408
8414
|
if (i === "mouse") {
|
|
8409
|
-
const l =
|
|
8415
|
+
const l = _n(
|
|
8410
8416
|
this.playerIdentity.playerStyle.colorPalette[0] || "#3b82f6"
|
|
8411
8417
|
);
|
|
8412
8418
|
document.documentElement.style.cursor = l;
|
|
@@ -8416,19 +8422,19 @@ class bh {
|
|
|
8416
8422
|
x: r.clientX,
|
|
8417
8423
|
y: r.clientY,
|
|
8418
8424
|
pointer: i
|
|
8419
|
-
}, this.throttledUpdateCursorAwareness();
|
|
8425
|
+
}, this.throttledUpdateCursorAwareness(), this.updateAllCursorVisibility();
|
|
8420
8426
|
}, n = (r) => {
|
|
8421
8427
|
const i = r.touches[0];
|
|
8422
8428
|
i && (this.currentCursor = {
|
|
8423
8429
|
x: i.clientX,
|
|
8424
8430
|
y: i.clientY,
|
|
8425
8431
|
pointer: "touch"
|
|
8426
|
-
}, this.throttledUpdateCursorAwareness());
|
|
8432
|
+
}, this.throttledUpdateCursorAwareness(), this.updateAllCursorVisibility());
|
|
8427
8433
|
}, s = () => {
|
|
8428
8434
|
this.currentCursor = null, this.updateCursorAwareness();
|
|
8429
8435
|
};
|
|
8430
8436
|
document.addEventListener("mousemove", t), document.addEventListener("touchmove", n), document.addEventListener("touchend", s), document.addEventListener("mouseleave", (r) => {
|
|
8431
|
-
this.currentCursor = null, this.updateCursorAwareness();
|
|
8437
|
+
this.currentCursor = null, this.updateCursorAwareness(), this.showAllCursors();
|
|
8432
8438
|
});
|
|
8433
8439
|
}
|
|
8434
8440
|
throttledUpdateCursorAwareness() {
|
|
@@ -8462,7 +8468,8 @@ class bh {
|
|
|
8462
8468
|
!s || i ? (s && s.remove(), s = this.createCursorElement(
|
|
8463
8469
|
n.playerIdentity,
|
|
8464
8470
|
r.pointer,
|
|
8465
|
-
n.message
|
|
8471
|
+
n.message,
|
|
8472
|
+
t
|
|
8466
8473
|
), s.dataset.pointerType = r.pointer, this.cursors.set(t, s), document.body.appendChild(s)) : s && (this.updateCursorMessage(
|
|
8467
8474
|
s,
|
|
8468
8475
|
n.playerIdentity,
|
|
@@ -8476,28 +8483,32 @@ class bh {
|
|
|
8476
8483
|
Math.min(a - l, r.y)
|
|
8477
8484
|
);
|
|
8478
8485
|
if (s.style.position = "fixed", s.style.left = `${h}px`, s.style.top = `${u}px`, s.style.zIndex = "999999", s.style.pointerEvents = "none", this.currentCursor) {
|
|
8479
|
-
const
|
|
8480
|
-
s.style.opacity = f ? "1" : "0", s.style.transform = f ? "scale(1)" : "scale(0.8)";
|
|
8486
|
+
const d = kn(r, this.currentCursor), f = this.visibilityThreshold ? d < this.visibilityThreshold : !0;
|
|
8487
|
+
s.style.display = f ? "block" : "none", s.style.opacity = f ? "1" : "0", s.style.transform = f ? "scale(1)" : "scale(0.8)";
|
|
8481
8488
|
} else
|
|
8482
|
-
s.style.opacity = "1", s.style.transform = "scale(1)";
|
|
8489
|
+
s.style.display = "block", s.style.opacity = "1", s.style.transform = "scale(1)";
|
|
8483
8490
|
}
|
|
8484
|
-
createCursorElement(t, n = "mouse", s) {
|
|
8485
|
-
var
|
|
8486
|
-
const
|
|
8487
|
-
|
|
8488
|
-
|
|
8491
|
+
createCursorElement(t, n = "mouse", s, r) {
|
|
8492
|
+
var l, c;
|
|
8493
|
+
const i = document.createElement("div");
|
|
8494
|
+
if (i.className = "playhtml-cursor-other playhtml-cursor-fade-in", r && this.options.onCustomCursorRender) {
|
|
8495
|
+
const a = this.options.onCustomCursorRender(r, i);
|
|
8496
|
+
if (a)
|
|
8497
|
+
return a;
|
|
8498
|
+
}
|
|
8499
|
+
const o = ((c = (l = t == null ? void 0 : t.playerStyle) == null ? void 0 : l.colorPalette) == null ? void 0 : c[0]) || "#3b82f6";
|
|
8489
8500
|
switch (n) {
|
|
8490
8501
|
case "mouse":
|
|
8491
|
-
|
|
8502
|
+
i.innerHTML = this.getMouseCursorSVG(o);
|
|
8492
8503
|
break;
|
|
8493
8504
|
case "touch":
|
|
8494
|
-
|
|
8505
|
+
i.innerHTML = this.getTouchCursorSVG(o);
|
|
8495
8506
|
break;
|
|
8496
8507
|
default:
|
|
8497
|
-
|
|
8508
|
+
i.innerHTML = this.getCustomCursorSVG(o, n);
|
|
8498
8509
|
break;
|
|
8499
8510
|
}
|
|
8500
|
-
return this.options.cursorStyle && (
|
|
8511
|
+
return this.options.cursorStyle && (i.style.cssText += this.options.cursorStyle), this.updateCursorMessage(i, t, s), this.updateCursorName(i, t), i;
|
|
8501
8512
|
}
|
|
8502
8513
|
getMouseCursorSVG(t) {
|
|
8503
8514
|
return `
|
|
@@ -8573,7 +8584,7 @@ class bh {
|
|
|
8573
8584
|
count: this.cursors.size,
|
|
8574
8585
|
setColor: (s) => {
|
|
8575
8586
|
this.playerIdentity.playerStyle.colorPalette[0] = s;
|
|
8576
|
-
const r =
|
|
8587
|
+
const r = _n(s);
|
|
8577
8588
|
document.documentElement.style.cursor = r, this.updateCursorAwareness(), window.cursors && (window.cursors.color = s), this.emitGlobalEvent("color", s);
|
|
8578
8589
|
},
|
|
8579
8590
|
setName: (s) => {
|
|
@@ -8698,6 +8709,32 @@ class bh {
|
|
|
8698
8709
|
getContrastColor(t) {
|
|
8699
8710
|
return this.getLuminance(t) > 0.5 ? "#000000" : "#ffffff";
|
|
8700
8711
|
}
|
|
8712
|
+
updateAllCursorVisibility() {
|
|
8713
|
+
!this.currentCursor || !this.visibilityThreshold || this.cursors.forEach((t, n) => {
|
|
8714
|
+
var i;
|
|
8715
|
+
const r = (i = this.spatialGrid.getAll().find((o) => o.id === n)) == null ? void 0 : i.data;
|
|
8716
|
+
if (r && r.cursor) {
|
|
8717
|
+
const l = kn(this.currentCursor, r.cursor) < this.visibilityThreshold;
|
|
8718
|
+
t.style.display = l ? "block" : "none", t.style.opacity = l ? "1" : "0", t.style.transform = l ? "scale(1)" : "scale(0.8)";
|
|
8719
|
+
}
|
|
8720
|
+
});
|
|
8721
|
+
}
|
|
8722
|
+
showAllCursors() {
|
|
8723
|
+
this.cursors.forEach((t) => {
|
|
8724
|
+
t.style.display = "block", t.style.opacity = "1", t.style.transform = "scale(1)";
|
|
8725
|
+
});
|
|
8726
|
+
}
|
|
8727
|
+
configure(t) {
|
|
8728
|
+
Object.assign(this.options, t), t.visibilityThreshold !== void 0 && (this.visibilityThreshold = t.visibilityThreshold, this.updateAllCursorVisibility()), t.playerIdentity !== void 0 && (this.playerIdentity = t.playerIdentity);
|
|
8729
|
+
}
|
|
8730
|
+
hideCursor(t) {
|
|
8731
|
+
const n = this.cursors.get(t);
|
|
8732
|
+
n && (n.style.display = "none");
|
|
8733
|
+
}
|
|
8734
|
+
showCursor(t) {
|
|
8735
|
+
const n = this.cursors.get(t);
|
|
8736
|
+
n && (n.style.display = "block");
|
|
8737
|
+
}
|
|
8701
8738
|
destroy() {
|
|
8702
8739
|
this.cursors.forEach((t) => t.remove()), this.cursors.clear(), this.spatialGrid.clear(), this.chat && this.chat.destroy(), this.provider.awareness.setLocalStateField($e, null);
|
|
8703
8740
|
}
|
|
@@ -8711,15 +8748,15 @@ class bh {
|
|
|
8711
8748
|
};
|
|
8712
8749
|
}
|
|
8713
8750
|
}
|
|
8714
|
-
const
|
|
8751
|
+
const bh = "playhtml.spencerc99.partykit.dev", Sh = "staging.playhtml.spencerc99.partykit.dev";
|
|
8715
8752
|
function Ch(e) {
|
|
8716
8753
|
if (e)
|
|
8717
8754
|
return e;
|
|
8718
8755
|
const t = window.location.hostname;
|
|
8719
|
-
return t.includes("staging") || t.includes("ngrok-free") ?
|
|
8756
|
+
return t.includes("staging") || t.includes("ngrok-free") ? Sh : bh;
|
|
8720
8757
|
}
|
|
8721
|
-
const F =
|
|
8722
|
-
function
|
|
8758
|
+
const F = ch({ play: {} }), qt = oh(F);
|
|
8759
|
+
function kh(e) {
|
|
8723
8760
|
var i;
|
|
8724
8761
|
performance.now(), console.debug(`[MIGRATION] Starting migration for tag: ${e}`);
|
|
8725
8762
|
const t = le.get(e);
|
|
@@ -8765,28 +8802,28 @@ function _h(e) {
|
|
|
8765
8802
|
}
|
|
8766
8803
|
performance.now();
|
|
8767
8804
|
}
|
|
8768
|
-
function
|
|
8805
|
+
function _h() {
|
|
8769
8806
|
if (le.get("__migration_complete__")) {
|
|
8770
8807
|
console.debug("[MIGRATION] Migration already completed, skipping");
|
|
8771
8808
|
return;
|
|
8772
8809
|
}
|
|
8773
8810
|
console.debug("[MIGRATION] Starting migration from Y.Map to SyncedStore"), le.forEach((t, n) => {
|
|
8774
|
-
n !== "__migration_complete__" &&
|
|
8811
|
+
n !== "__migration_complete__" && kh(n);
|
|
8775
8812
|
}), le.set("__migration_complete__", !0), console.debug(
|
|
8776
8813
|
"[MIGRATION] Migration completed. SyncedStore state:",
|
|
8777
8814
|
xe(F.play)
|
|
8778
8815
|
);
|
|
8779
8816
|
}
|
|
8780
|
-
function
|
|
8817
|
+
function Eh(e) {
|
|
8781
8818
|
const t = window.location.pathname.replace(/\.[^/.]+$/, "");
|
|
8782
8819
|
return e ? t + window.location.search : t;
|
|
8783
8820
|
}
|
|
8784
8821
|
let H, Wi = null, le = qt.getMap("playhtml-global");
|
|
8785
|
-
const
|
|
8786
|
-
function
|
|
8822
|
+
const En = /* @__PURE__ */ new Map(), yr = /* @__PURE__ */ new Map();
|
|
8823
|
+
function vh(e, t, n) {
|
|
8787
8824
|
var r;
|
|
8788
|
-
|
|
8789
|
-
const s =
|
|
8825
|
+
En.has(e) || En.set(e, /* @__PURE__ */ new Map());
|
|
8826
|
+
const s = En.get(e);
|
|
8790
8827
|
if (!s.has(t)) {
|
|
8791
8828
|
if ((r = F.play)[e] ?? (r[e] = {}), F.play[e][t] === void 0) {
|
|
8792
8829
|
const i = xe(n);
|
|
@@ -8798,14 +8835,14 @@ function Ah(e, t, n) {
|
|
|
8798
8835
|
}
|
|
8799
8836
|
let j = /* @__PURE__ */ new Map(), Nt = /* @__PURE__ */ new Map();
|
|
8800
8837
|
const mr = /* @__PURE__ */ new Map();
|
|
8801
|
-
let
|
|
8838
|
+
let Ah = 0, ln = Oa;
|
|
8802
8839
|
function Se() {
|
|
8803
|
-
return [
|
|
8840
|
+
return [ms.CanPlay, ...Object.keys(ln)];
|
|
8804
8841
|
}
|
|
8805
|
-
function
|
|
8842
|
+
function Dh(e) {
|
|
8806
8843
|
H.ws && H.ws.send(JSON.stringify(e));
|
|
8807
8844
|
}
|
|
8808
|
-
function
|
|
8845
|
+
function xh(e) {
|
|
8809
8846
|
if (e.data instanceof Blob)
|
|
8810
8847
|
return;
|
|
8811
8848
|
let t;
|
|
@@ -8819,7 +8856,7 @@ function Oh(e) {
|
|
|
8819
8856
|
for (const i of r)
|
|
8820
8857
|
i.onEvent(s);
|
|
8821
8858
|
}
|
|
8822
|
-
function
|
|
8859
|
+
function Oh() {
|
|
8823
8860
|
const e = document.createElement("div");
|
|
8824
8861
|
e.id = "playhtml-dev-ui", e.style.position = "fixed", e.style.bottom = "10px", e.style.left = "10px", e.style.zIndex = "10000";
|
|
8825
8862
|
const t = document.createElement("button");
|
|
@@ -8867,23 +8904,23 @@ function Mh() {
|
|
|
8867
8904
|
}
|
|
8868
8905
|
});
|
|
8869
8906
|
}
|
|
8870
|
-
let Ot = !1,
|
|
8871
|
-
async function
|
|
8907
|
+
let Ot = !1, Kn = !0;
|
|
8908
|
+
async function Mh({
|
|
8872
8909
|
// TODO: if it is a localhost url, need to make some deterministic way to connect to the same room.
|
|
8873
8910
|
host: e,
|
|
8874
8911
|
extraCapabilities: t,
|
|
8875
8912
|
events: n,
|
|
8876
8913
|
defaultRoomOptions: s = {},
|
|
8877
|
-
room: r =
|
|
8914
|
+
room: r = Eh(s.includeSearch),
|
|
8878
8915
|
onError: i,
|
|
8879
8916
|
developmentMode: o = !1,
|
|
8880
8917
|
cursors: l = {}
|
|
8881
8918
|
} = {}) {
|
|
8882
|
-
if (!
|
|
8919
|
+
if (!Kn || "playhtml" in window) {
|
|
8883
8920
|
console.error("playhtml already set up! ignoring");
|
|
8884
8921
|
return;
|
|
8885
8922
|
}
|
|
8886
|
-
window.playhtml =
|
|
8923
|
+
window.playhtml = $h;
|
|
8887
8924
|
const c = encodeURIComponent(window.location.hostname + "-" + r), a = Ch(e);
|
|
8888
8925
|
if (console.log(
|
|
8889
8926
|
`࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂
|
|
@@ -8894,28 +8931,26 @@ async function Ih({
|
|
|
8894
8931
|
࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂࿂`
|
|
8895
8932
|
), H = new aa(a, c, qt), H.on("error", () => {
|
|
8896
8933
|
i == null || i();
|
|
8897
|
-
}),
|
|
8934
|
+
}), l.enabled) {
|
|
8935
|
+
const u = {
|
|
8936
|
+
...l
|
|
8937
|
+
};
|
|
8938
|
+
u.playerIdentity || (u.playerIdentity = Li()), Wi = new wh(H, u);
|
|
8939
|
+
}
|
|
8940
|
+
if (new Ea(c, qt), t)
|
|
8898
8941
|
for (const [u, d] of Object.entries(t))
|
|
8899
8942
|
ln[u] = d;
|
|
8900
8943
|
if (n)
|
|
8901
8944
|
for (const [u, d] of Object.entries(n))
|
|
8902
8945
|
Qi(u, d);
|
|
8903
8946
|
const h = document.createElement("link");
|
|
8904
|
-
return h.rel = "stylesheet", h.href = "https://unpkg.com/playhtml@latest/dist/style.css", document.head.appendChild(h), o &&
|
|
8947
|
+
return h.rel = "stylesheet", h.href = "https://unpkg.com/playhtml@latest/dist/style.css", document.head.appendChild(h), o && Oh(), Lh(), await new Promise((u) => {
|
|
8905
8948
|
Ot && u(!0), H.on("sync", (d) => {
|
|
8906
|
-
|
|
8907
|
-
if (Ot = !0, console.log("[PLAYHTML]: Setting up elements... Time to have some fun 🛝"), Eh(), Zi(), l.enabled) {
|
|
8908
|
-
const f = {
|
|
8909
|
-
...l
|
|
8910
|
-
};
|
|
8911
|
-
f.playerIdentity || (f.playerIdentity = Li()), Wi = new bh(H, f);
|
|
8912
|
-
}
|
|
8913
|
-
Rh(), u(!0);
|
|
8914
|
-
}
|
|
8949
|
+
d ? d && H.ws.addEventListener("message", xh) : console.error("Issue connecting to yjs..."), !Ot && (Ot = !0, console.log("[PLAYHTML]: Setting up elements... Time to have some fun 🛝"), _h(), Zi(), Th(), u(!0));
|
|
8915
8950
|
});
|
|
8916
8951
|
}), H;
|
|
8917
8952
|
}
|
|
8918
|
-
function
|
|
8953
|
+
function Ih(e, t) {
|
|
8919
8954
|
const n = H.awareness.getLocalState();
|
|
8920
8955
|
return ((n == null ? void 0 : n[e]) ?? {})[t];
|
|
8921
8956
|
}
|
|
@@ -8939,7 +8974,7 @@ function Xi(e) {
|
|
|
8939
8974
|
const n = e.getAttribute("loading-class");
|
|
8940
8975
|
n && e.classList.remove(n), e.removeAttribute("aria-busy"), e.removeAttribute("aria-live");
|
|
8941
8976
|
}
|
|
8942
|
-
function
|
|
8977
|
+
function Lh() {
|
|
8943
8978
|
for (const e of Se())
|
|
8944
8979
|
Array.from(
|
|
8945
8980
|
document.querySelectorAll(`[${e}]`)
|
|
@@ -8947,7 +8982,7 @@ function Th() {
|
|
|
8947
8982
|
Ji(n);
|
|
8948
8983
|
});
|
|
8949
8984
|
}
|
|
8950
|
-
function
|
|
8985
|
+
function Th() {
|
|
8951
8986
|
for (const e of Se())
|
|
8952
8987
|
Array.from(
|
|
8953
8988
|
document.querySelectorAll(`[${e}]`)
|
|
@@ -8955,19 +8990,19 @@ function Rh() {
|
|
|
8955
8990
|
Xi(n);
|
|
8956
8991
|
});
|
|
8957
8992
|
}
|
|
8958
|
-
function
|
|
8959
|
-
const r = n.defaultData instanceof Function ? n.defaultData(e) : n.defaultData, i =
|
|
8993
|
+
function Rh(e, t, n, s) {
|
|
8994
|
+
const r = n.defaultData instanceof Function ? n.defaultData(e) : n.defaultData, i = vh(t, s, r);
|
|
8960
8995
|
return {
|
|
8961
8996
|
...n,
|
|
8962
8997
|
// Always provide a plain snapshot to render paths
|
|
8963
8998
|
data: xe(i),
|
|
8964
|
-
awareness:
|
|
8999
|
+
awareness: Ih(t, s) ?? n.myDefaultAwareness !== void 0 ? [n.myDefaultAwareness] : void 0,
|
|
8965
9000
|
element: e,
|
|
8966
9001
|
onChange: (l) => {
|
|
8967
9002
|
typeof l == "function" ? qt.transact(() => {
|
|
8968
9003
|
l(i);
|
|
8969
9004
|
}) : qt.transact(() => {
|
|
8970
|
-
|
|
9005
|
+
Gn(i, l);
|
|
8971
9006
|
});
|
|
8972
9007
|
},
|
|
8973
9008
|
onAwarenessChange: (l) => {
|
|
@@ -8980,20 +9015,20 @@ function Uh(e, t, n, s) {
|
|
|
8980
9015
|
}
|
|
8981
9016
|
};
|
|
8982
9017
|
}
|
|
8983
|
-
function
|
|
9018
|
+
function vn(e) {
|
|
8984
9019
|
return e !== null && typeof e == "object" && Object.getPrototypeOf(e) === Object.prototype;
|
|
8985
9020
|
}
|
|
8986
|
-
function
|
|
9021
|
+
function Gn(e, t) {
|
|
8987
9022
|
if (t != null) {
|
|
8988
9023
|
if (Array.isArray(t)) {
|
|
8989
9024
|
e.splice(0, e.length, ...t);
|
|
8990
9025
|
return;
|
|
8991
9026
|
}
|
|
8992
|
-
if (
|
|
9027
|
+
if (vn(t)) {
|
|
8993
9028
|
for (const n of Object.keys(e))
|
|
8994
9029
|
n in t || delete e[n];
|
|
8995
9030
|
for (const [n, s] of Object.entries(t))
|
|
8996
|
-
Array.isArray(s) ? (Array.isArray(e[n]) || (e[n] = []),
|
|
9031
|
+
Array.isArray(s) ? (Array.isArray(e[n]) || (e[n] = []), Gn(e[n], s)) : vn(s) ? (vn(e[n]) || (e[n] = {}), Gn(e[n], s)) : e[n] = s;
|
|
8997
9032
|
return;
|
|
8998
9033
|
}
|
|
8999
9034
|
e = t;
|
|
@@ -9007,11 +9042,11 @@ function xe(e) {
|
|
|
9007
9042
|
}
|
|
9008
9043
|
return e == null ? e : typeof e == "object" ? JSON.parse(JSON.stringify(e)) : e;
|
|
9009
9044
|
}
|
|
9010
|
-
function
|
|
9045
|
+
function Uh(e) {
|
|
9011
9046
|
return e.defaultData !== void 0 && (typeof e.defaultData == "object" || typeof e.defaultData == "function") && e.updateElement !== void 0;
|
|
9012
9047
|
}
|
|
9013
|
-
function
|
|
9014
|
-
if (e ===
|
|
9048
|
+
function Nh(e, t) {
|
|
9049
|
+
if (e === ms.CanPlay) {
|
|
9015
9050
|
const n = t;
|
|
9016
9051
|
return {
|
|
9017
9052
|
defaultData: n.defaultData,
|
|
@@ -9074,41 +9109,41 @@ function Zi() {
|
|
|
9074
9109
|
document.querySelectorAll(`[${e}]`)
|
|
9075
9110
|
).filter(cn);
|
|
9076
9111
|
t.length && Promise.all(
|
|
9077
|
-
t.map((n) =>
|
|
9112
|
+
t.map((n) => Cs(n, e))
|
|
9078
9113
|
);
|
|
9079
9114
|
}
|
|
9080
|
-
|
|
9115
|
+
Kn && (H.awareness.on("change", () => qi()), Kn = !1);
|
|
9081
9116
|
}
|
|
9082
9117
|
}
|
|
9083
|
-
const
|
|
9084
|
-
init:
|
|
9118
|
+
const $h = {
|
|
9119
|
+
init: Mh,
|
|
9085
9120
|
setupPlayElements: Zi,
|
|
9086
|
-
setupPlayElement:
|
|
9087
|
-
removePlayElement:
|
|
9088
|
-
setupPlayElementForTag:
|
|
9121
|
+
setupPlayElement: zh,
|
|
9122
|
+
removePlayElement: jh,
|
|
9123
|
+
setupPlayElementForTag: Cs,
|
|
9089
9124
|
syncedStore: F.play,
|
|
9090
9125
|
// TODO: REMOVE AFTER MIGRATION VALIDATED
|
|
9091
9126
|
globalData: le,
|
|
9092
9127
|
elementHandlers: j,
|
|
9093
9128
|
eventHandlers: Nt,
|
|
9094
|
-
dispatchPlayEvent:
|
|
9129
|
+
dispatchPlayEvent: Hh,
|
|
9095
9130
|
registerPlayEventListener: Qi,
|
|
9096
|
-
removePlayEventListener:
|
|
9131
|
+
removePlayEventListener: Ph,
|
|
9097
9132
|
get cursorClient() {
|
|
9098
9133
|
return Wi;
|
|
9099
9134
|
}
|
|
9100
9135
|
};
|
|
9101
|
-
function
|
|
9136
|
+
function Bh(e) {
|
|
9102
9137
|
var t;
|
|
9103
9138
|
j.has(e) || Ot && (j.has(e) || j.set(e, /* @__PURE__ */ new Map()), (t = F.play)[e] ?? (t[e] = {}));
|
|
9104
9139
|
}
|
|
9105
|
-
function
|
|
9140
|
+
function Fh(e, t) {
|
|
9106
9141
|
var n, s;
|
|
9107
9142
|
return ((s = (n = ln[t]) == null ? void 0 : n.isValidElementForTag) == null ? void 0 : s.call(n, e)) ?? !0;
|
|
9108
9143
|
}
|
|
9109
|
-
async function
|
|
9144
|
+
async function Cs(e, t) {
|
|
9110
9145
|
var o;
|
|
9111
|
-
if (!
|
|
9146
|
+
if (!Fh(e, t) || !Ot)
|
|
9112
9147
|
return;
|
|
9113
9148
|
if (!e.id) {
|
|
9114
9149
|
const l = e.getAttribute("selector-id");
|
|
@@ -9116,27 +9151,27 @@ async function Ss(e, t) {
|
|
|
9116
9151
|
const c = mr.get(l) ?? 0;
|
|
9117
9152
|
e.id = btoa(`${t}-${l}-${c}`), mr.set(l, c + 1);
|
|
9118
9153
|
} else
|
|
9119
|
-
e.id = await
|
|
9154
|
+
e.id = await hh(t, e);
|
|
9120
9155
|
}
|
|
9121
|
-
const n =
|
|
9156
|
+
const n = Da(e);
|
|
9122
9157
|
if (!n) {
|
|
9123
9158
|
console.error(
|
|
9124
9159
|
`Element ${e} does not have an acceptable ID. Please add an ID to the element to register it as a playhtml element.`
|
|
9125
9160
|
);
|
|
9126
9161
|
return;
|
|
9127
9162
|
}
|
|
9128
|
-
|
|
9129
|
-
const s = j.get(t), r =
|
|
9163
|
+
Bh(t);
|
|
9164
|
+
const s = j.get(t), r = Nh(
|
|
9130
9165
|
t,
|
|
9131
9166
|
e
|
|
9132
9167
|
);
|
|
9133
|
-
if (!
|
|
9168
|
+
if (!Uh(r)) {
|
|
9134
9169
|
console.error(
|
|
9135
9170
|
`Element ${n} does not have proper info to initial a playhtml element. Please refer to https://github.com/spencerc99/playhtml#can-play for troubleshooting help.`
|
|
9136
9171
|
);
|
|
9137
9172
|
return;
|
|
9138
9173
|
}
|
|
9139
|
-
const i =
|
|
9174
|
+
const i = Rh(
|
|
9140
9175
|
e,
|
|
9141
9176
|
t,
|
|
9142
9177
|
r,
|
|
@@ -9146,7 +9181,7 @@ async function Ss(e, t) {
|
|
|
9146
9181
|
s.get(n).reinitializeElementData(i), wr(t, n);
|
|
9147
9182
|
return;
|
|
9148
9183
|
} else
|
|
9149
|
-
s.set(n, new
|
|
9184
|
+
s.set(n, new ah(i));
|
|
9150
9185
|
(o = i.triggerAwarenessUpdate) == null || o.call(i), e.classList.add("__playhtml-element"), e.style.setProperty("--jiggle-delay", `${Math.random() * 1}s;}`), wr(t, n);
|
|
9151
9186
|
}
|
|
9152
9187
|
function wr(e, t) {
|
|
@@ -9176,7 +9211,7 @@ function wr(e, t) {
|
|
|
9176
9211
|
};
|
|
9177
9212
|
i.observeDeep(c), yr.set(n, c);
|
|
9178
9213
|
}
|
|
9179
|
-
function
|
|
9214
|
+
function zh(e, { ignoreIfAlreadySetup: t } = {}) {
|
|
9180
9215
|
if (t && Object.keys(j || {}).some(
|
|
9181
9216
|
(s) => {
|
|
9182
9217
|
var r;
|
|
@@ -9191,32 +9226,32 @@ function jh(e, { ignoreIfAlreadySetup: t } = {}) {
|
|
|
9191
9226
|
Se().some(
|
|
9192
9227
|
(s) => e.hasAttribute(s)
|
|
9193
9228
|
) && (Ot ? Xi(e) : Ji(e)), Promise.all(
|
|
9194
|
-
Se().filter((s) => e.hasAttribute(s)).map((s) =>
|
|
9229
|
+
Se().filter((s) => e.hasAttribute(s)).map((s) => Cs(e, s))
|
|
9195
9230
|
);
|
|
9196
9231
|
}
|
|
9197
|
-
function
|
|
9232
|
+
function jh(e) {
|
|
9198
9233
|
if (!(!e || !e.id))
|
|
9199
9234
|
for (const t of Object.keys(j)) {
|
|
9200
9235
|
const n = j.get(t);
|
|
9201
9236
|
n.has(e.id) && n.delete(e.id);
|
|
9202
9237
|
}
|
|
9203
9238
|
}
|
|
9204
|
-
function
|
|
9239
|
+
function Hh(e) {
|
|
9205
9240
|
const { type: t } = e;
|
|
9206
9241
|
if (!Nt.has(t)) {
|
|
9207
9242
|
console.error(`[playhtml] event "${t}" not registered.`);
|
|
9208
9243
|
return;
|
|
9209
9244
|
}
|
|
9210
|
-
|
|
9245
|
+
Dh(e);
|
|
9211
9246
|
}
|
|
9212
9247
|
function Qi(e, t) {
|
|
9213
|
-
const n = String(
|
|
9248
|
+
const n = String(Ah++);
|
|
9214
9249
|
return Nt.set(e, [
|
|
9215
9250
|
...Nt.get(e) ?? [],
|
|
9216
9251
|
{ type: e, ...t, id: n }
|
|
9217
9252
|
]), n;
|
|
9218
9253
|
}
|
|
9219
|
-
function
|
|
9254
|
+
function Ph(e, t) {
|
|
9220
9255
|
const n = Nt.get(e);
|
|
9221
9256
|
if (!n)
|
|
9222
9257
|
return;
|
|
@@ -9224,5 +9259,5 @@ function Vh(e, t) {
|
|
|
9224
9259
|
s !== -1 && (n.splice(s, 1), n.length === 0 && Nt.delete(e));
|
|
9225
9260
|
}
|
|
9226
9261
|
export {
|
|
9227
|
-
|
|
9262
|
+
$h as playhtml
|
|
9228
9263
|
};
|