@sovann72-dev/lynqify-ui 1.0.4 → 1.0.8

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.
@@ -0,0 +1,1955 @@
1
+ import V, { useRef as ar, useState as Et, useDebugValue as yt, useEffect as _t, createContext as Re, useMemo as Se, createRef as ur, memo as cr, createElement as gt, useContext as we, forwardRef as lr, version as Qe, useLayoutEffect as fr } from "react";
2
+ import dr, { flushSync as hr } from "react-dom";
3
+ import { d as pr, f as vr, aX as mr, ax as Er, j as yr, a6 as _r, E as gr } from "./core-DSeuwlI1.js";
4
+ var re = { exports: {} }, me = {};
5
+ /**
6
+ * @license React
7
+ * use-sync-external-store-shim.production.js
8
+ *
9
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
10
+ *
11
+ * This source code is licensed under the MIT license found in the
12
+ * LICENSE file in the root directory of this source tree.
13
+ */
14
+ var et;
15
+ function Sr() {
16
+ if (et) return me;
17
+ et = 1;
18
+ var e = V;
19
+ function t(y, S) {
20
+ return y === S && (y !== 0 || 1 / y === 1 / S) || y !== y && S !== S;
21
+ }
22
+ var i = typeof Object.is == "function" ? Object.is : t, n = e.useState, o = e.useEffect, s = e.useLayoutEffect, c = e.useDebugValue;
23
+ function f(y, S) {
24
+ var m = S(), g = n({ inst: { value: m, getSnapshot: S } }), R = g[0].inst, h = g[1];
25
+ return s(
26
+ function() {
27
+ R.value = m, R.getSnapshot = S, l(R) && h({ inst: R });
28
+ },
29
+ [y, m, S]
30
+ ), o(
31
+ function() {
32
+ return l(R) && h({ inst: R }), y(function() {
33
+ l(R) && h({ inst: R });
34
+ });
35
+ },
36
+ [y]
37
+ ), c(m), m;
38
+ }
39
+ function l(y) {
40
+ var S = y.getSnapshot;
41
+ y = y.value;
42
+ try {
43
+ var m = S();
44
+ return !i(y, m);
45
+ } catch {
46
+ return !0;
47
+ }
48
+ }
49
+ function _(y, S) {
50
+ return S();
51
+ }
52
+ var d = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? _ : f;
53
+ return me.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : d, me;
54
+ }
55
+ var Ee = {};
56
+ /**
57
+ * @license React
58
+ * use-sync-external-store-shim.development.js
59
+ *
60
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
61
+ *
62
+ * This source code is licensed under the MIT license found in the
63
+ * LICENSE file in the root directory of this source tree.
64
+ */
65
+ var tt;
66
+ function br() {
67
+ return tt || (tt = 1, process.env.NODE_ENV !== "production" && (function() {
68
+ function e(m, g) {
69
+ return m === g && (m !== 0 || 1 / m === 1 / g) || m !== m && g !== g;
70
+ }
71
+ function t(m, g) {
72
+ d || o.startTransition === void 0 || (d = !0, console.error(
73
+ "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
74
+ ));
75
+ var R = g();
76
+ if (!y) {
77
+ var h = g();
78
+ s(R, h) || (console.error(
79
+ "The result of getSnapshot should be cached to avoid an infinite loop"
80
+ ), y = !0);
81
+ }
82
+ h = c({
83
+ inst: { value: R, getSnapshot: g }
84
+ });
85
+ var p = h[0].inst, v = h[1];
86
+ return l(
87
+ function() {
88
+ p.value = R, p.getSnapshot = g, i(p) && v({ inst: p });
89
+ },
90
+ [m, R, g]
91
+ ), f(
92
+ function() {
93
+ return i(p) && v({ inst: p }), m(function() {
94
+ i(p) && v({ inst: p });
95
+ });
96
+ },
97
+ [m]
98
+ ), _(R), R;
99
+ }
100
+ function i(m) {
101
+ var g = m.getSnapshot;
102
+ m = m.value;
103
+ try {
104
+ var R = g();
105
+ return !s(m, R);
106
+ } catch {
107
+ return !0;
108
+ }
109
+ }
110
+ function n(m, g) {
111
+ return g();
112
+ }
113
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
114
+ var o = V, s = typeof Object.is == "function" ? Object.is : e, c = o.useState, f = o.useEffect, l = o.useLayoutEffect, _ = o.useDebugValue, d = !1, y = !1, S = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? n : t;
115
+ Ee.useSyncExternalStore = o.useSyncExternalStore !== void 0 ? o.useSyncExternalStore : S, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
116
+ })()), Ee;
117
+ }
118
+ var rt;
119
+ function Oe() {
120
+ return rt || (rt = 1, process.env.NODE_ENV === "production" ? re.exports = Sr() : re.exports = br()), re.exports;
121
+ }
122
+ var St = Oe(), ne = { exports: {} }, H = {};
123
+ /**
124
+ * @license React
125
+ * react-jsx-runtime.production.min.js
126
+ *
127
+ * Copyright (c) Facebook, Inc. and its affiliates.
128
+ *
129
+ * This source code is licensed under the MIT license found in the
130
+ * LICENSE file in the root directory of this source tree.
131
+ */
132
+ var nt;
133
+ function Rr() {
134
+ if (nt) return H;
135
+ nt = 1;
136
+ var e = V, t = Symbol.for("react.element"), i = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, o = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
137
+ function c(f, l, _) {
138
+ var d, y = {}, S = null, m = null;
139
+ _ !== void 0 && (S = "" + _), l.key !== void 0 && (S = "" + l.key), l.ref !== void 0 && (m = l.ref);
140
+ for (d in l) n.call(l, d) && !s.hasOwnProperty(d) && (y[d] = l[d]);
141
+ if (f && f.defaultProps) for (d in l = f.defaultProps, l) y[d] === void 0 && (y[d] = l[d]);
142
+ return { $$typeof: t, type: f, key: S, ref: m, props: y, _owner: o.current };
143
+ }
144
+ return H.Fragment = i, H.jsx = c, H.jsxs = c, H;
145
+ }
146
+ var J = {};
147
+ /**
148
+ * @license React
149
+ * react-jsx-runtime.development.js
150
+ *
151
+ * Copyright (c) Facebook, Inc. and its affiliates.
152
+ *
153
+ * This source code is licensed under the MIT license found in the
154
+ * LICENSE file in the root directory of this source tree.
155
+ */
156
+ var it;
157
+ function wr() {
158
+ return it || (it = 1, process.env.NODE_ENV !== "production" && (function() {
159
+ var e = V, t = Symbol.for("react.element"), i = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), c = Symbol.for("react.provider"), f = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), _ = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), y = Symbol.for("react.memo"), S = Symbol.for("react.lazy"), m = Symbol.for("react.offscreen"), g = Symbol.iterator, R = "@@iterator";
160
+ function h(r) {
161
+ if (r === null || typeof r != "object")
162
+ return null;
163
+ var a = g && r[g] || r[R];
164
+ return typeof a == "function" ? a : null;
165
+ }
166
+ var p = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
167
+ function v(r) {
168
+ {
169
+ for (var a = arguments.length, u = new Array(a > 1 ? a - 1 : 0), E = 1; E < a; E++)
170
+ u[E - 1] = arguments[E];
171
+ M("error", r, u);
172
+ }
173
+ }
174
+ function M(r, a, u) {
175
+ {
176
+ var E = p.ReactDebugCurrentFrame, O = E.getStackAddendum();
177
+ O !== "" && (a += "%s", u = u.concat([O]));
178
+ var C = u.map(function(w) {
179
+ return String(w);
180
+ });
181
+ C.unshift("Warning: " + a), Function.prototype.apply.call(console[r], console, C);
182
+ }
183
+ }
184
+ var D = !1, A = !1, T = !1, P = !1, W = !1, Ae;
185
+ Ae = Symbol.for("react.module.reference");
186
+ function Pt(r) {
187
+ return !!(typeof r == "string" || typeof r == "function" || r === n || r === s || W || r === o || r === _ || r === d || P || r === m || D || A || T || typeof r == "object" && r !== null && (r.$$typeof === S || r.$$typeof === y || r.$$typeof === c || r.$$typeof === f || r.$$typeof === l || // This needs to include all possible module reference object
188
+ // types supported by any Flight configuration anywhere since
189
+ // we don't know which Flight build this will end up being used
190
+ // with.
191
+ r.$$typeof === Ae || r.getModuleId !== void 0));
192
+ }
193
+ function It(r, a, u) {
194
+ var E = r.displayName;
195
+ if (E)
196
+ return E;
197
+ var O = a.displayName || a.name || "";
198
+ return O !== "" ? u + "(" + O + ")" : u;
199
+ }
200
+ function xe(r) {
201
+ return r.displayName || "Context";
202
+ }
203
+ function q(r) {
204
+ if (r == null)
205
+ return null;
206
+ if (typeof r.tag == "number" && v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
207
+ return r.displayName || r.name || null;
208
+ if (typeof r == "string")
209
+ return r;
210
+ switch (r) {
211
+ case n:
212
+ return "Fragment";
213
+ case i:
214
+ return "Portal";
215
+ case s:
216
+ return "Profiler";
217
+ case o:
218
+ return "StrictMode";
219
+ case _:
220
+ return "Suspense";
221
+ case d:
222
+ return "SuspenseList";
223
+ }
224
+ if (typeof r == "object")
225
+ switch (r.$$typeof) {
226
+ case f:
227
+ var a = r;
228
+ return xe(a) + ".Consumer";
229
+ case c:
230
+ var u = r;
231
+ return xe(u._context) + ".Provider";
232
+ case l:
233
+ return It(r, r.render, "ForwardRef");
234
+ case y:
235
+ var E = r.displayName || null;
236
+ return E !== null ? E : q(r.type) || "Memo";
237
+ case S: {
238
+ var O = r, C = O._payload, w = O._init;
239
+ try {
240
+ return q(w(C));
241
+ } catch {
242
+ return null;
243
+ }
244
+ }
245
+ }
246
+ return null;
247
+ }
248
+ var F = Object.assign, z = 0, je, De, Pe, Ie, Me, Ve, ke;
249
+ function Ne() {
250
+ }
251
+ Ne.__reactDisabledLog = !0;
252
+ function Mt() {
253
+ {
254
+ if (z === 0) {
255
+ je = console.log, De = console.info, Pe = console.warn, Ie = console.error, Me = console.group, Ve = console.groupCollapsed, ke = console.groupEnd;
256
+ var r = {
257
+ configurable: !0,
258
+ enumerable: !0,
259
+ value: Ne,
260
+ writable: !0
261
+ };
262
+ Object.defineProperties(console, {
263
+ info: r,
264
+ log: r,
265
+ warn: r,
266
+ error: r,
267
+ group: r,
268
+ groupCollapsed: r,
269
+ groupEnd: r
270
+ });
271
+ }
272
+ z++;
273
+ }
274
+ }
275
+ function Vt() {
276
+ {
277
+ if (z--, z === 0) {
278
+ var r = {
279
+ configurable: !0,
280
+ enumerable: !0,
281
+ writable: !0
282
+ };
283
+ Object.defineProperties(console, {
284
+ log: F({}, r, {
285
+ value: je
286
+ }),
287
+ info: F({}, r, {
288
+ value: De
289
+ }),
290
+ warn: F({}, r, {
291
+ value: Pe
292
+ }),
293
+ error: F({}, r, {
294
+ value: Ie
295
+ }),
296
+ group: F({}, r, {
297
+ value: Me
298
+ }),
299
+ groupCollapsed: F({}, r, {
300
+ value: Ve
301
+ }),
302
+ groupEnd: F({}, r, {
303
+ value: ke
304
+ })
305
+ });
306
+ }
307
+ z < 0 && v("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
308
+ }
309
+ }
310
+ var ue = p.ReactCurrentDispatcher, ce;
311
+ function Z(r, a, u) {
312
+ {
313
+ if (ce === void 0)
314
+ try {
315
+ throw Error();
316
+ } catch (O) {
317
+ var E = O.stack.trim().match(/\n( *(at )?)/);
318
+ ce = E && E[1] || "";
319
+ }
320
+ return `
321
+ ` + ce + r;
322
+ }
323
+ }
324
+ var le = !1, Q;
325
+ {
326
+ var kt = typeof WeakMap == "function" ? WeakMap : Map;
327
+ Q = new kt();
328
+ }
329
+ function Le(r, a) {
330
+ if (!r || le)
331
+ return "";
332
+ {
333
+ var u = Q.get(r);
334
+ if (u !== void 0)
335
+ return u;
336
+ }
337
+ var E;
338
+ le = !0;
339
+ var O = Error.prepareStackTrace;
340
+ Error.prepareStackTrace = void 0;
341
+ var C;
342
+ C = ue.current, ue.current = null, Mt();
343
+ try {
344
+ if (a) {
345
+ var w = function() {
346
+ throw Error();
347
+ };
348
+ if (Object.defineProperty(w.prototype, "props", {
349
+ set: function() {
350
+ throw Error();
351
+ }
352
+ }), typeof Reflect == "object" && Reflect.construct) {
353
+ try {
354
+ Reflect.construct(w, []);
355
+ } catch (N) {
356
+ E = N;
357
+ }
358
+ Reflect.construct(r, [], w);
359
+ } else {
360
+ try {
361
+ w.call();
362
+ } catch (N) {
363
+ E = N;
364
+ }
365
+ r.call(w.prototype);
366
+ }
367
+ } else {
368
+ try {
369
+ throw Error();
370
+ } catch (N) {
371
+ E = N;
372
+ }
373
+ r();
374
+ }
375
+ } catch (N) {
376
+ if (N && E && typeof N.stack == "string") {
377
+ for (var b = N.stack.split(`
378
+ `), k = E.stack.split(`
379
+ `), x = b.length - 1, j = k.length - 1; x >= 1 && j >= 0 && b[x] !== k[j]; )
380
+ j--;
381
+ for (; x >= 1 && j >= 0; x--, j--)
382
+ if (b[x] !== k[j]) {
383
+ if (x !== 1 || j !== 1)
384
+ do
385
+ if (x--, j--, j < 0 || b[x] !== k[j]) {
386
+ var L = `
387
+ ` + b[x].replace(" at new ", " at ");
388
+ return r.displayName && L.includes("<anonymous>") && (L = L.replace("<anonymous>", r.displayName)), typeof r == "function" && Q.set(r, L), L;
389
+ }
390
+ while (x >= 1 && j >= 0);
391
+ break;
392
+ }
393
+ }
394
+ } finally {
395
+ le = !1, ue.current = C, Vt(), Error.prepareStackTrace = O;
396
+ }
397
+ var Y = r ? r.displayName || r.name : "", $ = Y ? Z(Y) : "";
398
+ return typeof r == "function" && Q.set(r, $), $;
399
+ }
400
+ function Nt(r, a, u) {
401
+ return Le(r, !1);
402
+ }
403
+ function Lt(r) {
404
+ var a = r.prototype;
405
+ return !!(a && a.isReactComponent);
406
+ }
407
+ function ee(r, a, u) {
408
+ if (r == null)
409
+ return "";
410
+ if (typeof r == "function")
411
+ return Le(r, Lt(r));
412
+ if (typeof r == "string")
413
+ return Z(r);
414
+ switch (r) {
415
+ case _:
416
+ return Z("Suspense");
417
+ case d:
418
+ return Z("SuspenseList");
419
+ }
420
+ if (typeof r == "object")
421
+ switch (r.$$typeof) {
422
+ case l:
423
+ return Nt(r.render);
424
+ case y:
425
+ return ee(r.type, a, u);
426
+ case S: {
427
+ var E = r, O = E._payload, C = E._init;
428
+ try {
429
+ return ee(C(O), a, u);
430
+ } catch {
431
+ }
432
+ }
433
+ }
434
+ return "";
435
+ }
436
+ var K = Object.prototype.hasOwnProperty, qe = {}, Ue = p.ReactDebugCurrentFrame;
437
+ function te(r) {
438
+ if (r) {
439
+ var a = r._owner, u = ee(r.type, r._source, a ? a.type : null);
440
+ Ue.setExtraStackFrame(u);
441
+ } else
442
+ Ue.setExtraStackFrame(null);
443
+ }
444
+ function qt(r, a, u, E, O) {
445
+ {
446
+ var C = Function.call.bind(K);
447
+ for (var w in r)
448
+ if (C(r, w)) {
449
+ var b = void 0;
450
+ try {
451
+ if (typeof r[w] != "function") {
452
+ var k = Error((E || "React class") + ": " + u + " type `" + w + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[w] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
453
+ throw k.name = "Invariant Violation", k;
454
+ }
455
+ b = r[w](a, w, E, u, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
456
+ } catch (x) {
457
+ b = x;
458
+ }
459
+ b && !(b instanceof Error) && (te(O), v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", E || "React class", u, w, typeof b), te(null)), b instanceof Error && !(b.message in qe) && (qe[b.message] = !0, te(O), v("Failed %s type: %s", u, b.message), te(null));
460
+ }
461
+ }
462
+ }
463
+ var Ut = Array.isArray;
464
+ function fe(r) {
465
+ return Ut(r);
466
+ }
467
+ function Wt(r) {
468
+ {
469
+ var a = typeof Symbol == "function" && Symbol.toStringTag, u = a && r[Symbol.toStringTag] || r.constructor.name || "Object";
470
+ return u;
471
+ }
472
+ }
473
+ function Ft(r) {
474
+ try {
475
+ return We(r), !1;
476
+ } catch {
477
+ return !0;
478
+ }
479
+ }
480
+ function We(r) {
481
+ return "" + r;
482
+ }
483
+ function Fe(r) {
484
+ if (Ft(r))
485
+ return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Wt(r)), We(r);
486
+ }
487
+ var $e = p.ReactCurrentOwner, $t = {
488
+ key: !0,
489
+ ref: !0,
490
+ __self: !0,
491
+ __source: !0
492
+ }, Be, Ge;
493
+ function Bt(r) {
494
+ if (K.call(r, "ref")) {
495
+ var a = Object.getOwnPropertyDescriptor(r, "ref").get;
496
+ if (a && a.isReactWarning)
497
+ return !1;
498
+ }
499
+ return r.ref !== void 0;
500
+ }
501
+ function Gt(r) {
502
+ if (K.call(r, "key")) {
503
+ var a = Object.getOwnPropertyDescriptor(r, "key").get;
504
+ if (a && a.isReactWarning)
505
+ return !1;
506
+ }
507
+ return r.key !== void 0;
508
+ }
509
+ function Yt(r, a) {
510
+ typeof r.ref == "string" && $e.current;
511
+ }
512
+ function zt(r, a) {
513
+ {
514
+ var u = function() {
515
+ Be || (Be = !0, v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", a));
516
+ };
517
+ u.isReactWarning = !0, Object.defineProperty(r, "key", {
518
+ get: u,
519
+ configurable: !0
520
+ });
521
+ }
522
+ }
523
+ function Kt(r, a) {
524
+ {
525
+ var u = function() {
526
+ Ge || (Ge = !0, v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", a));
527
+ };
528
+ u.isReactWarning = !0, Object.defineProperty(r, "ref", {
529
+ get: u,
530
+ configurable: !0
531
+ });
532
+ }
533
+ }
534
+ var Ht = function(r, a, u, E, O, C, w) {
535
+ var b = {
536
+ // This tag allows us to uniquely identify this as a React Element
537
+ $$typeof: t,
538
+ // Built-in properties that belong on the element
539
+ type: r,
540
+ key: a,
541
+ ref: u,
542
+ props: w,
543
+ // Record the component responsible for creating this element.
544
+ _owner: C
545
+ };
546
+ return b._store = {}, Object.defineProperty(b._store, "validated", {
547
+ configurable: !1,
548
+ enumerable: !1,
549
+ writable: !0,
550
+ value: !1
551
+ }), Object.defineProperty(b, "_self", {
552
+ configurable: !1,
553
+ enumerable: !1,
554
+ writable: !1,
555
+ value: E
556
+ }), Object.defineProperty(b, "_source", {
557
+ configurable: !1,
558
+ enumerable: !1,
559
+ writable: !1,
560
+ value: O
561
+ }), Object.freeze && (Object.freeze(b.props), Object.freeze(b)), b;
562
+ };
563
+ function Jt(r, a, u, E, O) {
564
+ {
565
+ var C, w = {}, b = null, k = null;
566
+ u !== void 0 && (Fe(u), b = "" + u), Gt(a) && (Fe(a.key), b = "" + a.key), Bt(a) && (k = a.ref, Yt(a, O));
567
+ for (C in a)
568
+ K.call(a, C) && !$t.hasOwnProperty(C) && (w[C] = a[C]);
569
+ if (r && r.defaultProps) {
570
+ var x = r.defaultProps;
571
+ for (C in x)
572
+ w[C] === void 0 && (w[C] = x[C]);
573
+ }
574
+ if (b || k) {
575
+ var j = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
576
+ b && zt(w, j), k && Kt(w, j);
577
+ }
578
+ return Ht(r, b, k, O, E, $e.current, w);
579
+ }
580
+ }
581
+ var de = p.ReactCurrentOwner, Ye = p.ReactDebugCurrentFrame;
582
+ function G(r) {
583
+ if (r) {
584
+ var a = r._owner, u = ee(r.type, r._source, a ? a.type : null);
585
+ Ye.setExtraStackFrame(u);
586
+ } else
587
+ Ye.setExtraStackFrame(null);
588
+ }
589
+ var he;
590
+ he = !1;
591
+ function pe(r) {
592
+ return typeof r == "object" && r !== null && r.$$typeof === t;
593
+ }
594
+ function ze() {
595
+ {
596
+ if (de.current) {
597
+ var r = q(de.current.type);
598
+ if (r)
599
+ return `
600
+
601
+ Check the render method of \`` + r + "`.";
602
+ }
603
+ return "";
604
+ }
605
+ }
606
+ function Xt(r) {
607
+ return "";
608
+ }
609
+ var Ke = {};
610
+ function Zt(r) {
611
+ {
612
+ var a = ze();
613
+ if (!a) {
614
+ var u = typeof r == "string" ? r : r.displayName || r.name;
615
+ u && (a = `
616
+
617
+ Check the top-level render call using <` + u + ">.");
618
+ }
619
+ return a;
620
+ }
621
+ }
622
+ function He(r, a) {
623
+ {
624
+ if (!r._store || r._store.validated || r.key != null)
625
+ return;
626
+ r._store.validated = !0;
627
+ var u = Zt(a);
628
+ if (Ke[u])
629
+ return;
630
+ Ke[u] = !0;
631
+ var E = "";
632
+ r && r._owner && r._owner !== de.current && (E = " It was passed a child from " + q(r._owner.type) + "."), G(r), v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', u, E), G(null);
633
+ }
634
+ }
635
+ function Je(r, a) {
636
+ {
637
+ if (typeof r != "object")
638
+ return;
639
+ if (fe(r))
640
+ for (var u = 0; u < r.length; u++) {
641
+ var E = r[u];
642
+ pe(E) && He(E, a);
643
+ }
644
+ else if (pe(r))
645
+ r._store && (r._store.validated = !0);
646
+ else if (r) {
647
+ var O = h(r);
648
+ if (typeof O == "function" && O !== r.entries)
649
+ for (var C = O.call(r), w; !(w = C.next()).done; )
650
+ pe(w.value) && He(w.value, a);
651
+ }
652
+ }
653
+ }
654
+ function Qt(r) {
655
+ {
656
+ var a = r.type;
657
+ if (a == null || typeof a == "string")
658
+ return;
659
+ var u;
660
+ if (typeof a == "function")
661
+ u = a.propTypes;
662
+ else if (typeof a == "object" && (a.$$typeof === l || // Note: Memo only checks outer props here.
663
+ // Inner props are checked in the reconciler.
664
+ a.$$typeof === y))
665
+ u = a.propTypes;
666
+ else
667
+ return;
668
+ if (u) {
669
+ var E = q(a);
670
+ qt(u, r.props, "prop", E, r);
671
+ } else if (a.PropTypes !== void 0 && !he) {
672
+ he = !0;
673
+ var O = q(a);
674
+ v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", O || "Unknown");
675
+ }
676
+ typeof a.getDefaultProps == "function" && !a.getDefaultProps.isReactClassApproved && v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
677
+ }
678
+ }
679
+ function er(r) {
680
+ {
681
+ for (var a = Object.keys(r.props), u = 0; u < a.length; u++) {
682
+ var E = a[u];
683
+ if (E !== "children" && E !== "key") {
684
+ G(r), v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", E), G(null);
685
+ break;
686
+ }
687
+ }
688
+ r.ref !== null && (G(r), v("Invalid attribute `ref` supplied to `React.Fragment`."), G(null));
689
+ }
690
+ }
691
+ var Xe = {};
692
+ function Ze(r, a, u, E, O, C) {
693
+ {
694
+ var w = Pt(r);
695
+ if (!w) {
696
+ var b = "";
697
+ (r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (b += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
698
+ var k = Xt();
699
+ k ? b += k : b += ze();
700
+ var x;
701
+ r === null ? x = "null" : fe(r) ? x = "array" : r !== void 0 && r.$$typeof === t ? (x = "<" + (q(r.type) || "Unknown") + " />", b = " Did you accidentally export a JSX literal instead of a component?") : x = typeof r, v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", x, b);
702
+ }
703
+ var j = Jt(r, a, u, O, C);
704
+ if (j == null)
705
+ return j;
706
+ if (w) {
707
+ var L = a.children;
708
+ if (L !== void 0)
709
+ if (E)
710
+ if (fe(L)) {
711
+ for (var Y = 0; Y < L.length; Y++)
712
+ Je(L[Y], r);
713
+ Object.freeze && Object.freeze(L);
714
+ } else
715
+ v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
716
+ else
717
+ Je(L, r);
718
+ }
719
+ if (K.call(a, "key")) {
720
+ var $ = q(r), N = Object.keys(a).filter(function(sr) {
721
+ return sr !== "key";
722
+ }), ve = N.length > 0 ? "{key: someKey, " + N.join(": ..., ") + ": ...}" : "{key: someKey}";
723
+ if (!Xe[$ + ve]) {
724
+ var or = N.length > 0 ? "{" + N.join(": ..., ") + ": ...}" : "{}";
725
+ v(`A props object containing a "key" prop is being spread into JSX:
726
+ let props = %s;
727
+ <%s {...props} />
728
+ React keys must be passed directly to JSX without using spread:
729
+ let props = %s;
730
+ <%s key={someKey} {...props} />`, ve, $, or, $), Xe[$ + ve] = !0;
731
+ }
732
+ }
733
+ return r === n ? er(j) : Qt(j), j;
734
+ }
735
+ }
736
+ function tr(r, a, u) {
737
+ return Ze(r, a, u, !0);
738
+ }
739
+ function rr(r, a, u) {
740
+ return Ze(r, a, u, !1);
741
+ }
742
+ var nr = rr, ir = tr;
743
+ J.Fragment = n, J.jsx = nr, J.jsxs = ir;
744
+ })()), J;
745
+ }
746
+ var ot;
747
+ function Or() {
748
+ return ot || (ot = 1, process.env.NODE_ENV === "production" ? ne.exports = Rr() : ne.exports = wr()), ne.exports;
749
+ }
750
+ var I = Or();
751
+ const { getOwnPropertyNames: Cr, getOwnPropertySymbols: Tr } = Object, { hasOwnProperty: Ar } = Object.prototype;
752
+ function ye(e, t) {
753
+ return function(n, o, s) {
754
+ return e(n, o, s) && t(n, o, s);
755
+ };
756
+ }
757
+ function ie(e) {
758
+ return function(i, n, o) {
759
+ if (!i || !n || typeof i != "object" || typeof n != "object")
760
+ return e(i, n, o);
761
+ const { cache: s } = o, c = s.get(i), f = s.get(n);
762
+ if (c && f)
763
+ return c === n && f === i;
764
+ s.set(i, n), s.set(n, i);
765
+ const l = e(i, n, o);
766
+ return s.delete(i), s.delete(n), l;
767
+ };
768
+ }
769
+ function xr(e) {
770
+ return e != null ? e[Symbol.toStringTag] : void 0;
771
+ }
772
+ function st(e) {
773
+ return Cr(e).concat(Tr(e));
774
+ }
775
+ const jr = (
776
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
777
+ Object.hasOwn || ((e, t) => Ar.call(e, t))
778
+ );
779
+ function B(e, t) {
780
+ return e === t || !e && !t && e !== e && t !== t;
781
+ }
782
+ const Dr = "__v", Pr = "__o", Ir = "_owner", { getOwnPropertyDescriptor: at, keys: ut } = Object;
783
+ function Mr(e, t) {
784
+ return e.byteLength === t.byteLength && se(new Uint8Array(e), new Uint8Array(t));
785
+ }
786
+ function Vr(e, t, i) {
787
+ let n = e.length;
788
+ if (t.length !== n)
789
+ return !1;
790
+ for (; n-- > 0; )
791
+ if (!i.equals(e[n], t[n], n, n, e, t, i))
792
+ return !1;
793
+ return !0;
794
+ }
795
+ function kr(e, t) {
796
+ return e.byteLength === t.byteLength && se(new Uint8Array(e.buffer, e.byteOffset, e.byteLength), new Uint8Array(t.buffer, t.byteOffset, t.byteLength));
797
+ }
798
+ function Nr(e, t) {
799
+ return B(e.getTime(), t.getTime());
800
+ }
801
+ function Lr(e, t) {
802
+ return e.name === t.name && e.message === t.message && e.cause === t.cause && e.stack === t.stack;
803
+ }
804
+ function qr(e, t) {
805
+ return e === t;
806
+ }
807
+ function ct(e, t, i) {
808
+ const n = e.size;
809
+ if (n !== t.size)
810
+ return !1;
811
+ if (!n)
812
+ return !0;
813
+ const o = new Array(n), s = e.entries();
814
+ let c, f, l = 0;
815
+ for (; (c = s.next()) && !c.done; ) {
816
+ const _ = t.entries();
817
+ let d = !1, y = 0;
818
+ for (; (f = _.next()) && !f.done; ) {
819
+ if (o[y]) {
820
+ y++;
821
+ continue;
822
+ }
823
+ const S = c.value, m = f.value;
824
+ if (i.equals(S[0], m[0], l, y, e, t, i) && i.equals(S[1], m[1], S[0], m[0], e, t, i)) {
825
+ d = o[y] = !0;
826
+ break;
827
+ }
828
+ y++;
829
+ }
830
+ if (!d)
831
+ return !1;
832
+ l++;
833
+ }
834
+ return !0;
835
+ }
836
+ const Ur = B;
837
+ function Wr(e, t, i) {
838
+ const n = ut(e);
839
+ let o = n.length;
840
+ if (ut(t).length !== o)
841
+ return !1;
842
+ for (; o-- > 0; )
843
+ if (!bt(e, t, i, n[o]))
844
+ return !1;
845
+ return !0;
846
+ }
847
+ function X(e, t, i) {
848
+ const n = st(e);
849
+ let o = n.length;
850
+ if (st(t).length !== o)
851
+ return !1;
852
+ let s, c, f;
853
+ for (; o-- > 0; )
854
+ if (s = n[o], !bt(e, t, i, s) || (c = at(e, s), f = at(t, s), (c || f) && (!c || !f || c.configurable !== f.configurable || c.enumerable !== f.enumerable || c.writable !== f.writable)))
855
+ return !1;
856
+ return !0;
857
+ }
858
+ function Fr(e, t) {
859
+ return B(e.valueOf(), t.valueOf());
860
+ }
861
+ function $r(e, t) {
862
+ return e.source === t.source && e.flags === t.flags;
863
+ }
864
+ function lt(e, t, i) {
865
+ const n = e.size;
866
+ if (n !== t.size)
867
+ return !1;
868
+ if (!n)
869
+ return !0;
870
+ const o = new Array(n), s = e.values();
871
+ let c, f;
872
+ for (; (c = s.next()) && !c.done; ) {
873
+ const l = t.values();
874
+ let _ = !1, d = 0;
875
+ for (; (f = l.next()) && !f.done; ) {
876
+ if (!o[d] && i.equals(c.value, f.value, c.value, f.value, e, t, i)) {
877
+ _ = o[d] = !0;
878
+ break;
879
+ }
880
+ d++;
881
+ }
882
+ if (!_)
883
+ return !1;
884
+ }
885
+ return !0;
886
+ }
887
+ function se(e, t) {
888
+ let i = e.byteLength;
889
+ if (t.byteLength !== i || e.byteOffset !== t.byteOffset)
890
+ return !1;
891
+ for (; i-- > 0; )
892
+ if (e[i] !== t[i])
893
+ return !1;
894
+ return !0;
895
+ }
896
+ function Br(e, t) {
897
+ return e.hostname === t.hostname && e.pathname === t.pathname && e.protocol === t.protocol && e.port === t.port && e.hash === t.hash && e.username === t.username && e.password === t.password;
898
+ }
899
+ function bt(e, t, i, n) {
900
+ return (n === Ir || n === Pr || n === Dr) && (e.$$typeof || t.$$typeof) ? !0 : jr(t, n) && i.equals(e[n], t[n], n, n, e, t, i);
901
+ }
902
+ const Gr = "[object ArrayBuffer]", Yr = "[object Arguments]", zr = "[object Boolean]", Kr = "[object DataView]", Hr = "[object Date]", Jr = "[object Error]", Xr = "[object Map]", Zr = "[object Number]", Qr = "[object Object]", en = "[object RegExp]", tn = "[object Set]", rn = "[object String]", nn = {
903
+ "[object Int8Array]": !0,
904
+ "[object Uint8Array]": !0,
905
+ "[object Uint8ClampedArray]": !0,
906
+ "[object Int16Array]": !0,
907
+ "[object Uint16Array]": !0,
908
+ "[object Int32Array]": !0,
909
+ "[object Uint32Array]": !0,
910
+ "[object Float16Array]": !0,
911
+ "[object Float32Array]": !0,
912
+ "[object Float64Array]": !0,
913
+ "[object BigInt64Array]": !0,
914
+ "[object BigUint64Array]": !0
915
+ }, on = "[object URL]", sn = Object.prototype.toString;
916
+ function an({ areArrayBuffersEqual: e, areArraysEqual: t, areDataViewsEqual: i, areDatesEqual: n, areErrorsEqual: o, areFunctionsEqual: s, areMapsEqual: c, areNumbersEqual: f, areObjectsEqual: l, arePrimitiveWrappersEqual: _, areRegExpsEqual: d, areSetsEqual: y, areTypedArraysEqual: S, areUrlsEqual: m, unknownTagComparators: g }) {
917
+ return function(h, p, v) {
918
+ if (h === p)
919
+ return !0;
920
+ if (h == null || p == null)
921
+ return !1;
922
+ const M = typeof h;
923
+ if (M !== typeof p)
924
+ return !1;
925
+ if (M !== "object")
926
+ return M === "number" ? f(h, p, v) : M === "function" ? s(h, p, v) : !1;
927
+ const D = h.constructor;
928
+ if (D !== p.constructor)
929
+ return !1;
930
+ if (D === Object)
931
+ return l(h, p, v);
932
+ if (Array.isArray(h))
933
+ return t(h, p, v);
934
+ if (D === Date)
935
+ return n(h, p, v);
936
+ if (D === RegExp)
937
+ return d(h, p, v);
938
+ if (D === Map)
939
+ return c(h, p, v);
940
+ if (D === Set)
941
+ return y(h, p, v);
942
+ const A = sn.call(h);
943
+ if (A === Hr)
944
+ return n(h, p, v);
945
+ if (A === en)
946
+ return d(h, p, v);
947
+ if (A === Xr)
948
+ return c(h, p, v);
949
+ if (A === tn)
950
+ return y(h, p, v);
951
+ if (A === Qr)
952
+ return typeof h.then != "function" && typeof p.then != "function" && l(h, p, v);
953
+ if (A === on)
954
+ return m(h, p, v);
955
+ if (A === Jr)
956
+ return o(h, p, v);
957
+ if (A === Yr)
958
+ return l(h, p, v);
959
+ if (nn[A])
960
+ return S(h, p, v);
961
+ if (A === Gr)
962
+ return e(h, p, v);
963
+ if (A === Kr)
964
+ return i(h, p, v);
965
+ if (A === zr || A === Zr || A === rn)
966
+ return _(h, p, v);
967
+ if (g) {
968
+ let T = g[A];
969
+ if (!T) {
970
+ const P = xr(h);
971
+ P && (T = g[P]);
972
+ }
973
+ if (T)
974
+ return T(h, p, v);
975
+ }
976
+ return !1;
977
+ };
978
+ }
979
+ function un({ circular: e, createCustomConfig: t, strict: i }) {
980
+ let n = {
981
+ areArrayBuffersEqual: Mr,
982
+ areArraysEqual: i ? X : Vr,
983
+ areDataViewsEqual: kr,
984
+ areDatesEqual: Nr,
985
+ areErrorsEqual: Lr,
986
+ areFunctionsEqual: qr,
987
+ areMapsEqual: i ? ye(ct, X) : ct,
988
+ areNumbersEqual: Ur,
989
+ areObjectsEqual: i ? X : Wr,
990
+ arePrimitiveWrappersEqual: Fr,
991
+ areRegExpsEqual: $r,
992
+ areSetsEqual: i ? ye(lt, X) : lt,
993
+ areTypedArraysEqual: i ? ye(se, X) : se,
994
+ areUrlsEqual: Br,
995
+ unknownTagComparators: void 0
996
+ };
997
+ if (t && (n = Object.assign({}, n, t(n))), e) {
998
+ const o = ie(n.areArraysEqual), s = ie(n.areMapsEqual), c = ie(n.areObjectsEqual), f = ie(n.areSetsEqual);
999
+ n = Object.assign({}, n, {
1000
+ areArraysEqual: o,
1001
+ areMapsEqual: s,
1002
+ areObjectsEqual: c,
1003
+ areSetsEqual: f
1004
+ });
1005
+ }
1006
+ return n;
1007
+ }
1008
+ function cn(e) {
1009
+ return function(t, i, n, o, s, c, f) {
1010
+ return e(t, i, f);
1011
+ };
1012
+ }
1013
+ function ln({ circular: e, comparator: t, createState: i, equals: n, strict: o }) {
1014
+ if (i)
1015
+ return function(f, l) {
1016
+ const { cache: _ = e ? /* @__PURE__ */ new WeakMap() : void 0, meta: d } = i();
1017
+ return t(f, l, {
1018
+ cache: _,
1019
+ equals: n,
1020
+ meta: d,
1021
+ strict: o
1022
+ });
1023
+ };
1024
+ if (e)
1025
+ return function(f, l) {
1026
+ return t(f, l, {
1027
+ cache: /* @__PURE__ */ new WeakMap(),
1028
+ equals: n,
1029
+ meta: void 0,
1030
+ strict: o
1031
+ });
1032
+ };
1033
+ const s = {
1034
+ cache: void 0,
1035
+ equals: n,
1036
+ meta: void 0,
1037
+ strict: o
1038
+ };
1039
+ return function(f, l) {
1040
+ return t(f, l, s);
1041
+ };
1042
+ }
1043
+ const fn = U();
1044
+ U({ strict: !0 });
1045
+ U({ circular: !0 });
1046
+ U({
1047
+ circular: !0,
1048
+ strict: !0
1049
+ });
1050
+ U({
1051
+ createInternalComparator: () => B
1052
+ });
1053
+ U({
1054
+ strict: !0,
1055
+ createInternalComparator: () => B
1056
+ });
1057
+ U({
1058
+ circular: !0,
1059
+ createInternalComparator: () => B
1060
+ });
1061
+ U({
1062
+ circular: !0,
1063
+ createInternalComparator: () => B,
1064
+ strict: !0
1065
+ });
1066
+ function U(e = {}) {
1067
+ const { circular: t = !1, createInternalComparator: i, createState: n, strict: o = !1 } = e, s = un(e), c = an(s), f = i ? i(c) : cn(c);
1068
+ return ln({ circular: t, comparator: c, createState: n, equals: f, strict: o });
1069
+ }
1070
+ var oe = { exports: {} }, _e = {};
1071
+ /**
1072
+ * @license React
1073
+ * use-sync-external-store-shim/with-selector.production.js
1074
+ *
1075
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
1076
+ *
1077
+ * This source code is licensed under the MIT license found in the
1078
+ * LICENSE file in the root directory of this source tree.
1079
+ */
1080
+ var ft;
1081
+ function dn() {
1082
+ if (ft) return _e;
1083
+ ft = 1;
1084
+ var e = V, t = Oe();
1085
+ function i(_, d) {
1086
+ return _ === d && (_ !== 0 || 1 / _ === 1 / d) || _ !== _ && d !== d;
1087
+ }
1088
+ var n = typeof Object.is == "function" ? Object.is : i, o = t.useSyncExternalStore, s = e.useRef, c = e.useEffect, f = e.useMemo, l = e.useDebugValue;
1089
+ return _e.useSyncExternalStoreWithSelector = function(_, d, y, S, m) {
1090
+ var g = s(null);
1091
+ if (g.current === null) {
1092
+ var R = { hasValue: !1, value: null };
1093
+ g.current = R;
1094
+ } else R = g.current;
1095
+ g = f(
1096
+ function() {
1097
+ function p(T) {
1098
+ if (!v) {
1099
+ if (v = !0, M = T, T = S(T), m !== void 0 && R.hasValue) {
1100
+ var P = R.value;
1101
+ if (m(P, T))
1102
+ return D = P;
1103
+ }
1104
+ return D = T;
1105
+ }
1106
+ if (P = D, n(M, T)) return P;
1107
+ var W = S(T);
1108
+ return m !== void 0 && m(P, W) ? (M = T, P) : (M = T, D = W);
1109
+ }
1110
+ var v = !1, M, D, A = y === void 0 ? null : y;
1111
+ return [
1112
+ function() {
1113
+ return p(d());
1114
+ },
1115
+ A === null ? void 0 : function() {
1116
+ return p(A());
1117
+ }
1118
+ ];
1119
+ },
1120
+ [d, y, S, m]
1121
+ );
1122
+ var h = o(_, g[0], g[1]);
1123
+ return c(
1124
+ function() {
1125
+ R.hasValue = !0, R.value = h;
1126
+ },
1127
+ [h]
1128
+ ), l(h), h;
1129
+ }, _e;
1130
+ }
1131
+ var ge = {};
1132
+ /**
1133
+ * @license React
1134
+ * use-sync-external-store-shim/with-selector.development.js
1135
+ *
1136
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
1137
+ *
1138
+ * This source code is licensed under the MIT license found in the
1139
+ * LICENSE file in the root directory of this source tree.
1140
+ */
1141
+ var dt;
1142
+ function hn() {
1143
+ return dt || (dt = 1, process.env.NODE_ENV !== "production" && (function() {
1144
+ function e(_, d) {
1145
+ return _ === d && (_ !== 0 || 1 / _ === 1 / d) || _ !== _ && d !== d;
1146
+ }
1147
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
1148
+ var t = V, i = Oe(), n = typeof Object.is == "function" ? Object.is : e, o = i.useSyncExternalStore, s = t.useRef, c = t.useEffect, f = t.useMemo, l = t.useDebugValue;
1149
+ ge.useSyncExternalStoreWithSelector = function(_, d, y, S, m) {
1150
+ var g = s(null);
1151
+ if (g.current === null) {
1152
+ var R = { hasValue: !1, value: null };
1153
+ g.current = R;
1154
+ } else R = g.current;
1155
+ g = f(
1156
+ function() {
1157
+ function p(T) {
1158
+ if (!v) {
1159
+ if (v = !0, M = T, T = S(T), m !== void 0 && R.hasValue) {
1160
+ var P = R.value;
1161
+ if (m(P, T))
1162
+ return D = P;
1163
+ }
1164
+ return D = T;
1165
+ }
1166
+ if (P = D, n(M, T))
1167
+ return P;
1168
+ var W = S(T);
1169
+ return m !== void 0 && m(P, W) ? (M = T, P) : (M = T, D = W);
1170
+ }
1171
+ var v = !1, M, D, A = y === void 0 ? null : y;
1172
+ return [
1173
+ function() {
1174
+ return p(d());
1175
+ },
1176
+ A === null ? void 0 : function() {
1177
+ return p(A());
1178
+ }
1179
+ ];
1180
+ },
1181
+ [d, y, S, m]
1182
+ );
1183
+ var h = o(_, g[0], g[1]);
1184
+ return c(
1185
+ function() {
1186
+ R.hasValue = !0, R.value = h;
1187
+ },
1188
+ [h]
1189
+ ), l(h), h;
1190
+ }, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1191
+ })()), ge;
1192
+ }
1193
+ var ht;
1194
+ function pn() {
1195
+ return ht || (ht = 1, process.env.NODE_ENV === "production" ? oe.exports = dn() : oe.exports = hn()), oe.exports;
1196
+ }
1197
+ var vn = pn(), mn = (...e) => (t) => {
1198
+ e.forEach((i) => {
1199
+ typeof i == "function" ? i(t) : i && (i.current = t);
1200
+ });
1201
+ }, En = ({ contentComponent: e }) => {
1202
+ const t = St.useSyncExternalStore(
1203
+ e.subscribe,
1204
+ e.getSnapshot,
1205
+ e.getServerSnapshot
1206
+ );
1207
+ return /* @__PURE__ */ I.jsx(I.Fragment, { children: Object.values(t) });
1208
+ };
1209
+ function yn() {
1210
+ const e = /* @__PURE__ */ new Set();
1211
+ let t = {};
1212
+ return {
1213
+ /**
1214
+ * Subscribe to the editor instance's changes.
1215
+ */
1216
+ subscribe(i) {
1217
+ return e.add(i), () => {
1218
+ e.delete(i);
1219
+ };
1220
+ },
1221
+ getSnapshot() {
1222
+ return t;
1223
+ },
1224
+ getServerSnapshot() {
1225
+ return t;
1226
+ },
1227
+ /**
1228
+ * Adds a new NodeView Renderer to the editor.
1229
+ */
1230
+ setRenderer(i, n) {
1231
+ t = {
1232
+ ...t,
1233
+ [i]: dr.createPortal(n.reactElement, n.element, i)
1234
+ }, e.forEach((o) => o());
1235
+ },
1236
+ /**
1237
+ * Removes a NodeView Renderer from the editor.
1238
+ */
1239
+ removeRenderer(i) {
1240
+ const n = { ...t };
1241
+ delete n[i], t = n, e.forEach((o) => o());
1242
+ }
1243
+ };
1244
+ }
1245
+ var _n = class extends V.Component {
1246
+ constructor(e) {
1247
+ super(e), this.editorContentRef = V.createRef();
1248
+ }
1249
+ componentDidMount() {
1250
+ this.init();
1251
+ }
1252
+ componentDidUpdate() {
1253
+ this.init();
1254
+ }
1255
+ init() {
1256
+ var e;
1257
+ const t = this.props.editor;
1258
+ if (t && !t.isDestroyed && ((e = t.view.dom) != null && e.parentNode)) {
1259
+ if (t.contentComponent)
1260
+ return;
1261
+ const i = this.editorContentRef.current;
1262
+ i.append(...t.view.dom.parentNode.childNodes), t.setOptions({
1263
+ element: i
1264
+ }), t.contentComponent = yn(), t.createNodeViews(), t.isEditorContentInitialized = !0, this.forceUpdate();
1265
+ }
1266
+ }
1267
+ componentWillUnmount() {
1268
+ var e;
1269
+ const t = this.props.editor;
1270
+ if (t) {
1271
+ t.isEditorContentInitialized = !1, t.isDestroyed || t.view.setProps({
1272
+ nodeViews: {}
1273
+ }), t.contentComponent = null;
1274
+ try {
1275
+ if (!((e = t.view.dom) != null && e.parentNode))
1276
+ return;
1277
+ const i = document.createElement("div");
1278
+ i.append(...t.view.dom.parentNode.childNodes), t.setOptions({
1279
+ element: i
1280
+ });
1281
+ } catch {
1282
+ }
1283
+ }
1284
+ }
1285
+ render() {
1286
+ const { editor: e, innerRef: t, ...i } = this.props;
1287
+ return /* @__PURE__ */ I.jsxs(I.Fragment, { children: [
1288
+ /* @__PURE__ */ I.jsx("div", { ref: mn(t, this.editorContentRef), ...i }),
1289
+ (e == null ? void 0 : e.contentComponent) && /* @__PURE__ */ I.jsx(En, { contentComponent: e.contentComponent })
1290
+ ] });
1291
+ }
1292
+ }, gn = lr(
1293
+ (e, t) => {
1294
+ const i = V.useMemo(() => Math.floor(Math.random() * 4294967295).toString(), [e.editor]);
1295
+ return V.createElement(_n, {
1296
+ key: i,
1297
+ innerRef: t,
1298
+ ...e
1299
+ });
1300
+ }
1301
+ ), Rt = V.memo(gn), Sn = typeof window < "u" ? fr : _t, bn = class {
1302
+ constructor(e) {
1303
+ this.transactionNumber = 0, this.lastTransactionNumber = 0, this.subscribers = /* @__PURE__ */ new Set(), this.editor = e, this.lastSnapshot = { editor: e, transactionNumber: 0 }, this.getSnapshot = this.getSnapshot.bind(this), this.getServerSnapshot = this.getServerSnapshot.bind(this), this.watch = this.watch.bind(this), this.subscribe = this.subscribe.bind(this);
1304
+ }
1305
+ /**
1306
+ * Get the current editor instance.
1307
+ */
1308
+ getSnapshot() {
1309
+ return this.transactionNumber === this.lastTransactionNumber ? this.lastSnapshot : (this.lastTransactionNumber = this.transactionNumber, this.lastSnapshot = { editor: this.editor, transactionNumber: this.transactionNumber }, this.lastSnapshot);
1310
+ }
1311
+ /**
1312
+ * Always disable the editor on the server-side.
1313
+ */
1314
+ getServerSnapshot() {
1315
+ return { editor: null, transactionNumber: 0 };
1316
+ }
1317
+ /**
1318
+ * Subscribe to the editor instance's changes.
1319
+ */
1320
+ subscribe(e) {
1321
+ return this.subscribers.add(e), () => {
1322
+ this.subscribers.delete(e);
1323
+ };
1324
+ }
1325
+ /**
1326
+ * Watch the editor instance for changes.
1327
+ */
1328
+ watch(e) {
1329
+ if (this.editor = e, this.editor) {
1330
+ const t = () => {
1331
+ this.transactionNumber += 1, this.subscribers.forEach((n) => n());
1332
+ }, i = this.editor;
1333
+ return i.on("transaction", t), () => {
1334
+ i.off("transaction", t);
1335
+ };
1336
+ }
1337
+ }
1338
+ };
1339
+ function wt(e) {
1340
+ var t;
1341
+ const [i] = Et(() => new bn(e.editor)), n = vn.useSyncExternalStoreWithSelector(
1342
+ i.subscribe,
1343
+ i.getSnapshot,
1344
+ i.getServerSnapshot,
1345
+ e.selector,
1346
+ (t = e.equalityFn) != null ? t : fn
1347
+ );
1348
+ return Sn(() => i.watch(e.editor), [e.editor, i]), yt(n), n;
1349
+ }
1350
+ var pt = process.env.NODE_ENV !== "production", be = typeof window > "u", Rn = be || !!(typeof window < "u" && window.next), wn = class Ot {
1351
+ constructor(t) {
1352
+ this.editor = null, this.subscriptions = /* @__PURE__ */ new Set(), this.isComponentMounted = !1, this.previousDeps = null, this.instanceId = "", this.options = t, this.subscriptions = /* @__PURE__ */ new Set(), this.setEditor(this.getInitialEditor()), this.scheduleDestroy(), this.getEditor = this.getEditor.bind(this), this.getServerSnapshot = this.getServerSnapshot.bind(this), this.subscribe = this.subscribe.bind(this), this.refreshEditorInstance = this.refreshEditorInstance.bind(this), this.scheduleDestroy = this.scheduleDestroy.bind(this), this.onRender = this.onRender.bind(this), this.createEditor = this.createEditor.bind(this);
1353
+ }
1354
+ setEditor(t) {
1355
+ this.editor = t, this.instanceId = Math.random().toString(36).slice(2, 9), this.subscriptions.forEach((i) => i());
1356
+ }
1357
+ getInitialEditor() {
1358
+ if (this.options.current.immediatelyRender === void 0) {
1359
+ if (be || Rn) {
1360
+ if (pt)
1361
+ throw new Error(
1362
+ "Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches."
1363
+ );
1364
+ return null;
1365
+ }
1366
+ return this.createEditor();
1367
+ }
1368
+ if (this.options.current.immediatelyRender && be && pt)
1369
+ throw new Error(
1370
+ "Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches."
1371
+ );
1372
+ return this.options.current.immediatelyRender ? this.createEditor() : null;
1373
+ }
1374
+ /**
1375
+ * Create a new editor instance. And attach event listeners.
1376
+ */
1377
+ createEditor() {
1378
+ const t = {
1379
+ ...this.options.current,
1380
+ // Always call the most recent version of the callback function by default
1381
+ onBeforeCreate: (...n) => {
1382
+ var o, s;
1383
+ return (s = (o = this.options.current).onBeforeCreate) == null ? void 0 : s.call(o, ...n);
1384
+ },
1385
+ onBlur: (...n) => {
1386
+ var o, s;
1387
+ return (s = (o = this.options.current).onBlur) == null ? void 0 : s.call(o, ...n);
1388
+ },
1389
+ onCreate: (...n) => {
1390
+ var o, s;
1391
+ return (s = (o = this.options.current).onCreate) == null ? void 0 : s.call(o, ...n);
1392
+ },
1393
+ onDestroy: (...n) => {
1394
+ var o, s;
1395
+ return (s = (o = this.options.current).onDestroy) == null ? void 0 : s.call(o, ...n);
1396
+ },
1397
+ onFocus: (...n) => {
1398
+ var o, s;
1399
+ return (s = (o = this.options.current).onFocus) == null ? void 0 : s.call(o, ...n);
1400
+ },
1401
+ onSelectionUpdate: (...n) => {
1402
+ var o, s;
1403
+ return (s = (o = this.options.current).onSelectionUpdate) == null ? void 0 : s.call(o, ...n);
1404
+ },
1405
+ onTransaction: (...n) => {
1406
+ var o, s;
1407
+ return (s = (o = this.options.current).onTransaction) == null ? void 0 : s.call(o, ...n);
1408
+ },
1409
+ onUpdate: (...n) => {
1410
+ var o, s;
1411
+ return (s = (o = this.options.current).onUpdate) == null ? void 0 : s.call(o, ...n);
1412
+ },
1413
+ onContentError: (...n) => {
1414
+ var o, s;
1415
+ return (s = (o = this.options.current).onContentError) == null ? void 0 : s.call(o, ...n);
1416
+ },
1417
+ onDrop: (...n) => {
1418
+ var o, s;
1419
+ return (s = (o = this.options.current).onDrop) == null ? void 0 : s.call(o, ...n);
1420
+ },
1421
+ onPaste: (...n) => {
1422
+ var o, s;
1423
+ return (s = (o = this.options.current).onPaste) == null ? void 0 : s.call(o, ...n);
1424
+ },
1425
+ onDelete: (...n) => {
1426
+ var o, s;
1427
+ return (s = (o = this.options.current).onDelete) == null ? void 0 : s.call(o, ...n);
1428
+ }
1429
+ };
1430
+ return new gr(t);
1431
+ }
1432
+ /**
1433
+ * Get the current editor instance.
1434
+ */
1435
+ getEditor() {
1436
+ return this.editor;
1437
+ }
1438
+ /**
1439
+ * Always disable the editor on the server-side.
1440
+ */
1441
+ getServerSnapshot() {
1442
+ return null;
1443
+ }
1444
+ /**
1445
+ * Subscribe to the editor instance's changes.
1446
+ */
1447
+ subscribe(t) {
1448
+ return this.subscriptions.add(t), () => {
1449
+ this.subscriptions.delete(t);
1450
+ };
1451
+ }
1452
+ static compareOptions(t, i) {
1453
+ return Object.keys(t).every((n) => [
1454
+ "onCreate",
1455
+ "onBeforeCreate",
1456
+ "onDestroy",
1457
+ "onUpdate",
1458
+ "onTransaction",
1459
+ "onFocus",
1460
+ "onBlur",
1461
+ "onSelectionUpdate",
1462
+ "onContentError",
1463
+ "onDrop",
1464
+ "onPaste"
1465
+ ].includes(n) ? !0 : n === "extensions" && t.extensions && i.extensions ? t.extensions.length !== i.extensions.length ? !1 : t.extensions.every((o, s) => {
1466
+ var c;
1467
+ return o === ((c = i.extensions) == null ? void 0 : c[s]);
1468
+ }) : t[n] === i[n]);
1469
+ }
1470
+ /**
1471
+ * On each render, we will create, update, or destroy the editor instance.
1472
+ * @param deps The dependencies to watch for changes
1473
+ * @returns A cleanup function
1474
+ */
1475
+ onRender(t) {
1476
+ return () => (this.isComponentMounted = !0, clearTimeout(this.scheduledDestructionTimeout), this.editor && !this.editor.isDestroyed && t.length === 0 ? Ot.compareOptions(this.options.current, this.editor.options) || this.editor.setOptions({
1477
+ ...this.options.current,
1478
+ editable: this.editor.isEditable
1479
+ }) : this.refreshEditorInstance(t), () => {
1480
+ this.isComponentMounted = !1, this.scheduleDestroy();
1481
+ });
1482
+ }
1483
+ /**
1484
+ * Recreate the editor instance if the dependencies have changed.
1485
+ */
1486
+ refreshEditorInstance(t) {
1487
+ if (this.editor && !this.editor.isDestroyed) {
1488
+ if (this.previousDeps === null) {
1489
+ this.previousDeps = t;
1490
+ return;
1491
+ }
1492
+ if (this.previousDeps.length === t.length && this.previousDeps.every((n, o) => n === t[o]))
1493
+ return;
1494
+ }
1495
+ this.editor && !this.editor.isDestroyed && this.editor.destroy(), this.setEditor(this.createEditor()), this.previousDeps = t;
1496
+ }
1497
+ /**
1498
+ * Schedule the destruction of the editor instance.
1499
+ * This will only destroy the editor if it was not mounted on the next tick.
1500
+ * This is to avoid destroying the editor instance when it's actually still mounted.
1501
+ */
1502
+ scheduleDestroy() {
1503
+ const t = this.instanceId, i = this.editor;
1504
+ this.scheduledDestructionTimeout = setTimeout(() => {
1505
+ if (this.isComponentMounted && this.instanceId === t) {
1506
+ i && i.setOptions(this.options.current);
1507
+ return;
1508
+ }
1509
+ i && !i.isDestroyed && (i.destroy(), this.instanceId === t && this.setEditor(null));
1510
+ }, 1);
1511
+ }
1512
+ };
1513
+ function On(e = {}, t = []) {
1514
+ const i = ar(e);
1515
+ i.current = e;
1516
+ const [n] = Et(() => new wn(i)), o = St.useSyncExternalStore(
1517
+ n.subscribe,
1518
+ n.getEditor,
1519
+ n.getServerSnapshot
1520
+ );
1521
+ return yt(o), _t(n.onRender(t)), wt({
1522
+ editor: o,
1523
+ selector: ({ transactionNumber: s }) => e.shouldRerenderOnTransaction === !1 || e.shouldRerenderOnTransaction === void 0 ? null : e.immediatelyRender && s === 0 ? 0 : s + 1
1524
+ }), o;
1525
+ }
1526
+ var ae = Re({
1527
+ editor: null
1528
+ }), Cn = ae.Consumer, Vn = () => we(ae);
1529
+ function kn({
1530
+ children: e,
1531
+ slotAfter: t,
1532
+ slotBefore: i,
1533
+ editorContainerProps: n = {},
1534
+ ...o
1535
+ }) {
1536
+ const s = On(o), c = Se(() => ({ editor: s }), [s]);
1537
+ return s ? /* @__PURE__ */ I.jsxs(ae.Provider, { value: c, children: [
1538
+ i,
1539
+ /* @__PURE__ */ I.jsx(Cn, { children: ({ editor: f }) => /* @__PURE__ */ I.jsx(Rt, { editor: f, ...n }) }),
1540
+ e,
1541
+ t
1542
+ ] }) : null;
1543
+ }
1544
+ var Ce = Re({
1545
+ onDragStart: () => {
1546
+ },
1547
+ nodeViewContentChildren: void 0,
1548
+ nodeViewContentRef: () => {
1549
+ }
1550
+ }), Nn = ({ children: e, content: t }) => gt(Ce.Provider, { value: { nodeViewContentChildren: t } }, e), Ct = () => we(Ce);
1551
+ function Ln({
1552
+ as: e = "div",
1553
+ ...t
1554
+ }) {
1555
+ const { nodeViewContentRef: i, nodeViewContentChildren: n } = Ct();
1556
+ return (
1557
+ // @ts-ignore
1558
+ /* @__PURE__ */ I.jsx(
1559
+ e,
1560
+ {
1561
+ ...t,
1562
+ ref: i,
1563
+ "data-node-view-content": "",
1564
+ style: {
1565
+ whiteSpace: "pre-wrap",
1566
+ ...t.style
1567
+ },
1568
+ children: n
1569
+ }
1570
+ )
1571
+ );
1572
+ }
1573
+ var qn = V.forwardRef((e, t) => {
1574
+ const { onDragStart: i } = Ct(), n = e.as || "div";
1575
+ return (
1576
+ // @ts-ignore
1577
+ /* @__PURE__ */ I.jsx(
1578
+ n,
1579
+ {
1580
+ ...e,
1581
+ ref: t,
1582
+ "data-node-view-wrapper": "",
1583
+ onDragStart: i,
1584
+ style: {
1585
+ whiteSpace: "normal",
1586
+ ...e.style
1587
+ }
1588
+ }
1589
+ )
1590
+ );
1591
+ });
1592
+ function vt(e) {
1593
+ return !!(typeof e == "function" && e.prototype && e.prototype.isReactComponent);
1594
+ }
1595
+ function mt(e) {
1596
+ return !!(typeof e == "object" && e.$$typeof && (e.$$typeof.toString() === "Symbol(react.forward_ref)" || e.$$typeof.description === "react.forward_ref"));
1597
+ }
1598
+ function Tn(e) {
1599
+ return !!(typeof e == "object" && e.$$typeof && (e.$$typeof.toString() === "Symbol(react.memo)" || e.$$typeof.description === "react.memo"));
1600
+ }
1601
+ function An(e) {
1602
+ if (vt(e) || mt(e))
1603
+ return !0;
1604
+ if (Tn(e)) {
1605
+ const t = e.type;
1606
+ if (t)
1607
+ return vt(t) || mt(t);
1608
+ }
1609
+ return !1;
1610
+ }
1611
+ function xn() {
1612
+ try {
1613
+ if (Qe)
1614
+ return parseInt(Qe.split(".")[0], 10) >= 19;
1615
+ } catch {
1616
+ }
1617
+ return !1;
1618
+ }
1619
+ var Tt = class {
1620
+ /**
1621
+ * Immediately creates element and renders the provided React component.
1622
+ */
1623
+ constructor(e, { editor: t, props: i = {}, as: n = "div", className: o = "" }) {
1624
+ this.ref = null, this.destroyed = !1, this.id = Math.floor(Math.random() * 4294967295).toString(), this.component = e, this.editor = t, this.props = i, this.element = document.createElement(n), this.element.classList.add("react-renderer"), o && this.element.classList.add(...o.split(" ")), this.editor.isEditorContentInitialized ? hr(() => {
1625
+ this.render();
1626
+ }) : queueMicrotask(() => {
1627
+ this.destroyed || this.render();
1628
+ });
1629
+ }
1630
+ /**
1631
+ * Render the React component.
1632
+ */
1633
+ render() {
1634
+ var e;
1635
+ if (this.destroyed)
1636
+ return;
1637
+ const t = this.component, i = this.props, n = this.editor, o = xn(), s = An(t), c = { ...i };
1638
+ c.ref && !(o || s) && delete c.ref, !c.ref && (o || s) && (c.ref = (f) => {
1639
+ this.ref = f;
1640
+ }), this.reactElement = /* @__PURE__ */ I.jsx(t, { ...c }), (e = n == null ? void 0 : n.contentComponent) == null || e.setRenderer(this.id, this);
1641
+ }
1642
+ /**
1643
+ * Re-renders the React component with new props.
1644
+ */
1645
+ updateProps(e = {}) {
1646
+ this.destroyed || (this.props = {
1647
+ ...this.props,
1648
+ ...e
1649
+ }, this.render());
1650
+ }
1651
+ /**
1652
+ * Destroy the React component.
1653
+ */
1654
+ destroy() {
1655
+ var e;
1656
+ this.destroyed = !0;
1657
+ const t = this.editor;
1658
+ (e = t == null ? void 0 : t.contentComponent) == null || e.removeRenderer(this.id);
1659
+ try {
1660
+ this.element && this.element.parentNode && this.element.parentNode.removeChild(this.element);
1661
+ } catch {
1662
+ }
1663
+ }
1664
+ /**
1665
+ * Update the attributes of the element that holds the React component.
1666
+ */
1667
+ updateAttributes(e) {
1668
+ Object.keys(e).forEach((t) => {
1669
+ this.element.setAttribute(t, e[t]);
1670
+ });
1671
+ }
1672
+ }, At = V.createContext({
1673
+ markViewContentRef: () => {
1674
+ }
1675
+ }), Un = (e) => {
1676
+ const { as: t = "span", ...i } = e, { markViewContentRef: n } = V.useContext(At);
1677
+ return (
1678
+ // @ts-ignore
1679
+ /* @__PURE__ */ I.jsx(t, { ...i, ref: n, "data-mark-view-content": "" })
1680
+ );
1681
+ }, jn = class extends pr {
1682
+ constructor(e, t, i) {
1683
+ super(e, t, i);
1684
+ const { as: n = "span", attrs: o, className: s = "" } = i || {}, c = { ...t, updateAttributes: this.updateAttributes.bind(this) };
1685
+ this.contentDOMElement = document.createElement("span");
1686
+ const l = {
1687
+ markViewContentRef: (d) => {
1688
+ d && !d.contains(this.contentDOMElement) && d.appendChild(this.contentDOMElement);
1689
+ }
1690
+ }, _ = V.memo((d) => /* @__PURE__ */ I.jsx(At.Provider, { value: l, children: V.createElement(e, d) }));
1691
+ _.displayName = "ReactMarkView", this.renderer = new Tt(_, {
1692
+ editor: t.editor,
1693
+ props: c,
1694
+ as: n,
1695
+ className: `mark-${t.mark.type.name} ${s}`.trim()
1696
+ }), o && this.renderer.updateAttributes(o);
1697
+ }
1698
+ get dom() {
1699
+ return this.renderer.element;
1700
+ }
1701
+ get contentDOM() {
1702
+ return this.contentDOMElement;
1703
+ }
1704
+ };
1705
+ function Wn(e, t = {}) {
1706
+ return (i) => new jn(e, i, t);
1707
+ }
1708
+ var Dn = class extends vr {
1709
+ constructor(e, t, i) {
1710
+ if (super(e, t, i), this.selectionRafId = null, this.positionCheckCallback = null, this.cachedExtensionWithSyncedStorage = null, !this.node.isLeaf) {
1711
+ this.options.contentDOMElementTag ? this.contentDOMElement = document.createElement(this.options.contentDOMElementTag) : this.contentDOMElement = document.createElement(this.node.isInline ? "span" : "div"), this.contentDOMElement.dataset.nodeViewContentReact = "", this.contentDOMElement.dataset.nodeViewWrapper = "", this.contentDOMElement.style.whiteSpace = "inherit";
1712
+ const n = this.dom.querySelector("[data-node-view-content]");
1713
+ if (!n)
1714
+ return;
1715
+ n.appendChild(this.contentDOMElement);
1716
+ }
1717
+ }
1718
+ /**
1719
+ * Returns a proxy of the extension that redirects storage access to the editor's mutable storage.
1720
+ * This preserves the original prototype chain (instanceof checks, methods like configure/extend work).
1721
+ * Cached to avoid proxy creation on every update.
1722
+ */
1723
+ get extensionWithSyncedStorage() {
1724
+ if (!this.cachedExtensionWithSyncedStorage) {
1725
+ const e = this.editor, t = this.extension;
1726
+ this.cachedExtensionWithSyncedStorage = new Proxy(t, {
1727
+ get(i, n, o) {
1728
+ var s;
1729
+ return n === "storage" ? (s = e.storage[t.name]) != null ? s : {} : Reflect.get(i, n, o);
1730
+ }
1731
+ });
1732
+ }
1733
+ return this.cachedExtensionWithSyncedStorage;
1734
+ }
1735
+ /**
1736
+ * Setup the React component.
1737
+ * Called on initialization.
1738
+ */
1739
+ mount() {
1740
+ const e = {
1741
+ editor: this.editor,
1742
+ node: this.node,
1743
+ decorations: this.decorations,
1744
+ innerDecorations: this.innerDecorations,
1745
+ view: this.view,
1746
+ selected: !1,
1747
+ extension: this.extensionWithSyncedStorage,
1748
+ HTMLAttributes: this.HTMLAttributes,
1749
+ getPos: () => this.getPos(),
1750
+ updateAttributes: (l = {}) => this.updateAttributes(l),
1751
+ deleteNode: () => this.deleteNode(),
1752
+ ref: ur()
1753
+ };
1754
+ if (!this.component.displayName) {
1755
+ const l = (_) => _.charAt(0).toUpperCase() + _.substring(1);
1756
+ this.component.displayName = l(this.extension.name);
1757
+ }
1758
+ const n = { onDragStart: this.onDragStart.bind(this), nodeViewContentRef: (l) => {
1759
+ l && this.contentDOMElement && l.firstChild !== this.contentDOMElement && (l.hasAttribute("data-node-view-wrapper") && l.removeAttribute("data-node-view-wrapper"), l.appendChild(this.contentDOMElement));
1760
+ } }, o = this.component, s = cr((l) => /* @__PURE__ */ I.jsx(Ce.Provider, { value: n, children: gt(o, l) }));
1761
+ s.displayName = "ReactNodeView";
1762
+ let c = this.node.isInline ? "span" : "div";
1763
+ this.options.as && (c = this.options.as);
1764
+ const { className: f = "" } = this.options;
1765
+ this.handleSelectionUpdate = this.handleSelectionUpdate.bind(this), this.renderer = new Tt(s, {
1766
+ editor: this.editor,
1767
+ props: e,
1768
+ as: c,
1769
+ className: `node-${this.node.type.name} ${f}`.trim()
1770
+ }), this.editor.on("selectionUpdate", this.handleSelectionUpdate), this.updateElementAttributes(), this.currentPos = this.getPos(), this.positionCheckCallback = () => {
1771
+ const l = this.getPos();
1772
+ typeof l != "number" || l === this.currentPos || (this.currentPos = l, this.renderer.updateProps({ getPos: () => this.getPos() }), typeof this.options.attrs == "function" && this.updateElementAttributes());
1773
+ }, mr(this.editor, this.positionCheckCallback);
1774
+ }
1775
+ /**
1776
+ * Return the DOM element.
1777
+ * This is the element that will be used to display the node view.
1778
+ */
1779
+ get dom() {
1780
+ var e;
1781
+ if (this.renderer.element.firstElementChild && !((e = this.renderer.element.firstElementChild) != null && e.hasAttribute("data-node-view-wrapper")))
1782
+ throw Error("Please use the NodeViewWrapper component for your node view.");
1783
+ return this.renderer.element;
1784
+ }
1785
+ /**
1786
+ * Return the content DOM element.
1787
+ * This is the element that will be used to display the rich-text content of the node.
1788
+ */
1789
+ get contentDOM() {
1790
+ return this.node.isLeaf ? null : this.contentDOMElement;
1791
+ }
1792
+ /**
1793
+ * On editor selection update, check if the node is selected.
1794
+ * If it is, call `selectNode`, otherwise call `deselectNode`.
1795
+ */
1796
+ handleSelectionUpdate() {
1797
+ this.selectionRafId && (cancelAnimationFrame(this.selectionRafId), this.selectionRafId = null), this.selectionRafId = requestAnimationFrame(() => {
1798
+ this.selectionRafId = null;
1799
+ const e = this.currentPos;
1800
+ if (typeof e != "number")
1801
+ return;
1802
+ if (Er({
1803
+ selection: this.editor.state.selection,
1804
+ pos: e,
1805
+ nodeSize: this.node.nodeSize,
1806
+ selectedOnTextSelection: this.options.selectedOnTextSelection
1807
+ })) {
1808
+ if (this.renderer.props.selected)
1809
+ return;
1810
+ this.selectNode();
1811
+ } else {
1812
+ if (!this.renderer.props.selected)
1813
+ return;
1814
+ this.deselectNode();
1815
+ }
1816
+ });
1817
+ }
1818
+ /**
1819
+ * On update, update the React component.
1820
+ * To prevent unnecessary updates, the `update` option can be used.
1821
+ */
1822
+ update(e, t, i) {
1823
+ const n = (s) => {
1824
+ this.renderer.updateProps(s), typeof this.options.attrs == "function" && this.updateElementAttributes();
1825
+ };
1826
+ if (e.type !== this.node.type)
1827
+ return !1;
1828
+ if (typeof this.options.update == "function") {
1829
+ const s = this.node, c = this.decorations, f = this.innerDecorations;
1830
+ return this.node = e, this.decorations = t, this.innerDecorations = i, this.currentPos = this.getPos(), this.options.update({
1831
+ oldNode: s,
1832
+ oldDecorations: c,
1833
+ newNode: e,
1834
+ newDecorations: t,
1835
+ oldInnerDecorations: f,
1836
+ innerDecorations: i,
1837
+ updateProps: () => n({ node: e, decorations: t, innerDecorations: i, extension: this.extensionWithSyncedStorage })
1838
+ });
1839
+ }
1840
+ const o = this.getPos();
1841
+ return e === this.node && this.decorations === t && this.innerDecorations === i ? (o === this.currentPos || (this.currentPos = o, n({
1842
+ node: e,
1843
+ decorations: t,
1844
+ innerDecorations: i,
1845
+ extension: this.extensionWithSyncedStorage,
1846
+ getPos: () => this.getPos()
1847
+ })), !0) : (this.node = e, this.decorations = t, this.innerDecorations = i, this.currentPos = o, n({ node: e, decorations: t, innerDecorations: i, extension: this.extensionWithSyncedStorage }), !0);
1848
+ }
1849
+ /**
1850
+ * Select the node.
1851
+ * Add the `selected` prop and the `ProseMirror-selectednode` class.
1852
+ */
1853
+ selectNode() {
1854
+ this.renderer.updateProps({
1855
+ selected: !0
1856
+ }), this.renderer.element.classList.add("ProseMirror-selectednode");
1857
+ }
1858
+ /**
1859
+ * Deselect the node.
1860
+ * Remove the `selected` prop and the `ProseMirror-selectednode` class.
1861
+ */
1862
+ deselectNode() {
1863
+ this.renderer.updateProps({
1864
+ selected: !1
1865
+ }), this.renderer.element.classList.remove("ProseMirror-selectednode");
1866
+ }
1867
+ /**
1868
+ * Destroy the React component instance.
1869
+ */
1870
+ destroy() {
1871
+ this.renderer.destroy(), this.editor.off("selectionUpdate", this.handleSelectionUpdate), this.positionCheckCallback && (yr(this.editor, this.positionCheckCallback), this.positionCheckCallback = null), this.contentDOMElement = null, this.selectionRafId && (cancelAnimationFrame(this.selectionRafId), this.selectionRafId = null);
1872
+ }
1873
+ /**
1874
+ * Update the attributes of the top-level element that holds the React component.
1875
+ * Applying the attributes defined in the `attrs` option.
1876
+ */
1877
+ updateElementAttributes() {
1878
+ if (this.options.attrs) {
1879
+ let e = {};
1880
+ if (typeof this.options.attrs == "function") {
1881
+ const t = this.editor.extensionManager.attributes, i = _r(this.node, t);
1882
+ e = this.options.attrs({ node: this.node, HTMLAttributes: i });
1883
+ } else
1884
+ e = this.options.attrs;
1885
+ this.renderer.updateAttributes(e);
1886
+ }
1887
+ }
1888
+ };
1889
+ function Fn(e, t) {
1890
+ return (i) => i.editor.contentComponent ? new Dn(e, i, t) : {};
1891
+ }
1892
+ var Te = Re({
1893
+ get editor() {
1894
+ throw new Error("useTiptap must be used within a <Tiptap> provider");
1895
+ }
1896
+ });
1897
+ Te.displayName = "TiptapContext";
1898
+ var xt = () => we(Te);
1899
+ function $n(e, t) {
1900
+ const { editor: i } = xt();
1901
+ return wt({
1902
+ editor: i,
1903
+ selector: e,
1904
+ equalityFn: t
1905
+ });
1906
+ }
1907
+ function jt({ editor: e, instance: t, children: i }) {
1908
+ const n = e ?? t;
1909
+ if (!n)
1910
+ throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");
1911
+ const o = Se(() => ({ editor: n }), [n]), s = Se(() => ({ editor: n }), [n]);
1912
+ return /* @__PURE__ */ I.jsx(ae.Provider, { value: s, children: /* @__PURE__ */ I.jsx(Te.Provider, { value: o, children: i }) });
1913
+ }
1914
+ jt.displayName = "Tiptap";
1915
+ function Dt({ ...e }) {
1916
+ const { editor: t } = xt();
1917
+ return /* @__PURE__ */ I.jsx(Rt, { editor: t, ...e });
1918
+ }
1919
+ Dt.displayName = "Tiptap.Content";
1920
+ var Bn = Object.assign(jt, {
1921
+ /**
1922
+ * The Tiptap Content component that renders the EditorContent with the editor instance from the context.
1923
+ * @see TiptapContent
1924
+ */
1925
+ Content: Dt
1926
+ });
1927
+ export {
1928
+ Cn as E,
1929
+ Un as M,
1930
+ Ln as N,
1931
+ _n as P,
1932
+ jn as R,
1933
+ Bn as T,
1934
+ Rt as a,
1935
+ ae as b,
1936
+ kn as c,
1937
+ qn as d,
1938
+ At as e,
1939
+ Wn as f,
1940
+ Dn as g,
1941
+ Nn as h,
1942
+ Ce as i,
1943
+ Fn as j,
1944
+ Tt as k,
1945
+ Dt as l,
1946
+ Te as m,
1947
+ jt as n,
1948
+ On as o,
1949
+ wt as p,
1950
+ Ct as q,
1951
+ xt as r,
1952
+ $n as s,
1953
+ I as t,
1954
+ Vn as u
1955
+ };