Files
enlight-lms/lms/public/frontend/assets/frappe-ui.8966d601.js
T
2023-12-05 22:39:00 +05:30

43902 lines
1.0 MiB
Plaintext

var $y = Object.defineProperty,
zy = Object.defineProperties;
var Hy = Object.getOwnPropertyDescriptors;
var Ms = Object.getOwnPropertySymbols;
var Hf = Object.prototype.hasOwnProperty,
Ff = Object.prototype.propertyIsEnumerable;
var Xa = (t, e, n) =>
e in t
? $y(t, e, {
enumerable: !0,
configurable: !0,
writable: !0,
value: n,
})
: (t[e] = n),
W = (t, e) => {
for (var n in e || (e = {})) Hf.call(e, n) && Xa(t, n, e[n]);
if (Ms) for (var n of Ms(e)) Ff.call(e, n) && Xa(t, n, e[n]);
return t;
},
be = (t, e) => zy(t, Hy(e));
var Qe = (t, e) => {
var n = {};
for (var r in t) Hf.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]);
if (t != null && Ms)
for (var r of Ms(t)) e.indexOf(r) < 0 && Ff.call(t, r) && (n[r] = t[r]);
return n;
};
var Za = (t, e, n) => (Xa(t, typeof e != "symbol" ? e + "" : e, n), n);
var cr = (t, e, n) =>
new Promise((r, i) => {
var o = (a) => {
try {
l(n.next(a));
} catch (u) {
i(u);
}
},
s = (a) => {
try {
l(n.throw(a));
} catch (u) {
i(u);
}
},
l = (a) =>
a.done ? r(a.value) : Promise.resolve(a.value).then(o, s);
l((n = n.apply(t, e)).next());
});
function id(t, e) {
const n = Object.create(null),
r = t.split(",");
for (let i = 0; i < r.length; i++) n[r[i]] = !0;
return e ? (i) => !!n[i.toLowerCase()] : (i) => !!n[i];
}
const rt = {},
Li = [],
On = () => {},
Fy = () => !1,
Vy = /^on[^a-z]/,
va = (t) => Vy.test(t),
od = (t) => t.startsWith("onUpdate:"),
_t = Object.assign,
sd = (t, e) => {
const n = t.indexOf(e);
n > -1 && t.splice(n, 1);
},
Wy = Object.prototype.hasOwnProperty,
We = (t, e) => Wy.call(t, e),
we = Array.isArray,
Di = (t) => wa(t) === "[object Map]",
jm = (t) => wa(t) === "[object Set]",
Ee = (t) => typeof t == "function",
at = (t) => typeof t == "string",
ba = (t) => typeof t == "symbol",
it = (t) => t !== null && typeof t == "object",
Lm = (t) => (it(t) || Ee(t)) && Ee(t.then) && Ee(t.catch),
Dm = Object.prototype.toString,
wa = (t) => Dm.call(t),
Uy = (t) => wa(t).slice(8, -1),
Im = (t) => wa(t) === "[object Object]",
ld = (t) =>
at(t) && t !== "NaN" && t[0] !== "-" && "" + parseInt(t, 10) === t,
il = id(
",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
),
xa = (t) => {
const e = Object.create(null);
return (n) => e[n] || (e[n] = t(n));
},
Ky = /-(\w)/g,
Jn = xa((t) => t.replace(Ky, (e, n) => (n ? n.toUpperCase() : ""))),
qy = /\B([A-Z])/g,
xi = xa((t) => t.replace(qy, "-$1").toLowerCase()),
ka = xa((t) => t.charAt(0).toUpperCase() + t.slice(1)),
eu = xa((t) => (t ? `on${ka(t)}` : "")),
pi = (t, e) => !Object.is(t, e),
tu = (t, e) => {
for (let n = 0; n < t.length; n++) t[n](e);
},
yl = (t, e, n) => {
Object.defineProperty(t, e, {
configurable: !0,
enumerable: !1,
value: n,
});
},
Jy = (t) => {
const e = parseFloat(t);
return isNaN(e) ? t : e;
},
Gy = (t) => {
const e = at(t) ? Number(t) : NaN;
return isNaN(e) ? t : e;
};
let Vf;
const Ju = () =>
Vf ||
(Vf =
typeof globalThis != "undefined"
? globalThis
: typeof self != "undefined"
? self
: typeof window != "undefined"
? window
: typeof global != "undefined"
? global
: {});
function Ir(t) {
if (we(t)) {
const e = {};
for (let n = 0; n < t.length; n++) {
const r = t[n],
i = at(r) ? Zy(r) : Ir(r);
if (i) for (const o in i) e[o] = i[o];
}
return e;
} else if (at(t) || it(t)) return t;
}
const Yy = /;(?![^(]*\))/g,
Qy = /:([^]+)/,
Xy = /\/\*[^]*?\*\//g;
function Zy(t) {
const e = {};
return (
t
.replace(Xy, "")
.split(Yy)
.forEach((n) => {
if (n) {
const r = n.split(Qy);
r.length > 1 && (e[r[0].trim()] = r[1].trim());
}
}),
e
);
}
function ye(t) {
let e = "";
if (at(t)) e = t;
else if (we(t))
for (let n = 0; n < t.length; n++) {
const r = ye(t[n]);
r && (e += r + " ");
}
else if (it(t)) for (const n in t) t[n] && (e += n + " ");
return e.trim();
}
function Dt(t) {
if (!t) return null;
let { class: e, style: n } = t;
return e && !at(e) && (t.class = ye(e)), n && (t.style = Ir(n)), t;
}
const e2 =
"itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",
t2 = id(e2);
function Bm(t) {
return !!t || t === "";
}
const Ge = (t) =>
at(t)
? t
: t == null
? ""
: we(t) || (it(t) && (t.toString === Dm || !Ee(t.toString)))
? JSON.stringify(t, $m, 2)
: String(t),
$m = (t, e) =>
e && e.__v_isRef
? $m(t, e.value)
: Di(e)
? {
[`Map(${e.size})`]: [...e.entries()].reduce(
(n, [r, i]) => ((n[`${r} =>`] = i), n),
{}
),
}
: jm(e)
? { [`Set(${e.size})`]: [...e.values()] }
: it(e) && !we(e) && !Im(e)
? String(e)
: e;
let rn;
class n2 {
constructor(e = !1) {
(this.detached = e),
(this._active = !0),
(this.effects = []),
(this.cleanups = []),
(this.parent = rn),
!e &&
rn &&
(this.index = (rn.scopes || (rn.scopes = [])).push(this) - 1);
}
get active() {
return this._active;
}
run(e) {
if (this._active) {
const n = rn;
try {
return (rn = this), e();
} finally {
rn = n;
}
}
}
on() {
rn = this;
}
off() {
rn = this.parent;
}
stop(e) {
if (this._active) {
let n, r;
for (n = 0, r = this.effects.length; n < r; n++)
this.effects[n].stop();
for (n = 0, r = this.cleanups.length; n < r; n++)
this.cleanups[n]();
if (this.scopes)
for (n = 0, r = this.scopes.length; n < r; n++)
this.scopes[n].stop(!0);
if (!this.detached && this.parent && !e) {
const i = this.parent.scopes.pop();
i &&
i !== this &&
((this.parent.scopes[this.index] = i),
(i.index = this.index));
}
(this.parent = void 0), (this._active = !1);
}
}
}
function r2(t, e = rn) {
e && e.active && e.effects.push(t);
}
function zm() {
return rn;
}
function i2(t) {
rn && rn.cleanups.push(t);
}
const ad = (t) => {
const e = new Set(t);
return (e.w = 0), (e.n = 0), e;
},
Hm = (t) => (t.w & jr) > 0,
Fm = (t) => (t.n & jr) > 0,
o2 = ({ deps: t }) => {
if (t.length) for (let e = 0; e < t.length; e++) t[e].w |= jr;
},
s2 = (t) => {
const { deps: e } = t;
if (e.length) {
let n = 0;
for (let r = 0; r < e.length; r++) {
const i = e[r];
Hm(i) && !Fm(i) ? i.delete(t) : (e[n++] = i),
(i.w &= ~jr),
(i.n &= ~jr);
}
e.length = n;
}
},
Gu = new WeakMap();
let Co = 0,
jr = 1;
const Yu = 30;
let Mn;
const oi = Symbol(""),
Qu = Symbol("");
class ud {
constructor(e, n = null, r) {
(this.fn = e),
(this.scheduler = n),
(this.active = !0),
(this.deps = []),
(this.parent = void 0),
r2(this, r);
}
run() {
if (!this.active) return this.fn();
let e = Mn,
n = Tr;
for (; e; ) {
if (e === this) return;
e = e.parent;
}
try {
return (
(this.parent = Mn),
(Mn = this),
(Tr = !0),
(jr = 1 << ++Co),
Co <= Yu ? o2(this) : Wf(this),
this.fn()
);
} finally {
Co <= Yu && s2(this),
(jr = 1 << --Co),
(Mn = this.parent),
(Tr = n),
(this.parent = void 0),
this.deferStop && this.stop();
}
}
stop() {
Mn === this
? (this.deferStop = !0)
: this.active &&
(Wf(this), this.onStop && this.onStop(), (this.active = !1));
}
}
function Wf(t) {
const { deps: e } = t;
if (e.length) {
for (let n = 0; n < e.length; n++) e[n].delete(t);
e.length = 0;
}
}
let Tr = !0;
const Vm = [];
function io() {
Vm.push(Tr), (Tr = !1);
}
function oo() {
const t = Vm.pop();
Tr = t === void 0 ? !0 : t;
}
function tn(t, e, n) {
if (Tr && Mn) {
let r = Gu.get(t);
r || Gu.set(t, (r = new Map()));
let i = r.get(n);
i || r.set(n, (i = ad())), Wm(i);
}
}
function Wm(t, e) {
let n = !1;
Co <= Yu ? Fm(t) || ((t.n |= jr), (n = !Hm(t))) : (n = !t.has(Mn)),
n && (t.add(Mn), Mn.deps.push(t));
}
function or(t, e, n, r, i, o) {
const s = Gu.get(t);
if (!s) return;
let l = [];
if (e === "clear") l = [...s.values()];
else if (n === "length" && we(t)) {
const a = Number(r);
s.forEach((u, c) => {
(c === "length" || (!ba(c) && c >= a)) && l.push(u);
});
} else
switch ((n !== void 0 && l.push(s.get(n)), e)) {
case "add":
we(t)
? ld(n) && l.push(s.get("length"))
: (l.push(s.get(oi)), Di(t) && l.push(s.get(Qu)));
break;
case "delete":
we(t) || (l.push(s.get(oi)), Di(t) && l.push(s.get(Qu)));
break;
case "set":
Di(t) && l.push(s.get(oi));
break;
}
if (l.length === 1) l[0] && Xu(l[0]);
else {
const a = [];
for (const u of l) u && a.push(...u);
Xu(ad(a));
}
}
function Xu(t, e) {
const n = we(t) ? t : [...t];
for (const r of n) r.computed && Uf(r);
for (const r of n) r.computed || Uf(r);
}
function Uf(t, e) {
(t !== Mn || t.allowRecurse) && (t.scheduler ? t.scheduler() : t.run());
}
const l2 = id("__proto__,__v_isRef,__isVue"),
Um = new Set(
Object.getOwnPropertyNames(Symbol)
.filter((t) => t !== "arguments" && t !== "caller")
.map((t) => Symbol[t])
.filter(ba)
),
Kf = a2();
function a2() {
const t = {};
return (
["includes", "indexOf", "lastIndexOf"].forEach((e) => {
t[e] = function (...n) {
const r = de(this);
for (let o = 0, s = this.length; o < s; o++)
tn(r, "get", o + "");
const i = r[e](...n);
return i === -1 || i === !1 ? r[e](...n.map(de)) : i;
};
}),
["push", "pop", "shift", "unshift", "splice"].forEach((e) => {
t[e] = function (...n) {
io();
const r = de(this)[e].apply(this, n);
return oo(), r;
};
}),
t
);
}
function u2(t) {
const e = de(this);
return tn(e, "has", t), e.hasOwnProperty(t);
}
class Km {
constructor(e = !1, n = !1) {
(this._isReadonly = e), (this._shallow = n);
}
get(e, n, r) {
const i = this._isReadonly,
o = this._shallow;
if (n === "__v_isReactive") return !i;
if (n === "__v_isReadonly") return i;
if (n === "__v_isShallow") return o;
if (n === "__v_raw" && r === (i ? (o ? k2 : Ym) : o ? Gm : Jm).get(e))
return e;
const s = we(e);
if (!i) {
if (s && We(Kf, n)) return Reflect.get(Kf, n, r);
if (n === "hasOwnProperty") return u2;
}
const l = Reflect.get(e, n, r);
return (ba(n) ? Um.has(n) : l2(n)) || (i || tn(e, "get", n), o)
? l
: Ht(l)
? s && ld(n)
? l
: l.value
: it(l)
? i
? Xm(l)
: Sn(l)
: l;
}
}
class qm extends Km {
constructor(e = !1) {
super(!1, e);
}
set(e, n, r, i) {
let o = e[n];
if (Wi(o) && Ht(o) && !Ht(r)) return !1;
if (
!this._shallow &&
(!vl(r) && !Wi(r) && ((o = de(o)), (r = de(r))),
!we(e) && Ht(o) && !Ht(r))
)
return (o.value = r), !0;
const s = we(e) && ld(n) ? Number(n) < e.length : We(e, n),
l = Reflect.set(e, n, r, i);
return (
e === de(i) &&
(s ? pi(r, o) && or(e, "set", n, r) : or(e, "add", n, r)),
l
);
}
deleteProperty(e, n) {
const r = We(e, n);
e[n];
const i = Reflect.deleteProperty(e, n);
return i && r && or(e, "delete", n, void 0), i;
}
has(e, n) {
const r = Reflect.has(e, n);
return (!ba(n) || !Um.has(n)) && tn(e, "has", n), r;
}
ownKeys(e) {
return tn(e, "iterate", we(e) ? "length" : oi), Reflect.ownKeys(e);
}
}
class c2 extends Km {
constructor(e = !1) {
super(!0, e);
}
set(e, n) {
return !0;
}
deleteProperty(e, n) {
return !0;
}
}
const d2 = new qm(),
f2 = new c2(),
h2 = new qm(!0),
cd = (t) => t,
Ca = (t) => Reflect.getPrototypeOf(t);
function Es(t, e, n = !1, r = !1) {
t = t.__v_raw;
const i = de(t),
o = de(e);
n || (pi(e, o) && tn(i, "get", e), tn(i, "get", o));
const { has: s } = Ca(i),
l = r ? cd : n ? hd : Uo;
if (s.call(i, e)) return l(t.get(e));
if (s.call(i, o)) return l(t.get(o));
t !== i && t.get(e);
}
function As(t, e = !1) {
const n = this.__v_raw,
r = de(n),
i = de(t);
return (
e || (pi(t, i) && tn(r, "has", t), tn(r, "has", i)),
t === i ? n.has(t) : n.has(t) || n.has(i)
);
}
function Ts(t, e = !1) {
return (
(t = t.__v_raw),
!e && tn(de(t), "iterate", oi),
Reflect.get(t, "size", t)
);
}
function qf(t) {
t = de(t);
const e = de(this);
return Ca(e).has.call(e, t) || (e.add(t), or(e, "add", t, t)), this;
}
function Jf(t, e) {
e = de(e);
const n = de(this),
{ has: r, get: i } = Ca(n);
let o = r.call(n, t);
o || ((t = de(t)), (o = r.call(n, t)));
const s = i.call(n, t);
return (
n.set(t, e),
o ? pi(e, s) && or(n, "set", t, e) : or(n, "add", t, e),
this
);
}
function Gf(t) {
const e = de(this),
{ has: n, get: r } = Ca(e);
let i = n.call(e, t);
i || ((t = de(t)), (i = n.call(e, t))), r && r.call(e, t);
const o = e.delete(t);
return i && or(e, "delete", t, void 0), o;
}
function Yf() {
const t = de(this),
e = t.size !== 0,
n = t.clear();
return e && or(t, "clear", void 0, void 0), n;
}
function Os(t, e) {
return function (r, i) {
const o = this,
s = o.__v_raw,
l = de(s),
a = e ? cd : t ? hd : Uo;
return (
!t && tn(l, "iterate", oi),
s.forEach((u, c) => r.call(i, a(u), a(c), o))
);
};
}
function Rs(t, e, n) {
return function (...r) {
const i = this.__v_raw,
o = de(i),
s = Di(o),
l = t === "entries" || (t === Symbol.iterator && s),
a = t === "keys" && s,
u = i[t](...r),
c = n ? cd : e ? hd : Uo;
return (
!e && tn(o, "iterate", a ? Qu : oi),
{
next() {
const { value: f, done: h } = u.next();
return h
? { value: f, done: h }
: { value: l ? [c(f[0]), c(f[1])] : c(f), done: h };
},
[Symbol.iterator]() {
return this;
},
}
);
};
}
function dr(t) {
return function (...e) {
return t === "delete" ? !1 : t === "clear" ? void 0 : this;
};
}
function p2() {
const t = {
get(o) {
return Es(this, o);
},
get size() {
return Ts(this);
},
has: As,
add: qf,
set: Jf,
delete: Gf,
clear: Yf,
forEach: Os(!1, !1),
},
e = {
get(o) {
return Es(this, o, !1, !0);
},
get size() {
return Ts(this);
},
has: As,
add: qf,
set: Jf,
delete: Gf,
clear: Yf,
forEach: Os(!1, !0),
},
n = {
get(o) {
return Es(this, o, !0);
},
get size() {
return Ts(this, !0);
},
has(o) {
return As.call(this, o, !0);
},
add: dr("add"),
set: dr("set"),
delete: dr("delete"),
clear: dr("clear"),
forEach: Os(!0, !1),
},
r = {
get(o) {
return Es(this, o, !0, !0);
},
get size() {
return Ts(this, !0);
},
has(o) {
return As.call(this, o, !0);
},
add: dr("add"),
set: dr("set"),
delete: dr("delete"),
clear: dr("clear"),
forEach: Os(!0, !0),
};
return (
["keys", "values", "entries", Symbol.iterator].forEach((o) => {
(t[o] = Rs(o, !1, !1)),
(n[o] = Rs(o, !0, !1)),
(e[o] = Rs(o, !1, !0)),
(r[o] = Rs(o, !0, !0));
}),
[t, n, e, r]
);
}
const [m2, g2, y2, v2] = p2();
function dd(t, e) {
const n = e ? (t ? v2 : y2) : t ? g2 : m2;
return (r, i, o) =>
i === "__v_isReactive"
? !t
: i === "__v_isReadonly"
? t
: i === "__v_raw"
? r
: Reflect.get(We(n, i) && i in r ? n : r, i, o);
}
const b2 = { get: dd(!1, !1) },
w2 = { get: dd(!1, !0) },
x2 = { get: dd(!0, !1) },
Jm = new WeakMap(),
Gm = new WeakMap(),
Ym = new WeakMap(),
k2 = new WeakMap();
function C2(t) {
switch (t) {
case "Object":
case "Array":
return 1;
case "Map":
case "Set":
case "WeakMap":
case "WeakSet":
return 2;
default:
return 0;
}
}
function S2(t) {
return t.__v_skip || !Object.isExtensible(t) ? 0 : C2(Uy(t));
}
function Sn(t) {
return Wi(t) ? t : fd(t, !1, d2, b2, Jm);
}
function Qm(t) {
return fd(t, !1, h2, w2, Gm);
}
function Xm(t) {
return fd(t, !0, f2, x2, Ym);
}
function fd(t, e, n, r, i) {
if (!it(t) || (t.__v_raw && !(e && t.__v_isReactive))) return t;
const o = i.get(t);
if (o) return o;
const s = S2(t);
if (s === 0) return t;
const l = new Proxy(t, s === 2 ? r : n);
return i.set(t, l), l;
}
function Ii(t) {
return Wi(t) ? Ii(t.__v_raw) : !!(t && t.__v_isReactive);
}
function Wi(t) {
return !!(t && t.__v_isReadonly);
}
function vl(t) {
return !!(t && t.__v_isShallow);
}
function Zm(t) {
return Ii(t) || Wi(t);
}
function de(t) {
const e = t && t.__v_raw;
return e ? de(e) : t;
}
function eg(t) {
return yl(t, "__v_skip", !0), t;
}
const Uo = (t) => (it(t) ? Sn(t) : t),
hd = (t) => (it(t) ? Xm(t) : t);
function tg(t) {
Tr && Mn && ((t = de(t)), Wm(t.dep || (t.dep = ad())));
}
function ng(t, e) {
t = de(t);
const n = t.dep;
n && Xu(n);
}
function Ht(t) {
return !!(t && t.__v_isRef === !0);
}
function oe(t) {
return ig(t, !1);
}
function rg(t) {
return ig(t, !0);
}
function ig(t, e) {
return Ht(t) ? t : new _2(t, e);
}
class _2 {
constructor(e, n) {
(this.__v_isShallow = n),
(this.dep = void 0),
(this.__v_isRef = !0),
(this._rawValue = n ? e : de(e)),
(this._value = n ? e : Uo(e));
}
get value() {
return tg(this), this._value;
}
set value(e) {
const n = this.__v_isShallow || vl(e) || Wi(e);
(e = n ? e : de(e)),
pi(e, this._rawValue) &&
((this._rawValue = e), (this._value = n ? e : Uo(e)), ng(this));
}
}
function ne(t) {
return Ht(t) ? t.value : t;
}
const M2 = {
get: (t, e, n) => ne(Reflect.get(t, e, n)),
set: (t, e, n, r) => {
const i = t[e];
return Ht(i) && !Ht(n) ? ((i.value = n), !0) : Reflect.set(t, e, n, r);
},
};
function og(t) {
return Ii(t) ? t : new Proxy(t, M2);
}
class E2 {
constructor(e, n, r, i) {
(this._setter = n),
(this.dep = void 0),
(this.__v_isRef = !0),
(this.__v_isReadonly = !1),
(this._dirty = !0),
(this.effect = new ud(e, () => {
this._dirty || ((this._dirty = !0), ng(this));
})),
(this.effect.computed = this),
(this.effect.active = this._cacheable = !i),
(this.__v_isReadonly = r);
}
get value() {
const e = de(this);
return (
tg(e),
(e._dirty || !e._cacheable) &&
((e._dirty = !1), (e._value = e.effect.run())),
e._value
);
}
set value(e) {
this._setter(e);
}
}
function Zu(t, e, n = !1) {
let r, i;
const o = Ee(t);
return (
o ? ((r = t), (i = On)) : ((r = t.get), (i = t.set)),
new E2(r, i, o || !i, n)
);
}
function Or(t, e, n, r) {
let i;
try {
i = r ? t(...r) : t();
} catch (o) {
cs(o, e, n);
}
return i;
}
function gn(t, e, n, r) {
if (Ee(t)) {
const o = Or(t, e, n, r);
return (
o &&
Lm(o) &&
o.catch((s) => {
cs(s, e, n);
}),
o
);
}
const i = [];
for (let o = 0; o < t.length; o++) i.push(gn(t[o], e, n, r));
return i;
}
function cs(t, e, n, r = !0) {
const i = e ? e.vnode : null;
if (e) {
let o = e.parent;
const s = e.proxy,
l = n;
for (; o; ) {
const u = o.ec;
if (u) {
for (let c = 0; c < u.length; c++)
if (u[c](t, s, l) === !1) return;
}
o = o.parent;
}
const a = e.appContext.config.errorHandler;
if (a) {
Or(a, null, 10, [t, s, l]);
return;
}
}
A2(t, n, i, r);
}
function A2(t, e, n, r = !0) {
console.error(t);
}
let Ko = !1,
ec = !1;
const zt = [];
let Vn = 0;
const Bi = [];
let rr = null,
Yr = 0;
const sg = Promise.resolve();
let pd = null;
function Ct(t) {
const e = pd || sg;
return t ? e.then(this ? t.bind(this) : t) : e;
}
function T2(t) {
let e = Vn + 1,
n = zt.length;
for (; e < n; ) {
const r = (e + n) >>> 1,
i = zt[r],
o = qo(i);
o < t || (o === t && i.pre) ? (e = r + 1) : (n = r);
}
return e;
}
function Sa(t) {
(!zt.length || !zt.includes(t, Ko && t.allowRecurse ? Vn + 1 : Vn)) &&
(t.id == null ? zt.push(t) : zt.splice(T2(t.id), 0, t), lg());
}
function lg() {
!Ko && !ec && ((ec = !0), (pd = sg.then(ug)));
}
function O2(t) {
const e = zt.indexOf(t);
e > Vn && zt.splice(e, 1);
}
function R2(t) {
we(t)
? Bi.push(...t)
: (!rr || !rr.includes(t, t.allowRecurse ? Yr + 1 : Yr)) && Bi.push(t),
lg();
}
function Qf(t, e = Ko ? Vn + 1 : 0) {
for (; e < zt.length; e++) {
const n = zt[e];
n && n.pre && (zt.splice(e, 1), e--, n());
}
}
function ag(t) {
if (Bi.length) {
const e = [...new Set(Bi)];
if (((Bi.length = 0), rr)) {
rr.push(...e);
return;
}
for (
rr = e, rr.sort((n, r) => qo(n) - qo(r)), Yr = 0;
Yr < rr.length;
Yr++
)
rr[Yr]();
(rr = null), (Yr = 0);
}
}
const qo = (t) => (t.id == null ? 1 / 0 : t.id),
P2 = (t, e) => {
const n = qo(t) - qo(e);
if (n === 0) {
if (t.pre && !e.pre) return -1;
if (e.pre && !t.pre) return 1;
}
return n;
};
function ug(t) {
(ec = !1), (Ko = !0), zt.sort(P2);
const e = On;
try {
for (Vn = 0; Vn < zt.length; Vn++) {
const n = zt[Vn];
n && n.active !== !1 && Or(n, null, 14);
}
} finally {
(Vn = 0),
(zt.length = 0),
ag(),
(Ko = !1),
(pd = null),
(zt.length || Bi.length) && ug();
}
}
function N2(t, e, ...n) {
if (t.isUnmounted) return;
const r = t.vnode.props || rt;
let i = n;
const o = e.startsWith("update:"),
s = o && e.slice(7);
if (s && s in r) {
const c = `${s === "modelValue" ? "model" : s}Modifiers`,
{ number: f, trim: h } = r[c] || rt;
h && (i = n.map((p) => (at(p) ? p.trim() : p))), f && (i = n.map(Jy));
}
let l,
a = r[(l = eu(e))] || r[(l = eu(Jn(e)))];
!a && o && (a = r[(l = eu(xi(e)))]), a && gn(a, t, 6, i);
const u = r[l + "Once"];
if (u) {
if (!t.emitted) t.emitted = {};
else if (t.emitted[l]) return;
(t.emitted[l] = !0), gn(u, t, 6, i);
}
}
function cg(t, e, n = !1) {
const r = e.emitsCache,
i = r.get(t);
if (i !== void 0) return i;
const o = t.emits;
let s = {},
l = !1;
if (!Ee(t)) {
const a = (u) => {
const c = cg(u, e, !0);
c && ((l = !0), _t(s, c));
};
!n && e.mixins.length && e.mixins.forEach(a),
t.extends && a(t.extends),
t.mixins && t.mixins.forEach(a);
}
return !o && !l
? (it(t) && r.set(t, null), null)
: (we(o) ? o.forEach((a) => (s[a] = null)) : _t(s, o),
it(t) && r.set(t, s),
s);
}
function _a(t, e) {
return !t || !va(e)
? !1
: ((e = e.slice(2).replace(/Once$/, "")),
We(t, e[0].toLowerCase() + e.slice(1)) || We(t, xi(e)) || We(t, e));
}
let It = null,
dg = null;
function bl(t) {
const e = It;
return (It = t), (dg = (t && t.type.__scopeId) || null), e;
}
function Te(t, e = It, n) {
if (!e || t._n) return t;
const r = (...i) => {
r._d && ch(-1);
const o = bl(e);
let s;
try {
s = t(...i);
} finally {
bl(o), r._d && ch(1);
}
return s;
};
return (r._n = !0), (r._c = !0), (r._d = !0), r;
}
function nu(t) {
const {
type: e,
vnode: n,
proxy: r,
withProxy: i,
props: o,
propsOptions: [s],
slots: l,
attrs: a,
emit: u,
render: c,
renderCache: f,
data: h,
setupState: p,
ctx: g,
inheritAttrs: v,
} = t;
let b, x;
const S = bl(t);
try {
if (n.shapeFlag & 4) {
const d = i || r,
y = d;
(b = Hn(c.call(y, d, f, o, p, h, g))), (x = a);
} else {
const d = e;
(b = Hn(
d.length > 1
? d(o, { attrs: a, slots: l, emit: u })
: d(o, null)
)),
(x = e.props ? a : j2(a));
}
} catch (d) {
(Po.length = 0), cs(d, t, 1), (b = Me(yn));
}
let T = b;
if (x && v !== !1) {
const d = Object.keys(x),
{ shapeFlag: y } = T;
d.length &&
y & 7 &&
(s && d.some(od) && (x = L2(x, s)), (T = sr(T, x)));
}
return (
n.dirs &&
((T = sr(T)), (T.dirs = T.dirs ? T.dirs.concat(n.dirs) : n.dirs)),
n.transition && (T.transition = n.transition),
(b = T),
bl(S),
b
);
}
const j2 = (t) => {
let e;
for (const n in t)
(n === "class" || n === "style" || va(n)) &&
((e || (e = {}))[n] = t[n]);
return e;
},
L2 = (t, e) => {
const n = {};
for (const r in t) (!od(r) || !(r.slice(9) in e)) && (n[r] = t[r]);
return n;
};
function D2(t, e, n) {
const { props: r, children: i, component: o } = t,
{ props: s, children: l, patchFlag: a } = e,
u = o.emitsOptions;
if (e.dirs || e.transition) return !0;
if (n && a >= 0) {
if (a & 1024) return !0;
if (a & 16) return r ? Xf(r, s, u) : !!s;
if (a & 8) {
const c = e.dynamicProps;
for (let f = 0; f < c.length; f++) {
const h = c[f];
if (s[h] !== r[h] && !_a(u, h)) return !0;
}
}
} else
return (i || l) && (!l || !l.$stable)
? !0
: r === s
? !1
: r
? s
? Xf(r, s, u)
: !0
: !!s;
return !1;
}
function Xf(t, e, n) {
const r = Object.keys(e);
if (r.length !== Object.keys(t).length) return !0;
for (let i = 0; i < r.length; i++) {
const o = r[i];
if (e[o] !== t[o] && !_a(n, o)) return !0;
}
return !1;
}
function I2({ vnode: t, parent: e }, n) {
for (; e && e.subTree === t; ) ((t = e.vnode).el = n), (e = e.parent);
}
const md = "components";
function ft(t, e) {
return hg(md, t, !0, e) || t;
}
const fg = Symbol.for("v-ndc");
function mi(t) {
return at(t) ? hg(md, t, !1) || t : t || fg;
}
function hg(t, e, n = !0, r = !1) {
const i = It || St;
if (i) {
const o = i.type;
if (t === md) {
const l = Av(o, !1);
if (l && (l === e || l === Jn(e) || l === ka(Jn(e)))) return o;
}
const s = Zf(i[t] || o[t], e) || Zf(i.appContext[t], e);
return !s && r ? o : s;
}
}
function Zf(t, e) {
return t && (t[e] || t[Jn(e)] || t[ka(Jn(e))]);
}
const B2 = (t) => t.__isSuspense;
function $2(t, e) {
e && e.pendingBranch
? we(t)
? e.effects.push(...t)
: e.effects.push(t)
: R2(t);
}
function Mt(t, e) {
return gd(t, null, e);
}
const Ps = {};
function Rt(t, e, n) {
return gd(t, e, n);
}
function gd(
t,
e,
{ immediate: n, deep: r, flush: i, onTrack: o, onTrigger: s } = rt
) {
var l;
const a = zm() === ((l = St) == null ? void 0 : l.scope) ? St : null;
let u,
c = !1,
f = !1;
if (
(Ht(t)
? ((u = () => t.value), (c = vl(t)))
: Ii(t)
? ((u = () => t), (r = !0))
: we(t)
? ((f = !0),
(c = t.some((d) => Ii(d) || vl(d))),
(u = () =>
t.map((d) => {
if (Ht(d)) return d.value;
if (Ii(d)) return ti(d);
if (Ee(d)) return Or(d, a, 2);
})))
: Ee(t)
? e
? (u = () => Or(t, a, 2))
: (u = () => {
if (!(a && a.isUnmounted))
return h && h(), gn(t, a, 3, [p]);
})
: (u = On),
e && r)
) {
const d = u;
u = () => ti(d());
}
let h,
p = (d) => {
h = S.onStop = () => {
Or(d, a, 4), (h = S.onStop = void 0);
};
},
g;
if (Ki)
if (
((p = On),
e ? n && gn(e, a, 3, [u(), f ? [] : void 0, p]) : u(),
i === "sync")
) {
const d = Rv();
g = d.__watcherHandles || (d.__watcherHandles = []);
} else return On;
let v = f ? new Array(t.length).fill(Ps) : Ps;
const b = () => {
if (!!S.active)
if (e) {
const d = S.run();
(r || c || (f ? d.some((y, m) => pi(y, v[m])) : pi(d, v))) &&
(h && h(),
gn(e, a, 3, [
d,
v === Ps ? void 0 : f && v[0] === Ps ? [] : v,
p,
]),
(v = d));
} else S.run();
};
b.allowRecurse = !!e;
let x;
i === "sync"
? (x = b)
: i === "post"
? (x = () => Gt(b, a && a.suspense))
: ((b.pre = !0), a && (b.id = a.uid), (x = () => Sa(b)));
const S = new ud(u, x);
e
? n
? b()
: (v = S.run())
: i === "post"
? Gt(S.run.bind(S), a && a.suspense)
: S.run();
const T = () => {
S.stop(), a && a.scope && sd(a.scope.effects, S);
};
return g && g.push(T), T;
}
function z2(t, e, n) {
const r = this.proxy,
i = at(t) ? (t.includes(".") ? pg(r, t) : () => r[t]) : t.bind(r, r);
let o;
Ee(e) ? (o = e) : ((o = e.handler), (n = e));
const s = St;
Ui(this);
const l = gd(i, o.bind(r), n);
return s ? Ui(s) : si(), l;
}
function pg(t, e) {
const n = e.split(".");
return () => {
let r = t;
for (let i = 0; i < n.length && r; i++) r = r[n[i]];
return r;
};
}
function ti(t, e) {
if (!it(t) || t.__v_skip || ((e = e || new Set()), e.has(t))) return t;
if ((e.add(t), Ht(t))) ti(t.value, e);
else if (we(t)) for (let n = 0; n < t.length; n++) ti(t[n], e);
else if (jm(t) || Di(t))
t.forEach((n) => {
ti(n, e);
});
else if (Im(t)) for (const n in t) ti(t[n], e);
return t;
}
function tc(t, e) {
const n = It;
if (n === null) return t;
const r = Ta(n) || n.proxy,
i = t.dirs || (t.dirs = []);
for (let o = 0; o < e.length; o++) {
let [s, l, a, u = rt] = e[o];
s &&
(Ee(s) && (s = { mounted: s, updated: s }),
s.deep && ti(l),
i.push({
dir: s,
instance: r,
value: l,
oldValue: void 0,
arg: a,
modifiers: u,
}));
}
return t;
}
function Wr(t, e, n, r) {
const i = t.dirs,
o = e && e.dirs;
for (let s = 0; s < i.length; s++) {
const l = i[s];
o && (l.oldValue = o[s].value);
let a = l.dir[r];
a && (io(), gn(a, n, 8, [t.el, l, t, e]), oo());
}
}
const gr = Symbol("_leaveCb"),
Ns = Symbol("_enterCb");
function H2() {
const t = {
isMounted: !1,
isLeaving: !1,
isUnmounting: !1,
leavingVNodes: new Map(),
};
return (
Ye(() => {
t.isMounted = !0;
}),
fs(() => {
t.isUnmounting = !0;
}),
t
);
}
const cn = [Function, Array],
mg = {
mode: String,
appear: Boolean,
persisted: Boolean,
onBeforeEnter: cn,
onEnter: cn,
onAfterEnter: cn,
onEnterCancelled: cn,
onBeforeLeave: cn,
onLeave: cn,
onAfterLeave: cn,
onLeaveCancelled: cn,
onBeforeAppear: cn,
onAppear: cn,
onAfterAppear: cn,
onAppearCancelled: cn,
},
F2 = {
name: "BaseTransition",
props: mg,
setup(t, { slots: e }) {
const n = ps(),
r = H2();
let i;
return () => {
const o = e.default && yg(e.default(), !0);
if (!o || !o.length) return;
let s = o[0];
if (o.length > 1) {
for (const v of o)
if (v.type !== yn) {
s = v;
break;
}
}
const l = de(t),
{ mode: a } = l;
if (r.isLeaving) return ru(s);
const u = eh(s);
if (!u) return ru(s);
const c = nc(u, l, r, n);
rc(u, c);
const f = n.subTree,
h = f && eh(f);
let p = !1;
const { getTransitionKey: g } = u.type;
if (g) {
const v = g();
i === void 0 ? (i = v) : v !== i && ((i = v), (p = !0));
}
if (h && h.type !== yn && (!Qr(u, h) || p)) {
const v = nc(h, l, r, n);
if ((rc(h, v), a === "out-in"))
return (
(r.isLeaving = !0),
(v.afterLeave = () => {
(r.isLeaving = !1),
n.update.active !== !1 && n.update();
}),
ru(s)
);
a === "in-out" &&
u.type !== yn &&
(v.delayLeave = (b, x, S) => {
const T = gg(r, h);
(T[String(h.key)] = h),
(b[gr] = () => {
x(),
(b[gr] = void 0),
delete c.delayedLeave;
}),
(c.delayedLeave = S);
});
}
return s;
};
},
},
V2 = F2;
function gg(t, e) {
const { leavingVNodes: n } = t;
let r = n.get(e.type);
return r || ((r = Object.create(null)), n.set(e.type, r)), r;
}
function nc(t, e, n, r) {
const {
appear: i,
mode: o,
persisted: s = !1,
onBeforeEnter: l,
onEnter: a,
onAfterEnter: u,
onEnterCancelled: c,
onBeforeLeave: f,
onLeave: h,
onAfterLeave: p,
onLeaveCancelled: g,
onBeforeAppear: v,
onAppear: b,
onAfterAppear: x,
onAppearCancelled: S,
} = e,
T = String(t.key),
d = gg(n, t),
y = (k, _) => {
k && gn(k, r, 9, _);
},
m = (k, _) => {
const C = _[1];
y(k, _),
we(k)
? k.every((E) => E.length <= 1) && C()
: k.length <= 1 && C();
},
w = {
mode: o,
persisted: s,
beforeEnter(k) {
let _ = l;
if (!n.isMounted)
if (i) _ = v || l;
else return;
k[gr] && k[gr](!0);
const C = d[T];
C && Qr(t, C) && C.el[gr] && C.el[gr](), y(_, [k]);
},
enter(k) {
let _ = a,
C = u,
E = c;
if (!n.isMounted)
if (i) (_ = b || a), (C = x || u), (E = S || c);
else return;
let R = !1;
const P = (k[Ns] = (L) => {
R ||
((R = !0),
L ? y(E, [k]) : y(C, [k]),
w.delayedLeave && w.delayedLeave(),
(k[Ns] = void 0));
});
_ ? m(_, [k, P]) : P();
},
leave(k, _) {
const C = String(t.key);
if ((k[Ns] && k[Ns](!0), n.isUnmounting)) return _();
y(f, [k]);
let E = !1;
const R = (k[gr] = (P) => {
E ||
((E = !0),
_(),
P ? y(g, [k]) : y(p, [k]),
(k[gr] = void 0),
d[C] === t && delete d[C]);
});
(d[C] = t), h ? m(h, [k, R]) : R();
},
clone(k) {
return nc(k, e, n, r);
},
};
return w;
}
function ru(t) {
if (ds(t)) return (t = sr(t)), (t.children = null), t;
}
function eh(t) {
return ds(t) ? (t.children ? t.children[0] : void 0) : t;
}
function rc(t, e) {
t.shapeFlag & 6 && t.component
? rc(t.component.subTree, e)
: t.shapeFlag & 128
? ((t.ssContent.transition = e.clone(t.ssContent)),
(t.ssFallback.transition = e.clone(t.ssFallback)))
: (t.transition = e);
}
function yg(t, e = !1, n) {
let r = [],
i = 0;
for (let o = 0; o < t.length; o++) {
let s = t[o];
const l =
n == null ? s.key : String(n) + String(s.key != null ? s.key : o);
s.type === He
? (s.patchFlag & 128 && i++, (r = r.concat(yg(s.children, e, l))))
: (e || s.type !== yn) && r.push(l != null ? sr(s, { key: l }) : s);
}
if (i > 1) for (let o = 0; o < r.length; o++) r[o].patchFlag = -2;
return r;
}
/*! #__NO_SIDE_EFFECTS__ */ function xe(t, e) {
return Ee(t) ? (() => _t({ name: t.name }, e, { setup: t }))() : t;
}
const To = (t) => !!t.type.__asyncLoader;
/*! #__NO_SIDE_EFFECTS__ */ function js(t) {
Ee(t) && (t = { loader: t });
const {
loader: e,
loadingComponent: n,
errorComponent: r,
delay: i = 200,
timeout: o,
suspensible: s = !0,
onError: l,
} = t;
let a = null,
u,
c = 0;
const f = () => (c++, (a = null), h()),
h = () => {
let p;
return (
a ||
(p = a =
e()
.catch((g) => {
if (
((g =
g instanceof Error
? g
: new Error(String(g))),
l)
)
return new Promise((v, b) => {
l(
g,
() => v(f()),
() => b(g),
c + 1
);
});
throw g;
})
.then((g) =>
p !== a && a
? a
: (g &&
(g.__esModule ||
g[Symbol.toStringTag] ===
"Module") &&
(g = g.default),
(u = g),
g)
))
);
};
return xe({
name: "AsyncComponentWrapper",
__asyncLoader: h,
get __asyncResolved() {
return u;
},
setup() {
const p = St;
if (u) return () => iu(u, p);
const g = (S) => {
(a = null), cs(S, p, 13, !r);
};
if ((s && p.suspense) || Ki)
return h()
.then((S) => () => iu(S, p))
.catch(
(S) => (g(S), () => (r ? Me(r, { error: S }) : null))
);
const v = oe(!1),
b = oe(),
x = oe(!!i);
return (
i &&
setTimeout(() => {
x.value = !1;
}, i),
o != null &&
setTimeout(() => {
if (!v.value && !b.value) {
const S = new Error(
`Async component timed out after ${o}ms.`
);
g(S), (b.value = S);
}
}, o),
h()
.then(() => {
(v.value = !0),
p.parent &&
ds(p.parent.vnode) &&
Sa(p.parent.update);
})
.catch((S) => {
g(S), (b.value = S);
}),
() => {
if (v.value && u) return iu(u, p);
if (b.value && r) return Me(r, { error: b.value });
if (n && !x.value) return Me(n);
}
);
},
});
}
function iu(t, e) {
const { ref: n, props: r, children: i, ce: o } = e.vnode,
s = Me(t, r, i);
return (s.ref = n), (s.ce = o), delete e.vnode.ce, s;
}
const ds = (t) => t.type.__isKeepAlive;
function W2(t, e) {
vg(t, "a", e);
}
function U2(t, e) {
vg(t, "da", e);
}
function vg(t, e, n = St) {
const r =
t.__wdc ||
(t.__wdc = () => {
let i = n;
for (; i; ) {
if (i.isDeactivated) return;
i = i.parent;
}
return t();
});
if ((Ma(e, r, n), n)) {
let i = n.parent;
for (; i && i.parent; )
ds(i.parent.vnode) && K2(r, e, n, i), (i = i.parent);
}
}
function K2(t, e, n, r) {
const i = Ma(e, t, r, !0);
Bt(() => {
sd(r[e], i);
}, n);
}
function Ma(t, e, n = St, r = !1) {
if (n) {
const i = n[t] || (n[t] = []),
o =
e.__weh ||
(e.__weh = (...s) => {
if (n.isUnmounted) return;
io(), Ui(n);
const l = gn(e, n, t, s);
return si(), oo(), l;
});
return r ? i.unshift(o) : i.push(o), o;
}
}
const ar =
(t) =>
(e, n = St) =>
(!Ki || t === "sp") && Ma(t, (...r) => e(...r), n),
q2 = ar("bm"),
Ye = ar("m"),
J2 = ar("bu"),
G2 = ar("u"),
fs = ar("bum"),
Bt = ar("um"),
Y2 = ar("sp"),
Q2 = ar("rtg"),
X2 = ar("rtc");
function Z2(t, e = St) {
Ma("ec", t, e);
}
function wn(t, e, n, r) {
let i;
const o = n && n[r];
if (we(t) || at(t)) {
i = new Array(t.length);
for (let s = 0, l = t.length; s < l; s++)
i[s] = e(t[s], s, void 0, o && o[s]);
} else if (typeof t == "number") {
i = new Array(t);
for (let s = 0; s < t; s++) i[s] = e(s + 1, s, void 0, o && o[s]);
} else if (it(t))
if (t[Symbol.iterator])
i = Array.from(t, (s, l) => e(s, l, void 0, o && o[l]));
else {
const s = Object.keys(t);
i = new Array(s.length);
for (let l = 0, a = s.length; l < a; l++) {
const u = s[l];
i[l] = e(t[u], u, l, o && o[l]);
}
}
else i = [];
return n && (n[r] = i), i;
}
function ou(t, e) {
for (let n = 0; n < e.length; n++) {
const r = e[n];
if (we(r)) for (let i = 0; i < r.length; i++) t[r[i].name] = r[i].fn;
else
r &&
(t[r.name] = r.key
? (...i) => {
const o = r.fn(...i);
return o && (o.key = r.key), o;
}
: r.fn);
}
return t;
}
function _e(t, e, n = {}, r, i) {
if (It.isCE || (It.parent && To(It.parent) && It.parent.isCE))
return e !== "default" && (n.name = e), Me("slot", n, r && r());
let o = t[e];
o && o._c && (o._d = !1), B();
const s = o && bg(o(n)),
l = Be(
He,
{ key: n.key || (s && s.key) || `_${e}` },
s || (r ? r() : []),
s && t._ === 1 ? 64 : -2
);
return (
!i && l.scopeId && (l.slotScopeIds = [l.scopeId + "-s"]),
o && o._c && (o._d = !0),
l
);
}
function bg(t) {
return t.some((e) =>
kl(e) ? !(e.type === yn || (e.type === He && !bg(e.children))) : !0
)
? t
: null;
}
const ic = (t) => (t ? (Rg(t) ? Ta(t) || t.proxy : ic(t.parent)) : null),
Oo = _t(Object.create(null), {
$: (t) => t,
$el: (t) => t.vnode.el,
$data: (t) => t.data,
$props: (t) => t.props,
$attrs: (t) => t.attrs,
$slots: (t) => t.slots,
$refs: (t) => t.refs,
$parent: (t) => ic(t.parent),
$root: (t) => ic(t.root),
$emit: (t) => t.emit,
$options: (t) => vd(t),
$forceUpdate: (t) => t.f || (t.f = () => Sa(t.update)),
$nextTick: (t) => t.n || (t.n = Ct.bind(t.proxy)),
$watch: (t) => z2.bind(t),
}),
su = (t, e) => t !== rt && !t.__isScriptSetup && We(t, e),
ev = {
get({ _: t }, e) {
const {
ctx: n,
setupState: r,
data: i,
props: o,
accessCache: s,
type: l,
appContext: a,
} = t;
let u;
if (e[0] !== "$") {
const p = s[e];
if (p !== void 0)
switch (p) {
case 1:
return r[e];
case 2:
return i[e];
case 4:
return n[e];
case 3:
return o[e];
}
else {
if (su(r, e)) return (s[e] = 1), r[e];
if (i !== rt && We(i, e)) return (s[e] = 2), i[e];
if ((u = t.propsOptions[0]) && We(u, e))
return (s[e] = 3), o[e];
if (n !== rt && We(n, e)) return (s[e] = 4), n[e];
oc && (s[e] = 0);
}
}
const c = Oo[e];
let f, h;
if (c) return e === "$attrs" && tn(t, "get", e), c(t);
if ((f = l.__cssModules) && (f = f[e])) return f;
if (n !== rt && We(n, e)) return (s[e] = 4), n[e];
if (((h = a.config.globalProperties), We(h, e))) return h[e];
},
set({ _: t }, e, n) {
const { data: r, setupState: i, ctx: o } = t;
return su(i, e)
? ((i[e] = n), !0)
: r !== rt && We(r, e)
? ((r[e] = n), !0)
: We(t.props, e) || (e[0] === "$" && e.slice(1) in t)
? !1
: ((o[e] = n), !0);
},
has(
{
_: {
data: t,
setupState: e,
accessCache: n,
ctx: r,
appContext: i,
propsOptions: o,
},
},
s
) {
let l;
return (
!!n[s] ||
(t !== rt && We(t, s)) ||
su(e, s) ||
((l = o[0]) && We(l, s)) ||
We(r, s) ||
We(Oo, s) ||
We(i.config.globalProperties, s)
);
},
defineProperty(t, e, n) {
return (
n.get != null
? (t._.accessCache[e] = 0)
: We(n, "value") && this.set(t, e, n.value, null),
Reflect.defineProperty(t, e, n)
);
},
};
function yd() {
return wg().slots;
}
function hs() {
return wg().attrs;
}
function wg() {
const t = ps();
return t.setupContext || (t.setupContext = Ng(t));
}
function th(t) {
return we(t) ? t.reduce((e, n) => ((e[n] = null), e), {}) : t;
}
let oc = !0;
function tv(t) {
const e = vd(t),
n = t.proxy,
r = t.ctx;
(oc = !1), e.beforeCreate && nh(e.beforeCreate, t, "bc");
const {
data: i,
computed: o,
methods: s,
watch: l,
provide: a,
inject: u,
created: c,
beforeMount: f,
mounted: h,
beforeUpdate: p,
updated: g,
activated: v,
deactivated: b,
beforeDestroy: x,
beforeUnmount: S,
destroyed: T,
unmounted: d,
render: y,
renderTracked: m,
renderTriggered: w,
errorCaptured: k,
serverPrefetch: _,
expose: C,
inheritAttrs: E,
components: R,
directives: P,
filters: L,
} = e;
if ((u && nv(u, r, null), s))
for (const N in s) {
const D = s[N];
Ee(D) && (r[N] = D.bind(n));
}
if (i) {
const N = i.call(n, n);
it(N) && (t.data = Sn(N));
}
if (((oc = !0), o))
for (const N in o) {
const D = o[N],
K = Ee(D) ? D.bind(n, n) : Ee(D.get) ? D.get.bind(n, n) : On,
ae = !Ee(D) && Ee(D.set) ? D.set.bind(n) : On,
Q = $({ get: K, set: ae });
Object.defineProperty(r, N, {
enumerable: !0,
configurable: !0,
get: () => Q.value,
set: (me) => (Q.value = me),
});
}
if (l) for (const N in l) xg(l[N], r, n, N);
if (a) {
const N = Ee(a) ? a.call(n) : a;
Reflect.ownKeys(N).forEach((D) => {
kt(D, N[D]);
});
}
c && nh(c, t, "c");
function M(N, D) {
we(D) ? D.forEach((K) => N(K.bind(n))) : D && N(D.bind(n));
}
if (
(M(q2, f),
M(Ye, h),
M(J2, p),
M(G2, g),
M(W2, v),
M(U2, b),
M(Z2, k),
M(X2, m),
M(Q2, w),
M(fs, S),
M(Bt, d),
M(Y2, _),
we(C))
)
if (C.length) {
const N = t.exposed || (t.exposed = {});
C.forEach((D) => {
Object.defineProperty(N, D, {
get: () => n[D],
set: (K) => (n[D] = K),
});
});
} else t.exposed || (t.exposed = {});
y && t.render === On && (t.render = y),
E != null && (t.inheritAttrs = E),
R && (t.components = R),
P && (t.directives = P);
}
function nv(t, e, n = On) {
we(t) && (t = sc(t));
for (const r in t) {
const i = t[r];
let o;
it(i)
? "default" in i
? (o = qe(i.from || r, i.default, !0))
: (o = qe(i.from || r))
: (o = qe(i)),
Ht(o)
? Object.defineProperty(e, r, {
enumerable: !0,
configurable: !0,
get: () => o.value,
set: (s) => (o.value = s),
})
: (e[r] = o);
}
}
function nh(t, e, n) {
gn(we(t) ? t.map((r) => r.bind(e.proxy)) : t.bind(e.proxy), e, n);
}
function xg(t, e, n, r) {
const i = r.includes(".") ? pg(n, r) : () => n[r];
if (at(t)) {
const o = e[t];
Ee(o) && Rt(i, o);
} else if (Ee(t)) Rt(i, t.bind(n));
else if (it(t))
if (we(t)) t.forEach((o) => xg(o, e, n, r));
else {
const o = Ee(t.handler) ? t.handler.bind(n) : e[t.handler];
Ee(o) && Rt(i, o, t);
}
}
function vd(t) {
const e = t.type,
{ mixins: n, extends: r } = e,
{
mixins: i,
optionsCache: o,
config: { optionMergeStrategies: s },
} = t.appContext,
l = o.get(e);
let a;
return (
l
? (a = l)
: !i.length && !n && !r
? (a = e)
: ((a = {}),
i.length && i.forEach((u) => wl(a, u, s, !0)),
wl(a, e, s)),
it(e) && o.set(e, a),
a
);
}
function wl(t, e, n, r = !1) {
const { mixins: i, extends: o } = e;
o && wl(t, o, n, !0), i && i.forEach((s) => wl(t, s, n, !0));
for (const s in e)
if (!(r && s === "expose")) {
const l = rv[s] || (n && n[s]);
t[s] = l ? l(t[s], e[s]) : e[s];
}
return t;
}
const rv = {
data: rh,
props: ih,
emits: ih,
methods: So,
computed: So,
beforeCreate: Kt,
created: Kt,
beforeMount: Kt,
mounted: Kt,
beforeUpdate: Kt,
updated: Kt,
beforeDestroy: Kt,
beforeUnmount: Kt,
destroyed: Kt,
unmounted: Kt,
activated: Kt,
deactivated: Kt,
errorCaptured: Kt,
serverPrefetch: Kt,
components: So,
directives: So,
watch: ov,
provide: rh,
inject: iv,
};
function rh(t, e) {
return e
? t
? function () {
return _t(
Ee(t) ? t.call(this, this) : t,
Ee(e) ? e.call(this, this) : e
);
}
: e
: t;
}
function iv(t, e) {
return So(sc(t), sc(e));
}
function sc(t) {
if (we(t)) {
const e = {};
for (let n = 0; n < t.length; n++) e[t[n]] = t[n];
return e;
}
return t;
}
function Kt(t, e) {
return t ? [...new Set([].concat(t, e))] : e;
}
function So(t, e) {
return t ? _t(Object.create(null), t, e) : e;
}
function ih(t, e) {
return t
? we(t) && we(e)
? [...new Set([...t, ...e])]
: _t(Object.create(null), th(t), th(e != null ? e : {}))
: e;
}
function ov(t, e) {
if (!t) return e;
if (!e) return t;
const n = _t(Object.create(null), t);
for (const r in e) n[r] = Kt(t[r], e[r]);
return n;
}
function kg() {
return {
app: null,
config: {
isNativeTag: Fy,
performance: !1,
globalProperties: {},
optionMergeStrategies: {},
errorHandler: void 0,
warnHandler: void 0,
compilerOptions: {},
},
mixins: [],
components: {},
directives: {},
provides: Object.create(null),
optionsCache: new WeakMap(),
propsCache: new WeakMap(),
emitsCache: new WeakMap(),
};
}
let sv = 0;
function lv(t, e) {
return function (r, i = null) {
Ee(r) || (r = _t({}, r)), i != null && !it(i) && (i = null);
const o = kg(),
s = new WeakSet();
let l = !1;
const a = (o.app = {
_uid: sv++,
_component: r,
_props: i,
_container: null,
_context: o,
_instance: null,
version: Pv,
get config() {
return o.config;
},
set config(u) {},
use(u, ...c) {
return (
s.has(u) ||
(u && Ee(u.install)
? (s.add(u), u.install(a, ...c))
: Ee(u) && (s.add(u), u(a, ...c))),
a
);
},
mixin(u) {
return o.mixins.includes(u) || o.mixins.push(u), a;
},
component(u, c) {
return c ? ((o.components[u] = c), a) : o.components[u];
},
directive(u, c) {
return c ? ((o.directives[u] = c), a) : o.directives[u];
},
mount(u, c, f) {
if (!l) {
const h = Me(r, i);
return (
(h.appContext = o),
c && e ? e(h, u) : t(h, u, f),
(l = !0),
(a._container = u),
(u.__vue_app__ = a),
Ta(h.component) || h.component.proxy
);
}
},
unmount() {
l && (t(null, a._container), delete a._container.__vue_app__);
},
provide(u, c) {
return (o.provides[u] = c), a;
},
runWithContext(u) {
xl = a;
try {
return u();
} finally {
xl = null;
}
},
});
return a;
};
}
let xl = null;
function kt(t, e) {
if (St) {
let n = St.provides;
const r = St.parent && St.parent.provides;
r === n && (n = St.provides = Object.create(r)), (n[t] = e);
}
}
function qe(t, e, n = !1) {
const r = St || It;
if (r || xl) {
const i = r
? r.parent == null
? r.vnode.appContext && r.vnode.appContext.provides
: r.parent.provides
: xl._context.provides;
if (i && t in i) return i[t];
if (arguments.length > 1) return n && Ee(e) ? e.call(r && r.proxy) : e;
}
}
function av(t, e, n, r = !1) {
const i = {},
o = {};
yl(o, Aa, 1), (t.propsDefaults = Object.create(null)), Cg(t, e, i, o);
for (const s in t.propsOptions[0]) s in i || (i[s] = void 0);
n
? (t.props = r ? i : Qm(i))
: t.type.props
? (t.props = i)
: (t.props = o),
(t.attrs = o);
}
function uv(t, e, n, r) {
const {
props: i,
attrs: o,
vnode: { patchFlag: s },
} = t,
l = de(i),
[a] = t.propsOptions;
let u = !1;
if ((r || s > 0) && !(s & 16)) {
if (s & 8) {
const c = t.vnode.dynamicProps;
for (let f = 0; f < c.length; f++) {
let h = c[f];
if (_a(t.emitsOptions, h)) continue;
const p = e[h];
if (a)
if (We(o, h)) p !== o[h] && ((o[h] = p), (u = !0));
else {
const g = Jn(h);
i[g] = lc(a, l, g, p, t, !1);
}
else p !== o[h] && ((o[h] = p), (u = !0));
}
}
} else {
Cg(t, e, i, o) && (u = !0);
let c;
for (const f in l)
(!e || (!We(e, f) && ((c = xi(f)) === f || !We(e, c)))) &&
(a
? n &&
(n[f] !== void 0 || n[c] !== void 0) &&
(i[f] = lc(a, l, f, void 0, t, !0))
: delete i[f]);
if (o !== l)
for (const f in o)
(!e || (!We(e, f) && !0)) && (delete o[f], (u = !0));
}
u && or(t, "set", "$attrs");
}
function Cg(t, e, n, r) {
const [i, o] = t.propsOptions;
let s = !1,
l;
if (e)
for (let a in e) {
if (il(a)) continue;
const u = e[a];
let c;
i && We(i, (c = Jn(a)))
? !o || !o.includes(c)
? (n[c] = u)
: ((l || (l = {}))[c] = u)
: _a(t.emitsOptions, a) ||
((!(a in r) || u !== r[a]) && ((r[a] = u), (s = !0)));
}
if (o) {
const a = de(n),
u = l || rt;
for (let c = 0; c < o.length; c++) {
const f = o[c];
n[f] = lc(i, a, f, u[f], t, !We(u, f));
}
}
return s;
}
function lc(t, e, n, r, i, o) {
const s = t[n];
if (s != null) {
const l = We(s, "default");
if (l && r === void 0) {
const a = s.default;
if (s.type !== Function && !s.skipFactory && Ee(a)) {
const { propsDefaults: u } = i;
n in u
? (r = u[n])
: (Ui(i), (r = u[n] = a.call(null, e)), si());
} else r = a;
}
s[0] &&
(o && !l
? (r = !1)
: s[1] && (r === "" || r === xi(n)) && (r = !0));
}
return r;
}
function Sg(t, e, n = !1) {
const r = e.propsCache,
i = r.get(t);
if (i) return i;
const o = t.props,
s = {},
l = [];
let a = !1;
if (!Ee(t)) {
const c = (f) => {
a = !0;
const [h, p] = Sg(f, e, !0);
_t(s, h), p && l.push(...p);
};
!n && e.mixins.length && e.mixins.forEach(c),
t.extends && c(t.extends),
t.mixins && t.mixins.forEach(c);
}
if (!o && !a) return it(t) && r.set(t, Li), Li;
if (we(o))
for (let c = 0; c < o.length; c++) {
const f = Jn(o[c]);
oh(f) && (s[f] = rt);
}
else if (o)
for (const c in o) {
const f = Jn(c);
if (oh(f)) {
const h = o[c],
p = (s[f] = we(h) || Ee(h) ? { type: h } : _t({}, h));
if (p) {
const g = ah(Boolean, p.type),
v = ah(String, p.type);
(p[0] = g > -1),
(p[1] = v < 0 || g < v),
(g > -1 || We(p, "default")) && l.push(f);
}
}
}
const u = [s, l];
return it(t) && r.set(t, u), u;
}
function oh(t) {
return t[0] !== "$";
}
function sh(t) {
const e = t && t.toString().match(/^\s*(function|class) (\w+)/);
return e ? e[2] : t === null ? "null" : "";
}
function lh(t, e) {
return sh(t) === sh(e);
}
function ah(t, e) {
return we(e) ? e.findIndex((n) => lh(n, t)) : Ee(e) && lh(e, t) ? 0 : -1;
}
const _g = (t) => t[0] === "_" || t === "$stable",
bd = (t) => (we(t) ? t.map(Hn) : [Hn(t)]),
cv = (t, e, n) => {
if (e._n) return e;
const r = Te((...i) => bd(e(...i)), n);
return (r._c = !1), r;
},
Mg = (t, e, n) => {
const r = t._ctx;
for (const i in t) {
if (_g(i)) continue;
const o = t[i];
if (Ee(o)) e[i] = cv(i, o, r);
else if (o != null) {
const s = bd(o);
e[i] = () => s;
}
}
},
Eg = (t, e) => {
const n = bd(e);
t.slots.default = () => n;
},
dv = (t, e) => {
if (t.vnode.shapeFlag & 32) {
const n = e._;
n ? ((t.slots = de(e)), yl(e, "_", n)) : Mg(e, (t.slots = {}));
} else (t.slots = {}), e && Eg(t, e);
yl(t.slots, Aa, 1);
},
fv = (t, e, n) => {
const { vnode: r, slots: i } = t;
let o = !0,
s = rt;
if (r.shapeFlag & 32) {
const l = e._;
l
? n && l === 1
? (o = !1)
: (_t(i, e), !n && l === 1 && delete i._)
: ((o = !e.$stable), Mg(e, i)),
(s = e);
} else e && (Eg(t, e), (s = { default: 1 }));
if (o) for (const l in i) !_g(l) && s[l] == null && delete i[l];
};
function ac(t, e, n, r, i = !1) {
if (we(t)) {
t.forEach((h, p) => ac(h, e && (we(e) ? e[p] : e), n, r, i));
return;
}
if (To(r) && !i) return;
const o = r.shapeFlag & 4 ? Ta(r.component) || r.component.proxy : r.el,
s = i ? null : o,
{ i: l, r: a } = t,
u = e && e.r,
c = l.refs === rt ? (l.refs = {}) : l.refs,
f = l.setupState;
if (
(u != null &&
u !== a &&
(at(u)
? ((c[u] = null), We(f, u) && (f[u] = null))
: Ht(u) && (u.value = null)),
Ee(a))
)
Or(a, l, 12, [s, c]);
else {
const h = at(a),
p = Ht(a);
if (h || p) {
const g = () => {
if (t.f) {
const v = h ? (We(f, a) ? f[a] : c[a]) : a.value;
i
? we(v) && sd(v, o)
: we(v)
? v.includes(o) || v.push(o)
: h
? ((c[a] = [o]), We(f, a) && (f[a] = c[a]))
: ((a.value = [o]), t.k && (c[t.k] = a.value));
} else
h
? ((c[a] = s), We(f, a) && (f[a] = s))
: p && ((a.value = s), t.k && (c[t.k] = s));
};
s ? ((g.id = -1), Gt(g, n)) : g();
}
}
}
const Gt = $2;
function hv(t) {
return pv(t);
}
function pv(t, e) {
const n = Ju();
n.__VUE__ = !0;
const {
insert: r,
remove: i,
patchProp: o,
createElement: s,
createText: l,
createComment: a,
setText: u,
setElementText: c,
parentNode: f,
nextSibling: h,
setScopeId: p = On,
insertStaticContent: g,
} = t,
v = (
A,
O,
j,
H = null,
V = null,
q = null,
se = !1,
Z = null,
te = !!O.dynamicChildren
) => {
if (A === O) return;
A && !Qr(A, O) && ((H = z(A)), me(A, V, q, !0), (A = null)),
O.patchFlag === -2 && ((te = !1), (O.dynamicChildren = null));
const { type: J, ref: he, shapeFlag: ce } = O;
switch (J) {
case Ea:
b(A, O, j, H);
break;
case yn:
x(A, O, j, H);
break;
case lu:
A == null && S(O, j, H, se);
break;
case He:
R(A, O, j, H, V, q, se, Z, te);
break;
default:
ce & 1
? y(A, O, j, H, V, q, se, Z, te)
: ce & 6
? P(A, O, j, H, V, q, se, Z, te)
: (ce & 64 || ce & 128) &&
J.process(A, O, j, H, V, q, se, Z, te, ee);
}
he != null && V && ac(he, A && A.ref, q, O || A, !O);
},
b = (A, O, j, H) => {
if (A == null) r((O.el = l(O.children)), j, H);
else {
const V = (O.el = A.el);
O.children !== A.children && u(V, O.children);
}
},
x = (A, O, j, H) => {
A == null ? r((O.el = a(O.children || "")), j, H) : (O.el = A.el);
},
S = (A, O, j, H) => {
[A.el, A.anchor] = g(A.children, O, j, H, A.el, A.anchor);
},
T = ({ el: A, anchor: O }, j, H) => {
let V;
for (; A && A !== O; ) (V = h(A)), r(A, j, H), (A = V);
r(O, j, H);
},
d = ({ el: A, anchor: O }) => {
let j;
for (; A && A !== O; ) (j = h(A)), i(A), (A = j);
i(O);
},
y = (A, O, j, H, V, q, se, Z, te) => {
(se = se || O.type === "svg"),
A == null
? m(O, j, H, V, q, se, Z, te)
: _(A, O, V, q, se, Z, te);
},
m = (A, O, j, H, V, q, se, Z) => {
let te, J;
const {
type: he,
props: ce,
shapeFlag: pe,
transition: ke,
dirs: Oe,
} = A;
if (
((te = A.el = s(A.type, q, ce && ce.is, ce)),
pe & 8
? c(te, A.children)
: pe & 16 &&
k(
A.children,
te,
null,
H,
V,
q && he !== "foreignObject",
se,
Z
),
Oe && Wr(A, null, H, "created"),
w(te, A, A.scopeId, se, H),
ce)
) {
for (const Fe in ce)
Fe !== "value" &&
!il(Fe) &&
o(te, Fe, null, ce[Fe], q, A.children, H, V, Ae);
"value" in ce && o(te, "value", null, ce.value),
(J = ce.onVnodeBeforeMount) && Dn(J, H, A);
}
Oe && Wr(A, null, H, "beforeMount");
const Je = mv(V, ke);
Je && ke.beforeEnter(te),
r(te, O, j),
((J = ce && ce.onVnodeMounted) || Je || Oe) &&
Gt(() => {
J && Dn(J, H, A),
Je && ke.enter(te),
Oe && Wr(A, null, H, "mounted");
}, V);
},
w = (A, O, j, H, V) => {
if ((j && p(A, j), H))
for (let q = 0; q < H.length; q++) p(A, H[q]);
if (V) {
let q = V.subTree;
if (O === q) {
const se = V.vnode;
w(A, se, se.scopeId, se.slotScopeIds, V.parent);
}
}
},
k = (A, O, j, H, V, q, se, Z, te = 0) => {
for (let J = te; J < A.length; J++) {
const he = (A[J] = Z ? yr(A[J]) : Hn(A[J]));
v(null, he, O, j, H, V, q, se, Z);
}
},
_ = (A, O, j, H, V, q, se) => {
const Z = (O.el = A.el);
let { patchFlag: te, dynamicChildren: J, dirs: he } = O;
te |= A.patchFlag & 16;
const ce = A.props || rt,
pe = O.props || rt;
let ke;
j && Ur(j, !1),
(ke = pe.onVnodeBeforeUpdate) && Dn(ke, j, O, A),
he && Wr(O, A, j, "beforeUpdate"),
j && Ur(j, !0);
const Oe = V && O.type !== "foreignObject";
if (
(J
? C(A.dynamicChildren, J, Z, j, H, Oe, q)
: se || D(A, O, Z, null, j, H, Oe, q, !1),
te > 0)
) {
if (te & 16) E(Z, O, ce, pe, j, H, V);
else if (
(te & 2 &&
ce.class !== pe.class &&
o(Z, "class", null, pe.class, V),
te & 4 && o(Z, "style", ce.style, pe.style, V),
te & 8)
) {
const Je = O.dynamicProps;
for (let Fe = 0; Fe < Je.length; Fe++) {
const ct = Je[Fe],
nn = ce[ct],
ur = pe[ct];
(ur !== nn || ct === "value") &&
o(Z, ct, nn, ur, V, A.children, j, H, Ae);
}
}
te & 1 && A.children !== O.children && c(Z, O.children);
} else !se && J == null && E(Z, O, ce, pe, j, H, V);
((ke = pe.onVnodeUpdated) || he) &&
Gt(() => {
ke && Dn(ke, j, O, A), he && Wr(O, A, j, "updated");
}, H);
},
C = (A, O, j, H, V, q, se) => {
for (let Z = 0; Z < O.length; Z++) {
const te = A[Z],
J = O[Z],
he =
te.el &&
(te.type === He || !Qr(te, J) || te.shapeFlag & 70)
? f(te.el)
: j;
v(te, J, he, null, H, V, q, se, !0);
}
},
E = (A, O, j, H, V, q, se) => {
if (j !== H) {
if (j !== rt)
for (const Z in j)
!il(Z) &&
!(Z in H) &&
o(A, Z, j[Z], null, se, O.children, V, q, Ae);
for (const Z in H) {
if (il(Z)) continue;
const te = H[Z],
J = j[Z];
te !== J &&
Z !== "value" &&
o(A, Z, J, te, se, O.children, V, q, Ae);
}
"value" in H && o(A, "value", j.value, H.value);
}
},
R = (A, O, j, H, V, q, se, Z, te) => {
const J = (O.el = A ? A.el : l("")),
he = (O.anchor = A ? A.anchor : l(""));
let { patchFlag: ce, dynamicChildren: pe, slotScopeIds: ke } = O;
ke && (Z = Z ? Z.concat(ke) : ke),
A == null
? (r(J, j, H),
r(he, j, H),
k(O.children, j, he, V, q, se, Z, te))
: ce > 0 && ce & 64 && pe && A.dynamicChildren
? (C(A.dynamicChildren, pe, j, V, q, se, Z),
(O.key != null || (V && O === V.subTree)) && wd(A, O, !0))
: D(A, O, j, he, V, q, se, Z, te);
},
P = (A, O, j, H, V, q, se, Z, te) => {
(O.slotScopeIds = Z),
A == null
? O.shapeFlag & 512
? V.ctx.activate(O, j, H, se, te)
: L(O, j, H, V, q, se, te)
: I(A, O, te);
},
L = (A, O, j, H, V, q, se) => {
const Z = (A.component = Sv(A, H, V));
if ((ds(A) && (Z.ctx.renderer = ee), _v(Z), Z.asyncDep)) {
if ((V && V.registerDep(Z, M), !A.el)) {
const te = (Z.subTree = Me(yn));
x(null, te, O, j);
}
return;
}
M(Z, A, O, j, V, q, se);
},
I = (A, O, j) => {
const H = (O.component = A.component);
if (D2(A, O, j))
if (H.asyncDep && !H.asyncResolved) {
N(H, O, j);
return;
} else (H.next = O), O2(H.update), H.update();
else (O.el = A.el), (H.vnode = O);
},
M = (A, O, j, H, V, q, se) => {
const Z = () => {
if (A.isMounted) {
let {
next: he,
bu: ce,
u: pe,
parent: ke,
vnode: Oe,
} = A,
Je = he,
Fe;
Ur(A, !1),
he ? ((he.el = Oe.el), N(A, he, se)) : (he = Oe),
ce && tu(ce),
(Fe = he.props && he.props.onVnodeBeforeUpdate) &&
Dn(Fe, ke, he, Oe),
Ur(A, !0);
const ct = nu(A),
nn = A.subTree;
(A.subTree = ct),
v(nn, ct, f(nn.el), z(nn), A, V, q),
(he.el = ct.el),
Je === null && I2(A, ct.el),
pe && Gt(pe, V),
(Fe = he.props && he.props.onVnodeUpdated) &&
Gt(() => Dn(Fe, ke, he, Oe), V);
} else {
let he;
const { el: ce, props: pe } = O,
{ bm: ke, m: Oe, parent: Je } = A,
Fe = To(O);
if (
(Ur(A, !1),
ke && tu(ke),
!Fe &&
(he = pe && pe.onVnodeBeforeMount) &&
Dn(he, Je, O),
Ur(A, !0),
ce && Pe)
) {
const ct = () => {
(A.subTree = nu(A)),
Pe(ce, A.subTree, A, V, null);
};
Fe
? O.type
.__asyncLoader()
.then(() => !A.isUnmounted && ct())
: ct();
} else {
const ct = (A.subTree = nu(A));
v(null, ct, j, H, A, V, q), (O.el = ct.el);
}
if (
(Oe && Gt(Oe, V),
!Fe && (he = pe && pe.onVnodeMounted))
) {
const ct = O;
Gt(() => Dn(he, Je, ct), V);
}
(O.shapeFlag & 256 ||
(Je && To(Je.vnode) && Je.vnode.shapeFlag & 256)) &&
A.a &&
Gt(A.a, V),
(A.isMounted = !0),
(O = j = H = null);
}
},
te = (A.effect = new ud(Z, () => Sa(J), A.scope)),
J = (A.update = () => te.run());
(J.id = A.uid), Ur(A, !0), J();
},
N = (A, O, j) => {
O.component = A;
const H = A.vnode.props;
(A.vnode = O),
(A.next = null),
uv(A, O.props, H, j),
fv(A, O.children, j),
io(),
Qf(),
oo();
},
D = (A, O, j, H, V, q, se, Z, te = !1) => {
const J = A && A.children,
he = A ? A.shapeFlag : 0,
ce = O.children,
{ patchFlag: pe, shapeFlag: ke } = O;
if (pe > 0) {
if (pe & 128) {
ae(J, ce, j, H, V, q, se, Z, te);
return;
} else if (pe & 256) {
K(J, ce, j, H, V, q, se, Z, te);
return;
}
}
ke & 8
? (he & 16 && Ae(J, V, q), ce !== J && c(j, ce))
: he & 16
? ke & 16
? ae(J, ce, j, H, V, q, se, Z, te)
: Ae(J, V, q, !0)
: (he & 8 && c(j, ""), ke & 16 && k(ce, j, H, V, q, se, Z, te));
},
K = (A, O, j, H, V, q, se, Z, te) => {
(A = A || Li), (O = O || Li);
const J = A.length,
he = O.length,
ce = Math.min(J, he);
let pe;
for (pe = 0; pe < ce; pe++) {
const ke = (O[pe] = te ? yr(O[pe]) : Hn(O[pe]));
v(A[pe], ke, j, null, V, q, se, Z, te);
}
J > he ? Ae(A, V, q, !0, !1, ce) : k(O, j, H, V, q, se, Z, te, ce);
},
ae = (A, O, j, H, V, q, se, Z, te) => {
let J = 0;
const he = O.length;
let ce = A.length - 1,
pe = he - 1;
for (; J <= ce && J <= pe; ) {
const ke = A[J],
Oe = (O[J] = te ? yr(O[J]) : Hn(O[J]));
if (Qr(ke, Oe)) v(ke, Oe, j, null, V, q, se, Z, te);
else break;
J++;
}
for (; J <= ce && J <= pe; ) {
const ke = A[ce],
Oe = (O[pe] = te ? yr(O[pe]) : Hn(O[pe]));
if (Qr(ke, Oe)) v(ke, Oe, j, null, V, q, se, Z, te);
else break;
ce--, pe--;
}
if (J > ce) {
if (J <= pe) {
const ke = pe + 1,
Oe = ke < he ? O[ke].el : H;
for (; J <= pe; )
v(
null,
(O[J] = te ? yr(O[J]) : Hn(O[J])),
j,
Oe,
V,
q,
se,
Z,
te
),
J++;
}
} else if (J > pe) for (; J <= ce; ) me(A[J], V, q, !0), J++;
else {
const ke = J,
Oe = J,
Je = new Map();
for (J = Oe; J <= pe; J++) {
const le = (O[J] = te ? yr(O[J]) : Hn(O[J]));
le.key != null && Je.set(le.key, J);
}
let Fe,
ct = 0;
const nn = pe - Oe + 1;
let ur = !1,
Cs = 0;
const Fr = new Array(nn);
for (J = 0; J < nn; J++) Fr[J] = 0;
for (J = ke; J <= ce; J++) {
const le = A[J];
if (ct >= nn) {
me(le, V, q, !0);
continue;
}
let ge;
if (le.key != null) ge = Je.get(le.key);
else
for (Fe = Oe; Fe <= pe; Fe++)
if (Fr[Fe - Oe] === 0 && Qr(le, O[Fe])) {
ge = Fe;
break;
}
ge === void 0
? me(le, V, q, !0)
: ((Fr[ge - Oe] = J + 1),
ge >= Cs ? (Cs = ge) : (ur = !0),
v(le, O[ge], j, null, V, q, se, Z, te),
ct++);
}
const F = ur ? gv(Fr) : Li;
for (Fe = F.length - 1, J = nn - 1; J >= 0; J--) {
const le = Oe + J,
ge = O[le],
Ke = le + 1 < he ? O[le + 1].el : H;
Fr[J] === 0
? v(null, ge, j, Ke, V, q, se, Z, te)
: ur &&
(Fe < 0 || J !== F[Fe] ? Q(ge, j, Ke, 2) : Fe--);
}
}
},
Q = (A, O, j, H, V = null) => {
const {
el: q,
type: se,
transition: Z,
children: te,
shapeFlag: J,
} = A;
if (J & 6) {
Q(A.component.subTree, O, j, H);
return;
}
if (J & 128) {
A.suspense.move(O, j, H);
return;
}
if (J & 64) {
se.move(A, O, j, ee);
return;
}
if (se === He) {
r(q, O, j);
for (let ce = 0; ce < te.length; ce++) Q(te[ce], O, j, H);
r(A.anchor, O, j);
return;
}
if (se === lu) {
T(A, O, j);
return;
}
if (H !== 2 && J & 1 && Z)
if (H === 0)
Z.beforeEnter(q), r(q, O, j), Gt(() => Z.enter(q), V);
else {
const { leave: ce, delayLeave: pe, afterLeave: ke } = Z,
Oe = () => r(q, O, j),
Je = () => {
ce(q, () => {
Oe(), ke && ke();
});
};
pe ? pe(q, Oe, Je) : Je();
}
else r(q, O, j);
},
me = (A, O, j, H = !1, V = !1) => {
const {
type: q,
props: se,
ref: Z,
children: te,
dynamicChildren: J,
shapeFlag: he,
patchFlag: ce,
dirs: pe,
} = A;
if ((Z != null && ac(Z, null, j, A, !0), he & 256)) {
O.ctx.deactivate(A);
return;
}
const ke = he & 1 && pe,
Oe = !To(A);
let Je;
if (
(Oe && (Je = se && se.onVnodeBeforeUnmount) && Dn(Je, O, A),
he & 6)
)
Re(A.component, j, H);
else {
if (he & 128) {
A.suspense.unmount(j, H);
return;
}
ke && Wr(A, null, O, "beforeUnmount"),
he & 64
? A.type.remove(A, O, j, V, ee, H)
: J && (q !== He || (ce > 0 && ce & 64))
? Ae(J, O, j, !1, !0)
: ((q === He && ce & 384) || (!V && he & 16)) &&
Ae(te, O, j),
H && je(A);
}
((Oe && (Je = se && se.onVnodeUnmounted)) || ke) &&
Gt(() => {
Je && Dn(Je, O, A), ke && Wr(A, null, O, "unmounted");
}, j);
},
je = (A) => {
const { type: O, el: j, anchor: H, transition: V } = A;
if (O === He) {
Le(j, H);
return;
}
if (O === lu) {
d(A);
return;
}
const q = () => {
i(j), V && !V.persisted && V.afterLeave && V.afterLeave();
};
if (A.shapeFlag & 1 && V && !V.persisted) {
const { leave: se, delayLeave: Z } = V,
te = () => se(j, q);
Z ? Z(A.el, q, te) : te();
} else q();
},
Le = (A, O) => {
let j;
for (; A !== O; ) (j = h(A)), i(A), (A = j);
i(O);
},
Re = (A, O, j) => {
const { bum: H, scope: V, update: q, subTree: se, um: Z } = A;
H && tu(H),
V.stop(),
q && ((q.active = !1), me(se, A, O, j)),
Z && Gt(Z, O),
Gt(() => {
A.isUnmounted = !0;
}, O),
O &&
O.pendingBranch &&
!O.isUnmounted &&
A.asyncDep &&
!A.asyncResolved &&
A.suspenseId === O.pendingId &&
(O.deps--, O.deps === 0 && O.resolve());
},
Ae = (A, O, j, H = !1, V = !1, q = 0) => {
for (let se = q; se < A.length; se++) me(A[se], O, j, H, V);
},
z = (A) =>
A.shapeFlag & 6
? z(A.component.subTree)
: A.shapeFlag & 128
? A.suspense.next()
: h(A.anchor || A.el),
X = (A, O, j) => {
A == null
? O._vnode && me(O._vnode, null, null, !0)
: v(O._vnode || null, A, O, null, null, null, j),
Qf(),
ag(),
(O._vnode = A);
},
ee = {
p: v,
um: me,
m: Q,
r: je,
mt: L,
mc: k,
pc: D,
pbc: C,
n: z,
o: t,
};
let ue, Pe;
return (
e && ([ue, Pe] = e(ee)),
{ render: X, hydrate: ue, createApp: lv(X, ue) }
);
}
function Ur({ effect: t, update: e }, n) {
t.allowRecurse = e.allowRecurse = n;
}
function mv(t, e) {
return (!t || (t && !t.pendingBranch)) && e && !e.persisted;
}
function wd(t, e, n = !1) {
const r = t.children,
i = e.children;
if (we(r) && we(i))
for (let o = 0; o < r.length; o++) {
const s = r[o];
let l = i[o];
l.shapeFlag & 1 &&
!l.dynamicChildren &&
((l.patchFlag <= 0 || l.patchFlag === 32) &&
((l = i[o] = yr(i[o])), (l.el = s.el)),
n || wd(s, l)),
l.type === Ea && (l.el = s.el);
}
}
function gv(t) {
const e = t.slice(),
n = [0];
let r, i, o, s, l;
const a = t.length;
for (r = 0; r < a; r++) {
const u = t[r];
if (u !== 0) {
if (((i = n[n.length - 1]), t[i] < u)) {
(e[r] = i), n.push(r);
continue;
}
for (o = 0, s = n.length - 1; o < s; )
(l = (o + s) >> 1), t[n[l]] < u ? (o = l + 1) : (s = l);
u < t[n[o]] && (o > 0 && (e[r] = n[o - 1]), (n[o] = r));
}
}
for (o = n.length, s = n[o - 1]; o-- > 0; ) (n[o] = s), (s = e[s]);
return n;
}
const yv = (t) => t.__isTeleport,
Ro = (t) => t && (t.disabled || t.disabled === ""),
uh = (t) => typeof SVGElement != "undefined" && t instanceof SVGElement,
uc = (t, e) => {
const n = t && t.to;
return at(n) ? (e ? e(n) : null) : n;
},
vv = {
name: "Teleport",
__isTeleport: !0,
process(t, e, n, r, i, o, s, l, a, u) {
const {
mc: c,
pc: f,
pbc: h,
o: {
insert: p,
querySelector: g,
createText: v,
createComment: b,
},
} = u,
x = Ro(e.props);
let { shapeFlag: S, children: T, dynamicChildren: d } = e;
if (t == null) {
const y = (e.el = v("")),
m = (e.anchor = v(""));
p(y, n, r), p(m, n, r);
const w = (e.target = uc(e.props, g)),
k = (e.targetAnchor = v(""));
w && (p(k, w), (s = s || uh(w)));
const _ = (C, E) => {
S & 16 && c(T, C, E, i, o, s, l, a);
};
x ? _(n, m) : w && _(w, k);
} else {
e.el = t.el;
const y = (e.anchor = t.anchor),
m = (e.target = t.target),
w = (e.targetAnchor = t.targetAnchor),
k = Ro(t.props),
_ = k ? n : m,
C = k ? y : w;
if (
((s = s || uh(m)),
d
? (h(t.dynamicChildren, d, _, i, o, s, l), wd(t, e, !0))
: a || f(t, e, _, C, i, o, s, l, !1),
x)
)
k
? e.props &&
t.props &&
e.props.to !== t.props.to &&
(e.props.to = t.props.to)
: Ls(e, n, y, u, 1);
else if ((e.props && e.props.to) !== (t.props && t.props.to)) {
const E = (e.target = uc(e.props, g));
E && Ls(e, E, null, u, 0);
} else k && Ls(e, m, w, u, 1);
}
Ag(e);
},
remove(t, e, n, r, { um: i, o: { remove: o } }, s) {
const {
shapeFlag: l,
children: a,
anchor: u,
targetAnchor: c,
target: f,
props: h,
} = t;
if ((f && o(c), s && o(u), l & 16)) {
const p = s || !Ro(h);
for (let g = 0; g < a.length; g++) {
const v = a[g];
i(v, e, n, p, !!v.dynamicChildren);
}
}
},
move: Ls,
hydrate: bv,
};
function Ls(t, e, n, { o: { insert: r }, m: i }, o = 2) {
o === 0 && r(t.targetAnchor, e, n);
const { el: s, anchor: l, shapeFlag: a, children: u, props: c } = t,
f = o === 2;
if ((f && r(s, e, n), (!f || Ro(c)) && a & 16))
for (let h = 0; h < u.length; h++) i(u[h], e, n, 2);
f && r(l, e, n);
}
function bv(
t,
e,
n,
r,
i,
o,
{ o: { nextSibling: s, parentNode: l, querySelector: a } },
u
) {
const c = (e.target = uc(e.props, a));
if (c) {
const f = c._lpa || c.firstChild;
if (e.shapeFlag & 16)
if (Ro(e.props))
(e.anchor = u(s(t), e, l(t), n, r, i, o)), (e.targetAnchor = f);
else {
e.anchor = s(t);
let h = f;
for (; h; )
if (
((h = s(h)),
h && h.nodeType === 8 && h.data === "teleport anchor")
) {
(e.targetAnchor = h),
(c._lpa = e.targetAnchor && s(e.targetAnchor));
break;
}
u(f, e, c, n, r, i, o);
}
Ag(e);
}
return e.anchor && s(e.anchor);
}
const xd = vv;
function Ag(t) {
const e = t.ctx;
if (e && e.ut) {
let n = t.children[0].el;
for (; n && n !== t.targetAnchor; )
n.nodeType === 1 && n.setAttribute("data-v-owner", e.uid),
(n = n.nextSibling);
e.ut();
}
}
const He = Symbol.for("v-fgt"),
Ea = Symbol.for("v-txt"),
yn = Symbol.for("v-cmt"),
lu = Symbol.for("v-stc"),
Po = [];
let An = null;
function B(t = !1) {
Po.push((An = t ? null : []));
}
function wv() {
Po.pop(), (An = Po[Po.length - 1] || null);
}
let Jo = 1;
function ch(t) {
Jo += t;
}
function Tg(t) {
return (
(t.dynamicChildren = Jo > 0 ? An || Li : null),
wv(),
Jo > 0 && An && An.push(t),
t
);
}
function G(t, e, n, r, i, o) {
return Tg(U(t, e, n, r, i, o, !0));
}
function Be(t, e, n, r, i) {
return Tg(Me(t, e, n, r, i, !0));
}
function kl(t) {
return t ? t.__v_isVNode === !0 : !1;
}
function Qr(t, e) {
return t.type === e.type && t.key === e.key;
}
const Aa = "__vInternal",
Og = ({ key: t }) => (t != null ? t : null),
ol = ({ ref: t, ref_key: e, ref_for: n }) => (
typeof t == "number" && (t = "" + t),
t != null
? at(t) || Ht(t) || Ee(t)
? { i: It, r: t, k: e, f: !!n }
: t
: null
);
function U(
t,
e = null,
n = null,
r = 0,
i = null,
o = t === He ? 0 : 1,
s = !1,
l = !1
) {
const a = {
__v_isVNode: !0,
__v_skip: !0,
type: t,
props: e,
key: e && Og(e),
ref: e && ol(e),
scopeId: dg,
slotScopeIds: null,
children: n,
component: null,
suspense: null,
ssContent: null,
ssFallback: null,
dirs: null,
transition: null,
el: null,
anchor: null,
target: null,
targetAnchor: null,
staticCount: 0,
shapeFlag: o,
patchFlag: r,
dynamicProps: i,
dynamicChildren: null,
appContext: null,
ctx: It,
};
return (
l
? (kd(a, n), o & 128 && t.normalize(a))
: n && (a.shapeFlag |= at(n) ? 8 : 16),
Jo > 0 &&
!s &&
An &&
(a.patchFlag > 0 || o & 6) &&
a.patchFlag !== 32 &&
An.push(a),
a
);
}
const Me = xv;
function xv(t, e = null, n = null, r = 0, i = null, o = !1) {
if (((!t || t === fg) && (t = yn), kl(t))) {
const l = sr(t, e, !0);
return (
n && kd(l, n),
Jo > 0 &&
!o &&
An &&
(l.shapeFlag & 6 ? (An[An.indexOf(t)] = l) : An.push(l)),
(l.patchFlag |= -2),
l
);
}
if ((Tv(t) && (t = t.__vccOpts), e)) {
e = Ft(e);
let { class: l, style: a } = e;
l && !at(l) && (e.class = ye(l)),
it(a) && (Zm(a) && !we(a) && (a = _t({}, a)), (e.style = Ir(a)));
}
const s = at(t) ? 1 : B2(t) ? 128 : yv(t) ? 64 : it(t) ? 4 : Ee(t) ? 2 : 0;
return U(t, e, n, r, i, s, o, !0);
}
function Ft(t) {
return t ? (Zm(t) || Aa in t ? _t({}, t) : t) : null;
}
function sr(t, e, n = !1) {
const { props: r, ref: i, patchFlag: o, children: s } = t,
l = e ? yt(r || {}, e) : r;
return {
__v_isVNode: !0,
__v_skip: !0,
type: t.type,
props: l,
key: l && Og(l),
ref:
e && e.ref
? n && i
? we(i)
? i.concat(ol(e))
: [i, ol(e)]
: ol(e)
: i,
scopeId: t.scopeId,
slotScopeIds: t.slotScopeIds,
children: s,
target: t.target,
targetAnchor: t.targetAnchor,
staticCount: t.staticCount,
shapeFlag: t.shapeFlag,
patchFlag: e && t.type !== He ? (o === -1 ? 16 : o | 16) : o,
dynamicProps: t.dynamicProps,
dynamicChildren: t.dynamicChildren,
appContext: t.appContext,
dirs: t.dirs,
transition: t.transition,
component: t.component,
suspense: t.suspense,
ssContent: t.ssContent && sr(t.ssContent),
ssFallback: t.ssFallback && sr(t.ssFallback),
el: t.el,
anchor: t.anchor,
ctx: t.ctx,
ce: t.ce,
};
}
function Pn(t = " ", e = 0) {
return Me(Ea, null, t, e);
}
function De(t = "", e = !1) {
return e ? (B(), Be(yn, null, t)) : Me(yn, null, t);
}
function Hn(t) {
return t == null || typeof t == "boolean"
? Me(yn)
: we(t)
? Me(He, null, t.slice())
: typeof t == "object"
? yr(t)
: Me(Ea, null, String(t));
}
function yr(t) {
return (t.el === null && t.patchFlag !== -1) || t.memo ? t : sr(t);
}
function kd(t, e) {
let n = 0;
const { shapeFlag: r } = t;
if (e == null) e = null;
else if (we(e)) n = 16;
else if (typeof e == "object")
if (r & 65) {
const i = e.default;
i && (i._c && (i._d = !1), kd(t, i()), i._c && (i._d = !0));
return;
} else {
n = 32;
const i = e._;
!i && !(Aa in e)
? (e._ctx = It)
: i === 3 &&
It &&
(It.slots._ === 1
? (e._ = 1)
: ((e._ = 2), (t.patchFlag |= 1024)));
}
else
Ee(e)
? ((e = { default: e, _ctx: It }), (n = 32))
: ((e = String(e)), r & 64 ? ((n = 16), (e = [Pn(e)])) : (n = 8));
(t.children = e), (t.shapeFlag |= n);
}
function yt(...t) {
const e = {};
for (let n = 0; n < t.length; n++) {
const r = t[n];
for (const i in r)
if (i === "class")
e.class !== r.class && (e.class = ye([e.class, r.class]));
else if (i === "style") e.style = Ir([e.style, r.style]);
else if (va(i)) {
const o = e[i],
s = r[i];
s &&
o !== s &&
!(we(o) && o.includes(s)) &&
(e[i] = o ? [].concat(o, s) : s);
} else i !== "" && (e[i] = r[i]);
}
return e;
}
function Dn(t, e, n, r = null) {
gn(t, e, 7, [n, r]);
}
const kv = kg();
let Cv = 0;
function Sv(t, e, n) {
const r = t.type,
i = (e ? e.appContext : t.appContext) || kv,
o = {
uid: Cv++,
vnode: t,
type: r,
parent: e,
appContext: i,
root: null,
next: null,
subTree: null,
effect: null,
update: null,
scope: new n2(!0),
render: null,
proxy: null,
exposed: null,
exposeProxy: null,
withProxy: null,
provides: e ? e.provides : Object.create(i.provides),
accessCache: null,
renderCache: [],
components: null,
directives: null,
propsOptions: Sg(r, i),
emitsOptions: cg(r, i),
emit: null,
emitted: null,
propsDefaults: rt,
inheritAttrs: r.inheritAttrs,
ctx: rt,
data: rt,
props: rt,
attrs: rt,
slots: rt,
refs: rt,
setupState: rt,
setupContext: null,
attrsProxy: null,
slotsProxy: null,
suspense: n,
suspenseId: n ? n.pendingId : 0,
asyncDep: null,
asyncResolved: !1,
isMounted: !1,
isUnmounted: !1,
isDeactivated: !1,
bc: null,
c: null,
bm: null,
m: null,
bu: null,
u: null,
um: null,
bum: null,
da: null,
a: null,
rtg: null,
rtc: null,
ec: null,
sp: null,
};
return (
(o.ctx = { _: o }),
(o.root = e ? e.root : o),
(o.emit = N2.bind(null, o)),
t.ce && t.ce(o),
o
);
}
let St = null;
const ps = () => St || It;
let Cd,
Ei,
dh = "__VUE_INSTANCE_SETTERS__";
(Ei = Ju()[dh]) || (Ei = Ju()[dh] = []),
Ei.push((t) => (St = t)),
(Cd = (t) => {
Ei.length > 1 ? Ei.forEach((e) => e(t)) : Ei[0](t);
});
const Ui = (t) => {
Cd(t), t.scope.on();
},
si = () => {
St && St.scope.off(), Cd(null);
};
function Rg(t) {
return t.vnode.shapeFlag & 4;
}
let Ki = !1;
function _v(t, e = !1) {
Ki = e;
const { props: n, children: r } = t.vnode,
i = Rg(t);
av(t, n, i, e), dv(t, r);
const o = i ? Mv(t, e) : void 0;
return (Ki = !1), o;
}
function Mv(t, e) {
const n = t.type;
(t.accessCache = Object.create(null)), (t.proxy = eg(new Proxy(t.ctx, ev)));
const { setup: r } = n;
if (r) {
const i = (t.setupContext = r.length > 1 ? Ng(t) : null);
Ui(t), io();
const o = Or(r, t, 0, [t.props, i]);
if ((oo(), si(), Lm(o))) {
if ((o.then(si, si), e))
return o
.then((s) => {
fh(t, s, e);
})
.catch((s) => {
cs(s, t, 0);
});
t.asyncDep = o;
} else fh(t, o, e);
} else Pg(t, e);
}
function fh(t, e, n) {
Ee(e)
? t.type.__ssrInlineRender
? (t.ssrRender = e)
: (t.render = e)
: it(e) && (t.setupState = og(e)),
Pg(t, n);
}
let hh;
function Pg(t, e, n) {
const r = t.type;
if (!t.render) {
if (!e && hh && !r.render) {
const i = r.template || vd(t).template;
if (i) {
const { isCustomElement: o, compilerOptions: s } =
t.appContext.config,
{ delimiters: l, compilerOptions: a } = r,
u = _t(_t({ isCustomElement: o, delimiters: l }, s), a);
r.render = hh(i, u);
}
}
t.render = r.render || On;
}
{
Ui(t), io();
try {
tv(t);
} finally {
oo(), si();
}
}
}
function Ev(t) {
return (
t.attrsProxy ||
(t.attrsProxy = new Proxy(t.attrs, {
get(e, n) {
return tn(t, "get", "$attrs"), e[n];
},
}))
);
}
function Ng(t) {
const e = (n) => {
t.exposed = n || {};
};
return {
get attrs() {
return Ev(t);
},
slots: t.slots,
emit: t.emit,
expose: e,
};
}
function Ta(t) {
if (t.exposed)
return (
t.exposeProxy ||
(t.exposeProxy = new Proxy(og(eg(t.exposed)), {
get(e, n) {
if (n in e) return e[n];
if (n in Oo) return Oo[n](t);
},
has(e, n) {
return n in e || n in Oo;
},
}))
);
}
function Av(t, e = !0) {
return Ee(t) ? t.displayName || t.name : t.name || (e && t.__name);
}
function Tv(t) {
return Ee(t) && "__vccOpts" in t;
}
const $ = (t, e) => Zu(t, e, Ki);
function ze(t, e, n) {
const r = arguments.length;
return r === 2
? it(e) && !we(e)
? kl(e)
? Me(t, null, [e])
: Me(t, e)
: Me(t, null, e)
: (r > 3
? (n = Array.prototype.slice.call(arguments, 2))
: r === 3 && kl(n) && (n = [n]),
Me(t, e, n));
}
const Ov = Symbol.for("v-scx"),
Rv = () => qe(Ov),
Pv = "3.3.9",
Nv = "http://www.w3.org/2000/svg",
Xr = typeof document != "undefined" ? document : null,
ph = Xr && Xr.createElement("template"),
jv = {
insert: (t, e, n) => {
e.insertBefore(t, n || null);
},
remove: (t) => {
const e = t.parentNode;
e && e.removeChild(t);
},
createElement: (t, e, n, r) => {
const i = e
? Xr.createElementNS(Nv, t)
: Xr.createElement(t, n ? { is: n } : void 0);
return (
t === "select" &&
r &&
r.multiple != null &&
i.setAttribute("multiple", r.multiple),
i
);
},
createText: (t) => Xr.createTextNode(t),
createComment: (t) => Xr.createComment(t),
setText: (t, e) => {
t.nodeValue = e;
},
setElementText: (t, e) => {
t.textContent = e;
},
parentNode: (t) => t.parentNode,
nextSibling: (t) => t.nextSibling,
querySelector: (t) => Xr.querySelector(t),
setScopeId(t, e) {
t.setAttribute(e, "");
},
insertStaticContent(t, e, n, r, i, o) {
const s = n ? n.previousSibling : e.lastChild;
if (i && (i === o || i.nextSibling))
for (
;
e.insertBefore(i.cloneNode(!0), n),
!(i === o || !(i = i.nextSibling));
);
else {
ph.innerHTML = r ? `<svg>${t}</svg>` : t;
const l = ph.content;
if (r) {
const a = l.firstChild;
for (; a.firstChild; ) l.appendChild(a.firstChild);
l.removeChild(a);
}
e.insertBefore(l, n);
}
return [
s ? s.nextSibling : e.firstChild,
n ? n.previousSibling : e.lastChild,
];
},
},
fr = "transition",
go = "animation",
Go = Symbol("_vtc"),
Oa = (t, { slots: e }) => ze(V2, Lv(t), e);
Oa.displayName = "Transition";
const jg = {
name: String,
type: String,
css: { type: Boolean, default: !0 },
duration: [String, Number, Object],
enterFromClass: String,
enterActiveClass: String,
enterToClass: String,
appearFromClass: String,
appearActiveClass: String,
appearToClass: String,
leaveFromClass: String,
leaveActiveClass: String,
leaveToClass: String,
};
Oa.props = _t({}, mg, jg);
const Kr = (t, e = []) => {
we(t) ? t.forEach((n) => n(...e)) : t && t(...e);
},
mh = (t) => (t ? (we(t) ? t.some((e) => e.length > 1) : t.length > 1) : !1);
function Lv(t) {
const e = {};
for (const R in t) R in jg || (e[R] = t[R]);
if (t.css === !1) return e;
const {
name: n = "v",
type: r,
duration: i,
enterFromClass: o = `${n}-enter-from`,
enterActiveClass: s = `${n}-enter-active`,
enterToClass: l = `${n}-enter-to`,
appearFromClass: a = o,
appearActiveClass: u = s,
appearToClass: c = l,
leaveFromClass: f = `${n}-leave-from`,
leaveActiveClass: h = `${n}-leave-active`,
leaveToClass: p = `${n}-leave-to`,
} = t,
g = Dv(i),
v = g && g[0],
b = g && g[1],
{
onBeforeEnter: x,
onEnter: S,
onEnterCancelled: T,
onLeave: d,
onLeaveCancelled: y,
onBeforeAppear: m = x,
onAppear: w = S,
onAppearCancelled: k = T,
} = e,
_ = (R, P, L) => {
qr(R, P ? c : l), qr(R, P ? u : s), L && L();
},
C = (R, P) => {
(R._isLeaving = !1), qr(R, f), qr(R, p), qr(R, h), P && P();
},
E = (R) => (P, L) => {
const I = R ? w : S,
M = () => _(P, R, L);
Kr(I, [P, M]),
gh(() => {
qr(P, R ? a : o), hr(P, R ? c : l), mh(I) || yh(P, r, v, M);
});
};
return _t(e, {
onBeforeEnter(R) {
Kr(x, [R]), hr(R, o), hr(R, s);
},
onBeforeAppear(R) {
Kr(m, [R]), hr(R, a), hr(R, u);
},
onEnter: E(!1),
onAppear: E(!0),
onLeave(R, P) {
R._isLeaving = !0;
const L = () => C(R, P);
hr(R, f),
$v(),
hr(R, h),
gh(() => {
!R._isLeaving ||
(qr(R, f), hr(R, p), mh(d) || yh(R, r, b, L));
}),
Kr(d, [R, L]);
},
onEnterCancelled(R) {
_(R, !1), Kr(T, [R]);
},
onAppearCancelled(R) {
_(R, !0), Kr(k, [R]);
},
onLeaveCancelled(R) {
C(R), Kr(y, [R]);
},
});
}
function Dv(t) {
if (t == null) return null;
if (it(t)) return [au(t.enter), au(t.leave)];
{
const e = au(t);
return [e, e];
}
}
function au(t) {
return Gy(t);
}
function hr(t, e) {
e.split(/\s+/).forEach((n) => n && t.classList.add(n)),
(t[Go] || (t[Go] = new Set())).add(e);
}
function qr(t, e) {
e.split(/\s+/).forEach((r) => r && t.classList.remove(r));
const n = t[Go];
n && (n.delete(e), n.size || (t[Go] = void 0));
}
function gh(t) {
requestAnimationFrame(() => {
requestAnimationFrame(t);
});
}
let Iv = 0;
function yh(t, e, n, r) {
const i = (t._endId = ++Iv),
o = () => {
i === t._endId && r();
};
if (n) return setTimeout(o, n);
const { type: s, timeout: l, propCount: a } = Bv(t, e);
if (!s) return r();
const u = s + "end";
let c = 0;
const f = () => {
t.removeEventListener(u, h), o();
},
h = (p) => {
p.target === t && ++c >= a && f();
};
setTimeout(() => {
c < a && f();
}, l + 1),
t.addEventListener(u, h);
}
function Bv(t, e) {
const n = window.getComputedStyle(t),
r = (g) => (n[g] || "").split(", "),
i = r(`${fr}Delay`),
o = r(`${fr}Duration`),
s = vh(i, o),
l = r(`${go}Delay`),
a = r(`${go}Duration`),
u = vh(l, a);
let c = null,
f = 0,
h = 0;
e === fr
? s > 0 && ((c = fr), (f = s), (h = o.length))
: e === go
? u > 0 && ((c = go), (f = u), (h = a.length))
: ((f = Math.max(s, u)),
(c = f > 0 ? (s > u ? fr : go) : null),
(h = c ? (c === fr ? o.length : a.length) : 0));
const p =
c === fr &&
/\b(transform|all)(,|$)/.test(r(`${fr}Property`).toString());
return { type: c, timeout: f, propCount: h, hasTransform: p };
}
function vh(t, e) {
for (; t.length < e.length; ) t = t.concat(t);
return Math.max(...e.map((n, r) => bh(n) + bh(t[r])));
}
function bh(t) {
return t === "auto" ? 0 : Number(t.slice(0, -1).replace(",", ".")) * 1e3;
}
function $v() {
return document.body.offsetHeight;
}
function zv(t, e, n) {
const r = t[Go];
r && (e = (e ? [e, ...r] : [...r]).join(" ")),
e == null
? t.removeAttribute("class")
: n
? t.setAttribute("class", e)
: (t.className = e);
}
const Sd = Symbol("_vod"),
cc = {
beforeMount(t, { value: e }, { transition: n }) {
(t[Sd] = t.style.display === "none" ? "" : t.style.display),
n && e ? n.beforeEnter(t) : yo(t, e);
},
mounted(t, { value: e }, { transition: n }) {
n && e && n.enter(t);
},
updated(t, { value: e, oldValue: n }, { transition: r }) {
!e != !n &&
(r
? e
? (r.beforeEnter(t), yo(t, !0), r.enter(t))
: r.leave(t, () => {
yo(t, !1);
})
: yo(t, e));
},
beforeUnmount(t, { value: e }) {
yo(t, e);
},
};
function yo(t, e) {
t.style.display = e ? t[Sd] : "none";
}
function Hv(t, e, n) {
const r = t.style,
i = at(n);
if (n && !i) {
if (e && !at(e)) for (const o in e) n[o] == null && dc(r, o, "");
for (const o in n) dc(r, o, n[o]);
} else {
const o = r.display;
i ? e !== n && (r.cssText = n) : e && t.removeAttribute("style"),
Sd in t && (r.display = o);
}
}
const wh = /\s*!important$/;
function dc(t, e, n) {
if (we(n)) n.forEach((r) => dc(t, e, r));
else if ((n == null && (n = ""), e.startsWith("--"))) t.setProperty(e, n);
else {
const r = Fv(t, e);
wh.test(n)
? t.setProperty(xi(r), n.replace(wh, ""), "important")
: (t[r] = n);
}
}
const xh = ["Webkit", "Moz", "ms"],
uu = {};
function Fv(t, e) {
const n = uu[e];
if (n) return n;
let r = Jn(e);
if (r !== "filter" && r in t) return (uu[e] = r);
r = ka(r);
for (let i = 0; i < xh.length; i++) {
const o = xh[i] + r;
if (o in t) return (uu[e] = o);
}
return e;
}
const kh = "http://www.w3.org/1999/xlink";
function Vv(t, e, n, r, i) {
if (r && e.startsWith("xlink:"))
n == null
? t.removeAttributeNS(kh, e.slice(6, e.length))
: t.setAttributeNS(kh, e, n);
else {
const o = t2(e);
n == null || (o && !Bm(n))
? t.removeAttribute(e)
: t.setAttribute(e, o ? "" : n);
}
}
function Wv(t, e, n, r, i, o, s) {
if (e === "innerHTML" || e === "textContent") {
r && s(r, i, o), (t[e] = n == null ? "" : n);
return;
}
const l = t.tagName;
if (e === "value" && l !== "PROGRESS" && !l.includes("-")) {
t._value = n;
const u = l === "OPTION" ? t.getAttribute("value") : t.value,
c = n == null ? "" : n;
u !== c && (t.value = c), n == null && t.removeAttribute(e);
return;
}
let a = !1;
if (n === "" || n == null) {
const u = typeof t[e];
u === "boolean"
? (n = Bm(n))
: n == null && u === "string"
? ((n = ""), (a = !0))
: u === "number" && ((n = 0), (a = !0));
}
try {
t[e] = n;
} catch (u) {}
a && t.removeAttribute(e);
}
function Uv(t, e, n, r) {
t.addEventListener(e, n, r);
}
function Kv(t, e, n, r) {
t.removeEventListener(e, n, r);
}
const Ch = Symbol("_vei");
function qv(t, e, n, r, i = null) {
const o = t[Ch] || (t[Ch] = {}),
s = o[e];
if (r && s) s.value = r;
else {
const [l, a] = Jv(e);
if (r) {
const u = (o[e] = Qv(r, i));
Uv(t, l, u, a);
} else s && (Kv(t, l, s, a), (o[e] = void 0));
}
}
const Sh = /(?:Once|Passive|Capture)$/;
function Jv(t) {
let e;
if (Sh.test(t)) {
e = {};
let r;
for (; (r = t.match(Sh)); )
(t = t.slice(0, t.length - r[0].length)),
(e[r[0].toLowerCase()] = !0);
}
return [t[2] === ":" ? t.slice(3) : xi(t.slice(2)), e];
}
let cu = 0;
const Gv = Promise.resolve(),
Yv = () => cu || (Gv.then(() => (cu = 0)), (cu = Date.now()));
function Qv(t, e) {
const n = (r) => {
if (!r._vts) r._vts = Date.now();
else if (r._vts <= n.attached) return;
gn(Xv(r, n.value), e, 5, [r]);
};
return (n.value = t), (n.attached = Yv()), n;
}
function Xv(t, e) {
if (we(e)) {
const n = t.stopImmediatePropagation;
return (
(t.stopImmediatePropagation = () => {
n.call(t), (t._stopped = !0);
}),
e.map((r) => (i) => !i._stopped && r && r(i))
);
} else return e;
}
const _h = /^on[a-z]/,
Zv = (t, e, n, r, i = !1, o, s, l, a) => {
e === "class"
? zv(t, r, i)
: e === "style"
? Hv(t, n, r)
: va(e)
? od(e) || qv(t, e, n, r, s)
: (
e[0] === "."
? ((e = e.slice(1)), !0)
: e[0] === "^"
? ((e = e.slice(1)), !1)
: eb(t, e, r, i)
)
? Wv(t, e, r, o, s, l, a)
: (e === "true-value"
? (t._trueValue = r)
: e === "false-value" && (t._falseValue = r),
Vv(t, e, r, i));
};
function eb(t, e, n, r) {
return r
? !!(
e === "innerHTML" ||
e === "textContent" ||
(e in t && _h.test(e) && Ee(n))
)
: e === "spellcheck" ||
e === "draggable" ||
e === "translate" ||
e === "form" ||
(e === "list" && t.tagName === "INPUT") ||
(e === "type" && t.tagName === "TEXTAREA") ||
(_h.test(e) && at(n))
? !1
: e in t;
}
const tb = ["ctrl", "shift", "alt", "meta"],
nb = {
stop: (t) => t.stopPropagation(),
prevent: (t) => t.preventDefault(),
self: (t) => t.target !== t.currentTarget,
ctrl: (t) => !t.ctrlKey,
shift: (t) => !t.shiftKey,
alt: (t) => !t.altKey,
meta: (t) => !t.metaKey,
left: (t) => "button" in t && t.button !== 0,
middle: (t) => "button" in t && t.button !== 1,
right: (t) => "button" in t && t.button !== 2,
exact: (t, e) => tb.some((n) => t[`${n}Key`] && !e.includes(n)),
},
_d =
(t, e) =>
(n, ...r) => {
for (let i = 0; i < e.length; i++) {
const o = nb[e[i]];
if (o && o(n, e)) return;
}
return t(n, ...r);
},
rb = {
esc: "escape",
space: " ",
up: "arrow-up",
left: "arrow-left",
right: "arrow-right",
down: "arrow-down",
delete: "backspace",
},
ib = (t, e) => (n) => {
if (!("key" in n)) return;
const r = xi(n.key);
if (e.some((i) => i === r || rb[i] === r)) return t(n);
},
ob = _t({ patchProp: Zv }, jv);
let Mh;
function sb() {
return Mh || (Mh = hv(ob));
}
const cR = (...t) => {
const e = sb().createApp(...t),
{ mount: n } = e;
return (
(e.mount = (r) => {
const i = lb(r);
if (!i) return;
const o = e._component;
!Ee(o) && !o.render && !o.template && (o.template = i.innerHTML),
(i.innerHTML = "");
const s = n(i, !1, i instanceof SVGElement);
return (
i instanceof Element &&
(i.removeAttribute("v-cloak"),
i.setAttribute("data-v-app", "")),
s
);
}),
e
);
};
function lb(t) {
return at(t) ? document.querySelector(t) : t;
}
const ab = "modulepreload",
ub = function (t) {
return "/" + t;
},
Eh = {},
Ds = function (e, n, r) {
if (!n || n.length === 0) return e();
const i = document.getElementsByTagName("link");
return Promise.all(
n.map((o) => {
if (((o = ub(o)), o in Eh)) return;
Eh[o] = !0;
const s = o.endsWith(".css"),
l = s ? '[rel="stylesheet"]' : "";
if (!!r)
for (let c = i.length - 1; c >= 0; c--) {
const f = i[c];
if (f.href === o && (!s || f.rel === "stylesheet"))
return;
}
else if (document.querySelector(`link[href="${o}"]${l}`))
return;
const u = document.createElement("link");
if (
((u.rel = s ? "stylesheet" : ab),
s || ((u.as = "script"), (u.crossOrigin = "")),
(u.href = o),
document.head.appendChild(u),
s)
)
return new Promise((c, f) => {
u.addEventListener("load", c),
u.addEventListener("error", () =>
f(new Error(`Unable to preload CSS for ${o}`))
);
});
})
).then(() => e());
};
/*!
* vue-router v4.2.5
* (c) 2023 Eduardo San Martin Morote
* @license MIT
*/ const Oi = typeof window != "undefined";
function cb(t) {
return t.__esModule || t[Symbol.toStringTag] === "Module";
}
const Xe = Object.assign;
function du(t, e) {
const n = {};
for (const r in e) {
const i = e[r];
n[r] = Nn(i) ? i.map(t) : t(i);
}
return n;
}
const No = () => {},
Nn = Array.isArray,
db = /\/$/,
fb = (t) => t.replace(db, "");
function fu(t, e, n = "/") {
let r,
i = {},
o = "",
s = "";
const l = e.indexOf("#");
let a = e.indexOf("?");
return (
l < a && l >= 0 && (a = -1),
a > -1 &&
((r = e.slice(0, a)),
(o = e.slice(a + 1, l > -1 ? l : e.length)),
(i = t(o))),
l > -1 && ((r = r || e.slice(0, l)), (s = e.slice(l, e.length))),
(r = gb(r != null ? r : e, n)),
{ fullPath: r + (o && "?") + o + s, path: r, query: i, hash: s }
);
}
function hb(t, e) {
const n = e.query ? t(e.query) : "";
return e.path + (n && "?") + n + (e.hash || "");
}
function Ah(t, e) {
return !e || !t.toLowerCase().startsWith(e.toLowerCase())
? t
: t.slice(e.length) || "/";
}
function pb(t, e, n) {
const r = e.matched.length - 1,
i = n.matched.length - 1;
return (
r > -1 &&
r === i &&
qi(e.matched[r], n.matched[i]) &&
Lg(e.params, n.params) &&
t(e.query) === t(n.query) &&
e.hash === n.hash
);
}
function qi(t, e) {
return (t.aliasOf || t) === (e.aliasOf || e);
}
function Lg(t, e) {
if (Object.keys(t).length !== Object.keys(e).length) return !1;
for (const n in t) if (!mb(t[n], e[n])) return !1;
return !0;
}
function mb(t, e) {
return Nn(t) ? Th(t, e) : Nn(e) ? Th(e, t) : t === e;
}
function Th(t, e) {
return Nn(e)
? t.length === e.length && t.every((n, r) => n === e[r])
: t.length === 1 && t[0] === e;
}
function gb(t, e) {
if (t.startsWith("/")) return t;
if (!t) return e;
const n = e.split("/"),
r = t.split("/"),
i = r[r.length - 1];
(i === ".." || i === ".") && r.push("");
let o = n.length - 1,
s,
l;
for (s = 0; s < r.length; s++)
if (((l = r[s]), l !== "."))
if (l === "..") o > 1 && o--;
else break;
return (
n.slice(0, o).join("/") +
"/" +
r.slice(s - (s === r.length ? 1 : 0)).join("/")
);
}
var Yo;
(function (t) {
(t.pop = "pop"), (t.push = "push");
})(Yo || (Yo = {}));
var jo;
(function (t) {
(t.back = "back"), (t.forward = "forward"), (t.unknown = "");
})(jo || (jo = {}));
function yb(t) {
if (!t)
if (Oi) {
const e = document.querySelector("base");
(t = (e && e.getAttribute("href")) || "/"),
(t = t.replace(/^\w+:\/\/[^\/]+/, ""));
} else t = "/";
return t[0] !== "/" && t[0] !== "#" && (t = "/" + t), fb(t);
}
const vb = /^[^#]+#/;
function bb(t, e) {
return t.replace(vb, "#") + e;
}
function wb(t, e) {
const n = document.documentElement.getBoundingClientRect(),
r = t.getBoundingClientRect();
return {
behavior: e.behavior,
left: r.left - n.left - (e.left || 0),
top: r.top - n.top - (e.top || 0),
};
}
const Ra = () => ({ left: window.pageXOffset, top: window.pageYOffset });
function xb(t) {
let e;
if ("el" in t) {
const n = t.el,
r = typeof n == "string" && n.startsWith("#"),
i =
typeof n == "string"
? r
? document.getElementById(n.slice(1))
: document.querySelector(n)
: n;
if (!i) return;
e = wb(i, t);
} else e = t;
"scrollBehavior" in document.documentElement.style
? window.scrollTo(e)
: window.scrollTo(
e.left != null ? e.left : window.pageXOffset,
e.top != null ? e.top : window.pageYOffset
);
}
function Oh(t, e) {
return (history.state ? history.state.position - e : -1) + t;
}
const fc = new Map();
function kb(t, e) {
fc.set(t, e);
}
function Cb(t) {
const e = fc.get(t);
return fc.delete(t), e;
}
let Sb = () => location.protocol + "//" + location.host;
function Dg(t, e) {
const { pathname: n, search: r, hash: i } = e,
o = t.indexOf("#");
if (o > -1) {
let l = i.includes(t.slice(o)) ? t.slice(o).length : 1,
a = i.slice(l);
return a[0] !== "/" && (a = "/" + a), Ah(a, "");
}
return Ah(n, t) + r + i;
}
function _b(t, e, n, r) {
let i = [],
o = [],
s = null;
const l = ({ state: h }) => {
const p = Dg(t, location),
g = n.value,
v = e.value;
let b = 0;
if (h) {
if (((n.value = p), (e.value = h), s && s === g)) {
s = null;
return;
}
b = v ? h.position - v.position : 0;
} else r(p);
i.forEach((x) => {
x(n.value, g, {
delta: b,
type: Yo.pop,
direction: b ? (b > 0 ? jo.forward : jo.back) : jo.unknown,
});
});
};
function a() {
s = n.value;
}
function u(h) {
i.push(h);
const p = () => {
const g = i.indexOf(h);
g > -1 && i.splice(g, 1);
};
return o.push(p), p;
}
function c() {
const { history: h } = window;
!h.state || h.replaceState(Xe({}, h.state, { scroll: Ra() }), "");
}
function f() {
for (const h of o) h();
(o = []),
window.removeEventListener("popstate", l),
window.removeEventListener("beforeunload", c);
}
return (
window.addEventListener("popstate", l),
window.addEventListener("beforeunload", c, { passive: !0 }),
{ pauseListeners: a, listen: u, destroy: f }
);
}
function Rh(t, e, n, r = !1, i = !1) {
return {
back: t,
current: e,
forward: n,
replaced: r,
position: window.history.length,
scroll: i ? Ra() : null,
};
}
function Mb(t) {
const { history: e, location: n } = window,
r = { value: Dg(t, n) },
i = { value: e.state };
i.value ||
o(
r.value,
{
back: null,
current: r.value,
forward: null,
position: e.length - 1,
replaced: !0,
scroll: null,
},
!0
);
function o(a, u, c) {
const f = t.indexOf("#"),
h =
f > -1
? (n.host && document.querySelector("base")
? t
: t.slice(f)) + a
: Sb() + t + a;
try {
e[c ? "replaceState" : "pushState"](u, "", h), (i.value = u);
} catch (p) {
console.error(p), n[c ? "replace" : "assign"](h);
}
}
function s(a, u) {
const c = Xe({}, e.state, Rh(i.value.back, a, i.value.forward, !0), u, {
position: i.value.position,
});
o(a, c, !0), (r.value = a);
}
function l(a, u) {
const c = Xe({}, i.value, e.state, { forward: a, scroll: Ra() });
o(c.current, c, !0);
const f = Xe({}, Rh(r.value, a, null), { position: c.position + 1 }, u);
o(a, f, !1), (r.value = a);
}
return { location: r, state: i, push: l, replace: s };
}
function dR(t) {
t = yb(t);
const e = Mb(t),
n = _b(t, e.state, e.location, e.replace);
function r(o, s = !0) {
s || n.pauseListeners(), history.go(o);
}
const i = Xe(
{ location: "", base: t, go: r, createHref: bb.bind(null, t) },
e,
n
);
return (
Object.defineProperty(i, "location", {
enumerable: !0,
get: () => e.location.value,
}),
Object.defineProperty(i, "state", {
enumerable: !0,
get: () => e.state.value,
}),
i
);
}
function Eb(t) {
return typeof t == "string" || (t && typeof t == "object");
}
function Ig(t) {
return typeof t == "string" || typeof t == "symbol";
}
const pr = {
path: "/",
name: void 0,
params: {},
query: {},
hash: "",
fullPath: "/",
matched: [],
meta: {},
redirectedFrom: void 0,
},
Bg = Symbol("");
var Ph;
(function (t) {
(t[(t.aborted = 4)] = "aborted"),
(t[(t.cancelled = 8)] = "cancelled"),
(t[(t.duplicated = 16)] = "duplicated");
})(Ph || (Ph = {}));
function Ji(t, e) {
return Xe(new Error(), { type: t, [Bg]: !0 }, e);
}
function er(t, e) {
return t instanceof Error && Bg in t && (e == null || !!(t.type & e));
}
const Nh = "[^/]+?",
Ab = { sensitive: !1, strict: !1, start: !0, end: !0 },
Tb = /[.+*?^${}()[\]/\\]/g;
function Ob(t, e) {
const n = Xe({}, Ab, e),
r = [];
let i = n.start ? "^" : "";
const o = [];
for (const u of t) {
const c = u.length ? [] : [90];
n.strict && !u.length && (i += "/");
for (let f = 0; f < u.length; f++) {
const h = u[f];
let p = 40 + (n.sensitive ? 0.25 : 0);
if (h.type === 0)
f || (i += "/"), (i += h.value.replace(Tb, "\\$&")), (p += 40);
else if (h.type === 1) {
const { value: g, repeatable: v, optional: b, regexp: x } = h;
o.push({ name: g, repeatable: v, optional: b });
const S = x || Nh;
if (S !== Nh) {
p += 10;
try {
new RegExp(`(${S})`);
} catch (d) {
throw new Error(
`Invalid custom RegExp for param "${g}" (${S}): ` +
d.message
);
}
}
let T = v ? `((?:${S})(?:/(?:${S}))*)` : `(${S})`;
f || (T = b && u.length < 2 ? `(?:/${T})` : "/" + T),
b && (T += "?"),
(i += T),
(p += 20),
b && (p += -8),
v && (p += -20),
S === ".*" && (p += -50);
}
c.push(p);
}
r.push(c);
}
if (n.strict && n.end) {
const u = r.length - 1;
r[u][r[u].length - 1] += 0.7000000000000001;
}
n.strict || (i += "/?"), n.end ? (i += "$") : n.strict && (i += "(?:/|$)");
const s = new RegExp(i, n.sensitive ? "" : "i");
function l(u) {
const c = u.match(s),
f = {};
if (!c) return null;
for (let h = 1; h < c.length; h++) {
const p = c[h] || "",
g = o[h - 1];
f[g.name] = p && g.repeatable ? p.split("/") : p;
}
return f;
}
function a(u) {
let c = "",
f = !1;
for (const h of t) {
(!f || !c.endsWith("/")) && (c += "/"), (f = !1);
for (const p of h)
if (p.type === 0) c += p.value;
else if (p.type === 1) {
const { value: g, repeatable: v, optional: b } = p,
x = g in u ? u[g] : "";
if (Nn(x) && !v)
throw new Error(
`Provided param "${g}" is an array but it is not repeatable (* or + modifiers)`
);
const S = Nn(x) ? x.join("/") : x;
if (!S)
if (b)
h.length < 2 &&
(c.endsWith("/")
? (c = c.slice(0, -1))
: (f = !0));
else throw new Error(`Missing required param "${g}"`);
c += S;
}
}
return c || "/";
}
return { re: s, score: r, keys: o, parse: l, stringify: a };
}
function Rb(t, e) {
let n = 0;
for (; n < t.length && n < e.length; ) {
const r = e[n] - t[n];
if (r) return r;
n++;
}
return t.length < e.length
? t.length === 1 && t[0] === 40 + 40
? -1
: 1
: t.length > e.length
? e.length === 1 && e[0] === 40 + 40
? 1
: -1
: 0;
}
function Pb(t, e) {
let n = 0;
const r = t.score,
i = e.score;
for (; n < r.length && n < i.length; ) {
const o = Rb(r[n], i[n]);
if (o) return o;
n++;
}
if (Math.abs(i.length - r.length) === 1) {
if (jh(r)) return 1;
if (jh(i)) return -1;
}
return i.length - r.length;
}
function jh(t) {
const e = t[t.length - 1];
return t.length > 0 && e[e.length - 1] < 0;
}
const Nb = { type: 0, value: "" },
jb = /[a-zA-Z0-9_]/;
function Lb(t) {
if (!t) return [[]];
if (t === "/") return [[Nb]];
if (!t.startsWith("/")) throw new Error(`Invalid path "${t}"`);
function e(p) {
throw new Error(`ERR (${n})/"${u}": ${p}`);
}
let n = 0,
r = n;
const i = [];
let o;
function s() {
o && i.push(o), (o = []);
}
let l = 0,
a,
u = "",
c = "";
function f() {
!u ||
(n === 0
? o.push({ type: 0, value: u })
: n === 1 || n === 2 || n === 3
? (o.length > 1 &&
(a === "*" || a === "+") &&
e(
`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`
),
o.push({
type: 1,
value: u,
regexp: c,
repeatable: a === "*" || a === "+",
optional: a === "*" || a === "?",
}))
: e("Invalid state to consume buffer"),
(u = ""));
}
function h() {
u += a;
}
for (; l < t.length; ) {
if (((a = t[l++]), a === "\\" && n !== 2)) {
(r = n), (n = 4);
continue;
}
switch (n) {
case 0:
a === "/" ? (u && f(), s()) : a === ":" ? (f(), (n = 1)) : h();
break;
case 4:
h(), (n = r);
break;
case 1:
a === "("
? (n = 2)
: jb.test(a)
? h()
: (f(),
(n = 0),
a !== "*" && a !== "?" && a !== "+" && l--);
break;
case 2:
a === ")"
? c[c.length - 1] == "\\"
? (c = c.slice(0, -1) + a)
: (n = 3)
: (c += a);
break;
case 3:
f(),
(n = 0),
a !== "*" && a !== "?" && a !== "+" && l--,
(c = "");
break;
default:
e("Unknown state");
break;
}
}
return (
n === 2 && e(`Unfinished custom RegExp for param "${u}"`), f(), s(), i
);
}
function Db(t, e, n) {
const r = Ob(Lb(t.path), n),
i = Xe(r, { record: t, parent: e, children: [], alias: [] });
return e && !i.record.aliasOf == !e.record.aliasOf && e.children.push(i), i;
}
function Ib(t, e) {
const n = [],
r = new Map();
e = Ih({ strict: !1, end: !0, sensitive: !1 }, e);
function i(c) {
return r.get(c);
}
function o(c, f, h) {
const p = !h,
g = Bb(c);
g.aliasOf = h && h.record;
const v = Ih(e, c),
b = [g];
if ("alias" in c) {
const T = typeof c.alias == "string" ? [c.alias] : c.alias;
for (const d of T)
b.push(
Xe({}, g, {
components: h ? h.record.components : g.components,
path: d,
aliasOf: h ? h.record : g,
})
);
}
let x, S;
for (const T of b) {
const { path: d } = T;
if (f && d[0] !== "/") {
const y = f.record.path,
m = y[y.length - 1] === "/" ? "" : "/";
T.path = f.record.path + (d && m + d);
}
if (
((x = Db(T, f, v)),
h
? h.alias.push(x)
: ((S = S || x),
S !== x && S.alias.push(x),
p && c.name && !Dh(x) && s(c.name)),
g.children)
) {
const y = g.children;
for (let m = 0; m < y.length; m++)
o(y[m], x, h && h.children[m]);
}
(h = h || x),
((x.record.components &&
Object.keys(x.record.components).length) ||
x.record.name ||
x.record.redirect) &&
a(x);
}
return S
? () => {
s(S);
}
: No;
}
function s(c) {
if (Ig(c)) {
const f = r.get(c);
f &&
(r.delete(c),
n.splice(n.indexOf(f), 1),
f.children.forEach(s),
f.alias.forEach(s));
} else {
const f = n.indexOf(c);
f > -1 &&
(n.splice(f, 1),
c.record.name && r.delete(c.record.name),
c.children.forEach(s),
c.alias.forEach(s));
}
}
function l() {
return n;
}
function a(c) {
let f = 0;
for (
;
f < n.length &&
Pb(c, n[f]) >= 0 &&
(c.record.path !== n[f].record.path || !$g(c, n[f]));
)
f++;
n.splice(f, 0, c), c.record.name && !Dh(c) && r.set(c.record.name, c);
}
function u(c, f) {
let h,
p = {},
g,
v;
if ("name" in c && c.name) {
if (((h = r.get(c.name)), !h)) throw Ji(1, { location: c });
(v = h.record.name),
(p = Xe(
Lh(
f.params,
h.keys.filter((S) => !S.optional).map((S) => S.name)
),
c.params &&
Lh(
c.params,
h.keys.map((S) => S.name)
)
)),
(g = h.stringify(p));
} else if ("path" in c)
(g = c.path),
(h = n.find((S) => S.re.test(g))),
h && ((p = h.parse(g)), (v = h.record.name));
else {
if (
((h = f.name
? r.get(f.name)
: n.find((S) => S.re.test(f.path))),
!h)
)
throw Ji(1, { location: c, currentLocation: f });
(v = h.record.name),
(p = Xe({}, f.params, c.params)),
(g = h.stringify(p));
}
const b = [];
let x = h;
for (; x; ) b.unshift(x.record), (x = x.parent);
return { name: v, path: g, params: p, matched: b, meta: zb(b) };
}
return (
t.forEach((c) => o(c)),
{
addRoute: o,
resolve: u,
removeRoute: s,
getRoutes: l,
getRecordMatcher: i,
}
);
}
function Lh(t, e) {
const n = {};
for (const r of e) r in t && (n[r] = t[r]);
return n;
}
function Bb(t) {
return {
path: t.path,
redirect: t.redirect,
name: t.name,
meta: t.meta || {},
aliasOf: void 0,
beforeEnter: t.beforeEnter,
props: $b(t),
children: t.children || [],
instances: {},
leaveGuards: new Set(),
updateGuards: new Set(),
enterCallbacks: {},
components:
"components" in t
? t.components || null
: t.component && { default: t.component },
};
}
function $b(t) {
const e = {},
n = t.props || !1;
if ("component" in t) e.default = n;
else for (const r in t.components) e[r] = typeof n == "object" ? n[r] : n;
return e;
}
function Dh(t) {
for (; t; ) {
if (t.record.aliasOf) return !0;
t = t.parent;
}
return !1;
}
function zb(t) {
return t.reduce((e, n) => Xe(e, n.meta), {});
}
function Ih(t, e) {
const n = {};
for (const r in t) n[r] = r in e ? e[r] : t[r];
return n;
}
function $g(t, e) {
return e.children.some((n) => n === t || $g(t, n));
}
const zg = /#/g,
Hb = /&/g,
Fb = /\//g,
Vb = /=/g,
Wb = /\?/g,
Hg = /\+/g,
Ub = /%5B/g,
Kb = /%5D/g,
Fg = /%5E/g,
qb = /%60/g,
Vg = /%7B/g,
Jb = /%7C/g,
Wg = /%7D/g,
Gb = /%20/g;
function Md(t) {
return encodeURI("" + t)
.replace(Jb, "|")
.replace(Ub, "[")
.replace(Kb, "]");
}
function Yb(t) {
return Md(t).replace(Vg, "{").replace(Wg, "}").replace(Fg, "^");
}
function hc(t) {
return Md(t)
.replace(Hg, "%2B")
.replace(Gb, "+")
.replace(zg, "%23")
.replace(Hb, "%26")
.replace(qb, "`")
.replace(Vg, "{")
.replace(Wg, "}")
.replace(Fg, "^");
}
function Qb(t) {
return hc(t).replace(Vb, "%3D");
}
function Xb(t) {
return Md(t).replace(zg, "%23").replace(Wb, "%3F");
}
function Zb(t) {
return t == null ? "" : Xb(t).replace(Fb, "%2F");
}
function Cl(t) {
try {
return decodeURIComponent("" + t);
} catch (e) {}
return "" + t;
}
function ew(t) {
const e = {};
if (t === "" || t === "?") return e;
const r = (t[0] === "?" ? t.slice(1) : t).split("&");
for (let i = 0; i < r.length; ++i) {
const o = r[i].replace(Hg, " "),
s = o.indexOf("="),
l = Cl(s < 0 ? o : o.slice(0, s)),
a = s < 0 ? null : Cl(o.slice(s + 1));
if (l in e) {
let u = e[l];
Nn(u) || (u = e[l] = [u]), u.push(a);
} else e[l] = a;
}
return e;
}
function Bh(t) {
let e = "";
for (let n in t) {
const r = t[n];
if (((n = Qb(n)), r == null)) {
r !== void 0 && (e += (e.length ? "&" : "") + n);
continue;
}
(Nn(r) ? r.map((o) => o && hc(o)) : [r && hc(r)]).forEach((o) => {
o !== void 0 &&
((e += (e.length ? "&" : "") + n), o != null && (e += "=" + o));
});
}
return e;
}
function tw(t) {
const e = {};
for (const n in t) {
const r = t[n];
r !== void 0 &&
(e[n] = Nn(r)
? r.map((i) => (i == null ? null : "" + i))
: r == null
? r
: "" + r);
}
return e;
}
const nw = Symbol(""),
$h = Symbol(""),
Pa = Symbol(""),
Ug = Symbol(""),
pc = Symbol("");
function vo() {
let t = [];
function e(r) {
return (
t.push(r),
() => {
const i = t.indexOf(r);
i > -1 && t.splice(i, 1);
}
);
}
function n() {
t = [];
}
return { add: e, list: () => t.slice(), reset: n };
}
function vr(t, e, n, r, i) {
const o = r && (r.enterCallbacks[i] = r.enterCallbacks[i] || []);
return () =>
new Promise((s, l) => {
const a = (f) => {
f === !1
? l(Ji(4, { from: n, to: e }))
: f instanceof Error
? l(f)
: Eb(f)
? l(Ji(2, { from: e, to: f }))
: (o &&
r.enterCallbacks[i] === o &&
typeof f == "function" &&
o.push(f),
s());
},
u = t.call(r && r.instances[i], e, n, a);
let c = Promise.resolve(u);
t.length < 3 && (c = c.then(a)), c.catch((f) => l(f));
});
}
function hu(t, e, n, r) {
const i = [];
for (const o of t)
for (const s in o.components) {
let l = o.components[s];
if (!(e !== "beforeRouteEnter" && !o.instances[s]))
if (rw(l)) {
const u = (l.__vccOpts || l)[e];
u && i.push(vr(u, n, r, o, s));
} else {
let a = l();
i.push(() =>
a.then((u) => {
if (!u)
return Promise.reject(
new Error(
`Couldn't resolve component "${s}" at "${o.path}"`
)
);
const c = cb(u) ? u.default : u;
o.components[s] = c;
const h = (c.__vccOpts || c)[e];
return h && vr(h, n, r, o, s)();
})
);
}
}
return i;
}
function rw(t) {
return (
typeof t == "object" ||
"displayName" in t ||
"props" in t ||
"__vccOpts" in t
);
}
function zh(t) {
const e = qe(Pa),
n = qe(Ug),
r = $(() => e.resolve(ne(t.to))),
i = $(() => {
const { matched: a } = r.value,
{ length: u } = a,
c = a[u - 1],
f = n.matched;
if (!c || !f.length) return -1;
const h = f.findIndex(qi.bind(null, c));
if (h > -1) return h;
const p = Hh(a[u - 2]);
return u > 1 && Hh(c) === p && f[f.length - 1].path !== p
? f.findIndex(qi.bind(null, a[u - 2]))
: h;
}),
o = $(() => i.value > -1 && lw(n.params, r.value.params)),
s = $(
() =>
i.value > -1 &&
i.value === n.matched.length - 1 &&
Lg(n.params, r.value.params)
);
function l(a = {}) {
return sw(a)
? e[ne(t.replace) ? "replace" : "push"](ne(t.to)).catch(No)
: Promise.resolve();
}
return {
route: r,
href: $(() => r.value.href),
isActive: o,
isExactActive: s,
navigate: l,
};
}
const iw = xe({
name: "RouterLink",
compatConfig: { MODE: 3 },
props: {
to: { type: [String, Object], required: !0 },
replace: Boolean,
activeClass: String,
exactActiveClass: String,
custom: Boolean,
ariaCurrentValue: { type: String, default: "page" },
},
useLink: zh,
setup(t, { slots: e }) {
const n = Sn(zh(t)),
{ options: r } = qe(Pa),
i = $(() => ({
[Fh(
t.activeClass,
r.linkActiveClass,
"router-link-active"
)]: n.isActive,
[Fh(
t.exactActiveClass,
r.linkExactActiveClass,
"router-link-exact-active"
)]: n.isExactActive,
}));
return () => {
const o = e.default && e.default(n);
return t.custom
? o
: ze(
"a",
{
"aria-current": n.isExactActive
? t.ariaCurrentValue
: null,
href: n.href,
onClick: n.navigate,
class: i.value,
},
o
);
};
},
}),
ow = iw;
function sw(t) {
if (
!(t.metaKey || t.altKey || t.ctrlKey || t.shiftKey) &&
!t.defaultPrevented &&
!(t.button !== void 0 && t.button !== 0)
) {
if (t.currentTarget && t.currentTarget.getAttribute) {
const e = t.currentTarget.getAttribute("target");
if (/\b_blank\b/i.test(e)) return;
}
return t.preventDefault && t.preventDefault(), !0;
}
}
function lw(t, e) {
for (const n in e) {
const r = e[n],
i = t[n];
if (typeof r == "string") {
if (r !== i) return !1;
} else if (
!Nn(i) ||
i.length !== r.length ||
r.some((o, s) => o !== i[s])
)
return !1;
}
return !0;
}
function Hh(t) {
return t ? (t.aliasOf ? t.aliasOf.path : t.path) : "";
}
const Fh = (t, e, n) => (t != null ? t : e != null ? e : n),
aw = xe({
name: "RouterView",
inheritAttrs: !1,
props: { name: { type: String, default: "default" }, route: Object },
compatConfig: { MODE: 3 },
setup(t, { attrs: e, slots: n }) {
const r = qe(pc),
i = $(() => t.route || r.value),
o = qe($h, 0),
s = $(() => {
let u = ne(o);
const { matched: c } = i.value;
let f;
for (; (f = c[u]) && !f.components; ) u++;
return u;
}),
l = $(() => i.value.matched[s.value]);
kt(
$h,
$(() => s.value + 1)
),
kt(nw, l),
kt(pc, i);
const a = oe();
return (
Rt(
() => [a.value, l.value, t.name],
([u, c, f], [h, p, g]) => {
c &&
((c.instances[f] = u),
p &&
p !== c &&
u &&
u === h &&
(c.leaveGuards.size ||
(c.leaveGuards = p.leaveGuards),
c.updateGuards.size ||
(c.updateGuards = p.updateGuards))),
u &&
c &&
(!p || !qi(c, p) || !h) &&
(c.enterCallbacks[f] || []).forEach((v) =>
v(u)
);
},
{ flush: "post" }
),
() => {
const u = i.value,
c = t.name,
f = l.value,
h = f && f.components[c];
if (!h) return Vh(n.default, { Component: h, route: u });
const p = f.props[c],
g = p
? p === !0
? u.params
: typeof p == "function"
? p(u)
: p
: null,
b = ze(
h,
Xe({}, g, e, {
onVnodeUnmounted: (x) => {
x.component.isUnmounted &&
(f.instances[c] = null);
},
ref: a,
})
);
return Vh(n.default, { Component: b, route: u }) || b;
}
);
},
});
function Vh(t, e) {
if (!t) return null;
const n = t(e);
return n.length === 1 ? n[0] : n;
}
const uw = aw;
function fR(t) {
const e = Ib(t.routes, t),
n = t.parseQuery || ew,
r = t.stringifyQuery || Bh,
i = t.history,
o = vo(),
s = vo(),
l = vo(),
a = rg(pr);
let u = pr;
Oi &&
t.scrollBehavior &&
"scrollRestoration" in history &&
(history.scrollRestoration = "manual");
const c = du.bind(null, (z) => "" + z),
f = du.bind(null, Zb),
h = du.bind(null, Cl);
function p(z, X) {
let ee, ue;
return (
Ig(z) ? ((ee = e.getRecordMatcher(z)), (ue = X)) : (ue = z),
e.addRoute(ue, ee)
);
}
function g(z) {
const X = e.getRecordMatcher(z);
X && e.removeRoute(X);
}
function v() {
return e.getRoutes().map((z) => z.record);
}
function b(z) {
return !!e.getRecordMatcher(z);
}
function x(z, X) {
if (((X = Xe({}, X || a.value)), typeof z == "string")) {
const j = fu(n, z, X.path),
H = e.resolve({ path: j.path }, X),
V = i.createHref(j.fullPath);
return Xe(j, H, {
params: h(H.params),
hash: Cl(j.hash),
redirectedFrom: void 0,
href: V,
});
}
let ee;
if ("path" in z) ee = Xe({}, z, { path: fu(n, z.path, X.path).path });
else {
const j = Xe({}, z.params);
for (const H in j) j[H] == null && delete j[H];
(ee = Xe({}, z, { params: f(j) })), (X.params = f(X.params));
}
const ue = e.resolve(ee, X),
Pe = z.hash || "";
ue.params = c(h(ue.params));
const A = hb(r, Xe({}, z, { hash: Yb(Pe), path: ue.path })),
O = i.createHref(A);
return Xe(
{
fullPath: A,
hash: Pe,
query: r === Bh ? tw(z.query) : z.query || {},
},
ue,
{ redirectedFrom: void 0, href: O }
);
}
function S(z) {
return typeof z == "string" ? fu(n, z, a.value.path) : Xe({}, z);
}
function T(z, X) {
if (u !== z) return Ji(8, { from: X, to: z });
}
function d(z) {
return w(z);
}
function y(z) {
return d(Xe(S(z), { replace: !0 }));
}
function m(z) {
const X = z.matched[z.matched.length - 1];
if (X && X.redirect) {
const { redirect: ee } = X;
let ue = typeof ee == "function" ? ee(z) : ee;
return (
typeof ue == "string" &&
((ue =
ue.includes("?") || ue.includes("#")
? (ue = S(ue))
: { path: ue }),
(ue.params = {})),
Xe(
{
query: z.query,
hash: z.hash,
params: "path" in ue ? {} : z.params,
},
ue
)
);
}
}
function w(z, X) {
const ee = (u = x(z)),
ue = a.value,
Pe = z.state,
A = z.force,
O = z.replace === !0,
j = m(ee);
if (j)
return w(
Xe(S(j), {
state: typeof j == "object" ? Xe({}, Pe, j.state) : Pe,
force: A,
replace: O,
}),
X || ee
);
const H = ee;
H.redirectedFrom = X;
let V;
return (
!A &&
pb(r, ue, ee) &&
((V = Ji(16, { to: H, from: ue })), Q(ue, ue, !0, !1)),
(V ? Promise.resolve(V) : C(H, ue))
.catch((q) => (er(q) ? (er(q, 2) ? q : ae(q)) : D(q, H, ue)))
.then((q) => {
if (q) {
if (er(q, 2))
return w(
Xe({ replace: O }, S(q.to), {
state:
typeof q.to == "object"
? Xe({}, Pe, q.to.state)
: Pe,
force: A,
}),
X || H
);
} else q = R(H, ue, !0, O, Pe);
return E(H, ue, q), q;
})
);
}
function k(z, X) {
const ee = T(z, X);
return ee ? Promise.reject(ee) : Promise.resolve();
}
function _(z) {
const X = Le.values().next().value;
return X && typeof X.runWithContext == "function"
? X.runWithContext(z)
: z();
}
function C(z, X) {
let ee;
const [ue, Pe, A] = cw(z, X);
ee = hu(ue.reverse(), "beforeRouteLeave", z, X);
for (const j of ue)
j.leaveGuards.forEach((H) => {
ee.push(vr(H, z, X));
});
const O = k.bind(null, z, X);
return (
ee.push(O),
Ae(ee)
.then(() => {
ee = [];
for (const j of o.list()) ee.push(vr(j, z, X));
return ee.push(O), Ae(ee);
})
.then(() => {
ee = hu(Pe, "beforeRouteUpdate", z, X);
for (const j of Pe)
j.updateGuards.forEach((H) => {
ee.push(vr(H, z, X));
});
return ee.push(O), Ae(ee);
})
.then(() => {
ee = [];
for (const j of A)
if (j.beforeEnter)
if (Nn(j.beforeEnter))
for (const H of j.beforeEnter)
ee.push(vr(H, z, X));
else ee.push(vr(j.beforeEnter, z, X));
return ee.push(O), Ae(ee);
})
.then(
() => (
z.matched.forEach((j) => (j.enterCallbacks = {})),
(ee = hu(A, "beforeRouteEnter", z, X)),
ee.push(O),
Ae(ee)
)
)
.then(() => {
ee = [];
for (const j of s.list()) ee.push(vr(j, z, X));
return ee.push(O), Ae(ee);
})
.catch((j) => (er(j, 8) ? j : Promise.reject(j)))
);
}
function E(z, X, ee) {
l.list().forEach((ue) => _(() => ue(z, X, ee)));
}
function R(z, X, ee, ue, Pe) {
const A = T(z, X);
if (A) return A;
const O = X === pr,
j = Oi ? history.state : {};
ee &&
(ue || O
? i.replace(z.fullPath, Xe({ scroll: O && j && j.scroll }, Pe))
: i.push(z.fullPath, Pe)),
(a.value = z),
Q(z, X, ee, O),
ae();
}
let P;
function L() {
P ||
(P = i.listen((z, X, ee) => {
if (!Re.listening) return;
const ue = x(z),
Pe = m(ue);
if (Pe) {
w(Xe(Pe, { replace: !0 }), ue).catch(No);
return;
}
u = ue;
const A = a.value;
Oi && kb(Oh(A.fullPath, ee.delta), Ra()),
C(ue, A)
.catch((O) =>
er(O, 12)
? O
: er(O, 2)
? (w(O.to, ue)
.then((j) => {
er(j, 20) &&
!ee.delta &&
ee.type === Yo.pop &&
i.go(-1, !1);
})
.catch(No),
Promise.reject())
: (ee.delta && i.go(-ee.delta, !1), D(O, ue, A))
)
.then((O) => {
(O = O || R(ue, A, !1)),
O &&
(ee.delta && !er(O, 8)
? i.go(-ee.delta, !1)
: ee.type === Yo.pop &&
er(O, 20) &&
i.go(-1, !1)),
E(ue, A, O);
})
.catch(No);
}));
}
let I = vo(),
M = vo(),
N;
function D(z, X, ee) {
ae(z);
const ue = M.list();
return (
ue.length ? ue.forEach((Pe) => Pe(z, X, ee)) : console.error(z),
Promise.reject(z)
);
}
function K() {
return N && a.value !== pr
? Promise.resolve()
: new Promise((z, X) => {
I.add([z, X]);
});
}
function ae(z) {
return (
N ||
((N = !z),
L(),
I.list().forEach(([X, ee]) => (z ? ee(z) : X())),
I.reset()),
z
);
}
function Q(z, X, ee, ue) {
const { scrollBehavior: Pe } = t;
if (!Oi || !Pe) return Promise.resolve();
const A =
(!ee && Cb(Oh(z.fullPath, 0))) ||
((ue || !ee) && history.state && history.state.scroll) ||
null;
return Ct()
.then(() => Pe(z, X, A))
.then((O) => O && xb(O))
.catch((O) => D(O, z, X));
}
const me = (z) => i.go(z);
let je;
const Le = new Set(),
Re = {
currentRoute: a,
listening: !0,
addRoute: p,
removeRoute: g,
hasRoute: b,
getRoutes: v,
resolve: x,
options: t,
push: d,
replace: y,
go: me,
back: () => me(-1),
forward: () => me(1),
beforeEach: o.add,
beforeResolve: s.add,
afterEach: l.add,
onError: M.add,
isReady: K,
install(z) {
const X = this;
z.component("RouterLink", ow),
z.component("RouterView", uw),
(z.config.globalProperties.$router = X),
Object.defineProperty(z.config.globalProperties, "$route", {
enumerable: !0,
get: () => ne(a),
}),
Oi &&
!je &&
a.value === pr &&
((je = !0), d(i.location).catch((Pe) => {}));
const ee = {};
for (const Pe in pr)
Object.defineProperty(ee, Pe, {
get: () => a.value[Pe],
enumerable: !0,
});
z.provide(Pa, X), z.provide(Ug, Qm(ee)), z.provide(pc, a);
const ue = z.unmount;
Le.add(z),
(z.unmount = function () {
Le.delete(z),
Le.size < 1 &&
((u = pr),
P && P(),
(P = null),
(a.value = pr),
(je = !1),
(N = !1)),
ue();
});
},
};
function Ae(z) {
return z.reduce((X, ee) => X.then(() => _(ee)), Promise.resolve());
}
return Re;
}
function cw(t, e) {
const n = [],
r = [],
i = [],
o = Math.max(e.matched.length, t.matched.length);
for (let s = 0; s < o; s++) {
const l = e.matched[s];
l && (t.matched.find((u) => qi(u, l)) ? r.push(l) : n.push(l));
const a = t.matched[s];
a && (e.matched.find((u) => qi(u, a)) || i.push(a));
}
return [n, r, i];
}
function Kg() {
return qe(Pa);
}
const Ue = (t, e) => {
const n = t.__vccOpts || t;
for (const [r, i] of e) n[r] = i;
return n;
};
function vt(t, e, ...n) {
if (t in e) {
let i = e[t];
return typeof i == "function" ? i(...n) : i;
}
let r = new Error(
`Tried to handle "${t}" but there is no handler defined. Only defined handlers are: ${Object.keys(
e
)
.map((i) => `"${i}"`)
.join(", ")}.`
);
throw (Error.captureStackTrace && Error.captureStackTrace(r, vt), r);
}
var Gn = ((t) => (
(t[(t.None = 0)] = "None"),
(t[(t.RenderStrategy = 1)] = "RenderStrategy"),
(t[(t.Static = 2)] = "Static"),
t
))(Gn || {}),
_r = ((t) => (
(t[(t.Unmount = 0)] = "Unmount"), (t[(t.Hidden = 1)] = "Hidden"), t
))(_r || {});
function tt(o) {
var s = o,
{ visible: t = !0, features: e = 0, ourProps: n, theirProps: r } = s,
i = Qe(s, ["visible", "features", "ourProps", "theirProps"]);
var l;
let a = Jg(r, n),
u = Object.assign(i, { props: a });
if (t || (e & 2 && a.static)) return pu(u);
if (e & 1) {
let c = (l = a.unmount) == null || l ? 0 : 1;
return vt(c, {
[0]() {
return null;
},
[1]() {
return pu(
be(W({}, i), {
props: be(W({}, a), {
hidden: !0,
style: { display: "none" },
}),
})
);
},
});
}
return pu(u);
}
function pu({ props: t, attrs: e, slots: n, slot: r, name: i }) {
var o, s;
let f = so(t, ["unmount", "static"]),
{ as: l } = f,
a = Qe(f, ["as"]),
u = (o = n.default) == null ? void 0 : o.call(n, r),
c = {};
if (r) {
let h = !1,
p = [];
for (let [g, v] of Object.entries(r))
typeof v == "boolean" && (h = !0), v === !0 && p.push(g);
h && (c["data-headlessui-state"] = p.join(" "));
}
if (l === "template") {
if (
((u = qg(u != null ? u : [])),
Object.keys(a).length > 0 || Object.keys(e).length > 0)
) {
let [h, ...p] = u != null ? u : [];
if (!dw(h) || p.length > 0)
throw new Error(
[
'Passing props on "template"!',
"",
`The current component <${i} /> is rendering a "template".`,
"However we need to passthrough the following props:",
Object.keys(a)
.concat(Object.keys(e))
.map((b) => b.trim())
.filter((b, x, S) => S.indexOf(b) === x)
.sort((b, x) => b.localeCompare(x))
.map((b) => ` - ${b}`).join(`
`),
"",
"You can apply a few solutions:",
[
'Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".',
"Render a single element as the child so that we can forward the props onto that element.",
].map((b) => ` - ${b}`).join(`
`),
].join(`
`)
);
let g = Jg((s = h.props) != null ? s : {}, a),
v = sr(h, g);
for (let b in g)
b.startsWith("on") &&
(v.props || (v.props = {}), (v.props[b] = g[b]));
return v;
}
return Array.isArray(u) && u.length === 1 ? u[0] : u;
}
return ze(l, Object.assign({}, a, c), { default: () => u });
}
function qg(t) {
return t.flatMap((e) => (e.type === He ? qg(e.children) : [e]));
}
function Jg(...t) {
if (t.length === 0) return {};
if (t.length === 1) return t[0];
let e = {},
n = {};
for (let r of t)
for (let i in r)
i.startsWith("on") && typeof r[i] == "function"
? (n[i] != null || (n[i] = []), n[i].push(r[i]))
: (e[i] = r[i]);
if (e.disabled || e["aria-disabled"])
return Object.assign(
e,
Object.fromEntries(Object.keys(n).map((r) => [r, void 0]))
);
for (let r in n)
Object.assign(e, {
[r](i, ...o) {
let s = n[r];
for (let l of s) {
if (i instanceof Event && i.defaultPrevented) return;
l(i, ...o);
}
},
});
return e;
}
function Ed(t) {
let e = Object.assign({}, t);
for (let n in e) e[n] === void 0 && delete e[n];
return e;
}
function so(t, e = []) {
let n = Object.assign({}, t);
for (let r of e) r in n && delete n[r];
return n;
}
function dw(t) {
return t == null
? !1
: typeof t.type == "string" ||
typeof t.type == "object" ||
typeof t.type == "function";
}
let fw = 0;
function hw() {
return ++fw;
}
function At() {
return hw();
}
var Ie = ((t) => (
(t.Space = " "),
(t.Enter = "Enter"),
(t.Escape = "Escape"),
(t.Backspace = "Backspace"),
(t.Delete = "Delete"),
(t.ArrowLeft = "ArrowLeft"),
(t.ArrowUp = "ArrowUp"),
(t.ArrowRight = "ArrowRight"),
(t.ArrowDown = "ArrowDown"),
(t.Home = "Home"),
(t.End = "End"),
(t.PageUp = "PageUp"),
(t.PageDown = "PageDown"),
(t.Tab = "Tab"),
t
))(Ie || {});
function pw(t) {
throw new Error("Unexpected object: " + t);
}
var Ze = ((t) => (
(t[(t.First = 0)] = "First"),
(t[(t.Previous = 1)] = "Previous"),
(t[(t.Next = 2)] = "Next"),
(t[(t.Last = 3)] = "Last"),
(t[(t.Specific = 4)] = "Specific"),
(t[(t.Nothing = 5)] = "Nothing"),
t
))(Ze || {});
function Gg(t, e) {
let n = e.resolveItems();
if (n.length <= 0) return null;
let r = e.resolveActiveIndex(),
i = r != null ? r : -1,
o = (() => {
switch (t.focus) {
case 0:
return n.findIndex((s) => !e.resolveDisabled(s));
case 1: {
let s = n
.slice()
.reverse()
.findIndex((l, a, u) =>
i !== -1 && u.length - a - 1 >= i
? !1
: !e.resolveDisabled(l)
);
return s === -1 ? s : n.length - 1 - s;
}
case 2:
return n.findIndex((s, l) =>
l <= i ? !1 : !e.resolveDisabled(s)
);
case 3: {
let s = n
.slice()
.reverse()
.findIndex((l) => !e.resolveDisabled(l));
return s === -1 ? s : n.length - 1 - s;
}
case 4:
return n.findIndex((s) => e.resolveId(s) === t.id);
case 5:
return null;
default:
pw(t);
}
})();
return o === -1 ? r : o;
}
function fe(t) {
var e;
return t == null || t.value == null
? null
: (e = t.value.$el) != null
? e
: t.value;
}
let Yg = Symbol("Context");
var gt = ((t) => (
(t[(t.Open = 1)] = "Open"),
(t[(t.Closed = 2)] = "Closed"),
(t[(t.Closing = 4)] = "Closing"),
(t[(t.Opening = 8)] = "Opening"),
t
))(gt || {});
function mw() {
return ms() !== null;
}
function ms() {
return qe(Yg, null);
}
function Ad(t) {
kt(Yg, t);
}
function Wh(t, e) {
if (t) return t;
let n = e != null ? e : "button";
if (typeof n == "string" && n.toLowerCase() === "button") return "button";
}
function Td(t, e) {
let n = oe(Wh(t.value.type, t.value.as));
return (
Ye(() => {
n.value = Wh(t.value.type, t.value.as);
}),
Mt(() => {
var r;
n.value ||
(fe(e) &&
fe(e) instanceof HTMLButtonElement &&
!((r = fe(e)) != null && r.hasAttribute("type")) &&
(n.value = "button"));
}),
n
);
}
var gw = Object.defineProperty,
yw = (t, e, n) =>
e in t
? gw(t, e, {
enumerable: !0,
configurable: !0,
writable: !0,
value: n,
})
: (t[e] = n),
Uh = (t, e, n) => (yw(t, typeof e != "symbol" ? e + "" : e, n), n);
class vw {
constructor() {
Uh(this, "current", this.detect()), Uh(this, "currentId", 0);
}
set(e) {
this.current !== e && ((this.currentId = 0), (this.current = e));
}
reset() {
this.set(this.detect());
}
nextId() {
return ++this.currentId;
}
get isServer() {
return this.current === "server";
}
get isClient() {
return this.current === "client";
}
detect() {
return typeof window == "undefined" || typeof document == "undefined"
? "server"
: "client";
}
}
let gs = new vw();
function vn(t) {
if (gs.isServer) return null;
if (t instanceof Node) return t.ownerDocument;
if (t != null && t.hasOwnProperty("value")) {
let e = fe(t);
if (e) return e.ownerDocument;
}
return document;
}
function Od({ container: t, accept: e, walk: n, enabled: r }) {
Mt(() => {
let i = t.value;
if (!i || (r !== void 0 && !r.value)) return;
let o = vn(t);
if (!o) return;
let s = Object.assign((a) => e(a), { acceptNode: e }),
l = o.createTreeWalker(i, NodeFilter.SHOW_ELEMENT, s, !1);
for (; l.nextNode(); ) n(l.currentNode);
});
}
let mc = [
"[contentEditable=true]",
"[tabindex]",
"a[href]",
"area[href]",
"button:not([disabled])",
"iframe",
"input:not([disabled])",
"select:not([disabled])",
"textarea:not([disabled])",
]
.map((t) => `${t}:not([tabindex='-1'])`)
.join(",");
var Qt = ((t) => (
(t[(t.First = 1)] = "First"),
(t[(t.Previous = 2)] = "Previous"),
(t[(t.Next = 4)] = "Next"),
(t[(t.Last = 8)] = "Last"),
(t[(t.WrapAround = 16)] = "WrapAround"),
(t[(t.NoScroll = 32)] = "NoScroll"),
t
))(Qt || {}),
Sl = ((t) => (
(t[(t.Error = 0)] = "Error"),
(t[(t.Overflow = 1)] = "Overflow"),
(t[(t.Success = 2)] = "Success"),
(t[(t.Underflow = 3)] = "Underflow"),
t
))(Sl || {}),
bw = ((t) => (
(t[(t.Previous = -1)] = "Previous"), (t[(t.Next = 1)] = "Next"), t
))(bw || {});
function Qg(t = document.body) {
return t == null
? []
: Array.from(t.querySelectorAll(mc)).sort((e, n) =>
Math.sign(
(e.tabIndex || Number.MAX_SAFE_INTEGER) -
(n.tabIndex || Number.MAX_SAFE_INTEGER)
)
);
}
var Rd = ((t) => (
(t[(t.Strict = 0)] = "Strict"), (t[(t.Loose = 1)] = "Loose"), t
))(Rd || {});
function Pd(t, e = 0) {
var n;
return t === ((n = vn(t)) == null ? void 0 : n.body)
? !1
: vt(e, {
[0]() {
return t.matches(mc);
},
[1]() {
let r = t;
for (; r !== null; ) {
if (r.matches(mc)) return !0;
r = r.parentElement;
}
return !1;
},
});
}
function Xg(t) {
let e = vn(t);
Ct(() => {
e && !Pd(e.activeElement, 0) && Rr(t);
});
}
var ww = ((t) => (
(t[(t.Keyboard = 0)] = "Keyboard"), (t[(t.Mouse = 1)] = "Mouse"), t
))(ww || {});
typeof window != "undefined" &&
typeof document != "undefined" &&
(document.addEventListener(
"keydown",
(t) => {
t.metaKey ||
t.altKey ||
t.ctrlKey ||
(document.documentElement.dataset.headlessuiFocusVisible = "");
},
!0
),
document.addEventListener(
"click",
(t) => {
t.detail === 1
? delete document.documentElement.dataset.headlessuiFocusVisible
: t.detail === 0 &&
(document.documentElement.dataset.headlessuiFocusVisible =
"");
},
!0
));
function Rr(t) {
t == null || t.focus({ preventScroll: !0 });
}
let xw = ["textarea", "input"].join(",");
function kw(t) {
var e, n;
return (n =
(e = t == null ? void 0 : t.matches) == null
? void 0
: e.call(t, xw)) != null
? n
: !1;
}
function Na(t, e = (n) => n) {
return t.slice().sort((n, r) => {
let i = e(n),
o = e(r);
if (i === null || o === null) return 0;
let s = i.compareDocumentPosition(o);
return s & Node.DOCUMENT_POSITION_FOLLOWING
? -1
: s & Node.DOCUMENT_POSITION_PRECEDING
? 1
: 0;
});
}
function Cw(t, e) {
return li(Qg(), e, { relativeTo: t });
}
function li(
t,
e,
{ sorted: n = !0, relativeTo: r = null, skipElements: i = [] } = {}
) {
var o;
let s =
(o = Array.isArray(t)
? t.length > 0
? t[0].ownerDocument
: document
: t == null
? void 0
: t.ownerDocument) != null
? o
: document,
l = Array.isArray(t) ? (n ? Na(t) : t) : Qg(t);
i.length > 0 && l.length > 1 && (l = l.filter((g) => !i.includes(g))),
(r = r != null ? r : s.activeElement);
let a = (() => {
if (e & 5) return 1;
if (e & 10) return -1;
throw new Error(
"Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last"
);
})(),
u = (() => {
if (e & 1) return 0;
if (e & 2) return Math.max(0, l.indexOf(r)) - 1;
if (e & 4) return Math.max(0, l.indexOf(r)) + 1;
if (e & 8) return l.length - 1;
throw new Error(
"Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last"
);
})(),
c = e & 32 ? { preventScroll: !0 } : {},
f = 0,
h = l.length,
p;
do {
if (f >= h || f + h <= 0) return 0;
let g = u + f;
if (e & 16) g = (g + h) % h;
else {
if (g < 0) return 3;
if (g >= h) return 1;
}
(p = l[g]), p == null || p.focus(c), (f += a);
} while (p !== s.activeElement);
return e & 6 && kw(p) && p.select(), 2;
}
function Is(t, e, n) {
gs.isServer ||
Mt((r) => {
document.addEventListener(t, e, n),
r(() => document.removeEventListener(t, e, n));
});
}
function Zg(t, e, n) {
gs.isServer ||
Mt((r) => {
window.addEventListener(t, e, n),
r(() => window.removeEventListener(t, e, n));
});
}
function Nd(t, e, n = $(() => !0)) {
function r(o, s) {
if (!n.value || o.defaultPrevented) return;
let l = s(o);
if (l === null || !l.getRootNode().contains(l)) return;
let a = (function u(c) {
return typeof c == "function"
? u(c())
: Array.isArray(c) || c instanceof Set
? c
: [c];
})(t);
for (let u of a) {
if (u === null) continue;
let c = u instanceof HTMLElement ? u : fe(u);
if (
(c != null && c.contains(l)) ||
(o.composed && o.composedPath().includes(c))
)
return;
}
return (
!Pd(l, Rd.Loose) && l.tabIndex !== -1 && o.preventDefault(), e(o, l)
);
}
let i = oe(null);
Is(
"pointerdown",
(o) => {
var s, l;
n.value &&
(i.value =
((l = (s = o.composedPath) == null ? void 0 : s.call(o)) ==
null
? void 0
: l[0]) || o.target);
},
!0
),
Is(
"mousedown",
(o) => {
var s, l;
n.value &&
(i.value =
((l =
(s = o.composedPath) == null
? void 0
: s.call(o)) == null
? void 0
: l[0]) || o.target);
},
!0
),
Is(
"click",
(o) => {
i.value && (r(o, () => i.value), (i.value = null));
},
!0
),
Is(
"touchend",
(o) =>
r(o, () => (o.target instanceof HTMLElement ? o.target : null)),
!0
),
Zg(
"blur",
(o) =>
r(o, () =>
window.document.activeElement instanceof HTMLIFrameElement
? window.document.activeElement
: null
),
!0
);
}
var gi = ((t) => (
(t[(t.None = 1)] = "None"),
(t[(t.Focusable = 2)] = "Focusable"),
(t[(t.Hidden = 4)] = "Hidden"),
t
))(gi || {});
let Gi = xe({
name: "Hidden",
props: {
as: { type: [Object, String], default: "div" },
features: { type: Number, default: 1 },
},
setup(t, { slots: e, attrs: n }) {
return () => {
let s = t,
{ features: r } = s,
i = Qe(s, ["features"]),
o = {
"aria-hidden": (r & 2) === 2 ? !0 : void 0,
style: W(
{
position: "fixed",
top: 1,
left: 1,
width: 1,
height: 0,
padding: 0,
margin: -1,
overflow: "hidden",
clip: "rect(0, 0, 0, 0)",
whiteSpace: "nowrap",
borderWidth: "0",
},
(r & 4) === 4 && (r & 2) !== 2 && { display: "none" }
),
};
return tt({
ourProps: o,
theirProps: i,
slot: {},
attrs: n,
slots: e,
name: "Hidden",
});
};
},
});
function jd(t = {}, e = null, n = []) {
for (let [r, i] of Object.entries(t)) t1(n, e1(e, r), i);
return n;
}
function e1(t, e) {
return t ? t + "[" + e + "]" : e;
}
function t1(t, e, n) {
if (Array.isArray(n))
for (let [r, i] of n.entries()) t1(t, e1(e, r.toString()), i);
else
n instanceof Date
? t.push([e, n.toISOString()])
: typeof n == "boolean"
? t.push([e, n ? "1" : "0"])
: typeof n == "string"
? t.push([e, n])
: typeof n == "number"
? t.push([e, `${n}`])
: n == null
? t.push([e, ""])
: jd(n, e, t);
}
function n1(t) {
var e, n;
let r = (e = t == null ? void 0 : t.form) != null ? e : t.closest("form");
if (r) {
for (let i of r.elements)
if (
i !== t &&
((i.tagName === "INPUT" && i.type === "submit") ||
(i.tagName === "BUTTON" && i.type === "submit") ||
(i.nodeName === "INPUT" && i.type === "image"))
) {
i.click();
return;
}
(n = r.requestSubmit) == null || n.call(r);
}
}
function Ld(t, e, n) {
let r = oe(n == null ? void 0 : n.value),
i = $(() => t.value !== void 0);
return [
$(() => (i.value ? t.value : r.value)),
function (o) {
return i.value || (r.value = o), e == null ? void 0 : e(o);
},
];
}
function Kh(t) {
return [t.screenX, t.screenY];
}
function r1() {
let t = oe([-1, -1]);
return {
wasMoved(e) {
let n = Kh(e);
return t.value[0] === n[0] && t.value[1] === n[1]
? !1
: ((t.value = n), !0);
},
update(e) {
t.value = Kh(e);
},
};
}
function i1() {
return (
/iPhone/gi.test(window.navigator.platform) ||
(/Mac/gi.test(window.navigator.platform) &&
window.navigator.maxTouchPoints > 0)
);
}
function Sw() {
return /Android/gi.test(window.navigator.userAgent);
}
function _w() {
return i1() || Sw();
}
function Dd(t) {
typeof queueMicrotask == "function"
? queueMicrotask(t)
: Promise.resolve()
.then(t)
.catch((e) =>
setTimeout(() => {
throw e;
})
);
}
function lo() {
let t = [],
e = {
addEventListener(n, r, i, o) {
return (
n.addEventListener(r, i, o),
e.add(() => n.removeEventListener(r, i, o))
);
},
requestAnimationFrame(...n) {
let r = requestAnimationFrame(...n);
e.add(() => cancelAnimationFrame(r));
},
nextFrame(...n) {
e.requestAnimationFrame(() => {
e.requestAnimationFrame(...n);
});
},
setTimeout(...n) {
let r = setTimeout(...n);
e.add(() => clearTimeout(r));
},
microTask(...n) {
let r = { current: !0 };
return (
Dd(() => {
r.current && n[0]();
}),
e.add(() => {
r.current = !1;
})
);
},
style(n, r, i) {
let o = n.style.getPropertyValue(r);
return (
Object.assign(n.style, { [r]: i }),
this.add(() => {
Object.assign(n.style, { [r]: o });
})
);
},
group(n) {
let r = lo();
return n(r), this.add(() => r.dispose());
},
add(n) {
return (
t.push(n),
() => {
let r = t.indexOf(n);
if (r >= 0) for (let i of t.splice(r, 1)) i();
}
);
},
dispose() {
for (let n of t.splice(0)) n();
},
};
return e;
}
function Mw(t, e) {
return t === e;
}
var Ew = ((t) => (
(t[(t.Open = 0)] = "Open"), (t[(t.Closed = 1)] = "Closed"), t
))(Ew || {}),
Aw = ((t) => (
(t[(t.Single = 0)] = "Single"), (t[(t.Multi = 1)] = "Multi"), t
))(Aw || {}),
Tw = ((t) => (
(t[(t.Pointer = 0)] = "Pointer"), (t[(t.Other = 1)] = "Other"), t
))(Tw || {});
let o1 = Symbol("ComboboxContext");
function ao(t) {
let e = qe(o1, null);
if (e === null) {
let n = new Error(
`<${t} /> is missing a parent <Combobox /> component.`
);
throw (Error.captureStackTrace && Error.captureStackTrace(n, ao), n);
}
return e;
}
let Ow = xe({
name: "Combobox",
emits: { "update:modelValue": (t) => !0 },
props: {
as: { type: [Object, String], default: "template" },
disabled: { type: [Boolean], default: !1 },
by: { type: [String, Function], default: () => Mw },
modelValue: {
type: [Object, String, Number, Boolean],
default: void 0,
},
defaultValue: {
type: [Object, String, Number, Boolean],
default: void 0,
},
form: { type: String, optional: !0 },
name: { type: String, optional: !0 },
nullable: { type: Boolean, default: !1 },
multiple: { type: [Boolean], default: !1 },
},
inheritAttrs: !1,
setup(t, { slots: e, attrs: n, emit: r }) {
let i = oe(1),
o = oe(null),
s = oe(null),
l = oe(null),
a = oe(null),
u = oe({ static: !1, hold: !1 }),
c = oe([]),
f = oe(null),
h = oe(1),
p = oe(!1);
function g(_ = (C) => C) {
let C = f.value !== null ? c.value[f.value] : null,
E = Na(_(c.value.slice()), (P) => fe(P.dataRef.domRef)),
R = C ? E.indexOf(C) : null;
return R === -1 && (R = null), { options: E, activeOptionIndex: R };
}
let v = $(() => (t.multiple ? 1 : 0)),
b = $(() => t.nullable),
[x, S] = Ld(
$(() => t.modelValue),
(_) => r("update:modelValue", _),
$(() => t.defaultValue)
),
T = $(() =>
x.value === void 0
? vt(v.value, { [1]: [], [0]: void 0 })
: x.value
),
d = null,
y = null,
m = {
comboboxState: i,
value: T,
mode: v,
compare(_, C) {
if (typeof t.by == "string") {
let E = t.by;
return (
(_ == null ? void 0 : _[E]) ===
(C == null ? void 0 : C[E])
);
}
return t.by(_, C);
},
defaultValue: $(() => t.defaultValue),
nullable: b,
inputRef: s,
labelRef: o,
buttonRef: l,
optionsRef: a,
disabled: $(() => t.disabled),
options: c,
change(_) {
S(_);
},
activeOptionIndex: $(() => {
if (p.value && f.value === null && c.value.length > 0) {
let _ = c.value.findIndex((C) => !C.dataRef.disabled);
_ !== -1 && (f.value = _);
}
return f.value;
}),
activationTrigger: h,
optionsPropsRef: u,
closeCombobox() {
(p.value = !1),
!t.disabled &&
i.value !== 1 &&
((i.value = 1), (f.value = null));
},
openCombobox() {
if (((p.value = !0), t.disabled || i.value === 0)) return;
let _ = c.value.findIndex((C) => {
let E = de(C.dataRef.value);
return vt(v.value, {
[0]: () => m.compare(de(m.value.value), de(E)),
[1]: () =>
de(m.value.value).some((R) =>
m.compare(de(R), de(E))
),
});
});
_ !== -1 && (f.value = _), (i.value = 0);
},
goToOption(_, C, E) {
(p.value = !1),
d !== null && cancelAnimationFrame(d),
(d = requestAnimationFrame(() => {
if (
t.disabled ||
(a.value && !u.value.static && i.value === 1)
)
return;
let R = g();
if (R.activeOptionIndex === null) {
let L = R.options.findIndex(
(I) => !I.dataRef.disabled
);
L !== -1 && (R.activeOptionIndex = L);
}
let P = Gg(
_ === Ze.Specific
? { focus: Ze.Specific, id: C }
: { focus: _ },
{
resolveItems: () => R.options,
resolveActiveIndex: () =>
R.activeOptionIndex,
resolveId: (L) => L.id,
resolveDisabled: (L) => L.dataRef.disabled,
}
);
(f.value = P),
(h.value = E != null ? E : 1),
(c.value = R.options);
}));
},
selectOption(_) {
let C = c.value.find((R) => R.id === _);
if (!C) return;
let { dataRef: E } = C;
S(
vt(v.value, {
[0]: () => E.value,
[1]: () => {
let R = de(m.value.value).slice(),
P = de(E.value),
L = R.findIndex((I) => m.compare(P, de(I)));
return L === -1 ? R.push(P) : R.splice(L, 1), R;
},
})
);
},
selectActiveOption() {
if (m.activeOptionIndex.value === null) return;
let { dataRef: _, id: C } =
c.value[m.activeOptionIndex.value];
S(
vt(v.value, {
[0]: () => _.value,
[1]: () => {
let E = de(m.value.value).slice(),
R = de(_.value),
P = E.findIndex((L) => m.compare(R, de(L)));
return P === -1 ? E.push(R) : E.splice(P, 1), E;
},
})
),
m.goToOption(Ze.Specific, C);
},
registerOption(_, C) {
y && cancelAnimationFrame(y);
let E = { id: _, dataRef: C },
R = g((P) => (P.push(E), P));
if (f.value === null) {
let P = C.value.value;
vt(v.value, {
[0]: () => m.compare(de(m.value.value), de(P)),
[1]: () =>
de(m.value.value).some((L) =>
m.compare(de(L), de(P))
),
}) && (R.activeOptionIndex = R.options.indexOf(E));
}
(c.value = R.options),
(f.value = R.activeOptionIndex),
(h.value = 1),
R.options.some((P) => !fe(P.dataRef.domRef)) &&
(y = requestAnimationFrame(() => {
let P = g();
(c.value = P.options),
(f.value = P.activeOptionIndex);
}));
},
unregisterOption(_) {
var C;
m.activeOptionIndex.value !== null &&
((C = m.options.value[m.activeOptionIndex.value]) ==
null
? void 0
: C.id) === _ &&
(p.value = !0);
let E = g((R) => {
let P = R.findIndex((L) => L.id === _);
return P !== -1 && R.splice(P, 1), R;
});
(c.value = E.options),
(f.value = E.activeOptionIndex),
(h.value = 1);
},
};
Nd(
[s, l, a],
() => m.closeCombobox(),
$(() => i.value === 0)
),
kt(o1, m),
Ad($(() => vt(i.value, { [0]: gt.Open, [1]: gt.Closed })));
let w = $(() =>
m.activeOptionIndex.value === null
? null
: c.value[m.activeOptionIndex.value].dataRef.value
),
k = $(() => {
var _;
return (_ = fe(s)) == null ? void 0 : _.closest("form");
});
return (
Ye(() => {
Rt(
[k],
() => {
if (!k.value || t.defaultValue === void 0) return;
function _() {
m.change(t.defaultValue);
}
return (
k.value.addEventListener("reset", _),
() => {
var C;
(C = k.value) == null ||
C.removeEventListener("reset", _);
}
);
},
{ immediate: !0 }
);
}),
() => {
let L = t,
{ name: _, disabled: C, form: E } = L,
R = Qe(L, ["name", "disabled", "form"]),
P = {
open: i.value === 0,
disabled: C,
activeIndex: m.activeOptionIndex.value,
activeOption: w.value,
value: T.value,
};
return ze(He, [
...(_ != null && T.value != null
? jd({ [_]: T.value }).map(([I, M]) =>
ze(
Gi,
Ed({
features: gi.Hidden,
key: I,
as: "input",
type: "hidden",
hidden: !0,
readOnly: !0,
form: E,
name: I,
value: M,
})
)
)
: []),
tt({
theirProps: W(
W({}, n),
so(R, [
"modelValue",
"defaultValue",
"nullable",
"multiple",
"onUpdate:modelValue",
"by",
])
),
ourProps: {},
slot: P,
slots: e,
attrs: n,
name: "Combobox",
}),
]);
}
);
},
});
xe({
name: "ComboboxLabel",
props: {
as: { type: [Object, String], default: "label" },
id: {
type: String,
default: () => `headlessui-combobox-label-${At()}`,
},
},
setup(t, { attrs: e, slots: n }) {
let r = ao("ComboboxLabel");
function i() {
var o;
(o = fe(r.inputRef)) == null || o.focus({ preventScroll: !0 });
}
return () => {
let o = {
open: r.comboboxState.value === 0,
disabled: r.disabled.value,
},
u = t,
{ id: s } = u,
l = Qe(u, ["id"]),
a = { id: s, ref: r.labelRef, onClick: i };
return tt({
ourProps: a,
theirProps: l,
slot: o,
attrs: e,
slots: n,
name: "ComboboxLabel",
});
};
},
});
let Rw = xe({
name: "ComboboxButton",
props: {
as: { type: [Object, String], default: "button" },
id: {
type: String,
default: () => `headlessui-combobox-button-${At()}`,
},
},
setup(t, { attrs: e, slots: n, expose: r }) {
let i = ao("ComboboxButton");
r({ el: i.buttonRef, $el: i.buttonRef });
function o(a) {
i.disabled.value ||
(i.comboboxState.value === 0
? i.closeCombobox()
: (a.preventDefault(), i.openCombobox()),
Ct(() => {
var u;
return (u = fe(i.inputRef)) == null
? void 0
: u.focus({ preventScroll: !0 });
}));
}
function s(a) {
switch (a.key) {
case Ie.ArrowDown:
a.preventDefault(),
a.stopPropagation(),
i.comboboxState.value === 1 && i.openCombobox(),
Ct(() => {
var u;
return (u = i.inputRef.value) == null
? void 0
: u.focus({ preventScroll: !0 });
});
return;
case Ie.ArrowUp:
a.preventDefault(),
a.stopPropagation(),
i.comboboxState.value === 1 &&
(i.openCombobox(),
Ct(() => {
i.value.value || i.goToOption(Ze.Last);
})),
Ct(() => {
var u;
return (u = i.inputRef.value) == null
? void 0
: u.focus({ preventScroll: !0 });
});
return;
case Ie.Escape:
if (i.comboboxState.value !== 0) return;
a.preventDefault(),
i.optionsRef.value &&
!i.optionsPropsRef.value.static &&
a.stopPropagation(),
i.closeCombobox(),
Ct(() => {
var u;
return (u = i.inputRef.value) == null
? void 0
: u.focus({ preventScroll: !0 });
});
return;
}
}
let l = Td(
$(() => ({ as: t.as, type: e.type })),
i.buttonRef
);
return () => {
var a, u;
let c = {
open: i.comboboxState.value === 0,
disabled: i.disabled.value,
value: i.value.value,
},
g = t,
{ id: f } = g,
h = Qe(g, ["id"]),
p = {
ref: i.buttonRef,
id: f,
type: l.value,
tabindex: "-1",
"aria-haspopup": "listbox",
"aria-controls":
(a = fe(i.optionsRef)) == null ? void 0 : a.id,
"aria-expanded": i.comboboxState.value === 0,
"aria-labelledby": i.labelRef.value
? [
(u = fe(i.labelRef)) == null
? void 0
: u.id,
f,
].join(" ")
: void 0,
disabled: i.disabled.value === !0 ? !0 : void 0,
onKeydown: s,
onClick: o,
};
return tt({
ourProps: p,
theirProps: h,
slot: c,
attrs: e,
slots: n,
name: "ComboboxButton",
});
};
},
}),
Pw = xe({
name: "ComboboxInput",
props: {
as: { type: [Object, String], default: "input" },
static: { type: Boolean, default: !1 },
unmount: { type: Boolean, default: !0 },
displayValue: { type: Function },
defaultValue: { type: String, default: void 0 },
id: {
type: String,
default: () => `headlessui-combobox-input-${At()}`,
},
},
emits: { change: (t) => !0 },
setup(t, { emit: e, attrs: n, slots: r, expose: i }) {
let o = ao("ComboboxInput"),
s = $(() => vn(fe(o.inputRef))),
l = { value: !1 };
i({ el: o.inputRef, $el: o.inputRef });
function a() {
o.change(null);
let x = fe(o.optionsRef);
x && (x.scrollTop = 0), o.goToOption(Ze.Nothing);
}
let u = $(() => {
var x;
let S = o.value.value;
return fe(o.inputRef)
? typeof t.displayValue != "undefined" && S !== void 0
? (x = t.displayValue(S)) != null
? x
: ""
: typeof S == "string"
? S
: ""
: "";
});
Ye(() => {
Rt(
[u, o.comboboxState, s],
([x, S], [T, d]) => {
if (l.value) return;
let y = fe(o.inputRef);
y &&
(((d === 0 && S === 1) || x !== T) && (y.value = x),
requestAnimationFrame(() => {
var m;
if (
l.value ||
!y ||
((m = s.value) == null
? void 0
: m.activeElement) !== y
)
return;
let { selectionStart: w, selectionEnd: k } = y;
Math.abs(
(k != null ? k : 0) - (w != null ? w : 0)
) === 0 &&
w === 0 &&
y.setSelectionRange(
y.value.length,
y.value.length
);
}));
},
{ immediate: !0 }
),
Rt([o.comboboxState], ([x], [S]) => {
if (x === 0 && S === 1) {
if (l.value) return;
let T = fe(o.inputRef);
if (!T) return;
let d = T.value,
{
selectionStart: y,
selectionEnd: m,
selectionDirection: w,
} = T;
(T.value = ""),
(T.value = d),
w !== null
? T.setSelectionRange(y, m, w)
: T.setSelectionRange(y, m);
}
});
});
let c = oe(!1);
function f() {
c.value = !0;
}
function h() {
lo().nextFrame(() => {
c.value = !1;
});
}
function p(x) {
switch (((l.value = !0), x.key)) {
case Ie.Enter:
if (
((l.value = !1),
o.comboboxState.value !== 0 || c.value)
)
return;
if (
(x.preventDefault(),
x.stopPropagation(),
o.activeOptionIndex.value === null)
) {
o.closeCombobox();
return;
}
o.selectActiveOption(),
o.mode.value === 0 && o.closeCombobox();
break;
case Ie.ArrowDown:
return (
(l.value = !1),
x.preventDefault(),
x.stopPropagation(),
vt(o.comboboxState.value, {
[0]: () => o.goToOption(Ze.Next),
[1]: () => o.openCombobox(),
})
);
case Ie.ArrowUp:
return (
(l.value = !1),
x.preventDefault(),
x.stopPropagation(),
vt(o.comboboxState.value, {
[0]: () => o.goToOption(Ze.Previous),
[1]: () => {
o.openCombobox(),
Ct(() => {
o.value.value ||
o.goToOption(Ze.Last);
});
},
})
);
case Ie.Home:
if (x.shiftKey) break;
return (
(l.value = !1),
x.preventDefault(),
x.stopPropagation(),
o.goToOption(Ze.First)
);
case Ie.PageUp:
return (
(l.value = !1),
x.preventDefault(),
x.stopPropagation(),
o.goToOption(Ze.First)
);
case Ie.End:
if (x.shiftKey) break;
return (
(l.value = !1),
x.preventDefault(),
x.stopPropagation(),
o.goToOption(Ze.Last)
);
case Ie.PageDown:
return (
(l.value = !1),
x.preventDefault(),
x.stopPropagation(),
o.goToOption(Ze.Last)
);
case Ie.Escape:
if (((l.value = !1), o.comboboxState.value !== 0))
return;
x.preventDefault(),
o.optionsRef.value &&
!o.optionsPropsRef.value.static &&
x.stopPropagation(),
o.nullable.value &&
o.mode.value === 0 &&
o.value.value === null &&
a(),
o.closeCombobox();
break;
case Ie.Tab:
if (((l.value = !1), o.comboboxState.value !== 0))
return;
o.mode.value === 0 && o.selectActiveOption(),
o.closeCombobox();
break;
}
}
function g(x) {
e("change", x),
o.nullable.value &&
o.mode.value === 0 &&
x.target.value === "" &&
a(),
o.openCombobox();
}
function v() {
l.value = !1;
}
let b = $(() => {
var x, S, T, d;
return (d =
(T =
(S = t.defaultValue) != null
? S
: o.defaultValue.value !== void 0
? (x = t.displayValue) == null
? void 0
: x.call(t, o.defaultValue.value)
: null) != null
? T
: o.defaultValue.value) != null
? d
: "";
});
return () => {
var x, S, T, d, y, m;
let w = { open: o.comboboxState.value === 0 },
P = t,
{ id: k, displayValue: _, onChange: C } = P,
E = Qe(P, ["id", "displayValue", "onChange"]),
R = {
"aria-controls":
(x = o.optionsRef.value) == null ? void 0 : x.id,
"aria-expanded": o.comboboxState.value === 0,
"aria-activedescendant":
o.activeOptionIndex.value === null ||
(S = o.options.value[o.activeOptionIndex.value]) ==
null
? void 0
: S.id,
"aria-labelledby":
(y =
(T = fe(o.labelRef)) == null ? void 0 : T.id) !=
null
? y
: (d = fe(o.buttonRef)) == null
? void 0
: d.id,
"aria-autocomplete": "list",
id: k,
onCompositionstart: f,
onCompositionend: h,
onKeydown: p,
onInput: g,
onBlur: v,
role: "combobox",
type: (m = n.type) != null ? m : "text",
tabIndex: 0,
ref: o.inputRef,
defaultValue: b.value,
disabled: o.disabled.value === !0 ? !0 : void 0,
};
return tt({
ourProps: R,
theirProps: E,
slot: w,
attrs: n,
slots: r,
features: Gn.RenderStrategy | Gn.Static,
name: "ComboboxInput",
});
};
},
}),
Nw = xe({
name: "ComboboxOptions",
props: {
as: { type: [Object, String], default: "ul" },
static: { type: Boolean, default: !1 },
unmount: { type: Boolean, default: !0 },
hold: { type: [Boolean], default: !1 },
},
setup(t, { attrs: e, slots: n, expose: r }) {
let i = ao("ComboboxOptions"),
o = `headlessui-combobox-options-${At()}`;
r({ el: i.optionsRef, $el: i.optionsRef }),
Mt(() => {
i.optionsPropsRef.value.static = t.static;
}),
Mt(() => {
i.optionsPropsRef.value.hold = t.hold;
});
let s = ms(),
l = $(() =>
s !== null
? (s.value & gt.Open) === gt.Open
: i.comboboxState.value === 0
);
return (
Od({
container: $(() => fe(i.optionsRef)),
enabled: $(() => i.comboboxState.value === 0),
accept(a) {
return a.getAttribute("role") === "option"
? NodeFilter.FILTER_REJECT
: a.hasAttribute("role")
? NodeFilter.FILTER_SKIP
: NodeFilter.FILTER_ACCEPT;
},
walk(a) {
a.setAttribute("role", "none");
},
}),
() => {
var a, u, c;
let f = { open: i.comboboxState.value === 0 },
h = {
"aria-labelledby":
(c =
(a = fe(i.labelRef)) == null
? void 0
: a.id) != null
? c
: (u = fe(i.buttonRef)) == null
? void 0
: u.id,
id: o,
ref: i.optionsRef,
role: "listbox",
"aria-multiselectable":
i.mode.value === 1 ? !0 : void 0,
},
p = so(t, ["hold"]);
return tt({
ourProps: h,
theirProps: p,
slot: f,
attrs: e,
slots: n,
features: Gn.RenderStrategy | Gn.Static,
visible: l.value,
name: "ComboboxOptions",
});
}
);
},
}),
jw = xe({
name: "ComboboxOption",
props: {
as: { type: [Object, String], default: "li" },
value: { type: [Object, String, Number, Boolean] },
disabled: { type: Boolean, default: !1 },
},
setup(t, { slots: e, attrs: n, expose: r }) {
let i = ao("ComboboxOption"),
o = `headlessui-combobox-option-${At()}`,
s = oe(null);
r({ el: s, $el: s });
let l = $(() =>
i.activeOptionIndex.value !== null
? i.options.value[i.activeOptionIndex.value].id === o
: !1
),
a = $(() =>
vt(i.mode.value, {
[0]: () => i.compare(de(i.value.value), de(t.value)),
[1]: () =>
de(i.value.value).some((b) =>
i.compare(de(b), de(t.value))
),
})
),
u = $(() => ({
disabled: t.disabled,
value: t.value,
domRef: s,
}));
Ye(() => i.registerOption(o, u)),
Bt(() => i.unregisterOption(o)),
Mt(() => {
i.comboboxState.value === 0 &&
l.value &&
i.activationTrigger.value !== 0 &&
Ct(() => {
var b, x;
return (x =
(b = fe(s)) == null
? void 0
: b.scrollIntoView) == null
? void 0
: x.call(b, { block: "nearest" });
});
});
function c(b) {
if (t.disabled) return b.preventDefault();
i.selectOption(o),
i.mode.value === 0 && i.closeCombobox(),
_w() ||
requestAnimationFrame(() => {
var x;
return (x = fe(i.inputRef)) == null
? void 0
: x.focus();
});
}
function f() {
if (t.disabled) return i.goToOption(Ze.Nothing);
i.goToOption(Ze.Specific, o);
}
let h = r1();
function p(b) {
h.update(b);
}
function g(b) {
h.wasMoved(b) &&
(t.disabled || l.value || i.goToOption(Ze.Specific, o, 0));
}
function v(b) {
h.wasMoved(b) &&
(t.disabled ||
(l.value &&
(i.optionsPropsRef.value.hold ||
i.goToOption(Ze.Nothing))));
}
return () => {
let { disabled: b } = t,
x = { active: l.value, selected: a.value, disabled: b },
S = {
id: o,
ref: s,
role: "option",
tabIndex: b === !0 ? void 0 : -1,
"aria-disabled": b === !0 ? !0 : void 0,
"aria-selected": a.value,
disabled: void 0,
onClick: c,
onFocus: f,
onPointerenter: p,
onMouseenter: p,
onPointermove: g,
onMousemove: g,
onPointerleave: v,
onMouseleave: v,
};
return tt({
ourProps: S,
theirProps: t,
slot: x,
attrs: n,
slots: e,
name: "ComboboxOption",
});
};
},
});
var _o = ((t) => (
(t[(t.Forwards = 0)] = "Forwards"), (t[(t.Backwards = 1)] = "Backwards"), t
))(_o || {});
function Lw() {
let t = oe(0);
return (
Zg("keydown", (e) => {
e.key === "Tab" && (t.value = e.shiftKey ? 1 : 0);
}),
t
);
}
function s1(t, e, n, r) {
gs.isServer ||
Mt((i) => {
(t = t != null ? t : window),
t.addEventListener(e, n, r),
i(() => t.removeEventListener(e, n, r));
});
}
function Dw(t) {
function e() {
document.readyState !== "loading" &&
(t(), document.removeEventListener("DOMContentLoaded", e));
}
typeof window != "undefined" &&
typeof document != "undefined" &&
(document.addEventListener("DOMContentLoaded", e), e());
}
function l1(t) {
if (!t) return new Set();
if (typeof t == "function") return new Set(t());
let e = new Set();
for (let n of t.value) {
let r = fe(n);
r instanceof HTMLElement && e.add(r);
}
return e;
}
var a1 = ((t) => (
(t[(t.None = 1)] = "None"),
(t[(t.InitialFocus = 2)] = "InitialFocus"),
(t[(t.TabLock = 4)] = "TabLock"),
(t[(t.FocusLock = 8)] = "FocusLock"),
(t[(t.RestoreFocus = 16)] = "RestoreFocus"),
(t[(t.All = 30)] = "All"),
t
))(a1 || {});
let bo = Object.assign(
xe({
name: "FocusTrap",
props: {
as: { type: [Object, String], default: "div" },
initialFocus: { type: Object, default: null },
features: { type: Number, default: 30 },
containers: {
type: [Object, Function],
default: oe(new Set()),
},
},
inheritAttrs: !1,
setup(t, { attrs: e, slots: n, expose: r }) {
let i = oe(null);
r({ el: i, $el: i });
let o = $(() => vn(i)),
s = oe(!1);
Ye(() => (s.value = !0)),
Bt(() => (s.value = !1)),
Bw(
{ ownerDocument: o },
$(() => s.value && Boolean(t.features & 16))
);
let l = $w(
{
ownerDocument: o,
container: i,
initialFocus: $(() => t.initialFocus),
},
$(() => s.value && Boolean(t.features & 2))
);
zw(
{
ownerDocument: o,
container: i,
containers: t.containers,
previousActiveElement: l,
},
$(() => s.value && Boolean(t.features & 8))
);
let a = Lw();
function u(p) {
let g = fe(i);
!g ||
((v) => v())(() => {
vt(a.value, {
[_o.Forwards]: () => {
li(g, Qt.First, {
skipElements: [p.relatedTarget],
});
},
[_o.Backwards]: () => {
li(g, Qt.Last, {
skipElements: [p.relatedTarget],
});
},
});
});
}
let c = oe(!1);
function f(p) {
p.key === "Tab" &&
((c.value = !0),
requestAnimationFrame(() => {
c.value = !1;
}));
}
function h(p) {
if (!s.value) return;
let g = l1(t.containers);
fe(i) instanceof HTMLElement && g.add(fe(i));
let v = p.relatedTarget;
v instanceof HTMLElement &&
v.dataset.headlessuiFocusGuard !== "true" &&
(u1(g, v) ||
(c.value
? li(
fe(i),
vt(a.value, {
[_o.Forwards]: () => Qt.Next,
[_o.Backwards]: () => Qt.Previous,
}) | Qt.WrapAround,
{ relativeTo: p.target }
)
: p.target instanceof HTMLElement &&
Rr(p.target)));
}
return () => {
let p = {},
g = { ref: i, onKeydown: f, onFocusout: h },
T = t,
{ features: v, initialFocus: b, containers: x } = T,
S = Qe(T, ["features", "initialFocus", "containers"]);
return ze(He, [
Boolean(v & 4) &&
ze(Gi, {
as: "button",
type: "button",
"data-headlessui-focus-guard": !0,
onFocus: u,
features: gi.Focusable,
}),
tt({
ourProps: g,
theirProps: W(W({}, e), S),
slot: p,
attrs: e,
slots: n,
name: "FocusTrap",
}),
Boolean(v & 4) &&
ze(Gi, {
as: "button",
type: "button",
"data-headlessui-focus-guard": !0,
onFocus: u,
features: gi.Focusable,
}),
]);
};
},
}),
{ features: a1 }
),
Zr = [];
Dw(() => {
function t(e) {
e.target instanceof HTMLElement &&
e.target !== document.body &&
Zr[0] !== e.target &&
(Zr.unshift(e.target),
(Zr = Zr.filter((n) => n != null && n.isConnected)),
Zr.splice(10));
}
window.addEventListener("click", t, { capture: !0 }),
window.addEventListener("mousedown", t, { capture: !0 }),
window.addEventListener("focus", t, { capture: !0 }),
document.body.addEventListener("click", t, { capture: !0 }),
document.body.addEventListener("mousedown", t, { capture: !0 }),
document.body.addEventListener("focus", t, { capture: !0 });
});
function Iw(t) {
let e = oe(Zr.slice());
return (
Rt(
[t],
([n], [r]) => {
r === !0 && n === !1
? Dd(() => {
e.value.splice(0);
})
: r === !1 && n === !0 && (e.value = Zr.slice());
},
{ flush: "post" }
),
() => {
var n;
return (n = e.value.find((r) => r != null && r.isConnected)) != null
? n
: null;
}
);
}
function Bw({ ownerDocument: t }, e) {
let n = Iw(e);
Ye(() => {
Mt(
() => {
var r, i;
e.value ||
(((r = t.value) == null ? void 0 : r.activeElement) ===
((i = t.value) == null ? void 0 : i.body) &&
Rr(n()));
},
{ flush: "post" }
);
}),
Bt(() => {
e.value && Rr(n());
});
}
function $w({ ownerDocument: t, container: e, initialFocus: n }, r) {
let i = oe(null),
o = oe(!1);
return (
Ye(() => (o.value = !0)),
Bt(() => (o.value = !1)),
Ye(() => {
Rt(
[e, n, r],
(s, l) => {
if (
s.every((u, c) => (l == null ? void 0 : l[c]) === u) ||
!r.value
)
return;
let a = fe(e);
a &&
Dd(() => {
var u, c;
if (!o.value) return;
let f = fe(n),
h =
(u = t.value) == null
? void 0
: u.activeElement;
if (f) {
if (f === h) {
i.value = h;
return;
}
} else if (a.contains(h)) {
i.value = h;
return;
}
f
? Rr(f)
: li(a, Qt.First | Qt.NoScroll) === Sl.Error &&
console.warn(
"There are no focusable elements inside the <FocusTrap />"
),
(i.value =
(c = t.value) == null
? void 0
: c.activeElement);
});
},
{ immediate: !0, flush: "post" }
);
}),
i
);
}
function zw(
{ ownerDocument: t, container: e, containers: n, previousActiveElement: r },
i
) {
var o;
s1(
(o = t.value) == null ? void 0 : o.defaultView,
"focus",
(s) => {
if (!i.value) return;
let l = l1(n);
fe(e) instanceof HTMLElement && l.add(fe(e));
let a = r.value;
if (!a) return;
let u = s.target;
u && u instanceof HTMLElement
? u1(l, u)
? ((r.value = u), Rr(u))
: (s.preventDefault(), s.stopPropagation(), Rr(a))
: Rr(r.value);
},
!0
);
}
function u1(t, e) {
for (let n of t) if (n.contains(e)) return !0;
return !1;
}
let mu = new Map(),
wo = new Map();
function qh(t, e = oe(!0)) {
Mt((n) => {
var r;
if (!e.value) return;
let i = fe(t);
if (!i) return;
n(function () {
var s;
if (!i) return;
let l = (s = wo.get(i)) != null ? s : 1;
if ((l === 1 ? wo.delete(i) : wo.set(i, l - 1), l !== 1)) return;
let a = mu.get(i);
a &&
(a["aria-hidden"] === null
? i.removeAttribute("aria-hidden")
: i.setAttribute("aria-hidden", a["aria-hidden"]),
(i.inert = a.inert),
mu.delete(i));
});
let o = (r = wo.get(i)) != null ? r : 0;
wo.set(i, o + 1),
o === 0 &&
(mu.set(i, {
"aria-hidden": i.getAttribute("aria-hidden"),
inert: i.inert,
}),
i.setAttribute("aria-hidden", "true"),
(i.inert = !0));
});
}
let c1 = Symbol("ForcePortalRootContext");
function Hw() {
return qe(c1, !1);
}
let gc = xe({
name: "ForcePortalRoot",
props: {
as: { type: [Object, String], default: "template" },
force: { type: Boolean, default: !1 },
},
setup(t, { slots: e, attrs: n }) {
return (
kt(c1, t.force),
() => {
let o = t,
{ force: r } = o,
i = Qe(o, ["force"]);
return tt({
theirProps: i,
ourProps: {},
slot: {},
slots: e,
attrs: n,
name: "ForcePortalRoot",
});
}
);
},
});
function Fw(t) {
let e = vn(t);
if (!e) {
if (t === null) return null;
throw new Error(
`[Headless UI]: Cannot find ownerDocument for contextElement: ${t}`
);
}
let n = e.getElementById("headlessui-portal-root");
if (n) return n;
let r = e.createElement("div");
return (
r.setAttribute("id", "headlessui-portal-root"), e.body.appendChild(r)
);
}
let d1 = xe({
name: "Portal",
props: { as: { type: [Object, String], default: "div" } },
setup(t, { slots: e, attrs: n }) {
let r = oe(null),
i = $(() => vn(r)),
o = Hw(),
s = qe(f1, null),
l = oe(o === !0 || s == null ? Fw(r.value) : s.resolveTarget());
Mt(() => {
o || (s != null && (l.value = s.resolveTarget()));
});
let a = qe(yc, null);
return (
Ye(() => {
let u = fe(r);
u && a && Bt(a.register(u));
}),
Bt(() => {
var u, c;
let f =
(u = i.value) == null
? void 0
: u.getElementById("headlessui-portal-root");
f &&
l.value === f &&
l.value.children.length <= 0 &&
((c = l.value.parentElement) == null ||
c.removeChild(l.value));
}),
() => {
if (l.value === null) return null;
let u = { ref: r, "data-headlessui-portal": "" };
return ze(
xd,
{ to: l.value },
tt({
ourProps: u,
theirProps: t,
slot: {},
attrs: n,
slots: e,
name: "Portal",
})
);
}
);
},
}),
yc = Symbol("PortalParentContext");
function Vw() {
let t = qe(yc, null),
e = oe([]);
function n(o) {
return e.value.push(o), t && t.register(o), () => r(o);
}
function r(o) {
let s = e.value.indexOf(o);
s !== -1 && e.value.splice(s, 1), t && t.unregister(o);
}
let i = { register: n, unregister: r, portals: e };
return [
e,
xe({
name: "PortalWrapper",
setup(o, { slots: s }) {
return (
kt(yc, i),
() => {
var l;
return (l = s.default) == null ? void 0 : l.call(s);
}
);
},
}),
];
}
let f1 = Symbol("PortalGroupContext"),
Ww = xe({
name: "PortalGroup",
props: {
as: { type: [Object, String], default: "template" },
target: { type: Object, default: null },
},
setup(t, { attrs: e, slots: n }) {
let r = Sn({
resolveTarget() {
return t.target;
},
});
return (
kt(f1, r),
() => {
let s = t,
{ target: i } = s,
o = Qe(s, ["target"]);
return tt({
theirProps: o,
ourProps: {},
slot: {},
attrs: e,
slots: n,
name: "PortalGroup",
});
}
);
},
}),
h1 = Symbol("StackContext");
var vc = ((t) => ((t[(t.Add = 0)] = "Add"), (t[(t.Remove = 1)] = "Remove"), t))(
vc || {}
);
function Uw() {
return qe(h1, () => {});
}
function Kw({ type: t, enabled: e, element: n, onUpdate: r }) {
let i = Uw();
function o(...s) {
r == null || r(...s), i(...s);
}
Ye(() => {
Rt(
e,
(s, l) => {
s ? o(0, t, n) : l === !0 && o(1, t, n);
},
{ immediate: !0, flush: "sync" }
);
}),
Bt(() => {
e.value && o(1, t, n);
}),
kt(h1, o);
}
let p1 = Symbol("DescriptionContext");
function qw() {
let t = qe(p1, null);
if (t === null) throw new Error("Missing parent");
return t;
}
function ja({ slot: t = oe({}), name: e = "Description", props: n = {} } = {}) {
let r = oe([]);
function i(o) {
return (
r.value.push(o),
() => {
let s = r.value.indexOf(o);
s !== -1 && r.value.splice(s, 1);
}
);
}
return (
kt(p1, { register: i, slot: t, name: e, props: n }),
$(() => (r.value.length > 0 ? r.value.join(" ") : void 0))
);
}
let Jw = xe({
name: "Description",
props: {
as: { type: [Object, String], default: "p" },
id: { type: String, default: () => `headlessui-description-${At()}` },
},
setup(t, { attrs: e, slots: n }) {
let r = qw();
return (
Ye(() => Bt(r.register(t.id))),
() => {
let {
name: i = "Description",
slot: o = oe({}),
props: s = {},
} = r,
c = t,
{ id: l } = c,
a = Qe(c, ["id"]),
u = be(
W(
{},
Object.entries(s).reduce(
(f, [h, p]) => Object.assign(f, { [h]: ne(p) }),
{}
)
),
{ id: l }
);
return tt({
ourProps: u,
theirProps: a,
slot: o.value,
attrs: e,
slots: n,
name: i,
});
}
);
},
});
function Gw(t) {
let e = rg(t.getSnapshot());
return (
Bt(
t.subscribe(() => {
e.value = t.getSnapshot();
})
),
e
);
}
function Yw(t, e) {
let n = t(),
r = new Set();
return {
getSnapshot() {
return n;
},
subscribe(i) {
return r.add(i), () => r.delete(i);
},
dispatch(i, ...o) {
let s = e[i].call(n, ...o);
s && ((n = s), r.forEach((l) => l()));
},
};
}
function Qw() {
let t;
return {
before({ doc: e }) {
var n;
let r = e.documentElement;
t =
((n = e.defaultView) != null ? n : window).innerWidth -
r.clientWidth;
},
after({ doc: e, d: n }) {
let r = e.documentElement,
i = r.clientWidth - r.offsetWidth,
o = t - i;
n.style(r, "paddingRight", `${o}px`);
},
};
}
function Xw() {
if (!i1()) return {};
let t;
return {
before() {
t = window.pageYOffset;
},
after({ doc: e, d: n, meta: r }) {
function i(s) {
return r.containers
.flatMap((l) => l())
.some((l) => l.contains(s));
}
if (
window.getComputedStyle(e.documentElement).scrollBehavior !==
"auto"
) {
let s = lo();
s.style(e.documentElement, "scroll-behavior", "auto"),
n.add(() => n.microTask(() => s.dispose()));
}
n.style(e.body, "marginTop", `-${t}px`), window.scrollTo(0, 0);
let o = null;
n.addEventListener(
e,
"click",
(s) => {
if (s.target instanceof HTMLElement)
try {
let l = s.target.closest("a");
if (!l) return;
let { hash: a } = new URL(l.href),
u = e.querySelector(a);
u && !i(u) && (o = u);
} catch (l) {}
},
!0
),
n.addEventListener(
e,
"touchmove",
(s) => {
s.target instanceof HTMLElement &&
!i(s.target) &&
s.preventDefault();
},
{ passive: !1 }
),
n.add(() => {
window.scrollTo(0, window.pageYOffset + t),
o &&
o.isConnected &&
(o.scrollIntoView({ block: "nearest" }),
(o = null));
});
},
};
}
function Zw() {
return {
before({ doc: t, d: e }) {
e.style(t.documentElement, "overflow", "hidden");
},
};
}
function ex(t) {
let e = {};
for (let n of t) Object.assign(e, n(e));
return e;
}
let ni = Yw(() => new Map(), {
PUSH(t, e) {
var n;
let r =
(n = this.get(t)) != null
? n
: { doc: t, count: 0, d: lo(), meta: new Set() };
return r.count++, r.meta.add(e), this.set(t, r), this;
},
POP(t, e) {
let n = this.get(t);
return n && (n.count--, n.meta.delete(e)), this;
},
SCROLL_PREVENT({ doc: t, d: e, meta: n }) {
let r = { doc: t, d: e, meta: ex(n) },
i = [Xw(), Qw(), Zw()];
i.forEach(({ before: o }) => (o == null ? void 0 : o(r))),
i.forEach(({ after: o }) => (o == null ? void 0 : o(r)));
},
SCROLL_ALLOW({ d: t }) {
t.dispose();
},
TEARDOWN({ doc: t }) {
this.delete(t);
},
});
ni.subscribe(() => {
let t = ni.getSnapshot(),
e = new Map();
for (let [n] of t) e.set(n, n.documentElement.style.overflow);
for (let n of t.values()) {
let r = e.get(n.doc) === "hidden",
i = n.count !== 0;
((i && !r) || (!i && r)) &&
ni.dispatch(n.count > 0 ? "SCROLL_PREVENT" : "SCROLL_ALLOW", n),
n.count === 0 && ni.dispatch("TEARDOWN", n);
}
});
function tx(t, e, n) {
let r = Gw(ni),
i = $(() => {
let o = t.value ? r.value.get(t.value) : void 0;
return o ? o.count > 0 : !1;
});
return (
Rt(
[t, e],
([o, s], [l], a) => {
if (!o || !s) return;
ni.dispatch("PUSH", o, n);
let u = !1;
a(() => {
u || (ni.dispatch("POP", l != null ? l : o, n), (u = !0));
});
},
{ immediate: !0 }
),
i
);
}
function nx({
defaultContainers: t = [],
portals: e,
mainTreeNodeRef: n,
} = {}) {
let r = oe(null),
i = vn(r);
function o() {
var s;
let l = [];
for (let a of t)
a !== null &&
(a instanceof HTMLElement
? l.push(a)
: "value" in a &&
a.value instanceof HTMLElement &&
l.push(a.value));
if (e != null && e.value) for (let a of e.value) l.push(a);
for (let a of (s =
i == null ? void 0 : i.querySelectorAll("html > *, body > *")) !=
null
? s
: [])
a !== document.body &&
a !== document.head &&
a instanceof HTMLElement &&
a.id !== "headlessui-portal-root" &&
(a.contains(fe(r)) ||
l.some((u) => a.contains(u)) ||
l.push(a));
return l;
}
return {
resolveContainers: o,
contains(s) {
return o().some((l) => l.contains(s));
},
mainTreeNodeRef: r,
MainTreeNode() {
return n != null ? null : ze(Gi, { features: gi.Hidden, ref: r });
},
};
}
var rx = ((t) => (
(t[(t.Open = 0)] = "Open"), (t[(t.Closed = 1)] = "Closed"), t
))(rx || {});
let bc = Symbol("DialogContext");
function ys(t) {
let e = qe(bc, null);
if (e === null) {
let n = new Error(`<${t} /> is missing a parent <Dialog /> component.`);
throw (Error.captureStackTrace && Error.captureStackTrace(n, ys), n);
}
return e;
}
let Bs = "DC8F892D-2EBD-447C-A4C8-A03058436FF4",
ix = xe({
name: "Dialog",
inheritAttrs: !1,
props: {
as: { type: [Object, String], default: "div" },
static: { type: Boolean, default: !1 },
unmount: { type: Boolean, default: !0 },
open: { type: [Boolean, String], default: Bs },
initialFocus: { type: Object, default: null },
id: { type: String, default: () => `headlessui-dialog-${At()}` },
},
emits: { close: (t) => !0 },
setup(t, { emit: e, attrs: n, slots: r, expose: i }) {
var o;
let s = oe(!1);
Ye(() => {
s.value = !0;
});
let l = oe(0),
a = ms(),
u = $(() =>
t.open === Bs && a !== null
? (a.value & gt.Open) === gt.Open
: t.open
),
c = oe(null),
f = $(() => vn(c));
if ((i({ el: c, $el: c }), !(t.open !== Bs || a !== null)))
throw new Error(
"You forgot to provide an `open` prop to the `Dialog`."
);
if (typeof u.value != "boolean")
throw new Error(
`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${
u.value === Bs ? void 0 : t.open
}`
);
let h = $(() => (s.value && u.value ? 0 : 1)),
p = $(() => h.value === 0),
g = $(() => l.value > 1),
v = qe(bc, null) !== null,
[b, x] = Vw(),
{
resolveContainers: S,
mainTreeNodeRef: T,
MainTreeNode: d,
} = nx({
portals: b,
defaultContainers: [
$(() => {
var N;
return (N = P.panelRef.value) != null ? N : c.value;
}),
],
}),
y = $(() => (g.value ? "parent" : "leaf")),
m = $(() =>
a !== null ? (a.value & gt.Closing) === gt.Closing : !1
),
w = $(() => (v || m.value ? !1 : p.value)),
k = $(() => {
var N, D, K;
return (K = Array.from(
(D =
(N = f.value) == null
? void 0
: N.querySelectorAll("body > *")) != null
? D
: []
).find((ae) =>
ae.id === "headlessui-portal-root"
? !1
: ae.contains(fe(T)) && ae instanceof HTMLElement
)) != null
? K
: null;
});
qh(k, w);
let _ = $(() => (g.value ? !0 : p.value)),
C = $(() => {
var N, D, K;
return (K = Array.from(
(D =
(N = f.value) == null
? void 0
: N.querySelectorAll(
"[data-headlessui-portal]"
)) != null
? D
: []
).find(
(ae) => ae.contains(fe(T)) && ae instanceof HTMLElement
)) != null
? K
: null;
});
qh(C, _),
Kw({
type: "Dialog",
enabled: $(() => h.value === 0),
element: c,
onUpdate: (N, D) => {
if (D === "Dialog")
return vt(N, {
[vc.Add]: () => (l.value += 1),
[vc.Remove]: () => (l.value -= 1),
});
},
});
let E = ja({
name: "DialogDescription",
slot: $(() => ({ open: u.value })),
}),
R = oe(null),
P = {
titleId: R,
panelRef: oe(null),
dialogState: h,
setTitleId(N) {
R.value !== N && (R.value = N);
},
close() {
e("close", !1);
},
};
kt(bc, P);
let L = $(() => !(!p.value || g.value));
Nd(
S,
(N, D) => {
P.close(), Ct(() => (D == null ? void 0 : D.focus()));
},
L
);
let I = $(() => !(g.value || h.value !== 0));
s1(
(o = f.value) == null ? void 0 : o.defaultView,
"keydown",
(N) => {
I.value &&
(N.defaultPrevented ||
(N.key === Ie.Escape &&
(N.preventDefault(),
N.stopPropagation(),
P.close())));
}
);
let M = $(() => !(m.value || h.value !== 0 || v));
return (
tx(f, M, (N) => {
var D;
return {
containers: [
...((D = N.containers) != null ? D : []),
S,
],
};
}),
Mt((N) => {
if (h.value !== 0) return;
let D = fe(c);
if (!D) return;
let K = new ResizeObserver((ae) => {
for (let Q of ae) {
let me = Q.target.getBoundingClientRect();
me.x === 0 &&
me.y === 0 &&
me.width === 0 &&
me.height === 0 &&
P.close();
}
});
K.observe(D), N(() => K.disconnect());
}),
() => {
let je = t,
{ id: N, open: D, initialFocus: K } = je,
ae = Qe(je, ["id", "open", "initialFocus"]),
Q = be(W({}, n), {
ref: c,
id: N,
role: "dialog",
"aria-modal": h.value === 0 ? !0 : void 0,
"aria-labelledby": R.value,
"aria-describedby": E.value,
}),
me = { open: h.value === 0 };
return ze(gc, { force: !0 }, () => [
ze(d1, () =>
ze(Ww, { target: c.value }, () =>
ze(gc, { force: !1 }, () =>
ze(
bo,
{
initialFocus: K,
containers: S,
features: p.value
? vt(y.value, {
parent: bo.features
.RestoreFocus,
leaf:
bo.features.All &
~bo.features
.FocusLock,
})
: bo.features.None,
},
() =>
ze(x, {}, () =>
tt({
ourProps: Q,
theirProps: W(W({}, ae), n),
slot: me,
attrs: n,
slots: r,
visible: h.value === 0,
features:
Gn.RenderStrategy |
Gn.Static,
name: "Dialog",
})
)
)
)
)
),
ze(d),
]);
}
);
},
});
xe({
name: "DialogOverlay",
props: {
as: { type: [Object, String], default: "div" },
id: {
type: String,
default: () => `headlessui-dialog-overlay-${At()}`,
},
},
setup(t, { attrs: e, slots: n }) {
let r = ys("DialogOverlay");
function i(o) {
o.target === o.currentTarget &&
(o.preventDefault(), o.stopPropagation(), r.close());
}
return () => {
let l = t,
{ id: o } = l,
s = Qe(l, ["id"]);
return tt({
ourProps: { id: o, "aria-hidden": !0, onClick: i },
theirProps: s,
slot: { open: r.dialogState.value === 0 },
attrs: e,
slots: n,
name: "DialogOverlay",
});
};
},
});
xe({
name: "DialogBackdrop",
props: {
as: { type: [Object, String], default: "div" },
id: {
type: String,
default: () => `headlessui-dialog-backdrop-${At()}`,
},
},
inheritAttrs: !1,
setup(t, { attrs: e, slots: n, expose: r }) {
let i = ys("DialogBackdrop"),
o = oe(null);
return (
r({ el: o, $el: o }),
Ye(() => {
if (i.panelRef.value === null)
throw new Error(
"A <DialogBackdrop /> component is being used, but a <DialogPanel /> component is missing."
);
}),
() => {
let u = t,
{ id: s } = u,
l = Qe(u, ["id"]),
a = { id: s, ref: o, "aria-hidden": !0 };
return ze(gc, { force: !0 }, () =>
ze(d1, () =>
tt({
ourProps: a,
theirProps: W(W({}, e), l),
slot: { open: i.dialogState.value === 0 },
attrs: e,
slots: n,
name: "DialogBackdrop",
})
)
);
}
);
},
});
let ox = xe({
name: "DialogPanel",
props: {
as: { type: [Object, String], default: "div" },
id: {
type: String,
default: () => `headlessui-dialog-panel-${At()}`,
},
},
setup(t, { attrs: e, slots: n, expose: r }) {
let i = ys("DialogPanel");
r({ el: i.panelRef, $el: i.panelRef });
function o(s) {
s.stopPropagation();
}
return () => {
let u = t,
{ id: s } = u,
l = Qe(u, ["id"]),
a = { id: s, ref: i.panelRef, onClick: o };
return tt({
ourProps: a,
theirProps: l,
slot: { open: i.dialogState.value === 0 },
attrs: e,
slots: n,
name: "DialogPanel",
});
};
},
}),
sx = xe({
name: "DialogTitle",
props: {
as: { type: [Object, String], default: "h2" },
id: {
type: String,
default: () => `headlessui-dialog-title-${At()}`,
},
},
setup(t, { attrs: e, slots: n }) {
let r = ys("DialogTitle");
return (
Ye(() => {
r.setTitleId(t.id), Bt(() => r.setTitleId(null));
}),
() => {
let s = t,
{ id: i } = s,
o = Qe(s, ["id"]);
return tt({
ourProps: { id: i },
theirProps: o,
slot: { open: r.dialogState.value === 0 },
attrs: e,
slots: n,
name: "DialogTitle",
});
}
);
},
}),
Jh =
/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;
function Gh(t) {
var e, n;
let r = (e = t.innerText) != null ? e : "",
i = t.cloneNode(!0);
if (!(i instanceof HTMLElement)) return r;
let o = !1;
for (let l of i.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))
l.remove(), (o = !0);
let s = o ? ((n = i.innerText) != null ? n : "") : r;
return Jh.test(s) && (s = s.replace(Jh, "")), s;
}
function lx(t) {
let e = t.getAttribute("aria-label");
if (typeof e == "string") return e.trim();
let n = t.getAttribute("aria-labelledby");
if (n) {
let r = n
.split(" ")
.map((i) => {
let o = document.getElementById(i);
if (o) {
let s = o.getAttribute("aria-label");
return typeof s == "string" ? s.trim() : Gh(o).trim();
}
return null;
})
.filter(Boolean);
if (r.length > 0) return r.join(", ");
}
return Gh(t).trim();
}
function ax(t) {
let e = oe(""),
n = oe("");
return () => {
let r = fe(t);
if (!r) return "";
let i = r.innerText;
if (e.value === i) return n.value;
let o = lx(r).trim().toLowerCase();
return (e.value = i), (n.value = o), o;
};
}
var ux = ((t) => (
(t[(t.Open = 0)] = "Open"), (t[(t.Closed = 1)] = "Closed"), t
))(ux || {}),
cx = ((t) => (
(t[(t.Pointer = 0)] = "Pointer"), (t[(t.Other = 1)] = "Other"), t
))(cx || {});
function dx(t) {
requestAnimationFrame(() => requestAnimationFrame(t));
}
let m1 = Symbol("MenuContext");
function La(t) {
let e = qe(m1, null);
if (e === null) {
let n = new Error(`<${t} /> is missing a parent <Menu /> component.`);
throw (Error.captureStackTrace && Error.captureStackTrace(n, La), n);
}
return e;
}
let fx = xe({
name: "Menu",
props: { as: { type: [Object, String], default: "template" } },
setup(t, { slots: e, attrs: n }) {
let r = oe(1),
i = oe(null),
o = oe(null),
s = oe([]),
l = oe(""),
a = oe(null),
u = oe(1);
function c(h = (p) => p) {
let p = a.value !== null ? s.value[a.value] : null,
g = Na(h(s.value.slice()), (b) => fe(b.dataRef.domRef)),
v = p ? g.indexOf(p) : null;
return v === -1 && (v = null), { items: g, activeItemIndex: v };
}
let f = {
menuState: r,
buttonRef: i,
itemsRef: o,
items: s,
searchQuery: l,
activeItemIndex: a,
activationTrigger: u,
closeMenu: () => {
(r.value = 1), (a.value = null);
},
openMenu: () => (r.value = 0),
goToItem(h, p, g) {
let v = c(),
b = Gg(
h === Ze.Specific
? { focus: Ze.Specific, id: p }
: { focus: h },
{
resolveItems: () => v.items,
resolveActiveIndex: () => v.activeItemIndex,
resolveId: (x) => x.id,
resolveDisabled: (x) => x.dataRef.disabled,
}
);
(l.value = ""),
(a.value = b),
(u.value = g != null ? g : 1),
(s.value = v.items);
},
search(h) {
let p = l.value !== "" ? 0 : 1;
l.value += h.toLowerCase();
let g = (
a.value !== null
? s.value
.slice(a.value + p)
.concat(s.value.slice(0, a.value + p))
: s.value
).find(
(b) =>
b.dataRef.textValue.startsWith(l.value) &&
!b.dataRef.disabled
),
v = g ? s.value.indexOf(g) : -1;
v === -1 || v === a.value || ((a.value = v), (u.value = 1));
},
clearSearch() {
l.value = "";
},
registerItem(h, p) {
let g = c((v) => [...v, { id: h, dataRef: p }]);
(s.value = g.items),
(a.value = g.activeItemIndex),
(u.value = 1);
},
unregisterItem(h) {
let p = c((g) => {
let v = g.findIndex((b) => b.id === h);
return v !== -1 && g.splice(v, 1), g;
});
(s.value = p.items),
(a.value = p.activeItemIndex),
(u.value = 1);
},
};
return (
Nd(
[i, o],
(h, p) => {
var g;
f.closeMenu(),
Pd(p, Rd.Loose) ||
(h.preventDefault(),
(g = fe(i)) == null || g.focus());
},
$(() => r.value === 0)
),
kt(m1, f),
Ad($(() => vt(r.value, { [0]: gt.Open, [1]: gt.Closed }))),
() => {
let h = { open: r.value === 0, close: f.closeMenu };
return tt({
ourProps: {},
theirProps: t,
slot: h,
slots: e,
attrs: n,
name: "Menu",
});
}
);
},
}),
hx = xe({
name: "MenuButton",
props: {
disabled: { type: Boolean, default: !1 },
as: { type: [Object, String], default: "button" },
id: {
type: String,
default: () => `headlessui-menu-button-${At()}`,
},
},
setup(t, { attrs: e, slots: n, expose: r }) {
let i = La("MenuButton");
r({ el: i.buttonRef, $el: i.buttonRef });
function o(u) {
switch (u.key) {
case Ie.Space:
case Ie.Enter:
case Ie.ArrowDown:
u.preventDefault(),
u.stopPropagation(),
i.openMenu(),
Ct(() => {
var c;
(c = fe(i.itemsRef)) == null ||
c.focus({ preventScroll: !0 }),
i.goToItem(Ze.First);
});
break;
case Ie.ArrowUp:
u.preventDefault(),
u.stopPropagation(),
i.openMenu(),
Ct(() => {
var c;
(c = fe(i.itemsRef)) == null ||
c.focus({ preventScroll: !0 }),
i.goToItem(Ze.Last);
});
break;
}
}
function s(u) {
switch (u.key) {
case Ie.Space:
u.preventDefault();
break;
}
}
function l(u) {
t.disabled ||
(i.menuState.value === 0
? (i.closeMenu(),
Ct(() => {
var c;
return (c = fe(i.buttonRef)) == null
? void 0
: c.focus({ preventScroll: !0 });
}))
: (u.preventDefault(),
i.openMenu(),
dx(() => {
var c;
return (c = fe(i.itemsRef)) == null
? void 0
: c.focus({ preventScroll: !0 });
})));
}
let a = Td(
$(() => ({ as: t.as, type: e.type })),
i.buttonRef
);
return () => {
var u;
let c = { open: i.menuState.value === 0 },
g = t,
{ id: f } = g,
h = Qe(g, ["id"]),
p = {
ref: i.buttonRef,
id: f,
type: a.value,
"aria-haspopup": "menu",
"aria-controls":
(u = fe(i.itemsRef)) == null ? void 0 : u.id,
"aria-expanded": i.menuState.value === 0,
onKeydown: o,
onKeyup: s,
onClick: l,
};
return tt({
ourProps: p,
theirProps: h,
slot: c,
attrs: e,
slots: n,
name: "MenuButton",
});
};
},
}),
px = xe({
name: "MenuItems",
props: {
as: { type: [Object, String], default: "div" },
static: { type: Boolean, default: !1 },
unmount: { type: Boolean, default: !0 },
id: {
type: String,
default: () => `headlessui-menu-items-${At()}`,
},
},
setup(t, { attrs: e, slots: n, expose: r }) {
let i = La("MenuItems"),
o = oe(null);
r({ el: i.itemsRef, $el: i.itemsRef }),
Od({
container: $(() => fe(i.itemsRef)),
enabled: $(() => i.menuState.value === 0),
accept(c) {
return c.getAttribute("role") === "menuitem"
? NodeFilter.FILTER_REJECT
: c.hasAttribute("role")
? NodeFilter.FILTER_SKIP
: NodeFilter.FILTER_ACCEPT;
},
walk(c) {
c.setAttribute("role", "none");
},
});
function s(c) {
var f;
switch ((o.value && clearTimeout(o.value), c.key)) {
case Ie.Space:
if (i.searchQuery.value !== "")
return (
c.preventDefault(),
c.stopPropagation(),
i.search(c.key)
);
case Ie.Enter:
if (
(c.preventDefault(),
c.stopPropagation(),
i.activeItemIndex.value !== null)
) {
let h = i.items.value[i.activeItemIndex.value];
(f = fe(h.dataRef.domRef)) == null || f.click();
}
i.closeMenu(), Xg(fe(i.buttonRef));
break;
case Ie.ArrowDown:
return (
c.preventDefault(),
c.stopPropagation(),
i.goToItem(Ze.Next)
);
case Ie.ArrowUp:
return (
c.preventDefault(),
c.stopPropagation(),
i.goToItem(Ze.Previous)
);
case Ie.Home:
case Ie.PageUp:
return (
c.preventDefault(),
c.stopPropagation(),
i.goToItem(Ze.First)
);
case Ie.End:
case Ie.PageDown:
return (
c.preventDefault(),
c.stopPropagation(),
i.goToItem(Ze.Last)
);
case Ie.Escape:
c.preventDefault(),
c.stopPropagation(),
i.closeMenu(),
Ct(() => {
var h;
return (h = fe(i.buttonRef)) == null
? void 0
: h.focus({ preventScroll: !0 });
});
break;
case Ie.Tab:
c.preventDefault(),
c.stopPropagation(),
i.closeMenu(),
Ct(() =>
Cw(
fe(i.buttonRef),
c.shiftKey ? Qt.Previous : Qt.Next
)
);
break;
default:
c.key.length === 1 &&
(i.search(c.key),
(o.value = setTimeout(() => i.clearSearch(), 350)));
break;
}
}
function l(c) {
switch (c.key) {
case Ie.Space:
c.preventDefault();
break;
}
}
let a = ms(),
u = $(() =>
a !== null
? (a.value & gt.Open) === gt.Open
: i.menuState.value === 0
);
return () => {
var c, f;
let h = { open: i.menuState.value === 0 },
b = t,
{ id: p } = b,
g = Qe(b, ["id"]),
v = {
"aria-activedescendant":
i.activeItemIndex.value === null ||
(c = i.items.value[i.activeItemIndex.value]) == null
? void 0
: c.id,
"aria-labelledby":
(f = fe(i.buttonRef)) == null ? void 0 : f.id,
id: p,
onKeydown: s,
onKeyup: l,
role: "menu",
tabIndex: 0,
ref: i.itemsRef,
};
return tt({
ourProps: v,
theirProps: g,
slot: h,
attrs: e,
slots: n,
features: Gn.RenderStrategy | Gn.Static,
visible: u.value,
name: "MenuItems",
});
};
},
}),
mx = xe({
name: "MenuItem",
inheritAttrs: !1,
props: {
as: { type: [Object, String], default: "template" },
disabled: { type: Boolean, default: !1 },
id: { type: String, default: () => `headlessui-menu-item-${At()}` },
},
setup(t, { slots: e, attrs: n, expose: r }) {
let i = La("MenuItem"),
o = oe(null);
r({ el: o, $el: o });
let s = $(() =>
i.activeItemIndex.value !== null
? i.items.value[i.activeItemIndex.value].id === t.id
: !1
),
l = ax(o),
a = $(() => ({
disabled: t.disabled,
get textValue() {
return l();
},
domRef: o,
}));
Ye(() => i.registerItem(t.id, a)),
Bt(() => i.unregisterItem(t.id)),
Mt(() => {
i.menuState.value === 0 &&
s.value &&
i.activationTrigger.value !== 0 &&
Ct(() => {
var v, b;
return (b =
(v = fe(o)) == null
? void 0
: v.scrollIntoView) == null
? void 0
: b.call(v, { block: "nearest" });
});
});
function u(v) {
if (t.disabled) return v.preventDefault();
i.closeMenu(), Xg(fe(i.buttonRef));
}
function c() {
if (t.disabled) return i.goToItem(Ze.Nothing);
i.goToItem(Ze.Specific, t.id);
}
let f = r1();
function h(v) {
f.update(v);
}
function p(v) {
f.wasMoved(v) &&
(t.disabled || s.value || i.goToItem(Ze.Specific, t.id, 0));
}
function g(v) {
f.wasMoved(v) &&
(t.disabled || (s.value && i.goToItem(Ze.Nothing)));
}
return () => {
let { disabled: v } = t,
b = { active: s.value, disabled: v, close: i.closeMenu },
T = t,
{ id: x } = T,
S = Qe(T, ["id"]);
return tt({
ourProps: {
id: x,
ref: o,
role: "menuitem",
tabIndex: v === !0 ? void 0 : -1,
"aria-disabled": v === !0 ? !0 : void 0,
disabled: void 0,
onClick: u,
onFocus: c,
onPointerenter: h,
onMouseenter: h,
onPointermove: p,
onMousemove: p,
onPointerleave: g,
onMouseleave: g,
},
theirProps: W(W({}, n), S),
slot: b,
attrs: n,
slots: e,
name: "MenuItem",
});
};
},
}),
g1 = Symbol("LabelContext");
function y1() {
let t = qe(g1, null);
if (t === null) {
let e = new Error(
"You used a <Label /> component, but it is not inside a parent."
);
throw (Error.captureStackTrace && Error.captureStackTrace(e, y1), e);
}
return t;
}
function Id({ slot: t = {}, name: e = "Label", props: n = {} } = {}) {
let r = oe([]);
function i(o) {
return (
r.value.push(o),
() => {
let s = r.value.indexOf(o);
s !== -1 && r.value.splice(s, 1);
}
);
}
return (
kt(g1, { register: i, slot: t, name: e, props: n }),
$(() => (r.value.length > 0 ? r.value.join(" ") : void 0))
);
}
let gx = xe({
name: "Label",
props: {
as: { type: [Object, String], default: "label" },
passive: { type: [Boolean], default: !1 },
id: { type: String, default: () => `headlessui-label-${At()}` },
},
setup(t, { slots: e, attrs: n }) {
let r = y1();
return (
Ye(() => Bt(r.register(t.id))),
() => {
let { name: i = "Label", slot: o = {}, props: s = {} } = r,
f = t,
{ id: l, passive: a } = f,
u = Qe(f, ["id", "passive"]),
c = be(
W(
{},
Object.entries(s).reduce(
(h, [p, g]) => Object.assign(h, { [p]: ne(g) }),
{}
)
),
{ id: l }
);
return (
a && (delete c.onClick, delete c.htmlFor, delete u.onClick),
tt({
ourProps: c,
theirProps: u,
slot: o,
attrs: n,
slots: e,
name: i,
})
);
}
);
},
});
function yx(t, e) {
return t === e;
}
let v1 = Symbol("RadioGroupContext");
function b1(t) {
let e = qe(v1, null);
if (e === null) {
let n = new Error(
`<${t} /> is missing a parent <RadioGroup /> component.`
);
throw (Error.captureStackTrace && Error.captureStackTrace(n, b1), n);
}
return e;
}
let hR = xe({
name: "RadioGroup",
emits: { "update:modelValue": (t) => !0 },
props: {
as: { type: [Object, String], default: "div" },
disabled: { type: [Boolean], default: !1 },
by: { type: [String, Function], default: () => yx },
modelValue: {
type: [Object, String, Number, Boolean],
default: void 0,
},
defaultValue: {
type: [Object, String, Number, Boolean],
default: void 0,
},
form: { type: String, optional: !0 },
name: { type: String, optional: !0 },
id: { type: String, default: () => `headlessui-radiogroup-${At()}` },
},
inheritAttrs: !1,
setup(t, { emit: e, attrs: n, slots: r, expose: i }) {
let o = oe(null),
s = oe([]),
l = Id({ name: "RadioGroupLabel" }),
a = ja({ name: "RadioGroupDescription" });
i({ el: o, $el: o });
let [u, c] = Ld(
$(() => t.modelValue),
(g) => e("update:modelValue", g),
$(() => t.defaultValue)
),
f = {
options: s,
value: u,
disabled: $(() => t.disabled),
firstOption: $(() => s.value.find((g) => !g.propsRef.disabled)),
containsCheckedOption: $(() =>
s.value.some((g) =>
f.compare(de(g.propsRef.value), de(t.modelValue))
)
),
compare(g, v) {
if (typeof t.by == "string") {
let b = t.by;
return (
(g == null ? void 0 : g[b]) ===
(v == null ? void 0 : v[b])
);
}
return t.by(g, v);
},
change(g) {
var v;
if (t.disabled || f.compare(de(u.value), de(g))) return !1;
let b =
(v = s.value.find((x) =>
f.compare(de(x.propsRef.value), de(g))
)) == null
? void 0
: v.propsRef;
return b != null && b.disabled ? !1 : (c(g), !0);
},
registerOption(g) {
s.value.push(g), (s.value = Na(s.value, (v) => v.element));
},
unregisterOption(g) {
let v = s.value.findIndex((b) => b.id === g);
v !== -1 && s.value.splice(v, 1);
},
};
kt(v1, f),
Od({
container: $(() => fe(o)),
accept(g) {
return g.getAttribute("role") === "radio"
? NodeFilter.FILTER_REJECT
: g.hasAttribute("role")
? NodeFilter.FILTER_SKIP
: NodeFilter.FILTER_ACCEPT;
},
walk(g) {
g.setAttribute("role", "none");
},
});
function h(g) {
if (!o.value || !o.value.contains(g.target)) return;
let v = s.value
.filter((b) => b.propsRef.disabled === !1)
.map((b) => b.element);
switch (g.key) {
case Ie.Enter:
n1(g.currentTarget);
break;
case Ie.ArrowLeft:
case Ie.ArrowUp:
if (
(g.preventDefault(),
g.stopPropagation(),
li(v, Qt.Previous | Qt.WrapAround) === Sl.Success)
) {
let b = s.value.find((x) => {
var S;
return (
x.element ===
((S = vn(o)) == null ? void 0 : S.activeElement)
);
});
b && f.change(b.propsRef.value);
}
break;
case Ie.ArrowRight:
case Ie.ArrowDown:
if (
(g.preventDefault(),
g.stopPropagation(),
li(v, Qt.Next | Qt.WrapAround) === Sl.Success)
) {
let b = s.value.find((x) => {
var S;
return (
x.element ===
((S = vn(x.element)) == null
? void 0
: S.activeElement)
);
});
b && f.change(b.propsRef.value);
}
break;
case Ie.Space:
{
g.preventDefault(), g.stopPropagation();
let b = s.value.find((x) => {
var S;
return (
x.element ===
((S = vn(x.element)) == null
? void 0
: S.activeElement)
);
});
b && f.change(b.propsRef.value);
}
break;
}
}
let p = $(() => {
var g;
return (g = fe(o)) == null ? void 0 : g.closest("form");
});
return (
Ye(() => {
Rt(
[p],
() => {
if (!p.value || t.defaultValue === void 0) return;
function g() {
f.change(t.defaultValue);
}
return (
p.value.addEventListener("reset", g),
() => {
var v;
(v = p.value) == null ||
v.removeEventListener("reset", g);
}
);
},
{ immediate: !0 }
);
}),
() => {
let d = t,
{ disabled: g, name: v, id: b, form: x } = d,
S = Qe(d, ["disabled", "name", "id", "form"]),
T = {
ref: o,
id: b,
role: "radiogroup",
"aria-labelledby": l.value,
"aria-describedby": a.value,
onKeydown: h,
};
return ze(He, [
...(v != null && u.value != null
? jd({ [v]: u.value }).map(([y, m]) =>
ze(
Gi,
Ed({
features: gi.Hidden,
key: y,
as: "input",
type: "hidden",
hidden: !0,
readOnly: !0,
form: x,
name: y,
value: m,
})
)
)
: []),
tt({
ourProps: T,
theirProps: W(
W({}, n),
so(S, ["modelValue", "defaultValue", "by"])
),
slot: {},
attrs: n,
slots: r,
name: "RadioGroup",
}),
]);
}
);
},
});
var vx = ((t) => (
(t[(t.Empty = 1)] = "Empty"), (t[(t.Active = 2)] = "Active"), t
))(vx || {});
let pR = xe({
name: "RadioGroupOption",
props: {
as: { type: [Object, String], default: "div" },
value: { type: [Object, String, Number, Boolean] },
disabled: { type: Boolean, default: !1 },
id: {
type: String,
default: () => `headlessui-radiogroup-option-${At()}`,
},
},
setup(t, { attrs: e, slots: n, expose: r }) {
let i = b1("RadioGroupOption"),
o = Id({ name: "RadioGroupLabel" }),
s = ja({ name: "RadioGroupDescription" }),
l = oe(null),
a = $(() => ({ value: t.value, disabled: t.disabled })),
u = oe(1);
r({ el: l, $el: l });
let c = $(() => fe(l));
Ye(() => i.registerOption({ id: t.id, element: c, propsRef: a })),
Bt(() => i.unregisterOption(t.id));
let f = $(() => {
var S;
return (
((S = i.firstOption.value) == null ? void 0 : S.id) === t.id
);
}),
h = $(() => i.disabled.value || t.disabled),
p = $(() => i.compare(de(i.value.value), de(t.value))),
g = $(() =>
h.value
? -1
: p.value || (!i.containsCheckedOption.value && f.value)
? 0
: -1
);
function v() {
var S;
i.change(t.value) &&
((u.value |= 2), (S = fe(l)) == null || S.focus());
}
function b() {
u.value |= 2;
}
function x() {
u.value &= -3;
}
return () => {
let k = t,
{ id: S, value: T, disabled: d } = k,
y = Qe(k, ["id", "value", "disabled"]),
m = {
checked: p.value,
disabled: h.value,
active: Boolean(u.value & 2),
},
w = {
id: S,
ref: l,
role: "radio",
"aria-checked": p.value ? "true" : "false",
"aria-labelledby": o.value,
"aria-describedby": s.value,
"aria-disabled": h.value ? !0 : void 0,
tabIndex: g.value,
onClick: h.value ? void 0 : v,
onFocus: h.value ? void 0 : b,
onBlur: h.value ? void 0 : x,
};
return tt({
ourProps: w,
theirProps: y,
slot: m,
attrs: e,
slots: n,
name: "RadioGroupOption",
});
};
},
});
let w1 = Symbol("GroupContext"),
bx = xe({
name: "SwitchGroup",
props: { as: { type: [Object, String], default: "template" } },
setup(t, { slots: e, attrs: n }) {
let r = oe(null),
i = Id({
name: "SwitchLabel",
props: {
htmlFor: $(() => {
var s;
return (s = r.value) == null ? void 0 : s.id;
}),
onClick(s) {
r.value &&
(s.currentTarget.tagName === "LABEL" &&
s.preventDefault(),
r.value.click(),
r.value.focus({ preventScroll: !0 }));
},
},
}),
o = ja({ name: "SwitchDescription" });
return (
kt(w1, { switchRef: r, labelledby: i, describedby: o }),
() =>
tt({
theirProps: t,
ourProps: {},
slot: {},
slots: e,
attrs: n,
name: "SwitchGroup",
})
);
},
}),
wx = xe({
name: "Switch",
emits: { "update:modelValue": (t) => !0 },
props: {
as: { type: [Object, String], default: "button" },
modelValue: { type: Boolean, default: void 0 },
defaultChecked: { type: Boolean, optional: !0 },
form: { type: String, optional: !0 },
name: { type: String, optional: !0 },
value: { type: String, optional: !0 },
id: { type: String, default: () => `headlessui-switch-${At()}` },
},
inheritAttrs: !1,
setup(t, { emit: e, attrs: n, slots: r, expose: i }) {
let o = qe(w1, null),
[s, l] = Ld(
$(() => t.modelValue),
(b) => e("update:modelValue", b),
$(() => t.defaultChecked)
);
function a() {
l(!s.value);
}
let u = oe(null),
c = o === null ? u : o.switchRef,
f = Td(
$(() => ({ as: t.as, type: n.type })),
c
);
i({ el: c, $el: c });
function h(b) {
b.preventDefault(), a();
}
function p(b) {
b.key === Ie.Space
? (b.preventDefault(), a())
: b.key === Ie.Enter && n1(b.currentTarget);
}
function g(b) {
b.preventDefault();
}
let v = $(() => {
var b, x;
return (x = (b = fe(c)) == null ? void 0 : b.closest) == null
? void 0
: x.call(b, "form");
});
return (
Ye(() => {
Rt(
[v],
() => {
if (!v.value || t.defaultChecked === void 0) return;
function b() {
l(t.defaultChecked);
}
return (
v.value.addEventListener("reset", b),
() => {
var x;
(x = v.value) == null ||
x.removeEventListener("reset", b);
}
);
},
{ immediate: !0 }
);
}),
() => {
let w = t,
{ id: b, name: x, value: S, form: T } = w,
d = Qe(w, ["id", "name", "value", "form"]),
y = { checked: s.value },
m = {
id: b,
ref: c,
role: "switch",
type: f.value,
tabIndex: 0,
"aria-checked": s.value,
"aria-labelledby":
o == null ? void 0 : o.labelledby.value,
"aria-describedby":
o == null ? void 0 : o.describedby.value,
onClick: h,
onKeyup: p,
onKeypress: g,
};
return ze(He, [
x != null && s.value != null
? ze(
Gi,
Ed({
features: gi.Hidden,
as: "input",
type: "checkbox",
hidden: !0,
readOnly: !0,
checked: s.value,
form: T,
name: x,
value: S,
})
)
: null,
tt({
ourProps: m,
theirProps: W(
W({}, n),
so(d, ["modelValue", "defaultChecked"])
),
slot: y,
attrs: n,
slots: r,
name: "Switch",
}),
]);
}
);
},
}),
xx = gx,
kx = Jw;
function Cx(t) {
let e = { called: !1 };
return (...n) => {
if (!e.called) return (e.called = !0), t(...n);
};
}
function gu(t, ...e) {
t && e.length > 0 && t.classList.add(...e);
}
function $s(t, ...e) {
t && e.length > 0 && t.classList.remove(...e);
}
var wc = ((t) => ((t.Finished = "finished"), (t.Cancelled = "cancelled"), t))(
wc || {}
);
function Sx(t, e) {
let n = lo();
if (!t) return n.dispose;
let { transitionDuration: r, transitionDelay: i } = getComputedStyle(t),
[o, s] = [r, i].map((l) => {
let [a = 0] = l
.split(",")
.filter(Boolean)
.map((u) =>
u.includes("ms") ? parseFloat(u) : parseFloat(u) * 1e3
)
.sort((u, c) => c - u);
return a;
});
return (
o !== 0 ? n.setTimeout(() => e("finished"), o + s) : e("finished"),
n.add(() => e("cancelled")),
n.dispose
);
}
function Yh(t, e, n, r, i, o) {
let s = lo(),
l = o !== void 0 ? Cx(o) : () => {};
return (
$s(t, ...i),
gu(t, ...e, ...n),
s.nextFrame(() => {
$s(t, ...n),
gu(t, ...r),
s.add(Sx(t, (a) => ($s(t, ...r, ...e), gu(t, ...i), l(a))));
}),
s.add(() => $s(t, ...e, ...n, ...r, ...i)),
s.add(() => l("cancelled")),
s.dispose
);
}
function Jr(t = "") {
return t.split(" ").filter((e) => e.trim().length > 1);
}
let Bd = Symbol("TransitionContext");
var _x = ((t) => ((t.Visible = "visible"), (t.Hidden = "hidden"), t))(_x || {});
function Mx() {
return qe(Bd, null) !== null;
}
function Ex() {
let t = qe(Bd, null);
if (t === null)
throw new Error(
"A <TransitionChild /> is used but it is missing a parent <TransitionRoot />."
);
return t;
}
function Ax() {
let t = qe($d, null);
if (t === null)
throw new Error(
"A <TransitionChild /> is used but it is missing a parent <TransitionRoot />."
);
return t;
}
let $d = Symbol("NestingContext");
function Da(t) {
return "children" in t
? Da(t.children)
: t.value.filter(({ state: e }) => e === "visible").length > 0;
}
function x1(t) {
let e = oe([]),
n = oe(!1);
Ye(() => (n.value = !0)), Bt(() => (n.value = !1));
function r(o, s = _r.Hidden) {
let l = e.value.findIndex(({ id: a }) => a === o);
l !== -1 &&
(vt(s, {
[_r.Unmount]() {
e.value.splice(l, 1);
},
[_r.Hidden]() {
e.value[l].state = "hidden";
},
}),
!Da(e) && n.value && (t == null || t()));
}
function i(o) {
let s = e.value.find(({ id: l }) => l === o);
return (
s
? s.state !== "visible" && (s.state = "visible")
: e.value.push({ id: o, state: "visible" }),
() => r(o, _r.Unmount)
);
}
return { children: e, register: i, unregister: r };
}
let k1 = Gn.RenderStrategy,
C1 = xe({
props: {
as: { type: [Object, String], default: "div" },
show: { type: [Boolean], default: null },
unmount: { type: [Boolean], default: !0 },
appear: { type: [Boolean], default: !1 },
enter: { type: [String], default: "" },
enterFrom: { type: [String], default: "" },
enterTo: { type: [String], default: "" },
entered: { type: [String], default: "" },
leave: { type: [String], default: "" },
leaveFrom: { type: [String], default: "" },
leaveTo: { type: [String], default: "" },
},
emits: {
beforeEnter: () => !0,
afterEnter: () => !0,
beforeLeave: () => !0,
afterLeave: () => !0,
},
setup(t, { emit: e, attrs: n, slots: r, expose: i }) {
let o = oe(0);
function s() {
(o.value |= gt.Opening), e("beforeEnter");
}
function l() {
(o.value &= ~gt.Opening), e("afterEnter");
}
function a() {
(o.value |= gt.Closing), e("beforeLeave");
}
function u() {
(o.value &= ~gt.Closing), e("afterLeave");
}
if (!Mx() && mw())
return () =>
ze(
S1,
be(W({}, t), {
onBeforeEnter: s,
onAfterEnter: l,
onBeforeLeave: a,
onAfterLeave: u,
}),
r
);
let c = oe(null),
f = $(() => (t.unmount ? _r.Unmount : _r.Hidden));
i({ el: c, $el: c });
let { show: h, appear: p } = Ex(),
{ register: g, unregister: v } = Ax(),
b = oe(h.value ? "visible" : "hidden"),
x = { value: !0 },
S = At(),
T = { value: !1 },
d = x1(() => {
!T.value &&
b.value !== "hidden" &&
((b.value = "hidden"), v(S), u());
});
Ye(() => {
let P = g(S);
Bt(P);
}),
Mt(() => {
if (f.value === _r.Hidden && S) {
if (h.value && b.value !== "visible") {
b.value = "visible";
return;
}
vt(b.value, {
hidden: () => v(S),
visible: () => g(S),
});
}
});
let y = Jr(t.enter),
m = Jr(t.enterFrom),
w = Jr(t.enterTo),
k = Jr(t.entered),
_ = Jr(t.leave),
C = Jr(t.leaveFrom),
E = Jr(t.leaveTo);
Ye(() => {
Mt(() => {
if (b.value === "visible") {
let P = fe(c);
if (P instanceof Comment && P.data === "")
throw new Error(
"Did you forget to passthrough the `ref` to the actual DOM node?"
);
}
});
});
function R(P) {
let L = x.value && !p.value,
I = fe(c);
!I ||
!(I instanceof HTMLElement) ||
L ||
((T.value = !0),
h.value && s(),
h.value || a(),
P(
h.value
? Yh(I, y, m, w, k, (M) => {
(T.value = !1), M === wc.Finished && l();
})
: Yh(I, _, C, E, k, (M) => {
(T.value = !1),
M === wc.Finished &&
(Da(d) ||
((b.value = "hidden"),
v(S),
u()));
})
));
}
return (
Ye(() => {
Rt(
[h],
(P, L, I) => {
R(I), (x.value = !1);
},
{ immediate: !0 }
);
}),
kt($d, d),
Ad(
$(
() =>
vt(b.value, {
visible: gt.Open,
hidden: gt.Closed,
}) | o.value
)
),
() => {
let Re = t,
{
appear: P,
show: L,
enter: I,
enterFrom: M,
enterTo: N,
entered: D,
leave: K,
leaveFrom: ae,
leaveTo: Q,
} = Re,
me = Qe(Re, [
"appear",
"show",
"enter",
"enterFrom",
"enterTo",
"entered",
"leave",
"leaveFrom",
"leaveTo",
]),
je = { ref: c },
Le = W(
W({}, me),
p.value && h.value && gs.isServer
? { class: ye([n.class, me.class, ...y, ...m]) }
: {}
);
return tt({
theirProps: Le,
ourProps: je,
slot: {},
slots: r,
attrs: n,
features: k1,
visible: b.value === "visible",
name: "TransitionChild",
});
}
);
},
}),
Tx = C1,
S1 = xe({
inheritAttrs: !1,
props: {
as: { type: [Object, String], default: "div" },
show: { type: [Boolean], default: null },
unmount: { type: [Boolean], default: !0 },
appear: { type: [Boolean], default: !1 },
enter: { type: [String], default: "" },
enterFrom: { type: [String], default: "" },
enterTo: { type: [String], default: "" },
entered: { type: [String], default: "" },
leave: { type: [String], default: "" },
leaveFrom: { type: [String], default: "" },
leaveTo: { type: [String], default: "" },
},
emits: {
beforeEnter: () => !0,
afterEnter: () => !0,
beforeLeave: () => !0,
afterLeave: () => !0,
},
setup(t, { emit: e, attrs: n, slots: r }) {
let i = ms(),
o = $(() =>
t.show === null && i !== null
? (i.value & gt.Open) === gt.Open
: t.show
);
Mt(() => {
if (![!0, !1].includes(o.value))
throw new Error(
'A <Transition /> is used but it is missing a `:show="true | false"` prop.'
);
});
let s = oe(o.value ? "visible" : "hidden"),
l = x1(() => {
s.value = "hidden";
}),
a = oe(!0),
u = { show: o, appear: $(() => t.appear || !a.value) };
return (
Ye(() => {
Mt(() => {
(a.value = !1),
o.value
? (s.value = "visible")
: Da(l) || (s.value = "hidden");
});
}),
kt($d, l),
kt(Bd, u),
() => {
let c = so(t, [
"show",
"appear",
"unmount",
"onBeforeEnter",
"onBeforeLeave",
"onAfterEnter",
"onAfterLeave",
]),
f = { unmount: t.unmount };
return tt({
ourProps: be(W({}, f), { as: "template" }),
theirProps: {},
slot: {},
slots: be(W({}, r), {
default: () => [
ze(
Tx,
W(
W(
W(
{
onBeforeEnter: () =>
e("beforeEnter"),
onAfterEnter: () =>
e("afterEnter"),
onBeforeLeave: () =>
e("beforeLeave"),
onAfterLeave: () =>
e("afterLeave"),
},
n
),
f
),
c
),
r.default
),
],
}),
attrs: {},
features: k1,
visible: s.value === "visible",
name: "Transition",
});
}
);
},
});
var Zt = "top",
xn = "bottom",
kn = "right",
en = "left",
zd = "auto",
vs = [Zt, xn, kn, en],
Yi = "start",
Qo = "end",
Ox = "clippingParents",
_1 = "viewport",
xo = "popper",
Rx = "reference",
Qh = vs.reduce(function (t, e) {
return t.concat([e + "-" + Yi, e + "-" + Qo]);
}, []),
M1 = [].concat(vs, [zd]).reduce(function (t, e) {
return t.concat([e, e + "-" + Yi, e + "-" + Qo]);
}, []),
Px = "beforeRead",
Nx = "read",
jx = "afterRead",
Lx = "beforeMain",
Dx = "main",
Ix = "afterMain",
Bx = "beforeWrite",
$x = "write",
zx = "afterWrite",
Hx = [Px, Nx, jx, Lx, Dx, Ix, Bx, $x, zx];
function Yn(t) {
return t ? (t.nodeName || "").toLowerCase() : null;
}
function ln(t) {
if (t == null) return window;
if (t.toString() !== "[object Window]") {
var e = t.ownerDocument;
return (e && e.defaultView) || window;
}
return t;
}
function yi(t) {
var e = ln(t).Element;
return t instanceof e || t instanceof Element;
}
function bn(t) {
var e = ln(t).HTMLElement;
return t instanceof e || t instanceof HTMLElement;
}
function Hd(t) {
if (typeof ShadowRoot == "undefined") return !1;
var e = ln(t).ShadowRoot;
return t instanceof e || t instanceof ShadowRoot;
}
function Fx(t) {
var e = t.state;
Object.keys(e.elements).forEach(function (n) {
var r = e.styles[n] || {},
i = e.attributes[n] || {},
o = e.elements[n];
!bn(o) ||
!Yn(o) ||
(Object.assign(o.style, r),
Object.keys(i).forEach(function (s) {
var l = i[s];
l === !1
? o.removeAttribute(s)
: o.setAttribute(s, l === !0 ? "" : l);
}));
});
}
function Vx(t) {
var e = t.state,
n = {
popper: {
position: e.options.strategy,
left: "0",
top: "0",
margin: "0",
},
arrow: { position: "absolute" },
reference: {},
};
return (
Object.assign(e.elements.popper.style, n.popper),
(e.styles = n),
e.elements.arrow && Object.assign(e.elements.arrow.style, n.arrow),
function () {
Object.keys(e.elements).forEach(function (r) {
var i = e.elements[r],
o = e.attributes[r] || {},
s = Object.keys(
e.styles.hasOwnProperty(r) ? e.styles[r] : n[r]
),
l = s.reduce(function (a, u) {
return (a[u] = ""), a;
}, {});
!bn(i) ||
!Yn(i) ||
(Object.assign(i.style, l),
Object.keys(o).forEach(function (a) {
i.removeAttribute(a);
}));
});
}
);
}
const E1 = {
name: "applyStyles",
enabled: !0,
phase: "write",
fn: Fx,
effect: Vx,
requires: ["computeStyles"],
};
function Kn(t) {
return t.split("-")[0];
}
var ai = Math.max,
_l = Math.min,
Qi = Math.round;
function xc() {
var t = navigator.userAgentData;
return t != null && t.brands && Array.isArray(t.brands)
? t.brands
.map(function (e) {
return e.brand + "/" + e.version;
})
.join(" ")
: navigator.userAgent;
}
function A1() {
return !/^((?!chrome|android).)*safari/i.test(xc());
}
function Xi(t, e, n) {
e === void 0 && (e = !1), n === void 0 && (n = !1);
var r = t.getBoundingClientRect(),
i = 1,
o = 1;
e &&
bn(t) &&
((i = (t.offsetWidth > 0 && Qi(r.width) / t.offsetWidth) || 1),
(o = (t.offsetHeight > 0 && Qi(r.height) / t.offsetHeight) || 1));
var s = yi(t) ? ln(t) : window,
l = s.visualViewport,
a = !A1() && n,
u = (r.left + (a && l ? l.offsetLeft : 0)) / i,
c = (r.top + (a && l ? l.offsetTop : 0)) / o,
f = r.width / i,
h = r.height / o;
return {
width: f,
height: h,
top: c,
right: u + f,
bottom: c + h,
left: u,
x: u,
y: c,
};
}
function Fd(t) {
var e = Xi(t),
n = t.offsetWidth,
r = t.offsetHeight;
return (
Math.abs(e.width - n) <= 1 && (n = e.width),
Math.abs(e.height - r) <= 1 && (r = e.height),
{ x: t.offsetLeft, y: t.offsetTop, width: n, height: r }
);
}
function T1(t, e) {
var n = e.getRootNode && e.getRootNode();
if (t.contains(e)) return !0;
if (n && Hd(n)) {
var r = e;
do {
if (r && t.isSameNode(r)) return !0;
r = r.parentNode || r.host;
} while (r);
}
return !1;
}
function lr(t) {
return ln(t).getComputedStyle(t);
}
function Wx(t) {
return ["table", "td", "th"].indexOf(Yn(t)) >= 0;
}
function Br(t) {
return ((yi(t) ? t.ownerDocument : t.document) || window.document)
.documentElement;
}
function Ia(t) {
return Yn(t) === "html"
? t
: t.assignedSlot || t.parentNode || (Hd(t) ? t.host : null) || Br(t);
}
function Xh(t) {
return !bn(t) || lr(t).position === "fixed" ? null : t.offsetParent;
}
function Ux(t) {
var e = /firefox/i.test(xc()),
n = /Trident/i.test(xc());
if (n && bn(t)) {
var r = lr(t);
if (r.position === "fixed") return null;
}
var i = Ia(t);
for (
Hd(i) && (i = i.host);
bn(i) && ["html", "body"].indexOf(Yn(i)) < 0;
) {
var o = lr(i);
if (
o.transform !== "none" ||
o.perspective !== "none" ||
o.contain === "paint" ||
["transform", "perspective"].indexOf(o.willChange) !== -1 ||
(e && o.willChange === "filter") ||
(e && o.filter && o.filter !== "none")
)
return i;
i = i.parentNode;
}
return null;
}
function bs(t) {
for (var e = ln(t), n = Xh(t); n && Wx(n) && lr(n).position === "static"; )
n = Xh(n);
return n &&
(Yn(n) === "html" || (Yn(n) === "body" && lr(n).position === "static"))
? e
: n || Ux(t) || e;
}
function Vd(t) {
return ["top", "bottom"].indexOf(t) >= 0 ? "x" : "y";
}
function Lo(t, e, n) {
return ai(t, _l(e, n));
}
function Kx(t, e, n) {
var r = Lo(t, e, n);
return r > n ? n : r;
}
function O1() {
return { top: 0, right: 0, bottom: 0, left: 0 };
}
function R1(t) {
return Object.assign({}, O1(), t);
}
function P1(t, e) {
return e.reduce(function (n, r) {
return (n[r] = t), n;
}, {});
}
var qx = function (e, n) {
return (
(e =
typeof e == "function"
? e(Object.assign({}, n.rects, { placement: n.placement }))
: e),
R1(typeof e != "number" ? e : P1(e, vs))
);
};
function Jx(t) {
var e,
n = t.state,
r = t.name,
i = t.options,
o = n.elements.arrow,
s = n.modifiersData.popperOffsets,
l = Kn(n.placement),
a = Vd(l),
u = [en, kn].indexOf(l) >= 0,
c = u ? "height" : "width";
if (!(!o || !s)) {
var f = qx(i.padding, n),
h = Fd(o),
p = a === "y" ? Zt : en,
g = a === "y" ? xn : kn,
v =
n.rects.reference[c] +
n.rects.reference[a] -
s[a] -
n.rects.popper[c],
b = s[a] - n.rects.reference[a],
x = bs(o),
S = x ? (a === "y" ? x.clientHeight || 0 : x.clientWidth || 0) : 0,
T = v / 2 - b / 2,
d = f[p],
y = S - h[c] - f[g],
m = S / 2 - h[c] / 2 + T,
w = Lo(d, m, y),
k = a;
n.modifiersData[r] =
((e = {}), (e[k] = w), (e.centerOffset = w - m), e);
}
}
function Gx(t) {
var e = t.state,
n = t.options,
r = n.element,
i = r === void 0 ? "[data-popper-arrow]" : r;
i != null &&
((typeof i == "string" &&
((i = e.elements.popper.querySelector(i)), !i)) ||
!T1(e.elements.popper, i) ||
(e.elements.arrow = i));
}
const Yx = {
name: "arrow",
enabled: !0,
phase: "main",
fn: Jx,
effect: Gx,
requires: ["popperOffsets"],
requiresIfExists: ["preventOverflow"],
};
function Zi(t) {
return t.split("-")[1];
}
var Qx = { top: "auto", right: "auto", bottom: "auto", left: "auto" };
function Xx(t, e) {
var n = t.x,
r = t.y,
i = e.devicePixelRatio || 1;
return { x: Qi(n * i) / i || 0, y: Qi(r * i) / i || 0 };
}
function Zh(t) {
var e,
n = t.popper,
r = t.popperRect,
i = t.placement,
o = t.variation,
s = t.offsets,
l = t.position,
a = t.gpuAcceleration,
u = t.adaptive,
c = t.roundOffsets,
f = t.isFixed,
h = s.x,
p = h === void 0 ? 0 : h,
g = s.y,
v = g === void 0 ? 0 : g,
b = typeof c == "function" ? c({ x: p, y: v }) : { x: p, y: v };
(p = b.x), (v = b.y);
var x = s.hasOwnProperty("x"),
S = s.hasOwnProperty("y"),
T = en,
d = Zt,
y = window;
if (u) {
var m = bs(n),
w = "clientHeight",
k = "clientWidth";
if (
(m === ln(n) &&
((m = Br(n)),
lr(m).position !== "static" &&
l === "absolute" &&
((w = "scrollHeight"), (k = "scrollWidth"))),
(m = m),
i === Zt || ((i === en || i === kn) && o === Qo))
) {
d = xn;
var _ =
f && m === y && y.visualViewport
? y.visualViewport.height
: m[w];
(v -= _ - r.height), (v *= a ? 1 : -1);
}
if (i === en || ((i === Zt || i === xn) && o === Qo)) {
T = kn;
var C =
f && m === y && y.visualViewport
? y.visualViewport.width
: m[k];
(p -= C - r.width), (p *= a ? 1 : -1);
}
}
var E = Object.assign({ position: l }, u && Qx),
R = c === !0 ? Xx({ x: p, y: v }, ln(n)) : { x: p, y: v };
if (((p = R.x), (v = R.y), a)) {
var P;
return Object.assign(
{},
E,
((P = {}),
(P[d] = S ? "0" : ""),
(P[T] = x ? "0" : ""),
(P.transform =
(y.devicePixelRatio || 1) <= 1
? "translate(" + p + "px, " + v + "px)"
: "translate3d(" + p + "px, " + v + "px, 0)"),
P)
);
}
return Object.assign(
{},
E,
((e = {}),
(e[d] = S ? v + "px" : ""),
(e[T] = x ? p + "px" : ""),
(e.transform = ""),
e)
);
}
function Zx(t) {
var e = t.state,
n = t.options,
r = n.gpuAcceleration,
i = r === void 0 ? !0 : r,
o = n.adaptive,
s = o === void 0 ? !0 : o,
l = n.roundOffsets,
a = l === void 0 ? !0 : l,
u = {
placement: Kn(e.placement),
variation: Zi(e.placement),
popper: e.elements.popper,
popperRect: e.rects.popper,
gpuAcceleration: i,
isFixed: e.options.strategy === "fixed",
};
e.modifiersData.popperOffsets != null &&
(e.styles.popper = Object.assign(
{},
e.styles.popper,
Zh(
Object.assign({}, u, {
offsets: e.modifiersData.popperOffsets,
position: e.options.strategy,
adaptive: s,
roundOffsets: a,
})
)
)),
e.modifiersData.arrow != null &&
(e.styles.arrow = Object.assign(
{},
e.styles.arrow,
Zh(
Object.assign({}, u, {
offsets: e.modifiersData.arrow,
position: "absolute",
adaptive: !1,
roundOffsets: a,
})
)
)),
(e.attributes.popper = Object.assign({}, e.attributes.popper, {
"data-popper-placement": e.placement,
}));
}
const e3 = {
name: "computeStyles",
enabled: !0,
phase: "beforeWrite",
fn: Zx,
data: {},
};
var zs = { passive: !0 };
function t3(t) {
var e = t.state,
n = t.instance,
r = t.options,
i = r.scroll,
o = i === void 0 ? !0 : i,
s = r.resize,
l = s === void 0 ? !0 : s,
a = ln(e.elements.popper),
u = [].concat(e.scrollParents.reference, e.scrollParents.popper);
return (
o &&
u.forEach(function (c) {
c.addEventListener("scroll", n.update, zs);
}),
l && a.addEventListener("resize", n.update, zs),
function () {
o &&
u.forEach(function (c) {
c.removeEventListener("scroll", n.update, zs);
}),
l && a.removeEventListener("resize", n.update, zs);
}
);
}
const n3 = {
name: "eventListeners",
enabled: !0,
phase: "write",
fn: function () {},
effect: t3,
data: {},
};
var r3 = { left: "right", right: "left", bottom: "top", top: "bottom" };
function sl(t) {
return t.replace(/left|right|bottom|top/g, function (e) {
return r3[e];
});
}
var i3 = { start: "end", end: "start" };
function ep(t) {
return t.replace(/start|end/g, function (e) {
return i3[e];
});
}
function Wd(t) {
var e = ln(t),
n = e.pageXOffset,
r = e.pageYOffset;
return { scrollLeft: n, scrollTop: r };
}
function Ud(t) {
return Xi(Br(t)).left + Wd(t).scrollLeft;
}
function o3(t, e) {
var n = ln(t),
r = Br(t),
i = n.visualViewport,
o = r.clientWidth,
s = r.clientHeight,
l = 0,
a = 0;
if (i) {
(o = i.width), (s = i.height);
var u = A1();
(u || (!u && e === "fixed")) && ((l = i.offsetLeft), (a = i.offsetTop));
}
return { width: o, height: s, x: l + Ud(t), y: a };
}
function s3(t) {
var e,
n = Br(t),
r = Wd(t),
i = (e = t.ownerDocument) == null ? void 0 : e.body,
o = ai(
n.scrollWidth,
n.clientWidth,
i ? i.scrollWidth : 0,
i ? i.clientWidth : 0
),
s = ai(
n.scrollHeight,
n.clientHeight,
i ? i.scrollHeight : 0,
i ? i.clientHeight : 0
),
l = -r.scrollLeft + Ud(t),
a = -r.scrollTop;
return (
lr(i || n).direction === "rtl" &&
(l += ai(n.clientWidth, i ? i.clientWidth : 0) - o),
{ width: o, height: s, x: l, y: a }
);
}
function Kd(t) {
var e = lr(t),
n = e.overflow,
r = e.overflowX,
i = e.overflowY;
return /auto|scroll|overlay|hidden/.test(n + i + r);
}
function N1(t) {
return ["html", "body", "#document"].indexOf(Yn(t)) >= 0
? t.ownerDocument.body
: bn(t) && Kd(t)
? t
: N1(Ia(t));
}
function Do(t, e) {
var n;
e === void 0 && (e = []);
var r = N1(t),
i = r === ((n = t.ownerDocument) == null ? void 0 : n.body),
o = ln(r),
s = i ? [o].concat(o.visualViewport || [], Kd(r) ? r : []) : r,
l = e.concat(s);
return i ? l : l.concat(Do(Ia(s)));
}
function kc(t) {
return Object.assign({}, t, {
left: t.x,
top: t.y,
right: t.x + t.width,
bottom: t.y + t.height,
});
}
function l3(t, e) {
var n = Xi(t, !1, e === "fixed");
return (
(n.top = n.top + t.clientTop),
(n.left = n.left + t.clientLeft),
(n.bottom = n.top + t.clientHeight),
(n.right = n.left + t.clientWidth),
(n.width = t.clientWidth),
(n.height = t.clientHeight),
(n.x = n.left),
(n.y = n.top),
n
);
}
function tp(t, e, n) {
return e === _1 ? kc(o3(t, n)) : yi(e) ? l3(e, n) : kc(s3(Br(t)));
}
function a3(t) {
var e = Do(Ia(t)),
n = ["absolute", "fixed"].indexOf(lr(t).position) >= 0,
r = n && bn(t) ? bs(t) : t;
return yi(r)
? e.filter(function (i) {
return yi(i) && T1(i, r) && Yn(i) !== "body";
})
: [];
}
function u3(t, e, n, r) {
var i = e === "clippingParents" ? a3(t) : [].concat(e),
o = [].concat(i, [n]),
s = o[0],
l = o.reduce(function (a, u) {
var c = tp(t, u, r);
return (
(a.top = ai(c.top, a.top)),
(a.right = _l(c.right, a.right)),
(a.bottom = _l(c.bottom, a.bottom)),
(a.left = ai(c.left, a.left)),
a
);
}, tp(t, s, r));
return (
(l.width = l.right - l.left),
(l.height = l.bottom - l.top),
(l.x = l.left),
(l.y = l.top),
l
);
}
function j1(t) {
var e = t.reference,
n = t.element,
r = t.placement,
i = r ? Kn(r) : null,
o = r ? Zi(r) : null,
s = e.x + e.width / 2 - n.width / 2,
l = e.y + e.height / 2 - n.height / 2,
a;
switch (i) {
case Zt:
a = { x: s, y: e.y - n.height };
break;
case xn:
a = { x: s, y: e.y + e.height };
break;
case kn:
a = { x: e.x + e.width, y: l };
break;
case en:
a = { x: e.x - n.width, y: l };
break;
default:
a = { x: e.x, y: e.y };
}
var u = i ? Vd(i) : null;
if (u != null) {
var c = u === "y" ? "height" : "width";
switch (o) {
case Yi:
a[u] = a[u] - (e[c] / 2 - n[c] / 2);
break;
case Qo:
a[u] = a[u] + (e[c] / 2 - n[c] / 2);
break;
}
}
return a;
}
function Xo(t, e) {
e === void 0 && (e = {});
var n = e,
r = n.placement,
i = r === void 0 ? t.placement : r,
o = n.strategy,
s = o === void 0 ? t.strategy : o,
l = n.boundary,
a = l === void 0 ? Ox : l,
u = n.rootBoundary,
c = u === void 0 ? _1 : u,
f = n.elementContext,
h = f === void 0 ? xo : f,
p = n.altBoundary,
g = p === void 0 ? !1 : p,
v = n.padding,
b = v === void 0 ? 0 : v,
x = R1(typeof b != "number" ? b : P1(b, vs)),
S = h === xo ? Rx : xo,
T = t.rects.popper,
d = t.elements[g ? S : h],
y = u3(yi(d) ? d : d.contextElement || Br(t.elements.popper), a, c, s),
m = Xi(t.elements.reference),
w = j1({
reference: m,
element: T,
strategy: "absolute",
placement: i,
}),
k = kc(Object.assign({}, T, w)),
_ = h === xo ? k : m,
C = {
top: y.top - _.top + x.top,
bottom: _.bottom - y.bottom + x.bottom,
left: y.left - _.left + x.left,
right: _.right - y.right + x.right,
},
E = t.modifiersData.offset;
if (h === xo && E) {
var R = E[i];
Object.keys(C).forEach(function (P) {
var L = [kn, xn].indexOf(P) >= 0 ? 1 : -1,
I = [Zt, xn].indexOf(P) >= 0 ? "y" : "x";
C[P] += R[I] * L;
});
}
return C;
}
function c3(t, e) {
e === void 0 && (e = {});
var n = e,
r = n.placement,
i = n.boundary,
o = n.rootBoundary,
s = n.padding,
l = n.flipVariations,
a = n.allowedAutoPlacements,
u = a === void 0 ? M1 : a,
c = Zi(r),
f = c
? l
? Qh
: Qh.filter(function (g) {
return Zi(g) === c;
})
: vs,
h = f.filter(function (g) {
return u.indexOf(g) >= 0;
});
h.length === 0 && (h = f);
var p = h.reduce(function (g, v) {
return (
(g[v] = Xo(t, {
placement: v,
boundary: i,
rootBoundary: o,
padding: s,
})[Kn(v)]),
g
);
}, {});
return Object.keys(p).sort(function (g, v) {
return p[g] - p[v];
});
}
function d3(t) {
if (Kn(t) === zd) return [];
var e = sl(t);
return [ep(t), e, ep(e)];
}
function f3(t) {
var e = t.state,
n = t.options,
r = t.name;
if (!e.modifiersData[r]._skip) {
for (
var i = n.mainAxis,
o = i === void 0 ? !0 : i,
s = n.altAxis,
l = s === void 0 ? !0 : s,
a = n.fallbackPlacements,
u = n.padding,
c = n.boundary,
f = n.rootBoundary,
h = n.altBoundary,
p = n.flipVariations,
g = p === void 0 ? !0 : p,
v = n.allowedAutoPlacements,
b = e.options.placement,
x = Kn(b),
S = x === b,
T = a || (S || !g ? [sl(b)] : d3(b)),
d = [b].concat(T).reduce(function (Le, Re) {
return Le.concat(
Kn(Re) === zd
? c3(e, {
placement: Re,
boundary: c,
rootBoundary: f,
padding: u,
flipVariations: g,
allowedAutoPlacements: v,
})
: Re
);
}, []),
y = e.rects.reference,
m = e.rects.popper,
w = new Map(),
k = !0,
_ = d[0],
C = 0;
C < d.length;
C++
) {
var E = d[C],
R = Kn(E),
P = Zi(E) === Yi,
L = [Zt, xn].indexOf(R) >= 0,
I = L ? "width" : "height",
M = Xo(e, {
placement: E,
boundary: c,
rootBoundary: f,
altBoundary: h,
padding: u,
}),
N = L ? (P ? kn : en) : P ? xn : Zt;
y[I] > m[I] && (N = sl(N));
var D = sl(N),
K = [];
if (
(o && K.push(M[R] <= 0),
l && K.push(M[N] <= 0, M[D] <= 0),
K.every(function (Le) {
return Le;
}))
) {
(_ = E), (k = !1);
break;
}
w.set(E, K);
}
if (k)
for (
var ae = g ? 3 : 1,
Q = function (Re) {
var Ae = d.find(function (z) {
var X = w.get(z);
if (X)
return X.slice(0, Re).every(function (ee) {
return ee;
});
});
if (Ae) return (_ = Ae), "break";
},
me = ae;
me > 0;
me--
) {
var je = Q(me);
if (je === "break") break;
}
e.placement !== _ &&
((e.modifiersData[r]._skip = !0),
(e.placement = _),
(e.reset = !0));
}
}
const h3 = {
name: "flip",
enabled: !0,
phase: "main",
fn: f3,
requiresIfExists: ["offset"],
data: { _skip: !1 },
};
function np(t, e, n) {
return (
n === void 0 && (n = { x: 0, y: 0 }),
{
top: t.top - e.height - n.y,
right: t.right - e.width + n.x,
bottom: t.bottom - e.height + n.y,
left: t.left - e.width - n.x,
}
);
}
function rp(t) {
return [Zt, kn, xn, en].some(function (e) {
return t[e] >= 0;
});
}
function p3(t) {
var e = t.state,
n = t.name,
r = e.rects.reference,
i = e.rects.popper,
o = e.modifiersData.preventOverflow,
s = Xo(e, { elementContext: "reference" }),
l = Xo(e, { altBoundary: !0 }),
a = np(s, r),
u = np(l, i, o),
c = rp(a),
f = rp(u);
(e.modifiersData[n] = {
referenceClippingOffsets: a,
popperEscapeOffsets: u,
isReferenceHidden: c,
hasPopperEscaped: f,
}),
(e.attributes.popper = Object.assign({}, e.attributes.popper, {
"data-popper-reference-hidden": c,
"data-popper-escaped": f,
}));
}
const m3 = {
name: "hide",
enabled: !0,
phase: "main",
requiresIfExists: ["preventOverflow"],
fn: p3,
};
function g3(t, e, n) {
var r = Kn(t),
i = [en, Zt].indexOf(r) >= 0 ? -1 : 1,
o =
typeof n == "function"
? n(Object.assign({}, e, { placement: t }))
: n,
s = o[0],
l = o[1];
return (
(s = s || 0),
(l = (l || 0) * i),
[en, kn].indexOf(r) >= 0 ? { x: l, y: s } : { x: s, y: l }
);
}
function y3(t) {
var e = t.state,
n = t.options,
r = t.name,
i = n.offset,
o = i === void 0 ? [0, 0] : i,
s = M1.reduce(function (c, f) {
return (c[f] = g3(f, e.rects, o)), c;
}, {}),
l = s[e.placement],
a = l.x,
u = l.y;
e.modifiersData.popperOffsets != null &&
((e.modifiersData.popperOffsets.x += a),
(e.modifiersData.popperOffsets.y += u)),
(e.modifiersData[r] = s);
}
const v3 = {
name: "offset",
enabled: !0,
phase: "main",
requires: ["popperOffsets"],
fn: y3,
};
function b3(t) {
var e = t.state,
n = t.name;
e.modifiersData[n] = j1({
reference: e.rects.reference,
element: e.rects.popper,
strategy: "absolute",
placement: e.placement,
});
}
const w3 = {
name: "popperOffsets",
enabled: !0,
phase: "read",
fn: b3,
data: {},
};
function x3(t) {
return t === "x" ? "y" : "x";
}
function k3(t) {
var e = t.state,
n = t.options,
r = t.name,
i = n.mainAxis,
o = i === void 0 ? !0 : i,
s = n.altAxis,
l = s === void 0 ? !1 : s,
a = n.boundary,
u = n.rootBoundary,
c = n.altBoundary,
f = n.padding,
h = n.tether,
p = h === void 0 ? !0 : h,
g = n.tetherOffset,
v = g === void 0 ? 0 : g,
b = Xo(e, { boundary: a, rootBoundary: u, padding: f, altBoundary: c }),
x = Kn(e.placement),
S = Zi(e.placement),
T = !S,
d = Vd(x),
y = x3(d),
m = e.modifiersData.popperOffsets,
w = e.rects.reference,
k = e.rects.popper,
_ =
typeof v == "function"
? v(Object.assign({}, e.rects, { placement: e.placement }))
: v,
C =
typeof _ == "number"
? { mainAxis: _, altAxis: _ }
: Object.assign({ mainAxis: 0, altAxis: 0 }, _),
E = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null,
R = { x: 0, y: 0 };
if (!!m) {
if (o) {
var P,
L = d === "y" ? Zt : en,
I = d === "y" ? xn : kn,
M = d === "y" ? "height" : "width",
N = m[d],
D = N + b[L],
K = N - b[I],
ae = p ? -k[M] / 2 : 0,
Q = S === Yi ? w[M] : k[M],
me = S === Yi ? -k[M] : -w[M],
je = e.elements.arrow,
Le = p && je ? Fd(je) : { width: 0, height: 0 },
Re = e.modifiersData["arrow#persistent"]
? e.modifiersData["arrow#persistent"].padding
: O1(),
Ae = Re[L],
z = Re[I],
X = Lo(0, w[M], Le[M]),
ee = T
? w[M] / 2 - ae - X - Ae - C.mainAxis
: Q - X - Ae - C.mainAxis,
ue = T
? -w[M] / 2 + ae + X + z + C.mainAxis
: me + X + z + C.mainAxis,
Pe = e.elements.arrow && bs(e.elements.arrow),
A = Pe
? d === "y"
? Pe.clientTop || 0
: Pe.clientLeft || 0
: 0,
O = (P = E == null ? void 0 : E[d]) != null ? P : 0,
j = N + ee - O - A,
H = N + ue - O,
V = Lo(p ? _l(D, j) : D, N, p ? ai(K, H) : K);
(m[d] = V), (R[d] = V - N);
}
if (l) {
var q,
se = d === "x" ? Zt : en,
Z = d === "x" ? xn : kn,
te = m[y],
J = y === "y" ? "height" : "width",
he = te + b[se],
ce = te - b[Z],
pe = [Zt, en].indexOf(x) !== -1,
ke = (q = E == null ? void 0 : E[y]) != null ? q : 0,
Oe = pe ? he : te - w[J] - k[J] - ke + C.altAxis,
Je = pe ? te + w[J] + k[J] - ke - C.altAxis : ce,
Fe =
p && pe ? Kx(Oe, te, Je) : Lo(p ? Oe : he, te, p ? Je : ce);
(m[y] = Fe), (R[y] = Fe - te);
}
e.modifiersData[r] = R;
}
}
const C3 = {
name: "preventOverflow",
enabled: !0,
phase: "main",
fn: k3,
requiresIfExists: ["offset"],
};
function S3(t) {
return { scrollLeft: t.scrollLeft, scrollTop: t.scrollTop };
}
function _3(t) {
return t === ln(t) || !bn(t) ? Wd(t) : S3(t);
}
function M3(t) {
var e = t.getBoundingClientRect(),
n = Qi(e.width) / t.offsetWidth || 1,
r = Qi(e.height) / t.offsetHeight || 1;
return n !== 1 || r !== 1;
}
function E3(t, e, n) {
n === void 0 && (n = !1);
var r = bn(e),
i = bn(e) && M3(e),
o = Br(e),
s = Xi(t, i, n),
l = { scrollLeft: 0, scrollTop: 0 },
a = { x: 0, y: 0 };
return (
(r || (!r && !n)) &&
((Yn(e) !== "body" || Kd(o)) && (l = _3(e)),
bn(e)
? ((a = Xi(e, !0)), (a.x += e.clientLeft), (a.y += e.clientTop))
: o && (a.x = Ud(o))),
{
x: s.left + l.scrollLeft - a.x,
y: s.top + l.scrollTop - a.y,
width: s.width,
height: s.height,
}
);
}
function A3(t) {
var e = new Map(),
n = new Set(),
r = [];
t.forEach(function (o) {
e.set(o.name, o);
});
function i(o) {
n.add(o.name);
var s = [].concat(o.requires || [], o.requiresIfExists || []);
s.forEach(function (l) {
if (!n.has(l)) {
var a = e.get(l);
a && i(a);
}
}),
r.push(o);
}
return (
t.forEach(function (o) {
n.has(o.name) || i(o);
}),
r
);
}
function T3(t) {
var e = A3(t);
return Hx.reduce(function (n, r) {
return n.concat(
e.filter(function (i) {
return i.phase === r;
})
);
}, []);
}
function O3(t) {
var e;
return function () {
return (
e ||
(e = new Promise(function (n) {
Promise.resolve().then(function () {
(e = void 0), n(t());
});
})),
e
);
};
}
function R3(t) {
var e = t.reduce(function (n, r) {
var i = n[r.name];
return (
(n[r.name] = i
? Object.assign({}, i, r, {
options: Object.assign({}, i.options, r.options),
data: Object.assign({}, i.data, r.data),
})
: r),
n
);
}, {});
return Object.keys(e).map(function (n) {
return e[n];
});
}
var ip = { placement: "bottom", modifiers: [], strategy: "absolute" };
function op() {
for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
e[n] = arguments[n];
return !e.some(function (r) {
return !(r && typeof r.getBoundingClientRect == "function");
});
}
function P3(t) {
t === void 0 && (t = {});
var e = t,
n = e.defaultModifiers,
r = n === void 0 ? [] : n,
i = e.defaultOptions,
o = i === void 0 ? ip : i;
return function (l, a, u) {
u === void 0 && (u = o);
var c = {
placement: "bottom",
orderedModifiers: [],
options: Object.assign({}, ip, o),
modifiersData: {},
elements: { reference: l, popper: a },
attributes: {},
styles: {},
},
f = [],
h = !1,
p = {
state: c,
setOptions: function (x) {
var S = typeof x == "function" ? x(c.options) : x;
v(),
(c.options = Object.assign({}, o, c.options, S)),
(c.scrollParents = {
reference: yi(l)
? Do(l)
: l.contextElement
? Do(l.contextElement)
: [],
popper: Do(a),
});
var T = T3(R3([].concat(r, c.options.modifiers)));
return (
(c.orderedModifiers = T.filter(function (d) {
return d.enabled;
})),
g(),
p.update()
);
},
forceUpdate: function () {
if (!h) {
var x = c.elements,
S = x.reference,
T = x.popper;
if (!!op(S, T)) {
(c.rects = {
reference: E3(
S,
bs(T),
c.options.strategy === "fixed"
),
popper: Fd(T),
}),
(c.reset = !1),
(c.placement = c.options.placement),
c.orderedModifiers.forEach(function (C) {
return (c.modifiersData[C.name] =
Object.assign({}, C.data));
});
for (
var d = 0;
d < c.orderedModifiers.length;
d++
) {
if (c.reset === !0) {
(c.reset = !1), (d = -1);
continue;
}
var y = c.orderedModifiers[d],
m = y.fn,
w = y.options,
k = w === void 0 ? {} : w,
_ = y.name;
typeof m == "function" &&
(c =
m({
state: c,
options: k,
name: _,
instance: p,
}) || c);
}
}
}
},
update: O3(function () {
return new Promise(function (b) {
p.forceUpdate(), b(c);
});
}),
destroy: function () {
v(), (h = !0);
},
};
if (!op(l, a)) return p;
p.setOptions(u).then(function (b) {
!h && u.onFirstUpdate && u.onFirstUpdate(b);
});
function g() {
c.orderedModifiers.forEach(function (b) {
var x = b.name,
S = b.options,
T = S === void 0 ? {} : S,
d = b.effect;
if (typeof d == "function") {
var y = d({ state: c, name: x, instance: p, options: T }),
m = function () {};
f.push(y || m);
}
});
}
function v() {
f.forEach(function (b) {
return b();
}),
(f = []);
}
return p;
};
}
var N3 = [n3, w3, e3, E1, v3, h3, C3, Yx, m3],
L1 = P3({ defaultModifiers: N3 });
const j3 = {
name: "Popover",
inheritAttrs: !1,
props: {
show: { default: void 0 },
trigger: { type: String, default: "click" },
hoverDelay: { type: Number, default: 0 },
leaveDelay: { type: Number, default: 0 },
placement: { type: String, default: "bottom-start" },
popoverClass: [String, Object, Array],
transition: { default: null },
hideOnBlur: { default: !0 },
},
emits: ["open", "close", "update:show"],
expose: ["open", "close"],
data() {
return {
showPopup: !1,
targetWidth: null,
pointerOverTargetOrPopup: !1,
};
},
watch: {
show(t) {
t ? this.open() : this.close();
},
},
created() {
if (
typeof window != "undefined" &&
!document.getElementById("frappeui-popper-root")
) {
const t = document.createElement("div");
(t.id = "frappeui-popper-root"), document.body.appendChild(t);
}
},
mounted() {
(this.listener = (t) => {
[this.$refs.reference, this.$refs.popover].some(
(r) => r && (t.target === r || r.contains(t.target))
) || this.close();
}),
this.hideOnBlur &&
document.addEventListener("click", this.listener),
this.$nextTick(() => {
this.targetWidth = this.$refs.target.clientWidth;
});
},
beforeDestroy() {
this.popper && this.popper.destroy(),
document.removeEventListener("click", this.listener);
},
computed: {
showPropPassed() {
return this.show != null;
},
isOpen: {
get() {
return this.showPropPassed ? this.show : this.showPopup;
},
set(t) {
(t = Boolean(t)),
this.showPropPassed
? this.$emit("update:show", t)
: (this.showPopup = t),
t === !1
? this.$emit("close")
: t === !0 && this.$emit("open");
},
},
popupTransition() {
let t = {
default: {
enterActiveClass: "transition duration-150 ease-out",
enterFromClass: "translate-y-1 opacity-0",
enterToClass: "translate-y-0 opacity-100",
leaveActiveClass: "transition duration-150 ease-in",
leaveFromClass: "translate-y-0 opacity-100",
leaveToClass: "translate-y-1 opacity-0",
},
};
return typeof this.transition == "string"
? t[this.transition]
: this.transition;
},
},
methods: {
setupPopper() {
this.popper
? this.updatePosition()
: (this.popper = L1(
this.$refs.reference,
this.$refs.popover,
{ placement: this.placement }
));
},
updatePosition() {
this.popper && this.popper.update();
},
togglePopover(t) {
t instanceof Event && (t = null),
t == null && (t = !this.isOpen),
(t = Boolean(t)),
t ? this.open() : this.close();
},
open() {
(this.isOpen = !0), this.$nextTick(() => this.setupPopper());
},
close() {
this.isOpen = !1;
},
onMouseover() {
(this.pointerOverTargetOrPopup = !0),
this.leaveTimer &&
(clearTimeout(this.leaveTimer),
(this.leaveTimer = null)),
this.trigger === "hover" &&
(this.hoverDelay
? (this.hoverTimer = setTimeout(() => {
this.pointerOverTargetOrPopup &&
this.open();
}, Number(this.hoverDelay) * 1e3))
: this.open());
},
onMouseleave(t) {
(this.pointerOverTargetOrPopup = !1),
this.hoverTimer &&
(clearTimeout(this.hoverTimer),
(this.hoverTimer = null)),
this.trigger === "hover" &&
(this.leaveTimer && clearTimeout(this.leaveTimer),
this.leaveDelay
? (this.leaveTimer = setTimeout(() => {
this.pointerOverTargetOrPopup ||
this.close();
}, Number(this.leaveDelay) * 1e3))
: this.pointerOverTargetOrPopup || this.close());
},
},
},
L3 = { ref: "reference" },
D3 = { class: "rounded-lg border border-gray-100 bg-white shadow-xl" };
function I3(t, e, n, r, i, o) {
return (
B(),
G(
"div",
L3,
[
U(
"div",
{
ref: "target",
class: ye(["flex", t.$attrs.class]),
onClick:
e[0] ||
(e[0] = (...s) =>
o.updatePosition && o.updatePosition(...s)),
onFocusin:
e[1] ||
(e[1] = (...s) =>
o.updatePosition && o.updatePosition(...s)),
onKeydown:
e[2] ||
(e[2] = (...s) =>
o.updatePosition && o.updatePosition(...s)),
onMouseover:
e[3] ||
(e[3] = (...s) =>
o.onMouseover && o.onMouseover(...s)),
onMouseleave:
e[4] ||
(e[4] = (...s) =>
o.onMouseleave && o.onMouseleave(...s)),
},
[
_e(
t.$slots,
"target",
Dt(
Ft({
togglePopover: o.togglePopover,
updatePosition: o.updatePosition,
open: o.open,
close: o.close,
isOpen: o.isOpen,
})
)
),
],
34
),
(B(),
Be(xd, { to: "#frappeui-popper-root" }, [
U(
"div",
{
ref: "popover",
class: ye([
n.popoverClass,
"popover-container relative z-[100]",
]),
style: Ir({
minWidth: i.targetWidth
? i.targetWidth + "px"
: null,
}),
onMouseover:
e[5] ||
(e[5] = (s) =>
(i.pointerOverTargetOrPopup = !0)),
onMouseleave:
e[6] ||
(e[6] = (...s) =>
o.onMouseleave && o.onMouseleave(...s)),
},
[
Me(
Oa,
Dt(Ft(o.popupTransition)),
{
default: Te(() => [
tc(
U(
"div",
null,
[
_e(
t.$slots,
"body",
Dt(
Ft({
togglePopover:
o.togglePopover,
updatePosition:
o.updatePosition,
open: o.open,
close: o.close,
isOpen: o.isOpen,
})
),
() => [
U("div", D3, [
_e(
t.$slots,
"body-main",
Dt(
Ft({
togglePopover:
o.togglePopover,
updatePosition:
o.updatePosition,
open: o.open,
close: o.close,
isOpen: o.isOpen,
})
)
),
]),
]
),
],
512
),
[[cc, o.isOpen]]
),
]),
_: 3,
},
16
),
],
38
),
])),
],
512
)
);
}
const qd = Ue(j3, [["render", I3]]);
var D1 =
typeof globalThis != "undefined"
? globalThis
: typeof window != "undefined"
? window
: typeof global != "undefined"
? global
: typeof self != "undefined"
? self
: {};
function B3(t) {
return t &&
t.__esModule &&
Object.prototype.hasOwnProperty.call(t, "default")
? t.default
: t;
}
var I1 = { exports: {} };
(function (t, e) {
(function (r, i) {
t.exports = i();
})(typeof self != "undefined" ? self : D1, function () {
return (function (n) {
var r = {};
function i(o) {
if (r[o]) return r[o].exports;
var s = (r[o] = { i: o, l: !1, exports: {} });
return (
n[o].call(s.exports, s, s.exports, i), (s.l = !0), s.exports
);
}
return (
(i.m = n),
(i.c = r),
(i.d = function (o, s, l) {
i.o(o, s) ||
Object.defineProperty(o, s, {
configurable: !1,
enumerable: !0,
get: l,
});
}),
(i.r = function (o) {
Object.defineProperty(o, "__esModule", { value: !0 });
}),
(i.n = function (o) {
var s =
o && o.__esModule
? function () {
return o.default;
}
: function () {
return o;
};
return i.d(s, "a", s), s;
}),
(i.o = function (o, s) {
return Object.prototype.hasOwnProperty.call(o, s);
}),
(i.p = ""),
i((i.s = 0))
);
})({
"./dist/icons.json": function (n) {
n.exports = {
activity:
'<polyline points="22 12 18 12 15 21 9 3 6 12 2 12"></polyline>',
airplay:
'<path d="M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1"></path><polygon points="12 15 17 21 7 21 12 15"></polygon>',
"alert-circle":
'<circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line>',
"alert-octagon":
'<polygon points="7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"></polygon><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line>',
"alert-triangle":
'<path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1="12" y1="9" x2="12" y2="13"></line><line x1="12" y1="17" x2="12.01" y2="17"></line>',
"align-center":
'<line x1="18" y1="10" x2="6" y2="10"></line><line x1="21" y1="6" x2="3" y2="6"></line><line x1="21" y1="14" x2="3" y2="14"></line><line x1="18" y1="18" x2="6" y2="18"></line>',
"align-justify":
'<line x1="21" y1="10" x2="3" y2="10"></line><line x1="21" y1="6" x2="3" y2="6"></line><line x1="21" y1="14" x2="3" y2="14"></line><line x1="21" y1="18" x2="3" y2="18"></line>',
"align-left":
'<line x1="17" y1="10" x2="3" y2="10"></line><line x1="21" y1="6" x2="3" y2="6"></line><line x1="21" y1="14" x2="3" y2="14"></line><line x1="17" y1="18" x2="3" y2="18"></line>',
"align-right":
'<line x1="21" y1="10" x2="7" y2="10"></line><line x1="21" y1="6" x2="3" y2="6"></line><line x1="21" y1="14" x2="3" y2="14"></line><line x1="21" y1="18" x2="7" y2="18"></line>',
anchor: '<circle cx="12" cy="5" r="3"></circle><line x1="12" y1="22" x2="12" y2="8"></line><path d="M5 12H2a10 10 0 0 0 20 0h-3"></path>',
aperture:
'<circle cx="12" cy="12" r="10"></circle><line x1="14.31" y1="8" x2="20.05" y2="17.94"></line><line x1="9.69" y1="8" x2="21.17" y2="8"></line><line x1="7.38" y1="12" x2="13.12" y2="2.06"></line><line x1="9.69" y1="16" x2="3.95" y2="6.06"></line><line x1="14.31" y1="16" x2="2.83" y2="16"></line><line x1="16.62" y1="12" x2="10.88" y2="21.94"></line>',
archive:
'<polyline points="21 8 21 21 3 21 3 8"></polyline><rect x="1" y="3" width="22" height="5"></rect><line x1="10" y1="12" x2="14" y2="12"></line>',
"arrow-down-circle":
'<circle cx="12" cy="12" r="10"></circle><polyline points="8 12 12 16 16 12"></polyline><line x1="12" y1="8" x2="12" y2="16"></line>',
"arrow-down-left":
'<line x1="17" y1="7" x2="7" y2="17"></line><polyline points="17 17 7 17 7 7"></polyline>',
"arrow-down-right":
'<line x1="7" y1="7" x2="17" y2="17"></line><polyline points="17 7 17 17 7 17"></polyline>',
"arrow-down":
'<line x1="12" y1="5" x2="12" y2="19"></line><polyline points="19 12 12 19 5 12"></polyline>',
"arrow-left-circle":
'<circle cx="12" cy="12" r="10"></circle><polyline points="12 8 8 12 12 16"></polyline><line x1="16" y1="12" x2="8" y2="12"></line>',
"arrow-left":
'<line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline>',
"arrow-right-circle":
'<circle cx="12" cy="12" r="10"></circle><polyline points="12 16 16 12 12 8"></polyline><line x1="8" y1="12" x2="16" y2="12"></line>',
"arrow-right":
'<line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline>',
"arrow-up-circle":
'<circle cx="12" cy="12" r="10"></circle><polyline points="16 12 12 8 8 12"></polyline><line x1="12" y1="16" x2="12" y2="8"></line>',
"arrow-up-left":
'<line x1="17" y1="17" x2="7" y2="7"></line><polyline points="7 17 7 7 17 7"></polyline>',
"arrow-up-right":
'<line x1="7" y1="17" x2="17" y2="7"></line><polyline points="7 7 17 7 17 17"></polyline>',
"arrow-up":
'<line x1="12" y1="19" x2="12" y2="5"></line><polyline points="5 12 12 5 19 12"></polyline>',
"at-sign":
'<circle cx="12" cy="12" r="4"></circle><path d="M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-3.92 7.94"></path>',
award: '<circle cx="12" cy="8" r="7"></circle><polyline points="8.21 13.89 7 23 12 20 17 23 15.79 13.88"></polyline>',
"bar-chart-2":
'<line x1="18" y1="20" x2="18" y2="10"></line><line x1="12" y1="20" x2="12" y2="4"></line><line x1="6" y1="20" x2="6" y2="14"></line>',
"bar-chart":
'<line x1="12" y1="20" x2="12" y2="10"></line><line x1="18" y1="20" x2="18" y2="4"></line><line x1="6" y1="20" x2="6" y2="16"></line>',
"battery-charging":
'<path d="M5 18H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h3.19M15 6h2a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-3.19"></path><line x1="23" y1="13" x2="23" y2="11"></line><polyline points="11 6 7 12 13 12 9 18"></polyline>',
battery:
'<rect x="1" y="6" width="18" height="12" rx="2" ry="2"></rect><line x1="23" y1="13" x2="23" y2="11"></line>',
"bell-off":
'<path d="M13.73 21a2 2 0 0 1-3.46 0"></path><path d="M18.63 13A17.89 17.89 0 0 1 18 8"></path><path d="M6.26 6.26A5.86 5.86 0 0 0 6 8c0 7-3 9-3 9h14"></path><path d="M18 8a6 6 0 0 0-9.33-5"></path><line x1="1" y1="1" x2="23" y2="23"></line>',
bell: '<path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"></path><path d="M13.73 21a2 2 0 0 1-3.46 0"></path>',
bluetooth:
'<polyline points="6.5 6.5 17.5 17.5 12 23 12 1 17.5 6.5 6.5 17.5"></polyline>',
bold: '<path d="M6 4h8a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z"></path><path d="M6 12h9a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z"></path>',
"book-open":
'<path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"></path><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"></path>',
book: '<path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"></path><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"></path>',
bookmark:
'<path d="M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"></path>',
box: '<path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path><polyline points="3.27 6.96 12 12.01 20.73 6.96"></polyline><line x1="12" y1="22.08" x2="12" y2="12"></line>',
briefcase:
'<rect x="2" y="7" width="20" height="14" rx="2" ry="2"></rect><path d="M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"></path>',
calendar:
'<rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line>',
"camera-off":
'<line x1="1" y1="1" x2="23" y2="23"></line><path d="M21 21H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h3m3-3h6l2 3h4a2 2 0 0 1 2 2v9.34m-7.72-2.06a4 4 0 1 1-5.56-5.56"></path>',
camera: '<path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"></path><circle cx="12" cy="13" r="4"></circle>',
cast: '<path d="M2 16.1A5 5 0 0 1 5.9 20M2 12.05A9 9 0 0 1 9.95 20M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6"></path><line x1="2" y1="20" x2="2.01" y2="20"></line>',
"check-circle":
'<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path><polyline points="22 4 12 14.01 9 11.01"></polyline>',
"check-square":
'<polyline points="9 11 12 14 22 4"></polyline><path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"></path>',
check: '<polyline points="20 6 9 17 4 12"></polyline>',
"chevron-down":
'<polyline points="6 9 12 15 18 9"></polyline>',
"chevron-left":
'<polyline points="15 18 9 12 15 6"></polyline>',
"chevron-right":
'<polyline points="9 18 15 12 9 6"></polyline>',
"chevron-up":
'<polyline points="18 15 12 9 6 15"></polyline>',
"chevrons-down":
'<polyline points="7 13 12 18 17 13"></polyline><polyline points="7 6 12 11 17 6"></polyline>',
"chevrons-left":
'<polyline points="11 17 6 12 11 7"></polyline><polyline points="18 17 13 12 18 7"></polyline>',
"chevrons-right":
'<polyline points="13 17 18 12 13 7"></polyline><polyline points="6 17 11 12 6 7"></polyline>',
"chevrons-up":
'<polyline points="17 11 12 6 7 11"></polyline><polyline points="17 18 12 13 7 18"></polyline>',
chrome: '<circle cx="12" cy="12" r="10"></circle><circle cx="12" cy="12" r="4"></circle><line x1="21.17" y1="8" x2="12" y2="8"></line><line x1="3.95" y1="6.06" x2="8.54" y2="14"></line><line x1="10.88" y1="21.94" x2="15.46" y2="14"></line>',
circle: '<circle cx="12" cy="12" r="10"></circle>',
clipboard:
'<path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"></path><rect x="8" y="2" width="8" height="4" rx="1" ry="1"></rect>',
clock: '<circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline>',
"cloud-drizzle":
'<line x1="8" y1="19" x2="8" y2="21"></line><line x1="8" y1="13" x2="8" y2="15"></line><line x1="16" y1="19" x2="16" y2="21"></line><line x1="16" y1="13" x2="16" y2="15"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="12" y1="15" x2="12" y2="17"></line><path d="M20 16.58A5 5 0 0 0 18 7h-1.26A8 8 0 1 0 4 15.25"></path>',
"cloud-lightning":
'<path d="M19 16.9A5 5 0 0 0 18 7h-1.26a8 8 0 1 0-11.62 9"></path><polyline points="13 11 9 17 15 17 11 23"></polyline>',
"cloud-off":
'<path d="M22.61 16.95A5 5 0 0 0 18 10h-1.26a8 8 0 0 0-7.05-6M5 5a8 8 0 0 0 4 15h9a5 5 0 0 0 1.7-.3"></path><line x1="1" y1="1" x2="23" y2="23"></line>',
"cloud-rain":
'<line x1="16" y1="13" x2="16" y2="21"></line><line x1="8" y1="13" x2="8" y2="21"></line><line x1="12" y1="15" x2="12" y2="23"></line><path d="M20 16.58A5 5 0 0 0 18 7h-1.26A8 8 0 1 0 4 15.25"></path>',
"cloud-snow":
'<path d="M20 17.58A5 5 0 0 0 18 8h-1.26A8 8 0 1 0 4 16.25"></path><line x1="8" y1="16" x2="8.01" y2="16"></line><line x1="8" y1="20" x2="8.01" y2="20"></line><line x1="12" y1="18" x2="12.01" y2="18"></line><line x1="12" y1="22" x2="12.01" y2="22"></line><line x1="16" y1="16" x2="16.01" y2="16"></line><line x1="16" y1="20" x2="16.01" y2="20"></line>',
cloud: '<path d="M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z"></path>',
code: '<polyline points="16 18 22 12 16 6"></polyline><polyline points="8 6 2 12 8 18"></polyline>',
codepen:
'<polygon points="12 2 22 8.5 22 15.5 12 22 2 15.5 2 8.5 12 2"></polygon><line x1="12" y1="22" x2="12" y2="15.5"></line><polyline points="22 8.5 12 15.5 2 8.5"></polyline><polyline points="2 15.5 12 8.5 22 15.5"></polyline><line x1="12" y1="2" x2="12" y2="8.5"></line>',
codesandbox:
'<path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path><polyline points="7.5 4.21 12 6.81 16.5 4.21"></polyline><polyline points="7.5 19.79 7.5 14.6 3 12"></polyline><polyline points="21 12 16.5 14.6 16.5 19.79"></polyline><polyline points="3.27 6.96 12 12.01 20.73 6.96"></polyline><line x1="12" y1="22.08" x2="12" y2="12"></line>',
coffee: '<path d="M18 8h1a4 4 0 0 1 0 8h-1"></path><path d="M2 8h16v9a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4V8z"></path><line x1="6" y1="1" x2="6" y2="4"></line><line x1="10" y1="1" x2="10" y2="4"></line><line x1="14" y1="1" x2="14" y2="4"></line>',
columns:
'<path d="M12 3h7a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-7m0-18H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h7m0-18v18"></path>',
command:
'<path d="M18 3a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3H6a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3V6a3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3h12a3 3 0 0 0 3-3 3 3 0 0 0-3-3z"></path>',
compass:
'<circle cx="12" cy="12" r="10"></circle><polygon points="16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76"></polygon>',
copy: '<rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>',
"corner-down-left":
'<polyline points="9 10 4 15 9 20"></polyline><path d="M20 4v7a4 4 0 0 1-4 4H4"></path>',
"corner-down-right":
'<polyline points="15 10 20 15 15 20"></polyline><path d="M4 4v7a4 4 0 0 0 4 4h12"></path>',
"corner-left-down":
'<polyline points="14 15 9 20 4 15"></polyline><path d="M20 4h-7a4 4 0 0 0-4 4v12"></path>',
"corner-left-up":
'<polyline points="14 9 9 4 4 9"></polyline><path d="M20 20h-7a4 4 0 0 1-4-4V4"></path>',
"corner-right-down":
'<polyline points="10 15 15 20 20 15"></polyline><path d="M4 4h7a4 4 0 0 1 4 4v12"></path>',
"corner-right-up":
'<polyline points="10 9 15 4 20 9"></polyline><path d="M4 20h7a4 4 0 0 0 4-4V4"></path>',
"corner-up-left":
'<polyline points="9 14 4 9 9 4"></polyline><path d="M20 20v-7a4 4 0 0 0-4-4H4"></path>',
"corner-up-right":
'<polyline points="15 14 20 9 15 4"></polyline><path d="M4 20v-7a4 4 0 0 1 4-4h12"></path>',
cpu: '<rect x="4" y="4" width="16" height="16" rx="2" ry="2"></rect><rect x="9" y="9" width="6" height="6"></rect><line x1="9" y1="1" x2="9" y2="4"></line><line x1="15" y1="1" x2="15" y2="4"></line><line x1="9" y1="20" x2="9" y2="23"></line><line x1="15" y1="20" x2="15" y2="23"></line><line x1="20" y1="9" x2="23" y2="9"></line><line x1="20" y1="14" x2="23" y2="14"></line><line x1="1" y1="9" x2="4" y2="9"></line><line x1="1" y1="14" x2="4" y2="14"></line>',
"credit-card":
'<rect x="1" y="4" width="22" height="16" rx="2" ry="2"></rect><line x1="1" y1="10" x2="23" y2="10"></line>',
crop: '<path d="M6.13 1L6 16a2 2 0 0 0 2 2h15"></path><path d="M1 6.13L16 6a2 2 0 0 1 2 2v15"></path>',
crosshair:
'<circle cx="12" cy="12" r="10"></circle><line x1="22" y1="12" x2="18" y2="12"></line><line x1="6" y1="12" x2="2" y2="12"></line><line x1="12" y1="6" x2="12" y2="2"></line><line x1="12" y1="22" x2="12" y2="18"></line>',
database:
'<ellipse cx="12" cy="5" rx="9" ry="3"></ellipse><path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"></path><path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"></path>',
delete: '<path d="M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"></path><line x1="18" y1="9" x2="12" y2="15"></line><line x1="12" y1="9" x2="18" y2="15"></line>',
disc: '<circle cx="12" cy="12" r="10"></circle><circle cx="12" cy="12" r="3"></circle>',
"divide-circle":
'<line x1="8" y1="12" x2="16" y2="12"></line><line x1="12" y1="16" x2="12" y2="16"></line><line x1="12" y1="8" x2="12" y2="8"></line><circle cx="12" cy="12" r="10"></circle>',
"divide-square":
'<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="8" y1="12" x2="16" y2="12"></line><line x1="12" y1="16" x2="12" y2="16"></line><line x1="12" y1="8" x2="12" y2="8"></line>',
divide: '<circle cx="12" cy="6" r="2"></circle><line x1="5" y1="12" x2="19" y2="12"></line><circle cx="12" cy="18" r="2"></circle>',
"dollar-sign":
'<line x1="12" y1="1" x2="12" y2="23"></line><path d="M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"></path>',
"download-cloud":
'<polyline points="8 17 12 21 16 17"></polyline><line x1="12" y1="12" x2="12" y2="21"></line><path d="M20.88 18.09A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.29"></path>',
download:
'<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line>',
dribbble:
'<circle cx="12" cy="12" r="10"></circle><path d="M8.56 2.75c4.37 6.03 6.02 9.42 8.03 17.72m2.54-15.38c-3.72 4.35-8.94 5.66-16.88 5.85m19.5 1.9c-3.5-.93-6.63-.82-8.94 0-2.58.92-5.01 2.86-7.44 6.32"></path>',
droplet:
'<path d="M12 2.69l5.66 5.66a8 8 0 1 1-11.31 0z"></path>',
"edit-2":
'<path d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"></path>',
"edit-3":
'<path d="M12 20h9"></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path>',
edit: '<path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path>',
"external-link":
'<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line>',
"eye-off":
'<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"></path><line x1="1" y1="1" x2="23" y2="23"></line>',
eye: '<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle>',
facebook:
'<path d="M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z"></path>',
"fast-forward":
'<polygon points="13 19 22 12 13 5 13 19"></polygon><polygon points="2 19 11 12 2 5 2 19"></polygon>',
feather:
'<path d="M20.24 12.24a6 6 0 0 0-8.49-8.49L5 10.5V19h8.5z"></path><line x1="16" y1="8" x2="2" y2="22"></line><line x1="17.5" y1="15" x2="9" y2="15"></line>',
figma: '<path d="M5 5.5A3.5 3.5 0 0 1 8.5 2H12v7H8.5A3.5 3.5 0 0 1 5 5.5z"></path><path d="M12 2h3.5a3.5 3.5 0 1 1 0 7H12V2z"></path><path d="M12 12.5a3.5 3.5 0 1 1 7 0 3.5 3.5 0 1 1-7 0z"></path><path d="M5 19.5A3.5 3.5 0 0 1 8.5 16H12v3.5a3.5 3.5 0 1 1-7 0z"></path><path d="M5 12.5A3.5 3.5 0 0 1 8.5 9H12v7H8.5A3.5 3.5 0 0 1 5 12.5z"></path>',
"file-minus":
'<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="9" y1="15" x2="15" y2="15"></line>',
"file-plus":
'<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="12" y1="18" x2="12" y2="12"></line><line x1="9" y1="15" x2="15" y2="15"></line>',
"file-text":
'<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline>',
file: '<path d="M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"></path><polyline points="13 2 13 9 20 9"></polyline>',
film: '<rect x="2" y="2" width="20" height="20" rx="2.18" ry="2.18"></rect><line x1="7" y1="2" x2="7" y2="22"></line><line x1="17" y1="2" x2="17" y2="22"></line><line x1="2" y1="12" x2="22" y2="12"></line><line x1="2" y1="7" x2="7" y2="7"></line><line x1="2" y1="17" x2="7" y2="17"></line><line x1="17" y1="17" x2="22" y2="17"></line><line x1="17" y1="7" x2="22" y2="7"></line>',
filter: '<polygon points="22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"></polygon>',
flag: '<path d="M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"></path><line x1="4" y1="22" x2="4" y2="15"></line>',
"folder-minus":
'<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path><line x1="9" y1="14" x2="15" y2="14"></line>',
"folder-plus":
'<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path><line x1="12" y1="11" x2="12" y2="17"></line><line x1="9" y1="14" x2="15" y2="14"></line>',
folder: '<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path>',
framer: '<path d="M5 16V9h14V2H5l14 14h-7m-7 0l7 7v-7m-7 0h7"></path>',
frown: '<circle cx="12" cy="12" r="10"></circle><path d="M16 16s-1.5-2-4-2-4 2-4 2"></path><line x1="9" y1="9" x2="9.01" y2="9"></line><line x1="15" y1="9" x2="15.01" y2="9"></line>',
gift: '<polyline points="20 12 20 22 4 22 4 12"></polyline><rect x="2" y="7" width="20" height="5"></rect><line x1="12" y1="22" x2="12" y2="7"></line><path d="M12 7H7.5a2.5 2.5 0 0 1 0-5C11 2 12 7 12 7z"></path><path d="M12 7h4.5a2.5 2.5 0 0 0 0-5C13 2 12 7 12 7z"></path>',
"git-branch":
'<line x1="6" y1="3" x2="6" y2="15"></line><circle cx="18" cy="6" r="3"></circle><circle cx="6" cy="18" r="3"></circle><path d="M18 9a9 9 0 0 1-9 9"></path>',
"git-commit":
'<circle cx="12" cy="12" r="4"></circle><line x1="1.05" y1="12" x2="7" y2="12"></line><line x1="17.01" y1="12" x2="22.96" y2="12"></line>',
"git-merge":
'<circle cx="18" cy="18" r="3"></circle><circle cx="6" cy="6" r="3"></circle><path d="M6 21V9a9 9 0 0 0 9 9"></path>',
"git-pull-request":
'<circle cx="18" cy="18" r="3"></circle><circle cx="6" cy="6" r="3"></circle><path d="M13 6h3a2 2 0 0 1 2 2v7"></path><line x1="6" y1="9" x2="6" y2="21"></line>',
github: '<path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"></path>',
gitlab: '<path d="M22.65 14.39L12 22.13 1.35 14.39a.84.84 0 0 1-.3-.94l1.22-3.78 2.44-7.51A.42.42 0 0 1 4.82 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.49h8.1l2.44-7.51A.42.42 0 0 1 18.6 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.51L23 13.45a.84.84 0 0 1-.35.94z"></path>',
globe: '<circle cx="12" cy="12" r="10"></circle><line x1="2" y1="12" x2="22" y2="12"></line><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path>',
grid: '<rect x="3" y="3" width="7" height="7"></rect><rect x="14" y="3" width="7" height="7"></rect><rect x="14" y="14" width="7" height="7"></rect><rect x="3" y="14" width="7" height="7"></rect>',
"hard-drive":
'<line x1="22" y1="12" x2="2" y2="12"></line><path d="M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"></path><line x1="6" y1="16" x2="6.01" y2="16"></line><line x1="10" y1="16" x2="10.01" y2="16"></line>',
hash: '<line x1="4" y1="9" x2="20" y2="9"></line><line x1="4" y1="15" x2="20" y2="15"></line><line x1="10" y1="3" x2="8" y2="21"></line><line x1="16" y1="3" x2="14" y2="21"></line>',
headphones:
'<path d="M3 18v-6a9 9 0 0 1 18 0v6"></path><path d="M21 19a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3zM3 19a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2H3z"></path>',
heart: '<path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path>',
"help-circle":
'<circle cx="12" cy="12" r="10"></circle><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path><line x1="12" y1="17" x2="12.01" y2="17"></line>',
hexagon:
'<path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path>',
home: '<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline>',
image: '<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline>',
inbox: '<polyline points="22 12 16 12 14 15 10 15 8 12 2 12"></polyline><path d="M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"></path>',
info: '<circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line>',
instagram:
'<rect x="2" y="2" width="20" height="20" rx="5" ry="5"></rect><path d="M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"></path><line x1="17.5" y1="6.5" x2="17.51" y2="6.5"></line>',
italic: '<line x1="19" y1="4" x2="10" y2="4"></line><line x1="14" y1="20" x2="5" y2="20"></line><line x1="15" y1="4" x2="9" y2="20"></line>',
key: '<path d="M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4"></path>',
layers: '<polygon points="12 2 2 7 12 12 22 7 12 2"></polygon><polyline points="2 17 12 22 22 17"></polyline><polyline points="2 12 12 17 22 12"></polyline>',
layout: '<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="3" y1="9" x2="21" y2="9"></line><line x1="9" y1="21" x2="9" y2="9"></line>',
"life-buoy":
'<circle cx="12" cy="12" r="10"></circle><circle cx="12" cy="12" r="4"></circle><line x1="4.93" y1="4.93" x2="9.17" y2="9.17"></line><line x1="14.83" y1="14.83" x2="19.07" y2="19.07"></line><line x1="14.83" y1="9.17" x2="19.07" y2="4.93"></line><line x1="14.83" y1="9.17" x2="18.36" y2="5.64"></line><line x1="4.93" y1="19.07" x2="9.17" y2="14.83"></line>',
"link-2":
'<path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path><line x1="8" y1="12" x2="16" y2="12"></line>',
link: '<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path>',
linkedin:
'<path d="M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z"></path><rect x="2" y="9" width="4" height="12"></rect><circle cx="4" cy="4" r="2"></circle>',
list: '<line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line><line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line>',
loader: '<line x1="12" y1="2" x2="12" y2="6"></line><line x1="12" y1="18" x2="12" y2="22"></line><line x1="4.93" y1="4.93" x2="7.76" y2="7.76"></line><line x1="16.24" y1="16.24" x2="19.07" y2="19.07"></line><line x1="2" y1="12" x2="6" y2="12"></line><line x1="18" y1="12" x2="22" y2="12"></line><line x1="4.93" y1="19.07" x2="7.76" y2="16.24"></line><line x1="16.24" y1="7.76" x2="19.07" y2="4.93"></line>',
lock: '<rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect><path d="M7 11V7a5 5 0 0 1 10 0v4"></path>',
"log-in":
'<path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4"></path><polyline points="10 17 15 12 10 7"></polyline><line x1="15" y1="12" x2="3" y2="12"></line>',
"log-out":
'<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path><polyline points="16 17 21 12 16 7"></polyline><line x1="21" y1="12" x2="9" y2="12"></line>',
mail: '<path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path><polyline points="22,6 12,13 2,6"></polyline>',
"map-pin":
'<path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path><circle cx="12" cy="10" r="3"></circle>',
map: '<polygon points="1 6 1 22 8 18 16 22 23 18 23 2 16 6 8 2 1 6"></polygon><line x1="8" y1="2" x2="8" y2="18"></line><line x1="16" y1="6" x2="16" y2="22"></line>',
"maximize-2":
'<polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" y1="3" x2="14" y2="10"></line><line x1="3" y1="21" x2="10" y2="14"></line>',
maximize:
'<path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"></path>',
meh: '<circle cx="12" cy="12" r="10"></circle><line x1="8" y1="15" x2="16" y2="15"></line><line x1="9" y1="9" x2="9.01" y2="9"></line><line x1="15" y1="9" x2="15.01" y2="9"></line>',
menu: '<line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line>',
"message-circle":
'<path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"></path>',
"message-square":
'<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path>',
"mic-off":
'<line x1="1" y1="1" x2="23" y2="23"></line><path d="M9 9v3a3 3 0 0 0 5.12 2.12M15 9.34V4a3 3 0 0 0-5.94-.6"></path><path d="M17 16.95A7 7 0 0 1 5 12v-2m14 0v2a7 7 0 0 1-.11 1.23"></path><line x1="12" y1="19" x2="12" y2="23"></line><line x1="8" y1="23" x2="16" y2="23"></line>',
mic: '<path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"></path><path d="M19 10v2a7 7 0 0 1-14 0v-2"></path><line x1="12" y1="19" x2="12" y2="23"></line><line x1="8" y1="23" x2="16" y2="23"></line>',
"minimize-2":
'<polyline points="4 14 10 14 10 20"></polyline><polyline points="20 10 14 10 14 4"></polyline><line x1="14" y1="10" x2="21" y2="3"></line><line x1="3" y1="21" x2="10" y2="14"></line>',
minimize:
'<path d="M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"></path>',
"minus-circle":
'<circle cx="12" cy="12" r="10"></circle><line x1="8" y1="12" x2="16" y2="12"></line>',
"minus-square":
'<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="8" y1="12" x2="16" y2="12"></line>',
minus: '<line x1="5" y1="12" x2="19" y2="12"></line>',
monitor:
'<rect x="2" y="3" width="20" height="14" rx="2" ry="2"></rect><line x1="8" y1="21" x2="16" y2="21"></line><line x1="12" y1="17" x2="12" y2="21"></line>',
moon: '<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>',
"more-horizontal":
'<circle cx="12" cy="12" r="1"></circle><circle cx="19" cy="12" r="1"></circle><circle cx="5" cy="12" r="1"></circle>',
"more-vertical":
'<circle cx="12" cy="12" r="1"></circle><circle cx="12" cy="5" r="1"></circle><circle cx="12" cy="19" r="1"></circle>',
"mouse-pointer":
'<path d="M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z"></path><path d="M13 13l6 6"></path>',
move: '<polyline points="5 9 2 12 5 15"></polyline><polyline points="9 5 12 2 15 5"></polyline><polyline points="15 19 12 22 9 19"></polyline><polyline points="19 9 22 12 19 15"></polyline><line x1="2" y1="12" x2="22" y2="12"></line><line x1="12" y1="2" x2="12" y2="22"></line>',
music: '<path d="M9 18V5l12-2v13"></path><circle cx="6" cy="18" r="3"></circle><circle cx="18" cy="16" r="3"></circle>',
"navigation-2":
'<polygon points="12 2 19 21 12 17 5 21 12 2"></polygon>',
navigation:
'<polygon points="3 11 22 2 13 21 11 13 3 11"></polygon>',
octagon:
'<polygon points="7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"></polygon>',
package:
'<line x1="16.5" y1="9.4" x2="7.5" y2="4.21"></line><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path><polyline points="3.27 6.96 12 12.01 20.73 6.96"></polyline><line x1="12" y1="22.08" x2="12" y2="12"></line>',
paperclip:
'<path d="M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"></path>',
"pause-circle":
'<circle cx="12" cy="12" r="10"></circle><line x1="10" y1="15" x2="10" y2="9"></line><line x1="14" y1="15" x2="14" y2="9"></line>',
pause: '<rect x="6" y="4" width="4" height="16"></rect><rect x="14" y="4" width="4" height="16"></rect>',
"pen-tool":
'<path d="M12 19l7-7 3 3-7 7-3-3z"></path><path d="M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z"></path><path d="M2 2l7.586 7.586"></path><circle cx="11" cy="11" r="2"></circle>',
percent:
'<line x1="19" y1="5" x2="5" y2="19"></line><circle cx="6.5" cy="6.5" r="2.5"></circle><circle cx="17.5" cy="17.5" r="2.5"></circle>',
"phone-call":
'<path d="M15.05 5A5 5 0 0 1 19 8.95M15.05 1A9 9 0 0 1 23 8.94m-1 7.98v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path>',
"phone-forwarded":
'<polyline points="19 1 23 5 19 9"></polyline><line x1="15" y1="5" x2="23" y2="5"></line><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path>',
"phone-incoming":
'<polyline points="16 2 16 8 22 8"></polyline><line x1="23" y1="1" x2="16" y2="8"></line><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path>',
"phone-missed":
'<line x1="23" y1="1" x2="17" y2="7"></line><line x1="17" y1="1" x2="23" y2="7"></line><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path>',
"phone-off":
'<path d="M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91"></path><line x1="23" y1="1" x2="1" y2="23"></line>',
"phone-outgoing":
'<polyline points="23 7 23 1 17 1"></polyline><line x1="16" y1="8" x2="23" y2="1"></line><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path>',
phone: '<path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path>',
"pie-chart":
'<path d="M21.21 15.89A10 10 0 1 1 8 2.83"></path><path d="M22 12A10 10 0 0 0 12 2v10z"></path>',
"play-circle":
'<circle cx="12" cy="12" r="10"></circle><polygon points="10 8 16 12 10 16 10 8"></polygon>',
play: '<polygon points="5 3 19 12 5 21 5 3"></polygon>',
"plus-circle":
'<circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="16"></line><line x1="8" y1="12" x2="16" y2="12"></line>',
"plus-square":
'<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="12" y1="8" x2="12" y2="16"></line><line x1="8" y1="12" x2="16" y2="12"></line>',
plus: '<line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line>',
pocket: '<path d="M4 3h16a2 2 0 0 1 2 2v6a10 10 0 0 1-10 10A10 10 0 0 1 2 11V5a2 2 0 0 1 2-2z"></path><polyline points="8 10 12 14 16 10"></polyline>',
power: '<path d="M18.36 6.64a9 9 0 1 1-12.73 0"></path><line x1="12" y1="2" x2="12" y2="12"></line>',
printer:
'<polyline points="6 9 6 2 18 2 18 9"></polyline><path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"></path><rect x="6" y="14" width="12" height="8"></rect>',
radio: '<circle cx="12" cy="12" r="2"></circle><path d="M16.24 7.76a6 6 0 0 1 0 8.49m-8.48-.01a6 6 0 0 1 0-8.49m11.31-2.82a10 10 0 0 1 0 14.14m-14.14 0a10 10 0 0 1 0-14.14"></path>',
"refresh-ccw":
'<polyline points="1 4 1 10 7 10"></polyline><polyline points="23 20 23 14 17 14"></polyline><path d="M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 0 1 3.51 15"></path>',
"refresh-cw":
'<polyline points="23 4 23 10 17 10"></polyline><polyline points="1 20 1 14 7 14"></polyline><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"></path>',
repeat: '<polyline points="17 1 21 5 17 9"></polyline><path d="M3 11V9a4 4 0 0 1 4-4h14"></path><polyline points="7 23 3 19 7 15"></polyline><path d="M21 13v2a4 4 0 0 1-4 4H3"></path>',
rewind: '<polygon points="11 19 2 12 11 5 11 19"></polygon><polygon points="22 19 13 12 22 5 22 19"></polygon>',
"rotate-ccw":
'<polyline points="1 4 1 10 7 10"></polyline><path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"></path>',
"rotate-cw":
'<polyline points="23 4 23 10 17 10"></polyline><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"></path>',
rss: '<path d="M4 11a9 9 0 0 1 9 9"></path><path d="M4 4a16 16 0 0 1 16 16"></path><circle cx="5" cy="19" r="1"></circle>',
save: '<path d="M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"></path><polyline points="17 21 17 13 7 13 7 21"></polyline><polyline points="7 3 7 8 15 8"></polyline>',
scissors:
'<circle cx="6" cy="6" r="3"></circle><circle cx="6" cy="18" r="3"></circle><line x1="20" y1="4" x2="8.12" y2="15.88"></line><line x1="14.47" y1="14.48" x2="20" y2="20"></line><line x1="8.12" y1="8.12" x2="12" y2="12"></line>',
search: '<circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line>',
send: '<line x1="22" y1="2" x2="11" y2="13"></line><polygon points="22 2 15 22 11 13 2 9 22 2"></polygon>',
server: '<rect x="2" y="2" width="20" height="8" rx="2" ry="2"></rect><rect x="2" y="14" width="20" height="8" rx="2" ry="2"></rect><line x1="6" y1="6" x2="6.01" y2="6"></line><line x1="6" y1="18" x2="6.01" y2="18"></line>',
settings:
'<circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path>',
"share-2":
'<circle cx="18" cy="5" r="3"></circle><circle cx="6" cy="12" r="3"></circle><circle cx="18" cy="19" r="3"></circle><line x1="8.59" y1="13.51" x2="15.42" y2="17.49"></line><line x1="15.41" y1="6.51" x2="8.59" y2="10.49"></line>',
share: '<path d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"></path><polyline points="16 6 12 2 8 6"></polyline><line x1="12" y1="2" x2="12" y2="15"></line>',
"shield-off":
'<path d="M19.69 14a6.9 6.9 0 0 0 .31-2V5l-8-3-3.16 1.18"></path><path d="M4.73 4.73L4 5v7c0 6 8 10 8 10a20.29 20.29 0 0 0 5.62-4.38"></path><line x1="1" y1="1" x2="23" y2="23"></line>',
shield: '<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path>',
"shopping-bag":
'<path d="M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z"></path><line x1="3" y1="6" x2="21" y2="6"></line><path d="M16 10a4 4 0 0 1-8 0"></path>',
"shopping-cart":
'<circle cx="9" cy="21" r="1"></circle><circle cx="20" cy="21" r="1"></circle><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path>',
shuffle:
'<polyline points="16 3 21 3 21 8"></polyline><line x1="4" y1="20" x2="21" y2="3"></line><polyline points="21 16 21 21 16 21"></polyline><line x1="15" y1="15" x2="21" y2="21"></line><line x1="4" y1="4" x2="9" y2="9"></line>',
sidebar:
'<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="9" y1="3" x2="9" y2="21"></line>',
"skip-back":
'<polygon points="19 20 9 12 19 4 19 20"></polygon><line x1="5" y1="19" x2="5" y2="5"></line>',
"skip-forward":
'<polygon points="5 4 15 12 5 20 5 4"></polygon><line x1="19" y1="5" x2="19" y2="19"></line>',
slack: '<path d="M14.5 10c-.83 0-1.5-.67-1.5-1.5v-5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5v5c0 .83-.67 1.5-1.5 1.5z"></path><path d="M20.5 10H19V8.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"></path><path d="M9.5 14c.83 0 1.5.67 1.5 1.5v5c0 .83-.67 1.5-1.5 1.5S8 21.33 8 20.5v-5c0-.83.67-1.5 1.5-1.5z"></path><path d="M3.5 14H5v1.5c0 .83-.67 1.5-1.5 1.5S2 16.33 2 15.5 2.67 14 3.5 14z"></path><path d="M14 14.5c0-.83.67-1.5 1.5-1.5h5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-5c-.83 0-1.5-.67-1.5-1.5z"></path><path d="M15.5 19H14v1.5c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5-.67-1.5-1.5-1.5z"></path><path d="M10 9.5C10 8.67 9.33 8 8.5 8h-5C2.67 8 2 8.67 2 9.5S2.67 11 3.5 11h5c.83 0 1.5-.67 1.5-1.5z"></path><path d="M8.5 5H10V3.5C10 2.67 9.33 2 8.5 2S7 2.67 7 3.5 7.67 5 8.5 5z"></path>',
slash: '<circle cx="12" cy="12" r="10"></circle><line x1="4.93" y1="4.93" x2="19.07" y2="19.07"></line>',
sliders:
'<line x1="4" y1="21" x2="4" y2="14"></line><line x1="4" y1="10" x2="4" y2="3"></line><line x1="12" y1="21" x2="12" y2="12"></line><line x1="12" y1="8" x2="12" y2="3"></line><line x1="20" y1="21" x2="20" y2="16"></line><line x1="20" y1="12" x2="20" y2="3"></line><line x1="1" y1="14" x2="7" y2="14"></line><line x1="9" y1="8" x2="15" y2="8"></line><line x1="17" y1="16" x2="23" y2="16"></line>',
smartphone:
'<rect x="5" y="2" width="14" height="20" rx="2" ry="2"></rect><line x1="12" y1="18" x2="12.01" y2="18"></line>',
smile: '<circle cx="12" cy="12" r="10"></circle><path d="M8 14s1.5 2 4 2 4-2 4-2"></path><line x1="9" y1="9" x2="9.01" y2="9"></line><line x1="15" y1="9" x2="15.01" y2="9"></line>',
speaker:
'<rect x="4" y="2" width="16" height="20" rx="2" ry="2"></rect><circle cx="12" cy="14" r="4"></circle><line x1="12" y1="6" x2="12.01" y2="6"></line>',
square: '<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>',
star: '<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon>',
"stop-circle":
'<circle cx="12" cy="12" r="10"></circle><rect x="9" y="9" width="6" height="6"></rect>',
sun: '<circle cx="12" cy="12" r="5"></circle><line x1="12" y1="1" x2="12" y2="3"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line><line x1="1" y1="12" x2="3" y2="12"></line><line x1="21" y1="12" x2="23" y2="12"></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>',
sunrise:
'<path d="M17 18a5 5 0 0 0-10 0"></path><line x1="12" y1="2" x2="12" y2="9"></line><line x1="4.22" y1="10.22" x2="5.64" y2="11.64"></line><line x1="1" y1="18" x2="3" y2="18"></line><line x1="21" y1="18" x2="23" y2="18"></line><line x1="18.36" y1="11.64" x2="19.78" y2="10.22"></line><line x1="23" y1="22" x2="1" y2="22"></line><polyline points="8 6 12 2 16 6"></polyline>',
sunset: '<path d="M17 18a5 5 0 0 0-10 0"></path><line x1="12" y1="9" x2="12" y2="2"></line><line x1="4.22" y1="10.22" x2="5.64" y2="11.64"></line><line x1="1" y1="18" x2="3" y2="18"></line><line x1="21" y1="18" x2="23" y2="18"></line><line x1="18.36" y1="11.64" x2="19.78" y2="10.22"></line><line x1="23" y1="22" x2="1" y2="22"></line><polyline points="16 5 12 9 8 5"></polyline>',
table: '<path d="M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18"></path>',
tablet: '<rect x="4" y="2" width="16" height="20" rx="2" ry="2"></rect><line x1="12" y1="18" x2="12.01" y2="18"></line>',
tag: '<path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"></path><line x1="7" y1="7" x2="7.01" y2="7"></line>',
target: '<circle cx="12" cy="12" r="10"></circle><circle cx="12" cy="12" r="6"></circle><circle cx="12" cy="12" r="2"></circle>',
terminal:
'<polyline points="4 17 10 11 4 5"></polyline><line x1="12" y1="19" x2="20" y2="19"></line>',
thermometer:
'<path d="M14 14.76V3.5a2.5 2.5 0 0 0-5 0v11.26a4.5 4.5 0 1 0 5 0z"></path>',
"thumbs-down":
'<path d="M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17"></path>',
"thumbs-up":
'<path d="M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"></path>',
"toggle-left":
'<rect x="1" y="5" width="22" height="14" rx="7" ry="7"></rect><circle cx="8" cy="12" r="3"></circle>',
"toggle-right":
'<rect x="1" y="5" width="22" height="14" rx="7" ry="7"></rect><circle cx="16" cy="12" r="3"></circle>',
tool: '<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"></path>',
"trash-2":
'<polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path><line x1="10" y1="11" x2="10" y2="17"></line><line x1="14" y1="11" x2="14" y2="17"></line>',
trash: '<polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>',
trello: '<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><rect x="7" y="7" width="3" height="9"></rect><rect x="14" y="7" width="3" height="5"></rect>',
"trending-down":
'<polyline points="23 18 13.5 8.5 8.5 13.5 1 6"></polyline><polyline points="17 18 23 18 23 12"></polyline>',
"trending-up":
'<polyline points="23 6 13.5 15.5 8.5 10.5 1 18"></polyline><polyline points="17 6 23 6 23 12"></polyline>',
triangle:
'<path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path>',
truck: '<rect x="1" y="3" width="15" height="13"></rect><polygon points="16 8 20 8 23 11 23 16 16 16 16 8"></polygon><circle cx="5.5" cy="18.5" r="2.5"></circle><circle cx="18.5" cy="18.5" r="2.5"></circle>',
tv: '<rect x="2" y="7" width="20" height="15" rx="2" ry="2"></rect><polyline points="17 2 12 7 7 2"></polyline>',
twitch: '<path d="M21 2H3v16h5v4l4-4h5l4-4V2zM11 11V7M16 11V7"></path>',
twitter:
'<path d="M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z"></path>',
type: '<polyline points="4 7 4 4 20 4 20 7"></polyline><line x1="9" y1="20" x2="15" y2="20"></line><line x1="12" y1="4" x2="12" y2="20"></line>',
umbrella:
'<path d="M23 12a11.05 11.05 0 0 0-22 0zm-5 7a3 3 0 0 1-6 0v-7"></path>',
underline:
'<path d="M6 3v7a6 6 0 0 0 6 6 6 6 0 0 0 6-6V3"></path><line x1="4" y1="21" x2="20" y2="21"></line>',
unlock: '<rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect><path d="M7 11V7a5 5 0 0 1 9.9-1"></path>',
"upload-cloud":
'<polyline points="16 16 12 12 8 16"></polyline><line x1="12" y1="12" x2="12" y2="21"></line><path d="M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3"></path><polyline points="16 16 12 12 8 16"></polyline>',
upload: '<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="17 8 12 3 7 8"></polyline><line x1="12" y1="3" x2="12" y2="15"></line>',
"user-check":
'<path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="8.5" cy="7" r="4"></circle><polyline points="17 11 19 13 23 9"></polyline>',
"user-minus":
'<path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="8.5" cy="7" r="4"></circle><line x1="23" y1="11" x2="17" y2="11"></line>',
"user-plus":
'<path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="8.5" cy="7" r="4"></circle><line x1="20" y1="8" x2="20" y2="14"></line><line x1="23" y1="11" x2="17" y2="11"></line>',
"user-x":
'<path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="8.5" cy="7" r="4"></circle><line x1="18" y1="8" x2="23" y2="13"></line><line x1="23" y1="8" x2="18" y2="13"></line>',
user: '<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle>',
users: '<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="9" cy="7" r="4"></circle><path d="M23 21v-2a4 4 0 0 0-3-3.87"></path><path d="M16 3.13a4 4 0 0 1 0 7.75"></path>',
"video-off":
'<path d="M16 16v1a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h2m5.66 0H14a2 2 0 0 1 2 2v3.34l1 1L23 7v10"></path><line x1="1" y1="1" x2="23" y2="23"></line>',
video: '<polygon points="23 7 16 12 23 17 23 7"></polygon><rect x="1" y="5" width="15" height="14" rx="2" ry="2"></rect>',
voicemail:
'<circle cx="5.5" cy="11.5" r="4.5"></circle><circle cx="18.5" cy="11.5" r="4.5"></circle><line x1="5.5" y1="16" x2="18.5" y2="16"></line>',
"volume-1":
'<polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"></polygon><path d="M15.54 8.46a5 5 0 0 1 0 7.07"></path>',
"volume-2":
'<polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"></polygon><path d="M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07"></path>',
"volume-x":
'<polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"></polygon><line x1="23" y1="9" x2="17" y2="15"></line><line x1="17" y1="9" x2="23" y2="15"></line>',
volume: '<polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"></polygon>',
watch: '<circle cx="12" cy="12" r="7"></circle><polyline points="12 9 12 12 13.5 13.5"></polyline><path d="M16.51 17.35l-.35 3.83a2 2 0 0 1-2 1.82H9.83a2 2 0 0 1-2-1.82l-.35-3.83m.01-10.7l.35-3.83A2 2 0 0 1 9.83 1h4.35a2 2 0 0 1 2 1.82l.35 3.83"></path>',
"wifi-off":
'<line x1="1" y1="1" x2="23" y2="23"></line><path d="M16.72 11.06A10.94 10.94 0 0 1 19 12.55"></path><path d="M5 12.55a10.94 10.94 0 0 1 5.17-2.39"></path><path d="M10.71 5.05A16 16 0 0 1 22.58 9"></path><path d="M1.42 9a15.91 15.91 0 0 1 4.7-2.88"></path><path d="M8.53 16.11a6 6 0 0 1 6.95 0"></path><line x1="12" y1="20" x2="12.01" y2="20"></line>',
wifi: '<path d="M5 12.55a11 11 0 0 1 14.08 0"></path><path d="M1.42 9a16 16 0 0 1 21.16 0"></path><path d="M8.53 16.11a6 6 0 0 1 6.95 0"></path><line x1="12" y1="20" x2="12.01" y2="20"></line>',
wind: '<path d="M9.59 4.59A2 2 0 1 1 11 8H2m10.59 11.41A2 2 0 1 0 14 16H2m15.73-8.27A2.5 2.5 0 1 1 19.5 12H2"></path>',
"x-circle":
'<circle cx="12" cy="12" r="10"></circle><line x1="15" y1="9" x2="9" y2="15"></line><line x1="9" y1="9" x2="15" y2="15"></line>',
"x-octagon":
'<polygon points="7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"></polygon><line x1="15" y1="9" x2="9" y2="15"></line><line x1="9" y1="9" x2="15" y2="15"></line>',
"x-square":
'<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="9" y1="9" x2="15" y2="15"></line><line x1="15" y1="9" x2="9" y2="15"></line>',
x: '<line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line>',
youtube:
'<path d="M22.54 6.42a2.78 2.78 0 0 0-1.94-2C18.88 4 12 4 12 4s-6.88 0-8.6.46a2.78 2.78 0 0 0-1.94 2A29 29 0 0 0 1 11.75a29 29 0 0 0 .46 5.33A2.78 2.78 0 0 0 3.4 19c1.72.46 8.6.46 8.6.46s6.88 0 8.6-.46a2.78 2.78 0 0 0 1.94-2 29 29 0 0 0 .46-5.25 29 29 0 0 0-.46-5.33z"></path><polygon points="9.75 15.02 15.5 11.75 9.75 8.48 9.75 15.02"></polygon>',
"zap-off":
'<polyline points="12.41 6.75 13 2 10.57 4.92"></polyline><polyline points="18.57 12.91 21 10 15.66 10"></polyline><polyline points="8 8 3 14 12 14 11 22 16 16"></polyline><line x1="1" y1="1" x2="23" y2="23"></line>',
zap: '<polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"></polygon>',
"zoom-in":
'<circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line><line x1="11" y1="8" x2="11" y2="14"></line><line x1="8" y1="11" x2="14" y2="11"></line>',
"zoom-out":
'<circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line><line x1="8" y1="11" x2="14" y2="11"></line>',
};
},
"./node_modules/classnames/dedupe.js": function (n, r, i) {
var o, s;
/*!
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/ (function () {
var l = (function () {
function a() {}
a.prototype = Object.create(null);
function u(x, S) {
for (var T = S.length, d = 0; d < T; ++d)
v(x, S[d]);
}
var c = {}.hasOwnProperty;
function f(x, S) {
x[S] = !0;
}
function h(x, S) {
for (var T in S) c.call(S, T) && (x[T] = !!S[T]);
}
var p = /\s+/;
function g(x, S) {
for (
var T = S.split(p), d = T.length, y = 0;
y < d;
++y
)
x[T[y]] = !0;
}
function v(x, S) {
if (!!S) {
var T = typeof S;
T === "string"
? g(x, S)
: Array.isArray(S)
? u(x, S)
: T === "object"
? h(x, S)
: T === "number" && f(x, S);
}
}
function b() {
for (
var x = arguments.length, S = Array(x), T = 0;
T < x;
T++
)
S[T] = arguments[T];
var d = new a();
u(d, S);
var y = [];
for (var m in d) d[m] && y.push(m);
return y.join(" ");
}
return b;
})();
typeof n != "undefined" && n.exports
? (n.exports = l)
: ((o = []),
(s = function () {
return l;
}.apply(r, o)),
s !== void 0 && (n.exports = s));
})();
},
"./node_modules/core-js/es/array/from.js": function (n, r, i) {
i("./node_modules/core-js/modules/es.string.iterator.js"),
i("./node_modules/core-js/modules/es.array.from.js");
var o = i("./node_modules/core-js/internals/path.js");
n.exports = o.Array.from;
},
"./node_modules/core-js/internals/a-function.js": function (n, r) {
n.exports = function (i) {
if (typeof i != "function")
throw TypeError(String(i) + " is not a function");
return i;
};
},
"./node_modules/core-js/internals/an-object.js": function (
n,
r,
i
) {
var o = i("./node_modules/core-js/internals/is-object.js");
n.exports = function (s) {
if (!o(s)) throw TypeError(String(s) + " is not an object");
return s;
};
},
"./node_modules/core-js/internals/array-from.js": function (
n,
r,
i
) {
var o = i("./node_modules/core-js/internals/bind-context.js"),
s = i("./node_modules/core-js/internals/to-object.js"),
l = i(
"./node_modules/core-js/internals/call-with-safe-iteration-closing.js"
),
a = i(
"./node_modules/core-js/internals/is-array-iterator-method.js"
),
u = i("./node_modules/core-js/internals/to-length.js"),
c = i(
"./node_modules/core-js/internals/create-property.js"
),
f = i(
"./node_modules/core-js/internals/get-iterator-method.js"
);
n.exports = function (p) {
var g = s(p),
v = typeof this == "function" ? this : Array,
b = arguments.length,
x = b > 1 ? arguments[1] : void 0,
S = x !== void 0,
T = 0,
d = f(g),
y,
m,
w,
k;
if (
(S && (x = o(x, b > 2 ? arguments[2] : void 0, 2)),
d != null && !(v == Array && a(d)))
)
for (
k = d.call(g), m = new v();
!(w = k.next()).done;
T++
)
c(m, T, S ? l(k, x, [w.value, T], !0) : w.value);
else
for (y = u(g.length), m = new v(y); y > T; T++)
c(m, T, S ? x(g[T], T) : g[T]);
return (m.length = T), m;
};
},
"./node_modules/core-js/internals/array-includes.js": function (
n,
r,
i
) {
var o = i(
"./node_modules/core-js/internals/to-indexed-object.js"
),
s = i("./node_modules/core-js/internals/to-length.js"),
l = i(
"./node_modules/core-js/internals/to-absolute-index.js"
);
n.exports = function (a) {
return function (u, c, f) {
var h = o(u),
p = s(h.length),
g = l(f, p),
v;
if (a && c != c) {
for (; p > g; )
if (((v = h[g++]), v != v)) return !0;
} else
for (; p > g; g++)
if ((a || g in h) && h[g] === c)
return a || g || 0;
return !a && -1;
};
};
},
"./node_modules/core-js/internals/bind-context.js": function (
n,
r,
i
) {
var o = i("./node_modules/core-js/internals/a-function.js");
n.exports = function (s, l, a) {
if ((o(s), l === void 0)) return s;
switch (a) {
case 0:
return function () {
return s.call(l);
};
case 1:
return function (u) {
return s.call(l, u);
};
case 2:
return function (u, c) {
return s.call(l, u, c);
};
case 3:
return function (u, c, f) {
return s.call(l, u, c, f);
};
}
return function () {
return s.apply(l, arguments);
};
};
},
"./node_modules/core-js/internals/call-with-safe-iteration-closing.js":
function (n, r, i) {
var o = i("./node_modules/core-js/internals/an-object.js");
n.exports = function (s, l, a, u) {
try {
return u ? l(o(a)[0], a[1]) : l(a);
} catch (f) {
var c = s.return;
throw (c !== void 0 && o(c.call(s)), f);
}
};
},
"./node_modules/core-js/internals/check-correctness-of-iteration.js":
function (n, r, i) {
var o = i(
"./node_modules/core-js/internals/well-known-symbol.js"
),
s = o("iterator"),
l = !1;
try {
var a = 0,
u = {
next: function () {
return { done: !!a++ };
},
return: function () {
l = !0;
},
};
(u[s] = function () {
return this;
}),
Array.from(u, function () {
throw 2;
});
} catch (c) {}
n.exports = function (c, f) {
if (!f && !l) return !1;
var h = !1;
try {
var p = {};
(p[s] = function () {
return {
next: function () {
return { done: (h = !0) };
},
};
}),
c(p);
} catch (g) {}
return h;
};
},
"./node_modules/core-js/internals/classof-raw.js": function (n, r) {
var i = {}.toString;
n.exports = function (o) {
return i.call(o).slice(8, -1);
};
},
"./node_modules/core-js/internals/classof.js": function (n, r, i) {
var o = i("./node_modules/core-js/internals/classof-raw.js"),
s = i(
"./node_modules/core-js/internals/well-known-symbol.js"
),
l = s("toStringTag"),
a =
o(
(function () {
return arguments;
})()
) == "Arguments",
u = function (c, f) {
try {
return c[f];
} catch (h) {}
};
n.exports = function (c) {
var f, h, p;
return c === void 0
? "Undefined"
: c === null
? "Null"
: typeof (h = u((f = Object(c)), l)) == "string"
? h
: a
? o(f)
: (p = o(f)) == "Object" &&
typeof f.callee == "function"
? "Arguments"
: p;
};
},
"./node_modules/core-js/internals/copy-constructor-properties.js":
function (n, r, i) {
var o = i("./node_modules/core-js/internals/has.js"),
s = i("./node_modules/core-js/internals/own-keys.js"),
l = i(
"./node_modules/core-js/internals/object-get-own-property-descriptor.js"
),
a = i(
"./node_modules/core-js/internals/object-define-property.js"
);
n.exports = function (u, c) {
for (
var f = s(c), h = a.f, p = l.f, g = 0;
g < f.length;
g++
) {
var v = f[g];
o(u, v) || h(u, v, p(c, v));
}
};
},
"./node_modules/core-js/internals/correct-prototype-getter.js":
function (n, r, i) {
var o = i("./node_modules/core-js/internals/fails.js");
n.exports = !o(function () {
function s() {}
return (
(s.prototype.constructor = null),
Object.getPrototypeOf(new s()) !== s.prototype
);
});
},
"./node_modules/core-js/internals/create-iterator-constructor.js":
function (n, r, i) {
var o = i(
"./node_modules/core-js/internals/iterators-core.js"
).IteratorPrototype,
s = i(
"./node_modules/core-js/internals/object-create.js"
),
l = i(
"./node_modules/core-js/internals/create-property-descriptor.js"
),
a = i(
"./node_modules/core-js/internals/set-to-string-tag.js"
),
u = i("./node_modules/core-js/internals/iterators.js"),
c = function () {
return this;
};
n.exports = function (f, h, p) {
var g = h + " Iterator";
return (
(f.prototype = s(o, { next: l(1, p) })),
a(f, g, !1, !0),
(u[g] = c),
f
);
};
},
"./node_modules/core-js/internals/create-property-descriptor.js":
function (n, r) {
n.exports = function (i, o) {
return {
enumerable: !(i & 1),
configurable: !(i & 2),
writable: !(i & 4),
value: o,
};
};
},
"./node_modules/core-js/internals/create-property.js": function (
n,
r,
i
) {
var o = i("./node_modules/core-js/internals/to-primitive.js"),
s = i(
"./node_modules/core-js/internals/object-define-property.js"
),
l = i(
"./node_modules/core-js/internals/create-property-descriptor.js"
);
n.exports = function (a, u, c) {
var f = o(u);
f in a ? s.f(a, f, l(0, c)) : (a[f] = c);
};
},
"./node_modules/core-js/internals/define-iterator.js": function (
n,
r,
i
) {
var o = i("./node_modules/core-js/internals/export.js"),
s = i(
"./node_modules/core-js/internals/create-iterator-constructor.js"
),
l = i(
"./node_modules/core-js/internals/object-get-prototype-of.js"
),
a = i(
"./node_modules/core-js/internals/object-set-prototype-of.js"
),
u = i(
"./node_modules/core-js/internals/set-to-string-tag.js"
),
c = i("./node_modules/core-js/internals/hide.js"),
f = i("./node_modules/core-js/internals/redefine.js"),
h = i(
"./node_modules/core-js/internals/well-known-symbol.js"
),
p = i("./node_modules/core-js/internals/is-pure.js"),
g = i("./node_modules/core-js/internals/iterators.js"),
v = i("./node_modules/core-js/internals/iterators-core.js"),
b = v.IteratorPrototype,
x = v.BUGGY_SAFARI_ITERATORS,
S = h("iterator"),
T = "keys",
d = "values",
y = "entries",
m = function () {
return this;
};
n.exports = function (w, k, _, C, E, R, P) {
s(_, k, C);
var L = function (Le) {
if (Le === E && K) return K;
if (!x && Le in N) return N[Le];
switch (Le) {
case T:
return function () {
return new _(this, Le);
};
case d:
return function () {
return new _(this, Le);
};
case y:
return function () {
return new _(this, Le);
};
}
return function () {
return new _(this);
};
},
I = k + " Iterator",
M = !1,
N = w.prototype,
D = N[S] || N["@@iterator"] || (E && N[E]),
K = (!x && D) || L(E),
ae = (k == "Array" && N.entries) || D,
Q,
me,
je;
if (
(ae &&
((Q = l(ae.call(new w()))),
b !== Object.prototype &&
Q.next &&
(!p &&
l(Q) !== b &&
(a
? a(Q, b)
: typeof Q[S] != "function" &&
c(Q, S, m)),
u(Q, I, !0, !0),
p && (g[I] = m))),
E == d &&
D &&
D.name !== d &&
((M = !0),
(K = function () {
return D.call(this);
})),
(!p || P) && N[S] !== K && c(N, S, K),
(g[k] = K),
E)
)
if (
((me = {
values: L(d),
keys: R ? K : L(T),
entries: L(y),
}),
P)
)
for (je in me)
(x || M || !(je in N)) && f(N, je, me[je]);
else o({ target: k, proto: !0, forced: x || M }, me);
return me;
};
},
"./node_modules/core-js/internals/descriptors.js": function (
n,
r,
i
) {
var o = i("./node_modules/core-js/internals/fails.js");
n.exports = !o(function () {
return (
Object.defineProperty({}, "a", {
get: function () {
return 7;
},
}).a != 7
);
});
},
"./node_modules/core-js/internals/document-create-element.js":
function (n, r, i) {
var o = i("./node_modules/core-js/internals/global.js"),
s = i("./node_modules/core-js/internals/is-object.js"),
l = o.document,
a = s(l) && s(l.createElement);
n.exports = function (u) {
return a ? l.createElement(u) : {};
};
},
"./node_modules/core-js/internals/enum-bug-keys.js": function (
n,
r
) {
n.exports = [
"constructor",
"hasOwnProperty",
"isPrototypeOf",
"propertyIsEnumerable",
"toLocaleString",
"toString",
"valueOf",
];
},
"./node_modules/core-js/internals/export.js": function (n, r, i) {
var o = i("./node_modules/core-js/internals/global.js"),
s = i(
"./node_modules/core-js/internals/object-get-own-property-descriptor.js"
).f,
l = i("./node_modules/core-js/internals/hide.js"),
a = i("./node_modules/core-js/internals/redefine.js"),
u = i("./node_modules/core-js/internals/set-global.js"),
c = i(
"./node_modules/core-js/internals/copy-constructor-properties.js"
),
f = i("./node_modules/core-js/internals/is-forced.js");
n.exports = function (h, p) {
var g = h.target,
v = h.global,
b = h.stat,
x,
S,
T,
d,
y,
m;
if (
(v
? (S = o)
: b
? (S = o[g] || u(g, {}))
: (S = (o[g] || {}).prototype),
S)
)
for (T in p) {
if (
((y = p[T]),
h.noTargetGet
? ((m = s(S, T)), (d = m && m.value))
: (d = S[T]),
(x = f(
v ? T : g + (b ? "." : "#") + T,
h.forced
)),
!x && d !== void 0)
) {
if (typeof y == typeof d) continue;
c(y, d);
}
(h.sham || (d && d.sham)) && l(y, "sham", !0),
a(S, T, y, h);
}
};
},
"./node_modules/core-js/internals/fails.js": function (n, r) {
n.exports = function (i) {
try {
return !!i();
} catch (o) {
return !0;
}
};
},
"./node_modules/core-js/internals/function-to-string.js": function (
n,
r,
i
) {
var o = i("./node_modules/core-js/internals/shared.js");
n.exports = o("native-function-to-string", Function.toString);
},
"./node_modules/core-js/internals/get-iterator-method.js":
function (n, r, i) {
var o = i("./node_modules/core-js/internals/classof.js"),
s = i("./node_modules/core-js/internals/iterators.js"),
l = i(
"./node_modules/core-js/internals/well-known-symbol.js"
),
a = l("iterator");
n.exports = function (u) {
if (u != null)
return u[a] || u["@@iterator"] || s[o(u)];
};
},
"./node_modules/core-js/internals/global.js": function (n, r, i) {
(function (o) {
var s = "object",
l = function (a) {
return a && a.Math == Math && a;
};
n.exports =
l(typeof globalThis == s && globalThis) ||
l(typeof window == s && window) ||
l(typeof self == s && self) ||
l(typeof o == s && o) ||
Function("return this")();
}.call(this, i("./node_modules/webpack/buildin/global.js")));
},
"./node_modules/core-js/internals/has.js": function (n, r) {
var i = {}.hasOwnProperty;
n.exports = function (o, s) {
return i.call(o, s);
};
},
"./node_modules/core-js/internals/hidden-keys.js": function (n, r) {
n.exports = {};
},
"./node_modules/core-js/internals/hide.js": function (n, r, i) {
var o = i("./node_modules/core-js/internals/descriptors.js"),
s = i(
"./node_modules/core-js/internals/object-define-property.js"
),
l = i(
"./node_modules/core-js/internals/create-property-descriptor.js"
);
n.exports = o
? function (a, u, c) {
return s.f(a, u, l(1, c));
}
: function (a, u, c) {
return (a[u] = c), a;
};
},
"./node_modules/core-js/internals/html.js": function (n, r, i) {
var o = i("./node_modules/core-js/internals/global.js"),
s = o.document;
n.exports = s && s.documentElement;
},
"./node_modules/core-js/internals/ie8-dom-define.js": function (
n,
r,
i
) {
var o = i("./node_modules/core-js/internals/descriptors.js"),
s = i("./node_modules/core-js/internals/fails.js"),
l = i(
"./node_modules/core-js/internals/document-create-element.js"
);
n.exports =
!o &&
!s(function () {
return (
Object.defineProperty(l("div"), "a", {
get: function () {
return 7;
},
}).a != 7
);
});
},
"./node_modules/core-js/internals/indexed-object.js": function (
n,
r,
i
) {
var o = i("./node_modules/core-js/internals/fails.js"),
s = i("./node_modules/core-js/internals/classof-raw.js"),
l = "".split;
n.exports = o(function () {
return !Object("z").propertyIsEnumerable(0);
})
? function (a) {
return s(a) == "String" ? l.call(a, "") : Object(a);
}
: Object;
},
"./node_modules/core-js/internals/internal-state.js": function (
n,
r,
i
) {
var o = i(
"./node_modules/core-js/internals/native-weak-map.js"
),
s = i("./node_modules/core-js/internals/global.js"),
l = i("./node_modules/core-js/internals/is-object.js"),
a = i("./node_modules/core-js/internals/hide.js"),
u = i("./node_modules/core-js/internals/has.js"),
c = i("./node_modules/core-js/internals/shared-key.js"),
f = i("./node_modules/core-js/internals/hidden-keys.js"),
h = s.WeakMap,
p,
g,
v,
b = function (w) {
return v(w) ? g(w) : p(w, {});
},
x = function (w) {
return function (k) {
var _;
if (!l(k) || (_ = g(k)).type !== w)
throw TypeError(
"Incompatible receiver, " + w + " required"
);
return _;
};
};
if (o) {
var S = new h(),
T = S.get,
d = S.has,
y = S.set;
(p = function (w, k) {
return y.call(S, w, k), k;
}),
(g = function (w) {
return T.call(S, w) || {};
}),
(v = function (w) {
return d.call(S, w);
});
} else {
var m = c("state");
(f[m] = !0),
(p = function (w, k) {
return a(w, m, k), k;
}),
(g = function (w) {
return u(w, m) ? w[m] : {};
}),
(v = function (w) {
return u(w, m);
});
}
n.exports = {
set: p,
get: g,
has: v,
enforce: b,
getterFor: x,
};
},
"./node_modules/core-js/internals/is-array-iterator-method.js":
function (n, r, i) {
var o = i(
"./node_modules/core-js/internals/well-known-symbol.js"
),
s = i("./node_modules/core-js/internals/iterators.js"),
l = o("iterator"),
a = Array.prototype;
n.exports = function (u) {
return u !== void 0 && (s.Array === u || a[l] === u);
};
},
"./node_modules/core-js/internals/is-forced.js": function (
n,
r,
i
) {
var o = i("./node_modules/core-js/internals/fails.js"),
s = /#|\.prototype\./,
l = function (h, p) {
var g = u[a(h)];
return g == f
? !0
: g == c
? !1
: typeof p == "function"
? o(p)
: !!p;
},
a = (l.normalize = function (h) {
return String(h).replace(s, ".").toLowerCase();
}),
u = (l.data = {}),
c = (l.NATIVE = "N"),
f = (l.POLYFILL = "P");
n.exports = l;
},
"./node_modules/core-js/internals/is-object.js": function (n, r) {
n.exports = function (i) {
return typeof i == "object"
? i !== null
: typeof i == "function";
};
},
"./node_modules/core-js/internals/is-pure.js": function (n, r) {
n.exports = !1;
},
"./node_modules/core-js/internals/iterators-core.js": function (
n,
r,
i
) {
var o = i(
"./node_modules/core-js/internals/object-get-prototype-of.js"
),
s = i("./node_modules/core-js/internals/hide.js"),
l = i("./node_modules/core-js/internals/has.js"),
a = i(
"./node_modules/core-js/internals/well-known-symbol.js"
),
u = i("./node_modules/core-js/internals/is-pure.js"),
c = a("iterator"),
f = !1,
h = function () {
return this;
},
p,
g,
v;
[].keys &&
((v = [].keys()),
"next" in v
? ((g = o(o(v))), g !== Object.prototype && (p = g))
: (f = !0)),
p == null && (p = {}),
!u && !l(p, c) && s(p, c, h),
(n.exports = {
IteratorPrototype: p,
BUGGY_SAFARI_ITERATORS: f,
});
},
"./node_modules/core-js/internals/iterators.js": function (n, r) {
n.exports = {};
},
"./node_modules/core-js/internals/native-symbol.js": function (
n,
r,
i
) {
var o = i("./node_modules/core-js/internals/fails.js");
n.exports =
!!Object.getOwnPropertySymbols &&
!o(function () {
return !String(Symbol());
});
},
"./node_modules/core-js/internals/native-weak-map.js": function (
n,
r,
i
) {
var o = i("./node_modules/core-js/internals/global.js"),
s = i(
"./node_modules/core-js/internals/function-to-string.js"
),
l = o.WeakMap;
n.exports =
typeof l == "function" && /native code/.test(s.call(l));
},
"./node_modules/core-js/internals/object-create.js": function (
n,
r,
i
) {
var o = i("./node_modules/core-js/internals/an-object.js"),
s = i(
"./node_modules/core-js/internals/object-define-properties.js"
),
l = i("./node_modules/core-js/internals/enum-bug-keys.js"),
a = i("./node_modules/core-js/internals/hidden-keys.js"),
u = i("./node_modules/core-js/internals/html.js"),
c = i(
"./node_modules/core-js/internals/document-create-element.js"
),
f = i("./node_modules/core-js/internals/shared-key.js"),
h = f("IE_PROTO"),
p = "prototype",
g = function () {},
v = function () {
var b = c("iframe"),
x = l.length,
S = "<",
T = "script",
d = ">",
y = "java" + T + ":",
m;
for (
b.style.display = "none",
u.appendChild(b),
b.src = String(y),
m = b.contentWindow.document,
m.open(),
m.write(
S +
T +
d +
"document.F=Object" +
S +
"/" +
T +
d
),
m.close(),
v = m.F;
x--;
)
delete v[p][l[x]];
return v();
};
(n.exports =
Object.create ||
function (x, S) {
var T;
return (
x !== null
? ((g[p] = o(x)),
(T = new g()),
(g[p] = null),
(T[h] = x))
: (T = v()),
S === void 0 ? T : s(T, S)
);
}),
(a[h] = !0);
},
"./node_modules/core-js/internals/object-define-properties.js":
function (n, r, i) {
var o = i(
"./node_modules/core-js/internals/descriptors.js"
),
s = i(
"./node_modules/core-js/internals/object-define-property.js"
),
l = i("./node_modules/core-js/internals/an-object.js"),
a = i(
"./node_modules/core-js/internals/object-keys.js"
);
n.exports = o
? Object.defineProperties
: function (c, f) {
l(c);
for (
var h = a(f), p = h.length, g = 0, v;
p > g;
)
s.f(c, (v = h[g++]), f[v]);
return c;
};
},
"./node_modules/core-js/internals/object-define-property.js":
function (n, r, i) {
var o = i(
"./node_modules/core-js/internals/descriptors.js"
),
s = i(
"./node_modules/core-js/internals/ie8-dom-define.js"
),
l = i("./node_modules/core-js/internals/an-object.js"),
a = i(
"./node_modules/core-js/internals/to-primitive.js"
),
u = Object.defineProperty;
r.f = o
? u
: function (f, h, p) {
if ((l(f), (h = a(h, !0)), l(p), s))
try {
return u(f, h, p);
} catch (g) {}
if ("get" in p || "set" in p)
throw TypeError("Accessors not supported");
return "value" in p && (f[h] = p.value), f;
};
},
"./node_modules/core-js/internals/object-get-own-property-descriptor.js":
function (n, r, i) {
var o = i(
"./node_modules/core-js/internals/descriptors.js"
),
s = i(
"./node_modules/core-js/internals/object-property-is-enumerable.js"
),
l = i(
"./node_modules/core-js/internals/create-property-descriptor.js"
),
a = i(
"./node_modules/core-js/internals/to-indexed-object.js"
),
u = i(
"./node_modules/core-js/internals/to-primitive.js"
),
c = i("./node_modules/core-js/internals/has.js"),
f = i(
"./node_modules/core-js/internals/ie8-dom-define.js"
),
h = Object.getOwnPropertyDescriptor;
r.f = o
? h
: function (g, v) {
if (((g = a(g)), (v = u(v, !0)), f))
try {
return h(g, v);
} catch (b) {}
if (c(g, v)) return l(!s.f.call(g, v), g[v]);
};
},
"./node_modules/core-js/internals/object-get-own-property-names.js":
function (n, r, i) {
var o = i(
"./node_modules/core-js/internals/object-keys-internal.js"
),
s = i(
"./node_modules/core-js/internals/enum-bug-keys.js"
),
l = s.concat("length", "prototype");
r.f =
Object.getOwnPropertyNames ||
function (u) {
return o(u, l);
};
},
"./node_modules/core-js/internals/object-get-own-property-symbols.js":
function (n, r) {
r.f = Object.getOwnPropertySymbols;
},
"./node_modules/core-js/internals/object-get-prototype-of.js":
function (n, r, i) {
var o = i("./node_modules/core-js/internals/has.js"),
s = i("./node_modules/core-js/internals/to-object.js"),
l = i("./node_modules/core-js/internals/shared-key.js"),
a = i(
"./node_modules/core-js/internals/correct-prototype-getter.js"
),
u = l("IE_PROTO"),
c = Object.prototype;
n.exports = a
? Object.getPrototypeOf
: function (f) {
return (
(f = s(f)),
o(f, u)
? f[u]
: typeof f.constructor == "function" &&
f instanceof f.constructor
? f.constructor.prototype
: f instanceof Object
? c
: null
);
};
},
"./node_modules/core-js/internals/object-keys-internal.js":
function (n, r, i) {
var o = i("./node_modules/core-js/internals/has.js"),
s = i(
"./node_modules/core-js/internals/to-indexed-object.js"
),
l = i(
"./node_modules/core-js/internals/array-includes.js"
),
a = i(
"./node_modules/core-js/internals/hidden-keys.js"
),
u = l(!1);
n.exports = function (c, f) {
var h = s(c),
p = 0,
g = [],
v;
for (v in h) !o(a, v) && o(h, v) && g.push(v);
for (; f.length > p; )
o(h, (v = f[p++])) && (~u(g, v) || g.push(v));
return g;
};
},
"./node_modules/core-js/internals/object-keys.js": function (
n,
r,
i
) {
var o = i(
"./node_modules/core-js/internals/object-keys-internal.js"
),
s = i("./node_modules/core-js/internals/enum-bug-keys.js");
n.exports =
Object.keys ||
function (a) {
return o(a, s);
};
},
"./node_modules/core-js/internals/object-property-is-enumerable.js":
function (n, r, i) {
var o = {}.propertyIsEnumerable,
s = Object.getOwnPropertyDescriptor,
l = s && !o.call({ 1: 2 }, 1);
r.f = l
? function (u) {
var c = s(this, u);
return !!c && c.enumerable;
}
: o;
},
"./node_modules/core-js/internals/object-set-prototype-of.js":
function (n, r, i) {
var o = i(
"./node_modules/core-js/internals/validate-set-prototype-of-arguments.js"
);
n.exports =
Object.setPrototypeOf ||
("__proto__" in {}
? (function () {
var s = !1,
l = {},
a;
try {
(a = Object.getOwnPropertyDescriptor(
Object.prototype,
"__proto__"
).set),
a.call(l, []),
(s = l instanceof Array);
} catch (u) {}
return function (c, f) {
return (
o(c, f),
s
? a.call(c, f)
: (c.__proto__ = f),
c
);
};
})()
: void 0);
},
"./node_modules/core-js/internals/own-keys.js": function (n, r, i) {
var o = i("./node_modules/core-js/internals/global.js"),
s = i(
"./node_modules/core-js/internals/object-get-own-property-names.js"
),
l = i(
"./node_modules/core-js/internals/object-get-own-property-symbols.js"
),
a = i("./node_modules/core-js/internals/an-object.js"),
u = o.Reflect;
n.exports =
(u && u.ownKeys) ||
function (f) {
var h = s.f(a(f)),
p = l.f;
return p ? h.concat(p(f)) : h;
};
},
"./node_modules/core-js/internals/path.js": function (n, r, i) {
n.exports = i("./node_modules/core-js/internals/global.js");
},
"./node_modules/core-js/internals/redefine.js": function (n, r, i) {
var o = i("./node_modules/core-js/internals/global.js"),
s = i("./node_modules/core-js/internals/shared.js"),
l = i("./node_modules/core-js/internals/hide.js"),
a = i("./node_modules/core-js/internals/has.js"),
u = i("./node_modules/core-js/internals/set-global.js"),
c = i(
"./node_modules/core-js/internals/function-to-string.js"
),
f = i("./node_modules/core-js/internals/internal-state.js"),
h = f.get,
p = f.enforce,
g = String(c).split("toString");
s("inspectSource", function (v) {
return c.call(v);
}),
(n.exports = function (v, b, x, S) {
var T = S ? !!S.unsafe : !1,
d = S ? !!S.enumerable : !1,
y = S ? !!S.noTargetGet : !1;
if (
(typeof x == "function" &&
(typeof b == "string" &&
!a(x, "name") &&
l(x, "name", b),
(p(x).source = g.join(
typeof b == "string" ? b : ""
))),
v === o)
) {
d ? (v[b] = x) : u(b, x);
return;
} else T ? !y && v[b] && (d = !0) : delete v[b];
d ? (v[b] = x) : l(v, b, x);
})(Function.prototype, "toString", function () {
return (
(typeof this == "function" && h(this).source) ||
c.call(this)
);
});
},
"./node_modules/core-js/internals/require-object-coercible.js":
function (n, r) {
n.exports = function (i) {
if (i == null)
throw TypeError("Can't call method on " + i);
return i;
};
},
"./node_modules/core-js/internals/set-global.js": function (
n,
r,
i
) {
var o = i("./node_modules/core-js/internals/global.js"),
s = i("./node_modules/core-js/internals/hide.js");
n.exports = function (l, a) {
try {
s(o, l, a);
} catch (u) {
o[l] = a;
}
return a;
};
},
"./node_modules/core-js/internals/set-to-string-tag.js": function (
n,
r,
i
) {
var o = i(
"./node_modules/core-js/internals/object-define-property.js"
).f,
s = i("./node_modules/core-js/internals/has.js"),
l = i(
"./node_modules/core-js/internals/well-known-symbol.js"
),
a = l("toStringTag");
n.exports = function (u, c, f) {
u &&
!s((u = f ? u : u.prototype), a) &&
o(u, a, { configurable: !0, value: c });
};
},
"./node_modules/core-js/internals/shared-key.js": function (
n,
r,
i
) {
var o = i("./node_modules/core-js/internals/shared.js"),
s = i("./node_modules/core-js/internals/uid.js"),
l = o("keys");
n.exports = function (a) {
return l[a] || (l[a] = s(a));
};
},
"./node_modules/core-js/internals/shared.js": function (n, r, i) {
var o = i("./node_modules/core-js/internals/global.js"),
s = i("./node_modules/core-js/internals/set-global.js"),
l = i("./node_modules/core-js/internals/is-pure.js"),
a = "__core-js_shared__",
u = o[a] || s(a, {});
(n.exports = function (c, f) {
return u[c] || (u[c] = f !== void 0 ? f : {});
})("versions", []).push({
version: "3.1.3",
mode: l ? "pure" : "global",
copyright: "\xA9 2019 Denis Pushkarev (zloirock.ru)",
});
},
"./node_modules/core-js/internals/string-at.js": function (
n,
r,
i
) {
var o = i("./node_modules/core-js/internals/to-integer.js"),
s = i(
"./node_modules/core-js/internals/require-object-coercible.js"
);
n.exports = function (l, a, u) {
var c = String(s(l)),
f = o(a),
h = c.length,
p,
g;
return f < 0 || f >= h
? u
? ""
: void 0
: ((p = c.charCodeAt(f)),
p < 55296 ||
p > 56319 ||
f + 1 === h ||
(g = c.charCodeAt(f + 1)) < 56320 ||
g > 57343
? u
? c.charAt(f)
: p
: u
? c.slice(f, f + 2)
: ((p - 55296) << 10) + (g - 56320) + 65536);
};
},
"./node_modules/core-js/internals/to-absolute-index.js": function (
n,
r,
i
) {
var o = i("./node_modules/core-js/internals/to-integer.js"),
s = Math.max,
l = Math.min;
n.exports = function (a, u) {
var c = o(a);
return c < 0 ? s(c + u, 0) : l(c, u);
};
},
"./node_modules/core-js/internals/to-indexed-object.js": function (
n,
r,
i
) {
var o = i("./node_modules/core-js/internals/indexed-object.js"),
s = i(
"./node_modules/core-js/internals/require-object-coercible.js"
);
n.exports = function (l) {
return o(s(l));
};
},
"./node_modules/core-js/internals/to-integer.js": function (n, r) {
var i = Math.ceil,
o = Math.floor;
n.exports = function (s) {
return isNaN((s = +s)) ? 0 : (s > 0 ? o : i)(s);
};
},
"./node_modules/core-js/internals/to-length.js": function (
n,
r,
i
) {
var o = i("./node_modules/core-js/internals/to-integer.js"),
s = Math.min;
n.exports = function (l) {
return l > 0 ? s(o(l), 9007199254740991) : 0;
};
},
"./node_modules/core-js/internals/to-object.js": function (
n,
r,
i
) {
var o = i(
"./node_modules/core-js/internals/require-object-coercible.js"
);
n.exports = function (s) {
return Object(o(s));
};
},
"./node_modules/core-js/internals/to-primitive.js": function (
n,
r,
i
) {
var o = i("./node_modules/core-js/internals/is-object.js");
n.exports = function (s, l) {
if (!o(s)) return s;
var a, u;
if (
(l &&
typeof (a = s.toString) == "function" &&
!o((u = a.call(s)))) ||
(typeof (a = s.valueOf) == "function" &&
!o((u = a.call(s)))) ||
(!l &&
typeof (a = s.toString) == "function" &&
!o((u = a.call(s))))
)
return u;
throw TypeError("Can't convert object to primitive value");
};
},
"./node_modules/core-js/internals/uid.js": function (n, r) {
var i = 0,
o = Math.random();
n.exports = function (s) {
return "Symbol(".concat(
s === void 0 ? "" : s,
")_",
(++i + o).toString(36)
);
};
},
"./node_modules/core-js/internals/validate-set-prototype-of-arguments.js":
function (n, r, i) {
var o = i("./node_modules/core-js/internals/is-object.js"),
s = i("./node_modules/core-js/internals/an-object.js");
n.exports = function (l, a) {
if ((s(l), !o(a) && a !== null))
throw TypeError(
"Can't set " + String(a) + " as a prototype"
);
};
},
"./node_modules/core-js/internals/well-known-symbol.js": function (
n,
r,
i
) {
var o = i("./node_modules/core-js/internals/global.js"),
s = i("./node_modules/core-js/internals/shared.js"),
l = i("./node_modules/core-js/internals/uid.js"),
a = i("./node_modules/core-js/internals/native-symbol.js"),
u = o.Symbol,
c = s("wks");
n.exports = function (f) {
return (
c[f] ||
(c[f] = (a && u[f]) || (a ? u : l)("Symbol." + f))
);
};
},
"./node_modules/core-js/modules/es.array.from.js": function (
n,
r,
i
) {
var o = i("./node_modules/core-js/internals/export.js"),
s = i("./node_modules/core-js/internals/array-from.js"),
l = i(
"./node_modules/core-js/internals/check-correctness-of-iteration.js"
),
a = !l(function (u) {
Array.from(u);
});
o({ target: "Array", stat: !0, forced: a }, { from: s });
},
"./node_modules/core-js/modules/es.string.iterator.js": function (
n,
r,
i
) {
var o = i("./node_modules/core-js/internals/string-at.js"),
s = i("./node_modules/core-js/internals/internal-state.js"),
l = i(
"./node_modules/core-js/internals/define-iterator.js"
),
a = "String Iterator",
u = s.set,
c = s.getterFor(a);
l(
String,
"String",
function (f) {
u(this, { type: a, string: String(f), index: 0 });
},
function () {
var h = c(this),
p = h.string,
g = h.index,
v;
return g >= p.length
? { value: void 0, done: !0 }
: ((v = o(p, g, !0)),
(h.index += v.length),
{ value: v, done: !1 });
}
);
},
"./node_modules/webpack/buildin/global.js": function (n, r) {
var i;
i = (function () {
return this;
})();
try {
i = i || Function("return this")() || (0, eval)("this");
} catch (o) {
typeof window == "object" && (i = window);
}
n.exports = i;
},
"./src/default-attrs.json": function (n) {
n.exports = {
xmlns: "http://www.w3.org/2000/svg",
width: 24,
height: 24,
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
"stroke-width": 2,
"stroke-linecap": "round",
"stroke-linejoin": "round",
};
},
"./src/icon.js": function (n, r, i) {
Object.defineProperty(r, "__esModule", { value: !0 });
var o =
Object.assign ||
function (v) {
for (var b = 1; b < arguments.length; b++) {
var x = arguments[b];
for (var S in x)
Object.prototype.hasOwnProperty.call(
x,
S
) && (v[S] = x[S]);
}
return v;
},
s = (function () {
function v(b, x) {
for (var S = 0; S < x.length; S++) {
var T = x[S];
(T.enumerable = T.enumerable || !1),
(T.configurable = !0),
"value" in T && (T.writable = !0),
Object.defineProperty(b, T.key, T);
}
}
return function (b, x, S) {
return x && v(b.prototype, x), S && v(b, S), b;
};
})(),
l = i("./node_modules/classnames/dedupe.js"),
a = f(l),
u = i("./src/default-attrs.json"),
c = f(u);
function f(v) {
return v && v.__esModule ? v : { default: v };
}
function h(v, b) {
if (!(v instanceof b))
throw new TypeError(
"Cannot call a class as a function"
);
}
var p = (function () {
function v(b, x) {
var S =
arguments.length > 2 && arguments[2] !== void 0
? arguments[2]
: [];
h(this, v),
(this.name = b),
(this.contents = x),
(this.tags = S),
(this.attrs = o({}, c.default, {
class: "feather feather-" + b,
}));
}
return (
s(v, [
{
key: "toSvg",
value: function () {
var x =
arguments.length > 0 &&
arguments[0] !== void 0
? arguments[0]
: {},
S = o({}, this.attrs, x, {
class: (0, a.default)(
this.attrs.class,
x.class
),
});
return (
"<svg " +
g(S) +
">" +
this.contents +
"</svg>"
);
},
},
{
key: "toString",
value: function () {
return this.contents;
},
},
]),
v
);
})();
function g(v) {
return Object.keys(v)
.map(function (b) {
return b + '="' + v[b] + '"';
})
.join(" ");
}
r.default = p;
},
"./src/icons.js": function (n, r, i) {
Object.defineProperty(r, "__esModule", { value: !0 });
var o = i("./src/icon.js"),
s = f(o),
l = i("./dist/icons.json"),
a = f(l),
u = i("./src/tags.json"),
c = f(u);
function f(h) {
return h && h.__esModule ? h : { default: h };
}
r.default = Object.keys(a.default)
.map(function (h) {
return new s.default(h, a.default[h], c.default[h]);
})
.reduce(function (h, p) {
return (h[p.name] = p), h;
}, {});
},
"./src/index.js": function (n, r, i) {
var o = i("./src/icons.js"),
s = f(o),
l = i("./src/to-svg.js"),
a = f(l),
u = i("./src/replace.js"),
c = f(u);
function f(h) {
return h && h.__esModule ? h : { default: h };
}
n.exports = {
icons: s.default,
toSvg: a.default,
replace: c.default,
};
},
"./src/replace.js": function (n, r, i) {
Object.defineProperty(r, "__esModule", { value: !0 });
var o =
Object.assign ||
function (g) {
for (var v = 1; v < arguments.length; v++) {
var b = arguments[v];
for (var x in b)
Object.prototype.hasOwnProperty.call(
b,
x
) && (g[x] = b[x]);
}
return g;
},
s = i("./node_modules/classnames/dedupe.js"),
l = c(s),
a = i("./src/icons.js"),
u = c(a);
function c(g) {
return g && g.__esModule ? g : { default: g };
}
function f() {
var g =
arguments.length > 0 && arguments[0] !== void 0
? arguments[0]
: {};
if (typeof document == "undefined")
throw new Error(
"`feather.replace()` only works in a browser environment."
);
var v = document.querySelectorAll("[data-feather]");
Array.from(v).forEach(function (b) {
return h(b, g);
});
}
function h(g) {
var v =
arguments.length > 1 && arguments[1] !== void 0
? arguments[1]
: {},
b = p(g),
x = b["data-feather"];
delete b["data-feather"];
var S = u.default[x].toSvg(
o({}, v, b, {
class: (0, l.default)(v.class, b.class),
})
),
T = new DOMParser().parseFromString(S, "image/svg+xml"),
d = T.querySelector("svg");
g.parentNode.replaceChild(d, g);
}
function p(g) {
return Array.from(g.attributes).reduce(function (v, b) {
return (v[b.name] = b.value), v;
}, {});
}
r.default = f;
},
"./src/tags.json": function (n) {
n.exports = {
activity: ["pulse", "health", "action", "motion"],
airplay: ["stream", "cast", "mirroring"],
"alert-circle": ["warning", "alert", "danger"],
"alert-octagon": ["warning", "alert", "danger"],
"alert-triangle": ["warning", "alert", "danger"],
"align-center": ["text alignment", "center"],
"align-justify": ["text alignment", "justified"],
"align-left": ["text alignment", "left"],
"align-right": ["text alignment", "right"],
anchor: [],
archive: ["index", "box"],
"at-sign": ["mention", "at", "email", "message"],
award: ["achievement", "badge"],
aperture: ["camera", "photo"],
"bar-chart": ["statistics", "diagram", "graph"],
"bar-chart-2": ["statistics", "diagram", "graph"],
battery: ["power", "electricity"],
"battery-charging": ["power", "electricity"],
bell: ["alarm", "notification", "sound"],
"bell-off": ["alarm", "notification", "silent"],
bluetooth: ["wireless"],
"book-open": ["read", "library"],
book: [
"read",
"dictionary",
"booklet",
"magazine",
"library",
],
bookmark: ["read", "clip", "marker", "tag"],
box: ["cube"],
briefcase: ["work", "bag", "baggage", "folder"],
calendar: ["date"],
camera: ["photo"],
cast: ["chromecast", "airplay"],
"chevron-down": ["expand"],
"chevron-up": ["collapse"],
circle: ["off", "zero", "record"],
clipboard: ["copy"],
clock: ["time", "watch", "alarm"],
"cloud-drizzle": ["weather", "shower"],
"cloud-lightning": ["weather", "bolt"],
"cloud-rain": ["weather"],
"cloud-snow": ["weather", "blizzard"],
cloud: ["weather"],
codepen: ["logo"],
codesandbox: ["logo"],
code: ["source", "programming"],
coffee: [
"drink",
"cup",
"mug",
"tea",
"cafe",
"hot",
"beverage",
],
columns: ["layout"],
command: ["keyboard", "cmd", "terminal", "prompt"],
compass: ["navigation", "safari", "travel", "direction"],
copy: ["clone", "duplicate"],
"corner-down-left": ["arrow", "return"],
"corner-down-right": ["arrow"],
"corner-left-down": ["arrow"],
"corner-left-up": ["arrow"],
"corner-right-down": ["arrow"],
"corner-right-up": ["arrow"],
"corner-up-left": ["arrow"],
"corner-up-right": ["arrow"],
cpu: ["processor", "technology"],
"credit-card": ["purchase", "payment", "cc"],
crop: ["photo", "image"],
crosshair: ["aim", "target"],
database: ["storage", "memory"],
delete: ["remove"],
disc: ["album", "cd", "dvd", "music"],
"dollar-sign": ["currency", "money", "payment"],
droplet: ["water"],
edit: ["pencil", "change"],
"edit-2": ["pencil", "change"],
"edit-3": ["pencil", "change"],
eye: ["view", "watch"],
"eye-off": ["view", "watch", "hide", "hidden"],
"external-link": ["outbound"],
facebook: ["logo", "social"],
"fast-forward": ["music"],
figma: ["logo", "design", "tool"],
"file-minus": ["delete", "remove", "erase"],
"file-plus": ["add", "create", "new"],
"file-text": ["data", "txt", "pdf"],
film: ["movie", "video"],
filter: ["funnel", "hopper"],
flag: ["report"],
"folder-minus": ["directory"],
"folder-plus": ["directory"],
folder: ["directory"],
framer: ["logo", "design", "tool"],
frown: ["emoji", "face", "bad", "sad", "emotion"],
gift: ["present", "box", "birthday", "party"],
"git-branch": ["code", "version control"],
"git-commit": ["code", "version control"],
"git-merge": ["code", "version control"],
"git-pull-request": ["code", "version control"],
github: ["logo", "version control"],
gitlab: ["logo", "version control"],
globe: ["world", "browser", "language", "translate"],
"hard-drive": ["computer", "server", "memory", "data"],
hash: ["hashtag", "number", "pound"],
headphones: ["music", "audio", "sound"],
heart: ["like", "love", "emotion"],
"help-circle": ["question mark"],
hexagon: ["shape", "node.js", "logo"],
home: ["house", "living"],
image: ["picture"],
inbox: ["email"],
instagram: ["logo", "camera"],
key: ["password", "login", "authentication", "secure"],
layers: ["stack"],
layout: ["window", "webpage"],
"life-buoy": ["help", "life ring", "support"],
link: ["chain", "url"],
"link-2": ["chain", "url"],
linkedin: ["logo", "social media"],
list: ["options"],
lock: ["security", "password", "secure"],
"log-in": ["sign in", "arrow", "enter"],
"log-out": ["sign out", "arrow", "exit"],
mail: ["email", "message"],
"map-pin": ["location", "navigation", "travel", "marker"],
map: ["location", "navigation", "travel"],
maximize: ["fullscreen"],
"maximize-2": ["fullscreen", "arrows", "expand"],
meh: ["emoji", "face", "neutral", "emotion"],
menu: ["bars", "navigation", "hamburger"],
"message-circle": ["comment", "chat"],
"message-square": ["comment", "chat"],
"mic-off": ["record", "sound", "mute"],
mic: ["record", "sound", "listen"],
minimize: ["exit fullscreen", "close"],
"minimize-2": ["exit fullscreen", "arrows", "close"],
minus: ["subtract"],
monitor: ["tv", "screen", "display"],
moon: ["dark", "night"],
"more-horizontal": ["ellipsis"],
"more-vertical": ["ellipsis"],
"mouse-pointer": ["arrow", "cursor"],
move: ["arrows"],
music: ["note"],
navigation: ["location", "travel"],
"navigation-2": ["location", "travel"],
octagon: ["stop"],
package: ["box", "container"],
paperclip: ["attachment"],
pause: ["music", "stop"],
"pause-circle": ["music", "audio", "stop"],
"pen-tool": ["vector", "drawing"],
percent: ["discount"],
"phone-call": ["ring"],
"phone-forwarded": ["call"],
"phone-incoming": ["call"],
"phone-missed": ["call"],
"phone-off": ["call", "mute"],
"phone-outgoing": ["call"],
phone: ["call"],
play: ["music", "start"],
"pie-chart": ["statistics", "diagram"],
"play-circle": ["music", "start"],
plus: ["add", "new"],
"plus-circle": ["add", "new"],
"plus-square": ["add", "new"],
pocket: ["logo", "save"],
power: ["on", "off"],
printer: ["fax", "office", "device"],
radio: ["signal"],
"refresh-cw": ["synchronise", "arrows"],
"refresh-ccw": ["arrows"],
repeat: ["loop", "arrows"],
rewind: ["music"],
"rotate-ccw": ["arrow"],
"rotate-cw": ["arrow"],
rss: ["feed", "subscribe"],
save: ["floppy disk"],
scissors: ["cut"],
search: ["find", "magnifier", "magnifying glass"],
send: [
"message",
"mail",
"email",
"paper airplane",
"paper aeroplane",
],
settings: ["cog", "edit", "gear", "preferences"],
"share-2": ["network", "connections"],
shield: ["security", "secure"],
"shield-off": ["security", "insecure"],
"shopping-bag": ["ecommerce", "cart", "purchase", "store"],
"shopping-cart": ["ecommerce", "cart", "purchase", "store"],
shuffle: ["music"],
"skip-back": ["music"],
"skip-forward": ["music"],
slack: ["logo"],
slash: ["ban", "no"],
sliders: ["settings", "controls"],
smartphone: ["cellphone", "device"],
smile: ["emoji", "face", "happy", "good", "emotion"],
speaker: ["audio", "music"],
star: ["bookmark", "favorite", "like"],
"stop-circle": ["media", "music"],
sun: ["brightness", "weather", "light"],
sunrise: ["weather", "time", "morning", "day"],
sunset: ["weather", "time", "evening", "night"],
tablet: ["device"],
tag: ["label"],
target: ["logo", "bullseye"],
terminal: ["code", "command line", "prompt"],
thermometer: [
"temperature",
"celsius",
"fahrenheit",
"weather",
],
"thumbs-down": ["dislike", "bad", "emotion"],
"thumbs-up": ["like", "good", "emotion"],
"toggle-left": ["on", "off", "switch"],
"toggle-right": ["on", "off", "switch"],
tool: ["settings", "spanner"],
trash: ["garbage", "delete", "remove", "bin"],
"trash-2": ["garbage", "delete", "remove", "bin"],
triangle: ["delta"],
truck: [
"delivery",
"van",
"shipping",
"transport",
"lorry",
],
tv: ["television", "stream"],
twitch: ["logo"],
twitter: ["logo", "social"],
type: ["text"],
umbrella: ["rain", "weather"],
unlock: ["security"],
"user-check": ["followed", "subscribed"],
"user-minus": [
"delete",
"remove",
"unfollow",
"unsubscribe",
],
"user-plus": [
"new",
"add",
"create",
"follow",
"subscribe",
],
"user-x": [
"delete",
"remove",
"unfollow",
"unsubscribe",
"unavailable",
],
user: ["person", "account"],
users: ["group"],
"video-off": ["camera", "movie", "film"],
video: ["camera", "movie", "film"],
voicemail: ["phone"],
volume: ["music", "sound", "mute"],
"volume-1": ["music", "sound"],
"volume-2": ["music", "sound"],
"volume-x": ["music", "sound", "mute"],
watch: ["clock", "time"],
"wifi-off": ["disabled"],
wifi: ["connection", "signal", "wireless"],
wind: ["weather", "air"],
"x-circle": [
"cancel",
"close",
"delete",
"remove",
"times",
"clear",
],
"x-octagon": [
"delete",
"stop",
"alert",
"warning",
"times",
"clear",
],
"x-square": [
"cancel",
"close",
"delete",
"remove",
"times",
"clear",
],
x: [
"cancel",
"close",
"delete",
"remove",
"times",
"clear",
],
youtube: ["logo", "video", "play"],
"zap-off": ["flash", "camera", "lightning"],
zap: ["flash", "camera", "lightning"],
"zoom-in": ["magnifying glass"],
"zoom-out": ["magnifying glass"],
};
},
"./src/to-svg.js": function (n, r, i) {
Object.defineProperty(r, "__esModule", { value: !0 });
var o = i("./src/icons.js"),
s = l(o);
function l(u) {
return u && u.__esModule ? u : { default: u };
}
function a(u) {
var c =
arguments.length > 1 && arguments[1] !== void 0
? arguments[1]
: {};
if (
(console.warn(
"feather.toSvg() is deprecated. Please use feather.icons[name].toSvg() instead."
),
!u)
)
throw new Error(
"The required `key` (icon name) parameter is missing."
);
if (!s.default[u])
throw new Error(
"No icon matching '" +
u +
"'. See the complete list of icons at https://feathericons.com"
);
return s.default[u].toSvg(c);
}
r.default = a;
},
0: function (n, r, i) {
i("./node_modules/core-js/es/array/from.js"),
(n.exports = i("./src/index.js"));
},
});
});
})(I1);
const Cc = B3(I1.exports),
sp = Object.keys(Cc.icons),
ui = {
props: {
name: {
type: String,
required: !0,
validator(t) {
const e = sp.includes(t);
return (
e ||
(console.groupCollapsed(
"[frappe-ui] name property for feather-icon must be one of "
),
console.dir(sp),
console.groupEnd()),
e
);
},
},
color: { type: String, default: null },
strokeWidth: { type: Number, default: 1.5 },
},
render() {
let t = Cc.icons[this.name];
return (
t || (t = Cc.icons.circle),
ze(
"svg",
yt(
t.attrs,
{
fill: "none",
stroke: "currentColor",
color: this.color,
"stroke-linecap": "round",
"stroke-linejoin": "round",
"stroke-width": this.strokeWidth,
width: null,
height: null,
class: [t.attrs.class, "shrink-0"],
innerHTML: t.contents,
},
this.$attrs
)
)
);
},
},
$3 = { name: "LoadingIndicator" },
z3 = {
class: "max-w-xs animate-spin",
xmlns: "http://www.w3.org/2000/svg",
fill: "none",
viewBox: "0 0 24 24",
},
H3 = U(
"circle",
{
class: "opacity-25",
cx: "12",
cy: "12",
r: "10",
stroke: "currentColor",
"stroke-width": "4",
},
null,
-1
),
F3 = U(
"path",
{
class: "opacity-75",
fill: "currentColor",
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z",
},
null,
-1
),
V3 = [H3, F3];
function W3(t, e, n, r, i, o) {
return B(), G("svg", z3, V3);
}
const U3 = Ue($3, [["render", W3]]),
K3 = ["disabled", "ariaLabel"],
vi = xe({
__name: "Button",
props: {
theme: { default: "gray" },
size: { default: "sm" },
variant: { default: "subtle" },
label: {},
icon: {},
iconLeft: {},
iconRight: {},
loading: { type: Boolean, default: !1 },
loadingText: {},
disabled: { type: Boolean, default: !1 },
route: {},
link: {},
},
setup(t) {
const e = t,
n = yd(),
r = Kg(),
i = $(() => {
let c = {
gray: "text-white bg-gray-900 hover:bg-gray-800 active:bg-gray-700",
blue: "text-white bg-blue-500 hover:bg-blue-600 active:bg-blue-700",
green: "text-white bg-green-600 hover:bg-green-700 active:bg-green-800",
red: "text-white bg-red-600 hover:bg-red-700 active:bg-red-800",
}[e.theme],
f = {
gray: "text-gray-800 bg-gray-100 hover:bg-gray-200 active:bg-gray-300",
blue: "text-blue-600 bg-blue-100 hover:bg-blue-200 active:bg-blue-300",
green: "text-green-800 bg-green-100 hover:bg-green-200 active:bg-green-300",
red: "text-red-700 bg-red-100 hover:bg-red-200 active:bg-red-300",
}[e.theme],
h = {
gray: "text-gray-800 bg-white border border-gray-300 hover:border-gray-400 active:border-gray-400 active:bg-gray-300",
blue: "text-blue-600 bg-white border border-blue-300 hover:border-blue-400 active:border-blue-400 active:bg-blue-300",
green: "text-green-800 bg-white border border-green-400 hover:border-green-500 active:border-green-500 active:bg-green-300",
red: "text-red-700 bg-white border border-red-300 hover:border-red-400 active:border-red-400 active:bg-red-200",
}[e.theme],
p = {
gray: "text-gray-800 bg-transparent hover:bg-gray-200 active:bg-gray-300",
blue: "text-blue-600 bg-transparent hover:bg-blue-200 active:bg-blue-300",
green: "text-green-800 bg-transparent hover:bg-green-200 active:bg-green-300",
red: "text-red-700 bg-transparent hover:bg-red-200 active:bg-red-300",
}[e.theme],
g = {
gray: "focus-visible:ring focus-visible:ring-gray-400",
blue: "focus-visible:ring focus-visible:ring-blue-400",
green: "focus-visible:ring focus-visible:ring-green-400",
red: "focus-visible:ring focus-visible:ring-red-400",
}[e.theme],
v = { subtle: f, solid: c, outline: h, ghost: p }[
e.variant
],
b = `${e.theme}-${e.variant}`,
x = {
gray: "bg-gray-100 text-gray-500",
"gray-outline":
"bg-gray-100 text-gray-500 border border-gray-300",
"gray-ghost": "text-gray-500",
"blue-solid": "bg-blue-300 text-white",
"blue-subtle": "bg-blue-100 text-blue-400",
"blue-outline":
"bg-blue-100 text-blue-400 border border-blue-300",
"blue-ghost": "text-blue-400",
green: "bg-green-100 text-green-500",
"green-outline":
"bg-green-100 text-green-500 border border-green-400",
"green-ghost": "text-green-500",
red: "bg-red-100 text-red-400",
"red-outline":
"bg-red-100 text-red-400 border border-red-300",
"red-ghost": "text-red-400",
},
S = x[b] || x[e.theme],
T = {
sm: "h-7 text-base px-2 rounded",
md: "h-8 text-base font-medium px-2.5 rounded",
lg: "h-10 text-lg font-medium px-3 rounded-md",
xl: "h-11.5 text-xl font-medium px-3.5 rounded-lg",
"2xl": "h-13 text-2xl font-medium px-3.5 rounded-xl",
}[e.size];
return (
a.value &&
(T = {
sm: "h-7 w-7 rounded",
md: "h-8 w-8 rounded",
lg: "h-10 w-10 rounded-md",
xl: "h-11.5 w-11.5 rounded-lg",
"2xl": "h-13 w-13 rounded-xl",
}[e.size]),
[
"inline-flex items-center justify-center gap-2 transition-colors focus:outline-none",
s.value ? S : v,
g,
T,
]
);
}),
o = $(
() =>
({
sm: "h-4",
md: "h-4.5",
lg: "h-5",
xl: "h-6",
"2xl": "h-6",
}[e.size])
),
s = $(() => e.disabled || e.loading),
l = $(() => (a.value ? e.label : null)),
a = $(() => e.icon || n.icon),
u = () => {
if (e.route) return r.push(e.route);
if (e.link) return window.open(e.link, "_blank");
};
return (c, f) => (
B(),
G(
"button",
yt(c.$attrs, {
class: i.value,
onClick: u,
disabled: s.value,
ariaLabel: l.value,
}),
[
c.loading
? (B(),
Be(
U3,
{
key: 0,
class: ye({
"h-3 w-3": c.size == "sm",
"h-[13.5px] w-[13.5px]":
c.size == "md",
"h-[15px] w-[15px]": c.size == "lg",
"h-4.5 w-4.5":
c.size == "xl" ||
c.size == "2xl",
}),
},
null,
8,
["class"]
))
: c.$slots.prefix || c.iconLeft
? _e(c.$slots, "prefix", { key: 1 }, () => [
c.iconLeft
? (B(),
Be(
ui,
{
key: 0,
name: c.iconLeft,
class: ye(o.value),
"aria-hidden": "true",
},
null,
8,
["name", "class"]
))
: De("", !0),
])
: De("", !0),
c.loading && c.loadingText
? (B(),
G(He, { key: 2 }, [Pn(Ge(c.loadingText), 1)], 64))
: a.value && !c.loading
? (B(),
G(
He,
{ key: 3 },
[
c.icon
? (B(),
Be(
ui,
{
key: 0,
name: c.icon,
class: ye(o.value),
"aria-label": c.label,
},
null,
8,
[
"name",
"class",
"aria-label",
]
))
: c.$slots.icon
? _e(c.$slots, "icon", { key: 1 })
: De("", !0),
],
64
))
: (B(),
G(
"span",
{
key: 4,
class: ye({ "sr-only": a.value }),
},
[
_e(c.$slots, "default", {}, () => [
Pn(Ge(c.label), 1),
]),
],
2
)),
_e(c.$slots, "suffix", {}, () => [
c.iconRight
? (B(),
Be(
ui,
{
key: 0,
name: c.iconRight,
class: ye(o.value),
"aria-hidden": "true",
},
null,
8,
["name", "class"]
))
: De("", !0),
]),
],
16,
K3
)
);
},
}),
q3 = {
name: "Autocomplete",
props: ["modelValue", "options", "placeholder"],
emits: ["update:modelValue", "update:query", "change"],
components: {
Popover: qd,
Button: vi,
FeatherIcon: ui,
Combobox: Ow,
ComboboxInput: Pw,
ComboboxOptions: Nw,
ComboboxOption: jw,
ComboboxButton: Rw,
},
data() {
return { query: "", showOptions: !1 };
},
computed: {
valuePropPassed() {
return "value" in this.$attrs;
},
selectedValue: {
get() {
return this.valuePropPassed
? this.$attrs.value
: this.modelValue;
},
set(t) {
(this.query = ""),
t && (this.showOptions = !1),
this.$emit(
this.valuePropPassed
? "change"
: "update:modelValue",
t
);
},
},
groups() {
var e;
return !this.options || this.options.length == 0
? []
: ((e = this.options[0]) != null && e.group
? this.options
: [{ group: "", items: this.options }]
)
.map((n, r) => ({
key: r,
group: n.group,
hideLabel: n.hideLabel || !1,
items: this.filterOptions(n.items),
}))
.filter((n) => n.items.length > 0);
},
},
watch: {
query(t) {
this.$emit("update:query", t);
},
showOptions(t) {
t &&
this.$nextTick(() => {
this.$refs.search.el.focus();
});
},
},
methods: {
filterOptions(t) {
return this.query
? t.filter((e) =>
[e.label, e.value].some((r) =>
(r || "")
.toString()
.toLowerCase()
.includes(this.query.toLowerCase())
)
)
: t;
},
displayValue(t) {
if (typeof t == "string") {
let n = this.groups
.flatMap((r) => r.items)
.find((r) => r.value === t);
return (n == null ? void 0 : n.label) || t;
}
return t == null ? void 0 : t.label;
},
},
},
J3 = { class: "w-full" },
G3 = ["onClick"],
Y3 = { class: "flex items-center" },
Q3 = {
key: 0,
class: "overflow-hidden text-ellipsis whitespace-nowrap text-base leading-5",
},
X3 = { key: 1, class: "text-base leading-5 text-gray-500" },
Z3 = {
class: "sticky top-0 z-10 flex items-stretch space-x-1.5 bg-white pt-1.5",
},
ek = { class: "relative w-full" },
tk = { key: 0, class: "px-2.5 py-1.5 text-sm font-medium text-gray-500" },
nk = { key: 0, class: "rounded-md px-2.5 py-1.5 text-base text-gray-600" };
function rk(t, e, n, r, i, o) {
const s = ft("FeatherIcon"),
l = ft("ComboboxInput"),
a = ft("ComboboxOption"),
u = ft("ComboboxOptions"),
c = ft("Popover"),
f = ft("Combobox");
return (
B(),
Be(
f,
{
modelValue: o.selectedValue,
"onUpdate:modelValue":
e[3] || (e[3] = (h) => (o.selectedValue = h)),
nullable: "",
},
{
default: Te(({ open: h }) => [
Me(
c,
{
class: "w-full",
show: i.showOptions,
"onUpdate:show":
e[2] || (e[2] = (p) => (i.showOptions = p)),
},
{
target: Te(({ open: p, togglePopover: g }) => [
_e(
t.$slots,
"target",
Dt(Ft({ open: p, togglePopover: g })),
() => [
U("div", J3, [
U(
"button",
{
class: ye([
"flex h-7 w-full items-center justify-between gap-2 rounded bg-gray-100 px-2 py-1 transition-colors hover:bg-gray-200 focus:ring-2 focus:ring-gray-400",
{ "bg-gray-200": h },
]),
onClick: () => g(),
},
[
U("div", Y3, [
_e(t.$slots, "prefix"),
o.selectedValue
? (B(),
G(
"span",
Q3,
Ge(
o.displayValue(
o.selectedValue
)
),
1
))
: (B(),
G(
"span",
X3,
Ge(
n.placeholder ||
""
),
1
)),
]),
Me(s, {
name: "chevron-down",
class: "h-4 w-4 text-gray-600",
"aria-hidden": "true",
}),
],
10,
G3
),
]),
]
),
]),
body: Te(({ isOpen: p }) => [
tc(
U(
"div",
null,
[
Me(
u,
{
class: "mt-1 max-h-[15rem] overflow-y-auto rounded-lg bg-white px-1.5 pb-1.5 shadow-2xl",
static: "",
},
{
default: Te(() => [
U("div", Z3, [
U("div", ek, [
Me(
l,
{
ref: "search",
class: "form-input w-full",
type: "text",
onChange:
e[0] ||
(e[0] =
(
g
) => {
i.query =
g.target.value;
}),
value: i.query,
autocomplete:
"off",
placeholder:
"Search",
},
null,
8,
["value"]
),
U(
"button",
{
class: "absolute right-0 inline-flex h-7 w-7 items-center justify-center",
onClick:
e[1] ||
(e[1] =
(
g
) =>
(o.selectedValue =
null)),
},
[
Me(s, {
name: "x",
class: "w-4",
}),
]
),
]),
]),
(B(!0),
G(
He,
null,
wn(o.groups, (g) =>
tc(
(B(),
G(
"div",
{
class: "mt-1.5",
key: g.key,
},
[
g.group &&
!g.hideLabel
? (B(),
G(
"div",
tk,
Ge(
g.group
),
1
))
: De(
"",
!0
),
(B(
!0
),
G(
He,
null,
wn(
g.items,
(
v
) => (
B(),
Be(
a,
{
as: "template",
key: v.value,
value: v,
},
{
default:
Te(
({
active: b,
selected:
x,
}) => [
U(
"li",
{
class: ye(
[
"flex items-center rounded px-2.5 py-1.5 text-base",
{
"bg-gray-100":
b,
},
]
),
},
[
_e(
t.$slots,
"item-prefix",
Dt(
Ft(
{
active: b,
selected:
x,
option: v,
}
)
)
),
Pn(
" " +
Ge(
v.label
),
1
),
],
2
),
]
),
_: 2,
},
1032,
[
"value",
]
)
)
),
128
)),
]
)),
[
[
cc,
g
.items
.length >
0,
],
]
)
),
128
)),
o.groups.length == 0
? (B(),
G(
"li",
nk,
" No results found "
))
: De("", !0),
]),
_: 3,
}
),
],
512
),
[[cc, p]]
),
]),
_: 2,
},
1032,
["show"]
),
]),
_: 3,
},
8,
["modelValue"]
)
);
}
const ik = Ue(q3, [["render", rk]]),
ok = ["src"],
mR = xe({
__name: "Avatar",
props: {
image: {},
label: {},
size: { default: "md" },
shape: { default: "circle" },
},
setup(t) {
const e = t,
n = $(
() =>
({
circle: "rounded-full",
square: {
xs: "rounded-[4px]",
sm: "rounded-[5px]",
md: "rounded-[5px]",
lg: "rounded-[6px]",
xl: "rounded-[6px]",
"2xl": "rounded-[8px]",
"3xl": "rounded-[10px]",
}[e.size],
}[e.shape])
),
r = $(
() =>
({
xs: "w-4 h-4",
sm: "w-5 h-5",
md: "w-6 h-6",
lg: "w-7 h-7",
xl: "w-8 h-8",
"2xl": "w-10 h-10",
"3xl": "w-11.5 h-11.5",
}[e.size])
),
i = $(() => [
"font-medium",
{
xs: "text-2xs",
sm: "text-sm",
md: "text-base",
lg: "text-base",
xl: "text-lg",
"2xl": "text-xl",
"3xl": "text-2xl",
}[e.size],
]),
o = $(
() =>
({
xs: "-mr-[.1rem] -mb-[.1rem] h-2 w-2",
sm: "-mr-[.1rem] -mb-[.1rem] h-[9px] w-[9px]",
md: "-mr-[.1rem] -mb-[.1rem] h-2.5 w-2.5",
lg: "-mr-[.1rem] -mb-[.1rem] h-3 w-3",
xl: "-mr-[.1rem] -mb-[.1rem] h-3 w-3",
"2xl": "-mr-[.1rem] -mb-[.1rem] h-3.5 w-3.5",
"3xl": "-mr-[.2rem] -mb-[.2rem] h-4 w-4",
}[e.size])
),
s = $(
() =>
({
xs: "h-1 w-1",
sm: "h-[5px] w-[5px]",
md: "h-1.5 w-1.5",
lg: "h-2 w-2",
xl: "h-2 w-2",
"2xl": "h-2.5 w-2.5",
"3xl": "h-3 w-3",
}[e.size])
),
l = $(
() =>
({
xs: "h-2.5 w-2.5",
sm: "h-3 w-3",
md: "h-4 w-4",
lg: "h-4 w-4",
xl: "h-4 w-4",
"2xl": "h-5 w-5",
"3xl": "h-5 w-5",
}[e.size])
);
return (a, u) => (
B(),
G(
"div",
{
class: ye([
"relative inline-block shrink-0",
[r.value, n.value],
]),
},
[
a.image
? (B(),
G(
"img",
{
key: 0,
src: a.image,
class: ye([
n.value,
"h-full w-full object-cover",
]),
},
null,
10,
ok
))
: (B(),
G(
"div",
{
key: 1,
class: ye([
"flex h-full w-full items-center justify-center bg-gray-100 uppercase text-gray-600",
[i.value, n.value],
]),
},
[
a.$slots.default
? (B(),
G(
"div",
{
key: 0,
class: ye(l.value),
},
[_e(a.$slots, "default")],
2
))
: (B(),
G(
He,
{ key: 1 },
[
Pn(
Ge(
a.label &&
a.label[0]
),
1
),
],
64
)),
],
2
)),
a.$slots.indicator
? (B(),
G(
"div",
{
key: 2,
class: ye([
"absolute bottom-0 right-0 grid place-items-center rounded-full bg-white",
o.value,
]),
},
[
U(
"div",
{ class: ye(s.value) },
[_e(a.$slots, "indicator")],
2
),
],
2
))
: De("", !0),
],
2
)
);
},
});
xe({
__name: "Badge",
props: {
theme: { default: "gray" },
size: { default: "md" },
variant: { default: "subtle" },
label: {},
},
setup(t) {
const e = t,
n = $(() => {
let r = {
gray: "text-white bg-gray-900",
blue: "text-white bg-blue-500",
green: "text-white bg-green-600",
orange: "text-white bg-amber-600",
red: "text-white bg-red-600",
}[e.theme],
i = {
gray: "text-gray-700 bg-gray-100",
blue: "text-blue-600 bg-blue-100",
green: "text-green-800 bg-green-200",
orange: "text-amber-700 bg-amber-100",
red: "text-red-600 bg-red-100",
}[e.theme],
o = {
gray: "text-gray-700 bg-white border border-gray-300",
blue: "text-blue-600 bg-white border border-blue-300",
green: "text-green-800 bg-white border border-green-300",
orange: "text-amber-700 bg-white border border-amber-300",
red: "text-red-600 bg-white border border-red-300",
}[e.theme],
s = {
gray: "text-gray-700 bg-transparent",
blue: "text-blue-600 bg-transparent",
green: "text-green-800 bg-transparent",
orange: "text-amber-700 bg-transparent",
red: "text-red-600 bg-transparent",
}[e.theme],
l = { subtle: i, solid: r, outline: o, ghost: s }[
e.variant
],
a = {
sm: "h-4 text-xs px-1.5",
md: "h-5 text-xs px-1.5",
lg: "h-6 text-sm px-2",
}[e.size];
return [l, a];
});
return (r, i) => (
B(),
G(
"div",
{
class: ye([
"inline-flex select-none items-center gap-1 rounded-full",
n.value,
]),
},
[
r.$slots.prefix
? (B(),
G(
"div",
{
key: 0,
class: ye([
e.size == "lg" ? "max-h-6" : "max-h-4",
]),
},
[_e(r.$slots, "prefix")],
2
))
: De("", !0),
_e(r.$slots, "default", {}, () => {
var o;
return [
Pn(
Ge(
(o = e.label) == null
? void 0
: o.toString()
),
1
),
];
}),
r.$slots.suffix
? (B(),
G(
"div",
{
key: 1,
class: ye([
e.size == "lg" ? "max-h-6" : "max-h-4",
]),
},
[_e(r.$slots, "suffix")],
2
))
: De("", !0),
],
2
)
);
},
});
function B1(t) {
return zm() ? (i2(t), !0) : !1;
}
function Jd(t) {
return typeof t == "function" ? t() : ne(t);
}
const Ba = typeof window != "undefined" && typeof document != "undefined";
typeof WorkerGlobalScope != "undefined" &&
globalThis instanceof WorkerGlobalScope;
const sk = Object.prototype.toString,
lk = (t) => sk.call(t) === "[object Object]",
ak = () => {};
function uk(t, e = !0) {
ps() ? Ye(t) : e ? t() : Ct(t);
}
function ck(t) {
var e;
const n = Jd(t);
return (e = n == null ? void 0 : n.$el) != null ? e : n;
}
const Gd = Ba ? window : void 0;
Ba && window.document;
Ba && window.navigator;
Ba && window.location;
function dk(...t) {
let e, n, r, i;
if (
(typeof t[0] == "string" || Array.isArray(t[0])
? (([n, r, i] = t), (e = Gd))
: ([e, n, r, i] = t),
!e)
)
return ak;
Array.isArray(n) || (n = [n]), Array.isArray(r) || (r = [r]);
const o = [],
s = () => {
o.forEach((c) => c()), (o.length = 0);
},
l = (c, f, h, p) => (
c.addEventListener(f, h, p), () => c.removeEventListener(f, h, p)
),
a = Rt(
() => [ck(e), Jd(i)],
([c, f]) => {
if ((s(), !c)) return;
const h = lk(f) ? W({}, f) : f;
o.push(...n.flatMap((p) => r.map((g) => l(c, p, g, h))));
},
{ immediate: !0, flush: "post" }
),
u = () => {
a(), s();
};
return B1(u), u;
}
function fk() {
const t = oe(!1);
return (
ps() &&
Ye(() => {
t.value = !0;
}),
t
);
}
function hk(t) {
const e = fk();
return $(() => (e.value, Boolean(t())));
}
function pk(t, e = {}) {
const { window: n = Gd } = e,
r = hk(
() => n && "matchMedia" in n && typeof n.matchMedia == "function"
);
let i;
const o = oe(!1),
s = (u) => {
o.value = u.matches;
},
l = () => {
!i ||
("removeEventListener" in i
? i.removeEventListener("change", s)
: i.removeListener(s));
},
a = Mt(() => {
!r.value ||
(l(),
(i = n.matchMedia(Jd(t))),
"addEventListener" in i
? i.addEventListener("change", s)
: i.addListener(s),
(o.value = i.matches));
});
return (
B1(() => {
a(), l(), (i = void 0);
}),
o
);
}
function mk(t = {}) {
const {
window: e = Gd,
initialWidth: n = Number.POSITIVE_INFINITY,
initialHeight: r = Number.POSITIVE_INFINITY,
listenOrientation: i = !0,
includeScrollbar: o = !0,
} = t,
s = oe(n),
l = oe(r),
a = () => {
e &&
(o
? ((s.value = e.innerWidth), (l.value = e.innerHeight))
: ((s.value = e.document.documentElement.clientWidth),
(l.value = e.document.documentElement.clientHeight)));
};
if ((a(), uk(a), dk("resize", a, { passive: !0 }), i)) {
const u = pk("(orientation: portrait)");
Rt(u, () => a());
}
return { width: s, height: l };
}
const gk = {
name: "Dropdown",
props: {
button: { type: Object, default: null },
options: { type: Array, default: () => [] },
placement: { type: String, default: "left" },
},
components: {
Menu: fx,
MenuButton: hx,
MenuItems: px,
MenuItem: mx,
Button: vi,
FeatherIcon: ui,
Popover: qd,
},
methods: {
normalizeDropdownItem(t) {
let e = t.onClick || null;
return (
!e &&
t.route &&
this.$router &&
(e = () => this.$router.push(t.route)),
{
label: t.label,
icon: t.icon,
group: t.group,
component: t.component,
onClick: e,
}
);
},
filterOptions(t) {
return (t || [])
.filter(Boolean)
.filter((e) => (e.condition ? e.condition() : !0))
.map((e) => this.normalizeDropdownItem(e));
},
},
computed: {
groups() {
var e;
return (
(e = this.options[0]) != null && e.group
? this.options
: [{ group: "", items: this.options }]
).map((n, r) => ({
key: r,
group: n.group,
hideLabel: n.hideLabel || !1,
items: this.filterOptions(n.items),
}));
},
dropdownTransition() {
return {
enterActiveClass: "transition duration-100 ease-out",
enterFromClass: "transform scale-95 opacity-0",
enterToClass: "transform scale-100 opacity-100",
leaveActiveClass: "transition duration-75 ease-in",
leaveFromClass: "transform scale-100 opacity-100",
leaveToClass: "transform scale-95 opacity-0",
};
},
popoverPlacement() {
return this.placement === "left"
? "bottom-start"
: this.placement === "right"
? "bottom-end"
: this.placement === "center"
? "bottom-center"
: "bottom";
},
},
},
yk = {
key: 0,
class: "flex h-7 items-center px-2 text-sm font-medium text-gray-500",
},
vk = ["onClick"],
bk = { class: "whitespace-nowrap" };
function wk(t, e, n, r, i, o) {
const s = ft("Button"),
l = ft("MenuButton"),
a = ft("FeatherIcon"),
u = ft("MenuItem"),
c = ft("MenuItems"),
f = ft("Popover"),
h = ft("Menu");
return (
B(),
Be(
h,
{ as: "div", class: "relative inline-block text-left" },
{
default: Te(({ open: p }) => [
Me(
f,
{
transition: o.dropdownTransition,
show: p,
placement: o.popoverPlacement,
},
{
target: Te(() => [
Me(
l,
{ as: "div" },
{
default: Te(() => [
t.$slots.default
? _e(
t.$slots,
"default",
Dt(
yt(
{ key: 0 },
{ open: p }
)
)
)
: (B(),
Be(
s,
yt(
{
key: 1,
active: p,
},
n.button
),
{
default: Te(() => {
var g;
return [
Pn(
Ge(
n.button
? ((g =
n.button) ==
null
? void 0
: g.label) ||
null
: "Options"
),
1
),
];
}),
_: 2,
},
1040,
["active"]
)),
]),
_: 2,
},
1024
),
]),
body: Te(() => [
Me(
c,
{
class: ye([
"mt-2 min-w-40 divide-y divide-gray-100 rounded-lg bg-white shadow-2xl ring-1 ring-black ring-opacity-5 focus:outline-none",
{
"left-0 origin-top-left":
n.placement == "left",
"right-0 origin-top-right":
n.placement == "right",
"inset-x-0 origin-top":
n.placement == "center",
},
]),
},
{
default: Te(() => [
(B(!0),
G(
He,
null,
wn(
o.groups,
(g) => (
B(),
G(
"div",
{
key: g.key,
class: "p-1.5",
},
[
g.group &&
!g.hideLabel
? (B(),
G(
"div",
yk,
Ge(
g.group
),
1
))
: De(
"",
!0
),
(B(!0),
G(
He,
null,
wn(
g.items,
(v) => (
B(),
Be(
u,
{
key: v.label,
},
{
default:
Te(
({
active: b,
}) => [
v.component
? (B(),
Be(
mi(
v.component
),
{
key: 0,
active: b,
},
null,
8,
[
"active",
]
))
: (B(),
G(
"button",
{
key: 1,
class: ye(
[
b
? "bg-gray-100"
: "text-gray-800",
"group flex h-7 w-full items-center rounded px-2 text-base",
]
),
onClick:
v.onClick,
},
[
v.icon &&
typeof v.icon ==
"string"
? (B(),
Be(
a,
{
key: 0,
name: v.icon,
class: "mr-2 h-4 w-4 flex-shrink-0 text-gray-700",
"aria-hidden":
"true",
},
null,
8,
[
"name",
]
))
: v.icon
? (B(),
Be(
mi(
v.icon
),
{
key: 1,
class: "mr-2 h-4 w-4 flex-shrink-0 text-gray-700",
}
))
: De(
"",
!0
),
U(
"span",
bk,
Ge(
v.label
),
1
),
],
10,
vk
)),
]
),
_: 2,
},
1024
)
)
),
128
)),
]
)
)
),
128
)),
]),
_: 1,
},
8,
["class"]
),
]),
_: 2,
},
1032,
["transition", "show", "placement"]
),
]),
_: 3,
}
)
);
}
const xk = Ue(gk, [["render", wk]]),
kk = { class: "flex min-w-0 items-center" },
Ck = U(
"svg",
{
class: "w-4 text-gray-600",
xmlns: "http://www.w3.org/2000/svg",
width: "24",
height: "24",
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
"stroke-width": "2",
"stroke-linecap": "round",
"stroke-linejoin": "round",
},
[
U("circle", { cx: "12", cy: "12", r: "1" }),
U("circle", { cx: "19", cy: "12", r: "1" }),
U("circle", { cx: "5", cy: "12", r: "1" }),
],
-1
),
Sk = U(
"span",
{ class: "ml-1 mr-0.5 text-base text-gray-500", "aria-hidden": "true" },
" / ",
-1
),
_k = {
class: "flex min-w-0 items-center overflow-hidden text-ellipsis whitespace-nowrap",
},
Mk = {
key: 0,
class: "mx-0.5 text-base text-gray-500",
"aria-hidden": "true",
};
xe({
__name: "Breadcrumbs",
props: { items: {} },
setup(t) {
const e = t,
n = Kg(),
{ width: r } = mk(),
i = $(() => (e.items || []).filter(Boolean)),
o = $(() =>
r.value > 640
? []
: i.value.slice(0, -2).map((a) => {
let u = a.onClick
? a.onClick
: () => n.push(a.route);
return be(W({}, a), {
icon: null,
label: a.label,
onClick: u,
});
})
),
s = $(() => (r.value > 640 ? i.value : i.value.slice(-2)));
return (l, a) => (
B(),
G("div", kk, [
o.value.length
? (B(),
G(
He,
{ key: 0 },
[
Me(
xk,
{ class: "h-7", options: o.value },
{
default: Te(() => [
Me(
vi,
{ variant: "ghost" },
{ icon: Te(() => [Ck]), _: 1 }
),
]),
_: 1,
},
8,
["options"]
),
Sk,
],
64
))
: De("", !0),
U("div", _k, [
(B(!0),
G(
He,
null,
wn(
s.value,
(u, c) => (
B(),
G(
He,
{ key: u.label },
[
(B(),
Be(
mi(
u.route
? "router-link"
: "button"
),
yt(
{
class: [
"flex items-center rounded px-0.5 py-1 text-lg font-medium focus:outline-none focus-visible:ring-2 focus-visible:ring-gray-400",
[
c ==
s.value.length - 1
? "text-gray-900"
: "text-gray-600 hover:text-gray-700",
],
],
},
u.route
? { to: u.route }
: { onClick: u.onClick }
),
{
default: Te(() => [
_e(l.$slots, "prefix", {
item: u,
}),
U(
"span",
null,
Ge(u.label),
1
),
]),
_: 2,
},
1040,
["class"]
)),
c != s.value.length - 1
? (B(), G("span", Mk, " / "))
: De("", !0),
],
64
)
)
),
128
)),
]),
])
);
},
});
let Ek = 0;
function Ak() {
return ++Ek;
}
function $1() {
return "frappe-ui-" + Ak();
}
const Tk = ["disabled", "id", "checked"],
Ok = ["for"],
$a = xe({
__name: "Checkbox",
props: {
size: { default: "sm" },
label: {},
checked: { type: Boolean },
disabled: { type: Boolean },
padding: { type: Boolean, default: !1 },
modelValue: { type: Boolean },
id: {},
},
setup(t) {
var s;
const e = t,
n = hs(),
r = (s = e.id) != null ? s : $1(),
i = $(() => [
{ sm: "text-base font-medium", md: "text-lg font-medium" }[
e.size
],
e.disabled ? "text-gray-500" : "text-gray-800",
"select-none",
]),
o = $(() => {
let l = e.disabled
? "border-gray-300 bg-gray-50 text-gray-400"
: "border-gray-500 text-gray-900 hover:border-gray-600 focus:ring-offset-0 focus:border-gray-900 active:border-gray-700 transition",
a = e.disabled
? ""
: e.padding
? "focus:ring-0"
: "hover:shadow-sm focus:ring-0 focus-visible:ring-2 focus-visible:ring-gray-400 active:bg-gray-100",
u = { sm: "w-3.5 h-3.5", md: "w-4 h-4" }[e.size];
return [l, a, u];
});
return (l, a) => (
B(),
G(
"div",
{
class: ye([
"inline-flex items-center space-x-2 rounded transition",
{
"px-2.5 py-1.5": l.padding && l.size === "sm",
"px-3 py-2": l.padding && l.size === "md",
"focus-within:bg-gray-100 focus-within:ring-2 focus-within:ring-gray-400 hover:bg-gray-200 active:bg-gray-300":
l.padding && !l.disabled,
},
]),
},
[
U(
"input",
yt(
{
class: ["rounded-sm", o.value],
type: "checkbox",
disabled: l.disabled,
id: ne(r),
checked: Boolean(l.modelValue),
onChange:
a[0] ||
(a[0] = (u) =>
l.$emit(
"update:modelValue",
u.target.checked
)),
},
ne(n)
),
null,
16,
Tk
),
l.label
? (B(),
G(
"label",
{
key: 0,
class: ye(["block", i.value]),
for: ne(r),
},
Ge(l.label),
11,
Ok
))
: De("", !0),
],
2
)
);
},
});
function za(t, e, n) {
var r;
return function () {
var i = this,
o = arguments,
s = function () {
(r = void 0), n || t.apply(i, o);
},
l = n && !r;
clearTimeout(r), (r = window.setTimeout(s, e)), l && t.apply(i, o);
};
}
const Rk = {
name: "Input",
inheritAttrs: !1,
expose: ["getInputValue"],
components: { FeatherIcon: ui },
props: {
label: { type: String },
type: {
type: String,
default: "text",
validator(t) {
let e = [
"text",
"number",
"checkbox",
"textarea",
"select",
"email",
"password",
"date",
].includes(t);
return (
e ||
console.warn(
`Invalid value "${t}" for "type" prop for Input`
),
e
);
},
},
modelValue: { type: [String, Number, Boolean, Object, Array] },
inputClass: { type: [String, Array, Object] },
debounce: { type: Number },
options: { type: Array },
disabled: { type: Boolean },
rows: { type: Number, default: 3 },
placeholder: { type: String },
iconLeft: { type: String },
},
emits: ["input", "change", "update:modelValue"],
methods: {
focus() {
this.$refs.input.focus();
},
blur() {
this.$refs.input.blur();
},
getInputValue(t) {
let e = t ? t.target : this.$refs.input,
n = e.value;
return this.type == "checkbox" && (n = e.checked), n;
},
},
computed: {
passedInputValue() {
return "value" in this.$attrs
? this.$attrs.value
: this.modelValue || null;
},
inputAttributes() {
let t = {},
e = (n) => {
this.$emit("input", this.getInputValue(n));
};
return (
this.debounce && (e = za(e, this.debounce)),
this.type == "checkbox" &&
(t.checked = this.passedInputValue),
Object.assign(t, this.$attrs, {
onInput: e,
onChange: (n) => {
this.$emit("change", this.getInputValue(n)),
this.$emit(
"update:modelValue",
this.getInputValue(n)
);
},
})
);
},
selectOptions() {
return this.options
.map((t) =>
typeof t == "string" ? { label: t, value: t } : t
)
.filter(Boolean);
},
isNormalInput() {
return [
"text",
"number",
"checkbox",
"email",
"password",
"date",
].includes(this.type);
},
},
},
Pk = { key: 0, class: "mb-2 block text-sm leading-4 text-gray-700" },
Nk = ["type", "disabled", "placeholder", "value"],
jk = ["placeholder", "value", "disabled", "rows"],
Lk = ["disabled"],
Dk = ["value", "disabled", "selected"],
Ik = { key: 1, class: "ml-2 inline-block text-base leading-4" };
function Bk(t, e, n, r, i, o) {
const s = ft("FeatherIcon");
return (
B(),
G(
"label",
{
class: ye([
n.type == "checkbox" ? "flex" : "block",
t.$attrs.class,
]),
},
[
n.label && n.type != "checkbox"
? (B(), G("span", Pk, Ge(n.label), 1))
: De("", !0),
U(
"div",
{
class: ye([
"relative flex",
{
"items-center":
o.isNormalInput || n.type == "select",
},
]),
},
[
n.iconLeft && n.type != "checkbox"
? (B(),
Be(
s,
{
key: 0,
name: n.iconLeft,
class: ye([
"absolute mx-2 h-4 w-4 text-gray-600",
{ "mt-2": n.type == "textarea" },
]),
},
null,
8,
["name", "class"]
))
: De("", !0),
o.isNormalInput
? (B(),
G(
"input",
yt({ key: 1 }, o.inputAttributes, {
class: [
"border-gray-400 placeholder-gray-500",
[
{
"form-input block w-full":
n.type != "checkbox",
"form-checkbox":
n.type == "checkbox",
"pl-8":
n.iconLeft &&
n.type != "checkbox",
},
n.inputClass,
],
],
ref: "input",
type: n.type || "text",
disabled: n.disabled,
placeholder: n.placeholder,
value: o.passedInputValue,
}),
null,
16,
Nk
))
: De("", !0),
n.type === "textarea"
? (B(),
G(
"textarea",
yt({ key: 2 }, o.inputAttributes, {
placeholder: n.placeholder,
class: [
"placeholder-gray-500",
[
"form-textarea block w-full resize-none",
n.inputClass,
{ "pl-8": n.iconLeft },
],
],
ref: "input",
value: o.passedInputValue,
disabled: n.disabled,
rows: n.rows,
}),
null,
16,
jk
))
: De("", !0),
n.type === "select"
? (B(),
G(
"select",
yt({ key: 3 }, o.inputAttributes, {
class: [
"form-select block w-full",
{ "pl-8": n.iconLeft },
],
ref: "input",
disabled: n.disabled,
}),
[
(B(!0),
G(
He,
null,
wn(
o.selectOptions,
(l) => (
B(),
G(
"option",
{
key: l.value,
value: l.value,
disabled:
l.disabled ||
!1,
selected:
o.passedInputValue ===
l.value,
},
Ge(l.label),
9,
Dk
)
)
),
128
)),
],
16,
Lk
))
: De("", !0),
],
2
),
n.label && n.type == "checkbox"
? (B(), G("span", Ik, Ge(n.label), 1))
: De("", !0),
],
2
)
);
}
const gR = Ue(Rk, [["render", Bk]]),
$k = {
name: "Dialog",
props: {
modelValue: { type: Boolean, required: !0 },
options: {
type: Object,
default() {
return {};
},
},
},
emits: ["update:modelValue", "close", "after-leave"],
components: {
HDialog: ix,
DialogPanel: ox,
DialogTitle: sx,
TransitionChild: C1,
TransitionRoot: S1,
Button: vi,
FeatherIcon: ui,
},
data() {
return { dialogActions: [] };
},
watch: {
"options.actions": {
handler(t) {
!t ||
(this.dialogActions = t.map((e) => {
let n = oe(!1);
return be(W({}, e), {
loading: n,
onClick: e.onClick
? () =>
cr(this, null, function* () {
n.value = !0;
try {
yield e.onClick();
} finally {
n.value = !1;
}
})
: this.close,
});
}));
},
immediate: !0,
},
},
methods: {
close() {
this.open = !1;
},
},
computed: {
open: {
get() {
return this.modelValue;
},
set(t) {
this.$emit("update:modelValue", t),
t || this.$emit("close");
},
},
icon() {
var e;
if (!((e = this.options) != null && e.icon)) return null;
let t = this.options.icon;
return typeof t == "string" && (t = { name: t }), t;
},
dialogPositionClasses() {
var e;
let t =
((e = this.options) == null ? void 0 : e.position) ||
"center";
return {
"justify-center": t === "center",
"pt-[20vh]": t === "top",
};
},
},
},
zk = ["data-dialog"],
Hk = { class: "bg-white px-4 pb-6 pt-5 sm:px-6" },
Fk = { class: "flex" },
Vk = { class: "flex-1" },
Wk = { class: "mb-6 flex items-center justify-between" },
Uk = { class: "flex items-center space-x-2" },
Kk = { class: "text-2xl font-semibold leading-6 text-gray-900" },
qk = U(
"svg",
{
width: "16",
height: "16",
viewBox: "0 0 16 16",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
},
[
U("path", {
"fill-rule": "evenodd",
"clip-rule": "evenodd",
d: "M12.8567 3.85355C13.052 3.65829 13.052 3.34171 12.8567 3.14645C12.6615 2.95118 12.3449 2.95118 12.1496 3.14645L8.00201 7.29405L3.85441 3.14645C3.65914 2.95118 3.34256 2.95118 3.1473 3.14645C2.95204 3.34171 2.95204 3.65829 3.1473 3.85355L7.29491 8.00116L3.14645 12.1496C2.95118 12.3449 2.95118 12.6615 3.14645 12.8567C3.34171 13.052 3.65829 13.052 3.85355 12.8567L8.00201 8.70827L12.1505 12.8567C12.3457 13.052 12.6623 13.052 12.8576 12.8567C13.0528 12.6615 13.0528 12.3449 12.8576 12.1496L8.70912 8.00116L12.8567 3.85355Z",
fill: "#383838",
}),
],
-1
),
Jk = { key: 0, class: "text-p-base text-gray-700" },
Gk = { key: 0, class: "px-4 pb-7 pt-4 sm:px-6" },
Yk = { class: "space-y-2" };
function Qk(t, e, n, r, i, o) {
const s = ft("TransitionChild"),
l = ft("FeatherIcon"),
a = ft("DialogTitle"),
u = ft("Button"),
c = ft("DialogPanel"),
f = ft("HDialog"),
h = ft("TransitionRoot");
return (
B(),
Be(
h,
{
as: "template",
show: o.open,
onAfterLeave: e[0] || (e[0] = (p) => t.$emit("after-leave")),
},
{
default: Te(() => [
Me(
f,
{
as: "div",
class: "fixed inset-0 z-10 overflow-y-auto",
onClose: o.close,
},
{
default: Te(() => [
U(
"div",
{
class: ye([
"flex min-h-screen flex-col items-center px-4 py-4 text-center",
o.dialogPositionClasses,
]),
},
[
Me(
s,
{
as: "template",
enter: "ease-out duration-150",
"enter-from": "opacity-0",
"enter-to": "opacity-100",
leave: "ease-in duration-150",
"leave-from": "opacity-100",
"leave-to": "opacity-0",
},
{
default: Te(() => [
U(
"div",
{
class: "fixed inset-0 bg-black-overlay-200 transition-opacity",
"data-dialog":
n.options.title,
},
null,
8,
zk
),
]),
_: 1,
}
),
Me(
s,
{
as: "template",
enter: "ease-out duration-150",
"enter-from":
"opacity-50 translate-y-2 scale-95",
"enter-to":
"opacity-100 translate-y-0 scale-100",
leave: "ease-in duration-150",
"leave-from":
"opacity-100 translate-y-0 scale-100",
"leave-to":
"opacity-50 translate-y-4 translate-y-4 scale-95",
},
{
default: Te(() => [
Me(
c,
{
class: ye([
"my-8 inline-block w-full transform overflow-hidden rounded-xl bg-white text-left align-middle shadow-xl transition-all",
{
"max-w-7xl":
n
.options
.size ===
"7xl",
"max-w-6xl":
n
.options
.size ===
"6xl",
"max-w-5xl":
n
.options
.size ===
"5xl",
"max-w-4xl":
n
.options
.size ===
"4xl",
"max-w-3xl":
n
.options
.size ===
"3xl",
"max-w-2xl":
n
.options
.size ===
"2xl",
"max-w-xl":
n
.options
.size ===
"xl",
"max-w-lg":
n
.options
.size ===
"lg" ||
!n
.options
.size,
"max-w-md":
n
.options
.size ===
"md",
"max-w-sm":
n
.options
.size ===
"sm",
"max-w-xs":
n
.options
.size ===
"xs",
},
]),
},
{
default: Te(() => [
_e(
t.$slots,
"body",
{},
() => [
_e(
t.$slots,
"body-main",
{},
() => [
U(
"div",
Hk,
[
U(
"div",
Fk,
[
U(
"div",
Vk,
[
U(
"div",
Wk,
[
U(
"div",
Uk,
[
o.icon
? (B(),
G(
"div",
{
key: 0,
class: ye(
[
"flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-full",
{
"bg-gray-100":
!o
.icon
.appearance,
"bg-yellow-100":
o
.icon
.appearance ===
"warning",
"bg-blue-100":
o
.icon
.appearance ===
"info",
"bg-red-100":
o
.icon
.appearance ===
"danger",
"bg-green-100":
o
.icon
.appearance ===
"success",
},
]
),
},
[
Me(
l,
{
name: o
.icon
.name,
class: ye(
[
"h-4 w-4",
{
"text-gray-600":
!o
.icon
.appearance,
"text-yellow-600":
o
.icon
.appearance ===
"warning",
"text-blue-600":
o
.icon
.appearance ===
"info",
"text-red-600":
o
.icon
.appearance ===
"danger",
"text-green-600":
o
.icon
.appearance ===
"success",
},
]
),
"aria-hidden":
"true",
},
null,
8,
[
"name",
"class",
]
),
],
2
))
: De(
"",
!0
),
Me(
a,
{
as: "header",
},
{
default:
Te(
() => [
_e(
t.$slots,
"body-title",
{},
() => [
U(
"h3",
Kk,
Ge(
n
.options
.title ||
"Untitled"
),
1
),
]
),
]
),
_: 3,
}
),
]
),
Me(
u,
{
variant:
"ghost",
onClick:
o.close,
},
{
icon: Te(
() => [
qk,
]
),
_: 1,
},
8,
[
"onClick",
]
),
]
),
_e(
t.$slots,
"body-content",
{},
() => [
n
.options
.message
? (B(),
G(
"p",
Jk,
Ge(
n
.options
.message
),
1
))
: De(
"",
!0
),
]
),
]
),
]
),
]
),
]
),
i
.dialogActions
.length ||
t.$slots
.actions
? (B(),
G(
"div",
Gk,
[
_e(
t.$slots,
"actions",
Dt(
Ft(
{
close: o.close,
}
)
),
() => [
U(
"div",
Yk,
[
(B(
!0
),
G(
He,
null,
wn(
i.dialogActions,
(
p
) => (
B(),
Be(
u,
yt(
{
class: "w-full",
key: p.label,
},
p
),
{
default:
Te(
() => [
Pn(
Ge(
p.label
),
1
),
]
),
_: 2,
},
1040
)
)
),
128
)),
]
),
]
),
]
))
: De(
"",
!0
),
]
),
]),
_: 3,
},
8,
["class"]
),
]),
_: 3,
}
),
],
2
),
]),
_: 3,
},
8,
["onClose"]
),
]),
_: 3,
},
8,
["show"]
)
);
}
const yR = Ue($k, [["render", Qk]]);
xe({
__name: "Divider",
props: {
orientation: { default: "horizontal" },
position: { default: "center" },
flexItem: { type: Boolean },
action: {},
},
setup(t) {
const e = t,
n = $(() => {
let i = {
horizontal: "border-t-[1px] w-full",
vertical: "border-l-[1px]",
}[e.orientation],
o = e.flexItem ? "self-stretch h-auto" : "h-full";
return [i, o];
}),
r = $(
() =>
({
horizontal: {
center: "left-1/2 top-0 -translate-y-2/4 -translate-x-1/2",
start: "left-0 top-0 -translate-y-2/4 ml-4",
end: "right-0 -translate-y-2/4 mr-4",
},
vertical: {
center: "-translate-x-2/4 top-1/2 left-0 -translate-y-1/2",
start: "-translate-x-2/4 top-0 mt-4 left-0",
end: "-translate-x-2/4 bottom-0 mb-4 left-0",
},
}[e.orientation][e.position])
);
return (i, o) => (
B(),
Be(
mi(e.action ? "div" : "hr"),
{
class: ye([
"relative whitespace-nowrap border-0 border-gray-300",
n.value,
]),
},
{
default: Te(() => {
var s, l, a;
return [
e.action
? (B(),
G(
"span",
{
key: 0,
class: ye(["absolute", r.value]),
},
[
Me(
ne(vi),
{
label:
(s = e.action) == null
? void 0
: s.label,
loading:
(l = e.action) == null
? void 0
: l.loading,
size: "sm",
variant: "outline",
onClick:
(a = e.action) == null
? void 0
: a.handler,
},
null,
8,
["label", "loading", "onClick"]
),
],
2
))
: De("", !0),
];
}),
_: 1,
},
8,
["class"]
)
);
},
});
class Xk {
constructor() {
Za(this, "listeners");
Za(this, "failed");
(this.listeners = {}), (this.failed = !1);
}
on(e, n) {
(this.listeners[e] = this.listeners[e] || []),
this.listeners[e].push(n);
}
trigger(e, n) {
(this.listeners[e] || []).forEach((i) => {
i.call(this, n);
});
}
upload(e, n) {
return new Promise((r, i) => {
let o = new XMLHttpRequest();
o.upload.addEventListener("loadstart", () => {
this.trigger("start");
}),
o.upload.addEventListener("progress", (a) => {
a.lengthComputable &&
this.trigger("progress", {
uploaded: a.loaded,
total: a.total,
});
}),
o.upload.addEventListener("load", () => {
this.trigger("finish");
}),
o.addEventListener("error", () => {
this.trigger("error"), i();
}),
(o.onreadystatechange = () => {
if (o.readyState == XMLHttpRequest.DONE) {
let a;
if (o.status === 200) {
let u = null;
try {
u = JSON.parse(o.responseText);
} catch (f) {
u = o.responseText;
}
let c = u.message || u;
r(c);
} else if (o.status === 403)
a = JSON.parse(o.responseText);
else {
this.failed = !0;
try {
a = JSON.parse(o.responseText);
} catch (u) {}
}
a && a.exc && console.error(JSON.parse(a.exc)[0]), i(a);
}
});
const s = n.upload_endpoint || "/api/method/upload_file";
o.open("POST", s, !0),
o.setRequestHeader("Accept", "application/json"),
window.csrf_token &&
window.csrf_token !== "{{ csrf_token }}" &&
o.setRequestHeader(
"X-Frappe-CSRF-Token",
window.csrf_token
);
let l = new FormData();
e && l.append("file", e, e.name),
l.append("is_private", n.private ? "1" : "0"),
l.append("folder", n.folder || "Home"),
n.file_url && l.append("file_url", n.file_url),
n.doctype && l.append("doctype", n.doctype),
n.docname && l.append("docname", n.docname),
n.fieldname && l.append("fieldname", n.fieldname),
n.method && l.append("method", n.method),
n.type && l.append("type", n.type),
o.send(l);
});
}
}
const Zk = {
name: "FileUploader",
props: ["fileTypes", "uploadArgs", "validateFile"],
data() {
return {
uploader: null,
uploading: !1,
uploaded: 0,
error: null,
message: "",
total: 0,
file: null,
finishedUploading: !1,
};
},
computed: {
progress() {
let t = Math.floor((this.uploaded / this.total) * 100);
return isNaN(t) ? 0 : t;
},
success() {
return this.finishedUploading && !this.error;
},
},
methods: {
openFileSelector() {
this.$refs.input.click();
},
onFileAdd(t) {
return cr(this, null, function* () {
if (
((this.error = null),
(this.file = t.target.files[0]),
this.file && this.validateFile)
)
try {
let e = yield this.validateFile(this.file);
e && (this.error = e);
} catch (e) {
this.error = e;
}
this.error || this.uploadFile(this.file);
});
},
uploadFile(t) {
return cr(this, null, function* () {
(this.error = null),
(this.uploaded = 0),
(this.total = 0),
(this.uploader = new Xk()),
this.uploader.on("start", () => {
this.uploading = !0;
}),
this.uploader.on("progress", (e) => {
(this.uploaded = e.uploaded),
(this.total = e.total);
}),
this.uploader.on("error", () => {
(this.uploading = !1),
(this.error = "Error Uploading File");
}),
this.uploader.on("finish", () => {
(this.uploading = !1),
(this.finishedUploading = !0);
}),
this.uploader
.upload(t, this.uploadArgs || {})
.then((e) => {
this.$emit("success", e);
})
.catch((e) => {
this.uploading = !1;
let n = "Error Uploading File";
e != null && e._server_messages
? (n = JSON.parse(
JSON.parse(e._server_messages)[0]
).message)
: e != null &&
e.exc &&
(n = JSON.parse(e.exc)[0]
.split(
`
`
)
.slice(-2, -1)[0]),
(this.error = n),
this.$emit("failure", e);
});
});
},
},
},
e8 = ["accept"];
function t8(t, e, n, r, i, o) {
return (
B(),
G("div", null, [
U(
"input",
{
ref: "input",
type: "file",
accept: n.fileTypes,
class: "hidden",
onChange:
e[0] ||
(e[0] = (...s) => o.onFileAdd && o.onFileAdd(...s)),
},
null,
40,
e8
),
_e(
t.$slots,
"default",
Dt(
Ft({
file: i.file,
uploading: i.uploading,
progress: o.progress,
uploaded: i.uploaded,
message: i.message,
error: i.error,
total: i.total,
success: o.success,
openFileSelector: o.openFileSelector,
})
)
),
])
);
}
const vR = Ue(Zk, [["render", t8]]),
n8 = { class: "relative flex items-center" },
r8 = ["type", "placeholder", "disabled", "id", "value"],
i8 = xe({
__name: "TextInput",
props: {
type: { default: "text" },
size: { default: "sm" },
variant: { default: "subtle" },
placeholder: {},
disabled: { type: Boolean },
id: {},
modelValue: {},
debounce: {},
},
emits: ["update:modelValue"],
setup(t, { expose: e, emit: n }) {
const r = t,
i = n,
o = yd(),
s = hs(),
l = oe(null);
e({ el: l });
const a = $(() => (r.disabled ? "text-gray-600" : "text-gray-800")),
u = $(() => {
let g = {
sm: "text-base rounded h-7",
md: "text-base rounded h-8",
lg: "text-lg rounded-md h-10",
xl: "text-xl rounded-md h-10",
}[r.size],
v = {
sm: [
"py-1.5",
o.prefix ? "pl-8" : "pl-2",
o.suffix ? "pr-8" : "pr-2",
],
md: [
"py-1.5",
o.prefix ? "pl-9" : "pl-2.5",
o.suffix ? "pr-9" : "pr-2.5",
],
lg: [
"py-1.5",
o.prefix ? "pl-10" : "pl-3",
o.suffix ? "pr-10" : "pr-3",
],
xl: [
"py-1.5",
o.prefix ? "pl-10" : "pl-3",
o.suffix ? "pr-10" : "pr-3",
],
}[r.size],
b = r.disabled ? "disabled" : r.variant,
x = {
subtle: "border border-gray-100 bg-gray-100 placeholder-gray-500 hover:border-gray-200 hover:bg-gray-200 focus:bg-white focus:border-gray-500 focus:shadow-sm focus:ring-0 focus-visible:ring-2 focus-visible:ring-gray-400",
outline:
"border border-gray-300 bg-white placeholder-gray-500 hover:border-gray-400 hover:shadow-sm focus:bg-white focus:border-gray-500 focus:shadow-sm focus:ring-0 focus-visible:ring-2 focus-visible:ring-gray-400",
disabled: [
"border bg-gray-50 placeholder-gray-400",
r.variant === "outline"
? "border-gray-300"
: "border-transparent",
],
}[b];
return [g, v, x, a.value, "transition-colors w-full"];
});
let c = $(
() =>
({ sm: "pl-2", md: "pl-2.5", lg: "pl-3", xl: "pl-3" }[
r.size
])
),
f = $(
() =>
({ sm: "pr-2", md: "pr-2.5", lg: "pr-3", xl: "pr-3" }[
r.size
])
),
h = (g) => {
i("update:modelValue", g);
};
r.debounce && (h = za(h, r.debounce));
let p = (g) => {
h(g.target.value);
};
return (g, v) => (
B(),
G("div", n8, [
g.$slots.prefix
? (B(),
G(
"div",
{
key: 0,
class: ye([
"absolute inset-y-0 left-0 flex items-center",
a.value,
ne(c),
]),
},
[_e(g.$slots, "prefix")],
2
))
: De("", !0),
U(
"input",
yt(
{
ref_key: "inputRef",
ref: l,
type: g.type,
placeholder: g.placeholder,
class: u.value,
disabled: g.disabled,
id: g.id,
value: g.modelValue,
onInput:
v[0] ||
(v[0] = (...b) => ne(p) && ne(p)(...b)),
onChange:
v[1] ||
(v[1] = (...b) => ne(p) && ne(p)(...b)),
},
ne(s)
),
null,
16,
r8
),
g.$slots.suffix
? (B(),
G(
"div",
{
key: 1,
class: ye([
"absolute inset-y-0 right-0 flex items-center",
a.value,
ne(f),
]),
},
[_e(g.$slots, "suffix")],
2
))
: De("", !0),
])
);
},
}),
o8 = { class: "relative flex items-center" },
s8 = ["disabled", "id", "value"],
l8 = ["value", "disabled", "selected"],
a8 = xe({
__name: "Select",
props: {
size: { default: "sm" },
variant: { default: "subtle" },
placeholder: {},
disabled: { type: Boolean },
id: {},
modelValue: {},
options: {},
},
emits: ["update:modelValue"],
setup(t, { emit: e }) {
const n = t,
r = e,
i = yd(),
o = hs();
function s(f) {
r("update:modelValue", f.target.value);
}
const l = $(() => {
var f;
return (
((f = n.options) == null
? void 0
: f
.map((h) =>
typeof h == "string"
? { label: h, value: h }
: h
)
.filter(Boolean)) || []
);
}),
a = $(() => (n.disabled ? "text-gray-500" : "text-gray-800")),
u = $(() => {
let f = {
sm: "text-base rounded h-7",
md: "text-base rounded h-8",
lg: "text-lg rounded-md h-10",
xl: "text-xl rounded-md h-10",
}[n.size],
h = {
sm: ["py-0", i.prefix ? "pl-8" : "pl-2"],
md: ["py-0", i.prefix ? "pl-9" : "pl-2.5"],
lg: ["py-0", i.prefix ? "pl-10" : "pl-3"],
xl: ["py-0", i.prefix ? "pl-10" : "pl-3"],
}[n.size],
p = n.disabled ? "disabled" : n.variant,
g = {
subtle: "border border-gray-100 bg-gray-100 hover:border-gray-200 hover:bg-gray-200 focus:border-gray-500 focus:ring-0 focus-visible:ring-2 focus-visible:ring-gray-400",
outline:
"border border-gray-300 bg-white hover:border-gray-400 focus:border-gray-500 focus:ring-0 focus-visible:ring-2 focus-visible:ring-gray-400",
ghost: "bg-transparent border-transparent hover:bg-gray-200 focus:bg-gray-200 focus:border-gray-500 focus:ring-0 focus-visible:ring-2 focus-visible:ring-gray-400",
disabled: [
"border",
n.variant !== "ghost" ? "bg-gray-50" : "",
n.variant === "outline"
? "border-gray-300"
: "border-transparent",
],
}[p];
return [f, h, g, a.value, "transition-colors w-full"];
});
let c = $(
() =>
({ sm: "pl-2", md: "pl-2.5", lg: "pl-3", xl: "pl-3" }[
n.size
])
);
return (f, h) => (
B(),
G("div", o8, [
f.$slots.prefix
? (B(),
G(
"div",
{
key: 0,
class: ye([
"absolute inset-y-0 left-0 flex items-center",
a.value,
ne(c),
]),
},
[_e(f.$slots, "prefix")],
2
))
: De("", !0),
U(
"select",
yt(
{
class: u.value,
disabled: f.disabled,
id: f.id,
value: f.modelValue,
onChange: s,
},
ne(o)
),
[
(B(!0),
G(
He,
null,
wn(
l.value,
(p) => (
B(),
G(
"option",
{
key: p.value,
value: p.value,
disabled: p.disabled || !1,
selected:
f.modelValue === p.value,
},
Ge(p.label),
9,
l8
)
)
),
128
)),
],
16,
s8
),
])
);
},
}),
u8 = ["placeholder", "disabled", "id", "value", "rows"],
c8 = xe({
__name: "Textarea",
props: {
size: { default: "sm" },
variant: { default: "subtle" },
placeholder: {},
disabled: { type: Boolean },
id: {},
modelValue: {},
debounce: {},
rows: { default: 3 },
},
emits: ["update:modelValue"],
setup(t, { emit: e }) {
const n = t,
r = e,
i = hs(),
o = $(() => {
let a = {
sm: "text-base rounded",
md: "text-base rounded",
lg: "text-lg rounded-md",
xl: "text-xl rounded-md",
}[n.size],
u = {
sm: ["py-1.5 px-2"],
md: ["py-1.5 px-2.5"],
lg: ["py-1.5 px-3"],
xl: ["py-1.5 px-3"],
}[n.size],
c = n.disabled ? "disabled" : n.variant,
f = {
subtle: "border border-gray-100 bg-gray-100 placeholder-gray-500 hover:border-gray-200 hover:bg-gray-200 focus:bg-white focus:border-gray-500 focus:shadow-sm focus:ring-0 focus-visible:ring-2 focus-visible:ring-gray-400",
outline:
"border border-gray-300 bg-white placeholder-gray-500 hover:border-gray-400 hover:shadow-sm focus:bg-white focus:border-gray-500 focus:shadow-sm focus:ring-0 focus-visible:ring-2 focus-visible:ring-gray-400",
disabled: [
"border bg-gray-50 placeholder-gray-400",
n.variant === "outline"
? "border-gray-300"
: "border-transparent",
],
}[c];
return [
a,
u,
f,
n.disabled ? "text-gray-600" : "text-gray-800",
"transition-colors w-full block",
];
});
let s = (a) => {
r("update:modelValue", a);
};
n.debounce && (s = za(s, n.debounce));
let l = (a) => {
s(a.target.value);
};
return (a, u) => (
B(),
G(
"textarea",
yt(
{
placeholder: a.placeholder,
class: o.value,
disabled: a.disabled,
id: a.id,
value: a.modelValue,
rows: a.rows,
onInput:
u[0] || (u[0] = (...c) => ne(l) && ne(l)(...c)),
onChange:
u[1] || (u[1] = (...c) => ne(l) && ne(l)(...c)),
},
ne(i)
),
null,
16,
u8
)
);
},
}),
d8 = ["for"],
f8 = { inheritAttrs: !1 };
xe(
be(W({}, f8), {
__name: "FormControl",
props: {
label: {},
description: {},
type: { default: "text" },
size: { default: "sm" },
},
setup(t) {
const e = $1(),
n = t,
r = hs(),
i = $(() => {
let l = {};
for (let a in r)
a !== "class" && a !== "style" && (l[a] = r[a]);
return l;
}),
o = $(() => [
{ sm: "text-xs", md: "text-base" }[n.size],
"text-gray-600",
]),
s = $(() => [
{ sm: "text-xs", md: "text-base" }[n.size],
"text-gray-600",
]);
return (l, a) =>
l.type != "checkbox"
? (B(),
G(
"div",
{ key: 0, class: ye(["space-y-1.5", ne(r).class]) },
[
l.label
? (B(),
G(
"label",
{
key: 0,
class: ye(["block", o.value]),
for: ne(e),
},
Ge(l.label),
11,
d8
))
: De("", !0),
l.type === "select"
? (B(),
Be(
a8,
yt(
{ key: 1, id: ne(e) },
be(W({}, i.value), {
size: l.size,
})
),
ou({ _: 2 }, [
l.$slots.prefix
? {
name: "prefix",
fn: Te(() => [
_e(
l.$slots,
"prefix"
),
]),
key: "0",
}
: void 0,
]),
1040,
["id"]
))
: l.type === "autocomplete"
? (B(),
Be(
ik,
Dt(yt({ key: 2 }, W({}, i.value))),
ou({ _: 2 }, [
l.$slots.prefix
? {
name: "prefix",
fn: Te(() => [
_e(
l.$slots,
"prefix"
),
]),
key: "0",
}
: void 0,
l.$slots["item-prefix"]
? {
name: "item-prefix",
fn: Te((u) => [
_e(
l.$slots,
"item-prefix",
Dt(Ft(u))
),
]),
key: "1",
}
: void 0,
]),
1040
))
: l.type === "textarea"
? (B(),
Be(
c8,
yt(
{ key: 3, id: ne(e) },
be(W({}, i.value), {
size: l.size,
})
),
null,
16,
["id"]
))
: (B(),
Be(
i8,
yt(
{ key: 4, id: ne(e) },
be(W({}, i.value), {
type: l.type,
size: l.size,
})
),
ou({ _: 2 }, [
l.$slots.prefix
? {
name: "prefix",
fn: Te(() => [
_e(
l.$slots,
"prefix"
),
]),
key: "0",
}
: void 0,
l.$slots.suffix
? {
name: "suffix",
fn: Te(() => [
_e(
l.$slots,
"suffix"
),
]),
key: "1",
}
: void 0,
]),
1040,
["id"]
)),
_e(l.$slots, "description", {}, () => [
l.description
? (B(),
G(
"p",
{ key: 0, class: ye(s.value) },
Ge(l.description),
3
))
: De("", !0),
]),
],
2
))
: (B(),
Be(
$a,
yt(
{ key: 1, id: ne(e) },
be(W({}, i.value), {
label: l.label,
size: l.size,
class: ne(r).class,
})
),
null,
16,
["id"]
));
},
})
);
const h8 = { class: "min-w-50 space-y-[10px]" },
p8 = { key: 0, class: "flex items-baseline justify-between" },
m8 = { key: 0, class: "text-base font-medium text-gray-800" },
g8 = { key: 1 },
y8 = { key: 2, class: "self-end text-base font-medium text-gray-500" },
v8 = ["aria-valuenow"],
b8 = 0,
yu = 100;
xe({
__name: "Progress",
props: {
value: {},
size: { default: "sm" },
label: { default: "" },
hint: { type: Boolean, default: !1 },
intervals: { type: Boolean, default: !1 },
intervalCount: { default: 6 },
},
setup(t) {
const e = t,
n = Zu(() => {
const i = { sm: "h-[2px]", md: "h-1", lg: "h-2", xl: "h-3" }[
e.size
],
o = e.intervals ? "flex space-x-1" : "relative bg-gray-100";
return [i, o];
}),
r = Zu(() =>
e.value > yu
? e.intervalCount
: Math.round((e.value / yu) * e.intervalCount)
);
return (i, o) => (
B(),
G("div", h8, [
e.label || e.hint
? (B(),
G("div", p8, [
e.label
? (B(), G("span", m8, Ge(e.label), 1))
: (B(), G("span", g8)),
e.hint
? (B(), G("span", y8, Ge(e.value) + "%", 1))
: De("", !0),
]))
: De("", !0),
U(
"div",
{
class: ye(["overflow-hidden rounded-xl", ne(n)]),
"aria-valuemax": yu,
"aria-valuemin": b8,
"aria-valuenow": e.value,
role: "progressbar",
},
[
e.intervals
? (B(!0),
G(
He,
{ key: 1 },
wn(
i.intervalCount,
(s) => (
B(),
G(
"div",
{
class: ye([
"h-full w-full",
s <= ne(r)
? "bg-gray-900"
: "bg-gray-100",
]),
},
null,
2
)
)
),
256
))
: (B(),
G(
"div",
{
key: 0,
class: "h-full bg-gray-900",
style: Ir(`width: ${e.value}%`),
},
null,
4
)),
],
10,
v8
),
])
);
},
});
xe({
__name: "Switch",
props: {
size: { default: "sm" },
label: { default: "" },
description: { default: "" },
disabled: { type: Boolean, default: !1 },
modelValue: { type: [Boolean, Number, String] },
},
emits: ["change", "update:modelValue"],
setup(t, { emit: e }) {
const n = t,
r = e,
i = $(() => (n.label && n.description ? 2 : n.label ? 1 : 0)),
o = $(() => [
"relative inline-flex flex-shrink-0 cursor-pointer rounded-full border-transparent transition-colors duration-100 ease-in-out items-center",
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-gray-400",
"disabled:cursor-not-allowed disabled:bg-gray-200",
n.modelValue
? "bg-gray-900 enabled:hover:bg-gray-800 active:bg-gray-700 group-hover:enabled:bg-gray-800"
: "bg-gray-300 enabled:hover:bg-gray-400 active:bg-gray-500 group-hover:enabled:bg-gray-400",
n.size === "md"
? "h-5 w-8 border-[3px]"
: "h-4 w-[26px] border-2",
]),
s = $(() => [
"pointer-events-none inline-block transform rounded-full bg-white shadow ring-0 transition duration-100 ease-in-out",
n.size === "md" ? "h-3.5 w-3.5" : "h-3 w-3",
n.size === "md"
? n.modelValue
? "translate-x-3"
: "translate-x-0"
: n.modelValue
? "translate-x-2.5"
: "translate-x-0",
]),
l = $(() => [
"font-medium leading-normal",
n.disabled && i.value === 1 ? "text-gray-500" : "text-gray-800",
n.size === "md" ? "text-lg" : "text-base",
]),
a = $(() => ["max-w-xs text-p-base text-gray-700"]),
u = $(() => {
const f = ["flex justify-between"];
return (
i.value === 1
? (f.push(
"group items-center space-x-3 cursor-pointer rounded focus-visible:bg-gray-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-gray-400"
),
f.push(
n.disabled
? "cursor-not-allowed"
: "hover:bg-gray-200 active:bg-gray-300"
),
f.push(
n.size === "md"
? "px-3 py-1.5"
: "px-2.5 py-1.5"
))
: i.value === 2 &&
(f.push("items-start"),
f.push(
n.size === "md" ? "space-x-3.5" : "space-x-2.5"
)),
f
);
}),
c = $(() => ["flex flex-col text-left space-y-0.5"]);
return (f, h) => (
B(),
Be(
ne(bx),
{
as: "div",
tabindex: i.value == 1 ? 0 : -1,
onKeyup:
h[1] ||
(h[1] = ib(
_d(
(p) => r("update:modelValue", !f.modelValue),
["self"]
),
["space"]
)),
class: ye(u.value),
},
{
default: Te(() => [
U(
"span",
{ class: ye(c.value) },
[
n.label
? (B(),
Be(
ne(xx),
{
key: 0,
as: "span",
class: ye(l.value),
},
{
default: Te(() => [
Pn(Ge(n.label), 1),
]),
_: 1,
},
8,
["class"]
))
: De("", !0),
n.description
? (B(),
Be(
ne(kx),
{
key: 1,
as: "span",
class: ye(a.value),
},
{
default: Te(() => [
Pn(Ge(n.description), 1),
]),
_: 1,
},
8,
["class"]
))
: De("", !0),
],
2
),
Me(
ne(wx),
{
disabled: n.disabled,
"model-value": f.modelValue,
class: ye(o.value),
"onUpdate:modelValue":
h[0] ||
(h[0] = (p) =>
r("update:modelValue", !f.modelValue)),
},
{
default: Te(() => [
U(
"span",
{
"aria-hidden": "true",
class: ye(s.value),
},
null,
2
),
]),
_: 1,
},
8,
["disabled", "model-value", "class"]
),
]),
_: 1,
},
8,
["tabindex", "class"]
)
);
},
});
function qt(t) {
this.content = t;
}
qt.prototype = {
constructor: qt,
find: function (t) {
for (var e = 0; e < this.content.length; e += 2)
if (this.content[e] === t) return e;
return -1;
},
get: function (t) {
var e = this.find(t);
return e == -1 ? void 0 : this.content[e + 1];
},
update: function (t, e, n) {
var r = n && n != t ? this.remove(n) : this,
i = r.find(t),
o = r.content.slice();
return (
i == -1 ? o.push(n || t, e) : ((o[i + 1] = e), n && (o[i] = n)),
new qt(o)
);
},
remove: function (t) {
var e = this.find(t);
if (e == -1) return this;
var n = this.content.slice();
return n.splice(e, 2), new qt(n);
},
addToStart: function (t, e) {
return new qt([t, e].concat(this.remove(t).content));
},
addToEnd: function (t, e) {
var n = this.remove(t).content.slice();
return n.push(t, e), new qt(n);
},
addBefore: function (t, e, n) {
var r = this.remove(e),
i = r.content.slice(),
o = r.find(t);
return i.splice(o == -1 ? i.length : o, 0, e, n), new qt(i);
},
forEach: function (t) {
for (var e = 0; e < this.content.length; e += 2)
t(this.content[e], this.content[e + 1]);
},
prepend: function (t) {
return (
(t = qt.from(t)),
t.size ? new qt(t.content.concat(this.subtract(t).content)) : this
);
},
append: function (t) {
return (
(t = qt.from(t)),
t.size ? new qt(this.subtract(t).content.concat(t.content)) : this
);
},
subtract: function (t) {
var e = this;
t = qt.from(t);
for (var n = 0; n < t.content.length; n += 2)
e = e.remove(t.content[n]);
return e;
},
toObject: function () {
var t = {};
return (
this.forEach(function (e, n) {
t[e] = n;
}),
t
);
},
get size() {
return this.content.length >> 1;
},
};
qt.from = function (t) {
if (t instanceof qt) return t;
var e = [];
if (t) for (var n in t) e.push(n, t[n]);
return new qt(e);
};
function z1(t, e, n) {
for (let r = 0; ; r++) {
if (r == t.childCount || r == e.childCount)
return t.childCount == e.childCount ? null : n;
let i = t.child(r),
o = e.child(r);
if (i == o) {
n += i.nodeSize;
continue;
}
if (!i.sameMarkup(o)) return n;
if (i.isText && i.text != o.text) {
for (let s = 0; i.text[s] == o.text[s]; s++) n++;
return n;
}
if (i.content.size || o.content.size) {
let s = z1(i.content, o.content, n + 1);
if (s != null) return s;
}
n += i.nodeSize;
}
}
function H1(t, e, n, r) {
for (let i = t.childCount, o = e.childCount; ; ) {
if (i == 0 || o == 0) return i == o ? null : { a: n, b: r };
let s = t.child(--i),
l = e.child(--o),
a = s.nodeSize;
if (s == l) {
(n -= a), (r -= a);
continue;
}
if (!s.sameMarkup(l)) return { a: n, b: r };
if (s.isText && s.text != l.text) {
let u = 0,
c = Math.min(s.text.length, l.text.length);
for (
;
u < c &&
s.text[s.text.length - u - 1] == l.text[l.text.length - u - 1];
)
u++, n--, r--;
return { a: n, b: r };
}
if (s.content.size || l.content.size) {
let u = H1(s.content, l.content, n - 1, r - 1);
if (u) return u;
}
(n -= a), (r -= a);
}
}
class Y {
constructor(e, n) {
if (((this.content = e), (this.size = n || 0), n == null))
for (let r = 0; r < e.length; r++) this.size += e[r].nodeSize;
}
nodesBetween(e, n, r, i = 0, o) {
for (let s = 0, l = 0; l < n; s++) {
let a = this.content[s],
u = l + a.nodeSize;
if (u > e && r(a, i + l, o || null, s) !== !1 && a.content.size) {
let c = l + 1;
a.nodesBetween(
Math.max(0, e - c),
Math.min(a.content.size, n - c),
r,
i + c
);
}
l = u;
}
}
descendants(e) {
this.nodesBetween(0, this.size, e);
}
textBetween(e, n, r, i) {
let o = "",
s = !0;
return (
this.nodesBetween(
e,
n,
(l, a) => {
l.isText
? ((o += l.text.slice(Math.max(e, a) - a, n - a)),
(s = !r))
: l.isLeaf
? (i
? (o += typeof i == "function" ? i(l) : i)
: l.type.spec.leafText &&
(o += l.type.spec.leafText(l)),
(s = !r))
: !s && l.isBlock && ((o += r), (s = !0));
},
0
),
o
);
}
append(e) {
if (!e.size) return this;
if (!this.size) return e;
let n = this.lastChild,
r = e.firstChild,
i = this.content.slice(),
o = 0;
for (
n.isText &&
n.sameMarkup(r) &&
((i[i.length - 1] = n.withText(n.text + r.text)), (o = 1));
o < e.content.length;
o++
)
i.push(e.content[o]);
return new Y(i, this.size + e.size);
}
cut(e, n = this.size) {
if (e == 0 && n == this.size) return this;
let r = [],
i = 0;
if (n > e)
for (let o = 0, s = 0; s < n; o++) {
let l = this.content[o],
a = s + l.nodeSize;
a > e &&
((s < e || a > n) &&
(l.isText
? (l = l.cut(
Math.max(0, e - s),
Math.min(l.text.length, n - s)
))
: (l = l.cut(
Math.max(0, e - s - 1),
Math.min(l.content.size, n - s - 1)
))),
r.push(l),
(i += l.nodeSize)),
(s = a);
}
return new Y(r, i);
}
cutByIndex(e, n) {
return e == n
? Y.empty
: e == 0 && n == this.content.length
? this
: new Y(this.content.slice(e, n));
}
replaceChild(e, n) {
let r = this.content[e];
if (r == n) return this;
let i = this.content.slice(),
o = this.size + n.nodeSize - r.nodeSize;
return (i[e] = n), new Y(i, o);
}
addToStart(e) {
return new Y([e].concat(this.content), this.size + e.nodeSize);
}
addToEnd(e) {
return new Y(this.content.concat(e), this.size + e.nodeSize);
}
eq(e) {
if (this.content.length != e.content.length) return !1;
for (let n = 0; n < this.content.length; n++)
if (!this.content[n].eq(e.content[n])) return !1;
return !0;
}
get firstChild() {
return this.content.length ? this.content[0] : null;
}
get lastChild() {
return this.content.length
? this.content[this.content.length - 1]
: null;
}
get childCount() {
return this.content.length;
}
child(e) {
let n = this.content[e];
if (!n)
throw new RangeError("Index " + e + " out of range for " + this);
return n;
}
maybeChild(e) {
return this.content[e] || null;
}
forEach(e) {
for (let n = 0, r = 0; n < this.content.length; n++) {
let i = this.content[n];
e(i, r, n), (r += i.nodeSize);
}
}
findDiffStart(e, n = 0) {
return z1(this, e, n);
}
findDiffEnd(e, n = this.size, r = e.size) {
return H1(this, e, n, r);
}
findIndex(e, n = -1) {
if (e == 0) return Hs(0, e);
if (e == this.size) return Hs(this.content.length, e);
if (e > this.size || e < 0)
throw new RangeError(`Position ${e} outside of fragment (${this})`);
for (let r = 0, i = 0; ; r++) {
let o = this.child(r),
s = i + o.nodeSize;
if (s >= e) return s == e || n > 0 ? Hs(r + 1, s) : Hs(r, i);
i = s;
}
}
toString() {
return "<" + this.toStringInner() + ">";
}
toStringInner() {
return this.content.join(", ");
}
toJSON() {
return this.content.length ? this.content.map((e) => e.toJSON()) : null;
}
static fromJSON(e, n) {
if (!n) return Y.empty;
if (!Array.isArray(n))
throw new RangeError("Invalid input for Fragment.fromJSON");
return new Y(n.map(e.nodeFromJSON));
}
static fromArray(e) {
if (!e.length) return Y.empty;
let n,
r = 0;
for (let i = 0; i < e.length; i++) {
let o = e[i];
(r += o.nodeSize),
i && o.isText && e[i - 1].sameMarkup(o)
? (n || (n = e.slice(0, i)),
(n[n.length - 1] = o.withText(
n[n.length - 1].text + o.text
)))
: n && n.push(o);
}
return new Y(n || e, r);
}
static from(e) {
if (!e) return Y.empty;
if (e instanceof Y) return e;
if (Array.isArray(e)) return this.fromArray(e);
if (e.attrs) return new Y([e], e.nodeSize);
throw new RangeError(
"Can not convert " +
e +
" to a Fragment" +
(e.nodesBetween
? " (looks like multiple versions of prosemirror-model were loaded)"
: "")
);
}
}
Y.empty = new Y([], 0);
const vu = { index: 0, offset: 0 };
function Hs(t, e) {
return (vu.index = t), (vu.offset = e), vu;
}
function Ml(t, e) {
if (t === e) return !0;
if (!(t && typeof t == "object") || !(e && typeof e == "object")) return !1;
let n = Array.isArray(t);
if (Array.isArray(e) != n) return !1;
if (n) {
if (t.length != e.length) return !1;
for (let r = 0; r < t.length; r++) if (!Ml(t[r], e[r])) return !1;
} else {
for (let r in t) if (!(r in e) || !Ml(t[r], e[r])) return !1;
for (let r in e) if (!(r in t)) return !1;
}
return !0;
}
class dt {
constructor(e, n) {
(this.type = e), (this.attrs = n);
}
addToSet(e) {
let n,
r = !1;
for (let i = 0; i < e.length; i++) {
let o = e[i];
if (this.eq(o)) return e;
if (this.type.excludes(o.type)) n || (n = e.slice(0, i));
else {
if (o.type.excludes(this.type)) return e;
!r &&
o.type.rank > this.type.rank &&
(n || (n = e.slice(0, i)), n.push(this), (r = !0)),
n && n.push(o);
}
}
return n || (n = e.slice()), r || n.push(this), n;
}
removeFromSet(e) {
for (let n = 0; n < e.length; n++)
if (this.eq(e[n])) return e.slice(0, n).concat(e.slice(n + 1));
return e;
}
isInSet(e) {
for (let n = 0; n < e.length; n++) if (this.eq(e[n])) return !0;
return !1;
}
eq(e) {
return this == e || (this.type == e.type && Ml(this.attrs, e.attrs));
}
toJSON() {
let e = { type: this.type.name };
for (let n in this.attrs) {
e.attrs = this.attrs;
break;
}
return e;
}
static fromJSON(e, n) {
if (!n) throw new RangeError("Invalid input for Mark.fromJSON");
let r = e.marks[n.type];
if (!r)
throw new RangeError(
`There is no mark type ${n.type} in this schema`
);
return r.create(n.attrs);
}
static sameSet(e, n) {
if (e == n) return !0;
if (e.length != n.length) return !1;
for (let r = 0; r < e.length; r++) if (!e[r].eq(n[r])) return !1;
return !0;
}
static setFrom(e) {
if (!e || (Array.isArray(e) && e.length == 0)) return dt.none;
if (e instanceof dt) return [e];
let n = e.slice();
return n.sort((r, i) => r.type.rank - i.type.rank), n;
}
}
dt.none = [];
class El extends Error {}
class ie {
constructor(e, n, r) {
(this.content = e), (this.openStart = n), (this.openEnd = r);
}
get size() {
return this.content.size - this.openStart - this.openEnd;
}
insertAt(e, n) {
let r = V1(this.content, e + this.openStart, n);
return r && new ie(r, this.openStart, this.openEnd);
}
removeBetween(e, n) {
return new ie(
F1(this.content, e + this.openStart, n + this.openStart),
this.openStart,
this.openEnd
);
}
eq(e) {
return (
this.content.eq(e.content) &&
this.openStart == e.openStart &&
this.openEnd == e.openEnd
);
}
toString() {
return this.content + "(" + this.openStart + "," + this.openEnd + ")";
}
toJSON() {
if (!this.content.size) return null;
let e = { content: this.content.toJSON() };
return (
this.openStart > 0 && (e.openStart = this.openStart),
this.openEnd > 0 && (e.openEnd = this.openEnd),
e
);
}
static fromJSON(e, n) {
if (!n) return ie.empty;
let r = n.openStart || 0,
i = n.openEnd || 0;
if (typeof r != "number" || typeof i != "number")
throw new RangeError("Invalid input for Slice.fromJSON");
return new ie(Y.fromJSON(e, n.content), r, i);
}
static maxOpen(e, n = !0) {
let r = 0,
i = 0;
for (
let o = e.firstChild;
o && !o.isLeaf && (n || !o.type.spec.isolating);
o = o.firstChild
)
r++;
for (
let o = e.lastChild;
o && !o.isLeaf && (n || !o.type.spec.isolating);
o = o.lastChild
)
i++;
return new ie(e, r, i);
}
}
ie.empty = new ie(Y.empty, 0, 0);
function F1(t, e, n) {
let { index: r, offset: i } = t.findIndex(e),
o = t.maybeChild(r),
{ index: s, offset: l } = t.findIndex(n);
if (i == e || o.isText) {
if (l != n && !t.child(s).isText)
throw new RangeError("Removing non-flat range");
return t.cut(0, e).append(t.cut(n));
}
if (r != s) throw new RangeError("Removing non-flat range");
return t.replaceChild(r, o.copy(F1(o.content, e - i - 1, n - i - 1)));
}
function V1(t, e, n, r) {
let { index: i, offset: o } = t.findIndex(e),
s = t.maybeChild(i);
if (o == e || s.isText)
return r && !r.canReplace(i, i, n)
? null
: t.cut(0, e).append(n).append(t.cut(e));
let l = V1(s.content, e - o - 1, n);
return l && t.replaceChild(i, s.copy(l));
}
function w8(t, e, n) {
if (n.openStart > t.depth)
throw new El("Inserted content deeper than insertion position");
if (t.depth - n.openStart != e.depth - n.openEnd)
throw new El("Inconsistent open depths");
return W1(t, e, n, 0);
}
function W1(t, e, n, r) {
let i = t.index(r),
o = t.node(r);
if (i == e.index(r) && r < t.depth - n.openStart) {
let s = W1(t, e, n, r + 1);
return o.copy(o.content.replaceChild(i, s));
} else if (n.content.size)
if (!n.openStart && !n.openEnd && t.depth == r && e.depth == r) {
let s = t.parent,
l = s.content;
return di(
s,
l
.cut(0, t.parentOffset)
.append(n.content)
.append(l.cut(e.parentOffset))
);
} else {
let { start: s, end: l } = x8(n, t);
return di(o, K1(t, s, l, e, r));
}
else return di(o, Al(t, e, r));
}
function U1(t, e) {
if (!e.type.compatibleContent(t.type))
throw new El("Cannot join " + e.type.name + " onto " + t.type.name);
}
function Sc(t, e, n) {
let r = t.node(n);
return U1(r, e.node(n)), r;
}
function ci(t, e) {
let n = e.length - 1;
n >= 0 && t.isText && t.sameMarkup(e[n])
? (e[n] = t.withText(e[n].text + t.text))
: e.push(t);
}
function Io(t, e, n, r) {
let i = (e || t).node(n),
o = 0,
s = e ? e.index(n) : i.childCount;
t &&
((o = t.index(n)),
t.depth > n ? o++ : t.textOffset && (ci(t.nodeAfter, r), o++));
for (let l = o; l < s; l++) ci(i.child(l), r);
e && e.depth == n && e.textOffset && ci(e.nodeBefore, r);
}
function di(t, e) {
return t.type.checkContent(e), t.copy(e);
}
function K1(t, e, n, r, i) {
let o = t.depth > i && Sc(t, e, i + 1),
s = r.depth > i && Sc(n, r, i + 1),
l = [];
return (
Io(null, t, i, l),
o && s && e.index(i) == n.index(i)
? (U1(o, s), ci(di(o, K1(t, e, n, r, i + 1)), l))
: (o && ci(di(o, Al(t, e, i + 1)), l),
Io(e, n, i, l),
s && ci(di(s, Al(n, r, i + 1)), l)),
Io(r, null, i, l),
new Y(l)
);
}
function Al(t, e, n) {
let r = [];
if ((Io(null, t, n, r), t.depth > n)) {
let i = Sc(t, e, n + 1);
ci(di(i, Al(t, e, n + 1)), r);
}
return Io(e, null, n, r), new Y(r);
}
function x8(t, e) {
let n = e.depth - t.openStart,
i = e.node(n).copy(t.content);
for (let o = n - 1; o >= 0; o--) i = e.node(o).copy(Y.from(i));
return {
start: i.resolveNoCache(t.openStart + n),
end: i.resolveNoCache(i.content.size - t.openEnd - n),
};
}
class Zo {
constructor(e, n, r) {
(this.pos = e),
(this.path = n),
(this.parentOffset = r),
(this.depth = n.length / 3 - 1);
}
resolveDepth(e) {
return e == null ? this.depth : e < 0 ? this.depth + e : e;
}
get parent() {
return this.node(this.depth);
}
get doc() {
return this.node(0);
}
node(e) {
return this.path[this.resolveDepth(e) * 3];
}
index(e) {
return this.path[this.resolveDepth(e) * 3 + 1];
}
indexAfter(e) {
return (
(e = this.resolveDepth(e)),
this.index(e) + (e == this.depth && !this.textOffset ? 0 : 1)
);
}
start(e) {
return (
(e = this.resolveDepth(e)), e == 0 ? 0 : this.path[e * 3 - 1] + 1
);
}
end(e) {
return (
(e = this.resolveDepth(e)),
this.start(e) + this.node(e).content.size
);
}
before(e) {
if (((e = this.resolveDepth(e)), !e))
throw new RangeError(
"There is no position before the top-level node"
);
return e == this.depth + 1 ? this.pos : this.path[e * 3 - 1];
}
after(e) {
if (((e = this.resolveDepth(e)), !e))
throw new RangeError(
"There is no position after the top-level node"
);
return e == this.depth + 1
? this.pos
: this.path[e * 3 - 1] + this.path[e * 3].nodeSize;
}
get textOffset() {
return this.pos - this.path[this.path.length - 1];
}
get nodeAfter() {
let e = this.parent,
n = this.index(this.depth);
if (n == e.childCount) return null;
let r = this.pos - this.path[this.path.length - 1],
i = e.child(n);
return r ? e.child(n).cut(r) : i;
}
get nodeBefore() {
let e = this.index(this.depth),
n = this.pos - this.path[this.path.length - 1];
return n
? this.parent.child(e).cut(0, n)
: e == 0
? null
: this.parent.child(e - 1);
}
posAtIndex(e, n) {
n = this.resolveDepth(n);
let r = this.path[n * 3],
i = n == 0 ? 0 : this.path[n * 3 - 1] + 1;
for (let o = 0; o < e; o++) i += r.child(o).nodeSize;
return i;
}
marks() {
let e = this.parent,
n = this.index();
if (e.content.size == 0) return dt.none;
if (this.textOffset) return e.child(n).marks;
let r = e.maybeChild(n - 1),
i = e.maybeChild(n);
if (!r) {
let l = r;
(r = i), (i = l);
}
let o = r.marks;
for (var s = 0; s < o.length; s++)
o[s].type.spec.inclusive === !1 &&
(!i || !o[s].isInSet(i.marks)) &&
(o = o[s--].removeFromSet(o));
return o;
}
marksAcross(e) {
let n = this.parent.maybeChild(this.index());
if (!n || !n.isInline) return null;
let r = n.marks,
i = e.parent.maybeChild(e.index());
for (var o = 0; o < r.length; o++)
r[o].type.spec.inclusive === !1 &&
(!i || !r[o].isInSet(i.marks)) &&
(r = r[o--].removeFromSet(r));
return r;
}
sharedDepth(e) {
for (let n = this.depth; n > 0; n--)
if (this.start(n) <= e && this.end(n) >= e) return n;
return 0;
}
blockRange(e = this, n) {
if (e.pos < this.pos) return e.blockRange(this);
for (
let r =
this.depth -
(this.parent.inlineContent || this.pos == e.pos ? 1 : 0);
r >= 0;
r--
)
if (e.pos <= this.end(r) && (!n || n(this.node(r))))
return new Tl(this, e, r);
return null;
}
sameParent(e) {
return this.pos - this.parentOffset == e.pos - e.parentOffset;
}
max(e) {
return e.pos > this.pos ? e : this;
}
min(e) {
return e.pos < this.pos ? e : this;
}
toString() {
let e = "";
for (let n = 1; n <= this.depth; n++)
e +=
(e ? "/" : "") +
this.node(n).type.name +
"_" +
this.index(n - 1);
return e + ":" + this.parentOffset;
}
static resolve(e, n) {
if (!(n >= 0 && n <= e.content.size))
throw new RangeError("Position " + n + " out of range");
let r = [],
i = 0,
o = n;
for (let s = e; ; ) {
let { index: l, offset: a } = s.content.findIndex(o),
u = o - a;
if ((r.push(s, l, i + a), !u || ((s = s.child(l)), s.isText)))
break;
(o = u - 1), (i += a + 1);
}
return new Zo(n, r, o);
}
static resolveCached(e, n) {
for (let i = 0; i < bu.length; i++) {
let o = bu[i];
if (o.pos == n && o.doc == e) return o;
}
let r = (bu[wu] = Zo.resolve(e, n));
return (wu = (wu + 1) % k8), r;
}
}
let bu = [],
wu = 0,
k8 = 12;
class Tl {
constructor(e, n, r) {
(this.$from = e), (this.$to = n), (this.depth = r);
}
get start() {
return this.$from.before(this.depth + 1);
}
get end() {
return this.$to.after(this.depth + 1);
}
get parent() {
return this.$from.node(this.depth);
}
get startIndex() {
return this.$from.index(this.depth);
}
get endIndex() {
return this.$to.indexAfter(this.depth);
}
}
const C8 = Object.create(null);
class Ol {
constructor(e, n, r, i = dt.none) {
(this.type = e),
(this.attrs = n),
(this.marks = i),
(this.content = r || Y.empty);
}
get nodeSize() {
return this.isLeaf ? 1 : 2 + this.content.size;
}
get childCount() {
return this.content.childCount;
}
child(e) {
return this.content.child(e);
}
maybeChild(e) {
return this.content.maybeChild(e);
}
forEach(e) {
this.content.forEach(e);
}
nodesBetween(e, n, r, i = 0) {
this.content.nodesBetween(e, n, r, i, this);
}
descendants(e) {
this.nodesBetween(0, this.content.size, e);
}
get textContent() {
return this.isLeaf && this.type.spec.leafText
? this.type.spec.leafText(this)
: this.textBetween(0, this.content.size, "");
}
textBetween(e, n, r, i) {
return this.content.textBetween(e, n, r, i);
}
get firstChild() {
return this.content.firstChild;
}
get lastChild() {
return this.content.lastChild;
}
eq(e) {
return this == e || (this.sameMarkup(e) && this.content.eq(e.content));
}
sameMarkup(e) {
return this.hasMarkup(e.type, e.attrs, e.marks);
}
hasMarkup(e, n, r) {
return (
this.type == e &&
Ml(this.attrs, n || e.defaultAttrs || C8) &&
dt.sameSet(this.marks, r || dt.none)
);
}
copy(e = null) {
return e == this.content
? this
: new Ol(this.type, this.attrs, e, this.marks);
}
mark(e) {
return e == this.marks
? this
: new Ol(this.type, this.attrs, this.content, e);
}
cut(e, n = this.content.size) {
return e == 0 && n == this.content.size
? this
: this.copy(this.content.cut(e, n));
}
slice(e, n = this.content.size, r = !1) {
if (e == n) return ie.empty;
let i = this.resolve(e),
o = this.resolve(n),
s = r ? 0 : i.sharedDepth(n),
l = i.start(s),
u = i.node(s).content.cut(i.pos - l, o.pos - l);
return new ie(u, i.depth - s, o.depth - s);
}
replace(e, n, r) {
return w8(this.resolve(e), this.resolve(n), r);
}
nodeAt(e) {
for (let n = this; ; ) {
let { index: r, offset: i } = n.content.findIndex(e);
if (((n = n.maybeChild(r)), !n)) return null;
if (i == e || n.isText) return n;
e -= i + 1;
}
}
childAfter(e) {
let { index: n, offset: r } = this.content.findIndex(e);
return { node: this.content.maybeChild(n), index: n, offset: r };
}
childBefore(e) {
if (e == 0) return { node: null, index: 0, offset: 0 };
let { index: n, offset: r } = this.content.findIndex(e);
if (r < e) return { node: this.content.child(n), index: n, offset: r };
let i = this.content.child(n - 1);
return { node: i, index: n - 1, offset: r - i.nodeSize };
}
resolve(e) {
return Zo.resolveCached(this, e);
}
resolveNoCache(e) {
return Zo.resolve(this, e);
}
rangeHasMark(e, n, r) {
let i = !1;
return (
n > e &&
this.nodesBetween(
e,
n,
(o) => (r.isInSet(o.marks) && (i = !0), !i)
),
i
);
}
get isBlock() {
return this.type.isBlock;
}
get isTextblock() {
return this.type.isTextblock;
}
get inlineContent() {
return this.type.inlineContent;
}
get isInline() {
return this.type.isInline;
}
get isText() {
return this.type.isText;
}
get isLeaf() {
return this.type.isLeaf;
}
get isAtom() {
return this.type.isAtom;
}
toString() {
if (this.type.spec.toDebugString)
return this.type.spec.toDebugString(this);
let e = this.type.name;
return (
this.content.size &&
(e += "(" + this.content.toStringInner() + ")"),
S8(this.marks, e)
);
}
contentMatchAt(e) {
let n = this.type.contentMatch.matchFragment(this.content, 0, e);
if (!n)
throw new Error(
"Called contentMatchAt on a node with invalid content"
);
return n;
}
canReplace(e, n, r = Y.empty, i = 0, o = r.childCount) {
let s = this.contentMatchAt(e).matchFragment(r, i, o),
l = s && s.matchFragment(this.content, n);
if (!l || !l.validEnd) return !1;
for (let a = i; a < o; a++)
if (!this.type.allowsMarks(r.child(a).marks)) return !1;
return !0;
}
canReplaceWith(e, n, r, i) {
if (i && !this.type.allowsMarks(i)) return !1;
let o = this.contentMatchAt(e).matchType(r),
s = o && o.matchFragment(this.content, n);
return s ? s.validEnd : !1;
}
canAppend(e) {
return e.content.size
? this.canReplace(this.childCount, this.childCount, e.content)
: this.type.compatibleContent(e.type);
}
check() {
this.type.checkContent(this.content);
let e = dt.none;
for (let n = 0; n < this.marks.length; n++)
e = this.marks[n].addToSet(e);
if (!dt.sameSet(e, this.marks))
throw new RangeError(
`Invalid collection of marks for node ${
this.type.name
}: ${this.marks.map((n) => n.type.name)}`
);
this.content.forEach((n) => n.check());
}
toJSON() {
let e = { type: this.type.name };
for (let n in this.attrs) {
e.attrs = this.attrs;
break;
}
return (
this.content.size && (e.content = this.content.toJSON()),
this.marks.length && (e.marks = this.marks.map((n) => n.toJSON())),
e
);
}
static fromJSON(e, n) {
if (!n) throw new RangeError("Invalid input for Node.fromJSON");
let r = null;
if (n.marks) {
if (!Array.isArray(n.marks))
throw new RangeError("Invalid mark data for Node.fromJSON");
r = n.marks.map(e.markFromJSON);
}
if (n.type == "text") {
if (typeof n.text != "string")
throw new RangeError("Invalid text node in JSON");
return e.text(n.text, r);
}
let i = Y.fromJSON(e, n.content);
return e.nodeType(n.type).create(n.attrs, i, r);
}
}
Ol.prototype.text = void 0;
function S8(t, e) {
for (let n = t.length - 1; n >= 0; n--) e = t[n].type.name + "(" + e + ")";
return e;
}
class es {
constructor(e) {
(this.validEnd = e), (this.next = []), (this.wrapCache = []);
}
static parse(e, n) {
let r = new _8(e, n);
if (r.next == null) return es.empty;
let i = q1(r);
r.next && r.err("Unexpected trailing text");
let o = P8(R8(i));
return N8(o, r), o;
}
matchType(e) {
for (let n = 0; n < this.next.length; n++)
if (this.next[n].type == e) return this.next[n].next;
return null;
}
matchFragment(e, n = 0, r = e.childCount) {
let i = this;
for (let o = n; i && o < r; o++) i = i.matchType(e.child(o).type);
return i;
}
get inlineContent() {
return this.next.length != 0 && this.next[0].type.isInline;
}
get defaultType() {
for (let e = 0; e < this.next.length; e++) {
let { type: n } = this.next[e];
if (!(n.isText || n.hasRequiredAttrs())) return n;
}
return null;
}
compatible(e) {
for (let n = 0; n < this.next.length; n++)
for (let r = 0; r < e.next.length; r++)
if (this.next[n].type == e.next[r].type) return !0;
return !1;
}
fillBefore(e, n = !1, r = 0) {
let i = [this];
function o(s, l) {
let a = s.matchFragment(e, r);
if (a && (!n || a.validEnd))
return Y.from(l.map((u) => u.createAndFill()));
for (let u = 0; u < s.next.length; u++) {
let { type: c, next: f } = s.next[u];
if (!(c.isText || c.hasRequiredAttrs()) && i.indexOf(f) == -1) {
i.push(f);
let h = o(f, l.concat(c));
if (h) return h;
}
}
return null;
}
return o(this, []);
}
findWrapping(e) {
for (let r = 0; r < this.wrapCache.length; r += 2)
if (this.wrapCache[r] == e) return this.wrapCache[r + 1];
let n = this.computeWrapping(e);
return this.wrapCache.push(e, n), n;
}
computeWrapping(e) {
let n = Object.create(null),
r = [{ match: this, type: null, via: null }];
for (; r.length; ) {
let i = r.shift(),
o = i.match;
if (o.matchType(e)) {
let s = [];
for (let l = i; l.type; l = l.via) s.push(l.type);
return s.reverse();
}
for (let s = 0; s < o.next.length; s++) {
let { type: l, next: a } = o.next[s];
!l.isLeaf &&
!l.hasRequiredAttrs() &&
!(l.name in n) &&
(!i.type || a.validEnd) &&
(r.push({ match: l.contentMatch, type: l, via: i }),
(n[l.name] = !0));
}
}
return null;
}
get edgeCount() {
return this.next.length;
}
edge(e) {
if (e >= this.next.length)
throw new RangeError(
`There's no ${e}th edge in this content match`
);
return this.next[e];
}
toString() {
let e = [];
function n(r) {
e.push(r);
for (let i = 0; i < r.next.length; i++)
e.indexOf(r.next[i].next) == -1 && n(r.next[i].next);
}
return (
n(this),
e.map((r, i) => {
let o = i + (r.validEnd ? "*" : " ") + " ";
for (let s = 0; s < r.next.length; s++)
o +=
(s ? ", " : "") +
r.next[s].type.name +
"->" +
e.indexOf(r.next[s].next);
return o;
}).join(`
`)
);
}
}
es.empty = new es(!0);
class _8 {
constructor(e, n) {
(this.string = e),
(this.nodeTypes = n),
(this.inline = null),
(this.pos = 0),
(this.tokens = e.split(/\s*(?=\b|\W|$)/)),
this.tokens[this.tokens.length - 1] == "" && this.tokens.pop(),
this.tokens[0] == "" && this.tokens.shift();
}
get next() {
return this.tokens[this.pos];
}
eat(e) {
return this.next == e && (this.pos++ || !0);
}
err(e) {
throw new SyntaxError(
e + " (in content expression '" + this.string + "')"
);
}
}
function q1(t) {
let e = [];
do e.push(M8(t));
while (t.eat("|"));
return e.length == 1 ? e[0] : { type: "choice", exprs: e };
}
function M8(t) {
let e = [];
do e.push(E8(t));
while (t.next && t.next != ")" && t.next != "|");
return e.length == 1 ? e[0] : { type: "seq", exprs: e };
}
function E8(t) {
let e = O8(t);
for (;;)
if (t.eat("+")) e = { type: "plus", expr: e };
else if (t.eat("*")) e = { type: "star", expr: e };
else if (t.eat("?")) e = { type: "opt", expr: e };
else if (t.eat("{")) e = A8(t, e);
else break;
return e;
}
function lp(t) {
/\D/.test(t.next) && t.err("Expected number, got '" + t.next + "'");
let e = Number(t.next);
return t.pos++, e;
}
function A8(t, e) {
let n = lp(t),
r = n;
return (
t.eat(",") && (t.next != "}" ? (r = lp(t)) : (r = -1)),
t.eat("}") || t.err("Unclosed braced range"),
{ type: "range", min: n, max: r, expr: e }
);
}
function T8(t, e) {
let n = t.nodeTypes,
r = n[e];
if (r) return [r];
let i = [];
for (let o in n) {
let s = n[o];
s.groups.indexOf(e) > -1 && i.push(s);
}
return i.length == 0 && t.err("No node type or group '" + e + "' found"), i;
}
function O8(t) {
if (t.eat("(")) {
let e = q1(t);
return t.eat(")") || t.err("Missing closing paren"), e;
} else if (/\W/.test(t.next)) t.err("Unexpected token '" + t.next + "'");
else {
let e = T8(t, t.next).map(
(n) => (
t.inline == null
? (t.inline = n.isInline)
: t.inline != n.isInline &&
t.err("Mixing inline and block content"),
{ type: "name", value: n }
)
);
return t.pos++, e.length == 1 ? e[0] : { type: "choice", exprs: e };
}
}
function R8(t) {
let e = [[]];
return i(o(t, 0), n()), e;
function n() {
return e.push([]) - 1;
}
function r(s, l, a) {
let u = { term: a, to: l };
return e[s].push(u), u;
}
function i(s, l) {
s.forEach((a) => (a.to = l));
}
function o(s, l) {
if (s.type == "choice")
return s.exprs.reduce((a, u) => a.concat(o(u, l)), []);
if (s.type == "seq")
for (let a = 0; ; a++) {
let u = o(s.exprs[a], l);
if (a == s.exprs.length - 1) return u;
i(u, (l = n()));
}
else if (s.type == "star") {
let a = n();
return r(l, a), i(o(s.expr, a), a), [r(a)];
} else if (s.type == "plus") {
let a = n();
return i(o(s.expr, l), a), i(o(s.expr, a), a), [r(a)];
} else {
if (s.type == "opt") return [r(l)].concat(o(s.expr, l));
if (s.type == "range") {
let a = l;
for (let u = 0; u < s.min; u++) {
let c = n();
i(o(s.expr, a), c), (a = c);
}
if (s.max == -1) i(o(s.expr, a), a);
else
for (let u = s.min; u < s.max; u++) {
let c = n();
r(a, c), i(o(s.expr, a), c), (a = c);
}
return [r(a)];
} else {
if (s.type == "name") return [r(l, void 0, s.value)];
throw new Error("Unknown expr type");
}
}
}
}
function J1(t, e) {
return e - t;
}
function ap(t, e) {
let n = [];
return r(e), n.sort(J1);
function r(i) {
let o = t[i];
if (o.length == 1 && !o[0].term) return r(o[0].to);
n.push(i);
for (let s = 0; s < o.length; s++) {
let { term: l, to: a } = o[s];
!l && n.indexOf(a) == -1 && r(a);
}
}
}
function P8(t) {
let e = Object.create(null);
return n(ap(t, 0));
function n(r) {
let i = [];
r.forEach((s) => {
t[s].forEach(({ term: l, to: a }) => {
if (!l) return;
let u;
for (let c = 0; c < i.length; c++)
i[c][0] == l && (u = i[c][1]);
ap(t, a).forEach((c) => {
u || i.push([l, (u = [])]), u.indexOf(c) == -1 && u.push(c);
});
});
});
let o = (e[r.join(",")] = new es(r.indexOf(t.length - 1) > -1));
for (let s = 0; s < i.length; s++) {
let l = i[s][1].sort(J1);
o.next.push({ type: i[s][0], next: e[l.join(",")] || n(l) });
}
return o;
}
}
function N8(t, e) {
for (let n = 0, r = [t]; n < r.length; n++) {
let i = r[n],
o = !i.validEnd,
s = [];
for (let l = 0; l < i.next.length; l++) {
let { type: a, next: u } = i.next[l];
s.push(a.name),
o && !(a.isText || a.hasRequiredAttrs()) && (o = !1),
r.indexOf(u) == -1 && r.push(u);
}
o &&
e.err(
"Only non-generatable nodes (" +
s.join(", ") +
") in a required position (see https://prosemirror.net/docs/guide/#generatable)"
);
}
}
function j8(t) {
let e = Object.create(null);
for (let n in t) {
let r = t[n];
if (!r.hasDefault) return null;
e[n] = r.default;
}
return e;
}
function L8(t, e) {
let n = Object.create(null);
for (let r in t) {
let i = e && e[r];
if (i === void 0) {
let o = t[r];
if (o.hasDefault) i = o.default;
else throw new RangeError("No value supplied for attribute " + r);
}
n[r] = i;
}
return n;
}
function D8(t) {
let e = Object.create(null);
if (t) for (let n in t) e[n] = new I8(t[n]);
return e;
}
class I8 {
constructor(e) {
(this.hasDefault = Object.prototype.hasOwnProperty.call(e, "default")),
(this.default = e.default);
}
get isRequired() {
return !this.hasDefault;
}
}
class Yd {
constructor(e, n, r, i) {
(this.name = e),
(this.rank = n),
(this.schema = r),
(this.spec = i),
(this.attrs = D8(i.attrs)),
(this.excluded = null);
let o = j8(this.attrs);
this.instance = o ? new dt(this, o) : null;
}
create(e = null) {
return !e && this.instance
? this.instance
: new dt(this, L8(this.attrs, e));
}
static compile(e, n) {
let r = Object.create(null),
i = 0;
return e.forEach((o, s) => (r[o] = new Yd(o, i++, n, s))), r;
}
removeFromSet(e) {
for (var n = 0; n < e.length; n++)
e[n].type == this &&
((e = e.slice(0, n).concat(e.slice(n + 1))), n--);
return e;
}
isInSet(e) {
for (let n = 0; n < e.length; n++) if (e[n].type == this) return e[n];
}
excludes(e) {
return this.excluded.indexOf(e) > -1;
}
}
class ts {
constructor(e, n) {
(this.schema = e),
(this.rules = n),
(this.tags = []),
(this.styles = []),
n.forEach((r) => {
r.tag ? this.tags.push(r) : r.style && this.styles.push(r);
}),
(this.normalizeLists = !this.tags.some((r) => {
if (!/^(ul|ol)\b/.test(r.tag) || !r.node) return !1;
let i = e.nodes[r.node];
return i.contentMatch.matchType(i);
}));
}
parse(e, n = {}) {
let r = new cp(this, n, !1);
return r.addAll(e, n.from, n.to), r.finish();
}
parseSlice(e, n = {}) {
let r = new cp(this, n, !0);
return r.addAll(e, n.from, n.to), ie.maxOpen(r.finish());
}
matchTag(e, n, r) {
for (
let i = r ? this.tags.indexOf(r) + 1 : 0;
i < this.tags.length;
i++
) {
let o = this.tags[i];
if (
z8(e, o.tag) &&
(o.namespace === void 0 || e.namespaceURI == o.namespace) &&
(!o.context || n.matchesContext(o.context))
) {
if (o.getAttrs) {
let s = o.getAttrs(e);
if (s === !1) continue;
o.attrs = s || void 0;
}
return o;
}
}
}
matchStyle(e, n, r, i) {
for (
let o = i ? this.styles.indexOf(i) + 1 : 0;
o < this.styles.length;
o++
) {
let s = this.styles[o],
l = s.style;
if (
!(
l.indexOf(e) != 0 ||
(s.context && !r.matchesContext(s.context)) ||
(l.length > e.length &&
(l.charCodeAt(e.length) != 61 ||
l.slice(e.length + 1) != n))
)
) {
if (s.getAttrs) {
let a = s.getAttrs(n);
if (a === !1) continue;
s.attrs = a || void 0;
}
return s;
}
}
}
static schemaRules(e) {
let n = [];
function r(i) {
let o = i.priority == null ? 50 : i.priority,
s = 0;
for (; s < n.length; s++) {
let l = n[s];
if ((l.priority == null ? 50 : l.priority) < o) break;
}
n.splice(s, 0, i);
}
for (let i in e.marks) {
let o = e.marks[i].spec.parseDOM;
o &&
o.forEach((s) => {
r((s = dp(s))),
s.mark || s.ignore || s.clearMark || (s.mark = i);
});
}
for (let i in e.nodes) {
let o = e.nodes[i].spec.parseDOM;
o &&
o.forEach((s) => {
r((s = dp(s))),
s.node || s.ignore || s.mark || (s.node = i);
});
}
return n;
}
static fromSchema(e) {
return (
e.cached.domParser ||
(e.cached.domParser = new ts(e, ts.schemaRules(e)))
);
}
}
const G1 = {
address: !0,
article: !0,
aside: !0,
blockquote: !0,
canvas: !0,
dd: !0,
div: !0,
dl: !0,
fieldset: !0,
figcaption: !0,
figure: !0,
footer: !0,
form: !0,
h1: !0,
h2: !0,
h3: !0,
h4: !0,
h5: !0,
h6: !0,
header: !0,
hgroup: !0,
hr: !0,
li: !0,
noscript: !0,
ol: !0,
output: !0,
p: !0,
pre: !0,
section: !0,
table: !0,
tfoot: !0,
ul: !0,
},
B8 = {
head: !0,
noscript: !0,
object: !0,
script: !0,
style: !0,
title: !0,
},
Y1 = { ol: !0, ul: !0 },
Rl = 1,
Pl = 2,
Bo = 4;
function up(t, e, n) {
return e != null
? (e ? Rl : 0) | (e === "full" ? Pl : 0)
: t && t.whitespace == "pre"
? Rl | Pl
: n & ~Bo;
}
class Fs {
constructor(e, n, r, i, o, s, l) {
(this.type = e),
(this.attrs = n),
(this.marks = r),
(this.pendingMarks = i),
(this.solid = o),
(this.options = l),
(this.content = []),
(this.activeMarks = dt.none),
(this.stashMarks = []),
(this.match = s || (l & Bo ? null : e.contentMatch));
}
findWrapping(e) {
if (!this.match) {
if (!this.type) return [];
let n = this.type.contentMatch.fillBefore(Y.from(e));
if (n) this.match = this.type.contentMatch.matchFragment(n);
else {
let r = this.type.contentMatch,
i;
return (i = r.findWrapping(e.type))
? ((this.match = r), i)
: null;
}
}
return this.match.findWrapping(e.type);
}
finish(e) {
if (!(this.options & Rl)) {
let r = this.content[this.content.length - 1],
i;
if (r && r.isText && (i = /[ \t\r\n\u000c]+$/.exec(r.text))) {
let o = r;
r.text.length == i[0].length
? this.content.pop()
: (this.content[this.content.length - 1] = o.withText(
o.text.slice(0, o.text.length - i[0].length)
));
}
}
let n = Y.from(this.content);
return (
!e &&
this.match &&
(n = n.append(this.match.fillBefore(Y.empty, !0))),
this.type ? this.type.create(this.attrs, n, this.marks) : n
);
}
popFromStashMark(e) {
for (let n = this.stashMarks.length - 1; n >= 0; n--)
if (e.eq(this.stashMarks[n]))
return this.stashMarks.splice(n, 1)[0];
}
applyPending(e) {
for (let n = 0, r = this.pendingMarks; n < r.length; n++) {
let i = r[n];
(this.type ? this.type.allowsMarkType(i.type) : F8(i.type, e)) &&
!i.isInSet(this.activeMarks) &&
((this.activeMarks = i.addToSet(this.activeMarks)),
(this.pendingMarks = i.removeFromSet(this.pendingMarks)));
}
}
inlineContext(e) {
return this.type
? this.type.inlineContent
: this.content.length
? this.content[0].isInline
: e.parentNode &&
!G1.hasOwnProperty(e.parentNode.nodeName.toLowerCase());
}
}
class cp {
constructor(e, n, r) {
(this.parser = e),
(this.options = n),
(this.isOpen = r),
(this.open = 0);
let i = n.topNode,
o,
s = up(null, n.preserveWhitespace, 0) | (r ? Bo : 0);
i
? (o = new Fs(
i.type,
i.attrs,
dt.none,
dt.none,
!0,
n.topMatch || i.type.contentMatch,
s
))
: r
? (o = new Fs(null, null, dt.none, dt.none, !0, null, s))
: (o = new Fs(
e.schema.topNodeType,
null,
dt.none,
dt.none,
!0,
null,
s
)),
(this.nodes = [o]),
(this.find = n.findPositions),
(this.needsBlock = !1);
}
get top() {
return this.nodes[this.open];
}
addDOM(e) {
e.nodeType == 3
? this.addTextNode(e)
: e.nodeType == 1 && this.addElement(e);
}
withStyleRules(e, n) {
let r = e.getAttribute("style");
if (!r) return n();
let i = this.readStyles(H8(r));
if (!i) return;
let [o, s] = i,
l = this.top;
for (let a = 0; a < s.length; a++) this.removePendingMark(s[a], l);
for (let a = 0; a < o.length; a++) this.addPendingMark(o[a]);
n();
for (let a = 0; a < o.length; a++) this.removePendingMark(o[a], l);
for (let a = 0; a < s.length; a++) this.addPendingMark(s[a]);
}
addTextNode(e) {
let n = e.nodeValue,
r = this.top;
if (
r.options & Pl ||
r.inlineContext(e) ||
/[^ \t\r\n\u000c]/.test(n)
) {
if (r.options & Rl)
r.options & Pl
? (n = n.replace(
/\r\n?/g,
`
`
))
: (n = n.replace(/\r?\n|\r/g, " "));
else if (
((n = n.replace(/[ \t\r\n\u000c]+/g, " ")),
/^[ \t\r\n\u000c]/.test(n) &&
this.open == this.nodes.length - 1)
) {
let i = r.content[r.content.length - 1],
o = e.previousSibling;
(!i ||
(o && o.nodeName == "BR") ||
(i.isText && /[ \t\r\n\u000c]$/.test(i.text))) &&
(n = n.slice(1));
}
n && this.insertNode(this.parser.schema.text(n)),
this.findInText(e);
} else this.findInside(e);
}
addElement(e, n) {
let r = e.nodeName.toLowerCase(),
i;
Y1.hasOwnProperty(r) && this.parser.normalizeLists && $8(e);
let o =
(this.options.ruleFromNode && this.options.ruleFromNode(e)) ||
(i = this.parser.matchTag(e, this, n));
if (o ? o.ignore : B8.hasOwnProperty(r))
this.findInside(e), this.ignoreFallback(e);
else if (!o || o.skip || o.closeParent) {
o && o.closeParent
? (this.open = Math.max(0, this.open - 1))
: o && o.skip.nodeType && (e = o.skip);
let s,
l = this.top,
a = this.needsBlock;
if (G1.hasOwnProperty(r))
l.content.length &&
l.content[0].isInline &&
this.open &&
(this.open--, (l = this.top)),
(s = !0),
l.type || (this.needsBlock = !0);
else if (!e.firstChild) {
this.leafFallback(e);
return;
}
o && o.skip
? this.addAll(e)
: this.withStyleRules(e, () => this.addAll(e)),
s && this.sync(l),
(this.needsBlock = a);
} else
this.withStyleRules(e, () => {
this.addElementByRule(e, o, o.consuming === !1 ? i : void 0);
});
}
leafFallback(e) {
e.nodeName == "BR" &&
this.top.type &&
this.top.type.inlineContent &&
this.addTextNode(
e.ownerDocument.createTextNode(`
`)
);
}
ignoreFallback(e) {
e.nodeName == "BR" &&
(!this.top.type || !this.top.type.inlineContent) &&
this.findPlace(this.parser.schema.text("-"));
}
readStyles(e) {
let n = dt.none,
r = dt.none;
for (let i = 0; i < e.length; i += 2)
for (let o = void 0; ; ) {
let s = this.parser.matchStyle(e[i], e[i + 1], this, o);
if (!s) break;
if (s.ignore) return null;
if (
(s.clearMark
? this.top.pendingMarks
.concat(this.top.activeMarks)
.forEach((l) => {
s.clearMark(l) && (r = l.addToSet(r));
})
: (n = this.parser.schema.marks[s.mark]
.create(s.attrs)
.addToSet(n)),
s.consuming === !1)
)
o = s;
else break;
}
return [n, r];
}
addElementByRule(e, n, r) {
let i, o, s;
n.node
? ((o = this.parser.schema.nodes[n.node]),
o.isLeaf
? this.insertNode(o.create(n.attrs)) || this.leafFallback(e)
: (i = this.enter(
o,
n.attrs || null,
n.preserveWhitespace
)))
: ((s = this.parser.schema.marks[n.mark].create(n.attrs)),
this.addPendingMark(s));
let l = this.top;
if (o && o.isLeaf) this.findInside(e);
else if (r) this.addElement(e, r);
else if (n.getContent)
this.findInside(e),
n
.getContent(e, this.parser.schema)
.forEach((a) => this.insertNode(a));
else {
let a = e;
typeof n.contentElement == "string"
? (a = e.querySelector(n.contentElement))
: typeof n.contentElement == "function"
? (a = n.contentElement(e))
: n.contentElement && (a = n.contentElement),
this.findAround(e, a, !0),
this.addAll(a);
}
i && this.sync(l) && this.open--, s && this.removePendingMark(s, l);
}
addAll(e, n, r) {
let i = n || 0;
for (
let o = n ? e.childNodes[n] : e.firstChild,
s = r == null ? null : e.childNodes[r];
o != s;
o = o.nextSibling, ++i
)
this.findAtPoint(e, i), this.addDOM(o);
this.findAtPoint(e, i);
}
findPlace(e) {
let n, r;
for (let i = this.open; i >= 0; i--) {
let o = this.nodes[i],
s = o.findWrapping(e);
if (
(s &&
(!n || n.length > s.length) &&
((n = s), (r = o), !s.length)) ||
o.solid
)
break;
}
if (!n) return !1;
this.sync(r);
for (let i = 0; i < n.length; i++) this.enterInner(n[i], null, !1);
return !0;
}
insertNode(e) {
if (e.isInline && this.needsBlock && !this.top.type) {
let n = this.textblockFromContext();
n && this.enterInner(n);
}
if (this.findPlace(e)) {
this.closeExtra();
let n = this.top;
n.applyPending(e.type),
n.match && (n.match = n.match.matchType(e.type));
let r = n.activeMarks;
for (let i = 0; i < e.marks.length; i++)
(!n.type || n.type.allowsMarkType(e.marks[i].type)) &&
(r = e.marks[i].addToSet(r));
return n.content.push(e.mark(r)), !0;
}
return !1;
}
enter(e, n, r) {
let i = this.findPlace(e.create(n));
return i && this.enterInner(e, n, !0, r), i;
}
enterInner(e, n = null, r = !1, i) {
this.closeExtra();
let o = this.top;
o.applyPending(e), (o.match = o.match && o.match.matchType(e));
let s = up(e, i, o.options);
o.options & Bo && o.content.length == 0 && (s |= Bo),
this.nodes.push(
new Fs(e, n, o.activeMarks, o.pendingMarks, r, null, s)
),
this.open++;
}
closeExtra(e = !1) {
let n = this.nodes.length - 1;
if (n > this.open) {
for (; n > this.open; n--)
this.nodes[n - 1].content.push(this.nodes[n].finish(e));
this.nodes.length = this.open + 1;
}
}
finish() {
return (
(this.open = 0),
this.closeExtra(this.isOpen),
this.nodes[0].finish(this.isOpen || this.options.topOpen)
);
}
sync(e) {
for (let n = this.open; n >= 0; n--)
if (this.nodes[n] == e) return (this.open = n), !0;
return !1;
}
get currentPos() {
this.closeExtra();
let e = 0;
for (let n = this.open; n >= 0; n--) {
let r = this.nodes[n].content;
for (let i = r.length - 1; i >= 0; i--) e += r[i].nodeSize;
n && e++;
}
return e;
}
findAtPoint(e, n) {
if (this.find)
for (let r = 0; r < this.find.length; r++)
this.find[r].node == e &&
this.find[r].offset == n &&
(this.find[r].pos = this.currentPos);
}
findInside(e) {
if (this.find)
for (let n = 0; n < this.find.length; n++)
this.find[n].pos == null &&
e.nodeType == 1 &&
e.contains(this.find[n].node) &&
(this.find[n].pos = this.currentPos);
}
findAround(e, n, r) {
if (e != n && this.find)
for (let i = 0; i < this.find.length; i++)
this.find[i].pos == null &&
e.nodeType == 1 &&
e.contains(this.find[i].node) &&
n.compareDocumentPosition(this.find[i].node) &
(r ? 2 : 4) &&
(this.find[i].pos = this.currentPos);
}
findInText(e) {
if (this.find)
for (let n = 0; n < this.find.length; n++)
this.find[n].node == e &&
(this.find[n].pos =
this.currentPos -
(e.nodeValue.length - this.find[n].offset));
}
matchesContext(e) {
if (e.indexOf("|") > -1)
return e.split(/\s*\|\s*/).some(this.matchesContext, this);
let n = e.split("/"),
r = this.options.context,
i = !this.isOpen && (!r || r.parent.type == this.nodes[0].type),
o = -(r ? r.depth + 1 : 0) + (i ? 0 : 1),
s = (l, a) => {
for (; l >= 0; l--) {
let u = n[l];
if (u == "") {
if (l == n.length - 1 || l == 0) continue;
for (; a >= o; a--) if (s(l - 1, a)) return !0;
return !1;
} else {
let c =
a > 0 || (a == 0 && i)
? this.nodes[a].type
: r && a >= o
? r.node(a - o).type
: null;
if (!c || (c.name != u && c.groups.indexOf(u) == -1))
return !1;
a--;
}
}
return !0;
};
return s(n.length - 1, this.open);
}
textblockFromContext() {
let e = this.options.context;
if (e)
for (let n = e.depth; n >= 0; n--) {
let r = e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;
if (r && r.isTextblock && r.defaultAttrs) return r;
}
for (let n in this.parser.schema.nodes) {
let r = this.parser.schema.nodes[n];
if (r.isTextblock && r.defaultAttrs) return r;
}
}
addPendingMark(e) {
let n = V8(e, this.top.pendingMarks);
n && this.top.stashMarks.push(n),
(this.top.pendingMarks = e.addToSet(this.top.pendingMarks));
}
removePendingMark(e, n) {
for (let r = this.open; r >= 0; r--) {
let i = this.nodes[r];
if (i.pendingMarks.lastIndexOf(e) > -1)
i.pendingMarks = e.removeFromSet(i.pendingMarks);
else {
i.activeMarks = e.removeFromSet(i.activeMarks);
let s = i.popFromStashMark(e);
s &&
i.type &&
i.type.allowsMarkType(s.type) &&
(i.activeMarks = s.addToSet(i.activeMarks));
}
if (i == n) break;
}
}
}
function $8(t) {
for (let e = t.firstChild, n = null; e; e = e.nextSibling) {
let r = e.nodeType == 1 ? e.nodeName.toLowerCase() : null;
r && Y1.hasOwnProperty(r) && n
? (n.appendChild(e), (e = n))
: r == "li"
? (n = e)
: r && (n = null);
}
}
function z8(t, e) {
return (
t.matches ||
t.msMatchesSelector ||
t.webkitMatchesSelector ||
t.mozMatchesSelector
).call(t, e);
}
function H8(t) {
let e = /\s*([\w-]+)\s*:\s*([^;]+)/g,
n,
r = [];
for (; (n = e.exec(t)); ) r.push(n[1], n[2].trim());
return r;
}
function dp(t) {
let e = {};
for (let n in t) e[n] = t[n];
return e;
}
function F8(t, e) {
let n = e.schema.nodes;
for (let r in n) {
let i = n[r];
if (!i.allowsMarkType(t)) continue;
let o = [],
s = (l) => {
o.push(l);
for (let a = 0; a < l.edgeCount; a++) {
let { type: u, next: c } = l.edge(a);
if (u == e || (o.indexOf(c) < 0 && s(c))) return !0;
}
};
if (s(i.contentMatch)) return !0;
}
}
function V8(t, e) {
for (let n = 0; n < e.length; n++) if (t.eq(e[n])) return e[n];
}
class ri {
constructor(e, n) {
(this.nodes = e), (this.marks = n);
}
serializeFragment(e, n = {}, r) {
r || (r = xu(n).createDocumentFragment());
let i = r,
o = [];
return (
e.forEach((s) => {
if (o.length || s.marks.length) {
let l = 0,
a = 0;
for (; l < o.length && a < s.marks.length; ) {
let u = s.marks[a];
if (!this.marks[u.type.name]) {
a++;
continue;
}
if (!u.eq(o[l][0]) || u.type.spec.spanning === !1)
break;
l++, a++;
}
for (; l < o.length; ) i = o.pop()[1];
for (; a < s.marks.length; ) {
let u = s.marks[a++],
c = this.serializeMark(u, s.isInline, n);
c &&
(o.push([u, i]),
i.appendChild(c.dom),
(i = c.contentDOM || c.dom));
}
}
i.appendChild(this.serializeNodeInner(s, n));
}),
r
);
}
serializeNodeInner(e, n) {
let { dom: r, contentDOM: i } = ri.renderSpec(
xu(n),
this.nodes[e.type.name](e)
);
if (i) {
if (e.isLeaf)
throw new RangeError(
"Content hole not allowed in a leaf node spec"
);
this.serializeFragment(e.content, n, i);
}
return r;
}
serializeNode(e, n = {}) {
let r = this.serializeNodeInner(e, n);
for (let i = e.marks.length - 1; i >= 0; i--) {
let o = this.serializeMark(e.marks[i], e.isInline, n);
o && ((o.contentDOM || o.dom).appendChild(r), (r = o.dom));
}
return r;
}
serializeMark(e, n, r = {}) {
let i = this.marks[e.type.name];
return i && ri.renderSpec(xu(r), i(e, n));
}
static renderSpec(e, n, r = null) {
if (typeof n == "string") return { dom: e.createTextNode(n) };
if (n.nodeType != null) return { dom: n };
if (n.dom && n.dom.nodeType != null) return n;
let i = n[0],
o = i.indexOf(" ");
o > 0 && ((r = i.slice(0, o)), (i = i.slice(o + 1)));
let s,
l = r ? e.createElementNS(r, i) : e.createElement(i),
a = n[1],
u = 1;
if (
a &&
typeof a == "object" &&
a.nodeType == null &&
!Array.isArray(a)
) {
u = 2;
for (let c in a)
if (a[c] != null) {
let f = c.indexOf(" ");
f > 0
? l.setAttributeNS(c.slice(0, f), c.slice(f + 1), a[c])
: l.setAttribute(c, a[c]);
}
}
for (let c = u; c < n.length; c++) {
let f = n[c];
if (f === 0) {
if (c < n.length - 1 || c > u)
throw new RangeError(
"Content hole must be the only child of its parent node"
);
return { dom: l, contentDOM: l };
} else {
let { dom: h, contentDOM: p } = ri.renderSpec(e, f, r);
if ((l.appendChild(h), p)) {
if (s) throw new RangeError("Multiple content holes");
s = p;
}
}
}
return { dom: l, contentDOM: s };
}
static fromSchema(e) {
return (
e.cached.domSerializer ||
(e.cached.domSerializer = new ri(
this.nodesFromSchema(e),
this.marksFromSchema(e)
))
);
}
static nodesFromSchema(e) {
let n = fp(e.nodes);
return n.text || (n.text = (r) => r.text), n;
}
static marksFromSchema(e) {
return fp(e.marks);
}
}
function fp(t) {
let e = {};
for (let n in t) {
let r = t[n].spec.toDOM;
r && (e[n] = r);
}
return e;
}
function xu(t) {
return t.document || window.document;
}
const Q1 = 65535,
X1 = Math.pow(2, 16);
function W8(t, e) {
return t + e * X1;
}
function hp(t) {
return t & Q1;
}
function U8(t) {
return (t - (t & Q1)) / X1;
}
const Z1 = 1,
e0 = 2,
ll = 4,
t0 = 8;
class _c {
constructor(e, n, r) {
(this.pos = e), (this.delInfo = n), (this.recover = r);
}
get deleted() {
return (this.delInfo & t0) > 0;
}
get deletedBefore() {
return (this.delInfo & (Z1 | ll)) > 0;
}
get deletedAfter() {
return (this.delInfo & (e0 | ll)) > 0;
}
get deletedAcross() {
return (this.delInfo & ll) > 0;
}
}
class sn {
constructor(e, n = !1) {
if (((this.ranges = e), (this.inverted = n), !e.length && sn.empty))
return sn.empty;
}
recover(e) {
let n = 0,
r = hp(e);
if (!this.inverted)
for (let i = 0; i < r; i++)
n += this.ranges[i * 3 + 2] - this.ranges[i * 3 + 1];
return this.ranges[r * 3] + n + U8(e);
}
mapResult(e, n = 1) {
return this._map(e, n, !1);
}
map(e, n = 1) {
return this._map(e, n, !0);
}
_map(e, n, r) {
let i = 0,
o = this.inverted ? 2 : 1,
s = this.inverted ? 1 : 2;
for (let l = 0; l < this.ranges.length; l += 3) {
let a = this.ranges[l] - (this.inverted ? i : 0);
if (a > e) break;
let u = this.ranges[l + o],
c = this.ranges[l + s],
f = a + u;
if (e <= f) {
let h = u ? (e == a ? -1 : e == f ? 1 : n) : n,
p = a + i + (h < 0 ? 0 : c);
if (r) return p;
let g = e == (n < 0 ? a : f) ? null : W8(l / 3, e - a),
v = e == a ? e0 : e == f ? Z1 : ll;
return (n < 0 ? e != a : e != f) && (v |= t0), new _c(p, v, g);
}
i += c - u;
}
return r ? e + i : new _c(e + i, 0, null);
}
touches(e, n) {
let r = 0,
i = hp(n),
o = this.inverted ? 2 : 1,
s = this.inverted ? 1 : 2;
for (let l = 0; l < this.ranges.length; l += 3) {
let a = this.ranges[l] - (this.inverted ? r : 0);
if (a > e) break;
let u = this.ranges[l + o],
c = a + u;
if (e <= c && l == i * 3) return !0;
r += this.ranges[l + s] - u;
}
return !1;
}
forEach(e) {
let n = this.inverted ? 2 : 1,
r = this.inverted ? 1 : 2;
for (let i = 0, o = 0; i < this.ranges.length; i += 3) {
let s = this.ranges[i],
l = s - (this.inverted ? o : 0),
a = s + (this.inverted ? 0 : o),
u = this.ranges[i + n],
c = this.ranges[i + r];
e(l, l + u, a, a + c), (o += c - u);
}
}
invert() {
return new sn(this.ranges, !this.inverted);
}
toString() {
return (this.inverted ? "-" : "") + JSON.stringify(this.ranges);
}
static offset(e) {
return e == 0 ? sn.empty : new sn(e < 0 ? [0, -e, 0] : [0, 0, e]);
}
}
sn.empty = new sn([]);
class $i {
constructor(e = [], n, r = 0, i = e.length) {
(this.maps = e), (this.mirror = n), (this.from = r), (this.to = i);
}
slice(e = 0, n = this.maps.length) {
return new $i(this.maps, this.mirror, e, n);
}
copy() {
return new $i(
this.maps.slice(),
this.mirror && this.mirror.slice(),
this.from,
this.to
);
}
appendMap(e, n) {
(this.to = this.maps.push(e)),
n != null && this.setMirror(this.maps.length - 1, n);
}
appendMapping(e) {
for (let n = 0, r = this.maps.length; n < e.maps.length; n++) {
let i = e.getMirror(n);
this.appendMap(e.maps[n], i != null && i < n ? r + i : void 0);
}
}
getMirror(e) {
if (this.mirror) {
for (let n = 0; n < this.mirror.length; n++)
if (this.mirror[n] == e)
return this.mirror[n + (n % 2 ? -1 : 1)];
}
}
setMirror(e, n) {
this.mirror || (this.mirror = []), this.mirror.push(e, n);
}
appendMappingInverted(e) {
for (
let n = e.maps.length - 1, r = this.maps.length + e.maps.length;
n >= 0;
n--
) {
let i = e.getMirror(n);
this.appendMap(
e.maps[n].invert(),
i != null && i > n ? r - i - 1 : void 0
);
}
}
invert() {
let e = new $i();
return e.appendMappingInverted(this), e;
}
map(e, n = 1) {
if (this.mirror) return this._map(e, n, !0);
for (let r = this.from; r < this.to; r++) e = this.maps[r].map(e, n);
return e;
}
mapResult(e, n = 1) {
return this._map(e, n, !1);
}
_map(e, n, r) {
let i = 0;
for (let o = this.from; o < this.to; o++) {
let s = this.maps[o],
l = s.mapResult(e, n);
if (l.recover != null) {
let a = this.getMirror(o);
if (a != null && a > o && a < this.to) {
(o = a), (e = this.maps[a].recover(l.recover));
continue;
}
}
(i |= l.delInfo), (e = l.pos);
}
return r ? e : new _c(e, i, null);
}
}
const ku = Object.create(null);
class Wt {
getMap() {
return sn.empty;
}
merge(e) {
return null;
}
static fromJSON(e, n) {
if (!n || !n.stepType)
throw new RangeError("Invalid input for Step.fromJSON");
let r = ku[n.stepType];
if (!r) throw new RangeError(`No step type ${n.stepType} defined`);
return r.fromJSON(e, n);
}
static jsonID(e, n) {
if (e in ku) throw new RangeError("Duplicate use of step JSON ID " + e);
return (ku[e] = n), (n.prototype.jsonID = e), n;
}
}
class wt {
constructor(e, n) {
(this.doc = e), (this.failed = n);
}
static ok(e) {
return new wt(e, null);
}
static fail(e) {
return new wt(null, e);
}
static fromReplace(e, n, r, i) {
try {
return wt.ok(e.replace(n, r, i));
} catch (o) {
if (o instanceof El) return wt.fail(o.message);
throw o;
}
}
}
function Qd(t, e, n) {
let r = [];
for (let i = 0; i < t.childCount; i++) {
let o = t.child(i);
o.content.size && (o = o.copy(Qd(o.content, e, o))),
o.isInline && (o = e(o, n, i)),
r.push(o);
}
return Y.fromArray(r);
}
class Mr extends Wt {
constructor(e, n, r) {
super(), (this.from = e), (this.to = n), (this.mark = r);
}
apply(e) {
let n = e.slice(this.from, this.to),
r = e.resolve(this.from),
i = r.node(r.sharedDepth(this.to)),
o = new ie(
Qd(
n.content,
(s, l) =>
!s.isAtom || !l.type.allowsMarkType(this.mark.type)
? s
: s.mark(this.mark.addToSet(s.marks)),
i
),
n.openStart,
n.openEnd
);
return wt.fromReplace(e, this.from, this.to, o);
}
invert() {
return new Un(this.from, this.to, this.mark);
}
map(e) {
let n = e.mapResult(this.from, 1),
r = e.mapResult(this.to, -1);
return (n.deleted && r.deleted) || n.pos >= r.pos
? null
: new Mr(n.pos, r.pos, this.mark);
}
merge(e) {
return e instanceof Mr &&
e.mark.eq(this.mark) &&
this.from <= e.to &&
this.to >= e.from
? new Mr(
Math.min(this.from, e.from),
Math.max(this.to, e.to),
this.mark
)
: null;
}
toJSON() {
return {
stepType: "addMark",
mark: this.mark.toJSON(),
from: this.from,
to: this.to,
};
}
static fromJSON(e, n) {
if (typeof n.from != "number" || typeof n.to != "number")
throw new RangeError("Invalid input for AddMarkStep.fromJSON");
return new Mr(n.from, n.to, e.markFromJSON(n.mark));
}
}
Wt.jsonID("addMark", Mr);
class Un extends Wt {
constructor(e, n, r) {
super(), (this.from = e), (this.to = n), (this.mark = r);
}
apply(e) {
let n = e.slice(this.from, this.to),
r = new ie(
Qd(
n.content,
(i) => i.mark(this.mark.removeFromSet(i.marks)),
e
),
n.openStart,
n.openEnd
);
return wt.fromReplace(e, this.from, this.to, r);
}
invert() {
return new Mr(this.from, this.to, this.mark);
}
map(e) {
let n = e.mapResult(this.from, 1),
r = e.mapResult(this.to, -1);
return (n.deleted && r.deleted) || n.pos >= r.pos
? null
: new Un(n.pos, r.pos, this.mark);
}
merge(e) {
return e instanceof Un &&
e.mark.eq(this.mark) &&
this.from <= e.to &&
this.to >= e.from
? new Un(
Math.min(this.from, e.from),
Math.max(this.to, e.to),
this.mark
)
: null;
}
toJSON() {
return {
stepType: "removeMark",
mark: this.mark.toJSON(),
from: this.from,
to: this.to,
};
}
static fromJSON(e, n) {
if (typeof n.from != "number" || typeof n.to != "number")
throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");
return new Un(n.from, n.to, e.markFromJSON(n.mark));
}
}
Wt.jsonID("removeMark", Un);
class Er extends Wt {
constructor(e, n) {
super(), (this.pos = e), (this.mark = n);
}
apply(e) {
let n = e.nodeAt(this.pos);
if (!n) return wt.fail("No node at mark step's position");
let r = n.type.create(n.attrs, null, this.mark.addToSet(n.marks));
return wt.fromReplace(
e,
this.pos,
this.pos + 1,
new ie(Y.from(r), 0, n.isLeaf ? 0 : 1)
);
}
invert(e) {
let n = e.nodeAt(this.pos);
if (n) {
let r = this.mark.addToSet(n.marks);
if (r.length == n.marks.length) {
for (let i = 0; i < n.marks.length; i++)
if (!n.marks[i].isInSet(r))
return new Er(this.pos, n.marks[i]);
return new Er(this.pos, this.mark);
}
}
return new eo(this.pos, this.mark);
}
map(e) {
let n = e.mapResult(this.pos, 1);
return n.deletedAfter ? null : new Er(n.pos, this.mark);
}
toJSON() {
return {
stepType: "addNodeMark",
pos: this.pos,
mark: this.mark.toJSON(),
};
}
static fromJSON(e, n) {
if (typeof n.pos != "number")
throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");
return new Er(n.pos, e.markFromJSON(n.mark));
}
}
Wt.jsonID("addNodeMark", Er);
class eo extends Wt {
constructor(e, n) {
super(), (this.pos = e), (this.mark = n);
}
apply(e) {
let n = e.nodeAt(this.pos);
if (!n) return wt.fail("No node at mark step's position");
let r = n.type.create(n.attrs, null, this.mark.removeFromSet(n.marks));
return wt.fromReplace(
e,
this.pos,
this.pos + 1,
new ie(Y.from(r), 0, n.isLeaf ? 0 : 1)
);
}
invert(e) {
let n = e.nodeAt(this.pos);
return !n || !this.mark.isInSet(n.marks)
? this
: new Er(this.pos, this.mark);
}
map(e) {
let n = e.mapResult(this.pos, 1);
return n.deletedAfter ? null : new eo(n.pos, this.mark);
}
toJSON() {
return {
stepType: "removeNodeMark",
pos: this.pos,
mark: this.mark.toJSON(),
};
}
static fromJSON(e, n) {
if (typeof n.pos != "number")
throw new RangeError(
"Invalid input for RemoveNodeMarkStep.fromJSON"
);
return new eo(n.pos, e.markFromJSON(n.mark));
}
}
Wt.jsonID("removeNodeMark", eo);
class jt extends Wt {
constructor(e, n, r, i = !1) {
super(),
(this.from = e),
(this.to = n),
(this.slice = r),
(this.structure = i);
}
apply(e) {
return this.structure && Mc(e, this.from, this.to)
? wt.fail("Structure replace would overwrite content")
: wt.fromReplace(e, this.from, this.to, this.slice);
}
getMap() {
return new sn([this.from, this.to - this.from, this.slice.size]);
}
invert(e) {
return new jt(
this.from,
this.from + this.slice.size,
e.slice(this.from, this.to)
);
}
map(e) {
let n = e.mapResult(this.from, 1),
r = e.mapResult(this.to, -1);
return n.deletedAcross && r.deletedAcross
? null
: new jt(n.pos, Math.max(n.pos, r.pos), this.slice);
}
merge(e) {
if (!(e instanceof jt) || e.structure || this.structure) return null;
if (
this.from + this.slice.size == e.from &&
!this.slice.openEnd &&
!e.slice.openStart
) {
let n =
this.slice.size + e.slice.size == 0
? ie.empty
: new ie(
this.slice.content.append(e.slice.content),
this.slice.openStart,
e.slice.openEnd
);
return new jt(
this.from,
this.to + (e.to - e.from),
n,
this.structure
);
} else if (
e.to == this.from &&
!this.slice.openStart &&
!e.slice.openEnd
) {
let n =
this.slice.size + e.slice.size == 0
? ie.empty
: new ie(
e.slice.content.append(this.slice.content),
e.slice.openStart,
this.slice.openEnd
);
return new jt(e.from, this.to, n, this.structure);
} else return null;
}
toJSON() {
let e = { stepType: "replace", from: this.from, to: this.to };
return (
this.slice.size && (e.slice = this.slice.toJSON()),
this.structure && (e.structure = !0),
e
);
}
static fromJSON(e, n) {
if (typeof n.from != "number" || typeof n.to != "number")
throw new RangeError("Invalid input for ReplaceStep.fromJSON");
return new jt(n.from, n.to, ie.fromJSON(e, n.slice), !!n.structure);
}
}
Wt.jsonID("replace", jt);
class Pt extends Wt {
constructor(e, n, r, i, o, s, l = !1) {
super(),
(this.from = e),
(this.to = n),
(this.gapFrom = r),
(this.gapTo = i),
(this.slice = o),
(this.insert = s),
(this.structure = l);
}
apply(e) {
if (
this.structure &&
(Mc(e, this.from, this.gapFrom) || Mc(e, this.gapTo, this.to))
)
return wt.fail("Structure gap-replace would overwrite content");
let n = e.slice(this.gapFrom, this.gapTo);
if (n.openStart || n.openEnd) return wt.fail("Gap is not a flat range");
let r = this.slice.insertAt(this.insert, n.content);
return r
? wt.fromReplace(e, this.from, this.to, r)
: wt.fail("Content does not fit in gap");
}
getMap() {
return new sn([
this.from,
this.gapFrom - this.from,
this.insert,
this.gapTo,
this.to - this.gapTo,
this.slice.size - this.insert,
]);
}
invert(e) {
let n = this.gapTo - this.gapFrom;
return new Pt(
this.from,
this.from + this.slice.size + n,
this.from + this.insert,
this.from + this.insert + n,
e
.slice(this.from, this.to)
.removeBetween(
this.gapFrom - this.from,
this.gapTo - this.from
),
this.gapFrom - this.from,
this.structure
);
}
map(e) {
let n = e.mapResult(this.from, 1),
r = e.mapResult(this.to, -1),
i = e.map(this.gapFrom, -1),
o = e.map(this.gapTo, 1);
return (n.deletedAcross && r.deletedAcross) || i < n.pos || o > r.pos
? null
: new Pt(
n.pos,
r.pos,
i,
o,
this.slice,
this.insert,
this.structure
);
}
toJSON() {
let e = {
stepType: "replaceAround",
from: this.from,
to: this.to,
gapFrom: this.gapFrom,
gapTo: this.gapTo,
insert: this.insert,
};
return (
this.slice.size && (e.slice = this.slice.toJSON()),
this.structure && (e.structure = !0),
e
);
}
static fromJSON(e, n) {
if (
typeof n.from != "number" ||
typeof n.to != "number" ||
typeof n.gapFrom != "number" ||
typeof n.gapTo != "number" ||
typeof n.insert != "number"
)
throw new RangeError(
"Invalid input for ReplaceAroundStep.fromJSON"
);
return new Pt(
n.from,
n.to,
n.gapFrom,
n.gapTo,
ie.fromJSON(e, n.slice),
n.insert,
!!n.structure
);
}
}
Wt.jsonID("replaceAround", Pt);
function Mc(t, e, n) {
let r = t.resolve(e),
i = n - e,
o = r.depth;
for (; i > 0 && o > 0 && r.indexAfter(o) == r.node(o).childCount; )
o--, i--;
if (i > 0) {
let s = r.node(o).maybeChild(r.indexAfter(o));
for (; i > 0; ) {
if (!s || s.isLeaf) return !0;
(s = s.firstChild), i--;
}
}
return !1;
}
function K8(t, e, n, r) {
let i = [],
o = [],
s,
l;
t.doc.nodesBetween(e, n, (a, u, c) => {
if (!a.isInline) return;
let f = a.marks;
if (!r.isInSet(f) && c.type.allowsMarkType(r.type)) {
let h = Math.max(u, e),
p = Math.min(u + a.nodeSize, n),
g = r.addToSet(f);
for (let v = 0; v < f.length; v++)
f[v].isInSet(g) ||
(s && s.to == h && s.mark.eq(f[v])
? (s.to = p)
: i.push((s = new Un(h, p, f[v]))));
l && l.to == h ? (l.to = p) : o.push((l = new Mr(h, p, r)));
}
}),
i.forEach((a) => t.step(a)),
o.forEach((a) => t.step(a));
}
function q8(t, e, n, r) {
let i = [],
o = 0;
t.doc.nodesBetween(e, n, (s, l) => {
if (!s.isInline) return;
o++;
let a = null;
if (r instanceof Yd) {
let u = s.marks,
c;
for (; (c = r.isInSet(u)); )
(a || (a = [])).push(c), (u = c.removeFromSet(u));
} else r ? r.isInSet(s.marks) && (a = [r]) : (a = s.marks);
if (a && a.length) {
let u = Math.min(l + s.nodeSize, n);
for (let c = 0; c < a.length; c++) {
let f = a[c],
h;
for (let p = 0; p < i.length; p++) {
let g = i[p];
g.step == o - 1 && f.eq(i[p].style) && (h = g);
}
h
? ((h.to = u), (h.step = o))
: i.push({
style: f,
from: Math.max(l, e),
to: u,
step: o,
});
}
}
}),
i.forEach((s) => t.step(new Un(s.from, s.to, s.style)));
}
function J8(t, e, n, r = n.contentMatch) {
let i = t.doc.nodeAt(e),
o = [],
s = e + 1;
for (let l = 0; l < i.childCount; l++) {
let a = i.child(l),
u = s + a.nodeSize,
c = r.matchType(a.type);
if (!c) o.push(new jt(s, u, ie.empty));
else {
r = c;
for (let f = 0; f < a.marks.length; f++)
n.allowsMarkType(a.marks[f].type) ||
t.step(new Un(s, u, a.marks[f]));
if (a.isText && !n.spec.code) {
let f,
h = /\r?\n|\r/g,
p;
for (; (f = h.exec(a.text)); )
p ||
(p = new ie(
Y.from(n.schema.text(" ", n.allowedMarks(a.marks))),
0,
0
)),
o.push(
new jt(s + f.index, s + f.index + f[0].length, p)
);
}
}
s = u;
}
if (!r.validEnd) {
let l = r.fillBefore(Y.empty, !0);
t.replace(s, s, new ie(l, 0, 0));
}
for (let l = o.length - 1; l >= 0; l--) t.step(o[l]);
}
function G8(t, e, n) {
return (
(e == 0 || t.canReplace(e, t.childCount)) &&
(n == t.childCount || t.canReplace(0, n))
);
}
function uo(t) {
let n = t.parent.content.cutByIndex(t.startIndex, t.endIndex);
for (let r = t.depth; ; --r) {
let i = t.$from.node(r),
o = t.$from.index(r),
s = t.$to.indexAfter(r);
if (r < t.depth && i.canReplace(o, s, n)) return r;
if (r == 0 || i.type.spec.isolating || !G8(i, o, s)) break;
}
return null;
}
function Y8(t, e, n) {
let { $from: r, $to: i, depth: o } = e,
s = r.before(o + 1),
l = i.after(o + 1),
a = s,
u = l,
c = Y.empty,
f = 0;
for (let g = o, v = !1; g > n; g--)
v || r.index(g) > 0
? ((v = !0), (c = Y.from(r.node(g).copy(c))), f++)
: a--;
let h = Y.empty,
p = 0;
for (let g = o, v = !1; g > n; g--)
v || i.after(g + 1) < i.end(g)
? ((v = !0), (h = Y.from(i.node(g).copy(h))), p++)
: u++;
t.step(new Pt(a, u, s, l, new ie(c.append(h), f, p), c.size - f, !0));
}
function Xd(t, e, n = null, r = t) {
let i = Q8(t, e),
o = i && X8(r, e);
return o ? i.map(pp).concat({ type: e, attrs: n }).concat(o.map(pp)) : null;
}
function pp(t) {
return { type: t, attrs: null };
}
function Q8(t, e) {
let { parent: n, startIndex: r, endIndex: i } = t,
o = n.contentMatchAt(r).findWrapping(e);
if (!o) return null;
let s = o.length ? o[0] : e;
return n.canReplaceWith(r, i, s) ? o : null;
}
function X8(t, e) {
let { parent: n, startIndex: r, endIndex: i } = t,
o = n.child(r),
s = e.contentMatch.findWrapping(o.type);
if (!s) return null;
let a = (s.length ? s[s.length - 1] : e).contentMatch;
for (let u = r; a && u < i; u++) a = a.matchType(n.child(u).type);
return !a || !a.validEnd ? null : s;
}
function Z8(t, e, n) {
let r = Y.empty;
for (let s = n.length - 1; s >= 0; s--) {
if (r.size) {
let l = n[s].type.contentMatch.matchFragment(r);
if (!l || !l.validEnd)
throw new RangeError(
"Wrapper type given to Transform.wrap does not form valid content of its parent wrapper"
);
}
r = Y.from(n[s].type.create(n[s].attrs, r));
}
let i = e.start,
o = e.end;
t.step(new Pt(i, o, i, o, new ie(r, 0, 0), n.length, !0));
}
function eC(t, e, n, r, i) {
if (!r.isTextblock)
throw new RangeError(
"Type given to setBlockType should be a textblock"
);
let o = t.steps.length;
t.doc.nodesBetween(e, n, (s, l) => {
if (
s.isTextblock &&
!s.hasMarkup(r, i) &&
tC(t.doc, t.mapping.slice(o).map(l), r)
) {
t.clearIncompatible(t.mapping.slice(o).map(l, 1), r);
let a = t.mapping.slice(o),
u = a.map(l, 1),
c = a.map(l + s.nodeSize, 1);
return (
t.step(
new Pt(
u,
c,
u + 1,
c - 1,
new ie(Y.from(r.create(i, null, s.marks)), 0, 0),
1,
!0
)
),
!1
);
}
});
}
function tC(t, e, n) {
let r = t.resolve(e),
i = r.index();
return r.parent.canReplaceWith(i, i + 1, n);
}
function nC(t, e, n, r, i) {
let o = t.doc.nodeAt(e);
if (!o) throw new RangeError("No node at given position");
n || (n = o.type);
let s = n.create(r, null, i || o.marks);
if (o.isLeaf) return t.replaceWith(e, e + o.nodeSize, s);
if (!n.validContent(o.content))
throw new RangeError("Invalid content for node type " + n.name);
t.step(
new Pt(
e,
e + o.nodeSize,
e + 1,
e + o.nodeSize - 1,
new ie(Y.from(s), 0, 0),
1,
!0
)
);
}
function zi(t, e, n = 1, r) {
let i = t.resolve(e),
o = i.depth - n,
s = (r && r[r.length - 1]) || i.parent;
if (
o < 0 ||
i.parent.type.spec.isolating ||
!i.parent.canReplace(i.index(), i.parent.childCount) ||
!s.type.validContent(
i.parent.content.cutByIndex(i.index(), i.parent.childCount)
)
)
return !1;
for (let u = i.depth - 1, c = n - 2; u > o; u--, c--) {
let f = i.node(u),
h = i.index(u);
if (f.type.spec.isolating) return !1;
let p = f.content.cutByIndex(h, f.childCount),
g = r && r[c + 1];
g && (p = p.replaceChild(0, g.type.create(g.attrs)));
let v = (r && r[c]) || f;
if (!f.canReplace(h + 1, f.childCount) || !v.type.validContent(p))
return !1;
}
let l = i.indexAfter(o),
a = r && r[0];
return i.node(o).canReplaceWith(l, l, a ? a.type : i.node(o + 1).type);
}
function rC(t, e, n = 1, r) {
let i = t.doc.resolve(e),
o = Y.empty,
s = Y.empty;
for (let l = i.depth, a = i.depth - n, u = n - 1; l > a; l--, u--) {
o = Y.from(i.node(l).copy(o));
let c = r && r[u];
s = Y.from(c ? c.type.create(c.attrs, s) : i.node(l).copy(s));
}
t.step(new jt(e, e, new ie(o.append(s), n, n), !0));
}
function $r(t, e) {
let n = t.resolve(e),
r = n.index();
return n0(n.nodeBefore, n.nodeAfter) && n.parent.canReplace(r, r + 1);
}
function n0(t, e) {
return !!(t && e && !t.isLeaf && t.canAppend(e));
}
function Ha(t, e, n = -1) {
let r = t.resolve(e);
for (let i = r.depth; ; i--) {
let o,
s,
l = r.index(i);
if (
(i == r.depth
? ((o = r.nodeBefore), (s = r.nodeAfter))
: n > 0
? ((o = r.node(i + 1)), l++, (s = r.node(i).maybeChild(l)))
: ((o = r.node(i).maybeChild(l - 1)), (s = r.node(i + 1))),
o && !o.isTextblock && n0(o, s) && r.node(i).canReplace(l, l + 1))
)
return e;
if (i == 0) break;
e = n < 0 ? r.before(i) : r.after(i);
}
}
function iC(t, e, n) {
let r = new jt(e - n, e + n, ie.empty, !0);
t.step(r);
}
function oC(t, e, n) {
let r = t.resolve(e);
if (r.parent.canReplaceWith(r.index(), r.index(), n)) return e;
if (r.parentOffset == 0)
for (let i = r.depth - 1; i >= 0; i--) {
let o = r.index(i);
if (r.node(i).canReplaceWith(o, o, n)) return r.before(i + 1);
if (o > 0) return null;
}
if (r.parentOffset == r.parent.content.size)
for (let i = r.depth - 1; i >= 0; i--) {
let o = r.indexAfter(i);
if (r.node(i).canReplaceWith(o, o, n)) return r.after(i + 1);
if (o < r.node(i).childCount) return null;
}
return null;
}
function r0(t, e, n) {
let r = t.resolve(e);
if (!n.content.size) return e;
let i = n.content;
for (let o = 0; o < n.openStart; o++) i = i.firstChild.content;
for (let o = 1; o <= (n.openStart == 0 && n.size ? 2 : 1); o++)
for (let s = r.depth; s >= 0; s--) {
let l =
s == r.depth
? 0
: r.pos <= (r.start(s + 1) + r.end(s + 1)) / 2
? -1
: 1,
a = r.index(s) + (l > 0 ? 1 : 0),
u = r.node(s),
c = !1;
if (o == 1) c = u.canReplace(a, a, i);
else {
let f = u.contentMatchAt(a).findWrapping(i.firstChild.type);
c = f && u.canReplaceWith(a, a, f[0]);
}
if (c)
return l == 0
? r.pos
: l < 0
? r.before(s + 1)
: r.after(s + 1);
}
return null;
}
function Zd(t, e, n = e, r = ie.empty) {
if (e == n && !r.size) return null;
let i = t.resolve(e),
o = t.resolve(n);
return i0(i, o, r) ? new jt(e, n, r) : new sC(i, o, r).fit();
}
function i0(t, e, n) {
return (
!n.openStart &&
!n.openEnd &&
t.start() == e.start() &&
t.parent.canReplace(t.index(), e.index(), n.content)
);
}
class sC {
constructor(e, n, r) {
(this.$from = e),
(this.$to = n),
(this.unplaced = r),
(this.frontier = []),
(this.placed = Y.empty);
for (let i = 0; i <= e.depth; i++) {
let o = e.node(i);
this.frontier.push({
type: o.type,
match: o.contentMatchAt(e.indexAfter(i)),
});
}
for (let i = e.depth; i > 0; i--)
this.placed = Y.from(e.node(i).copy(this.placed));
}
get depth() {
return this.frontier.length - 1;
}
fit() {
for (; this.unplaced.size; ) {
let u = this.findFittable();
u ? this.placeNodes(u) : this.openMore() || this.dropNode();
}
let e = this.mustMoveInline(),
n = this.placed.size - this.depth - this.$from.depth,
r = this.$from,
i = this.close(e < 0 ? this.$to : r.doc.resolve(e));
if (!i) return null;
let o = this.placed,
s = r.depth,
l = i.depth;
for (; s && l && o.childCount == 1; )
(o = o.firstChild.content), s--, l--;
let a = new ie(o, s, l);
return e > -1
? new Pt(r.pos, e, this.$to.pos, this.$to.end(), a, n)
: a.size || r.pos != this.$to.pos
? new jt(r.pos, i.pos, a)
: null;
}
findFittable() {
let e = this.unplaced.openStart;
for (
let n = this.unplaced.content, r = 0, i = this.unplaced.openEnd;
r < e;
r++
) {
let o = n.firstChild;
if (
(n.childCount > 1 && (i = 0), o.type.spec.isolating && i <= r)
) {
e = r;
break;
}
n = o.content;
}
for (let n = 1; n <= 2; n++)
for (let r = n == 1 ? e : this.unplaced.openStart; r >= 0; r--) {
let i,
o = null;
r
? ((o = Cu(this.unplaced.content, r - 1).firstChild),
(i = o.content))
: (i = this.unplaced.content);
let s = i.firstChild;
for (let l = this.depth; l >= 0; l--) {
let { type: a, match: u } = this.frontier[l],
c,
f = null;
if (
n == 1 &&
(s
? u.matchType(s.type) ||
(f = u.fillBefore(Y.from(s), !1))
: o && a.compatibleContent(o.type))
)
return {
sliceDepth: r,
frontierDepth: l,
parent: o,
inject: f,
};
if (n == 2 && s && (c = u.findWrapping(s.type)))
return {
sliceDepth: r,
frontierDepth: l,
parent: o,
wrap: c,
};
if (o && u.matchType(o.type)) break;
}
}
}
openMore() {
let { content: e, openStart: n, openEnd: r } = this.unplaced,
i = Cu(e, n);
return !i.childCount || i.firstChild.isLeaf
? !1
: ((this.unplaced = new ie(
e,
n + 1,
Math.max(r, i.size + n >= e.size - r ? n + 1 : 0)
)),
!0);
}
dropNode() {
let { content: e, openStart: n, openEnd: r } = this.unplaced,
i = Cu(e, n);
if (i.childCount <= 1 && n > 0) {
let o = e.size - n <= n + i.size;
this.unplaced = new ie(Mo(e, n - 1, 1), n - 1, o ? n - 1 : r);
} else this.unplaced = new ie(Mo(e, n, 1), n, r);
}
placeNodes({
sliceDepth: e,
frontierDepth: n,
parent: r,
inject: i,
wrap: o,
}) {
for (; this.depth > n; ) this.closeFrontierNode();
if (o) for (let v = 0; v < o.length; v++) this.openFrontierNode(o[v]);
let s = this.unplaced,
l = r ? r.content : s.content,
a = s.openStart - e,
u = 0,
c = [],
{ match: f, type: h } = this.frontier[n];
if (i) {
for (let v = 0; v < i.childCount; v++) c.push(i.child(v));
f = f.matchFragment(i);
}
let p = l.size + e - (s.content.size - s.openEnd);
for (; u < l.childCount; ) {
let v = l.child(u),
b = f.matchType(v.type);
if (!b) break;
u++,
(u > 1 || a == 0 || v.content.size) &&
((f = b),
c.push(
o0(
v.mark(h.allowedMarks(v.marks)),
u == 1 ? a : 0,
u == l.childCount ? p : -1
)
));
}
let g = u == l.childCount;
g || (p = -1),
(this.placed = Eo(this.placed, n, Y.from(c))),
(this.frontier[n].match = f),
g &&
p < 0 &&
r &&
r.type == this.frontier[this.depth].type &&
this.frontier.length > 1 &&
this.closeFrontierNode();
for (let v = 0, b = l; v < p; v++) {
let x = b.lastChild;
this.frontier.push({
type: x.type,
match: x.contentMatchAt(x.childCount),
}),
(b = x.content);
}
this.unplaced = g
? e == 0
? ie.empty
: new ie(
Mo(s.content, e - 1, 1),
e - 1,
p < 0 ? s.openEnd : e - 1
)
: new ie(Mo(s.content, e, u), s.openStart, s.openEnd);
}
mustMoveInline() {
if (!this.$to.parent.isTextblock) return -1;
let e = this.frontier[this.depth],
n;
if (
!e.type.isTextblock ||
!Su(this.$to, this.$to.depth, e.type, e.match, !1) ||
(this.$to.depth == this.depth &&
(n = this.findCloseLevel(this.$to)) &&
n.depth == this.depth)
)
return -1;
let { depth: r } = this.$to,
i = this.$to.after(r);
for (; r > 1 && i == this.$to.end(--r); ) ++i;
return i;
}
findCloseLevel(e) {
e: for (let n = Math.min(this.depth, e.depth); n >= 0; n--) {
let { match: r, type: i } = this.frontier[n],
o = n < e.depth && e.end(n + 1) == e.pos + (e.depth - (n + 1)),
s = Su(e, n, i, r, o);
if (!!s) {
for (let l = n - 1; l >= 0; l--) {
let { match: a, type: u } = this.frontier[l],
c = Su(e, l, u, a, !0);
if (!c || c.childCount) continue e;
}
return {
depth: n,
fit: s,
move: o ? e.doc.resolve(e.after(n + 1)) : e,
};
}
}
}
close(e) {
let n = this.findCloseLevel(e);
if (!n) return null;
for (; this.depth > n.depth; ) this.closeFrontierNode();
n.fit.childCount && (this.placed = Eo(this.placed, n.depth, n.fit)),
(e = n.move);
for (let r = n.depth + 1; r <= e.depth; r++) {
let i = e.node(r),
o = i.type.contentMatch.fillBefore(i.content, !0, e.index(r));
this.openFrontierNode(i.type, i.attrs, o);
}
return e;
}
openFrontierNode(e, n = null, r) {
let i = this.frontier[this.depth];
(i.match = i.match.matchType(e)),
(this.placed = Eo(this.placed, this.depth, Y.from(e.create(n, r)))),
this.frontier.push({ type: e, match: e.contentMatch });
}
closeFrontierNode() {
let n = this.frontier.pop().match.fillBefore(Y.empty, !0);
n.childCount &&
(this.placed = Eo(this.placed, this.frontier.length, n));
}
}
function Mo(t, e, n) {
return e == 0
? t.cutByIndex(n, t.childCount)
: t.replaceChild(
0,
t.firstChild.copy(Mo(t.firstChild.content, e - 1, n))
);
}
function Eo(t, e, n) {
return e == 0
? t.append(n)
: t.replaceChild(
t.childCount - 1,
t.lastChild.copy(Eo(t.lastChild.content, e - 1, n))
);
}
function Cu(t, e) {
for (let n = 0; n < e; n++) t = t.firstChild.content;
return t;
}
function o0(t, e, n) {
if (e <= 0) return t;
let r = t.content;
return (
e > 1 &&
(r = r.replaceChild(
0,
o0(r.firstChild, e - 1, r.childCount == 1 ? n - 1 : 0)
)),
e > 0 &&
((r = t.type.contentMatch.fillBefore(r).append(r)),
n <= 0 &&
(r = r.append(
t.type.contentMatch.matchFragment(r).fillBefore(Y.empty, !0)
))),
t.copy(r)
);
}
function Su(t, e, n, r, i) {
let o = t.node(e),
s = i ? t.indexAfter(e) : t.index(e);
if (s == o.childCount && !n.compatibleContent(o.type)) return null;
let l = r.fillBefore(o.content, !0, s);
return l && !lC(n, o.content, s) ? l : null;
}
function lC(t, e, n) {
for (let r = n; r < e.childCount; r++)
if (!t.allowsMarks(e.child(r).marks)) return !0;
return !1;
}
function aC(t) {
return t.spec.defining || t.spec.definingForContent;
}
function uC(t, e, n, r) {
if (!r.size) return t.deleteRange(e, n);
let i = t.doc.resolve(e),
o = t.doc.resolve(n);
if (i0(i, o, r)) return t.step(new jt(e, n, r));
let s = l0(i, t.doc.resolve(n));
s[s.length - 1] == 0 && s.pop();
let l = -(i.depth + 1);
s.unshift(l);
for (let h = i.depth, p = i.pos - 1; h > 0; h--, p--) {
let g = i.node(h).type.spec;
if (g.defining || g.definingAsContext || g.isolating) break;
s.indexOf(h) > -1 ? (l = h) : i.before(h) == p && s.splice(1, 0, -h);
}
let a = s.indexOf(l),
u = [],
c = r.openStart;
for (let h = r.content, p = 0; ; p++) {
let g = h.firstChild;
if ((u.push(g), p == r.openStart)) break;
h = g.content;
}
for (let h = c - 1; h >= 0; h--) {
let p = u[h],
g = aC(p.type);
if (g && !p.sameMarkup(i.node(Math.abs(l) - 1))) c = h;
else if (g || !p.type.isTextblock) break;
}
for (let h = r.openStart; h >= 0; h--) {
let p = (h + c + 1) % (r.openStart + 1),
g = u[p];
if (!!g)
for (let v = 0; v < s.length; v++) {
let b = s[(v + a) % s.length],
x = !0;
b < 0 && ((x = !1), (b = -b));
let S = i.node(b - 1),
T = i.index(b - 1);
if (S.canReplaceWith(T, T, g.type, g.marks))
return t.replace(
i.before(b),
x ? o.after(b) : n,
new ie(s0(r.content, 0, r.openStart, p), p, r.openEnd)
);
}
}
let f = t.steps.length;
for (
let h = s.length - 1;
h >= 0 && (t.replace(e, n, r), !(t.steps.length > f));
h--
) {
let p = s[h];
p < 0 || ((e = i.before(p)), (n = o.after(p)));
}
}
function s0(t, e, n, r, i) {
if (e < n) {
let o = t.firstChild;
t = t.replaceChild(0, o.copy(s0(o.content, e + 1, n, r, o)));
}
if (e > r) {
let o = i.contentMatchAt(0),
s = o.fillBefore(t).append(t);
t = s.append(o.matchFragment(s).fillBefore(Y.empty, !0));
}
return t;
}
function cC(t, e, n, r) {
if (!r.isInline && e == n && t.doc.resolve(e).parent.content.size) {
let i = oC(t.doc, e, r.type);
i != null && (e = n = i);
}
t.replaceRange(e, n, new ie(Y.from(r), 0, 0));
}
function dC(t, e, n) {
let r = t.doc.resolve(e),
i = t.doc.resolve(n),
o = l0(r, i);
for (let s = 0; s < o.length; s++) {
let l = o[s],
a = s == o.length - 1;
if ((a && l == 0) || r.node(l).type.contentMatch.validEnd)
return t.delete(r.start(l), i.end(l));
if (
l > 0 &&
(a || r.node(l - 1).canReplace(r.index(l - 1), i.indexAfter(l - 1)))
)
return t.delete(r.before(l), i.after(l));
}
for (let s = 1; s <= r.depth && s <= i.depth; s++)
if (
e - r.start(s) == r.depth - s &&
n > r.end(s) &&
i.end(s) - n != i.depth - s
)
return t.delete(r.before(s), n);
t.delete(e, n);
}
function l0(t, e) {
let n = [],
r = Math.min(t.depth, e.depth);
for (let i = r; i >= 0; i--) {
let o = t.start(i);
if (
o < t.pos - (t.depth - i) ||
e.end(i) > e.pos + (e.depth - i) ||
t.node(i).type.spec.isolating ||
e.node(i).type.spec.isolating
)
break;
(o == e.start(i) ||
(i == t.depth &&
i == e.depth &&
t.parent.inlineContent &&
e.parent.inlineContent &&
i &&
e.start(i - 1) == o - 1)) &&
n.push(i);
}
return n;
}
class Hi extends Wt {
constructor(e, n, r) {
super(), (this.pos = e), (this.attr = n), (this.value = r);
}
apply(e) {
let n = e.nodeAt(this.pos);
if (!n) return wt.fail("No node at attribute step's position");
let r = Object.create(null);
for (let o in n.attrs) r[o] = n.attrs[o];
r[this.attr] = this.value;
let i = n.type.create(r, null, n.marks);
return wt.fromReplace(
e,
this.pos,
this.pos + 1,
new ie(Y.from(i), 0, n.isLeaf ? 0 : 1)
);
}
getMap() {
return sn.empty;
}
invert(e) {
return new Hi(this.pos, this.attr, e.nodeAt(this.pos).attrs[this.attr]);
}
map(e) {
let n = e.mapResult(this.pos, 1);
return n.deletedAfter ? null : new Hi(n.pos, this.attr, this.value);
}
toJSON() {
return {
stepType: "attr",
pos: this.pos,
attr: this.attr,
value: this.value,
};
}
static fromJSON(e, n) {
if (typeof n.pos != "number" || typeof n.attr != "string")
throw new RangeError("Invalid input for AttrStep.fromJSON");
return new Hi(n.pos, n.attr, n.value);
}
}
Wt.jsonID("attr", Hi);
class ns extends Wt {
constructor(e, n) {
super(), (this.attr = e), (this.value = n);
}
apply(e) {
let n = Object.create(null);
for (let i in e.attrs) n[i] = e.attrs[i];
n[this.attr] = this.value;
let r = e.type.create(n, e.content, e.marks);
return wt.ok(r);
}
getMap() {
return sn.empty;
}
invert(e) {
return new ns(this.attr, e.attrs[this.attr]);
}
map(e) {
return this;
}
toJSON() {
return { stepType: "docAttr", attr: this.attr, value: this.value };
}
static fromJSON(e, n) {
if (typeof n.attr != "string")
throw new RangeError("Invalid input for DocAttrStep.fromJSON");
return new ns(n.attr, n.value);
}
}
Wt.jsonID("docAttr", ns);
let to = class extends Error {};
to = function t(e) {
let n = Error.call(this, e);
return (n.__proto__ = t.prototype), n;
};
to.prototype = Object.create(Error.prototype);
to.prototype.constructor = to;
to.prototype.name = "TransformError";
class a0 {
constructor(e) {
(this.doc = e),
(this.steps = []),
(this.docs = []),
(this.mapping = new $i());
}
get before() {
return this.docs.length ? this.docs[0] : this.doc;
}
step(e) {
let n = this.maybeStep(e);
if (n.failed) throw new to(n.failed);
return this;
}
maybeStep(e) {
let n = e.apply(this.doc);
return n.failed || this.addStep(e, n.doc), n;
}
get docChanged() {
return this.steps.length > 0;
}
addStep(e, n) {
this.docs.push(this.doc),
this.steps.push(e),
this.mapping.appendMap(e.getMap()),
(this.doc = n);
}
replace(e, n = e, r = ie.empty) {
let i = Zd(this.doc, e, n, r);
return i && this.step(i), this;
}
replaceWith(e, n, r) {
return this.replace(e, n, new ie(Y.from(r), 0, 0));
}
delete(e, n) {
return this.replace(e, n, ie.empty);
}
insert(e, n) {
return this.replaceWith(e, e, n);
}
replaceRange(e, n, r) {
return uC(this, e, n, r), this;
}
replaceRangeWith(e, n, r) {
return cC(this, e, n, r), this;
}
deleteRange(e, n) {
return dC(this, e, n), this;
}
lift(e, n) {
return Y8(this, e, n), this;
}
join(e, n = 1) {
return iC(this, e, n), this;
}
wrap(e, n) {
return Z8(this, e, n), this;
}
setBlockType(e, n = e, r, i = null) {
return eC(this, e, n, r, i), this;
}
setNodeMarkup(e, n, r = null, i) {
return nC(this, e, n, r, i), this;
}
setNodeAttribute(e, n, r) {
return this.step(new Hi(e, n, r)), this;
}
setDocAttribute(e, n) {
return this.step(new ns(e, n)), this;
}
addNodeMark(e, n) {
return this.step(new Er(e, n)), this;
}
removeNodeMark(e, n) {
if (!(n instanceof dt)) {
let r = this.doc.nodeAt(e);
if (!r) throw new RangeError("No node at position " + e);
if (((n = n.isInSet(r.marks)), !n)) return this;
}
return this.step(new eo(e, n)), this;
}
split(e, n = 1, r) {
return rC(this, e, n, r), this;
}
addMark(e, n, r) {
return K8(this, e, n, r), this;
}
removeMark(e, n, r) {
return q8(this, e, n, r), this;
}
clearIncompatible(e, n, r) {
return J8(this, e, n, r), this;
}
}
const _u = Object.create(null);
class Se {
constructor(e, n, r) {
(this.$anchor = e),
(this.$head = n),
(this.ranges = r || [new u0(e.min(n), e.max(n))]);
}
get anchor() {
return this.$anchor.pos;
}
get head() {
return this.$head.pos;
}
get from() {
return this.$from.pos;
}
get to() {
return this.$to.pos;
}
get $from() {
return this.ranges[0].$from;
}
get $to() {
return this.ranges[0].$to;
}
get empty() {
let e = this.ranges;
for (let n = 0; n < e.length; n++)
if (e[n].$from.pos != e[n].$to.pos) return !1;
return !0;
}
content() {
return this.$from.doc.slice(this.from, this.to, !0);
}
replace(e, n = ie.empty) {
let r = n.content.lastChild,
i = null;
for (let l = 0; l < n.openEnd; l++) (i = r), (r = r.lastChild);
let o = e.steps.length,
s = this.ranges;
for (let l = 0; l < s.length; l++) {
let { $from: a, $to: u } = s[l],
c = e.mapping.slice(o);
e.replaceRange(c.map(a.pos), c.map(u.pos), l ? ie.empty : n),
l == 0 &&
yp(e, o, (r ? r.isInline : i && i.isTextblock) ? -1 : 1);
}
}
replaceWith(e, n) {
let r = e.steps.length,
i = this.ranges;
for (let o = 0; o < i.length; o++) {
let { $from: s, $to: l } = i[o],
a = e.mapping.slice(r),
u = a.map(s.pos),
c = a.map(l.pos);
o
? e.deleteRange(u, c)
: (e.replaceRangeWith(u, c, n), yp(e, r, n.isInline ? -1 : 1));
}
}
static findFrom(e, n, r = !1) {
let i = e.parent.inlineContent
? new Ce(e)
: Ri(e.node(0), e.parent, e.pos, e.index(), n, r);
if (i) return i;
for (let o = e.depth - 1; o >= 0; o--) {
let s =
n < 0
? Ri(
e.node(0),
e.node(o),
e.before(o + 1),
e.index(o),
n,
r
)
: Ri(
e.node(0),
e.node(o),
e.after(o + 1),
e.index(o) + 1,
n,
r
);
if (s) return s;
}
return null;
}
static near(e, n = 1) {
return this.findFrom(e, n) || this.findFrom(e, -n) || new Rn(e.node(0));
}
static atStart(e) {
return Ri(e, e, 0, 0, 1) || new Rn(e);
}
static atEnd(e) {
return Ri(e, e, e.content.size, e.childCount, -1) || new Rn(e);
}
static fromJSON(e, n) {
if (!n || !n.type)
throw new RangeError("Invalid input for Selection.fromJSON");
let r = _u[n.type];
if (!r) throw new RangeError(`No selection type ${n.type} defined`);
return r.fromJSON(e, n);
}
static jsonID(e, n) {
if (e in _u)
throw new RangeError("Duplicate use of selection JSON ID " + e);
return (_u[e] = n), (n.prototype.jsonID = e), n;
}
getBookmark() {
return Ce.between(this.$anchor, this.$head).getBookmark();
}
}
Se.prototype.visible = !0;
class u0 {
constructor(e, n) {
(this.$from = e), (this.$to = n);
}
}
let mp = !1;
function gp(t) {
!mp &&
!t.parent.inlineContent &&
((mp = !0),
console.warn(
"TextSelection endpoint not pointing into a node with inline content (" +
t.parent.type.name +
")"
));
}
class Ce extends Se {
constructor(e, n = e) {
gp(e), gp(n), super(e, n);
}
get $cursor() {
return this.$anchor.pos == this.$head.pos ? this.$head : null;
}
map(e, n) {
let r = e.resolve(n.map(this.head));
if (!r.parent.inlineContent) return Se.near(r);
let i = e.resolve(n.map(this.anchor));
return new Ce(i.parent.inlineContent ? i : r, r);
}
replace(e, n = ie.empty) {
if ((super.replace(e, n), n == ie.empty)) {
let r = this.$from.marksAcross(this.$to);
r && e.ensureMarks(r);
}
}
eq(e) {
return (
e instanceof Ce && e.anchor == this.anchor && e.head == this.head
);
}
getBookmark() {
return new Fa(this.anchor, this.head);
}
toJSON() {
return { type: "text", anchor: this.anchor, head: this.head };
}
static fromJSON(e, n) {
if (typeof n.anchor != "number" || typeof n.head != "number")
throw new RangeError("Invalid input for TextSelection.fromJSON");
return new Ce(e.resolve(n.anchor), e.resolve(n.head));
}
static create(e, n, r = n) {
let i = e.resolve(n);
return new this(i, r == n ? i : e.resolve(r));
}
static between(e, n, r) {
let i = e.pos - n.pos;
if (((!r || i) && (r = i >= 0 ? 1 : -1), !n.parent.inlineContent)) {
let o = Se.findFrom(n, r, !0) || Se.findFrom(n, -r, !0);
if (o) n = o.$head;
else return Se.near(n, r);
}
return (
e.parent.inlineContent ||
(i == 0
? (e = n)
: ((e = (Se.findFrom(e, -r, !0) || Se.findFrom(e, r, !0))
.$anchor),
e.pos < n.pos != i < 0 && (e = n))),
new Ce(e, n)
);
}
}
Se.jsonID("text", Ce);
class Fa {
constructor(e, n) {
(this.anchor = e), (this.head = n);
}
map(e) {
return new Fa(e.map(this.anchor), e.map(this.head));
}
resolve(e) {
return Ce.between(e.resolve(this.anchor), e.resolve(this.head));
}
}
class ve extends Se {
constructor(e) {
let n = e.nodeAfter,
r = e.node(0).resolve(e.pos + n.nodeSize);
super(e, r), (this.node = n);
}
map(e, n) {
let { deleted: r, pos: i } = n.mapResult(this.anchor),
o = e.resolve(i);
return r ? Se.near(o) : new ve(o);
}
content() {
return new ie(Y.from(this.node), 0, 0);
}
eq(e) {
return e instanceof ve && e.anchor == this.anchor;
}
toJSON() {
return { type: "node", anchor: this.anchor };
}
getBookmark() {
return new ef(this.anchor);
}
static fromJSON(e, n) {
if (typeof n.anchor != "number")
throw new RangeError("Invalid input for NodeSelection.fromJSON");
return new ve(e.resolve(n.anchor));
}
static create(e, n) {
return new ve(e.resolve(n));
}
static isSelectable(e) {
return !e.isText && e.type.spec.selectable !== !1;
}
}
ve.prototype.visible = !1;
Se.jsonID("node", ve);
class ef {
constructor(e) {
this.anchor = e;
}
map(e) {
let { deleted: n, pos: r } = e.mapResult(this.anchor);
return n ? new Fa(r, r) : new ef(r);
}
resolve(e) {
let n = e.resolve(this.anchor),
r = n.nodeAfter;
return r && ve.isSelectable(r) ? new ve(n) : Se.near(n);
}
}
class Rn extends Se {
constructor(e) {
super(e.resolve(0), e.resolve(e.content.size));
}
replace(e, n = ie.empty) {
if (n == ie.empty) {
e.delete(0, e.doc.content.size);
let r = Se.atStart(e.doc);
r.eq(e.selection) || e.setSelection(r);
} else super.replace(e, n);
}
toJSON() {
return { type: "all" };
}
static fromJSON(e) {
return new Rn(e);
}
map(e) {
return new Rn(e);
}
eq(e) {
return e instanceof Rn;
}
getBookmark() {
return fC;
}
}
Se.jsonID("all", Rn);
const fC = {
map() {
return this;
},
resolve(t) {
return new Rn(t);
},
};
function Ri(t, e, n, r, i, o = !1) {
if (e.inlineContent) return Ce.create(t, n);
for (
let s = r - (i > 0 ? 0 : 1);
i > 0 ? s < e.childCount : s >= 0;
s += i
) {
let l = e.child(s);
if (l.isAtom) {
if (!o && ve.isSelectable(l))
return ve.create(t, n - (i < 0 ? l.nodeSize : 0));
} else {
let a = Ri(t, l, n + i, i < 0 ? l.childCount : 0, i, o);
if (a) return a;
}
n += l.nodeSize * i;
}
return null;
}
function yp(t, e, n) {
let r = t.steps.length - 1;
if (r < e) return;
let i = t.steps[r];
if (!(i instanceof jt || i instanceof Pt)) return;
let o = t.mapping.maps[r],
s;
o.forEach((l, a, u, c) => {
s == null && (s = c);
}),
t.setSelection(Se.near(t.doc.resolve(s), n));
}
function vp(t, e) {
return !e || !t ? t : t.bind(e);
}
class Vs {
constructor(e, n, r) {
(this.name = e),
(this.init = vp(n.init, r)),
(this.apply = vp(n.apply, r));
}
}
const bR = [
new Vs("doc", {
init(t) {
return t.doc || t.schema.topNodeType.createAndFill();
},
apply(t) {
return t.doc;
},
}),
new Vs("selection", {
init(t, e) {
return t.selection || Se.atStart(e.doc);
},
apply(t) {
return t.selection;
},
}),
new Vs("storedMarks", {
init(t) {
return t.storedMarks || null;
},
apply(t, e, n, r) {
return r.selection.$cursor ? t.storedMarks : null;
},
}),
new Vs("scrollToSelection", {
init() {
return 0;
},
apply(t, e) {
return t.scrolledIntoView ? e + 1 : e;
},
}),
];
function c0(t, e, n) {
for (let r in t) {
let i = t[r];
i instanceof Function
? (i = i.bind(e))
: r == "handleDOMEvents" && (i = c0(i, e, {})),
(n[r] = i);
}
return n;
}
class Tt {
constructor(e) {
(this.spec = e),
(this.props = {}),
e.props && c0(e.props, this, this.props),
(this.key = e.key ? e.key.key : d0("plugin"));
}
getState(e) {
return e[this.key];
}
}
const Mu = Object.create(null);
function d0(t) {
return t in Mu ? t + "$" + ++Mu[t] : ((Mu[t] = 0), t + "$");
}
class Ot {
constructor(e = "key") {
this.key = d0(e);
}
get(e) {
return e.config.pluginsByKey[this.key];
}
getState(e) {
return e[this.key];
}
}
const ki = function (t) {
for (var e = 0; ; e++) if (((t = t.previousSibling), !t)) return e;
};
const f0 = function (t, e, n, r) {
return n && (bp(t, e, n, r, -1) || bp(t, e, n, r, 1));
},
hC = /^(img|br|input|textarea|hr)$/i;
function bp(t, e, n, r, i) {
for (;;) {
if (t == n && e == r) return !0;
if (e == (i < 0 ? 0 : Nl(t))) {
let o = t.parentNode;
if (
!o ||
o.nodeType != 1 ||
tf(t) ||
hC.test(t.nodeName) ||
t.contentEditable == "false"
)
return !1;
(e = ki(t) + (i < 0 ? 0 : 1)), (t = o);
} else if (t.nodeType == 1) {
if (
((t = t.childNodes[e + (i < 0 ? -1 : 0)]),
t.contentEditable == "false")
)
return !1;
e = i < 0 ? Nl(t) : 0;
} else return !1;
}
}
function Nl(t) {
return t.nodeType == 3 ? t.nodeValue.length : t.childNodes.length;
}
function pC(t, e, n) {
for (let r = e == 0, i = e == Nl(t); r || i; ) {
if (t == n) return !0;
let o = ki(t);
if (((t = t.parentNode), !t)) return !1;
(r = r && o == 0), (i = i && o == Nl(t));
}
}
function tf(t) {
let e;
for (let n = t; n && !(e = n.pmViewDesc); n = n.parentNode);
return e && e.node && e.node.isBlock && (e.dom == t || e.contentDOM == t);
}
const h0 = function (t) {
return (
t.focusNode &&
f0(t.focusNode, t.focusOffset, t.anchorNode, t.anchorOffset)
);
};
function p0(t, e) {
let n = document.createEvent("Event");
return (
n.initEvent("keydown", !0, !0), (n.keyCode = t), (n.key = n.code = e), n
);
}
const Qn = typeof navigator != "undefined" ? navigator : null,
wp = typeof document != "undefined" ? document : null,
zr = (Qn && Qn.userAgent) || "",
Ec = /Edge\/(\d+)/.exec(zr),
m0 = /MSIE \d/.exec(zr),
Ac = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(zr),
co = !!(m0 || Ac || Ec),
nf = m0 ? document.documentMode : Ac ? +Ac[1] : Ec ? +Ec[1] : 0,
Va = !co && /gecko\/(\d+)/i.test(zr);
Va && +(/Firefox\/(\d+)/.exec(zr) || [0, 0])[1];
const Tc = !co && /Chrome\/(\d+)/.exec(zr),
Ci = !!Tc,
mC = Tc ? +Tc[1] : 0,
Si = !co && !!Qn && /Apple Computer/.test(Qn.vendor),
rf = Si && (/Mobile\/\w+/.test(zr) || (!!Qn && Qn.maxTouchPoints > 2)),
hn = rf || (Qn ? /Mac/.test(Qn.platform) : !1),
gC = Qn ? /Win/.test(Qn.platform) : !1,
ws = /Android \d/.test(zr),
of = !!wp && "webkitFontSmoothing" in wp.documentElement.style,
yC = of
? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1]
: 0;
const g0 = function (t) {
t && (this.nodeName = t);
};
g0.prototype = Object.create(null);
const wR = [new g0()];
function vC(t, e = null) {
let n = t.domSelectionRange(),
r = t.state.doc;
if (!n.focusNode) return null;
let i = t.docView.nearestDesc(n.focusNode),
o = i && i.size == 0,
s = t.docView.posFromDOM(n.focusNode, n.focusOffset, 1);
if (s < 0) return null;
let l = r.resolve(s),
a,
u;
if (h0(n)) {
for (a = l; i && !i.node; ) i = i.parent;
let c = i.node;
if (
i &&
c.isAtom &&
ve.isSelectable(c) &&
i.parent &&
!(c.isInline && pC(n.focusNode, n.focusOffset, i.dom))
) {
let f = i.posBefore;
u = new ve(s == f ? l : r.resolve(f));
}
} else {
let c = t.docView.posFromDOM(n.anchorNode, n.anchorOffset, 1);
if (c < 0) return null;
a = r.resolve(c);
}
if (!u) {
let c =
e == "pointer" || (t.state.selection.head < l.pos && !o) ? 1 : -1;
u = v0(t, a, l, c);
}
return u;
}
function y0(t) {
return t.editable
? t.hasFocus()
: kC(t) &&
document.activeElement &&
document.activeElement.contains(t.dom);
}
function sf(t, e = !1) {
let n = t.state.selection;
if ((xC(t, n), !!y0(t))) {
if (!e && t.input.mouseDown && t.input.mouseDown.allowDefault && Ci) {
let r = t.domSelectionRange(),
i = t.domObserver.currentSelection;
if (
r.anchorNode &&
i.anchorNode &&
f0(r.anchorNode, r.anchorOffset, i.anchorNode, i.anchorOffset)
) {
(t.input.mouseDown.delayedSelectionSync = !0),
t.domObserver.setCurSelection();
return;
}
}
if ((t.domObserver.disconnectSelection(), t.cursorWrapper)) wC(t);
else {
let { anchor: r, head: i } = n,
o,
s;
xp &&
!(n instanceof Ce) &&
(n.$from.parent.inlineContent || (o = kp(t, n.from)),
!n.empty && !n.$from.parent.inlineContent && (s = kp(t, n.to))),
t.docView.setSelection(r, i, t.root, e),
xp && (o && Cp(o), s && Cp(s)),
n.visible
? t.dom.classList.remove("ProseMirror-hideselection")
: (t.dom.classList.add("ProseMirror-hideselection"),
"onselectionchange" in document && bC(t));
}
t.domObserver.setCurSelection(), t.domObserver.connectSelection();
}
}
const xp = Si || (Ci && mC < 63);
function kp(t, e) {
let { node: n, offset: r } = t.docView.domFromPos(e, 0),
i = r < n.childNodes.length ? n.childNodes[r] : null,
o = r ? n.childNodes[r - 1] : null;
if (Si && i && i.contentEditable == "false") return Eu(i);
if (
(!i || i.contentEditable == "false") &&
(!o || o.contentEditable == "false")
) {
if (i) return Eu(i);
if (o) return Eu(o);
}
}
function Eu(t) {
return (
(t.contentEditable = "true"),
Si && t.draggable && ((t.draggable = !1), (t.wasDraggable = !0)),
t
);
}
function Cp(t) {
(t.contentEditable = "false"),
t.wasDraggable && ((t.draggable = !0), (t.wasDraggable = null));
}
function bC(t) {
let e = t.dom.ownerDocument;
e.removeEventListener("selectionchange", t.input.hideSelectionGuard);
let n = t.domSelectionRange(),
r = n.anchorNode,
i = n.anchorOffset;
e.addEventListener(
"selectionchange",
(t.input.hideSelectionGuard = () => {
(n.anchorNode != r || n.anchorOffset != i) &&
(e.removeEventListener(
"selectionchange",
t.input.hideSelectionGuard
),
setTimeout(() => {
(!y0(t) || t.state.selection.visible) &&
t.dom.classList.remove("ProseMirror-hideselection");
}, 20));
})
);
}
function wC(t) {
let e = t.domSelection(),
n = document.createRange(),
r = t.cursorWrapper.dom,
i = r.nodeName == "IMG";
i ? n.setEnd(r.parentNode, ki(r) + 1) : n.setEnd(r, 0),
n.collapse(!1),
e.removeAllRanges(),
e.addRange(n),
!i &&
!t.state.selection.visible &&
co &&
nf <= 11 &&
((r.disabled = !0), (r.disabled = !1));
}
function xC(t, e) {
if (e instanceof ve) {
let n = t.docView.descAt(e.from);
n != t.lastSelectedViewDesc &&
(Sp(t), n && n.selectNode(), (t.lastSelectedViewDesc = n));
} else Sp(t);
}
function Sp(t) {
t.lastSelectedViewDesc &&
(t.lastSelectedViewDesc.parent && t.lastSelectedViewDesc.deselectNode(),
(t.lastSelectedViewDesc = void 0));
}
function v0(t, e, n, r) {
return (
t.someProp("createSelectionBetween", (i) => i(t, e, n)) ||
Ce.between(e, n, r)
);
}
function kC(t) {
let e = t.domSelectionRange();
if (!e.anchorNode) return !1;
try {
return (
t.dom.contains(
e.anchorNode.nodeType == 3
? e.anchorNode.parentNode
: e.anchorNode
) &&
(t.editable ||
t.dom.contains(
e.focusNode.nodeType == 3
? e.focusNode.parentNode
: e.focusNode
))
);
} catch (n) {
return !1;
}
}
function Oc(t, e) {
let { $anchor: n, $head: r } = t.selection,
i = e > 0 ? n.max(r) : n.min(r),
o = i.parent.inlineContent
? i.depth
? t.doc.resolve(e > 0 ? i.after() : i.before())
: null
: i;
return o && Se.findFrom(o, e);
}
function br(t, e) {
return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()), !0;
}
function _p(t, e, n) {
let r = t.state.selection;
if (r instanceof Ce)
if (n.indexOf("s") > -1) {
let { $head: i } = r,
o = i.textOffset ? null : e < 0 ? i.nodeBefore : i.nodeAfter;
if (!o || o.isText || !o.isLeaf) return !1;
let s = t.state.doc.resolve(i.pos + o.nodeSize * (e < 0 ? -1 : 1));
return br(t, new Ce(r.$anchor, s));
} else if (r.empty) {
if (t.endOfTextblock(e > 0 ? "forward" : "backward")) {
let i = Oc(t.state, e);
return i && i instanceof ve ? br(t, i) : !1;
} else if (!(hn && n.indexOf("m") > -1)) {
let i = r.$head,
o = i.textOffset
? null
: e < 0
? i.nodeBefore
: i.nodeAfter,
s;
if (!o || o.isText) return !1;
let l = e < 0 ? i.pos - o.nodeSize : i.pos;
return o.isAtom || ((s = t.docView.descAt(l)) && !s.contentDOM)
? ve.isSelectable(o)
? br(
t,
new ve(
e < 0
? t.state.doc.resolve(
i.pos - o.nodeSize
)
: i
)
)
: of
? br(
t,
new Ce(
t.state.doc.resolve(
e < 0 ? l : l + o.nodeSize
)
)
)
: !1
: !1;
}
} else return !1;
else {
if (r instanceof ve && r.node.isInline)
return br(t, new Ce(e > 0 ? r.$to : r.$from));
{
let i = Oc(t.state, e);
return i ? br(t, i) : !1;
}
}
}
function jl(t) {
return t.nodeType == 3 ? t.nodeValue.length : t.childNodes.length;
}
function $o(t, e) {
let n = t.pmViewDesc;
return n && n.size == 0 && (e < 0 || t.nextSibling || t.nodeName != "BR");
}
function Ai(t, e) {
return e < 0 ? CC(t) : SC(t);
}
function CC(t) {
let e = t.domSelectionRange(),
n = e.focusNode,
r = e.focusOffset;
if (!n) return;
let i,
o,
s = !1;
for (
Va &&
n.nodeType == 1 &&
r < jl(n) &&
$o(n.childNodes[r], -1) &&
(s = !0);
;
)
if (r > 0) {
if (n.nodeType != 1) break;
{
let l = n.childNodes[r - 1];
if ($o(l, -1)) (i = n), (o = --r);
else if (l.nodeType == 3) (n = l), (r = n.nodeValue.length);
else break;
}
} else {
if (b0(n)) break;
{
let l = n.previousSibling;
for (; l && $o(l, -1); )
(i = n.parentNode), (o = ki(l)), (l = l.previousSibling);
if (l) (n = l), (r = jl(n));
else {
if (((n = n.parentNode), n == t.dom)) break;
r = 0;
}
}
}
s ? Rc(t, n, r) : i && Rc(t, i, o);
}
function SC(t) {
let e = t.domSelectionRange(),
n = e.focusNode,
r = e.focusOffset;
if (!n) return;
let i = jl(n),
o,
s;
for (;;)
if (r < i) {
if (n.nodeType != 1) break;
let l = n.childNodes[r];
if ($o(l, 1)) (o = n), (s = ++r);
else break;
} else {
if (b0(n)) break;
{
let l = n.nextSibling;
for (; l && $o(l, 1); )
(o = l.parentNode), (s = ki(l) + 1), (l = l.nextSibling);
if (l) (n = l), (r = 0), (i = jl(n));
else {
if (((n = n.parentNode), n == t.dom)) break;
r = i = 0;
}
}
}
o && Rc(t, o, s);
}
function b0(t) {
let e = t.pmViewDesc;
return e && e.node && e.node.isBlock;
}
function _C(t, e) {
for (; t && e == t.childNodes.length && !tf(t); )
(e = ki(t) + 1), (t = t.parentNode);
for (; t && e < t.childNodes.length; ) {
let n = t.childNodes[e];
if (n.nodeType == 3) return n;
if (n.nodeType == 1 && n.contentEditable == "false") break;
(t = n), (e = 0);
}
}
function MC(t, e) {
for (; t && !e && !tf(t); ) (e = ki(t)), (t = t.parentNode);
for (; t && e; ) {
let n = t.childNodes[e - 1];
if (n.nodeType == 3) return n;
if (n.nodeType == 1 && n.contentEditable == "false") break;
(t = n), (e = t.childNodes.length);
}
}
function Rc(t, e, n) {
if (e.nodeType != 3) {
let o, s;
(s = _C(e, n))
? ((e = s), (n = 0))
: (o = MC(e, n)) && ((e = o), (n = o.nodeValue.length));
}
let r = t.domSelection();
if (h0(r)) {
let o = document.createRange();
o.setEnd(e, n), o.setStart(e, n), r.removeAllRanges(), r.addRange(o);
} else r.extend && r.extend(e, n);
t.domObserver.setCurSelection();
let { state: i } = t;
setTimeout(() => {
t.state == i && sf(t);
}, 50);
}
function Mp(t, e) {
let n = t.state.doc.resolve(e);
if (!(Ci || gC) && n.parent.inlineContent) {
let i = t.coordsAtPos(e);
if (e > n.start()) {
let o = t.coordsAtPos(e - 1),
s = (o.top + o.bottom) / 2;
if (s > i.top && s < i.bottom && Math.abs(o.left - i.left) > 1)
return o.left < i.left ? "ltr" : "rtl";
}
if (e < n.end()) {
let o = t.coordsAtPos(e + 1),
s = (o.top + o.bottom) / 2;
if (s > i.top && s < i.bottom && Math.abs(o.left - i.left) > 1)
return o.left > i.left ? "ltr" : "rtl";
}
}
return getComputedStyle(t.dom).direction == "rtl" ? "rtl" : "ltr";
}
function Ep(t, e, n) {
let r = t.state.selection;
if (
(r instanceof Ce && !r.empty) ||
n.indexOf("s") > -1 ||
(hn && n.indexOf("m") > -1)
)
return !1;
let { $from: i, $to: o } = r;
if (!i.parent.inlineContent || t.endOfTextblock(e < 0 ? "up" : "down")) {
let s = Oc(t.state, e);
if (s && s instanceof ve) return br(t, s);
}
if (!i.parent.inlineContent) {
let s = e < 0 ? i : o,
l = r instanceof Rn ? Se.near(s, e) : Se.findFrom(s, e);
return l ? br(t, l) : !1;
}
return !1;
}
function Ap(t, e) {
if (!(t.state.selection instanceof Ce)) return !0;
let { $head: n, $anchor: r, empty: i } = t.state.selection;
if (!n.sameParent(r)) return !0;
if (!i) return !1;
if (t.endOfTextblock(e > 0 ? "forward" : "backward")) return !0;
let o = !n.textOffset && (e < 0 ? n.nodeBefore : n.nodeAfter);
if (o && !o.isText) {
let s = t.state.tr;
return (
e < 0
? s.delete(n.pos - o.nodeSize, n.pos)
: s.delete(n.pos, n.pos + o.nodeSize),
t.dispatch(s),
!0
);
}
return !1;
}
function Tp(t, e, n) {
t.domObserver.stop(), (e.contentEditable = n), t.domObserver.start();
}
function EC(t) {
if (!Si || t.state.selection.$head.parentOffset > 0) return !1;
let { focusNode: e, focusOffset: n } = t.domSelectionRange();
if (
e &&
e.nodeType == 1 &&
n == 0 &&
e.firstChild &&
e.firstChild.contentEditable == "false"
) {
let r = e.firstChild;
Tp(t, r, "true"), setTimeout(() => Tp(t, r, "false"), 20);
}
return !1;
}
function AC(t) {
let e = "";
return (
t.ctrlKey && (e += "c"),
t.metaKey && (e += "m"),
t.altKey && (e += "a"),
t.shiftKey && (e += "s"),
e
);
}
function TC(t, e) {
let n = e.keyCode,
r = AC(e);
if (n == 8 || (hn && n == 72 && r == "c")) return Ap(t, -1) || Ai(t, -1);
if ((n == 46 && !e.shiftKey) || (hn && n == 68 && r == "c"))
return Ap(t, 1) || Ai(t, 1);
if (n == 13 || n == 27) return !0;
if (n == 37 || (hn && n == 66 && r == "c")) {
let i =
n == 37 ? (Mp(t, t.state.selection.from) == "ltr" ? -1 : 1) : -1;
return _p(t, i, r) || Ai(t, i);
} else if (n == 39 || (hn && n == 70 && r == "c")) {
let i = n == 39 ? (Mp(t, t.state.selection.from) == "ltr" ? 1 : -1) : 1;
return _p(t, i, r) || Ai(t, i);
} else {
if (n == 38 || (hn && n == 80 && r == "c"))
return Ep(t, -1, r) || Ai(t, -1);
if (n == 40 || (hn && n == 78 && r == "c"))
return EC(t) || Ep(t, 1, r) || Ai(t, 1);
if (r == (hn ? "m" : "c") && (n == 66 || n == 73 || n == 89 || n == 90))
return !0;
}
return !1;
}
function w0(t, e) {
t.someProp("transformCopied", (p) => {
e = p(e, t);
});
let n = [],
{ content: r, openStart: i, openEnd: o } = e;
for (
;
i > 1 && o > 1 && r.childCount == 1 && r.firstChild.childCount == 1;
) {
i--, o--;
let p = r.firstChild;
n.push(p.type.name, p.attrs != p.type.defaultAttrs ? p.attrs : null),
(r = p.content);
}
let s = t.someProp("clipboardSerializer") || ri.fromSchema(t.state.schema),
l = M0(),
a = l.createElement("div");
a.appendChild(s.serializeFragment(r, { document: l }));
let u = a.firstChild,
c,
f = 0;
for (; u && u.nodeType == 1 && (c = _0[u.nodeName.toLowerCase()]); ) {
for (let p = c.length - 1; p >= 0; p--) {
let g = l.createElement(c[p]);
for (; a.firstChild; ) g.appendChild(a.firstChild);
a.appendChild(g), f++;
}
u = a.firstChild;
}
u &&
u.nodeType == 1 &&
u.setAttribute(
"data-pm-slice",
`${i} ${o}${f ? ` -${f}` : ""} ${JSON.stringify(n)}`
);
let h =
t.someProp("clipboardTextSerializer", (p) => p(e, t)) ||
e.content.textBetween(
0,
e.content.size,
`
`
);
return { dom: a, text: h };
}
function x0(t, e, n, r, i) {
let o = i.parent.type.spec.code,
s,
l;
if (!n && !e) return null;
let a = e && (r || o || !n);
if (a) {
if (
(t.someProp("transformPastedText", (h) => {
e = h(e, o || r, t);
}),
o)
)
return e
? new ie(
Y.from(
t.state.schema.text(
e.replace(
/\r\n?/g,
`
`
)
)
),
0,
0
)
: ie.empty;
let f = t.someProp("clipboardTextParser", (h) => h(e, i, r, t));
if (f) l = f;
else {
let h = i.marks(),
{ schema: p } = t.state,
g = ri.fromSchema(p);
(s = document.createElement("div")),
e.split(/(?:\r\n?|\n)+/).forEach((v) => {
let b = s.appendChild(document.createElement("p"));
v && b.appendChild(g.serializeNode(p.text(v, h)));
});
}
} else
t.someProp("transformPastedHTML", (f) => {
n = f(n, t);
}),
(s = PC(n)),
of && NC(s);
let u = s && s.querySelector("[data-pm-slice]"),
c =
u &&
/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(
u.getAttribute("data-pm-slice") || ""
);
if (c && c[3])
for (let f = +c[3]; f > 0; f--) {
let h = s.firstChild;
for (; h && h.nodeType != 1; ) h = h.nextSibling;
if (!h) break;
s = h;
}
if (
(l ||
(l = (
t.someProp("clipboardParser") ||
t.someProp("domParser") ||
ts.fromSchema(t.state.schema)
).parseSlice(s, {
preserveWhitespace: !!(a || c),
context: i,
ruleFromNode(h) {
return h.nodeName == "BR" &&
!h.nextSibling &&
h.parentNode &&
!OC.test(h.parentNode.nodeName)
? { ignore: !0 }
: null;
},
})),
c)
)
l = jC(Op(l, +c[1], +c[2]), c[4]);
else if (
((l = ie.maxOpen(RC(l.content, i), !0)), l.openStart || l.openEnd)
) {
let f = 0,
h = 0;
for (
let p = l.content.firstChild;
f < l.openStart && !p.type.spec.isolating;
f++, p = p.firstChild
);
for (
let p = l.content.lastChild;
h < l.openEnd && !p.type.spec.isolating;
h++, p = p.lastChild
);
l = Op(l, f, h);
}
return (
t.someProp("transformPasted", (f) => {
l = f(l, t);
}),
l
);
}
const OC =
/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;
function RC(t, e) {
if (t.childCount < 2) return t;
for (let n = e.depth; n >= 0; n--) {
let i = e.node(n).contentMatchAt(e.index(n)),
o,
s = [];
if (
(t.forEach((l) => {
if (!s) return;
let a = i.findWrapping(l.type),
u;
if (!a) return (s = null);
if (
(u =
s.length && o.length && C0(a, o, l, s[s.length - 1], 0))
)
s[s.length - 1] = u;
else {
s.length &&
(s[s.length - 1] = S0(s[s.length - 1], o.length));
let c = k0(l, a);
s.push(c), (i = i.matchType(c.type)), (o = a);
}
}),
s)
)
return Y.from(s);
}
return t;
}
function k0(t, e, n = 0) {
for (let r = e.length - 1; r >= n; r--) t = e[r].create(null, Y.from(t));
return t;
}
function C0(t, e, n, r, i) {
if (i < t.length && i < e.length && t[i] == e[i]) {
let o = C0(t, e, n, r.lastChild, i + 1);
if (o) return r.copy(r.content.replaceChild(r.childCount - 1, o));
if (
r
.contentMatchAt(r.childCount)
.matchType(i == t.length - 1 ? n.type : t[i + 1])
)
return r.copy(r.content.append(Y.from(k0(n, t, i + 1))));
}
}
function S0(t, e) {
if (e == 0) return t;
let n = t.content.replaceChild(t.childCount - 1, S0(t.lastChild, e - 1)),
r = t.contentMatchAt(t.childCount).fillBefore(Y.empty, !0);
return t.copy(n.append(r));
}
function Pc(t, e, n, r, i, o) {
let s = e < 0 ? t.firstChild : t.lastChild,
l = s.content;
return (
t.childCount > 1 && (o = 0),
i < r - 1 && (l = Pc(l, e, n, r, i + 1, o)),
i >= n &&
(l =
e < 0
? s
.contentMatchAt(0)
.fillBefore(l, o <= i)
.append(l)
: l.append(
s
.contentMatchAt(s.childCount)
.fillBefore(Y.empty, !0)
)),
t.replaceChild(e < 0 ? 0 : t.childCount - 1, s.copy(l))
);
}
function Op(t, e, n) {
return (
e < t.openStart &&
(t = new ie(
Pc(t.content, -1, e, t.openStart, 0, t.openEnd),
e,
t.openEnd
)),
n < t.openEnd &&
(t = new ie(Pc(t.content, 1, n, t.openEnd, 0, 0), t.openStart, n)),
t
);
}
const _0 = {
thead: ["table"],
tbody: ["table"],
tfoot: ["table"],
caption: ["table"],
colgroup: ["table"],
col: ["table", "colgroup"],
tr: ["table", "tbody"],
td: ["table", "tbody", "tr"],
th: ["table", "tbody", "tr"],
};
let Rp = null;
function M0() {
return Rp || (Rp = document.implementation.createHTMLDocument("title"));
}
function PC(t) {
let e = /^(\s*<meta [^>]*>)*/.exec(t);
e && (t = t.slice(e[0].length));
let n = M0().createElement("div"),
r = /<([a-z][^>\s]+)/i.exec(t),
i;
if (
((i = r && _0[r[1].toLowerCase()]) &&
(t =
i.map((o) => "<" + o + ">").join("") +
t +
i
.map((o) => "</" + o + ">")
.reverse()
.join("")),
(n.innerHTML = t),
i)
)
for (let o = 0; o < i.length; o++) n = n.querySelector(i[o]) || n;
return n;
}
function NC(t) {
let e = t.querySelectorAll(
Ci ? "span:not([class]):not([style])" : "span.Apple-converted-space"
);
for (let n = 0; n < e.length; n++) {
let r = e[n];
r.childNodes.length == 1 &&
r.textContent == "\xA0" &&
r.parentNode &&
r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "), r);
}
}
function jC(t, e) {
if (!t.size) return t;
let n = t.content.firstChild.type.schema,
r;
try {
r = JSON.parse(e);
} catch (l) {
return t;
}
let { content: i, openStart: o, openEnd: s } = t;
for (let l = r.length - 2; l >= 0; l -= 2) {
let a = n.nodes[r[l]];
if (!a || a.hasRequiredAttrs()) break;
(i = Y.from(a.create(r[l + 1], i))), o++, s++;
}
return new ie(i, o, s);
}
const jn = {},
an = {};
function Ar(t, e) {
(t.input.lastSelectionOrigin = e), (t.input.lastSelectionTime = Date.now());
}
an.keydown = (t, e) => {
let n = e;
if (
((t.input.shiftKey = n.keyCode == 16 || n.shiftKey),
!A0(t, n) &&
((t.input.lastKeyCode = n.keyCode),
(t.input.lastKeyCodeTime = Date.now()),
!(ws && Ci && n.keyCode == 13)))
)
if (
(n.keyCode != 229 && t.domObserver.forceFlush(),
rf && n.keyCode == 13 && !n.ctrlKey && !n.altKey && !n.metaKey)
) {
let r = Date.now();
(t.input.lastIOSEnter = r),
(t.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
t.input.lastIOSEnter == r &&
(t.someProp("handleKeyDown", (i) =>
i(t, p0(13, "Enter"))
),
(t.input.lastIOSEnter = 0));
}, 200));
} else
t.someProp("handleKeyDown", (r) => r(t, n)) || TC(t, n)
? n.preventDefault()
: Ar(t, "key");
};
an.keyup = (t, e) => {
e.keyCode == 16 && (t.input.shiftKey = !1);
};
an.keypress = (t, e) => {
let n = e;
if (
A0(t, n) ||
!n.charCode ||
(n.ctrlKey && !n.altKey) ||
(hn && n.metaKey)
)
return;
if (t.someProp("handleKeyPress", (i) => i(t, n))) {
n.preventDefault();
return;
}
let r = t.state.selection;
if (!(r instanceof Ce) || !r.$from.sameParent(r.$to)) {
let i = String.fromCharCode(n.charCode);
!/[\r\n]/.test(i) &&
!t.someProp("handleTextInput", (o) =>
o(t, r.$from.pos, r.$to.pos, i)
) &&
t.dispatch(t.state.tr.insertText(i).scrollIntoView()),
n.preventDefault();
}
};
function Wa(t) {
return { left: t.clientX, top: t.clientY };
}
function LC(t, e) {
let n = e.x - t.clientX,
r = e.y - t.clientY;
return n * n + r * r < 100;
}
function lf(t, e, n, r, i) {
if (r == -1) return !1;
let o = t.state.doc.resolve(r);
for (let s = o.depth + 1; s > 0; s--)
if (
t.someProp(e, (l) =>
s > o.depth
? l(t, n, o.nodeAfter, o.before(s), i, !0)
: l(t, n, o.node(s), o.before(s), i, !1)
)
)
return !0;
return !1;
}
function Fi(t, e, n) {
t.focused || t.focus();
let r = t.state.tr.setSelection(e);
n == "pointer" && r.setMeta("pointer", !0), t.dispatch(r);
}
function DC(t, e) {
if (e == -1) return !1;
let n = t.state.doc.resolve(e),
r = n.nodeAfter;
return r && r.isAtom && ve.isSelectable(r)
? (Fi(t, new ve(n), "pointer"), !0)
: !1;
}
function IC(t, e) {
if (e == -1) return !1;
let n = t.state.selection,
r,
i;
n instanceof ve && (r = n.node);
let o = t.state.doc.resolve(e);
for (let s = o.depth + 1; s > 0; s--) {
let l = s > o.depth ? o.nodeAfter : o.node(s);
if (ve.isSelectable(l)) {
r &&
n.$from.depth > 0 &&
s >= n.$from.depth &&
o.before(n.$from.depth + 1) == n.$from.pos
? (i = o.before(n.$from.depth))
: (i = o.before(s));
break;
}
}
return i != null ? (Fi(t, ve.create(t.state.doc, i), "pointer"), !0) : !1;
}
function BC(t, e, n, r, i) {
return (
lf(t, "handleClickOn", e, n, r) ||
t.someProp("handleClick", (o) => o(t, e, r)) ||
(i ? IC(t, n) : DC(t, n))
);
}
function $C(t, e, n, r) {
return (
lf(t, "handleDoubleClickOn", e, n, r) ||
t.someProp("handleDoubleClick", (i) => i(t, e, r))
);
}
function zC(t, e, n, r) {
return (
lf(t, "handleTripleClickOn", e, n, r) ||
t.someProp("handleTripleClick", (i) => i(t, e, r)) ||
HC(t, n, r)
);
}
function HC(t, e, n) {
if (n.button != 0) return !1;
let r = t.state.doc;
if (e == -1)
return r.inlineContent
? (Fi(t, Ce.create(r, 0, r.content.size), "pointer"), !0)
: !1;
let i = r.resolve(e);
for (let o = i.depth + 1; o > 0; o--) {
let s = o > i.depth ? i.nodeAfter : i.node(o),
l = i.before(o);
if (s.inlineContent)
Fi(t, Ce.create(r, l + 1, l + 1 + s.content.size), "pointer");
else if (ve.isSelectable(s)) Fi(t, ve.create(r, l), "pointer");
else continue;
return !0;
}
}
function af(t) {
return Ll(t);
}
const E0 = hn ? "metaKey" : "ctrlKey";
jn.mousedown = (t, e) => {
let n = e;
t.input.shiftKey = n.shiftKey;
let r = af(t),
i = Date.now(),
o = "singleClick";
i - t.input.lastClick.time < 500 &&
LC(n, t.input.lastClick) &&
!n[E0] &&
(t.input.lastClick.type == "singleClick"
? (o = "doubleClick")
: t.input.lastClick.type == "doubleClick" && (o = "tripleClick")),
(t.input.lastClick = { time: i, x: n.clientX, y: n.clientY, type: o });
let s = t.posAtCoords(Wa(n));
!s ||
(o == "singleClick"
? (t.input.mouseDown && t.input.mouseDown.done(),
(t.input.mouseDown = new FC(t, s, n, !!r)))
: (o == "doubleClick" ? $C : zC)(t, s.pos, s.inside, n)
? n.preventDefault()
: Ar(t, "pointer"));
};
class FC {
constructor(e, n, r, i) {
(this.view = e),
(this.pos = n),
(this.event = r),
(this.flushed = i),
(this.delayedSelectionSync = !1),
(this.mightDrag = null),
(this.startDoc = e.state.doc),
(this.selectNode = !!r[E0]),
(this.allowDefault = r.shiftKey);
let o, s;
if (n.inside > -1) (o = e.state.doc.nodeAt(n.inside)), (s = n.inside);
else {
let c = e.state.doc.resolve(n.pos);
(o = c.parent), (s = c.depth ? c.before() : 0);
}
const l = i ? null : r.target,
a = l ? e.docView.nearestDesc(l, !0) : null;
this.target = a ? a.dom : null;
let { selection: u } = e.state;
((r.button == 0 &&
o.type.spec.draggable &&
o.type.spec.selectable !== !1) ||
(u instanceof ve && u.from <= s && u.to > s)) &&
(this.mightDrag = {
node: o,
pos: s,
addAttr: !!(this.target && !this.target.draggable),
setUneditable: !!(
this.target &&
Va &&
!this.target.hasAttribute("contentEditable")
),
}),
this.target &&
this.mightDrag &&
(this.mightDrag.addAttr || this.mightDrag.setUneditable) &&
(this.view.domObserver.stop(),
this.mightDrag.addAttr && (this.target.draggable = !0),
this.mightDrag.setUneditable &&
setTimeout(() => {
this.view.input.mouseDown == this &&
this.target.setAttribute(
"contentEditable",
"false"
);
}, 20),
this.view.domObserver.start()),
e.root.addEventListener("mouseup", (this.up = this.up.bind(this))),
e.root.addEventListener(
"mousemove",
(this.move = this.move.bind(this))
),
Ar(e, "pointer");
}
done() {
this.view.root.removeEventListener("mouseup", this.up),
this.view.root.removeEventListener("mousemove", this.move),
this.mightDrag &&
this.target &&
(this.view.domObserver.stop(),
this.mightDrag.addAttr &&
this.target.removeAttribute("draggable"),
this.mightDrag.setUneditable &&
this.target.removeAttribute("contentEditable"),
this.view.domObserver.start()),
this.delayedSelectionSync && setTimeout(() => sf(this.view)),
(this.view.input.mouseDown = null);
}
up(e) {
if ((this.done(), !this.view.dom.contains(e.target))) return;
let n = this.pos;
this.view.state.doc != this.startDoc &&
(n = this.view.posAtCoords(Wa(e))),
this.updateAllowDefault(e),
this.allowDefault || !n
? Ar(this.view, "pointer")
: BC(this.view, n.pos, n.inside, e, this.selectNode)
? e.preventDefault()
: e.button == 0 &&
(this.flushed ||
(Si && this.mightDrag && !this.mightDrag.node.isAtom) ||
(Ci &&
!this.view.state.selection.visible &&
Math.min(
Math.abs(
n.pos - this.view.state.selection.from
),
Math.abs(n.pos - this.view.state.selection.to)
) <= 2))
? (Fi(
this.view,
Se.near(this.view.state.doc.resolve(n.pos)),
"pointer"
),
e.preventDefault())
: Ar(this.view, "pointer");
}
move(e) {
this.updateAllowDefault(e),
Ar(this.view, "pointer"),
e.buttons == 0 && this.done();
}
updateAllowDefault(e) {
!this.allowDefault &&
(Math.abs(this.event.x - e.clientX) > 4 ||
Math.abs(this.event.y - e.clientY) > 4) &&
(this.allowDefault = !0);
}
}
jn.touchstart = (t) => {
(t.input.lastTouch = Date.now()), af(t), Ar(t, "pointer");
};
jn.touchmove = (t) => {
(t.input.lastTouch = Date.now()), Ar(t, "pointer");
};
jn.contextmenu = (t) => af(t);
function A0(t, e) {
return t.composing
? !0
: Si && Math.abs(e.timeStamp - t.input.compositionEndedAt) < 500
? ((t.input.compositionEndedAt = -2e8), !0)
: !1;
}
const VC = ws ? 5e3 : -1;
an.compositionstart = an.compositionupdate = (t) => {
if (!t.composing) {
t.domObserver.flush();
let { state: e } = t,
n = e.selection.$from;
if (
e.selection.empty &&
(e.storedMarks ||
(!n.textOffset &&
n.parentOffset &&
n.nodeBefore.marks.some(
(r) => r.type.spec.inclusive === !1
)))
)
(t.markCursor = t.state.storedMarks || n.marks()),
Ll(t, !0),
(t.markCursor = null);
else if (
(Ll(t),
Va &&
e.selection.empty &&
n.parentOffset &&
!n.textOffset &&
n.nodeBefore.marks.length)
) {
let r = t.domSelectionRange();
for (
let i = r.focusNode, o = r.focusOffset;
i && i.nodeType == 1 && o != 0;
) {
let s = o < 0 ? i.lastChild : i.childNodes[o - 1];
if (!s) break;
if (s.nodeType == 3) {
t.domSelection().collapse(s, s.nodeValue.length);
break;
} else (i = s), (o = -1);
}
}
t.input.composing = !0;
}
T0(t, VC);
};
an.compositionend = (t, e) => {
t.composing &&
((t.input.composing = !1),
(t.input.compositionEndedAt = e.timeStamp),
(t.input.compositionPendingChanges = t.domObserver.pendingRecords()
.length
? t.input.compositionID
: 0),
t.input.compositionPendingChanges &&
Promise.resolve().then(() => t.domObserver.flush()),
t.input.compositionID++,
T0(t, 20));
};
function T0(t, e) {
clearTimeout(t.input.composingTimeout),
e > -1 && (t.input.composingTimeout = setTimeout(() => Ll(t), e));
}
function WC(t) {
for (
t.composing &&
((t.input.composing = !1), (t.input.compositionEndedAt = UC()));
t.input.compositionNodes.length > 0;
)
t.input.compositionNodes.pop().markParentsDirty();
}
function UC() {
let t = document.createEvent("Event");
return t.initEvent("event", !0, !0), t.timeStamp;
}
function Ll(t, e = !1) {
if (!(ws && t.domObserver.flushingSoon >= 0)) {
if (
(t.domObserver.forceFlush(),
WC(t),
e || (t.docView && t.docView.dirty))
) {
let n = vC(t);
return (
n && !n.eq(t.state.selection)
? t.dispatch(t.state.tr.setSelection(n))
: t.updateState(t.state),
!0
);
}
return !1;
}
}
function KC(t, e) {
if (!t.dom.parentNode) return;
let n = t.dom.parentNode.appendChild(document.createElement("div"));
n.appendChild(e),
(n.style.cssText = "position: fixed; left: -10000px; top: 10px");
let r = getSelection(),
i = document.createRange();
i.selectNodeContents(e),
t.dom.blur(),
r.removeAllRanges(),
r.addRange(i),
setTimeout(() => {
n.parentNode && n.parentNode.removeChild(n), t.focus();
}, 50);
}
const rs = (co && nf < 15) || (rf && yC < 604);
jn.copy = an.cut = (t, e) => {
let n = e,
r = t.state.selection,
i = n.type == "cut";
if (r.empty) return;
let o = rs ? null : n.clipboardData,
s = r.content(),
{ dom: l, text: a } = w0(t, s);
o
? (n.preventDefault(),
o.clearData(),
o.setData("text/html", l.innerHTML),
o.setData("text/plain", a))
: KC(t, l),
i &&
t.dispatch(
t.state.tr
.deleteSelection()
.scrollIntoView()
.setMeta("uiEvent", "cut")
);
};
function qC(t) {
return t.openStart == 0 && t.openEnd == 0 && t.content.childCount == 1
? t.content.firstChild
: null;
}
function JC(t, e) {
if (!t.dom.parentNode) return;
let n = t.input.shiftKey || t.state.selection.$from.parent.type.spec.code,
r = t.dom.parentNode.appendChild(
document.createElement(n ? "textarea" : "div")
);
n || (r.contentEditable = "true"),
(r.style.cssText = "position: fixed; left: -10000px; top: 10px"),
r.focus();
let i = t.input.shiftKey && t.input.lastKeyCode != 45;
setTimeout(() => {
t.focus(),
r.parentNode && r.parentNode.removeChild(r),
n
? Nc(t, r.value, null, i, e)
: Nc(t, r.textContent, r.innerHTML, i, e);
}, 50);
}
function Nc(t, e, n, r, i) {
let o = x0(t, e, n, r, t.state.selection.$from);
if (t.someProp("handlePaste", (a) => a(t, i, o || ie.empty))) return !0;
if (!o) return !1;
let s = qC(o),
l = s
? t.state.tr.replaceSelectionWith(s, r)
: t.state.tr.replaceSelection(o);
return (
t.dispatch(
l.scrollIntoView().setMeta("paste", !0).setMeta("uiEvent", "paste")
),
!0
);
}
function O0(t) {
let e = t.getData("text/plain") || t.getData("Text");
if (e) return e;
let n = t.getData("text/uri-list");
return n ? n.replace(/\r?\n/g, " ") : "";
}
an.paste = (t, e) => {
let n = e;
if (t.composing && !ws) return;
let r = rs ? null : n.clipboardData,
i = t.input.shiftKey && t.input.lastKeyCode != 45;
r && Nc(t, O0(r), r.getData("text/html"), i, n)
? n.preventDefault()
: JC(t, n);
};
class GC {
constructor(e, n, r) {
(this.slice = e), (this.move = n), (this.node = r);
}
}
const R0 = hn ? "altKey" : "ctrlKey";
jn.dragstart = (t, e) => {
let n = e,
r = t.input.mouseDown;
if ((r && r.done(), !n.dataTransfer)) return;
let i = t.state.selection,
o = i.empty ? null : t.posAtCoords(Wa(n)),
s;
if (
!(o && o.pos >= i.from && o.pos <= (i instanceof ve ? i.to - 1 : i.to))
) {
if (r && r.mightDrag) s = ve.create(t.state.doc, r.mightDrag.pos);
else if (n.target && n.target.nodeType == 1) {
let c = t.docView.nearestDesc(n.target, !0);
c &&
c.node.type.spec.draggable &&
c != t.docView &&
(s = ve.create(t.state.doc, c.posBefore));
}
}
let l = (s || t.state.selection).content(),
{ dom: a, text: u } = w0(t, l);
n.dataTransfer.clearData(),
n.dataTransfer.setData(rs ? "Text" : "text/html", a.innerHTML),
(n.dataTransfer.effectAllowed = "copyMove"),
rs || n.dataTransfer.setData("text/plain", u),
(t.dragging = new GC(l, !n[R0], s));
};
jn.dragend = (t) => {
let e = t.dragging;
window.setTimeout(() => {
t.dragging == e && (t.dragging = null);
}, 50);
};
an.dragover = an.dragenter = (t, e) => e.preventDefault();
an.drop = (t, e) => {
let n = e,
r = t.dragging;
if (((t.dragging = null), !n.dataTransfer)) return;
let i = t.posAtCoords(Wa(n));
if (!i) return;
let o = t.state.doc.resolve(i.pos),
s = r && r.slice;
s
? t.someProp("transformPasted", (g) => {
s = g(s, t);
})
: (s = x0(
t,
O0(n.dataTransfer),
rs ? null : n.dataTransfer.getData("text/html"),
!1,
o
));
let l = !!(r && !n[R0]);
if (t.someProp("handleDrop", (g) => g(t, n, s || ie.empty, l))) {
n.preventDefault();
return;
}
if (!s) return;
n.preventDefault();
let a = s ? r0(t.state.doc, o.pos, s) : o.pos;
a == null && (a = o.pos);
let u = t.state.tr;
if (l) {
let { node: g } = r;
g ? g.replace(u) : u.deleteSelection();
}
let c = u.mapping.map(a),
f = s.openStart == 0 && s.openEnd == 0 && s.content.childCount == 1,
h = u.doc;
if (
(f
? u.replaceRangeWith(c, c, s.content.firstChild)
: u.replaceRange(c, c, s),
u.doc.eq(h))
)
return;
let p = u.doc.resolve(c);
if (
f &&
ve.isSelectable(s.content.firstChild) &&
p.nodeAfter &&
p.nodeAfter.sameMarkup(s.content.firstChild)
)
u.setSelection(new ve(p));
else {
let g = u.mapping.map(a);
u.mapping.maps[u.mapping.maps.length - 1].forEach(
(v, b, x, S) => (g = S)
),
u.setSelection(v0(t, p, u.doc.resolve(g)));
}
t.focus(), t.dispatch(u.setMeta("uiEvent", "drop"));
};
jn.focus = (t) => {
(t.input.lastFocus = Date.now()),
t.focused ||
(t.domObserver.stop(),
t.dom.classList.add("ProseMirror-focused"),
t.domObserver.start(),
(t.focused = !0),
setTimeout(() => {
t.docView &&
t.hasFocus() &&
!t.domObserver.currentSelection.eq(t.domSelectionRange()) &&
sf(t);
}, 20));
};
jn.blur = (t, e) => {
let n = e;
t.focused &&
(t.domObserver.stop(),
t.dom.classList.remove("ProseMirror-focused"),
t.domObserver.start(),
n.relatedTarget &&
t.dom.contains(n.relatedTarget) &&
t.domObserver.currentSelection.clear(),
(t.focused = !1));
};
jn.beforeinput = (t, e) => {
if (Ci && ws && e.inputType == "deleteContentBackward") {
t.domObserver.flushSoon();
let { domChangeCount: r } = t.input;
setTimeout(() => {
if (
t.input.domChangeCount != r ||
(t.dom.blur(),
t.focus(),
t.someProp("handleKeyDown", (o) => o(t, p0(8, "Backspace"))))
)
return;
let { $cursor: i } = t.state.selection;
i &&
i.pos > 0 &&
t.dispatch(
t.state.tr.delete(i.pos - 1, i.pos).scrollIntoView()
);
}, 50);
}
};
for (let t in an) jn[t] = an[t];
function is(t, e) {
if (t == e) return !0;
for (let n in t) if (t[n] !== e[n]) return !1;
for (let n in e) if (!(n in t)) return !1;
return !0;
}
class Dl {
constructor(e, n) {
(this.toDOM = e),
(this.spec = n || fi),
(this.side = this.spec.side || 0);
}
map(e, n, r, i) {
let { pos: o, deleted: s } = e.mapResult(
n.from + i,
this.side < 0 ? -1 : 1
);
return s ? null : new Xt(o - r, o - r, this);
}
valid() {
return !0;
}
eq(e) {
return (
this == e ||
(e instanceof Dl &&
((this.spec.key && this.spec.key == e.spec.key) ||
(this.toDOM == e.toDOM && is(this.spec, e.spec))))
);
}
destroy(e) {
this.spec.destroy && this.spec.destroy(e);
}
}
class Pr {
constructor(e, n) {
(this.attrs = e), (this.spec = n || fi);
}
map(e, n, r, i) {
let o = e.map(n.from + i, this.spec.inclusiveStart ? -1 : 1) - r,
s = e.map(n.to + i, this.spec.inclusiveEnd ? 1 : -1) - r;
return o >= s ? null : new Xt(o, s, this);
}
valid(e, n) {
return n.from < n.to;
}
eq(e) {
return (
this == e ||
(e instanceof Pr &&
is(this.attrs, e.attrs) &&
is(this.spec, e.spec))
);
}
static is(e) {
return e.type instanceof Pr;
}
destroy() {}
}
class uf {
constructor(e, n) {
(this.attrs = e), (this.spec = n || fi);
}
map(e, n, r, i) {
let o = e.mapResult(n.from + i, 1);
if (o.deleted) return null;
let s = e.mapResult(n.to + i, -1);
return s.deleted || s.pos <= o.pos
? null
: new Xt(o.pos - r, s.pos - r, this);
}
valid(e, n) {
let { index: r, offset: i } = e.content.findIndex(n.from),
o;
return (
i == n.from && !(o = e.child(r)).isText && i + o.nodeSize == n.to
);
}
eq(e) {
return (
this == e ||
(e instanceof uf &&
is(this.attrs, e.attrs) &&
is(this.spec, e.spec))
);
}
destroy() {}
}
class Xt {
constructor(e, n, r) {
(this.from = e), (this.to = n), (this.type = r);
}
copy(e, n) {
return new Xt(e, n, this.type);
}
eq(e, n = 0) {
return (
this.type.eq(e.type) &&
this.from + n == e.from &&
this.to + n == e.to
);
}
map(e, n, r) {
return this.type.map(e, this, n, r);
}
static widget(e, n, r) {
return new Xt(e, e, new Dl(n, r));
}
static inline(e, n, r, i) {
return new Xt(e, n, new Pr(r, i));
}
static node(e, n, r, i) {
return new Xt(e, n, new uf(r, i));
}
get spec() {
return this.type.spec;
}
get inline() {
return this.type instanceof Pr;
}
get widget() {
return this.type instanceof Dl;
}
}
const Pi = [],
fi = {};
class st {
constructor(e, n) {
(this.local = e.length ? e : Pi), (this.children = n.length ? n : Pi);
}
static create(e, n) {
return n.length ? Il(n, e, 0, fi) : Jt;
}
find(e, n, r) {
let i = [];
return (
this.findInner(e == null ? 0 : e, n == null ? 1e9 : n, i, 0, r), i
);
}
findInner(e, n, r, i, o) {
for (let s = 0; s < this.local.length; s++) {
let l = this.local[s];
l.from <= n &&
l.to >= e &&
(!o || o(l.spec)) &&
r.push(l.copy(l.from + i, l.to + i));
}
for (let s = 0; s < this.children.length; s += 3)
if (this.children[s] < n && this.children[s + 1] > e) {
let l = this.children[s] + 1;
this.children[s + 2].findInner(e - l, n - l, r, i + l, o);
}
}
map(e, n, r) {
return this == Jt || e.maps.length == 0
? this
: this.mapInner(e, n, 0, 0, r || fi);
}
mapInner(e, n, r, i, o) {
let s;
for (let l = 0; l < this.local.length; l++) {
let a = this.local[l].map(e, r, i);
a && a.type.valid(n, a)
? (s || (s = [])).push(a)
: o.onRemove && o.onRemove(this.local[l].spec);
}
return this.children.length
? YC(this.children, s || [], e, n, r, i, o)
: s
? new st(s.sort(hi), Pi)
: Jt;
}
add(e, n) {
return n.length
? this == Jt
? st.create(e, n)
: this.addInner(e, n, 0)
: this;
}
addInner(e, n, r) {
let i,
o = 0;
e.forEach((l, a) => {
let u = a + r,
c;
if (!!(c = N0(n, l, u))) {
for (
i || (i = this.children.slice());
o < i.length && i[o] < a;
)
o += 3;
i[o] == a
? (i[o + 2] = i[o + 2].addInner(l, c, u + 1))
: i.splice(o, 0, a, a + l.nodeSize, Il(c, l, u + 1, fi)),
(o += 3);
}
});
let s = P0(o ? j0(n) : n, -r);
for (let l = 0; l < s.length; l++)
s[l].type.valid(e, s[l]) || s.splice(l--, 1);
return new st(
s.length ? this.local.concat(s).sort(hi) : this.local,
i || this.children
);
}
remove(e) {
return e.length == 0 || this == Jt ? this : this.removeInner(e, 0);
}
removeInner(e, n) {
let r = this.children,
i = this.local;
for (let o = 0; o < r.length; o += 3) {
let s,
l = r[o] + n,
a = r[o + 1] + n;
for (let c = 0, f; c < e.length; c++)
(f = e[c]) &&
f.from > l &&
f.to < a &&
((e[c] = null), (s || (s = [])).push(f));
if (!s) continue;
r == this.children && (r = this.children.slice());
let u = r[o + 2].removeInner(s, l + 1);
u != Jt ? (r[o + 2] = u) : (r.splice(o, 3), (o -= 3));
}
if (i.length) {
for (let o = 0, s; o < e.length; o++)
if ((s = e[o]))
for (let l = 0; l < i.length; l++)
i[l].eq(s, n) &&
(i == this.local && (i = this.local.slice()),
i.splice(l--, 1));
}
return r == this.children && i == this.local
? this
: i.length || r.length
? new st(i, r)
: Jt;
}
forChild(e, n) {
if (this == Jt) return this;
if (n.isLeaf) return st.empty;
let r, i;
for (let l = 0; l < this.children.length; l += 3)
if (this.children[l] >= e) {
this.children[l] == e && (r = this.children[l + 2]);
break;
}
let o = e + 1,
s = o + n.content.size;
for (let l = 0; l < this.local.length; l++) {
let a = this.local[l];
if (a.from < s && a.to > o && a.type instanceof Pr) {
let u = Math.max(o, a.from) - o,
c = Math.min(s, a.to) - o;
u < c && (i || (i = [])).push(a.copy(u, c));
}
}
if (i) {
let l = new st(i.sort(hi), Pi);
return r ? new ei([l, r]) : l;
}
return r || Jt;
}
eq(e) {
if (this == e) return !0;
if (
!(e instanceof st) ||
this.local.length != e.local.length ||
this.children.length != e.children.length
)
return !1;
for (let n = 0; n < this.local.length; n++)
if (!this.local[n].eq(e.local[n])) return !1;
for (let n = 0; n < this.children.length; n += 3)
if (
this.children[n] != e.children[n] ||
this.children[n + 1] != e.children[n + 1] ||
!this.children[n + 2].eq(e.children[n + 2])
)
return !1;
return !0;
}
locals(e) {
return cf(this.localsInner(e));
}
localsInner(e) {
if (this == Jt) return Pi;
if (e.inlineContent || !this.local.some(Pr.is)) return this.local;
let n = [];
for (let r = 0; r < this.local.length; r++)
this.local[r].type instanceof Pr || n.push(this.local[r]);
return n;
}
}
st.empty = new st([], []);
st.removeOverlap = cf;
const Jt = st.empty;
class ei {
constructor(e) {
this.members = e;
}
map(e, n) {
const r = this.members.map((i) => i.map(e, n, fi));
return ei.from(r);
}
forChild(e, n) {
if (n.isLeaf) return st.empty;
let r = [];
for (let i = 0; i < this.members.length; i++) {
let o = this.members[i].forChild(e, n);
o != Jt &&
(o instanceof ei ? (r = r.concat(o.members)) : r.push(o));
}
return ei.from(r);
}
eq(e) {
if (!(e instanceof ei) || e.members.length != this.members.length)
return !1;
for (let n = 0; n < this.members.length; n++)
if (!this.members[n].eq(e.members[n])) return !1;
return !0;
}
locals(e) {
let n,
r = !0;
for (let i = 0; i < this.members.length; i++) {
let o = this.members[i].localsInner(e);
if (!!o.length)
if (!n) n = o;
else {
r && ((n = n.slice()), (r = !1));
for (let s = 0; s < o.length; s++) n.push(o[s]);
}
}
return n ? cf(r ? n : n.sort(hi)) : Pi;
}
static from(e) {
switch (e.length) {
case 0:
return Jt;
case 1:
return e[0];
default:
return new ei(
e.every((n) => n instanceof st)
? e
: e.reduce(
(n, r) =>
n.concat(r instanceof st ? r : r.members),
[]
)
);
}
}
}
function YC(t, e, n, r, i, o, s) {
let l = t.slice();
for (let u = 0, c = o; u < n.maps.length; u++) {
let f = 0;
n.maps[u].forEach((h, p, g, v) => {
let b = v - g - (p - h);
for (let x = 0; x < l.length; x += 3) {
let S = l[x + 1];
if (S < 0 || h > S + c - f) continue;
let T = l[x] + c - f;
p >= T
? (l[x + 1] = h <= T ? -2 : -1)
: g >= i && b && ((l[x] += b), (l[x + 1] += b));
}
f += b;
}),
(c = n.maps[u].map(c, -1));
}
let a = !1;
for (let u = 0; u < l.length; u += 3)
if (l[u + 1] < 0) {
if (l[u + 1] == -2) {
(a = !0), (l[u + 1] = -1);
continue;
}
let c = n.map(t[u] + o),
f = c - i;
if (f < 0 || f >= r.content.size) {
a = !0;
continue;
}
let h = n.map(t[u + 1] + o, -1),
p = h - i,
{ index: g, offset: v } = r.content.findIndex(f),
b = r.maybeChild(g);
if (b && v == f && v + b.nodeSize == p) {
let x = l[u + 2].mapInner(n, b, c + 1, t[u] + o + 1, s);
x != Jt
? ((l[u] = f), (l[u + 1] = p), (l[u + 2] = x))
: ((l[u + 1] = -2), (a = !0));
} else a = !0;
}
if (a) {
let u = QC(l, t, e, n, i, o, s),
c = Il(u, r, 0, s);
e = c.local;
for (let f = 0; f < l.length; f += 3)
l[f + 1] < 0 && (l.splice(f, 3), (f -= 3));
for (let f = 0, h = 0; f < c.children.length; f += 3) {
let p = c.children[f];
for (; h < l.length && l[h] < p; ) h += 3;
l.splice(h, 0, c.children[f], c.children[f + 1], c.children[f + 2]);
}
}
return new st(e.sort(hi), l);
}
function P0(t, e) {
if (!e || !t.length) return t;
let n = [];
for (let r = 0; r < t.length; r++) {
let i = t[r];
n.push(new Xt(i.from + e, i.to + e, i.type));
}
return n;
}
function QC(t, e, n, r, i, o, s) {
function l(a, u) {
for (let c = 0; c < a.local.length; c++) {
let f = a.local[c].map(r, i, u);
f ? n.push(f) : s.onRemove && s.onRemove(a.local[c].spec);
}
for (let c = 0; c < a.children.length; c += 3)
l(a.children[c + 2], a.children[c] + u + 1);
}
for (let a = 0; a < t.length; a += 3)
t[a + 1] == -1 && l(t[a + 2], e[a] + o + 1);
return n;
}
function N0(t, e, n) {
if (e.isLeaf) return null;
let r = n + e.nodeSize,
i = null;
for (let o = 0, s; o < t.length; o++)
(s = t[o]) &&
s.from > n &&
s.to < r &&
((i || (i = [])).push(s), (t[o] = null));
return i;
}
function j0(t) {
let e = [];
for (let n = 0; n < t.length; n++) t[n] != null && e.push(t[n]);
return e;
}
function Il(t, e, n, r) {
let i = [],
o = !1;
e.forEach((l, a) => {
let u = N0(t, l, a + n);
if (u) {
o = !0;
let c = Il(u, l, n + a + 1, r);
c != Jt && i.push(a, a + l.nodeSize, c);
}
});
let s = P0(o ? j0(t) : t, -n).sort(hi);
for (let l = 0; l < s.length; l++)
s[l].type.valid(e, s[l]) ||
(r.onRemove && r.onRemove(s[l].spec), s.splice(l--, 1));
return s.length || i.length ? new st(s, i) : Jt;
}
function hi(t, e) {
return t.from - e.from || t.to - e.to;
}
function cf(t) {
let e = t;
for (let n = 0; n < e.length - 1; n++) {
let r = e[n];
if (r.from != r.to)
for (let i = n + 1; i < e.length; i++) {
let o = e[i];
if (o.from == r.from) {
o.to != r.to &&
(e == t && (e = t.slice()),
(e[i] = o.copy(o.from, r.to)),
Pp(e, i + 1, o.copy(r.to, o.to)));
continue;
} else {
o.from < r.to &&
(e == t && (e = t.slice()),
(e[n] = r.copy(r.from, o.from)),
Pp(e, i, r.copy(o.from, r.to)));
break;
}
}
}
return e;
}
function Pp(t, e, n) {
for (; e < t.length && hi(n, t[e]) > 0; ) e++;
t.splice(e, 0, n);
}
const xR = co && nf <= 11;
var Lr = {
8: "Backspace",
9: "Tab",
10: "Enter",
12: "NumLock",
13: "Enter",
16: "Shift",
17: "Control",
18: "Alt",
20: "CapsLock",
27: "Escape",
32: " ",
33: "PageUp",
34: "PageDown",
35: "End",
36: "Home",
37: "ArrowLeft",
38: "ArrowUp",
39: "ArrowRight",
40: "ArrowDown",
44: "PrintScreen",
45: "Insert",
46: "Delete",
59: ";",
61: "=",
91: "Meta",
92: "Meta",
106: "*",
107: "+",
108: ",",
109: "-",
110: ".",
111: "/",
144: "NumLock",
145: "ScrollLock",
160: "Shift",
161: "Shift",
162: "Control",
163: "Control",
164: "Alt",
165: "Alt",
173: "-",
186: ";",
187: "=",
188: ",",
189: "-",
190: ".",
191: "/",
192: "`",
219: "[",
220: "\\",
221: "]",
222: "'",
},
Bl = {
48: ")",
49: "!",
50: "@",
51: "#",
52: "$",
53: "%",
54: "^",
55: "&",
56: "*",
57: "(",
59: ":",
61: "+",
173: "_",
186: ":",
187: "+",
188: "<",
189: "_",
190: ">",
191: "?",
192: "~",
219: "{",
220: "|",
221: "}",
222: '"',
},
XC = typeof navigator != "undefined" && /Mac/.test(navigator.platform),
ZC =
typeof navigator != "undefined" &&
/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(
navigator.userAgent
);
for (var Lt = 0; Lt < 10; Lt++) Lr[48 + Lt] = Lr[96 + Lt] = String(Lt);
for (var Lt = 1; Lt <= 24; Lt++) Lr[Lt + 111] = "F" + Lt;
for (var Lt = 65; Lt <= 90; Lt++)
(Lr[Lt] = String.fromCharCode(Lt + 32)), (Bl[Lt] = String.fromCharCode(Lt));
for (var Au in Lr) Bl.hasOwnProperty(Au) || (Bl[Au] = Lr[Au]);
function eS(t) {
var e =
(XC && t.metaKey && t.shiftKey && !t.ctrlKey && !t.altKey) ||
(ZC && t.shiftKey && t.key && t.key.length == 1) ||
t.key == "Unidentified",
n =
(!e && t.key) ||
(t.shiftKey ? Bl : Lr)[t.keyCode] ||
t.key ||
"Unidentified";
return (
n == "Esc" && (n = "Escape"),
n == "Del" && (n = "Delete"),
n == "Left" && (n = "ArrowLeft"),
n == "Up" && (n = "ArrowUp"),
n == "Right" && (n = "ArrowRight"),
n == "Down" && (n = "ArrowDown"),
n
);
}
const tS =
typeof navigator != "undefined"
? /Mac|iP(hone|[oa]d)/.test(navigator.platform)
: !1;
function nS(t) {
let e = t.split(/-(?!$)/),
n = e[e.length - 1];
n == "Space" && (n = " ");
let r, i, o, s;
for (let l = 0; l < e.length - 1; l++) {
let a = e[l];
if (/^(cmd|meta|m)$/i.test(a)) s = !0;
else if (/^a(lt)?$/i.test(a)) r = !0;
else if (/^(c|ctrl|control)$/i.test(a)) i = !0;
else if (/^s(hift)?$/i.test(a)) o = !0;
else if (/^mod$/i.test(a)) tS ? (s = !0) : (i = !0);
else throw new Error("Unrecognized modifier name: " + a);
}
return (
r && (n = "Alt-" + n),
i && (n = "Ctrl-" + n),
s && (n = "Meta-" + n),
o && (n = "Shift-" + n),
n
);
}
function rS(t) {
let e = Object.create(null);
for (let n in t) e[nS(n)] = t[n];
return e;
}
function Tu(t, e, n = !0) {
return (
e.altKey && (t = "Alt-" + t),
e.ctrlKey && (t = "Ctrl-" + t),
e.metaKey && (t = "Meta-" + t),
n && e.shiftKey && (t = "Shift-" + t),
t
);
}
function L0(t) {
let e = rS(t);
return function (n, r) {
let i = eS(r),
o,
s = e[Tu(i, r)];
if (s && s(n.state, n.dispatch, n)) return !0;
if (i.length == 1 && i != " ") {
if (r.shiftKey) {
let l = e[Tu(i, r, !1)];
if (l && l(n.state, n.dispatch, n)) return !0;
}
if (
(r.shiftKey ||
r.altKey ||
r.metaKey ||
i.charCodeAt(0) > 127) &&
(o = Lr[r.keyCode]) &&
o != i
) {
let l = e[Tu(o, r)];
if (l && l(n.state, n.dispatch, n)) return !0;
}
}
return !1;
};
}
const iS = (t, e) =>
t.selection.empty
? !1
: (e && e(t.tr.deleteSelection().scrollIntoView()), !0);
function oS(t, e) {
let { $cursor: n } = t.selection;
return !n || (e ? !e.endOfTextblock("backward", t) : n.parentOffset > 0)
? null
: n;
}
const sS = (t, e, n) => {
let r = oS(t, n);
if (!r) return !1;
let i = D0(r);
if (!i) {
let s = r.blockRange(),
l = s && uo(s);
return l == null ? !1 : (e && e(t.tr.lift(s, l).scrollIntoView()), !0);
}
let o = i.nodeBefore;
if (!o.type.spec.isolating && $0(t, i, e)) return !0;
if (r.parent.content.size == 0 && (no(o, "end") || ve.isSelectable(o))) {
let s = Zd(t.doc, r.before(), r.after(), ie.empty);
if (s && s.slice.size < s.to - s.from) {
if (e) {
let l = t.tr.step(s);
l.setSelection(
no(o, "end")
? Se.findFrom(
l.doc.resolve(l.mapping.map(i.pos, -1)),
-1
)
: ve.create(l.doc, i.pos - o.nodeSize)
),
e(l.scrollIntoView());
}
return !0;
}
}
return o.isAtom && i.depth == r.depth - 1
? (e && e(t.tr.delete(i.pos - o.nodeSize, i.pos).scrollIntoView()), !0)
: !1;
};
function no(t, e, n = !1) {
for (let r = t; r; r = e == "start" ? r.firstChild : r.lastChild) {
if (r.isTextblock) return !0;
if (n && r.childCount != 1) return !1;
}
return !1;
}
const lS = (t, e, n) => {
let { $head: r, empty: i } = t.selection,
o = r;
if (!i) return !1;
if (r.parent.isTextblock) {
if (n ? !n.endOfTextblock("backward", t) : r.parentOffset > 0)
return !1;
o = D0(r);
}
let s = o && o.nodeBefore;
return !s || !ve.isSelectable(s)
? !1
: (e &&
e(
t.tr
.setSelection(ve.create(t.doc, o.pos - s.nodeSize))
.scrollIntoView()
),
!0);
};
function D0(t) {
if (!t.parent.type.spec.isolating)
for (let e = t.depth - 1; e >= 0; e--) {
if (t.index(e) > 0) return t.doc.resolve(t.before(e + 1));
if (t.node(e).type.spec.isolating) break;
}
return null;
}
function aS(t, e) {
let { $cursor: n } = t.selection;
return !n ||
(e
? !e.endOfTextblock("forward", t)
: n.parentOffset < n.parent.content.size)
? null
: n;
}
const uS = (t, e, n) => {
let r = aS(t, n);
if (!r) return !1;
let i = I0(r);
if (!i) return !1;
let o = i.nodeAfter;
if ($0(t, i, e)) return !0;
if (
r.parent.content.size == 0 &&
(no(o, "start") || ve.isSelectable(o))
) {
let s = Zd(t.doc, r.before(), r.after(), ie.empty);
if (s && s.slice.size < s.to - s.from) {
if (e) {
let l = t.tr.step(s);
l.setSelection(
no(o, "start")
? Se.findFrom(
l.doc.resolve(l.mapping.map(i.pos)),
1
)
: ve.create(l.doc, l.mapping.map(i.pos))
),
e(l.scrollIntoView());
}
return !0;
}
}
return o.isAtom && i.depth == r.depth - 1
? (e && e(t.tr.delete(i.pos, i.pos + o.nodeSize).scrollIntoView()),
!0)
: !1;
},
cS = (t, e, n) => {
let { $head: r, empty: i } = t.selection,
o = r;
if (!i) return !1;
if (r.parent.isTextblock) {
if (
n
? !n.endOfTextblock("forward", t)
: r.parentOffset < r.parent.content.size
)
return !1;
o = I0(r);
}
let s = o && o.nodeAfter;
return !s || !ve.isSelectable(s)
? !1
: (e &&
e(
t.tr
.setSelection(ve.create(t.doc, o.pos))
.scrollIntoView()
),
!0);
};
function I0(t) {
if (!t.parent.type.spec.isolating)
for (let e = t.depth - 1; e >= 0; e--) {
let n = t.node(e);
if (t.index(e) + 1 < n.childCount)
return t.doc.resolve(t.after(e + 1));
if (n.type.spec.isolating) break;
}
return null;
}
const dS = (t, e) => {
let n = t.selection,
r = n instanceof ve,
i;
if (r) {
if (n.node.isTextblock || !$r(t.doc, n.from)) return !1;
i = n.from;
} else if (((i = Ha(t.doc, n.from, -1)), i == null)) return !1;
if (e) {
let o = t.tr.join(i);
r &&
o.setSelection(
ve.create(o.doc, i - t.doc.resolve(i).nodeBefore.nodeSize)
),
e(o.scrollIntoView());
}
return !0;
},
fS = (t, e) => {
let n = t.selection,
r;
if (n instanceof ve) {
if (n.node.isTextblock || !$r(t.doc, n.to)) return !1;
r = n.to;
} else if (((r = Ha(t.doc, n.to, 1)), r == null)) return !1;
return e && e(t.tr.join(r).scrollIntoView()), !0;
},
hS = (t, e) => {
let { $from: n, $to: r } = t.selection,
i = n.blockRange(r),
o = i && uo(i);
return o == null ? !1 : (e && e(t.tr.lift(i, o).scrollIntoView()), !0);
},
pS = (t, e) => {
let { $head: n, $anchor: r } = t.selection;
return !n.parent.type.spec.code || !n.sameParent(r)
? !1
: (e &&
e(
t.tr
.insertText(
`
`
)
.scrollIntoView()
),
!0);
};
function B0(t) {
for (let e = 0; e < t.edgeCount; e++) {
let { type: n } = t.edge(e);
if (n.isTextblock && !n.hasRequiredAttrs()) return n;
}
return null;
}
const mS = (t, e) => {
let { $head: n, $anchor: r } = t.selection;
if (!n.parent.type.spec.code || !n.sameParent(r)) return !1;
let i = n.node(-1),
o = n.indexAfter(-1),
s = B0(i.contentMatchAt(o));
if (!s || !i.canReplaceWith(o, o, s)) return !1;
if (e) {
let l = n.after(),
a = t.tr.replaceWith(l, l, s.createAndFill());
a.setSelection(Se.near(a.doc.resolve(l), 1)), e(a.scrollIntoView());
}
return !0;
},
gS = (t, e) => {
let n = t.selection,
{ $from: r, $to: i } = n;
if (n instanceof Rn || r.parent.inlineContent || i.parent.inlineContent)
return !1;
let o = B0(i.parent.contentMatchAt(i.indexAfter()));
if (!o || !o.isTextblock) return !1;
if (e) {
let s = (!r.parentOffset && i.index() < i.parent.childCount ? r : i)
.pos,
l = t.tr.insert(s, o.createAndFill());
l.setSelection(Ce.create(l.doc, s + 1)), e(l.scrollIntoView());
}
return !0;
},
yS = (t, e) => {
let { $cursor: n } = t.selection;
if (!n || n.parent.content.size) return !1;
if (n.depth > 1 && n.after() != n.end(-1)) {
let o = n.before();
if (zi(t.doc, o)) return e && e(t.tr.split(o).scrollIntoView()), !0;
}
let r = n.blockRange(),
i = r && uo(r);
return i == null ? !1 : (e && e(t.tr.lift(r, i).scrollIntoView()), !0);
},
vS = (t, e) => {
let { $from: n, to: r } = t.selection,
i,
o = n.sharedDepth(r);
return o == 0
? !1
: ((i = n.before(o)),
e && e(t.tr.setSelection(ve.create(t.doc, i))),
!0);
};
function bS(t, e, n) {
let r = e.nodeBefore,
i = e.nodeAfter,
o = e.index();
return !r || !i || !r.type.compatibleContent(i.type)
? !1
: !r.content.size && e.parent.canReplace(o - 1, o)
? (n && n(t.tr.delete(e.pos - r.nodeSize, e.pos).scrollIntoView()), !0)
: !e.parent.canReplace(o, o + 1) || !(i.isTextblock || $r(t.doc, e.pos))
? !1
: (n &&
n(
t.tr
.clearIncompatible(
e.pos,
r.type,
r.contentMatchAt(r.childCount)
)
.join(e.pos)
.scrollIntoView()
),
!0);
}
function $0(t, e, n) {
let r = e.nodeBefore,
i = e.nodeAfter,
o,
s;
if (r.type.spec.isolating || i.type.spec.isolating) return !1;
if (bS(t, e, n)) return !0;
let l = e.parent.canReplace(e.index(), e.index() + 1);
if (
l &&
(o = (s = r.contentMatchAt(r.childCount)).findWrapping(i.type)) &&
s.matchType(o[0] || i.type).validEnd
) {
if (n) {
let f = e.pos + i.nodeSize,
h = Y.empty;
for (let v = o.length - 1; v >= 0; v--)
h = Y.from(o[v].create(null, h));
h = Y.from(r.copy(h));
let p = t.tr.step(
new Pt(
e.pos - 1,
f,
e.pos,
f,
new ie(h, 1, 0),
o.length,
!0
)
),
g = f + 2 * o.length;
$r(p.doc, g) && p.join(g), n(p.scrollIntoView());
}
return !0;
}
let a = Se.findFrom(e, 1),
u = a && a.$from.blockRange(a.$to),
c = u && uo(u);
if (c != null && c >= e.depth)
return n && n(t.tr.lift(u, c).scrollIntoView()), !0;
if (l && no(i, "start", !0) && no(r, "end")) {
let f = r,
h = [];
for (; h.push(f), !f.isTextblock; ) f = f.lastChild;
let p = i,
g = 1;
for (; !p.isTextblock; p = p.firstChild) g++;
if (f.canReplace(f.childCount, f.childCount, p.content)) {
if (n) {
let v = Y.empty;
for (let x = h.length - 1; x >= 0; x--)
v = Y.from(h[x].copy(v));
let b = t.tr.step(
new Pt(
e.pos - h.length,
e.pos + i.nodeSize,
e.pos + g,
e.pos + i.nodeSize - g,
new ie(v, h.length, 0),
0,
!0
)
);
n(b.scrollIntoView());
}
return !0;
}
}
return !1;
}
function z0(t) {
return function (e, n) {
let r = e.selection,
i = t < 0 ? r.$from : r.$to,
o = i.depth;
for (; i.node(o).isInline; ) {
if (!o) return !1;
o--;
}
return i.node(o).isTextblock
? (n &&
n(
e.tr.setSelection(
Ce.create(e.doc, t < 0 ? i.start(o) : i.end(o))
)
),
!0)
: !1;
};
}
const wS = z0(-1),
xS = z0(1);
function kS(t, e = null) {
return function (n, r) {
let { $from: i, $to: o } = n.selection,
s = i.blockRange(o),
l = s && Xd(s, t, e);
return l ? (r && r(n.tr.wrap(s, l).scrollIntoView()), !0) : !1;
};
}
function Np(t, e = null) {
return function (n, r) {
let i = !1;
for (let o = 0; o < n.selection.ranges.length && !i; o++) {
let {
$from: { pos: s },
$to: { pos: l },
} = n.selection.ranges[o];
n.doc.nodesBetween(s, l, (a, u) => {
if (i) return !1;
if (!(!a.isTextblock || a.hasMarkup(t, e)))
if (a.type == t) i = !0;
else {
let c = n.doc.resolve(u),
f = c.index();
i = c.parent.canReplaceWith(f, f + 1, t);
}
});
}
if (!i) return !1;
if (r) {
let o = n.tr;
for (let s = 0; s < n.selection.ranges.length; s++) {
let {
$from: { pos: l },
$to: { pos: a },
} = n.selection.ranges[s];
o.setBlockType(l, a, t, e);
}
r(o.scrollIntoView());
}
return !0;
};
}
typeof navigator != "undefined"
? /Mac|iP(hone|[oa]d)/.test(navigator.platform)
: typeof os != "undefined" && os.platform && os.platform() == "darwin";
function CS(t, e = null) {
return function (n, r) {
let { $from: i, $to: o } = n.selection,
s = i.blockRange(o),
l = !1,
a = s;
if (!s) return !1;
if (
s.depth >= 2 &&
i.node(s.depth - 1).type.compatibleContent(t) &&
s.startIndex == 0
) {
if (i.index(s.depth - 1) == 0) return !1;
let c = n.doc.resolve(s.start - 2);
(a = new Tl(c, c, s.depth)),
s.endIndex < s.parent.childCount &&
(s = new Tl(i, n.doc.resolve(o.end(s.depth)), s.depth)),
(l = !0);
}
let u = Xd(a, t, e, s);
return u ? (r && r(SS(n.tr, s, u, l, t).scrollIntoView()), !0) : !1;
};
}
function SS(t, e, n, r, i) {
let o = Y.empty;
for (let c = n.length - 1; c >= 0; c--)
o = Y.from(n[c].type.create(n[c].attrs, o));
t.step(
new Pt(
e.start - (r ? 2 : 0),
e.end,
e.start,
e.end,
new ie(o, 0, 0),
n.length,
!0
)
);
let s = 0;
for (let c = 0; c < n.length; c++) n[c].type == i && (s = c + 1);
let l = n.length - s,
a = e.start + n.length - (r ? 2 : 0),
u = e.parent;
for (let c = e.startIndex, f = e.endIndex, h = !0; c < f; c++, h = !1)
!h && zi(t.doc, a, l) && (t.split(a, l), (a += 2 * l)),
(a += u.child(c).nodeSize);
return t;
}
function _S(t) {
return function (e, n) {
let { $from: r, $to: i } = e.selection,
o = r.blockRange(
i,
(s) => s.childCount > 0 && s.firstChild.type == t
);
return o
? n
? r.node(o.depth - 1).type == t
? MS(e, n, t, o)
: ES(e, n, o)
: !0
: !1;
};
}
function MS(t, e, n, r) {
let i = t.tr,
o = r.end,
s = r.$to.end(r.depth);
o < s &&
(i.step(
new Pt(
o - 1,
s,
o,
s,
new ie(Y.from(n.create(null, r.parent.copy())), 1, 0),
1,
!0
)
),
(r = new Tl(i.doc.resolve(r.$from.pos), i.doc.resolve(s), r.depth)));
const l = uo(r);
if (l == null) return !1;
i.lift(r, l);
let a = i.mapping.map(o, -1) - 1;
return $r(i.doc, a) && i.join(a), e(i.scrollIntoView()), !0;
}
function ES(t, e, n) {
let r = t.tr,
i = n.parent;
for (let p = n.end, g = n.endIndex - 1, v = n.startIndex; g > v; g--)
(p -= i.child(g).nodeSize), r.delete(p - 1, p + 1);
let o = r.doc.resolve(n.start),
s = o.nodeAfter;
if (r.mapping.map(n.end) != n.start + o.nodeAfter.nodeSize) return !1;
let l = n.startIndex == 0,
a = n.endIndex == i.childCount,
u = o.node(-1),
c = o.index(-1);
if (
!u.canReplace(
c + (l ? 0 : 1),
c + 1,
s.content.append(a ? Y.empty : Y.from(i))
)
)
return !1;
let f = o.pos,
h = f + s.nodeSize;
return (
r.step(
new Pt(
f - (l ? 1 : 0),
h + (a ? 1 : 0),
f + 1,
h - 1,
new ie(
(l ? Y.empty : Y.from(i.copy(Y.empty))).append(
a ? Y.empty : Y.from(i.copy(Y.empty))
),
l ? 0 : 1,
a ? 0 : 1
),
l ? 0 : 1
)
),
e(r.scrollIntoView()),
!0
);
}
function AS(t) {
return function (e, n) {
let { $from: r, $to: i } = e.selection,
o = r.blockRange(
i,
(u) => u.childCount > 0 && u.firstChild.type == t
);
if (!o) return !1;
let s = o.startIndex;
if (s == 0) return !1;
let l = o.parent,
a = l.child(s - 1);
if (a.type != t) return !1;
if (n) {
let u = a.lastChild && a.lastChild.type == l.type,
c = Y.from(u ? t.create() : null),
f = new ie(
Y.from(t.create(null, Y.from(l.type.create(null, c)))),
u ? 3 : 1,
0
),
h = o.start,
p = o.end;
n(
e.tr
.step(new Pt(h - (u ? 3 : 1), p, h, p, f, 1, !0))
.scrollIntoView()
);
}
return !0;
};
}
function H0(t) {
const { state: e, transaction: n } = t;
let { selection: r } = n,
{ doc: i } = n,
{ storedMarks: o } = n;
return be(W({}, e), {
apply: e.apply.bind(e),
applyTransaction: e.applyTransaction.bind(e),
filterTransaction: e.filterTransaction,
plugins: e.plugins,
schema: e.schema,
reconfigure: e.reconfigure.bind(e),
toJSON: e.toJSON.bind(e),
get storedMarks() {
return o;
},
get selection() {
return r;
},
get doc() {
return i;
},
get tr() {
return (r = n.selection), (i = n.doc), (o = n.storedMarks), n;
},
});
}
class TS {
constructor(e) {
(this.editor = e.editor),
(this.rawCommands = this.editor.extensionManager.commands),
(this.customState = e.state);
}
get hasCustomState() {
return !!this.customState;
}
get state() {
return this.customState || this.editor.state;
}
get commands() {
const { rawCommands: e, editor: n, state: r } = this,
{ view: i } = n,
{ tr: o } = r,
s = this.buildProps(o);
return Object.fromEntries(
Object.entries(e).map(([l, a]) => [
l,
(...c) => {
const f = a(...c)(s);
return (
!o.getMeta("preventDispatch") &&
!this.hasCustomState &&
i.dispatch(o),
f
);
},
])
);
}
get chain() {
return () => this.createChain();
}
get can() {
return () => this.createCan();
}
createChain(e, n = !0) {
const { rawCommands: r, editor: i, state: o } = this,
{ view: s } = i,
l = [],
a = !!e,
u = e || o.tr,
c = () => (
!a &&
n &&
!u.getMeta("preventDispatch") &&
!this.hasCustomState &&
s.dispatch(u),
l.every((h) => h === !0)
),
f = be(
W(
{},
Object.fromEntries(
Object.entries(r).map(([h, p]) => [
h,
(...v) => {
const b = this.buildProps(u, n),
x = p(...v)(b);
return l.push(x), f;
},
])
)
),
{ run: c }
);
return f;
}
createCan(e) {
const { rawCommands: n, state: r } = this,
i = !1,
o = e || r.tr,
s = this.buildProps(o, i),
l = Object.fromEntries(
Object.entries(n).map(([a, u]) => [
a,
(...c) => u(...c)(be(W({}, s), { dispatch: void 0 })),
])
);
return be(W({}, l), { chain: () => this.createChain(o, i) });
}
buildProps(e, n = !0) {
const { rawCommands: r, editor: i, state: o } = this,
{ view: s } = i,
l = {
tr: e,
editor: i,
view: s,
state: H0({ state: o, transaction: e }),
dispatch: n ? () => {} : void 0,
chain: () => this.createChain(e, n),
can: () => this.createCan(e),
get commands() {
return Object.fromEntries(
Object.entries(r).map(([a, u]) => [
a,
(...c) => u(...c)(l),
])
);
},
};
return l;
}
}
function bt(t, e, n) {
return t.config[e] === void 0 && t.parent
? bt(t.parent, e, n)
: typeof t.config[e] == "function"
? t.config[e].bind(
be(W({}, n), { parent: t.parent ? bt(t.parent, e, n) : null })
)
: t.config[e];
}
function OS(t) {
const e = t.filter((i) => i.type === "extension"),
n = t.filter((i) => i.type === "node"),
r = t.filter((i) => i.type === "mark");
return { baseExtensions: e, nodeExtensions: n, markExtensions: r };
}
function $t(t, e) {
if (typeof t == "string") {
if (!e.nodes[t])
throw Error(
`There is no node type named '${t}'. Maybe you forgot to add the extension?`
);
return e.nodes[t];
}
return t;
}
function et(...t) {
return t
.filter((e) => !!e)
.reduce((e, n) => {
const r = W({}, e);
return (
Object.entries(n).forEach(([i, o]) => {
if (!r[i]) {
r[i] = o;
return;
}
if (i === "class") {
const l = o ? o.split(" ") : [],
a = r[i] ? r[i].split(" ") : [],
u = l.filter((c) => !a.includes(c));
r[i] = [...a, ...u].join(" ");
} else
i === "style"
? (r[i] = [r[i], o].join("; "))
: (r[i] = o);
}),
r
);
}, {});
}
function RS(t) {
return typeof t == "function";
}
function lt(t, e = void 0, ...n) {
return RS(t) ? (e ? t.bind(e)(...n) : t(...n)) : t;
}
function PS(t) {
return Object.prototype.toString.call(t) === "[object RegExp]";
}
class xs {
constructor(e) {
(this.find = e.find), (this.handler = e.handler);
}
}
class NS {
constructor(e) {
(this.find = e.find), (this.handler = e.handler);
}
}
function jS(t) {
return Object.prototype.toString.call(t).slice(8, -1);
}
function Ou(t) {
return jS(t) !== "Object"
? !1
: t.constructor === Object &&
Object.getPrototypeOf(t) === Object.prototype;
}
function Ua(t, e) {
const n = W({}, t);
return (
Ou(t) &&
Ou(e) &&
Object.keys(e).forEach((r) => {
Ou(e[r])
? r in t
? (n[r] = Ua(t[r], e[r]))
: Object.assign(n, { [r]: e[r] })
: Object.assign(n, { [r]: e[r] });
}),
n
);
}
class Et {
constructor(e = {}) {
(this.type = "extension"),
(this.name = "extension"),
(this.parent = null),
(this.child = null),
(this.config = { name: this.name, defaultOptions: {} }),
(this.config = W(W({}, this.config), e)),
(this.name = this.config.name),
e.defaultOptions &&
console.warn(
`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`
),
(this.options = this.config.defaultOptions),
this.config.addOptions &&
(this.options = lt(
bt(this, "addOptions", { name: this.name })
)),
(this.storage =
lt(
bt(this, "addStorage", {
name: this.name,
options: this.options,
})
) || {});
}
static create(e = {}) {
return new Et(e);
}
configure(e = {}) {
const n = this.extend();
return (
(n.options = Ua(this.options, e)),
(n.storage = lt(
bt(n, "addStorage", { name: n.name, options: n.options })
)),
n
);
}
extend(e = {}) {
const n = new Et(e);
return (
(n.parent = this),
(this.child = n),
(n.name = e.name ? e.name : n.parent.name),
e.defaultOptions &&
console.warn(
`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`
),
(n.options = lt(bt(n, "addOptions", { name: n.name }))),
(n.storage = lt(
bt(n, "addStorage", { name: n.name, options: n.options })
)),
n
);
}
}
function LS(t, e, n) {
const { from: r, to: i } = e,
{
blockSeparator: o = `
`,
textSerializers: s = {},
} = n || {};
let l = "",
a = !0;
return (
t.nodesBetween(r, i, (u, c, f, h) => {
var p;
const g = s == null ? void 0 : s[u.type.name];
g
? (u.isBlock && !a && ((l += o), (a = !0)),
f &&
(l += g({
node: u,
pos: c,
parent: f,
index: h,
range: e,
})))
: u.isText
? ((l +=
(p = u == null ? void 0 : u.text) === null ||
p === void 0
? void 0
: p.slice(Math.max(r, c) - c, i - c)),
(a = !1))
: u.isBlock && !a && ((l += o), (a = !0));
}),
l
);
}
function DS(t) {
return Object.fromEntries(
Object.entries(t.nodes)
.filter(([, e]) => e.spec.toText)
.map(([e, n]) => [e, n.spec.toText])
);
}
const kR = Et.create({
name: "clipboardTextSerializer",
addProseMirrorPlugins() {
return [
new Tt({
key: new Ot("clipboardTextSerializer"),
props: {
clipboardTextSerializer: () => {
const { editor: t } = this,
{ state: e, schema: n } = t,
{ doc: r, selection: i } = e,
{ ranges: o } = i,
s = Math.min(...o.map((c) => c.$from.pos)),
l = Math.max(...o.map((c) => c.$to.pos)),
a = DS(n);
return LS(
r,
{ from: s, to: l },
{ textSerializers: a }
);
},
},
}),
];
},
}),
IS =
() =>
({ editor: t, view: e }) => (
requestAnimationFrame(() => {
var n;
t.isDestroyed ||
(e.dom.blur(),
(n = window == null ? void 0 : window.getSelection()) ===
null ||
n === void 0 ||
n.removeAllRanges());
}),
!0
),
BS =
(t = !1) =>
({ commands: e }) =>
e.setContent("", t),
$S =
() =>
({ state: t, tr: e, dispatch: n }) => {
const { selection: r } = e,
{ ranges: i } = r;
return (
n &&
i.forEach(({ $from: o, $to: s }) => {
t.doc.nodesBetween(o.pos, s.pos, (l, a) => {
if (l.type.isText) return;
const { doc: u, mapping: c } = e,
f = u.resolve(c.map(a)),
h = u.resolve(c.map(a + l.nodeSize)),
p = f.blockRange(h);
if (!p) return;
const g = uo(p);
if (l.type.isTextblock) {
const { defaultType: v } =
f.parent.contentMatchAt(f.index());
e.setNodeMarkup(p.start, v);
}
(g || g === 0) && e.lift(p, g);
});
}),
!0
);
},
zS = (t) => (e) => t(e),
HS =
() =>
({ state: t, dispatch: e }) =>
gS(t, e),
FS =
(t, e) =>
({ editor: n, tr: r }) => {
const { state: i } = n,
o = i.doc.slice(t.from, t.to);
r.deleteRange(t.from, t.to);
const s = r.mapping.map(e);
return (
r.insert(s, o.content),
r.setSelection(new Ce(r.doc.resolve(s - 1))),
!0
);
},
VS =
() =>
({ tr: t, dispatch: e }) => {
const { selection: n } = t,
r = n.$anchor.node();
if (r.content.size > 0) return !1;
const i = t.selection.$anchor;
for (let o = i.depth; o > 0; o -= 1)
if (i.node(o).type === r.type) {
if (e) {
const l = i.before(o),
a = i.after(o);
t.delete(l, a).scrollIntoView();
}
return !0;
}
return !1;
},
WS =
(t) =>
({ tr: e, state: n, dispatch: r }) => {
const i = $t(t, n.schema),
o = e.selection.$anchor;
for (let s = o.depth; s > 0; s -= 1)
if (o.node(s).type === i) {
if (r) {
const a = o.before(s),
u = o.after(s);
e.delete(a, u).scrollIntoView();
}
return !0;
}
return !1;
},
US =
(t) =>
({ tr: e, dispatch: n }) => {
const { from: r, to: i } = t;
return n && e.delete(r, i), !0;
},
KS =
() =>
({ state: t, dispatch: e }) =>
iS(t, e),
qS =
() =>
({ commands: t }) =>
t.keyboardShortcut("Enter"),
JS =
() =>
({ state: t, dispatch: e }) =>
mS(t, e);
function $l(t, e, n = { strict: !0 }) {
const r = Object.keys(e);
return r.length
? r.every((i) =>
n.strict
? e[i] === t[i]
: PS(e[i])
? e[i].test(t[i])
: e[i] === t[i]
)
: !0;
}
function jc(t, e, n = {}) {
return t.find((r) => r.type === e && $l(r.attrs, n));
}
function GS(t, e, n = {}) {
return !!jc(t, e, n);
}
function df(t, e, n = {}) {
if (!t || !e) return;
let r = t.parent.childAfter(t.parentOffset);
if (
(t.parentOffset === r.offset &&
r.offset !== 0 &&
(r = t.parent.childBefore(t.parentOffset)),
!r.node)
)
return;
const i = jc([...r.node.marks], e, n);
if (!i) return;
let o = r.index,
s = t.start() + r.offset,
l = o + 1,
a = s + r.node.nodeSize;
for (
jc([...r.node.marks], e, n);
o > 0 && i.isInSet(t.parent.child(o - 1).marks);
)
(o -= 1), (s -= t.parent.child(o).nodeSize);
for (; l < t.parent.childCount && GS([...t.parent.child(l).marks], e, n); )
(a += t.parent.child(l).nodeSize), (l += 1);
return { from: s, to: a };
}
function Hr(t, e) {
if (typeof t == "string") {
if (!e.marks[t])
throw Error(
`There is no mark type named '${t}'. Maybe you forgot to add the extension?`
);
return e.marks[t];
}
return t;
}
const YS =
(t, e = {}) =>
({ tr: n, state: r, dispatch: i }) => {
const o = Hr(t, r.schema),
{ doc: s, selection: l } = n,
{ $from: a, from: u, to: c } = l;
if (i) {
const f = df(a, o, e);
if (f && f.from <= u && f.to >= c) {
const h = Ce.create(s, f.from, f.to);
n.setSelection(h);
}
}
return !0;
},
QS = (t) => (e) => {
const n = typeof t == "function" ? t(e) : t;
for (let r = 0; r < n.length; r += 1) if (n[r](e)) return !0;
return !1;
};
function ff(t) {
return t instanceof Ce;
}
function ir(t = 0, e = 0, n = 0) {
return Math.min(Math.max(t, e), n);
}
function XS(t, e = null) {
if (!e) return null;
const n = Se.atStart(t),
r = Se.atEnd(t);
if (e === "start" || e === !0) return n;
if (e === "end") return r;
const i = n.from,
o = r.to;
return e === "all"
? Ce.create(t, ir(0, i, o), ir(t.content.size, i, o))
: Ce.create(t, ir(e, i, o), ir(e, i, o));
}
function hf() {
return (
[
"iPad Simulator",
"iPhone Simulator",
"iPod Simulator",
"iPad",
"iPhone",
"iPod",
].includes(navigator.platform) ||
(navigator.userAgent.includes("Mac") && "ontouchend" in document)
);
}
const ZS =
(t = null, e = {}) =>
({ editor: n, view: r, tr: i, dispatch: o }) => {
e = W({ scrollIntoView: !0 }, e);
const s = () => {
hf() && r.dom.focus(),
requestAnimationFrame(() => {
n.isDestroyed ||
(r.focus(),
e != null &&
e.scrollIntoView &&
n.commands.scrollIntoView());
});
};
if ((r.hasFocus() && t === null) || t === !1) return !0;
if (o && t === null && !ff(n.state.selection)) return s(), !0;
const l = XS(i.doc, t) || n.state.selection,
a = n.state.selection.eq(l);
return (
o &&
(a || i.setSelection(l),
a && i.storedMarks && i.setStoredMarks(i.storedMarks),
s()),
!0
);
},
e_ = (t, e) => (n) => t.every((r, i) => e(r, be(W({}, n), { index: i }))),
t_ =
(t, e) =>
({ tr: n, commands: r }) =>
r.insertContentAt(
{ from: n.selection.from, to: n.selection.to },
t,
e
);
function jp(t) {
const e = `<body>${t}</body>`;
return new window.DOMParser().parseFromString(e, "text/html").body;
}
function zl(t, e, n) {
if (
((n = W({ slice: !0, parseOptions: {} }, n)),
typeof t == "object" && t !== null)
)
try {
return Array.isArray(t) && t.length > 0
? Y.fromArray(t.map((r) => e.nodeFromJSON(r)))
: e.nodeFromJSON(t);
} catch (r) {
return (
console.warn(
"[tiptap warn]: Invalid content.",
"Passed value:",
t,
"Error:",
r
),
zl("", e, n)
);
}
if (typeof t == "string") {
const r = ts.fromSchema(e);
return n.slice
? r.parseSlice(jp(t), n.parseOptions).content
: r.parse(jp(t), n.parseOptions);
}
return zl("", e, n);
}
function n_(t, e, n) {
const r = t.steps.length - 1;
if (r < e) return;
const i = t.steps[r];
if (!(i instanceof jt || i instanceof Pt)) return;
const o = t.mapping.maps[r];
let s = 0;
o.forEach((l, a, u, c) => {
s === 0 && (s = c);
}),
t.setSelection(Se.near(t.doc.resolve(s), n));
}
const r_ = (t) => t.toString().startsWith("<"),
i_ =
(t, e, n) =>
({ tr: r, dispatch: i, editor: o }) => {
if (i) {
n = W({ parseOptions: {}, updateSelection: !0 }, n);
const s = zl(e, o.schema, {
parseOptions: W(
{ preserveWhitespace: "full" },
n.parseOptions
),
});
if (s.toString() === "<>") return !0;
let { from: l, to: a } =
typeof t == "number"
? { from: t, to: t }
: { from: t.from, to: t.to },
u = !0,
c = !0;
if (
((r_(s) ? s : [s]).forEach((h) => {
h.check(),
(u = u ? h.isText && h.marks.length === 0 : !1),
(c = c ? h.isBlock : !1);
}),
l === a && c)
) {
const { parent: h } = r.doc.resolve(l);
h.isTextblock &&
!h.type.spec.code &&
!h.childCount &&
((l -= 1), (a += 1));
}
u
? Array.isArray(e)
? r.insertText(
e.map((h) => h.text || "").join(""),
l,
a
)
: typeof e == "object" && !!e && !!e.text
? r.insertText(e.text, l, a)
: r.insertText(e, l, a)
: r.replaceWith(l, a, s),
n.updateSelection && n_(r, r.steps.length - 1, -1);
}
return !0;
},
o_ =
() =>
({ state: t, dispatch: e }) =>
dS(t, e),
s_ =
() =>
({ state: t, dispatch: e }) =>
fS(t, e),
l_ =
() =>
({ state: t, dispatch: e }) =>
sS(t, e),
a_ =
() =>
({ state: t, dispatch: e }) =>
uS(t, e),
u_ =
() =>
({ tr: t, state: e, dispatch: n }) => {
try {
const r = Ha(e.doc, e.selection.$from.pos, -1);
return r == null ? !1 : (t.join(r, 2), n && n(t), !0);
} catch (r) {
return !1;
}
},
c_ =
() =>
({ state: t, dispatch: e, tr: n }) => {
try {
const r = Ha(t.doc, t.selection.$from.pos, 1);
return r == null ? !1 : (n.join(r, 2), e && e(n), !0);
} catch (r) {
return !1;
}
};
function pf() {
return typeof navigator != "undefined"
? /Mac/.test(navigator.platform)
: !1;
}
function d_(t) {
const e = t.split(/-(?!$)/);
let n = e[e.length - 1];
n === "Space" && (n = " ");
let r, i, o, s;
for (let l = 0; l < e.length - 1; l += 1) {
const a = e[l];
if (/^(cmd|meta|m)$/i.test(a)) s = !0;
else if (/^a(lt)?$/i.test(a)) r = !0;
else if (/^(c|ctrl|control)$/i.test(a)) i = !0;
else if (/^s(hift)?$/i.test(a)) o = !0;
else if (/^mod$/i.test(a)) hf() || pf() ? (s = !0) : (i = !0);
else throw new Error(`Unrecognized modifier name: ${a}`);
}
return (
r && (n = `Alt-${n}`),
i && (n = `Ctrl-${n}`),
s && (n = `Meta-${n}`),
o && (n = `Shift-${n}`),
n
);
}
const f_ =
(t) =>
({ editor: e, view: n, tr: r, dispatch: i }) => {
const o = d_(t).split(/-(?!$)/),
s = o.find((u) => !["Alt", "Ctrl", "Meta", "Shift"].includes(u)),
l = new KeyboardEvent("keydown", {
key: s === "Space" ? " " : s,
altKey: o.includes("Alt"),
ctrlKey: o.includes("Ctrl"),
metaKey: o.includes("Meta"),
shiftKey: o.includes("Shift"),
bubbles: !0,
cancelable: !0,
}),
a = e.captureTransaction(() => {
n.someProp("handleKeyDown", (u) => u(n, l));
});
return (
a == null ||
a.steps.forEach((u) => {
const c = u.map(r.mapping);
c && i && r.maybeStep(c);
}),
!0
);
};
function mf(t, e, n = {}) {
const { from: r, to: i, empty: o } = t.selection,
s = e ? $t(e, t.schema) : null,
l = [];
t.doc.nodesBetween(r, i, (f, h) => {
if (f.isText) return;
const p = Math.max(r, h),
g = Math.min(i, h + f.nodeSize);
l.push({ node: f, from: p, to: g });
});
const a = i - r,
u = l
.filter((f) => (s ? s.name === f.node.type.name : !0))
.filter((f) => $l(f.node.attrs, n, { strict: !1 }));
return o ? !!u.length : u.reduce((f, h) => f + h.to - h.from, 0) >= a;
}
const h_ =
(t, e = {}) =>
({ state: n, dispatch: r }) => {
const i = $t(t, n.schema);
return mf(n, i, e) ? hS(n, r) : !1;
},
p_ =
() =>
({ state: t, dispatch: e }) =>
yS(t, e),
m_ =
(t) =>
({ state: e, dispatch: n }) => {
const r = $t(t, e.schema);
return _S(r)(e, n);
},
g_ =
() =>
({ state: t, dispatch: e }) =>
pS(t, e);
function gf(t, e) {
return e.nodes[t] ? "node" : e.marks[t] ? "mark" : null;
}
function Lp(t, e) {
const n = typeof e == "string" ? [e] : e;
return Object.keys(t).reduce(
(r, i) => (n.includes(i) || (r[i] = t[i]), r),
{}
);
}
const y_ =
(t, e) =>
({ tr: n, state: r, dispatch: i }) => {
let o = null,
s = null;
const l = gf(typeof t == "string" ? t : t.name, r.schema);
return l
? (l === "node" && (o = $t(t, r.schema)),
l === "mark" && (s = Hr(t, r.schema)),
i &&
n.selection.ranges.forEach((a) => {
r.doc.nodesBetween(
a.$from.pos,
a.$to.pos,
(u, c) => {
o &&
o === u.type &&
n.setNodeMarkup(
c,
void 0,
Lp(u.attrs, e)
),
s &&
u.marks.length &&
u.marks.forEach((f) => {
s === f.type &&
n.addMark(
c,
c + u.nodeSize,
s.create(Lp(f.attrs, e))
);
});
}
);
}),
!0)
: !1;
},
v_ =
() =>
({ tr: t, dispatch: e }) => (e && t.scrollIntoView(), !0),
b_ =
() =>
({ tr: t, commands: e }) =>
e.setTextSelection({ from: 0, to: t.doc.content.size }),
w_ =
() =>
({ state: t, dispatch: e }) =>
lS(t, e),
x_ =
() =>
({ state: t, dispatch: e }) =>
cS(t, e),
k_ =
() =>
({ state: t, dispatch: e }) =>
vS(t, e),
C_ =
() =>
({ state: t, dispatch: e }) =>
xS(t, e),
S_ =
() =>
({ state: t, dispatch: e }) =>
wS(t, e);
function __(t, e, n = {}) {
return zl(t, e, { slice: !1, parseOptions: n });
}
const M_ =
(t, e = !1, n = {}) =>
({ tr: r, editor: i, dispatch: o }) => {
const { doc: s } = r,
l = __(t, i.schema, n);
return (
o &&
r
.replaceWith(0, s.content.size, l)
.setMeta("preventUpdate", !e),
!0
);
};
function ks(t, e) {
const n = Hr(e, t.schema),
{ from: r, to: i, empty: o } = t.selection,
s = [];
o
? (t.storedMarks && s.push(...t.storedMarks),
s.push(...t.selection.$head.marks()))
: t.doc.nodesBetween(r, i, (a) => {
s.push(...a.marks);
});
const l = s.find((a) => a.type.name === n.name);
return l ? W({}, l.attrs) : {};
}
function E_(t, e) {
const n = new a0(t);
return (
e.forEach((r) => {
r.steps.forEach((i) => {
n.step(i);
});
}),
n
);
}
function A_(t) {
for (let e = 0; e < t.edgeCount; e += 1) {
const { type: n } = t.edge(e);
if (n.isTextblock && !n.hasRequiredAttrs()) return n;
}
return null;
}
function T_(t, e, n) {
const r = [];
return (
t.nodesBetween(e.from, e.to, (i, o) => {
n(i) && r.push({ node: i, pos: o });
}),
r
);
}
function F0(t, e) {
for (let n = t.depth; n > 0; n -= 1) {
const r = t.node(n);
if (e(r))
return {
pos: n > 0 ? t.before(n) : 0,
start: t.start(n),
depth: n,
node: r,
};
}
}
function yf(t) {
return (e) => F0(e.$from, t);
}
function O_(t, e) {
const n = $t(e, t.schema),
{ from: r, to: i } = t.selection,
o = [];
t.doc.nodesBetween(r, i, (l) => {
o.push(l);
});
const s = o.reverse().find((l) => l.type.name === n.name);
return s ? W({}, s.attrs) : {};
}
function R_(t, e) {
const n = gf(typeof e == "string" ? e : e.name, t.schema);
return n === "node" ? O_(t, e) : n === "mark" ? ks(t, e) : {};
}
function P_(t, e = JSON.stringify) {
const n = {};
return t.filter((r) => {
const i = e(r);
return Object.prototype.hasOwnProperty.call(n, i) ? !1 : (n[i] = !0);
});
}
function N_(t) {
const e = P_(t);
return e.length === 1
? e
: e.filter(
(n, r) =>
!e
.filter((o, s) => s !== r)
.some(
(o) =>
n.oldRange.from >= o.oldRange.from &&
n.oldRange.to <= o.oldRange.to &&
n.newRange.from >= o.newRange.from &&
n.newRange.to <= o.newRange.to
)
);
}
function j_(t) {
const { mapping: e, steps: n } = t,
r = [];
return (
e.maps.forEach((i, o) => {
const s = [];
if (i.ranges.length)
i.forEach((l, a) => {
s.push({ from: l, to: a });
});
else {
const { from: l, to: a } = n[o];
if (l === void 0 || a === void 0) return;
s.push({ from: l, to: a });
}
s.forEach(({ from: l, to: a }) => {
const u = e.slice(o).map(l, -1),
c = e.slice(o).map(a),
f = e.invert().map(u, -1),
h = e.invert().map(c);
r.push({
oldRange: { from: f, to: h },
newRange: { from: u, to: c },
});
});
}),
N_(r)
);
}
function vf(t, e, n) {
const r = [];
return (
t === e
? n
.resolve(t)
.marks()
.forEach((i) => {
const o = n.resolve(t - 1),
s = df(o, i.type);
!s || r.push(W({ mark: i }, s));
})
: n.nodesBetween(t, e, (i, o) => {
r.push(
...i.marks.map((s) => ({
from: o,
to: o + i.nodeSize,
mark: s,
}))
);
}),
r
);
}
function al(t, e, n) {
return Object.fromEntries(
Object.entries(n).filter(([r]) => {
const i = t.find((o) => o.type === e && o.name === r);
return i ? i.attribute.keepOnSplit : !1;
})
);
}
function L_(t, e, n = {}) {
const { empty: r, ranges: i } = t.selection,
o = e ? Hr(e, t.schema) : null;
if (r)
return !!(t.storedMarks || t.selection.$from.marks())
.filter((f) => (o ? o.name === f.type.name : !0))
.find((f) => $l(f.attrs, n, { strict: !1 }));
let s = 0;
const l = [];
if (
(i.forEach(({ $from: f, $to: h }) => {
const p = f.pos,
g = h.pos;
t.doc.nodesBetween(p, g, (v, b) => {
if (!v.isText && !v.marks.length) return;
const x = Math.max(p, b),
S = Math.min(g, b + v.nodeSize),
T = S - x;
(s += T),
l.push(
...v.marks.map((d) => ({ mark: d, from: x, to: S }))
);
});
}),
s === 0)
)
return !1;
const a = l
.filter((f) => (o ? o.name === f.mark.type.name : !0))
.filter((f) => $l(f.mark.attrs, n, { strict: !1 }))
.reduce((f, h) => f + h.to - h.from, 0),
u = l
.filter((f) =>
o ? f.mark.type !== o && f.mark.type.excludes(o) : !0
)
.reduce((f, h) => f + h.to - h.from, 0);
return (a > 0 ? a + u : a) >= s;
}
function Dp(t, e) {
const { nodeExtensions: n } = OS(e),
r = n.find((s) => s.name === t);
if (!r) return !1;
const i = { name: r.name, options: r.options, storage: r.storage },
o = lt(bt(r, "group", i));
return typeof o != "string" ? !1 : o.split(" ").includes("list");
}
function D_(t) {
return t instanceof ve;
}
function V0(t, e, n) {
const i = t.state.doc.content.size,
o = ir(e, 0, i),
s = ir(n, 0, i),
l = t.coordsAtPos(o),
a = t.coordsAtPos(s, -1),
u = Math.min(l.top, a.top),
c = Math.max(l.bottom, a.bottom),
f = Math.min(l.left, a.left),
h = Math.max(l.right, a.right),
p = h - f,
g = c - u,
x = {
top: u,
bottom: c,
left: f,
right: h,
width: p,
height: g,
x: f,
y: u,
};
return be(W({}, x), { toJSON: () => x });
}
function I_(t, e, n) {
var r;
const { selection: i } = e;
let o = null;
if ((ff(i) && (o = i.$cursor), o)) {
const l = (r = t.storedMarks) !== null && r !== void 0 ? r : o.marks();
return !!n.isInSet(l) || !l.some((a) => a.type.excludes(n));
}
const { ranges: s } = i;
return s.some(({ $from: l, $to: a }) => {
let u =
l.depth === 0
? t.doc.inlineContent && t.doc.type.allowsMarkType(n)
: !1;
return (
t.doc.nodesBetween(l.pos, a.pos, (c, f, h) => {
if (u) return !1;
if (c.isInline) {
const p = !h || h.type.allowsMarkType(n),
g =
!!n.isInSet(c.marks) ||
!c.marks.some((v) => v.type.excludes(n));
u = p && g;
}
return !u;
}),
u
);
});
}
const B_ =
(t, e = {}) =>
({ tr: n, state: r, dispatch: i }) => {
const { selection: o } = n,
{ empty: s, ranges: l } = o,
a = Hr(t, r.schema);
if (i)
if (s) {
const u = ks(r, a);
n.addStoredMark(a.create(W(W({}, u), e)));
} else
l.forEach((u) => {
const c = u.$from.pos,
f = u.$to.pos;
r.doc.nodesBetween(c, f, (h, p) => {
const g = Math.max(p, c),
v = Math.min(p + h.nodeSize, f);
h.marks.find((x) => x.type === a)
? h.marks.forEach((x) => {
a === x.type &&
n.addMark(
g,
v,
a.create(W(W({}, x.attrs), e))
);
})
: n.addMark(g, v, a.create(e));
});
});
return I_(r, n, a);
},
$_ =
(t, e) =>
({ tr: n }) => (n.setMeta(t, e), !0),
z_ =
(t, e = {}) =>
({ state: n, dispatch: r, chain: i }) => {
const o = $t(t, n.schema);
return o.isTextblock
? i()
.command(({ commands: s }) =>
Np(o, e)(n) ? !0 : s.clearNodes()
)
.command(({ state: s }) => Np(o, e)(s, r))
.run()
: (console.warn(
'[tiptap warn]: Currently "setNode()" only supports text block nodes.'
),
!1);
},
H_ =
(t) =>
({ tr: e, dispatch: n }) => {
if (n) {
const { doc: r } = e,
i = ir(t, 0, r.content.size),
o = ve.create(r, i);
e.setSelection(o);
}
return !0;
},
F_ =
(t) =>
({ tr: e, dispatch: n }) => {
if (n) {
const { doc: r } = e,
{ from: i, to: o } =
typeof t == "number" ? { from: t, to: t } : t,
s = Ce.atStart(r).from,
l = Ce.atEnd(r).to,
a = ir(i, s, l),
u = ir(o, s, l),
c = Ce.create(r, a, u);
e.setSelection(c);
}
return !0;
},
V_ =
(t) =>
({ state: e, dispatch: n }) => {
const r = $t(t, e.schema);
return AS(r)(e, n);
};
function Ip(t, e) {
const n =
t.storedMarks ||
(t.selection.$to.parentOffset && t.selection.$from.marks());
if (n) {
const r = n.filter((i) =>
e == null ? void 0 : e.includes(i.type.name)
);
t.tr.ensureMarks(r);
}
}
const W_ =
({ keepMarks: t = !0 } = {}) =>
({ tr: e, state: n, dispatch: r, editor: i }) => {
const { selection: o, doc: s } = e,
{ $from: l, $to: a } = o,
u = i.extensionManager.attributes,
c = al(u, l.node().type.name, l.node().attrs);
if (o instanceof ve && o.node.isBlock)
return !l.parentOffset || !zi(s, l.pos)
? !1
: (r &&
(t && Ip(n, i.extensionManager.splittableMarks),
e.split(l.pos).scrollIntoView()),
!0);
if (!l.parent.isBlock) return !1;
if (r) {
const f = a.parentOffset === a.parent.content.size;
o instanceof Ce && e.deleteSelection();
const h =
l.depth === 0
? void 0
: A_(l.node(-1).contentMatchAt(l.indexAfter(-1)));
let p = f && h ? [{ type: h, attrs: c }] : void 0,
g = zi(e.doc, e.mapping.map(l.pos), 1, p);
if (
(!p &&
!g &&
zi(
e.doc,
e.mapping.map(l.pos),
1,
h ? [{ type: h }] : void 0
) &&
((g = !0), (p = h ? [{ type: h, attrs: c }] : void 0)),
g &&
(e.split(e.mapping.map(l.pos), 1, p),
h && !f && !l.parentOffset && l.parent.type !== h))
) {
const v = e.mapping.map(l.before()),
b = e.doc.resolve(v);
l.node(-1).canReplaceWith(b.index(), b.index() + 1, h) &&
e.setNodeMarkup(e.mapping.map(l.before()), h);
}
t && Ip(n, i.extensionManager.splittableMarks),
e.scrollIntoView();
}
return !0;
},
U_ =
(t) =>
({ tr: e, state: n, dispatch: r, editor: i }) => {
var o;
const s = $t(t, n.schema),
{ $from: l, $to: a } = n.selection,
u = n.selection.node;
if ((u && u.isBlock) || l.depth < 2 || !l.sameParent(a)) return !1;
const c = l.node(-1);
if (c.type !== s) return !1;
const f = i.extensionManager.attributes;
if (
l.parent.content.size === 0 &&
l.node(-1).childCount === l.indexAfter(-1)
) {
if (
l.depth === 2 ||
l.node(-3).type !== s ||
l.index(-2) !== l.node(-2).childCount - 1
)
return !1;
if (r) {
let b = Y.empty;
const x = l.index(-1) ? 1 : l.index(-2) ? 2 : 3;
for (let w = l.depth - x; w >= l.depth - 3; w -= 1)
b = Y.from(l.node(w).copy(b));
const S =
l.indexAfter(-1) < l.node(-2).childCount
? 1
: l.indexAfter(-2) < l.node(-3).childCount
? 2
: 3,
T = al(f, l.node().type.name, l.node().attrs),
d =
((o = s.contentMatch.defaultType) === null ||
o === void 0
? void 0
: o.createAndFill(T)) || void 0;
b = b.append(Y.from(s.createAndFill(null, d) || void 0));
const y = l.before(l.depth - (x - 1));
e.replace(y, l.after(-S), new ie(b, 4 - x, 0));
let m = -1;
e.doc.nodesBetween(y, e.doc.content.size, (w, k) => {
if (m > -1) return !1;
w.isTextblock && w.content.size === 0 && (m = k + 1);
}),
m > -1 && e.setSelection(Ce.near(e.doc.resolve(m))),
e.scrollIntoView();
}
return !0;
}
const h =
a.pos === l.end() ? c.contentMatchAt(0).defaultType : null,
p = al(f, c.type.name, c.attrs),
g = al(f, l.node().type.name, l.node().attrs);
e.delete(l.pos, a.pos);
const v = h
? [
{ type: s, attrs: p },
{ type: h, attrs: g },
]
: [{ type: s, attrs: p }];
if (!zi(e.doc, l.pos, 2)) return !1;
if (r) {
const { selection: b, storedMarks: x } = n,
{ splittableMarks: S } = i.extensionManager,
T = x || (b.$to.parentOffset && b.$from.marks());
if ((e.split(l.pos, 2, v).scrollIntoView(), !T || !r))
return !0;
const d = T.filter((y) => S.includes(y.type.name));
e.ensureMarks(d);
}
return !0;
},
Ru = (t, e) => {
const n = yf((s) => s.type === e)(t.selection);
if (!n) return !0;
const r = t.doc.resolve(Math.max(0, n.pos - 1)).before(n.depth);
if (r === void 0) return !0;
const i = t.doc.nodeAt(r);
return (
n.node.type === (i == null ? void 0 : i.type) &&
$r(t.doc, n.pos) &&
t.join(n.pos),
!0
);
},
Pu = (t, e) => {
const n = yf((s) => s.type === e)(t.selection);
if (!n) return !0;
const r = t.doc.resolve(n.start).after(n.depth);
if (r === void 0) return !0;
const i = t.doc.nodeAt(r);
return (
n.node.type === (i == null ? void 0 : i.type) &&
$r(t.doc, r) &&
t.join(r),
!0
);
},
K_ =
(t, e, n, r = {}) =>
({
editor: i,
tr: o,
state: s,
dispatch: l,
chain: a,
commands: u,
can: c,
}) => {
const { extensions: f, splittableMarks: h } = i.extensionManager,
p = $t(t, s.schema),
g = $t(e, s.schema),
{ selection: v, storedMarks: b } = s,
{ $from: x, $to: S } = v,
T = x.blockRange(S),
d = b || (v.$to.parentOffset && v.$from.marks());
if (!T) return !1;
const y = yf((m) => Dp(m.type.name, f))(v);
if (T.depth >= 1 && y && T.depth - y.depth <= 1) {
if (y.node.type === p) return u.liftListItem(g);
if (
Dp(y.node.type.name, f) &&
p.validContent(y.node.content) &&
l
)
return a()
.command(() => (o.setNodeMarkup(y.pos, p), !0))
.command(() => Ru(o, p))
.command(() => Pu(o, p))
.run();
}
return !n || !d || !l
? a()
.command(() =>
c().wrapInList(p, r) ? !0 : u.clearNodes()
)
.wrapInList(p, r)
.command(() => Ru(o, p))
.command(() => Pu(o, p))
.run()
: a()
.command(() => {
const m = c().wrapInList(p, r),
w = d.filter((k) => h.includes(k.type.name));
return o.ensureMarks(w), m ? !0 : u.clearNodes();
})
.wrapInList(p, r)
.command(() => Ru(o, p))
.command(() => Pu(o, p))
.run();
},
q_ =
(t, e = {}, n = {}) =>
({ state: r, commands: i }) => {
const { extendEmptyMarkRange: o = !1 } = n,
s = Hr(t, r.schema);
return L_(r, s, e)
? i.unsetMark(s, { extendEmptyMarkRange: o })
: i.setMark(s, e);
},
J_ =
(t, e, n = {}) =>
({ state: r, commands: i }) => {
const o = $t(t, r.schema),
s = $t(e, r.schema);
return mf(r, o, n) ? i.setNode(s) : i.setNode(o, n);
},
G_ =
(t, e = {}) =>
({ state: n, commands: r }) => {
const i = $t(t, n.schema);
return mf(n, i, e) ? r.lift(i) : r.wrapIn(i, e);
},
Y_ =
() =>
({ state: t, dispatch: e }) => {
const n = t.plugins;
for (let r = 0; r < n.length; r += 1) {
const i = n[r];
let o;
if (i.spec.isInputRules && (o = i.getState(t))) {
if (e) {
const s = t.tr,
l = o.transform;
for (let a = l.steps.length - 1; a >= 0; a -= 1)
s.step(l.steps[a].invert(l.docs[a]));
if (o.text) {
const a = s.doc.resolve(o.from).marks();
s.replaceWith(
o.from,
o.to,
t.schema.text(o.text, a)
);
} else s.delete(o.from, o.to);
}
return !0;
}
}
return !1;
},
Q_ =
() =>
({ tr: t, dispatch: e }) => {
const { selection: n } = t,
{ empty: r, ranges: i } = n;
return (
r ||
(e &&
i.forEach((o) => {
t.removeMark(o.$from.pos, o.$to.pos);
})),
!0
);
},
X_ =
(t, e = {}) =>
({ tr: n, state: r, dispatch: i }) => {
var o;
const { extendEmptyMarkRange: s = !1 } = e,
{ selection: l } = n,
a = Hr(t, r.schema),
{ $from: u, empty: c, ranges: f } = l;
if (!i) return !0;
if (c && s) {
let { from: h, to: p } = l;
const g =
(o = u.marks().find((b) => b.type === a)) === null ||
o === void 0
? void 0
: o.attrs,
v = df(u, a, g);
v && ((h = v.from), (p = v.to)), n.removeMark(h, p, a);
} else
f.forEach((h) => {
n.removeMark(h.$from.pos, h.$to.pos, a);
});
return n.removeStoredMark(a), !0;
},
Z_ =
(t, e = {}) =>
({ tr: n, state: r, dispatch: i }) => {
let o = null,
s = null;
const l = gf(typeof t == "string" ? t : t.name, r.schema);
return l
? (l === "node" && (o = $t(t, r.schema)),
l === "mark" && (s = Hr(t, r.schema)),
i &&
n.selection.ranges.forEach((a) => {
const u = a.$from.pos,
c = a.$to.pos;
r.doc.nodesBetween(u, c, (f, h) => {
o &&
o === f.type &&
n.setNodeMarkup(
h,
void 0,
W(W({}, f.attrs), e)
),
s &&
f.marks.length &&
f.marks.forEach((p) => {
if (s === p.type) {
const g = Math.max(h, u),
v = Math.min(
h + f.nodeSize,
c
);
n.addMark(
g,
v,
s.create(
W(W({}, p.attrs), e)
)
);
}
});
});
}),
!0)
: !1;
},
eM =
(t, e = {}) =>
({ state: n, dispatch: r }) => {
const i = $t(t, n.schema);
return kS(i, e)(n, r);
},
tM =
(t, e = {}) =>
({ state: n, dispatch: r }) => {
const i = $t(t, n.schema);
return CS(i, e)(n, r);
};
var nM = Object.freeze({
__proto__: null,
blur: IS,
clearContent: BS,
clearNodes: $S,
command: zS,
createParagraphNear: HS,
cut: FS,
deleteCurrentNode: VS,
deleteNode: WS,
deleteRange: US,
deleteSelection: KS,
enter: qS,
exitCode: JS,
extendMarkRange: YS,
first: QS,
focus: ZS,
forEach: e_,
insertContent: t_,
insertContentAt: i_,
joinUp: o_,
joinDown: s_,
joinBackward: l_,
joinForward: a_,
joinItemBackward: u_,
joinItemForward: c_,
keyboardShortcut: f_,
lift: h_,
liftEmptyBlock: p_,
liftListItem: m_,
newlineInCode: g_,
resetAttributes: y_,
scrollIntoView: v_,
selectAll: b_,
selectNodeBackward: w_,
selectNodeForward: x_,
selectParentNode: k_,
selectTextblockEnd: C_,
selectTextblockStart: S_,
setContent: M_,
setMark: B_,
setMeta: $_,
setNode: z_,
setNodeSelection: H_,
setTextSelection: F_,
sinkListItem: V_,
splitBlock: W_,
splitListItem: U_,
toggleList: K_,
toggleMark: q_,
toggleNode: J_,
toggleWrap: G_,
undoInputRule: Y_,
unsetAllMarks: Q_,
unsetMark: X_,
updateAttributes: Z_,
wrapIn: eM,
wrapInList: tM,
});
const CR = Et.create({
name: "commands",
addCommands() {
return W({}, nM);
},
}),
SR = Et.create({
name: "editable",
addProseMirrorPlugins() {
return [
new Tt({
key: new Ot("editable"),
props: { editable: () => this.editor.options.editable },
}),
];
},
}),
_R = Et.create({
name: "focusEvents",
addProseMirrorPlugins() {
const { editor: t } = this;
return [
new Tt({
key: new Ot("focusEvents"),
props: {
handleDOMEvents: {
focus: (e, n) => {
t.isFocused = !0;
const r = t.state.tr
.setMeta("focus", { event: n })
.setMeta("addToHistory", !1);
return e.dispatch(r), !1;
},
blur: (e, n) => {
t.isFocused = !1;
const r = t.state.tr
.setMeta("blur", { event: n })
.setMeta("addToHistory", !1);
return e.dispatch(r), !1;
},
},
},
}),
];
},
}),
MR = Et.create({
name: "keymap",
addKeyboardShortcuts() {
const t = () =>
this.editor.commands.first(({ commands: s }) => [
() => s.undoInputRule(),
() =>
s.command(({ tr: l }) => {
const { selection: a, doc: u } = l,
{ empty: c, $anchor: f } = a,
{ pos: h, parent: p } = f,
g = f.parent.isTextblock
? l.doc.resolve(h - 1)
: f,
v = g.parent.type.spec.isolating,
b = f.pos - f.parentOffset,
x =
v && g.parent.childCount === 1
? b === f.pos
: Se.atStart(u).from === h;
return !c ||
!x ||
!p.type.isTextblock ||
p.textContent.length
? !1
: s.clearNodes();
}),
() => s.deleteSelection(),
() => s.joinBackward(),
() => s.selectNodeBackward(),
]),
e = () =>
this.editor.commands.first(({ commands: s }) => [
() => s.deleteSelection(),
() => s.deleteCurrentNode(),
() => s.joinForward(),
() => s.selectNodeForward(),
]),
r = {
Enter: () =>
this.editor.commands.first(({ commands: s }) => [
() => s.newlineInCode(),
() => s.createParagraphNear(),
() => s.liftEmptyBlock(),
() => s.splitBlock(),
]),
"Mod-Enter": () => this.editor.commands.exitCode(),
Backspace: t,
"Mod-Backspace": t,
"Shift-Backspace": t,
Delete: e,
"Mod-Delete": e,
"Mod-a": () => this.editor.commands.selectAll(),
},
i = W({}, r),
o = be(W({}, r), {
"Ctrl-h": t,
"Alt-Backspace": t,
"Ctrl-d": e,
"Ctrl-Alt-Backspace": e,
"Alt-Delete": e,
"Alt-d": e,
"Ctrl-a": () => this.editor.commands.selectTextblockStart(),
"Ctrl-e": () => this.editor.commands.selectTextblockEnd(),
});
return hf() || pf() ? o : i;
},
addProseMirrorPlugins() {
return [
new Tt({
key: new Ot("clearDocument"),
appendTransaction: (t, e, n) => {
if (!(t.some((g) => g.docChanged) && !e.doc.eq(n.doc)))
return;
const { empty: i, from: o, to: s } = e.selection,
l = Se.atStart(e.doc).from,
a = Se.atEnd(e.doc).to;
if (
i ||
!(o === l && s === a) ||
!(
n.doc.textBetween(
0,
n.doc.content.size,
" ",
" "
).length === 0
)
)
return;
const f = n.tr,
h = H0({ state: n, transaction: f }),
{ commands: p } = new TS({
editor: this.editor,
state: h,
});
if ((p.clearNodes(), !!f.steps.length)) return f;
},
}),
];
},
}),
ER = Et.create({
name: "tabindex",
addProseMirrorPlugins() {
return [
new Tt({
key: new Ot("tabindex"),
props: {
attributes: this.editor.isEditable
? { tabindex: "0" }
: {},
},
}),
];
},
});
function bi(t) {
return new xs({
find: t.find,
handler: ({ state: e, range: n, match: r }) => {
const i = lt(t.getAttributes, void 0, r);
if (i === !1 || i === null) return null;
const { tr: o } = e,
s = r[r.length - 1],
l = r[0];
if (s) {
const a = l.search(/\S/),
u = n.from + l.indexOf(s),
c = u + s.length;
if (
vf(n.from, n.to, e.doc)
.filter((p) =>
p.mark.type.excluded.find(
(v) => v === t.type && v !== p.mark.type
)
)
.filter((p) => p.to > u).length
)
return null;
c < n.to && o.delete(c, n.to),
u > n.from && o.delete(n.from + a, u);
const h = n.from + a + s.length;
o.addMark(n.from + a, h, t.type.create(i || {})),
o.removeStoredMark(t.type);
}
},
});
}
function W0(t) {
return new xs({
find: t.find,
handler: ({ state: e, range: n, match: r }) => {
const i = lt(t.getAttributes, void 0, r) || {},
{ tr: o } = e,
s = n.from;
let l = n.to;
const a = t.type.create(i);
if (r[1]) {
const u = r[0].lastIndexOf(r[1]);
let c = s + u;
c > l ? (c = l) : (l = c + r[1].length);
const f = r[0][r[0].length - 1];
o.insertText(f, s + r[0].length - 1), o.replaceWith(c, l, a);
} else
r[0] &&
o
.insert(s - 1, t.type.create(i))
.delete(o.mapping.map(s), o.mapping.map(l));
o.scrollIntoView();
},
});
}
function Lc(t) {
return new xs({
find: t.find,
handler: ({ state: e, range: n, match: r }) => {
const i = e.doc.resolve(n.from),
o = lt(t.getAttributes, void 0, r) || {};
if (
!i
.node(-1)
.canReplaceWith(i.index(-1), i.indexAfter(-1), t.type)
)
return null;
e.tr.delete(n.from, n.to).setBlockType(n.from, n.from, t.type, o);
},
});
}
function mt(t) {
return new xs({
find: t.find,
handler: ({ state: e, range: n, match: r }) => {
let i = t.replace,
o = n.from;
const s = n.to;
if (r[1]) {
const l = r[0].lastIndexOf(r[1]);
(i += r[0].slice(l + r[1].length)), (o += l);
const a = o - s;
a > 0 && ((i = r[0].slice(l - a, l) + i), (o = s));
}
e.tr.insertText(i, o, s);
},
});
}
function ss(t) {
return new xs({
find: t.find,
handler: ({ state: e, range: n, match: r, chain: i }) => {
const o = lt(t.getAttributes, void 0, r) || {},
s = e.tr.delete(n.from, n.to),
a = s.doc.resolve(n.from).blockRange(),
u = a && Xd(a, t.type, o);
if (!u) return null;
if ((s.wrap(a, u), t.keepMarks && t.editor)) {
const { selection: f, storedMarks: h } = e,
{ splittableMarks: p } = t.editor.extensionManager,
g = h || (f.$to.parentOffset && f.$from.marks());
if (g) {
const v = g.filter((b) => p.includes(b.type.name));
s.ensureMarks(v);
}
}
if (t.keepAttributes) {
const f =
t.type.name === "bulletList" ||
t.type.name === "orderedList"
? "listItem"
: "taskList";
i().updateAttributes(f, o).run();
}
const c = s.doc.resolve(n.from - 1).nodeBefore;
c &&
c.type === t.type &&
$r(s.doc, n.from - 1) &&
(!t.joinPredicate || t.joinPredicate(r, c)) &&
s.join(n.from - 1);
},
});
}
class Cn {
constructor(e = {}) {
(this.type = "mark"),
(this.name = "mark"),
(this.parent = null),
(this.child = null),
(this.config = { name: this.name, defaultOptions: {} }),
(this.config = W(W({}, this.config), e)),
(this.name = this.config.name),
e.defaultOptions &&
console.warn(
`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`
),
(this.options = this.config.defaultOptions),
this.config.addOptions &&
(this.options = lt(
bt(this, "addOptions", { name: this.name })
)),
(this.storage =
lt(
bt(this, "addStorage", {
name: this.name,
options: this.options,
})
) || {});
}
static create(e = {}) {
return new Cn(e);
}
configure(e = {}) {
const n = this.extend();
return (
(n.options = Ua(this.options, e)),
(n.storage = lt(
bt(n, "addStorage", { name: n.name, options: n.options })
)),
n
);
}
extend(e = {}) {
const n = new Cn(e);
return (
(n.parent = this),
(this.child = n),
(n.name = e.name ? e.name : n.parent.name),
e.defaultOptions &&
console.warn(
`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`
),
(n.options = lt(bt(n, "addOptions", { name: n.name }))),
(n.storage = lt(
bt(n, "addStorage", { name: n.name, options: n.options })
)),
n
);
}
static handleExit({ editor: e, mark: n }) {
const { tr: r } = e.state,
i = e.state.selection.$from;
if (i.pos === i.end()) {
const s = i.marks();
if (!!!s.find((u) => (u == null ? void 0 : u.type.name) === n.name))
return !1;
const a = s.find(
(u) => (u == null ? void 0 : u.type.name) === n.name
);
return (
a && r.removeStoredMark(a),
r.insertText(" ", i.pos),
e.view.dispatch(r),
!0
);
}
return !1;
}
}
class ut {
constructor(e = {}) {
(this.type = "node"),
(this.name = "node"),
(this.parent = null),
(this.child = null),
(this.config = { name: this.name, defaultOptions: {} }),
(this.config = W(W({}, this.config), e)),
(this.name = this.config.name),
e.defaultOptions &&
console.warn(
`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`
),
(this.options = this.config.defaultOptions),
this.config.addOptions &&
(this.options = lt(
bt(this, "addOptions", { name: this.name })
)),
(this.storage =
lt(
bt(this, "addStorage", {
name: this.name,
options: this.options,
})
) || {});
}
static create(e = {}) {
return new ut(e);
}
configure(e = {}) {
const n = this.extend();
return (
(n.options = Ua(this.options, e)),
(n.storage = lt(
bt(n, "addStorage", { name: n.name, options: n.options })
)),
n
);
}
extend(e = {}) {
const n = new ut(e);
return (
(n.parent = this),
(this.child = n),
(n.name = e.name ? e.name : n.parent.name),
e.defaultOptions &&
console.warn(
`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`
),
(n.options = lt(bt(n, "addOptions", { name: n.name }))),
(n.storage = lt(
bt(n, "addStorage", { name: n.name, options: n.options })
)),
n
);
}
}
function Dr(t) {
return new NS({
find: t.find,
handler: ({ state: e, range: n, match: r, pasteEvent: i }) => {
const o = lt(t.getAttributes, void 0, r, i);
if (o === !1 || o === null) return null;
const { tr: s } = e,
l = r[r.length - 1],
a = r[0];
let u = n.to;
if (l) {
const c = a.search(/\S/),
f = n.from + a.indexOf(l),
h = f + l.length;
if (
vf(n.from, n.to, e.doc)
.filter((g) =>
g.mark.type.excluded.find(
(b) => b === t.type && b !== g.mark.type
)
)
.filter((g) => g.to > f).length
)
return null;
h < n.to && s.delete(h, n.to),
f > n.from && s.delete(n.from + c, f),
(u = n.from + c + l.length),
s.addMark(n.from + c, u, t.type.create(o || {})),
s.removeStoredMark(t.type);
}
},
});
}
function rM(t) {
return t.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
}
var iM = "tippy-box",
U0 = "tippy-content",
oM = "tippy-backdrop",
K0 = "tippy-arrow",
q0 = "tippy-svg-arrow",
Gr = { passive: !0, capture: !0 },
J0 = function () {
return document.body;
};
function Nu(t, e, n) {
if (Array.isArray(t)) {
var r = t[e];
return r == null ? (Array.isArray(n) ? n[e] : n) : r;
}
return t;
}
function bf(t, e) {
var n = {}.toString.call(t);
return n.indexOf("[object") === 0 && n.indexOf(e + "]") > -1;
}
function G0(t, e) {
return typeof t == "function" ? t.apply(void 0, e) : t;
}
function Bp(t, e) {
if (e === 0) return t;
var n;
return function (r) {
clearTimeout(n),
(n = setTimeout(function () {
t(r);
}, e));
};
}
function sM(t) {
return t.split(/\s+/).filter(Boolean);
}
function Ni(t) {
return [].concat(t);
}
function $p(t, e) {
t.indexOf(e) === -1 && t.push(e);
}
function lM(t) {
return t.filter(function (e, n) {
return t.indexOf(e) === n;
});
}
function aM(t) {
return t.split("-")[0];
}
function Hl(t) {
return [].slice.call(t);
}
function zp(t) {
return Object.keys(t).reduce(function (e, n) {
return t[n] !== void 0 && (e[n] = t[n]), e;
}, {});
}
function zo() {
return document.createElement("div");
}
function Ka(t) {
return ["Element", "Fragment"].some(function (e) {
return bf(t, e);
});
}
function uM(t) {
return bf(t, "NodeList");
}
function cM(t) {
return bf(t, "MouseEvent");
}
function dM(t) {
return !!(t && t._tippy && t._tippy.reference === t);
}
function fM(t) {
return Ka(t)
? [t]
: uM(t)
? Hl(t)
: Array.isArray(t)
? t
: Hl(document.querySelectorAll(t));
}
function ju(t, e) {
t.forEach(function (n) {
n && (n.style.transitionDuration = e + "ms");
});
}
function Hp(t, e) {
t.forEach(function (n) {
n && n.setAttribute("data-state", e);
});
}
function hM(t) {
var e,
n = Ni(t),
r = n[0];
return r != null && (e = r.ownerDocument) != null && e.body
? r.ownerDocument
: document;
}
function pM(t, e) {
var n = e.clientX,
r = e.clientY;
return t.every(function (i) {
var o = i.popperRect,
s = i.popperState,
l = i.props,
a = l.interactiveBorder,
u = aM(s.placement),
c = s.modifiersData.offset;
if (!c) return !0;
var f = u === "bottom" ? c.top.y : 0,
h = u === "top" ? c.bottom.y : 0,
p = u === "right" ? c.left.x : 0,
g = u === "left" ? c.right.x : 0,
v = o.top - r + f > a,
b = r - o.bottom - h > a,
x = o.left - n + p > a,
S = n - o.right - g > a;
return v || b || x || S;
});
}
function Lu(t, e, n) {
var r = e + "EventListener";
["transitionend", "webkitTransitionEnd"].forEach(function (i) {
t[r](i, n);
});
}
function Fp(t, e) {
for (var n = e; n; ) {
var r;
if (t.contains(n)) return !0;
n =
n.getRootNode == null || (r = n.getRootNode()) == null
? void 0
: r.host;
}
return !1;
}
var Fn = { isTouch: !1 },
Vp = 0;
function mM() {
Fn.isTouch ||
((Fn.isTouch = !0),
window.performance && document.addEventListener("mousemove", Y0));
}
function Y0() {
var t = performance.now();
t - Vp < 20 &&
((Fn.isTouch = !1), document.removeEventListener("mousemove", Y0)),
(Vp = t);
}
function gM() {
var t = document.activeElement;
if (dM(t)) {
var e = t._tippy;
t.blur && !e.state.isVisible && t.blur();
}
}
function yM() {
document.addEventListener("touchstart", mM, Gr),
window.addEventListener("blur", gM);
}
var vM = typeof window != "undefined" && typeof document != "undefined",
bM = vM ? !!window.msCrypto : !1,
wM = {
animateFill: !1,
followCursor: !1,
inlinePositioning: !1,
sticky: !1,
},
xM = {
allowHTML: !1,
animation: "fade",
arrow: !0,
content: "",
inertia: !1,
maxWidth: 350,
role: "tooltip",
theme: "",
zIndex: 9999,
},
Tn = Object.assign(
{
appendTo: J0,
aria: { content: "auto", expanded: "auto" },
delay: 0,
duration: [300, 250],
getReferenceClientRect: null,
hideOnClick: !0,
ignoreAttributes: !1,
interactive: !1,
interactiveBorder: 2,
interactiveDebounce: 0,
moveTransition: "",
offset: [0, 10],
onAfterUpdate: function () {},
onBeforeUpdate: function () {},
onCreate: function () {},
onDestroy: function () {},
onHidden: function () {},
onHide: function () {},
onMount: function () {},
onShow: function () {},
onShown: function () {},
onTrigger: function () {},
onUntrigger: function () {},
onClickOutside: function () {},
placement: "top",
plugins: [],
popperOptions: {},
render: null,
showOnCreate: !1,
touch: !0,
trigger: "mouseenter focus",
triggerTarget: null,
},
wM,
xM
),
kM = Object.keys(Tn),
CM = function (e) {
var n = Object.keys(e);
n.forEach(function (r) {
Tn[r] = e[r];
});
};
function Q0(t) {
var e = t.plugins || [],
n = e.reduce(function (r, i) {
var o = i.name,
s = i.defaultValue;
if (o) {
var l;
r[o] = t[o] !== void 0 ? t[o] : (l = Tn[o]) != null ? l : s;
}
return r;
}, {});
return Object.assign({}, t, n);
}
function SM(t, e) {
var n = e ? Object.keys(Q0(Object.assign({}, Tn, { plugins: e }))) : kM,
r = n.reduce(function (i, o) {
var s = (t.getAttribute("data-tippy-" + o) || "").trim();
if (!s) return i;
if (o === "content") i[o] = s;
else
try {
i[o] = JSON.parse(s);
} catch (l) {
i[o] = s;
}
return i;
}, {});
return r;
}
function Wp(t, e) {
var n = Object.assign(
{},
e,
{ content: G0(e.content, [t]) },
e.ignoreAttributes ? {} : SM(t, e.plugins)
);
return (
(n.aria = Object.assign({}, Tn.aria, n.aria)),
(n.aria = {
expanded:
n.aria.expanded === "auto" ? e.interactive : n.aria.expanded,
content:
n.aria.content === "auto"
? e.interactive
? null
: "describedby"
: n.aria.content,
}),
n
);
}
var _M = function () {
return "innerHTML";
};
function Dc(t, e) {
t[_M()] = e;
}
function Up(t) {
var e = zo();
return (
t === !0
? (e.className = K0)
: ((e.className = q0), Ka(t) ? e.appendChild(t) : Dc(e, t)),
e
);
}
function Kp(t, e) {
Ka(e.content)
? (Dc(t, ""), t.appendChild(e.content))
: typeof e.content != "function" &&
(e.allowHTML ? Dc(t, e.content) : (t.textContent = e.content));
}
function Ic(t) {
var e = t.firstElementChild,
n = Hl(e.children);
return {
box: e,
content: n.find(function (r) {
return r.classList.contains(U0);
}),
arrow: n.find(function (r) {
return r.classList.contains(K0) || r.classList.contains(q0);
}),
backdrop: n.find(function (r) {
return r.classList.contains(oM);
}),
};
}
function X0(t) {
var e = zo(),
n = zo();
(n.className = iM),
n.setAttribute("data-state", "hidden"),
n.setAttribute("tabindex", "-1");
var r = zo();
(r.className = U0),
r.setAttribute("data-state", "hidden"),
Kp(r, t.props),
e.appendChild(n),
n.appendChild(r),
i(t.props, t.props);
function i(o, s) {
var l = Ic(e),
a = l.box,
u = l.content,
c = l.arrow;
s.theme
? a.setAttribute("data-theme", s.theme)
: a.removeAttribute("data-theme"),
typeof s.animation == "string"
? a.setAttribute("data-animation", s.animation)
: a.removeAttribute("data-animation"),
s.inertia
? a.setAttribute("data-inertia", "")
: a.removeAttribute("data-inertia"),
(a.style.maxWidth =
typeof s.maxWidth == "number" ? s.maxWidth + "px" : s.maxWidth),
s.role ? a.setAttribute("role", s.role) : a.removeAttribute("role"),
(o.content !== s.content || o.allowHTML !== s.allowHTML) &&
Kp(u, t.props),
s.arrow
? c
? o.arrow !== s.arrow &&
(a.removeChild(c), a.appendChild(Up(s.arrow)))
: a.appendChild(Up(s.arrow))
: c && a.removeChild(c);
}
return { popper: e, onUpdate: i };
}
X0.$$tippy = !0;
var MM = 1,
Ws = [],
Du = [];
function EM(t, e) {
var n = Wp(t, Object.assign({}, Tn, Q0(zp(e)))),
r,
i,
o,
s = !1,
l = !1,
a = !1,
u = !1,
c,
f,
h,
p = [],
g = Bp(j, n.interactiveDebounce),
v,
b = MM++,
x = null,
S = lM(n.plugins),
T = {
isEnabled: !0,
isVisible: !1,
isDestroyed: !1,
isMounted: !1,
isShown: !1,
},
d = {
id: b,
reference: t,
popper: zo(),
popperInstance: x,
props: n,
state: T,
plugins: S,
clearDelayTimeouts: Oe,
setProps: Je,
setContent: Fe,
show: ct,
hide: nn,
hideWithInteractivity: ur,
enable: pe,
disable: ke,
unmount: Cs,
destroy: Fr,
};
if (!n.render) return d;
var y = n.render(d),
m = y.popper,
w = y.onUpdate;
m.setAttribute("data-tippy-root", ""),
(m.id = "tippy-" + d.id),
(d.popper = m),
(t._tippy = d),
(m._tippy = d);
var k = S.map(function (F) {
return F.fn(d);
}),
_ = t.hasAttribute("aria-expanded");
return (
Pe(),
ae(),
N(),
D("onCreate", [d]),
n.showOnCreate && he(),
m.addEventListener("mouseenter", function () {
d.props.interactive && d.state.isVisible && d.clearDelayTimeouts();
}),
m.addEventListener("mouseleave", function () {
d.props.interactive &&
d.props.trigger.indexOf("mouseenter") >= 0 &&
L().addEventListener("mousemove", g);
}),
d
);
function C() {
var F = d.props.touch;
return Array.isArray(F) ? F : [F, 0];
}
function E() {
return C()[0] === "hold";
}
function R() {
var F;
return !!((F = d.props.render) != null && F.$$tippy);
}
function P() {
return v || t;
}
function L() {
var F = P().parentNode;
return F ? hM(F) : document;
}
function I() {
return Ic(m);
}
function M(F) {
return (d.state.isMounted && !d.state.isVisible) ||
Fn.isTouch ||
(c && c.type === "focus")
? 0
: Nu(d.props.delay, F ? 0 : 1, Tn.delay);
}
function N(F) {
F === void 0 && (F = !1),
(m.style.pointerEvents = d.props.interactive && !F ? "" : "none"),
(m.style.zIndex = "" + d.props.zIndex);
}
function D(F, le, ge) {
if (
(ge === void 0 && (ge = !0),
k.forEach(function (Ve) {
Ve[F] && Ve[F].apply(Ve, le);
}),
ge)
) {
var Ke;
(Ke = d.props)[F].apply(Ke, le);
}
}
function K() {
var F = d.props.aria;
if (!!F.content) {
var le = "aria-" + F.content,
ge = m.id,
Ke = Ni(d.props.triggerTarget || t);
Ke.forEach(function (Ve) {
var Ut = Ve.getAttribute(le);
if (d.state.isVisible)
Ve.setAttribute(le, Ut ? Ut + " " + ge : ge);
else {
var un = Ut && Ut.replace(ge, "").trim();
un ? Ve.setAttribute(le, un) : Ve.removeAttribute(le);
}
});
}
}
function ae() {
if (!(_ || !d.props.aria.expanded)) {
var F = Ni(d.props.triggerTarget || t);
F.forEach(function (le) {
d.props.interactive
? le.setAttribute(
"aria-expanded",
d.state.isVisible && le === P() ? "true" : "false"
)
: le.removeAttribute("aria-expanded");
});
}
}
function Q() {
L().removeEventListener("mousemove", g),
(Ws = Ws.filter(function (F) {
return F !== g;
}));
}
function me(F) {
if (!(Fn.isTouch && (a || F.type === "mousedown"))) {
var le = (F.composedPath && F.composedPath()[0]) || F.target;
if (!(d.props.interactive && Fp(m, le))) {
if (
Ni(d.props.triggerTarget || t).some(function (ge) {
return Fp(ge, le);
})
) {
if (
Fn.isTouch ||
(d.state.isVisible &&
d.props.trigger.indexOf("click") >= 0)
)
return;
} else D("onClickOutside", [d, F]);
d.props.hideOnClick === !0 &&
(d.clearDelayTimeouts(),
d.hide(),
(l = !0),
setTimeout(function () {
l = !1;
}),
d.state.isMounted || Ae());
}
}
}
function je() {
a = !0;
}
function Le() {
a = !1;
}
function Re() {
var F = L();
F.addEventListener("mousedown", me, !0),
F.addEventListener("touchend", me, Gr),
F.addEventListener("touchstart", Le, Gr),
F.addEventListener("touchmove", je, Gr);
}
function Ae() {
var F = L();
F.removeEventListener("mousedown", me, !0),
F.removeEventListener("touchend", me, Gr),
F.removeEventListener("touchstart", Le, Gr),
F.removeEventListener("touchmove", je, Gr);
}
function z(F, le) {
ee(F, function () {
!d.state.isVisible &&
m.parentNode &&
m.parentNode.contains(m) &&
le();
});
}
function X(F, le) {
ee(F, le);
}
function ee(F, le) {
var ge = I().box;
function Ke(Ve) {
Ve.target === ge && (Lu(ge, "remove", Ke), le());
}
if (F === 0) return le();
Lu(ge, "remove", f), Lu(ge, "add", Ke), (f = Ke);
}
function ue(F, le, ge) {
ge === void 0 && (ge = !1);
var Ke = Ni(d.props.triggerTarget || t);
Ke.forEach(function (Ve) {
Ve.addEventListener(F, le, ge),
p.push({ node: Ve, eventType: F, handler: le, options: ge });
});
}
function Pe() {
E() &&
(ue("touchstart", O, { passive: !0 }),
ue("touchend", H, { passive: !0 })),
sM(d.props.trigger).forEach(function (F) {
if (F !== "manual")
switch ((ue(F, O), F)) {
case "mouseenter":
ue("mouseleave", H);
break;
case "focus":
ue(bM ? "focusout" : "blur", V);
break;
case "focusin":
ue("focusout", V);
break;
}
});
}
function A() {
p.forEach(function (F) {
var le = F.node,
ge = F.eventType,
Ke = F.handler,
Ve = F.options;
le.removeEventListener(ge, Ke, Ve);
}),
(p = []);
}
function O(F) {
var le,
ge = !1;
if (!(!d.state.isEnabled || q(F) || l)) {
var Ke = ((le = c) == null ? void 0 : le.type) === "focus";
(c = F),
(v = F.currentTarget),
ae(),
!d.state.isVisible &&
cM(F) &&
Ws.forEach(function (Ve) {
return Ve(F);
}),
F.type === "click" &&
(d.props.trigger.indexOf("mouseenter") < 0 || s) &&
d.props.hideOnClick !== !1 &&
d.state.isVisible
? (ge = !0)
: he(F),
F.type === "click" && (s = !ge),
ge && !Ke && ce(F);
}
}
function j(F) {
var le = F.target,
ge = P().contains(le) || m.contains(le);
if (!(F.type === "mousemove" && ge)) {
var Ke = J()
.concat(m)
.map(function (Ve) {
var Ut,
un = Ve._tippy,
_i =
(Ut = un.popperInstance) == null
? void 0
: Ut.state;
return _i
? {
popperRect: Ve.getBoundingClientRect(),
popperState: _i,
props: n,
}
: null;
})
.filter(Boolean);
pM(Ke, F) && (Q(), ce(F));
}
}
function H(F) {
var le = q(F) || (d.props.trigger.indexOf("click") >= 0 && s);
if (!le) {
if (d.props.interactive) {
d.hideWithInteractivity(F);
return;
}
ce(F);
}
}
function V(F) {
(d.props.trigger.indexOf("focusin") < 0 && F.target !== P()) ||
(d.props.interactive &&
F.relatedTarget &&
m.contains(F.relatedTarget)) ||
ce(F);
}
function q(F) {
return Fn.isTouch ? E() !== F.type.indexOf("touch") >= 0 : !1;
}
function se() {
Z();
var F = d.props,
le = F.popperOptions,
ge = F.placement,
Ke = F.offset,
Ve = F.getReferenceClientRect,
Ut = F.moveTransition,
un = R() ? Ic(m).arrow : null,
_i = Ve
? {
getBoundingClientRect: Ve,
contextElement: Ve.contextElement || P(),
}
: t,
zf = {
name: "$$tippy",
enabled: !0,
phase: "beforeWrite",
requires: ["computeStyles"],
fn: function (Ss) {
var Mi = Ss.state;
if (R()) {
var By = I(),
Qa = By.box;
["placement", "reference-hidden", "escaped"].forEach(
function (_s) {
_s === "placement"
? Qa.setAttribute(
"data-placement",
Mi.placement
)
: Mi.attributes.popper["data-popper-" + _s]
? Qa.setAttribute("data-" + _s, "")
: Qa.removeAttribute("data-" + _s);
}
),
(Mi.attributes.popper = {});
}
},
},
Vr = [
{ name: "offset", options: { offset: Ke } },
{
name: "preventOverflow",
options: {
padding: { top: 2, bottom: 2, left: 5, right: 5 },
},
},
{ name: "flip", options: { padding: 5 } },
{ name: "computeStyles", options: { adaptive: !Ut } },
zf,
];
R() &&
un &&
Vr.push({ name: "arrow", options: { element: un, padding: 3 } }),
Vr.push.apply(Vr, (le == null ? void 0 : le.modifiers) || []),
(d.popperInstance = L1(
_i,
m,
Object.assign({}, le, {
placement: ge,
onFirstUpdate: h,
modifiers: Vr,
})
));
}
function Z() {
d.popperInstance &&
(d.popperInstance.destroy(), (d.popperInstance = null));
}
function te() {
var F = d.props.appendTo,
le,
ge = P();
(d.props.interactive && F === J0) || F === "parent"
? (le = ge.parentNode)
: (le = G0(F, [ge])),
le.contains(m) || le.appendChild(m),
(d.state.isMounted = !0),
se();
}
function J() {
return Hl(m.querySelectorAll("[data-tippy-root]"));
}
function he(F) {
d.clearDelayTimeouts(), F && D("onTrigger", [d, F]), Re();
var le = M(!0),
ge = C(),
Ke = ge[0],
Ve = ge[1];
Fn.isTouch && Ke === "hold" && Ve && (le = Ve),
le
? (r = setTimeout(function () {
d.show();
}, le))
: d.show();
}
function ce(F) {
if (
(d.clearDelayTimeouts(),
D("onUntrigger", [d, F]),
!d.state.isVisible)
) {
Ae();
return;
}
if (
!(
d.props.trigger.indexOf("mouseenter") >= 0 &&
d.props.trigger.indexOf("click") >= 0 &&
["mouseleave", "mousemove"].indexOf(F.type) >= 0 &&
s
)
) {
var le = M(!1);
le
? (i = setTimeout(function () {
d.state.isVisible && d.hide();
}, le))
: (o = requestAnimationFrame(function () {
d.hide();
}));
}
}
function pe() {
d.state.isEnabled = !0;
}
function ke() {
d.hide(), (d.state.isEnabled = !1);
}
function Oe() {
clearTimeout(r), clearTimeout(i), cancelAnimationFrame(o);
}
function Je(F) {
if (!d.state.isDestroyed) {
D("onBeforeUpdate", [d, F]), A();
var le = d.props,
ge = Wp(
t,
Object.assign({}, le, zp(F), { ignoreAttributes: !0 })
);
(d.props = ge),
Pe(),
le.interactiveDebounce !== ge.interactiveDebounce &&
(Q(), (g = Bp(j, ge.interactiveDebounce))),
le.triggerTarget && !ge.triggerTarget
? Ni(le.triggerTarget).forEach(function (Ke) {
Ke.removeAttribute("aria-expanded");
})
: ge.triggerTarget && t.removeAttribute("aria-expanded"),
ae(),
N(),
w && w(le, ge),
d.popperInstance &&
(se(),
J().forEach(function (Ke) {
requestAnimationFrame(
Ke._tippy.popperInstance.forceUpdate
);
})),
D("onAfterUpdate", [d, F]);
}
}
function Fe(F) {
d.setProps({ content: F });
}
function ct() {
var F = d.state.isVisible,
le = d.state.isDestroyed,
ge = !d.state.isEnabled,
Ke = Fn.isTouch && !d.props.touch,
Ve = Nu(d.props.duration, 0, Tn.duration);
if (
!(F || le || ge || Ke) &&
!P().hasAttribute("disabled") &&
(D("onShow", [d], !1), d.props.onShow(d) !== !1)
) {
if (
((d.state.isVisible = !0),
R() && (m.style.visibility = "visible"),
N(),
Re(),
d.state.isMounted || (m.style.transition = "none"),
R())
) {
var Ut = I(),
un = Ut.box,
_i = Ut.content;
ju([un, _i], 0);
}
(h = function () {
var Vr;
if (!(!d.state.isVisible || u)) {
if (
((u = !0),
m.offsetHeight,
(m.style.transition = d.props.moveTransition),
R() && d.props.animation)
) {
var Ya = I(),
Ss = Ya.box,
Mi = Ya.content;
ju([Ss, Mi], Ve), Hp([Ss, Mi], "visible");
}
K(),
ae(),
$p(Du, d),
(Vr = d.popperInstance) == null || Vr.forceUpdate(),
D("onMount", [d]),
d.props.animation &&
R() &&
X(Ve, function () {
(d.state.isShown = !0), D("onShown", [d]);
});
}
}),
te();
}
}
function nn() {
var F = !d.state.isVisible,
le = d.state.isDestroyed,
ge = !d.state.isEnabled,
Ke = Nu(d.props.duration, 1, Tn.duration);
if (
!(F || le || ge) &&
(D("onHide", [d], !1), d.props.onHide(d) !== !1)
) {
if (
((d.state.isVisible = !1),
(d.state.isShown = !1),
(u = !1),
(s = !1),
R() && (m.style.visibility = "hidden"),
Q(),
Ae(),
N(!0),
R())
) {
var Ve = I(),
Ut = Ve.box,
un = Ve.content;
d.props.animation && (ju([Ut, un], Ke), Hp([Ut, un], "hidden"));
}
K(),
ae(),
d.props.animation ? R() && z(Ke, d.unmount) : d.unmount();
}
}
function ur(F) {
L().addEventListener("mousemove", g), $p(Ws, g), g(F);
}
function Cs() {
d.state.isVisible && d.hide(),
d.state.isMounted &&
(Z(),
J().forEach(function (F) {
F._tippy.unmount();
}),
m.parentNode && m.parentNode.removeChild(m),
(Du = Du.filter(function (F) {
return F !== d;
})),
(d.state.isMounted = !1),
D("onHidden", [d]));
}
function Fr() {
d.state.isDestroyed ||
(d.clearDelayTimeouts(),
d.unmount(),
A(),
delete t._tippy,
(d.state.isDestroyed = !0),
D("onDestroy", [d]));
}
}
function fo(t, e) {
e === void 0 && (e = {});
var n = Tn.plugins.concat(e.plugins || []);
yM();
var r = Object.assign({}, e, { plugins: n }),
i = fM(t),
o = i.reduce(function (s, l) {
var a = l && EM(l, r);
return a && s.push(a), s;
}, []);
return Ka(t) ? o[0] : o;
}
fo.defaultProps = Tn;
fo.setDefaultProps = CM;
fo.currentInput = Fn;
Object.assign({}, E1, {
effect: function (e) {
var n = e.state,
r = {
popper: {
position: n.options.strategy,
left: "0",
top: "0",
margin: "0",
},
arrow: { position: "absolute" },
reference: {},
};
Object.assign(n.elements.popper.style, r.popper),
(n.styles = r),
n.elements.arrow && Object.assign(n.elements.arrow.style, r.arrow);
},
});
fo.setDefaultProps({ render: X0 });
class AM {
constructor({
editor: e,
element: n,
view: r,
tippyOptions: i = {},
updateDelay: o = 250,
shouldShow: s,
}) {
(this.preventHide = !1),
(this.shouldShow = ({ view: l, state: a, from: u, to: c }) => {
const { doc: f, selection: h } = a,
{ empty: p } = h,
g = !f.textBetween(u, c).length && ff(a.selection),
v = this.element.contains(document.activeElement);
return !(
!(l.hasFocus() || v) ||
p ||
g ||
!this.editor.isEditable
);
}),
(this.mousedownHandler = () => {
this.preventHide = !0;
}),
(this.dragstartHandler = () => {
this.hide();
}),
(this.focusHandler = () => {
setTimeout(() => this.update(this.editor.view));
}),
(this.blurHandler = ({ event: l }) => {
var a;
if (this.preventHide) {
this.preventHide = !1;
return;
}
((l == null ? void 0 : l.relatedTarget) &&
((a = this.element.parentNode) === null || a === void 0
? void 0
: a.contains(l.relatedTarget))) ||
this.hide();
}),
(this.tippyBlurHandler = (l) => {
this.blurHandler({ event: l });
}),
(this.handleDebouncedUpdate = (l, a) => {
const u = !(a != null && a.selection.eq(l.state.selection)),
c = !(a != null && a.doc.eq(l.state.doc));
(!u && !c) ||
(this.updateDebounceTimer &&
clearTimeout(this.updateDebounceTimer),
(this.updateDebounceTimer = window.setTimeout(() => {
this.updateHandler(l, u, c, a);
}, this.updateDelay)));
}),
(this.updateHandler = (l, a, u, c) => {
var f, h, p;
const { state: g, composing: v } = l,
{ selection: b } = g;
if (v || (!a && !u)) return;
this.createTooltip();
const { ranges: S } = b,
T = Math.min(...S.map((m) => m.$from.pos)),
d = Math.max(...S.map((m) => m.$to.pos));
if (
!((f = this.shouldShow) === null || f === void 0
? void 0
: f.call(this, {
editor: this.editor,
view: l,
state: g,
oldState: c,
from: T,
to: d,
}))
) {
this.hide();
return;
}
(h = this.tippy) === null ||
h === void 0 ||
h.setProps({
getReferenceClientRect:
((p = this.tippyOptions) === null || p === void 0
? void 0
: p.getReferenceClientRect) ||
(() => {
if (D_(g.selection)) {
let m = l.nodeDOM(T);
const w = m.dataset.nodeViewWrapper
? m
: m.querySelector(
"[data-node-view-wrapper]"
);
if ((w && (m = w.firstChild), m))
return m.getBoundingClientRect();
}
return V0(l, T, d);
}),
}),
this.show();
}),
(this.editor = e),
(this.element = n),
(this.view = r),
(this.updateDelay = o),
s && (this.shouldShow = s),
this.element.addEventListener("mousedown", this.mousedownHandler, {
capture: !0,
}),
this.view.dom.addEventListener("dragstart", this.dragstartHandler),
this.editor.on("focus", this.focusHandler),
this.editor.on("blur", this.blurHandler),
(this.tippyOptions = i),
this.element.remove(),
(this.element.style.visibility = "visible");
}
createTooltip() {
const { element: e } = this.editor.options,
n = !!e.parentElement;
this.tippy ||
!n ||
((this.tippy = fo(
e,
W(
{
duration: 0,
getReferenceClientRect: null,
content: this.element,
interactive: !0,
trigger: "manual",
placement: "top",
hideOnClick: "toggle",
},
this.tippyOptions
)
)),
this.tippy.popper.firstChild &&
this.tippy.popper.firstChild.addEventListener(
"blur",
this.tippyBlurHandler
));
}
update(e, n) {
const { state: r } = e,
i = r.selection.$from.pos !== r.selection.$to.pos;
if (this.updateDelay > 0 && i) {
this.handleDebouncedUpdate(e, n);
return;
}
const o = !(n != null && n.selection.eq(e.state.selection)),
s = !(n != null && n.doc.eq(e.state.doc));
this.updateHandler(e, o, s, n);
}
show() {
var e;
(e = this.tippy) === null || e === void 0 || e.show();
}
hide() {
var e;
(e = this.tippy) === null || e === void 0 || e.hide();
}
destroy() {
var e, n;
!((e = this.tippy) === null || e === void 0) &&
e.popper.firstChild &&
this.tippy.popper.firstChild.removeEventListener(
"blur",
this.tippyBlurHandler
),
(n = this.tippy) === null || n === void 0 || n.destroy(),
this.element.removeEventListener(
"mousedown",
this.mousedownHandler,
{ capture: !0 }
),
this.view.dom.removeEventListener(
"dragstart",
this.dragstartHandler
),
this.editor.off("focus", this.focusHandler),
this.editor.off("blur", this.blurHandler);
}
}
const Z0 = (t) =>
new Tt({
key: typeof t.pluginKey == "string" ? new Ot(t.pluginKey) : t.pluginKey,
view: (e) => new AM(W({ view: e }, t)),
});
Et.create({
name: "bubbleMenu",
addOptions() {
return {
element: null,
tippyOptions: {},
pluginKey: "bubbleMenu",
updateDelay: void 0,
shouldShow: null,
};
},
addProseMirrorPlugins() {
return this.options.element
? [
Z0({
pluginKey: this.options.pluginKey,
editor: this.editor,
element: this.options.element,
tippyOptions: this.options.tippyOptions,
updateDelay: this.options.updateDelay,
shouldShow: this.options.shouldShow,
}),
]
: [];
},
});
class TM {
constructor({
editor: e,
element: n,
view: r,
tippyOptions: i = {},
shouldShow: o,
}) {
(this.preventHide = !1),
(this.shouldShow = ({ view: s, state: l }) => {
const { selection: a } = l,
{ $anchor: u, empty: c } = a,
f = u.depth === 1,
h =
u.parent.isTextblock &&
!u.parent.type.spec.code &&
!u.parent.textContent;
return !(
!s.hasFocus() ||
!c ||
!f ||
!h ||
!this.editor.isEditable
);
}),
(this.mousedownHandler = () => {
this.preventHide = !0;
}),
(this.focusHandler = () => {
setTimeout(() => this.update(this.editor.view));
}),
(this.blurHandler = ({ event: s }) => {
var l;
if (this.preventHide) {
this.preventHide = !1;
return;
}
((s == null ? void 0 : s.relatedTarget) &&
((l = this.element.parentNode) === null || l === void 0
? void 0
: l.contains(s.relatedTarget))) ||
this.hide();
}),
(this.tippyBlurHandler = (s) => {
this.blurHandler({ event: s });
}),
(this.editor = e),
(this.element = n),
(this.view = r),
o && (this.shouldShow = o),
this.element.addEventListener("mousedown", this.mousedownHandler, {
capture: !0,
}),
this.editor.on("focus", this.focusHandler),
this.editor.on("blur", this.blurHandler),
(this.tippyOptions = i),
this.element.remove(),
(this.element.style.visibility = "visible");
}
createTooltip() {
const { element: e } = this.editor.options,
n = !!e.parentElement;
this.tippy ||
!n ||
((this.tippy = fo(
e,
W(
{
duration: 0,
getReferenceClientRect: null,
content: this.element,
interactive: !0,
trigger: "manual",
placement: "right",
hideOnClick: "toggle",
},
this.tippyOptions
)
)),
this.tippy.popper.firstChild &&
this.tippy.popper.firstChild.addEventListener(
"blur",
this.tippyBlurHandler
));
}
update(e, n) {
var r, i, o;
const { state: s } = e,
{ doc: l, selection: a } = s,
{ from: u, to: c } = a;
if (n && n.doc.eq(l) && n.selection.eq(a)) return;
if (
(this.createTooltip(),
!((r = this.shouldShow) === null || r === void 0
? void 0
: r.call(this, {
editor: this.editor,
view: e,
state: s,
oldState: n,
})))
) {
this.hide();
return;
}
(i = this.tippy) === null ||
i === void 0 ||
i.setProps({
getReferenceClientRect:
((o = this.tippyOptions) === null || o === void 0
? void 0
: o.getReferenceClientRect) || (() => V0(e, u, c)),
}),
this.show();
}
show() {
var e;
(e = this.tippy) === null || e === void 0 || e.show();
}
hide() {
var e;
(e = this.tippy) === null || e === void 0 || e.hide();
}
destroy() {
var e, n;
!((e = this.tippy) === null || e === void 0) &&
e.popper.firstChild &&
this.tippy.popper.firstChild.removeEventListener(
"blur",
this.tippyBlurHandler
),
(n = this.tippy) === null || n === void 0 || n.destroy(),
this.element.removeEventListener(
"mousedown",
this.mousedownHandler,
{ capture: !0 }
),
this.editor.off("focus", this.focusHandler),
this.editor.off("blur", this.blurHandler);
}
}
const ey = (t) =>
new Tt({
key: typeof t.pluginKey == "string" ? new Ot(t.pluginKey) : t.pluginKey,
view: (e) => new TM(W({ view: e }, t)),
});
Et.create({
name: "floatingMenu",
addOptions() {
return {
element: null,
tippyOptions: {},
pluginKey: "floatingMenu",
shouldShow: null,
};
},
addProseMirrorPlugins() {
return this.options.element
? [
ey({
pluginKey: this.options.pluginKey,
editor: this.editor,
element: this.options.element,
tippyOptions: this.options.tippyOptions,
shouldShow: this.options.shouldShow,
}),
]
: [];
},
});
const AR = xe({
name: "BubbleMenu",
props: {
pluginKey: { type: [String, Object], default: "bubbleMenu" },
editor: { type: Object, required: !0 },
updateDelay: { type: Number, default: void 0 },
tippyOptions: { type: Object, default: () => ({}) },
shouldShow: { type: Function, default: null },
},
setup(t, { slots: e }) {
const n = oe(null);
return (
Ye(() => {
const {
updateDelay: r,
editor: i,
pluginKey: o,
shouldShow: s,
tippyOptions: l,
} = t;
i.registerPlugin(
Z0({
updateDelay: r,
editor: i,
element: n.value,
pluginKey: o,
shouldShow: s,
tippyOptions: l,
})
);
}),
fs(() => {
const { pluginKey: r, editor: i } = t;
i.unregisterPlugin(r);
}),
() => {
var r;
return ze(
"div",
{ ref: n },
(r = e.default) === null || r === void 0
? void 0
: r.call(e)
);
}
);
},
});
const TR = xe({
name: "EditorContent",
props: { editor: { default: null, type: Object } },
setup(t) {
const e = oe(),
n = ps();
return (
Mt(() => {
const r = t.editor;
r &&
r.options.element &&
e.value &&
Ct(() => {
if (!e.value || !r.options.element.firstChild)
return;
const i = ne(e.value);
e.value.append(...r.options.element.childNodes),
(r.contentComponent = n.ctx._),
r.setOptions({ element: i }),
r.createNodeViews();
});
}),
fs(() => {
const r = t.editor;
if (
!r ||
(r.isDestroyed || r.view.setProps({ nodeViews: {} }),
(r.contentComponent = null),
!r.options.element.firstChild)
)
return;
const i = document.createElement("div");
i.append(...r.options.element.childNodes),
r.setOptions({ element: i });
}),
{ rootEl: e }
);
},
render() {
const t = [];
return (
this.editor &&
this.editor.vueRenderers.forEach((e) => {
const n = ze(
xd,
{ to: e.teleportElement, key: e.id },
ze(e.component, W({ ref: e.id }, e.props))
);
t.push(n);
}),
ze(
"div",
{
ref: (e) => {
this.rootEl = e;
},
},
...t
)
);
},
}),
OR = xe({
name: "FloatingMenu",
props: {
pluginKey: { type: null, default: "floatingMenu" },
editor: { type: Object, required: !0 },
tippyOptions: { type: Object, default: () => ({}) },
shouldShow: { type: Function, default: null },
},
setup(t, { slots: e }) {
const n = oe(null);
return (
Ye(() => {
const {
pluginKey: r,
editor: i,
tippyOptions: o,
shouldShow: s,
} = t;
i.registerPlugin(
ey({
pluginKey: r,
editor: i,
element: n.value,
tippyOptions: o,
shouldShow: s,
})
);
}),
fs(() => {
const { pluginKey: r, editor: i } = t;
i.unregisterPlugin(r);
}),
() => {
var r;
return ze(
"div",
{ ref: n },
(r = e.default) === null || r === void 0
? void 0
: r.call(e)
);
}
);
},
});
xe({
name: "NodeViewContent",
props: { as: { type: String, default: "div" } },
render() {
return ze(this.as, {
style: { whiteSpace: "pre-wrap" },
"data-node-view-content": "",
});
},
});
xe({
name: "NodeViewWrapper",
props: { as: { type: String, default: "div" } },
inject: ["onDragStart", "decorationClasses"],
render() {
var t, e;
return ze(
this.as,
{
class: this.decorationClasses,
style: { whiteSpace: "normal" },
"data-node-view-wrapper": "",
onDragstart: this.onDragStart,
},
(e = (t = this.$slots).default) === null || e === void 0
? void 0
: e.call(t)
);
},
});
const OM = /^\s*>\s$/,
RM = ut.create({
name: "blockquote",
addOptions() {
return { HTMLAttributes: {} };
},
content: "block+",
group: "block",
defining: !0,
parseHTML() {
return [{ tag: "blockquote" }];
},
renderHTML({ HTMLAttributes: t }) {
return ["blockquote", et(this.options.HTMLAttributes, t), 0];
},
addCommands() {
return {
setBlockquote:
() =>
({ commands: t }) =>
t.wrapIn(this.name),
toggleBlockquote:
() =>
({ commands: t }) =>
t.toggleWrap(this.name),
unsetBlockquote:
() =>
({ commands: t }) =>
t.lift(this.name),
};
},
addKeyboardShortcuts() {
return {
"Mod-Shift-b": () => this.editor.commands.toggleBlockquote(),
};
},
addInputRules() {
return [ss({ find: OM, type: this.type })];
},
}),
PM = /(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,
NM = /(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,
jM = /(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,
LM = /(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,
DM = Cn.create({
name: "bold",
addOptions() {
return { HTMLAttributes: {} };
},
parseHTML() {
return [
{ tag: "strong" },
{
tag: "b",
getAttrs: (t) => t.style.fontWeight !== "normal" && null,
},
{
style: "font-weight",
getAttrs: (t) =>
/^(bold(er)?|[5-9]\d{2,})$/.test(t) && null,
},
];
},
renderHTML({ HTMLAttributes: t }) {
return ["strong", et(this.options.HTMLAttributes, t), 0];
},
addCommands() {
return {
setBold:
() =>
({ commands: t }) =>
t.setMark(this.name),
toggleBold:
() =>
({ commands: t }) =>
t.toggleMark(this.name),
unsetBold:
() =>
({ commands: t }) =>
t.unsetMark(this.name),
};
},
addKeyboardShortcuts() {
return {
"Mod-b": () => this.editor.commands.toggleBold(),
"Mod-B": () => this.editor.commands.toggleBold(),
};
},
addInputRules() {
return [
bi({ find: PM, type: this.type }),
bi({ find: jM, type: this.type }),
];
},
addPasteRules() {
return [
Dr({ find: NM, type: this.type }),
Dr({ find: LM, type: this.type }),
];
},
}),
IM = ut.create({
name: "listItem",
addOptions() {
return {
HTMLAttributes: {},
bulletListTypeName: "bulletList",
orderedListTypeName: "orderedList",
};
},
content: "paragraph block*",
defining: !0,
parseHTML() {
return [{ tag: "li" }];
},
renderHTML({ HTMLAttributes: t }) {
return ["li", et(this.options.HTMLAttributes, t), 0];
},
addKeyboardShortcuts() {
return {
Enter: () => this.editor.commands.splitListItem(this.name),
Tab: () => this.editor.commands.sinkListItem(this.name),
"Shift-Tab": () => this.editor.commands.liftListItem(this.name),
};
},
}),
qp = Cn.create({
name: "textStyle",
addOptions() {
return { HTMLAttributes: {} };
},
parseHTML() {
return [
{
tag: "span",
getAttrs: (t) => (t.hasAttribute("style") ? {} : !1),
},
];
},
renderHTML({ HTMLAttributes: t }) {
return ["span", et(this.options.HTMLAttributes, t), 0];
},
addCommands() {
return {
removeEmptyTextStyle:
() =>
({ state: t, commands: e }) => {
const n = ks(t, this.type);
return Object.entries(n).some(([, i]) => !!i)
? !0
: e.unsetMark(this.name);
},
};
},
}),
Jp = /^\s*([-+*])\s$/,
BM = ut.create({
name: "bulletList",
addOptions() {
return {
itemTypeName: "listItem",
HTMLAttributes: {},
keepMarks: !1,
keepAttributes: !1,
};
},
group: "block list",
content() {
return `${this.options.itemTypeName}+`;
},
parseHTML() {
return [{ tag: "ul" }];
},
renderHTML({ HTMLAttributes: t }) {
return ["ul", et(this.options.HTMLAttributes, t), 0];
},
addCommands() {
return {
toggleBulletList:
() =>
({ commands: t, chain: e }) =>
this.options.keepAttributes
? e()
.toggleList(
this.name,
this.options.itemTypeName,
this.options.keepMarks
)
.updateAttributes(
IM.name,
this.editor.getAttributes(qp.name)
)
.run()
: t.toggleList(
this.name,
this.options.itemTypeName,
this.options.keepMarks
),
};
},
addKeyboardShortcuts() {
return {
"Mod-Shift-8": () => this.editor.commands.toggleBulletList(),
};
},
addInputRules() {
let t = ss({ find: Jp, type: this.type });
return (
(this.options.keepMarks || this.options.keepAttributes) &&
(t = ss({
find: Jp,
type: this.type,
keepMarks: this.options.keepMarks,
keepAttributes: this.options.keepAttributes,
getAttributes: () => this.editor.getAttributes(qp.name),
editor: this.editor,
})),
[t]
);
},
}),
$M = /(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,
zM = /(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,
HM = Cn.create({
name: "code",
addOptions() {
return { HTMLAttributes: {} };
},
excludes: "_",
code: !0,
exitable: !0,
parseHTML() {
return [{ tag: "code" }];
},
renderHTML({ HTMLAttributes: t }) {
return ["code", et(this.options.HTMLAttributes, t), 0];
},
addCommands() {
return {
setCode:
() =>
({ commands: t }) =>
t.setMark(this.name),
toggleCode:
() =>
({ commands: t }) =>
t.toggleMark(this.name),
unsetCode:
() =>
({ commands: t }) =>
t.unsetMark(this.name),
};
},
addKeyboardShortcuts() {
return { "Mod-e": () => this.editor.commands.toggleCode() };
},
addInputRules() {
return [bi({ find: $M, type: this.type })];
},
addPasteRules() {
return [Dr({ find: zM, type: this.type })];
},
}),
FM = /^```([a-z]+)?[\s\n]$/,
VM = /^~~~([a-z]+)?[\s\n]$/,
WM = ut.create({
name: "codeBlock",
addOptions() {
return {
languageClassPrefix: "language-",
exitOnTripleEnter: !0,
exitOnArrowDown: !0,
HTMLAttributes: {},
};
},
content: "text*",
marks: "",
group: "block",
code: !0,
defining: !0,
addAttributes() {
return {
language: {
default: null,
parseHTML: (t) => {
var e;
const { languageClassPrefix: n } = this.options,
o = [
...(((e = t.firstElementChild) === null ||
e === void 0
? void 0
: e.classList) || []),
]
.filter((s) => s.startsWith(n))
.map((s) => s.replace(n, ""))[0];
return o || null;
},
rendered: !1,
},
};
},
parseHTML() {
return [{ tag: "pre", preserveWhitespace: "full" }];
},
renderHTML({ node: t, HTMLAttributes: e }) {
return [
"pre",
et(this.options.HTMLAttributes, e),
[
"code",
{
class: t.attrs.language
? this.options.languageClassPrefix +
t.attrs.language
: null,
},
0,
],
];
},
addCommands() {
return {
setCodeBlock:
(t) =>
({ commands: e }) =>
e.setNode(this.name, t),
toggleCodeBlock:
(t) =>
({ commands: e }) =>
e.toggleNode(this.name, "paragraph", t),
};
},
addKeyboardShortcuts() {
return {
"Mod-Alt-c": () => this.editor.commands.toggleCodeBlock(),
Backspace: () => {
const { empty: t, $anchor: e } =
this.editor.state.selection,
n = e.pos === 1;
return !t || e.parent.type.name !== this.name
? !1
: n || !e.parent.textContent.length
? this.editor.commands.clearNodes()
: !1;
},
Enter: ({ editor: t }) => {
if (!this.options.exitOnTripleEnter) return !1;
const { state: e } = t,
{ selection: n } = e,
{ $from: r, empty: i } = n;
if (!i || r.parent.type !== this.type) return !1;
const o = r.parentOffset === r.parent.nodeSize - 2,
s = r.parent.textContent.endsWith(`
`);
return !o || !s
? !1
: t
.chain()
.command(
({ tr: l }) => (
l.delete(r.pos - 2, r.pos), !0
)
)
.exitCode()
.run();
},
ArrowDown: ({ editor: t }) => {
if (!this.options.exitOnArrowDown) return !1;
const { state: e } = t,
{ selection: n, doc: r } = e,
{ $from: i, empty: o } = n;
if (
!o ||
i.parent.type !== this.type ||
!(i.parentOffset === i.parent.nodeSize - 2)
)
return !1;
const l = i.after();
return l === void 0 || r.nodeAt(l)
? !1
: t.commands.exitCode();
},
};
},
addInputRules() {
return [
Lc({
find: FM,
type: this.type,
getAttributes: (t) => ({ language: t[1] }),
}),
Lc({
find: VM,
type: this.type,
getAttributes: (t) => ({ language: t[1] }),
}),
];
},
addProseMirrorPlugins() {
return [
new Tt({
key: new Ot("codeBlockVSCodeHandler"),
props: {
handlePaste: (t, e) => {
if (
!e.clipboardData ||
this.editor.isActive(this.type.name)
)
return !1;
const n = e.clipboardData.getData("text/plain"),
r =
e.clipboardData.getData(
"vscode-editor-data"
),
i = r ? JSON.parse(r) : void 0,
o = i == null ? void 0 : i.mode;
if (!n || !o) return !1;
const { tr: s } = t.state;
return (
s.replaceSelectionWith(
this.type.create({ language: o })
),
s.setSelection(
Ce.near(
s.doc.resolve(
Math.max(0, s.selection.from - 2)
)
)
),
s.insertText(
n.replace(
/\r\n?/g,
`
`
)
),
s.setMeta("paste", !0),
t.dispatch(s),
!0
);
},
},
}),
];
},
}),
UM = ut.create({ name: "doc", topNode: !0, content: "block+" });
function KM(t = {}) {
return new Tt({
view(e) {
return new qM(e, t);
},
});
}
class qM {
constructor(e, n) {
var r;
(this.editorView = e),
(this.cursorPos = null),
(this.element = null),
(this.timeout = -1),
(this.width = (r = n.width) !== null && r !== void 0 ? r : 1),
(this.color = n.color === !1 ? void 0 : n.color || "black"),
(this.class = n.class),
(this.handlers = ["dragover", "dragend", "drop", "dragleave"].map(
(i) => {
let o = (s) => {
this[i](s);
};
return (
e.dom.addEventListener(i, o), { name: i, handler: o }
);
}
));
}
destroy() {
this.handlers.forEach(({ name: e, handler: n }) =>
this.editorView.dom.removeEventListener(e, n)
);
}
update(e, n) {
this.cursorPos != null &&
n.doc != e.state.doc &&
(this.cursorPos > e.state.doc.content.size
? this.setCursor(null)
: this.updateOverlay());
}
setCursor(e) {
e != this.cursorPos &&
((this.cursorPos = e),
e == null
? (this.element.parentNode.removeChild(this.element),
(this.element = null))
: this.updateOverlay());
}
updateOverlay() {
let e = this.editorView.state.doc.resolve(this.cursorPos),
n = !e.parent.inlineContent,
r;
if (n) {
let l = e.nodeBefore,
a = e.nodeAfter;
if (l || a) {
let u = this.editorView.nodeDOM(
this.cursorPos - (l ? l.nodeSize : 0)
);
if (u) {
let c = u.getBoundingClientRect(),
f = l ? c.bottom : c.top;
l &&
a &&
(f =
(f +
this.editorView
.nodeDOM(this.cursorPos)
.getBoundingClientRect().top) /
2),
(r = {
left: c.left,
right: c.right,
top: f - this.width / 2,
bottom: f + this.width / 2,
});
}
}
}
if (!r) {
let l = this.editorView.coordsAtPos(this.cursorPos);
r = {
left: l.left - this.width / 2,
right: l.left + this.width / 2,
top: l.top,
bottom: l.bottom,
};
}
let i = this.editorView.dom.offsetParent;
this.element ||
((this.element = i.appendChild(document.createElement("div"))),
this.class && (this.element.className = this.class),
(this.element.style.cssText =
"position: absolute; z-index: 50; pointer-events: none;"),
this.color && (this.element.style.backgroundColor = this.color)),
this.element.classList.toggle("prosemirror-dropcursor-block", n),
this.element.classList.toggle("prosemirror-dropcursor-inline", !n);
let o, s;
if (
!i ||
(i == document.body && getComputedStyle(i).position == "static")
)
(o = -pageXOffset), (s = -pageYOffset);
else {
let l = i.getBoundingClientRect();
(o = l.left - i.scrollLeft), (s = l.top - i.scrollTop);
}
(this.element.style.left = r.left - o + "px"),
(this.element.style.top = r.top - s + "px"),
(this.element.style.width = r.right - r.left + "px"),
(this.element.style.height = r.bottom - r.top + "px");
}
scheduleRemoval(e) {
clearTimeout(this.timeout),
(this.timeout = setTimeout(() => this.setCursor(null), e));
}
dragover(e) {
if (!this.editorView.editable) return;
let n = this.editorView.posAtCoords({
left: e.clientX,
top: e.clientY,
}),
r =
n &&
n.inside >= 0 &&
this.editorView.state.doc.nodeAt(n.inside),
i = r && r.type.spec.disableDropCursor,
o = typeof i == "function" ? i(this.editorView, n, e) : i;
if (n && !o) {
let s = n.pos;
if (this.editorView.dragging && this.editorView.dragging.slice) {
let l = r0(
this.editorView.state.doc,
s,
this.editorView.dragging.slice
);
l != null && (s = l);
}
this.setCursor(s), this.scheduleRemoval(5e3);
}
}
dragend() {
this.scheduleRemoval(20);
}
drop() {
this.scheduleRemoval(20);
}
dragleave(e) {
(e.target == this.editorView.dom ||
!this.editorView.dom.contains(e.relatedTarget)) &&
this.setCursor(null);
}
}
const JM = Et.create({
name: "dropCursor",
addOptions() {
return { color: "currentColor", width: 1, class: void 0 };
},
addProseMirrorPlugins() {
return [KM(this.options)];
},
});
class ht extends Se {
constructor(e) {
super(e, e);
}
map(e, n) {
let r = e.resolve(n.map(this.head));
return ht.valid(r) ? new ht(r) : Se.near(r);
}
content() {
return ie.empty;
}
eq(e) {
return e instanceof ht && e.head == this.head;
}
toJSON() {
return { type: "gapcursor", pos: this.head };
}
static fromJSON(e, n) {
if (typeof n.pos != "number")
throw new RangeError("Invalid input for GapCursor.fromJSON");
return new ht(e.resolve(n.pos));
}
getBookmark() {
return new wf(this.anchor);
}
static valid(e) {
let n = e.parent;
if (n.isTextblock || !GM(e) || !YM(e)) return !1;
let r = n.type.spec.allowGapCursor;
if (r != null) return r;
let i = n.contentMatchAt(e.index()).defaultType;
return i && i.isTextblock;
}
static findGapCursorFrom(e, n, r = !1) {
e: for (;;) {
if (!r && ht.valid(e)) return e;
let i = e.pos,
o = null;
for (let s = e.depth; ; s--) {
let l = e.node(s);
if (n > 0 ? e.indexAfter(s) < l.childCount : e.index(s) > 0) {
o = l.child(n > 0 ? e.indexAfter(s) : e.index(s) - 1);
break;
} else if (s == 0) return null;
i += n;
let a = e.doc.resolve(i);
if (ht.valid(a)) return a;
}
for (;;) {
let s = n > 0 ? o.firstChild : o.lastChild;
if (!s) {
if (o.isAtom && !o.isText && !ve.isSelectable(o)) {
(e = e.doc.resolve(i + o.nodeSize * n)), (r = !1);
continue e;
}
break;
}
(o = s), (i += n);
let l = e.doc.resolve(i);
if (ht.valid(l)) return l;
}
return null;
}
}
}
ht.prototype.visible = !1;
ht.findFrom = ht.findGapCursorFrom;
Se.jsonID("gapcursor", ht);
class wf {
constructor(e) {
this.pos = e;
}
map(e) {
return new wf(e.map(this.pos));
}
resolve(e) {
let n = e.resolve(this.pos);
return ht.valid(n) ? new ht(n) : Se.near(n);
}
}
function GM(t) {
for (let e = t.depth; e >= 0; e--) {
let n = t.index(e),
r = t.node(e);
if (n == 0) {
if (r.type.spec.isolating) return !0;
continue;
}
for (let i = r.child(n - 1); ; i = i.lastChild) {
if (
(i.childCount == 0 && !i.inlineContent) ||
i.isAtom ||
i.type.spec.isolating
)
return !0;
if (i.inlineContent) return !1;
}
}
return !0;
}
function YM(t) {
for (let e = t.depth; e >= 0; e--) {
let n = t.indexAfter(e),
r = t.node(e);
if (n == r.childCount) {
if (r.type.spec.isolating) return !0;
continue;
}
for (let i = r.child(n); ; i = i.firstChild) {
if (
(i.childCount == 0 && !i.inlineContent) ||
i.isAtom ||
i.type.spec.isolating
)
return !0;
if (i.inlineContent) return !1;
}
}
return !0;
}
function QM() {
return new Tt({
props: {
decorations: tE,
createSelectionBetween(t, e, n) {
return e.pos == n.pos && ht.valid(n) ? new ht(n) : null;
},
handleClick: ZM,
handleKeyDown: XM,
handleDOMEvents: { beforeinput: eE },
},
});
}
const XM = L0({
ArrowLeft: Us("horiz", -1),
ArrowRight: Us("horiz", 1),
ArrowUp: Us("vert", -1),
ArrowDown: Us("vert", 1),
});
function Us(t, e) {
const n = t == "vert" ? (e > 0 ? "down" : "up") : e > 0 ? "right" : "left";
return function (r, i, o) {
let s = r.selection,
l = e > 0 ? s.$to : s.$from,
a = s.empty;
if (s instanceof Ce) {
if (!o.endOfTextblock(n) || l.depth == 0) return !1;
(a = !1), (l = r.doc.resolve(e > 0 ? l.after() : l.before()));
}
let u = ht.findGapCursorFrom(l, e, a);
return u ? (i && i(r.tr.setSelection(new ht(u))), !0) : !1;
};
}
function ZM(t, e, n) {
if (!t || !t.editable) return !1;
let r = t.state.doc.resolve(e);
if (!ht.valid(r)) return !1;
let i = t.posAtCoords({ left: n.clientX, top: n.clientY });
return i && i.inside > -1 && ve.isSelectable(t.state.doc.nodeAt(i.inside))
? !1
: (t.dispatch(t.state.tr.setSelection(new ht(r))), !0);
}
function eE(t, e) {
if (
e.inputType != "insertCompositionText" ||
!(t.state.selection instanceof ht)
)
return !1;
let { $from: n } = t.state.selection,
r = n.parent
.contentMatchAt(n.index())
.findWrapping(t.state.schema.nodes.text);
if (!r) return !1;
let i = Y.empty;
for (let s = r.length - 1; s >= 0; s--)
i = Y.from(r[s].createAndFill(null, i));
let o = t.state.tr.replace(n.pos, n.pos, new ie(i, 0, 0));
return o.setSelection(Ce.near(o.doc.resolve(n.pos + 1))), t.dispatch(o), !1;
}
function tE(t) {
if (!(t.selection instanceof ht)) return null;
let e = document.createElement("div");
return (
(e.className = "ProseMirror-gapcursor"),
st.create(t.doc, [Xt.widget(t.selection.head, e, { key: "gapcursor" })])
);
}
const nE = Et.create({
name: "gapCursor",
addProseMirrorPlugins() {
return [QM()];
},
extendNodeSchema(t) {
var e;
const n = { name: t.name, options: t.options, storage: t.storage };
return {
allowGapCursor:
(e = lt(bt(t, "allowGapCursor", n))) !== null &&
e !== void 0
? e
: null,
};
},
}),
rE = ut.create({
name: "hardBreak",
addOptions() {
return { keepMarks: !0, HTMLAttributes: {} };
},
inline: !0,
group: "inline",
selectable: !1,
parseHTML() {
return [{ tag: "br" }];
},
renderHTML({ HTMLAttributes: t }) {
return ["br", et(this.options.HTMLAttributes, t)];
},
renderText() {
return `
`;
},
addCommands() {
return {
setHardBreak:
() =>
({ commands: t, chain: e, state: n, editor: r }) =>
t.first([
() => t.exitCode(),
() =>
t.command(() => {
const { selection: i, storedMarks: o } = n;
if (i.$from.parent.type.spec.isolating)
return !1;
const { keepMarks: s } = this.options,
{ splittableMarks: l } =
r.extensionManager,
a =
o ||
(i.$to.parentOffset &&
i.$from.marks());
return e()
.insertContent({ type: this.name })
.command(({ tr: u, dispatch: c }) => {
if (c && a && s) {
const f = a.filter((h) =>
l.includes(h.type.name)
);
u.ensureMarks(f);
}
return !0;
})
.run();
}),
]),
};
},
addKeyboardShortcuts() {
return {
"Mod-Enter": () => this.editor.commands.setHardBreak(),
"Shift-Enter": () => this.editor.commands.setHardBreak(),
};
},
}),
iE = ut.create({
name: "heading",
addOptions() {
return { levels: [1, 2, 3, 4, 5, 6], HTMLAttributes: {} };
},
content: "inline*",
group: "block",
defining: !0,
addAttributes() {
return { level: { default: 1, rendered: !1 } };
},
parseHTML() {
return this.options.levels.map((t) => ({
tag: `h${t}`,
attrs: { level: t },
}));
},
renderHTML({ node: t, HTMLAttributes: e }) {
return [
`h${
this.options.levels.includes(t.attrs.level)
? t.attrs.level
: this.options.levels[0]
}`,
et(this.options.HTMLAttributes, e),
0,
];
},
addCommands() {
return {
setHeading:
(t) =>
({ commands: e }) =>
this.options.levels.includes(t.level)
? e.setNode(this.name, t)
: !1,
toggleHeading:
(t) =>
({ commands: e }) =>
this.options.levels.includes(t.level)
? e.toggleNode(this.name, "paragraph", t)
: !1,
};
},
addKeyboardShortcuts() {
return this.options.levels.reduce(
(t, e) =>
be(W({}, t), {
[`Mod-Alt-${e}`]: () =>
this.editor.commands.toggleHeading({ level: e }),
}),
{}
);
},
addInputRules() {
return this.options.levels.map((t) =>
Lc({
find: new RegExp(`^(#{1,${t}})\\s$`),
type: this.type,
getAttributes: { level: t },
})
);
},
});
var Fl = 200,
Nt = function () {};
Nt.prototype.append = function (e) {
return e.length
? ((e = Nt.from(e)),
(!this.length && e) ||
(e.length < Fl && this.leafAppend(e)) ||
(this.length < Fl && e.leafPrepend(this)) ||
this.appendInner(e))
: this;
};
Nt.prototype.prepend = function (e) {
return e.length ? Nt.from(e).append(this) : this;
};
Nt.prototype.appendInner = function (e) {
return new oE(this, e);
};
Nt.prototype.slice = function (e, n) {
return (
e === void 0 && (e = 0),
n === void 0 && (n = this.length),
e >= n
? Nt.empty
: this.sliceInner(Math.max(0, e), Math.min(this.length, n))
);
};
Nt.prototype.get = function (e) {
if (!(e < 0 || e >= this.length)) return this.getInner(e);
};
Nt.prototype.forEach = function (e, n, r) {
n === void 0 && (n = 0),
r === void 0 && (r = this.length),
n <= r
? this.forEachInner(e, n, r, 0)
: this.forEachInvertedInner(e, n, r, 0);
};
Nt.prototype.map = function (e, n, r) {
n === void 0 && (n = 0), r === void 0 && (r = this.length);
var i = [];
return (
this.forEach(
function (o, s) {
return i.push(e(o, s));
},
n,
r
),
i
);
};
Nt.from = function (e) {
return e instanceof Nt ? e : e && e.length ? new ty(e) : Nt.empty;
};
var ty = (function (t) {
function e(r) {
t.call(this), (this.values = r);
}
t && (e.__proto__ = t),
(e.prototype = Object.create(t && t.prototype)),
(e.prototype.constructor = e);
var n = { length: { configurable: !0 }, depth: { configurable: !0 } };
return (
(e.prototype.flatten = function () {
return this.values;
}),
(e.prototype.sliceInner = function (i, o) {
return i == 0 && o == this.length
? this
: new e(this.values.slice(i, o));
}),
(e.prototype.getInner = function (i) {
return this.values[i];
}),
(e.prototype.forEachInner = function (i, o, s, l) {
for (var a = o; a < s; a++)
if (i(this.values[a], l + a) === !1) return !1;
}),
(e.prototype.forEachInvertedInner = function (i, o, s, l) {
for (var a = o - 1; a >= s; a--)
if (i(this.values[a], l + a) === !1) return !1;
}),
(e.prototype.leafAppend = function (i) {
if (this.length + i.length <= Fl)
return new e(this.values.concat(i.flatten()));
}),
(e.prototype.leafPrepend = function (i) {
if (this.length + i.length <= Fl)
return new e(i.flatten().concat(this.values));
}),
(n.length.get = function () {
return this.values.length;
}),
(n.depth.get = function () {
return 0;
}),
Object.defineProperties(e.prototype, n),
e
);
})(Nt);
Nt.empty = new ty([]);
var oE = (function (t) {
function e(n, r) {
t.call(this),
(this.left = n),
(this.right = r),
(this.length = n.length + r.length),
(this.depth = Math.max(n.depth, r.depth) + 1);
}
return (
t && (e.__proto__ = t),
(e.prototype = Object.create(t && t.prototype)),
(e.prototype.constructor = e),
(e.prototype.flatten = function () {
return this.left.flatten().concat(this.right.flatten());
}),
(e.prototype.getInner = function (r) {
return r < this.left.length
? this.left.get(r)
: this.right.get(r - this.left.length);
}),
(e.prototype.forEachInner = function (r, i, o, s) {
var l = this.left.length;
if (
(i < l &&
this.left.forEachInner(r, i, Math.min(o, l), s) === !1) ||
(o > l &&
this.right.forEachInner(
r,
Math.max(i - l, 0),
Math.min(this.length, o) - l,
s + l
) === !1)
)
return !1;
}),
(e.prototype.forEachInvertedInner = function (r, i, o, s) {
var l = this.left.length;
if (
(i > l &&
this.right.forEachInvertedInner(
r,
i - l,
Math.max(o, l) - l,
s + l
) === !1) ||
(o < l &&
this.left.forEachInvertedInner(r, Math.min(i, l), o, s) ===
!1)
)
return !1;
}),
(e.prototype.sliceInner = function (r, i) {
if (r == 0 && i == this.length) return this;
var o = this.left.length;
return i <= o
? this.left.slice(r, i)
: r >= o
? this.right.slice(r - o, i - o)
: this.left.slice(r, o).append(this.right.slice(0, i - o));
}),
(e.prototype.leafAppend = function (r) {
var i = this.right.leafAppend(r);
if (i) return new e(this.left, i);
}),
(e.prototype.leafPrepend = function (r) {
var i = this.left.leafPrepend(r);
if (i) return new e(i, this.right);
}),
(e.prototype.appendInner = function (r) {
return this.left.depth >= Math.max(this.right.depth, r.depth) + 1
? new e(this.left, new e(this.right, r))
: new e(this, r);
}),
e
);
})(Nt);
const sE = 500;
class En {
constructor(e, n) {
(this.items = e), (this.eventCount = n);
}
popEvent(e, n) {
if (this.eventCount == 0) return null;
let r = this.items.length;
for (; ; r--)
if (this.items.get(r - 1).selection) {
--r;
break;
}
let i, o;
n && ((i = this.remapping(r, this.items.length)), (o = i.maps.length));
let s = e.tr,
l,
a,
u = [],
c = [];
return (
this.items.forEach(
(f, h) => {
if (!f.step) {
i ||
((i = this.remapping(r, h + 1)),
(o = i.maps.length)),
o--,
c.push(f);
return;
}
if (i) {
c.push(new In(f.map));
let p = f.step.map(i.slice(o)),
g;
p &&
s.maybeStep(p).doc &&
((g = s.mapping.maps[s.mapping.maps.length - 1]),
u.push(
new In(g, void 0, void 0, u.length + c.length)
)),
o--,
g && i.appendMap(g, o);
} else s.maybeStep(f.step);
if (f.selection)
return (
(l = i ? f.selection.map(i.slice(o)) : f.selection),
(a = new En(
this.items
.slice(0, r)
.append(c.reverse().concat(u)),
this.eventCount - 1
)),
!1
);
},
this.items.length,
0
),
{ remaining: a, transform: s, selection: l }
);
}
addTransform(e, n, r, i) {
let o = [],
s = this.eventCount,
l = this.items,
a = !i && l.length ? l.get(l.length - 1) : null;
for (let c = 0; c < e.steps.length; c++) {
let f = e.steps[c].invert(e.docs[c]),
h = new In(e.mapping.maps[c], f, n),
p;
(p = a && a.merge(h)) &&
((h = p), c ? o.pop() : (l = l.slice(0, l.length - 1))),
o.push(h),
n && (s++, (n = void 0)),
i || (a = h);
}
let u = s - r.depth;
return u > aE && ((l = lE(l, u)), (s -= u)), new En(l.append(o), s);
}
remapping(e, n) {
let r = new $i();
return (
this.items.forEach(
(i, o) => {
let s =
i.mirrorOffset != null && o - i.mirrorOffset >= e
? r.maps.length - i.mirrorOffset
: void 0;
r.appendMap(i.map, s);
},
e,
n
),
r
);
}
addMaps(e) {
return this.eventCount == 0
? this
: new En(
this.items.append(e.map((n) => new In(n))),
this.eventCount
);
}
rebased(e, n) {
if (!this.eventCount) return this;
let r = [],
i = Math.max(0, this.items.length - n),
o = e.mapping,
s = e.steps.length,
l = this.eventCount;
this.items.forEach((h) => {
h.selection && l--;
}, i);
let a = n;
this.items.forEach((h) => {
let p = o.getMirror(--a);
if (p == null) return;
s = Math.min(s, p);
let g = o.maps[p];
if (h.step) {
let v = e.steps[p].invert(e.docs[p]),
b = h.selection && h.selection.map(o.slice(a + 1, p));
b && l++, r.push(new In(g, v, b));
} else r.push(new In(g));
}, i);
let u = [];
for (let h = n; h < s; h++) u.push(new In(o.maps[h]));
let c = this.items.slice(0, i).append(u).append(r),
f = new En(c, l);
return (
f.emptyItemCount() > sE &&
(f = f.compress(this.items.length - r.length)),
f
);
}
emptyItemCount() {
let e = 0;
return (
this.items.forEach((n) => {
n.step || e++;
}),
e
);
}
compress(e = this.items.length) {
let n = this.remapping(0, e),
r = n.maps.length,
i = [],
o = 0;
return (
this.items.forEach(
(s, l) => {
if (l >= e) i.push(s), s.selection && o++;
else if (s.step) {
let a = s.step.map(n.slice(r)),
u = a && a.getMap();
if ((r--, u && n.appendMap(u, r), a)) {
let c = s.selection && s.selection.map(n.slice(r));
c && o++;
let f = new In(u.invert(), a, c),
h,
p = i.length - 1;
(h = i.length && i[p].merge(f))
? (i[p] = h)
: i.push(f);
}
} else s.map && r--;
},
this.items.length,
0
),
new En(Nt.from(i.reverse()), o)
);
}
}
En.empty = new En(Nt.empty, 0);
function lE(t, e) {
let n;
return (
t.forEach((r, i) => {
if (r.selection && e-- == 0) return (n = i), !1;
}),
t.slice(n)
);
}
class In {
constructor(e, n, r, i) {
(this.map = e),
(this.step = n),
(this.selection = r),
(this.mirrorOffset = i);
}
merge(e) {
if (this.step && e.step && !e.selection) {
let n = e.step.merge(this.step);
if (n) return new In(n.getMap().invert(), n, this.selection);
}
}
}
class wr {
constructor(e, n, r, i, o) {
(this.done = e),
(this.undone = n),
(this.prevRanges = r),
(this.prevTime = i),
(this.prevComposition = o);
}
}
const aE = 20;
function uE(t, e, n, r) {
let i = n.getMeta(Nr),
o;
if (i) return i.historyState;
n.getMeta(dE) && (t = new wr(t.done, t.undone, null, 0, -1));
let s = n.getMeta("appendedTransaction");
if (n.steps.length == 0) return t;
if (s && s.getMeta(Nr))
return s.getMeta(Nr).redo
? new wr(
t.done.addTransform(n, void 0, r, ul(e)),
t.undone,
Gp(n.mapping.maps[n.steps.length - 1]),
t.prevTime,
t.prevComposition
)
: new wr(
t.done,
t.undone.addTransform(n, void 0, r, ul(e)),
null,
t.prevTime,
t.prevComposition
);
if (
n.getMeta("addToHistory") !== !1 &&
!(s && s.getMeta("addToHistory") === !1)
) {
let l = n.getMeta("composition"),
a =
t.prevTime == 0 ||
(!s &&
t.prevComposition != l &&
(t.prevTime < (n.time || 0) - r.newGroupDelay ||
!cE(n, t.prevRanges))),
u = s
? Iu(t.prevRanges, n.mapping)
: Gp(n.mapping.maps[n.steps.length - 1]);
return new wr(
t.done.addTransform(
n,
a ? e.selection.getBookmark() : void 0,
r,
ul(e)
),
En.empty,
u,
n.time,
l == null ? t.prevComposition : l
);
} else
return (o = n.getMeta("rebased"))
? new wr(
t.done.rebased(n, o),
t.undone.rebased(n, o),
Iu(t.prevRanges, n.mapping),
t.prevTime,
t.prevComposition
)
: new wr(
t.done.addMaps(n.mapping.maps),
t.undone.addMaps(n.mapping.maps),
Iu(t.prevRanges, n.mapping),
t.prevTime,
t.prevComposition
);
}
function cE(t, e) {
if (!e) return !1;
if (!t.docChanged) return !0;
let n = !1;
return (
t.mapping.maps[0].forEach((r, i) => {
for (let o = 0; o < e.length; o += 2)
r <= e[o + 1] && i >= e[o] && (n = !0);
}),
n
);
}
function Gp(t) {
let e = [];
return t.forEach((n, r, i, o) => e.push(i, o)), e;
}
function Iu(t, e) {
if (!t) return null;
let n = [];
for (let r = 0; r < t.length; r += 2) {
let i = e.map(t[r], 1),
o = e.map(t[r + 1], -1);
i <= o && n.push(i, o);
}
return n;
}
function ny(t, e, n, r) {
let i = ul(e),
o = Nr.get(e).spec.config,
s = (r ? t.undone : t.done).popEvent(e, i);
if (!s) return;
let l = s.selection.resolve(s.transform.doc),
a = (r ? t.done : t.undone).addTransform(
s.transform,
e.selection.getBookmark(),
o,
i
),
u = new wr(r ? a : s.remaining, r ? s.remaining : a, null, 0, -1);
n(
s.transform
.setSelection(l)
.setMeta(Nr, { redo: r, historyState: u })
.scrollIntoView()
);
}
let Bu = !1,
Yp = null;
function ul(t) {
let e = t.plugins;
if (Yp != e) {
(Bu = !1), (Yp = e);
for (let n = 0; n < e.length; n++)
if (e[n].spec.historyPreserveItems) {
Bu = !0;
break;
}
}
return Bu;
}
const Nr = new Ot("history"),
dE = new Ot("closeHistory");
function fE(t = {}) {
return (
(t = { depth: t.depth || 100, newGroupDelay: t.newGroupDelay || 500 }),
new Tt({
key: Nr,
state: {
init() {
return new wr(En.empty, En.empty, null, 0, -1);
},
apply(e, n, r) {
return uE(n, r, e, t);
},
},
config: t,
props: {
handleDOMEvents: {
beforeinput(e, n) {
let r = n.inputType,
i =
r == "historyUndo"
? ry
: r == "historyRedo"
? iy
: null;
return i
? (n.preventDefault(), i(e.state, e.dispatch))
: !1;
},
},
},
})
);
}
const ry = (t, e) => {
let n = Nr.getState(t);
return !n || n.done.eventCount == 0 ? !1 : (e && ny(n, t, e, !1), !0);
},
iy = (t, e) => {
let n = Nr.getState(t);
return !n || n.undone.eventCount == 0 ? !1 : (e && ny(n, t, e, !0), !0);
},
hE = Et.create({
name: "history",
addOptions() {
return { depth: 100, newGroupDelay: 500 };
},
addCommands() {
return {
undo:
() =>
({ state: t, dispatch: e }) =>
ry(t, e),
redo:
() =>
({ state: t, dispatch: e }) =>
iy(t, e),
};
},
addProseMirrorPlugins() {
return [fE(this.options)];
},
addKeyboardShortcuts() {
return {
"Mod-z": () => this.editor.commands.undo(),
"Mod-Z": () => this.editor.commands.undo(),
"Mod-y": () => this.editor.commands.redo(),
"Mod-Y": () => this.editor.commands.redo(),
"Shift-Mod-z": () => this.editor.commands.redo(),
"Shift-Mod-Z": () => this.editor.commands.redo(),
"Mod-\u044F": () => this.editor.commands.undo(),
"Shift-Mod-\u044F": () => this.editor.commands.redo(),
};
},
}),
pE = ut.create({
name: "horizontalRule",
addOptions() {
return { HTMLAttributes: {} };
},
group: "block",
parseHTML() {
return [{ tag: "hr" }];
},
renderHTML({ HTMLAttributes: t }) {
return ["hr", et(this.options.HTMLAttributes, t)];
},
addCommands() {
return {
setHorizontalRule:
() =>
({ chain: t, state: e }) => {
const { $to: n } = e.selection,
r = t();
return (
n.parentOffset === 0
? r.insertContentAt(Math.max(n.pos - 2, 0), {
type: this.name,
})
: r.insertContent({ type: this.name }),
r
.command(({ tr: i, dispatch: o }) => {
var s;
if (o) {
const { $to: l } = i.selection,
a = l.end();
if (l.nodeAfter)
l.nodeAfter.isTextblock
? i.setSelection(
Ce.create(
i.doc,
l.pos + 1
)
)
: l.nodeAfter.isBlock
? i.setSelection(
ve.create(i.doc, l.pos)
)
: i.setSelection(
Ce.create(i.doc, l.pos)
);
else {
const u =
(s =
l.parent.type.contentMatch
.defaultType) ===
null || s === void 0
? void 0
: s.create();
u &&
(i.insert(a, u),
i.setSelection(
Ce.create(i.doc, a + 1)
));
}
i.scrollIntoView();
}
return !0;
})
.run()
);
},
};
},
addInputRules() {
return [
W0({ find: /^(?:---|—-|___\s|\*\*\*\s)$/, type: this.type }),
];
},
}),
mE = /(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,
gE = /(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,
yE = /(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,
vE = /(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,
bE = Cn.create({
name: "italic",
addOptions() {
return { HTMLAttributes: {} };
},
parseHTML() {
return [
{ tag: "em" },
{
tag: "i",
getAttrs: (t) => t.style.fontStyle !== "normal" && null,
},
{ style: "font-style=italic" },
];
},
renderHTML({ HTMLAttributes: t }) {
return ["em", et(this.options.HTMLAttributes, t), 0];
},
addCommands() {
return {
setItalic:
() =>
({ commands: t }) =>
t.setMark(this.name),
toggleItalic:
() =>
({ commands: t }) =>
t.toggleMark(this.name),
unsetItalic:
() =>
({ commands: t }) =>
t.unsetMark(this.name),
};
},
addKeyboardShortcuts() {
return {
"Mod-i": () => this.editor.commands.toggleItalic(),
"Mod-I": () => this.editor.commands.toggleItalic(),
};
},
addInputRules() {
return [
bi({ find: mE, type: this.type }),
bi({ find: yE, type: this.type }),
];
},
addPasteRules() {
return [
Dr({ find: gE, type: this.type }),
Dr({ find: vE, type: this.type }),
];
},
}),
wE = ut.create({
name: "listItem",
addOptions() {
return {
HTMLAttributes: {},
bulletListTypeName: "bulletList",
orderedListTypeName: "orderedList",
};
},
content: "paragraph block*",
defining: !0,
parseHTML() {
return [{ tag: "li" }];
},
renderHTML({ HTMLAttributes: t }) {
return ["li", et(this.options.HTMLAttributes, t), 0];
},
addKeyboardShortcuts() {
return {
Enter: () => this.editor.commands.splitListItem(this.name),
Tab: () => this.editor.commands.sinkListItem(this.name),
"Shift-Tab": () => this.editor.commands.liftListItem(this.name),
};
},
}),
xE = ut.create({
name: "listItem",
addOptions() {
return {
HTMLAttributes: {},
bulletListTypeName: "bulletList",
orderedListTypeName: "orderedList",
};
},
content: "paragraph block*",
defining: !0,
parseHTML() {
return [{ tag: "li" }];
},
renderHTML({ HTMLAttributes: t }) {
return ["li", et(this.options.HTMLAttributes, t), 0];
},
addKeyboardShortcuts() {
return {
Enter: () => this.editor.commands.splitListItem(this.name),
Tab: () => this.editor.commands.sinkListItem(this.name),
"Shift-Tab": () => this.editor.commands.liftListItem(this.name),
};
},
}),
Qp = Cn.create({
name: "textStyle",
addOptions() {
return { HTMLAttributes: {} };
},
parseHTML() {
return [
{
tag: "span",
getAttrs: (t) => (t.hasAttribute("style") ? {} : !1),
},
];
},
renderHTML({ HTMLAttributes: t }) {
return ["span", et(this.options.HTMLAttributes, t), 0];
},
addCommands() {
return {
removeEmptyTextStyle:
() =>
({ state: t, commands: e }) => {
const n = ks(t, this.type);
return Object.entries(n).some(([, i]) => !!i)
? !0
: e.unsetMark(this.name);
},
};
},
}),
Xp = /^(\d+)\.\s$/,
kE = ut.create({
name: "orderedList",
addOptions() {
return {
itemTypeName: "listItem",
HTMLAttributes: {},
keepMarks: !1,
keepAttributes: !1,
};
},
group: "block list",
content() {
return `${this.options.itemTypeName}+`;
},
addAttributes() {
return {
start: {
default: 1,
parseHTML: (t) =>
t.hasAttribute("start")
? parseInt(t.getAttribute("start") || "", 10)
: 1,
},
};
},
parseHTML() {
return [{ tag: "ol" }];
},
renderHTML({ HTMLAttributes: t }) {
const r = t,
{ start: e } = r,
n = Qe(r, ["start"]);
return e === 1
? ["ol", et(this.options.HTMLAttributes, n), 0]
: ["ol", et(this.options.HTMLAttributes, t), 0];
},
addCommands() {
return {
toggleOrderedList:
() =>
({ commands: t, chain: e }) =>
this.options.keepAttributes
? e()
.toggleList(
this.name,
this.options.itemTypeName,
this.options.keepMarks
)
.updateAttributes(
xE.name,
this.editor.getAttributes(Qp.name)
)
.run()
: t.toggleList(
this.name,
this.options.itemTypeName,
this.options.keepMarks
),
};
},
addKeyboardShortcuts() {
return {
"Mod-Shift-7": () => this.editor.commands.toggleOrderedList(),
};
},
addInputRules() {
let t = ss({
find: Xp,
type: this.type,
getAttributes: (e) => ({ start: +e[1] }),
joinPredicate: (e, n) => n.childCount + n.attrs.start === +e[1],
});
return (
(this.options.keepMarks || this.options.keepAttributes) &&
(t = ss({
find: Xp,
type: this.type,
keepMarks: this.options.keepMarks,
keepAttributes: this.options.keepAttributes,
getAttributes: (e) =>
W(
{ start: +e[1] },
this.editor.getAttributes(Qp.name)
),
joinPredicate: (e, n) =>
n.childCount + n.attrs.start === +e[1],
editor: this.editor,
})),
[t]
);
},
}),
CE = ut.create({
name: "paragraph",
priority: 1e3,
addOptions() {
return { HTMLAttributes: {} };
},
group: "block",
content: "inline*",
parseHTML() {
return [{ tag: "p" }];
},
renderHTML({ HTMLAttributes: t }) {
return ["p", et(this.options.HTMLAttributes, t), 0];
},
addCommands() {
return {
setParagraph:
() =>
({ commands: t }) =>
t.setNode(this.name),
};
},
addKeyboardShortcuts() {
return { "Mod-Alt-0": () => this.editor.commands.setParagraph() };
},
}),
SE = /(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,
_E = /(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,
ME = Cn.create({
name: "strike",
addOptions() {
return { HTMLAttributes: {} };
},
parseHTML() {
return [
{ tag: "s" },
{ tag: "del" },
{ tag: "strike" },
{
style: "text-decoration",
consuming: !1,
getAttrs: (t) => (t.includes("line-through") ? {} : !1),
},
];
},
renderHTML({ HTMLAttributes: t }) {
return ["s", et(this.options.HTMLAttributes, t), 0];
},
addCommands() {
return {
setStrike:
() =>
({ commands: t }) =>
t.setMark(this.name),
toggleStrike:
() =>
({ commands: t }) =>
t.toggleMark(this.name),
unsetStrike:
() =>
({ commands: t }) =>
t.unsetMark(this.name),
};
},
addKeyboardShortcuts() {
const t = {};
return (
pf()
? (t["Mod-Shift-s"] = () =>
this.editor.commands.toggleStrike())
: (t["Ctrl-Shift-s"] = () =>
this.editor.commands.toggleStrike()),
t
);
},
addInputRules() {
return [bi({ find: SE, type: this.type })];
},
addPasteRules() {
return [Dr({ find: _E, type: this.type })];
},
}),
EE = ut.create({ name: "text", group: "inline" }),
RR = Et.create({
name: "starterKit",
addExtensions() {
var t, e, n, r, i, o, s, l, a, u, c, f, h, p, g, v, b, x;
const S = [];
return (
this.options.blockquote !== !1 &&
S.push(
RM.configure(
(t = this.options) === null || t === void 0
? void 0
: t.blockquote
)
),
this.options.bold !== !1 &&
S.push(
DM.configure(
(e = this.options) === null || e === void 0
? void 0
: e.bold
)
),
this.options.bulletList !== !1 &&
S.push(
BM.configure(
(n = this.options) === null || n === void 0
? void 0
: n.bulletList
)
),
this.options.code !== !1 &&
S.push(
HM.configure(
(r = this.options) === null || r === void 0
? void 0
: r.code
)
),
this.options.codeBlock !== !1 &&
S.push(
WM.configure(
(i = this.options) === null || i === void 0
? void 0
: i.codeBlock
)
),
this.options.document !== !1 &&
S.push(
UM.configure(
(o = this.options) === null || o === void 0
? void 0
: o.document
)
),
this.options.dropcursor !== !1 &&
S.push(
JM.configure(
(s = this.options) === null || s === void 0
? void 0
: s.dropcursor
)
),
this.options.gapcursor !== !1 &&
S.push(
nE.configure(
(l = this.options) === null || l === void 0
? void 0
: l.gapcursor
)
),
this.options.hardBreak !== !1 &&
S.push(
rE.configure(
(a = this.options) === null || a === void 0
? void 0
: a.hardBreak
)
),
this.options.heading !== !1 &&
S.push(
iE.configure(
(u = this.options) === null || u === void 0
? void 0
: u.heading
)
),
this.options.history !== !1 &&
S.push(
hE.configure(
(c = this.options) === null || c === void 0
? void 0
: c.history
)
),
this.options.horizontalRule !== !1 &&
S.push(
pE.configure(
(f = this.options) === null || f === void 0
? void 0
: f.horizontalRule
)
),
this.options.italic !== !1 &&
S.push(
bE.configure(
(h = this.options) === null || h === void 0
? void 0
: h.italic
)
),
this.options.listItem !== !1 &&
S.push(
wE.configure(
(p = this.options) === null || p === void 0
? void 0
: p.listItem
)
),
this.options.orderedList !== !1 &&
S.push(
kE.configure(
(g = this.options) === null || g === void 0
? void 0
: g.orderedList
)
),
this.options.paragraph !== !1 &&
S.push(
CE.configure(
(v = this.options) === null || v === void 0
? void 0
: v.paragraph
)
),
this.options.strike !== !1 &&
S.push(
ME.configure(
(b = this.options) === null || b === void 0
? void 0
: b.strike
)
),
this.options.text !== !1 &&
S.push(
EE.configure(
(x = this.options) === null || x === void 0
? void 0
: x.text
)
),
S
);
},
}),
PR = Et.create({
name: "placeholder",
addOptions() {
return {
emptyEditorClass: "is-editor-empty",
emptyNodeClass: "is-empty",
placeholder: "Write something \u2026",
showOnlyWhenEditable: !0,
showOnlyCurrent: !0,
includeChildren: !1,
};
},
addProseMirrorPlugins() {
return [
new Tt({
key: new Ot("placeholder"),
props: {
decorations: ({ doc: t, selection: e }) => {
const n =
this.editor.isEditable ||
!this.options.showOnlyWhenEditable,
{ anchor: r } = e,
i = [];
if (!n) return null;
const o = t.type.createAndFill(),
s =
(o == null ? void 0 : o.sameMarkup(t)) &&
o.content.findDiffStart(t.content) === null;
return (
t.descendants((l, a) => {
const u = r >= a && r <= a + l.nodeSize,
c = !l.isLeaf && !l.childCount;
if (
(u || !this.options.showOnlyCurrent) &&
c
) {
const f = [this.options.emptyNodeClass];
s &&
f.push(
this.options.emptyEditorClass
);
const h = Xt.node(a, a + l.nodeSize, {
class: f.join(" "),
"data-placeholder":
typeof this.options
.placeholder == "function"
? this.options.placeholder({
editor: this.editor,
node: l,
pos: a,
hasAnchor: u,
})
: this.options.placeholder,
});
i.push(h);
}
return this.options.includeChildren;
}),
st.create(t, i)
);
},
},
}),
];
},
}),
NR = Et.create({
name: "textAlign",
addOptions() {
return {
types: [],
alignments: ["left", "center", "right", "justify"],
defaultAlignment: "left",
};
},
addGlobalAttributes() {
return [
{
types: this.options.types,
attributes: {
textAlign: {
default: this.options.defaultAlignment,
parseHTML: (t) =>
t.style.textAlign ||
this.options.defaultAlignment,
renderHTML: (t) =>
t.textAlign === this.options.defaultAlignment
? {}
: { style: `text-align: ${t.textAlign}` },
},
},
},
];
},
addCommands() {
return {
setTextAlign:
(t) =>
({ commands: e }) =>
this.options.alignments.includes(t)
? this.options.types.every((n) =>
e.updateAttributes(n, { textAlign: t })
)
: !1,
unsetTextAlign:
() =>
({ commands: t }) =>
this.options.types.every((e) =>
t.resetAttributes(e, "textAlign")
),
};
},
addKeyboardShortcuts() {
return {
"Mod-Shift-l": () => this.editor.commands.setTextAlign("left"),
"Mod-Shift-e": () =>
this.editor.commands.setTextAlign("center"),
"Mod-Shift-r": () => this.editor.commands.setTextAlign("right"),
"Mod-Shift-j": () =>
this.editor.commands.setTextAlign("justify"),
};
},
});
var Bc, $c;
if (typeof WeakMap != "undefined") {
let t = new WeakMap();
(Bc = (e) => t.get(e)), ($c = (e, n) => (t.set(e, n), n));
} else {
const t = [];
let n = 0;
(Bc = (r) => {
for (let i = 0; i < t.length; i += 2) if (t[i] == r) return t[i + 1];
}),
($c = (r, i) => (n == 10 && (n = 0), (t[n++] = r), (t[n++] = i)));
}
var pt = class {
constructor(t, e, n, r) {
(this.width = t),
(this.height = e),
(this.map = n),
(this.problems = r);
}
findCell(t) {
for (let e = 0; e < this.map.length; e++) {
const n = this.map[e];
if (n != t) continue;
const r = e % this.width,
i = (e / this.width) | 0;
let o = r + 1,
s = i + 1;
for (let l = 1; o < this.width && this.map[e + l] == n; l++) o++;
for (
let l = 1;
s < this.height && this.map[e + this.width * l] == n;
l++
)
s++;
return { left: r, top: i, right: o, bottom: s };
}
throw new RangeError(`No cell with offset ${t} found`);
}
colCount(t) {
for (let e = 0; e < this.map.length; e++)
if (this.map[e] == t) return e % this.width;
throw new RangeError(`No cell with offset ${t} found`);
}
nextCell(t, e, n) {
const { left: r, right: i, top: o, bottom: s } = this.findCell(t);
return e == "horiz"
? (n < 0 ? r == 0 : i == this.width)
? null
: this.map[o * this.width + (n < 0 ? r - 1 : i)]
: (n < 0 ? o == 0 : s == this.height)
? null
: this.map[r + this.width * (n < 0 ? o - 1 : s)];
}
rectBetween(t, e) {
const { left: n, right: r, top: i, bottom: o } = this.findCell(t),
{ left: s, right: l, top: a, bottom: u } = this.findCell(e);
return {
left: Math.min(n, s),
top: Math.min(i, a),
right: Math.max(r, l),
bottom: Math.max(o, u),
};
}
cellsInRect(t) {
const e = [],
n = {};
for (let r = t.top; r < t.bottom; r++)
for (let i = t.left; i < t.right; i++) {
const o = r * this.width + i,
s = this.map[o];
n[s] ||
((n[s] = !0),
!(
(i == t.left && i && this.map[o - 1] == s) ||
(r == t.top && r && this.map[o - this.width] == s)
) && e.push(s));
}
return e;
}
positionAt(t, e, n) {
for (let r = 0, i = 0; ; r++) {
const o = i + n.child(r).nodeSize;
if (r == t) {
let s = e + t * this.width;
const l = (t + 1) * this.width;
for (; s < l && this.map[s] < i; ) s++;
return s == l ? o - 1 : this.map[s];
}
i = o;
}
}
static get(t) {
return Bc(t) || $c(t, AE(t));
}
};
function AE(t) {
if (t.type.spec.tableRole != "table")
throw new RangeError("Not a table node: " + t.type.name);
const e = TE(t),
n = t.childCount,
r = [];
let i = 0,
o = null;
const s = [];
for (let u = 0, c = e * n; u < c; u++) r[u] = 0;
for (let u = 0, c = 0; u < n; u++) {
const f = t.child(u);
c++;
for (let g = 0; ; g++) {
for (; i < r.length && r[i] != 0; ) i++;
if (g == f.childCount) break;
const v = f.child(g),
{ colspan: b, rowspan: x, colwidth: S } = v.attrs;
for (let T = 0; T < x; T++) {
if (T + u >= n) {
(o || (o = [])).push({
type: "overlong_rowspan",
pos: c,
n: x - T,
});
break;
}
const d = i + T * e;
for (let y = 0; y < b; y++) {
r[d + y] == 0
? (r[d + y] = c)
: (o || (o = [])).push({
type: "collision",
row: u,
pos: c,
n: b - y,
});
const m = S && S[y];
if (m) {
const w = ((d + y) % e) * 2,
k = s[w];
k == null || (k != m && s[w + 1] == 1)
? ((s[w] = m), (s[w + 1] = 1))
: k == m && s[w + 1]++;
}
}
}
(i += b), (c += v.nodeSize);
}
const h = (u + 1) * e;
let p = 0;
for (; i < h; ) r[i++] == 0 && p++;
p && (o || (o = [])).push({ type: "missing", row: u, n: p }), c++;
}
const l = new pt(e, n, r, o);
let a = !1;
for (let u = 0; !a && u < s.length; u += 2)
s[u] != null && s[u + 1] < n && (a = !0);
return a && OE(l, s, t), l;
}
function TE(t) {
let e = -1,
n = !1;
for (let r = 0; r < t.childCount; r++) {
const i = t.child(r);
let o = 0;
if (n)
for (let s = 0; s < r; s++) {
const l = t.child(s);
for (let a = 0; a < l.childCount; a++) {
const u = l.child(a);
s + u.attrs.rowspan > r && (o += u.attrs.colspan);
}
}
for (let s = 0; s < i.childCount; s++) {
const l = i.child(s);
(o += l.attrs.colspan), l.attrs.rowspan > 1 && (n = !0);
}
e == -1 ? (e = o) : e != o && (e = Math.max(e, o));
}
return e;
}
function OE(t, e, n) {
t.problems || (t.problems = []);
const r = {};
for (let i = 0; i < t.map.length; i++) {
const o = t.map[i];
if (r[o]) continue;
r[o] = !0;
const s = n.nodeAt(o);
if (!s) throw new RangeError(`No cell with offset ${o} found`);
let l = null;
const a = s.attrs;
for (let u = 0; u < a.colspan; u++) {
const c = (i + u) % t.width,
f = e[c * 2];
f != null &&
(!a.colwidth || a.colwidth[u] != f) &&
((l || (l = RE(a)))[u] = f);
}
l &&
t.problems.unshift({
type: "colwidth mismatch",
pos: o,
colwidth: l,
});
}
}
function RE(t) {
if (t.colwidth) return t.colwidth.slice();
const e = [];
for (let n = 0; n < t.colspan; n++) e.push(0);
return e;
}
function Vt(t) {
let e = t.cached.tableNodeTypes;
if (!e) {
e = t.cached.tableNodeTypes = {};
for (const n in t.nodes) {
const r = t.nodes[n],
i = r.spec.tableRole;
i && (e[i] = r);
}
}
return e;
}
var kr = new Ot("selectingCells");
function ho(t) {
for (let e = t.depth - 1; e > 0; e--)
if (t.node(e).type.spec.tableRole == "row")
return t.node(0).resolve(t.before(e + 1));
return null;
}
function PE(t) {
for (let e = t.depth; e > 0; e--) {
const n = t.node(e).type.spec.tableRole;
if (n === "cell" || n === "header_cell") return t.node(e);
}
return null;
}
function Ln(t) {
const e = t.selection.$head;
for (let n = e.depth; n > 0; n--)
if (e.node(n).type.spec.tableRole == "row") return !0;
return !1;
}
function qa(t) {
const e = t.selection;
if ("$anchorCell" in e && e.$anchorCell)
return e.$anchorCell.pos > e.$headCell.pos
? e.$anchorCell
: e.$headCell;
if ("node" in e && e.node && e.node.type.spec.tableRole == "cell")
return e.$anchor;
const n = ho(e.$head) || NE(e.$head);
if (n) return n;
throw new RangeError(`No cell found around position ${e.head}`);
}
function NE(t) {
for (let e = t.nodeAfter, n = t.pos; e; e = e.firstChild, n++) {
const r = e.type.spec.tableRole;
if (r == "cell" || r == "header_cell") return t.doc.resolve(n);
}
for (let e = t.nodeBefore, n = t.pos; e; e = e.lastChild, n--) {
const r = e.type.spec.tableRole;
if (r == "cell" || r == "header_cell")
return t.doc.resolve(n - e.nodeSize);
}
}
function zc(t) {
return t.parent.type.spec.tableRole == "row" && !!t.nodeAfter;
}
function jE(t) {
return t.node(0).resolve(t.pos + t.nodeAfter.nodeSize);
}
function xf(t, e) {
return t.depth == e.depth && t.pos >= e.start(-1) && t.pos <= e.end(-1);
}
function oy(t, e, n) {
const r = t.node(-1),
i = pt.get(r),
o = t.start(-1),
s = i.nextCell(t.pos - o, e, n);
return s == null ? null : t.node(0).resolve(o + s);
}
function wi(t, e, n = 1) {
const r = be(W({}, t), { colspan: t.colspan - n });
return (
r.colwidth &&
((r.colwidth = r.colwidth.slice()),
r.colwidth.splice(e, n),
r.colwidth.some((i) => i > 0) || (r.colwidth = null)),
r
);
}
function sy(t, e, n = 1) {
const r = be(W({}, t), { colspan: t.colspan + n });
if (r.colwidth) {
r.colwidth = r.colwidth.slice();
for (let i = 0; i < n; i++) r.colwidth.splice(e, 0, 0);
}
return r;
}
function LE(t, e, n) {
const r = Vt(e.type.schema).header_cell;
for (let i = 0; i < t.height; i++)
if (e.nodeAt(t.map[n + i * t.width]).type != r) return !1;
return !0;
}
var nt = class tr extends Se {
constructor(e, n = e) {
const r = e.node(-1),
i = pt.get(r),
o = e.start(-1),
s = i.rectBetween(e.pos - o, n.pos - o),
l = e.node(0),
a = i.cellsInRect(s).filter((c) => c != n.pos - o);
a.unshift(n.pos - o);
const u = a.map((c) => {
const f = r.nodeAt(c);
if (!f) throw RangeError(`No cell with offset ${c} found`);
const h = o + c + 1;
return new u0(l.resolve(h), l.resolve(h + f.content.size));
});
super(u[0].$from, u[0].$to, u),
(this.$anchorCell = e),
(this.$headCell = n);
}
map(e, n) {
const r = e.resolve(n.map(this.$anchorCell.pos)),
i = e.resolve(n.map(this.$headCell.pos));
if (zc(r) && zc(i) && xf(r, i)) {
const o = this.$anchorCell.node(-1) != r.node(-1);
return o && this.isRowSelection()
? tr.rowSelection(r, i)
: o && this.isColSelection()
? tr.colSelection(r, i)
: new tr(r, i);
}
return Ce.between(r, i);
}
content() {
const e = this.$anchorCell.node(-1),
n = pt.get(e),
r = this.$anchorCell.start(-1),
i = n.rectBetween(this.$anchorCell.pos - r, this.$headCell.pos - r),
o = {},
s = [];
for (let a = i.top; a < i.bottom; a++) {
const u = [];
for (
let c = a * n.width + i.left, f = i.left;
f < i.right;
f++, c++
) {
const h = n.map[c];
if (o[h]) continue;
o[h] = !0;
const p = n.findCell(h);
let g = e.nodeAt(h);
if (!g) throw RangeError(`No cell with offset ${h} found`);
const v = i.left - p.left,
b = p.right - i.right;
if (v > 0 || b > 0) {
let x = g.attrs;
if (
(v > 0 && (x = wi(x, 0, v)),
b > 0 && (x = wi(x, x.colspan - b, b)),
p.left < i.left)
) {
if (((g = g.type.createAndFill(x)), !g))
throw RangeError(
`Could not create cell with attrs ${JSON.stringify(
x
)}`
);
} else g = g.type.create(x, g.content);
}
if (p.top < i.top || p.bottom > i.bottom) {
const x = be(W({}, g.attrs), {
rowspan:
Math.min(p.bottom, i.bottom) -
Math.max(p.top, i.top),
});
p.top < i.top
? (g = g.type.createAndFill(x))
: (g = g.type.create(x, g.content));
}
u.push(g);
}
s.push(e.child(a).copy(Y.from(u)));
}
const l = this.isColSelection() && this.isRowSelection() ? e : s;
return new ie(Y.from(l), 1, 1);
}
replace(e, n = ie.empty) {
const r = e.steps.length,
i = this.ranges;
for (let s = 0; s < i.length; s++) {
const { $from: l, $to: a } = i[s],
u = e.mapping.slice(r);
e.replace(u.map(l.pos), u.map(a.pos), s ? ie.empty : n);
}
const o = Se.findFrom(
e.doc.resolve(e.mapping.slice(r).map(this.to)),
-1
);
o && e.setSelection(o);
}
replaceWith(e, n) {
this.replace(e, new ie(Y.from(n), 0, 0));
}
forEachCell(e) {
const n = this.$anchorCell.node(-1),
r = pt.get(n),
i = this.$anchorCell.start(-1),
o = r.cellsInRect(
r.rectBetween(this.$anchorCell.pos - i, this.$headCell.pos - i)
);
for (let s = 0; s < o.length; s++) e(n.nodeAt(o[s]), i + o[s]);
}
isColSelection() {
const e = this.$anchorCell.index(-1),
n = this.$headCell.index(-1);
if (Math.min(e, n) > 0) return !1;
const r = e + this.$anchorCell.nodeAfter.attrs.rowspan,
i = n + this.$headCell.nodeAfter.attrs.rowspan;
return Math.max(r, i) == this.$headCell.node(-1).childCount;
}
static colSelection(e, n = e) {
const r = e.node(-1),
i = pt.get(r),
o = e.start(-1),
s = i.findCell(e.pos - o),
l = i.findCell(n.pos - o),
a = e.node(0);
return (
s.top <= l.top
? (s.top > 0 && (e = a.resolve(o + i.map[s.left])),
l.bottom < i.height &&
(n = a.resolve(
o + i.map[i.width * (i.height - 1) + l.right - 1]
)))
: (l.top > 0 && (n = a.resolve(o + i.map[l.left])),
s.bottom < i.height &&
(e = a.resolve(
o + i.map[i.width * (i.height - 1) + s.right - 1]
))),
new tr(e, n)
);
}
isRowSelection() {
const e = this.$anchorCell.node(-1),
n = pt.get(e),
r = this.$anchorCell.start(-1),
i = n.colCount(this.$anchorCell.pos - r),
o = n.colCount(this.$headCell.pos - r);
if (Math.min(i, o) > 0) return !1;
const s = i + this.$anchorCell.nodeAfter.attrs.colspan,
l = o + this.$headCell.nodeAfter.attrs.colspan;
return Math.max(s, l) == n.width;
}
eq(e) {
return (
e instanceof tr &&
e.$anchorCell.pos == this.$anchorCell.pos &&
e.$headCell.pos == this.$headCell.pos
);
}
static rowSelection(e, n = e) {
const r = e.node(-1),
i = pt.get(r),
o = e.start(-1),
s = i.findCell(e.pos - o),
l = i.findCell(n.pos - o),
a = e.node(0);
return (
s.left <= l.left
? (s.left > 0 && (e = a.resolve(o + i.map[s.top * i.width])),
l.right < i.width &&
(n = a.resolve(o + i.map[i.width * (l.top + 1) - 1])))
: (l.left > 0 && (n = a.resolve(o + i.map[l.top * i.width])),
s.right < i.width &&
(e = a.resolve(o + i.map[i.width * (s.top + 1) - 1]))),
new tr(e, n)
);
}
toJSON() {
return {
type: "cell",
anchor: this.$anchorCell.pos,
head: this.$headCell.pos,
};
}
static fromJSON(e, n) {
return new tr(e.resolve(n.anchor), e.resolve(n.head));
}
static create(e, n, r = n) {
return new tr(e.resolve(n), e.resolve(r));
}
getBookmark() {
return new DE(this.$anchorCell.pos, this.$headCell.pos);
}
};
nt.prototype.visible = !1;
Se.jsonID("cell", nt);
var DE = class ly {
constructor(e, n) {
(this.anchor = e), (this.head = n);
}
map(e) {
return new ly(e.map(this.anchor), e.map(this.head));
}
resolve(e) {
const n = e.resolve(this.anchor),
r = e.resolve(this.head);
return n.parent.type.spec.tableRole == "row" &&
r.parent.type.spec.tableRole == "row" &&
n.index() < n.parent.childCount &&
r.index() < r.parent.childCount &&
xf(n, r)
? new nt(n, r)
: Se.near(r, 1);
}
};
function IE(t) {
if (!(t.selection instanceof nt)) return null;
const e = [];
return (
t.selection.forEachCell((n, r) => {
e.push(Xt.node(r, r + n.nodeSize, { class: "selectedCell" }));
}),
st.create(t.doc, e)
);
}
function BE({ $from: t, $to: e }) {
if (t.pos == e.pos || t.pos < t.pos - 6) return !1;
let n = t.pos,
r = e.pos,
i = t.depth;
for (; i >= 0 && !(t.after(i + 1) < t.end(i)); i--, n++);
for (let o = e.depth; o >= 0 && !(e.before(o + 1) > e.start(o)); o--, r--);
return n == r && /row|table/.test(t.node(i).type.spec.tableRole);
}
function $E({ $from: t, $to: e }) {
let n, r;
for (let i = t.depth; i > 0; i--) {
const o = t.node(i);
if (
o.type.spec.tableRole === "cell" ||
o.type.spec.tableRole === "header_cell"
) {
n = o;
break;
}
}
for (let i = e.depth; i > 0; i--) {
const o = e.node(i);
if (
o.type.spec.tableRole === "cell" ||
o.type.spec.tableRole === "header_cell"
) {
r = o;
break;
}
}
return n !== r && e.parentOffset === 0;
}
function zE(t, e, n) {
const r = (e || t).selection,
i = (e || t).doc;
let o, s;
if (r instanceof ve && (s = r.node.type.spec.tableRole)) {
if (s == "cell" || s == "header_cell") o = nt.create(i, r.from);
else if (s == "row") {
const l = i.resolve(r.from + 1);
o = nt.rowSelection(l, l);
} else if (!n) {
const l = pt.get(r.node),
a = r.from + 1,
u = a + l.map[l.width * l.height - 1];
o = nt.create(i, a + 1, u);
}
} else
r instanceof Ce && BE(r)
? (o = Ce.create(i, r.from))
: r instanceof Ce &&
$E(r) &&
(o = Ce.create(i, r.$from.start(), r.$from.end()));
return o && (e || (e = t.tr)).setSelection(o), e;
}
var HE = new Ot("fix-tables");
function ay(t, e, n, r) {
const i = t.childCount,
o = e.childCount;
e: for (let s = 0, l = 0; s < o; s++) {
const a = e.child(s);
for (let u = l, c = Math.min(i, s + 3); u < c; u++)
if (t.child(u) == a) {
(l = u + 1), (n += a.nodeSize);
continue e;
}
r(a, n),
l < i && t.child(l).sameMarkup(a)
? ay(t.child(l), a, n + 1, r)
: a.nodesBetween(0, a.content.size, r, n + 1),
(n += a.nodeSize);
}
}
function uy(t, e) {
let n;
const r = (i, o) => {
i.type.spec.tableRole == "table" && (n = FE(t, i, o, n));
};
return (
e ? e.doc != t.doc && ay(e.doc, t.doc, 0, r) : t.doc.descendants(r), n
);
}
function FE(t, e, n, r) {
const i = pt.get(e);
if (!i.problems) return r;
r || (r = t.tr);
const o = [];
for (let a = 0; a < i.height; a++) o.push(0);
for (let a = 0; a < i.problems.length; a++) {
const u = i.problems[a];
if (u.type == "collision") {
const c = e.nodeAt(u.pos);
if (!c) continue;
const f = c.attrs;
for (let h = 0; h < f.rowspan; h++) o[u.row + h] += u.n;
r.setNodeMarkup(
r.mapping.map(n + 1 + u.pos),
null,
wi(f, f.colspan - u.n, u.n)
);
} else if (u.type == "missing") o[u.row] += u.n;
else if (u.type == "overlong_rowspan") {
const c = e.nodeAt(u.pos);
if (!c) continue;
r.setNodeMarkup(
r.mapping.map(n + 1 + u.pos),
null,
be(W({}, c.attrs), { rowspan: c.attrs.rowspan - u.n })
);
} else if (u.type == "colwidth mismatch") {
const c = e.nodeAt(u.pos);
if (!c) continue;
r.setNodeMarkup(
r.mapping.map(n + 1 + u.pos),
null,
be(W({}, c.attrs), { colwidth: u.colwidth })
);
}
}
let s, l;
for (let a = 0; a < o.length; a++) o[a] && (s == null && (s = a), (l = a));
for (let a = 0, u = n + 1; a < i.height; a++) {
const c = e.child(a),
f = u + c.nodeSize,
h = o[a];
if (h > 0) {
let p = "cell";
c.firstChild && (p = c.firstChild.type.spec.tableRole);
const g = [];
for (let b = 0; b < h; b++) {
const x = Vt(t.schema)[p].createAndFill();
x && g.push(x);
}
const v = (a == 0 || s == a - 1) && l == a ? u + 1 : f - 1;
r.insert(r.mapping.map(v), g);
}
u = f;
}
return r.setMeta(HE, { fixTables: !0 });
}
function VE(t) {
if (!t.size) return null;
let { content: e, openStart: n, openEnd: r } = t;
for (
;
e.childCount == 1 &&
((n > 0 && r > 0) || e.child(0).type.spec.tableRole == "table");
)
n--, r--, (e = e.child(0).content);
const i = e.child(0),
o = i.type.spec.tableRole,
s = i.type.schema,
l = [];
if (o == "row")
for (let a = 0; a < e.childCount; a++) {
let u = e.child(a).content;
const c = a ? 0 : Math.max(0, n - 1),
f = a < e.childCount - 1 ? 0 : Math.max(0, r - 1);
(c || f) && (u = Hc(Vt(s).row, new ie(u, c, f)).content), l.push(u);
}
else if (o == "cell" || o == "header_cell")
l.push(n || r ? Hc(Vt(s).row, new ie(e, n, r)).content : e);
else return null;
return WE(s, l);
}
function WE(t, e) {
const n = [];
for (let i = 0; i < e.length; i++) {
const o = e[i];
for (let s = o.childCount - 1; s >= 0; s--) {
const { rowspan: l, colspan: a } = o.child(s).attrs;
for (let u = i; u < i + l; u++) n[u] = (n[u] || 0) + a;
}
}
let r = 0;
for (let i = 0; i < n.length; i++) r = Math.max(r, n[i]);
for (let i = 0; i < n.length; i++)
if ((i >= e.length && e.push(Y.empty), n[i] < r)) {
const o = Vt(t).cell.createAndFill(),
s = [];
for (let l = n[i]; l < r; l++) s.push(o);
e[i] = e[i].append(Y.from(s));
}
return { height: e.length, width: r, rows: e };
}
function Hc(t, e) {
const n = t.createAndFill();
return new a0(n).replace(0, n.content.size, e).doc;
}
function UE({ width: t, height: e, rows: n }, r, i) {
if (t != r) {
const o = [],
s = [];
for (let l = 0; l < n.length; l++) {
const a = n[l],
u = [];
for (let c = o[l] || 0, f = 0; c < r; f++) {
let h = a.child(f % a.childCount);
c + h.attrs.colspan > r &&
(h = h.type.createChecked(
wi(h.attrs, h.attrs.colspan, c + h.attrs.colspan - r),
h.content
)),
u.push(h),
(c += h.attrs.colspan);
for (let p = 1; p < h.attrs.rowspan; p++)
o[l + p] = (o[l + p] || 0) + h.attrs.colspan;
}
s.push(Y.from(u));
}
(n = s), (t = r);
}
if (e != i) {
const o = [];
for (let s = 0, l = 0; s < i; s++, l++) {
const a = [],
u = n[l % e];
for (let c = 0; c < u.childCount; c++) {
let f = u.child(c);
s + f.attrs.rowspan > i &&
(f = f.type.create(
be(W({}, f.attrs), {
rowspan: Math.max(1, i - f.attrs.rowspan),
}),
f.content
)),
a.push(f);
}
o.push(Y.from(a));
}
(n = o), (e = i);
}
return { width: t, height: e, rows: n };
}
function KE(t, e, n, r, i, o, s) {
const l = t.doc.type.schema,
a = Vt(l);
let u, c;
if (i > e.width)
for (let f = 0, h = 0; f < e.height; f++) {
const p = n.child(f);
h += p.nodeSize;
const g = [];
let v;
p.lastChild == null || p.lastChild.type == a.cell
? (v = u || (u = a.cell.createAndFill()))
: (v = c || (c = a.header_cell.createAndFill()));
for (let b = e.width; b < i; b++) g.push(v);
t.insert(t.mapping.slice(s).map(h - 1 + r), g);
}
if (o > e.height) {
const f = [];
for (
let g = 0, v = (e.height - 1) * e.width;
g < Math.max(e.width, i);
g++
) {
const b =
g >= e.width
? !1
: n.nodeAt(e.map[v + g]).type == a.header_cell;
f.push(
b
? c || (c = a.header_cell.createAndFill())
: u || (u = a.cell.createAndFill())
);
}
const h = a.row.create(null, Y.from(f)),
p = [];
for (let g = e.height; g < o; g++) p.push(h);
t.insert(t.mapping.slice(s).map(r + n.nodeSize - 2), p);
}
return !!(u || c);
}
function Zp(t, e, n, r, i, o, s, l) {
if (s == 0 || s == e.height) return !1;
let a = !1;
for (let u = i; u < o; u++) {
const c = s * e.width + u,
f = e.map[c];
if (e.map[c - e.width] == f) {
a = !0;
const h = n.nodeAt(f),
{ top: p, left: g } = e.findCell(f);
t.setNodeMarkup(
t.mapping.slice(l).map(f + r),
null,
be(W({}, h.attrs), { rowspan: s - p })
),
t.insert(
t.mapping.slice(l).map(e.positionAt(s, g, n)),
h.type.createAndFill(
be(W({}, h.attrs), { rowspan: p + h.attrs.rowspan - s })
)
),
(u += h.attrs.colspan - 1);
}
}
return a;
}
function em(t, e, n, r, i, o, s, l) {
if (s == 0 || s == e.width) return !1;
let a = !1;
for (let u = i; u < o; u++) {
const c = u * e.width + s,
f = e.map[c];
if (e.map[c - 1] == f) {
a = !0;
const h = n.nodeAt(f),
p = e.colCount(f),
g = t.mapping.slice(l).map(f + r);
t.setNodeMarkup(
g,
null,
wi(h.attrs, s - p, h.attrs.colspan - (s - p))
),
t.insert(
g + h.nodeSize,
h.type.createAndFill(wi(h.attrs, 0, s - p))
),
(u += h.attrs.rowspan - 1);
}
}
return a;
}
function tm(t, e, n, r, i) {
let o = n ? t.doc.nodeAt(n - 1) : t.doc;
if (!o) throw new Error("No table found");
let s = pt.get(o);
const { top: l, left: a } = r,
u = a + i.width,
c = l + i.height,
f = t.tr;
let h = 0;
function p() {
if (((o = n ? f.doc.nodeAt(n - 1) : f.doc), !o))
throw new Error("No table found");
(s = pt.get(o)), (h = f.mapping.maps.length);
}
KE(f, s, o, n, u, c, h) && p(),
Zp(f, s, o, n, a, u, l, h) && p(),
Zp(f, s, o, n, a, u, c, h) && p(),
em(f, s, o, n, l, c, a, h) && p(),
em(f, s, o, n, l, c, u, h) && p();
for (let g = l; g < c; g++) {
const v = s.positionAt(g, a, o),
b = s.positionAt(g, u, o);
f.replace(
f.mapping.slice(h).map(v + n),
f.mapping.slice(h).map(b + n),
new ie(i.rows[g - l], 0, 0)
);
}
p(),
f.setSelection(
new nt(
f.doc.resolve(n + s.positionAt(l, a, o)),
f.doc.resolve(n + s.positionAt(c - 1, u - 1, o))
)
),
e(f);
}
var qE = L0({
ArrowLeft: Ks("horiz", -1),
ArrowRight: Ks("horiz", 1),
ArrowUp: Ks("vert", -1),
ArrowDown: Ks("vert", 1),
"Shift-ArrowLeft": qs("horiz", -1),
"Shift-ArrowRight": qs("horiz", 1),
"Shift-ArrowUp": qs("vert", -1),
"Shift-ArrowDown": qs("vert", 1),
Backspace: Js,
"Mod-Backspace": Js,
Delete: Js,
"Mod-Delete": Js,
});
function cl(t, e, n) {
return n.eq(t.selection)
? !1
: (e && e(t.tr.setSelection(n).scrollIntoView()), !0);
}
function Ks(t, e) {
return (n, r, i) => {
if (!i) return !1;
const o = n.selection;
if (o instanceof nt) return cl(n, r, Se.near(o.$headCell, e));
if (t != "horiz" && !o.empty) return !1;
const s = cy(i, t, e);
if (s == null) return !1;
if (t == "horiz")
return cl(n, r, Se.near(n.doc.resolve(o.head + e), e));
{
const l = n.doc.resolve(s),
a = oy(l, t, e);
let u;
return (
a
? (u = Se.near(a, 1))
: e < 0
? (u = Se.near(n.doc.resolve(l.before(-1)), -1))
: (u = Se.near(n.doc.resolve(l.after(-1)), 1)),
cl(n, r, u)
);
}
};
}
function qs(t, e) {
return (n, r, i) => {
if (!i) return !1;
const o = n.selection;
let s;
if (o instanceof nt) s = o;
else {
const a = cy(i, t, e);
if (a == null) return !1;
s = new nt(n.doc.resolve(a));
}
const l = oy(s.$headCell, t, e);
return l ? cl(n, r, new nt(s.$anchorCell, l)) : !1;
};
}
function Js(t, e) {
const n = t.selection;
if (!(n instanceof nt)) return !1;
if (e) {
const r = t.tr,
i = Vt(t.schema).cell.createAndFill().content;
n.forEachCell((o, s) => {
o.content.eq(i) ||
r.replace(
r.mapping.map(s + 1),
r.mapping.map(s + o.nodeSize - 1),
new ie(i, 0, 0)
);
}),
r.docChanged && e(r);
}
return !0;
}
function JE(t, e) {
const n = t.state.doc,
r = ho(n.resolve(e));
return r ? (t.dispatch(t.state.tr.setSelection(new nt(r))), !0) : !1;
}
function GE(t, e, n) {
if (!Ln(t.state)) return !1;
let r = VE(n);
const i = t.state.selection;
if (i instanceof nt) {
r ||
(r = {
width: 1,
height: 1,
rows: [Y.from(Hc(Vt(t.state.schema).cell, n))],
});
const o = i.$anchorCell.node(-1),
s = i.$anchorCell.start(-1),
l = pt
.get(o)
.rectBetween(i.$anchorCell.pos - s, i.$headCell.pos - s);
return (
(r = UE(r, l.right - l.left, l.bottom - l.top)),
tm(t.state, t.dispatch, s, l, r),
!0
);
} else if (r) {
const o = qa(t.state),
s = o.start(-1);
return (
tm(
t.state,
t.dispatch,
s,
pt.get(o.node(-1)).findCell(o.pos - s),
r
),
!0
);
} else return !1;
}
function YE(t, e) {
var n;
if (e.ctrlKey || e.metaKey) return;
const r = nm(t, e.target);
let i;
if (e.shiftKey && t.state.selection instanceof nt)
o(t.state.selection.$anchorCell, e), e.preventDefault();
else if (
e.shiftKey &&
r &&
(i = ho(t.state.selection.$anchor)) != null &&
((n = $u(t, e)) == null ? void 0 : n.pos) != i.pos
)
o(i, e), e.preventDefault();
else if (!r) return;
function o(a, u) {
let c = $u(t, u);
const f = kr.getState(t.state) == null;
if (!c || !xf(a, c))
if (f) c = a;
else return;
const h = new nt(a, c);
if (f || !t.state.selection.eq(h)) {
const p = t.state.tr.setSelection(h);
f && p.setMeta(kr, a.pos), t.dispatch(p);
}
}
function s() {
t.root.removeEventListener("mouseup", s),
t.root.removeEventListener("dragstart", s),
t.root.removeEventListener("mousemove", l),
kr.getState(t.state) != null &&
t.dispatch(t.state.tr.setMeta(kr, -1));
}
function l(a) {
const u = a,
c = kr.getState(t.state);
let f;
if (c != null) f = t.state.doc.resolve(c);
else if (nm(t, u.target) != r && ((f = $u(t, e)), !f)) return s();
f && o(f, u);
}
t.root.addEventListener("mouseup", s),
t.root.addEventListener("dragstart", s),
t.root.addEventListener("mousemove", l);
}
function cy(t, e, n) {
if (!(t.state.selection instanceof Ce)) return null;
const { $head: r } = t.state.selection;
for (let i = r.depth - 1; i >= 0; i--) {
const o = r.node(i);
if (
(n < 0 ? r.index(i) : r.indexAfter(i)) != (n < 0 ? 0 : o.childCount)
)
return null;
if (
o.type.spec.tableRole == "cell" ||
o.type.spec.tableRole == "header_cell"
) {
const l = r.before(i),
a =
e == "vert"
? n > 0
? "down"
: "up"
: n > 0
? "right"
: "left";
return t.endOfTextblock(a) ? l : null;
}
}
return null;
}
function nm(t, e) {
for (; e && e != t.dom; e = e.parentNode)
if (e.nodeName == "TD" || e.nodeName == "TH") return e;
return null;
}
function $u(t, e) {
const n = t.posAtCoords({ left: e.clientX, top: e.clientY });
return n && n ? ho(t.state.doc.resolve(n.pos)) : null;
}
var QE = class {
constructor(t, e) {
(this.node = t),
(this.cellMinWidth = e),
(this.dom = document.createElement("div")),
(this.dom.className = "tableWrapper"),
(this.table = this.dom.appendChild(
document.createElement("table")
)),
(this.colgroup = this.table.appendChild(
document.createElement("colgroup")
)),
Fc(t, this.colgroup, this.table, e),
(this.contentDOM = this.table.appendChild(
document.createElement("tbody")
));
}
update(t) {
return t.type != this.node.type
? !1
: ((this.node = t),
Fc(t, this.colgroup, this.table, this.cellMinWidth),
!0);
}
ignoreMutation(t) {
return (
t.type == "attributes" &&
(t.target == this.table || this.colgroup.contains(t.target))
);
}
};
function Fc(t, e, n, r, i, o) {
var s;
let l = 0,
a = !0,
u = e.firstChild;
const c = t.firstChild;
if (!!c) {
for (let f = 0, h = 0; f < c.childCount; f++) {
const { colspan: p, colwidth: g } = c.child(f).attrs;
for (let v = 0; v < p; v++, h++) {
const b = i == h ? o : g && g[v],
x = b ? b + "px" : "";
(l += b || r),
b || (a = !1),
u
? (u.style.width != x && (u.style.width = x),
(u = u.nextSibling))
: (e.appendChild(
document.createElement("col")
).style.width = x);
}
}
for (; u; ) {
const f = u.nextSibling;
(s = u.parentNode) == null || s.removeChild(u), (u = f);
}
a
? ((n.style.width = l + "px"), (n.style.minWidth = ""))
: ((n.style.width = ""), (n.style.minWidth = l + "px"));
}
}
var mn = new Ot("tableColumnResizing");
function XE({
handleWidth: t = 5,
cellMinWidth: e = 25,
View: n = QE,
lastColumnResizable: r = !0,
} = {}) {
const i = new Tt({
key: mn,
state: {
init(o, s) {
return (
(i.spec.props.nodeViews[Vt(s.schema).table.name] = (l, a) =>
new n(l, e, a)),
new ZE(-1, !1)
);
},
apply(o, s) {
return s.apply(o);
},
},
props: {
attributes: (o) => {
const s = mn.getState(o);
return s && s.activeHandle > -1
? { class: "resize-cursor" }
: {};
},
handleDOMEvents: {
mousemove: (o, s) => {
e4(o, s, t, e, r);
},
mouseleave: (o) => {
t4(o);
},
mousedown: (o, s) => {
n4(o, s, e);
},
},
decorations: (o) => {
const s = mn.getState(o);
if (s && s.activeHandle > -1) return a4(o, s.activeHandle);
},
nodeViews: {},
},
});
return i;
}
var ZE = class dl {
constructor(e, n) {
(this.activeHandle = e), (this.dragging = n);
}
apply(e) {
const n = this,
r = e.getMeta(mn);
if (r && r.setHandle != null) return new dl(r.setHandle, !1);
if (r && r.setDragging !== void 0)
return new dl(n.activeHandle, r.setDragging);
if (n.activeHandle > -1 && e.docChanged) {
let i = e.mapping.map(n.activeHandle, -1);
return zc(e.doc.resolve(i)) || (i = -1), new dl(i, n.dragging);
}
return n;
}
};
function e4(t, e, n, r, i) {
const o = mn.getState(t.state);
if (!!o && !o.dragging) {
const s = i4(e.target);
let l = -1;
if (s) {
const { left: a, right: u } = s.getBoundingClientRect();
e.clientX - a <= n
? (l = rm(t, e, "left", n))
: u - e.clientX <= n && (l = rm(t, e, "right", n));
}
if (l != o.activeHandle) {
if (!i && l !== -1) {
const a = t.state.doc.resolve(l),
u = a.node(-1),
c = pt.get(u),
f = a.start(-1);
if (
c.colCount(a.pos - f) + a.nodeAfter.attrs.colspan - 1 ==
c.width - 1
)
return;
}
dy(t, l);
}
}
}
function t4(t) {
const e = mn.getState(t.state);
e && e.activeHandle > -1 && !e.dragging && dy(t, -1);
}
function n4(t, e, n) {
const r = mn.getState(t.state);
if (!r || r.activeHandle == -1 || r.dragging) return !1;
const i = t.state.doc.nodeAt(r.activeHandle),
o = r4(t, r.activeHandle, i.attrs);
t.dispatch(
t.state.tr.setMeta(mn, {
setDragging: { startX: e.clientX, startWidth: o },
})
);
function s(a) {
window.removeEventListener("mouseup", s),
window.removeEventListener("mousemove", l);
const u = mn.getState(t.state);
u != null &&
u.dragging &&
(o4(t, u.activeHandle, im(u.dragging, a, n)),
t.dispatch(t.state.tr.setMeta(mn, { setDragging: null })));
}
function l(a) {
if (!a.which) return s(a);
const u = mn.getState(t.state);
if (!!u && u.dragging) {
const c = im(u.dragging, a, n);
s4(t, u.activeHandle, c, n);
}
}
return (
window.addEventListener("mouseup", s),
window.addEventListener("mousemove", l),
e.preventDefault(),
!0
);
}
function r4(t, e, { colspan: n, colwidth: r }) {
const i = r && r[r.length - 1];
if (i) return i;
const o = t.domAtPos(e);
let l = o.node.childNodes[o.offset].offsetWidth,
a = n;
if (r) for (let u = 0; u < n; u++) r[u] && ((l -= r[u]), a--);
return l / a;
}
function i4(t) {
for (; t && t.nodeName != "TD" && t.nodeName != "TH"; )
t =
t.classList && t.classList.contains("ProseMirror")
? null
: t.parentNode;
return t;
}
function rm(t, e, n, r) {
const i = n == "right" ? -r : r,
o = t.posAtCoords({ left: e.clientX + i, top: e.clientY });
if (!o) return -1;
const { pos: s } = o,
l = ho(t.state.doc.resolve(s));
if (!l) return -1;
if (n == "right") return l.pos;
const a = pt.get(l.node(-1)),
u = l.start(-1),
c = a.map.indexOf(l.pos - u);
return c % a.width == 0 ? -1 : u + a.map[c - 1];
}
function im(t, e, n) {
const r = e.clientX - t.startX;
return Math.max(n, t.startWidth + r);
}
function dy(t, e) {
t.dispatch(t.state.tr.setMeta(mn, { setHandle: e }));
}
function o4(t, e, n) {
const r = t.state.doc.resolve(e),
i = r.node(-1),
o = pt.get(i),
s = r.start(-1),
l = o.colCount(r.pos - s) + r.nodeAfter.attrs.colspan - 1,
a = t.state.tr;
for (let u = 0; u < o.height; u++) {
const c = u * o.width + l;
if (u && o.map[c] == o.map[c - o.width]) continue;
const f = o.map[c],
h = i.nodeAt(f).attrs,
p = h.colspan == 1 ? 0 : l - o.colCount(f);
if (h.colwidth && h.colwidth[p] == n) continue;
const g = h.colwidth ? h.colwidth.slice() : l4(h.colspan);
(g[p] = n), a.setNodeMarkup(s + f, null, be(W({}, h), { colwidth: g }));
}
a.docChanged && t.dispatch(a);
}
function s4(t, e, n, r) {
const i = t.state.doc.resolve(e),
o = i.node(-1),
s = i.start(-1),
l = pt.get(o).colCount(i.pos - s) + i.nodeAfter.attrs.colspan - 1;
let a = t.domAtPos(i.start(-1)).node;
for (; a && a.nodeName != "TABLE"; ) a = a.parentNode;
!a || Fc(o, a.firstChild, a, r, l, n);
}
function l4(t) {
return Array(t).fill(0);
}
function a4(t, e) {
const n = [],
r = t.doc.resolve(e),
i = r.node(-1);
if (!i) return st.empty;
const o = pt.get(i),
s = r.start(-1),
l = o.colCount(r.pos - s) + r.nodeAfter.attrs.colspan;
for (let a = 0; a < o.height; a++) {
const u = l + a * o.width - 1;
if (
(l == o.width || o.map[u] != o.map[u + 1]) &&
(a == 0 || o.map[u] != o.map[u - o.width])
) {
const c = o.map[u],
f = s + c + i.nodeAt(c).nodeSize - 1,
h = document.createElement("div");
(h.className = "column-resize-handle"), n.push(Xt.widget(f, h));
}
}
return st.create(t.doc, n);
}
function Zn(t) {
const e = t.selection,
n = qa(t),
r = n.node(-1),
i = n.start(-1),
o = pt.get(r),
s =
e instanceof nt
? o.rectBetween(e.$anchorCell.pos - i, e.$headCell.pos - i)
: o.findCell(n.pos - i);
return be(W({}, s), { tableStart: i, map: o, table: r });
}
function fy(t, { map: e, tableStart: n, table: r }, i) {
let o = i > 0 ? -1 : 0;
LE(e, r, i + o) && (o = i == 0 || i == e.width ? null : 0);
for (let s = 0; s < e.height; s++) {
const l = s * e.width + i;
if (i > 0 && i < e.width && e.map[l - 1] == e.map[l]) {
const a = e.map[l],
u = r.nodeAt(a);
t.setNodeMarkup(
t.mapping.map(n + a),
null,
sy(u.attrs, i - e.colCount(a))
),
(s += u.attrs.rowspan - 1);
} else {
const a =
o == null
? Vt(r.type.schema).cell
: r.nodeAt(e.map[l + o]).type,
u = e.positionAt(s, i, r);
t.insert(t.mapping.map(n + u), a.createAndFill());
}
}
return t;
}
function u4(t, e) {
if (!Ln(t)) return !1;
if (e) {
const n = Zn(t);
e(fy(t.tr, n, n.left));
}
return !0;
}
function c4(t, e) {
if (!Ln(t)) return !1;
if (e) {
const n = Zn(t);
e(fy(t.tr, n, n.right));
}
return !0;
}
function d4(t, { map: e, table: n, tableStart: r }, i) {
const o = t.mapping.maps.length;
for (let s = 0; s < e.height; ) {
const l = s * e.width + i,
a = e.map[l],
u = n.nodeAt(a),
c = u.attrs;
if (
(i > 0 && e.map[l - 1] == a) ||
(i < e.width - 1 && e.map[l + 1] == a)
)
t.setNodeMarkup(
t.mapping.slice(o).map(r + a),
null,
wi(c, i - e.colCount(a))
);
else {
const f = t.mapping.slice(o).map(r + a);
t.delete(f, f + u.nodeSize);
}
s += c.rowspan;
}
}
function f4(t, e) {
if (!Ln(t)) return !1;
if (e) {
const n = Zn(t),
r = t.tr;
if (n.left == 0 && n.right == n.map.width) return !1;
for (let i = n.right - 1; d4(r, n, i), i != n.left; i--) {
const o = n.tableStart ? r.doc.nodeAt(n.tableStart - 1) : r.doc;
if (!o) throw RangeError("No table found");
(n.table = o), (n.map = pt.get(o));
}
e(r);
}
return !0;
}
function h4(t, e, n) {
var r;
const i = Vt(e.type.schema).header_cell;
for (let o = 0; o < t.width; o++)
if (
((r = e.nodeAt(t.map[o + n * t.width])) == null
? void 0
: r.type) != i
)
return !1;
return !0;
}
function hy(t, { map: e, tableStart: n, table: r }, i) {
var o;
let s = n;
for (let u = 0; u < i; u++) s += r.child(u).nodeSize;
const l = [];
let a = i > 0 ? -1 : 0;
h4(e, r, i + a) && (a = i == 0 || i == e.height ? null : 0);
for (let u = 0, c = e.width * i; u < e.width; u++, c++)
if (i > 0 && i < e.height && e.map[c] == e.map[c - e.width]) {
const f = e.map[c],
h = r.nodeAt(f).attrs;
t.setNodeMarkup(
n + f,
null,
be(W({}, h), { rowspan: h.rowspan + 1 })
),
(u += h.colspan - 1);
} else {
const f =
a == null
? Vt(r.type.schema).cell
: (o = r.nodeAt(e.map[c + a * e.width])) == null
? void 0
: o.type,
h = f == null ? void 0 : f.createAndFill();
h && l.push(h);
}
return t.insert(s, Vt(r.type.schema).row.create(null, l)), t;
}
function p4(t, e) {
if (!Ln(t)) return !1;
if (e) {
const n = Zn(t);
e(hy(t.tr, n, n.top));
}
return !0;
}
function m4(t, e) {
if (!Ln(t)) return !1;
if (e) {
const n = Zn(t);
e(hy(t.tr, n, n.bottom));
}
return !0;
}
function g4(t, { map: e, table: n, tableStart: r }, i) {
let o = 0;
for (let u = 0; u < i; u++) o += n.child(u).nodeSize;
const s = o + n.child(i).nodeSize,
l = t.mapping.maps.length;
t.delete(o + r, s + r);
const a = new Set();
for (let u = 0, c = i * e.width; u < e.width; u++, c++) {
const f = e.map[c];
if (!a.has(f)) {
if ((a.add(f), i > 0 && f == e.map[c - e.width])) {
const h = n.nodeAt(f).attrs;
t.setNodeMarkup(
t.mapping.slice(l).map(f + r),
null,
be(W({}, h), { rowspan: h.rowspan - 1 })
),
(u += h.colspan - 1);
} else if (i < e.height && f == e.map[c + e.width]) {
const h = n.nodeAt(f),
p = h.attrs,
g = h.type.create(
be(W({}, p), { rowspan: h.attrs.rowspan - 1 }),
h.content
),
v = e.positionAt(i + 1, u, n);
t.insert(t.mapping.slice(l).map(r + v), g),
(u += p.colspan - 1);
}
}
}
}
function y4(t, e) {
if (!Ln(t)) return !1;
if (e) {
const n = Zn(t),
r = t.tr;
if (n.top == 0 && n.bottom == n.map.height) return !1;
for (let i = n.bottom - 1; g4(r, n, i), i != n.top; i--) {
const o = n.tableStart ? r.doc.nodeAt(n.tableStart - 1) : r.doc;
if (!o) throw RangeError("No table found");
(n.table = o), (n.map = pt.get(n.table));
}
e(r);
}
return !0;
}
function om(t) {
const e = t.content;
return (
e.childCount == 1 &&
e.child(0).isTextblock &&
e.child(0).childCount == 0
);
}
function v4({ width: t, height: e, map: n }, r) {
let i = r.top * t + r.left,
o = i,
s = (r.bottom - 1) * t + r.left,
l = i + (r.right - r.left - 1);
for (let a = r.top; a < r.bottom; a++) {
if (
(r.left > 0 && n[o] == n[o - 1]) ||
(r.right < t && n[l] == n[l + 1])
)
return !0;
(o += t), (l += t);
}
for (let a = r.left; a < r.right; a++) {
if (
(r.top > 0 && n[i] == n[i - t]) ||
(r.bottom < e && n[s] == n[s + t])
)
return !0;
i++, s++;
}
return !1;
}
function sm(t, e) {
const n = t.selection;
if (!(n instanceof nt) || n.$anchorCell.pos == n.$headCell.pos) return !1;
const r = Zn(t),
{ map: i } = r;
if (v4(i, r)) return !1;
if (e) {
const o = t.tr,
s = {};
let l = Y.empty,
a,
u;
for (let c = r.top; c < r.bottom; c++)
for (let f = r.left; f < r.right; f++) {
const h = i.map[c * i.width + f],
p = r.table.nodeAt(h);
if (!(s[h] || !p))
if (((s[h] = !0), a == null)) (a = h), (u = p);
else {
om(p) || (l = l.append(p.content));
const g = o.mapping.map(h + r.tableStart);
o.delete(g, g + p.nodeSize);
}
}
if (a == null || u == null) return !0;
if (
(o.setNodeMarkup(
a + r.tableStart,
null,
be(
W(
{},
sy(
u.attrs,
u.attrs.colspan,
r.right - r.left - u.attrs.colspan
)
),
{ rowspan: r.bottom - r.top }
)
),
l.size)
) {
const c = a + 1 + u.content.size,
f = om(u) ? a + 1 : c;
o.replaceWith(f + r.tableStart, c + r.tableStart, l);
}
o.setSelection(new nt(o.doc.resolve(a + r.tableStart))), e(o);
}
return !0;
}
function lm(t, e) {
const n = Vt(t.schema);
return b4(({ node: r }) => n[r.type.spec.tableRole])(t, e);
}
function b4(t) {
return (e, n) => {
var r;
const i = e.selection;
let o, s;
if (i instanceof nt) {
if (i.$anchorCell.pos != i.$headCell.pos) return !1;
(o = i.$anchorCell.nodeAfter), (s = i.$anchorCell.pos);
} else {
if (((o = PE(i.$from)), !o)) return !1;
s = (r = ho(i.$from)) == null ? void 0 : r.pos;
}
if (
o == null ||
s == null ||
(o.attrs.colspan == 1 && o.attrs.rowspan == 1)
)
return !1;
if (n) {
let l = o.attrs;
const a = [],
u = l.colwidth;
l.rowspan > 1 && (l = be(W({}, l), { rowspan: 1 })),
l.colspan > 1 && (l = be(W({}, l), { colspan: 1 }));
const c = Zn(e),
f = e.tr;
for (let p = 0; p < c.right - c.left; p++)
a.push(
u
? be(W({}, l), { colwidth: u && u[p] ? [u[p]] : null })
: l
);
let h;
for (let p = c.top; p < c.bottom; p++) {
let g = c.map.positionAt(p, c.left, c.table);
p == c.top && (g += o.nodeSize);
for (let v = c.left, b = 0; v < c.right; v++, b++)
(v == c.left && p == c.top) ||
f.insert(
(h = f.mapping.map(g + c.tableStart, 1)),
t({ node: o, row: p, col: v }).createAndFill(a[b])
);
}
f.setNodeMarkup(s, t({ node: o, row: c.top, col: c.left }), a[0]),
i instanceof nt &&
f.setSelection(
new nt(
f.doc.resolve(i.$anchorCell.pos),
h ? f.doc.resolve(h) : void 0
)
),
n(f);
}
return !0;
};
}
function w4(t, e) {
return function (n, r) {
if (!Ln(n)) return !1;
const i = qa(n);
if (i.nodeAfter.attrs[t] === e) return !1;
if (r) {
const o = n.tr;
n.selection instanceof nt
? n.selection.forEachCell((s, l) => {
s.attrs[t] !== e &&
o.setNodeMarkup(
l,
null,
be(W({}, s.attrs), { [t]: e })
);
})
: o.setNodeMarkup(
i.pos,
null,
be(W({}, i.nodeAfter.attrs), { [t]: e })
),
r(o);
}
return !0;
};
}
function x4(t) {
return function (e, n) {
if (!Ln(e)) return !1;
if (n) {
const r = Vt(e.schema),
i = Zn(e),
o = e.tr,
s = i.map.cellsInRect(
t == "column"
? {
left: i.left,
top: 0,
right: i.right,
bottom: i.map.height,
}
: t == "row"
? {
left: 0,
top: i.top,
right: i.map.width,
bottom: i.bottom,
}
: i
),
l = s.map((a) => i.table.nodeAt(a));
for (let a = 0; a < s.length; a++)
l[a].type == r.header_cell &&
o.setNodeMarkup(i.tableStart + s[a], r.cell, l[a].attrs);
if (o.steps.length == 0)
for (let a = 0; a < s.length; a++)
o.setNodeMarkup(
i.tableStart + s[a],
r.header_cell,
l[a].attrs
);
n(o);
}
return !0;
};
}
function am(t, e, n) {
const r = e.map.cellsInRect({
left: 0,
top: 0,
right: t == "row" ? e.map.width : 1,
bottom: t == "column" ? e.map.height : 1,
});
for (let i = 0; i < r.length; i++) {
const o = e.table.nodeAt(r[i]);
if (o && o.type !== n.header_cell) return !1;
}
return !0;
}
function ls(t, e) {
return (
(e = e || { useDeprecatedLogic: !1 }),
e.useDeprecatedLogic
? x4(t)
: function (n, r) {
if (!Ln(n)) return !1;
if (r) {
const i = Vt(n.schema),
o = Zn(n),
s = n.tr,
l = am("row", o, i),
a = am("column", o, i),
c = (t === "column" ? l : t === "row" ? a : !1)
? 1
: 0,
f =
t == "column"
? {
left: 0,
top: c,
right: 1,
bottom: o.map.height,
}
: t == "row"
? {
left: c,
top: 0,
right: o.map.width,
bottom: 1,
}
: o,
h =
t == "column"
? a
? i.cell
: i.header_cell
: t == "row"
? l
? i.cell
: i.header_cell
: i.cell;
o.map.cellsInRect(f).forEach((p) => {
const g = p + o.tableStart,
v = s.doc.nodeAt(g);
v && s.setNodeMarkup(g, h, v.attrs);
}),
r(s);
}
return !0;
}
);
}
ls("row", { useDeprecatedLogic: !0 });
ls("column", { useDeprecatedLogic: !0 });
var k4 = ls("cell", { useDeprecatedLogic: !0 });
function C4(t, e) {
if (e < 0) {
const n = t.nodeBefore;
if (n) return t.pos - n.nodeSize;
for (let r = t.index(-1) - 1, i = t.before(); r >= 0; r--) {
const o = t.node(-1).child(r),
s = o.lastChild;
if (s) return i - 1 - s.nodeSize;
i -= o.nodeSize;
}
} else {
if (t.index() < t.parent.childCount - 1)
return t.pos + t.nodeAfter.nodeSize;
const n = t.node(-1);
for (let r = t.indexAfter(-1), i = t.after(); r < n.childCount; r++) {
const o = n.child(r);
if (o.childCount) return i + 1;
i += o.nodeSize;
}
}
return null;
}
function um(t) {
return function (e, n) {
if (!Ln(e)) return !1;
const r = C4(qa(e), t);
if (r == null) return !1;
if (n) {
const i = e.doc.resolve(r);
n(e.tr.setSelection(Ce.between(i, jE(i))).scrollIntoView());
}
return !0;
};
}
function S4(t, e) {
const n = t.selection.$anchor;
for (let r = n.depth; r > 0; r--)
if (n.node(r).type.spec.tableRole == "table")
return (
e && e(t.tr.delete(n.before(r), n.after(r)).scrollIntoView()),
!0
);
return !1;
}
function _4({ allowTableNodeSelection: t = !1 } = {}) {
return new Tt({
key: kr,
state: {
init() {
return null;
},
apply(e, n) {
const r = e.getMeta(kr);
if (r != null) return r == -1 ? null : r;
if (n == null || !e.docChanged) return n;
const { deleted: i, pos: o } = e.mapping.mapResult(n);
return i ? null : o;
},
},
props: {
decorations: IE,
handleDOMEvents: { mousedown: YE },
createSelectionBetween(e) {
return kr.getState(e.state) != null ? e.state.selection : null;
},
handleTripleClick: JE,
handleKeyDown: qE,
handlePaste: GE,
},
appendTransaction(e, n, r) {
return zE(r, uy(r, n), t);
},
});
}
function cm(t, e, n, r, i, o) {
let s = 0,
l = !0,
a = e.firstChild;
const u = t.firstChild;
for (let c = 0, f = 0; c < u.childCount; c += 1) {
const { colspan: h, colwidth: p } = u.child(c).attrs;
for (let g = 0; g < h; g += 1, f += 1) {
const v = i === f ? o : p && p[g],
b = v ? `${v}px` : "";
(s += v || r),
v || (l = !1),
a
? (a.style.width !== b && (a.style.width = b),
(a = a.nextSibling))
: (e.appendChild(
document.createElement("col")
).style.width = b);
}
}
for (; a; ) {
const c = a.nextSibling;
a.parentNode.removeChild(a), (a = c);
}
l
? ((n.style.width = `${s}px`), (n.style.minWidth = ""))
: ((n.style.width = ""), (n.style.minWidth = `${s}px`));
}
class M4 {
constructor(e, n) {
(this.node = e),
(this.cellMinWidth = n),
(this.dom = document.createElement("div")),
(this.dom.className = "tableWrapper"),
(this.table = this.dom.appendChild(
document.createElement("table")
)),
(this.colgroup = this.table.appendChild(
document.createElement("colgroup")
)),
cm(e, this.colgroup, this.table, n),
(this.contentDOM = this.table.appendChild(
document.createElement("tbody")
));
}
update(e) {
return e.type !== this.node.type
? !1
: ((this.node = e),
cm(e, this.colgroup, this.table, this.cellMinWidth),
!0);
}
ignoreMutation(e) {
return (
e.type === "attributes" &&
(e.target === this.table || this.colgroup.contains(e.target))
);
}
}
function dm(t, e) {
return e ? t.createChecked(null, e) : t.createAndFill();
}
function E4(t) {
if (t.cached.tableNodeTypes) return t.cached.tableNodeTypes;
const e = {};
return (
Object.keys(t.nodes).forEach((n) => {
const r = t.nodes[n];
r.spec.tableRole && (e[r.spec.tableRole] = r);
}),
(t.cached.tableNodeTypes = e),
e
);
}
function A4(t, e, n, r, i) {
const o = E4(t),
s = [],
l = [];
for (let u = 0; u < n; u += 1) {
const c = dm(o.cell, i);
if ((c && l.push(c), r)) {
const f = dm(o.header_cell, i);
f && s.push(f);
}
}
const a = [];
for (let u = 0; u < e; u += 1)
a.push(o.row.createChecked(null, r && u === 0 ? s : l));
return o.table.createChecked(null, a);
}
function T4(t) {
return t instanceof nt;
}
const Gs = ({ editor: t }) => {
const { selection: e } = t.state;
if (!T4(e)) return !1;
let n = 0;
const r = F0(e.ranges[0].$from, (o) => o.type.name === "table");
return (
r == null ||
r.node.descendants((o) => {
if (o.type.name === "table") return !1;
["tableCell", "tableHeader"].includes(o.type.name) &&
(n += 1);
}),
n === e.ranges.length ? (t.commands.deleteTable(), !0) : !1
);
},
jR = ut.create({
name: "table",
addOptions() {
return {
HTMLAttributes: {},
resizable: !1,
handleWidth: 5,
cellMinWidth: 25,
View: M4,
lastColumnResizable: !0,
allowTableNodeSelection: !1,
};
},
content: "tableRow+",
tableRole: "table",
isolating: !0,
group: "block",
parseHTML() {
return [{ tag: "table" }];
},
renderHTML({ HTMLAttributes: t }) {
return ["table", et(this.options.HTMLAttributes, t), ["tbody", 0]];
},
addCommands() {
return {
insertTable:
({
rows: t = 3,
cols: e = 3,
withHeaderRow: n = !0,
} = {}) =>
({ tr: r, dispatch: i, editor: o }) => {
const s = A4(o.schema, t, e, n);
if (i) {
const l = r.selection.anchor + 1;
r.replaceSelectionWith(s)
.scrollIntoView()
.setSelection(Ce.near(r.doc.resolve(l)));
}
return !0;
},
addColumnBefore:
() =>
({ state: t, dispatch: e }) =>
u4(t, e),
addColumnAfter:
() =>
({ state: t, dispatch: e }) =>
c4(t, e),
deleteColumn:
() =>
({ state: t, dispatch: e }) =>
f4(t, e),
addRowBefore:
() =>
({ state: t, dispatch: e }) =>
p4(t, e),
addRowAfter:
() =>
({ state: t, dispatch: e }) =>
m4(t, e),
deleteRow:
() =>
({ state: t, dispatch: e }) =>
y4(t, e),
deleteTable:
() =>
({ state: t, dispatch: e }) =>
S4(t, e),
mergeCells:
() =>
({ state: t, dispatch: e }) =>
sm(t, e),
splitCell:
() =>
({ state: t, dispatch: e }) =>
lm(t, e),
toggleHeaderColumn:
() =>
({ state: t, dispatch: e }) =>
ls("column")(t, e),
toggleHeaderRow:
() =>
({ state: t, dispatch: e }) =>
ls("row")(t, e),
toggleHeaderCell:
() =>
({ state: t, dispatch: e }) =>
k4(t, e),
mergeOrSplit:
() =>
({ state: t, dispatch: e }) =>
sm(t, e) ? !0 : lm(t, e),
setCellAttribute:
(t, e) =>
({ state: n, dispatch: r }) =>
w4(t, e)(n, r),
goToNextCell:
() =>
({ state: t, dispatch: e }) =>
um(1)(t, e),
goToPreviousCell:
() =>
({ state: t, dispatch: e }) =>
um(-1)(t, e),
fixTables:
() =>
({ state: t, dispatch: e }) => (e && uy(t), !0),
setCellSelection:
(t) =>
({ tr: e, dispatch: n }) => {
if (n) {
const r = nt.create(
e.doc,
t.anchorCell,
t.headCell
);
e.setSelection(r);
}
return !0;
},
};
},
addKeyboardShortcuts() {
return {
Tab: () =>
this.editor.commands.goToNextCell()
? !0
: this.editor.can().addRowAfter()
? this.editor.chain().addRowAfter().goToNextCell().run()
: !1,
"Shift-Tab": () => this.editor.commands.goToPreviousCell(),
Backspace: Gs,
"Mod-Backspace": Gs,
Delete: Gs,
"Mod-Delete": Gs,
};
},
addProseMirrorPlugins() {
return [
...(this.options.resizable && this.editor.isEditable
? [
XE({
handleWidth: this.options.handleWidth,
cellMinWidth: this.options.cellMinWidth,
View: this.options.View,
lastColumnResizable:
this.options.lastColumnResizable,
}),
]
: []),
_4({
allowTableNodeSelection:
this.options.allowTableNodeSelection,
}),
];
},
extendNodeSchema(t) {
const e = { name: t.name, options: t.options, storage: t.storage };
return { tableRole: lt(bt(t, "tableRole", e)) };
},
}),
LR = ut.create({
name: "tableCell",
addOptions() {
return { HTMLAttributes: {} };
},
content: "block+",
addAttributes() {
return {
colspan: { default: 1 },
rowspan: { default: 1 },
colwidth: {
default: null,
parseHTML: (t) => {
const e = t.getAttribute("colwidth");
return e ? [parseInt(e, 10)] : null;
},
},
};
},
tableRole: "cell",
isolating: !0,
parseHTML() {
return [{ tag: "td" }];
},
renderHTML({ HTMLAttributes: t }) {
return ["td", et(this.options.HTMLAttributes, t), 0];
},
}),
DR = ut.create({
name: "tableHeader",
addOptions() {
return { HTMLAttributes: {} };
},
content: "block+",
addAttributes() {
return {
colspan: { default: 1 },
rowspan: { default: 1 },
colwidth: {
default: null,
parseHTML: (t) => {
const e = t.getAttribute("colwidth");
return e ? [parseInt(e, 10)] : null;
},
},
};
},
tableRole: "header_cell",
isolating: !0,
parseHTML() {
return [{ tag: "th" }];
},
renderHTML({ HTMLAttributes: t }) {
return ["th", et(this.options.HTMLAttributes, t), 0];
},
}),
IR = ut.create({
name: "tableRow",
addOptions() {
return { HTMLAttributes: {} };
},
content: "(tableCell | tableHeader)*",
tableRole: "row",
parseHTML() {
return [{ tag: "tr" }];
},
renderHTML({ HTMLAttributes: t }) {
return ["tr", et(this.options.HTMLAttributes, t), 0];
},
}),
fm = (t) =>
new Promise((e) => {
let n = new FileReader();
(n.onloadend = () => {
e(n.result);
}),
n.readAsDataURL(t);
}),
O4 = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,
BR = ut.create({
name: "image",
addOptions() {
return { inline: !1, HTMLAttributes: {} };
},
inline() {
return this.options.inline;
},
group() {
return this.options.inline ? "inline" : "block";
},
draggable: !0,
addAttributes() {
return {
src: { default: null },
alt: { default: null },
title: { default: null },
};
},
parseHTML() {
return [{ tag: "img[src]" }];
},
renderHTML({ HTMLAttributes: t }) {
return ["img", et(this.options.HTMLAttributes, t)];
},
addCommands() {
return {
setImage:
(t) =>
({ commands: e }) =>
e.insertContent({ type: this.name, attrs: t }),
};
},
addInputRules() {
return [
W0({
find: O4,
type: this.type,
getAttributes: (t) => {
const [, , e, n, r] = t;
return { src: n, alt: e, title: r };
},
}),
];
},
addProseMirrorPlugins() {
return [R4()];
},
}),
R4 = () =>
new Tt({
props: {
handlePaste(t, e, n) {
var o;
const r = Array.from(
((o = e.clipboardData) == null
? void 0
: o.items) || []
),
{ schema: i } = t.state;
return (
r.forEach((s) => {
const l = s.getAsFile();
!l ||
(s.type.indexOf("image") === 0 &&
(e.preventDefault(),
fm(l).then((a) => {
const u = i.nodes.image.create({
src: a,
}),
c =
t.state.tr.replaceSelectionWith(
u
);
t.dispatch(c);
})));
}),
!1
);
},
handleDOMEvents: {
drop: (t, e) => {
var s, l;
if (
!(
e.dataTransfer &&
e.dataTransfer.files &&
e.dataTransfer.files.length
)
)
return !1;
const r = Array.from(
(l =
(s = e.dataTransfer) == null
? void 0
: s.files) != null
? l
: []
).filter((a) => /image/i.test(a.type));
if (r.length === 0) return !1;
e.preventDefault();
const { schema: i } = t.state,
o = t.posAtCoords({
left: e.clientX,
top: e.clientY,
});
return o
? (r.forEach((a) =>
cr(void 0, null, function* () {
fm(a).then((u) => {
const c = i.nodes.image.create({
src: u,
}),
f = t.state.tr.insert(o.pos, c);
t.dispatch(f);
});
})
),
!0)
: !1;
},
},
},
}),
$R = ut.create({
name: "video",
group: "block",
selectable: !0,
draggable: !0,
atom: !0,
addAttributes() {
return { src: { default: null } };
},
parseHTML() {
return [{ tag: "video" }];
},
renderHTML({ HTMLAttributes: t }) {
return ["video", et(t)];
},
addNodeView() {
return ({ editor: t, node: e }) => {
const n = document.createElement("div");
n.className =
"relative aspect-w-16 aspect-h-9" +
(t.isEditable ? " cursor-pointer" : "");
const r = document.createElement("video");
if (
(t.isEditable && (r.className = "pointer-events-none"),
(r.src = e.attrs.src),
!t.isEditable)
)
r.setAttribute("controls", "");
else {
let i = document.createElement("div");
(i.className =
"absolute top-0 right-0 text-xs m-2 bg-gray-800 text-white px-2 py-1 rounded-md"),
(i.innerHTML = "Video"),
n.append(i);
}
return n.append(r), { dom: n };
};
},
}),
P4 =
"aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",
N4 =
"\u03B5\u03BB1\u03C52\u0431\u04331\u0435\u043B3\u0434\u0435\u0442\u04384\u0435\u044E2\u043A\u0430\u0442\u043E\u043B\u0438\u043A6\u043E\u043C3\u043C\u043A\u04342\u043E\u043D1\u0441\u043A\u0432\u04306\u043E\u043D\u043B\u0430\u0439\u043D5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043A\u04403\u049B\u0430\u04373\u0570\u0561\u05753\u05D9\u05E9\u05E8\u05D0\u05DC5\u05E7\u05D5\u05DD3\u0627\u0628\u0648\u0638\u0628\u064A5\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062F\u06464\u0628\u062D\u0631\u064A\u06465\u062C\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062F\u064A\u06296\u0639\u0644\u064A\u0627\u06465\u0645\u063A\u0631\u06285\u0645\u0627\u0631\u0627\u062A5\u06CC\u0631\u0627\u06465\u0628\u0627\u0631\u062A2\u0632\u0627\u06314\u064A\u062A\u06433\u06BE\u0627\u0631\u062A5\u062A\u0648\u0646\u06334\u0633\u0648\u062F\u0627\u06463\u0631\u064A\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064A\u06466\u0642\u0637\u06313\u0643\u0627\u062B\u0648\u0644\u064A\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064A\u0633\u064A\u06275\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067E\u0627\u06A9\u0633\u062A\u0627\u06467\u0680\u0627\u0631\u062A4\u0915\u0949\u092E3\u0928\u0947\u091F3\u092D\u093E\u0930\u09240\u092E\u094D3\u094B\u09245\u0938\u0902\u0917\u0920\u09285\u09AC\u09BE\u0982\u09B2\u09BE5\u09AD\u09BE\u09B0\u09A42\u09F0\u09A44\u0A2D\u0A3E\u0A30\u0A244\u0AAD\u0ABE\u0AB0\u0AA44\u0B2D\u0B3E\u0B30\u0B244\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE6\u0BB2\u0B99\u0BCD\u0B95\u0BC86\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD11\u0C2D\u0C3E\u0C30\u0C24\u0C4D5\u0CAD\u0CBE\u0CB0\u0CA44\u0D2D\u0D3E\u0D30\u0D24\u0D025\u0DBD\u0D82\u0D9A\u0DCF4\u0E04\u0E2D\u0E213\u0E44\u0E17\u0E223\u0EA5\u0EB2\u0EA73\u10D2\u10D42\u307F\u3093\u306A3\u30A2\u30DE\u30BE\u30F34\u30AF\u30E9\u30A6\u30C94\u30B0\u30FC\u30B0\u30EB4\u30B3\u30E02\u30B9\u30C8\u30A23\u30BB\u30FC\u30EB3\u30D5\u30A1\u30C3\u30B7\u30E7\u30F36\u30DD\u30A4\u30F3\u30C84\u4E16\u754C2\u4E2D\u4FE11\u56FD1\u570B1\u6587\u7F513\u4E9A\u9A6C\u900A3\u4F01\u4E1A2\u4F5B\u5C712\u4FE1\u606F2\u5065\u5EB72\u516B\u53662\u516C\u53F81\u76CA2\u53F0\u6E7E1\u70632\u5546\u57CE1\u5E971\u68072\u5609\u91CC0\u5927\u9152\u5E975\u5728\u7EBF2\u5927\u62FF2\u5929\u4E3B\u65593\u5A31\u4E502\u5BB6\u96FB2\u5E7F\u4E1C2\u5FAE\u535A2\u6148\u55842\u6211\u7231\u4F603\u624B\u673A2\u62DB\u80582\u653F\u52A11\u5E9C2\u65B0\u52A0\u57612\u95FB2\u65F6\u5C1A2\u66F8\u7C4D2\u673A\u67842\u6DE1\u9A6C\u95213\u6E38\u620F2\u6FB3\u95802\u70B9\u770B2\u79FB\u52A82\u7EC4\u7EC7\u673A\u67844\u7F51\u57401\u5E971\u7AD91\u7EDC2\u8054\u901A2\u8C37\u6B4C2\u8D2D\u72692\u901A\u8CA92\u96C6\u56E22\u96FB\u8A0A\u76C8\u79D14\u98DE\u5229\u6D663\u98DF\u54C12\u9910\u53852\u9999\u683C\u91CC\u62C93\u6E2F2\uB2F7\uB1371\uCEF42\uC0BC\uC1312\uD55C\uAD6D2",
ro = (t, e) => {
for (const n in e) t[n] = e[n];
return t;
},
Vc = "numeric",
Wc = "ascii",
Uc = "alpha",
fl = "asciinumeric",
Ys = "alphanumeric",
Kc = "domain",
py = "emoji",
j4 = "scheme",
L4 = "slashscheme",
hm = "whitespace";
function D4(t, e) {
return t in e || (e[t] = []), e[t];
}
function ii(t, e, n) {
e[Vc] && ((e[fl] = !0), (e[Ys] = !0)),
e[Wc] && ((e[fl] = !0), (e[Uc] = !0)),
e[fl] && (e[Ys] = !0),
e[Uc] && (e[Ys] = !0),
e[Ys] && (e[Kc] = !0),
e[py] && (e[Kc] = !0);
for (const r in e) {
const i = D4(r, n);
i.indexOf(t) < 0 && i.push(t);
}
}
function I4(t, e) {
const n = {};
for (const r in e) e[r].indexOf(t) >= 0 && (n[r] = !0);
return n;
}
function Yt(t) {
t === void 0 && (t = null),
(this.j = {}),
(this.jr = []),
(this.jd = null),
(this.t = t);
}
Yt.groups = {};
Yt.prototype = {
accepts() {
return !!this.t;
},
go(t) {
const e = this,
n = e.j[t];
if (n) return n;
for (let r = 0; r < e.jr.length; r++) {
const i = e.jr[r][0],
o = e.jr[r][1];
if (o && i.test(t)) return o;
}
return e.jd;
},
has(t, e) {
return e === void 0 && (e = !1), e ? t in this.j : !!this.go(t);
},
ta(t, e, n, r) {
for (let i = 0; i < t.length; i++) this.tt(t[i], e, n, r);
},
tr(t, e, n, r) {
r = r || Yt.groups;
let i;
return (
e && e.j ? (i = e) : ((i = new Yt(e)), n && r && ii(e, n, r)),
this.jr.push([t, i]),
i
);
},
ts(t, e, n, r) {
let i = this;
const o = t.length;
if (!o) return i;
for (let s = 0; s < o - 1; s++) i = i.tt(t[s]);
return i.tt(t[o - 1], e, n, r);
},
tt(t, e, n, r) {
r = r || Yt.groups;
const i = this;
if (e && e.j) return (i.j[t] = e), e;
const o = e;
let s,
l = i.go(t);
if (
(l
? ((s = new Yt()),
ro(s.j, l.j),
s.jr.push.apply(s.jr, l.jr),
(s.jd = l.jd),
(s.t = l.t))
: (s = new Yt()),
o)
) {
if (r)
if (s.t && typeof s.t == "string") {
const a = ro(I4(s.t, r), n);
ii(o, a, r);
} else n && ii(o, n, r);
s.t = o;
}
return (i.j[t] = s), s;
},
};
const Ne = (t, e, n, r, i) => t.ta(e, n, r, i),
dn = (t, e, n, r, i) => t.tr(e, n, r, i),
pm = (t, e, n, r, i) => t.ts(e, n, r, i),
re = (t, e, n, r, i) => t.tt(e, n, r, i),
nr = "WORD",
qc = "UWORD",
as = "LOCALHOST",
Jc = "TLD",
Gc = "UTLD",
hl = "SCHEME",
ji = "SLASH_SCHEME",
kf = "NUM",
my = "WS",
Cf = "NL",
Ho = "OPENBRACE",
Fo = "CLOSEBRACE",
Vl = "OPENBRACKET",
Wl = "CLOSEBRACKET",
Ul = "OPENPAREN",
Kl = "CLOSEPAREN",
ql = "OPENANGLEBRACKET",
Jl = "CLOSEANGLEBRACKET",
Gl = "FULLWIDTHLEFTPAREN",
Yl = "FULLWIDTHRIGHTPAREN",
Ql = "LEFTCORNERBRACKET",
Xl = "RIGHTCORNERBRACKET",
Zl = "LEFTWHITECORNERBRACKET",
ea = "RIGHTWHITECORNERBRACKET",
ta = "FULLWIDTHLESSTHAN",
na = "FULLWIDTHGREATERTHAN",
ra = "AMPERSAND",
ia = "APOSTROPHE",
oa = "ASTERISK",
xr = "AT",
sa = "BACKSLASH",
la = "BACKTICK",
aa = "CARET",
Cr = "COLON",
Sf = "COMMA",
ua = "DOLLAR",
Bn = "DOT",
ca = "EQUALS",
_f = "EXCLAMATION",
$n = "HYPHEN",
da = "PERCENT",
fa = "PIPE",
ha = "PLUS",
pa = "POUND",
ma = "QUERY",
Mf = "QUOTE",
Ef = "SEMI",
zn = "SLASH",
Vo = "TILDE",
ga = "UNDERSCORE",
gy = "EMOJI",
ya = "SYM";
var yy = Object.freeze({
__proto__: null,
WORD: nr,
UWORD: qc,
LOCALHOST: as,
TLD: Jc,
UTLD: Gc,
SCHEME: hl,
SLASH_SCHEME: ji,
NUM: kf,
WS: my,
NL: Cf,
OPENBRACE: Ho,
CLOSEBRACE: Fo,
OPENBRACKET: Vl,
CLOSEBRACKET: Wl,
OPENPAREN: Ul,
CLOSEPAREN: Kl,
OPENANGLEBRACKET: ql,
CLOSEANGLEBRACKET: Jl,
FULLWIDTHLEFTPAREN: Gl,
FULLWIDTHRIGHTPAREN: Yl,
LEFTCORNERBRACKET: Ql,
RIGHTCORNERBRACKET: Xl,
LEFTWHITECORNERBRACKET: Zl,
RIGHTWHITECORNERBRACKET: ea,
FULLWIDTHLESSTHAN: ta,
FULLWIDTHGREATERTHAN: na,
AMPERSAND: ra,
APOSTROPHE: ia,
ASTERISK: oa,
AT: xr,
BACKSLASH: sa,
BACKTICK: la,
CARET: aa,
COLON: Cr,
COMMA: Sf,
DOLLAR: ua,
DOT: Bn,
EQUALS: ca,
EXCLAMATION: _f,
HYPHEN: $n,
PERCENT: da,
PIPE: fa,
PLUS: ha,
POUND: pa,
QUERY: ma,
QUOTE: Mf,
SEMI: Ef,
SLASH: zn,
TILDE: Vo,
UNDERSCORE: ga,
EMOJI: gy,
SYM: ya,
});
const Ti = /[a-z]/,
zu = new RegExp("\\p{L}", "u"),
Hu = new RegExp("\\p{Emoji}", "u"),
Fu = /\d/,
mm = /\s/,
gm = `
`,
B4 = "\uFE0F",
$4 = "\u200D";
let Qs = null,
Xs = null;
function z4(t) {
t === void 0 && (t = []);
const e = {};
Yt.groups = e;
const n = new Yt();
Qs == null && (Qs = ym(P4)),
Xs == null && (Xs = ym(N4)),
re(n, "'", ia),
re(n, "{", Ho),
re(n, "}", Fo),
re(n, "[", Vl),
re(n, "]", Wl),
re(n, "(", Ul),
re(n, ")", Kl),
re(n, "<", ql),
re(n, ">", Jl),
re(n, "\uFF08", Gl),
re(n, "\uFF09", Yl),
re(n, "\u300C", Ql),
re(n, "\u300D", Xl),
re(n, "\u300E", Zl),
re(n, "\u300F", ea),
re(n, "\uFF1C", ta),
re(n, "\uFF1E", na),
re(n, "&", ra),
re(n, "*", oa),
re(n, "@", xr),
re(n, "`", la),
re(n, "^", aa),
re(n, ":", Cr),
re(n, ",", Sf),
re(n, "$", ua),
re(n, ".", Bn),
re(n, "=", ca),
re(n, "!", _f),
re(n, "-", $n),
re(n, "%", da),
re(n, "|", fa),
re(n, "+", ha),
re(n, "#", pa),
re(n, "?", ma),
re(n, '"', Mf),
re(n, "/", zn),
re(n, ";", Ef),
re(n, "~", Vo),
re(n, "_", ga),
re(n, "\\", sa);
const r = dn(n, Fu, kf, { [Vc]: !0 });
dn(r, Fu, r);
const i = dn(n, Ti, nr, { [Wc]: !0 });
dn(i, Ti, i);
const o = dn(n, zu, qc, { [Uc]: !0 });
dn(o, Ti), dn(o, zu, o);
const s = dn(n, mm, my, { [hm]: !0 });
re(n, gm, Cf, { [hm]: !0 }), re(s, gm), dn(s, mm, s);
const l = dn(n, Hu, gy, { [py]: !0 });
dn(l, Hu, l), re(l, B4, l);
const a = re(l, $4);
dn(a, Hu, l);
const u = [[Ti, i]],
c = [
[Ti, null],
[zu, o],
];
for (let f = 0; f < Qs.length; f++) mr(n, Qs[f], Jc, nr, u);
for (let f = 0; f < Xs.length; f++) mr(n, Xs[f], Gc, qc, c);
ii(Jc, { tld: !0, ascii: !0 }, e),
ii(Gc, { utld: !0, alpha: !0 }, e),
mr(n, "file", hl, nr, u),
mr(n, "mailto", hl, nr, u),
mr(n, "http", ji, nr, u),
mr(n, "https", ji, nr, u),
mr(n, "ftp", ji, nr, u),
mr(n, "ftps", ji, nr, u),
ii(hl, { scheme: !0, ascii: !0 }, e),
ii(ji, { slashscheme: !0, ascii: !0 }, e),
(t = t.sort((f, h) => (f[0] > h[0] ? 1 : -1)));
for (let f = 0; f < t.length; f++) {
const h = t[f][0],
g = t[f][1] ? { [j4]: !0 } : { [L4]: !0 };
h.indexOf("-") >= 0
? (g[Kc] = !0)
: Ti.test(h)
? Fu.test(h)
? (g[fl] = !0)
: (g[Wc] = !0)
: (g[Vc] = !0),
pm(n, h, h, g);
}
return (
pm(n, "localhost", as, { ascii: !0 }),
(n.jd = new Yt(ya)),
{ start: n, tokens: ro({ groups: e }, yy) }
);
}
function H4(t, e) {
const n = F4(e.replace(/[A-Z]/g, (l) => l.toLowerCase())),
r = n.length,
i = [];
let o = 0,
s = 0;
for (; s < r; ) {
let l = t,
a = null,
u = 0,
c = null,
f = -1,
h = -1;
for (; s < r && (a = l.go(n[s])); )
(l = a),
l.accepts()
? ((f = 0), (h = 0), (c = l))
: f >= 0 && ((f += n[s].length), h++),
(u += n[s].length),
(o += n[s].length),
s++;
(o -= f),
(s -= h),
(u -= f),
i.push({ t: c.t, v: e.slice(o - u, o), s: o - u, e: o });
}
return i;
}
function F4(t) {
const e = [],
n = t.length;
let r = 0;
for (; r < n; ) {
let i = t.charCodeAt(r),
o,
s =
i < 55296 ||
i > 56319 ||
r + 1 === n ||
(o = t.charCodeAt(r + 1)) < 56320 ||
o > 57343
? t[r]
: t.slice(r, r + 2);
e.push(s), (r += s.length);
}
return e;
}
function mr(t, e, n, r, i) {
let o;
const s = e.length;
for (let l = 0; l < s - 1; l++) {
const a = e[l];
t.j[a]
? (o = t.j[a])
: ((o = new Yt(r)), (o.jr = i.slice()), (t.j[a] = o)),
(t = o);
}
return (o = new Yt(n)), (o.jr = i.slice()), (t.j[e[s - 1]] = o), o;
}
function ym(t) {
const e = [],
n = [];
let r = 0,
i = "0123456789";
for (; r < t.length; ) {
let o = 0;
for (; i.indexOf(t[r + o]) >= 0; ) o++;
if (o > 0) {
e.push(n.join(""));
for (let s = parseInt(t.substring(r, r + o), 10); s > 0; s--)
n.pop();
r += o;
} else n.push(t[r]), r++;
}
return e;
}
const us = {
defaultProtocol: "http",
events: null,
format: vm,
formatHref: vm,
nl2br: !1,
tagName: "a",
target: null,
rel: null,
validate: !0,
truncate: 1 / 0,
className: null,
attributes: null,
ignoreTags: [],
render: null,
};
function Af(t, e) {
e === void 0 && (e = null);
let n = ro({}, us);
t && (n = ro(n, t instanceof Af ? t.o : t));
const r = n.ignoreTags,
i = [];
for (let o = 0; o < r.length; o++) i.push(r[o].toUpperCase());
(this.o = n), e && (this.defaultRender = e), (this.ignoreTags = i);
}
Af.prototype = {
o: us,
ignoreTags: [],
defaultRender(t) {
return t;
},
check(t) {
return this.get("validate", t.toString(), t);
},
get(t, e, n) {
const r = e != null;
let i = this.o[t];
return (
i &&
(typeof i == "object"
? ((i = n.t in i ? i[n.t] : us[t]),
typeof i == "function" && r && (i = i(e, n)))
: typeof i == "function" && r && (i = i(e, n.t, n)),
i)
);
},
getObj(t, e, n) {
let r = this.o[t];
return typeof r == "function" && e != null && (r = r(e, n.t, n)), r;
},
render(t) {
const e = t.render(this);
return (this.get("render", null, t) || this.defaultRender)(e, t.t, t);
},
};
function vm(t) {
return t;
}
function vy(t, e) {
(this.t = "token"), (this.v = t), (this.tk = e);
}
vy.prototype = {
isLink: !1,
toString() {
return this.v;
},
toHref(t) {
return this.toString();
},
toFormattedString(t) {
const e = this.toString(),
n = t.get("truncate", e, this),
r = t.get("format", e, this);
return n && r.length > n ? r.substring(0, n) + "\u2026" : r;
},
toFormattedHref(t) {
return t.get("formatHref", this.toHref(t.get("defaultProtocol")), this);
},
startIndex() {
return this.tk[0].s;
},
endIndex() {
return this.tk[this.tk.length - 1].e;
},
toObject(t) {
return (
t === void 0 && (t = us.defaultProtocol),
{
type: this.t,
value: this.toString(),
isLink: this.isLink,
href: this.toHref(t),
start: this.startIndex(),
end: this.endIndex(),
}
);
},
toFormattedObject(t) {
return {
type: this.t,
value: this.toFormattedString(t),
isLink: this.isLink,
href: this.toFormattedHref(t),
start: this.startIndex(),
end: this.endIndex(),
};
},
validate(t) {
return t.get("validate", this.toString(), this);
},
render(t) {
const e = this,
n = this.toHref(t.get("defaultProtocol")),
r = t.get("formatHref", n, this),
i = t.get("tagName", n, e),
o = this.toFormattedString(t),
s = {},
l = t.get("className", n, e),
a = t.get("target", n, e),
u = t.get("rel", n, e),
c = t.getObj("attributes", n, e),
f = t.getObj("events", n, e);
return (
(s.href = r),
l && (s.class = l),
a && (s.target = a),
u && (s.rel = u),
c && ro(s, c),
{ tagName: i, attributes: s, content: o, eventListeners: f }
);
},
};
function Ja(t, e) {
class n extends vy {
constructor(i, o) {
super(i, o), (this.t = t);
}
}
for (const r in e) n.prototype[r] = e[r];
return (n.t = t), n;
}
const bm = Ja("email", {
isLink: !0,
toHref() {
return "mailto:" + this.toString();
},
}),
wm = Ja("text"),
V4 = Ja("nl"),
Zs = Ja("url", {
isLink: !0,
toHref(t) {
return (
t === void 0 && (t = us.defaultProtocol),
this.hasProtocol() ? this.v : `${t}://${this.v}`
);
},
hasProtocol() {
const t = this.tk;
return t.length >= 2 && t[0].t !== as && t[1].t === Cr;
},
}),
fn = (t) => new Yt(t);
function W4(t) {
let { groups: e } = t;
const n = e.domain.concat([
ra,
oa,
xr,
sa,
la,
aa,
ua,
ca,
$n,
kf,
da,
fa,
ha,
pa,
zn,
ya,
Vo,
ga,
]),
r = [
ia,
Cr,
Sf,
Bn,
_f,
ma,
Mf,
Ef,
ql,
Jl,
Ho,
Fo,
Wl,
Vl,
Ul,
Kl,
Gl,
Yl,
Ql,
Xl,
Zl,
ea,
ta,
na,
],
i = [
ra,
ia,
oa,
sa,
la,
aa,
ua,
ca,
$n,
Ho,
Fo,
da,
fa,
ha,
pa,
ma,
zn,
ya,
Vo,
ga,
],
o = fn(),
s = re(o, Vo);
Ne(s, i, s), Ne(s, e.domain, s);
const l = fn(),
a = fn(),
u = fn();
Ne(o, e.domain, l),
Ne(o, e.scheme, a),
Ne(o, e.slashscheme, u),
Ne(l, i, s),
Ne(l, e.domain, l);
const c = re(l, xr);
re(s, xr, c), re(a, xr, c), re(u, xr, c);
const f = re(s, Bn);
Ne(f, i, s), Ne(f, e.domain, s);
const h = fn();
Ne(c, e.domain, h), Ne(h, e.domain, h);
const p = re(h, Bn);
Ne(p, e.domain, h);
const g = fn(bm);
Ne(p, e.tld, g), Ne(p, e.utld, g), re(c, as, g);
const v = re(h, $n);
Ne(v, e.domain, h), Ne(g, e.domain, h), re(g, Bn, p), re(g, $n, v);
const b = re(g, Cr);
Ne(b, e.numeric, bm);
const x = re(l, $n),
S = re(l, Bn);
Ne(x, e.domain, l), Ne(S, i, s), Ne(S, e.domain, l);
const T = fn(Zs);
Ne(S, e.tld, T),
Ne(S, e.utld, T),
Ne(T, e.domain, l),
Ne(T, i, s),
re(T, Bn, S),
re(T, $n, x),
re(T, xr, c);
const d = re(T, Cr),
y = fn(Zs);
Ne(d, e.numeric, y);
const m = fn(Zs),
w = fn();
Ne(m, n, m),
Ne(m, r, w),
Ne(w, n, m),
Ne(w, r, w),
re(T, zn, m),
re(y, zn, m);
const k = re(a, Cr),
_ = re(u, Cr),
C = re(_, zn),
E = re(C, zn);
Ne(a, e.domain, l),
re(a, Bn, S),
re(a, $n, x),
Ne(u, e.domain, l),
re(u, Bn, S),
re(u, $n, x),
Ne(k, e.domain, m),
re(k, zn, m),
Ne(E, e.domain, m),
Ne(E, n, m),
re(E, zn, m);
const R = [
[Ho, Fo],
[Vl, Wl],
[Ul, Kl],
[ql, Jl],
[Gl, Yl],
[Ql, Xl],
[Zl, ea],
[ta, na],
];
for (let P = 0; P < R.length; P++) {
const [L, I] = R[P],
M = re(m, L);
re(w, L, M), re(M, I, m);
const N = fn(Zs);
Ne(M, n, N);
const D = fn();
Ne(M, r),
Ne(N, n, N),
Ne(N, r, D),
Ne(D, n, N),
Ne(D, r, D),
re(N, I, m),
re(D, I, m);
}
return re(o, as, T), re(o, Cf, V4), { start: o, tokens: yy };
}
function U4(t, e, n) {
let r = n.length,
i = 0,
o = [],
s = [];
for (; i < r; ) {
let l = t,
a = null,
u = null,
c = 0,
f = null,
h = -1;
for (; i < r && !(a = l.go(n[i].t)); ) s.push(n[i++]);
for (; i < r && (u = a || l.go(n[i].t)); )
(a = null),
(l = u),
l.accepts() ? ((h = 0), (f = l)) : h >= 0 && h++,
i++,
c++;
if (h < 0) (i -= c), i < r && (s.push(n[i]), i++);
else {
s.length > 0 && (o.push(Vu(wm, e, s)), (s = [])),
(i -= h),
(c -= h);
const p = f.t,
g = n.slice(i - c, i);
o.push(Vu(p, e, g));
}
}
return s.length > 0 && o.push(Vu(wm, e, s)), o;
}
function Vu(t, e, n) {
const r = n[0].s,
i = n[n.length - 1].e,
o = e.slice(r, i);
return new t(o, n);
}
const K4 =
(typeof console != "undefined" && console && console.warn) ||
(() => {}),
q4 =
"until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",
ot = {
scanner: null,
parser: null,
tokenQueue: [],
pluginQueue: [],
customSchemes: [],
initialized: !1,
};
function J4() {
(Yt.groups = {}),
(ot.scanner = null),
(ot.parser = null),
(ot.tokenQueue = []),
(ot.pluginQueue = []),
(ot.customSchemes = []),
(ot.initialized = !1);
}
function xm(t, e) {
if (
(e === void 0 && (e = !1),
ot.initialized &&
K4(
`linkifyjs: already initialized - will not register custom scheme "${t}" ${q4}`
),
!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))
)
throw new Error(`linkifyjs: incorrect scheme format.
1. Must only contain digits, lowercase ASCII letters or "-"
2. Cannot start or end with "-"
3. "-" cannot repeat`);
ot.customSchemes.push([t, e]);
}
function G4() {
ot.scanner = z4(ot.customSchemes);
for (let t = 0; t < ot.tokenQueue.length; t++)
ot.tokenQueue[t][1]({ scanner: ot.scanner });
ot.parser = W4(ot.scanner.tokens);
for (let t = 0; t < ot.pluginQueue.length; t++)
ot.pluginQueue[t][1]({ scanner: ot.scanner, parser: ot.parser });
ot.initialized = !0;
}
function Y4(t) {
return (
ot.initialized || G4(), U4(ot.parser.start, t, H4(ot.scanner.start, t))
);
}
function Tf(t, e, n) {
if (
(e === void 0 && (e = null),
n === void 0 && (n = null),
e && typeof e == "object")
) {
if (n)
throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);
(n = e), (e = null);
}
const r = new Af(n),
i = Y4(t),
o = [];
for (let s = 0; s < i.length; s++) {
const l = i[s];
l.isLink &&
(!e || l.t === e) &&
r.check(l) &&
o.push(l.toFormattedObject(r));
}
return o;
}
function Q4(t) {
return new Tt({
key: new Ot("autolink"),
appendTransaction: (e, n, r) => {
const i = e.some((u) => u.docChanged) && !n.doc.eq(r.doc),
o = e.some((u) => u.getMeta("preventAutolink"));
if (!i || o) return;
const { tr: s } = r,
l = E_(n.doc, [...e]);
if (
(j_(l).forEach(({ newRange: u }) => {
const c = T_(r.doc, u, (p) => p.isTextblock);
let f, h;
if (
(c.length > 1
? ((f = c[0]),
(h = r.doc.textBetween(
f.pos,
f.pos + f.node.nodeSize,
void 0,
" "
)))
: c.length &&
r.doc
.textBetween(u.from, u.to, " ", " ")
.endsWith(" ") &&
((f = c[0]),
(h = r.doc.textBetween(
f.pos,
u.to,
void 0,
" "
))),
f && h)
) {
const p = h.split(" ").filter((b) => b !== "");
if (p.length <= 0) return !1;
const g = p[p.length - 1],
v = f.pos + h.lastIndexOf(g);
if (!g) return !1;
Tf(g)
.filter((b) => b.isLink)
.map((b) =>
be(W({}, b), {
from: v + b.start + 1,
to: v + b.end + 1,
})
)
.filter((b) =>
r.schema.marks.code
? !r.doc.rangeHasMark(
b.from,
b.to,
r.schema.marks.code
)
: !0
)
.filter((b) =>
t.validate ? t.validate(b.value) : !0
)
.forEach((b) => {
vf(b.from, b.to, r.doc).some(
(x) => x.mark.type === t.type
) ||
s.addMark(
b.from,
b.to,
t.type.create({ href: b.href })
);
});
}
}),
!!s.steps.length)
)
return s;
},
});
}
function X4(t) {
return new Tt({
key: new Ot("handleClickLink"),
props: {
handleClick: (e, n, r) => {
var i, o;
if (r.button !== 0 || r.target.nodeName !== "A") return !1;
const l = R_(e.state, t.type.name),
a = r.target,
u =
(i = a == null ? void 0 : a.href) !== null &&
i !== void 0
? i
: l.href,
c =
(o = a == null ? void 0 : a.target) !== null &&
o !== void 0
? o
: l.target;
return a && u ? (e.editable && window.open(u, c), !0) : !1;
},
},
});
}
function Z4(t) {
return new Tt({
key: new Ot("handlePasteLink"),
props: {
handlePaste: (e, n, r) => {
var i;
const { state: o } = e,
{ selection: s } = o,
{ empty: l } = s;
if (l) return !1;
let a = "";
r.content.forEach((g) => {
a += g.textContent;
});
const u = Tf(a).find((g) => g.isLink && g.value === a);
if (!a || !u) return !1;
const c =
(i = n.clipboardData) === null || i === void 0
? void 0
: i.getData("text/html"),
f = /href="([^"]*)"/,
h = c == null ? void 0 : c.match(f),
p = h ? h[1] : u.href;
return t.editor.commands.setMark(t.type, { href: p }), !0;
},
},
});
}
const zR = Cn.create({
name: "link",
priority: 1e3,
keepOnSplit: !1,
onCreate() {
this.options.protocols.forEach((t) => {
if (typeof t == "string") {
xm(t);
return;
}
xm(t.scheme, t.optionalSlashes);
});
},
onDestroy() {
J4();
},
inclusive() {
return this.options.autolink;
},
addOptions() {
return {
openOnClick: !0,
linkOnPaste: !0,
autolink: !0,
protocols: [],
HTMLAttributes: {
target: "_blank",
rel: "noopener noreferrer nofollow",
class: null,
},
validate: void 0,
};
},
addAttributes() {
return {
href: { default: null },
target: { default: this.options.HTMLAttributes.target },
rel: { default: this.options.HTMLAttributes.rel },
class: { default: this.options.HTMLAttributes.class },
};
},
parseHTML() {
return [{ tag: 'a[href]:not([href *= "javascript:" i])' }];
},
renderHTML({ HTMLAttributes: t }) {
return ["a", et(this.options.HTMLAttributes, t), 0];
},
addCommands() {
return {
setLink:
(t) =>
({ chain: e }) =>
e()
.setMark(this.name, t)
.setMeta("preventAutolink", !0)
.run(),
toggleLink:
(t) =>
({ chain: e }) =>
e()
.toggleMark(this.name, t, {
extendEmptyMarkRange: !0,
})
.setMeta("preventAutolink", !0)
.run(),
unsetLink:
() =>
({ chain: t }) =>
t()
.unsetMark(this.name, { extendEmptyMarkRange: !0 })
.setMeta("preventAutolink", !0)
.run(),
};
},
addPasteRules() {
return [
Dr({
find: (t) =>
Tf(t)
.filter((e) =>
this.options.validate
? this.options.validate(e.value)
: !0
)
.filter((e) => e.isLink)
.map((e) => ({
text: e.value,
index: e.start,
data: e,
})),
type: this.type,
getAttributes: (t, e) => {
var n, r;
const i =
(n = e == null ? void 0 : e.clipboardData) ===
null || n === void 0
? void 0
: n.getData("text/html"),
o = /href="([^"]*)"/,
s = i == null ? void 0 : i.match(o);
return s
? { href: s[1] }
: {
href:
(r = t.data) === null || r === void 0
? void 0
: r.href,
};
},
}),
];
},
addProseMirrorPlugins() {
const t = [];
return (
this.options.autolink &&
t.push(
Q4({ type: this.type, validate: this.options.validate })
),
this.options.openOnClick && t.push(X4({ type: this.type })),
this.options.linkOnPaste &&
t.push(Z4({ editor: this.editor, type: this.type })),
t
);
},
}),
eA = (t) => mt({ find: /--$/, replace: t != null ? t : "\u2014" }),
tA = (t) => mt({ find: /\.\.\.$/, replace: t != null ? t : "\u2026" }),
nA = (t) =>
mt({
find: /(?:^|[\s{[(<'"\u2018\u201C])(")$/,
replace: t != null ? t : "\u201C",
}),
rA = (t) => mt({ find: /"$/, replace: t != null ? t : "\u201D" }),
iA = (t) =>
mt({
find: /(?:^|[\s{[(<'"\u2018\u201C])(')$/,
replace: t != null ? t : "\u2018",
}),
oA = (t) => mt({ find: /'$/, replace: t != null ? t : "\u2019" }),
sA = (t) => mt({ find: /<-$/, replace: t != null ? t : "\u2190" }),
lA = (t) => mt({ find: /->$/, replace: t != null ? t : "\u2192" }),
aA = (t) => mt({ find: /\(c\)$/, replace: t != null ? t : "\xA9" }),
uA = (t) => mt({ find: /\(tm\)$/, replace: t != null ? t : "\u2122" }),
cA = (t) => mt({ find: /\(sm\)$/, replace: t != null ? t : "\u2120" }),
dA = (t) => mt({ find: /\(r\)$/, replace: t != null ? t : "\xAE" }),
fA = (t) =>
mt({ find: /(?:^|\s)(1\/2)$/, replace: t != null ? t : "\xBD" }),
hA = (t) => mt({ find: /\+\/-$/, replace: t != null ? t : "\xB1" }),
pA = (t) => mt({ find: /!=$/, replace: t != null ? t : "\u2260" }),
mA = (t) => mt({ find: /<<$/, replace: t != null ? t : "\xAB" }),
gA = (t) => mt({ find: />>$/, replace: t != null ? t : "\xBB" }),
yA = (t) =>
mt({ find: /\d+\s?([*x])\s?\d+$/, replace: t != null ? t : "\xD7" }),
vA = (t) => mt({ find: /\^2$/, replace: t != null ? t : "\xB2" }),
bA = (t) => mt({ find: /\^3$/, replace: t != null ? t : "\xB3" }),
wA = (t) =>
mt({ find: /(?:^|\s)(1\/4)$/, replace: t != null ? t : "\xBC" }),
xA = (t) =>
mt({ find: /(?:^|\s)(3\/4)$/, replace: t != null ? t : "\xBE" }),
HR = Et.create({
name: "typography",
addInputRules() {
const t = [];
return (
this.options.emDash !== !1 && t.push(eA(this.options.emDash)),
this.options.ellipsis !== !1 &&
t.push(tA(this.options.ellipsis)),
this.options.openDoubleQuote !== !1 &&
t.push(nA(this.options.openDoubleQuote)),
this.options.closeDoubleQuote !== !1 &&
t.push(rA(this.options.closeDoubleQuote)),
this.options.openSingleQuote !== !1 &&
t.push(iA(this.options.openSingleQuote)),
this.options.closeSingleQuote !== !1 &&
t.push(oA(this.options.closeSingleQuote)),
this.options.leftArrow !== !1 &&
t.push(sA(this.options.leftArrow)),
this.options.rightArrow !== !1 &&
t.push(lA(this.options.rightArrow)),
this.options.copyright !== !1 &&
t.push(aA(this.options.copyright)),
this.options.trademark !== !1 &&
t.push(uA(this.options.trademark)),
this.options.servicemark !== !1 &&
t.push(cA(this.options.servicemark)),
this.options.registeredTrademark !== !1 &&
t.push(dA(this.options.registeredTrademark)),
this.options.oneHalf !== !1 && t.push(fA(this.options.oneHalf)),
this.options.plusMinus !== !1 &&
t.push(hA(this.options.plusMinus)),
this.options.notEqual !== !1 &&
t.push(pA(this.options.notEqual)),
this.options.laquo !== !1 && t.push(mA(this.options.laquo)),
this.options.raquo !== !1 && t.push(gA(this.options.raquo)),
this.options.multiplication !== !1 &&
t.push(yA(this.options.multiplication)),
this.options.superscriptTwo !== !1 &&
t.push(vA(this.options.superscriptTwo)),
this.options.superscriptThree !== !1 &&
t.push(bA(this.options.superscriptThree)),
this.options.oneQuarter !== !1 &&
t.push(wA(this.options.oneQuarter)),
this.options.threeQuarters !== !1 &&
t.push(xA(this.options.threeQuarters)),
t
);
},
}),
FR = Cn.create({
name: "textStyle",
addOptions() {
return { HTMLAttributes: {} };
},
parseHTML() {
return [
{
tag: "span",
getAttrs: (t) => (t.hasAttribute("style") ? {} : !1),
},
];
},
renderHTML({ HTMLAttributes: t }) {
return ["span", et(this.options.HTMLAttributes, t), 0];
},
addCommands() {
return {
removeEmptyTextStyle:
() =>
({ state: t, commands: e }) => {
const n = ks(t, this.type);
return Object.entries(n).some(([, i]) => !!i)
? !0
: e.unsetMark(this.name);
},
};
},
}),
kA = /(?:^|\s)((?:==)((?:[^~=]+))(?:==))$/,
CA = /(?:^|\s)((?:==)((?:[^~=]+))(?:==))/g,
VR = Cn.create({
name: "highlight",
addOptions() {
return { multicolor: !1, HTMLAttributes: {} };
},
addAttributes() {
return this.options.multicolor
? {
color: {
default: null,
parseHTML: (t) =>
t.getAttribute("data-color") ||
t.style.backgroundColor,
renderHTML: (t) =>
t.color
? {
"data-color": t.color,
style: `background-color: ${t.color}; color: inherit`,
}
: {},
},
}
: {};
},
parseHTML() {
return [{ tag: "mark" }];
},
renderHTML({ HTMLAttributes: t }) {
return ["mark", et(this.options.HTMLAttributes, t), 0];
},
addCommands() {
return {
setHighlight:
(t) =>
({ commands: e }) =>
e.setMark(this.name, t),
toggleHighlight:
(t) =>
({ commands: e }) =>
e.toggleMark(this.name, t),
unsetHighlight:
() =>
({ commands: t }) =>
t.unsetMark(this.name),
};
},
addKeyboardShortcuts() {
return {
"Mod-Shift-h": () => this.editor.commands.toggleHighlight(),
};
},
addInputRules() {
return [bi({ find: kA, type: this.type })];
},
addPasteRules() {
return [Dr({ find: CA, type: this.type })];
},
}),
WR = Et.create({
name: "color",
addOptions() {
return { types: ["textStyle"] };
},
addGlobalAttributes() {
return [
{
types: this.options.types,
attributes: {
color: {
default: null,
parseHTML: (t) => {
var e;
return (e = t.style.color) === null ||
e === void 0
? void 0
: e.replace(/['"]+/g, "");
},
renderHTML: (t) =>
t.color ? { style: `color: ${t.color}` } : {},
},
},
},
];
},
addCommands() {
return {
setColor:
(t) =>
({ chain: e }) =>
e().setMark("textStyle", { color: t }).run(),
unsetColor:
() =>
({ chain: t }) =>
t()
.setMark("textStyle", { color: null })
.removeEmptyTextStyle()
.run(),
};
},
});
function SA(t) {
var e;
const {
char: n,
allowSpaces: r,
allowedPrefixes: i,
startOfLine: o,
$position: s,
} = t,
l = rM(n),
a = new RegExp(`\\s${l}$`),
u = o ? "^" : "",
c = r
? new RegExp(`${u}${l}.*?(?=\\s${l}|$)`, "gm")
: new RegExp(`${u}(?:^)?${l}[^\\s${l}]*`, "gm"),
f =
((e = s.nodeBefore) === null || e === void 0 ? void 0 : e.isText) &&
s.nodeBefore.text;
if (!f) return null;
const h = s.pos - f.length,
p = Array.from(f.matchAll(c)).pop();
if (!p || p.input === void 0 || p.index === void 0) return null;
const g = p.input.slice(Math.max(0, p.index - 1), p.index),
v = new RegExp(`^[${i == null ? void 0 : i.join("")}\0]?$`).test(g);
if (i !== null && !v) return null;
const b = h + p.index;
let x = b + p[0].length;
return (
r && a.test(f.slice(x - 1, x + 1)) && ((p[0] += " "), (x += 1)),
b < s.pos && x >= s.pos
? {
range: { from: b, to: x },
query: p[0].slice(n.length),
text: p[0],
}
: null
);
}
const _A = new Ot("suggestion");
function MA({
pluginKey: t = _A,
editor: e,
char: n = "@",
allowSpaces: r = !1,
allowedPrefixes: i = [" "],
startOfLine: o = !1,
decorationTag: s = "span",
decorationClass: l = "suggestion",
command: a = () => null,
items: u = () => [],
render: c = () => ({}),
allow: f = () => !0,
}) {
let h;
const p = c == null ? void 0 : c(),
g = new Tt({
key: t,
view() {
return {
update: (v, b) =>
cr(this, null, function* () {
var x, S, T, d, y, m, w;
const k =
(x = this.key) === null || x === void 0
? void 0
: x.getState(b),
_ =
(S = this.key) === null || S === void 0
? void 0
: S.getState(v.state),
C =
k.active &&
_.active &&
k.range.from !== _.range.from,
E = !k.active && _.active,
R = k.active && !_.active,
P = !E && !R && k.query !== _.query,
L = E || C,
I = P && !C,
M = R || C;
if (!L && !I && !M) return;
const N = M && !L ? k : _,
D = v.dom.querySelector(
`[data-decoration-id="${N.decorationId}"]`
);
(h = {
editor: e,
range: N.range,
query: N.query,
text: N.text,
items: [],
command: (K) => {
a({ editor: e, range: N.range, props: K });
},
decorationNode: D,
clientRect: D
? () => {
var K;
const { decorationId: ae } =
(K = this.key) === null ||
K === void 0
? void 0
: K.getState(e.state),
Q = v.dom.querySelector(
`[data-decoration-id="${ae}"]`
);
return (
(Q == null
? void 0
: Q.getBoundingClientRect()) ||
null
);
}
: null,
}),
L &&
((T =
p == null
? void 0
: p.onBeforeStart) === null ||
T === void 0 ||
T.call(p, h)),
I &&
((d =
p == null
? void 0
: p.onBeforeUpdate) === null ||
d === void 0 ||
d.call(p, h)),
(I || L) &&
(h.items = yield u({
editor: e,
query: N.query,
})),
M &&
((y = p == null ? void 0 : p.onExit) ===
null ||
y === void 0 ||
y.call(p, h)),
I &&
((m = p == null ? void 0 : p.onUpdate) ===
null ||
m === void 0 ||
m.call(p, h)),
L &&
((w = p == null ? void 0 : p.onStart) ===
null ||
w === void 0 ||
w.call(p, h));
}),
destroy: () => {
var v;
!h ||
(v = p == null ? void 0 : p.onExit) === null ||
v === void 0 ||
v.call(p, h);
},
};
},
state: {
init() {
return {
active: !1,
range: { from: 0, to: 0 },
query: null,
text: null,
composing: !1,
};
},
apply(v, b, x, S) {
const { isEditable: T } = e,
{ composing: d } = e.view,
{ selection: y } = v,
{ empty: m, from: w } = y,
k = W({}, b);
if (((k.composing = d), T && (m || e.view.composing))) {
(w < b.range.from || w > b.range.to) &&
!d &&
!b.composing &&
(k.active = !1);
const _ = SA({
char: n,
allowSpaces: r,
allowedPrefixes: i,
startOfLine: o,
$position: y.$from,
}),
C = `id_${Math.floor(Math.random() * 4294967295)}`;
_ && f({ editor: e, state: S, range: _.range })
? ((k.active = !0),
(k.decorationId = b.decorationId
? b.decorationId
: C),
(k.range = _.range),
(k.query = _.query),
(k.text = _.text))
: (k.active = !1);
} else k.active = !1;
return (
k.active ||
((k.decorationId = null),
(k.range = { from: 0, to: 0 }),
(k.query = null),
(k.text = null)),
k
);
},
},
props: {
handleKeyDown(v, b) {
var x;
const { active: S, range: T } = g.getState(v.state);
return (
(S &&
((x = p == null ? void 0 : p.onKeyDown) === null ||
x === void 0
? void 0
: x.call(p, {
view: v,
event: b,
range: T,
}))) ||
!1
);
},
decorations(v) {
const {
active: b,
range: x,
decorationId: S,
} = g.getState(v);
return b
? st.create(v.doc, [
Xt.inline(x.from, x.to, {
nodeName: s,
class: l,
"data-decoration-id": S,
}),
])
: null;
},
},
});
return g;
}
const EA = new Ot("mention"),
UR = ut.create({
name: "mention",
addOptions() {
return {
HTMLAttributes: {},
renderLabel({ options: t, node: e }) {
var n;
return `${t.suggestion.char}${
(n = e.attrs.label) !== null && n !== void 0
? n
: e.attrs.id
}`;
},
suggestion: {
char: "@",
pluginKey: EA,
command: ({ editor: t, range: e, props: n }) => {
var r, i;
const o = t.view.state.selection.$to.nodeAfter;
((r = o == null ? void 0 : o.text) === null ||
r === void 0
? void 0
: r.startsWith(" ")) && (e.to += 1),
t
.chain()
.focus()
.insertContentAt(e, [
{ type: this.name, attrs: n },
{ type: "text", text: " " },
])
.run(),
(i = window.getSelection()) === null ||
i === void 0 ||
i.collapseToEnd();
},
allow: ({ state: t, range: e }) => {
const n = t.doc.resolve(e.from),
r = t.schema.nodes[this.name];
return !!n.parent.type.contentMatch.matchType(r);
},
},
};
},
group: "inline",
inline: !0,
selectable: !1,
atom: !0,
addAttributes() {
return {
id: {
default: null,
parseHTML: (t) => t.getAttribute("data-id"),
renderHTML: (t) => (t.id ? { "data-id": t.id } : {}),
},
label: {
default: null,
parseHTML: (t) => t.getAttribute("data-label"),
renderHTML: (t) =>
t.label ? { "data-label": t.label } : {},
},
};
},
parseHTML() {
return [{ tag: `span[data-type="${this.name}"]` }];
},
renderHTML({ node: t, HTMLAttributes: e }) {
return [
"span",
et({ "data-type": this.name }, this.options.HTMLAttributes, e),
this.options.renderLabel({ options: this.options, node: t }),
];
},
renderText({ node: t }) {
return this.options.renderLabel({ options: this.options, node: t });
},
addKeyboardShortcuts() {
return {
Backspace: () =>
this.editor.commands.command(({ tr: t, state: e }) => {
let n = !1;
const { selection: r } = e,
{ empty: i, anchor: o } = r;
return i
? (e.doc.nodesBetween(o - 1, o, (s, l) => {
if (s.type.name === this.name)
return (
(n = !0),
t.insertText(
this.options.suggestion.char ||
"",
l,
l + s.nodeSize
),
!1
);
}),
n)
: !1;
}),
};
},
addProseMirrorPlugins() {
return [MA(W({ editor: this.editor }, this.options.suggestion))];
},
});
const AA = {},
TA = {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
width: "24",
height: "24",
},
OA = U("path", { fill: "none", d: "M0 0H24V24H0z" }, null, -1),
RA = U(
"path",
{
d: "M13 20h-2v-7H4v7H2V4h2v7h7V4h2v16zm8-12v12h-2v-9.796l-2 .536V8.67L19.5 8H21z",
fill: "currentColor",
},
null,
-1
),
PA = [OA, RA];
function NA(t, e) {
return B(), G("svg", TA, PA);
}
const jA = Ue(AA, [["render", NA]]),
LA = {},
DA = {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
width: "24",
height: "24",
},
IA = U("path", { fill: "none", d: "M0 0H24V24H0z" }, null, -1),
BA = U(
"path",
{
d: "M4 4v7h7V4h2v16h-2v-7H4v7H2V4h2zm14.5 4c2.071 0 3.75 1.679 3.75 3.75 0 .857-.288 1.648-.772 2.28l-.148.18L18.034 18H22v2h-7v-1.556l4.82-5.546c.268-.307.43-.709.43-1.148 0-.966-.784-1.75-1.75-1.75-.918 0-1.671.707-1.744 1.606l-.006.144h-2C14.75 9.679 16.429 8 18.5 8z",
fill: "currentColor",
},
null,
-1
),
$A = [IA, BA];
function zA(t, e) {
return B(), G("svg", DA, $A);
}
const HA = Ue(LA, [["render", zA]]),
FA = {},
VA = {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
width: "24",
height: "24",
},
WA = U("path", { fill: "none", d: "M0 0H24V24H0z" }, null, -1),
UA = U(
"path",
{
d: "M22 8l-.002 2-2.505 2.883c1.59.435 2.757 1.89 2.757 3.617 0 2.071-1.679 3.75-3.75 3.75-1.826 0-3.347-1.305-3.682-3.033l1.964-.382c.156.806.866 1.415 1.718 1.415.966 0 1.75-.784 1.75-1.75s-.784-1.75-1.75-1.75c-.286 0-.556.069-.794.19l-1.307-1.547L19.35 10H15V8h7zM4 4v7h7V4h2v16h-2v-7H4v7H2V4h2z",
fill: "currentColor",
},
null,
-1
),
KA = [WA, UA];
function qA(t, e) {
return B(), G("svg", VA, KA);
}
const JA = Ue(FA, [["render", qA]]),
GA = {},
YA = {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
width: "24",
height: "24",
},
QA = U("path", { fill: "none", d: "M0 0H24V24H0z" }, null, -1),
XA = U(
"path",
{
d: "M13 20h-2v-7H4v7H2V4h2v7h7V4h2v16zm9-12v8h1.5v2H22v2h-2v-2h-5.5v-1.34l5-8.66H22zm-2 3.133L17.19 16H20v-4.867z",
fill: "currentColor",
},
null,
-1
),
ZA = [QA, XA];
function eT(t, e) {
return B(), G("svg", YA, ZA);
}
const tT = Ue(GA, [["render", eT]]),
nT = {},
rT = {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
width: "24",
height: "24",
},
iT = U("path", { fill: "none", d: "M0 0H24V24H0z" }, null, -1),
oT = U(
"path",
{
d: "M22 8v2h-4.323l-.464 2.636c.33-.089.678-.136 1.037-.136 2.21 0 4 1.79 4 4s-1.79 4-4 4c-1.827 0-3.367-1.224-3.846-2.897l1.923-.551c.24.836 1.01 1.448 1.923 1.448 1.105 0 2-.895 2-2s-.895-2-2-2c-.63 0-1.193.292-1.56.748l-1.81-.904L16 8h6zM4 4v7h7V4h2v16h-2v-7H4v7H2V4h2z",
fill: "currentColor",
},
null,
-1
),
sT = [iT, oT];
function lT(t, e) {
return B(), G("svg", rT, sT);
}
const aT = Ue(nT, [["render", lT]]),
uT = {},
cT = {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
width: "24",
height: "24",
},
dT = U("path", { fill: "none", d: "M0 0H24V24H0z" }, null, -1),
fT = U(
"path",
{
d: "M21.097 8l-2.598 4.5c2.21 0 4.001 1.79 4.001 4s-1.79 4-4 4-4-1.79-4-4c0-.736.199-1.426.546-2.019L18.788 8h2.309zM4 4v7h7V4h2v16h-2v-7H4v7H2V4h2zm14.5 10.5c-1.105 0-2 .895-2 2s.895 2 2 2 2-.895 2-2-.895-2-2-2z",
fill: "currentColor",
},
null,
-1
),
hT = [dT, fT];
function pT(t, e) {
return B(), G("svg", cT, hT);
}
const mT = Ue(uT, [["render", pT]]),
gT = {},
yT = {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
width: "24",
height: "24",
},
vT = U("path", { fill: "none", d: "M0 0h24v24H0z" }, null, -1),
bT = U(
"path",
{ d: "M13 6v15h-2V6H5V4h14v2z", fill: "currentColor" },
null,
-1
),
wT = [vT, bT];
function xT(t, e) {
return B(), G("svg", yT, wT);
}
const kT = Ue(gT, [["render", xT]]),
CT = {},
ST = {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
width: "24",
height: "24",
},
_T = U("path", { fill: "none", d: "M0 0h24v24H0z" }, null, -1),
MT = U(
"path",
{
d: "M8 11h4.5a2.5 2.5 0 1 0 0-5H8v5zm10 4.5a4.5 4.5 0 0 1-4.5 4.5H6V4h6.5a4.5 4.5 0 0 1 3.256 7.606A4.498 4.498 0 0 1 18 15.5zM8 13v5h5.5a2.5 2.5 0 1 0 0-5H8z",
fill: "currentColor",
},
null,
-1
),
ET = [_T, MT];
function AT(t, e) {
return B(), G("svg", ST, ET);
}
const TT = Ue(CT, [["render", AT]]),
OT = {},
RT = {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
width: "24",
height: "24",
},
PT = U("path", { fill: "none", d: "M0 0h24v24H0z" }, null, -1),
NT = U(
"path",
{
d: "M15 20H7v-2h2.927l2.116-12H9V4h8v2h-2.927l-2.116 12H15z",
fill: "currentColor",
},
null,
-1
),
jT = [PT, NT];
function LT(t, e) {
return B(), G("svg", RT, jT);
}
const DT = Ue(OT, [["render", LT]]),
IT = {},
BT = {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
width: "24",
height: "24",
},
$T = U("path", { fill: "none", d: "M0 0h24v24H0z" }, null, -1),
zT = U(
"path",
{
d: "M8 3v9a4 4 0 1 0 8 0V3h2v9a6 6 0 1 1-12 0V3h2zM4 20h16v2H4v-2z",
fill: "currentColor",
},
null,
-1
),
HT = [$T, zT];
function FT(t, e) {
return B(), G("svg", BT, HT);
}
const VT = Ue(IT, [["render", FT]]),
WT = {},
UT = {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
width: "24",
height: "24",
},
KT = U("path", { fill: "none", d: "M0 0h24v24H0z" }, null, -1),
qT = U(
"path",
{
d: "M3 4h18v2H3V4zm2 15h14v2H5v-2zm-2-5h18v2H3v-2zm2-5h14v2H5V9z",
fill: "currentColor",
},
null,
-1
),
JT = [KT, qT];
function GT(t, e) {
return B(), G("svg", UT, JT);
}
const YT = Ue(WT, [["render", GT]]),
QT = {},
XT = {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
width: "24",
height: "24",
},
ZT = U("path", { fill: "none", d: "M0 0h24v24H0z" }, null, -1),
eO = U(
"path",
{
d: "M3 4h18v2H3V4zm0 15h14v2H3v-2zm0-5h18v2H3v-2zm0-5h14v2H3V9z",
fill: "currentColor",
},
null,
-1
),
tO = [ZT, eO];
function nO(t, e) {
return B(), G("svg", XT, tO);
}
const rO = Ue(QT, [["render", nO]]),
iO = {},
oO = {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
width: "24",
height: "24",
},
sO = U("path", { fill: "none", d: "M0 0h24v24H0z" }, null, -1),
lO = U(
"path",
{
d: "M3 4h18v2H3V4zm4 15h14v2H7v-2zm-4-5h18v2H3v-2zm4-5h14v2H7V9z",
fill: "currentColor",
},
null,
-1
),
aO = [sO, lO];
function uO(t, e) {
return B(), G("svg", oO, aO);
}
const cO = Ue(iO, [["render", uO]]),
dO = {},
fO = {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
width: "24",
height: "24",
},
hO = U("path", { fill: "none", d: "M0 0h24v24H0z" }, null, -1),
pO = U(
"path",
{
d: "M15.246 14H8.754l-1.6 4H5l6-15h2l6 15h-2.154l-1.6-4zm-.8-2L12 5.885 9.554 12h4.892zM3 20h18v2H3v-2z",
fill: "currentColor",
},
null,
-1
),
mO = [hO, pO];
function gO(t, e) {
return B(), G("svg", fO, mO);
}
const yO = Ue(dO, [["render", gO]]),
vO = {},
bO = {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
width: "24",
height: "24",
},
wO = U("path", { fill: "none", d: "M0 0h24v24H0z" }, null, -1),
xO = U(
"path",
{
d: "M8 4h13v2H8V4zM5 3v3h1v1H3V6h1V4H3V3h2zM3 14v-2.5h2V11H3v-1h3v2.5H4v.5h2v1H3zm2 5.5H3v-1h2V18H3v-1h3v4H3v-1h2v-.5zM8 11h13v2H8v-2zm0 7h13v2H8v-2z",
fill: "currentColor",
},
null,
-1
),
kO = [wO, xO];
function CO(t, e) {
return B(), G("svg", bO, kO);
}
const SO = Ue(vO, [["render", CO]]),
_O = {},
MO = {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
width: "24",
height: "24",
},
EO = U("path", { fill: "none", d: "M0 0h24v24H0z" }, null, -1),
AO = U(
"path",
{
d: "M8 4h13v2H8V4zM4.5 6.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm0 7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm0 6.9a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zM8 11h13v2H8v-2zm0 7h13v2H8v-2z",
fill: "currentColor",
},
null,
-1
),
TO = [EO, AO];
function OO(t, e) {
return B(), G("svg", MO, TO);
}
const RO = Ue(_O, [["render", OO]]),
PO = {},
NO = {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
width: "24",
height: "24",
},
jO = U("path", { fill: "none", d: "M0 0h24v24H0z" }, null, -1),
LO = U(
"path",
{
d: "M19.417 6.679C20.447 7.773 21 9 21 10.989c0 3.5-2.457 6.637-6.03 8.188l-.893-1.378c3.335-1.804 3.987-4.145 4.247-5.621-.537.278-1.24.375-1.929.311-1.804-.167-3.226-1.648-3.226-3.489a3.5 3.5 0 0 1 3.5-3.5c1.073 0 2.099.49 2.748 1.179zm-10 0C10.447 7.773 11 9 11 10.989c0 3.5-2.457 6.637-6.03 8.188l-.893-1.378c3.335-1.804 3.987-4.145 4.247-5.621-.537.278-1.24.375-1.929.311C4.591 12.322 3.17 10.841 3.17 9a3.5 3.5 0 0 1 3.5-3.5c1.073 0 2.099.49 2.748 1.179z",
fill: "currentColor",
},
null,
-1
),
DO = [jO, LO];
function IO(t, e) {
return B(), G("svg", NO, DO);
}
const BO = Ue(PO, [["render", IO]]),
$O = {},
zO = {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
width: "24",
height: "24",
},
HO = U("path", { fill: "none", d: "M0 0h24v24H0z" }, null, -1),
FO = U(
"path",
{
d: "M16.95 8.464l1.414-1.414 4.95 4.95-4.95 4.95-1.414-1.414L20.485 12 16.95 8.464zm-9.9 0L3.515 12l3.535 3.536-1.414 1.414L.686 12l4.95-4.95L7.05 8.464z",
fill: "currentColor",
},
null,
-1
),
VO = [HO, FO];
function WO(t, e) {
return B(), G("svg", zO, VO);
}
const UO = Ue($O, [["render", WO]]),
KO = {},
qO = {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
width: "24",
height: "24",
},
JO = U("path", { fill: "none", d: "M0 0h24v24H0z" }, null, -1),
GO = U(
"path",
{
d: "M18.364 15.536L16.95 14.12l1.414-1.414a5 5 0 1 0-7.071-7.071L9.879 7.05 8.464 5.636 9.88 4.222a7 7 0 0 1 9.9 9.9l-1.415 1.414zm-2.828 2.828l-1.415 1.414a7 7 0 0 1-9.9-9.9l1.415-1.414L7.05 9.88l-1.414 1.414a5 5 0 1 0 7.071 7.071l1.414-1.414 1.415 1.414zm-.708-10.607l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07z",
fill: "currentColor",
},
null,
-1
),
YO = [JO, GO];
function QO(t, e) {
return B(), G("svg", qO, YO);
}
const XO = Ue(KO, [["render", QO]]),
ZO = {},
e5 = {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
width: "24",
height: "24",
},
t5 = U("path", { fill: "none", d: "M0 0h24v24H0z" }, null, -1),
n5 = U(
"path",
{
d: "M21 15v3h3v2h-3v3h-2v-3h-3v-2h3v-3h2zm.008-12c.548 0 .992.445.992.993V13h-2V5H4v13.999L14 9l3 3v2.829l-3-3L6.827 19H14v2H2.992A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016zM8 7a2 2 0 1 1 0 4 2 2 0 0 1 0-4z",
fill: "currentColor",
},
null,
-1
),
r5 = [t5, n5];
function i5(t, e) {
return B(), G("svg", e5, r5);
}
const o5 = Ue(ZO, [["render", i5]]),
s5 = {},
l5 = {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
width: "24",
height: "24",
},
a5 = U("path", { fill: "none", d: "M0 0H24V24H0z" }, null, -1),
u5 = U(
"path",
{
d: "M16 4c.552 0 1 .448 1 1v4.2l5.213-3.65c.226-.158.538-.103.697.124.058.084.09.184.09.286v12.08c0 .276-.224.5-.5.5-.103 0-.203-.032-.287-.09L17 14.8V19c0 .552-.448 1-1 1H2c-.552 0-1-.448-1-1V5c0-.552.448-1 1-1h14zm-1 2H3v12h12V6zM8 8h2v3h3v2H9.999L10 16H8l-.001-3H5v-2h3V8zm13 .841l-4 2.8v.718l4 2.8V8.84z",
fill: "currentColor",
},
null,
-1
),
c5 = [a5, u5];
function d5(t, e) {
return B(), G("svg", l5, c5);
}
const f5 = Ue(s5, [["render", d5]]),
h5 = {},
p5 = {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
width: "24",
height: "24",
},
m5 = U("path", { fill: "none", d: "M0 0h24v24H0z" }, null, -1),
g5 = U(
"path",
{
d: "M5.828 7l2.536 2.536L6.95 10.95 2 6l4.95-4.95 1.414 1.414L5.828 5H13a8 8 0 1 1 0 16H4v-2h9a6 6 0 1 0 0-12H5.828z",
fill: "currentColor",
},
null,
-1
),
y5 = [m5, g5];
function v5(t, e) {
return B(), G("svg", p5, y5);
}
const b5 = Ue(h5, [["render", v5]]),
w5 = {},
x5 = {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
width: "24",
height: "24",
},
k5 = U("path", { fill: "none", d: "M0 0h24v24H0z" }, null, -1),
C5 = U(
"path",
{
d: "M18.172 7H11a6 6 0 1 0 0 12h9v2h-9a8 8 0 1 1 0-16h7.172l-2.536-2.536L17.05 1.05 22 6l-4.95 4.95-1.414-1.414L18.172 7z",
fill: "currentColor",
},
null,
-1
),
S5 = [k5, C5];
function _5(t, e) {
return B(), G("svg", x5, S5);
}
const M5 = Ue(w5, [["render", _5]]),
E5 = {},
A5 = {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
width: "24",
height: "24",
},
T5 = U("path", { fill: "none", d: "M0 0h24v24H0z" }, null, -1),
O5 = U(
"path",
{
d: "M2 11h2v2H2v-2zm4 0h12v2H6v-2zm14 0h2v2h-2v-2z",
fill: "currentColor",
},
null,
-1
),
R5 = [T5, O5];
function P5(t, e) {
return B(), G("svg", A5, R5);
}
const N5 = Ue(E5, [["render", P5]]),
j5 = {},
L5 = {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
width: "24",
height: "24",
},
D5 = U("path", { fill: "none", d: "M0 0h24v24H0z" }, null, -1),
I5 = U(
"path",
{
d: "M13 10v4h6v-4h-6zm-2 0H5v4h6v-4zm2 9h6v-3h-6v3zm-2 0v-3H5v3h6zm2-14v3h6V5h-6zm-2 0H5v3h6V5zM4 3h16a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z",
fill: "currentColor",
},
null,
-1
),
B5 = [D5, I5];
function $5(t, e) {
return B(), G("svg", L5, B5);
}
const z5 = Ue(j5, [["render", $5]]),
KR = {
Paragraph: {
label: "Paragraph",
icon: kT,
action: (t) => t.chain().focus().setParagraph().run(),
isActive: (t) => t.isActive("paragraph"),
},
"Heading 1": {
label: "Heading 1",
text: "H1",
icon: jA,
action: (t) => t.chain().focus().toggleHeading({ level: 1 }).run(),
isActive: (t) => t.isActive("heading", { level: 1 }),
},
"Heading 2": {
label: "Heading 2",
text: "H2",
icon: HA,
action: (t) => t.chain().focus().toggleHeading({ level: 2 }).run(),
isActive: (t) => t.isActive("heading", { level: 2 }),
},
"Heading 3": {
label: "Heading 3",
text: "H3",
icon: JA,
action: (t) => t.chain().focus().toggleHeading({ level: 3 }).run(),
isActive: (t) => t.isActive("heading", { level: 3 }),
},
"Heading 4": {
label: "Heading 4",
text: "H4",
icon: tT,
action: (t) => t.chain().focus().toggleHeading({ level: 4 }).run(),
isActive: (t) => t.isActive("heading", { level: 4 }),
},
"Heading 5": {
label: "Heading 5",
text: "H5",
icon: aT,
action: (t) => t.chain().focus().toggleHeading({ level: 5 }).run(),
isActive: (t) => t.isActive("heading", { level: 5 }),
},
"Heading 6": {
label: "Heading 6",
text: "H6",
icon: mT,
action: (t) => t.chain().focus().toggleHeading({ level: 6 }).run(),
isActive: (t) => t.isActive("heading", { level: 6 }),
},
Bold: {
label: "Bold",
icon: TT,
action: (t) => t.chain().focus().toggleBold().run(),
isActive: (t) => t.isActive("bold"),
},
Italic: {
label: "Italic",
icon: DT,
action: (t) => t.chain().focus().toggleItalic().run(),
isActive: (t) => t.isActive("italic"),
},
Underline: {
label: "Underline",
icon: VT,
action: (t) => t.chain().focus().toggleUnderline().run(),
isActive: (t) => t.isActive("underline"),
},
"Bullet List": {
label: "Bullet List",
icon: RO,
action: (t) => t.chain().focus().toggleBulletList().run(),
isActive: (t) => t.isActive("bulletList"),
},
"Numbered List": {
label: "Numbered List",
icon: SO,
action: (t) => t.chain().focus().toggleOrderedList().run(),
isActive: (t) => t.isActive("orderedList"),
},
"Align Center": {
label: "Align Center",
icon: YT,
action: (t) => t.chain().focus().setTextAlign("center").run(),
isActive: (t) => t.isActive({ textAlign: "center" }),
},
"Align Left": {
label: "Align Left",
icon: rO,
action: (t) => t.chain().focus().setTextAlign("left").run(),
isActive: (t) => t.isActive({ textAlign: "left" }),
},
"Align Right": {
label: "Align Right",
icon: cO,
action: (t) => t.chain().focus().setTextAlign("right").run(),
isActive: (t) => t.isActive({ textAlign: "right" }),
},
FontColor: {
label: "Font Color",
icon: yO,
isActive: (t) => t.isActive("textStyle") || t.isActive("highlight"),
component: js(() =>
Ds(() => import("./FontColor.41d2871a.js"), [])
),
},
Blockquote: {
label: "Blockquote",
icon: BO,
action: (t) => t.chain().focus().toggleBlockquote().run(),
isActive: (t) => t.isActive("blockquote"),
},
Code: {
label: "Code",
icon: UO,
action: (t) => t.chain().focus().toggleCodeBlock().run(),
isActive: (t) => t.isActive("codeBlock"),
},
"Horizontal Rule": {
label: "Horizontal Rule",
icon: N5,
action: (t) => t.chain().focus().setHorizontalRule().run(),
isActive: (t) => !1,
},
Link: {
label: "Link",
icon: XO,
isActive: (t) => t.isActive("link"),
component: js(() =>
Ds(() => import("./InsertLink.20429a64.js"), [])
),
},
Image: {
label: "Image",
icon: o5,
isActive: (t) => !1,
component: js(() =>
Ds(() => import("./InsertImage.3828880c.js"), [])
),
},
Video: {
label: "Video",
icon: f5,
isActive: (t) => !1,
component: js(() =>
Ds(() => import("./InsertVideo.d725d1a5.js"), [])
),
},
Undo: {
label: "Undo",
icon: b5,
action: (t) => t.chain().focus().undo().run(),
isActive: (t) => !1,
},
Redo: {
label: "Redo",
icon: M5,
action: (t) => t.chain().focus().redo().run(),
isActive: (t) => !1,
},
InsertTable: {
label: "Insert Table",
icon: z5,
action: (t) =>
t
.chain()
.focus()
.insertTable({ rows: 3, cols: 3, withHeaderRow: !0 })
.run(),
isActive: (t) => !1,
},
AddColumnBefore: {
label: "Add Column Before",
action: (t) => t.chain().focus().addColumnBefore().run(),
isActive: (t) => !1,
isDisabled: (t) => !t.can().addColumnBefore(),
},
AddColumnAfter: {
label: "Add Column After",
action: (t) => t.chain().focus().addColumnAfter().run(),
isActive: (t) => !1,
isDisabled: (t) => !t.can().addColumnAfter(),
},
DeleteColumn: {
label: "Delete Column",
action: (t) => t.chain().focus().deleteColumn().run(),
isActive: (t) => !1,
isDisabled: (t) => !t.can().deleteColumn(),
},
AddRowBefore: {
label: "Add Row Before",
action: (t) => t.chain().focus().addRowBefore().run(),
isActive: (t) => !1,
isDisabled: (t) => !t.can().addRowBefore(),
},
AddRowAfter: {
label: "Add Row After",
action: (t) => t.chain().focus().addRowAfter().run(),
isActive: (t) => !1,
isDisabled: (t) => !t.can().addRowAfter(),
},
DeleteRow: {
label: "Delete Row",
action: (t) => t.chain().focus().deleteRow().run(),
isActive: (t) => !1,
isDisabled: (t) => !t.can().deleteRow(),
},
DeleteTable: {
label: "Delete Table",
action: (t) => t.chain().focus().deleteTable().run(),
isActive: (t) => !1,
isDisabled: (t) => !t.can().deleteTable(),
},
MergeCells: {
label: "Merge Cells",
action: (t) => t.chain().focus().mergeCells().run(),
isActive: (t) => !1,
isDisabled: (t) => !t.can().mergeCells(),
},
SplitCell: {
label: "Split Cell",
action: (t) => t.chain().focus().splitCell().run(),
isActive: (t) => !1,
isDisabled: (t) => !t.can().splitCell(),
},
ToggleHeaderColumn: {
label: "Toggle Header Column",
action: (t) => t.chain().focus().toggleHeaderColumn().run(),
isActive: (t) => !1,
isDisabled: (t) => !t.can().toggleHeaderColumn(),
},
ToggleHeaderRow: {
label: "Toggle Header Row",
action: (t) => t.chain().focus().toggleHeaderRow().run(),
isActive: (t) => !1,
isDisabled: (t) => !t.can().toggleHeaderRow(),
},
ToggleHeaderCell: {
label: "Toggle Header Cell",
action: (t) => t.chain().focus().toggleHeaderCell().run(),
isActive: (t) => !1,
isDisabled: (t) => !t.can().toggleHeaderCell(),
},
Separator: { type: "separator" },
};
var by = { exports: {} };
(function (t) {
(function () {
function e(d) {
var y = {
omitExtraWLInCodeBlocks: {
defaultValue: !1,
describe:
"Omit the default extra whiteline added to code blocks",
type: "boolean",
},
noHeaderId: {
defaultValue: !1,
describe: "Turn on/off generated header id",
type: "boolean",
},
prefixHeaderId: {
defaultValue: !1,
describe:
"Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",
type: "string",
},
rawPrefixHeaderId: {
defaultValue: !1,
describe:
'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',
type: "boolean",
},
ghCompatibleHeaderId: {
defaultValue: !1,
describe:
"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",
type: "boolean",
},
rawHeaderId: {
defaultValue: !1,
describe: `Remove only spaces, ' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids`,
type: "boolean",
},
headerLevelStart: {
defaultValue: !1,
describe: "The header blocks level start",
type: "integer",
},
parseImgDimensions: {
defaultValue: !1,
describe: "Turn on/off image dimension parsing",
type: "boolean",
},
simplifiedAutoLink: {
defaultValue: !1,
describe: "Turn on/off GFM autolink style",
type: "boolean",
},
excludeTrailingPunctuationFromURLs: {
defaultValue: !1,
describe:
"Excludes trailing punctuation from links generated with autoLinking",
type: "boolean",
},
literalMidWordUnderscores: {
defaultValue: !1,
describe:
"Parse midword underscores as literal underscores",
type: "boolean",
},
literalMidWordAsterisks: {
defaultValue: !1,
describe: "Parse midword asterisks as literal asterisks",
type: "boolean",
},
strikethrough: {
defaultValue: !1,
describe: "Turn on/off strikethrough support",
type: "boolean",
},
tables: {
defaultValue: !1,
describe: "Turn on/off tables support",
type: "boolean",
},
tablesHeaderId: {
defaultValue: !1,
describe: "Add an id to table headers",
type: "boolean",
},
ghCodeBlocks: {
defaultValue: !0,
describe: "Turn on/off GFM fenced code blocks support",
type: "boolean",
},
tasklists: {
defaultValue: !1,
describe: "Turn on/off GFM tasklist support",
type: "boolean",
},
smoothLivePreview: {
defaultValue: !1,
describe:
"Prevents weird effects in live previews due to incomplete input",
type: "boolean",
},
smartIndentationFix: {
defaultValue: !1,
describe: "Tries to smartly fix indentation in es6 strings",
type: "boolean",
},
disableForced4SpacesIndentedSublists: {
defaultValue: !1,
describe:
"Disables the requirement of indenting nested sublists by 4 spaces",
type: "boolean",
},
simpleLineBreaks: {
defaultValue: !1,
describe: "Parses simple line breaks as <br> (GFM Style)",
type: "boolean",
},
requireSpaceBeforeHeadingText: {
defaultValue: !1,
describe:
"Makes adding a space between `#` and the header text mandatory (GFM Style)",
type: "boolean",
},
ghMentions: {
defaultValue: !1,
describe: "Enables github @mentions",
type: "boolean",
},
ghMentionsLink: {
defaultValue: "https://github.com/{u}",
describe:
"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",
type: "string",
},
encodeEmails: {
defaultValue: !0,
describe:
"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",
type: "boolean",
},
openLinksInNewWindow: {
defaultValue: !1,
describe: "Open all links in new windows",
type: "boolean",
},
backslashEscapesHTMLTags: {
defaultValue: !1,
describe:
"Support for HTML Tag escaping. ex: <div>foo</div>",
type: "boolean",
},
emoji: {
defaultValue: !1,
describe:
"Enable emoji support. Ex: `this is a :smile: emoji`",
type: "boolean",
},
underline: {
defaultValue: !1,
describe:
"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`",
type: "boolean",
},
ellipsis: {
defaultValue: !0,
describe:
"Replaces three dots with the ellipsis unicode character",
type: "boolean",
},
completeHTMLDocument: {
defaultValue: !1,
describe:
"Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags",
type: "boolean",
},
metadata: {
defaultValue: !1,
describe:
"Enable support for document metadata (defined at the top of the document between `\xAB\xAB\xAB` and `\xBB\xBB\xBB` or between `---` and `---`).",
type: "boolean",
},
splitAdjacentBlockquotes: {
defaultValue: !1,
describe: "Split adjacent blockquote blocks",
type: "boolean",
},
};
if (d === !1) return JSON.parse(JSON.stringify(y));
var m = {};
for (var w in y) y.hasOwnProperty(w) && (m[w] = y[w].defaultValue);
return m;
}
function n() {
var d = e(!0),
y = {};
for (var m in d) d.hasOwnProperty(m) && (y[m] = !0);
return y;
}
var r = {},
i = {},
o = {},
s = e(!0),
l = "vanilla",
a = {
github: {
omitExtraWLInCodeBlocks: !0,
simplifiedAutoLink: !0,
excludeTrailingPunctuationFromURLs: !0,
literalMidWordUnderscores: !0,
strikethrough: !0,
tables: !0,
tablesHeaderId: !0,
ghCodeBlocks: !0,
tasklists: !0,
disableForced4SpacesIndentedSublists: !0,
simpleLineBreaks: !0,
requireSpaceBeforeHeadingText: !0,
ghCompatibleHeaderId: !0,
ghMentions: !0,
backslashEscapesHTMLTags: !0,
emoji: !0,
splitAdjacentBlockquotes: !0,
},
original: { noHeaderId: !0, ghCodeBlocks: !1 },
ghost: {
omitExtraWLInCodeBlocks: !0,
parseImgDimensions: !0,
simplifiedAutoLink: !0,
excludeTrailingPunctuationFromURLs: !0,
literalMidWordUnderscores: !0,
strikethrough: !0,
tables: !0,
tablesHeaderId: !0,
ghCodeBlocks: !0,
tasklists: !0,
smoothLivePreview: !0,
simpleLineBreaks: !0,
requireSpaceBeforeHeadingText: !0,
ghMentions: !1,
encodeEmails: !0,
},
vanilla: e(!0),
allOn: n(),
};
(r.helper = {}),
(r.extensions = {}),
(r.setOption = function (d, y) {
return (s[d] = y), this;
}),
(r.getOption = function (d) {
return s[d];
}),
(r.getOptions = function () {
return s;
}),
(r.resetOptions = function () {
s = e(!0);
}),
(r.setFlavor = function (d) {
if (!a.hasOwnProperty(d))
throw Error(d + " flavor was not found");
r.resetOptions();
var y = a[d];
l = d;
for (var m in y) y.hasOwnProperty(m) && (s[m] = y[m]);
}),
(r.getFlavor = function () {
return l;
}),
(r.getFlavorOptions = function (d) {
if (a.hasOwnProperty(d)) return a[d];
}),
(r.getDefaultOptions = function (d) {
return e(d);
}),
(r.subParser = function (d, y) {
if (r.helper.isString(d))
if (typeof y != "undefined") i[d] = y;
else {
if (i.hasOwnProperty(d)) return i[d];
throw Error(
"SubParser named " + d + " not registered!"
);
}
}),
(r.extension = function (d, y) {
if (!r.helper.isString(d))
throw Error("Extension 'name' must be a string");
if (((d = r.helper.stdExtName(d)), r.helper.isUndefined(y))) {
if (!o.hasOwnProperty(d))
throw Error(
"Extension named " + d + " is not registered!"
);
return o[d];
} else {
typeof y == "function" && (y = y()),
r.helper.isArray(y) || (y = [y]);
var m = u(y, d);
if (m.valid) o[d] = y;
else throw Error(m.error);
}
}),
(r.getAllExtensions = function () {
return o;
}),
(r.removeExtension = function (d) {
delete o[d];
}),
(r.resetExtensions = function () {
o = {};
});
function u(d, y) {
var m = y
? "Error in " + y + " extension->"
: "Error in unnamed extension",
w = { valid: !0, error: "" };
r.helper.isArray(d) || (d = [d]);
for (var k = 0; k < d.length; ++k) {
var _ = m + " sub-extension " + k + ": ",
C = d[k];
if (typeof C != "object")
return (
(w.valid = !1),
(w.error =
_ +
"must be an object, but " +
typeof C +
" given"),
w
);
if (!r.helper.isString(C.type))
return (
(w.valid = !1),
(w.error =
_ +
'property "type" must be a string, but ' +
typeof C.type +
" given"),
w
);
var E = (C.type = C.type.toLowerCase());
if (
(E === "language" && (E = C.type = "lang"),
E === "html" && (E = C.type = "output"),
E !== "lang" && E !== "output" && E !== "listener")
)
return (
(w.valid = !1),
(w.error =
_ +
"type " +
E +
' is not recognized. Valid values: "lang/language", "output/html" or "listener"'),
w
);
if (E === "listener") {
if (r.helper.isUndefined(C.listeners))
return (
(w.valid = !1),
(w.error =
_ +
'. Extensions of type "listener" must have a property called "listeners"'),
w
);
} else if (
r.helper.isUndefined(C.filter) &&
r.helper.isUndefined(C.regex)
)
return (
(w.valid = !1),
(w.error =
_ +
E +
' extensions must define either a "regex" property or a "filter" method'),
w
);
if (C.listeners) {
if (typeof C.listeners != "object")
return (
(w.valid = !1),
(w.error =
_ +
'"listeners" property must be an object but ' +
typeof C.listeners +
" given"),
w
);
for (var R in C.listeners)
if (
C.listeners.hasOwnProperty(R) &&
typeof C.listeners[R] != "function"
)
return (
(w.valid = !1),
(w.error =
_ +
'"listeners" property must be an hash of [event name]: [callback]. listeners.' +
R +
" must be a function but " +
typeof C.listeners[R] +
" given"),
w
);
}
if (C.filter) {
if (typeof C.filter != "function")
return (
(w.valid = !1),
(w.error =
_ +
'"filter" must be a function, but ' +
typeof C.filter +
" given"),
w
);
} else if (C.regex) {
if (
(r.helper.isString(C.regex) &&
(C.regex = new RegExp(C.regex, "g")),
!(C.regex instanceof RegExp))
)
return (
(w.valid = !1),
(w.error =
_ +
'"regex" property must either be a string or a RegExp object, but ' +
typeof C.regex +
" given"),
w
);
if (r.helper.isUndefined(C.replace))
return (
(w.valid = !1),
(w.error =
_ +
'"regex" extensions must implement a replace string or function'),
w
);
}
}
return w;
}
(r.validateExtension = function (d) {
var y = u(d, null);
return y.valid ? !0 : (console.warn(y.error), !1);
}),
r.hasOwnProperty("helper") || (r.helper = {}),
(r.helper.isString = function (d) {
return typeof d == "string" || d instanceof String;
}),
(r.helper.isFunction = function (d) {
var y = {};
return d && y.toString.call(d) === "[object Function]";
}),
(r.helper.isArray = function (d) {
return Array.isArray(d);
}),
(r.helper.isUndefined = function (d) {
return typeof d == "undefined";
}),
(r.helper.forEach = function (d, y) {
if (r.helper.isUndefined(d))
throw new Error("obj param is required");
if (r.helper.isUndefined(y))
throw new Error("callback param is required");
if (!r.helper.isFunction(y))
throw new Error(
"callback param must be a function/closure"
);
if (typeof d.forEach == "function") d.forEach(y);
else if (r.helper.isArray(d))
for (var m = 0; m < d.length; m++) y(d[m], m, d);
else if (typeof d == "object")
for (var w in d) d.hasOwnProperty(w) && y(d[w], w, d);
else
throw new Error(
"obj does not seem to be an array or an iterable object"
);
}),
(r.helper.stdExtName = function (d) {
return d
.replace(/[_?*+\/\\.^-]/g, "")
.replace(/\s/g, "")
.toLowerCase();
});
function c(d, y) {
var m = y.charCodeAt(0);
return "\xA8E" + m + "E";
}
(r.helper.escapeCharactersCallback = c),
(r.helper.escapeCharacters = function (d, y, m) {
var w = "([" + y.replace(/([\[\]\\])/g, "\\$1") + "])";
m && (w = "\\\\" + w);
var k = new RegExp(w, "g");
return (d = d.replace(k, c)), d;
}),
(r.helper.unescapeHTMLEntities = function (d) {
return d
.replace(/&quot;/g, '"')
.replace(/&lt;/g, "<")
.replace(/&gt;/g, ">")
.replace(/&amp;/g, "&");
});
var f = function (d, y, m, w) {
var k = w || "",
_ = k.indexOf("g") > -1,
C = new RegExp(y + "|" + m, "g" + k.replace(/g/g, "")),
E = new RegExp(y, k.replace(/g/g, "")),
R = [],
P,
L,
I,
M,
N;
do
for (P = 0; (I = C.exec(d)); )
if (E.test(I[0]))
P++ || ((L = C.lastIndex), (M = L - I[0].length));
else if (P && !--P) {
N = I.index + I[0].length;
var D = {
left: { start: M, end: L },
match: { start: L, end: I.index },
right: { start: I.index, end: N },
wholeMatch: { start: M, end: N },
};
if ((R.push(D), !_)) return R;
}
while (P && (C.lastIndex = L));
return R;
};
(r.helper.matchRecursiveRegExp = function (d, y, m, w) {
for (var k = f(d, y, m, w), _ = [], C = 0; C < k.length; ++C)
_.push([
d.slice(k[C].wholeMatch.start, k[C].wholeMatch.end),
d.slice(k[C].match.start, k[C].match.end),
d.slice(k[C].left.start, k[C].left.end),
d.slice(k[C].right.start, k[C].right.end),
]);
return _;
}),
(r.helper.replaceRecursiveRegExp = function (d, y, m, w, k) {
if (!r.helper.isFunction(y)) {
var _ = y;
y = function () {
return _;
};
}
var C = f(d, m, w, k),
E = d,
R = C.length;
if (R > 0) {
var P = [];
C[0].wholeMatch.start !== 0 &&
P.push(d.slice(0, C[0].wholeMatch.start));
for (var L = 0; L < R; ++L)
P.push(
y(
d.slice(
C[L].wholeMatch.start,
C[L].wholeMatch.end
),
d.slice(C[L].match.start, C[L].match.end),
d.slice(C[L].left.start, C[L].left.end),
d.slice(C[L].right.start, C[L].right.end)
)
),
L < R - 1 &&
P.push(
d.slice(
C[L].wholeMatch.end,
C[L + 1].wholeMatch.start
)
);
C[R - 1].wholeMatch.end < d.length &&
P.push(d.slice(C[R - 1].wholeMatch.end)),
(E = P.join(""));
}
return E;
}),
(r.helper.regexIndexOf = function (d, y, m) {
if (!r.helper.isString(d))
throw "InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";
if (!(y instanceof RegExp))
throw "InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp";
var w = d.substring(m || 0).search(y);
return w >= 0 ? w + (m || 0) : w;
}),
(r.helper.splitAtIndex = function (d, y) {
if (!r.helper.isString(d))
throw "InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";
return [d.substring(0, y), d.substring(y)];
}),
(r.helper.encodeEmailAddress = function (d) {
var y = [
function (m) {
return "&#" + m.charCodeAt(0) + ";";
},
function (m) {
return "&#x" + m.charCodeAt(0).toString(16) + ";";
},
function (m) {
return m;
},
];
return (
(d = d.replace(/./g, function (m) {
if (m === "@") m = y[Math.floor(Math.random() * 2)](m);
else {
var w = Math.random();
m =
w > 0.9
? y[2](m)
: w > 0.45
? y[1](m)
: y[0](m);
}
return m;
})),
d
);
}),
(r.helper.padEnd = function (y, m, w) {
return (
(m = m >> 0),
(w = String(w || " ")),
y.length > m
? String(y)
: ((m = m - y.length),
m > w.length && (w += w.repeat(m / w.length)),
String(y) + w.slice(0, m))
);
}),
typeof console == "undefined" &&
(console = {
warn: function (d) {
alert(d);
},
log: function (d) {
alert(d);
},
error: function (d) {
throw d;
},
}),
(r.helper.regexes = { asteriskDashAndColon: /([*_:~])/g }),
(r.helper.emojis = {
"+1": "\u{1F44D}",
"-1": "\u{1F44E}",
100: "\u{1F4AF}",
1234: "\u{1F522}",
"1st_place_medal": "\u{1F947}",
"2nd_place_medal": "\u{1F948}",
"3rd_place_medal": "\u{1F949}",
"8ball": "\u{1F3B1}",
a: "\u{1F170}\uFE0F",
ab: "\u{1F18E}",
abc: "\u{1F524}",
abcd: "\u{1F521}",
accept: "\u{1F251}",
aerial_tramway: "\u{1F6A1}",
airplane: "\u2708\uFE0F",
alarm_clock: "\u23F0",
alembic: "\u2697\uFE0F",
alien: "\u{1F47D}",
ambulance: "\u{1F691}",
amphora: "\u{1F3FA}",
anchor: "\u2693\uFE0F",
angel: "\u{1F47C}",
anger: "\u{1F4A2}",
angry: "\u{1F620}",
anguished: "\u{1F627}",
ant: "\u{1F41C}",
apple: "\u{1F34E}",
aquarius: "\u2652\uFE0F",
aries: "\u2648\uFE0F",
arrow_backward: "\u25C0\uFE0F",
arrow_double_down: "\u23EC",
arrow_double_up: "\u23EB",
arrow_down: "\u2B07\uFE0F",
arrow_down_small: "\u{1F53D}",
arrow_forward: "\u25B6\uFE0F",
arrow_heading_down: "\u2935\uFE0F",
arrow_heading_up: "\u2934\uFE0F",
arrow_left: "\u2B05\uFE0F",
arrow_lower_left: "\u2199\uFE0F",
arrow_lower_right: "\u2198\uFE0F",
arrow_right: "\u27A1\uFE0F",
arrow_right_hook: "\u21AA\uFE0F",
arrow_up: "\u2B06\uFE0F",
arrow_up_down: "\u2195\uFE0F",
arrow_up_small: "\u{1F53C}",
arrow_upper_left: "\u2196\uFE0F",
arrow_upper_right: "\u2197\uFE0F",
arrows_clockwise: "\u{1F503}",
arrows_counterclockwise: "\u{1F504}",
art: "\u{1F3A8}",
articulated_lorry: "\u{1F69B}",
artificial_satellite: "\u{1F6F0}",
astonished: "\u{1F632}",
athletic_shoe: "\u{1F45F}",
atm: "\u{1F3E7}",
atom_symbol: "\u269B\uFE0F",
avocado: "\u{1F951}",
b: "\u{1F171}\uFE0F",
baby: "\u{1F476}",
baby_bottle: "\u{1F37C}",
baby_chick: "\u{1F424}",
baby_symbol: "\u{1F6BC}",
back: "\u{1F519}",
bacon: "\u{1F953}",
badminton: "\u{1F3F8}",
baggage_claim: "\u{1F6C4}",
baguette_bread: "\u{1F956}",
balance_scale: "\u2696\uFE0F",
balloon: "\u{1F388}",
ballot_box: "\u{1F5F3}",
ballot_box_with_check: "\u2611\uFE0F",
bamboo: "\u{1F38D}",
banana: "\u{1F34C}",
bangbang: "\u203C\uFE0F",
bank: "\u{1F3E6}",
bar_chart: "\u{1F4CA}",
barber: "\u{1F488}",
baseball: "\u26BE\uFE0F",
basketball: "\u{1F3C0}",
basketball_man: "\u26F9\uFE0F",
basketball_woman: "\u26F9\uFE0F&zwj;\u2640\uFE0F",
bat: "\u{1F987}",
bath: "\u{1F6C0}",
bathtub: "\u{1F6C1}",
battery: "\u{1F50B}",
beach_umbrella: "\u{1F3D6}",
bear: "\u{1F43B}",
bed: "\u{1F6CF}",
bee: "\u{1F41D}",
beer: "\u{1F37A}",
beers: "\u{1F37B}",
beetle: "\u{1F41E}",
beginner: "\u{1F530}",
bell: "\u{1F514}",
bellhop_bell: "\u{1F6CE}",
bento: "\u{1F371}",
biking_man: "\u{1F6B4}",
bike: "\u{1F6B2}",
biking_woman: "\u{1F6B4}&zwj;\u2640\uFE0F",
bikini: "\u{1F459}",
biohazard: "\u2623\uFE0F",
bird: "\u{1F426}",
birthday: "\u{1F382}",
black_circle: "\u26AB\uFE0F",
black_flag: "\u{1F3F4}",
black_heart: "\u{1F5A4}",
black_joker: "\u{1F0CF}",
black_large_square: "\u2B1B\uFE0F",
black_medium_small_square: "\u25FE\uFE0F",
black_medium_square: "\u25FC\uFE0F",
black_nib: "\u2712\uFE0F",
black_small_square: "\u25AA\uFE0F",
black_square_button: "\u{1F532}",
blonde_man: "\u{1F471}",
blonde_woman: "\u{1F471}&zwj;\u2640\uFE0F",
blossom: "\u{1F33C}",
blowfish: "\u{1F421}",
blue_book: "\u{1F4D8}",
blue_car: "\u{1F699}",
blue_heart: "\u{1F499}",
blush: "\u{1F60A}",
boar: "\u{1F417}",
boat: "\u26F5\uFE0F",
bomb: "\u{1F4A3}",
book: "\u{1F4D6}",
bookmark: "\u{1F516}",
bookmark_tabs: "\u{1F4D1}",
books: "\u{1F4DA}",
boom: "\u{1F4A5}",
boot: "\u{1F462}",
bouquet: "\u{1F490}",
bowing_man: "\u{1F647}",
bow_and_arrow: "\u{1F3F9}",
bowing_woman: "\u{1F647}&zwj;\u2640\uFE0F",
bowling: "\u{1F3B3}",
boxing_glove: "\u{1F94A}",
boy: "\u{1F466}",
bread: "\u{1F35E}",
bride_with_veil: "\u{1F470}",
bridge_at_night: "\u{1F309}",
briefcase: "\u{1F4BC}",
broken_heart: "\u{1F494}",
bug: "\u{1F41B}",
building_construction: "\u{1F3D7}",
bulb: "\u{1F4A1}",
bullettrain_front: "\u{1F685}",
bullettrain_side: "\u{1F684}",
burrito: "\u{1F32F}",
bus: "\u{1F68C}",
business_suit_levitating: "\u{1F574}",
busstop: "\u{1F68F}",
bust_in_silhouette: "\u{1F464}",
busts_in_silhouette: "\u{1F465}",
butterfly: "\u{1F98B}",
cactus: "\u{1F335}",
cake: "\u{1F370}",
calendar: "\u{1F4C6}",
call_me_hand: "\u{1F919}",
calling: "\u{1F4F2}",
camel: "\u{1F42B}",
camera: "\u{1F4F7}",
camera_flash: "\u{1F4F8}",
camping: "\u{1F3D5}",
cancer: "\u264B\uFE0F",
candle: "\u{1F56F}",
candy: "\u{1F36C}",
canoe: "\u{1F6F6}",
capital_abcd: "\u{1F520}",
capricorn: "\u2651\uFE0F",
car: "\u{1F697}",
card_file_box: "\u{1F5C3}",
card_index: "\u{1F4C7}",
card_index_dividers: "\u{1F5C2}",
carousel_horse: "\u{1F3A0}",
carrot: "\u{1F955}",
cat: "\u{1F431}",
cat2: "\u{1F408}",
cd: "\u{1F4BF}",
chains: "\u26D3",
champagne: "\u{1F37E}",
chart: "\u{1F4B9}",
chart_with_downwards_trend: "\u{1F4C9}",
chart_with_upwards_trend: "\u{1F4C8}",
checkered_flag: "\u{1F3C1}",
cheese: "\u{1F9C0}",
cherries: "\u{1F352}",
cherry_blossom: "\u{1F338}",
chestnut: "\u{1F330}",
chicken: "\u{1F414}",
children_crossing: "\u{1F6B8}",
chipmunk: "\u{1F43F}",
chocolate_bar: "\u{1F36B}",
christmas_tree: "\u{1F384}",
church: "\u26EA\uFE0F",
cinema: "\u{1F3A6}",
circus_tent: "\u{1F3AA}",
city_sunrise: "\u{1F307}",
city_sunset: "\u{1F306}",
cityscape: "\u{1F3D9}",
cl: "\u{1F191}",
clamp: "\u{1F5DC}",
clap: "\u{1F44F}",
clapper: "\u{1F3AC}",
classical_building: "\u{1F3DB}",
clinking_glasses: "\u{1F942}",
clipboard: "\u{1F4CB}",
clock1: "\u{1F550}",
clock10: "\u{1F559}",
clock1030: "\u{1F565}",
clock11: "\u{1F55A}",
clock1130: "\u{1F566}",
clock12: "\u{1F55B}",
clock1230: "\u{1F567}",
clock130: "\u{1F55C}",
clock2: "\u{1F551}",
clock230: "\u{1F55D}",
clock3: "\u{1F552}",
clock330: "\u{1F55E}",
clock4: "\u{1F553}",
clock430: "\u{1F55F}",
clock5: "\u{1F554}",
clock530: "\u{1F560}",
clock6: "\u{1F555}",
clock630: "\u{1F561}",
clock7: "\u{1F556}",
clock730: "\u{1F562}",
clock8: "\u{1F557}",
clock830: "\u{1F563}",
clock9: "\u{1F558}",
clock930: "\u{1F564}",
closed_book: "\u{1F4D5}",
closed_lock_with_key: "\u{1F510}",
closed_umbrella: "\u{1F302}",
cloud: "\u2601\uFE0F",
cloud_with_lightning: "\u{1F329}",
cloud_with_lightning_and_rain: "\u26C8",
cloud_with_rain: "\u{1F327}",
cloud_with_snow: "\u{1F328}",
clown_face: "\u{1F921}",
clubs: "\u2663\uFE0F",
cocktail: "\u{1F378}",
coffee: "\u2615\uFE0F",
coffin: "\u26B0\uFE0F",
cold_sweat: "\u{1F630}",
comet: "\u2604\uFE0F",
computer: "\u{1F4BB}",
computer_mouse: "\u{1F5B1}",
confetti_ball: "\u{1F38A}",
confounded: "\u{1F616}",
confused: "\u{1F615}",
congratulations: "\u3297\uFE0F",
construction: "\u{1F6A7}",
construction_worker_man: "\u{1F477}",
construction_worker_woman: "\u{1F477}&zwj;\u2640\uFE0F",
control_knobs: "\u{1F39B}",
convenience_store: "\u{1F3EA}",
cookie: "\u{1F36A}",
cool: "\u{1F192}",
policeman: "\u{1F46E}",
copyright: "\xA9\uFE0F",
corn: "\u{1F33D}",
couch_and_lamp: "\u{1F6CB}",
couple: "\u{1F46B}",
couple_with_heart_woman_man: "\u{1F491}",
couple_with_heart_man_man:
"\u{1F468}&zwj;\u2764\uFE0F&zwj;\u{1F468}",
couple_with_heart_woman_woman:
"\u{1F469}&zwj;\u2764\uFE0F&zwj;\u{1F469}",
couplekiss_man_man:
"\u{1F468}&zwj;\u2764\uFE0F&zwj;\u{1F48B}&zwj;\u{1F468}",
couplekiss_man_woman: "\u{1F48F}",
couplekiss_woman_woman:
"\u{1F469}&zwj;\u2764\uFE0F&zwj;\u{1F48B}&zwj;\u{1F469}",
cow: "\u{1F42E}",
cow2: "\u{1F404}",
cowboy_hat_face: "\u{1F920}",
crab: "\u{1F980}",
crayon: "\u{1F58D}",
credit_card: "\u{1F4B3}",
crescent_moon: "\u{1F319}",
cricket: "\u{1F3CF}",
crocodile: "\u{1F40A}",
croissant: "\u{1F950}",
crossed_fingers: "\u{1F91E}",
crossed_flags: "\u{1F38C}",
crossed_swords: "\u2694\uFE0F",
crown: "\u{1F451}",
cry: "\u{1F622}",
crying_cat_face: "\u{1F63F}",
crystal_ball: "\u{1F52E}",
cucumber: "\u{1F952}",
cupid: "\u{1F498}",
curly_loop: "\u27B0",
currency_exchange: "\u{1F4B1}",
curry: "\u{1F35B}",
custard: "\u{1F36E}",
customs: "\u{1F6C3}",
cyclone: "\u{1F300}",
dagger: "\u{1F5E1}",
dancer: "\u{1F483}",
dancing_women: "\u{1F46F}",
dancing_men: "\u{1F46F}&zwj;\u2642\uFE0F",
dango: "\u{1F361}",
dark_sunglasses: "\u{1F576}",
dart: "\u{1F3AF}",
dash: "\u{1F4A8}",
date: "\u{1F4C5}",
deciduous_tree: "\u{1F333}",
deer: "\u{1F98C}",
department_store: "\u{1F3EC}",
derelict_house: "\u{1F3DA}",
desert: "\u{1F3DC}",
desert_island: "\u{1F3DD}",
desktop_computer: "\u{1F5A5}",
male_detective: "\u{1F575}\uFE0F",
diamond_shape_with_a_dot_inside: "\u{1F4A0}",
diamonds: "\u2666\uFE0F",
disappointed: "\u{1F61E}",
disappointed_relieved: "\u{1F625}",
dizzy: "\u{1F4AB}",
dizzy_face: "\u{1F635}",
do_not_litter: "\u{1F6AF}",
dog: "\u{1F436}",
dog2: "\u{1F415}",
dollar: "\u{1F4B5}",
dolls: "\u{1F38E}",
dolphin: "\u{1F42C}",
door: "\u{1F6AA}",
doughnut: "\u{1F369}",
dove: "\u{1F54A}",
dragon: "\u{1F409}",
dragon_face: "\u{1F432}",
dress: "\u{1F457}",
dromedary_camel: "\u{1F42A}",
drooling_face: "\u{1F924}",
droplet: "\u{1F4A7}",
drum: "\u{1F941}",
duck: "\u{1F986}",
dvd: "\u{1F4C0}",
"e-mail": "\u{1F4E7}",
eagle: "\u{1F985}",
ear: "\u{1F442}",
ear_of_rice: "\u{1F33E}",
earth_africa: "\u{1F30D}",
earth_americas: "\u{1F30E}",
earth_asia: "\u{1F30F}",
egg: "\u{1F95A}",
eggplant: "\u{1F346}",
eight_pointed_black_star: "\u2734\uFE0F",
eight_spoked_asterisk: "\u2733\uFE0F",
electric_plug: "\u{1F50C}",
elephant: "\u{1F418}",
email: "\u2709\uFE0F",
end: "\u{1F51A}",
envelope_with_arrow: "\u{1F4E9}",
euro: "\u{1F4B6}",
european_castle: "\u{1F3F0}",
european_post_office: "\u{1F3E4}",
evergreen_tree: "\u{1F332}",
exclamation: "\u2757\uFE0F",
expressionless: "\u{1F611}",
eye: "\u{1F441}",
eye_speech_bubble: "\u{1F441}&zwj;\u{1F5E8}",
eyeglasses: "\u{1F453}",
eyes: "\u{1F440}",
face_with_head_bandage: "\u{1F915}",
face_with_thermometer: "\u{1F912}",
fist_oncoming: "\u{1F44A}",
factory: "\u{1F3ED}",
fallen_leaf: "\u{1F342}",
family_man_woman_boy: "\u{1F46A}",
family_man_boy: "\u{1F468}&zwj;\u{1F466}",
family_man_boy_boy: "\u{1F468}&zwj;\u{1F466}&zwj;\u{1F466}",
family_man_girl: "\u{1F468}&zwj;\u{1F467}",
family_man_girl_boy: "\u{1F468}&zwj;\u{1F467}&zwj;\u{1F466}",
family_man_girl_girl: "\u{1F468}&zwj;\u{1F467}&zwj;\u{1F467}",
family_man_man_boy: "\u{1F468}&zwj;\u{1F468}&zwj;\u{1F466}",
family_man_man_boy_boy:
"\u{1F468}&zwj;\u{1F468}&zwj;\u{1F466}&zwj;\u{1F466}",
family_man_man_girl: "\u{1F468}&zwj;\u{1F468}&zwj;\u{1F467}",
family_man_man_girl_boy:
"\u{1F468}&zwj;\u{1F468}&zwj;\u{1F467}&zwj;\u{1F466}",
family_man_man_girl_girl:
"\u{1F468}&zwj;\u{1F468}&zwj;\u{1F467}&zwj;\u{1F467}",
family_man_woman_boy_boy:
"\u{1F468}&zwj;\u{1F469}&zwj;\u{1F466}&zwj;\u{1F466}",
family_man_woman_girl: "\u{1F468}&zwj;\u{1F469}&zwj;\u{1F467}",
family_man_woman_girl_boy:
"\u{1F468}&zwj;\u{1F469}&zwj;\u{1F467}&zwj;\u{1F466}",
family_man_woman_girl_girl:
"\u{1F468}&zwj;\u{1F469}&zwj;\u{1F467}&zwj;\u{1F467}",
family_woman_boy: "\u{1F469}&zwj;\u{1F466}",
family_woman_boy_boy: "\u{1F469}&zwj;\u{1F466}&zwj;\u{1F466}",
family_woman_girl: "\u{1F469}&zwj;\u{1F467}",
family_woman_girl_boy: "\u{1F469}&zwj;\u{1F467}&zwj;\u{1F466}",
family_woman_girl_girl: "\u{1F469}&zwj;\u{1F467}&zwj;\u{1F467}",
family_woman_woman_boy: "\u{1F469}&zwj;\u{1F469}&zwj;\u{1F466}",
family_woman_woman_boy_boy:
"\u{1F469}&zwj;\u{1F469}&zwj;\u{1F466}&zwj;\u{1F466}",
family_woman_woman_girl:
"\u{1F469}&zwj;\u{1F469}&zwj;\u{1F467}",
family_woman_woman_girl_boy:
"\u{1F469}&zwj;\u{1F469}&zwj;\u{1F467}&zwj;\u{1F466}",
family_woman_woman_girl_girl:
"\u{1F469}&zwj;\u{1F469}&zwj;\u{1F467}&zwj;\u{1F467}",
fast_forward: "\u23E9",
fax: "\u{1F4E0}",
fearful: "\u{1F628}",
feet: "\u{1F43E}",
female_detective: "\u{1F575}\uFE0F&zwj;\u2640\uFE0F",
ferris_wheel: "\u{1F3A1}",
ferry: "\u26F4",
field_hockey: "\u{1F3D1}",
file_cabinet: "\u{1F5C4}",
file_folder: "\u{1F4C1}",
film_projector: "\u{1F4FD}",
film_strip: "\u{1F39E}",
fire: "\u{1F525}",
fire_engine: "\u{1F692}",
fireworks: "\u{1F386}",
first_quarter_moon: "\u{1F313}",
first_quarter_moon_with_face: "\u{1F31B}",
fish: "\u{1F41F}",
fish_cake: "\u{1F365}",
fishing_pole_and_fish: "\u{1F3A3}",
fist_raised: "\u270A",
fist_left: "\u{1F91B}",
fist_right: "\u{1F91C}",
flags: "\u{1F38F}",
flashlight: "\u{1F526}",
fleur_de_lis: "\u269C\uFE0F",
flight_arrival: "\u{1F6EC}",
flight_departure: "\u{1F6EB}",
floppy_disk: "\u{1F4BE}",
flower_playing_cards: "\u{1F3B4}",
flushed: "\u{1F633}",
fog: "\u{1F32B}",
foggy: "\u{1F301}",
football: "\u{1F3C8}",
footprints: "\u{1F463}",
fork_and_knife: "\u{1F374}",
fountain: "\u26F2\uFE0F",
fountain_pen: "\u{1F58B}",
four_leaf_clover: "\u{1F340}",
fox_face: "\u{1F98A}",
framed_picture: "\u{1F5BC}",
free: "\u{1F193}",
fried_egg: "\u{1F373}",
fried_shrimp: "\u{1F364}",
fries: "\u{1F35F}",
frog: "\u{1F438}",
frowning: "\u{1F626}",
frowning_face: "\u2639\uFE0F",
frowning_man: "\u{1F64D}&zwj;\u2642\uFE0F",
frowning_woman: "\u{1F64D}",
middle_finger: "\u{1F595}",
fuelpump: "\u26FD\uFE0F",
full_moon: "\u{1F315}",
full_moon_with_face: "\u{1F31D}",
funeral_urn: "\u26B1\uFE0F",
game_die: "\u{1F3B2}",
gear: "\u2699\uFE0F",
gem: "\u{1F48E}",
gemini: "\u264A\uFE0F",
ghost: "\u{1F47B}",
gift: "\u{1F381}",
gift_heart: "\u{1F49D}",
girl: "\u{1F467}",
globe_with_meridians: "\u{1F310}",
goal_net: "\u{1F945}",
goat: "\u{1F410}",
golf: "\u26F3\uFE0F",
golfing_man: "\u{1F3CC}\uFE0F",
golfing_woman: "\u{1F3CC}\uFE0F&zwj;\u2640\uFE0F",
gorilla: "\u{1F98D}",
grapes: "\u{1F347}",
green_apple: "\u{1F34F}",
green_book: "\u{1F4D7}",
green_heart: "\u{1F49A}",
green_salad: "\u{1F957}",
grey_exclamation: "\u2755",
grey_question: "\u2754",
grimacing: "\u{1F62C}",
grin: "\u{1F601}",
grinning: "\u{1F600}",
guardsman: "\u{1F482}",
guardswoman: "\u{1F482}&zwj;\u2640\uFE0F",
guitar: "\u{1F3B8}",
gun: "\u{1F52B}",
haircut_woman: "\u{1F487}",
haircut_man: "\u{1F487}&zwj;\u2642\uFE0F",
hamburger: "\u{1F354}",
hammer: "\u{1F528}",
hammer_and_pick: "\u2692",
hammer_and_wrench: "\u{1F6E0}",
hamster: "\u{1F439}",
hand: "\u270B",
handbag: "\u{1F45C}",
handshake: "\u{1F91D}",
hankey: "\u{1F4A9}",
hatched_chick: "\u{1F425}",
hatching_chick: "\u{1F423}",
headphones: "\u{1F3A7}",
hear_no_evil: "\u{1F649}",
heart: "\u2764\uFE0F",
heart_decoration: "\u{1F49F}",
heart_eyes: "\u{1F60D}",
heart_eyes_cat: "\u{1F63B}",
heartbeat: "\u{1F493}",
heartpulse: "\u{1F497}",
hearts: "\u2665\uFE0F",
heavy_check_mark: "\u2714\uFE0F",
heavy_division_sign: "\u2797",
heavy_dollar_sign: "\u{1F4B2}",
heavy_heart_exclamation: "\u2763\uFE0F",
heavy_minus_sign: "\u2796",
heavy_multiplication_x: "\u2716\uFE0F",
heavy_plus_sign: "\u2795",
helicopter: "\u{1F681}",
herb: "\u{1F33F}",
hibiscus: "\u{1F33A}",
high_brightness: "\u{1F506}",
high_heel: "\u{1F460}",
hocho: "\u{1F52A}",
hole: "\u{1F573}",
honey_pot: "\u{1F36F}",
horse: "\u{1F434}",
horse_racing: "\u{1F3C7}",
hospital: "\u{1F3E5}",
hot_pepper: "\u{1F336}",
hotdog: "\u{1F32D}",
hotel: "\u{1F3E8}",
hotsprings: "\u2668\uFE0F",
hourglass: "\u231B\uFE0F",
hourglass_flowing_sand: "\u23F3",
house: "\u{1F3E0}",
house_with_garden: "\u{1F3E1}",
houses: "\u{1F3D8}",
hugs: "\u{1F917}",
hushed: "\u{1F62F}",
ice_cream: "\u{1F368}",
ice_hockey: "\u{1F3D2}",
ice_skate: "\u26F8",
icecream: "\u{1F366}",
id: "\u{1F194}",
ideograph_advantage: "\u{1F250}",
imp: "\u{1F47F}",
inbox_tray: "\u{1F4E5}",
incoming_envelope: "\u{1F4E8}",
tipping_hand_woman: "\u{1F481}",
information_source: "\u2139\uFE0F",
innocent: "\u{1F607}",
interrobang: "\u2049\uFE0F",
iphone: "\u{1F4F1}",
izakaya_lantern: "\u{1F3EE}",
jack_o_lantern: "\u{1F383}",
japan: "\u{1F5FE}",
japanese_castle: "\u{1F3EF}",
japanese_goblin: "\u{1F47A}",
japanese_ogre: "\u{1F479}",
jeans: "\u{1F456}",
joy: "\u{1F602}",
joy_cat: "\u{1F639}",
joystick: "\u{1F579}",
kaaba: "\u{1F54B}",
key: "\u{1F511}",
keyboard: "\u2328\uFE0F",
keycap_ten: "\u{1F51F}",
kick_scooter: "\u{1F6F4}",
kimono: "\u{1F458}",
kiss: "\u{1F48B}",
kissing: "\u{1F617}",
kissing_cat: "\u{1F63D}",
kissing_closed_eyes: "\u{1F61A}",
kissing_heart: "\u{1F618}",
kissing_smiling_eyes: "\u{1F619}",
kiwi_fruit: "\u{1F95D}",
koala: "\u{1F428}",
koko: "\u{1F201}",
label: "\u{1F3F7}",
large_blue_circle: "\u{1F535}",
large_blue_diamond: "\u{1F537}",
large_orange_diamond: "\u{1F536}",
last_quarter_moon: "\u{1F317}",
last_quarter_moon_with_face: "\u{1F31C}",
latin_cross: "\u271D\uFE0F",
laughing: "\u{1F606}",
leaves: "\u{1F343}",
ledger: "\u{1F4D2}",
left_luggage: "\u{1F6C5}",
left_right_arrow: "\u2194\uFE0F",
leftwards_arrow_with_hook: "\u21A9\uFE0F",
lemon: "\u{1F34B}",
leo: "\u264C\uFE0F",
leopard: "\u{1F406}",
level_slider: "\u{1F39A}",
libra: "\u264E\uFE0F",
light_rail: "\u{1F688}",
link: "\u{1F517}",
lion: "\u{1F981}",
lips: "\u{1F444}",
lipstick: "\u{1F484}",
lizard: "\u{1F98E}",
lock: "\u{1F512}",
lock_with_ink_pen: "\u{1F50F}",
lollipop: "\u{1F36D}",
loop: "\u27BF",
loud_sound: "\u{1F50A}",
loudspeaker: "\u{1F4E2}",
love_hotel: "\u{1F3E9}",
love_letter: "\u{1F48C}",
low_brightness: "\u{1F505}",
lying_face: "\u{1F925}",
m: "\u24C2\uFE0F",
mag: "\u{1F50D}",
mag_right: "\u{1F50E}",
mahjong: "\u{1F004}\uFE0F",
mailbox: "\u{1F4EB}",
mailbox_closed: "\u{1F4EA}",
mailbox_with_mail: "\u{1F4EC}",
mailbox_with_no_mail: "\u{1F4ED}",
man: "\u{1F468}",
man_artist: "\u{1F468}&zwj;\u{1F3A8}",
man_astronaut: "\u{1F468}&zwj;\u{1F680}",
man_cartwheeling: "\u{1F938}&zwj;\u2642\uFE0F",
man_cook: "\u{1F468}&zwj;\u{1F373}",
man_dancing: "\u{1F57A}",
man_facepalming: "\u{1F926}&zwj;\u2642\uFE0F",
man_factory_worker: "\u{1F468}&zwj;\u{1F3ED}",
man_farmer: "\u{1F468}&zwj;\u{1F33E}",
man_firefighter: "\u{1F468}&zwj;\u{1F692}",
man_health_worker: "\u{1F468}&zwj;\u2695\uFE0F",
man_in_tuxedo: "\u{1F935}",
man_judge: "\u{1F468}&zwj;\u2696\uFE0F",
man_juggling: "\u{1F939}&zwj;\u2642\uFE0F",
man_mechanic: "\u{1F468}&zwj;\u{1F527}",
man_office_worker: "\u{1F468}&zwj;\u{1F4BC}",
man_pilot: "\u{1F468}&zwj;\u2708\uFE0F",
man_playing_handball: "\u{1F93E}&zwj;\u2642\uFE0F",
man_playing_water_polo: "\u{1F93D}&zwj;\u2642\uFE0F",
man_scientist: "\u{1F468}&zwj;\u{1F52C}",
man_shrugging: "\u{1F937}&zwj;\u2642\uFE0F",
man_singer: "\u{1F468}&zwj;\u{1F3A4}",
man_student: "\u{1F468}&zwj;\u{1F393}",
man_teacher: "\u{1F468}&zwj;\u{1F3EB}",
man_technologist: "\u{1F468}&zwj;\u{1F4BB}",
man_with_gua_pi_mao: "\u{1F472}",
man_with_turban: "\u{1F473}",
tangerine: "\u{1F34A}",
mans_shoe: "\u{1F45E}",
mantelpiece_clock: "\u{1F570}",
maple_leaf: "\u{1F341}",
martial_arts_uniform: "\u{1F94B}",
mask: "\u{1F637}",
massage_woman: "\u{1F486}",
massage_man: "\u{1F486}&zwj;\u2642\uFE0F",
meat_on_bone: "\u{1F356}",
medal_military: "\u{1F396}",
medal_sports: "\u{1F3C5}",
mega: "\u{1F4E3}",
melon: "\u{1F348}",
memo: "\u{1F4DD}",
men_wrestling: "\u{1F93C}&zwj;\u2642\uFE0F",
menorah: "\u{1F54E}",
mens: "\u{1F6B9}",
metal: "\u{1F918}",
metro: "\u{1F687}",
microphone: "\u{1F3A4}",
microscope: "\u{1F52C}",
milk_glass: "\u{1F95B}",
milky_way: "\u{1F30C}",
minibus: "\u{1F690}",
minidisc: "\u{1F4BD}",
mobile_phone_off: "\u{1F4F4}",
money_mouth_face: "\u{1F911}",
money_with_wings: "\u{1F4B8}",
moneybag: "\u{1F4B0}",
monkey: "\u{1F412}",
monkey_face: "\u{1F435}",
monorail: "\u{1F69D}",
moon: "\u{1F314}",
mortar_board: "\u{1F393}",
mosque: "\u{1F54C}",
motor_boat: "\u{1F6E5}",
motor_scooter: "\u{1F6F5}",
motorcycle: "\u{1F3CD}",
motorway: "\u{1F6E3}",
mount_fuji: "\u{1F5FB}",
mountain: "\u26F0",
mountain_biking_man: "\u{1F6B5}",
mountain_biking_woman: "\u{1F6B5}&zwj;\u2640\uFE0F",
mountain_cableway: "\u{1F6A0}",
mountain_railway: "\u{1F69E}",
mountain_snow: "\u{1F3D4}",
mouse: "\u{1F42D}",
mouse2: "\u{1F401}",
movie_camera: "\u{1F3A5}",
moyai: "\u{1F5FF}",
mrs_claus: "\u{1F936}",
muscle: "\u{1F4AA}",
mushroom: "\u{1F344}",
musical_keyboard: "\u{1F3B9}",
musical_note: "\u{1F3B5}",
musical_score: "\u{1F3BC}",
mute: "\u{1F507}",
nail_care: "\u{1F485}",
name_badge: "\u{1F4DB}",
national_park: "\u{1F3DE}",
nauseated_face: "\u{1F922}",
necktie: "\u{1F454}",
negative_squared_cross_mark: "\u274E",
nerd_face: "\u{1F913}",
neutral_face: "\u{1F610}",
new: "\u{1F195}",
new_moon: "\u{1F311}",
new_moon_with_face: "\u{1F31A}",
newspaper: "\u{1F4F0}",
newspaper_roll: "\u{1F5DE}",
next_track_button: "\u23ED",
ng: "\u{1F196}",
no_good_man: "\u{1F645}&zwj;\u2642\uFE0F",
no_good_woman: "\u{1F645}",
night_with_stars: "\u{1F303}",
no_bell: "\u{1F515}",
no_bicycles: "\u{1F6B3}",
no_entry: "\u26D4\uFE0F",
no_entry_sign: "\u{1F6AB}",
no_mobile_phones: "\u{1F4F5}",
no_mouth: "\u{1F636}",
no_pedestrians: "\u{1F6B7}",
no_smoking: "\u{1F6AD}",
"non-potable_water": "\u{1F6B1}",
nose: "\u{1F443}",
notebook: "\u{1F4D3}",
notebook_with_decorative_cover: "\u{1F4D4}",
notes: "\u{1F3B6}",
nut_and_bolt: "\u{1F529}",
o: "\u2B55\uFE0F",
o2: "\u{1F17E}\uFE0F",
ocean: "\u{1F30A}",
octopus: "\u{1F419}",
oden: "\u{1F362}",
office: "\u{1F3E2}",
oil_drum: "\u{1F6E2}",
ok: "\u{1F197}",
ok_hand: "\u{1F44C}",
ok_man: "\u{1F646}&zwj;\u2642\uFE0F",
ok_woman: "\u{1F646}",
old_key: "\u{1F5DD}",
older_man: "\u{1F474}",
older_woman: "\u{1F475}",
om: "\u{1F549}",
on: "\u{1F51B}",
oncoming_automobile: "\u{1F698}",
oncoming_bus: "\u{1F68D}",
oncoming_police_car: "\u{1F694}",
oncoming_taxi: "\u{1F696}",
open_file_folder: "\u{1F4C2}",
open_hands: "\u{1F450}",
open_mouth: "\u{1F62E}",
open_umbrella: "\u2602\uFE0F",
ophiuchus: "\u26CE",
orange_book: "\u{1F4D9}",
orthodox_cross: "\u2626\uFE0F",
outbox_tray: "\u{1F4E4}",
owl: "\u{1F989}",
ox: "\u{1F402}",
package: "\u{1F4E6}",
page_facing_up: "\u{1F4C4}",
page_with_curl: "\u{1F4C3}",
pager: "\u{1F4DF}",
paintbrush: "\u{1F58C}",
palm_tree: "\u{1F334}",
pancakes: "\u{1F95E}",
panda_face: "\u{1F43C}",
paperclip: "\u{1F4CE}",
paperclips: "\u{1F587}",
parasol_on_ground: "\u26F1",
parking: "\u{1F17F}\uFE0F",
part_alternation_mark: "\u303D\uFE0F",
partly_sunny: "\u26C5\uFE0F",
passenger_ship: "\u{1F6F3}",
passport_control: "\u{1F6C2}",
pause_button: "\u23F8",
peace_symbol: "\u262E\uFE0F",
peach: "\u{1F351}",
peanuts: "\u{1F95C}",
pear: "\u{1F350}",
pen: "\u{1F58A}",
pencil2: "\u270F\uFE0F",
penguin: "\u{1F427}",
pensive: "\u{1F614}",
performing_arts: "\u{1F3AD}",
persevere: "\u{1F623}",
person_fencing: "\u{1F93A}",
pouting_woman: "\u{1F64E}",
phone: "\u260E\uFE0F",
pick: "\u26CF",
pig: "\u{1F437}",
pig2: "\u{1F416}",
pig_nose: "\u{1F43D}",
pill: "\u{1F48A}",
pineapple: "\u{1F34D}",
ping_pong: "\u{1F3D3}",
pisces: "\u2653\uFE0F",
pizza: "\u{1F355}",
place_of_worship: "\u{1F6D0}",
plate_with_cutlery: "\u{1F37D}",
play_or_pause_button: "\u23EF",
point_down: "\u{1F447}",
point_left: "\u{1F448}",
point_right: "\u{1F449}",
point_up: "\u261D\uFE0F",
point_up_2: "\u{1F446}",
police_car: "\u{1F693}",
policewoman: "\u{1F46E}&zwj;\u2640\uFE0F",
poodle: "\u{1F429}",
popcorn: "\u{1F37F}",
post_office: "\u{1F3E3}",
postal_horn: "\u{1F4EF}",
postbox: "\u{1F4EE}",
potable_water: "\u{1F6B0}",
potato: "\u{1F954}",
pouch: "\u{1F45D}",
poultry_leg: "\u{1F357}",
pound: "\u{1F4B7}",
rage: "\u{1F621}",
pouting_cat: "\u{1F63E}",
pouting_man: "\u{1F64E}&zwj;\u2642\uFE0F",
pray: "\u{1F64F}",
prayer_beads: "\u{1F4FF}",
pregnant_woman: "\u{1F930}",
previous_track_button: "\u23EE",
prince: "\u{1F934}",
princess: "\u{1F478}",
printer: "\u{1F5A8}",
purple_heart: "\u{1F49C}",
purse: "\u{1F45B}",
pushpin: "\u{1F4CC}",
put_litter_in_its_place: "\u{1F6AE}",
question: "\u2753",
rabbit: "\u{1F430}",
rabbit2: "\u{1F407}",
racehorse: "\u{1F40E}",
racing_car: "\u{1F3CE}",
radio: "\u{1F4FB}",
radio_button: "\u{1F518}",
radioactive: "\u2622\uFE0F",
railway_car: "\u{1F683}",
railway_track: "\u{1F6E4}",
rainbow: "\u{1F308}",
rainbow_flag: "\u{1F3F3}\uFE0F&zwj;\u{1F308}",
raised_back_of_hand: "\u{1F91A}",
raised_hand_with_fingers_splayed: "\u{1F590}",
raised_hands: "\u{1F64C}",
raising_hand_woman: "\u{1F64B}",
raising_hand_man: "\u{1F64B}&zwj;\u2642\uFE0F",
ram: "\u{1F40F}",
ramen: "\u{1F35C}",
rat: "\u{1F400}",
record_button: "\u23FA",
recycle: "\u267B\uFE0F",
red_circle: "\u{1F534}",
registered: "\xAE\uFE0F",
relaxed: "\u263A\uFE0F",
relieved: "\u{1F60C}",
reminder_ribbon: "\u{1F397}",
repeat: "\u{1F501}",
repeat_one: "\u{1F502}",
rescue_worker_helmet: "\u26D1",
restroom: "\u{1F6BB}",
revolving_hearts: "\u{1F49E}",
rewind: "\u23EA",
rhinoceros: "\u{1F98F}",
ribbon: "\u{1F380}",
rice: "\u{1F35A}",
rice_ball: "\u{1F359}",
rice_cracker: "\u{1F358}",
rice_scene: "\u{1F391}",
right_anger_bubble: "\u{1F5EF}",
ring: "\u{1F48D}",
robot: "\u{1F916}",
rocket: "\u{1F680}",
rofl: "\u{1F923}",
roll_eyes: "\u{1F644}",
roller_coaster: "\u{1F3A2}",
rooster: "\u{1F413}",
rose: "\u{1F339}",
rosette: "\u{1F3F5}",
rotating_light: "\u{1F6A8}",
round_pushpin: "\u{1F4CD}",
rowing_man: "\u{1F6A3}",
rowing_woman: "\u{1F6A3}&zwj;\u2640\uFE0F",
rugby_football: "\u{1F3C9}",
running_man: "\u{1F3C3}",
running_shirt_with_sash: "\u{1F3BD}",
running_woman: "\u{1F3C3}&zwj;\u2640\uFE0F",
sa: "\u{1F202}\uFE0F",
sagittarius: "\u2650\uFE0F",
sake: "\u{1F376}",
sandal: "\u{1F461}",
santa: "\u{1F385}",
satellite: "\u{1F4E1}",
saxophone: "\u{1F3B7}",
school: "\u{1F3EB}",
school_satchel: "\u{1F392}",
scissors: "\u2702\uFE0F",
scorpion: "\u{1F982}",
scorpius: "\u264F\uFE0F",
scream: "\u{1F631}",
scream_cat: "\u{1F640}",
scroll: "\u{1F4DC}",
seat: "\u{1F4BA}",
secret: "\u3299\uFE0F",
see_no_evil: "\u{1F648}",
seedling: "\u{1F331}",
selfie: "\u{1F933}",
shallow_pan_of_food: "\u{1F958}",
shamrock: "\u2618\uFE0F",
shark: "\u{1F988}",
shaved_ice: "\u{1F367}",
sheep: "\u{1F411}",
shell: "\u{1F41A}",
shield: "\u{1F6E1}",
shinto_shrine: "\u26E9",
ship: "\u{1F6A2}",
shirt: "\u{1F455}",
shopping: "\u{1F6CD}",
shopping_cart: "\u{1F6D2}",
shower: "\u{1F6BF}",
shrimp: "\u{1F990}",
signal_strength: "\u{1F4F6}",
six_pointed_star: "\u{1F52F}",
ski: "\u{1F3BF}",
skier: "\u26F7",
skull: "\u{1F480}",
skull_and_crossbones: "\u2620\uFE0F",
sleeping: "\u{1F634}",
sleeping_bed: "\u{1F6CC}",
sleepy: "\u{1F62A}",
slightly_frowning_face: "\u{1F641}",
slightly_smiling_face: "\u{1F642}",
slot_machine: "\u{1F3B0}",
small_airplane: "\u{1F6E9}",
small_blue_diamond: "\u{1F539}",
small_orange_diamond: "\u{1F538}",
small_red_triangle: "\u{1F53A}",
small_red_triangle_down: "\u{1F53B}",
smile: "\u{1F604}",
smile_cat: "\u{1F638}",
smiley: "\u{1F603}",
smiley_cat: "\u{1F63A}",
smiling_imp: "\u{1F608}",
smirk: "\u{1F60F}",
smirk_cat: "\u{1F63C}",
smoking: "\u{1F6AC}",
snail: "\u{1F40C}",
snake: "\u{1F40D}",
sneezing_face: "\u{1F927}",
snowboarder: "\u{1F3C2}",
snowflake: "\u2744\uFE0F",
snowman: "\u26C4\uFE0F",
snowman_with_snow: "\u2603\uFE0F",
sob: "\u{1F62D}",
soccer: "\u26BD\uFE0F",
soon: "\u{1F51C}",
sos: "\u{1F198}",
sound: "\u{1F509}",
space_invader: "\u{1F47E}",
spades: "\u2660\uFE0F",
spaghetti: "\u{1F35D}",
sparkle: "\u2747\uFE0F",
sparkler: "\u{1F387}",
sparkles: "\u2728",
sparkling_heart: "\u{1F496}",
speak_no_evil: "\u{1F64A}",
speaker: "\u{1F508}",
speaking_head: "\u{1F5E3}",
speech_balloon: "\u{1F4AC}",
speedboat: "\u{1F6A4}",
spider: "\u{1F577}",
spider_web: "\u{1F578}",
spiral_calendar: "\u{1F5D3}",
spiral_notepad: "\u{1F5D2}",
spoon: "\u{1F944}",
squid: "\u{1F991}",
stadium: "\u{1F3DF}",
star: "\u2B50\uFE0F",
star2: "\u{1F31F}",
star_and_crescent: "\u262A\uFE0F",
star_of_david: "\u2721\uFE0F",
stars: "\u{1F320}",
station: "\u{1F689}",
statue_of_liberty: "\u{1F5FD}",
steam_locomotive: "\u{1F682}",
stew: "\u{1F372}",
stop_button: "\u23F9",
stop_sign: "\u{1F6D1}",
stopwatch: "\u23F1",
straight_ruler: "\u{1F4CF}",
strawberry: "\u{1F353}",
stuck_out_tongue: "\u{1F61B}",
stuck_out_tongue_closed_eyes: "\u{1F61D}",
stuck_out_tongue_winking_eye: "\u{1F61C}",
studio_microphone: "\u{1F399}",
stuffed_flatbread: "\u{1F959}",
sun_behind_large_cloud: "\u{1F325}",
sun_behind_rain_cloud: "\u{1F326}",
sun_behind_small_cloud: "\u{1F324}",
sun_with_face: "\u{1F31E}",
sunflower: "\u{1F33B}",
sunglasses: "\u{1F60E}",
sunny: "\u2600\uFE0F",
sunrise: "\u{1F305}",
sunrise_over_mountains: "\u{1F304}",
surfing_man: "\u{1F3C4}",
surfing_woman: "\u{1F3C4}&zwj;\u2640\uFE0F",
sushi: "\u{1F363}",
suspension_railway: "\u{1F69F}",
sweat: "\u{1F613}",
sweat_drops: "\u{1F4A6}",
sweat_smile: "\u{1F605}",
sweet_potato: "\u{1F360}",
swimming_man: "\u{1F3CA}",
swimming_woman: "\u{1F3CA}&zwj;\u2640\uFE0F",
symbols: "\u{1F523}",
synagogue: "\u{1F54D}",
syringe: "\u{1F489}",
taco: "\u{1F32E}",
tada: "\u{1F389}",
tanabata_tree: "\u{1F38B}",
taurus: "\u2649\uFE0F",
taxi: "\u{1F695}",
tea: "\u{1F375}",
telephone_receiver: "\u{1F4DE}",
telescope: "\u{1F52D}",
tennis: "\u{1F3BE}",
tent: "\u26FA\uFE0F",
thermometer: "\u{1F321}",
thinking: "\u{1F914}",
thought_balloon: "\u{1F4AD}",
ticket: "\u{1F3AB}",
tickets: "\u{1F39F}",
tiger: "\u{1F42F}",
tiger2: "\u{1F405}",
timer_clock: "\u23F2",
tipping_hand_man: "\u{1F481}&zwj;\u2642\uFE0F",
tired_face: "\u{1F62B}",
tm: "\u2122\uFE0F",
toilet: "\u{1F6BD}",
tokyo_tower: "\u{1F5FC}",
tomato: "\u{1F345}",
tongue: "\u{1F445}",
top: "\u{1F51D}",
tophat: "\u{1F3A9}",
tornado: "\u{1F32A}",
trackball: "\u{1F5B2}",
tractor: "\u{1F69C}",
traffic_light: "\u{1F6A5}",
train: "\u{1F68B}",
train2: "\u{1F686}",
tram: "\u{1F68A}",
triangular_flag_on_post: "\u{1F6A9}",
triangular_ruler: "\u{1F4D0}",
trident: "\u{1F531}",
triumph: "\u{1F624}",
trolleybus: "\u{1F68E}",
trophy: "\u{1F3C6}",
tropical_drink: "\u{1F379}",
tropical_fish: "\u{1F420}",
truck: "\u{1F69A}",
trumpet: "\u{1F3BA}",
tulip: "\u{1F337}",
tumbler_glass: "\u{1F943}",
turkey: "\u{1F983}",
turtle: "\u{1F422}",
tv: "\u{1F4FA}",
twisted_rightwards_arrows: "\u{1F500}",
two_hearts: "\u{1F495}",
two_men_holding_hands: "\u{1F46C}",
two_women_holding_hands: "\u{1F46D}",
u5272: "\u{1F239}",
u5408: "\u{1F234}",
u55b6: "\u{1F23A}",
u6307: "\u{1F22F}\uFE0F",
u6708: "\u{1F237}\uFE0F",
u6709: "\u{1F236}",
u6e80: "\u{1F235}",
u7121: "\u{1F21A}\uFE0F",
u7533: "\u{1F238}",
u7981: "\u{1F232}",
u7a7a: "\u{1F233}",
umbrella: "\u2614\uFE0F",
unamused: "\u{1F612}",
underage: "\u{1F51E}",
unicorn: "\u{1F984}",
unlock: "\u{1F513}",
up: "\u{1F199}",
upside_down_face: "\u{1F643}",
v: "\u270C\uFE0F",
vertical_traffic_light: "\u{1F6A6}",
vhs: "\u{1F4FC}",
vibration_mode: "\u{1F4F3}",
video_camera: "\u{1F4F9}",
video_game: "\u{1F3AE}",
violin: "\u{1F3BB}",
virgo: "\u264D\uFE0F",
volcano: "\u{1F30B}",
volleyball: "\u{1F3D0}",
vs: "\u{1F19A}",
vulcan_salute: "\u{1F596}",
walking_man: "\u{1F6B6}",
walking_woman: "\u{1F6B6}&zwj;\u2640\uFE0F",
waning_crescent_moon: "\u{1F318}",
waning_gibbous_moon: "\u{1F316}",
warning: "\u26A0\uFE0F",
wastebasket: "\u{1F5D1}",
watch: "\u231A\uFE0F",
water_buffalo: "\u{1F403}",
watermelon: "\u{1F349}",
wave: "\u{1F44B}",
wavy_dash: "\u3030\uFE0F",
waxing_crescent_moon: "\u{1F312}",
wc: "\u{1F6BE}",
weary: "\u{1F629}",
wedding: "\u{1F492}",
weight_lifting_man: "\u{1F3CB}\uFE0F",
weight_lifting_woman: "\u{1F3CB}\uFE0F&zwj;\u2640\uFE0F",
whale: "\u{1F433}",
whale2: "\u{1F40B}",
wheel_of_dharma: "\u2638\uFE0F",
wheelchair: "\u267F\uFE0F",
white_check_mark: "\u2705",
white_circle: "\u26AA\uFE0F",
white_flag: "\u{1F3F3}\uFE0F",
white_flower: "\u{1F4AE}",
white_large_square: "\u2B1C\uFE0F",
white_medium_small_square: "\u25FD\uFE0F",
white_medium_square: "\u25FB\uFE0F",
white_small_square: "\u25AB\uFE0F",
white_square_button: "\u{1F533}",
wilted_flower: "\u{1F940}",
wind_chime: "\u{1F390}",
wind_face: "\u{1F32C}",
wine_glass: "\u{1F377}",
wink: "\u{1F609}",
wolf: "\u{1F43A}",
woman: "\u{1F469}",
woman_artist: "\u{1F469}&zwj;\u{1F3A8}",
woman_astronaut: "\u{1F469}&zwj;\u{1F680}",
woman_cartwheeling: "\u{1F938}&zwj;\u2640\uFE0F",
woman_cook: "\u{1F469}&zwj;\u{1F373}",
woman_facepalming: "\u{1F926}&zwj;\u2640\uFE0F",
woman_factory_worker: "\u{1F469}&zwj;\u{1F3ED}",
woman_farmer: "\u{1F469}&zwj;\u{1F33E}",
woman_firefighter: "\u{1F469}&zwj;\u{1F692}",
woman_health_worker: "\u{1F469}&zwj;\u2695\uFE0F",
woman_judge: "\u{1F469}&zwj;\u2696\uFE0F",
woman_juggling: "\u{1F939}&zwj;\u2640\uFE0F",
woman_mechanic: "\u{1F469}&zwj;\u{1F527}",
woman_office_worker: "\u{1F469}&zwj;\u{1F4BC}",
woman_pilot: "\u{1F469}&zwj;\u2708\uFE0F",
woman_playing_handball: "\u{1F93E}&zwj;\u2640\uFE0F",
woman_playing_water_polo: "\u{1F93D}&zwj;\u2640\uFE0F",
woman_scientist: "\u{1F469}&zwj;\u{1F52C}",
woman_shrugging: "\u{1F937}&zwj;\u2640\uFE0F",
woman_singer: "\u{1F469}&zwj;\u{1F3A4}",
woman_student: "\u{1F469}&zwj;\u{1F393}",
woman_teacher: "\u{1F469}&zwj;\u{1F3EB}",
woman_technologist: "\u{1F469}&zwj;\u{1F4BB}",
woman_with_turban: "\u{1F473}&zwj;\u2640\uFE0F",
womans_clothes: "\u{1F45A}",
womans_hat: "\u{1F452}",
women_wrestling: "\u{1F93C}&zwj;\u2640\uFE0F",
womens: "\u{1F6BA}",
world_map: "\u{1F5FA}",
worried: "\u{1F61F}",
wrench: "\u{1F527}",
writing_hand: "\u270D\uFE0F",
x: "\u274C",
yellow_heart: "\u{1F49B}",
yen: "\u{1F4B4}",
yin_yang: "\u262F\uFE0F",
yum: "\u{1F60B}",
zap: "\u26A1\uFE0F",
zipper_mouth_face: "\u{1F910}",
zzz: "\u{1F4A4}",
octocat:
'<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">',
showdown: `<span style="font-family: 'Anonymous Pro', monospace; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: #3e8b8a;text-underline-position: under;">S</span>`,
}),
(r.Converter = function (d) {
var y = {},
m = [],
w = [],
k = {},
_ = l,
C = { parsed: {}, raw: "", format: "" };
E();
function E() {
d = d || {};
for (var M in s) s.hasOwnProperty(M) && (y[M] = s[M]);
if (typeof d == "object")
for (var N in d) d.hasOwnProperty(N) && (y[N] = d[N]);
else
throw Error(
"Converter expects the passed parameter to be an object, but " +
typeof d +
" was passed instead."
);
y.extensions && r.helper.forEach(y.extensions, R);
}
function R(M, N) {
if (((N = N || null), r.helper.isString(M)))
if (
((M = r.helper.stdExtName(M)),
(N = M),
r.extensions[M])
) {
console.warn(
"DEPRECATION WARNING: " +
M +
" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"
),
P(r.extensions[M], M);
return;
} else if (!r.helper.isUndefined(o[M])) M = o[M];
else
throw Error(
'Extension "' +
M +
'" could not be loaded. It was either not found or is not a valid extension.'
);
typeof M == "function" && (M = M()),
r.helper.isArray(M) || (M = [M]);
var D = u(M, N);
if (!D.valid) throw Error(D.error);
for (var K = 0; K < M.length; ++K) {
switch (M[K].type) {
case "lang":
m.push(M[K]);
break;
case "output":
w.push(M[K]);
break;
}
if (M[K].hasOwnProperty("listeners"))
for (var ae in M[K].listeners)
M[K].listeners.hasOwnProperty(ae) &&
L(ae, M[K].listeners[ae]);
}
}
function P(M, N) {
typeof M == "function" && (M = M(new r.Converter())),
r.helper.isArray(M) || (M = [M]);
var D = u(M, N);
if (!D.valid) throw Error(D.error);
for (var K = 0; K < M.length; ++K)
switch (M[K].type) {
case "lang":
m.push(M[K]);
break;
case "output":
w.push(M[K]);
break;
default:
throw Error(
"Extension loader error: Type unrecognized!!!"
);
}
}
function L(M, N) {
if (!r.helper.isString(M))
throw Error(
"Invalid argument in converter.listen() method: name must be a string, but " +
typeof M +
" given"
);
if (typeof N != "function")
throw Error(
"Invalid argument in converter.listen() method: callback must be a function, but " +
typeof N +
" given"
);
k.hasOwnProperty(M) || (k[M] = []), k[M].push(N);
}
function I(M) {
var N = M.match(/^\s*/)[0].length,
D = new RegExp("^\\s{0," + N + "}", "gm");
return M.replace(D, "");
}
(this._dispatch = function (N, D, K, ae) {
if (k.hasOwnProperty(N))
for (var Q = 0; Q < k[N].length; ++Q) {
var me = k[N][Q](N, D, this, K, ae);
me && typeof me != "undefined" && (D = me);
}
return D;
}),
(this.listen = function (M, N) {
return L(M, N), this;
}),
(this.makeHtml = function (M) {
if (!M) return M;
var N = {
gHtmlBlocks: [],
gHtmlMdBlocks: [],
gHtmlSpans: [],
gUrls: {},
gTitles: {},
gDimensions: {},
gListLevel: 0,
hashLinkCounts: {},
langExtensions: m,
outputModifiers: w,
converter: this,
ghCodeBlocks: [],
metadata: { parsed: {}, raw: "", format: "" },
};
return (
(M = M.replace(/¨/g, "\xA8T")),
(M = M.replace(/\$/g, "\xA8D")),
(M = M.replace(
/\r\n/g,
`
`
)),
(M = M.replace(
/\r/g,
`
`
)),
(M = M.replace(/\u00A0/g, "&nbsp;")),
y.smartIndentationFix && (M = I(M)),
(M =
`
` +
M +
`
`),
(M = r.subParser("detab")(M, y, N)),
(M = M.replace(/^[ \t]+$/gm, "")),
r.helper.forEach(m, function (D) {
M = r.subParser("runExtension")(D, M, y, N);
}),
(M = r.subParser("metadata")(M, y, N)),
(M = r.subParser("hashPreCodeTags")(M, y, N)),
(M = r.subParser("githubCodeBlocks")(M, y, N)),
(M = r.subParser("hashHTMLBlocks")(M, y, N)),
(M = r.subParser("hashCodeTags")(M, y, N)),
(M = r.subParser("stripLinkDefinitions")(M, y, N)),
(M = r.subParser("blockGamut")(M, y, N)),
(M = r.subParser("unhashHTMLSpans")(M, y, N)),
(M = r.subParser("unescapeSpecialChars")(M, y, N)),
(M = M.replace(/¨D/g, "$$")),
(M = M.replace(/¨T/g, "\xA8")),
(M = r.subParser("completeHTMLDocument")(M, y, N)),
r.helper.forEach(w, function (D) {
M = r.subParser("runExtension")(D, M, y, N);
}),
(C = N.metadata),
M
);
}),
(this.makeMarkdown = this.makeMd =
function (M, N) {
if (
((M = M.replace(
/\r\n/g,
`
`
)),
(M = M.replace(
/\r/g,
`
`
)),
(M = M.replace(/>[ \t]+</, ">\xA8NBSP;<")),
!N)
)
if (window && window.document)
N = window.document;
else
throw new Error(
"HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM"
);
var D = N.createElement("div");
D.innerHTML = M;
var K = { preList: Le(D) };
je(D);
for (
var ae = D.childNodes, Q = "", me = 0;
me < ae.length;
me++
)
Q += r.subParser("makeMarkdown.node")(
ae[me],
K
);
function je(Re) {
for (
var Ae = 0;
Ae < Re.childNodes.length;
++Ae
) {
var z = Re.childNodes[Ae];
z.nodeType === 3
? !/\S/.test(z.nodeValue) &&
!/^[ ]+$/.test(z.nodeValue)
? (Re.removeChild(z), --Ae)
: ((z.nodeValue = z.nodeValue
.split(
`
`
)
.join(" ")),
(z.nodeValue =
z.nodeValue.replace(
/(\s)+/g,
"$1"
)))
: z.nodeType === 1 && je(z);
}
}
function Le(Re) {
for (
var Ae = Re.querySelectorAll("pre"),
z = [],
X = 0;
X < Ae.length;
++X
)
if (
Ae[X].childElementCount === 1 &&
Ae[
X
].firstChild.tagName.toLowerCase() ===
"code"
) {
var ee =
Ae[
X
].firstChild.innerHTML.trim(),
ue =
Ae[X].firstChild.getAttribute(
"data-language"
) || "";
if (ue === "")
for (
var Pe =
Ae[
X
].firstChild.className.split(
" "
),
A = 0;
A < Pe.length;
++A
) {
var O =
Pe[A].match(
/^language-(.+)$/
);
if (O !== null) {
ue = O[1];
break;
}
}
(ee =
r.helper.unescapeHTMLEntities(ee)),
z.push(ee),
(Ae[X].outerHTML =
'<precode language="' +
ue +
'" precodenum="' +
X.toString() +
'"></precode>');
} else
z.push(Ae[X].innerHTML),
(Ae[X].innerHTML = ""),
Ae[X].setAttribute(
"prenum",
X.toString()
);
return z;
}
return Q;
}),
(this.setOption = function (M, N) {
y[M] = N;
}),
(this.getOption = function (M) {
return y[M];
}),
(this.getOptions = function () {
return y;
}),
(this.addExtension = function (M, N) {
(N = N || null), R(M, N);
}),
(this.useExtension = function (M) {
R(M);
}),
(this.setFlavor = function (M) {
if (!a.hasOwnProperty(M))
throw Error(M + " flavor was not found");
var N = a[M];
_ = M;
for (var D in N) N.hasOwnProperty(D) && (y[D] = N[D]);
}),
(this.getFlavor = function () {
return _;
}),
(this.removeExtension = function (M) {
r.helper.isArray(M) || (M = [M]);
for (var N = 0; N < M.length; ++N) {
for (var D = M[N], K = 0; K < m.length; ++K)
m[K] === D && m.splice(K, 1);
for (var ae = 0; ae < w.length; ++ae)
w[ae] === D && w.splice(ae, 1);
}
}),
(this.getAllExtensions = function () {
return { language: m, output: w };
}),
(this.getMetadata = function (M) {
return M ? C.raw : C.parsed;
}),
(this.getMetadataFormat = function () {
return C.format;
}),
(this._setMetadataPair = function (M, N) {
C.parsed[M] = N;
}),
(this._setMetadataFormat = function (M) {
C.format = M;
}),
(this._setMetadataRaw = function (M) {
C.raw = M;
});
}),
r.subParser("anchors", function (d, y, m) {
d = m.converter._dispatch("anchors.before", d, y, m);
var w = function (k, _, C, E, R, P, L) {
if (
(r.helper.isUndefined(L) && (L = ""),
(C = C.toLowerCase()),
k.search(/\(<?\s*>? ?(['"].*['"])?\)$/m) > -1)
)
E = "";
else if (!E)
if (
(C || (C = _.toLowerCase().replace(/ ?\n/g, " ")),
(E = "#" + C),
!r.helper.isUndefined(m.gUrls[C]))
)
(E = m.gUrls[C]),
r.helper.isUndefined(m.gTitles[C]) ||
(L = m.gTitles[C]);
else return k;
E = E.replace(
r.helper.regexes.asteriskDashAndColon,
r.helper.escapeCharactersCallback
);
var I = '<a href="' + E + '"';
return (
L !== "" &&
L !== null &&
((L = L.replace(/"/g, "&quot;")),
(L = L.replace(
r.helper.regexes.asteriskDashAndColon,
r.helper.escapeCharactersCallback
)),
(I += ' title="' + L + '"')),
y.openLinksInNewWindow &&
!/^#/.test(E) &&
(I +=
' rel="noopener noreferrer" target="\xA8E95Eblank"'),
(I += ">" + _ + "</a>"),
I
);
};
return (
(d = d.replace(
/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,
w
)),
(d = d.replace(
/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,
w
)),
(d = d.replace(
/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,
w
)),
(d = d.replace(/\[([^\[\]]+)]()()()()()/g, w)),
y.ghMentions &&
(d = d.replace(
/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gim,
function (k, _, C, E, R) {
if (C === "\\") return _ + E;
if (!r.helper.isString(y.ghMentionsLink))
throw new Error(
"ghMentionsLink option must be a string"
);
var P = y.ghMentionsLink.replace(/\{u}/g, R),
L = "";
return (
y.openLinksInNewWindow &&
(L =
' rel="noopener noreferrer" target="\xA8E95Eblank"'),
_ +
'<a href="' +
P +
'"' +
L +
">" +
E +
"</a>"
);
}
)),
(d = m.converter._dispatch("anchors.after", d, y, m)),
d
);
});
var h =
/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,
p =
/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,
g = /()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,
v =
/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gim,
b = /<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,
x = function (d) {
return function (y, m, w, k, _, C, E) {
w = w.replace(
r.helper.regexes.asteriskDashAndColon,
r.helper.escapeCharactersCallback
);
var R = w,
P = "",
L = "",
I = m || "",
M = E || "";
return (
/^www\./i.test(w) &&
(w = w.replace(/^www\./i, "http://www.")),
d.excludeTrailingPunctuationFromURLs && C && (P = C),
d.openLinksInNewWindow &&
(L =
' rel="noopener noreferrer" target="\xA8E95Eblank"'),
I + '<a href="' + w + '"' + L + ">" + R + "</a>" + P + M
);
};
},
S = function (d, y) {
return function (m, w, k) {
var _ = "mailto:";
return (
(w = w || ""),
(k = r.subParser("unescapeSpecialChars")(k, d, y)),
d.encodeEmails
? ((_ = r.helper.encodeEmailAddress(_ + k)),
(k = r.helper.encodeEmailAddress(k)))
: (_ = _ + k),
w + '<a href="' + _ + '">' + k + "</a>"
);
};
};
r.subParser("autoLinks", function (d, y, m) {
return (
(d = m.converter._dispatch("autoLinks.before", d, y, m)),
(d = d.replace(g, x(y))),
(d = d.replace(b, S(y, m))),
(d = m.converter._dispatch("autoLinks.after", d, y, m)),
d
);
}),
r.subParser("simplifiedAutoLinks", function (d, y, m) {
return (
y.simplifiedAutoLink &&
((d = m.converter._dispatch(
"simplifiedAutoLinks.before",
d,
y,
m
)),
y.excludeTrailingPunctuationFromURLs
? (d = d.replace(p, x(y)))
: (d = d.replace(h, x(y))),
(d = d.replace(v, S(y, m))),
(d = m.converter._dispatch(
"simplifiedAutoLinks.after",
d,
y,
m
))),
d
);
}),
r.subParser("blockGamut", function (d, y, m) {
return (
(d = m.converter._dispatch("blockGamut.before", d, y, m)),
(d = r.subParser("blockQuotes")(d, y, m)),
(d = r.subParser("headers")(d, y, m)),
(d = r.subParser("horizontalRule")(d, y, m)),
(d = r.subParser("lists")(d, y, m)),
(d = r.subParser("codeBlocks")(d, y, m)),
(d = r.subParser("tables")(d, y, m)),
(d = r.subParser("hashHTMLBlocks")(d, y, m)),
(d = r.subParser("paragraphs")(d, y, m)),
(d = m.converter._dispatch("blockGamut.after", d, y, m)),
d
);
}),
r.subParser("blockQuotes", function (d, y, m) {
(d = m.converter._dispatch("blockQuotes.before", d, y, m)),
(d =
d +
`
`);
var w = /(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;
return (
y.splitAdjacentBlockquotes &&
(w = /^ {0,3}>[\s\S]*?(?:\n\n)/gm),
(d = d.replace(w, function (k) {
return (
(k = k.replace(/^[ \t]*>[ \t]?/gm, "")),
(k = k.replace(/¨0/g, "")),
(k = k.replace(/^[ \t]+$/gm, "")),
(k = r.subParser("githubCodeBlocks")(k, y, m)),
(k = r.subParser("blockGamut")(k, y, m)),
(k = k.replace(/(^|\n)/g, "$1 ")),
(k = k.replace(
/(\s*<pre>[^\r]+?<\/pre>)/gm,
function (_, C) {
var E = C;
return (
(E = E.replace(/^ /gm, "\xA80")),
(E = E.replace(/¨0/g, "")),
E
);
}
)),
r.subParser("hashBlock")(
`<blockquote>
` +
k +
`
</blockquote>`,
y,
m
)
);
})),
(d = m.converter._dispatch("blockQuotes.after", d, y, m)),
d
);
}),
r.subParser("codeBlocks", function (d, y, m) {
(d = m.converter._dispatch("codeBlocks.before", d, y, m)),
(d += "\xA80");
var w =
/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g;
return (
(d = d.replace(w, function (k, _, C) {
var E = _,
R = C,
P = `
`;
return (
(E = r.subParser("outdent")(E, y, m)),
(E = r.subParser("encodeCode")(E, y, m)),
(E = r.subParser("detab")(E, y, m)),
(E = E.replace(/^\n+/g, "")),
(E = E.replace(/\n+$/g, "")),
y.omitExtraWLInCodeBlocks && (P = ""),
(E = "<pre><code>" + E + P + "</code></pre>"),
r.subParser("hashBlock")(E, y, m) + R
);
})),
(d = d.replace(/¨0/, "")),
(d = m.converter._dispatch("codeBlocks.after", d, y, m)),
d
);
}),
r.subParser("codeSpans", function (d, y, m) {
return (
(d = m.converter._dispatch("codeSpans.before", d, y, m)),
typeof d == "undefined" && (d = ""),
(d = d.replace(
/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,
function (w, k, _, C) {
var E = C;
return (
(E = E.replace(/^([ \t]*)/g, "")),
(E = E.replace(/[ \t]*$/g, "")),
(E = r.subParser("encodeCode")(E, y, m)),
(E = k + "<code>" + E + "</code>"),
(E = r.subParser("hashHTMLSpans")(E, y, m)),
E
);
}
)),
(d = m.converter._dispatch("codeSpans.after", d, y, m)),
d
);
}),
r.subParser("completeHTMLDocument", function (d, y, m) {
if (!y.completeHTMLDocument) return d;
d = m.converter._dispatch(
"completeHTMLDocument.before",
d,
y,
m
);
var w = "html",
k = `<!DOCTYPE HTML>
`,
_ = "",
C = `<meta charset="utf-8">
`,
E = "",
R = "";
typeof m.metadata.parsed.doctype != "undefined" &&
((k =
"<!DOCTYPE " +
m.metadata.parsed.doctype +
`>
`),
(w = m.metadata.parsed.doctype.toString().toLowerCase()),
(w === "html" || w === "html5") &&
(C = '<meta charset="utf-8">'));
for (var P in m.metadata.parsed)
if (m.metadata.parsed.hasOwnProperty(P))
switch (P.toLowerCase()) {
case "doctype":
break;
case "title":
_ =
"<title>" +
m.metadata.parsed.title +
`</title>
`;
break;
case "charset":
w === "html" || w === "html5"
? (C =
'<meta charset="' +
m.metadata.parsed.charset +
`">
`)
: (C =
'<meta name="charset" content="' +
m.metadata.parsed.charset +
`">
`);
break;
case "language":
case "lang":
(E = ' lang="' + m.metadata.parsed[P] + '"'),
(R +=
'<meta name="' +
P +
'" content="' +
m.metadata.parsed[P] +
`">
`);
break;
default:
R +=
'<meta name="' +
P +
'" content="' +
m.metadata.parsed[P] +
`">
`;
}
return (
(d =
k +
"<html" +
E +
`>
<head>
` +
_ +
C +
R +
`</head>
<body>
` +
d.trim() +
`
</body>
</html>`),
(d = m.converter._dispatch(
"completeHTMLDocument.after",
d,
y,
m
)),
d
);
}),
r.subParser("detab", function (d, y, m) {
return (
(d = m.converter._dispatch("detab.before", d, y, m)),
(d = d.replace(/\t(?=\t)/g, " ")),
(d = d.replace(/\t/g, "\xA8A\xA8B")),
(d = d.replace(/¨B(.+?)¨A/g, function (w, k) {
for (
var _ = k, C = 4 - (_.length % 4), E = 0;
E < C;
E++
)
_ += " ";
return _;
})),
(d = d.replace(/¨A/g, " ")),
(d = d.replace(/¨B/g, "")),
(d = m.converter._dispatch("detab.after", d, y, m)),
d
);
}),
r.subParser("ellipsis", function (d, y, m) {
return (
y.ellipsis &&
((d = m.converter._dispatch(
"ellipsis.before",
d,
y,
m
)),
(d = d.replace(/\.\.\./g, "\u2026")),
(d = m.converter._dispatch("ellipsis.after", d, y, m))),
d
);
}),
r.subParser("emoji", function (d, y, m) {
if (!y.emoji) return d;
d = m.converter._dispatch("emoji.before", d, y, m);
var w = /:([\S]+?):/g;
return (
(d = d.replace(w, function (k, _) {
return r.helper.emojis.hasOwnProperty(_)
? r.helper.emojis[_]
: k;
})),
(d = m.converter._dispatch("emoji.after", d, y, m)),
d
);
}),
r.subParser("encodeAmpsAndAngles", function (d, y, m) {
return (
(d = m.converter._dispatch(
"encodeAmpsAndAngles.before",
d,
y,
m
)),
(d = d.replace(
/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,
"&amp;"
)),
(d = d.replace(/<(?![a-z\/?$!])/gi, "&lt;")),
(d = d.replace(/</g, "&lt;")),
(d = d.replace(/>/g, "&gt;")),
(d = m.converter._dispatch(
"encodeAmpsAndAngles.after",
d,
y,
m
)),
d
);
}),
r.subParser("encodeBackslashEscapes", function (d, y, m) {
return (
(d = m.converter._dispatch(
"encodeBackslashEscapes.before",
d,
y,
m
)),
(d = d.replace(
/\\(\\)/g,
r.helper.escapeCharactersCallback
)),
(d = d.replace(
/\\([`*_{}\[\]()>#+.!~=|:-])/g,
r.helper.escapeCharactersCallback
)),
(d = m.converter._dispatch(
"encodeBackslashEscapes.after",
d,
y,
m
)),
d
);
}),
r.subParser("encodeCode", function (d, y, m) {
return (
(d = m.converter._dispatch("encodeCode.before", d, y, m)),
(d = d
.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(
/([*_{}\[\]\\=~-])/g,
r.helper.escapeCharactersCallback
)),
(d = m.converter._dispatch("encodeCode.after", d, y, m)),
d
);
}),
r.subParser(
"escapeSpecialCharsWithinTagAttributes",
function (d, y, m) {
d = m.converter._dispatch(
"escapeSpecialCharsWithinTagAttributes.before",
d,
y,
m
);
var w = /<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,
k = /<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi;
return (
(d = d.replace(w, function (_) {
return _.replace(
/(.)<\/?code>(?=.)/g,
"$1`"
).replace(
/([\\`*_~=|])/g,
r.helper.escapeCharactersCallback
);
})),
(d = d.replace(k, function (_) {
return _.replace(
/([\\`*_~=|])/g,
r.helper.escapeCharactersCallback
);
})),
(d = m.converter._dispatch(
"escapeSpecialCharsWithinTagAttributes.after",
d,
y,
m
)),
d
);
}
),
r.subParser("githubCodeBlocks", function (d, y, m) {
return y.ghCodeBlocks
? ((d = m.converter._dispatch(
"githubCodeBlocks.before",
d,
y,
m
)),
(d += "\xA80"),
(d = d.replace(
/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,
function (w, k, _, C) {
var E = y.omitExtraWLInCodeBlocks
? ""
: `
`;
return (
(C = r.subParser("encodeCode")(C, y, m)),
(C = r.subParser("detab")(C, y, m)),
(C = C.replace(/^\n+/g, "")),
(C = C.replace(/\n+$/g, "")),
(C =
"<pre><code" +
(_
? ' class="' +
_ +
" language-" +
_ +
'"'
: "") +
">" +
C +
E +
"</code></pre>"),
(C = r.subParser("hashBlock")(C, y, m)),
`
\xA8G` +
(m.ghCodeBlocks.push({
text: w,
codeblock: C,
}) -
1) +
`G
`
);
}
)),
(d = d.replace(/¨0/, "")),
m.converter._dispatch("githubCodeBlocks.after", d, y, m))
: d;
}),
r.subParser("hashBlock", function (d, y, m) {
return (
(d = m.converter._dispatch("hashBlock.before", d, y, m)),
(d = d.replace(/(^\n+|\n+$)/g, "")),
(d =
`
\xA8K` +
(m.gHtmlBlocks.push(d) - 1) +
`K
`),
(d = m.converter._dispatch("hashBlock.after", d, y, m)),
d
);
}),
r.subParser("hashCodeTags", function (d, y, m) {
d = m.converter._dispatch("hashCodeTags.before", d, y, m);
var w = function (k, _, C, E) {
var R = C + r.subParser("encodeCode")(_, y, m) + E;
return "\xA8C" + (m.gHtmlSpans.push(R) - 1) + "C";
};
return (
(d = r.helper.replaceRecursiveRegExp(
d,
w,
"<code\\b[^>]*>",
"</code>",
"gim"
)),
(d = m.converter._dispatch("hashCodeTags.after", d, y, m)),
d
);
}),
r.subParser("hashElement", function (d, y, m) {
return function (w, k) {
var _ = k;
return (
(_ = _.replace(
/\n\n/g,
`
`
)),
(_ = _.replace(/^\n/, "")),
(_ = _.replace(/\n+$/g, "")),
(_ =
`
\xA8K` +
(m.gHtmlBlocks.push(_) - 1) +
`K
`),
_
);
};
}),
r.subParser("hashHTMLBlocks", function (d, y, m) {
d = m.converter._dispatch("hashHTMLBlocks.before", d, y, m);
var w = [
"pre",
"div",
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"blockquote",
"table",
"dl",
"ol",
"ul",
"script",
"noscript",
"form",
"fieldset",
"iframe",
"math",
"style",
"section",
"header",
"footer",
"nav",
"article",
"aside",
"address",
"audio",
"canvas",
"figure",
"hgroup",
"output",
"video",
"p",
],
k = function (M, N, D, K) {
var ae = M;
return (
D.search(/\bmarkdown\b/) !== -1 &&
(ae = D + m.converter.makeHtml(N) + K),
`
\xA8K` +
(m.gHtmlBlocks.push(ae) - 1) +
`K
`
);
};
y.backslashEscapesHTMLTags &&
(d = d.replace(/\\<(\/?[^>]+?)>/g, function (M, N) {
return "&lt;" + N + "&gt;";
}));
for (var _ = 0; _ < w.length; ++_)
for (
var C,
E = new RegExp(
"^ {0,3}(<" + w[_] + "\\b[^>]*>)",
"im"
),
R = "<" + w[_] + "\\b[^>]*>",
P = "</" + w[_] + ">";
(C = r.helper.regexIndexOf(d, E)) !== -1;
) {
var L = r.helper.splitAtIndex(d, C),
I = r.helper.replaceRecursiveRegExp(
L[1],
k,
R,
P,
"im"
);
if (I === L[1]) break;
d = L[0].concat(I);
}
return (
(d = d.replace(
/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,
r.subParser("hashElement")(d, y, m)
)),
(d = r.helper.replaceRecursiveRegExp(
d,
function (M) {
return (
`
\xA8K` +
(m.gHtmlBlocks.push(M) - 1) +
`K
`
);
},
"^ {0,3}<!--",
"-->",
"gm"
)),
(d = d.replace(
/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,
r.subParser("hashElement")(d, y, m)
)),
(d = m.converter._dispatch(
"hashHTMLBlocks.after",
d,
y,
m
)),
d
);
}),
r.subParser("hashHTMLSpans", function (d, y, m) {
d = m.converter._dispatch("hashHTMLSpans.before", d, y, m);
function w(k) {
return "\xA8C" + (m.gHtmlSpans.push(k) - 1) + "C";
}
return (
(d = d.replace(/<[^>]+?\/>/gi, function (k) {
return w(k);
})),
(d = d.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g, function (k) {
return w(k);
})),
(d = d.replace(
/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,
function (k) {
return w(k);
}
)),
(d = d.replace(/<[^>]+?>/gi, function (k) {
return w(k);
})),
(d = m.converter._dispatch("hashHTMLSpans.after", d, y, m)),
d
);
}),
r.subParser("unhashHTMLSpans", function (d, y, m) {
d = m.converter._dispatch("unhashHTMLSpans.before", d, y, m);
for (var w = 0; w < m.gHtmlSpans.length; ++w) {
for (var k = m.gHtmlSpans[w], _ = 0; /¨C(\d+)C/.test(k); ) {
var C = RegExp.$1;
if (
((k = k.replace(
"\xA8C" + C + "C",
m.gHtmlSpans[C]
)),
_ === 10)
) {
console.error(
"maximum nesting of 10 spans reached!!!"
);
break;
}
++_;
}
d = d.replace("\xA8C" + w + "C", k);
}
return (
(d = m.converter._dispatch(
"unhashHTMLSpans.after",
d,
y,
m
)),
d
);
}),
r.subParser("hashPreCodeTags", function (d, y, m) {
d = m.converter._dispatch("hashPreCodeTags.before", d, y, m);
var w = function (k, _, C, E) {
var R = C + r.subParser("encodeCode")(_, y, m) + E;
return (
`
\xA8G` +
(m.ghCodeBlocks.push({ text: k, codeblock: R }) - 1) +
`G
`
);
};
return (
(d = r.helper.replaceRecursiveRegExp(
d,
w,
"^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>",
"^ {0,3}</code>\\s*</pre>",
"gim"
)),
(d = m.converter._dispatch(
"hashPreCodeTags.after",
d,
y,
m
)),
d
);
}),
r.subParser("headers", function (d, y, m) {
d = m.converter._dispatch("headers.before", d, y, m);
var w = isNaN(parseInt(y.headerLevelStart))
? 1
: parseInt(y.headerLevelStart),
k = y.smoothLivePreview
? /^(.+)[ \t]*\n={2,}[ \t]*\n+/gm
: /^(.+)[ \t]*\n=+[ \t]*\n+/gm,
_ = y.smoothLivePreview
? /^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm
: /^(.+)[ \t]*\n-+[ \t]*\n+/gm;
(d = d.replace(k, function (R, P) {
var L = r.subParser("spanGamut")(P, y, m),
I = y.noHeaderId ? "" : ' id="' + E(P) + '"',
M = w,
N = "<h" + M + I + ">" + L + "</h" + M + ">";
return r.subParser("hashBlock")(N, y, m);
})),
(d = d.replace(_, function (R, P) {
var L = r.subParser("spanGamut")(P, y, m),
I = y.noHeaderId ? "" : ' id="' + E(P) + '"',
M = w + 1,
N = "<h" + M + I + ">" + L + "</h" + M + ">";
return r.subParser("hashBlock")(N, y, m);
}));
var C = y.requireSpaceBeforeHeadingText
? /^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm
: /^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;
d = d.replace(C, function (R, P, L) {
var I = L;
y.customizedHeaderId &&
(I = L.replace(/\s?\{([^{]+?)}\s*$/, ""));
var M = r.subParser("spanGamut")(I, y, m),
N = y.noHeaderId ? "" : ' id="' + E(L) + '"',
D = w - 1 + P.length,
K = "<h" + D + N + ">" + M + "</h" + D + ">";
return r.subParser("hashBlock")(K, y, m);
});
function E(R) {
var P, L;
if (y.customizedHeaderId) {
var I = R.match(/\{([^{]+?)}\s*$/);
I && I[1] && (R = I[1]);
}
return (
(P = R),
r.helper.isString(y.prefixHeaderId)
? (L = y.prefixHeaderId)
: y.prefixHeaderId === !0
? (L = "section-")
: (L = ""),
y.rawPrefixHeaderId || (P = L + P),
y.ghCompatibleHeaderId
? (P = P.replace(/ /g, "-")
.replace(/&amp;/g, "")
.replace(/¨T/g, "")
.replace(/¨D/g, "")
.replace(
/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,
""
)
.toLowerCase())
: y.rawHeaderId
? (P = P.replace(/ /g, "-")
.replace(/&amp;/g, "&")
.replace(/¨T/g, "\xA8")
.replace(/¨D/g, "$")
.replace(/["']/g, "-")
.toLowerCase())
: (P = P.replace(/[^\w]/g, "").toLowerCase()),
y.rawPrefixHeaderId && (P = L + P),
m.hashLinkCounts[P]
? (P = P + "-" + m.hashLinkCounts[P]++)
: (m.hashLinkCounts[P] = 1),
P
);
}
return (d = m.converter._dispatch("headers.after", d, y, m)), d;
}),
r.subParser("horizontalRule", function (d, y, m) {
d = m.converter._dispatch("horizontalRule.before", d, y, m);
var w = r.subParser("hashBlock")("<hr />", y, m);
return (
(d = d.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm, w)),
(d = d.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm, w)),
(d = d.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm, w)),
(d = m.converter._dispatch(
"horizontalRule.after",
d,
y,
m
)),
d
);
}),
r.subParser("images", function (d, y, m) {
d = m.converter._dispatch("images.before", d, y, m);
var w =
/!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,
k =
/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,
_ =
/!\[([^\]]*?)][ \t]*()\([ \t]?<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,
C = /!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,
E = /!\[([^\[\]]+)]()()()()()/g;
function R(L, I, M, N, D, K, ae, Q) {
return (
(N = N.replace(/\s/g, "")), P(L, I, M, N, D, K, ae, Q)
);
}
function P(L, I, M, N, D, K, ae, Q) {
var me = m.gUrls,
je = m.gTitles,
Le = m.gDimensions;
if (
((M = M.toLowerCase()),
Q || (Q = ""),
L.search(/\(<?\s*>? ?(['"].*['"])?\)$/m) > -1)
)
N = "";
else if (N === "" || N === null)
if (
((M === "" || M === null) &&
(M = I.toLowerCase().replace(/ ?\n/g, " ")),
(N = "#" + M),
!r.helper.isUndefined(me[M]))
)
(N = me[M]),
r.helper.isUndefined(je[M]) || (Q = je[M]),
r.helper.isUndefined(Le[M]) ||
((D = Le[M].width), (K = Le[M].height));
else return L;
(I = I.replace(/"/g, "&quot;").replace(
r.helper.regexes.asteriskDashAndColon,
r.helper.escapeCharactersCallback
)),
(N = N.replace(
r.helper.regexes.asteriskDashAndColon,
r.helper.escapeCharactersCallback
));
var Re = '<img src="' + N + '" alt="' + I + '"';
return (
Q &&
r.helper.isString(Q) &&
((Q = Q.replace(/"/g, "&quot;").replace(
r.helper.regexes.asteriskDashAndColon,
r.helper.escapeCharactersCallback
)),
(Re += ' title="' + Q + '"')),
D &&
K &&
((D = D === "*" ? "auto" : D),
(K = K === "*" ? "auto" : K),
(Re += ' width="' + D + '"'),
(Re += ' height="' + K + '"')),
(Re += " />"),
Re
);
}
return (
(d = d.replace(C, P)),
(d = d.replace(_, R)),
(d = d.replace(k, P)),
(d = d.replace(w, P)),
(d = d.replace(E, P)),
(d = m.converter._dispatch("images.after", d, y, m)),
d
);
}),
r.subParser("italicsAndBold", function (d, y, m) {
d = m.converter._dispatch("italicsAndBold.before", d, y, m);
function w(k, _, C) {
return _ + k + C;
}
return (
y.literalMidWordUnderscores
? ((d = d.replace(
/\b___(\S[\s\S]*?)___\b/g,
function (k, _) {
return w(
_,
"<strong><em>",
"</em></strong>"
);
}
)),
(d = d.replace(
/\b__(\S[\s\S]*?)__\b/g,
function (k, _) {
return w(_, "<strong>", "</strong>");
}
)),
(d = d.replace(
/\b_(\S[\s\S]*?)_\b/g,
function (k, _) {
return w(_, "<em>", "</em>");
}
)))
: ((d = d.replace(
/___(\S[\s\S]*?)___/g,
function (k, _) {
return /\S$/.test(_)
? w(_, "<strong><em>", "</em></strong>")
: k;
}
)),
(d = d.replace(/__(\S[\s\S]*?)__/g, function (k, _) {
return /\S$/.test(_)
? w(_, "<strong>", "</strong>")
: k;
})),
(d = d.replace(
/_([^\s_][\s\S]*?)_/g,
function (k, _) {
return /\S$/.test(_)
? w(_, "<em>", "</em>")
: k;
}
))),
y.literalMidWordAsterisks
? ((d = d.replace(
/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g,
function (k, _, C) {
return w(
C,
_ + "<strong><em>",
"</em></strong>"
);
}
)),
(d = d.replace(
/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g,
function (k, _, C) {
return w(C, _ + "<strong>", "</strong>");
}
)),
(d = d.replace(
/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g,
function (k, _, C) {
return w(C, _ + "<em>", "</em>");
}
)))
: ((d = d.replace(
/\*\*\*(\S[\s\S]*?)\*\*\*/g,
function (k, _) {
return /\S$/.test(_)
? w(_, "<strong><em>", "</em></strong>")
: k;
}
)),
(d = d.replace(
/\*\*(\S[\s\S]*?)\*\*/g,
function (k, _) {
return /\S$/.test(_)
? w(_, "<strong>", "</strong>")
: k;
}
)),
(d = d.replace(
/\*([^\s*][\s\S]*?)\*/g,
function (k, _) {
return /\S$/.test(_)
? w(_, "<em>", "</em>")
: k;
}
))),
(d = m.converter._dispatch(
"italicsAndBold.after",
d,
y,
m
)),
d
);
}),
r.subParser("lists", function (d, y, m) {
function w(C, E) {
m.gListLevel++,
(C = C.replace(
/\n{2,}$/,
`
`
)),
(C += "\xA80");
var R =
/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,
P = /\n[ \t]*\n(?!¨0)/.test(C);
return (
y.disableForced4SpacesIndentedSublists &&
(R =
/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),
(C = C.replace(R, function (L, I, M, N, D, K, ae) {
ae = ae && ae.trim() !== "";
var Q = r.subParser("outdent")(D, y, m),
me = "";
return (
K &&
y.tasklists &&
((me =
' class="task-list-item" style="list-style-type: none;"'),
(Q = Q.replace(
/^[ \t]*\[(x|X| )?]/m,
function () {
var je =
'<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';
return (
ae && (je += " checked"),
(je += ">"),
je
);
}
))),
(Q = Q.replace(
/^([-*+]|\d\.)[ \t]+[\S\n ]*/g,
function (je) {
return "\xA8A" + je;
}
)),
I || Q.search(/\n{2,}/) > -1
? ((Q = r.subParser("githubCodeBlocks")(
Q,
y,
m
)),
(Q = r.subParser("blockGamut")(Q, y, m)))
: ((Q = r.subParser("lists")(Q, y, m)),
(Q = Q.replace(/\n$/, "")),
(Q = r.subParser("hashHTMLBlocks")(
Q,
y,
m
)),
(Q = Q.replace(
/\n\n+/g,
`
`
)),
P
? (Q = r.subParser("paragraphs")(
Q,
y,
m
))
: (Q = r.subParser("spanGamut")(
Q,
y,
m
))),
(Q = Q.replace("\xA8A", "")),
(Q =
"<li" +
me +
">" +
Q +
`</li>
`),
Q
);
})),
(C = C.replace(/¨0/g, "")),
m.gListLevel--,
E && (C = C.replace(/\s+$/, "")),
C
);
}
function k(C, E) {
if (E === "ol") {
var R = C.match(/^ *(\d+)\./);
if (R && R[1] !== "1") return ' start="' + R[1] + '"';
}
return "";
}
function _(C, E, R) {
var P = y.disableForced4SpacesIndentedSublists
? /^ ?\d+\.[ \t]/gm
: /^ {0,3}\d+\.[ \t]/gm,
L = y.disableForced4SpacesIndentedSublists
? /^ ?[*+-][ \t]/gm
: /^ {0,3}[*+-][ \t]/gm,
I = E === "ul" ? P : L,
M = "";
if (C.search(I) !== -1)
(function D(K) {
var ae = K.search(I),
Q = k(C, E);
ae !== -1
? ((M +=
`
<` +
E +
Q +
`>
` +
w(K.slice(0, ae), !!R) +
"</" +
E +
`>
`),
(E = E === "ul" ? "ol" : "ul"),
(I = E === "ul" ? P : L),
D(K.slice(ae)))
: (M +=
`
<` +
E +
Q +
`>
` +
w(K, !!R) +
"</" +
E +
`>
`);
})(C);
else {
var N = k(C, E);
M =
`
<` +
E +
N +
`>
` +
w(C, !!R) +
"</" +
E +
`>
`;
}
return M;
}
return (
(d = m.converter._dispatch("lists.before", d, y, m)),
(d += "\xA80"),
m.gListLevel
? (d = d.replace(
/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,
function (C, E, R) {
var P =
R.search(/[*+-]/g) > -1 ? "ul" : "ol";
return _(E, P, !0);
}
))
: (d = d.replace(
/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,
function (C, E, R, P) {
var L =
P.search(/[*+-]/g) > -1 ? "ul" : "ol";
return _(R, L, !1);
}
)),
(d = d.replace(/¨0/, "")),
(d = m.converter._dispatch("lists.after", d, y, m)),
d
);
}),
r.subParser("metadata", function (d, y, m) {
if (!y.metadata) return d;
d = m.converter._dispatch("metadata.before", d, y, m);
function w(k) {
(m.metadata.raw = k),
(k = k.replace(/&/g, "&amp;").replace(/"/g, "&quot;")),
(k = k.replace(/\n {4}/g, " ")),
k.replace(
/^([\S ]+): +([\s\S]+?)$/gm,
function (_, C, E) {
return (m.metadata.parsed[C] = E), "";
}
);
}
return (
(d = d.replace(
/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/,
function (k, _, C) {
return w(C), "\xA8M";
}
)),
(d = d.replace(
/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,
function (k, _, C) {
return _ && (m.metadata.format = _), w(C), "\xA8M";
}
)),
(d = d.replace(/¨M/g, "")),
(d = m.converter._dispatch("metadata.after", d, y, m)),
d
);
}),
r.subParser("outdent", function (d, y, m) {
return (
(d = m.converter._dispatch("outdent.before", d, y, m)),
(d = d.replace(/^(\t|[ ]{1,4})/gm, "\xA80")),
(d = d.replace(/¨0/g, "")),
(d = m.converter._dispatch("outdent.after", d, y, m)),
d
);
}),
r.subParser("paragraphs", function (d, y, m) {
(d = m.converter._dispatch("paragraphs.before", d, y, m)),
(d = d.replace(/^\n+/g, "")),
(d = d.replace(/\n+$/g, ""));
for (
var w = d.split(/\n{2,}/g), k = [], _ = w.length, C = 0;
C < _;
C++
) {
var E = w[C];
E.search(/¨(K|G)(\d+)\1/g) >= 0
? k.push(E)
: E.search(/\S/) >= 0 &&
((E = r.subParser("spanGamut")(E, y, m)),
(E = E.replace(/^([ \t]*)/g, "<p>")),
(E += "</p>"),
k.push(E));
}
for (_ = k.length, C = 0; C < _; C++) {
for (
var R = "", P = k[C], L = !1;
/¨(K|G)(\d+)\1/.test(P);
) {
var I = RegExp.$1,
M = RegExp.$2;
I === "K"
? (R = m.gHtmlBlocks[M])
: L
? (R = r.subParser("encodeCode")(
m.ghCodeBlocks[M].text,
y,
m
))
: (R = m.ghCodeBlocks[M].codeblock),
(R = R.replace(/\$/g, "$$$$")),
(P = P.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/, R)),
/^<pre\b[^>]*>\s*<code\b[^>]*>/.test(P) && (L = !0);
}
k[C] = P;
}
return (
(d = k.join(`
`)),
(d = d.replace(/^\n+/g, "")),
(d = d.replace(/\n+$/g, "")),
m.converter._dispatch("paragraphs.after", d, y, m)
);
}),
r.subParser("runExtension", function (d, y, m, w) {
if (d.filter) y = d.filter(y, w.converter, m);
else if (d.regex) {
var k = d.regex;
k instanceof RegExp || (k = new RegExp(k, "g")),
(y = y.replace(k, d.replace));
}
return y;
}),
r.subParser("spanGamut", function (d, y, m) {
return (
(d = m.converter._dispatch("spanGamut.before", d, y, m)),
(d = r.subParser("codeSpans")(d, y, m)),
(d = r.subParser("escapeSpecialCharsWithinTagAttributes")(
d,
y,
m
)),
(d = r.subParser("encodeBackslashEscapes")(d, y, m)),
(d = r.subParser("images")(d, y, m)),
(d = r.subParser("anchors")(d, y, m)),
(d = r.subParser("autoLinks")(d, y, m)),
(d = r.subParser("simplifiedAutoLinks")(d, y, m)),
(d = r.subParser("emoji")(d, y, m)),
(d = r.subParser("underline")(d, y, m)),
(d = r.subParser("italicsAndBold")(d, y, m)),
(d = r.subParser("strikethrough")(d, y, m)),
(d = r.subParser("ellipsis")(d, y, m)),
(d = r.subParser("hashHTMLSpans")(d, y, m)),
(d = r.subParser("encodeAmpsAndAngles")(d, y, m)),
y.simpleLineBreaks
? /\n\n¨K/.test(d) ||
(d = d.replace(
/\n+/g,
`<br />
`
))
: (d = d.replace(
/ +\n/g,
`<br />
`
)),
(d = m.converter._dispatch("spanGamut.after", d, y, m)),
d
);
}),
r.subParser("strikethrough", function (d, y, m) {
function w(k) {
return (
y.simplifiedAutoLink &&
(k = r.subParser("simplifiedAutoLinks")(k, y, m)),
"<del>" + k + "</del>"
);
}
return (
y.strikethrough &&
((d = m.converter._dispatch(
"strikethrough.before",
d,
y,
m
)),
(d = d.replace(
/(?:~){2}([\s\S]+?)(?:~){2}/g,
function (k, _) {
return w(_);
}
)),
(d = m.converter._dispatch(
"strikethrough.after",
d,
y,
m
))),
d
);
}),
r.subParser("stripLinkDefinitions", function (d, y, m) {
var w =
/^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*<?([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,
k =
/^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm;
d += "\xA80";
var _ = function (C, E, R, P, L, I, M) {
return (
(E = E.toLowerCase()),
d.toLowerCase().split(E).length - 1 < 2
? C
: (R.match(/^data:.+?\/.+?;base64,/)
? (m.gUrls[E] = R.replace(/\s/g, ""))
: (m.gUrls[E] = r.subParser(
"encodeAmpsAndAngles"
)(R, y, m)),
I
? I + M
: (M &&
(m.gTitles[E] = M.replace(
/"|'/g,
"&quot;"
)),
y.parseImgDimensions &&
P &&
L &&
(m.gDimensions[E] = {
width: P,
height: L,
}),
""))
);
};
return (
(d = d.replace(k, _)),
(d = d.replace(w, _)),
(d = d.replace(/¨0/, "")),
d
);
}),
r.subParser("tables", function (d, y, m) {
if (!y.tables) return d;
var w =
/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,
k =
/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm;
function _(L) {
return /^:[ \t]*--*$/.test(L)
? ' style="text-align:left;"'
: /^--*[ \t]*:[ \t]*$/.test(L)
? ' style="text-align:right;"'
: /^:[ \t]*--*[ \t]*:$/.test(L)
? ' style="text-align:center;"'
: "";
}
function C(L, I) {
var M = "";
return (
(L = L.trim()),
(y.tablesHeaderId || y.tableHeaderId) &&
(M =
' id="' +
L.replace(/ /g, "_").toLowerCase() +
'"'),
(L = r.subParser("spanGamut")(L, y, m)),
"<th" +
M +
I +
">" +
L +
`</th>
`
);
}
function E(L, I) {
var M = r.subParser("spanGamut")(L, y, m);
return (
"<td" +
I +
">" +
M +
`</td>
`
);
}
function R(L, I) {
for (
var M = `<table>
<thead>
<tr>
`,
N = L.length,
D = 0;
D < N;
++D
)
M += L[D];
for (
M += `</tr>
</thead>
<tbody>
`,
D = 0;
D < I.length;
++D
) {
M += `<tr>
`;
for (var K = 0; K < N; ++K) M += I[D][K];
M += `</tr>
`;
}
return (
(M += `</tbody>
</table>
`),
M
);
}
function P(L) {
var I,
M = L.split(`
`);
for (I = 0; I < M.length; ++I)
/^ {0,3}\|/.test(M[I]) &&
(M[I] = M[I].replace(/^ {0,3}\|/, "")),
/\|[ \t]*$/.test(M[I]) &&
(M[I] = M[I].replace(/\|[ \t]*$/, "")),
(M[I] = r.subParser("codeSpans")(M[I], y, m));
var N = M[0].split("|").map(function (Re) {
return Re.trim();
}),
D = M[1].split("|").map(function (Re) {
return Re.trim();
}),
K = [],
ae = [],
Q = [],
me = [];
for (M.shift(), M.shift(), I = 0; I < M.length; ++I)
M[I].trim() !== "" &&
K.push(
M[I].split("|").map(function (Re) {
return Re.trim();
})
);
if (N.length < D.length) return L;
for (I = 0; I < D.length; ++I) Q.push(_(D[I]));
for (I = 0; I < N.length; ++I)
r.helper.isUndefined(Q[I]) && (Q[I] = ""),
ae.push(C(N[I], Q[I]));
for (I = 0; I < K.length; ++I) {
for (var je = [], Le = 0; Le < ae.length; ++Le)
r.helper.isUndefined(K[I][Le]),
je.push(E(K[I][Le], Q[Le]));
me.push(je);
}
return R(ae, me);
}
return (
(d = m.converter._dispatch("tables.before", d, y, m)),
(d = d.replace(
/\\(\|)/g,
r.helper.escapeCharactersCallback
)),
(d = d.replace(w, P)),
(d = d.replace(k, P)),
(d = m.converter._dispatch("tables.after", d, y, m)),
d
);
}),
r.subParser("underline", function (d, y, m) {
return (
y.underline &&
((d = m.converter._dispatch(
"underline.before",
d,
y,
m
)),
y.literalMidWordUnderscores
? ((d = d.replace(
/\b___(\S[\s\S]*?)___\b/g,
function (w, k) {
return "<u>" + k + "</u>";
}
)),
(d = d.replace(
/\b__(\S[\s\S]*?)__\b/g,
function (w, k) {
return "<u>" + k + "</u>";
}
)))
: ((d = d.replace(
/___(\S[\s\S]*?)___/g,
function (w, k) {
return /\S$/.test(k)
? "<u>" + k + "</u>"
: w;
}
)),
(d = d.replace(
/__(\S[\s\S]*?)__/g,
function (w, k) {
return /\S$/.test(k)
? "<u>" + k + "</u>"
: w;
}
))),
(d = d.replace(
/(_)/g,
r.helper.escapeCharactersCallback
)),
(d = m.converter._dispatch(
"underline.after",
d,
y,
m
))),
d
);
}),
r.subParser("unescapeSpecialChars", function (d, y, m) {
return (
(d = m.converter._dispatch(
"unescapeSpecialChars.before",
d,
y,
m
)),
(d = d.replace(/¨E(\d+)E/g, function (w, k) {
var _ = parseInt(k);
return String.fromCharCode(_);
})),
(d = m.converter._dispatch(
"unescapeSpecialChars.after",
d,
y,
m
)),
d
);
}),
r.subParser("makeMarkdown.blockquote", function (d, y) {
var m = "";
if (d.hasChildNodes())
for (
var w = d.childNodes, k = w.length, _ = 0;
_ < k;
++_
) {
var C = r.subParser("makeMarkdown.node")(w[_], y);
C !== "" && (m += C);
}
return (
(m = m.trim()),
(m =
"> " +
m.split(`
`).join(`
> `)),
m
);
}),
r.subParser("makeMarkdown.codeBlock", function (d, y) {
var m = d.getAttribute("language"),
w = d.getAttribute("precodenum");
return (
"```" +
m +
`
` +
y.preList[w] +
"\n```"
);
}),
r.subParser("makeMarkdown.codeSpan", function (d) {
return "`" + d.innerHTML + "`";
}),
r.subParser("makeMarkdown.emphasis", function (d, y) {
var m = "";
if (d.hasChildNodes()) {
m += "*";
for (var w = d.childNodes, k = w.length, _ = 0; _ < k; ++_)
m += r.subParser("makeMarkdown.node")(w[_], y);
m += "*";
}
return m;
}),
r.subParser("makeMarkdown.header", function (d, y, m) {
var w = new Array(m + 1).join("#"),
k = "";
if (d.hasChildNodes()) {
k = w + " ";
for (var _ = d.childNodes, C = _.length, E = 0; E < C; ++E)
k += r.subParser("makeMarkdown.node")(_[E], y);
}
return k;
}),
r.subParser("makeMarkdown.hr", function () {
return "---";
}),
r.subParser("makeMarkdown.image", function (d) {
var y = "";
return (
d.hasAttribute("src") &&
((y += "![" + d.getAttribute("alt") + "]("),
(y += "<" + d.getAttribute("src") + ">"),
d.hasAttribute("width") &&
d.hasAttribute("height") &&
(y +=
" =" +
d.getAttribute("width") +
"x" +
d.getAttribute("height")),
d.hasAttribute("title") &&
(y += ' "' + d.getAttribute("title") + '"'),
(y += ")")),
y
);
}),
r.subParser("makeMarkdown.links", function (d, y) {
var m = "";
if (d.hasChildNodes() && d.hasAttribute("href")) {
var w = d.childNodes,
k = w.length;
m = "[";
for (var _ = 0; _ < k; ++_)
m += r.subParser("makeMarkdown.node")(w[_], y);
(m += "]("),
(m += "<" + d.getAttribute("href") + ">"),
d.hasAttribute("title") &&
(m += ' "' + d.getAttribute("title") + '"'),
(m += ")");
}
return m;
}),
r.subParser("makeMarkdown.list", function (d, y, m) {
var w = "";
if (!d.hasChildNodes()) return "";
for (
var k = d.childNodes,
_ = k.length,
C = d.getAttribute("start") || 1,
E = 0;
E < _;
++E
)
if (
!(
typeof k[E].tagName == "undefined" ||
k[E].tagName.toLowerCase() !== "li"
)
) {
var R = "";
m === "ol" ? (R = C.toString() + ". ") : (R = "- "),
(w +=
R +
r.subParser("makeMarkdown.listItem")(k[E], y)),
++C;
}
return (
(w += `
<!-- -->
`),
w.trim()
);
}),
r.subParser("makeMarkdown.listItem", function (d, y) {
for (
var m = "", w = d.childNodes, k = w.length, _ = 0;
_ < k;
++_
)
m += r.subParser("makeMarkdown.node")(w[_], y);
return (
/\n$/.test(m)
? (m = m
.split(
`
`
)
.join(
`
`
)
.replace(/^ {4}$/gm, "")
.replace(
/\n\n+/g,
`
`
))
: (m += `
`),
m
);
}),
r.subParser("makeMarkdown.node", function (d, y, m) {
m = m || !1;
var w = "";
if (d.nodeType === 3)
return r.subParser("makeMarkdown.txt")(d, y);
if (d.nodeType === 8)
return (
"<!--" +
d.data +
`-->
`
);
if (d.nodeType !== 1) return "";
var k = d.tagName.toLowerCase();
switch (k) {
case "h1":
m ||
(w =
r.subParser("makeMarkdown.header")(d, y, 1) +
`
`);
break;
case "h2":
m ||
(w =
r.subParser("makeMarkdown.header")(d, y, 2) +
`
`);
break;
case "h3":
m ||
(w =
r.subParser("makeMarkdown.header")(d, y, 3) +
`
`);
break;
case "h4":
m ||
(w =
r.subParser("makeMarkdown.header")(d, y, 4) +
`
`);
break;
case "h5":
m ||
(w =
r.subParser("makeMarkdown.header")(d, y, 5) +
`
`);
break;
case "h6":
m ||
(w =
r.subParser("makeMarkdown.header")(d, y, 6) +
`
`);
break;
case "p":
m ||
(w =
r.subParser("makeMarkdown.paragraph")(d, y) +
`
`);
break;
case "blockquote":
m ||
(w =
r.subParser("makeMarkdown.blockquote")(d, y) +
`
`);
break;
case "hr":
m ||
(w =
r.subParser("makeMarkdown.hr")(d, y) +
`
`);
break;
case "ol":
m ||
(w =
r.subParser("makeMarkdown.list")(d, y, "ol") +
`
`);
break;
case "ul":
m ||
(w =
r.subParser("makeMarkdown.list")(d, y, "ul") +
`
`);
break;
case "precode":
m ||
(w =
r.subParser("makeMarkdown.codeBlock")(d, y) +
`
`);
break;
case "pre":
m ||
(w =
r.subParser("makeMarkdown.pre")(d, y) +
`
`);
break;
case "table":
m ||
(w =
r.subParser("makeMarkdown.table")(d, y) +
`
`);
break;
case "code":
w = r.subParser("makeMarkdown.codeSpan")(d, y);
break;
case "em":
case "i":
w = r.subParser("makeMarkdown.emphasis")(d, y);
break;
case "strong":
case "b":
w = r.subParser("makeMarkdown.strong")(d, y);
break;
case "del":
w = r.subParser("makeMarkdown.strikethrough")(d, y);
break;
case "a":
w = r.subParser("makeMarkdown.links")(d, y);
break;
case "img":
w = r.subParser("makeMarkdown.image")(d, y);
break;
default:
w =
d.outerHTML +
`
`;
}
return w;
}),
r.subParser("makeMarkdown.paragraph", function (d, y) {
var m = "";
if (d.hasChildNodes())
for (var w = d.childNodes, k = w.length, _ = 0; _ < k; ++_)
m += r.subParser("makeMarkdown.node")(w[_], y);
return (m = m.trim()), m;
}),
r.subParser("makeMarkdown.pre", function (d, y) {
var m = d.getAttribute("prenum");
return "<pre>" + y.preList[m] + "</pre>";
}),
r.subParser("makeMarkdown.strikethrough", function (d, y) {
var m = "";
if (d.hasChildNodes()) {
m += "~~";
for (var w = d.childNodes, k = w.length, _ = 0; _ < k; ++_)
m += r.subParser("makeMarkdown.node")(w[_], y);
m += "~~";
}
return m;
}),
r.subParser("makeMarkdown.strong", function (d, y) {
var m = "";
if (d.hasChildNodes()) {
m += "**";
for (var w = d.childNodes, k = w.length, _ = 0; _ < k; ++_)
m += r.subParser("makeMarkdown.node")(w[_], y);
m += "**";
}
return m;
}),
r.subParser("makeMarkdown.table", function (d, y) {
var m = "",
w = [[], []],
k = d.querySelectorAll("thead>tr>th"),
_ = d.querySelectorAll("tbody>tr"),
C,
E;
for (C = 0; C < k.length; ++C) {
var R = r.subParser("makeMarkdown.tableCell")(k[C], y),
P = "---";
if (k[C].hasAttribute("style")) {
var L = k[C].getAttribute("style")
.toLowerCase()
.replace(/\s/g, "");
switch (L) {
case "text-align:left;":
P = ":---";
break;
case "text-align:right;":
P = "---:";
break;
case "text-align:center;":
P = ":---:";
break;
}
}
(w[0][C] = R.trim()), (w[1][C] = P);
}
for (C = 0; C < _.length; ++C) {
var I = w.push([]) - 1,
M = _[C].getElementsByTagName("td");
for (E = 0; E < k.length; ++E) {
var N = " ";
typeof M[E] != "undefined" &&
(N = r.subParser("makeMarkdown.tableCell")(
M[E],
y
)),
w[I].push(N);
}
}
var D = 3;
for (C = 0; C < w.length; ++C)
for (E = 0; E < w[C].length; ++E) {
var K = w[C][E].length;
K > D && (D = K);
}
for (C = 0; C < w.length; ++C) {
for (E = 0; E < w[C].length; ++E)
C === 1
? w[C][E].slice(-1) === ":"
? (w[C][E] =
r.helper.padEnd(
w[C][E].slice(-1),
D - 1,
"-"
) + ":")
: (w[C][E] = r.helper.padEnd(w[C][E], D, "-"))
: (w[C][E] = r.helper.padEnd(w[C][E], D));
m +=
"| " +
w[C].join(" | ") +
` |
`;
}
return m.trim();
}),
r.subParser("makeMarkdown.tableCell", function (d, y) {
var m = "";
if (!d.hasChildNodes()) return "";
for (var w = d.childNodes, k = w.length, _ = 0; _ < k; ++_)
m += r.subParser("makeMarkdown.node")(w[_], y, !0);
return m.trim();
}),
r.subParser("makeMarkdown.txt", function (d) {
var y = d.nodeValue;
return (
(y = y.replace(/ +/g, " ")),
(y = y.replace(/¨NBSP;/g, " ")),
(y = r.helper.unescapeHTMLEntities(y)),
(y = y.replace(/([*_~|`])/g, "\\$1")),
(y = y.replace(/^(\s*)>/g, "\\$1>")),
(y = y.replace(/^#/gm, "\\#")),
(y = y.replace(/^(\s*)([-=]{3,})(\s*)$/, "$1\\$2$3")),
(y = y.replace(/^( {0,3}\d+)\./gm, "$1\\.")),
(y = y.replace(/^( {0,3})([+-])/gm, "$1\\$2")),
(y = y.replace(/]([\s]*)\(/g, "\\]$1\\(")),
(y = y.replace(/^ {0,3}\[([\S \t]*?)]:/gm, "\\[$1]:")),
y
);
});
var T = this;
t.exports ? (t.exports = r) : (T.showdown = r);
}.call(D1));
})(by);
const qR = by.exports;
function wy(t, e = !0) {
let n = e ? "14px " : "",
r = t
.map((i) => {
let o = i.width || 1;
return typeof o == "number" ? o + "fr" : o;
})
.join(" ");
return n + r;
}
const Of = {
left: "justify-start",
start: "justify-start",
center: "justify-center",
middle: "justify-center",
right: "justify-end",
end: "justify-end",
},
H5 = {
__name: "ListHeaderItem",
props: { item: { type: Object, required: !0 } },
setup(t) {
return (e, n) => (
B(),
G(
"div",
{
class: ye([
"flex items-center space-x-2 text-base text-gray-600",
ne(Of)[t.item.align],
]),
},
[
_e(e.$slots, "prefix", Dt(Ft({ item: t.item }))),
U("div", null, Ge(t.item.label), 1),
_e(e.$slots, "suffix", Dt(Ft({ item: t.item }))),
],
2
)
);
},
},
F5 = {
__name: "ListHeader",
setup(t) {
const e = qe("list");
return (n, r) => (
B(),
G(
"div",
{
class: "mb-2 grid items-center space-x-4 rounded bg-gray-100 p-2",
style: Ir({
gridTemplateColumns: ne(wy)(
ne(e).columns,
ne(e).options.selectable
),
}),
},
[
ne(e).options.selectable
? (B(),
Be(
$a,
{
key: 0,
class: "cursor-pointer duration-300",
modelValue: ne(e).allRowsSelected,
onClick: _d(ne(e).toggleAllRows, [
"stop",
]),
},
null,
8,
["modelValue", "onClick"]
))
: De("", !0),
_e(n.$slots, "default", {}, () => [
(B(!0),
G(
He,
null,
wn(
ne(e).columns,
(i) => (
B(),
Be(
H5,
{ key: i.key, item: i },
null,
8,
["item"]
)
)
),
128
)),
]),
],
4
)
);
},
},
V5 = {
name: "Tooltip",
components: { Popover: qd },
props: {
hoverDelay: { default: 0.5 },
placement: { default: "top" },
text: { type: String, default: null },
},
},
W5 = {
key: 0,
class: "rounded bg-gray-900 px-2 py-1 text-xs text-white shadow-xl",
},
U5 = { class: "py-px" };
function K5(t, e, n, r, i, o) {
const s = ft("Popover");
return (
B(),
Be(
s,
{
trigger: "hover",
hoverDelay: n.hoverDelay,
placement: n.placement,
},
{
target: Te(() => [_e(t.$slots, "default")]),
body: Te(() => [
_e(t.$slots, "body", {}, () => [
n.text
? (B(), G("div", W5, [U("div", U5, Ge(n.text), 1)]))
: De("", !0),
]),
]),
_: 3,
},
8,
["hoverDelay", "placement"]
)
);
}
const q5 = Ue(V5, [["render", K5]]),
J5 = { class: "truncate text-base" },
G5 = {
__name: "ListRowItem",
props: {
item: { type: [String, Number, Object], default: "" },
align: { type: String, default: "left" },
},
setup(t) {
const e = t,
n = $(() => r(e.item).label || "");
function r(o) {
return o && typeof o == "object" ? o : { label: o };
}
const i = qe("list");
return (o, s) => (
B(),
Be(
mi(ne(i).options.showTooltip ? q5 : "div"),
yt(ne(i).options.showTooltip ? { text: n.value } : {}, {
class: ["flex items-center space-x-2", ne(Of)[t.align]],
}),
{
default: Te(() => [
_e(o.$slots, "prefix"),
_e(
o.$slots,
"default",
Dt(Ft({ label: n.value })),
() => [U("div", J5, Ge(n.value), 1)]
),
_e(o.$slots, "suffix"),
]),
_: 3,
},
16,
["class"]
)
);
},
},
Y5 = { key: 0, class: "mx-2 h-px border-t border-gray-200" },
Q5 = {
__name: "ListRow",
props: { row: { type: Object, required: !0 } },
setup(t) {
const e = t,
n = qe("list"),
r = $(() => {
var i;
return (i = n.value.rows) != null && i.length
? n.value.rows[n.value.rows.length - 1][
n.value.rowKey
] === e.row[n.value.rowKey]
: !1;
});
return (i, o) => (
B(),
Be(
mi(ne(n).options.getRowRoute ? "router-link" : "div"),
yt(
{
class: "flex cursor-pointer flex-col transition-all duration-300 ease-in-out",
},
ne(n).options.getRowRoute
? { to: ne(n).options.getRowRoute(t.row) }
: { onClick: () => ne(n).options.onRowClick(t.row) }
),
{
default: Te(() => [
(B(),
Be(
mi(
ne(n).options.getRowRoute
? "template"
: "button"
),
{ class: "[all:unset] hover:[all:unset]" },
{
default: Te(() => [
U(
"div",
{
class: ye([
"grid items-center space-x-4 rounded px-2 py-2.5",
ne(n).selections.has(
t.row[ne(n).rowKey]
)
? "bg-gray-100 hover:bg-gray-200"
: "hover:bg-gray-50",
]),
style: Ir({
gridTemplateColumns: ne(wy)(
ne(n).columns,
ne(n).options.selectable
),
}),
},
[
ne(n).options.selectable
? (B(),
Be(
$a,
{
key: 0,
modelValue: ne(
n
).selections.has(
t.row[
ne(n)
.rowKey
]
),
onClick:
o[0] ||
(o[0] = _d(
(s) =>
ne(
n
).toggleRow(
t
.row[
ne(
n
)
.rowKey
]
),
["stop"]
)),
class: "cursor-pointer duration-300",
},
null,
8,
["modelValue"]
))
: De("", !0),
(B(!0),
G(
He,
null,
wn(
ne(n).columns,
(s) => (
B(),
G(
"div",
{
key: s.key,
class: ye(
ne(Of)[
s
.align
]
),
},
[
_e(
i.$slots,
"default",
Dt(
Ft({
column: s,
item: t
.row[
s
.key
],
})
),
() => [
Me(
G5,
{
item: t
.row[
s
.key
],
align: s.align,
},
null,
8,
[
"item",
"align",
]
),
]
),
],
2
)
)
),
128
)),
],
6
),
r.value
? De("", !0)
: (B(), G("div", Y5)),
]),
_: 3,
}
)),
]),
_: 3,
},
16
)
);
},
},
X5 = { class: "h-full overflow-y-auto" },
Z5 = {
__name: "ListRows",
setup(t) {
const e = qe("list");
return (n, r) => (
B(),
G("div", X5, [
_e(n.$slots, "default", {}, () => [
(B(!0),
G(
He,
null,
wn(
ne(e).rows,
(i) => (
B(),
Be(
Q5,
{ key: i[ne(e).rowKey], row: i },
null,
8,
["row"]
)
)
),
128
)),
]),
])
);
},
},
e6 = {
key: 0,
class: "absolute inset-x-0 bottom-6 mx-auto w-max text-base",
},
t6 = {
class: "flex flex-1 justify-between border-r border-gray-300 text-gray-900",
},
n6 = { class: "flex items-center space-x-3" },
r6 = { class: "mr-3" },
i6 = { class: "flex items-center space-x-1" },
o6 = Object.assign(
{ inheritAttrs: !1 },
{
__name: "ListSelectBanner",
setup(t) {
const e = qe("list");
let n = $(() => {
let r = e.value.selections.size === 1 ? "Row" : "Rows";
return `${e.value.selections.size} ${r} selected`;
});
return (r, i) => (
B(),
Be(
Oa,
{
"enter-active-class": "duration-300 ease-out",
"enter-from-class": "transform opacity-0",
"enter-to-class": "opacity-100",
"leave-active-class": "duration-300 ease-in",
"leave-from-class": "opacity-100",
"leave-to-class": "transform opacity-0",
},
{
default: Te(() => [
ne(e).selections.size
? (B(),
G("div", e6, [
U(
"div",
{
class: ye([
"flex min-w-[596px] items-center space-x-3 rounded-lg bg-white px-4 py-2 shadow-2xl",
r.$attrs.class,
]),
},
[
_e(
r.$slots,
"default",
Dt(
Ft({
selections:
ne(e)
.selections,
allRowsSelected:
ne(e)
.allRowsSelected,
selectAll: () =>
ne(
e
).toggleAllRows(
!0
),
unselectAll:
() =>
ne(
e
).toggleAllRows(
!1
),
})
),
() => [
U("div", t6, [
U("div", n6, [
Me($a, {
modelValue:
!0,
disabled:
!0,
class: "text-gray-900",
}),
U(
"div",
null,
Ge(
ne(
n
)
),
1
),
]),
U("div", r6, [
_e(
r.$slots,
"actions",
Dt(
Ft({
selections:
ne(
e
)
.selections,
allRowsSelected:
ne(
e
)
.allRowsSelected,
selectAll:
() =>
ne(
e
).toggleAllRows(
!0
),
unselectAll:
() =>
ne(
e
).toggleAllRows(
!1
),
})
)
),
]),
]),
U("div", i6, [
Me(
vi,
{
class: ye(
[
"w- text-gray-700",
ne(
e
)
.allRowsSelected
? "cursor-not-allowed"
: "",
]
),
disabled:
ne(
e
)
.allRowsSelected,
variant:
"ghost",
onClick:
i[0] ||
(i[0] =
(
o
) =>
ne(
e
).toggleAllRows(
!0
)),
},
{
default:
Te(
() => [
Pn(
" Select all "
),
]
),
_: 1,
},
8,
[
"disabled",
"class",
]
),
Me(vi, {
icon: "x",
variant:
"ghost",
onClick:
i[1] ||
(i[1] =
(
o
) =>
ne(
e
).toggleAllRows(
!1
)),
}),
]),
]
),
],
2
),
]))
: De("", !0),
]),
_: 3,
}
)
);
},
}
),
s6 = { class: "relative flex w-full flex-1 flex-col overflow-x-auto" };
Object.assign(
{ inheritAttrs: !1 },
{
__name: "ListView",
props: {
columns: { type: Array, default: [] },
rows: { type: Array, default: [] },
rowKey: { type: String, required: !0 },
options: {
type: Object,
default: {
getRowRoute: null,
onRowClick: null,
showTooltip: !0,
selectable: !0,
},
},
},
setup(t) {
const e = t;
let n = Sn(new Set()),
r = $(() => {
function l(a) {
return a === void 0 ? !0 : a;
}
return {
getRowRoute: e.options.getRowRoute || null,
onRowClick: e.options.onRowClick || null,
showTooltip: l(e.options.showTooltip),
selectable: l(e.options.selectable),
};
});
const i = $(() => (e.rows.length ? n.size === e.rows.length : !1));
function o(l) {
n.delete(l) || n.add(l);
}
function s(l) {
if (!l || i.value) {
n.clear();
return;
}
e.rows.forEach((a) => n.add(a[e.rowKey]));
}
return (
kt(
"list",
$(() => ({
rowKey: e.rowKey,
rows: e.rows,
columns: e.columns,
options: r.value,
selections: n,
allRowsSelected: i.value,
toggleRow: o,
toggleAllRows: s,
}))
),
(l, a) => (
B(),
G("div", s6, [
U(
"div",
{
class: ye([
"flex w-max min-w-full flex-col overflow-y-hidden",
l.$attrs.class,
]),
},
[
_e(l.$slots, "default", {}, () => [
Me(F5),
Me(Z5),
ne(r).selectable
? (B(), Be(o6, { key: 0 }))
: De("", !0),
]),
],
2
),
])
)
);
},
}
);
oe([]);
let l6 = document.querySelector('link[rel="icon"]');
l6.href;
function xy(t) {
let e = Object.assign({}, t);
if (!e.url) throw new Error("[request] options.url is required");
e.transformRequest && (e = e.transformRequest(t)),
e.responseType || (e.responseType = "json"),
e.method || (e.method = "GET");
let n = e.url,
r;
if (e.params)
if (e.method === "GET") {
let i = new URLSearchParams();
for (let o in e.params) i.append(o, e.params[o]);
n = e.url + "?" + i.toString();
} else r = JSON.stringify(e.params);
return fetch(n, {
method: e.method || "GET",
headers: e.headers,
body: r,
}).then((i) => {
if (e.transformResponse) return e.transformResponse(i, e);
if (i.status >= 200 && i.status < 300)
return e.responseType === "json" ? i.json() : i;
{
let o = new Error(i.statusText);
throw ((o.response = i), o);
}
});
}
function Rf(t) {
return new Promise((e, n) => {
(t.oncomplete = t.onsuccess = () => e(t.result)),
(t.onabort = t.onerror = () => n(t.error));
});
}
function a6(t, e) {
const n = indexedDB.open(t);
n.onupgradeneeded = () => n.result.createObjectStore(e);
const r = Rf(n);
return (i, o) => r.then((s) => o(s.transaction(e, i).objectStore(e)));
}
let Wu;
function ky() {
return Wu || (Wu = a6("keyval-store", "keyval")), Wu;
}
function u6(t, e = ky()) {
return e("readonly", (n) => Rf(n.get(t)));
}
function c6(t, e, n = ky()) {
return n("readwrite", (r) => (r.put(e, t), Rf(r.transaction)));
}
function Pf(t, e) {
return typeof indexedDB == "undefined"
? Promise.resolve(null)
: t
? c6(t, JSON.stringify(e))
: Promise.resolve();
}
function Nf(t) {
return typeof indexedDB == "undefined"
? Promise.resolve(null)
: u6(t).then((e) => e && JSON.parse(e));
}
let Cy = {};
function JR(t, e) {
Cy[t] = e;
}
function Wn(t) {
return Cy[t] || null;
}
let pl = {};
function on(t, e) {
let n = null;
if (t.cache) {
n = po(t.cache);
let f = pl[n];
if (f) return f.auto && f.reload(), f;
}
typeof t == "string" && (t = { url: t, auto: !0 });
let r = t.debounce ? za(o, t.debounce) : o,
i = Sn({
method: t.method,
url: t.url,
data: t.initialData || null,
previousData: null,
loading: !1,
fetched: !1,
error: null,
promise: null,
auto: t.auto,
params: null,
fetch: r,
reload: r,
submit: r,
reset: l,
update: s,
setData: u,
});
function o(p) {
return cr(this, arguments, function* (f, h = {}) {
let g = t.resourceFetcher || Wn("resourceFetcher") || xy;
f instanceof Event && (f = null),
(f = f || i.params),
t.makeParams && (f = t.makeParams.call(e, f)),
(i.params = f),
(i.previousData = i.data
? JSON.parse(JSON.stringify(i.data))
: null),
(i.loading = !0),
(i.error = null),
t.onFetch && t.onFetch.call(e, i.params);
let v = [t.beforeSubmit, h.beforeSubmit];
for (let d of v) d && d.call(e, i.params);
let b = h.validate || t.validate,
x = [t.onError, h.onError],
S = [t.onSuccess, h.onSuccess],
T = [t.onData, h.onData];
if (b) {
let d;
try {
if (
((d = yield b.call(e, i.params)),
d && typeof d == "string")
)
throw new Error(d);
} catch (y) {
a(y, x);
return;
}
}
try {
i.promise = g(be(W({}, t), { params: f || t.params }));
let d = yield i.promise;
Pf(n, d), (i.data = c(d)), (i.fetched = !0);
for (let y of S) y && y.call(e, d);
for (let y of T) y && y.call(e, d);
} catch (d) {
a(d, x);
}
return (i.loading = !1), i.data;
});
}
function s({ method: f, url: h, params: p, auto: g }) {
f && f !== t.method && (i.method = f),
h && h !== t.url && (i.url = h),
p && p !== t.params && (i.params = p),
g !== void 0 && g !== i.auto && (i.auto = g);
}
function l() {
(i.data = t.initialData || null),
(i.previousData = null),
(i.loading = !1),
(i.fetched = !1),
(i.error = null),
(i.params = null),
(i.auto = t.auto);
}
function a(f, h) {
(i.loading = !1),
i.previousData && (i.data = i.previousData),
(i.error = f);
for (let p of h) p && p.call(e, f);
throw f;
}
function u(f) {
typeof f == "function" && (f = f.call(e, i.data)), (i.data = c(f));
}
function c(f) {
if (t.transform) {
let h = t.transform.call(e, f);
if (h != null) return h;
}
return f;
}
return (
n &&
!pl[n] &&
((pl[n] = i),
Nf(n).then((f) => {
var h;
(i.loading || !i.fetched) &&
f &&
(u(f), (h = t.onData) == null || h.call(e, f));
})),
t.auto && i.fetch(),
i
);
}
function po(t) {
return t ? (typeof t == "string" && (t = [t]), JSON.stringify(t)) : null;
}
function d6(t) {
return (t = po(t)), pl[t] || null;
}
function Sy(t, e, n) {
f6(t, e),
t.on("list_update", (r) => {
r.doctype == e && n(r.name);
});
}
let km = {};
function f6(t, e) {
km[e] || (t.emit("doctype_subscribe", e), (km[e] = !0));
}
let Yc = Sn({}),
Vi = {};
function h6(t, e) {
var x, S, T, d, y;
if (!t.doctype) throw new Error("List resource requires doctype");
let n = po(t.cache);
if (n) {
let m = Yc[n];
if (m) return m.auto && m.reload(), m;
}
let r = Wn("defaultListUrl") || "frappe.client.get_list",
i = Wn("defaultDocInsertUrl") || "frappe.client.insert",
o = Wn("defaultDocUpdateUrl") || "frappe.client.set_value",
s = Wn("defaultDocDeleteUrl") || "frappe.client.delete",
l = Wn("defaultRunDocMethodUrl") || "run_doc_method",
a = Sn({
doctype: t.doctype,
fields: t.fields,
filters: t.filters,
orderBy: t.orderBy,
start: t.start || 0,
pageLength: t.pageLength || 20,
groupBy: t.groupBy,
parent: t.parent,
debug: t.debug || 0,
originalData: null,
dataMap: {},
data: null,
previous: g,
hasPreviousPage: !1,
next: v,
hasNextPage: !0,
auto: t.auto,
list: on(
{
url: t.url || r,
makeParams() {
return {
doctype: a.doctype,
fields: a.fields,
filters: a.filters,
order_by: a.orderBy,
start: a.start,
limit: a.pageLength,
limit_start: a.start,
limit_page_length: a.pageLength,
group_by: a.groupBy,
parent: a.parent,
debug: a.debug,
};
},
onSuccess(m) {
var k;
(a.hasPreviousPage = !!a.start),
m.length < a.pageLength && (a.hasNextPage = !1);
let w;
!a.start || a.start == 0
? (w = m)
: a.start > 0 && (w = a.originalData.concat(m)),
Pf(n, w),
p(w),
(k = t.onSuccess) == null || k.call(e, a.data);
},
onError: t.onError,
},
e
),
fetchOne: on(
{
url: t.url || r,
makeParams(m) {
return {
doctype: a.doctype,
fields: a.fields || "*",
filters: { name: m },
};
},
onSuccess(m) {
var w, k;
if (m.length > 0 && a.originalData) {
let _ = m[0];
Wo(a.doctype, _);
}
(k = (w = t.fetchOne) == null ? void 0 : w.onSuccess) ==
null || k.call(e, a.data);
},
onError: (x = t.fetchOne) == null ? void 0 : x.onError,
},
e
),
insert: on(
{
url: i,
makeParams(m) {
return { doc: W({ doctype: a.doctype }, m) };
},
onSuccess(m) {
var w, k;
a.list.fetch(),
(k =
(w = t.insert) == null
? void 0
: w.onSuccess) == null || k.call(e, m);
},
onError: (S = t.insert) == null ? void 0 : S.onError,
},
e
),
setValue: on(
{
url: o,
makeParams(m) {
let _ = m,
{ name: w } = _,
k = Qe(_, ["name"]);
return { doctype: a.doctype, name: w, fieldname: k };
},
onSuccess(m) {
var w, k;
Wo(a.doctype, m),
(k =
(w = t.setValue) == null
? void 0
: w.onSuccess) == null || k.call(e, m);
},
onError: (T = t.setValue) == null ? void 0 : T.onError,
},
e
),
delete: on(
{
url: s,
makeParams(m) {
return { doctype: a.doctype, name: m };
},
onSuccess(m) {
var w, k;
a.list.fetch(),
(k =
(w = t.delete) == null
? void 0
: w.onSuccess) == null || k.call(e, m);
},
onError: (d = t.delete) == null ? void 0 : d.onError,
},
e
),
runDocMethod: on(
{
url: l,
makeParams(_) {
var C = _,
{ method: m, name: w } = C,
k = Qe(C, ["method", "name"]);
return {
dt: a.doctype,
dn: w,
method: m,
args: JSON.stringify(k),
};
},
onSuccess(m) {
var w, k;
if (m.docs) for (let _ of m.docs) Wo(_.doctype, _);
(k =
(w = t.runDocMethod) == null
? void 0
: w.onSuccess) == null || k.call(e, m);
},
onError: (y = t.runDocMethod) == null ? void 0 : y.onError,
},
e
),
update: u,
fetch: h,
reload: f,
setData: p,
transform: c,
getRow: b,
});
function u(m) {
Object.assign(a, m);
}
function c(m) {
if (t.transform) {
let w = t.transform.call(e, m);
if (w != null) return w;
}
return m;
}
function f() {
let m = a.start,
w = a.pageLength;
return (
a.start > 0 &&
((a.start = 0), (a.pageLength = a.originalData.length)),
a.list.fetch().finally(() => {
(a.start = m), (a.pageLength = w);
})
);
}
function h() {
f();
}
function p(m) {
if (
((a.originalData = m),
typeof m == "function" && (m = m.call(e, a.data)),
(a.data = c(m)),
Array.isArray(a.data))
) {
a.dataMap = {};
for (let w of a.data) {
if (!w.name) continue;
let k = w.name.toString();
a.dataMap[k] = w;
}
}
}
function g() {
(a.start = a.start - a.pageLength), a.list.fetch();
}
function v() {
(a.start = a.start + a.pageLength), a.list.fetch();
}
function b(m) {
let w = m.toString();
return a.dataMap[w];
}
return (
t.realtime &&
(e == null ? void 0 : e.$socket) &&
Sy(e.$socket, a.doctype, (m) => {
var w;
(w = a.originalData) != null &&
w.find((k) => k.name === m) &&
a.fetchOne.submit(m);
}),
n &&
((Yc[n] = a),
Nf(n).then((m) => {
var w;
(a.list.loading || !a.list.fetched) &&
m &&
(p(m), (w = t.onData) == null || w.call(e, m));
})),
t.auto && a.list.fetch(),
(Vi[a.doctype] = Vi[a.doctype] || []),
Vi[a.doctype].push(a),
a
);
}
function p6(t) {
return (t = po(t)), Yc[t] || null;
}
function Wo(t, e) {
if (!e.name) return;
let n = Vi[t] || [];
for (let r of n)
if (r.originalData) {
for (let i of r.originalData)
if (i.name && i.name == e.name) {
delete i._previousData;
let o = JSON.stringify(i);
for (let s in i) s in e && (i[s] = e[s]);
i._previousData = o;
}
r.data = r.transform(r.originalData);
}
}
function m6(t, e) {
let n = Vi[t] || [];
for (let r of n)
r.originalData &&
((r.originalData = r.originalData.filter(
(i) => i.name.toString() !== e.toString()
)),
(r.data = r.transform(r.originalData)));
}
function g6(t, e) {
let n = Vi[t] || [];
for (let r of n)
if (r.originalData) {
for (let i of r.originalData)
if (i.name && i.name == e.name) {
let o = JSON.parse(i._previousData);
for (let s in i) i[s] = o[s];
delete i._previousData;
}
r.data = r.transform(r.originalData);
}
}
let Qc = Sn({});
function y6(t, e) {
var g;
if (!(t.doctype && t.name)) return;
let n = po([t.doctype, t.name]),
r = Qc[n];
if (r) return r.auto && r.reload(), r;
let i = Wn("defaultDocGetUrl") || "frappe.client.get",
o = Wn("defaultDocUpdateUrl") || "frappe.client.set_value",
s = Wn("defaultDocDeleteUrl") || "frappe.client.delete",
l = Wn("defaultRunDocMethodUrl") || "run_doc_method",
a = {
url: o,
makeParams(b) {
return { doctype: c.doctype, name: c.name, fieldname: b };
},
beforeSubmit(b) {
(c.previousDoc = JSON.stringify(c.doc)),
Object.assign(c.doc, b.fieldname || {}),
Wo(c.doctype, c.doc);
},
onSuccess(b) {
var x, S;
(c.doc = p(b)),
(c.originalDoc = JSON.parse(JSON.stringify(c.doc))),
(S = (x = t.setValue) == null ? void 0 : x.onSuccess) ==
null || S.call(e, b);
},
onError(b) {
var x, S;
(c.doc = JSON.parse(c.previousDoc)),
(S = (x = t.setValue) == null ? void 0 : x.onError) ==
null || S.call(e, b),
g6(c.doctype, c.doc);
},
};
const u = t.auto !== void 0;
let c = Sn({
doctype: t.doctype,
name: t.name,
doc: null,
originalDoc: null,
isDirty: !1,
auto: u ? t.auto : !0,
get: on(
{
url: i,
makeParams() {
return { doctype: c.doctype, name: c.name };
},
onSuccess(b) {
var x;
Pf(n, b),
(c.doc = p(b)),
(c.originalDoc = JSON.parse(JSON.stringify(c.doc))),
(x = t.onSuccess) == null || x.call(e, c.doc);
},
onError: t.onError,
},
e
),
setValue: on(a, e),
setValueDebounced: on(be(W({}, a), { debounce: t.debounce || 500 }), e),
save: on(
be(W({}, a), {
makeParams() {
let b = JSON.parse(JSON.stringify(c.doc));
return (
delete b.doctype,
delete b.name,
{ doctype: c.doctype, name: c.name, fieldname: b }
);
},
}),
e
),
delete: on(
{
url: s,
makeParams() {
return { doctype: c.doctype, name: c.name };
},
onSuccess() {
var b, x;
(c.doc = null),
(x = (b = t.delete) == null ? void 0 : b.onSuccess) ==
null || x.call(e),
m6(c.doctype, c.name);
},
onError: (g = t.delete) == null ? void 0 : g.onError,
},
e
),
reload: f,
setDoc: h,
});
Rt(
() => c.doc,
() => {
c.isDirty = JSON.stringify(c.doc) !== JSON.stringify(c.originalDoc);
},
{ deep: !0 }
);
for (let b in t.whitelistedMethods) {
let x = t.whitelistedMethods[b];
typeof x == "string" && (x = { method: x });
let v = x,
{ method: S, onSuccess: T } = v,
d = Qe(v, ["method", "onSuccess"]);
c[b] = on(
W(
{
url: l,
makeParams(y) {
return {
dt: c.doctype,
dn: c.name,
method: S,
args: y,
};
},
onSuccess(y) {
if (y.docs) {
for (let m of y.docs)
if (
m.doctype === c.doctype &&
m.name.toString() === c.name.toString()
) {
(c.doc = p(m)), Wo(c.doctype, c.doc);
break;
}
}
T == null || T.call(e, y.message);
},
},
d
),
e
);
}
function f() {
return c.get.fetch();
}
function h(b) {
typeof b == "function" && (b = b.call(e, c.doc)), (c.doc = p(b));
}
function p(b) {
if (t.transform) {
let x = t.transform.call(e, b);
if (typeof x == "object") return x;
}
return b;
}
return (
t.realtime &&
e.$socket &&
Sy(e.$socket, c.doctype, (b) => {
b == c.name && c.get.fetch();
}),
(Qc[n] = c),
Nf(n).then((b) => {
(c.get.loading || !c.get.fetched) && b && (c.doc = p(b));
}),
c.auto && c.get.fetch(),
c
);
}
function v6(t, e) {
let n = po([t, e]);
return Qc[n] || null;
}
let b6 = (t) => ({
created() {
if (this.$options.resources) {
this._resources = Sn({});
for (let e in this.$options.resources) {
let n = this.$options.resources[e];
if (typeof n == "function")
Rt(
() => {
try {
return n.call(this);
} catch (r) {
return (
console.warn(
`Failed to get resource options
`,
r
),
null
);
}
},
(r, i) => {
!r ||
!(
!i ||
JSON.stringify(r) !== JSON.stringify(i)
) ||
(this._resources[e] = Cm(r, this));
},
{ immediate: !0 }
);
else {
let r = Cm(n, this);
this._resources[e] = r;
}
}
}
},
methods: {
$getResource(e) {
return d6(e);
},
$getDocumentResource(e, n) {
return v6(e, n);
},
$getDoc(e, n) {
let r = this.$getDocumentResource(e, n);
return r ? r.doc : null;
},
$getListResource(e) {
return p6(e);
},
$refetchResource(e) {
let n = this.$getResource(e);
n && n.fetch();
},
},
computed: {
$resources() {
return this._resources;
},
},
});
function Cm(t, e) {
return t.type === "document"
? y6(t, e)
: t.type === "list"
? h6(t, e)
: on(t, e);
}
const GR = {
install(t, e) {
let n = b6();
t.mixin(n);
},
};
function YR(t) {
return xy(
be(W({}, t), {
transformRequest: (e = {}) => {
if (!e.url)
throw new Error("[frappeRequest] options.url is required");
let n = Object.assign(
{
Accept: "application/json",
"Content-Type": "application/json; charset=utf-8",
"X-Frappe-Site-Name": window.location.hostname,
},
e.headers || {}
);
return (
window.csrf_token &&
window.csrf_token !== "{{ csrf_token }}" &&
(n["X-Frappe-CSRF-Token"] = window.csrf_token),
!e.url.startsWith("/") &&
!e.url.startsWith("http") &&
(e.url = "/api/method/" + e.url),
be(W({}, e), { method: e.method || "POST", headers: n })
);
},
transformResponse: (e, n) =>
cr(this, null, function* () {
let r = n.url;
if (e.ok) {
const i = yield e.json();
if (i.docs || r === "login") return i;
if (i.exc)
try {
console.groupCollapsed(r), console.log(n);
let o = JSON.parse(i.exc);
for (let s of o) console.log(s);
console.groupEnd();
} catch (o) {
console.warn(
"Error printing debug messages",
o
);
}
return i.message;
} else {
let i = yield e.text(),
o,
s;
try {
o = JSON.parse(i);
} catch (u) {}
let l = [
[n.url, o.exc_type, o._error_message]
.filter(Boolean)
.join(" "),
];
if (o.exc) {
s = o.exc;
try {
(s = JSON.parse(s)[0]), console.log(s);
} catch (u) {}
}
let a = new Error(
l.join(`
`)
);
throw (
((a.exc_type = o.exc_type),
(a.exc = s),
(a.response = e),
(a.status = i.status),
(a.messages = o._server_messages
? JSON.parse(o._server_messages)
: []),
(a.messages = a.messages.concat(o.message)),
(a.messages = a.messages.map((u) => {
try {
return JSON.parse(u).message;
} catch (c) {
return u;
}
})),
(a.messages = a.messages.filter(Boolean)),
a.messages.length ||
(a.messages = o._error_message
? [o._error_message]
: ["Internal Server Error"]),
n.onError && n.onError(a),
a)
);
}
}),
})
);
}
const Xn = Object.create(null);
Xn.open = "0";
Xn.close = "1";
Xn.ping = "2";
Xn.pong = "3";
Xn.message = "4";
Xn.upgrade = "5";
Xn.noop = "6";
const ml = Object.create(null);
Object.keys(Xn).forEach((t) => {
ml[Xn[t]] = t;
});
const Xc = { type: "error", data: "parser error" },
_y =
typeof Blob == "function" ||
(typeof Blob != "undefined" &&
Object.prototype.toString.call(Blob) ===
"[object BlobConstructor]"),
My = typeof ArrayBuffer == "function",
Ey = (t) =>
typeof ArrayBuffer.isView == "function"
? ArrayBuffer.isView(t)
: t && t.buffer instanceof ArrayBuffer,
jf = ({ type: t, data: e }, n, r) =>
_y && e instanceof Blob
? n
? r(e)
: Sm(e, r)
: My && (e instanceof ArrayBuffer || Ey(e))
? n
? r(e)
: Sm(new Blob([e]), r)
: r(Xn[t] + (e || "")),
Sm = (t, e) => {
const n = new FileReader();
return (
(n.onload = function () {
const r = n.result.split(",")[1];
e("b" + (r || ""));
}),
n.readAsDataURL(t)
);
};
function _m(t) {
return t instanceof Uint8Array
? t
: t instanceof ArrayBuffer
? new Uint8Array(t)
: new Uint8Array(t.buffer, t.byteOffset, t.byteLength);
}
let Uu;
function w6(t, e) {
if (_y && t.data instanceof Blob)
return t.data.arrayBuffer().then(_m).then(e);
if (My && (t.data instanceof ArrayBuffer || Ey(t.data)))
return e(_m(t.data));
jf(t, !1, (n) => {
Uu || (Uu = new TextEncoder()), e(Uu.encode(n));
});
}
const Mm = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
Ao = typeof Uint8Array == "undefined" ? [] : new Uint8Array(256);
for (let t = 0; t < Mm.length; t++) Ao[Mm.charCodeAt(t)] = t;
const x6 = (t) => {
let e = t.length * 0.75,
n = t.length,
r,
i = 0,
o,
s,
l,
a;
t[t.length - 1] === "=" && (e--, t[t.length - 2] === "=" && e--);
const u = new ArrayBuffer(e),
c = new Uint8Array(u);
for (r = 0; r < n; r += 4)
(o = Ao[t.charCodeAt(r)]),
(s = Ao[t.charCodeAt(r + 1)]),
(l = Ao[t.charCodeAt(r + 2)]),
(a = Ao[t.charCodeAt(r + 3)]),
(c[i++] = (o << 2) | (s >> 4)),
(c[i++] = ((s & 15) << 4) | (l >> 2)),
(c[i++] = ((l & 3) << 6) | (a & 63));
return u;
},
k6 = typeof ArrayBuffer == "function",
Lf = (t, e) => {
if (typeof t != "string") return { type: "message", data: Ay(t, e) };
const n = t.charAt(0);
return n === "b"
? { type: "message", data: C6(t.substring(1), e) }
: ml[n]
? t.length > 1
? { type: ml[n], data: t.substring(1) }
: { type: ml[n] }
: Xc;
},
C6 = (t, e) => {
if (k6) {
const n = x6(t);
return Ay(n, e);
} else return { base64: !0, data: t };
},
Ay = (t, e) => {
switch (e) {
case "blob":
return t instanceof Blob ? t : new Blob([t]);
case "arraybuffer":
default:
return t instanceof ArrayBuffer ? t : t.buffer;
}
},
Ty = String.fromCharCode(30),
S6 = (t, e) => {
const n = t.length,
r = new Array(n);
let i = 0;
t.forEach((o, s) => {
jf(o, !1, (l) => {
(r[s] = l), ++i === n && e(r.join(Ty));
});
});
},
_6 = (t, e) => {
const n = t.split(Ty),
r = [];
for (let i = 0; i < n.length; i++) {
const o = Lf(n[i], e);
if ((r.push(o), o.type === "error")) break;
}
return r;
};
function M6() {
return new TransformStream({
transform(t, e) {
w6(t, (n) => {
const r = n.length;
let i;
if (r < 126)
(i = new Uint8Array(1)),
new DataView(i.buffer).setUint8(0, r);
else if (r < 65536) {
i = new Uint8Array(3);
const o = new DataView(i.buffer);
o.setUint8(0, 126), o.setUint16(1, r);
} else {
i = new Uint8Array(9);
const o = new DataView(i.buffer);
o.setUint8(0, 127), o.setBigUint64(1, BigInt(r));
}
t.data && typeof t.data != "string" && (i[0] |= 128),
e.enqueue(i),
e.enqueue(n);
});
},
});
}
let Ku;
function el(t) {
return t.reduce((e, n) => e + n.length, 0);
}
function tl(t, e) {
if (t[0].length === e) return t.shift();
const n = new Uint8Array(e);
let r = 0;
for (let i = 0; i < e; i++)
(n[i] = t[0][r++]), r === t[0].length && (t.shift(), (r = 0));
return t.length && r < t[0].length && (t[0] = t[0].slice(r)), n;
}
function E6(t, e) {
Ku || (Ku = new TextDecoder());
const n = [];
let r = 0,
i = -1,
o = !1;
return new TransformStream({
transform(s, l) {
for (n.push(s); ; ) {
if (r === 0) {
if (el(n) < 1) break;
const a = tl(n, 1);
(o = (a[0] & 128) === 128),
(i = a[0] & 127),
i < 126 ? (r = 3) : i === 126 ? (r = 1) : (r = 2);
} else if (r === 1) {
if (el(n) < 2) break;
const a = tl(n, 2);
(i = new DataView(
a.buffer,
a.byteOffset,
a.length
).getUint16(0)),
(r = 3);
} else if (r === 2) {
if (el(n) < 8) break;
const a = tl(n, 8),
u = new DataView(a.buffer, a.byteOffset, a.length),
c = u.getUint32(0);
if (c > Math.pow(2, 53 - 32) - 1) {
l.enqueue(Xc);
break;
}
(i = c * Math.pow(2, 32) + u.getUint32(4)), (r = 3);
} else {
if (el(n) < i) break;
const a = tl(n, i);
l.enqueue(Lf(o ? a : Ku.decode(a), e)), (r = 0);
}
if (i === 0 || i > t) {
l.enqueue(Xc);
break;
}
}
},
});
}
const Oy = 4;
function xt(t) {
if (t) return A6(t);
}
function A6(t) {
for (var e in xt.prototype) t[e] = xt.prototype[e];
return t;
}
xt.prototype.on = xt.prototype.addEventListener = function (t, e) {
return (
(this._callbacks = this._callbacks || {}),
(this._callbacks["$" + t] = this._callbacks["$" + t] || []).push(e),
this
);
};
xt.prototype.once = function (t, e) {
function n() {
this.off(t, n), e.apply(this, arguments);
}
return (n.fn = e), this.on(t, n), this;
};
xt.prototype.off =
xt.prototype.removeListener =
xt.prototype.removeAllListeners =
xt.prototype.removeEventListener =
function (t, e) {
if (
((this._callbacks = this._callbacks || {}),
arguments.length == 0)
)
return (this._callbacks = {}), this;
var n = this._callbacks["$" + t];
if (!n) return this;
if (arguments.length == 1)
return delete this._callbacks["$" + t], this;
for (var r, i = 0; i < n.length; i++)
if (((r = n[i]), r === e || r.fn === e)) {
n.splice(i, 1);
break;
}
return n.length === 0 && delete this._callbacks["$" + t], this;
};
xt.prototype.emit = function (t) {
this._callbacks = this._callbacks || {};
for (
var e = new Array(arguments.length - 1),
n = this._callbacks["$" + t],
r = 1;
r < arguments.length;
r++
)
e[r - 1] = arguments[r];
if (n) {
n = n.slice(0);
for (var r = 0, i = n.length; r < i; ++r) n[r].apply(this, e);
}
return this;
};
xt.prototype.emitReserved = xt.prototype.emit;
xt.prototype.listeners = function (t) {
return (
(this._callbacks = this._callbacks || {}),
this._callbacks["$" + t] || []
);
};
xt.prototype.hasListeners = function (t) {
return !!this.listeners(t).length;
};
const pn = (() =>
typeof self != "undefined"
? self
: typeof window != "undefined"
? window
: Function("return this")())();
function Ry(t, ...e) {
return e.reduce((n, r) => (t.hasOwnProperty(r) && (n[r] = t[r]), n), {});
}
const T6 = pn.setTimeout,
O6 = pn.clearTimeout;
function Ga(t, e) {
e.useNativeTimers
? ((t.setTimeoutFn = T6.bind(pn)), (t.clearTimeoutFn = O6.bind(pn)))
: ((t.setTimeoutFn = pn.setTimeout.bind(pn)),
(t.clearTimeoutFn = pn.clearTimeout.bind(pn)));
}
const R6 = 1.33;
function P6(t) {
return typeof t == "string"
? N6(t)
: Math.ceil((t.byteLength || t.size) * R6);
}
function N6(t) {
let e = 0,
n = 0;
for (let r = 0, i = t.length; r < i; r++)
(e = t.charCodeAt(r)),
e < 128
? (n += 1)
: e < 2048
? (n += 2)
: e < 55296 || e >= 57344
? (n += 3)
: (r++, (n += 4));
return n;
}
function j6(t) {
let e = "";
for (let n in t)
t.hasOwnProperty(n) &&
(e.length && (e += "&"),
(e += encodeURIComponent(n) + "=" + encodeURIComponent(t[n])));
return e;
}
function L6(t) {
let e = {},
n = t.split("&");
for (let r = 0, i = n.length; r < i; r++) {
let o = n[r].split("=");
e[decodeURIComponent(o[0])] = decodeURIComponent(o[1]);
}
return e;
}
class D6 extends Error {
constructor(e, n, r) {
super(e),
(this.description = n),
(this.context = r),
(this.type = "TransportError");
}
}
class Df extends xt {
constructor(e) {
super(),
(this.writable = !1),
Ga(this, e),
(this.opts = e),
(this.query = e.query),
(this.socket = e.socket);
}
onError(e, n, r) {
return super.emitReserved("error", new D6(e, n, r)), this;
}
open() {
return (this.readyState = "opening"), this.doOpen(), this;
}
close() {
return (
(this.readyState === "opening" || this.readyState === "open") &&
(this.doClose(), this.onClose()),
this
);
}
send(e) {
this.readyState === "open" && this.write(e);
}
onOpen() {
(this.readyState = "open"),
(this.writable = !0),
super.emitReserved("open");
}
onData(e) {
const n = Lf(e, this.socket.binaryType);
this.onPacket(n);
}
onPacket(e) {
super.emitReserved("packet", e);
}
onClose(e) {
(this.readyState = "closed"), super.emitReserved("close", e);
}
pause(e) {}
createUri(e, n = {}) {
return (
e +
"://" +
this._hostname() +
this._port() +
this.opts.path +
this._query(n)
);
}
_hostname() {
const e = this.opts.hostname;
return e.indexOf(":") === -1 ? e : "[" + e + "]";
}
_port() {
return this.opts.port &&
((this.opts.secure && Number(this.opts.port !== 443)) ||
(!this.opts.secure && Number(this.opts.port) !== 80))
? ":" + this.opts.port
: "";
}
_query(e) {
const n = j6(e);
return n.length ? "?" + n : "";
}
}
const Py =
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(
""
),
Zc = 64,
I6 = {};
let Em = 0,
nl = 0,
Am;
function Tm(t) {
let e = "";
do (e = Py[t % Zc] + e), (t = Math.floor(t / Zc));
while (t > 0);
return e;
}
function Ny() {
const t = Tm(+new Date());
return t !== Am ? ((Em = 0), (Am = t)) : t + "." + Tm(Em++);
}
for (; nl < Zc; nl++) I6[Py[nl]] = nl;
let jy = !1;
try {
jy =
typeof XMLHttpRequest != "undefined" &&
"withCredentials" in new XMLHttpRequest();
} catch (t) {}
const B6 = jy;
function Ly(t) {
const e = t.xdomain;
try {
if (typeof XMLHttpRequest != "undefined" && (!e || B6))
return new XMLHttpRequest();
} catch (n) {}
if (!e)
try {
return new pn[["Active"].concat("Object").join("X")](
"Microsoft.XMLHTTP"
);
} catch (n) {}
}
function $6() {}
const z6 = (function () {
return new Ly({ xdomain: !1 }).responseType != null;
})();
class H6 extends Df {
constructor(e) {
if ((super(e), (this.polling = !1), typeof location != "undefined")) {
const r = location.protocol === "https:";
let i = location.port;
i || (i = r ? "443" : "80"),
(this.xd =
(typeof location != "undefined" &&
e.hostname !== location.hostname) ||
i !== e.port);
}
const n = e && e.forceBase64;
(this.supportsBinary = z6 && !n),
this.opts.withCredentials && (this.cookieJar = void 0);
}
get name() {
return "polling";
}
doOpen() {
this.poll();
}
pause(e) {
this.readyState = "pausing";
const n = () => {
(this.readyState = "paused"), e();
};
if (this.polling || !this.writable) {
let r = 0;
this.polling &&
(r++,
this.once("pollComplete", function () {
--r || n();
})),
this.writable ||
(r++,
this.once("drain", function () {
--r || n();
}));
} else n();
}
poll() {
(this.polling = !0), this.doPoll(), this.emitReserved("poll");
}
onData(e) {
const n = (r) => {
if (
(this.readyState === "opening" &&
r.type === "open" &&
this.onOpen(),
r.type === "close")
)
return (
this.onClose({
description: "transport closed by the server",
}),
!1
);
this.onPacket(r);
};
_6(e, this.socket.binaryType).forEach(n),
this.readyState !== "closed" &&
((this.polling = !1),
this.emitReserved("pollComplete"),
this.readyState === "open" && this.poll());
}
doClose() {
const e = () => {
this.write([{ type: "close" }]);
};
this.readyState === "open" ? e() : this.once("open", e);
}
write(e) {
(this.writable = !1),
S6(e, (n) => {
this.doWrite(n, () => {
(this.writable = !0), this.emitReserved("drain");
});
});
}
uri() {
const e = this.opts.secure ? "https" : "http",
n = this.query || {};
return (
this.opts.timestampRequests !== !1 &&
(n[this.opts.timestampParam] = Ny()),
!this.supportsBinary && !n.sid && (n.b64 = 1),
this.createUri(e, n)
);
}
request(e = {}) {
return (
Object.assign(
e,
{ xd: this.xd, cookieJar: this.cookieJar },
this.opts
),
new qn(this.uri(), e)
);
}
doWrite(e, n) {
const r = this.request({ method: "POST", data: e });
r.on("success", n),
r.on("error", (i, o) => {
this.onError("xhr post error", i, o);
});
}
doPoll() {
const e = this.request();
e.on("data", this.onData.bind(this)),
e.on("error", (n, r) => {
this.onError("xhr poll error", n, r);
}),
(this.pollXhr = e);
}
}
class qn extends xt {
constructor(e, n) {
super(),
Ga(this, n),
(this.opts = n),
(this.method = n.method || "GET"),
(this.uri = e),
(this.data = n.data !== void 0 ? n.data : null),
this.create();
}
create() {
var e;
const n = Ry(
this.opts,
"agent",
"pfx",
"key",
"passphrase",
"cert",
"ca",
"ciphers",
"rejectUnauthorized",
"autoUnref"
);
n.xdomain = !!this.opts.xd;
const r = (this.xhr = new Ly(n));
try {
r.open(this.method, this.uri, !0);
try {
if (this.opts.extraHeaders) {
r.setDisableHeaderCheck && r.setDisableHeaderCheck(!0);
for (let i in this.opts.extraHeaders)
this.opts.extraHeaders.hasOwnProperty(i) &&
r.setRequestHeader(i, this.opts.extraHeaders[i]);
}
} catch (i) {}
if (this.method === "POST")
try {
r.setRequestHeader(
"Content-type",
"text/plain;charset=UTF-8"
);
} catch (i) {}
try {
r.setRequestHeader("Accept", "*/*");
} catch (i) {}
(e = this.opts.cookieJar) === null ||
e === void 0 ||
e.addCookies(r),
"withCredentials" in r &&
(r.withCredentials = this.opts.withCredentials),
this.opts.requestTimeout &&
(r.timeout = this.opts.requestTimeout),
(r.onreadystatechange = () => {
var i;
r.readyState === 3 &&
((i = this.opts.cookieJar) === null ||
i === void 0 ||
i.parseCookies(r)),
r.readyState === 4 &&
(r.status === 200 || r.status === 1223
? this.onLoad()
: this.setTimeoutFn(() => {
this.onError(
typeof r.status == "number"
? r.status
: 0
);
}, 0));
}),
r.send(this.data);
} catch (i) {
this.setTimeoutFn(() => {
this.onError(i);
}, 0);
return;
}
typeof document != "undefined" &&
((this.index = qn.requestsCount++),
(qn.requests[this.index] = this));
}
onError(e) {
this.emitReserved("error", e, this.xhr), this.cleanup(!0);
}
cleanup(e) {
if (!(typeof this.xhr == "undefined" || this.xhr === null)) {
if (((this.xhr.onreadystatechange = $6), e))
try {
this.xhr.abort();
} catch (n) {}
typeof document != "undefined" && delete qn.requests[this.index],
(this.xhr = null);
}
}
onLoad() {
const e = this.xhr.responseText;
e !== null &&
(this.emitReserved("data", e),
this.emitReserved("success"),
this.cleanup());
}
abort() {
this.cleanup();
}
}
qn.requestsCount = 0;
qn.requests = {};
if (typeof document != "undefined") {
if (typeof attachEvent == "function") attachEvent("onunload", Om);
else if (typeof addEventListener == "function") {
const t = "onpagehide" in pn ? "pagehide" : "unload";
addEventListener(t, Om, !1);
}
}
function Om() {
for (let t in qn.requests)
qn.requests.hasOwnProperty(t) && qn.requests[t].abort();
}
const If = (() =>
typeof Promise == "function" && typeof Promise.resolve == "function"
? (e) => Promise.resolve().then(e)
: (e, n) => n(e, 0))(),
rl = pn.WebSocket || pn.MozWebSocket,
Rm = !0,
F6 = "arraybuffer",
Pm =
typeof navigator != "undefined" &&
typeof navigator.product == "string" &&
navigator.product.toLowerCase() === "reactnative";
class V6 extends Df {
constructor(e) {
super(e), (this.supportsBinary = !e.forceBase64);
}
get name() {
return "websocket";
}
doOpen() {
if (!this.check()) return;
const e = this.uri(),
n = this.opts.protocols,
r = Pm
? {}
: Ry(
this.opts,
"agent",
"perMessageDeflate",
"pfx",
"key",
"passphrase",
"cert",
"ca",
"ciphers",
"rejectUnauthorized",
"localAddress",
"protocolVersion",
"origin",
"maxPayload",
"family",
"checkServerIdentity"
);
this.opts.extraHeaders && (r.headers = this.opts.extraHeaders);
try {
this.ws =
Rm && !Pm ? (n ? new rl(e, n) : new rl(e)) : new rl(e, n, r);
} catch (i) {
return this.emitReserved("error", i);
}
(this.ws.binaryType = this.socket.binaryType), this.addEventListeners();
}
addEventListeners() {
(this.ws.onopen = () => {
this.opts.autoUnref && this.ws._socket.unref(), this.onOpen();
}),
(this.ws.onclose = (e) =>
this.onClose({
description: "websocket connection closed",
context: e,
})),
(this.ws.onmessage = (e) => this.onData(e.data)),
(this.ws.onerror = (e) => this.onError("websocket error", e));
}
write(e) {
this.writable = !1;
for (let n = 0; n < e.length; n++) {
const r = e[n],
i = n === e.length - 1;
jf(r, this.supportsBinary, (o) => {
const s = {};
try {
Rm && this.ws.send(o);
} catch (l) {}
i &&
If(() => {
(this.writable = !0), this.emitReserved("drain");
}, this.setTimeoutFn);
});
}
}
doClose() {
typeof this.ws != "undefined" && (this.ws.close(), (this.ws = null));
}
uri() {
const e = this.opts.secure ? "wss" : "ws",
n = this.query || {};
return (
this.opts.timestampRequests && (n[this.opts.timestampParam] = Ny()),
this.supportsBinary || (n.b64 = 1),
this.createUri(e, n)
);
}
check() {
return !!rl;
}
}
class W6 extends Df {
get name() {
return "webtransport";
}
doOpen() {
typeof WebTransport == "function" &&
((this.transport = new WebTransport(
this.createUri("https"),
this.opts.transportOptions[this.name]
)),
this.transport.closed
.then(() => {
this.onClose();
})
.catch((e) => {
this.onError("webtransport error", e);
}),
this.transport.ready.then(() => {
this.transport.createBidirectionalStream().then((e) => {
const n = E6(
Number.MAX_SAFE_INTEGER,
this.socket.binaryType
),
r = e.readable.pipeThrough(n).getReader(),
i = M6();
i.readable.pipeTo(e.writable),
(this.writer = i.writable.getWriter());
const o = () => {
r.read()
.then(({ done: l, value: a }) => {
l || (this.onPacket(a), o());
})
.catch((l) => {});
};
o();
const s = { type: "open" };
this.query.sid && (s.data = `{"sid":"${this.query.sid}"}`),
this.writer.write(s).then(() => this.onOpen());
});
}));
}
write(e) {
this.writable = !1;
for (let n = 0; n < e.length; n++) {
const r = e[n],
i = n === e.length - 1;
this.writer.write(r).then(() => {
i &&
If(() => {
(this.writable = !0), this.emitReserved("drain");
}, this.setTimeoutFn);
});
}
}
doClose() {
var e;
(e = this.transport) === null || e === void 0 || e.close();
}
}
const U6 = { websocket: V6, webtransport: W6, polling: H6 },
K6 =
/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,
q6 = [
"source",
"protocol",
"authority",
"userInfo",
"user",
"password",
"host",
"port",
"relative",
"path",
"directory",
"file",
"query",
"anchor",
];
function ed(t) {
if (t.length > 2e3) throw "URI too long";
const e = t,
n = t.indexOf("["),
r = t.indexOf("]");
n != -1 &&
r != -1 &&
(t =
t.substring(0, n) +
t.substring(n, r).replace(/:/g, ";") +
t.substring(r, t.length));
let i = K6.exec(t || ""),
o = {},
s = 14;
for (; s--; ) o[q6[s]] = i[s] || "";
return (
n != -1 &&
r != -1 &&
((o.source = e),
(o.host = o.host
.substring(1, o.host.length - 1)
.replace(/;/g, ":")),
(o.authority = o.authority
.replace("[", "")
.replace("]", "")
.replace(/;/g, ":")),
(o.ipv6uri = !0)),
(o.pathNames = J6(o, o.path)),
(o.queryKey = G6(o, o.query)),
o
);
}
function J6(t, e) {
const n = /\/{2,9}/g,
r = e.replace(n, "/").split("/");
return (
(e.slice(0, 1) == "/" || e.length === 0) && r.splice(0, 1),
e.slice(-1) == "/" && r.splice(r.length - 1, 1),
r
);
}
function G6(t, e) {
const n = {};
return (
e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g, function (r, i, o) {
i && (n[i] = o);
}),
n
);
}
class Sr extends xt {
constructor(e, n = {}) {
super(),
(this.binaryType = F6),
(this.writeBuffer = []),
e && typeof e == "object" && ((n = e), (e = null)),
e
? ((e = ed(e)),
(n.hostname = e.host),
(n.secure = e.protocol === "https" || e.protocol === "wss"),
(n.port = e.port),
e.query && (n.query = e.query))
: n.host && (n.hostname = ed(n.host).host),
Ga(this, n),
(this.secure =
n.secure != null
? n.secure
: typeof location != "undefined" &&
location.protocol === "https:"),
n.hostname && !n.port && (n.port = this.secure ? "443" : "80"),
(this.hostname =
n.hostname ||
(typeof location != "undefined"
? location.hostname
: "localhost")),
(this.port =
n.port ||
(typeof location != "undefined" && location.port
? location.port
: this.secure
? "443"
: "80")),
(this.transports = n.transports || [
"polling",
"websocket",
"webtransport",
]),
(this.writeBuffer = []),
(this.prevBufferLen = 0),
(this.opts = Object.assign(
{
path: "/engine.io",
agent: !1,
withCredentials: !1,
upgrade: !0,
timestampParam: "t",
rememberUpgrade: !1,
addTrailingSlash: !0,
rejectUnauthorized: !0,
perMessageDeflate: { threshold: 1024 },
transportOptions: {},
closeOnBeforeunload: !1,
},
n
)),
(this.opts.path =
this.opts.path.replace(/\/$/, "") +
(this.opts.addTrailingSlash ? "/" : "")),
typeof this.opts.query == "string" &&
(this.opts.query = L6(this.opts.query)),
(this.id = null),
(this.upgrades = null),
(this.pingInterval = null),
(this.pingTimeout = null),
(this.pingTimeoutTimer = null),
typeof addEventListener == "function" &&
(this.opts.closeOnBeforeunload &&
((this.beforeunloadEventListener = () => {
this.transport &&
(this.transport.removeAllListeners(),
this.transport.close());
}),
addEventListener(
"beforeunload",
this.beforeunloadEventListener,
!1
)),
this.hostname !== "localhost" &&
((this.offlineEventListener = () => {
this.onClose("transport close", {
description: "network connection lost",
});
}),
addEventListener(
"offline",
this.offlineEventListener,
!1
))),
this.open();
}
createTransport(e) {
const n = Object.assign({}, this.opts.query);
(n.EIO = Oy), (n.transport = e), this.id && (n.sid = this.id);
const r = Object.assign(
{},
this.opts,
{
query: n,
socket: this,
hostname: this.hostname,
secure: this.secure,
port: this.port,
},
this.opts.transportOptions[e]
);
return new U6[e](r);
}
open() {
let e;
if (
this.opts.rememberUpgrade &&
Sr.priorWebsocketSuccess &&
this.transports.indexOf("websocket") !== -1
)
e = "websocket";
else if (this.transports.length === 0) {
this.setTimeoutFn(() => {
this.emitReserved("error", "No transports available");
}, 0);
return;
} else e = this.transports[0];
this.readyState = "opening";
try {
e = this.createTransport(e);
} catch (n) {
this.transports.shift(), this.open();
return;
}
e.open(), this.setTransport(e);
}
setTransport(e) {
this.transport && this.transport.removeAllListeners(),
(this.transport = e),
e
.on("drain", this.onDrain.bind(this))
.on("packet", this.onPacket.bind(this))
.on("error", this.onError.bind(this))
.on("close", (n) => this.onClose("transport close", n));
}
probe(e) {
let n = this.createTransport(e),
r = !1;
Sr.priorWebsocketSuccess = !1;
const i = () => {
r ||
(n.send([{ type: "ping", data: "probe" }]),
n.once("packet", (f) => {
if (!r)
if (f.type === "pong" && f.data === "probe") {
if (
((this.upgrading = !0),
this.emitReserved("upgrading", n),
!n)
)
return;
(Sr.priorWebsocketSuccess = n.name === "websocket"),
this.transport.pause(() => {
r ||
(this.readyState !== "closed" &&
(c(),
this.setTransport(n),
n.send([{ type: "upgrade" }]),
this.emitReserved("upgrade", n),
(n = null),
(this.upgrading = !1),
this.flush()));
});
} else {
const h = new Error("probe error");
(h.transport = n.name),
this.emitReserved("upgradeError", h);
}
}));
};
function o() {
r || ((r = !0), c(), n.close(), (n = null));
}
const s = (f) => {
const h = new Error("probe error: " + f);
(h.transport = n.name), o(), this.emitReserved("upgradeError", h);
};
function l() {
s("transport closed");
}
function a() {
s("socket closed");
}
function u(f) {
n && f.name !== n.name && o();
}
const c = () => {
n.removeListener("open", i),
n.removeListener("error", s),
n.removeListener("close", l),
this.off("close", a),
this.off("upgrading", u);
};
n.once("open", i),
n.once("error", s),
n.once("close", l),
this.once("close", a),
this.once("upgrading", u),
this.upgrades.indexOf("webtransport") !== -1 && e !== "webtransport"
? this.setTimeoutFn(() => {
r || n.open();
}, 200)
: n.open();
}
onOpen() {
if (
((this.readyState = "open"),
(Sr.priorWebsocketSuccess = this.transport.name === "websocket"),
this.emitReserved("open"),
this.flush(),
this.readyState === "open" && this.opts.upgrade)
) {
let e = 0;
const n = this.upgrades.length;
for (; e < n; e++) this.probe(this.upgrades[e]);
}
}
onPacket(e) {
if (
this.readyState === "opening" ||
this.readyState === "open" ||
this.readyState === "closing"
)
switch (
(this.emitReserved("packet", e),
this.emitReserved("heartbeat"),
this.resetPingTimeout(),
e.type)
) {
case "open":
this.onHandshake(JSON.parse(e.data));
break;
case "ping":
this.sendPacket("pong"),
this.emitReserved("ping"),
this.emitReserved("pong");
break;
case "error":
const n = new Error("server error");
(n.code = e.data), this.onError(n);
break;
case "message":
this.emitReserved("data", e.data),
this.emitReserved("message", e.data);
break;
}
}
onHandshake(e) {
this.emitReserved("handshake", e),
(this.id = e.sid),
(this.transport.query.sid = e.sid),
(this.upgrades = this.filterUpgrades(e.upgrades)),
(this.pingInterval = e.pingInterval),
(this.pingTimeout = e.pingTimeout),
(this.maxPayload = e.maxPayload),
this.onOpen(),
this.readyState !== "closed" && this.resetPingTimeout();
}
resetPingTimeout() {
this.clearTimeoutFn(this.pingTimeoutTimer),
(this.pingTimeoutTimer = this.setTimeoutFn(() => {
this.onClose("ping timeout");
}, this.pingInterval + this.pingTimeout)),
this.opts.autoUnref && this.pingTimeoutTimer.unref();
}
onDrain() {
this.writeBuffer.splice(0, this.prevBufferLen),
(this.prevBufferLen = 0),
this.writeBuffer.length === 0
? this.emitReserved("drain")
: this.flush();
}
flush() {
if (
this.readyState !== "closed" &&
this.transport.writable &&
!this.upgrading &&
this.writeBuffer.length
) {
const e = this.getWritablePackets();
this.transport.send(e),
(this.prevBufferLen = e.length),
this.emitReserved("flush");
}
}
getWritablePackets() {
if (
!(
this.maxPayload &&
this.transport.name === "polling" &&
this.writeBuffer.length > 1
)
)
return this.writeBuffer;
let n = 1;
for (let r = 0; r < this.writeBuffer.length; r++) {
const i = this.writeBuffer[r].data;
if ((i && (n += P6(i)), r > 0 && n > this.maxPayload))
return this.writeBuffer.slice(0, r);
n += 2;
}
return this.writeBuffer;
}
write(e, n, r) {
return this.sendPacket("message", e, n, r), this;
}
send(e, n, r) {
return this.sendPacket("message", e, n, r), this;
}
sendPacket(e, n, r, i) {
if (
(typeof n == "function" && ((i = n), (n = void 0)),
typeof r == "function" && ((i = r), (r = null)),
this.readyState === "closing" || this.readyState === "closed")
)
return;
(r = r || {}), (r.compress = r.compress !== !1);
const o = { type: e, data: n, options: r };
this.emitReserved("packetCreate", o),
this.writeBuffer.push(o),
i && this.once("flush", i),
this.flush();
}
close() {
const e = () => {
this.onClose("forced close"), this.transport.close();
},
n = () => {
this.off("upgrade", n), this.off("upgradeError", n), e();
},
r = () => {
this.once("upgrade", n), this.once("upgradeError", n);
};
return (
(this.readyState === "opening" || this.readyState === "open") &&
((this.readyState = "closing"),
this.writeBuffer.length
? this.once("drain", () => {
this.upgrading ? r() : e();
})
: this.upgrading
? r()
: e()),
this
);
}
onError(e) {
(Sr.priorWebsocketSuccess = !1),
this.emitReserved("error", e),
this.onClose("transport error", e);
}
onClose(e, n) {
(this.readyState === "opening" ||
this.readyState === "open" ||
this.readyState === "closing") &&
(this.clearTimeoutFn(this.pingTimeoutTimer),
this.transport.removeAllListeners("close"),
this.transport.close(),
this.transport.removeAllListeners(),
typeof removeEventListener == "function" &&
(removeEventListener(
"beforeunload",
this.beforeunloadEventListener,
!1
),
removeEventListener("offline", this.offlineEventListener, !1)),
(this.readyState = "closed"),
(this.id = null),
this.emitReserved("close", e, n),
(this.writeBuffer = []),
(this.prevBufferLen = 0));
}
filterUpgrades(e) {
const n = [];
let r = 0;
const i = e.length;
for (; r < i; r++) ~this.transports.indexOf(e[r]) && n.push(e[r]);
return n;
}
}
Sr.protocol = Oy;
function Y6(t, e = "", n) {
let r = t;
(n = n || (typeof location != "undefined" && location)),
t == null && (t = n.protocol + "//" + n.host),
typeof t == "string" &&
(t.charAt(0) === "/" &&
(t.charAt(1) === "/" ? (t = n.protocol + t) : (t = n.host + t)),
/^(https?|wss?):\/\//.test(t) ||
(typeof n != "undefined"
? (t = n.protocol + "//" + t)
: (t = "https://" + t)),
(r = ed(t))),
r.port ||
(/^(http|ws)$/.test(r.protocol)
? (r.port = "80")
: /^(http|ws)s$/.test(r.protocol) && (r.port = "443")),
(r.path = r.path || "/");
const o = r.host.indexOf(":") !== -1 ? "[" + r.host + "]" : r.host;
return (
(r.id = r.protocol + "://" + o + ":" + r.port + e),
(r.href =
r.protocol +
"://" +
o +
(n && n.port === r.port ? "" : ":" + r.port)),
r
);
}
const Q6 = typeof ArrayBuffer == "function",
X6 = (t) =>
typeof ArrayBuffer.isView == "function"
? ArrayBuffer.isView(t)
: t.buffer instanceof ArrayBuffer,
Dy = Object.prototype.toString,
Z6 =
typeof Blob == "function" ||
(typeof Blob != "undefined" &&
Dy.call(Blob) === "[object BlobConstructor]"),
eR =
typeof File == "function" ||
(typeof File != "undefined" &&
Dy.call(File) === "[object FileConstructor]");
function Bf(t) {
return (
(Q6 && (t instanceof ArrayBuffer || X6(t))) ||
(Z6 && t instanceof Blob) ||
(eR && t instanceof File)
);
}
function gl(t, e) {
if (!t || typeof t != "object") return !1;
if (Array.isArray(t)) {
for (let n = 0, r = t.length; n < r; n++) if (gl(t[n])) return !0;
return !1;
}
if (Bf(t)) return !0;
if (t.toJSON && typeof t.toJSON == "function" && arguments.length === 1)
return gl(t.toJSON(), !0);
for (const n in t)
if (Object.prototype.hasOwnProperty.call(t, n) && gl(t[n])) return !0;
return !1;
}
function tR(t) {
const e = [],
n = t.data,
r = t;
return (
(r.data = td(n, e)),
(r.attachments = e.length),
{ packet: r, buffers: e }
);
}
function td(t, e) {
if (!t) return t;
if (Bf(t)) {
const n = { _placeholder: !0, num: e.length };
return e.push(t), n;
} else if (Array.isArray(t)) {
const n = new Array(t.length);
for (let r = 0; r < t.length; r++) n[r] = td(t[r], e);
return n;
} else if (typeof t == "object" && !(t instanceof Date)) {
const n = {};
for (const r in t)
Object.prototype.hasOwnProperty.call(t, r) && (n[r] = td(t[r], e));
return n;
}
return t;
}
function nR(t, e) {
return (t.data = nd(t.data, e)), delete t.attachments, t;
}
function nd(t, e) {
if (!t) return t;
if (t && t._placeholder === !0) {
if (typeof t.num == "number" && t.num >= 0 && t.num < e.length)
return e[t.num];
throw new Error("illegal attachments");
} else if (Array.isArray(t))
for (let n = 0; n < t.length; n++) t[n] = nd(t[n], e);
else if (typeof t == "object")
for (const n in t)
Object.prototype.hasOwnProperty.call(t, n) && (t[n] = nd(t[n], e));
return t;
}
const rR = [
"connect",
"connect_error",
"disconnect",
"disconnecting",
"newListener",
"removeListener",
],
iR = 5;
var $e;
(function (t) {
(t[(t.CONNECT = 0)] = "CONNECT"),
(t[(t.DISCONNECT = 1)] = "DISCONNECT"),
(t[(t.EVENT = 2)] = "EVENT"),
(t[(t.ACK = 3)] = "ACK"),
(t[(t.CONNECT_ERROR = 4)] = "CONNECT_ERROR"),
(t[(t.BINARY_EVENT = 5)] = "BINARY_EVENT"),
(t[(t.BINARY_ACK = 6)] = "BINARY_ACK");
})($e || ($e = {}));
class oR {
constructor(e) {
this.replacer = e;
}
encode(e) {
return (e.type === $e.EVENT || e.type === $e.ACK) && gl(e)
? this.encodeAsBinary({
type: e.type === $e.EVENT ? $e.BINARY_EVENT : $e.BINARY_ACK,
nsp: e.nsp,
data: e.data,
id: e.id,
})
: [this.encodeAsString(e)];
}
encodeAsString(e) {
let n = "" + e.type;
return (
(e.type === $e.BINARY_EVENT || e.type === $e.BINARY_ACK) &&
(n += e.attachments + "-"),
e.nsp && e.nsp !== "/" && (n += e.nsp + ","),
e.id != null && (n += e.id),
e.data != null && (n += JSON.stringify(e.data, this.replacer)),
n
);
}
encodeAsBinary(e) {
const n = tR(e),
r = this.encodeAsString(n.packet),
i = n.buffers;
return i.unshift(r), i;
}
}
function Nm(t) {
return Object.prototype.toString.call(t) === "[object Object]";
}
class $f extends xt {
constructor(e) {
super(), (this.reviver = e);
}
add(e) {
let n;
if (typeof e == "string") {
if (this.reconstructor)
throw new Error(
"got plaintext data when reconstructing a packet"
);
n = this.decodeString(e);
const r = n.type === $e.BINARY_EVENT;
r || n.type === $e.BINARY_ACK
? ((n.type = r ? $e.EVENT : $e.ACK),
(this.reconstructor = new sR(n)),
n.attachments === 0 && super.emitReserved("decoded", n))
: super.emitReserved("decoded", n);
} else if (Bf(e) || e.base64)
if (this.reconstructor)
(n = this.reconstructor.takeBinaryData(e)),
n &&
((this.reconstructor = null),
super.emitReserved("decoded", n));
else
throw new Error(
"got binary data when not reconstructing a packet"
);
else throw new Error("Unknown type: " + e);
}
decodeString(e) {
let n = 0;
const r = { type: Number(e.charAt(0)) };
if ($e[r.type] === void 0)
throw new Error("unknown packet type " + r.type);
if (r.type === $e.BINARY_EVENT || r.type === $e.BINARY_ACK) {
const o = n + 1;
for (; e.charAt(++n) !== "-" && n != e.length; );
const s = e.substring(o, n);
if (s != Number(s) || e.charAt(n) !== "-")
throw new Error("Illegal attachments");
r.attachments = Number(s);
}
if (e.charAt(n + 1) === "/") {
const o = n + 1;
for (; ++n && !(e.charAt(n) === "," || n === e.length); );
r.nsp = e.substring(o, n);
} else r.nsp = "/";
const i = e.charAt(n + 1);
if (i !== "" && Number(i) == i) {
const o = n + 1;
for (; ++n; ) {
const s = e.charAt(n);
if (s == null || Number(s) != s) {
--n;
break;
}
if (n === e.length) break;
}
r.id = Number(e.substring(o, n + 1));
}
if (e.charAt(++n)) {
const o = this.tryParse(e.substr(n));
if ($f.isPayloadValid(r.type, o)) r.data = o;
else throw new Error("invalid payload");
}
return r;
}
tryParse(e) {
try {
return JSON.parse(e, this.reviver);
} catch (n) {
return !1;
}
}
static isPayloadValid(e, n) {
switch (e) {
case $e.CONNECT:
return Nm(n);
case $e.DISCONNECT:
return n === void 0;
case $e.CONNECT_ERROR:
return typeof n == "string" || Nm(n);
case $e.EVENT:
case $e.BINARY_EVENT:
return (
Array.isArray(n) &&
(typeof n[0] == "number" ||
(typeof n[0] == "string" && rR.indexOf(n[0]) === -1))
);
case $e.ACK:
case $e.BINARY_ACK:
return Array.isArray(n);
}
}
destroy() {
this.reconstructor &&
(this.reconstructor.finishedReconstruction(),
(this.reconstructor = null));
}
}
class sR {
constructor(e) {
(this.packet = e), (this.buffers = []), (this.reconPack = e);
}
takeBinaryData(e) {
if (
(this.buffers.push(e),
this.buffers.length === this.reconPack.attachments)
) {
const n = nR(this.reconPack, this.buffers);
return this.finishedReconstruction(), n;
}
return null;
}
finishedReconstruction() {
(this.reconPack = null), (this.buffers = []);
}
}
const lR = Object.freeze(
Object.defineProperty(
{
__proto__: null,
protocol: iR,
get PacketType() {
return $e;
},
Encoder: oR,
Decoder: $f,
},
Symbol.toStringTag,
{ value: "Module" }
)
);
function _n(t, e, n) {
return (
t.on(e, n),
function () {
t.off(e, n);
}
);
}
const aR = Object.freeze({
connect: 1,
connect_error: 1,
disconnect: 1,
disconnecting: 1,
newListener: 1,
removeListener: 1,
});
class Iy extends xt {
constructor(e, n, r) {
super(),
(this.connected = !1),
(this.recovered = !1),
(this.receiveBuffer = []),
(this.sendBuffer = []),
(this._queue = []),
(this._queueSeq = 0),
(this.ids = 0),
(this.acks = {}),
(this.flags = {}),
(this.io = e),
(this.nsp = n),
r && r.auth && (this.auth = r.auth),
(this._opts = Object.assign({}, r)),
this.io._autoConnect && this.open();
}
get disconnected() {
return !this.connected;
}
subEvents() {
if (this.subs) return;
const e = this.io;
this.subs = [
_n(e, "open", this.onopen.bind(this)),
_n(e, "packet", this.onpacket.bind(this)),
_n(e, "error", this.onerror.bind(this)),
_n(e, "close", this.onclose.bind(this)),
];
}
get active() {
return !!this.subs;
}
connect() {
return this.connected
? this
: (this.subEvents(),
this.io._reconnecting || this.io.open(),
this.io._readyState === "open" && this.onopen(),
this);
}
open() {
return this.connect();
}
send(...e) {
return e.unshift("message"), this.emit.apply(this, e), this;
}
emit(e, ...n) {
if (aR.hasOwnProperty(e))
throw new Error('"' + e.toString() + '" is a reserved event name');
if (
(n.unshift(e),
this._opts.retries && !this.flags.fromQueue && !this.flags.volatile)
)
return this._addToQueue(n), this;
const r = { type: $e.EVENT, data: n };
if (
((r.options = {}),
(r.options.compress = this.flags.compress !== !1),
typeof n[n.length - 1] == "function")
) {
const s = this.ids++,
l = n.pop();
this._registerAckCallback(s, l), (r.id = s);
}
const i =
this.io.engine &&
this.io.engine.transport &&
this.io.engine.transport.writable;
return (
(this.flags.volatile && (!i || !this.connected)) ||
(this.connected
? (this.notifyOutgoingListeners(r), this.packet(r))
: this.sendBuffer.push(r)),
(this.flags = {}),
this
);
}
_registerAckCallback(e, n) {
var r;
const i =
(r = this.flags.timeout) !== null && r !== void 0
? r
: this._opts.ackTimeout;
if (i === void 0) {
this.acks[e] = n;
return;
}
const o = this.io.setTimeoutFn(() => {
delete this.acks[e];
for (let s = 0; s < this.sendBuffer.length; s++)
this.sendBuffer[s].id === e && this.sendBuffer.splice(s, 1);
n.call(this, new Error("operation has timed out"));
}, i);
this.acks[e] = (...s) => {
this.io.clearTimeoutFn(o), n.apply(this, [null, ...s]);
};
}
emitWithAck(e, ...n) {
const r =
this.flags.timeout !== void 0 || this._opts.ackTimeout !== void 0;
return new Promise((i, o) => {
n.push((s, l) => (r ? (s ? o(s) : i(l)) : i(s))),
this.emit(e, ...n);
});
}
_addToQueue(e) {
let n;
typeof e[e.length - 1] == "function" && (n = e.pop());
const r = {
id: this._queueSeq++,
tryCount: 0,
pending: !1,
args: e,
flags: Object.assign({ fromQueue: !0 }, this.flags),
};
e.push((i, ...o) =>
r !== this._queue[0]
? void 0
: (i !== null
? r.tryCount > this._opts.retries &&
(this._queue.shift(), n && n(i))
: (this._queue.shift(), n && n(null, ...o)),
(r.pending = !1),
this._drainQueue())
),
this._queue.push(r),
this._drainQueue();
}
_drainQueue(e = !1) {
if (!this.connected || this._queue.length === 0) return;
const n = this._queue[0];
(n.pending && !e) ||
((n.pending = !0),
n.tryCount++,
(this.flags = n.flags),
this.emit.apply(this, n.args));
}
packet(e) {
(e.nsp = this.nsp), this.io._packet(e);
}
onopen() {
typeof this.auth == "function"
? this.auth((e) => {
this._sendConnectPacket(e);
})
: this._sendConnectPacket(this.auth);
}
_sendConnectPacket(e) {
this.packet({
type: $e.CONNECT,
data: this._pid
? Object.assign({ pid: this._pid, offset: this._lastOffset }, e)
: e,
});
}
onerror(e) {
this.connected || this.emitReserved("connect_error", e);
}
onclose(e, n) {
(this.connected = !1),
delete this.id,
this.emitReserved("disconnect", e, n);
}
onpacket(e) {
if (e.nsp === this.nsp)
switch (e.type) {
case $e.CONNECT:
e.data && e.data.sid
? this.onconnect(e.data.sid, e.data.pid)
: this.emitReserved(
"connect_error",
new Error(
"It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"
)
);
break;
case $e.EVENT:
case $e.BINARY_EVENT:
this.onevent(e);
break;
case $e.ACK:
case $e.BINARY_ACK:
this.onack(e);
break;
case $e.DISCONNECT:
this.ondisconnect();
break;
case $e.CONNECT_ERROR:
this.destroy();
const r = new Error(e.data.message);
(r.data = e.data.data),
this.emitReserved("connect_error", r);
break;
}
}
onevent(e) {
const n = e.data || [];
e.id != null && n.push(this.ack(e.id)),
this.connected
? this.emitEvent(n)
: this.receiveBuffer.push(Object.freeze(n));
}
emitEvent(e) {
if (this._anyListeners && this._anyListeners.length) {
const n = this._anyListeners.slice();
for (const r of n) r.apply(this, e);
}
super.emit.apply(this, e),
this._pid &&
e.length &&
typeof e[e.length - 1] == "string" &&
(this._lastOffset = e[e.length - 1]);
}
ack(e) {
const n = this;
let r = !1;
return function (...i) {
r || ((r = !0), n.packet({ type: $e.ACK, id: e, data: i }));
};
}
onack(e) {
const n = this.acks[e.id];
typeof n == "function" &&
(n.apply(this, e.data), delete this.acks[e.id]);
}
onconnect(e, n) {
(this.id = e),
(this.recovered = n && this._pid === n),
(this._pid = n),
(this.connected = !0),
this.emitBuffered(),
this.emitReserved("connect"),
this._drainQueue(!0);
}
emitBuffered() {
this.receiveBuffer.forEach((e) => this.emitEvent(e)),
(this.receiveBuffer = []),
this.sendBuffer.forEach((e) => {
this.notifyOutgoingListeners(e), this.packet(e);
}),
(this.sendBuffer = []);
}
ondisconnect() {
this.destroy(), this.onclose("io server disconnect");
}
destroy() {
this.subs && (this.subs.forEach((e) => e()), (this.subs = void 0)),
this.io._destroy(this);
}
disconnect() {
return (
this.connected && this.packet({ type: $e.DISCONNECT }),
this.destroy(),
this.connected && this.onclose("io client disconnect"),
this
);
}
close() {
return this.disconnect();
}
compress(e) {
return (this.flags.compress = e), this;
}
get volatile() {
return (this.flags.volatile = !0), this;
}
timeout(e) {
return (this.flags.timeout = e), this;
}
onAny(e) {
return (
(this._anyListeners = this._anyListeners || []),
this._anyListeners.push(e),
this
);
}
prependAny(e) {
return (
(this._anyListeners = this._anyListeners || []),
this._anyListeners.unshift(e),
this
);
}
offAny(e) {
if (!this._anyListeners) return this;
if (e) {
const n = this._anyListeners;
for (let r = 0; r < n.length; r++)
if (e === n[r]) return n.splice(r, 1), this;
} else this._anyListeners = [];
return this;
}
listenersAny() {
return this._anyListeners || [];
}
onAnyOutgoing(e) {
return (
(this._anyOutgoingListeners = this._anyOutgoingListeners || []),
this._anyOutgoingListeners.push(e),
this
);
}
prependAnyOutgoing(e) {
return (
(this._anyOutgoingListeners = this._anyOutgoingListeners || []),
this._anyOutgoingListeners.unshift(e),
this
);
}
offAnyOutgoing(e) {
if (!this._anyOutgoingListeners) return this;
if (e) {
const n = this._anyOutgoingListeners;
for (let r = 0; r < n.length; r++)
if (e === n[r]) return n.splice(r, 1), this;
} else this._anyOutgoingListeners = [];
return this;
}
listenersAnyOutgoing() {
return this._anyOutgoingListeners || [];
}
notifyOutgoingListeners(e) {
if (this._anyOutgoingListeners && this._anyOutgoingListeners.length) {
const n = this._anyOutgoingListeners.slice();
for (const r of n) r.apply(this, e.data);
}
}
}
function mo(t) {
(t = t || {}),
(this.ms = t.min || 100),
(this.max = t.max || 1e4),
(this.factor = t.factor || 2),
(this.jitter = t.jitter > 0 && t.jitter <= 1 ? t.jitter : 0),
(this.attempts = 0);
}
mo.prototype.duration = function () {
var t = this.ms * Math.pow(this.factor, this.attempts++);
if (this.jitter) {
var e = Math.random(),
n = Math.floor(e * this.jitter * t);
t = (Math.floor(e * 10) & 1) == 0 ? t - n : t + n;
}
return Math.min(t, this.max) | 0;
};
mo.prototype.reset = function () {
this.attempts = 0;
};
mo.prototype.setMin = function (t) {
this.ms = t;
};
mo.prototype.setMax = function (t) {
this.max = t;
};
mo.prototype.setJitter = function (t) {
this.jitter = t;
};
class rd extends xt {
constructor(e, n) {
var r;
super(),
(this.nsps = {}),
(this.subs = []),
e && typeof e == "object" && ((n = e), (e = void 0)),
(n = n || {}),
(n.path = n.path || "/socket.io"),
(this.opts = n),
Ga(this, n),
this.reconnection(n.reconnection !== !1),
this.reconnectionAttempts(n.reconnectionAttempts || 1 / 0),
this.reconnectionDelay(n.reconnectionDelay || 1e3),
this.reconnectionDelayMax(n.reconnectionDelayMax || 5e3),
this.randomizationFactor(
(r = n.randomizationFactor) !== null && r !== void 0 ? r : 0.5
),
(this.backoff = new mo({
min: this.reconnectionDelay(),
max: this.reconnectionDelayMax(),
jitter: this.randomizationFactor(),
})),
this.timeout(n.timeout == null ? 2e4 : n.timeout),
(this._readyState = "closed"),
(this.uri = e);
const i = n.parser || lR;
(this.encoder = new i.Encoder()),
(this.decoder = new i.Decoder()),
(this._autoConnect = n.autoConnect !== !1),
this._autoConnect && this.open();
}
reconnection(e) {
return arguments.length
? ((this._reconnection = !!e), this)
: this._reconnection;
}
reconnectionAttempts(e) {
return e === void 0
? this._reconnectionAttempts
: ((this._reconnectionAttempts = e), this);
}
reconnectionDelay(e) {
var n;
return e === void 0
? this._reconnectionDelay
: ((this._reconnectionDelay = e),
(n = this.backoff) === null || n === void 0 || n.setMin(e),
this);
}
randomizationFactor(e) {
var n;
return e === void 0
? this._randomizationFactor
: ((this._randomizationFactor = e),
(n = this.backoff) === null || n === void 0 || n.setJitter(e),
this);
}
reconnectionDelayMax(e) {
var n;
return e === void 0
? this._reconnectionDelayMax
: ((this._reconnectionDelayMax = e),
(n = this.backoff) === null || n === void 0 || n.setMax(e),
this);
}
timeout(e) {
return arguments.length ? ((this._timeout = e), this) : this._timeout;
}
maybeReconnectOnOpen() {
!this._reconnecting &&
this._reconnection &&
this.backoff.attempts === 0 &&
this.reconnect();
}
open(e) {
if (~this._readyState.indexOf("open")) return this;
this.engine = new Sr(this.uri, this.opts);
const n = this.engine,
r = this;
(this._readyState = "opening"), (this.skipReconnect = !1);
const i = _n(n, "open", function () {
r.onopen(), e && e();
}),
o = (l) => {
this.cleanup(),
(this._readyState = "closed"),
this.emitReserved("error", l),
e ? e(l) : this.maybeReconnectOnOpen();
},
s = _n(n, "error", o);
if (this._timeout !== !1) {
const l = this._timeout,
a = this.setTimeoutFn(() => {
i(), o(new Error("timeout")), n.close();
}, l);
this.opts.autoUnref && a.unref(),
this.subs.push(() => {
this.clearTimeoutFn(a);
});
}
return this.subs.push(i), this.subs.push(s), this;
}
connect(e) {
return this.open(e);
}
onopen() {
this.cleanup(), (this._readyState = "open"), this.emitReserved("open");
const e = this.engine;
this.subs.push(
_n(e, "ping", this.onping.bind(this)),
_n(e, "data", this.ondata.bind(this)),
_n(e, "error", this.onerror.bind(this)),
_n(e, "close", this.onclose.bind(this)),
_n(this.decoder, "decoded", this.ondecoded.bind(this))
);
}
onping() {
this.emitReserved("ping");
}
ondata(e) {
try {
this.decoder.add(e);
} catch (n) {
this.onclose("parse error", n);
}
}
ondecoded(e) {
If(() => {
this.emitReserved("packet", e);
}, this.setTimeoutFn);
}
onerror(e) {
this.emitReserved("error", e);
}
socket(e, n) {
let r = this.nsps[e];
return (
r
? this._autoConnect && !r.active && r.connect()
: ((r = new Iy(this, e, n)), (this.nsps[e] = r)),
r
);
}
_destroy(e) {
const n = Object.keys(this.nsps);
for (const r of n) if (this.nsps[r].active) return;
this._close();
}
_packet(e) {
const n = this.encoder.encode(e);
for (let r = 0; r < n.length; r++) this.engine.write(n[r], e.options);
}
cleanup() {
this.subs.forEach((e) => e()),
(this.subs.length = 0),
this.decoder.destroy();
}
_close() {
(this.skipReconnect = !0),
(this._reconnecting = !1),
this.onclose("forced close"),
this.engine && this.engine.close();
}
disconnect() {
return this._close();
}
onclose(e, n) {
this.cleanup(),
this.backoff.reset(),
(this._readyState = "closed"),
this.emitReserved("close", e, n),
this._reconnection && !this.skipReconnect && this.reconnect();
}
reconnect() {
if (this._reconnecting || this.skipReconnect) return this;
const e = this;
if (this.backoff.attempts >= this._reconnectionAttempts)
this.backoff.reset(),
this.emitReserved("reconnect_failed"),
(this._reconnecting = !1);
else {
const n = this.backoff.duration();
this._reconnecting = !0;
const r = this.setTimeoutFn(() => {
e.skipReconnect ||
(this.emitReserved("reconnect_attempt", e.backoff.attempts),
!e.skipReconnect &&
e.open((i) => {
i
? ((e._reconnecting = !1),
e.reconnect(),
this.emitReserved("reconnect_error", i))
: e.onreconnect();
}));
}, n);
this.opts.autoUnref && r.unref(),
this.subs.push(() => {
this.clearTimeoutFn(r);
});
}
}
onreconnect() {
const e = this.backoff.attempts;
(this._reconnecting = !1),
this.backoff.reset(),
this.emitReserved("reconnect", e);
}
}
const ko = {};
function qu(t, e) {
typeof t == "object" && ((e = t), (t = void 0)), (e = e || {});
const n = Y6(t, e.path || "/socket.io"),
r = n.source,
i = n.id,
o = n.path,
s = ko[i] && o in ko[i].nsps,
l = e.forceNew || e["force new connection"] || e.multiplex === !1 || s;
let a;
return (
l ? (a = new rd(r, e)) : (ko[i] || (ko[i] = new rd(r, e)), (a = ko[i])),
n.query && !e.query && (e.query = n.queryKey),
a.socket(n.path, e)
);
}
Object.assign(qu, { Manager: rd, Socket: Iy, io: qu, connect: qu });
export {
_e as A,
Dt as B,
Ft as C,
yR as D,
ib as E,
He as F,
fm as G,
vR as H,
gR as I,
qd as P,
q5 as T,
Ds as _,
dR as a,
Ue as b,
fR as c,
G as d,
Me as e,
cR as f,
GR as g,
vi as h,
YR as i,
Pn as j,
U as k,
ze as l,
wn as m,
De as n,
B as o,
ye as p,
Ir as q,
ft as r,
JR as s,
Ge as t,
ne as u,
Be as v,
Te as w,
yt as x,
mR as y,
h6 as z,
};