UNPKG

@uva-glass/component-library

Version:

React components UvA

108 lines (107 loc) 3.15 kB
import { ae as l, h as i, B as a, af as L, a6 as x, a as y, k as A, c as N, a3 as P, a8 as d, w as p, a9 as S, a7 as j, e as I, ag as M, ah as R, ai as f, aj as E, ak as _ } from "./Lexical.prod-CniF7zEE.js"; function g(t, ...e) { const n = new URL("https://lexical.dev/docs/error"), r = new URLSearchParams(); r.append("code", t); for (const o of e) r.append("v", o); throw n.search = r.toString(), Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`); } const h = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, k = h && "documentMode" in document ? document.documentMode : null; !(!h || !("InputEvent" in window) || k) && "getTargetRanges" in new window.InputEvent("input"); function m(...t) { const e = []; for (const n of t) if (n && typeof n == "string") for (const [r] of n.matchAll(/\S+/g)) e.push(r); return e; } function O(...t) { return () => { for (let e = t.length - 1; e >= 0; e--) t[e](); t.length = 0; }; } function U(t, ...e) { const n = m(...e); n.length > 0 && t.classList.add(...n); } function $(t, ...e) { const n = m(...e); n.length > 0 && t.classList.remove(...n); } function b(t, e) { let n = t; for (; n != null; ) { if (n instanceof e) return n; n = n.getParent(); } return null; } function q(t) { const e = B(t, (n) => i(n) && !n.isInline()); return i(e) || g(4, t.__key), e; } const B = (t, e) => { let n = t; for (; n !== l() && n != null; ) { if (e(n)) return n; n = n.getParent(); } return null; }; function H(t) { const e = y() || A(); let n; if (N(e)) n = P(e.focus, "next"); else { if (e != null) { const u = e.getNodes(), c = u[u.length - 1]; c && (n = d(c, "next")); } n = n || a(l(), "previous").getFlipped().insert(p()); } const r = T(t, n), o = S(r), s = j(o) ? I(o) : r; return M(R(s)), t.getLatest(); } function T(t, e, n) { let r = f(e, "next"); for (let o = r; o; o = E(o, n)) r = o; return _(r) && g(283), r.insert(t.isInline() ? p().append(t) : t), f(d(t.getLatest(), "next"), e.direction); } function K(t, e) { return t !== null && Object.getPrototypeOf(t).constructor.name === e.name; } function V(t, e) { a(t, "next").insert(e); } function Z(t, e) { return w(t, e, null); } function w(t, e, n) { let r = !1; for (const o of v(t)) e(o) ? n !== null && n(o) : (r = !0, i(o) && w(o, e, n || ((s) => o.insertAfter(s))), o.remove()); return r; } function z(t, e) { const n = [], r = Array.from(t).reverse(); for (let o = r.pop(); o !== void 0; o = r.pop()) if (e(o)) n.push(o); else if (i(o)) for (const s of v(o)) r.push(s); return n; } function v(t) { return C(a(t, "previous")); } function C(t) { return L({ hasNext: x, initial: t.getAdjacentCaret(), map: (e) => e.origin.getLatest(), step: (e) => e.getAdjacentCaret() }); } export { K as L, V as N, H as S, Z as T, z as _, $ as i, O as j, U as r, b as v, B as w, q as y }; //# sourceMappingURL=LexicalUtils.prod-DVr8VsHc.js.map