UNPKG

@uva-glass/component-library

Version:

React components UvA

115 lines (114 loc) 3.68 kB
import { y as i, Q as l, ag as x, a9 as y, d as A, a as L, u as C, h as R, a6 as P, ab as p, ah as b, A as g, ac as k, aa as E, v as S, ai as j, aj as B, ak as d, al as N, am as I } from "./Lexical.prod-BAE-wnll.js"; function m(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 a = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, M = a && "documentMode" in document ? document.documentMode : null, O = a && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent); !(!a || !("InputEvent" in window) || M) && "getTargetRanges" in new window.InputEvent("input"); function h(...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 z(...t) { return () => { for (let e = t.length - 1; e >= 0; e--) t[e](); t.length = 0; }; } const T = a, _ = O; function Q(t, ...e) { const n = h(...e); n.length > 0 && t.classList.add(...n); } function q(t, ...e) { const n = h(...e); n.length > 0 && t.classList.remove(...n); } function K(t, e) { let n = t; for (; n != null; ) { if (n instanceof e) return n; n = n.getParent(); } return null; } function V(t) { const e = A(t, (n) => i(n) && !n.isInline()); return i(e) || m(4, t.__key), e; } function W(t) { const e = L() || C(); let n; if (R(e)) n = P(e.focus, "next"); else { if (e != null) { const c = e.getNodes(), f = c[c.length - 1]; f && (n = p(f, "next")); } n = n || l(b(), "previous").getFlipped().insert(g()); } const r = F(t, n), o = k(r), s = E(o) ? S(o) : r; return j(B(s)), t.getLatest(); } function F(t, e, n) { let r = d(e, "next"); for (let o = r; o; o = N(o, n)) r = o; return I(r) && m(283), r.insert(t.isInline() ? g().append(t) : t), d(p(t.getLatest(), "next"), e.direction); } function X(t, e) { return t !== null && Object.getPrototypeOf(t).constructor.name === e.name; } function D(t, e) { l(t, "next").insert(e); } let u = !(_ || !T) && void 0; function G(t) { let e = 1; if ((function() { if (u === void 0) { const n = document.createElement("div"); n.style.cssText = "position: absolute; opacity: 0; width: 100px; left: -1000px;", document.body.appendChild(n); const r = n.getBoundingClientRect(); n.style.setProperty("zoom", "2"), u = n.getBoundingClientRect().width === r.width, document.body.removeChild(n); } return u; })()) for (; t; ) e *= Number(window.getComputedStyle(t).getPropertyValue("zoom")), t = t.parentElement; return e; } function H(t, e) { return v(t, e, null); } function v(t, e, n) { let r = !1; for (const o of w(t)) e(o) ? n !== null && n(o) : (r = !0, i(o) && v(o, e, n || ((s) => o.insertAfter(s))), o.remove()); return r; } function J(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 w(o)) r.push(s); return n; } function w(t) { return U(l(t, "previous")); } function U(t) { return x({ hasNext: y, initial: t.getAdjacentCaret(), map: (e) => e.origin.getLatest(), step: (e) => e.getAdjacentCaret() }); } export { W as A, H as B, X as L, D as N, G as R, z as U, J as k, Q as l, q as u, K as w, V as x }; //# sourceMappingURL=LexicalUtils.prod-D8DAKg7O.js.map