@qwanyx/stack 0.2.19 → 0.2.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -2,7 +2,7 @@ var Rl = Object.defineProperty;
2
2
  var jl = (r, e, t) => e in r ? Rl(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
3
  var or = (r, e, t) => jl(r, typeof e != "symbol" ? e + "" : e, t);
4
4
  import * as ss from "react";
5
- import Ks, { useState as Q, useCallback as Z, useEffect as pe, useMemo as Pt, useRef as bs, createContext as Il, useContext as Ml, useLayoutEffect as er, Suspense as $l, forwardRef as Qo } from "react";
5
+ import Ks, { useState as Q, useCallback as Z, useEffect as ge, useMemo as Pt, useRef as bs, createContext as Il, useContext as Ml, useLayoutEffect as er, Suspense as $l, forwardRef as Qo } from "react";
6
6
  import { flushSync as ql, createPortal as zl } from "react-dom";
7
7
  class cf {
8
8
  constructor(e) {
@@ -3919,7 +3919,7 @@ function da(r, e, t = {}) {
3919
3919
  }
3920
3920
  }
3921
3921
  }, [r, JSON.stringify(e), n, o, i]);
3922
- return pe(() => {
3922
+ return ge(() => {
3923
3923
  s && h();
3924
3924
  }, [h, s]), {
3925
3925
  data: u,
@@ -4097,14 +4097,14 @@ function ha() {
4097
4097
  }
4098
4098
  return null;
4099
4099
  }
4100
- var I = Object.assign, W = 0, ne, Se, $e, vt, ut, ae, Le;
4100
+ var I = Object.assign, W = 0, ne, Se, Me, vt, ut, ae, $e;
4101
4101
  function qe() {
4102
4102
  }
4103
4103
  qe.__reactDisabledLog = !0;
4104
4104
  function lt() {
4105
4105
  {
4106
4106
  if (W === 0) {
4107
- ne = console.log, Se = console.info, $e = console.warn, vt = console.error, ut = console.group, ae = console.groupCollapsed, Le = console.groupEnd;
4107
+ ne = console.log, Se = console.info, Me = console.warn, vt = console.error, ut = console.group, ae = console.groupCollapsed, $e = console.groupEnd;
4108
4108
  var m = {
4109
4109
  configurable: !0,
4110
4110
  enumerable: !0,
@@ -4140,7 +4140,7 @@ function ha() {
4140
4140
  value: Se
4141
4141
  }),
4142
4142
  warn: I({}, m, {
4143
- value: $e
4143
+ value: Me
4144
4144
  }),
4145
4145
  error: I({}, m, {
4146
4146
  value: vt
@@ -4152,7 +4152,7 @@ function ha() {
4152
4152
  value: ae
4153
4153
  }),
4154
4154
  groupEnd: I({}, m, {
4155
- value: Le
4155
+ value: $e
4156
4156
  })
4157
4157
  });
4158
4158
  }
@@ -4704,7 +4704,7 @@ function hf({
4704
4704
  let I = g;
4705
4705
  return u && w && l.length > 0 && (I = as.search(I, w, l)), Object.keys(C).length > 0 && (I = as.filterByFields(I, C)), as.paginate(I, k, f);
4706
4706
  }, [g, w, C, k, f, u, l]);
4707
- pe(() => {
4707
+ ge(() => {
4708
4708
  A(1);
4709
4709
  }, [w, C]);
4710
4710
  const P = () => {
@@ -4996,7 +4996,7 @@ function mf({
4996
4996
  const A = Math.floor(Math.random() * k.length);
4997
4997
  return k[A];
4998
4998
  }, [r]), y = Z(() => Math.random() * (n - t) + t, [t, n]);
4999
- pe(() => {
4999
+ ge(() => {
5000
5000
  if (r.length === 0) {
5001
5001
  a([]), f([]);
5002
5002
  return;
@@ -5044,7 +5044,7 @@ function mf({
5044
5044
  }, k);
5045
5045
  _.current[b] = A;
5046
5046
  }, [y, D, l, c, p]), x = bs(!1);
5047
- pe(() => {
5047
+ ge(() => {
5048
5048
  if (!(l.length === 0 || r.length <= 1) && !x.current) {
5049
5049
  x.current = !0;
5050
5050
  for (let b = 0; b < l.length; b++)
@@ -5197,7 +5197,7 @@ function yf({
5197
5197
  renderLoading: y,
5198
5198
  theme: w = {}
5199
5199
  }) {
5200
- const x = { ...ga, ...w }, [C, b] = Q([]), [k, A] = Q(!1), [S, P] = Q(null), [F, U] = Q(/* @__PURE__ */ new Set()), [$, I] = Q(null), [W, ne] = Q(null), [Se, $e] = Q(null), [vt, ut] = Q(!1), ae = Pt(() => e ? new la({ baseUrl: r, system_id: e }) : null, [r, e]), Le = Z(async () => {
5200
+ const x = { ...ga, ...w }, [C, b] = Q([]), [k, A] = Q(!1), [S, P] = Q(null), [F, U] = Q(/* @__PURE__ */ new Set()), [$, I] = Q(null), [W, ne] = Q(null), [Se, Me] = Q(null), [vt, ut] = Q(!1), ae = Pt(() => e ? new la({ baseUrl: r, system_id: e }) : null, [r, e]), $e = Z(async () => {
5201
5201
  if (ae) {
5202
5202
  A(!0), P(null);
5203
5203
  try {
@@ -5210,17 +5210,15 @@ function yf({
5210
5210
  A(!1);
5211
5211
  }
5212
5212
  }, [ae, t, n, s, d, h]);
5213
- pe(() => {
5214
- l && Le();
5215
- }, [l, Le]), pe(() => {
5216
- Le();
5217
- }, [s]);
5213
+ ge(() => {
5214
+ l && $e();
5215
+ }, [l, $e]);
5218
5216
  const qe = Z(async (M) => {
5219
5217
  if (ae) {
5220
- ne(M), $e(null), ut(!0);
5218
+ ne(M), Me(null), ut(!0);
5221
5219
  try {
5222
5220
  const z = await ae.getEmailParsed(t, M.uid, s || "INBOX");
5223
- z != null && z.body && $e(z.body);
5221
+ z != null && z.body && Me(z.body);
5224
5222
  } catch (z) {
5225
5223
  console.error("Failed to fetch email body:", z);
5226
5224
  }
@@ -5288,7 +5286,7 @@ function yf({
5288
5286
  }, [c]), et = {
5289
5287
  delete: ve,
5290
5288
  archive: Ze,
5291
- refresh: Le,
5289
+ refresh: $e,
5292
5290
  selectAll: Te,
5293
5291
  clearSelection: ze
5294
5292
  }, Gn = (M) => {
@@ -5608,7 +5606,7 @@ function Ye() {
5608
5606
  function Pr(r) {
5609
5607
  return {};
5610
5608
  }
5611
- const Hs = {}, xa = {}, tu = {}, Et = {}, Ht = {}, kr = {}, Gt = {}, Fn = {}, Cs = {}, Sr = {}, Tr = {}, je = {}, Gs = {}, Js = {}, va = {}, ru = {}, ba = {}, nu = {}, Da = {}, su = {}, iu = {}, fn = {}, wa = {}, ou = {}, uu = {}, lu = {}, Ca = {}, Aa = {}, Ea = {}, Ii = {}, au = {}, ka = {}, cu = {}, du = {}, Sa = {}, Ln = {}, Qs = {}, As = {}, Ta = {}, Ba = {}, Zr = {}, en = {}, Na = {}, Fa = {}, La = {}, Me = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Pa = Me && "documentMode" in document ? document.documentMode : null, Pe = Me && /Mac|iPod|iPhone|iPad/.test(navigator.platform), mt = Me && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent), hn = !(!Me || !("InputEvent" in window) || Pa) && "getTargetRanges" in new window.InputEvent("input"), Pn = Me && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Or = Me && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Oa = Me && /Android/.test(navigator.userAgent), fu = Me && /^(?=.*Chrome).*/i.test(navigator.userAgent), Ra = Me && Oa && fu, Ys = Me && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !fu, Rr = 1, _t = 3, Tt = 0, hu = 1, Yt = 2, ja = 0, Ia = 1, Ma = 2, pn = 4, gn = 8, Xs = 128, $a = 112 | (3 | pn | gn) | Xs, Zs = 1, ei = 2, ti = 3, ri = 4, ni = 5, si = 6, On = Pn || Or || Ys ? " " : "​", nt = `
5609
+ const Hs = {}, xa = {}, tu = {}, Et = {}, Ht = {}, kr = {}, Gt = {}, Fn = {}, Cs = {}, Sr = {}, Tr = {}, Re = {}, Gs = {}, Js = {}, va = {}, ru = {}, ba = {}, nu = {}, Da = {}, su = {}, iu = {}, fn = {}, wa = {}, ou = {}, uu = {}, lu = {}, Ca = {}, Aa = {}, Ea = {}, Ii = {}, au = {}, ka = {}, cu = {}, du = {}, Sa = {}, Ln = {}, Qs = {}, As = {}, Ta = {}, Ba = {}, Zr = {}, en = {}, Na = {}, Fa = {}, La = {}, Ie = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Pa = Ie && "documentMode" in document ? document.documentMode : null, Le = Ie && /Mac|iPod|iPhone|iPad/.test(navigator.platform), mt = Ie && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent), hn = !(!Ie || !("InputEvent" in window) || Pa) && "getTargetRanges" in new window.InputEvent("input"), Pn = Ie && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Or = Ie && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Oa = Ie && /Android/.test(navigator.userAgent), fu = Ie && /^(?=.*Chrome).*/i.test(navigator.userAgent), Ra = Ie && Oa && fu, Ys = Ie && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !fu, Rr = 1, _t = 3, Tt = 0, hu = 1, Yt = 2, ja = 0, Ia = 1, Ma = 2, pn = 4, gn = 8, Xs = 128, $a = 112 | (3 | pn | gn) | Xs, Zs = 1, ei = 2, ti = 3, ri = 4, ni = 5, si = 6, On = Pn || Or || Ys ? " " : "​", nt = `
5612
5610
 
5613
5611
  `, qa = mt ? " " : On, pu = "֑-߿יִ-﷽ﹰ-ﻼ", gu = "A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿", za = new RegExp("^[^" + gu + "]*[" + pu + "]"), Ua = new RegExp("^[^" + pu + "]*[" + gu + "]"), Bt = { bold: 1, code: 16, highlight: Xs, italic: 2, strikethrough: pn, subscript: 32, superscript: 64, underline: gn }, Wa = { directionless: 1, unmergeable: 2 }, Mi = { center: ei, end: si, justify: ri, left: Zs, right: ti, start: ni }, Va = { [ei]: "center", [si]: "end", [ri]: "justify", [Zs]: "left", [ti]: "right", [ni]: "start" }, Ka = { normal: 0, segmented: 2, token: 1 }, Ha = { [ja]: "normal", [Ma]: "segmented", [Ia]: "token" };
5614
5612
  function Ga(r) {
@@ -5652,7 +5650,7 @@ function Za(r, e, t, n) {
5652
5650
  for (let s = r; s && !fc(s); s = Ir(s)) {
5653
5651
  const o = jn(s, e);
5654
5652
  if (o !== void 0) {
5655
- const i = ge(o, t);
5653
+ const i = pe(o, t);
5656
5654
  if (i) return Y(i) ? void 0 : [s, i];
5657
5655
  } else if (s === n) return [n, Cu(t)];
5658
5656
  }
@@ -5888,11 +5886,11 @@ function he(r) {
5888
5886
  const e = te(), t = e._compositionKey;
5889
5887
  if (r !== t) {
5890
5888
  if (e._compositionKey = r, t !== null) {
5891
- const n = ge(t);
5889
+ const n = pe(t);
5892
5890
  n !== null && n.getWritable();
5893
5891
  }
5894
5892
  if (r !== null) {
5895
- const n = ge(r);
5893
+ const n = pe(r);
5896
5894
  n !== null && n.getWritable();
5897
5895
  }
5898
5896
  }
@@ -5900,13 +5898,13 @@ function he(r) {
5900
5898
  function ht() {
5901
5899
  return Ur() ? null : te()._compositionKey;
5902
5900
  }
5903
- function ge(r, e) {
5901
+ function pe(r, e) {
5904
5902
  const t = (e || it())._nodeMap.get(r);
5905
5903
  return t === void 0 ? null : t;
5906
5904
  }
5907
5905
  function Du(r, e) {
5908
5906
  const t = jn(r, te());
5909
- return t !== void 0 ? ge(t, e) : null;
5907
+ return t !== void 0 ? pe(t, e) : null;
5910
5908
  }
5911
5909
  function jn(r, e) {
5912
5910
  return r[`__lexicalKey_${e._key}`];
@@ -5948,7 +5946,7 @@ function Vt(r) {
5948
5946
  }
5949
5947
  return null;
5950
5948
  }(r, e);
5951
- return t === null ? r === e.getRootElement() ? ge("root") : null : ge(t);
5949
+ return t === null ? r === e.getRootElement() ? pe("root") : null : pe(t);
5952
5950
  }
5953
5951
  function Vi(r, e) {
5954
5952
  return e ? r.getTextContentSize() : 0;
@@ -6033,7 +6031,7 @@ function Hi(r) {
6033
6031
  return r === "ArrowRight";
6034
6032
  }
6035
6033
  function gr(r, e) {
6036
- return Pe ? r : e;
6034
+ return Le ? r : e;
6037
6035
  }
6038
6036
  function Gi(r) {
6039
6037
  return r === "Enter";
@@ -6186,7 +6184,7 @@ function uc(r, e, t) {
6186
6184
  n !== null && fi(n, r, e);
6187
6185
  }
6188
6186
  function Fe(r) {
6189
- return Me ? (r || window).getSelection() : null;
6187
+ return Ie ? (r || window).getSelection() : null;
6190
6188
  }
6191
6189
  function lc(r) {
6192
6190
  return st(r) && r.tagName === "A";
@@ -6252,14 +6250,14 @@ function Tu(r, e, t, n, s, o) {
6252
6250
  i.__parent === e && (E(i) && Tu(i, u, t, n, s, o), t.has(u) || o.delete(u), s.push(u)), i = i.getNextSibling();
6253
6251
  }
6254
6252
  }
6255
- let yt, xe, Nr, $n, Ss, Ts, Nt, Ie, Bs, Fr, ue = "", ye = "", We = null, Oe = "", rt = "", Bu = !1, Lr = !1, ln = null;
6253
+ let yt, xe, Nr, $n, Ss, Ts, Nt, je, Bs, Fr, ue = "", ye = "", We = null, Pe = "", rt = "", Bu = !1, Lr = !1, ln = null;
6256
6254
  function Dn(r, e) {
6257
6255
  const t = Nt.get(r);
6258
6256
  if (e !== null) {
6259
6257
  const n = Ls(r);
6260
6258
  n.parentNode === e && e.removeChild(n);
6261
6259
  }
6262
- if (Ie.has(r) || xe._keyToDOMMap.delete(r), E(t)) {
6260
+ if (je.has(r) || xe._keyToDOMMap.delete(r), E(t)) {
6263
6261
  const n = Cn(t, Nt);
6264
6262
  Ns(n, 0, n.length - 1, null);
6265
6263
  }
@@ -6290,7 +6288,7 @@ function Fu(r, e) {
6290
6288
  e === 0 ? wt(t, "") : e === Zs ? wt(t, "left") : e === ei ? wt(t, "center") : e === ti ? wt(t, "right") : e === ri ? wt(t, "justify") : e === ni ? wt(t, "start") : e === si && wt(t, "end");
6291
6289
  }
6292
6290
  function wn(r, e) {
6293
- const t = Ie.get(r);
6291
+ const t = je.get(r);
6294
6292
  t === void 0 && N(60);
6295
6293
  const n = t.createDOM(yt, xe);
6296
6294
  if (function(s, o, i) {
@@ -6305,7 +6303,7 @@ function wn(r, e) {
6305
6303
  (function(l, a, c, f) {
6306
6304
  const d = ye;
6307
6305
  ye = "", Fs(l, c, 0, a, c.getDOMSlot(f)), Pu(c, f), ye = d;
6308
- })(Cn(t, Ie), u, t, n);
6306
+ })(Cn(t, je), u, t, n);
6309
6307
  }
6310
6308
  const i = t.__format;
6311
6309
  i !== 0 && Fu(n, i), t.isInline() || Lu(null, t, n), In(t) && (ue += nt, rt += nt);
@@ -6325,8 +6323,8 @@ function Fs(r, e, t, n, s) {
6325
6323
  let i = t;
6326
6324
  for (; i <= n; ++i) {
6327
6325
  wn(r[i], s);
6328
- const u = Ie.get(r[i]);
6329
- u !== null && L(u) && (We === null && (We = u.getFormat()), Oe === "" && (Oe = u.getStyle()));
6326
+ const u = je.get(r[i]);
6327
+ u !== null && L(u) && (We === null && (We = u.getFormat()), Pe === "" && (Pe = u.getStyle()));
6330
6328
  }
6331
6329
  In(e) && (ue += nt), s.element.__lexicalTextContent = ue, ue = o + ue;
6332
6330
  }
@@ -6342,7 +6340,7 @@ function Zi(r, e) {
6342
6340
  return null;
6343
6341
  }
6344
6342
  function Lu(r, e, t) {
6345
- const n = Zi(r, Nt), s = Zi(e, Ie);
6343
+ const n = Zi(r, Nt), s = Zi(e, je);
6346
6344
  n !== s && e.getDOMSlot(t).setManagedLineBreak(s);
6347
6345
  }
6348
6346
  function Pu(r, e) {
@@ -6379,7 +6377,7 @@ function Pu(r, e) {
6379
6377
  function pc(r, e, t) {
6380
6378
  const n = ye;
6381
6379
  var s;
6382
- ye = "", We = null, Oe = "", function(o, i, u) {
6380
+ ye = "", We = null, Pe = "", function(o, i, u) {
6383
6381
  const l = ue, a = o.__size, c = i.__size;
6384
6382
  ue = "";
6385
6383
  const f = u.element;
@@ -6399,10 +6397,10 @@ function pc(r, e, t) {
6399
6397
  }
6400
6398
  Dn(d, null);
6401
6399
  }
6402
- const p = Ie.get(h);
6403
- L(p) && (We === null && (We = p.getFormat()), Oe === "" && (Oe = p.getStyle()));
6400
+ const p = je.get(h);
6401
+ L(p) && (We === null && (We = p.getFormat()), Pe === "" && (Pe = p.getStyle()));
6404
6402
  } else {
6405
- const d = Cn(o, Nt), h = Cn(i, Ie);
6403
+ const d = Cn(o, Nt), h = Cn(i, je);
6406
6404
  if (d.length !== a && N(227), h.length !== c && N(228), a === 0) c !== 0 && Fs(h, i, 0, c - 1, u);
6407
6405
  else if (c === 0) {
6408
6406
  if (a !== 0) {
@@ -6419,13 +6417,13 @@ function pc(r, e, t) {
6419
6417
  b === void 0 && (b = new Set(g)), k === void 0 && (k = new Set(_));
6420
6418
  const ne = k.has($), Se = b.has(I);
6421
6419
  if (ne) if (Se) {
6422
- const $e = vn(xe, I);
6423
- $e === A ? A = hs(mr(I, w.element)) : (w.withBefore(A).insertChild($e), mr(I, w.element)), S++, P++;
6420
+ const Me = vn(xe, I);
6421
+ Me === A ? A = hs(mr(I, w.element)) : (w.withBefore(A).insertChild(Me), mr(I, w.element)), S++, P++;
6424
6422
  } else wn(I, w.withBefore(A)), P++;
6425
6423
  else A = hs(Ls($)), Dn($, w.element), S++;
6426
6424
  }
6427
- const W = Ie.get(I);
6428
- W !== null && L(W) && (We === null && (We = W.getFormat()), Oe === "" && (Oe = W.getStyle()));
6425
+ const W = je.get(I);
6426
+ W !== null && L(W) && (We === null && (We = W.getFormat()), Pe === "" && (Pe = W.getStyle()));
6429
6427
  }
6430
6428
  const F = S > x, U = P > C;
6431
6429
  if (F && !U) {
@@ -6435,8 +6433,8 @@ function pc(r, e, t) {
6435
6433
  })(i, d, h, a, c, u);
6436
6434
  }
6437
6435
  In(i) && (ue += nt), f.__lexicalTextContent = ue, ue = l + ue;
6438
- }(r, e, e.getDOMSlot(t)), Pu(e, t), Zt(s = e) && We != null && We !== s.__textFormat && !Lr && (s.setTextFormat(We), s.setTextStyle(Oe)), function(o) {
6439
- Zt(o) && Oe !== "" && Oe !== o.__textStyle && !Lr && o.setTextStyle(Oe);
6436
+ }(r, e, e.getDOMSlot(t)), Pu(e, t), Zt(s = e) && We != null && We !== s.__textFormat && !Lr && (s.setTextFormat(We), s.setTextStyle(Pe)), function(o) {
6437
+ Zt(o) && Pe !== "" && Pe !== o.__textStyle && !Lr && o.setTextStyle(Pe);
6440
6438
  }(e), ye = n;
6441
6439
  }
6442
6440
  function Cn(r, e) {
@@ -6450,7 +6448,7 @@ function Cn(r, e) {
6450
6448
  }
6451
6449
  function mr(r, e) {
6452
6450
  const t = Nt.get(r);
6453
- let n = Ie.get(r);
6451
+ let n = je.get(r);
6454
6452
  t !== void 0 && n !== void 0 || N(61);
6455
6453
  const s = Bu || Ts.has(r) || Ss.has(r), o = vn(xe, r);
6456
6454
  if (t === n && !s) {
@@ -6502,9 +6500,9 @@ function hs(r) {
6502
6500
  return e !== null && e === xe._blockCursorElement && (e = e.nextSibling), e;
6503
6501
  }
6504
6502
  function gc(r, e, t, n, s, o) {
6505
- ue = "", rt = "", ye = "", Bu = n === Yt, ln = null, xe = t, yt = t._config, Nr = t._nodes, $n = xe._listeners.mutation, Ss = s, Ts = o, Nt = r._nodeMap, Ie = e._nodeMap, Lr = e._readOnly, Bs = new Map(t._keyToDOMMap);
6503
+ ue = "", rt = "", ye = "", Bu = n === Yt, ln = null, xe = t, yt = t._config, Nr = t._nodes, $n = xe._listeners.mutation, Ss = s, Ts = o, Nt = r._nodeMap, je = e._nodeMap, Lr = e._readOnly, Bs = new Map(t._keyToDOMMap);
6506
6504
  const i = /* @__PURE__ */ new Map();
6507
- return Fr = i, mr("root", null), xe = void 0, Nr = void 0, Ss = void 0, Ts = void 0, Nt = void 0, Ie = void 0, yt = void 0, Bs = void 0, Fr = void 0, i;
6505
+ return Fr = i, mr("root", null), xe = void 0, Nr = void 0, Ss = void 0, Ts = void 0, Nt = void 0, je = void 0, yt = void 0, Bs = void 0, Fr = void 0, i;
6508
6506
  }
6509
6507
  function Ls(r) {
6510
6508
  const e = Bs.get(r);
@@ -6543,41 +6541,41 @@ const tt = Object.freeze({}), Ps = 30, Os = [["keydown", function(r, e) {
6543
6541
  return u === " ";
6544
6542
  }(t)) O(e, wa, r);
6545
6543
  else if (function(u, l) {
6546
- return Pe && l && u.toLowerCase() === "o";
6544
+ return Le && l && u.toLowerCase() === "o";
6547
6545
  }(t, s)) r.preventDefault(), Cr = !0, O(e, Ht, !0);
6548
6546
  else if (function(u, l) {
6549
6547
  return Gi(u) && !l;
6550
6548
  }(t, n)) Cr = !1, O(e, fn, r);
6551
6549
  else if (function(u, l, a, c) {
6552
- return Pe ? !l && !a && (ar(u) || u.toLowerCase() === "h" && c) : !(c || l || a) && ar(u);
6550
+ return Le ? !l && !a && (ar(u) || u.toLowerCase() === "h" && c) : !(c || l || a) && ar(u);
6553
6551
  }(t, i, o, s)) ar(t) ? O(e, ou, r) : (r.preventDefault(), O(e, Et, !0));
6554
6552
  else if (/* @__PURE__ */ function(u) {
6555
6553
  return u === "Escape";
6556
6554
  }(t)) O(e, uu, r);
6557
6555
  else if (function(u, l, a, c, f) {
6558
- return Pe ? !(a || c || f) && (cr(u) || u.toLowerCase() === "d" && l) : !(l || c || f) && cr(u);
6556
+ return Le ? !(a || c || f) && (cr(u) || u.toLowerCase() === "d" && l) : !(l || c || f) && cr(u);
6559
6557
  }(t, s, n, i, o)) cr(t) ? O(e, lu, r) : (r.preventDefault(), O(e, Et, !1));
6560
6558
  else if (function(u, l, a) {
6561
- return ar(u) && (Pe ? l : a);
6559
+ return ar(u) && (Le ? l : a);
6562
6560
  }(t, i, s)) r.preventDefault(), O(e, Sr, !0);
6563
6561
  else if (function(u, l, a) {
6564
- return cr(u) && (Pe ? l : a);
6562
+ return cr(u) && (Le ? l : a);
6565
6563
  }(t, i, s)) r.preventDefault(), O(e, Sr, !1);
6566
6564
  else if (function(u, l) {
6567
- return Pe && l && ar(u);
6565
+ return Le && l && ar(u);
6568
6566
  }(t, o)) r.preventDefault(), O(e, Tr, !0);
6569
6567
  else if (function(u, l) {
6570
- return Pe && l && cr(u);
6568
+ return Le && l && cr(u);
6571
6569
  }(t, o)) r.preventDefault(), O(e, Tr, !1);
6572
6570
  else if (function(u, l, a, c) {
6573
6571
  return u.toLowerCase() === "b" && !l && gr(a, c);
6574
- }(t, i, o, s)) r.preventDefault(), O(e, je, "bold");
6572
+ }(t, i, o, s)) r.preventDefault(), O(e, Re, "bold");
6575
6573
  else if (function(u, l, a, c) {
6576
6574
  return u.toLowerCase() === "u" && !l && gr(a, c);
6577
- }(t, i, o, s)) r.preventDefault(), O(e, je, "underline");
6575
+ }(t, i, o, s)) r.preventDefault(), O(e, Re, "underline");
6578
6576
  else if (function(u, l, a, c) {
6579
6577
  return u.toLowerCase() === "i" && !l && gr(a, c);
6580
- }(t, i, o, s)) r.preventDefault(), O(e, je, "italic");
6578
+ }(t, i, o, s)) r.preventDefault(), O(e, Re, "italic");
6581
6579
  else if (/* @__PURE__ */ function(u, l, a, c) {
6582
6580
  return u === "Tab" && !l && !a && !c;
6583
6581
  }(t, i, s, o)) O(e, Ca, r);
@@ -6585,14 +6583,14 @@ const tt = Object.freeze({}), Ps = 30, Os = [["keydown", function(r, e) {
6585
6583
  return u.toLowerCase() === "z" && !l && gr(a, c);
6586
6584
  }(t, n, o, s)) r.preventDefault(), O(e, Gs, void 0);
6587
6585
  else if (function(u, l, a, c) {
6588
- return Pe ? u.toLowerCase() === "z" && a && l : u.toLowerCase() === "y" && c || u.toLowerCase() === "z" && c && l;
6586
+ return Le ? u.toLowerCase() === "z" && a && l : u.toLowerCase() === "y" && c || u.toLowerCase() === "z" && c && l;
6589
6587
  }(t, n, o, s)) r.preventDefault(), O(e, Js, void 0);
6590
6588
  else {
6591
6589
  const u = e._editorState._selection;
6592
6590
  u === null || B(u) ? !mt && Ji(t, o, s) && (r.preventDefault(), O(e, As, r)) : function(l, a, c, f) {
6593
- return !a && l.toLowerCase() === "c" && (Pe ? c : f);
6591
+ return !a && l.toLowerCase() === "c" && (Le ? c : f);
6594
6592
  }(t, n, o, s) ? (r.preventDefault(), O(e, Ln, r)) : function(l, a, c, f) {
6595
- return !a && l.toLowerCase() === "x" && (Pe ? c : f);
6593
+ return !a && l.toLowerCase() === "x" && (Le ? c : f);
6596
6594
  }(t, n, o, s) ? (r.preventDefault(), O(e, Qs, r)) : Ji(t, o, s) && (r.preventDefault(), O(e, As, r));
6597
6595
  }
6598
6596
  /* @__PURE__ */ (function(u, l, a, c) {
@@ -6730,16 +6728,16 @@ hn && Os.push(["beforeinput", (r, e) => function(t, n) {
6730
6728
  O(n, Tr, !1);
6731
6729
  break;
6732
6730
  case "formatStrikeThrough":
6733
- O(n, je, "strikethrough");
6731
+ O(n, Re, "strikethrough");
6734
6732
  break;
6735
6733
  case "formatBold":
6736
- O(n, je, "bold");
6734
+ O(n, Re, "bold");
6737
6735
  break;
6738
6736
  case "formatItalic":
6739
- O(n, je, "italic");
6737
+ O(n, Re, "italic");
6740
6738
  break;
6741
6739
  case "formatUnderline":
6742
- O(n, je, "underline");
6740
+ O(n, Re, "underline");
6743
6741
  break;
6744
6742
  case "historyUndo":
6745
6743
  O(n, Gs, void 0);
@@ -6808,7 +6806,7 @@ function ps(r, e) {
6808
6806
  const t = r._compositionKey;
6809
6807
  if (he(null), t !== null && e != null) {
6810
6808
  if (e === "") {
6811
- const n = ge(t), s = yn(r.getElementByKey(t));
6809
+ const n = pe(t), s = yn(r.getElementByKey(t));
6812
6810
  return void (s !== null && s.nodeValue !== null && L(n) && ci(n, s.nodeValue, null, null, !0));
6813
6811
  }
6814
6812
  if (e[e.length - 1] === `
@@ -6907,7 +6905,7 @@ class qn {
6907
6905
  let e = this.__key;
6908
6906
  for (; e !== null; ) {
6909
6907
  if (e === "root") return !0;
6910
- const t = ge(e);
6908
+ const t = pe(e);
6911
6909
  if (t === null) break;
6912
6910
  e = t.__parent;
6913
6911
  }
@@ -6943,7 +6941,7 @@ class qn {
6943
6941
  }
6944
6942
  getParent() {
6945
6943
  const e = this.getLatest().__parent;
6946
- return e === null ? null : ge(e);
6944
+ return e === null ? null : pe(e);
6947
6945
  }
6948
6946
  getParentOrThrow() {
6949
6947
  const e = this.getParent();
@@ -6976,7 +6974,7 @@ class qn {
6976
6974
  }
6977
6975
  getPreviousSibling() {
6978
6976
  const e = this.getLatest().__prev;
6979
- return e === null ? null : ge(e);
6977
+ return e === null ? null : pe(e);
6980
6978
  }
6981
6979
  getPreviousSiblings() {
6982
6980
  const e = [], t = this.getParent();
@@ -6987,7 +6985,7 @@ class qn {
6987
6985
  }
6988
6986
  getNextSibling() {
6989
6987
  const e = this.getLatest().__next;
6990
- return e === null ? null : ge(e);
6988
+ return e === null ? null : pe(e);
6991
6989
  }
6992
6990
  getNextSiblings() {
6993
6991
  const e = [];
@@ -7076,7 +7074,7 @@ class qn {
7076
7074
  return e !== null && e.has(this.__key);
7077
7075
  }
7078
7076
  getLatest() {
7079
- const e = ge(this.__key);
7077
+ const e = pe(this.__key);
7080
7078
  return e === null && N(113), e;
7081
7079
  }
7082
7080
  getWritable() {
@@ -7691,7 +7689,7 @@ class Cc {
7691
7689
  return t === n ? s < o : t.isBefore(n);
7692
7690
  }
7693
7691
  getNode() {
7694
- const e = ge(this.key);
7692
+ const e = pe(this.key);
7695
7693
  return e === null && N(20), e;
7696
7694
  }
7697
7695
  set(e, t, n) {
@@ -7789,7 +7787,7 @@ class zn {
7789
7787
  if (e !== null) return e;
7790
7788
  const t = this._nodes, n = [];
7791
7789
  for (const s of t) {
7792
- const o = ge(s);
7790
+ const o = pe(s);
7793
7791
  o !== null && n.push(o);
7794
7792
  }
7795
7793
  return Ur() || (this._cachedNodes = n), n;
@@ -8474,10 +8472,10 @@ function Ec(r, e, t, n, s, o, i) {
8474
8472
  const Se = document.createRange();
8475
8473
  Se.selectNode(W), ne = Se.getBoundingClientRect();
8476
8474
  } else ne = W.getBoundingClientRect();
8477
- (function(Se, $e, vt) {
8475
+ (function(Se, Me, vt) {
8478
8476
  const ut = vt.ownerDocument, ae = ut.defaultView;
8479
8477
  if (ae === null) return;
8480
- let { top: Le, bottom: qe } = $e, lt = 0, at = 0, ve = vt;
8478
+ let { top: $e, bottom: qe } = Me, lt = 0, at = 0, ve = vt;
8481
8479
  for (; ve !== null; ) {
8482
8480
  const Ze = ve === ut.body;
8483
8481
  if (Ze) lt = 0, at = Mn(Se).innerHeight;
@@ -8486,12 +8484,12 @@ function Ec(r, e, t, n, s, o, i) {
8486
8484
  lt = ze.top, at = ze.bottom;
8487
8485
  }
8488
8486
  let Te = 0;
8489
- if (Le < lt ? Te = -(lt - Le) : qe > at && (Te = qe - at), Te !== 0) if (Ze) ae.scrollBy(0, Te);
8487
+ if ($e < lt ? Te = -(lt - $e) : qe > at && (Te = qe - at), Te !== 0) if (Ze) ae.scrollBy(0, Te);
8490
8488
  else {
8491
8489
  const ze = ve.scrollTop;
8492
8490
  ve.scrollTop += Te;
8493
8491
  const et = ve.scrollTop - ze;
8494
- Le -= et, qe -= et;
8492
+ $e -= et, qe -= et;
8495
8493
  }
8496
8494
  if (Ze) break;
8497
8495
  ve = Ir(ve);
@@ -9004,7 +9002,7 @@ class ot extends qn {
9004
9002
  }
9005
9003
  getFirstChild() {
9006
9004
  const e = this.getLatest().__first;
9007
- return e === null ? null : ge(e);
9005
+ return e === null ? null : pe(e);
9008
9006
  }
9009
9007
  getFirstChildOrThrow() {
9010
9008
  const e = this.getFirstChild();
@@ -9012,7 +9010,7 @@ class ot extends qn {
9012
9010
  }
9013
9011
  getLastChild() {
9014
9012
  const e = this.getLatest().__last;
9015
- return e === null ? null : ge(e);
9013
+ return e === null ? null : pe(e);
9016
9014
  }
9017
9015
  getLastChildOrThrow() {
9018
9016
  const e = this.getLastChild();
@@ -9700,7 +9698,7 @@ class Wn {
9700
9698
  }
9701
9699
  }
9702
9700
  Wn.version = "0.21.0+prod.esm";
9703
- const rl = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Oc = rl ? er : pe, nn = { tag: "history-merge" };
9701
+ const rl = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Oc = rl ? er : ge, nn = { tag: "history-merge" };
9704
9702
  function Rc({ initialConfig: r, children: e }) {
9705
9703
  const t = Pt(() => {
9706
9704
  const { theme: n, namespace: s, nodes: o, onError: i, editorState: u, html: l } = r, a = _a(null, n), c = Pc({ editable: r.editable, html: l, namespace: s, nodes: o, onError: (f) => i(f, c), theme: n });
@@ -9737,7 +9735,7 @@ function Rc({ initialConfig: r, children: e }) {
9737
9735
  s.setEditable(n === void 0 || n);
9738
9736
  }, []), v.jsx(eu.Provider, { value: t, children: e });
9739
9737
  }
9740
- const jc = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er : pe;
9738
+ const jc = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er : ge;
9741
9739
  function Ic(r) {
9742
9740
  return { initialValueFn: () => r.isEditable(), subscribe: (e) => r.registerEditableListener(e) };
9743
9741
  }
@@ -10405,7 +10403,7 @@ function xd(r) {
10405
10403
  }, G), r.registerCommand(Cs, () => {
10406
10404
  const e = j();
10407
10405
  return !!B(e) && (e.removeText(), !0);
10408
- }, G), r.registerCommand(je, (e) => {
10406
+ }, G), r.registerCommand(Re, (e) => {
10409
10407
  const t = j();
10410
10408
  return !!B(t) && (t.formatText(e), !0);
10411
10409
  }, G), r.registerCommand(ka, (e) => {
@@ -10544,7 +10542,7 @@ function xd(r) {
10544
10542
  }(e, r), !0);
10545
10543
  }, G));
10546
10544
  }
10547
- const qs = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er : pe;
10545
+ const qs = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er : ge;
10548
10546
  function Oo(r) {
10549
10547
  return r.getEditorState().read(nl(r.isComposing()));
10550
10548
  }
@@ -10555,7 +10553,7 @@ function vd({ contentEditable: r, placeholder: e = null, ErrorBoundary: t }) {
10555
10553
  ql(() => {
10556
10554
  l(a);
10557
10555
  });
10558
- }), [o]), pe(() => {
10556
+ }), [o]), ge(() => {
10559
10557
  l(o.getDecorators());
10560
10558
  }, [o]), Pt(() => {
10561
10559
  const a = [], c = Object.keys(u);
@@ -10587,7 +10585,7 @@ function bd({ content: r }) {
10587
10585
  }(e), n = Mc();
10588
10586
  return t ? typeof r == "function" ? r(n) : r : null;
10589
10587
  }
10590
- const pl = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er : pe;
10588
+ const pl = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er : ge;
10591
10589
  function Dd({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: n, ariaDescribedBy: s, ariaErrorMessage: o, ariaExpanded: i, ariaInvalid: u, ariaLabel: l, ariaLabelledBy: a, ariaMultiline: c, ariaOwns: f, ariaRequired: d, autoCapitalize: h, className: p, id: g, role: _ = "textbox", spellCheck: D = !0, style: y, tabIndex: w, "data-testid": x, ...C }, b) {
10592
10590
  const [k, A] = Q(r.isEditable()), S = Z((F) => {
10593
10591
  F && F.ownerDocument && F.ownerDocument.defaultView ? r.setRootElement(F) : r.setRootElement(null);
@@ -10632,12 +10630,12 @@ function Ed({ content: r, editor: e }) {
10632
10630
  let o = null;
10633
10631
  return typeof r == "function" ? o = r(n) : r !== null && (o = r), o === null ? null : v.jsx("div", { "aria-hidden": !0, children: o });
10634
10632
  }
10635
- const un = 0, zs = 1, Us = 2, Re = 0, kd = 1, jo = 2, Sd = 3, Td = 4;
10633
+ const un = 0, zs = 1, Us = 2, Oe = 0, kd = 1, jo = 2, Sd = 3, Td = 4;
10636
10634
  function Bd(r, e, t, n, s) {
10637
- if (r === null || t.size === 0 && n.size === 0 && !s) return Re;
10635
+ if (r === null || t.size === 0 && n.size === 0 && !s) return Oe;
10638
10636
  const o = e._selection, i = r._selection;
10639
10637
  if (s) return kd;
10640
- if (!(B(o) && B(i) && i.isCollapsed() && o.isCollapsed())) return Re;
10638
+ if (!(B(o) && B(i) && i.isCollapsed() && o.isCollapsed())) return Oe;
10641
10639
  const u = function(D, y, w) {
10642
10640
  const x = D._nodeMap, C = [];
10643
10641
  for (const b of y) {
@@ -10651,31 +10649,31 @@ function Bd(r, e, t, n, s) {
10651
10649
  }
10652
10650
  return C;
10653
10651
  }(e, t, n);
10654
- if (u.length === 0) return Re;
10652
+ if (u.length === 0) return Oe;
10655
10653
  if (u.length > 1) {
10656
10654
  const D = e._nodeMap, y = D.get(o.anchor.key), w = D.get(i.anchor.key);
10657
- return y && w && !r._nodeMap.has(y.__key) && L(y) && y.__text.length === 1 && o.anchor.offset === 1 ? jo : Re;
10655
+ return y && w && !r._nodeMap.has(y.__key) && L(y) && y.__text.length === 1 && o.anchor.offset === 1 ? jo : Oe;
10658
10656
  }
10659
10657
  const l = u[0], a = r._nodeMap.get(l.__key);
10660
- if (!L(a) || !L(l) || a.__mode !== l.__mode) return Re;
10658
+ if (!L(a) || !L(l) || a.__mode !== l.__mode) return Oe;
10661
10659
  const c = a.__text, f = l.__text;
10662
- if (c === f) return Re;
10660
+ if (c === f) return Oe;
10663
10661
  const d = o.anchor, h = i.anchor;
10664
- if (d.key !== h.key || d.type !== "text") return Re;
10662
+ if (d.key !== h.key || d.type !== "text") return Oe;
10665
10663
  const p = d.offset, g = h.offset, _ = f.length - c.length;
10666
- return _ === 1 && g === p - 1 ? jo : _ === -1 && g === p + 1 ? Sd : _ === -1 && g === p ? Td : Re;
10664
+ return _ === 1 && g === p - 1 ? jo : _ === -1 && g === p + 1 ? Sd : _ === -1 && g === p ? Td : Oe;
10667
10665
  }
10668
10666
  function Nd(r, e) {
10669
- let t = Date.now(), n = Re;
10667
+ let t = Date.now(), n = Oe;
10670
10668
  return (s, o, i, u, l, a) => {
10671
10669
  const c = Date.now();
10672
- if (a.has("historic")) return n = Re, t = c, Us;
10670
+ if (a.has("historic")) return n = Oe, t = c, Us;
10673
10671
  const f = Bd(s, o, u, l, r.isComposing()), d = (() => {
10674
10672
  const h = i === null || i.editor === r, p = a.has("history-push");
10675
10673
  if (!p && h && a.has("history-merge")) return un;
10676
10674
  if (s === null) return zs;
10677
10675
  const g = o._selection;
10678
- return u.size > 0 || l.size > 0 ? p === !1 && f !== Re && f === n && c < t + e && h || u.size === 1 && function(_, D, y) {
10676
+ return u.size > 0 || l.size > 0 ? p === !1 && f !== Oe && f === n && c < t + e && h || u.size === 1 && function(_, D, y) {
10679
10677
  const w = D._nodeMap.get(_), x = y._nodeMap.get(_), C = D._selection, b = y._selection;
10680
10678
  return !(B(C) && B(b) && C.anchor.type === "element" && C.focus.type === "element" && b.anchor.type === "text" && b.focus.type === "text" || !L(w) || !L(x) || w.__parent !== x.__parent) && JSON.stringify(D.read(() => w.exportJSON())) === JSON.stringify(y.read(() => x.exportJSON()));
10681
10679
  }(Array.from(u)[0], s, o) ? un : zs : g !== null ? un : Us;
@@ -10718,10 +10716,10 @@ function Pd({ delay: r, externalHistoryState: e }) {
10718
10716
  const [t] = Ye();
10719
10717
  return function(n, s, o = 1e3) {
10720
10718
  const i = Pt(() => s || Ld(), [s]);
10721
- pe(() => Fd(n, i, o), [o, n, i]);
10719
+ ge(() => Fd(n, i, o), [o, n, i]);
10722
10720
  }(t, e, r), null;
10723
10721
  }
10724
- const Od = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er : pe;
10722
+ const Od = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? er : ge;
10725
10723
  function Rd({ ignoreHistoryMergeTagChange: r = !0, ignoreSelectionChange: e = !1, onChange: t }) {
10726
10724
  const [n] = Ye();
10727
10725
  return Od(() => {
@@ -11329,10 +11327,10 @@ function Jd(r) {
11329
11327
  }
11330
11328
  function Qd() {
11331
11329
  const [r] = Ye();
11332
- return pe(() => {
11330
+ return ge(() => {
11333
11331
  if (!r.hasNodes([sr, Rt])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
11334
11332
  }, [r]), function(e) {
11335
- pe(() => Jd(e), [e]);
11333
+ ge(() => Jd(e), [e]);
11336
11334
  }(r), null;
11337
11335
  }
11338
11336
  const Yd = /* @__PURE__ */ new Set(["http:", "https:", "mailto:", "sms:", "tel:"]);
@@ -11533,7 +11531,7 @@ function vs(r, e = {}) {
11533
11531
  }
11534
11532
  function ef({ validateUrl: r, attributes: e }) {
11535
11533
  const [t] = Ye();
11536
- return pe(() => {
11534
+ return ge(() => {
11537
11535
  if (!t.hasNodes([jt])) throw new Error("LinkPlugin: LinkNode not registered on editor");
11538
11536
  return Ot(t.registerCommand(Jo, (n) => {
11539
11537
  if (n === null) return vs(n), !0;
@@ -11584,11 +11582,11 @@ const tf = {
11584
11582
  };
11585
11583
  function nf({ theme: r, disabled: e }) {
11586
11584
  const [t] = Ye(), n = Z(() => {
11587
- t.dispatchCommand(je, "bold");
11585
+ t.dispatchCommand(Re, "bold");
11588
11586
  }, [t]), s = Z(() => {
11589
- t.dispatchCommand(je, "italic");
11587
+ t.dispatchCommand(Re, "italic");
11590
11588
  }, [t]), o = Z(() => {
11591
- t.dispatchCommand(je, "underline");
11589
+ t.dispatchCommand(Re, "underline");
11592
11590
  }, [t]), i = Z(() => {
11593
11591
  t.dispatchCommand(yl, void 0);
11594
11592
  }, [t]), u = Z(() => {
@@ -11744,7 +11742,7 @@ function nf({ theme: r, disabled: e }) {
11744
11742
  }
11745
11743
  function sf({ html: r }) {
11746
11744
  const [e] = Ye();
11747
- return pe(() => {
11745
+ return ge(() => {
11748
11746
  r && e.update(() => {
11749
11747
  const t = re();
11750
11748
  t.clear();