@jackuait/blok 0.10.0-beta.12 → 0.10.0-beta.13
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/blok.mjs +2 -2
- package/dist/chunks/{blok-trqaO1wV.mjs → blok-uTkAJyAg.mjs} +257 -259
- package/dist/chunks/{constants-UyV9cJZk.mjs → constants-NpHRgdEj.mjs} +1 -1
- package/dist/chunks/{tools-DJJP1iOU.mjs → tools-bN22O_3E.mjs} +1 -1
- package/dist/full.mjs +3 -3
- package/dist/react.mjs +2 -2
- package/dist/tools.mjs +2 -2
- package/package.json +1 -1
- package/src/components/modules/toolbar/index.ts +2 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./chunk-D6kmoKXy.mjs";
|
|
2
|
-
import { $n as t, $t as n, An as r, At as i, Bn as a, Bt as o, C as s, Dn as c, E as l, En as u, Fn as d, Gn as f, Gt as p, Hn as m, In as h, It as g, Jn as _, Jt as v, Kn as ee, Kt as y, Ln as te, Mn as ne, Nn as re, On as ie, Ot as ae, Pn as oe, Qn as se, Qt as ce, Rn as le, S as ue, Sn as de, T as fe, Tn as pe, Un as b, Vn as me, Wn as he, Wt as ge, Xn as _e, Xt as ve, Yn as ye, Yt as be, Zn as x, Zt as xe, _ as Se, _n as Ce, an as we, b as S, bn as Te, dn as Ee, en as De, er as C, fn as Oe, ft as ke, g as Ae, gn as je, gt as Me, h as Ne, hn as Pe, in as w, jn as Fe, k as Ie, kn as Le, ln as Re, m as ze, mn as Be, nn as Ve, p as He, pn as Ue, qn as T, qt as We, rn as E, sn as Ge, tn as Ke, u as qe, un as Je, v as Ye, vn as Xe, vt as Ze, w as Qe, wn as D, x as $e, xn as et, y as tt, yn as nt, zn as rt, zt as it } from "./constants-
|
|
2
|
+
import { $n as t, $t as n, An as r, At as i, Bn as a, Bt as o, C as s, Dn as c, E as l, En as u, Fn as d, Gn as f, Gt as p, Hn as m, In as h, It as g, Jn as _, Jt as v, Kn as ee, Kt as y, Ln as te, Mn as ne, Nn as re, On as ie, Ot as ae, Pn as oe, Qn as se, Qt as ce, Rn as le, S as ue, Sn as de, T as fe, Tn as pe, Un as b, Vn as me, Wn as he, Wt as ge, Xn as _e, Xt as ve, Yn as ye, Yt as be, Zn as x, Zt as xe, _ as Se, _n as Ce, an as we, b as S, bn as Te, dn as Ee, en as De, er as C, fn as Oe, ft as ke, g as Ae, gn as je, gt as Me, h as Ne, hn as Pe, in as w, jn as Fe, k as Ie, kn as Le, ln as Re, m as ze, mn as Be, nn as Ve, p as He, pn as Ue, qn as T, qt as We, rn as E, sn as Ge, tn as Ke, u as qe, un as Je, v as Ye, vn as Xe, vt as Ze, w as Qe, wn as D, x as $e, xn as et, y as tt, yn as nt, zn as rt, zt as it } from "./constants-NpHRgdEj.mjs";
|
|
3
3
|
import { n as at, t as O } from "./objectSpread2-CWwMYL_U.mjs";
|
|
4
4
|
import { n as k, t as ot } from "./tw-CqxBf-1Y.mjs";
|
|
5
5
|
import { r as st, t as ct } from "./lightweight-i18n-Cvv8CWh4.mjs";
|
|
@@ -1520,11 +1520,11 @@ var z, Er = [], Dr = () => {
|
|
|
1520
1520
|
constructor(e, t) {
|
|
1521
1521
|
this.left = e, this.right = t;
|
|
1522
1522
|
}
|
|
1523
|
-
},
|
|
1524
|
-
let r =
|
|
1525
|
-
for (let t = 0; t < r; t++) i +=
|
|
1523
|
+
}, B = (e, t) => new Nr(e, t), Pr = (e) => e.next() >= .5, Fr = (e, t, n) => un(e.next() * (n + 1 - t) + t), Ir = (e, t, n) => un(e.next() * (n + 1 - t) + t), Lr = (e, t, n) => Ir(e, t, n), Rr = (e) => vn(Lr(e, 97, 122)), zr = (e, t = 0, n = 20) => {
|
|
1524
|
+
let r = Lr(e, t, n), i = "";
|
|
1525
|
+
for (let t = 0; t < r; t++) i += Rr(e);
|
|
1526
1526
|
return i;
|
|
1527
|
-
},
|
|
1527
|
+
}, Br = (e, t) => t[Lr(e, 0, t.length - 1)], Vr, Hr = Symbol("0schema"), Ur = class {
|
|
1528
1528
|
constructor() {
|
|
1529
1529
|
this._rerrs = [];
|
|
1530
1530
|
}
|
|
@@ -1545,20 +1545,20 @@ var z, Er = [], Dr = () => {
|
|
|
1545
1545
|
}
|
|
1546
1546
|
return e.join("\n");
|
|
1547
1547
|
}
|
|
1548
|
-
},
|
|
1549
|
-
|
|
1550
|
-
var
|
|
1548
|
+
}, Wr = (e, t) => e === t ? !0 : e == null || t == null || e.constructor !== t.constructor ? !1 : e[lr] ? ur(e, t) : cn(e) ? an(e, (e) => on(t, (t) => Wr(e, t))) : dr(e) ? _r(e, (e, n) => Wr(e, t[n])) : !1;
|
|
1549
|
+
Vr = lr;
|
|
1550
|
+
var V = class {
|
|
1551
1551
|
extends(e) {
|
|
1552
1552
|
let [t, n] = [this.shape, e.shape];
|
|
1553
|
-
return this.constructor._dilutes && ([n, t] = [t, n]),
|
|
1553
|
+
return this.constructor._dilutes && ([n, t] = [t, n]), Wr(t, n);
|
|
1554
1554
|
}
|
|
1555
1555
|
equals(e) {
|
|
1556
1556
|
return this.constructor === e.constructor && Cr(this.shape, e.shape);
|
|
1557
1557
|
}
|
|
1558
|
-
[
|
|
1558
|
+
[Hr]() {
|
|
1559
1559
|
return !0;
|
|
1560
1560
|
}
|
|
1561
|
-
[
|
|
1561
|
+
[Vr](e) {
|
|
1562
1562
|
return this.equals(e);
|
|
1563
1563
|
}
|
|
1564
1564
|
validate(e) {
|
|
@@ -1570,20 +1570,20 @@ var B = class {
|
|
|
1570
1570
|
}
|
|
1571
1571
|
/* c8 ignore stop */
|
|
1572
1572
|
get nullable() {
|
|
1573
|
-
return
|
|
1573
|
+
return xi(this, Ii);
|
|
1574
1574
|
}
|
|
1575
1575
|
get optional() {
|
|
1576
|
-
return new
|
|
1576
|
+
return new $r(this);
|
|
1577
1577
|
}
|
|
1578
1578
|
cast(e) {
|
|
1579
|
-
return
|
|
1579
|
+
return Bi(e, this), e;
|
|
1580
1580
|
}
|
|
1581
1581
|
expect(e) {
|
|
1582
|
-
return
|
|
1582
|
+
return Bi(e, this), e;
|
|
1583
1583
|
}
|
|
1584
1584
|
};
|
|
1585
|
-
at(
|
|
1586
|
-
var
|
|
1585
|
+
at(V, "_dilutes", !1);
|
|
1586
|
+
var Gr = class extends V {
|
|
1587
1587
|
constructor(e, t) {
|
|
1588
1588
|
super(), this.shape = e, this._c = t;
|
|
1589
1589
|
}
|
|
@@ -1591,9 +1591,9 @@ var Kr = class extends B {
|
|
|
1591
1591
|
let n = (e == null ? void 0 : e.constructor) === this.shape && (this._c == null || this._c(e));
|
|
1592
1592
|
return !n && (t == null || t.extend(null, this.shape.name, e == null ? void 0 : e.constructor.name, (e == null ? void 0 : e.constructor) === this.shape ? "Check failed" : "Constructor match failed")), n;
|
|
1593
1593
|
}
|
|
1594
|
-
},
|
|
1595
|
-
|
|
1596
|
-
var
|
|
1594
|
+
}, H = (e, t = null) => new Gr(e, t);
|
|
1595
|
+
H(Gr);
|
|
1596
|
+
var Kr = class extends V {
|
|
1597
1597
|
constructor(e) {
|
|
1598
1598
|
super(), this.shape = e;
|
|
1599
1599
|
}
|
|
@@ -1601,9 +1601,9 @@ var qr = class extends B {
|
|
|
1601
1601
|
let n = this.shape(e);
|
|
1602
1602
|
return !n && (t == null || t.extend(null, "custom prop", e == null ? void 0 : e.constructor.name, "failed to check custom prop")), n;
|
|
1603
1603
|
}
|
|
1604
|
-
},
|
|
1605
|
-
|
|
1606
|
-
var
|
|
1604
|
+
}, U = (e) => new Kr(e);
|
|
1605
|
+
H(Kr);
|
|
1606
|
+
var qr = class extends V {
|
|
1607
1607
|
constructor(e) {
|
|
1608
1608
|
super(), this.shape = e;
|
|
1609
1609
|
}
|
|
@@ -1611,25 +1611,25 @@ var Jr = class extends B {
|
|
|
1611
1611
|
let n = this.shape.some((t) => t === e);
|
|
1612
1612
|
return !n && (t == null || t.extend(null, this.shape.join(" | "), e.toString())), n;
|
|
1613
1613
|
}
|
|
1614
|
-
},
|
|
1615
|
-
if (
|
|
1616
|
-
if (
|
|
1617
|
-
if (
|
|
1618
|
-
if (
|
|
1619
|
-
if (
|
|
1614
|
+
}, Jr = (...e) => new qr(e), Yr = H(qr), Xr = RegExp.escape || ((e) => e.replace(/[().|&,$^[\]]/g, (e) => "\\" + e)), Zr = (e) => {
|
|
1615
|
+
if (ji.check(e)) return [Xr(e)];
|
|
1616
|
+
if (Yr.check(e)) return e.shape.map((e) => e + "");
|
|
1617
|
+
if (Ai.check(e)) return ["[+-]?\\d+.?\\d*"];
|
|
1618
|
+
if (Mi.check(e)) return [".*"];
|
|
1619
|
+
if (Si.check(e)) return e.shape.map(Zr).flat(1);
|
|
1620
1620
|
/* c8 ignore next 2 */
|
|
1621
1621
|
R();
|
|
1622
1622
|
};
|
|
1623
|
-
|
|
1623
|
+
H(class extends V {
|
|
1624
1624
|
constructor(e) {
|
|
1625
|
-
super(), this.shape = e, this._r = RegExp("^" + e.map(
|
|
1625
|
+
super(), this.shape = e, this._r = RegExp("^" + e.map(Zr).map((e) => `(${e.join("|")})`).join("") + "$");
|
|
1626
1626
|
}
|
|
1627
1627
|
check(e, t) {
|
|
1628
1628
|
let n = this._r.exec(e) != null;
|
|
1629
1629
|
return !n && (t == null || t.extend(null, this._r.toString(), e.toString(), "String doesn't match string template.")), n;
|
|
1630
1630
|
}
|
|
1631
1631
|
});
|
|
1632
|
-
var
|
|
1632
|
+
var Qr = Symbol("optional"), $r = class extends V {
|
|
1633
1633
|
constructor(e) {
|
|
1634
1634
|
super(), this.shape = e;
|
|
1635
1635
|
}
|
|
@@ -1637,16 +1637,16 @@ var $r = Symbol("optional"), ei = class extends B {
|
|
|
1637
1637
|
let n = e === void 0 || this.shape.check(e);
|
|
1638
1638
|
return !n && (t == null || t.extend(null, "undefined (optional)", "()")), n;
|
|
1639
1639
|
}
|
|
1640
|
-
get [
|
|
1640
|
+
get [Qr]() {
|
|
1641
1641
|
return !0;
|
|
1642
1642
|
}
|
|
1643
|
-
},
|
|
1643
|
+
}, ei = H($r), ti = class extends V {
|
|
1644
1644
|
check(e, t) {
|
|
1645
1645
|
return t == null || t.extend(null, "never", typeof e), !1;
|
|
1646
1646
|
}
|
|
1647
1647
|
};
|
|
1648
|
-
new
|
|
1649
|
-
var
|
|
1648
|
+
new ti(), H(ti);
|
|
1649
|
+
var ni = class e extends V {
|
|
1650
1650
|
constructor(e, t = !1) {
|
|
1651
1651
|
super(), this.shape = e, this._isPartial = t;
|
|
1652
1652
|
}
|
|
@@ -1660,8 +1660,8 @@ var ri = class e extends B {
|
|
|
1660
1660
|
});
|
|
1661
1661
|
}
|
|
1662
1662
|
};
|
|
1663
|
-
at(
|
|
1664
|
-
var
|
|
1663
|
+
at(ni, "_dilutes", !0);
|
|
1664
|
+
var ri = (e) => new ni(e), ii = H(ni), ai = U((e) => e != null && (e.constructor === Object || e.constructor == null)), oi = class extends V {
|
|
1665
1665
|
constructor(e, t) {
|
|
1666
1666
|
super(), this.shape = {
|
|
1667
1667
|
keys: e,
|
|
@@ -1674,7 +1674,7 @@ var ii = (e) => new ri(e), ai = V(ri), oi = H((e) => e != null && (e.constructor
|
|
|
1674
1674
|
return !i && (t == null || t.extend(r + "", "Record", typeof e, i ? "Key doesn't match schema" : "Value doesn't match value")), i && this.shape.values.check(n, t);
|
|
1675
1675
|
});
|
|
1676
1676
|
}
|
|
1677
|
-
},
|
|
1677
|
+
}, si = (e, t) => new oi(e, t), ci = H(oi), li = class extends V {
|
|
1678
1678
|
constructor(e) {
|
|
1679
1679
|
super(), this.shape = e;
|
|
1680
1680
|
}
|
|
@@ -1684,17 +1684,17 @@ var ii = (e) => new ri(e), ai = V(ri), oi = H((e) => e != null && (e.constructor
|
|
|
1684
1684
|
return !i && (t == null || t.extend(r.toString(), "Tuple", typeof n)), i;
|
|
1685
1685
|
});
|
|
1686
1686
|
}
|
|
1687
|
-
},
|
|
1688
|
-
|
|
1689
|
-
var
|
|
1687
|
+
}, ui = (...e) => new li(e);
|
|
1688
|
+
H(li);
|
|
1689
|
+
var di = class extends V {
|
|
1690
1690
|
constructor(e) {
|
|
1691
|
-
super(), this.shape = e.length === 1 ? e[0] : new
|
|
1691
|
+
super(), this.shape = e.length === 1 ? e[0] : new bi(e);
|
|
1692
1692
|
}
|
|
1693
1693
|
check(e, t) {
|
|
1694
1694
|
let n = cn(e) && an(e, (e) => this.shape.check(e));
|
|
1695
1695
|
return !n && (t == null || t.extend(null, "Array", "")), n;
|
|
1696
1696
|
}
|
|
1697
|
-
},
|
|
1697
|
+
}, fi = (...e) => new di(e), pi = H(di), mi = U((e) => cn(e)), hi = class extends V {
|
|
1698
1698
|
constructor(e, t) {
|
|
1699
1699
|
super(), this.shape = e, this._c = t;
|
|
1700
1700
|
}
|
|
@@ -1702,18 +1702,18 @@ var fi = class extends B {
|
|
|
1702
1702
|
let n = e instanceof this.shape && (this._c == null || this._c(e));
|
|
1703
1703
|
return !n && (t == null || t.extend(null, this.shape.name, e == null ? void 0 : e.constructor.name)), n;
|
|
1704
1704
|
}
|
|
1705
|
-
},
|
|
1706
|
-
|
|
1707
|
-
var
|
|
1705
|
+
}, gi = (e, t = null) => new hi(e, t);
|
|
1706
|
+
H(hi);
|
|
1707
|
+
var _i = gi(V), vi = H(class extends V {
|
|
1708
1708
|
constructor(e) {
|
|
1709
|
-
super(), this.len = e.length - 1, this.args =
|
|
1709
|
+
super(), this.len = e.length - 1, this.args = ui(...e.slice(-1)), this.res = e[this.len];
|
|
1710
1710
|
}
|
|
1711
1711
|
check(e, t) {
|
|
1712
1712
|
let n = e.constructor === Function && e.length <= this.len;
|
|
1713
1713
|
return !n && (t == null || t.extend(null, "function", typeof e)), n;
|
|
1714
1714
|
}
|
|
1715
|
-
}),
|
|
1716
|
-
|
|
1715
|
+
}), yi = U((e) => typeof e == "function");
|
|
1716
|
+
H(class extends V {
|
|
1717
1717
|
constructor(e) {
|
|
1718
1718
|
super(), this.shape = e;
|
|
1719
1719
|
}
|
|
@@ -1722,7 +1722,7 @@ V(class extends B {
|
|
|
1722
1722
|
return !n && (t == null || t.extend(null, "Intersectinon", typeof e)), n;
|
|
1723
1723
|
}
|
|
1724
1724
|
}, (e) => e.shape.length > 0);
|
|
1725
|
-
var
|
|
1725
|
+
var bi = class extends V {
|
|
1726
1726
|
constructor(e) {
|
|
1727
1727
|
super(), this.shape = e;
|
|
1728
1728
|
}
|
|
@@ -1731,44 +1731,44 @@ var xi = class extends B {
|
|
|
1731
1731
|
return t == null || t.extend(null, "Union", typeof e), n;
|
|
1732
1732
|
}
|
|
1733
1733
|
};
|
|
1734
|
-
at(
|
|
1735
|
-
var
|
|
1736
|
-
|
|
1737
|
-
var
|
|
1738
|
-
|
|
1739
|
-
var
|
|
1740
|
-
|
|
1741
|
-
var
|
|
1734
|
+
at(bi, "_dilutes", !0);
|
|
1735
|
+
var xi = (...e) => e.findIndex((e) => Si.check(e)) >= 0 ? xi(...e.map((e) => zi(e)).map((e) => Si.check(e) ? e.shape : [e]).flat(1)) : e.length === 1 ? e[0] : new bi(e), Si = H(bi), Ci = () => !0, wi = U(Ci), Ti = H(Kr, (e) => e.shape === Ci), Ei = U((e) => typeof e == "bigint"), Di = U((e) => e === Ei), Oi = U((e) => typeof e == "symbol");
|
|
1736
|
+
U((e) => e === Oi);
|
|
1737
|
+
var ki = U((e) => typeof e == "number"), Ai = U((e) => e === ki), ji = U((e) => typeof e == "string"), Mi = U((e) => e === ji), Ni = U((e) => typeof e == "boolean"), Pi = U((e) => e === Ni), Fi = Jr(void 0);
|
|
1738
|
+
H(qr, (e) => e.shape.length === 1 && e.shape[0] === void 0), Jr(void 0);
|
|
1739
|
+
var Ii = Jr(null), Li = H(qr, (e) => e.shape.length === 1 && e.shape[0] === null);
|
|
1740
|
+
H(Uint8Array), H(Gr, (e) => e.shape === Uint8Array);
|
|
1741
|
+
var Ri = xi(ki, ji, Ii, Fi, Ei, Ni, Oi);
|
|
1742
1742
|
(() => {
|
|
1743
|
-
let e =
|
|
1743
|
+
let e = fi(wi), t = si(ji, wi), n = xi(ki, ji, Ii, Ni, e, t);
|
|
1744
1744
|
return e.shape = n, t.shape.values = n, n;
|
|
1745
1745
|
})();
|
|
1746
|
-
var
|
|
1747
|
-
if (
|
|
1748
|
-
if (
|
|
1746
|
+
var zi = (e) => {
|
|
1747
|
+
if (_i.check(e)) return e;
|
|
1748
|
+
if (ai.check(e)) {
|
|
1749
1749
|
let t = {};
|
|
1750
|
-
for (let n in e) t[n] =
|
|
1751
|
-
return
|
|
1752
|
-
} else if (
|
|
1753
|
-
else if (
|
|
1754
|
-
else if (
|
|
1750
|
+
for (let n in e) t[n] = zi(e[n]);
|
|
1751
|
+
return ri(t);
|
|
1752
|
+
} else if (mi.check(e)) return xi(...e.map(zi));
|
|
1753
|
+
else if (Ri.check(e)) return Jr(e);
|
|
1754
|
+
else if (yi.check(e)) return H(e);
|
|
1755
1755
|
/* c8 ignore next */
|
|
1756
1756
|
R();
|
|
1757
|
-
},
|
|
1758
|
-
let n = new
|
|
1757
|
+
}, Bi = jr ? () => {} : (e, t) => {
|
|
1758
|
+
let n = new Ur();
|
|
1759
1759
|
if (!t.check(e, n)) throw $n(`Expected value to be of type ${t.constructor.name}.\n${n.toString()}`);
|
|
1760
|
-
},
|
|
1760
|
+
}, Vi = class {
|
|
1761
1761
|
constructor(e) {
|
|
1762
1762
|
this.patterns = [], this.$state = e;
|
|
1763
1763
|
}
|
|
1764
1764
|
if(e, t) {
|
|
1765
1765
|
return this.patterns.push({
|
|
1766
|
-
if:
|
|
1766
|
+
if: zi(e),
|
|
1767
1767
|
h: t
|
|
1768
1768
|
}), this;
|
|
1769
1769
|
}
|
|
1770
1770
|
else(e) {
|
|
1771
|
-
return this.if(
|
|
1771
|
+
return this.if(wi, e);
|
|
1772
1772
|
}
|
|
1773
1773
|
done() {
|
|
1774
1774
|
return (e, t) => {
|
|
@@ -1779,52 +1779,52 @@ var Bi = (e) => {
|
|
|
1779
1779
|
throw $n("Unhandled pattern");
|
|
1780
1780
|
};
|
|
1781
1781
|
}
|
|
1782
|
-
},
|
|
1782
|
+
}, Hi = ((e) => new Vi(e))(wi).if(Ai, (e, t) => Fr(t, gn, hn)).if(Mi, (e, t) => zr(t)).if(Pi, (e, t) => Pr(t)).if(Di, (e, t) => BigInt(Fr(t, gn, hn))).if(Si, (e, t) => Ui(t, Br(t, e.shape))).if(ii, (e, t) => {
|
|
1783
1783
|
let n = {};
|
|
1784
1784
|
for (let r in e.shape) {
|
|
1785
1785
|
let i = e.shape[r];
|
|
1786
|
-
if (
|
|
1787
|
-
if (
|
|
1786
|
+
if (ei.check(i)) {
|
|
1787
|
+
if (Pr(t)) continue;
|
|
1788
1788
|
i = i.shape;
|
|
1789
1789
|
}
|
|
1790
|
-
n[r] =
|
|
1790
|
+
n[r] = Hi(i, t);
|
|
1791
1791
|
}
|
|
1792
1792
|
return n;
|
|
1793
|
-
}).if(
|
|
1794
|
-
let n = [], r =
|
|
1795
|
-
for (let i = 0; i < r; i++) n.push(
|
|
1793
|
+
}).if(pi, (e, t) => {
|
|
1794
|
+
let n = [], r = Ir(t, 0, 42);
|
|
1795
|
+
for (let i = 0; i < r; i++) n.push(Ui(t, e.shape));
|
|
1796
1796
|
return n;
|
|
1797
|
-
}).if(
|
|
1798
|
-
let n =
|
|
1797
|
+
}).if(Yr, (e, t) => Br(t, e.shape)).if(Li, (e, t) => null).if(vi, (e, t) => {
|
|
1798
|
+
let n = Ui(t, e.res);
|
|
1799
1799
|
return () => n;
|
|
1800
|
-
}).if(
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
Li,
|
|
1800
|
+
}).if(Ti, (e, t) => Ui(t, Br(t, [
|
|
1801
|
+
ki,
|
|
1802
|
+
ji,
|
|
1804
1803
|
Ii,
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1804
|
+
Fi,
|
|
1805
|
+
Ei,
|
|
1806
|
+
Ni,
|
|
1807
|
+
fi(ki),
|
|
1808
|
+
si(xi("a", "b", "c"), ki)
|
|
1809
|
+
]))).if(ci, (e, t) => {
|
|
1810
|
+
let n = {}, r = Fr(t, 0, 3);
|
|
1811
1811
|
for (let i = 0; i < r; i++) {
|
|
1812
|
-
let r =
|
|
1813
|
-
n[r] =
|
|
1812
|
+
let r = Ui(t, e.shape.keys);
|
|
1813
|
+
n[r] = Ui(t, e.shape.values);
|
|
1814
1814
|
}
|
|
1815
1815
|
return n;
|
|
1816
|
-
}).done(),
|
|
1817
|
-
|
|
1818
|
-
var
|
|
1819
|
-
|
|
1820
|
-
var
|
|
1821
|
-
|
|
1822
|
-
var
|
|
1823
|
-
|
|
1816
|
+
}).done(), Ui = (e, t) => Hi(zi(t), e), Wi = typeof document < "u" ? document : {};
|
|
1817
|
+
U((e) => e.nodeType === Yi), typeof DOMParser < "u" && new DOMParser(), U((e) => e.nodeType === Ki), U((e) => e.nodeType === qi);
|
|
1818
|
+
var Gi = (e) => Qt(e, (e, t) => `${t}:${e};`).join(""), Ki = Wi.ELEMENT_NODE, qi = Wi.TEXT_NODE;
|
|
1819
|
+
Wi.CDATA_SECTION_NODE, Wi.COMMENT_NODE;
|
|
1820
|
+
var Ji = Wi.DOCUMENT_NODE;
|
|
1821
|
+
Wi.DOCUMENT_TYPE_NODE;
|
|
1822
|
+
var Yi = Wi.DOCUMENT_FRAGMENT_NODE;
|
|
1823
|
+
U((e) => e.nodeType === Ji);
|
|
1824
1824
|
/* c8 ignore stop */
|
|
1825
1825
|
//#endregion
|
|
1826
1826
|
//#region node_modules/lib0/symbol.js
|
|
1827
|
-
var
|
|
1827
|
+
var Xi = Symbol, Zi = Xi(), Qi = Xi(), $i = Xi(), ea = Xi(), ta = Xi(), na = Xi(), ra = Xi(), ia = Xi(), aa = Xi(), oa = (e) => {
|
|
1828
1828
|
var t;
|
|
1829
1829
|
e.length === 1 && ((t = e[0]) == null ? void 0 : t.constructor) === Function && (e = e[0]());
|
|
1830
1830
|
let n = [], r = [], i = 0;
|
|
@@ -1844,27 +1844,27 @@ ir();
|
|
|
1844
1844
|
/* c8 ignore stop */
|
|
1845
1845
|
//#endregion
|
|
1846
1846
|
//#region node_modules/lib0/logging.js
|
|
1847
|
-
var
|
|
1848
|
-
[
|
|
1849
|
-
[
|
|
1850
|
-
[
|
|
1851
|
-
[
|
|
1852
|
-
[
|
|
1853
|
-
[
|
|
1854
|
-
[
|
|
1855
|
-
[
|
|
1856
|
-
[
|
|
1857
|
-
},
|
|
1847
|
+
var sa = {
|
|
1848
|
+
[Zi]: B("font-weight", "bold"),
|
|
1849
|
+
[Qi]: B("font-weight", "normal"),
|
|
1850
|
+
[$i]: B("color", "blue"),
|
|
1851
|
+
[ta]: B("color", "green"),
|
|
1852
|
+
[ea]: B("color", "grey"),
|
|
1853
|
+
[na]: B("color", "red"),
|
|
1854
|
+
[ra]: B("color", "purple"),
|
|
1855
|
+
[ia]: B("color", "orange"),
|
|
1856
|
+
[aa]: B("color", "black")
|
|
1857
|
+
}, ca = Mr ? (e) => {
|
|
1858
1858
|
var t;
|
|
1859
1859
|
e.length === 1 && ((t = e[0]) == null ? void 0 : t.constructor) === Function && (e = e[0]());
|
|
1860
1860
|
let n = [], r = [], i = N(), a = [], o = 0;
|
|
1861
1861
|
for (; o < e.length; o++) {
|
|
1862
|
-
let t = e[o], a =
|
|
1862
|
+
let t = e[o], a = sa[t];
|
|
1863
1863
|
if (a !== void 0) i.set(a.left, a.right);
|
|
1864
1864
|
else {
|
|
1865
1865
|
if (t === void 0) break;
|
|
1866
1866
|
if (t.constructor === String || t.constructor === Number) {
|
|
1867
|
-
let e =
|
|
1867
|
+
let e = Gi(i);
|
|
1868
1868
|
o > 0 || e.length > 0 ? (n.push("%c" + t), r.push(e)) : n.push(t);
|
|
1869
1869
|
} else break;
|
|
1870
1870
|
}
|
|
@@ -1874,43 +1874,43 @@ var ca = {
|
|
|
1874
1874
|
t instanceof Symbol || a.push(t);
|
|
1875
1875
|
}
|
|
1876
1876
|
return a;
|
|
1877
|
-
} :
|
|
1877
|
+
} : oa, la = (...e) => {
|
|
1878
1878
|
/* c8 ignore next */
|
|
1879
|
-
console.log(...
|
|
1880
|
-
},
|
|
1881
|
-
console.warn(...
|
|
1882
|
-
},
|
|
1879
|
+
console.log(...ca(e)), da.forEach((t) => t.print(e));
|
|
1880
|
+
}, ua = (...e) => {
|
|
1881
|
+
console.warn(...ca(e)), e.unshift(ia), da.forEach((t) => t.print(e));
|
|
1882
|
+
}, da = en(), fa = (e) => ({
|
|
1883
1883
|
[Symbol.iterator]() {
|
|
1884
1884
|
return this;
|
|
1885
1885
|
},
|
|
1886
1886
|
next: e
|
|
1887
|
-
}),
|
|
1887
|
+
}), pa = (e, t) => fa(() => {
|
|
1888
1888
|
let n;
|
|
1889
1889
|
do
|
|
1890
1890
|
n = e.next();
|
|
1891
1891
|
while (!n.done && !t(n.value));
|
|
1892
1892
|
return n;
|
|
1893
|
-
}),
|
|
1893
|
+
}), ma = (e, t) => fa(() => {
|
|
1894
1894
|
let { done: n, value: r } = e.next();
|
|
1895
1895
|
return {
|
|
1896
1896
|
done: n,
|
|
1897
1897
|
value: n ? void 0 : t(r)
|
|
1898
1898
|
};
|
|
1899
|
-
}),
|
|
1899
|
+
}), ha = class {
|
|
1900
1900
|
constructor(e, t) {
|
|
1901
1901
|
this.clock = e, this.len = t;
|
|
1902
1902
|
}
|
|
1903
|
-
},
|
|
1903
|
+
}, ga = class {
|
|
1904
1904
|
constructor() {
|
|
1905
1905
|
this.clients = /* @__PURE__ */ new Map();
|
|
1906
1906
|
}
|
|
1907
|
-
},
|
|
1907
|
+
}, _a = (e, t, n) => t.clients.forEach((t, r) => {
|
|
1908
1908
|
let i = e.doc.store.clients.get(r);
|
|
1909
1909
|
if (i != null) {
|
|
1910
1910
|
let r = i[i.length - 1], a = r.id.clock + r.length;
|
|
1911
1911
|
for (let r = 0, o = t[r]; r < t.length && o.clock < a; o = t[++r]) eo(e, i, o.clock, o.len, n);
|
|
1912
1912
|
}
|
|
1913
|
-
}),
|
|
1913
|
+
}), va = (e, t) => {
|
|
1914
1914
|
let n = 0, r = e.length - 1;
|
|
1915
1915
|
for (; n <= r;) {
|
|
1916
1916
|
let i = un((n + r) / 2), a = e[i], o = a.clock;
|
|
@@ -1920,21 +1920,21 @@ var ca = {
|
|
|
1920
1920
|
} else r = i - 1;
|
|
1921
1921
|
}
|
|
1922
1922
|
return null;
|
|
1923
|
-
},
|
|
1923
|
+
}, ya = (e, t) => {
|
|
1924
1924
|
let n = e.clients.get(t.client);
|
|
1925
|
-
return n !== void 0 &&
|
|
1926
|
-
},
|
|
1925
|
+
return n !== void 0 && va(n, t.clock) !== null;
|
|
1926
|
+
}, ba = (e) => {
|
|
1927
1927
|
e.clients.forEach((e) => {
|
|
1928
1928
|
e.sort((e, t) => e.clock - t.clock);
|
|
1929
1929
|
let t, n;
|
|
1930
1930
|
for (t = 1, n = 1; t < e.length; t++) {
|
|
1931
1931
|
let r = e[n - 1], i = e[t];
|
|
1932
|
-
r.clock + r.len >= i.clock ? e[n - 1] = new
|
|
1932
|
+
r.clock + r.len >= i.clock ? e[n - 1] = new ha(r.clock, pn(r.len, i.clock + i.len - r.clock)) : (n < t && (e[n] = i), n++);
|
|
1933
1933
|
}
|
|
1934
1934
|
e.length = n;
|
|
1935
1935
|
});
|
|
1936
|
-
},
|
|
1937
|
-
let t = new
|
|
1936
|
+
}, xa = (e) => {
|
|
1937
|
+
let t = new ga();
|
|
1938
1938
|
for (let n = 0; n < e.length; n++) e[n].clients.forEach((r, i) => {
|
|
1939
1939
|
if (!t.clients.has(i)) {
|
|
1940
1940
|
let a = r.slice();
|
|
@@ -1942,10 +1942,10 @@ var ca = {
|
|
|
1942
1942
|
t.clients.set(i, a);
|
|
1943
1943
|
}
|
|
1944
1944
|
});
|
|
1945
|
-
return
|
|
1946
|
-
},
|
|
1947
|
-
Zt(e.clients, t, () => []).push(new
|
|
1948
|
-
},
|
|
1945
|
+
return ba(t), t;
|
|
1946
|
+
}, Sa = (e, t, n, r) => {
|
|
1947
|
+
Zt(e.clients, t, () => []).push(new ha(n, r));
|
|
1948
|
+
}, Ca = () => new ga(), wa = (e, t) => {
|
|
1949
1949
|
F(e.restEncoder, t.clients.size), rn(t.clients.entries()).sort((e, t) => t[0] - e[0]).forEach(([t, n]) => {
|
|
1950
1950
|
e.resetDsCurVal(), F(e.restEncoder, t);
|
|
1951
1951
|
let r = n.length;
|
|
@@ -1955,9 +1955,9 @@ var ca = {
|
|
|
1955
1955
|
e.writeDsClock(r.clock), e.writeDsLen(r.len);
|
|
1956
1956
|
}
|
|
1957
1957
|
});
|
|
1958
|
-
},
|
|
1958
|
+
}, Ta = tr, Ea = class e extends ln {
|
|
1959
1959
|
constructor({ guid: e = rr(), collectionid: t = null, gc: n = !0, gcFilter: r = () => !0, meta: i = null, autoLoad: a = !1, shouldLoad: o = !0 } = {}) {
|
|
1960
|
-
super(), this.gc = n, this.gcFilter = r, this.clientID =
|
|
1960
|
+
super(), this.gc = n, this.gcFilter = r, this.clientID = Ta(), this.guid = e, this.collectionid = t, this.share = /* @__PURE__ */ new Map(), this.store = new Ka(), this._transaction = null, this._transactionCleanups = [], this.subdocs = /* @__PURE__ */ new Set(), this._item = null, this.shouldLoad = o, this.autoLoad = a, this.meta = i, this.isLoaded = !1, this.isSynced = !1, this.isDestroyed = !1, this.whenLoaded = ar((e) => {
|
|
1961
1961
|
this.on("load", () => {
|
|
1962
1962
|
this.isLoaded = !0, e(this);
|
|
1963
1963
|
});
|
|
@@ -2036,7 +2036,7 @@ var ca = {
|
|
|
2036
2036
|
}
|
|
2037
2037
|
this.emit("destroyed", [!0]), this.emit("destroy", [this]), super.destroy();
|
|
2038
2038
|
}
|
|
2039
|
-
},
|
|
2039
|
+
}, Da = class {
|
|
2040
2040
|
constructor() {
|
|
2041
2041
|
this.restEncoder = An();
|
|
2042
2042
|
}
|
|
@@ -2050,7 +2050,7 @@ var ca = {
|
|
|
2050
2050
|
writeDsLen(e) {
|
|
2051
2051
|
F(this.restEncoder, e);
|
|
2052
2052
|
}
|
|
2053
|
-
},
|
|
2053
|
+
}, Oa = class extends Da {
|
|
2054
2054
|
writeLeftID(e) {
|
|
2055
2055
|
F(this.restEncoder, e.client), F(this.restEncoder, e.clock);
|
|
2056
2056
|
}
|
|
@@ -2087,7 +2087,7 @@ var ca = {
|
|
|
2087
2087
|
writeKey(e) {
|
|
2088
2088
|
Rn(this.restEncoder, e);
|
|
2089
2089
|
}
|
|
2090
|
-
},
|
|
2090
|
+
}, ka = class {
|
|
2091
2091
|
constructor() {
|
|
2092
2092
|
this.restEncoder = An(), this.dsCurrVal = 0;
|
|
2093
2093
|
}
|
|
@@ -2104,7 +2104,7 @@ var ca = {
|
|
|
2104
2104
|
writeDsLen(e) {
|
|
2105
2105
|
e === 0 && R(), F(this.restEncoder, e - 1), this.dsCurrVal += e;
|
|
2106
2106
|
}
|
|
2107
|
-
},
|
|
2107
|
+
}, Aa = class extends ka {
|
|
2108
2108
|
constructor() {
|
|
2109
2109
|
super(), this.keyMap = /* @__PURE__ */ new Map(), this.keyClock = 0, this.keyClockEncoder = new Zn(), this.clientEncoder = new Yn(), this.leftClockEncoder = new Zn(), this.rightClockEncoder = new Zn(), this.infoEncoder = new qn(Pn), this.stringEncoder = new Qn(), this.parentInfoEncoder = new qn(Pn), this.typeRefEncoder = new Yn(), this.lenEncoder = new Yn();
|
|
2110
2110
|
}
|
|
@@ -2149,69 +2149,69 @@ var ca = {
|
|
|
2149
2149
|
let t = this.keyMap.get(e);
|
|
2150
2150
|
t === void 0 ? (this.keyClockEncoder.write(this.keyClock++), this.stringEncoder.write(e)) : this.keyClockEncoder.write(t);
|
|
2151
2151
|
}
|
|
2152
|
-
},
|
|
2152
|
+
}, ja = (e, t, n, r) => {
|
|
2153
2153
|
r = pn(r, t[0].id.clock);
|
|
2154
|
-
let i =
|
|
2154
|
+
let i = Ya(t, r);
|
|
2155
2155
|
F(e.restEncoder, t.length - i), e.writeClient(n), F(e.restEncoder, r);
|
|
2156
2156
|
let a = t[i];
|
|
2157
2157
|
a.write(e, r - a.id.clock);
|
|
2158
2158
|
for (let n = i + 1; n < t.length; n++) t[n].write(e, 0);
|
|
2159
|
-
},
|
|
2159
|
+
}, Ma = (e, t, n) => {
|
|
2160
2160
|
let r = /* @__PURE__ */ new Map();
|
|
2161
2161
|
n.forEach((e, n) => {
|
|
2162
|
-
|
|
2163
|
-
}),
|
|
2162
|
+
G(t, n) > e && r.set(n, e);
|
|
2163
|
+
}), qa(t).forEach((e, t) => {
|
|
2164
2164
|
n.has(t) || r.set(t, 0);
|
|
2165
2165
|
}), F(e.restEncoder, r.size), rn(r.entries()).sort((e, t) => t[0] - e[0]).forEach(([n, r]) => {
|
|
2166
|
-
|
|
2166
|
+
ja(e, t.clients.get(n), n, r);
|
|
2167
2167
|
});
|
|
2168
|
-
},
|
|
2168
|
+
}, Na = (e, t) => Ma(e, t.doc.store, t.beforeState), Pa = class {
|
|
2169
2169
|
constructor() {
|
|
2170
2170
|
this.l = [];
|
|
2171
2171
|
}
|
|
2172
|
-
},
|
|
2172
|
+
}, Fa = () => new Pa(), Ia = (e, t) => e.l.push(t), La = (e, t) => {
|
|
2173
2173
|
let n = e.l, r = n.length;
|
|
2174
2174
|
e.l = n.filter((e) => t !== e), r === e.l.length && console.error("[yjs] Tried to remove event handler that doesn't exist.");
|
|
2175
|
-
},
|
|
2175
|
+
}, Ra = (e, t, n) => Sr(e.l, [t, n]), za = class {
|
|
2176
2176
|
constructor(e, t) {
|
|
2177
2177
|
this.client = e, this.clock = t;
|
|
2178
2178
|
}
|
|
2179
|
-
},
|
|
2179
|
+
}, Ba = (e, t) => e === t || e !== null && t !== null && e.client === t.client && e.clock === t.clock, W = (e, t) => new za(e, t), Va = (e) => {
|
|
2180
2180
|
for (let [t, n] of e.doc.share.entries()) if (n === e) return t;
|
|
2181
2181
|
throw R();
|
|
2182
|
-
},
|
|
2182
|
+
}, Ha = (e, t) => {
|
|
2183
2183
|
for (; t !== null;) {
|
|
2184
2184
|
if (t.parent === e) return !0;
|
|
2185
2185
|
t = t.parent._item;
|
|
2186
2186
|
}
|
|
2187
2187
|
return !1;
|
|
2188
|
-
},
|
|
2188
|
+
}, Ua = class {
|
|
2189
2189
|
constructor(e, t) {
|
|
2190
2190
|
this.ds = e, this.sv = t;
|
|
2191
2191
|
}
|
|
2192
2192
|
};
|
|
2193
|
-
((e, t) => new
|
|
2194
|
-
var
|
|
2195
|
-
let n = Zt(e.meta,
|
|
2193
|
+
((e, t) => new Ua(e, t))(Ca(), /* @__PURE__ */ new Map());
|
|
2194
|
+
var Wa = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.get(e.id.client) || 0) > e.id.clock && !ya(t.ds, e.id), Ga = (e, t) => {
|
|
2195
|
+
let n = Zt(e.meta, Ga, en), r = e.doc.store;
|
|
2196
2196
|
n.has(t) || (t.sv.forEach((t, n) => {
|
|
2197
|
-
t <
|
|
2198
|
-
}),
|
|
2199
|
-
},
|
|
2197
|
+
t < G(r, n) && K(e, W(n, t));
|
|
2198
|
+
}), _a(e, t.ds, (e) => {}), n.add(t));
|
|
2199
|
+
}, Ka = class {
|
|
2200
2200
|
constructor() {
|
|
2201
2201
|
this.clients = /* @__PURE__ */ new Map(), this.pendingStructs = null, this.pendingDs = null;
|
|
2202
2202
|
}
|
|
2203
|
-
},
|
|
2203
|
+
}, qa = (e) => {
|
|
2204
2204
|
let t = /* @__PURE__ */ new Map();
|
|
2205
2205
|
return e.clients.forEach((e, n) => {
|
|
2206
2206
|
let r = e[e.length - 1];
|
|
2207
2207
|
t.set(n, r.id.clock + r.length);
|
|
2208
2208
|
}), t;
|
|
2209
|
-
},
|
|
2209
|
+
}, G = (e, t) => {
|
|
2210
2210
|
let n = e.clients.get(t);
|
|
2211
2211
|
if (n === void 0) return 0;
|
|
2212
2212
|
let r = n[n.length - 1];
|
|
2213
2213
|
return r.id.clock + r.length;
|
|
2214
|
-
},
|
|
2214
|
+
}, Ja = (e, t) => {
|
|
2215
2215
|
let n = e.clients.get(t.id.client);
|
|
2216
2216
|
if (n === void 0) n = [], e.clients.set(t.id.client, n);
|
|
2217
2217
|
else {
|
|
@@ -2219,7 +2219,7 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
2219
2219
|
if (e.id.clock + e.length !== t.id.clock) throw R();
|
|
2220
2220
|
}
|
|
2221
2221
|
n.push(t);
|
|
2222
|
-
},
|
|
2222
|
+
}, Ya = (e, t) => {
|
|
2223
2223
|
let n = 0, r = e.length - 1, i = e[r], a = i.id.clock;
|
|
2224
2224
|
if (a === t) return r;
|
|
2225
2225
|
let o = un(t / (a + i.length - 1) * r);
|
|
@@ -2233,19 +2233,19 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
2233
2233
|
throw R();
|
|
2234
2234
|
}, Xa = (e, t) => {
|
|
2235
2235
|
let n = e.clients.get(t.client);
|
|
2236
|
-
return n[
|
|
2236
|
+
return n[Ya(n, t.clock)];
|
|
2237
2237
|
}, Za = (e, t, n) => {
|
|
2238
|
-
let r =
|
|
2238
|
+
let r = Ya(t, n), i = t[r];
|
|
2239
2239
|
return i.id.clock < n && i instanceof Q ? (t.splice(r + 1, 0, Ms(e, i, n - i.id.clock)), r + 1) : r;
|
|
2240
2240
|
}, K = (e, t) => {
|
|
2241
2241
|
let n = e.doc.store.clients.get(t.client);
|
|
2242
2242
|
return n[Za(e, n, t.clock)];
|
|
2243
2243
|
}, Qa = (e, t, n) => {
|
|
2244
|
-
let r = t.clients.get(n.client), i =
|
|
2244
|
+
let r = t.clients.get(n.client), i = Ya(r, n.clock), a = r[i];
|
|
2245
2245
|
return n.clock !== a.id.clock + a.length - 1 && a.constructor !== hs && r.splice(i + 1, 0, Ms(e, a, n.clock - a.id.clock + 1)), a;
|
|
2246
2246
|
}, $a = (e, t, n) => {
|
|
2247
2247
|
let r = e.clients.get(t.id.client);
|
|
2248
|
-
r[
|
|
2248
|
+
r[Ya(r, t.id.clock)] = n;
|
|
2249
2249
|
}, eo = (e, t, n, r, i) => {
|
|
2250
2250
|
if (r === 0) return;
|
|
2251
2251
|
let a = n + r, o = Za(e, t, n), s;
|
|
@@ -2254,9 +2254,9 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
2254
2254
|
while (o < t.length && t[o].id.clock < a);
|
|
2255
2255
|
}, to = class {
|
|
2256
2256
|
constructor(e, t, n) {
|
|
2257
|
-
this.doc = e, this.deleteSet = new
|
|
2257
|
+
this.doc = e, this.deleteSet = new ga(), this.beforeState = qa(e.store), this.afterState = /* @__PURE__ */ new Map(), this.changed = /* @__PURE__ */ new Map(), this.changedParentTypes = /* @__PURE__ */ new Map(), this._mergeStructs = [], this.origin = t, this.meta = /* @__PURE__ */ new Map(), this.local = n, this.subdocsAdded = /* @__PURE__ */ new Set(), this.subdocsRemoved = /* @__PURE__ */ new Set(), this.subdocsLoaded = /* @__PURE__ */ new Set(), this._needFormattingCleanup = !1;
|
|
2258
2258
|
}
|
|
2259
|
-
}, no = (e, t) => t.deleteSet.clients.size === 0 && !$t(t.afterState, (e, n) => t.beforeState.get(n) !== e) ? !1 : (
|
|
2259
|
+
}, no = (e, t) => t.deleteSet.clients.size === 0 && !$t(t.afterState, (e, n) => t.beforeState.get(n) !== e) ? !1 : (ba(t.deleteSet), Na(e, t), wa(e, t.deleteSet), !0), ro = (e, t, n) => {
|
|
2260
2260
|
let r = t._item;
|
|
2261
2261
|
(r === null || r.id.clock < (e.beforeState.get(r.id.client) || 0) && !r.deleted) && Zt(e.changed, t, en).add(n);
|
|
2262
2262
|
}, io = (e, t) => {
|
|
@@ -2275,7 +2275,7 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
2275
2275
|
let e = t.clients.get(r);
|
|
2276
2276
|
for (let r = i.length - 1; r >= 0; r--) {
|
|
2277
2277
|
let a = i[r], o = a.clock + a.len;
|
|
2278
|
-
for (let r =
|
|
2278
|
+
for (let r = Ya(e, a.clock), i = e[r]; r < e.length && i.id.clock < o; i = e[++r]) {
|
|
2279
2279
|
let i = e[r];
|
|
2280
2280
|
if (a.clock + a.len <= i.id.clock) break;
|
|
2281
2281
|
i instanceof Q && i.deleted && !i.keep && n(i) && i.gc(t, !1);
|
|
@@ -2286,7 +2286,7 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
2286
2286
|
e.clients.forEach((e, n) => {
|
|
2287
2287
|
let r = t.clients.get(n);
|
|
2288
2288
|
for (let t = e.length - 1; t >= 0; t--) {
|
|
2289
|
-
let n = e[t], i = fn(r.length - 1, 1 +
|
|
2289
|
+
let n = e[t], i = fn(r.length - 1, 1 + Ya(r, n.clock + n.len - 1));
|
|
2290
2290
|
for (let e = i, t = r[e]; e > 0 && t.id.clock >= n.clock; t = r[e]) e -= 1 + io(r, e);
|
|
2291
2291
|
}
|
|
2292
2292
|
});
|
|
@@ -2294,7 +2294,7 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
2294
2294
|
if (t < e.length) {
|
|
2295
2295
|
let n = e[t], r = n.doc, i = r.store, a = n.deleteSet, o = n._mergeStructs;
|
|
2296
2296
|
try {
|
|
2297
|
-
|
|
2297
|
+
ba(a), n.afterState = qa(n.doc.store), r.emit("beforeObserverCalls", [n, r]);
|
|
2298
2298
|
let e = [];
|
|
2299
2299
|
n.changed.forEach((t, r) => e.push(() => {
|
|
2300
2300
|
(r._item === null || !r._item.deleted) && r._callObserver(n, t);
|
|
@@ -2303,7 +2303,7 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
2303
2303
|
r._dEH.l.length > 0 && (r._item === null || !r._item.deleted) && (t = t.filter((e) => e.target._item === null || !e.target._item.deleted), t.forEach((e) => {
|
|
2304
2304
|
e.currentTarget = r, e._path = null;
|
|
2305
2305
|
}), t.sort((e, t) => e.path.length - t.path.length), e.push(() => {
|
|
2306
|
-
|
|
2306
|
+
Ra(r._dEH, t, n);
|
|
2307
2307
|
}));
|
|
2308
2308
|
}), e.push(() => r.emit("afterTransaction", [n, r])), e.push(() => {
|
|
2309
2309
|
n._needFormattingCleanup && as(n);
|
|
@@ -2313,16 +2313,16 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
2313
2313
|
r.gc && ao(a, i, r.gcFilter), oo(a, i), n.afterState.forEach((e, t) => {
|
|
2314
2314
|
let r = n.beforeState.get(t) || 0;
|
|
2315
2315
|
if (r !== e) {
|
|
2316
|
-
let e = i.clients.get(t), n = pn(
|
|
2316
|
+
let e = i.clients.get(t), n = pn(Ya(e, r), 1);
|
|
2317
2317
|
for (let t = e.length - 1; t >= n;) t -= 1 + io(e, t);
|
|
2318
2318
|
}
|
|
2319
2319
|
});
|
|
2320
2320
|
for (let e = o.length - 1; e >= 0; e--) {
|
|
2321
|
-
let { client: t, clock: n } = o[e].id, r = i.clients.get(t), a =
|
|
2321
|
+
let { client: t, clock: n } = o[e].id, r = i.clients.get(t), a = Ya(r, n);
|
|
2322
2322
|
a + 1 < r.length && io(r, a + 1) > 1 || a > 0 && io(r, a);
|
|
2323
2323
|
}
|
|
2324
|
-
if (!n.local && n.afterState.get(r.clientID) !== n.beforeState.get(r.clientID) && (
|
|
2325
|
-
let e = new
|
|
2324
|
+
if (!n.local && n.afterState.get(r.clientID) !== n.beforeState.get(r.clientID) && (la(ia, Zi, "[yjs] ", Qi, na, "Changed the client-id because another client seems to be using it."), r.clientID = Ta()), r.emit("afterTransactionCleanup", [n, r]), r._observers.has("update")) {
|
|
2325
|
+
let e = new Oa();
|
|
2326
2326
|
no(e, n) && r.emit("update", [
|
|
2327
2327
|
e.toUint8Array(),
|
|
2328
2328
|
n.origin,
|
|
@@ -2331,7 +2331,7 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
2331
2331
|
]);
|
|
2332
2332
|
}
|
|
2333
2333
|
if (r._observers.has("updateV2")) {
|
|
2334
|
-
let e = new
|
|
2334
|
+
let e = new Aa();
|
|
2335
2335
|
no(e, n) && r.emit("updateV2", [
|
|
2336
2336
|
e.toUint8Array(),
|
|
2337
2337
|
n.origin,
|
|
@@ -2370,24 +2370,24 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
2370
2370
|
this.insertions = t, this.deletions = e, this.meta = /* @__PURE__ */ new Map();
|
|
2371
2371
|
}
|
|
2372
2372
|
}, lo = (e, t, n) => {
|
|
2373
|
-
|
|
2374
|
-
n instanceof Q && t.scope.some((t) => t === e.doc ||
|
|
2373
|
+
_a(e, n.deletions, (n) => {
|
|
2374
|
+
n instanceof Q && t.scope.some((t) => t === e.doc || Ha(t, n)) && js(n, !1);
|
|
2375
2375
|
});
|
|
2376
2376
|
}, uo = (e, t, n) => {
|
|
2377
2377
|
let r = null, i = e.doc, a = e.scope;
|
|
2378
2378
|
q(i, (n) => {
|
|
2379
2379
|
for (; t.length > 0 && e.currStackItem === null;) {
|
|
2380
2380
|
let r = i.store, o = t.pop(), s = /* @__PURE__ */ new Set(), c = [], l = !1;
|
|
2381
|
-
|
|
2381
|
+
_a(n, o.insertions, (e) => {
|
|
2382
2382
|
if (e instanceof Q) {
|
|
2383
2383
|
if (e.redone !== null) {
|
|
2384
2384
|
let { item: t, diff: i } = As(r, e.id);
|
|
2385
|
-
i > 0 && (t = K(n,
|
|
2385
|
+
i > 0 && (t = K(n, W(t.id.client, t.id.clock + i))), e = t;
|
|
2386
2386
|
}
|
|
2387
|
-
!e.deleted && a.some((t) => t === n.doc ||
|
|
2387
|
+
!e.deleted && a.some((t) => t === n.doc || Ha(t, e)) && c.push(e);
|
|
2388
2388
|
}
|
|
2389
|
-
}),
|
|
2390
|
-
e instanceof Q && a.some((t) => t === n.doc ||
|
|
2389
|
+
}), _a(n, o.deletions, (e) => {
|
|
2390
|
+
e instanceof Q && a.some((t) => t === n.doc || Ha(t, e)) && !ya(o.insertions, e.id) && s.add(e);
|
|
2391
2391
|
}), s.forEach((t) => {
|
|
2392
2392
|
l = Ps(n, t, s, o.insertions, e.ignoreRemoteMapChanges, e) !== null || l;
|
|
2393
2393
|
});
|
|
@@ -2413,23 +2413,23 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
2413
2413
|
}
|
|
2414
2414
|
return o;
|
|
2415
2415
|
}, fo = class extends ln {
|
|
2416
|
-
constructor(e, { captureTimeout: t = 500, captureTransaction: n = (e) => !0, deleteFilter: r = () => !0, trackedOrigins: i = new Set([null]), ignoreRemoteMapChanges: a = !1, doc: o = cn(e) ? e[0].doc : e instanceof
|
|
2416
|
+
constructor(e, { captureTimeout: t = 500, captureTransaction: n = (e) => !0, deleteFilter: r = () => !0, trackedOrigins: i = new Set([null]), ignoreRemoteMapChanges: a = !1, doc: o = cn(e) ? e[0].doc : e instanceof Ea ? e : e.doc } = {}) {
|
|
2417
2417
|
super(), this.scope = [], this.doc = o, this.addToScope(e), this.deleteFilter = r, i.add(this), this.trackedOrigins = i, this.captureTransaction = n, this.undoStack = [], this.redoStack = [], this.undoing = !1, this.redoing = !1, this.currStackItem = null, this.lastChange = 0, this.ignoreRemoteMapChanges = a, this.captureTimeout = t, this.afterTransactionHandler = (e) => {
|
|
2418
2418
|
if (!this.captureTransaction(e) || !this.scope.some((t) => e.changedParentTypes.has(t) || t === this.doc) || !this.trackedOrigins.has(e.origin) && (!e.origin || !this.trackedOrigins.has(e.origin.constructor))) return;
|
|
2419
2419
|
let t = this.undoing, n = this.redoing, r = t ? this.redoStack : this.undoStack;
|
|
2420
2420
|
t ? this.stopCapturing() : n || this.clear(!1, !0);
|
|
2421
|
-
let i = new
|
|
2421
|
+
let i = new ga();
|
|
2422
2422
|
e.afterState.forEach((t, n) => {
|
|
2423
2423
|
let r = e.beforeState.get(n) || 0, a = t - r;
|
|
2424
|
-
a > 0 &&
|
|
2424
|
+
a > 0 && Sa(i, n, r, a);
|
|
2425
2425
|
});
|
|
2426
2426
|
let a = ir(), o = !1;
|
|
2427
2427
|
if (this.lastChange > 0 && a - this.lastChange < this.captureTimeout && r.length > 0 && !t && !n) {
|
|
2428
2428
|
let t = r[r.length - 1];
|
|
2429
|
-
t.deletions =
|
|
2429
|
+
t.deletions = xa([t.deletions, e.deleteSet]), t.insertions = xa([t.insertions, i]);
|
|
2430
2430
|
} else r.push(new co(e.deleteSet, i)), o = !0;
|
|
2431
|
-
!t && !n && (this.lastChange = a),
|
|
2432
|
-
t instanceof Q && this.scope.some((n) => n === e.doc ||
|
|
2431
|
+
!t && !n && (this.lastChange = a), _a(e, e.deleteSet, (t) => {
|
|
2432
|
+
t instanceof Q && this.scope.some((n) => n === e.doc || Ha(n, t)) && js(t, !0);
|
|
2433
2433
|
});
|
|
2434
2434
|
let s = [{
|
|
2435
2435
|
stackItem: r[r.length - 1],
|
|
@@ -2445,7 +2445,7 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
2445
2445
|
addToScope(e) {
|
|
2446
2446
|
let t = new Set(this.scope);
|
|
2447
2447
|
e = cn(e) ? e : [e], e.forEach((e) => {
|
|
2448
|
-
t.has(e) || (t.add(e), (e instanceof Y ? e.doc !== this.doc : e !== this.doc) &&
|
|
2448
|
+
t.has(e) || (t.add(e), (e instanceof Y ? e.doc !== this.doc : e !== this.doc) && ua("[yjs#509] Not same Y.Doc"), this.scope.push(e));
|
|
2449
2449
|
});
|
|
2450
2450
|
}
|
|
2451
2451
|
addTrackedOrigin(e) {
|
|
@@ -2502,7 +2502,7 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
2502
2502
|
return this._path || (this._path = ho(this.currentTarget, this.target));
|
|
2503
2503
|
}
|
|
2504
2504
|
deletes(e) {
|
|
2505
|
-
return
|
|
2505
|
+
return ya(this.transaction.deleteSet, e.id);
|
|
2506
2506
|
}
|
|
2507
2507
|
get keys() {
|
|
2508
2508
|
if (this._keys === null) {
|
|
@@ -2568,7 +2568,7 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
2568
2568
|
}
|
|
2569
2569
|
return n;
|
|
2570
2570
|
}, J = () => {
|
|
2571
|
-
|
|
2571
|
+
ua("Invalid access: Add Yjs type to a document before reading data.");
|
|
2572
2572
|
}, go = 80, _o = 0, vo = class {
|
|
2573
2573
|
constructor(e, t) {
|
|
2574
2574
|
e.marker = !0, this.p = e, this.index = t, this.timestamp = _o++;
|
|
@@ -2615,10 +2615,10 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
2615
2615
|
}, wo = (e, t, n) => {
|
|
2616
2616
|
let r = e, i = t.changedParentTypes;
|
|
2617
2617
|
for (; Zt(i, e, () => []).push(n), e._item !== null;) e = e._item.parent;
|
|
2618
|
-
|
|
2618
|
+
Ra(r._eH, n, t);
|
|
2619
2619
|
}, Y = class {
|
|
2620
2620
|
constructor() {
|
|
2621
|
-
this._item = null, this._map = /* @__PURE__ */ new Map(), this._start = null, this.doc = null, this._length = 0, this._eH =
|
|
2621
|
+
this._item = null, this._map = /* @__PURE__ */ new Map(), this._start = null, this.doc = null, this._length = 0, this._eH = Fa(), this._dEH = Fa(), this._searchMarker = null;
|
|
2622
2622
|
}
|
|
2623
2623
|
get parent() {
|
|
2624
2624
|
return this._item ? this._item.parent : null;
|
|
@@ -2642,16 +2642,16 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
2642
2642
|
!e.local && this._searchMarker && (this._searchMarker.length = 0);
|
|
2643
2643
|
}
|
|
2644
2644
|
observe(e) {
|
|
2645
|
-
|
|
2645
|
+
Ia(this._eH, e);
|
|
2646
2646
|
}
|
|
2647
2647
|
observeDeep(e) {
|
|
2648
|
-
|
|
2648
|
+
Ia(this._dEH, e);
|
|
2649
2649
|
}
|
|
2650
2650
|
unobserve(e) {
|
|
2651
|
-
|
|
2651
|
+
La(this._eH, e);
|
|
2652
2652
|
}
|
|
2653
2653
|
unobserveDeep(e) {
|
|
2654
|
-
|
|
2654
|
+
La(this._dEH, e);
|
|
2655
2655
|
}
|
|
2656
2656
|
toJSON() {}
|
|
2657
2657
|
}, To = (e, t, n) => {
|
|
@@ -2725,7 +2725,7 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
2725
2725
|
}
|
|
2726
2726
|
}, jo = (e, t, n, r) => {
|
|
2727
2727
|
let i = n, a = e.doc, o = a.clientID, s = a.store, c = n === null ? t._start : n.right, l = [], u = () => {
|
|
2728
|
-
l.length > 0 && (i = new Q(
|
|
2728
|
+
l.length > 0 && (i = new Q(W(o, G(s, o)), i, i && i.lastId, c, c && c.id, t, null, new Ss(l)), i.integrate(e, 0), l = []);
|
|
2729
2729
|
};
|
|
2730
2730
|
r.forEach((n) => {
|
|
2731
2731
|
if (n === null) l.push(n);
|
|
@@ -2740,12 +2740,12 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
2740
2740
|
default: switch (u(), n.constructor) {
|
|
2741
2741
|
case Uint8Array:
|
|
2742
2742
|
case ArrayBuffer:
|
|
2743
|
-
i = new Q(
|
|
2743
|
+
i = new Q(W(o, G(s, o)), i, i && i.lastId, c, c && c.id, t, null, new gs(new Uint8Array(n))), i.integrate(e, 0);
|
|
2744
2744
|
break;
|
|
2745
|
-
case
|
|
2746
|
-
i = new Q(
|
|
2745
|
+
case Ea:
|
|
2746
|
+
i = new Q(W(o, G(s, o)), i, i && i.lastId, c, c && c.id, t, null, new ys(n)), i.integrate(e, 0);
|
|
2747
2747
|
break;
|
|
2748
|
-
default: if (n instanceof Y) i = new Q(
|
|
2748
|
+
default: if (n instanceof Y) i = new Q(W(o, G(s, o)), i, i && i.lastId, c, c && c.id, t, null, new ks(n)), i.integrate(e, 0);
|
|
2749
2749
|
else throw Error("Unexpected content type in insert operation");
|
|
2750
2750
|
}
|
|
2751
2751
|
}
|
|
@@ -2756,7 +2756,7 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
2756
2756
|
let i = n, a = So(t, n), o = t._start;
|
|
2757
2757
|
for (a !== null && (o = a.p, n -= a.index, n === 0 && (o = o.prev, n += o && o.countable && !o.deleted ? o.length : 0)); o !== null; o = o.right) if (!o.deleted && o.countable) {
|
|
2758
2758
|
if (n <= o.length) {
|
|
2759
|
-
n < o.length && K(e,
|
|
2759
|
+
n < o.length && K(e, W(o.id.client, o.id.clock + n));
|
|
2760
2760
|
break;
|
|
2761
2761
|
}
|
|
2762
2762
|
n -= o.length;
|
|
@@ -2772,8 +2772,8 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
2772
2772
|
}, Fo = (e, t, n, r) => {
|
|
2773
2773
|
if (r === 0) return;
|
|
2774
2774
|
let i = n, a = r, o = So(t, n), s = t._start;
|
|
2775
|
-
for (o !== null && (s = o.p, n -= o.index); s !== null && n > 0; s = s.right) !s.deleted && s.countable && (n < s.length && K(e,
|
|
2776
|
-
for (; r > 0 && s !== null;) s.deleted || (r < s.length && K(e,
|
|
2775
|
+
for (o !== null && (s = o.p, n -= o.index); s !== null && n > 0; s = s.right) !s.deleted && s.countable && (n < s.length && K(e, W(s.id.client, s.id.clock + n)), n -= s.length);
|
|
2776
|
+
for (; r > 0 && s !== null;) s.deleted || (r < s.length && K(e, W(s.id.client, s.id.clock + r)), s.delete(e), r -= s.length), s = s.right;
|
|
2777
2777
|
if (r > 0) throw Mo();
|
|
2778
2778
|
t._searchMarker && Co(t._searchMarker, i, -a + r);
|
|
2779
2779
|
}, Io = (e, t, n) => {
|
|
@@ -2795,13 +2795,13 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
2795
2795
|
case Uint8Array:
|
|
2796
2796
|
s = new gs(r);
|
|
2797
2797
|
break;
|
|
2798
|
-
case
|
|
2798
|
+
case Ea:
|
|
2799
2799
|
s = new ys(r);
|
|
2800
2800
|
break;
|
|
2801
2801
|
default: if (r instanceof Y) s = new ks(r);
|
|
2802
2802
|
else throw Error("Unexpected content type");
|
|
2803
2803
|
}
|
|
2804
|
-
new Q(
|
|
2804
|
+
new Q(W(o, G(a.store, o)), i, i && i.lastId, null, null, t, n, s).integrate(e, 0);
|
|
2805
2805
|
}, Ro = (e, t) => {
|
|
2806
2806
|
e.doc != null || J();
|
|
2807
2807
|
let n = e._map.get(t);
|
|
@@ -2820,9 +2820,9 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
2820
2820
|
return e._map.forEach((e, r) => {
|
|
2821
2821
|
let i = e;
|
|
2822
2822
|
for (; i !== null && (!t.sv.has(i.id.client) || i.id.clock >= (t.sv.get(i.id.client) || 0));) i = i.left;
|
|
2823
|
-
i !== null &&
|
|
2823
|
+
i !== null && Wa(i, t) && (n[r] = i.content.getContent()[i.length - 1]);
|
|
2824
2824
|
}), n;
|
|
2825
|
-
}, Ho = (e) => (e.doc != null || J(),
|
|
2825
|
+
}, Ho = (e) => (e.doc != null || J(), pa(e._map.entries(), (e) => !e[1].deleted)), Uo = class extends mo {}, Wo = class e extends Y {
|
|
2826
2826
|
constructor() {
|
|
2827
2827
|
super(), this._prelimContent = [], this._searchMarker = [];
|
|
2828
2828
|
}
|
|
@@ -2927,13 +2927,13 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
2927
2927
|
return [...Ho(this)].length;
|
|
2928
2928
|
}
|
|
2929
2929
|
keys() {
|
|
2930
|
-
return
|
|
2930
|
+
return ma(Ho(this), (e) => e[0]);
|
|
2931
2931
|
}
|
|
2932
2932
|
values() {
|
|
2933
|
-
return
|
|
2933
|
+
return ma(Ho(this), (e) => e[1].content.getContent()[e[1].length - 1]);
|
|
2934
2934
|
}
|
|
2935
2935
|
entries() {
|
|
2936
|
-
return
|
|
2936
|
+
return ma(Ho(this), (e) => [e[0], e[1].content.getContent()[e[1].length - 1]]);
|
|
2937
2937
|
}
|
|
2938
2938
|
forEach(e) {
|
|
2939
2939
|
this.doc != null || J(), this._map.forEach((t, n) => {
|
|
@@ -2991,7 +2991,7 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
2991
2991
|
t.right.deleted || Zo(t.currentAttributes, t.right.content);
|
|
2992
2992
|
break;
|
|
2993
2993
|
default:
|
|
2994
|
-
t.right.deleted || (n < t.right.length && K(e,
|
|
2994
|
+
t.right.deleted || (n < t.right.length && K(e, W(t.right.id.client, t.right.id.clock + n)), t.index += t.right.length, n -= t.right.length);
|
|
2995
2995
|
break;
|
|
2996
2996
|
}
|
|
2997
2997
|
t.left = t.right, t.right = t.right.right;
|
|
@@ -3004,7 +3004,7 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
3004
3004
|
for (; n.right !== null && (n.right.deleted === !0 || n.right.content.constructor === Z && Ko(r.get(n.right.content.key), n.right.content.value));) n.right.deleted || r.delete(n.right.content.key), n.forward();
|
|
3005
3005
|
let i = e.doc, a = i.clientID;
|
|
3006
3006
|
r.forEach((r, o) => {
|
|
3007
|
-
let s = n.left, c = n.right, l = new Q(
|
|
3007
|
+
let s = n.left, c = n.right, l = new Q(W(a, G(i.store, a)), s, s && s.lastId, c, c && c.id, t, null, new Z(o, r));
|
|
3008
3008
|
l.integrate(e, 0), n.right = l, n.forward();
|
|
3009
3009
|
});
|
|
3010
3010
|
}, Zo = (e, t) => {
|
|
@@ -3024,7 +3024,7 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
3024
3024
|
if (!Ko(u, l)) {
|
|
3025
3025
|
o.set(c, u);
|
|
3026
3026
|
let { left: r, right: s } = n;
|
|
3027
|
-
n.right = new Q(
|
|
3027
|
+
n.right = new Q(W(a, G(i.store, a)), r, r && r.lastId, s, s && s.id, t, null, new Z(c, l)), n.right.integrate(e, 0), n.forward();
|
|
3028
3028
|
}
|
|
3029
3029
|
}
|
|
3030
3030
|
return o;
|
|
@@ -3035,7 +3035,7 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
3035
3035
|
let a = e.doc, o = a.clientID;
|
|
3036
3036
|
Qo(n, i);
|
|
3037
3037
|
let s = $o(e, t, n, i), c = r.constructor === String ? new Cs(r) : r instanceof Y ? new ks(r) : new bs(r), { left: l, right: u, index: d } = n;
|
|
3038
|
-
t._searchMarker && Co(t._searchMarker, n.index, c.getLength()), u = new Q(
|
|
3038
|
+
t._searchMarker && Co(t._searchMarker, n.index, c.getLength()), u = new Q(W(o, G(a.store, o)), l, l && l.lastId, u, u && u.id, t, null, c), u.integrate(e, 0), n.right = u, n.index = d, n.forward(), Xo(e, t, n, s);
|
|
3039
3039
|
}, ts = (e, t, n, r, i) => {
|
|
3040
3040
|
let a = e.doc, o = a.clientID;
|
|
3041
3041
|
Qo(n, i);
|
|
@@ -3055,7 +3055,7 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
3055
3055
|
break;
|
|
3056
3056
|
}
|
|
3057
3057
|
default:
|
|
3058
|
-
r < n.right.length && K(e,
|
|
3058
|
+
r < n.right.length && K(e, W(n.right.id.client, n.right.id.clock + r)), r -= n.right.length;
|
|
3059
3059
|
break;
|
|
3060
3060
|
}
|
|
3061
3061
|
n.forward();
|
|
@@ -3063,7 +3063,7 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
3063
3063
|
if (r > 0) {
|
|
3064
3064
|
let i = "";
|
|
3065
3065
|
for (; r > 0; r--) i += "\n";
|
|
3066
|
-
n.right = new Q(
|
|
3066
|
+
n.right = new Q(W(o, G(a.store, o)), n.left, n.left && n.left.lastId, n.right, n.right && n.right.id, t, null, new Cs(i)), n.right.integrate(e, 0), n.forward();
|
|
3067
3067
|
}
|
|
3068
3068
|
Xo(e, t, n, s);
|
|
3069
3069
|
}, ns = (e, t, n, r, i) => {
|
|
@@ -3130,7 +3130,7 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
3130
3130
|
});
|
|
3131
3131
|
}
|
|
3132
3132
|
q(n, (n) => {
|
|
3133
|
-
|
|
3133
|
+
_a(e, e.deleteSet, (e) => {
|
|
3134
3134
|
if (e instanceof hs || !e.parent._hasFormatting || t.has(e.parent)) return;
|
|
3135
3135
|
let r = e.parent;
|
|
3136
3136
|
e.content.constructor === Z ? t.add(r) : rs(n, e);
|
|
@@ -3144,7 +3144,7 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
3144
3144
|
case ks:
|
|
3145
3145
|
case bs:
|
|
3146
3146
|
case Cs:
|
|
3147
|
-
n < t.right.length && K(e,
|
|
3147
|
+
n < t.right.length && K(e, W(t.right.id.client, t.right.id.clock + n)), n -= t.right.length, t.right.delete(e);
|
|
3148
3148
|
break;
|
|
3149
3149
|
}
|
|
3150
3150
|
t.forward();
|
|
@@ -3298,10 +3298,10 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
3298
3298
|
}
|
|
3299
3299
|
let l = () => {
|
|
3300
3300
|
for (; s !== null;) {
|
|
3301
|
-
if (
|
|
3301
|
+
if (Wa(s, e) || t !== void 0 && Wa(s, t)) switch (s.content.constructor) {
|
|
3302
3302
|
case Cs: {
|
|
3303
3303
|
let r = i.get("ychange");
|
|
3304
|
-
e !== void 0 && !
|
|
3304
|
+
e !== void 0 && !Wa(s, e) ? (r === void 0 || r.user !== s.id.client || r.type !== "removed") && (c(), i.set("ychange", n ? n("removed", s.id) : { type: "removed" })) : t !== void 0 && !Wa(s, t) ? (r === void 0 || r.user !== s.id.client || r.type !== "added") && (c(), i.set("ychange", n ? n("added", s.id) : { type: "added" })) : r !== void 0 && (c(), i.delete("ychange")), o += s.content.str;
|
|
3305
3305
|
break;
|
|
3306
3306
|
}
|
|
3307
3307
|
case ks:
|
|
@@ -3318,7 +3318,7 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
3318
3318
|
break;
|
|
3319
3319
|
}
|
|
3320
3320
|
case Z:
|
|
3321
|
-
|
|
3321
|
+
Wa(s, e) && (c(), Zo(i, s.content));
|
|
3322
3322
|
break;
|
|
3323
3323
|
}
|
|
3324
3324
|
s = s.right;
|
|
@@ -3326,7 +3326,7 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
3326
3326
|
c();
|
|
3327
3327
|
};
|
|
3328
3328
|
return e || t ? q(a, (n) => {
|
|
3329
|
-
e &&
|
|
3329
|
+
e && Ga(n, e), t && Ga(n, t), l();
|
|
3330
3330
|
}, "cleanup") : l(), r;
|
|
3331
3331
|
}
|
|
3332
3332
|
insert(e, t, n) {
|
|
@@ -3597,7 +3597,7 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
3597
3597
|
return this.constructor === e.constructor ? (this.length += e.length, !0) : !1;
|
|
3598
3598
|
}
|
|
3599
3599
|
integrate(e, t) {
|
|
3600
|
-
t > 0 && (this.id.clock += t, this.length -= t),
|
|
3600
|
+
t > 0 && (this.id.clock += t, this.length -= t), Ja(e.doc.store, this);
|
|
3601
3601
|
}
|
|
3602
3602
|
write(e, t) {
|
|
3603
3603
|
e.writeInfo(ms), e.writeLen(this.length - t);
|
|
@@ -3660,7 +3660,7 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
3660
3660
|
return this.len += e.len, !0;
|
|
3661
3661
|
}
|
|
3662
3662
|
integrate(e, t) {
|
|
3663
|
-
|
|
3663
|
+
Sa(e.deleteSet, t.id.client, t.id.clock, this.len), t.markDeleted();
|
|
3664
3664
|
}
|
|
3665
3665
|
delete(e) {}
|
|
3666
3666
|
gc(e) {}
|
|
@@ -3670,7 +3670,7 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
3670
3670
|
getRef() {
|
|
3671
3671
|
return 1;
|
|
3672
3672
|
}
|
|
3673
|
-
}, vs = (e, t) => new
|
|
3673
|
+
}, vs = (e, t) => new Ea(O(O({ guid: e }, t), {}, { shouldLoad: t.shouldLoad || t.autoLoad || !1 })), ys = class e {
|
|
3674
3674
|
constructor(e) {
|
|
3675
3675
|
e._item && console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."), this.doc = e;
|
|
3676
3676
|
let t = {};
|
|
@@ -3891,7 +3891,7 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
3891
3891
|
}, As = (e, t) => {
|
|
3892
3892
|
let n = t, r = 0, i;
|
|
3893
3893
|
do
|
|
3894
|
-
r > 0 && (n =
|
|
3894
|
+
r > 0 && (n = W(n.client, n.clock + r)), i = Xa(e, n), r = n.clock - i.id.clock, n = i.redone;
|
|
3895
3895
|
while (n !== null && i instanceof Q);
|
|
3896
3896
|
return {
|
|
3897
3897
|
item: i,
|
|
@@ -3900,9 +3900,9 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
3900
3900
|
}, js = (e, t) => {
|
|
3901
3901
|
for (; e !== null && e.keep !== t;) e.keep = t, e = e.parent._item;
|
|
3902
3902
|
}, Ms = (e, t, n) => {
|
|
3903
|
-
let { client: r, clock: i } = t.id, a = new Q(
|
|
3904
|
-
return t.deleted && a.markDeleted(), t.keep && (a.keep = !0), t.redone !== null && (a.redone =
|
|
3905
|
-
}, Ns = (e, t) => on(e, (e) =>
|
|
3903
|
+
let { client: r, clock: i } = t.id, a = new Q(W(r, i + n), t, W(r, i + n - 1), t.right, t.rightOrigin, t.parent, t.parentSub, t.content.splice(n));
|
|
3904
|
+
return t.deleted && a.markDeleted(), t.keep && (a.keep = !0), t.redone !== null && (a.redone = W(t.redone.client, t.redone.clock + n)), t.right = a, a.right !== null && (a.right.left = a), e._mergeStructs.push(a), a.parentSub !== null && a.right === null && a.parent._map.set(a.parentSub, a), t.length = n, a;
|
|
3905
|
+
}, Ns = (e, t) => on(e, (e) => ya(e.deletions, t)), Ps = (e, t, n, r, i, a) => {
|
|
3906
3906
|
let o = e.doc, s = o.store, c = o.clientID, l = t.redone;
|
|
3907
3907
|
if (l !== null) return K(e, l);
|
|
3908
3908
|
let u = t.parent._item, d = null, f;
|
|
@@ -3931,10 +3931,10 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
3931
3931
|
f = f.right;
|
|
3932
3932
|
}
|
|
3933
3933
|
} else if (f = null, t.right && !i) {
|
|
3934
|
-
for (d = t; d !== null && d.right !== null && (d.right.redone ||
|
|
3934
|
+
for (d = t; d !== null && d.right !== null && (d.right.redone || ya(r, d.right.id) || Ns(a.undoStack, d.right.id) || Ns(a.redoStack, d.right.id));) for (d = d.right; d.redone;) d = K(e, d.redone);
|
|
3935
3935
|
if (d && d.right !== null) return null;
|
|
3936
3936
|
} else d = p._map.get(t.parentSub) || null;
|
|
3937
|
-
let m =
|
|
3937
|
+
let m = W(c, G(s, c)), h = new Q(m, d, d && d.lastId, f, f && f.id, p, t.parentSub, t.content.copy());
|
|
3938
3938
|
return t.redone = m, js(h, !0), h.integrate(e, 0), h;
|
|
3939
3939
|
}, Q = class e extends ps {
|
|
3940
3940
|
constructor(e, t, n, r, i, a, o, s) {
|
|
@@ -3965,19 +3965,19 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
3965
3965
|
this.info |= 4;
|
|
3966
3966
|
}
|
|
3967
3967
|
getMissing(t, n) {
|
|
3968
|
-
if (this.origin && this.origin.client !== this.id.client && this.origin.clock >=
|
|
3969
|
-
if (this.rightOrigin && this.rightOrigin.client !== this.id.client && this.rightOrigin.clock >=
|
|
3970
|
-
if (this.parent && this.parent.constructor ===
|
|
3968
|
+
if (this.origin && this.origin.client !== this.id.client && this.origin.clock >= G(n, this.origin.client)) return this.origin.client;
|
|
3969
|
+
if (this.rightOrigin && this.rightOrigin.client !== this.id.client && this.rightOrigin.clock >= G(n, this.rightOrigin.client)) return this.rightOrigin.client;
|
|
3970
|
+
if (this.parent && this.parent.constructor === za && this.id.client !== this.parent.client && this.parent.clock >= G(n, this.parent.client)) return this.parent.client;
|
|
3971
3971
|
if (this.origin && (this.left = Qa(t, n, this.origin), this.origin = this.left.lastId), this.rightOrigin && (this.right = K(t, this.rightOrigin), this.rightOrigin = this.right.id), this.left && this.left.constructor === hs || this.right && this.right.constructor === hs) this.parent = null;
|
|
3972
3972
|
else if (!this.parent) this.left && this.left.constructor === e ? (this.parent = this.left.parent, this.parentSub = this.left.parentSub) : this.right && this.right.constructor === e && (this.parent = this.right.parent, this.parentSub = this.right.parentSub);
|
|
3973
|
-
else if (this.parent.constructor ===
|
|
3973
|
+
else if (this.parent.constructor === za) {
|
|
3974
3974
|
let e = Xa(n, this.parent);
|
|
3975
3975
|
e.constructor === hs ? this.parent = null : this.parent = e.content.type;
|
|
3976
3976
|
}
|
|
3977
3977
|
return null;
|
|
3978
3978
|
}
|
|
3979
3979
|
integrate(e, t) {
|
|
3980
|
-
if (t > 0 && (this.id.clock += t, this.left = Qa(e, e.doc.store,
|
|
3980
|
+
if (t > 0 && (this.id.clock += t, this.left = Qa(e, e.doc.store, W(this.id.client, this.id.clock - 1)), this.origin = this.left.lastId, this.content = this.content.splice(t), this.length -= t), this.parent) {
|
|
3981
3981
|
if (!this.left && (!this.right || this.right.left !== null) || this.left && this.left.right !== this.right) {
|
|
3982
3982
|
let t = this.left, n;
|
|
3983
3983
|
if (t !== null) n = t.right;
|
|
@@ -3985,9 +3985,9 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
3985
3985
|
else n = this.parent._start;
|
|
3986
3986
|
let r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
3987
3987
|
for (; n !== null && n !== this.right;) {
|
|
3988
|
-
if (i.add(n), r.add(n),
|
|
3988
|
+
if (i.add(n), r.add(n), Ba(this.origin, n.origin)) {
|
|
3989
3989
|
if (n.id.client < this.id.client) t = n, r.clear();
|
|
3990
|
-
else if (
|
|
3990
|
+
else if (Ba(this.rightOrigin, n.rightOrigin)) break;
|
|
3991
3991
|
} else if (n.origin !== null && i.has(Xa(e.doc.store, n.origin))) r.has(Xa(e.doc.store, n.origin)) || (t = n, r.clear());
|
|
3992
3992
|
else break;
|
|
3993
3993
|
n = n.right;
|
|
@@ -4001,7 +4001,7 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
4001
4001
|
else e = this.parent._start, this.parent._start = this;
|
|
4002
4002
|
this.right = e;
|
|
4003
4003
|
}
|
|
4004
|
-
this.right === null ? this.parentSub !== null && (this.parent._map.set(this.parentSub, this), this.left !== null && this.left.delete(e)) : this.right.left = this, this.parentSub === null && this.countable && !this.deleted && (this.parent._length += this.length),
|
|
4004
|
+
this.right === null ? this.parentSub !== null && (this.parent._map.set(this.parentSub, this), this.left !== null && this.left.delete(e)) : this.right.left = this, this.parentSub === null && this.countable && !this.deleted && (this.parent._length += this.length), Ja(e.doc.store, this), this.content.integrate(e, this), ro(e, this.parent, this.parentSub), (this.parent._item !== null && this.parent._item.deleted || this.parentSub !== null && this.right !== null) && this.delete(e);
|
|
4005
4005
|
} else new hs(this.id, this.length).integrate(e, 0);
|
|
4006
4006
|
}
|
|
4007
4007
|
get next() {
|
|
@@ -4015,10 +4015,10 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
4015
4015
|
return e;
|
|
4016
4016
|
}
|
|
4017
4017
|
get lastId() {
|
|
4018
|
-
return this.length === 1 ? this.id :
|
|
4018
|
+
return this.length === 1 ? this.id : W(this.id.client, this.id.clock + this.length - 1);
|
|
4019
4019
|
}
|
|
4020
4020
|
mergeWith(e) {
|
|
4021
|
-
if (this.constructor === e.constructor &&
|
|
4021
|
+
if (this.constructor === e.constructor && Ba(e.origin, this.lastId) && this.right === e && Ba(this.rightOrigin, e.rightOrigin) && this.id.client === e.id.client && this.id.clock + this.length === e.id.clock && this.deleted === e.deleted && this.redone === null && e.redone === null && this.content.constructor === e.content.constructor && this.content.mergeWith(e.content)) {
|
|
4022
4022
|
let t = this.parent._searchMarker;
|
|
4023
4023
|
return t && t.forEach((t) => {
|
|
4024
4024
|
t.p === e && (t.p = this, !this.deleted && this.countable && (t.index -= this.length));
|
|
@@ -4029,7 +4029,7 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
4029
4029
|
delete(e) {
|
|
4030
4030
|
if (!this.deleted) {
|
|
4031
4031
|
let t = this.parent;
|
|
4032
|
-
this.countable && this.parentSub === null && (t._length -= this.length), this.markDeleted(),
|
|
4032
|
+
this.countable && this.parentSub === null && (t._length -= this.length), this.markDeleted(), Sa(e.deleteSet, this.id.client, this.id.clock, this.length), ro(e, t, this.parentSub), this.content.delete(e);
|
|
4033
4033
|
}
|
|
4034
4034
|
}
|
|
4035
4035
|
gc(e, t) {
|
|
@@ -4037,16 +4037,16 @@ var Ga = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.ge
|
|
|
4037
4037
|
this.content.gc(e), t ? $a(e, this, new hs(this.id, this.length)) : this.content = new _s(this.length);
|
|
4038
4038
|
}
|
|
4039
4039
|
write(e, t) {
|
|
4040
|
-
let n = t > 0 ?
|
|
4040
|
+
let n = t > 0 ? W(this.id.client, this.id.clock + t - 1) : this.origin, r = this.rightOrigin, i = this.parentSub, a = this.content.getRef() & 31 | (n === null ? 0 : 128) | (r === null ? 0 : 64) | (i === null ? 0 : 32);
|
|
4041
4041
|
if (e.writeInfo(a), n !== null && e.writeLeftID(n), r !== null && e.writeRightID(r), n === null && r === null) {
|
|
4042
4042
|
let t = this.parent;
|
|
4043
4043
|
if (t._item !== void 0) {
|
|
4044
4044
|
let n = t._item;
|
|
4045
4045
|
if (n === null) {
|
|
4046
|
-
let n =
|
|
4046
|
+
let n = Va(t);
|
|
4047
4047
|
e.writeParentInfo(!0), e.writeString(n);
|
|
4048
4048
|
} else e.writeParentInfo(!1), e.writeLeftID(n.id);
|
|
4049
|
-
} else t.constructor === String ? (e.writeParentInfo(!0), e.writeString(t)) : t.constructor ===
|
|
4049
|
+
} else t.constructor === String ? (e.writeParentInfo(!0), e.writeString(t)) : t.constructor === za ? (e.writeParentInfo(!1), e.writeLeftID(t)) : R();
|
|
4050
4050
|
i !== null && e.writeString(i);
|
|
4051
4051
|
}
|
|
4052
4052
|
this.content.write(e, t);
|
|
@@ -4149,7 +4149,7 @@ var Ls = class {
|
|
|
4149
4149
|
}
|
|
4150
4150
|
}, Rs = class {
|
|
4151
4151
|
constructor(e) {
|
|
4152
|
-
this.ydoc = new
|
|
4152
|
+
this.ydoc = new Ea(), this.yblocks = this.ydoc.getArray("blocks"), this.serializer = e;
|
|
4153
4153
|
}
|
|
4154
4154
|
fromJSON(e) {
|
|
4155
4155
|
this.ydoc.transact(() => {
|
|
@@ -10797,9 +10797,8 @@ var Dd = {
|
|
|
10797
10797
|
g && this.toolboxInstance.updateLeftAlignElement(g), this.positioner.applyContentOffset(this.nodes, o);
|
|
10798
10798
|
let _ = o.getTunes(), v = _.toolTunes.length > 0 || _.commonTunes.length > 0;
|
|
10799
10799
|
if (this.Blok.BlockManager.blocks.length === 1 && o.isEmpty && !v ? this.blockTunesToggler.hide() : this.blockTunesToggler.show(), this.open(), g && this.nodes.content) {
|
|
10800
|
-
|
|
10801
|
-
|
|
10802
|
-
this.nodes.content.style.marginLeft = `${Math.max(e, t)}px`;
|
|
10800
|
+
let e = parseFloat(getComputedStyle(g).marginLeft) || 0;
|
|
10801
|
+
this.nodes.content.style.marginLeft = `${e}px`;
|
|
10803
10802
|
}
|
|
10804
10803
|
}
|
|
10805
10804
|
moveAndOpenForMultipleBlocks(e) {
|
|
@@ -10825,9 +10824,8 @@ var Dd = {
|
|
|
10825
10824
|
this.positioner.moveToY(this.nodes, c), s.appendChild(i), o && !this.Blok.ReadOnly.isEnabled && r.setupDraggable(o, this.Blok.DragManager);
|
|
10826
10825
|
let l = s.querySelector(`[${t.elementContent}]`);
|
|
10827
10826
|
if (l && this.toolboxInstance.updateLeftAlignElement(l), this.positioner.applyContentOffset(this.nodes, r), this.blockTunesToggler.show(), this.open(), l && this.nodes.content) {
|
|
10828
|
-
|
|
10829
|
-
|
|
10830
|
-
this.nodes.content.style.marginLeft = `${Math.max(e, t)}px`;
|
|
10827
|
+
let e = parseFloat(getComputedStyle(l).marginLeft) || 0;
|
|
10828
|
+
this.nodes.content.style.marginLeft = `${e}px`;
|
|
10831
10829
|
}
|
|
10832
10830
|
}
|
|
10833
10831
|
close(e) {
|