buildkit-primevue
Version:
FormKit components and helpers built on PrimeVue v4 with Tailwind CSS
1,596 lines • 274 kB
JavaScript
var gl = typeof global == "object" && global && global.Object === Object && global, yo = typeof self == "object" && self && self.Object === Object && self, Zt = gl || yo || Function("return this")(), de = Zt.Symbol, pl = Object.prototype, vo = pl.hasOwnProperty, Eo = pl.toString, yr = de ? de.toStringTag : void 0;
function Ao(n) {
var t = vo.call(n, yr), e = n[yr];
try {
n[yr] = void 0;
var r = !0;
} catch {
}
var s = Eo.call(n);
return r && (t ? n[yr] = e : delete n[yr]), s;
}
var No = Object.prototype, wo = No.toString;
function To(n) {
return wo.call(n);
}
var xo = "[object Null]", Lo = "[object Undefined]", hi = de ? de.toStringTag : void 0;
function tr(n) {
return n == null ? n === void 0 ? Lo : xo : hi && hi in Object(n) ? Ao(n) : To(n);
}
function re(n) {
return n != null && typeof n == "object";
}
var we = Array.isArray;
function ge(n) {
var t = typeof n;
return n != null && (t == "object" || t == "function");
}
function ml(n) {
return n;
}
var _o = "[object AsyncFunction]", So = "[object Function]", Oo = "[object GeneratorFunction]", qo = "[object Proxy]";
function zs(n) {
if (!ge(n))
return !1;
var t = tr(n);
return t == So || t == Oo || t == _o || t == qo;
}
var gs = Zt["__core-js_shared__"], fi = (function() {
var n = /[^.]+$/.exec(gs && gs.keys && gs.keys.IE_PROTO || "");
return n ? "Symbol(src)_1." + n : "";
})();
function Co(n) {
return !!fi && fi in n;
}
var Io = Function.prototype, Ro = Io.toString;
function _e(n) {
if (n != null) {
try {
return Ro.call(n);
} catch {
}
try {
return n + "";
} catch {
}
}
return "";
}
var ko = /[\\^$.*+?()[\]{}|]/g, Bo = /^\[object .+?Constructor\]$/, Mo = Function.prototype, Do = Object.prototype, jo = Mo.toString, $o = Do.hasOwnProperty, Po = RegExp(
"^" + jo.call($o).replace(ko, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function Uo(n) {
if (!ge(n) || Co(n))
return !1;
var t = zs(n) ? Po : Bo;
return t.test(_e(n));
}
function Fo(n, t) {
return n?.[t];
}
function Se(n, t) {
var e = Fo(n, t);
return Uo(e) ? e : void 0;
}
var Ss = Se(Zt, "WeakMap"), di = Object.create, Ho = /* @__PURE__ */ (function() {
function n() {
}
return function(t) {
if (!ge(t))
return {};
if (di)
return di(t);
n.prototype = t;
var e = new n();
return n.prototype = void 0, e;
};
})();
function zo(n, t, e) {
switch (e.length) {
case 0:
return n.call(t);
case 1:
return n.call(t, e[0]);
case 2:
return n.call(t, e[0], e[1]);
case 3:
return n.call(t, e[0], e[1], e[2]);
}
return n.apply(t, e);
}
function Ko(n, t) {
var e = -1, r = n.length;
for (t || (t = Array(r)); ++e < r; )
t[e] = n[e];
return t;
}
var Go = 800, Vo = 16, Wo = Date.now;
function Zo(n) {
var t = 0, e = 0;
return function() {
var r = Wo(), s = Vo - (r - e);
if (e = r, s > 0) {
if (++t >= Go)
return arguments[0];
} else
t = 0;
return n.apply(void 0, arguments);
};
}
function Xo(n) {
return function() {
return n;
};
}
var dn = (function() {
try {
var n = Se(Object, "defineProperty");
return n({}, "", {}), n;
} catch {
}
})(), Yo = dn ? function(n, t) {
return dn(n, "toString", {
configurable: !0,
enumerable: !1,
value: Xo(t),
writable: !0
});
} : ml, Qo = Zo(Yo);
function Jo(n, t) {
for (var e = -1, r = n == null ? 0 : n.length; ++e < r && t(n[e], e, n) !== !1; )
;
return n;
}
var ta = 9007199254740991, ea = /^(?:0|[1-9]\d*)$/;
function bl(n, t) {
var e = typeof n;
return t = t ?? ta, !!t && (e == "number" || e != "symbol" && ea.test(n)) && n > -1 && n % 1 == 0 && n < t;
}
function Ks(n, t, e) {
t == "__proto__" && dn ? dn(n, t, {
configurable: !0,
enumerable: !0,
value: e,
writable: !0
}) : n[t] = e;
}
function Cr(n, t) {
return n === t || n !== n && t !== t;
}
var ra = Object.prototype, na = ra.hasOwnProperty;
function yl(n, t, e) {
var r = n[t];
(!(na.call(n, t) && Cr(r, e)) || e === void 0 && !(t in n)) && Ks(n, t, e);
}
function sa(n, t, e, r) {
var s = !e;
e || (e = {});
for (var i = -1, o = t.length; ++i < o; ) {
var a = t[i], u = void 0;
u === void 0 && (u = n[a]), s ? Ks(e, a, u) : yl(e, a, u);
}
return e;
}
var gi = Math.max;
function ia(n, t, e) {
return t = gi(t === void 0 ? n.length - 1 : t, 0), function() {
for (var r = arguments, s = -1, i = gi(r.length - t, 0), o = Array(i); ++s < i; )
o[s] = r[t + s];
s = -1;
for (var a = Array(t + 1); ++s < t; )
a[s] = r[s];
return a[t] = e(o), zo(n, this, a);
};
}
function la(n, t) {
return Qo(ia(n, t, ml), n + "");
}
var oa = 9007199254740991;
function vl(n) {
return typeof n == "number" && n > -1 && n % 1 == 0 && n <= oa;
}
function vn(n) {
return n != null && vl(n.length) && !zs(n);
}
function aa(n, t, e) {
if (!ge(e))
return !1;
var r = typeof t;
return (r == "number" ? vn(e) && bl(t, e.length) : r == "string" && t in e) ? Cr(e[t], n) : !1;
}
function ca(n) {
return la(function(t, e) {
var r = -1, s = e.length, i = s > 1 ? e[s - 1] : void 0, o = s > 2 ? e[2] : void 0;
for (i = n.length > 3 && typeof i == "function" ? (s--, i) : void 0, o && aa(e[0], e[1], o) && (i = s < 3 ? void 0 : i, s = 1), t = Object(t); ++r < s; ) {
var a = e[r];
a && n(t, a, r, i);
}
return t;
});
}
var ua = Object.prototype;
function Gs(n) {
var t = n && n.constructor, e = typeof t == "function" && t.prototype || ua;
return n === e;
}
function ha(n, t) {
for (var e = -1, r = Array(n); ++e < n; )
r[e] = t(e);
return r;
}
var fa = "[object Arguments]";
function pi(n) {
return re(n) && tr(n) == fa;
}
var El = Object.prototype, da = El.hasOwnProperty, ga = El.propertyIsEnumerable, Os = pi(/* @__PURE__ */ (function() {
return arguments;
})()) ? pi : function(n) {
return re(n) && da.call(n, "callee") && !ga.call(n, "callee");
};
function pa() {
return !1;
}
var Al = typeof exports == "object" && exports && !exports.nodeType && exports, mi = Al && typeof module == "object" && module && !module.nodeType && module, ma = mi && mi.exports === Al, bi = ma ? Zt.Buffer : void 0, ba = bi ? bi.isBuffer : void 0, xr = ba || pa, ya = "[object Arguments]", va = "[object Array]", Ea = "[object Boolean]", Aa = "[object Date]", Na = "[object Error]", wa = "[object Function]", Ta = "[object Map]", xa = "[object Number]", La = "[object Object]", _a = "[object RegExp]", Sa = "[object Set]", Oa = "[object String]", qa = "[object WeakMap]", Ca = "[object ArrayBuffer]", Ia = "[object DataView]", Ra = "[object Float32Array]", ka = "[object Float64Array]", Ba = "[object Int8Array]", Ma = "[object Int16Array]", Da = "[object Int32Array]", ja = "[object Uint8Array]", $a = "[object Uint8ClampedArray]", Pa = "[object Uint16Array]", Ua = "[object Uint32Array]", it = {};
it[Ra] = it[ka] = it[Ba] = it[Ma] = it[Da] = it[ja] = it[$a] = it[Pa] = it[Ua] = !0;
it[ya] = it[va] = it[Ca] = it[Ea] = it[Ia] = it[Aa] = it[Na] = it[wa] = it[Ta] = it[xa] = it[La] = it[_a] = it[Sa] = it[Oa] = it[qa] = !1;
function Fa(n) {
return re(n) && vl(n.length) && !!it[tr(n)];
}
function Vs(n) {
return function(t) {
return n(t);
};
}
var Nl = typeof exports == "object" && exports && !exports.nodeType && exports, wr = Nl && typeof module == "object" && module && !module.nodeType && module, Ha = wr && wr.exports === Nl, ps = Ha && gl.process, Qe = (function() {
try {
var n = wr && wr.require && wr.require("util").types;
return n || ps && ps.binding && ps.binding("util");
} catch {
}
})(), yi = Qe && Qe.isTypedArray, Ws = yi ? Vs(yi) : Fa, za = Object.prototype, Ka = za.hasOwnProperty;
function wl(n, t) {
var e = we(n), r = !e && Os(n), s = !e && !r && xr(n), i = !e && !r && !s && Ws(n), o = e || r || s || i, a = o ? ha(n.length, String) : [], u = a.length;
for (var h in n)
(t || Ka.call(n, h)) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode.
(h == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
s && (h == "offset" || h == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
i && (h == "buffer" || h == "byteLength" || h == "byteOffset") || // Skip index properties.
bl(h, u))) && a.push(h);
return a;
}
function Tl(n, t) {
return function(e) {
return n(t(e));
};
}
var Ga = Tl(Object.keys, Object), Va = Object.prototype, Wa = Va.hasOwnProperty;
function Za(n) {
if (!Gs(n))
return Ga(n);
var t = [];
for (var e in Object(n))
Wa.call(n, e) && e != "constructor" && t.push(e);
return t;
}
function Xa(n) {
return vn(n) ? wl(n) : Za(n);
}
function Ya(n) {
var t = [];
if (n != null)
for (var e in Object(n))
t.push(e);
return t;
}
var Qa = Object.prototype, Ja = Qa.hasOwnProperty;
function tc(n) {
if (!ge(n))
return Ya(n);
var t = Gs(n), e = [];
for (var r in n)
r == "constructor" && (t || !Ja.call(n, r)) || e.push(r);
return e;
}
function xl(n) {
return vn(n) ? wl(n, !0) : tc(n);
}
var Lr = Se(Object, "create");
function ec() {
this.__data__ = Lr ? Lr(null) : {}, this.size = 0;
}
function rc(n) {
var t = this.has(n) && delete this.__data__[n];
return this.size -= t ? 1 : 0, t;
}
var nc = "__lodash_hash_undefined__", sc = Object.prototype, ic = sc.hasOwnProperty;
function lc(n) {
var t = this.__data__;
if (Lr) {
var e = t[n];
return e === nc ? void 0 : e;
}
return ic.call(t, n) ? t[n] : void 0;
}
var oc = Object.prototype, ac = oc.hasOwnProperty;
function cc(n) {
var t = this.__data__;
return Lr ? t[n] !== void 0 : ac.call(t, n);
}
var uc = "__lodash_hash_undefined__";
function hc(n, t) {
var e = this.__data__;
return this.size += this.has(n) ? 0 : 1, e[n] = Lr && t === void 0 ? uc : t, this;
}
function Te(n) {
var t = -1, e = n == null ? 0 : n.length;
for (this.clear(); ++t < e; ) {
var r = n[t];
this.set(r[0], r[1]);
}
}
Te.prototype.clear = ec;
Te.prototype.delete = rc;
Te.prototype.get = lc;
Te.prototype.has = cc;
Te.prototype.set = hc;
function fc() {
this.__data__ = [], this.size = 0;
}
function En(n, t) {
for (var e = n.length; e--; )
if (Cr(n[e][0], t))
return e;
return -1;
}
var dc = Array.prototype, gc = dc.splice;
function pc(n) {
var t = this.__data__, e = En(t, n);
if (e < 0)
return !1;
var r = t.length - 1;
return e == r ? t.pop() : gc.call(t, e, 1), --this.size, !0;
}
function mc(n) {
var t = this.__data__, e = En(t, n);
return e < 0 ? void 0 : t[e][1];
}
function bc(n) {
return En(this.__data__, n) > -1;
}
function yc(n, t) {
var e = this.__data__, r = En(e, n);
return r < 0 ? (++this.size, e.push([n, t])) : e[r][1] = t, this;
}
function se(n) {
var t = -1, e = n == null ? 0 : n.length;
for (this.clear(); ++t < e; ) {
var r = n[t];
this.set(r[0], r[1]);
}
}
se.prototype.clear = fc;
se.prototype.delete = pc;
se.prototype.get = mc;
se.prototype.has = bc;
se.prototype.set = yc;
var _r = Se(Zt, "Map");
function vc() {
this.size = 0, this.__data__ = {
hash: new Te(),
map: new (_r || se)(),
string: new Te()
};
}
function Ec(n) {
var t = typeof n;
return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? n !== "__proto__" : n === null;
}
function An(n, t) {
var e = n.__data__;
return Ec(t) ? e[typeof t == "string" ? "string" : "hash"] : e.map;
}
function Ac(n) {
var t = An(this, n).delete(n);
return this.size -= t ? 1 : 0, t;
}
function Nc(n) {
return An(this, n).get(n);
}
function wc(n) {
return An(this, n).has(n);
}
function Tc(n, t) {
var e = An(this, n), r = e.size;
return e.set(n, t), this.size += e.size == r ? 0 : 1, this;
}
function Oe(n) {
var t = -1, e = n == null ? 0 : n.length;
for (this.clear(); ++t < e; ) {
var r = n[t];
this.set(r[0], r[1]);
}
}
Oe.prototype.clear = vc;
Oe.prototype.delete = Ac;
Oe.prototype.get = Nc;
Oe.prototype.has = wc;
Oe.prototype.set = Tc;
function xc(n, t) {
for (var e = -1, r = t.length, s = n.length; ++e < r; )
n[s + e] = t[e];
return n;
}
var Ll = Tl(Object.getPrototypeOf, Object), Lc = "[object Object]", _c = Function.prototype, Sc = Object.prototype, _l = _c.toString, Oc = Sc.hasOwnProperty, qc = _l.call(Object);
function Cc(n) {
if (!re(n) || tr(n) != Lc)
return !1;
var t = Ll(n);
if (t === null)
return !0;
var e = Oc.call(t, "constructor") && t.constructor;
return typeof e == "function" && e instanceof e && _l.call(e) == qc;
}
function Ic() {
this.__data__ = new se(), this.size = 0;
}
function Rc(n) {
var t = this.__data__, e = t.delete(n);
return this.size = t.size, e;
}
function kc(n) {
return this.__data__.get(n);
}
function Bc(n) {
return this.__data__.has(n);
}
var Mc = 200;
function Dc(n, t) {
var e = this.__data__;
if (e instanceof se) {
var r = e.__data__;
if (!_r || r.length < Mc - 1)
return r.push([n, t]), this.size = ++e.size, this;
e = this.__data__ = new Oe(r);
}
return e.set(n, t), this.size = e.size, this;
}
function Vt(n) {
var t = this.__data__ = new se(n);
this.size = t.size;
}
Vt.prototype.clear = Ic;
Vt.prototype.delete = Rc;
Vt.prototype.get = kc;
Vt.prototype.has = Bc;
Vt.prototype.set = Dc;
var Sl = typeof exports == "object" && exports && !exports.nodeType && exports, vi = Sl && typeof module == "object" && module && !module.nodeType && module, jc = vi && vi.exports === Sl, Ei = jc ? Zt.Buffer : void 0, Ai = Ei ? Ei.allocUnsafe : void 0;
function Ol(n, t) {
if (t)
return n.slice();
var e = n.length, r = Ai ? Ai(e) : new n.constructor(e);
return n.copy(r), r;
}
function $c(n, t) {
for (var e = -1, r = n == null ? 0 : n.length, s = 0, i = []; ++e < r; ) {
var o = n[e];
t(o, e, n) && (i[s++] = o);
}
return i;
}
function Pc() {
return [];
}
var Uc = Object.prototype, Fc = Uc.propertyIsEnumerable, Ni = Object.getOwnPropertySymbols, Hc = Ni ? function(n) {
return n == null ? [] : (n = Object(n), $c(Ni(n), function(t) {
return Fc.call(n, t);
}));
} : Pc;
function zc(n, t, e) {
var r = t(n);
return we(n) ? r : xc(r, e(n));
}
function qs(n) {
return zc(n, Xa, Hc);
}
var Cs = Se(Zt, "DataView"), Is = Se(Zt, "Promise"), Rs = Se(Zt, "Set"), wi = "[object Map]", Kc = "[object Object]", Ti = "[object Promise]", xi = "[object Set]", Li = "[object WeakMap]", _i = "[object DataView]", Gc = _e(Cs), Vc = _e(_r), Wc = _e(Is), Zc = _e(Rs), Xc = _e(Ss), Mt = tr;
(Cs && Mt(new Cs(new ArrayBuffer(1))) != _i || _r && Mt(new _r()) != wi || Is && Mt(Is.resolve()) != Ti || Rs && Mt(new Rs()) != xi || Ss && Mt(new Ss()) != Li) && (Mt = function(n) {
var t = tr(n), e = t == Kc ? n.constructor : void 0, r = e ? _e(e) : "";
if (r)
switch (r) {
case Gc:
return _i;
case Vc:
return wi;
case Wc:
return Ti;
case Zc:
return xi;
case Xc:
return Li;
}
return t;
});
var Yc = Object.prototype, Qc = Yc.hasOwnProperty;
function Jc(n) {
var t = n.length, e = new n.constructor(t);
return t && typeof n[0] == "string" && Qc.call(n, "index") && (e.index = n.index, e.input = n.input), e;
}
var gn = Zt.Uint8Array;
function Zs(n) {
var t = new n.constructor(n.byteLength);
return new gn(t).set(new gn(n)), t;
}
function tu(n, t) {
var e = Zs(n.buffer);
return new n.constructor(e, n.byteOffset, n.byteLength);
}
var eu = /\w*$/;
function ru(n) {
var t = new n.constructor(n.source, eu.exec(n));
return t.lastIndex = n.lastIndex, t;
}
var Si = de ? de.prototype : void 0, Oi = Si ? Si.valueOf : void 0;
function nu(n) {
return Oi ? Object(Oi.call(n)) : {};
}
function ql(n, t) {
var e = t ? Zs(n.buffer) : n.buffer;
return new n.constructor(e, n.byteOffset, n.length);
}
var su = "[object Boolean]", iu = "[object Date]", lu = "[object Map]", ou = "[object Number]", au = "[object RegExp]", cu = "[object Set]", uu = "[object String]", hu = "[object Symbol]", fu = "[object ArrayBuffer]", du = "[object DataView]", gu = "[object Float32Array]", pu = "[object Float64Array]", mu = "[object Int8Array]", bu = "[object Int16Array]", yu = "[object Int32Array]", vu = "[object Uint8Array]", Eu = "[object Uint8ClampedArray]", Au = "[object Uint16Array]", Nu = "[object Uint32Array]";
function wu(n, t, e) {
var r = n.constructor;
switch (t) {
case fu:
return Zs(n);
case su:
case iu:
return new r(+n);
case du:
return tu(n);
case gu:
case pu:
case mu:
case bu:
case yu:
case vu:
case Eu:
case Au:
case Nu:
return ql(n, e);
case lu:
return new r();
case ou:
case uu:
return new r(n);
case au:
return ru(n);
case cu:
return new r();
case hu:
return nu(n);
}
}
function Cl(n) {
return typeof n.constructor == "function" && !Gs(n) ? Ho(Ll(n)) : {};
}
var Tu = "[object Map]";
function xu(n) {
return re(n) && Mt(n) == Tu;
}
var qi = Qe && Qe.isMap, Lu = qi ? Vs(qi) : xu, _u = "[object Set]";
function Su(n) {
return re(n) && Mt(n) == _u;
}
var Ci = Qe && Qe.isSet, Ou = Ci ? Vs(Ci) : Su, qu = 1, Il = "[object Arguments]", Cu = "[object Array]", Iu = "[object Boolean]", Ru = "[object Date]", ku = "[object Error]", Rl = "[object Function]", Bu = "[object GeneratorFunction]", Mu = "[object Map]", Du = "[object Number]", kl = "[object Object]", ju = "[object RegExp]", $u = "[object Set]", Pu = "[object String]", Uu = "[object Symbol]", Fu = "[object WeakMap]", Hu = "[object ArrayBuffer]", zu = "[object DataView]", Ku = "[object Float32Array]", Gu = "[object Float64Array]", Vu = "[object Int8Array]", Wu = "[object Int16Array]", Zu = "[object Int32Array]", Xu = "[object Uint8Array]", Yu = "[object Uint8ClampedArray]", Qu = "[object Uint16Array]", Ju = "[object Uint32Array]", nt = {};
nt[Il] = nt[Cu] = nt[Hu] = nt[zu] = nt[Iu] = nt[Ru] = nt[Ku] = nt[Gu] = nt[Vu] = nt[Wu] = nt[Zu] = nt[Mu] = nt[Du] = nt[kl] = nt[ju] = nt[$u] = nt[Pu] = nt[Uu] = nt[Xu] = nt[Yu] = nt[Qu] = nt[Ju] = !0;
nt[ku] = nt[Rl] = nt[Fu] = !1;
function fn(n, t, e, r, s, i) {
var o, a = t & qu;
if (o !== void 0)
return o;
if (!ge(n))
return n;
var u = we(n);
if (u)
o = Jc(n);
else {
var h = Mt(n), p = h == Rl || h == Bu;
if (xr(n))
return Ol(n, a);
if (h == kl || h == Il || p && !s)
o = p ? {} : Cl(n);
else {
if (!nt[h])
return s ? n : {};
o = wu(n, h, a);
}
}
i || (i = new Vt());
var v = i.get(n);
if (v)
return v;
i.set(n, o), Ou(n) ? n.forEach(function(y) {
o.add(fn(y, t, e, y, n, i));
}) : Lu(n) && n.forEach(function(y, N) {
o.set(N, fn(y, t, e, N, n, i));
});
var f = qs, m = u ? void 0 : f(n);
return Jo(m || n, function(y, N) {
m && (N = y, y = n[N]), yl(o, N, fn(y, t, e, N, n, i));
}), o;
}
var th = 1, eh = 4;
function Ze(n) {
return fn(n, th | eh);
}
var rh = "__lodash_hash_undefined__";
function nh(n) {
return this.__data__.set(n, rh), this;
}
function sh(n) {
return this.__data__.has(n);
}
function pn(n) {
var t = -1, e = n == null ? 0 : n.length;
for (this.__data__ = new Oe(); ++t < e; )
this.add(n[t]);
}
pn.prototype.add = pn.prototype.push = nh;
pn.prototype.has = sh;
function ih(n, t) {
for (var e = -1, r = n == null ? 0 : n.length; ++e < r; )
if (t(n[e], e, n))
return !0;
return !1;
}
function lh(n, t) {
return n.has(t);
}
var oh = 1, ah = 2;
function Bl(n, t, e, r, s, i) {
var o = e & oh, a = n.length, u = t.length;
if (a != u && !(o && u > a))
return !1;
var h = i.get(n), p = i.get(t);
if (h && p)
return h == t && p == n;
var v = -1, f = !0, m = e & ah ? new pn() : void 0;
for (i.set(n, t), i.set(t, n); ++v < a; ) {
var y = n[v], N = t[v];
if (r)
var w = o ? r(N, y, v, t, n, i) : r(y, N, v, n, t, i);
if (w !== void 0) {
if (w)
continue;
f = !1;
break;
}
if (m) {
if (!ih(t, function(x, q) {
if (!lh(m, q) && (y === x || s(y, x, e, r, i)))
return m.push(q);
})) {
f = !1;
break;
}
} else if (!(y === N || s(y, N, e, r, i))) {
f = !1;
break;
}
}
return i.delete(n), i.delete(t), f;
}
function ch(n) {
var t = -1, e = Array(n.size);
return n.forEach(function(r, s) {
e[++t] = [s, r];
}), e;
}
function uh(n) {
var t = -1, e = Array(n.size);
return n.forEach(function(r) {
e[++t] = r;
}), e;
}
var hh = 1, fh = 2, dh = "[object Boolean]", gh = "[object Date]", ph = "[object Error]", mh = "[object Map]", bh = "[object Number]", yh = "[object RegExp]", vh = "[object Set]", Eh = "[object String]", Ah = "[object Symbol]", Nh = "[object ArrayBuffer]", wh = "[object DataView]", Ii = de ? de.prototype : void 0, ms = Ii ? Ii.valueOf : void 0;
function Th(n, t, e, r, s, i, o) {
switch (e) {
case wh:
if (n.byteLength != t.byteLength || n.byteOffset != t.byteOffset)
return !1;
n = n.buffer, t = t.buffer;
case Nh:
return !(n.byteLength != t.byteLength || !i(new gn(n), new gn(t)));
case dh:
case gh:
case bh:
return Cr(+n, +t);
case ph:
return n.name == t.name && n.message == t.message;
case yh:
case Eh:
return n == t + "";
case mh:
var a = ch;
case vh:
var u = r & hh;
if (a || (a = uh), n.size != t.size && !u)
return !1;
var h = o.get(n);
if (h)
return h == t;
r |= fh, o.set(n, t);
var p = Bl(a(n), a(t), r, s, i, o);
return o.delete(n), p;
case Ah:
if (ms)
return ms.call(n) == ms.call(t);
}
return !1;
}
var xh = 1, Lh = Object.prototype, _h = Lh.hasOwnProperty;
function Sh(n, t, e, r, s, i) {
var o = e & xh, a = qs(n), u = a.length, h = qs(t), p = h.length;
if (u != p && !o)
return !1;
for (var v = u; v--; ) {
var f = a[v];
if (!(o ? f in t : _h.call(t, f)))
return !1;
}
var m = i.get(n), y = i.get(t);
if (m && y)
return m == t && y == n;
var N = !0;
i.set(n, t), i.set(t, n);
for (var w = o; ++v < u; ) {
f = a[v];
var x = n[f], q = t[f];
if (r)
var B = o ? r(q, x, f, t, n, i) : r(x, q, f, n, t, i);
if (!(B === void 0 ? x === q || s(x, q, e, r, i) : B)) {
N = !1;
break;
}
w || (w = f == "constructor");
}
if (N && !w) {
var H = n.constructor, P = t.constructor;
H != P && "constructor" in n && "constructor" in t && !(typeof H == "function" && H instanceof H && typeof P == "function" && P instanceof P) && (N = !1);
}
return i.delete(n), i.delete(t), N;
}
var Oh = 1, Ri = "[object Arguments]", ki = "[object Array]", en = "[object Object]", qh = Object.prototype, Bi = qh.hasOwnProperty;
function Ch(n, t, e, r, s, i) {
var o = we(n), a = we(t), u = o ? ki : Mt(n), h = a ? ki : Mt(t);
u = u == Ri ? en : u, h = h == Ri ? en : h;
var p = u == en, v = h == en, f = u == h;
if (f && xr(n)) {
if (!xr(t))
return !1;
o = !0, p = !1;
}
if (f && !p)
return i || (i = new Vt()), o || Ws(n) ? Bl(n, t, e, r, s, i) : Th(n, t, u, e, r, s, i);
if (!(e & Oh)) {
var m = p && Bi.call(n, "__wrapped__"), y = v && Bi.call(t, "__wrapped__");
if (m || y) {
var N = m ? n.value() : n, w = y ? t.value() : t;
return i || (i = new Vt()), s(N, w, e, r, i);
}
}
return f ? (i || (i = new Vt()), Sh(n, t, e, r, s, i)) : !1;
}
function Ml(n, t, e, r, s) {
return n === t ? !0 : n == null || t == null || !re(n) && !re(t) ? n !== n && t !== t : Ch(n, t, e, r, Ml, s);
}
function Ih(n) {
return function(t, e, r) {
for (var s = -1, i = Object(t), o = r(t), a = o.length; a--; ) {
var u = o[++s];
if (e(i[u], u, i) === !1)
break;
}
return t;
};
}
var Rh = Ih();
function ks(n, t, e) {
(e !== void 0 && !Cr(n[t], e) || e === void 0 && !(t in n)) && Ks(n, t, e);
}
function kh(n) {
return re(n) && vn(n);
}
function Bs(n, t) {
if (!(t === "constructor" && typeof n[t] == "function") && t != "__proto__")
return n[t];
}
function Bh(n) {
return sa(n, xl(n));
}
function Mh(n, t, e, r, s, i, o) {
var a = Bs(n, e), u = Bs(t, e), h = o.get(u);
if (h) {
ks(n, e, h);
return;
}
var p = i ? i(a, u, e + "", n, t, o) : void 0, v = p === void 0;
if (v) {
var f = we(u), m = !f && xr(u), y = !f && !m && Ws(u);
p = u, f || m || y ? we(a) ? p = a : kh(a) ? p = Ko(a) : m ? (v = !1, p = Ol(u, !0)) : y ? (v = !1, p = ql(u, !0)) : p = [] : Cc(u) || Os(u) ? (p = a, Os(a) ? p = Bh(a) : (!ge(a) || zs(a)) && (p = Cl(u))) : v = !1;
}
v && (o.set(u, p), s(p, u, r, i, o), o.delete(u)), ks(n, e, p);
}
function Dl(n, t, e, r, s) {
n !== t && Rh(t, function(i, o) {
if (s || (s = new Vt()), ge(i))
Mh(n, t, o, e, Dl, r, s);
else {
var a = r ? r(Bs(n, o), i, o + "", n, t, s) : void 0;
a === void 0 && (a = i), ks(n, o, a);
}
}, xl);
}
function Xs(n, t) {
return Ml(n, t);
}
var he = ca(function(n, t, e) {
Dl(n, t, e);
}), M = /* @__PURE__ */ ((n) => (n[n.TYPE = 3] = "TYPE", n[n.LEVEL = 12] = "LEVEL", n[n.ATTRIBUTE = 13] = "ATTRIBUTE", n[n.BLOT = 14] = "BLOT", n[n.INLINE = 7] = "INLINE", n[n.BLOCK = 11] = "BLOCK", n[n.BLOCK_BLOT = 10] = "BLOCK_BLOT", n[n.INLINE_BLOT = 6] = "INLINE_BLOT", n[n.BLOCK_ATTRIBUTE = 9] = "BLOCK_ATTRIBUTE", n[n.INLINE_ATTRIBUTE = 5] = "INLINE_ATTRIBUTE", n[n.ANY = 15] = "ANY", n))(M || {});
class Wt {
constructor(t, e, r = {}) {
this.attrName = t, this.keyName = e;
const s = M.TYPE & M.ATTRIBUTE;
this.scope = r.scope != null ? (
// Ignore type bits, force attribute bit
r.scope & M.LEVEL | s
) : M.ATTRIBUTE, r.whitelist != null && (this.whitelist = r.whitelist);
}
static keys(t) {
return Array.from(t.attributes).map((e) => e.name);
}
add(t, e) {
return this.canAdd(t, e) ? (t.setAttribute(this.keyName, e), !0) : !1;
}
canAdd(t, e) {
return this.whitelist == null ? !0 : typeof e == "string" ? this.whitelist.indexOf(e.replace(/["']/g, "")) > -1 : this.whitelist.indexOf(e) > -1;
}
remove(t) {
t.removeAttribute(this.keyName);
}
value(t) {
const e = t.getAttribute(this.keyName);
return this.canAdd(t, e) && e ? e : "";
}
}
class Xe extends Error {
constructor(t) {
t = "[Parchment] " + t, super(t), this.message = t, this.name = this.constructor.name;
}
}
const jl = class Ms {
constructor() {
this.attributes = {}, this.classes = {}, this.tags = {}, this.types = {};
}
static find(t, e = !1) {
if (t == null)
return null;
if (this.blots.has(t))
return this.blots.get(t) || null;
if (e) {
let r = null;
try {
r = t.parentNode;
} catch {
return null;
}
return this.find(r, e);
}
return null;
}
create(t, e, r) {
const s = this.query(e);
if (s == null)
throw new Xe(`Unable to create ${e} blot`);
const i = s, o = (
// @ts-expect-error Fix me later
e instanceof Node || e.nodeType === Node.TEXT_NODE ? e : i.create(r)
), a = new i(t, o, r);
return Ms.blots.set(a.domNode, a), a;
}
find(t, e = !1) {
return Ms.find(t, e);
}
query(t, e = M.ANY) {
let r;
return typeof t == "string" ? r = this.types[t] || this.attributes[t] : t instanceof Text || t.nodeType === Node.TEXT_NODE ? r = this.types.text : typeof t == "number" ? t & M.LEVEL & M.BLOCK ? r = this.types.block : t & M.LEVEL & M.INLINE && (r = this.types.inline) : t instanceof Element && ((t.getAttribute("class") || "").split(/\s+/).some((s) => (r = this.classes[s], !!r)), r = r || this.tags[t.tagName]), r == null ? null : "scope" in r && e & M.LEVEL & r.scope && e & M.TYPE & r.scope ? r : null;
}
register(...t) {
return t.map((e) => {
const r = "blotName" in e, s = "attrName" in e;
if (!r && !s)
throw new Xe("Invalid definition");
if (r && e.blotName === "abstract")
throw new Xe("Cannot register abstract class");
const i = r ? e.blotName : s ? e.attrName : void 0;
return this.types[i] = e, s ? typeof e.keyName == "string" && (this.attributes[e.keyName] = e) : r && (e.className && (this.classes[e.className] = e), e.tagName && (Array.isArray(e.tagName) ? e.tagName = e.tagName.map((o) => o.toUpperCase()) : e.tagName = e.tagName.toUpperCase(), (Array.isArray(e.tagName) ? e.tagName : [e.tagName]).forEach((o) => {
(this.tags[o] == null || e.className == null) && (this.tags[o] = e);
}))), e;
});
}
};
jl.blots = /* @__PURE__ */ new WeakMap();
let Je = jl;
function Mi(n, t) {
return (n.getAttribute("class") || "").split(/\s+/).filter((e) => e.indexOf(`${t}-`) === 0);
}
class Dh extends Wt {
static keys(t) {
return (t.getAttribute("class") || "").split(/\s+/).map((e) => e.split("-").slice(0, -1).join("-"));
}
add(t, e) {
return this.canAdd(t, e) ? (this.remove(t), t.classList.add(`${this.keyName}-${e}`), !0) : !1;
}
remove(t) {
Mi(t, this.keyName).forEach((e) => {
t.classList.remove(e);
}), t.classList.length === 0 && t.removeAttribute("class");
}
value(t) {
const e = (Mi(t, this.keyName)[0] || "").slice(this.keyName.length + 1);
return this.canAdd(t, e) ? e : "";
}
}
const Ut = Dh;
function bs(n) {
const t = n.split("-"), e = t.slice(1).map((r) => r[0].toUpperCase() + r.slice(1)).join("");
return t[0] + e;
}
class jh extends Wt {
static keys(t) {
return (t.getAttribute("style") || "").split(";").map((e) => e.split(":")[0].trim());
}
add(t, e) {
return this.canAdd(t, e) ? (t.style[bs(this.keyName)] = e, !0) : !1;
}
remove(t) {
t.style[bs(this.keyName)] = "", t.getAttribute("style") || t.removeAttribute("style");
}
value(t) {
const e = t.style[bs(this.keyName)];
return this.canAdd(t, e) ? e : "";
}
}
const pe = jh;
class $h {
constructor(t) {
this.attributes = {}, this.domNode = t, this.build();
}
attribute(t, e) {
e ? t.add(this.domNode, e) && (t.value(this.domNode) != null ? this.attributes[t.attrName] = t : delete this.attributes[t.attrName]) : (t.remove(this.domNode), delete this.attributes[t.attrName]);
}
build() {
this.attributes = {};
const t = Je.find(this.domNode);
if (t == null)
return;
const e = Wt.keys(this.domNode), r = Ut.keys(this.domNode), s = pe.keys(this.domNode);
e.concat(r).concat(s).forEach((i) => {
const o = t.scroll.query(i, M.ATTRIBUTE);
o instanceof Wt && (this.attributes[o.attrName] = o);
});
}
copy(t) {
Object.keys(this.attributes).forEach((e) => {
const r = this.attributes[e].value(this.domNode);
t.format(e, r);
});
}
move(t) {
this.copy(t), Object.keys(this.attributes).forEach((e) => {
this.attributes[e].remove(this.domNode);
}), this.attributes = {};
}
values() {
return Object.keys(this.attributes).reduce(
(t, e) => (t[e] = this.attributes[e].value(this.domNode), t),
{}
);
}
}
const Nn = $h, $l = class {
constructor(t, e) {
this.scroll = t, this.domNode = e, Je.blots.set(e, this), this.prev = null, this.next = null;
}
static create(t) {
if (this.tagName == null)
throw new Xe("Blot definition missing tagName");
let e, r;
return Array.isArray(this.tagName) ? (typeof t == "string" ? (r = t.toUpperCase(), parseInt(r, 10).toString() === r && (r = parseInt(r, 10))) : typeof t == "number" && (r = t), typeof r == "number" ? e = document.createElement(this.tagName[r - 1]) : r && this.tagName.indexOf(r) > -1 ? e = document.createElement(r) : e = document.createElement(this.tagName[0])) : e = document.createElement(this.tagName), this.className && e.classList.add(this.className), e;
}
// Hack for accessing inherited static methods
get statics() {
return this.constructor;
}
attach() {
}
clone() {
const t = this.domNode.cloneNode(!1);
return this.scroll.create(t);
}
detach() {
this.parent != null && this.parent.removeChild(this), Je.blots.delete(this.domNode);
}
deleteAt(t, e) {
this.isolate(t, e).remove();
}
formatAt(t, e, r, s) {
const i = this.isolate(t, e);
if (this.scroll.query(r, M.BLOT) != null && s)
i.wrap(r, s);
else if (this.scroll.query(r, M.ATTRIBUTE) != null) {
const o = this.scroll.create(this.statics.scope);
i.wrap(o), o.format(r, s);
}
}
insertAt(t, e, r) {
const s = r == null ? this.scroll.create("text", e) : this.scroll.create(e, r), i = this.split(t);
this.parent.insertBefore(s, i || void 0);
}
isolate(t, e) {
const r = this.split(t);
if (r == null)
throw new Error("Attempt to isolate at end");
return r.split(e), r;
}
length() {
return 1;
}
offset(t = this.parent) {
return this.parent == null || this === t ? 0 : this.parent.children.offset(this) + this.parent.offset(t);
}
optimize(t) {
this.statics.requiredContainer && !(this.parent instanceof this.statics.requiredContainer) && this.wrap(this.statics.requiredContainer.blotName);
}
remove() {
this.domNode.parentNode != null && this.domNode.parentNode.removeChild(this.domNode), this.detach();
}
replaceWith(t, e) {
const r = typeof t == "string" ? this.scroll.create(t, e) : t;
return this.parent != null && (this.parent.insertBefore(r, this.next || void 0), this.remove()), r;
}
split(t, e) {
return t === 0 ? this : this.next;
}
update(t, e) {
}
wrap(t, e) {
const r = typeof t == "string" ? this.scroll.create(t, e) : t;
if (this.parent != null && this.parent.insertBefore(r, this.next || void 0), typeof r.appendChild != "function")
throw new Xe(`Cannot wrap ${t}`);
return r.appendChild(this), r;
}
};
$l.blotName = "abstract";
let Pl = $l;
const Ul = class extends Pl {
/**
* Returns the value represented by domNode if it is this Blot's type
* No checking that domNode can represent this Blot type is required so
* applications needing it should check externally before calling.
*/
static value(t) {
return !0;
}
/**
* Given location represented by node and offset from DOM Selection Range,
* return index to that location.
*/
index(t, e) {
return this.domNode === t || this.domNode.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_CONTAINED_BY ? Math.min(e, 1) : -1;
}
/**
* Given index to location within blot, return node and offset representing
* that location, consumable by DOM Selection Range
*/
position(t, e) {
let r = Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);
return t > 0 && (r += 1), [this.parent.domNode, r];
}
/**
* Return value represented by this blot
* Should not change without interaction from API or
* user change detectable by update()
*/
value() {
return {
[this.statics.blotName]: this.statics.value(this.domNode) || !0
};
}
};
Ul.scope = M.INLINE_BLOT;
let Ph = Ul;
const vt = Ph;
class Uh {
constructor() {
this.head = null, this.tail = null, this.length = 0;
}
append(...t) {
if (this.insertBefore(t[0], null), t.length > 1) {
const e = t.slice(1);
this.append(...e);
}
}
at(t) {
const e = this.iterator();
let r = e();
for (; r && t > 0; )
t -= 1, r = e();
return r;
}
contains(t) {
const e = this.iterator();
let r = e();
for (; r; ) {
if (r === t)
return !0;
r = e();
}
return !1;
}
indexOf(t) {
const e = this.iterator();
let r = e(), s = 0;
for (; r; ) {
if (r === t)
return s;
s += 1, r = e();
}
return -1;
}
insertBefore(t, e) {
t != null && (this.remove(t), t.next = e, e != null ? (t.prev = e.prev, e.prev != null && (e.prev.next = t), e.prev = t, e === this.head && (this.head = t)) : this.tail != null ? (this.tail.next = t, t.prev = this.tail, this.tail = t) : (t.prev = null, this.head = this.tail = t), this.length += 1);
}
offset(t) {
let e = 0, r = this.head;
for (; r != null; ) {
if (r === t)
return e;
e += r.length(), r = r.next;
}
return -1;
}
remove(t) {
this.contains(t) && (t.prev != null && (t.prev.next = t.next), t.next != null && (t.next.prev = t.prev), t === this.head && (this.head = t.next), t === this.tail && (this.tail = t.prev), this.length -= 1);
}
iterator(t = this.head) {
return () => {
const e = t;
return t != null && (t = t.next), e;
};
}
find(t, e = !1) {
const r = this.iterator();
let s = r();
for (; s; ) {
const i = s.length();
if (t < i || e && t === i && (s.next == null || s.next.length() !== 0))
return [s, t];
t -= i, s = r();
}
return [null, 0];
}
forEach(t) {
const e = this.iterator();
let r = e();
for (; r; )
t(r), r = e();
}
forEachAt(t, e, r) {
if (e <= 0)
return;
const [s, i] = this.find(t);
let o = t - i;
const a = this.iterator(s);
let u = a();
for (; u && o < t + e; ) {
const h = u.length();
t > o ? r(
u,
t - o,
Math.min(e, o + h - t)
) : r(u, 0, Math.min(h, t + e - o)), o += h, u = a();
}
}
map(t) {
return this.reduce((e, r) => (e.push(t(r)), e), []);
}
reduce(t, e) {
const r = this.iterator();
let s = r();
for (; s; )
e = t(e, s), s = r();
return e;
}
}
function Di(n, t) {
const e = t.find(n);
if (e)
return e;
try {
return t.create(n);
} catch {
const r = t.create(M.INLINE);
return Array.from(n.childNodes).forEach((s) => {
r.domNode.appendChild(s);
}), n.parentNode && n.parentNode.replaceChild(r.domNode, n), r.attach(), r;
}
}
const Fl = class ae extends Pl {
constructor(t, e) {
super(t, e), this.uiNode = null, this.build();
}
appendChild(t) {
this.insertBefore(t);
}
attach() {
super.attach(), this.children.forEach((t) => {
t.attach();
});
}
attachUI(t) {
this.uiNode != null && this.uiNode.remove(), this.uiNode = t, ae.uiClass && this.uiNode.classList.add(ae.uiClass), this.uiNode.setAttribute("contenteditable", "false"), this.domNode.insertBefore(this.uiNode, this.domNode.firstChild);
}
/**
* Called during construction, should fill its own children LinkedList.
*/
build() {
this.children = new Uh(), Array.from(this.domNode.childNodes).filter((t) => t !== this.uiNode).reverse().forEach((t) => {
try {
const e = Di(t, this.scroll);
this.insertBefore(e, this.children.head || void 0);
} catch (e) {
if (e instanceof Xe)
return;
throw e;
}
});
}
deleteAt(t, e) {
if (t === 0 && e === this.length())
return this.remove();
this.children.forEachAt(t, e, (r, s, i) => {
r.deleteAt(s, i);
});
}
descendant(t, e = 0) {
const [r, s] = this.children.find(e);
return t.blotName == null && t(r) || t.blotName != null && r instanceof t ? [r, s] : r instanceof ae ? r.descendant(t, s) : [null, -1];
}
descendants(t, e = 0, r = Number.MAX_VALUE) {
let s = [], i = r;
return this.children.forEachAt(
e,
r,
(o, a, u) => {
(t.blotName == null && t(o) || t.blotName != null && o instanceof t) && s.push(o), o instanceof ae && (s = s.concat(
o.descendants(t, a, i)
)), i -= u;
}
), s;
}
detach() {
this.children.forEach((t) => {
t.detach();
}), super.detach();
}
enforceAllowedChildren() {
let t = !1;
this.children.forEach((e) => {
t || this.statics.allowedChildren.some(
(r) => e instanceof r
) || (e.statics.scope === M.BLOCK_BLOT ? (e.next != null && this.splitAfter(e), e.prev != null && this.splitAfter(e.prev), e.parent.unwrap(), t = !0) : e instanceof ae ? e.unwrap() : e.remove());
});
}
formatAt(t, e, r, s) {
this.children.forEachAt(t, e, (i, o, a) => {
i.formatAt(o, a, r, s);
});
}
insertAt(t, e, r) {
const [s, i] = this.children.find(t);
if (s)
s.insertAt(i, e, r);
else {
const o = r == null ? this.scroll.create("text", e) : this.scroll.create(e, r);
this.appendChild(o);
}
}
insertBefore(t, e) {
t.parent != null && t.parent.children.remove(t);
let r = null;
this.children.insertBefore(t, e || null), t.parent = this, e != null && (r = e.domNode), (this.domNode.parentNode !== t.domNode || this.domNode.nextSibling !== r) && this.domNode.insertBefore(t.domNode, r), t.attach();
}
length() {
return this.children.reduce((t, e) => t + e.length(), 0);
}
moveChildren(t, e) {
this.children.forEach((r) => {
t.insertBefore(r, e);
});
}
optimize(t) {
if (super.optimize(t), this.enforceAllowedChildren(), this.uiNode != null && this.uiNode !== this.domNode.firstChild && this.domNode.insertBefore(this.uiNode, this.domNode.firstChild), this.children.length === 0)
if (this.statics.defaultChild != null) {
const e = this.scroll.create(this.statics.defaultChild.blotName);
this.appendChild(e);
} else
this.remove();
}
path(t, e = !1) {
const [r, s] = this.children.find(t, e), i = [[this, t]];
return r instanceof ae ? i.concat(r.path(s, e)) : (r != null && i.push([r, s]), i);
}
removeChild(t) {
this.children.remove(t);
}
replaceWith(t, e) {
const r = typeof t == "string" ? this.scroll.create(t, e) : t;
return r instanceof ae && this.moveChildren(r), super.replaceWith(r);
}
split(t, e = !1) {
if (!e) {
if (t === 0)
return this;
if (t === this.length())
return this.next;
}
const r = this.clone();
return this.parent && this.parent.insertBefore(r, this.next || void 0), this.children.forEachAt(t, this.length(), (s, i, o) => {
const a = s.split(i, e);
a != null && r.appendChild(a);
}), r;
}
splitAfter(t) {
const e = this.clone();
for (; t.next != null; )
e.appendChild(t.next);
return this.parent && this.parent.insertBefore(e, this.next || void 0), e;
}
unwrap() {
this.parent && this.moveChildren(this.parent, this.next || void 0), this.remove();
}
update(t, e) {
const r = [], s = [];
t.forEach((i) => {
i.target === this.domNode && i.type === "childList" && (r.push(...i.addedNodes), s.push(...i.removedNodes));
}), s.forEach((i) => {
if (i.parentNode != null && // @ts-expect-error Fix me later
i.tagName !== "IFRAME" && document.body.compareDocumentPosition(i) & Node.DOCUMENT_POSITION_CONTAINED_BY)
return;
const o = this.scroll.find(i);
o != null && (o.domNode.parentNode == null || o.domNode.parentNode === this.domNode) && o.detach();
}), r.filter((i) => i.parentNode === this.domNode && i !== this.uiNode).sort((i, o) => i === o ? 0 : i.compareDocumentPosition(o) & Node.DOCUMENT_POSITION_FOLLOWING ? 1 : -1).forEach((i) => {
let o = null;
i.nextSibling != null && (o = this.scroll.find(i.nextSibling));
const a = Di(i, this.scroll);
(a.next !== o || a.next == null) && (a.parent != null && a.parent.removeChild(this), this.insertBefore(a, o || void 0));
}), this.enforceAllowedChildren();
}
};
Fl.uiClass = "";
let Fh = Fl;
const $t = Fh;
function Hh(n, t) {
if (Object.keys(n).length !== Object.keys(t).length)
return !1;
for (const e in n)
if (n[e] !== t[e])
return !1;
return !0;
}
const ze = class Ke extends $t {
static create(t) {
return super.create(t);
}
static formats(t, e) {
const r = e.query(Ke.blotName);
if (!(r != null && t.tagName === r.tagName)) {
if (typeof this.tagName == "string")
return !0;
if (Array.isArray(this.tagName))
return t.tagName.toLowerCase();
}
}
constructor(t, e) {
super(t, e), this.attributes = new Nn(this.domNode);
}
format(t, e) {
if (t === this.statics.blotName && !e)
this.children.forEach((r) => {
r instanceof Ke || (r = r.wrap(Ke.blotName, !0)), this.attributes.copy(r);
}), this.unwrap();
else {
const r = this.scroll.query(t, M.INLINE);
if (r == null)
return;
r instanceof Wt ? this.attributes.attribute(r, e) : e && (t !== this.statics.blotName || this.formats()[t] !== e) && this.replaceWith(t, e);
}
}
formats() {
const t = this.attributes.values(), e = this.statics.formats(this.domNode, this.scroll);
return e != null && (t[this.statics.blotName] = e), t;
}
formatAt(t, e, r, s) {
this.formats()[r] != null || this.scroll.query(r, M.ATTRIBUTE) ? this.isolate(t, e).format(r, s) : super.formatAt(t, e, r, s);
}
optimize(t) {
super.optimize(t);
const e = this.formats();
if (Object.keys(e).length === 0)
return this.unwrap();
const r = this.next;
r instanceof Ke && r.prev === this && Hh(e, r.formats()) && (r.moveChildren(this), r.remove());
}
replaceWith(t, e) {
const r = super.replaceWith(t, e);
return this.attributes.copy(r), r;
}
update(t, e) {
super.update(t, e), t.some(
(r) => r.target === this.domNode && r.type === "attributes"
) && this.attributes.build();
}
wrap(t, e) {
const r = super.wrap(t, e);
return r instanceof Ke && this.attributes.move(r), r;
}
};
ze.allowedChildren = [ze, vt], ze.blotName = "inline", ze.scope = M.INLINE_BLOT, ze.tagName = "SPAN";
let zh = ze;
const Ys = zh, Ge = class Ds extends $t {
static create(t) {
return super.create(t);
}
static formats(t, e) {
const r = e.query(Ds.blotName);
if (!(r != null && t.tagName === r.tagName)) {
if (typeof this.tagName == "string")
return !0;
if (Array.isArray(this.tagName))
return t.tagName.toLowerCase();
}
}
constructor(t, e) {
super(t, e), this.attributes = new Nn(this.domNode);
}
format(t, e) {
const r = this.scroll.query(t, M.BLOCK);
r != null && (r instanceof Wt ? this.attributes.attribute(r, e) : t === this.statics.blotName && !e ? this.replaceWith(Ds.blotName) : e && (t !== this.statics.blotName || this.formats()[t] !== e) && this.replaceWith(t, e));
}
formats() {
const t = this.attributes.values(), e = this.statics.formats(this.domNode, this.scroll);
return e != null && (t[this.statics.blotName] = e), t;
}
formatAt(t, e, r, s) {
this.scroll.query(r, M.BLOCK) != null ? this.format(r, s) : super.formatAt(t, e, r, s);
}
insertAt(t, e, r) {
if (r == null || this.scroll.query(e, M.INLINE) != null)
super.insertAt(t, e, r);
else {
const s = this.split(t);
if (s != null) {
const i = this.scroll.create(e, r);
s.parent.insertBefore(i, s);
} else
throw new Error("Attempt to insertAt after block boundaries");
}
}
replaceWith(t, e) {
const r = super.replaceWith(t, e);
return this.attributes.copy(r), r;
}
update(t, e) {
super.update(t, e), t.some(
(r) => r.target === this.domNode && r.type === "attributes"
) && this.attributes.build();
}
};
Ge.blotName = "block", Ge.scope = M.BLOCK_BLOT, Ge.tagName = "P", Ge.allowedChildren = [
Ys,
Ge,
vt
];
let Kh = Ge;
const Sr = Kh, js = class extends $t {
checkMerge() {
return this.next !== null && this.next.statics.blotName === this.statics.blotName;
}
deleteAt(t, e) {
super.deleteAt(t, e), this.enforceAllowedChildren();
}
formatAt(t, e, r, s) {
super.formatAt(t, e, r, s), this.enforceAllowedChildren();
}
insertAt(t, e, r) {
super.insertAt(t, e, r), this.enforceAllowedChildren();
}
optimize(t) {
super.optimize(t), this.children.length > 0 && this.next != null && this.checkMerge() && (this.next.moveChildren(this), this.next.remove());
}
};
js.blotName = "container", js.scope = M.BLOCK_BLOT;
let Gh = js;
const wn = Gh;
class Vh extends vt {
static formats(t, e) {
}
format(t, e) {
super.formatAt(0, this.length(), t, e);
}
formatAt(t, e, r, s) {
t === 0 && e === this.length() ? this.format(r, s) : super.formatAt(t, e, r, s);
}
formats() {
return this.statics.formats(this.domNode, this.scroll);
}
}
const _t = Vh, Wh = {
attributes: !0,
characterData: !0,
characterDataOldValue: !0,
childList: !0,
subtree: !0
}, Zh = 100, Ve = class extends $t {
constructor(t, e) {
super(null, e), this.registry = t, this.scroll = this, this.build(), this.observer = new MutationObserver((r) => {
this.update(r);
}), this.observer.observe(this.domNode, Wh), this.attach();
}
create(t, e) {
return this.registry.create(this, t, e);
}
find(t, e = !1) {
const r = this.registry.find(t, e);
return r ? r.scroll === this ? r : e ? this.find(r.scroll.domNode.parentNode, !0) : null : null;
}
query(t, e = M.ANY) {
return this.registry.query(t, e);
}
register(...t) {
return this.registry.register(...t);
}
build() {
this.scroll != null && super.build();
}
detach() {
super.detach(), this.observer.disconnect();
}
deleteAt(t, e) {
this.update(), t === 0 && e === this.length() ? this.children.forEach((r) => {
r.remove();
}) : super.deleteAt(t, e);
}
formatAt(t, e, r, s) {
this.update(), super.formatAt(t, e, r, s);
}
insertAt(t, e, r) {
this.update(), super.insertAt(t, e, r);
}
optimize(t = [], e = {}) {
super.optimize(e);
const r = e.mutationsMap || /* @__PURE__ */ new WeakMap();
let s = Array.from(this.observer.takeRecords());
for (; s.length > 0; )
t.push(s.pop());
const i = (u, h = !0) => {
u == null || u === this || u.domNode.parentNode != null && (r.has(u.domNode) || r.set(u.domNode, []), h && i(u.parent));
}, o = (u) => {
r.has(u.domNode) && (u instanceof $t && u.children.forEach(o), r.delete(u.domNode), u.optimize(e));
};
let a = t;
for (let u = 0; a.length > 0; u += 1) {
if (u >= Zh)
th