@dooherceg/tiptap-controlled-editor-with-table 0.0.7 → 0.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.
Files changed (112) hide show
  1. package/dist/_virtual/_commonjsHelpers.js +8 -0
  2. package/dist/_virtual/index.js +7 -0
  3. package/dist/assets/components/tiptap-node/blockquote-node/blockquote-node.css +1 -0
  4. package/dist/assets/components/tiptap-node/code-block-node/code-block-node.css +1 -0
  5. package/dist/assets/components/tiptap-node/heading-node/heading-node.css +1 -0
  6. package/dist/assets/components/tiptap-node/horizontal-rule-node/horizontal-rule-node.css +1 -0
  7. package/dist/assets/components/tiptap-node/image-node/image-node.css +1 -0
  8. package/dist/assets/components/tiptap-node/list-node/list-node.css +1 -0
  9. package/dist/assets/components/tiptap-node/paragraph-node/paragraph-node.css +1 -0
  10. package/dist/assets/components/tiptap-templates/simple/simple-editor.css +1 -0
  11. package/dist/assets/{badge.css → components/tiptap-ui-primitive/badge/badge-colors.css} +1 -1
  12. package/dist/assets/components/tiptap-ui-primitive/badge/badge-group.css +1 -0
  13. package/dist/assets/components/tiptap-ui-primitive/badge/badge.css +1 -0
  14. package/dist/assets/{button.css → components/tiptap-ui-primitive/button/button-colors.css} +1 -1
  15. package/dist/assets/components/tiptap-ui-primitive/button/button-group.css +1 -0
  16. package/dist/assets/components/tiptap-ui-primitive/button/button.css +1 -0
  17. package/dist/assets/styles/_keyframe-animations.css +1 -0
  18. package/dist/assets/styles/_variables.css +1 -0
  19. package/dist/components/tiptap-node/horizontal-rule-node/horizontal-rule-node-extension.js +6 -58
  20. package/dist/components/tiptap-node/image-upload-node/image-upload-node.js +4 -3
  21. package/dist/components/tiptap-templates/simple/simple-editor.js +159 -1898
  22. package/dist/components/tiptap-ui/color-highlight-button/color-highlight-button.js +6 -5
  23. package/dist/components/tiptap-ui/color-highlight-button/use-color-highlight.js +1 -1
  24. package/dist/components/tiptap-ui/image-upload-button/use-image-upload.js +16 -16
  25. package/dist/components/tiptap-ui-primitive/badge/badge.js +19 -16
  26. package/dist/components/tiptap-ui-primitive/button/button.js +18 -15
  27. package/dist/components/tiptap-ui-primitive/card/card.js +13 -12
  28. package/dist/components/tiptap-ui-primitive/dropdown-menu/dropdown-menu.js +39 -1012
  29. package/dist/components/tiptap-ui-primitive/input/input.js +7 -6
  30. package/dist/components/tiptap-ui-primitive/popover/popover.js +24 -233
  31. package/dist/components/tiptap-ui-primitive/separator/separator.js +9 -8
  32. package/dist/components/tiptap-ui-primitive/toolbar/toolbar.js +2 -1
  33. package/dist/components/tiptap-ui-primitive/tooltip/tooltip.js +84 -1330
  34. package/dist/hooks/use-throttled-callback.js +13 -108
  35. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +527 -0
  36. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +402 -0
  37. package/dist/node_modules/@floating-ui/react/dist/floating-ui.react.js +932 -0
  38. package/dist/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js +185 -0
  39. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +208 -0
  40. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +136 -0
  41. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +130 -0
  42. package/dist/node_modules/@radix-ui/primitive/dist/index.js +9 -0
  43. package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +24 -0
  44. package/dist/node_modules/@radix-ui/react-collection/dist/index.js +48 -0
  45. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +29 -0
  46. package/dist/node_modules/@radix-ui/react-context/dist/index.js +53 -0
  47. package/dist/node_modules/@radix-ui/react-direction/dist/index.js +10 -0
  48. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +127 -0
  49. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +221 -0
  50. package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +17 -0
  51. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +136 -0
  52. package/dist/node_modules/@radix-ui/react-id/dist/index.js +13 -0
  53. package/dist/node_modules/@radix-ui/react-menu/dist/index.js +636 -0
  54. package/dist/node_modules/@radix-ui/react-popover/dist/index.js +239 -0
  55. package/dist/node_modules/@radix-ui/react-popper/dist/index.js +219 -0
  56. package/dist/node_modules/@radix-ui/react-portal/dist/index.js +15 -0
  57. package/dist/node_modules/@radix-ui/react-presence/dist/index.js +70 -0
  58. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +36 -0
  59. package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +183 -0
  60. package/dist/node_modules/@radix-ui/react-slot/dist/index.js +49 -0
  61. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +10 -0
  62. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +52 -0
  63. package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +14 -0
  64. package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +6 -0
  65. package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +27 -0
  66. package/dist/node_modules/@tiptap/extension-highlight/dist/index.js +84 -0
  67. package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +57 -0
  68. package/dist/node_modules/@tiptap/extension-image/dist/index.js +128 -0
  69. package/dist/node_modules/@tiptap/extension-list/dist/index.js +713 -0
  70. package/dist/node_modules/@tiptap/extension-subscript/dist/index.js +40 -0
  71. package/dist/node_modules/@tiptap/extension-superscript/dist/index.js +40 -0
  72. package/dist/node_modules/@tiptap/extension-table/dist/index.js +380 -0
  73. package/dist/node_modules/@tiptap/extension-text-align/dist/index.js +46 -0
  74. package/dist/node_modules/@tiptap/extension-typography/dist/index.js +125 -0
  75. package/dist/node_modules/@tiptap/extensions/dist/index.js +288 -0
  76. package/dist/node_modules/aria-hidden/dist/es2015/index.js +52 -0
  77. package/dist/node_modules/get-nonce/dist/es2015/index.js +7 -0
  78. package/dist/node_modules/lodash.throttle/index.js +95 -0
  79. package/dist/{index-Bqw9S4qP.js → node_modules/react-hotkeys-hook/packages/react-hotkeys-hook/dist/index.js} +57 -55
  80. package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +11 -0
  81. package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +112 -0
  82. package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +31 -0
  83. package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +16 -0
  84. package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +68 -0
  85. package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +5 -0
  86. package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +7 -0
  87. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +71 -0
  88. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +7 -0
  89. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +25 -0
  90. package/dist/node_modules/react-style-singleton/dist/es2015/component.js +11 -0
  91. package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +15 -0
  92. package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +30 -0
  93. package/dist/node_modules/tabbable/dist/index.esm.js +197 -0
  94. package/dist/node_modules/tslib/tslib.es6.js +27 -0
  95. package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +6 -0
  96. package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +26 -0
  97. package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +25 -0
  98. package/dist/node_modules/use-sidecar/dist/es2015/exports.js +18 -0
  99. package/dist/node_modules/use-sidecar/dist/es2015/medium.js +67 -0
  100. package/package.json +1 -1
  101. package/dist/Combination-CO0ZtURs.js +0 -1333
  102. package/dist/assets/simple-editor.css +0 -1
  103. package/dist/floating-ui.react-dom-DgOuULHo.js +0 -1334
  104. /package/dist/assets/{image-upload-node.css → components/tiptap-node/image-upload-node/image-upload-node.css} +0 -0
  105. /package/dist/assets/{color-highlight-button.css → components/tiptap-ui/color-highlight-button/color-highlight-button.css} +0 -0
  106. /package/dist/assets/{card.css → components/tiptap-ui-primitive/card/card.css} +0 -0
  107. /package/dist/assets/{dropdown-menu.css → components/tiptap-ui-primitive/dropdown-menu/dropdown-menu.css} +0 -0
  108. /package/dist/assets/{input.css → components/tiptap-ui-primitive/input/input.css} +0 -0
  109. /package/dist/assets/{popover.css → components/tiptap-ui-primitive/popover/popover.css} +0 -0
  110. /package/dist/assets/{separator.css → components/tiptap-ui-primitive/separator/separator.css} +0 -0
  111. /package/dist/assets/{toolbar.css → components/tiptap-ui-primitive/toolbar/toolbar.css} +0 -0
  112. /package/dist/assets/{tooltip.css → components/tiptap-ui-primitive/tooltip/tooltip.css} +0 -0
@@ -1,1334 +0,0 @@
1
- import * as L from "react";
2
- import { useLayoutEffect as qt } from "react";
3
- import * as Ut from "react-dom";
4
- function at() {
5
- return typeof window < "u";
6
- }
7
- function Z(t) {
8
- return Wt(t) ? (t.nodeName || "").toLowerCase() : "#document";
9
- }
10
- function $(t) {
11
- var e;
12
- return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
13
- }
14
- function I(t) {
15
- var e;
16
- return (e = (Wt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
17
- }
18
- function Wt(t) {
19
- return at() ? t instanceof Node || t instanceof $(t).Node : !1;
20
- }
21
- function V(t) {
22
- return at() ? t instanceof Element || t instanceof $(t).Element : !1;
23
- }
24
- function j(t) {
25
- return at() ? t instanceof HTMLElement || t instanceof $(t).HTMLElement : !1;
26
- }
27
- function St(t) {
28
- return !at() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof $(t).ShadowRoot;
29
- }
30
- const Kt = /* @__PURE__ */ new Set(["inline", "contents"]);
31
- function ot(t) {
32
- const {
33
- overflow: e,
34
- overflowX: n,
35
- overflowY: o,
36
- display: i
37
- } = H(t);
38
- return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && !Kt.has(i);
39
- }
40
- const Gt = /* @__PURE__ */ new Set(["table", "td", "th"]);
41
- function Jt(t) {
42
- return Gt.has(Z(t));
43
- }
44
- const Qt = [":popover-open", ":modal"];
45
- function ut(t) {
46
- return Qt.some((e) => {
47
- try {
48
- return t.matches(e);
49
- } catch {
50
- return !1;
51
- }
52
- });
53
- }
54
- const Zt = ["transform", "translate", "scale", "rotate", "perspective"], te = ["transform", "translate", "scale", "rotate", "perspective", "filter"], ee = ["paint", "layout", "strict", "content"];
55
- function yt(t) {
56
- const e = vt(), n = V(t) ? H(t) : t;
57
- return Zt.some((o) => n[o] ? n[o] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !e && (n.filter ? n.filter !== "none" : !1) || te.some((o) => (n.willChange || "").includes(o)) || ee.some((o) => (n.contain || "").includes(o));
58
- }
59
- function ne(t) {
60
- let e = U(t);
61
- for (; j(e) && !Q(e); ) {
62
- if (yt(e))
63
- return e;
64
- if (ut(e))
65
- return null;
66
- e = U(e);
67
- }
68
- return null;
69
- }
70
- function vt() {
71
- return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
72
- }
73
- const oe = /* @__PURE__ */ new Set(["html", "body", "#document"]);
74
- function Q(t) {
75
- return oe.has(Z(t));
76
- }
77
- function H(t) {
78
- return $(t).getComputedStyle(t);
79
- }
80
- function dt(t) {
81
- return V(t) ? {
82
- scrollLeft: t.scrollLeft,
83
- scrollTop: t.scrollTop
84
- } : {
85
- scrollLeft: t.scrollX,
86
- scrollTop: t.scrollY
87
- };
88
- }
89
- function U(t) {
90
- if (Z(t) === "html")
91
- return t;
92
- const e = (
93
- // Step into the shadow DOM of the parent of a slotted node.
94
- t.assignedSlot || // DOM Element detected.
95
- t.parentNode || // ShadowRoot detected.
96
- St(t) && t.host || // Fallback.
97
- I(t)
98
- );
99
- return St(e) ? e.host : e;
100
- }
101
- function Bt(t) {
102
- const e = U(t);
103
- return Q(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : j(e) && ot(e) ? e : Bt(e);
104
- }
105
- function et(t, e, n) {
106
- var o;
107
- e === void 0 && (e = []), n === void 0 && (n = !0);
108
- const i = Bt(t), r = i === ((o = t.ownerDocument) == null ? void 0 : o.body), s = $(i);
109
- if (r) {
110
- const c = pt(s);
111
- return e.concat(s, s.visualViewport || [], ot(i) ? i : [], c && n ? et(c) : []);
112
- }
113
- return e.concat(i, et(i, [], n));
114
- }
115
- function pt(t) {
116
- return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
117
- }
118
- const ie = ["top", "right", "bottom", "left"], K = Math.min, F = Math.max, st = Math.round, it = Math.floor, z = (t) => ({
119
- x: t,
120
- y: t
121
- }), re = {
122
- left: "right",
123
- right: "left",
124
- bottom: "top",
125
- top: "bottom"
126
- }, se = {
127
- start: "end",
128
- end: "start"
129
- };
130
- function wt(t, e, n) {
131
- return F(t, K(e, n));
132
- }
133
- function X(t, e) {
134
- return typeof t == "function" ? t(e) : t;
135
- }
136
- function Y(t) {
137
- return t.split("-")[0];
138
- }
139
- function tt(t) {
140
- return t.split("-")[1];
141
- }
142
- function bt(t) {
143
- return t === "x" ? "y" : "x";
144
- }
145
- function At(t) {
146
- return t === "y" ? "height" : "width";
147
- }
148
- const ce = /* @__PURE__ */ new Set(["top", "bottom"]);
149
- function _(t) {
150
- return ce.has(Y(t)) ? "y" : "x";
151
- }
152
- function Rt(t) {
153
- return bt(_(t));
154
- }
155
- function le(t, e, n) {
156
- n === void 0 && (n = !1);
157
- const o = tt(t), i = Rt(t), r = At(i);
158
- let s = i === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
159
- return e.reference[r] > e.floating[r] && (s = ct(s)), [s, ct(s)];
160
- }
161
- function fe(t) {
162
- const e = ct(t);
163
- return [xt(t), e, xt(e)];
164
- }
165
- function xt(t) {
166
- return t.replace(/start|end/g, (e) => se[e]);
167
- }
168
- const Ct = ["left", "right"], Et = ["right", "left"], ae = ["top", "bottom"], ue = ["bottom", "top"];
169
- function de(t, e, n) {
170
- switch (t) {
171
- case "top":
172
- case "bottom":
173
- return n ? e ? Et : Ct : e ? Ct : Et;
174
- case "left":
175
- case "right":
176
- return e ? ae : ue;
177
- default:
178
- return [];
179
- }
180
- }
181
- function me(t, e, n, o) {
182
- const i = tt(t);
183
- let r = de(Y(t), n === "start", o);
184
- return i && (r = r.map((s) => s + "-" + i), e && (r = r.concat(r.map(xt)))), r;
185
- }
186
- function ct(t) {
187
- return t.replace(/left|right|bottom|top/g, (e) => re[e]);
188
- }
189
- function he(t) {
190
- return {
191
- top: 0,
192
- right: 0,
193
- bottom: 0,
194
- left: 0,
195
- ...t
196
- };
197
- }
198
- function Vt(t) {
199
- return typeof t != "number" ? he(t) : {
200
- top: t,
201
- right: t,
202
- bottom: t,
203
- left: t
204
- };
205
- }
206
- function lt(t) {
207
- const {
208
- x: e,
209
- y: n,
210
- width: o,
211
- height: i
212
- } = t;
213
- return {
214
- width: o,
215
- height: i,
216
- top: n,
217
- left: e,
218
- right: e + o,
219
- bottom: n + i,
220
- x: e,
221
- y: n
222
- };
223
- }
224
- function Lt(t, e, n) {
225
- let {
226
- reference: o,
227
- floating: i
228
- } = t;
229
- const r = _(e), s = Rt(e), c = At(s), a = Y(e), f = r === "y", l = o.x + o.width / 2 - i.width / 2, u = o.y + o.height / 2 - i.height / 2, m = o[c] / 2 - i[c] / 2;
230
- let d;
231
- switch (a) {
232
- case "top":
233
- d = {
234
- x: l,
235
- y: o.y - i.height
236
- };
237
- break;
238
- case "bottom":
239
- d = {
240
- x: l,
241
- y: o.y + o.height
242
- };
243
- break;
244
- case "right":
245
- d = {
246
- x: o.x + o.width,
247
- y: u
248
- };
249
- break;
250
- case "left":
251
- d = {
252
- x: o.x - i.width,
253
- y: u
254
- };
255
- break;
256
- default:
257
- d = {
258
- x: o.x,
259
- y: o.y
260
- };
261
- }
262
- switch (tt(e)) {
263
- case "start":
264
- d[s] -= m * (n && f ? -1 : 1);
265
- break;
266
- case "end":
267
- d[s] += m * (n && f ? -1 : 1);
268
- break;
269
- }
270
- return d;
271
- }
272
- const ge = async (t, e, n) => {
273
- const {
274
- placement: o = "bottom",
275
- strategy: i = "absolute",
276
- middleware: r = [],
277
- platform: s
278
- } = n, c = r.filter(Boolean), a = await (s.isRTL == null ? void 0 : s.isRTL(e));
279
- let f = await s.getElementRects({
280
- reference: t,
281
- floating: e,
282
- strategy: i
283
- }), {
284
- x: l,
285
- y: u
286
- } = Lt(f, o, a), m = o, d = {}, h = 0;
287
- for (let g = 0; g < c.length; g++) {
288
- const {
289
- name: p,
290
- fn: w
291
- } = c[g], {
292
- x,
293
- y: v,
294
- data: b,
295
- reset: y
296
- } = await w({
297
- x: l,
298
- y: u,
299
- initialPlacement: o,
300
- placement: m,
301
- strategy: i,
302
- middlewareData: d,
303
- rects: f,
304
- platform: s,
305
- elements: {
306
- reference: t,
307
- floating: e
308
- }
309
- });
310
- l = x ?? l, u = v ?? u, d = {
311
- ...d,
312
- [p]: {
313
- ...d[p],
314
- ...b
315
- }
316
- }, y && h <= 50 && (h++, typeof y == "object" && (y.placement && (m = y.placement), y.rects && (f = y.rects === !0 ? await s.getElementRects({
317
- reference: t,
318
- floating: e,
319
- strategy: i
320
- }) : y.rects), {
321
- x: l,
322
- y: u
323
- } = Lt(f, m, a)), g = -1);
324
- }
325
- return {
326
- x: l,
327
- y: u,
328
- placement: m,
329
- strategy: i,
330
- middlewareData: d
331
- };
332
- };
333
- async function nt(t, e) {
334
- var n;
335
- e === void 0 && (e = {});
336
- const {
337
- x: o,
338
- y: i,
339
- platform: r,
340
- rects: s,
341
- elements: c,
342
- strategy: a
343
- } = t, {
344
- boundary: f = "clippingAncestors",
345
- rootBoundary: l = "viewport",
346
- elementContext: u = "floating",
347
- altBoundary: m = !1,
348
- padding: d = 0
349
- } = X(e, t), h = Vt(d), p = c[m ? u === "floating" ? "reference" : "floating" : u], w = lt(await r.getClippingRect({
350
- element: (n = await (r.isElement == null ? void 0 : r.isElement(p))) == null || n ? p : p.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(c.floating)),
351
- boundary: f,
352
- rootBoundary: l,
353
- strategy: a
354
- })), x = u === "floating" ? {
355
- x: o,
356
- y: i,
357
- width: s.floating.width,
358
- height: s.floating.height
359
- } : s.reference, v = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c.floating)), b = await (r.isElement == null ? void 0 : r.isElement(v)) ? await (r.getScale == null ? void 0 : r.getScale(v)) || {
360
- x: 1,
361
- y: 1
362
- } : {
363
- x: 1,
364
- y: 1
365
- }, y = lt(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
366
- elements: c,
367
- rect: x,
368
- offsetParent: v,
369
- strategy: a
370
- }) : x);
371
- return {
372
- top: (w.top - y.top + h.top) / b.y,
373
- bottom: (y.bottom - w.bottom + h.bottom) / b.y,
374
- left: (w.left - y.left + h.left) / b.x,
375
- right: (y.right - w.right + h.right) / b.x
376
- };
377
- }
378
- const pe = (t) => ({
379
- name: "arrow",
380
- options: t,
381
- async fn(e) {
382
- const {
383
- x: n,
384
- y: o,
385
- placement: i,
386
- rects: r,
387
- platform: s,
388
- elements: c,
389
- middlewareData: a
390
- } = e, {
391
- element: f,
392
- padding: l = 0
393
- } = X(t, e) || {};
394
- if (f == null)
395
- return {};
396
- const u = Vt(l), m = {
397
- x: n,
398
- y: o
399
- }, d = Rt(i), h = At(d), g = await s.getDimensions(f), p = d === "y", w = p ? "top" : "left", x = p ? "bottom" : "right", v = p ? "clientHeight" : "clientWidth", b = r.reference[h] + r.reference[d] - m[d] - r.floating[h], y = m[d] - r.reference[d], O = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(f));
400
- let R = O ? O[v] : 0;
401
- (!R || !await (s.isElement == null ? void 0 : s.isElement(O))) && (R = c.floating[v] || r.floating[h]);
402
- const P = b / 2 - y / 2, W = R / 2 - g[h] / 2 - 1, E = K(u[w], W), B = K(u[x], W), M = E, D = R - g[h] - B, S = R / 2 - g[h] / 2 + P, N = wt(M, S, D), C = !a.arrow && tt(i) != null && S !== N && r.reference[h] / 2 - (S < M ? E : B) - g[h] / 2 < 0, T = C ? S < M ? S - M : S - D : 0;
403
- return {
404
- [d]: m[d] + T,
405
- data: {
406
- [d]: N,
407
- centerOffset: S - N - T,
408
- ...C && {
409
- alignmentOffset: T
410
- }
411
- },
412
- reset: C
413
- };
414
- }
415
- }), we = function(t) {
416
- return t === void 0 && (t = {}), {
417
- name: "flip",
418
- options: t,
419
- async fn(e) {
420
- var n, o;
421
- const {
422
- placement: i,
423
- middlewareData: r,
424
- rects: s,
425
- initialPlacement: c,
426
- platform: a,
427
- elements: f
428
- } = e, {
429
- mainAxis: l = !0,
430
- crossAxis: u = !0,
431
- fallbackPlacements: m,
432
- fallbackStrategy: d = "bestFit",
433
- fallbackAxisSideDirection: h = "none",
434
- flipAlignment: g = !0,
435
- ...p
436
- } = X(t, e);
437
- if ((n = r.arrow) != null && n.alignmentOffset)
438
- return {};
439
- const w = Y(i), x = _(c), v = Y(c) === c, b = await (a.isRTL == null ? void 0 : a.isRTL(f.floating)), y = m || (v || !g ? [ct(c)] : fe(c)), O = h !== "none";
440
- !m && O && y.push(...me(c, g, h, b));
441
- const R = [c, ...y], P = await nt(e, p), W = [];
442
- let E = ((o = r.flip) == null ? void 0 : o.overflows) || [];
443
- if (l && W.push(P[w]), u) {
444
- const S = le(i, s, b);
445
- W.push(P[S[0]], P[S[1]]);
446
- }
447
- if (E = [...E, {
448
- placement: i,
449
- overflows: W
450
- }], !W.every((S) => S <= 0)) {
451
- var B, M;
452
- const S = (((B = r.flip) == null ? void 0 : B.index) || 0) + 1, N = R[S];
453
- if (N && (!(u === "alignment" ? x !== _(N) : !1) || // We leave the current main axis only if every placement on that axis
454
- // overflows the main axis.
455
- E.every((A) => _(A.placement) === x ? A.overflows[0] > 0 : !0)))
456
- return {
457
- data: {
458
- index: S,
459
- overflows: E
460
- },
461
- reset: {
462
- placement: N
463
- }
464
- };
465
- let C = (M = E.filter((T) => T.overflows[0] <= 0).sort((T, A) => T.overflows[1] - A.overflows[1])[0]) == null ? void 0 : M.placement;
466
- if (!C)
467
- switch (d) {
468
- case "bestFit": {
469
- var D;
470
- const T = (D = E.filter((A) => {
471
- if (O) {
472
- const k = _(A.placement);
473
- return k === x || // Create a bias to the `y` side axis due to horizontal
474
- // reading directions favoring greater width.
475
- k === "y";
476
- }
477
- return !0;
478
- }).map((A) => [A.placement, A.overflows.filter((k) => k > 0).reduce((k, q) => k + q, 0)]).sort((A, k) => A[1] - k[1])[0]) == null ? void 0 : D[0];
479
- T && (C = T);
480
- break;
481
- }
482
- case "initialPlacement":
483
- C = c;
484
- break;
485
- }
486
- if (i !== C)
487
- return {
488
- reset: {
489
- placement: C
490
- }
491
- };
492
- }
493
- return {};
494
- }
495
- };
496
- };
497
- function Pt(t, e) {
498
- return {
499
- top: t.top - e.height,
500
- right: t.right - e.width,
501
- bottom: t.bottom - e.height,
502
- left: t.left - e.width
503
- };
504
- }
505
- function Dt(t) {
506
- return ie.some((e) => t[e] >= 0);
507
- }
508
- const xe = function(t) {
509
- return t === void 0 && (t = {}), {
510
- name: "hide",
511
- options: t,
512
- async fn(e) {
513
- const {
514
- rects: n
515
- } = e, {
516
- strategy: o = "referenceHidden",
517
- ...i
518
- } = X(t, e);
519
- switch (o) {
520
- case "referenceHidden": {
521
- const r = await nt(e, {
522
- ...i,
523
- elementContext: "reference"
524
- }), s = Pt(r, n.reference);
525
- return {
526
- data: {
527
- referenceHiddenOffsets: s,
528
- referenceHidden: Dt(s)
529
- }
530
- };
531
- }
532
- case "escaped": {
533
- const r = await nt(e, {
534
- ...i,
535
- altBoundary: !0
536
- }), s = Pt(r, n.floating);
537
- return {
538
- data: {
539
- escapedOffsets: s,
540
- escaped: Dt(s)
541
- }
542
- };
543
- }
544
- default:
545
- return {};
546
- }
547
- }
548
- };
549
- }, Ht = /* @__PURE__ */ new Set(["left", "top"]);
550
- async function ye(t, e) {
551
- const {
552
- placement: n,
553
- platform: o,
554
- elements: i
555
- } = t, r = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), s = Y(n), c = tt(n), a = _(n) === "y", f = Ht.has(s) ? -1 : 1, l = r && a ? -1 : 1, u = X(e, t);
556
- let {
557
- mainAxis: m,
558
- crossAxis: d,
559
- alignmentAxis: h
560
- } = typeof u == "number" ? {
561
- mainAxis: u,
562
- crossAxis: 0,
563
- alignmentAxis: null
564
- } : {
565
- mainAxis: u.mainAxis || 0,
566
- crossAxis: u.crossAxis || 0,
567
- alignmentAxis: u.alignmentAxis
568
- };
569
- return c && typeof h == "number" && (d = c === "end" ? h * -1 : h), a ? {
570
- x: d * l,
571
- y: m * f
572
- } : {
573
- x: m * f,
574
- y: d * l
575
- };
576
- }
577
- const ve = function(t) {
578
- return t === void 0 && (t = 0), {
579
- name: "offset",
580
- options: t,
581
- async fn(e) {
582
- var n, o;
583
- const {
584
- x: i,
585
- y: r,
586
- placement: s,
587
- middlewareData: c
588
- } = e, a = await ye(e, t);
589
- return s === ((n = c.offset) == null ? void 0 : n.placement) && (o = c.arrow) != null && o.alignmentOffset ? {} : {
590
- x: i + a.x,
591
- y: r + a.y,
592
- data: {
593
- ...a,
594
- placement: s
595
- }
596
- };
597
- }
598
- };
599
- }, be = function(t) {
600
- return t === void 0 && (t = {}), {
601
- name: "shift",
602
- options: t,
603
- async fn(e) {
604
- const {
605
- x: n,
606
- y: o,
607
- placement: i
608
- } = e, {
609
- mainAxis: r = !0,
610
- crossAxis: s = !1,
611
- limiter: c = {
612
- fn: (p) => {
613
- let {
614
- x: w,
615
- y: x
616
- } = p;
617
- return {
618
- x: w,
619
- y: x
620
- };
621
- }
622
- },
623
- ...a
624
- } = X(t, e), f = {
625
- x: n,
626
- y: o
627
- }, l = await nt(e, a), u = _(Y(i)), m = bt(u);
628
- let d = f[m], h = f[u];
629
- if (r) {
630
- const p = m === "y" ? "top" : "left", w = m === "y" ? "bottom" : "right", x = d + l[p], v = d - l[w];
631
- d = wt(x, d, v);
632
- }
633
- if (s) {
634
- const p = u === "y" ? "top" : "left", w = u === "y" ? "bottom" : "right", x = h + l[p], v = h - l[w];
635
- h = wt(x, h, v);
636
- }
637
- const g = c.fn({
638
- ...e,
639
- [m]: d,
640
- [u]: h
641
- });
642
- return {
643
- ...g,
644
- data: {
645
- x: g.x - n,
646
- y: g.y - o,
647
- enabled: {
648
- [m]: r,
649
- [u]: s
650
- }
651
- }
652
- };
653
- }
654
- };
655
- }, Ae = function(t) {
656
- return t === void 0 && (t = {}), {
657
- options: t,
658
- fn(e) {
659
- const {
660
- x: n,
661
- y: o,
662
- placement: i,
663
- rects: r,
664
- middlewareData: s
665
- } = e, {
666
- offset: c = 0,
667
- mainAxis: a = !0,
668
- crossAxis: f = !0
669
- } = X(t, e), l = {
670
- x: n,
671
- y: o
672
- }, u = _(i), m = bt(u);
673
- let d = l[m], h = l[u];
674
- const g = X(c, e), p = typeof g == "number" ? {
675
- mainAxis: g,
676
- crossAxis: 0
677
- } : {
678
- mainAxis: 0,
679
- crossAxis: 0,
680
- ...g
681
- };
682
- if (a) {
683
- const v = m === "y" ? "height" : "width", b = r.reference[m] - r.floating[v] + p.mainAxis, y = r.reference[m] + r.reference[v] - p.mainAxis;
684
- d < b ? d = b : d > y && (d = y);
685
- }
686
- if (f) {
687
- var w, x;
688
- const v = m === "y" ? "width" : "height", b = Ht.has(Y(i)), y = r.reference[u] - r.floating[v] + (b && ((w = s.offset) == null ? void 0 : w[u]) || 0) + (b ? 0 : p.crossAxis), O = r.reference[u] + r.reference[v] + (b ? 0 : ((x = s.offset) == null ? void 0 : x[u]) || 0) - (b ? p.crossAxis : 0);
689
- h < y ? h = y : h > O && (h = O);
690
- }
691
- return {
692
- [m]: d,
693
- [u]: h
694
- };
695
- }
696
- };
697
- }, Re = function(t) {
698
- return t === void 0 && (t = {}), {
699
- name: "size",
700
- options: t,
701
- async fn(e) {
702
- var n, o;
703
- const {
704
- placement: i,
705
- rects: r,
706
- platform: s,
707
- elements: c
708
- } = e, {
709
- apply: a = () => {
710
- },
711
- ...f
712
- } = X(t, e), l = await nt(e, f), u = Y(i), m = tt(i), d = _(i) === "y", {
713
- width: h,
714
- height: g
715
- } = r.floating;
716
- let p, w;
717
- u === "top" || u === "bottom" ? (p = u, w = m === (await (s.isRTL == null ? void 0 : s.isRTL(c.floating)) ? "start" : "end") ? "left" : "right") : (w = u, p = m === "end" ? "top" : "bottom");
718
- const x = g - l.top - l.bottom, v = h - l.left - l.right, b = K(g - l[p], x), y = K(h - l[w], v), O = !e.middlewareData.shift;
719
- let R = b, P = y;
720
- if ((n = e.middlewareData.shift) != null && n.enabled.x && (P = v), (o = e.middlewareData.shift) != null && o.enabled.y && (R = x), O && !m) {
721
- const E = F(l.left, 0), B = F(l.right, 0), M = F(l.top, 0), D = F(l.bottom, 0);
722
- d ? P = h - 2 * (E !== 0 || B !== 0 ? E + B : F(l.left, l.right)) : R = g - 2 * (M !== 0 || D !== 0 ? M + D : F(l.top, l.bottom));
723
- }
724
- await a({
725
- ...e,
726
- availableWidth: P,
727
- availableHeight: R
728
- });
729
- const W = await s.getDimensions(c.floating);
730
- return h !== W.width || g !== W.height ? {
731
- reset: {
732
- rects: !0
733
- }
734
- } : {};
735
- }
736
- };
737
- };
738
- function Nt(t) {
739
- const e = H(t);
740
- let n = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
741
- const i = j(t), r = i ? t.offsetWidth : n, s = i ? t.offsetHeight : o, c = st(n) !== r || st(o) !== s;
742
- return c && (n = r, o = s), {
743
- width: n,
744
- height: o,
745
- $: c
746
- };
747
- }
748
- function Ot(t) {
749
- return V(t) ? t : t.contextElement;
750
- }
751
- function J(t) {
752
- const e = Ot(t);
753
- if (!j(e))
754
- return z(1);
755
- const n = e.getBoundingClientRect(), {
756
- width: o,
757
- height: i,
758
- $: r
759
- } = Nt(e);
760
- let s = (r ? st(n.width) : n.width) / o, c = (r ? st(n.height) : n.height) / i;
761
- return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
762
- x: s,
763
- y: c
764
- };
765
- }
766
- const Oe = /* @__PURE__ */ z(0);
767
- function _t(t) {
768
- const e = $(t);
769
- return !vt() || !e.visualViewport ? Oe : {
770
- x: e.visualViewport.offsetLeft,
771
- y: e.visualViewport.offsetTop
772
- };
773
- }
774
- function Se(t, e, n) {
775
- return e === void 0 && (e = !1), !n || e && n !== $(t) ? !1 : e;
776
- }
777
- function G(t, e, n, o) {
778
- e === void 0 && (e = !1), n === void 0 && (n = !1);
779
- const i = t.getBoundingClientRect(), r = Ot(t);
780
- let s = z(1);
781
- e && (o ? V(o) && (s = J(o)) : s = J(t));
782
- const c = Se(r, n, o) ? _t(r) : z(0);
783
- let a = (i.left + c.x) / s.x, f = (i.top + c.y) / s.y, l = i.width / s.x, u = i.height / s.y;
784
- if (r) {
785
- const m = $(r), d = o && V(o) ? $(o) : o;
786
- let h = m, g = pt(h);
787
- for (; g && o && d !== h; ) {
788
- const p = J(g), w = g.getBoundingClientRect(), x = H(g), v = w.left + (g.clientLeft + parseFloat(x.paddingLeft)) * p.x, b = w.top + (g.clientTop + parseFloat(x.paddingTop)) * p.y;
789
- a *= p.x, f *= p.y, l *= p.x, u *= p.y, a += v, f += b, h = $(g), g = pt(h);
790
- }
791
- }
792
- return lt({
793
- width: l,
794
- height: u,
795
- x: a,
796
- y: f
797
- });
798
- }
799
- function mt(t, e) {
800
- const n = dt(t).scrollLeft;
801
- return e ? e.left + n : G(I(t)).left + n;
802
- }
803
- function zt(t, e) {
804
- const n = t.getBoundingClientRect(), o = n.left + e.scrollLeft - mt(t, n), i = n.top + e.scrollTop;
805
- return {
806
- x: o,
807
- y: i
808
- };
809
- }
810
- function Ce(t) {
811
- let {
812
- elements: e,
813
- rect: n,
814
- offsetParent: o,
815
- strategy: i
816
- } = t;
817
- const r = i === "fixed", s = I(o), c = e ? ut(e.floating) : !1;
818
- if (o === s || c && r)
819
- return n;
820
- let a = {
821
- scrollLeft: 0,
822
- scrollTop: 0
823
- }, f = z(1);
824
- const l = z(0), u = j(o);
825
- if ((u || !u && !r) && ((Z(o) !== "body" || ot(s)) && (a = dt(o)), j(o))) {
826
- const d = G(o);
827
- f = J(o), l.x = d.x + o.clientLeft, l.y = d.y + o.clientTop;
828
- }
829
- const m = s && !u && !r ? zt(s, a) : z(0);
830
- return {
831
- width: n.width * f.x,
832
- height: n.height * f.y,
833
- x: n.x * f.x - a.scrollLeft * f.x + l.x + m.x,
834
- y: n.y * f.y - a.scrollTop * f.y + l.y + m.y
835
- };
836
- }
837
- function Ee(t) {
838
- return Array.from(t.getClientRects());
839
- }
840
- function Le(t) {
841
- const e = I(t), n = dt(t), o = t.ownerDocument.body, i = F(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), r = F(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
842
- let s = -n.scrollLeft + mt(t);
843
- const c = -n.scrollTop;
844
- return H(o).direction === "rtl" && (s += F(e.clientWidth, o.clientWidth) - i), {
845
- width: i,
846
- height: r,
847
- x: s,
848
- y: c
849
- };
850
- }
851
- const Tt = 25;
852
- function Pe(t, e) {
853
- const n = $(t), o = I(t), i = n.visualViewport;
854
- let r = o.clientWidth, s = o.clientHeight, c = 0, a = 0;
855
- if (i) {
856
- r = i.width, s = i.height;
857
- const l = vt();
858
- (!l || l && e === "fixed") && (c = i.offsetLeft, a = i.offsetTop);
859
- }
860
- const f = mt(o);
861
- if (f <= 0) {
862
- const l = o.ownerDocument, u = l.body, m = getComputedStyle(u), d = l.compatMode === "CSS1Compat" && parseFloat(m.marginLeft) + parseFloat(m.marginRight) || 0, h = Math.abs(o.clientWidth - u.clientWidth - d);
863
- h <= Tt && (r -= h);
864
- } else f <= Tt && (r += f);
865
- return {
866
- width: r,
867
- height: s,
868
- x: c,
869
- y: a
870
- };
871
- }
872
- const De = /* @__PURE__ */ new Set(["absolute", "fixed"]);
873
- function Te(t, e) {
874
- const n = G(t, !0, e === "fixed"), o = n.top + t.clientTop, i = n.left + t.clientLeft, r = j(t) ? J(t) : z(1), s = t.clientWidth * r.x, c = t.clientHeight * r.y, a = i * r.x, f = o * r.y;
875
- return {
876
- width: s,
877
- height: c,
878
- x: a,
879
- y: f
880
- };
881
- }
882
- function Mt(t, e, n) {
883
- let o;
884
- if (e === "viewport")
885
- o = Pe(t, n);
886
- else if (e === "document")
887
- o = Le(I(t));
888
- else if (V(e))
889
- o = Te(e, n);
890
- else {
891
- const i = _t(t);
892
- o = {
893
- x: e.x - i.x,
894
- y: e.y - i.y,
895
- width: e.width,
896
- height: e.height
897
- };
898
- }
899
- return lt(o);
900
- }
901
- function jt(t, e) {
902
- const n = U(t);
903
- return n === e || !V(n) || Q(n) ? !1 : H(n).position === "fixed" || jt(n, e);
904
- }
905
- function Me(t, e) {
906
- const n = e.get(t);
907
- if (n)
908
- return n;
909
- let o = et(t, [], !1).filter((c) => V(c) && Z(c) !== "body"), i = null;
910
- const r = H(t).position === "fixed";
911
- let s = r ? U(t) : t;
912
- for (; V(s) && !Q(s); ) {
913
- const c = H(s), a = yt(s);
914
- !a && c.position === "fixed" && (i = null), (r ? !a && !i : !a && c.position === "static" && !!i && De.has(i.position) || ot(s) && !a && jt(t, s)) ? o = o.filter((l) => l !== s) : i = c, s = U(s);
915
- }
916
- return e.set(t, o), o;
917
- }
918
- function ke(t) {
919
- let {
920
- element: e,
921
- boundary: n,
922
- rootBoundary: o,
923
- strategy: i
924
- } = t;
925
- const s = [...n === "clippingAncestors" ? ut(e) ? [] : Me(e, this._c) : [].concat(n), o], c = s[0], a = s.reduce((f, l) => {
926
- const u = Mt(e, l, i);
927
- return f.top = F(u.top, f.top), f.right = K(u.right, f.right), f.bottom = K(u.bottom, f.bottom), f.left = F(u.left, f.left), f;
928
- }, Mt(e, c, i));
929
- return {
930
- width: a.right - a.left,
931
- height: a.bottom - a.top,
932
- x: a.left,
933
- y: a.top
934
- };
935
- }
936
- function Fe(t) {
937
- const {
938
- width: e,
939
- height: n
940
- } = Nt(t);
941
- return {
942
- width: e,
943
- height: n
944
- };
945
- }
946
- function $e(t, e, n) {
947
- const o = j(e), i = I(e), r = n === "fixed", s = G(t, !0, r, e);
948
- let c = {
949
- scrollLeft: 0,
950
- scrollTop: 0
951
- };
952
- const a = z(0);
953
- function f() {
954
- a.x = mt(i);
955
- }
956
- if (o || !o && !r)
957
- if ((Z(e) !== "body" || ot(i)) && (c = dt(e)), o) {
958
- const d = G(e, !0, r, e);
959
- a.x = d.x + e.clientLeft, a.y = d.y + e.clientTop;
960
- } else i && f();
961
- r && !o && i && f();
962
- const l = i && !o && !r ? zt(i, c) : z(0), u = s.left + c.scrollLeft - a.x - l.x, m = s.top + c.scrollTop - a.y - l.y;
963
- return {
964
- x: u,
965
- y: m,
966
- width: s.width,
967
- height: s.height
968
- };
969
- }
970
- function ht(t) {
971
- return H(t).position === "static";
972
- }
973
- function kt(t, e) {
974
- if (!j(t) || H(t).position === "fixed")
975
- return null;
976
- if (e)
977
- return e(t);
978
- let n = t.offsetParent;
979
- return I(t) === n && (n = n.ownerDocument.body), n;
980
- }
981
- function It(t, e) {
982
- const n = $(t);
983
- if (ut(t))
984
- return n;
985
- if (!j(t)) {
986
- let i = U(t);
987
- for (; i && !Q(i); ) {
988
- if (V(i) && !ht(i))
989
- return i;
990
- i = U(i);
991
- }
992
- return n;
993
- }
994
- let o = kt(t, e);
995
- for (; o && Jt(o) && ht(o); )
996
- o = kt(o, e);
997
- return o && Q(o) && ht(o) && !yt(o) ? n : o || ne(t) || n;
998
- }
999
- const We = async function(t) {
1000
- const e = this.getOffsetParent || It, n = this.getDimensions, o = await n(t.floating);
1001
- return {
1002
- reference: $e(t.reference, await e(t.floating), t.strategy),
1003
- floating: {
1004
- x: 0,
1005
- y: 0,
1006
- width: o.width,
1007
- height: o.height
1008
- }
1009
- };
1010
- };
1011
- function Be(t) {
1012
- return H(t).direction === "rtl";
1013
- }
1014
- const Ve = {
1015
- convertOffsetParentRelativeRectToViewportRelativeRect: Ce,
1016
- getDocumentElement: I,
1017
- getClippingRect: ke,
1018
- getOffsetParent: It,
1019
- getElementRects: We,
1020
- getClientRects: Ee,
1021
- getDimensions: Fe,
1022
- getScale: J,
1023
- isElement: V,
1024
- isRTL: Be
1025
- };
1026
- function Xt(t, e) {
1027
- return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
1028
- }
1029
- function He(t, e) {
1030
- let n = null, o;
1031
- const i = I(t);
1032
- function r() {
1033
- var c;
1034
- clearTimeout(o), (c = n) == null || c.disconnect(), n = null;
1035
- }
1036
- function s(c, a) {
1037
- c === void 0 && (c = !1), a === void 0 && (a = 1), r();
1038
- const f = t.getBoundingClientRect(), {
1039
- left: l,
1040
- top: u,
1041
- width: m,
1042
- height: d
1043
- } = f;
1044
- if (c || e(), !m || !d)
1045
- return;
1046
- const h = it(u), g = it(i.clientWidth - (l + m)), p = it(i.clientHeight - (u + d)), w = it(l), v = {
1047
- rootMargin: -h + "px " + -g + "px " + -p + "px " + -w + "px",
1048
- threshold: F(0, K(1, a)) || 1
1049
- };
1050
- let b = !0;
1051
- function y(O) {
1052
- const R = O[0].intersectionRatio;
1053
- if (R !== a) {
1054
- if (!b)
1055
- return s();
1056
- R ? s(!1, R) : o = setTimeout(() => {
1057
- s(!1, 1e-7);
1058
- }, 1e3);
1059
- }
1060
- R === 1 && !Xt(f, t.getBoundingClientRect()) && s(), b = !1;
1061
- }
1062
- try {
1063
- n = new IntersectionObserver(y, {
1064
- ...v,
1065
- // Handle <iframe>s
1066
- root: i.ownerDocument
1067
- });
1068
- } catch {
1069
- n = new IntersectionObserver(y, v);
1070
- }
1071
- n.observe(t);
1072
- }
1073
- return s(!0), r;
1074
- }
1075
- function Je(t, e, n, o) {
1076
- o === void 0 && (o = {});
1077
- const {
1078
- ancestorScroll: i = !0,
1079
- ancestorResize: r = !0,
1080
- elementResize: s = typeof ResizeObserver == "function",
1081
- layoutShift: c = typeof IntersectionObserver == "function",
1082
- animationFrame: a = !1
1083
- } = o, f = Ot(t), l = i || r ? [...f ? et(f) : [], ...et(e)] : [];
1084
- l.forEach((w) => {
1085
- i && w.addEventListener("scroll", n, {
1086
- passive: !0
1087
- }), r && w.addEventListener("resize", n);
1088
- });
1089
- const u = f && c ? He(f, n) : null;
1090
- let m = -1, d = null;
1091
- s && (d = new ResizeObserver((w) => {
1092
- let [x] = w;
1093
- x && x.target === f && d && (d.unobserve(e), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
1094
- var v;
1095
- (v = d) == null || v.observe(e);
1096
- })), n();
1097
- }), f && !a && d.observe(f), d.observe(e));
1098
- let h, g = a ? G(t) : null;
1099
- a && p();
1100
- function p() {
1101
- const w = G(t);
1102
- g && !Xt(g, w) && n(), g = w, h = requestAnimationFrame(p);
1103
- }
1104
- return n(), () => {
1105
- var w;
1106
- l.forEach((x) => {
1107
- i && x.removeEventListener("scroll", n), r && x.removeEventListener("resize", n);
1108
- }), u?.(), (w = d) == null || w.disconnect(), d = null, a && cancelAnimationFrame(h);
1109
- };
1110
- }
1111
- const Ne = ve, _e = be, ze = we, je = Re, Ie = xe, Ft = pe, Xe = Ae, Ye = (t, e, n) => {
1112
- const o = /* @__PURE__ */ new Map(), i = {
1113
- platform: Ve,
1114
- ...n
1115
- }, r = {
1116
- ...i.platform,
1117
- _c: o
1118
- };
1119
- return ge(t, e, {
1120
- ...i,
1121
- platform: r
1122
- });
1123
- };
1124
- var qe = typeof document < "u", Ue = function() {
1125
- }, rt = qe ? qt : Ue;
1126
- function ft(t, e) {
1127
- if (t === e)
1128
- return !0;
1129
- if (typeof t != typeof e)
1130
- return !1;
1131
- if (typeof t == "function" && t.toString() === e.toString())
1132
- return !0;
1133
- let n, o, i;
1134
- if (t && e && typeof t == "object") {
1135
- if (Array.isArray(t)) {
1136
- if (n = t.length, n !== e.length) return !1;
1137
- for (o = n; o-- !== 0; )
1138
- if (!ft(t[o], e[o]))
1139
- return !1;
1140
- return !0;
1141
- }
1142
- if (i = Object.keys(t), n = i.length, n !== Object.keys(e).length)
1143
- return !1;
1144
- for (o = n; o-- !== 0; )
1145
- if (!{}.hasOwnProperty.call(e, i[o]))
1146
- return !1;
1147
- for (o = n; o-- !== 0; ) {
1148
- const r = i[o];
1149
- if (!(r === "_owner" && t.$$typeof) && !ft(t[r], e[r]))
1150
- return !1;
1151
- }
1152
- return !0;
1153
- }
1154
- return t !== t && e !== e;
1155
- }
1156
- function Yt(t) {
1157
- return typeof window > "u" ? 1 : (t.ownerDocument.defaultView || window).devicePixelRatio || 1;
1158
- }
1159
- function $t(t, e) {
1160
- const n = Yt(t);
1161
- return Math.round(e * n) / n;
1162
- }
1163
- function gt(t) {
1164
- const e = L.useRef(t);
1165
- return rt(() => {
1166
- e.current = t;
1167
- }), e;
1168
- }
1169
- function Qe(t) {
1170
- t === void 0 && (t = {});
1171
- const {
1172
- placement: e = "bottom",
1173
- strategy: n = "absolute",
1174
- middleware: o = [],
1175
- platform: i,
1176
- elements: {
1177
- reference: r,
1178
- floating: s
1179
- } = {},
1180
- transform: c = !0,
1181
- whileElementsMounted: a,
1182
- open: f
1183
- } = t, [l, u] = L.useState({
1184
- x: 0,
1185
- y: 0,
1186
- strategy: n,
1187
- placement: e,
1188
- middlewareData: {},
1189
- isPositioned: !1
1190
- }), [m, d] = L.useState(o);
1191
- ft(m, o) || d(o);
1192
- const [h, g] = L.useState(null), [p, w] = L.useState(null), x = L.useCallback((A) => {
1193
- A !== O.current && (O.current = A, g(A));
1194
- }, []), v = L.useCallback((A) => {
1195
- A !== R.current && (R.current = A, w(A));
1196
- }, []), b = r || h, y = s || p, O = L.useRef(null), R = L.useRef(null), P = L.useRef(l), W = a != null, E = gt(a), B = gt(i), M = gt(f), D = L.useCallback(() => {
1197
- if (!O.current || !R.current)
1198
- return;
1199
- const A = {
1200
- placement: e,
1201
- strategy: n,
1202
- middleware: m
1203
- };
1204
- B.current && (A.platform = B.current), Ye(O.current, R.current, A).then((k) => {
1205
- const q = {
1206
- ...k,
1207
- // The floating element's position may be recomputed while it's closed
1208
- // but still mounted (such as when transitioning out). To ensure
1209
- // `isPositioned` will be `false` initially on the next open, avoid
1210
- // setting it to `true` when `open === false` (must be specified).
1211
- isPositioned: M.current !== !1
1212
- };
1213
- S.current && !ft(P.current, q) && (P.current = q, Ut.flushSync(() => {
1214
- u(q);
1215
- }));
1216
- });
1217
- }, [m, e, n, B, M]);
1218
- rt(() => {
1219
- f === !1 && P.current.isPositioned && (P.current.isPositioned = !1, u((A) => ({
1220
- ...A,
1221
- isPositioned: !1
1222
- })));
1223
- }, [f]);
1224
- const S = L.useRef(!1);
1225
- rt(() => (S.current = !0, () => {
1226
- S.current = !1;
1227
- }), []), rt(() => {
1228
- if (b && (O.current = b), y && (R.current = y), b && y) {
1229
- if (E.current)
1230
- return E.current(b, y, D);
1231
- D();
1232
- }
1233
- }, [b, y, D, E, W]);
1234
- const N = L.useMemo(() => ({
1235
- reference: O,
1236
- floating: R,
1237
- setReference: x,
1238
- setFloating: v
1239
- }), [x, v]), C = L.useMemo(() => ({
1240
- reference: b,
1241
- floating: y
1242
- }), [b, y]), T = L.useMemo(() => {
1243
- const A = {
1244
- position: n,
1245
- left: 0,
1246
- top: 0
1247
- };
1248
- if (!C.floating)
1249
- return A;
1250
- const k = $t(C.floating, l.x), q = $t(C.floating, l.y);
1251
- return c ? {
1252
- ...A,
1253
- transform: "translate(" + k + "px, " + q + "px)",
1254
- ...Yt(C.floating) >= 1.5 && {
1255
- willChange: "transform"
1256
- }
1257
- } : {
1258
- position: n,
1259
- left: k,
1260
- top: q
1261
- };
1262
- }, [n, c, C.floating, l.x, l.y]);
1263
- return L.useMemo(() => ({
1264
- ...l,
1265
- update: D,
1266
- refs: N,
1267
- elements: C,
1268
- floatingStyles: T
1269
- }), [l, D, N, C, T]);
1270
- }
1271
- const Ke = (t) => {
1272
- function e(n) {
1273
- return {}.hasOwnProperty.call(n, "current");
1274
- }
1275
- return {
1276
- name: "arrow",
1277
- options: t,
1278
- fn(n) {
1279
- const {
1280
- element: o,
1281
- padding: i
1282
- } = typeof t == "function" ? t(n) : t;
1283
- return o && e(o) ? o.current != null ? Ft({
1284
- element: o.current,
1285
- padding: i
1286
- }).fn(n) : {} : o ? Ft({
1287
- element: o,
1288
- padding: i
1289
- }).fn(n) : {};
1290
- }
1291
- };
1292
- }, Ze = (t, e) => ({
1293
- ...Ne(t),
1294
- options: [t, e]
1295
- }), tn = (t, e) => ({
1296
- ..._e(t),
1297
- options: [t, e]
1298
- }), en = (t, e) => ({
1299
- ...Xe(t),
1300
- options: [t, e]
1301
- }), nn = (t, e) => ({
1302
- ...ze(t),
1303
- options: [t, e]
1304
- }), on = (t, e) => ({
1305
- ...je(t),
1306
- options: [t, e]
1307
- }), rn = (t, e) => ({
1308
- ...Ie(t),
1309
- options: [t, e]
1310
- }), sn = (t, e) => ({
1311
- ...Ke(t),
1312
- options: [t, e]
1313
- });
1314
- export {
1315
- j as a,
1316
- Wt as b,
1317
- V as c,
1318
- et as d,
1319
- vt as e,
1320
- Q as f,
1321
- $ as g,
1322
- U as h,
1323
- St as i,
1324
- H as j,
1325
- nn as k,
1326
- Je as l,
1327
- on as m,
1328
- sn as n,
1329
- Ze as o,
1330
- rn as p,
1331
- en as q,
1332
- tn as s,
1333
- Qe as u
1334
- };