mimir-ui-kit 1.37.2 → 1.37.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{combobox-CDU06zJj.js → combobox-BpYucpxz.js} +1121 -1080
- package/dist/components/Accordion/Accordion.js +15 -15
- package/dist/components/CheckboxMimir/CheckboxMimir.js +4 -4
- package/dist/components/MultiSelectSearch/MultiSelectSearch.js +22 -22
- package/dist/components/RadioGroup/RadioGroup.js +3 -3
- package/dist/components/SelectSearch/SelectSearch.js +24 -24
- package/dist/components/Switcher/Switcher.js +4 -4
- package/dist/components/TabTrail/TabTrail.js +4 -4
- package/dist/components/UniversalUploader/UniversalUploader.d.ts +2 -0
- package/dist/components/UniversalUploader/UniversalUploader.js +54 -51
- package/dist/components/UniversalUploader/types.d.ts +2 -0
- package/dist/{field-FJ34aSs4.js → field-C1kt7aNM.js} +2 -2
- package/dist/{focus-management-XwV-9qkO.js → focus-management-DOYCPyGg.js} +1 -1
- package/dist/{hidden-DbgtYPOH.js → hidden-PvGXrYUY.js} +1 -1
- package/dist/{keyboard-B0lm_zyn.js → keyboard-mgWkd2Vh.js} +114 -111
- package/dist/{label-y3ANLTNC.js → label-D4GFpe5F.js} +2 -2
- package/dist/open-closed-D2VjDhAN.js +86 -0
- package/dist/{use-active-press-86hajhdd.js → use-active-press-CqLGIFz7.js} +1 -1
- package/package.json +1 -1
- package/dist/open-closed-CdldUPoq.js +0 -86
@@ -1,34 +1,34 @@
|
|
1
|
-
import { n as
|
2
|
-
import * as
|
3
|
-
import
|
4
|
-
import * as
|
5
|
-
import { flushSync as
|
6
|
-
import { w as
|
7
|
-
import { u as
|
8
|
-
import { K as
|
9
|
-
import { A as
|
10
|
-
import { e as
|
11
|
-
import { c as
|
12
|
-
import { r as
|
13
|
-
function
|
1
|
+
import { n as U, u as wt, d as Te, s as Pe, o as M, p as Zt, t as An, e as Le, W as me, y as Oe, T as $n, H as pe, M as At, a as Re, $ as en, b as tn, D as yt, I as Dn, c as Z } from "./keyboard-mgWkd2Vh.js";
|
2
|
+
import * as w from "react";
|
3
|
+
import j, { useReducer as nn, useMemo as X, useSyncExternalStore as Fn, useId as Be, useEffect as oe, useCallback as Ne, useRef as J, useLayoutEffect as on, createContext as he, useContext as le, useState as ce, Fragment as tt, createRef as Ln } from "react";
|
4
|
+
import * as Xe from "react-dom";
|
5
|
+
import { flushSync as xe, createPortal as _n } from "react-dom";
|
6
|
+
import { w as Nn } from "./use-active-press-CqLGIFz7.js";
|
7
|
+
import { u as kn } from "./use-by-comparator-CVuf9KBq.js";
|
8
|
+
import { K as zn, a as Hn, b as Vn, T as Bn, z as Wn, j as jn, u as Un, I as Et, G as Yn } from "./label-D4GFpe5F.js";
|
9
|
+
import { A as qn, h as Kn, f as Gn, _ as Xn } from "./focus-management-DOYCPyGg.js";
|
10
|
+
import { e as Jn } from "./use-resolve-button-type-DhFdPxnv.js";
|
11
|
+
import { c as Qn, i as Je, u as Zn, x as eo, R as to } from "./open-closed-D2VjDhAN.js";
|
12
|
+
import { r as no } from "./bugs-diTMAGNw.js";
|
13
|
+
function Se(e, t, n) {
|
14
14
|
let o = n.initialDeps ?? [], i;
|
15
15
|
return () => {
|
16
16
|
var r, s, l, a;
|
17
|
-
let
|
18
|
-
n.key && ((r = n.debug) != null && r.call(n)) && (
|
19
|
-
const
|
20
|
-
if (!(
|
17
|
+
let u;
|
18
|
+
n.key && ((r = n.debug) != null && r.call(n)) && (u = Date.now());
|
19
|
+
const c = e();
|
20
|
+
if (!(c.length !== o.length || c.some((f, m) => o[m] !== f)))
|
21
21
|
return i;
|
22
|
-
o =
|
22
|
+
o = c;
|
23
23
|
let p;
|
24
|
-
if (n.key && ((s = n.debug) != null && s.call(n)) && (p = Date.now()), i = t(...
|
25
|
-
const
|
26
|
-
for (v = String(v); v.length <
|
24
|
+
if (n.key && ((s = n.debug) != null && s.call(n)) && (p = Date.now()), i = t(...c), n.key && ((l = n.debug) != null && l.call(n))) {
|
25
|
+
const f = Math.round((Date.now() - u) * 100) / 100, m = Math.round((Date.now() - p) * 100) / 100, h = m / 16, g = (v, y) => {
|
26
|
+
for (v = String(v); v.length < y; )
|
27
27
|
v = " " + v;
|
28
28
|
return v;
|
29
29
|
};
|
30
30
|
console.info(
|
31
|
-
`%c⏱ ${g(m, 5)} /${g(
|
31
|
+
`%c⏱ ${g(m, 5)} /${g(f, 5)} ms`,
|
32
32
|
`
|
33
33
|
font-size: .6rem;
|
34
34
|
font-weight: bold;
|
@@ -42,22 +42,22 @@ function De(e, t, n) {
|
|
42
42
|
return (a = n == null ? void 0 : n.onChange) == null || a.call(n, i), i;
|
43
43
|
};
|
44
44
|
}
|
45
|
-
function
|
45
|
+
function st(e, t) {
|
46
46
|
if (e === void 0)
|
47
47
|
throw new Error("Unexpected undefined");
|
48
48
|
return e;
|
49
49
|
}
|
50
|
-
const
|
50
|
+
const oo = (e, t) => Math.abs(e - t) < 1, io = (e, t, n) => {
|
51
51
|
let o;
|
52
52
|
return function(...i) {
|
53
53
|
e.clearTimeout(o), o = e.setTimeout(() => t.apply(this, i), n);
|
54
54
|
};
|
55
|
-
},
|
55
|
+
}, ro = (e) => e, lo = (e) => {
|
56
56
|
const t = Math.max(e.startIndex - e.overscan, 0), n = Math.min(e.endIndex + e.overscan, e.count - 1), o = [];
|
57
57
|
for (let i = t; i <= n; i++)
|
58
58
|
o.push(i);
|
59
59
|
return o;
|
60
|
-
},
|
60
|
+
}, so = (e, t) => {
|
61
61
|
const n = e.scrollElement;
|
62
62
|
if (!n)
|
63
63
|
return;
|
@@ -85,9 +85,9 @@ const to = (e, t) => Math.abs(e - t) < 1, no = (e, t, n) => {
|
|
85
85
|
return r.observe(n, { box: "border-box" }), () => {
|
86
86
|
r.unobserve(n);
|
87
87
|
};
|
88
|
-
},
|
88
|
+
}, $t = {
|
89
89
|
passive: !0
|
90
|
-
},
|
90
|
+
}, ao = typeof window > "u" ? !0 : "onscrollend" in window, co = (e, t) => {
|
91
91
|
const n = e.scrollElement;
|
92
92
|
if (!n)
|
93
93
|
return;
|
@@ -95,20 +95,21 @@ const to = (e, t) => Math.abs(e - t) < 1, no = (e, t, n) => {
|
|
95
95
|
if (!o)
|
96
96
|
return;
|
97
97
|
let i = 0;
|
98
|
-
const r =
|
99
|
-
} :
|
98
|
+
const r = ao ? () => {
|
99
|
+
} : io(
|
100
100
|
o,
|
101
101
|
() => {
|
102
102
|
t(i, !1);
|
103
103
|
},
|
104
104
|
e.options.isScrollingResetDelay
|
105
|
-
), s = (
|
106
|
-
|
105
|
+
), s = (u) => () => {
|
106
|
+
const { horizontal: c, isRtl: d } = e.options;
|
107
|
+
i = c ? n.scrollLeft * (d && -1 || 1) : n.scrollTop, r(), t(i, u);
|
107
108
|
}, l = s(!0), a = s(!1);
|
108
|
-
return a(), n.addEventListener("scroll", l,
|
109
|
+
return a(), n.addEventListener("scroll", l, $t), n.addEventListener("scrollend", a, $t), () => {
|
109
110
|
n.removeEventListener("scroll", l), n.removeEventListener("scrollend", a);
|
110
111
|
};
|
111
|
-
},
|
112
|
+
}, uo = (e, t, n) => {
|
112
113
|
if (t != null && t.borderBoxSize) {
|
113
114
|
const o = t.borderBoxSize[0];
|
114
115
|
if (o)
|
@@ -119,7 +120,7 @@ const to = (e, t) => Math.abs(e - t) < 1, no = (e, t, n) => {
|
|
119
120
|
return Math.round(
|
120
121
|
e.getBoundingClientRect()[n.options.horizontal ? "width" : "height"]
|
121
122
|
);
|
122
|
-
},
|
123
|
+
}, fo = (e, {
|
123
124
|
adjustments: t = 0,
|
124
125
|
behavior: n
|
125
126
|
}, o) => {
|
@@ -130,7 +131,7 @@ const to = (e, t) => Math.abs(e - t) < 1, no = (e, t, n) => {
|
|
130
131
|
behavior: n
|
131
132
|
});
|
132
133
|
};
|
133
|
-
class
|
134
|
+
class mo {
|
134
135
|
constructor(t) {
|
135
136
|
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.scrollToIndexTimeoutId = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.observer = /* @__PURE__ */ (() => {
|
136
137
|
let n = null;
|
@@ -142,7 +143,7 @@ class uo {
|
|
142
143
|
return {
|
143
144
|
disconnect: () => {
|
144
145
|
var i;
|
145
|
-
|
146
|
+
(i = o()) == null || i.disconnect(), n = null;
|
146
147
|
},
|
147
148
|
observe: (i) => {
|
148
149
|
var r;
|
@@ -165,11 +166,11 @@ class uo {
|
|
165
166
|
scrollPaddingStart: 0,
|
166
167
|
scrollPaddingEnd: 0,
|
167
168
|
horizontal: !1,
|
168
|
-
getItemKey:
|
169
|
-
rangeExtractor:
|
169
|
+
getItemKey: ro,
|
170
|
+
rangeExtractor: lo,
|
170
171
|
onChange: () => {
|
171
172
|
},
|
172
|
-
measureElement:
|
173
|
+
measureElement: uo,
|
173
174
|
initialRect: { width: 0, height: 0 },
|
174
175
|
scrollMargin: 0,
|
175
176
|
gap: 0,
|
@@ -178,17 +179,32 @@ class uo {
|
|
178
179
|
lanes: 1,
|
179
180
|
isScrollingResetDelay: 150,
|
180
181
|
enabled: !0,
|
182
|
+
isRtl: !1,
|
181
183
|
...n
|
182
184
|
};
|
183
|
-
}, this.notify = (n
|
184
|
-
var
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
185
|
+
}, this.notify = (n) => {
|
186
|
+
var o, i;
|
187
|
+
(i = (o = this.options).onChange) == null || i.call(o, this, n);
|
188
|
+
}, this.maybeNotify = Se(
|
189
|
+
() => (this.calculateRange(), [
|
190
|
+
this.isScrolling,
|
191
|
+
this.range ? this.range.startIndex : null,
|
192
|
+
this.range ? this.range.endIndex : null
|
193
|
+
]),
|
194
|
+
(n) => {
|
195
|
+
this.notify(n);
|
196
|
+
},
|
197
|
+
{
|
198
|
+
key: process.env.NODE_ENV !== "production" && "maybeNotify",
|
199
|
+
debug: () => this.options.debug,
|
200
|
+
initialDeps: [
|
201
|
+
this.isScrolling,
|
202
|
+
this.range ? this.range.startIndex : null,
|
203
|
+
this.range ? this.range.endIndex : null
|
204
|
+
]
|
205
|
+
}
|
206
|
+
), this.cleanup = () => {
|
207
|
+
this.unsubs.filter(Boolean).forEach((n) => n()), this.unsubs = [], this.observer.disconnect(), this.scrollElement = null, this.targetWindow = null;
|
192
208
|
}, this._didMount = () => () => {
|
193
209
|
this.cleanup();
|
194
210
|
}, this._willUpdate = () => {
|
@@ -196,21 +212,21 @@ class uo {
|
|
196
212
|
const o = this.options.enabled ? this.options.getScrollElement() : null;
|
197
213
|
if (this.scrollElement !== o) {
|
198
214
|
if (this.cleanup(), !o) {
|
199
|
-
this.
|
215
|
+
this.maybeNotify();
|
200
216
|
return;
|
201
217
|
}
|
202
|
-
this.scrollElement = o, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((n = this.scrollElement) == null ? void 0 : n.window) ?? null, this.
|
218
|
+
this.scrollElement = o, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((n = this.scrollElement) == null ? void 0 : n.window) ?? null, this.elementsCache.forEach((i) => {
|
219
|
+
this.observer.observe(i);
|
220
|
+
}), this._scrollToOffset(this.getScrollOffset(), {
|
203
221
|
adjustments: void 0,
|
204
222
|
behavior: void 0
|
205
223
|
}), this.unsubs.push(
|
206
224
|
this.options.observeElementRect(this, (i) => {
|
207
|
-
this.scrollRect = i, this.
|
225
|
+
this.scrollRect = i, this.maybeNotify();
|
208
226
|
})
|
209
227
|
), this.unsubs.push(
|
210
228
|
this.options.observeElementOffset(this, (i, r) => {
|
211
|
-
this.scrollAdjustments = 0, this.scrollDirection = r ? this.getScrollOffset() < i ? "forward" : "backward" : null, this.scrollOffset = i;
|
212
|
-
const s = this.isScrolling;
|
213
|
-
this.isScrolling = r, this.notify(s !== r, r);
|
229
|
+
this.scrollAdjustments = 0, this.scrollDirection = r ? this.getScrollOffset() < i ? "forward" : "backward" : null, this.scrollOffset = i, this.isScrolling = r, this.maybeNotify();
|
214
230
|
})
|
215
231
|
);
|
216
232
|
}
|
@@ -227,7 +243,7 @@ class uo {
|
|
227
243
|
break;
|
228
244
|
}
|
229
245
|
return r.size === this.options.lanes ? Array.from(r.values()).sort((s, l) => s.end === l.end ? s.index - l.index : s.end - l.end)[0] : void 0;
|
230
|
-
}, this.getMeasurementOptions =
|
246
|
+
}, this.getMeasurementOptions = Se(
|
231
247
|
() => [
|
232
248
|
this.options.count,
|
233
249
|
this.options.paddingStart,
|
@@ -245,51 +261,37 @@ class uo {
|
|
245
261
|
{
|
246
262
|
key: !1
|
247
263
|
}
|
248
|
-
), this.getMeasurements =
|
264
|
+
), this.getMeasurements = Se(
|
249
265
|
() => [this.getMeasurementOptions(), this.itemSizeCache],
|
250
266
|
({ count: n, paddingStart: o, scrollMargin: i, getItemKey: r, enabled: s }, l) => {
|
251
|
-
var a;
|
252
267
|
if (!s)
|
253
268
|
return this.measurementsCache = [], this.itemSizeCache.clear(), [];
|
254
|
-
this.measurementsCache.length === 0 && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((
|
255
|
-
this.itemSizeCache.set(
|
269
|
+
this.measurementsCache.length === 0 && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((c) => {
|
270
|
+
this.itemSizeCache.set(c.key, c.size);
|
256
271
|
}));
|
257
|
-
const
|
272
|
+
const a = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
258
273
|
this.pendingMeasuredCacheIndexes = [];
|
259
|
-
const
|
260
|
-
for (let
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
d,
|
270
|
-
this.options.measureElement(x, void 0, this)
|
271
|
-
);
|
272
|
-
});
|
273
|
-
const u = r(d), m = this.options.lanes === 1 ? f[d - 1] : this.getFurthestMeasurement(f, d), h = m ? m.end + this.options.gap : o + i, g = l.get(u), v = typeof g == "number" ? g : this.options.estimateSize(d), E = h + v, b = m ? m.lane : d % this.options.lanes;
|
274
|
-
f[d] = {
|
275
|
-
index: d,
|
276
|
-
start: h,
|
277
|
-
size: v,
|
278
|
-
end: E,
|
279
|
-
key: u,
|
280
|
-
lane: b,
|
281
|
-
measureElement: p
|
274
|
+
const u = this.measurementsCache.slice(0, a);
|
275
|
+
for (let c = a; c < n; c++) {
|
276
|
+
const d = r(c), p = this.options.lanes === 1 ? u[c - 1] : this.getFurthestMeasurement(u, c), f = p ? p.end + this.options.gap : o + i, m = l.get(d), h = typeof m == "number" ? m : this.options.estimateSize(c), g = f + h, v = p ? p.lane : c % this.options.lanes;
|
277
|
+
u[c] = {
|
278
|
+
index: c,
|
279
|
+
start: f,
|
280
|
+
size: h,
|
281
|
+
end: g,
|
282
|
+
key: d,
|
283
|
+
lane: v
|
282
284
|
};
|
283
285
|
}
|
284
|
-
return this.measurementsCache =
|
286
|
+
return this.measurementsCache = u, u;
|
285
287
|
},
|
286
288
|
{
|
287
289
|
key: process.env.NODE_ENV !== "production" && "getMeasurements",
|
288
290
|
debug: () => this.options.debug
|
289
291
|
}
|
290
|
-
), this.calculateRange =
|
292
|
+
), this.calculateRange = Se(
|
291
293
|
() => [this.getMeasurements(), this.getSize(), this.getScrollOffset()],
|
292
|
-
(n, o, i) => this.range = n.length > 0 && o > 0 ?
|
294
|
+
(n, o, i) => this.range = n.length > 0 && o > 0 ? po({
|
293
295
|
measurements: n,
|
294
296
|
outerSize: o,
|
295
297
|
scrollOffset: i
|
@@ -298,7 +300,7 @@ class uo {
|
|
298
300
|
key: process.env.NODE_ENV !== "production" && "calculateRange",
|
299
301
|
debug: () => this.options.debug
|
300
302
|
}
|
301
|
-
), this.getIndexes =
|
303
|
+
), this.getIndexes = Se(
|
302
304
|
() => [
|
303
305
|
this.options.rangeExtractor,
|
304
306
|
this.calculateRange(),
|
@@ -321,27 +323,29 @@ class uo {
|
|
321
323
|
`Missing attribute name '${o}={index}' on measured element.`
|
322
324
|
), -1);
|
323
325
|
}, this._measureElement = (n, o) => {
|
324
|
-
const i = this.indexFromElement(n), r = this.
|
325
|
-
if (!r
|
326
|
-
this.elementsCache.forEach((l, a) => {
|
327
|
-
l === n && (this.observer.unobserve(n), this.elementsCache.delete(a));
|
328
|
-
});
|
326
|
+
const i = this.indexFromElement(n), r = this.measurementsCache[i];
|
327
|
+
if (!r)
|
329
328
|
return;
|
330
|
-
|
331
|
-
|
332
|
-
s !== n && (s && this.observer.unobserve(s), this.observer.observe(n), this.elementsCache.set(r.key, n)), this.resizeItem(i, this.options.measureElement(n, o, this));
|
329
|
+
const s = r.key, l = this.elementsCache.get(s);
|
330
|
+
l !== n && (l && this.observer.unobserve(l), this.observer.observe(n), this.elementsCache.set(s, n)), n.isConnected && this.resizeItem(i, this.options.measureElement(n, o, this));
|
333
331
|
}, this.resizeItem = (n, o) => {
|
334
|
-
const i = this.
|
332
|
+
const i = this.measurementsCache[n];
|
335
333
|
if (!i)
|
336
334
|
return;
|
337
335
|
const r = this.itemSizeCache.get(i.key) ?? i.size, s = o - r;
|
338
336
|
s !== 0 && ((this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(i, s, this) : i.start < this.getScrollOffset() + this.scrollAdjustments) && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", s), this._scrollToOffset(this.getScrollOffset(), {
|
339
337
|
adjustments: this.scrollAdjustments += s,
|
340
338
|
behavior: void 0
|
341
|
-
})), this.pendingMeasuredCacheIndexes.push(i.index), this.itemSizeCache = new Map(this.itemSizeCache.set(i.key, o)), this.notify(!
|
339
|
+
})), this.pendingMeasuredCacheIndexes.push(i.index), this.itemSizeCache = new Map(this.itemSizeCache.set(i.key, o)), this.notify(!1));
|
342
340
|
}, this.measureElement = (n) => {
|
343
|
-
|
344
|
-
|
341
|
+
if (!n) {
|
342
|
+
this.elementsCache.forEach((o, i) => {
|
343
|
+
o.isConnected || (this.observer.unobserve(o), this.elementsCache.delete(i));
|
344
|
+
});
|
345
|
+
return;
|
346
|
+
}
|
347
|
+
this._measureElement(n, void 0);
|
348
|
+
}, this.getVirtualItems = Se(
|
345
349
|
() => [this.getIndexes(), this.getMeasurements()],
|
346
350
|
(n, o) => {
|
347
351
|
const i = [];
|
@@ -352,17 +356,17 @@ class uo {
|
|
352
356
|
return i;
|
353
357
|
},
|
354
358
|
{
|
355
|
-
key: process.env.NODE_ENV !== "production" && "
|
359
|
+
key: process.env.NODE_ENV !== "production" && "getVirtualItems",
|
356
360
|
debug: () => this.options.debug
|
357
361
|
}
|
358
362
|
), this.getVirtualItemForOffset = (n) => {
|
359
363
|
const o = this.getMeasurements();
|
360
364
|
if (o.length !== 0)
|
361
|
-
return
|
362
|
-
o[
|
365
|
+
return st(
|
366
|
+
o[rn(
|
363
367
|
0,
|
364
368
|
o.length - 1,
|
365
|
-
(i) =>
|
369
|
+
(i) => st(o[i]).start,
|
366
370
|
n
|
367
371
|
)]
|
368
372
|
);
|
@@ -373,7 +377,7 @@ class uo {
|
|
373
377
|
return Math.max(Math.min(a, n), 0);
|
374
378
|
}, this.getOffsetForIndex = (n, o = "auto") => {
|
375
379
|
n = Math.max(0, Math.min(n, this.options.count - 1));
|
376
|
-
const i = this.
|
380
|
+
const i = this.measurementsCache[n];
|
377
381
|
if (!i)
|
378
382
|
return;
|
379
383
|
const r = this.getSize(), s = this.getScrollOffset();
|
@@ -406,10 +410,10 @@ class uo {
|
|
406
410
|
if (this.scrollToIndexTimeoutId = null, this.elementsCache.has(
|
407
411
|
this.options.getItemKey(n)
|
408
412
|
)) {
|
409
|
-
const [
|
413
|
+
const [u] = st(
|
410
414
|
this.getOffsetForIndex(n, l)
|
411
415
|
);
|
412
|
-
|
416
|
+
oo(u, this.getScrollOffset()) || this.scrollToIndex(n, { align: l, behavior: i });
|
413
417
|
} else
|
414
418
|
this.scrollToIndex(n, { align: l, behavior: i });
|
415
419
|
}));
|
@@ -426,19 +430,21 @@ class uo {
|
|
426
430
|
let i;
|
427
431
|
return o.length === 0 ? i = this.options.paddingStart : i = this.options.lanes === 1 ? ((n = o[o.length - 1]) == null ? void 0 : n.end) ?? 0 : Math.max(
|
428
432
|
...o.slice(-this.options.lanes).map((r) => r.end)
|
429
|
-
),
|
433
|
+
), Math.max(
|
434
|
+
i - this.options.scrollMargin + this.options.paddingEnd,
|
435
|
+
0
|
436
|
+
);
|
430
437
|
}, this._scrollToOffset = (n, {
|
431
438
|
adjustments: o,
|
432
439
|
behavior: i
|
433
440
|
}) => {
|
434
441
|
this.options.scrollToFn(n, { behavior: i, adjustments: o }, this);
|
435
442
|
}, this.measure = () => {
|
436
|
-
|
437
|
-
this.itemSizeCache = /* @__PURE__ */ new Map(), (o = (n = this.options).onChange) == null || o.call(n, this, !1);
|
443
|
+
this.itemSizeCache = /* @__PURE__ */ new Map(), this.notify(!1);
|
438
444
|
}, this.setOptions(t);
|
439
445
|
}
|
440
446
|
}
|
441
|
-
const
|
447
|
+
const rn = (e, t, n, o) => {
|
442
448
|
for (; e <= t; ) {
|
443
449
|
const i = (e + t) / 2 | 0, r = n(i);
|
444
450
|
if (r < o)
|
@@ -450,46 +456,46 @@ const tn = (e, t, n, o) => {
|
|
450
456
|
}
|
451
457
|
return e > 0 ? e - 1 : 0;
|
452
458
|
};
|
453
|
-
function
|
459
|
+
function po({
|
454
460
|
measurements: e,
|
455
461
|
outerSize: t,
|
456
462
|
scrollOffset: n
|
457
463
|
}) {
|
458
|
-
const o = e.length - 1, r =
|
464
|
+
const o = e.length - 1, r = rn(0, o, (l) => e[l].start, n);
|
459
465
|
let s = r;
|
460
466
|
for (; s < o && e[s].end < n + t; )
|
461
467
|
s++;
|
462
468
|
return { startIndex: r, endIndex: s };
|
463
469
|
}
|
464
|
-
const
|
465
|
-
function
|
466
|
-
const t =
|
470
|
+
const ho = typeof document < "u" ? w.useLayoutEffect : w.useEffect;
|
471
|
+
function go(e) {
|
472
|
+
const t = w.useReducer(() => ({}), {})[1], n = {
|
467
473
|
...e,
|
468
474
|
onChange: (i, r) => {
|
469
475
|
var s;
|
470
|
-
r ?
|
476
|
+
r ? xe(t) : t(), (s = e.onChange) == null || s.call(e, i, r);
|
471
477
|
}
|
472
|
-
}, [o] =
|
473
|
-
() => new
|
478
|
+
}, [o] = w.useState(
|
479
|
+
() => new mo(n)
|
474
480
|
);
|
475
|
-
return o.setOptions(n),
|
481
|
+
return o.setOptions(n), w.useEffect(() => o._didMount(), []), ho(() => o._willUpdate()), o;
|
476
482
|
}
|
477
|
-
function
|
478
|
-
return
|
479
|
-
observeElementRect:
|
480
|
-
observeElementOffset:
|
481
|
-
scrollToFn:
|
483
|
+
function vo(e) {
|
484
|
+
return go({
|
485
|
+
observeElementRect: so,
|
486
|
+
observeElementOffset: co,
|
487
|
+
scrollToFn: fo,
|
482
488
|
...e
|
483
489
|
});
|
484
490
|
}
|
485
|
-
function
|
491
|
+
function bo(e) {
|
486
492
|
if (e === null) return { width: 0, height: 0 };
|
487
493
|
let { width: t, height: n } = e.getBoundingClientRect();
|
488
494
|
return { width: t, height: n };
|
489
495
|
}
|
490
|
-
function
|
491
|
-
let [n, o] =
|
492
|
-
return
|
496
|
+
function Dt(e, t = !1) {
|
497
|
+
let [n, o] = nn(() => ({}), {}), i = X(() => bo(e), [e, n]);
|
498
|
+
return U(() => {
|
493
499
|
if (!e) return;
|
494
500
|
let r = new ResizeObserver(o);
|
495
501
|
return r.observe(e), () => {
|
@@ -497,7 +503,7 @@ function Mt(e, t = !1) {
|
|
497
503
|
};
|
498
504
|
}, [e]), t ? { width: `${i.width}px`, height: `${i.height}px` } : i;
|
499
505
|
}
|
500
|
-
let
|
506
|
+
let xo = class extends Map {
|
501
507
|
constructor(t) {
|
502
508
|
super(), this.factory = t;
|
503
509
|
}
|
@@ -506,7 +512,7 @@ let vo = class extends Map {
|
|
506
512
|
return n === void 0 && (n = this.factory(t), this.set(t, n)), n;
|
507
513
|
}
|
508
514
|
};
|
509
|
-
function
|
515
|
+
function ln(e, t) {
|
510
516
|
let n = e(), o = /* @__PURE__ */ new Set();
|
511
517
|
return { getSnapshot() {
|
512
518
|
return n;
|
@@ -517,10 +523,10 @@ function nn(e, t) {
|
|
517
523
|
s && (n = s, o.forEach((l) => l()));
|
518
524
|
} };
|
519
525
|
}
|
520
|
-
function
|
521
|
-
return
|
526
|
+
function sn(e) {
|
527
|
+
return Fn(e.subscribe, e.getSnapshot, e.getSnapshot);
|
522
528
|
}
|
523
|
-
let
|
529
|
+
let wo = new xo(() => ln(() => [], { ADD(e) {
|
524
530
|
return this.includes(e) ? this : [...this, e];
|
525
531
|
}, REMOVE(e) {
|
526
532
|
let t = this.indexOf(e);
|
@@ -528,50 +534,50 @@ let bo = new vo(() => nn(() => [], { ADD(e) {
|
|
528
534
|
let n = this.slice();
|
529
535
|
return n.splice(t, 1), n;
|
530
536
|
} }));
|
531
|
-
function
|
532
|
-
let n =
|
533
|
-
if (
|
537
|
+
function Ot(e, t) {
|
538
|
+
let n = wo.get(t), o = Be(), i = sn(n);
|
539
|
+
if (U(() => {
|
534
540
|
if (e) return n.dispatch("ADD", o), () => n.dispatch("REMOVE", o);
|
535
541
|
}, [n, e]), !e) return !1;
|
536
542
|
let r = i.indexOf(o), s = i.length;
|
537
543
|
return r === -1 && (r = s, s += 1), r === s - 1;
|
538
544
|
}
|
539
|
-
let
|
540
|
-
function
|
545
|
+
let pt = /* @__PURE__ */ new Map(), _e = /* @__PURE__ */ new Map();
|
546
|
+
function Ft(e) {
|
541
547
|
var t;
|
542
548
|
let n = (t = _e.get(e)) != null ? t : 0;
|
543
|
-
return _e.set(e, n + 1), n !== 0 ? () =>
|
549
|
+
return _e.set(e, n + 1), n !== 0 ? () => Lt(e) : (pt.set(e, { "aria-hidden": e.getAttribute("aria-hidden"), inert: e.inert }), e.setAttribute("aria-hidden", "true"), e.inert = !0, () => Lt(e));
|
544
550
|
}
|
545
|
-
function
|
551
|
+
function Lt(e) {
|
546
552
|
var t;
|
547
553
|
let n = (t = _e.get(e)) != null ? t : 1;
|
548
554
|
if (n === 1 ? _e.delete(e) : _e.set(e, n - 1), n !== 1) return;
|
549
|
-
let o =
|
550
|
-
o && (o["aria-hidden"] === null ? e.removeAttribute("aria-hidden") : e.setAttribute("aria-hidden", o["aria-hidden"]), e.inert = o.inert,
|
555
|
+
let o = pt.get(e);
|
556
|
+
o && (o["aria-hidden"] === null ? e.removeAttribute("aria-hidden") : e.setAttribute("aria-hidden", o["aria-hidden"]), e.inert = o.inert, pt.delete(e));
|
551
557
|
}
|
552
|
-
function
|
553
|
-
let o =
|
554
|
-
|
558
|
+
function yo(e, { allowed: t, disallowed: n } = {}) {
|
559
|
+
let o = Ot(e, "inert-others");
|
560
|
+
U(() => {
|
555
561
|
var i, r;
|
556
562
|
if (!o) return;
|
557
563
|
let s = Te();
|
558
|
-
for (let a of (i = n == null ? void 0 : n()) != null ? i : []) a && s.add(
|
564
|
+
for (let a of (i = n == null ? void 0 : n()) != null ? i : []) a && s.add(Ft(a));
|
559
565
|
let l = (r = t == null ? void 0 : t()) != null ? r : [];
|
560
566
|
for (let a of l) {
|
561
567
|
if (!a) continue;
|
562
|
-
let
|
563
|
-
if (!
|
564
|
-
let
|
565
|
-
for (;
|
566
|
-
for (let d of
|
567
|
-
|
568
|
+
let u = wt(a);
|
569
|
+
if (!u) continue;
|
570
|
+
let c = a.parentElement;
|
571
|
+
for (; c && c !== u.body; ) {
|
572
|
+
for (let d of c.children) l.some((p) => d.contains(p)) || s.add(Ft(d));
|
573
|
+
c = c.parentElement;
|
568
574
|
}
|
569
575
|
}
|
570
576
|
return s.dispose;
|
571
577
|
}, [o, t, n]);
|
572
578
|
}
|
573
|
-
function
|
574
|
-
let o =
|
579
|
+
function Eo(e, t, n) {
|
580
|
+
let o = Pe((i) => {
|
575
581
|
let r = i.getBoundingClientRect();
|
576
582
|
r.x === 0 && r.y === 0 && r.width === 0 && r.height === 0 && n();
|
577
583
|
});
|
@@ -591,17 +597,17 @@ function wo(e, t, n) {
|
|
591
597
|
return () => r.dispose();
|
592
598
|
}, [t, o, e]);
|
593
599
|
}
|
594
|
-
function
|
600
|
+
function an() {
|
595
601
|
return /iPhone/gi.test(window.navigator.platform) || /Mac/gi.test(window.navigator.platform) && window.navigator.maxTouchPoints > 0;
|
596
602
|
}
|
597
|
-
function
|
603
|
+
function Oo() {
|
598
604
|
return /Android/gi.test(window.navigator.userAgent);
|
599
605
|
}
|
600
|
-
function
|
601
|
-
return
|
606
|
+
function cn() {
|
607
|
+
return an() || Oo();
|
602
608
|
}
|
603
609
|
function Fe(e, t, n, o) {
|
604
|
-
let i =
|
610
|
+
let i = Pe(n);
|
605
611
|
oe(() => {
|
606
612
|
if (!e) return;
|
607
613
|
function r(s) {
|
@@ -610,8 +616,8 @@ function Fe(e, t, n, o) {
|
|
610
616
|
return document.addEventListener(t, r, o), () => document.removeEventListener(t, r, o);
|
611
617
|
}, [e, t, o]);
|
612
618
|
}
|
613
|
-
function
|
614
|
-
let i =
|
619
|
+
function So(e, t, n, o) {
|
620
|
+
let i = Pe(n);
|
615
621
|
oe(() => {
|
616
622
|
if (!e) return;
|
617
623
|
function r(s) {
|
@@ -620,40 +626,40 @@ function yo(e, t, n, o) {
|
|
620
626
|
return window.addEventListener(t, r, o), () => window.removeEventListener(t, r, o);
|
621
627
|
}, [e, t, o]);
|
622
628
|
}
|
623
|
-
const
|
624
|
-
function
|
625
|
-
let o =
|
629
|
+
const _t = 30;
|
630
|
+
function Ro(e, t, n) {
|
631
|
+
let o = Ot(e, "outside-click"), i = Pe(n), r = Ne(function(a, u) {
|
626
632
|
if (a.defaultPrevented) return;
|
627
|
-
let
|
628
|
-
if (
|
629
|
-
let d = function p(
|
630
|
-
return typeof
|
633
|
+
let c = u(a);
|
634
|
+
if (c === null || !c.getRootNode().contains(c) || !c.isConnected) return;
|
635
|
+
let d = function p(f) {
|
636
|
+
return typeof f == "function" ? p(f()) : Array.isArray(f) || f instanceof Set ? f : [f];
|
631
637
|
}(t);
|
632
|
-
for (let p of d) if (p !== null && (p.contains(
|
633
|
-
return !
|
634
|
-
}, [i, t]), s =
|
638
|
+
for (let p of d) if (p !== null && (p.contains(c) || a.composed && a.composedPath().includes(p))) return;
|
639
|
+
return !qn(c, Kn.Loose) && c.tabIndex !== -1 && a.preventDefault(), i.current(a, c);
|
640
|
+
}, [i, t]), s = J(null);
|
635
641
|
Fe(o, "pointerdown", (a) => {
|
636
|
-
var
|
637
|
-
s.current = ((
|
642
|
+
var u, c;
|
643
|
+
s.current = ((c = (u = a.composedPath) == null ? void 0 : u.call(a)) == null ? void 0 : c[0]) || a.target;
|
638
644
|
}, !0), Fe(o, "mousedown", (a) => {
|
639
|
-
var
|
640
|
-
s.current = ((
|
645
|
+
var u, c;
|
646
|
+
s.current = ((c = (u = a.composedPath) == null ? void 0 : u.call(a)) == null ? void 0 : c[0]) || a.target;
|
641
647
|
}, !0), Fe(o, "click", (a) => {
|
642
|
-
|
648
|
+
cn() || s.current && (r(a, () => s.current), s.current = null);
|
643
649
|
}, !0);
|
644
|
-
let l =
|
650
|
+
let l = J({ x: 0, y: 0 });
|
645
651
|
Fe(o, "touchstart", (a) => {
|
646
652
|
l.current.x = a.touches[0].clientX, l.current.y = a.touches[0].clientY;
|
647
653
|
}, !0), Fe(o, "touchend", (a) => {
|
648
|
-
let
|
649
|
-
if (!(Math.abs(
|
650
|
-
}, !0),
|
654
|
+
let u = { x: a.changedTouches[0].clientX, y: a.changedTouches[0].clientY };
|
655
|
+
if (!(Math.abs(u.x - l.current.x) >= _t || Math.abs(u.y - l.current.y) >= _t)) return r(a, () => a.target instanceof HTMLElement ? a.target : null);
|
656
|
+
}, !0), So(o, "blur", (a) => r(a, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), !0);
|
651
657
|
}
|
652
658
|
function nt(...e) {
|
653
|
-
return
|
659
|
+
return X(() => wt(...e), [...e]);
|
654
660
|
}
|
655
|
-
function
|
656
|
-
let i =
|
661
|
+
function Co(e, t, n, o) {
|
662
|
+
let i = Pe(n);
|
657
663
|
oe(() => {
|
658
664
|
e = e ?? window;
|
659
665
|
function r(s) {
|
@@ -662,12 +668,12 @@ function So(e, t, n, o) {
|
|
662
668
|
return e.addEventListener(t, r, o), () => e.removeEventListener(t, r, o);
|
663
669
|
}, [e, t, o]);
|
664
670
|
}
|
665
|
-
function
|
666
|
-
let t =
|
667
|
-
return
|
671
|
+
function un(e) {
|
672
|
+
let t = J({ value: "", selectionStart: null, selectionEnd: null });
|
673
|
+
return Co(e, "blur", (n) => {
|
668
674
|
let o = n.target;
|
669
675
|
o instanceof HTMLInputElement && (t.current = { value: o.value, selectionStart: o.selectionStart, selectionEnd: o.selectionEnd });
|
670
|
-
}),
|
676
|
+
}), M(() => {
|
671
677
|
if (document.activeElement !== e && e instanceof HTMLInputElement && e.isConnected) {
|
672
678
|
if (e.focus({ preventScroll: !0 }), e.value !== t.current.value) e.setSelectionRange(e.value.length, e.value.length);
|
673
679
|
else {
|
@@ -678,7 +684,7 @@ function sn(e) {
|
|
678
684
|
}
|
679
685
|
});
|
680
686
|
}
|
681
|
-
function
|
687
|
+
function To() {
|
682
688
|
let e;
|
683
689
|
return { before({ doc: t }) {
|
684
690
|
var n;
|
@@ -689,8 +695,8 @@ function Ro() {
|
|
689
695
|
n.style(o, "paddingRight", `${r}px`);
|
690
696
|
} };
|
691
697
|
}
|
692
|
-
function
|
693
|
-
return
|
698
|
+
function Io() {
|
699
|
+
return an() ? { before({ doc: e, d: t, meta: n }) {
|
694
700
|
function o(i) {
|
695
701
|
return n.containers.flatMap((r) => r()).some((r) => r.contains(i));
|
696
702
|
}
|
@@ -705,8 +711,8 @@ function Co() {
|
|
705
711
|
if (l.target instanceof HTMLElement) try {
|
706
712
|
let a = l.target.closest("a");
|
707
713
|
if (!a) return;
|
708
|
-
let { hash:
|
709
|
-
|
714
|
+
let { hash: u } = new URL(a.href), c = e.querySelector(u);
|
715
|
+
c && !o(c) && (s = c);
|
710
716
|
} catch {
|
711
717
|
}
|
712
718
|
}, !0), t.addEventListener(e, "touchstart", (l) => {
|
@@ -732,17 +738,17 @@ function Co() {
|
|
732
738
|
});
|
733
739
|
} } : {};
|
734
740
|
}
|
735
|
-
function
|
741
|
+
function Mo() {
|
736
742
|
return { before({ doc: e, d: t }) {
|
737
743
|
t.style(e.documentElement, "overflow", "hidden");
|
738
744
|
} };
|
739
745
|
}
|
740
|
-
function
|
746
|
+
function Po(e) {
|
741
747
|
let t = {};
|
742
748
|
for (let n of e) Object.assign(t, n(t));
|
743
749
|
return t;
|
744
750
|
}
|
745
|
-
let
|
751
|
+
let we = ln(() => /* @__PURE__ */ new Map(), { PUSH(e, t) {
|
746
752
|
var n;
|
747
753
|
let o = (n = this.get(e)) != null ? n : { doc: e, count: 0, d: Te(), meta: /* @__PURE__ */ new Set() };
|
748
754
|
return o.count++, o.meta.add(t), this.set(e, o), this;
|
@@ -750,60 +756,60 @@ let Ee = nn(() => /* @__PURE__ */ new Map(), { PUSH(e, t) {
|
|
750
756
|
let n = this.get(e);
|
751
757
|
return n && (n.count--, n.meta.delete(t)), this;
|
752
758
|
}, SCROLL_PREVENT({ doc: e, d: t, meta: n }) {
|
753
|
-
let o = { doc: e, d: t, meta:
|
759
|
+
let o = { doc: e, d: t, meta: Po(n) }, i = [Io(), To(), Mo()];
|
754
760
|
i.forEach(({ before: r }) => r == null ? void 0 : r(o)), i.forEach(({ after: r }) => r == null ? void 0 : r(o));
|
755
761
|
}, SCROLL_ALLOW({ d: e }) {
|
756
762
|
e.dispose();
|
757
763
|
}, TEARDOWN({ doc: e }) {
|
758
764
|
this.delete(e);
|
759
765
|
} });
|
760
|
-
|
761
|
-
let e =
|
766
|
+
we.subscribe(() => {
|
767
|
+
let e = we.getSnapshot(), t = /* @__PURE__ */ new Map();
|
762
768
|
for (let [n] of e) t.set(n, n.documentElement.style.overflow);
|
763
769
|
for (let n of e.values()) {
|
764
770
|
let o = t.get(n.doc) === "hidden", i = n.count !== 0;
|
765
|
-
(i && !o || !i && o) &&
|
771
|
+
(i && !o || !i && o) && we.dispatch(n.count > 0 ? "SCROLL_PREVENT" : "SCROLL_ALLOW", n), n.count === 0 && we.dispatch("TEARDOWN", n);
|
766
772
|
}
|
767
773
|
});
|
768
|
-
function
|
769
|
-
let o =
|
770
|
-
return
|
771
|
-
if (!(!t || !e)) return
|
774
|
+
function Ao(e, t, n = () => ({ containers: [] })) {
|
775
|
+
let o = sn(we), i = t ? o.get(t) : void 0, r = i ? i.count > 0 : !1;
|
776
|
+
return U(() => {
|
777
|
+
if (!(!t || !e)) return we.dispatch("PUSH", t, n), () => we.dispatch("POP", t, n);
|
772
778
|
}, [e, t]), r;
|
773
779
|
}
|
774
|
-
function
|
775
|
-
let o =
|
776
|
-
|
780
|
+
function $o(e, t, n = () => [document.body]) {
|
781
|
+
let o = Ot(e, "scroll-lock");
|
782
|
+
Ao(o, t, (i) => {
|
777
783
|
var r;
|
778
784
|
return { containers: [...(r = i.containers) != null ? r : [], n] };
|
779
785
|
});
|
780
786
|
}
|
781
|
-
function
|
787
|
+
function Nt(e) {
|
782
788
|
return [e.screenX, e.screenY];
|
783
789
|
}
|
784
|
-
function
|
785
|
-
let e =
|
790
|
+
function Do() {
|
791
|
+
let e = J([-1, -1]);
|
786
792
|
return { wasMoved(t) {
|
787
|
-
let n =
|
793
|
+
let n = Nt(t);
|
788
794
|
return e.current[0] === n[0] && e.current[1] === n[1] ? !1 : (e.current = n, !0);
|
789
795
|
}, update(t) {
|
790
|
-
e.current =
|
796
|
+
e.current = Nt(t);
|
791
797
|
} };
|
792
798
|
}
|
793
|
-
function
|
794
|
-
let i =
|
799
|
+
function Fo(e, { container: t, accept: n, walk: o }) {
|
800
|
+
let i = J(n), r = J(o);
|
795
801
|
oe(() => {
|
796
802
|
i.current = n, r.current = o;
|
797
|
-
}, [n, o]),
|
803
|
+
}, [n, o]), U(() => {
|
798
804
|
if (!t || !e) return;
|
799
|
-
let s =
|
805
|
+
let s = wt(t);
|
800
806
|
if (!s) return;
|
801
|
-
let l = i.current, a = r.current,
|
802
|
-
for (;
|
807
|
+
let l = i.current, a = r.current, u = Object.assign((d) => l(d), { acceptNode: l }), c = s.createTreeWalker(t, NodeFilter.SHOW_ELEMENT, u, !1);
|
808
|
+
for (; c.nextNode(); ) a(c.currentNode);
|
803
809
|
}, [t, e, i, r]);
|
804
810
|
}
|
805
|
-
function
|
806
|
-
let n =
|
811
|
+
function kt(e, t) {
|
812
|
+
let n = J([]), o = M(e);
|
807
813
|
oe(() => {
|
808
814
|
let i = [...n.current];
|
809
815
|
for (let [r, s] of t.entries()) if (n.current[r] !== s) {
|
@@ -812,30 +818,33 @@ function Ft(e, t) {
|
|
812
818
|
}
|
813
819
|
}, [o, ...t]);
|
814
820
|
}
|
815
|
-
function
|
816
|
-
return
|
821
|
+
function ot() {
|
822
|
+
return typeof window < "u";
|
823
|
+
}
|
824
|
+
function Ae(e) {
|
825
|
+
return fn(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
817
826
|
}
|
818
827
|
function ee(e) {
|
819
828
|
var t;
|
820
829
|
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
821
830
|
}
|
822
|
-
function
|
831
|
+
function ae(e) {
|
823
832
|
var t;
|
824
|
-
return (t = (
|
833
|
+
return (t = (fn(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
|
825
834
|
}
|
826
|
-
function
|
827
|
-
return e instanceof Node || e instanceof ee(e).Node;
|
835
|
+
function fn(e) {
|
836
|
+
return ot() ? e instanceof Node || e instanceof ee(e).Node : !1;
|
828
837
|
}
|
829
|
-
function
|
830
|
-
return e instanceof Element || e instanceof ee(e).Element;
|
838
|
+
function G(e) {
|
839
|
+
return ot() ? e instanceof Element || e instanceof ee(e).Element : !1;
|
831
840
|
}
|
832
841
|
function se(e) {
|
833
|
-
return e instanceof HTMLElement || e instanceof ee(e).HTMLElement;
|
842
|
+
return ot() ? e instanceof HTMLElement || e instanceof ee(e).HTMLElement : !1;
|
834
843
|
}
|
835
|
-
function
|
836
|
-
return typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof ee(e).ShadowRoot;
|
844
|
+
function zt(e) {
|
845
|
+
return !ot() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof ee(e).ShadowRoot;
|
837
846
|
}
|
838
|
-
function
|
847
|
+
function We(e) {
|
839
848
|
const {
|
840
849
|
overflow: t,
|
841
850
|
overflowX: n,
|
@@ -844,10 +853,10 @@ function Be(e) {
|
|
844
853
|
} = ie(e);
|
845
854
|
return /auto|scroll|overlay|hidden|clip/.test(t + o + n) && !["inline", "contents"].includes(i);
|
846
855
|
}
|
847
|
-
function
|
848
|
-
return ["table", "td", "th"].includes(
|
856
|
+
function Lo(e) {
|
857
|
+
return ["table", "td", "th"].includes(Ae(e));
|
849
858
|
}
|
850
|
-
function
|
859
|
+
function it(e) {
|
851
860
|
return [":popover-open", ":modal"].some((t) => {
|
852
861
|
try {
|
853
862
|
return e.matches(t);
|
@@ -856,32 +865,32 @@ function ot(e) {
|
|
856
865
|
}
|
857
866
|
});
|
858
867
|
}
|
859
|
-
function
|
860
|
-
const t =
|
868
|
+
function St(e) {
|
869
|
+
const t = Rt(), n = G(e) ? ie(e) : e;
|
861
870
|
return n.transform !== "none" || n.perspective !== "none" || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((o) => (n.willChange || "").includes(o)) || ["paint", "layout", "strict", "content"].some((o) => (n.contain || "").includes(o));
|
862
871
|
}
|
863
|
-
function
|
864
|
-
let t =
|
872
|
+
function _o(e) {
|
873
|
+
let t = ue(e);
|
865
874
|
for (; se(t) && !Ie(t); ) {
|
866
|
-
if (
|
867
|
-
return null;
|
868
|
-
if (wt(t))
|
875
|
+
if (St(t))
|
869
876
|
return t;
|
870
|
-
|
877
|
+
if (it(t))
|
878
|
+
return null;
|
879
|
+
t = ue(t);
|
871
880
|
}
|
872
881
|
return null;
|
873
882
|
}
|
874
|
-
function
|
883
|
+
function Rt() {
|
875
884
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
876
885
|
}
|
877
886
|
function Ie(e) {
|
878
|
-
return ["html", "body", "#document"].includes(
|
887
|
+
return ["html", "body", "#document"].includes(Ae(e));
|
879
888
|
}
|
880
889
|
function ie(e) {
|
881
890
|
return ee(e).getComputedStyle(e);
|
882
891
|
}
|
883
|
-
function
|
884
|
-
return
|
892
|
+
function rt(e) {
|
893
|
+
return G(e) ? {
|
885
894
|
scrollLeft: e.scrollLeft,
|
886
895
|
scrollTop: e.scrollTop
|
887
896
|
} : {
|
@@ -889,29 +898,36 @@ function it(e) {
|
|
889
898
|
scrollTop: e.scrollY
|
890
899
|
};
|
891
900
|
}
|
892
|
-
function
|
893
|
-
if (
|
901
|
+
function ue(e) {
|
902
|
+
if (Ae(e) === "html")
|
894
903
|
return e;
|
895
904
|
const t = (
|
896
905
|
// Step into the shadow DOM of the parent of a slotted node.
|
897
906
|
e.assignedSlot || // DOM Element detected.
|
898
907
|
e.parentNode || // ShadowRoot detected.
|
899
|
-
|
900
|
-
|
908
|
+
zt(e) && e.host || // Fallback.
|
909
|
+
ae(e)
|
901
910
|
);
|
902
|
-
return
|
911
|
+
return zt(t) ? t.host : t;
|
903
912
|
}
|
904
|
-
function
|
905
|
-
const t =
|
906
|
-
return Ie(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : se(t) &&
|
913
|
+
function dn(e) {
|
914
|
+
const t = ue(e);
|
915
|
+
return Ie(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : se(t) && We(t) ? t : dn(t);
|
907
916
|
}
|
908
|
-
function
|
917
|
+
function ke(e, t, n) {
|
909
918
|
var o;
|
910
919
|
t === void 0 && (t = []), n === void 0 && (n = !0);
|
911
|
-
const i =
|
912
|
-
|
920
|
+
const i = dn(e), r = i === ((o = e.ownerDocument) == null ? void 0 : o.body), s = ee(i);
|
921
|
+
if (r) {
|
922
|
+
const l = ht(s);
|
923
|
+
return t.concat(s, s.visualViewport || [], We(i) ? i : [], l && n ? ke(l) : []);
|
924
|
+
}
|
925
|
+
return t.concat(i, ke(i, [], n));
|
913
926
|
}
|
914
|
-
function
|
927
|
+
function ht(e) {
|
928
|
+
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
929
|
+
}
|
930
|
+
function No() {
|
915
931
|
const e = navigator.userAgentData;
|
916
932
|
return e && Array.isArray(e.brands) ? e.brands.map((t) => {
|
917
933
|
let {
|
@@ -921,56 +937,56 @@ function Lo() {
|
|
921
937
|
return n + "/" + o;
|
922
938
|
}).join(" ") : navigator.userAgent;
|
923
939
|
}
|
924
|
-
const
|
940
|
+
const Me = Math.min, K = Math.max, ze = Math.round, Ke = Math.floor, fe = (e) => ({
|
925
941
|
x: e,
|
926
942
|
y: e
|
927
|
-
}),
|
943
|
+
}), ko = {
|
928
944
|
left: "right",
|
929
945
|
right: "left",
|
930
946
|
bottom: "top",
|
931
947
|
top: "bottom"
|
932
|
-
},
|
948
|
+
}, zo = {
|
933
949
|
start: "end",
|
934
950
|
end: "start"
|
935
951
|
};
|
936
|
-
function
|
937
|
-
return
|
952
|
+
function Ht(e, t, n) {
|
953
|
+
return K(e, Me(t, n));
|
938
954
|
}
|
939
|
-
function
|
955
|
+
function $e(e, t) {
|
940
956
|
return typeof e == "function" ? e(t) : e;
|
941
957
|
}
|
942
|
-
function
|
958
|
+
function de(e) {
|
943
959
|
return e.split("-")[0];
|
944
960
|
}
|
945
961
|
function je(e) {
|
946
962
|
return e.split("-")[1];
|
947
963
|
}
|
948
|
-
function
|
964
|
+
function mn(e) {
|
949
965
|
return e === "x" ? "y" : "x";
|
950
966
|
}
|
951
|
-
function
|
967
|
+
function pn(e) {
|
952
968
|
return e === "y" ? "height" : "width";
|
953
969
|
}
|
954
970
|
function ye(e) {
|
955
|
-
return ["top", "bottom"].includes(
|
971
|
+
return ["top", "bottom"].includes(de(e)) ? "y" : "x";
|
956
972
|
}
|
957
|
-
function
|
958
|
-
return
|
973
|
+
function hn(e) {
|
974
|
+
return mn(ye(e));
|
959
975
|
}
|
960
|
-
function
|
976
|
+
function Ho(e, t, n) {
|
961
977
|
n === void 0 && (n = !1);
|
962
|
-
const o = je(e), i =
|
978
|
+
const o = je(e), i = hn(e), r = pn(i);
|
963
979
|
let s = i === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
|
964
980
|
return t.reference[r] > t.floating[r] && (s = Qe(s)), [s, Qe(s)];
|
965
981
|
}
|
966
|
-
function
|
982
|
+
function Vo(e) {
|
967
983
|
const t = Qe(e);
|
968
|
-
return [
|
984
|
+
return [gt(e), t, gt(t)];
|
969
985
|
}
|
970
|
-
function
|
971
|
-
return e.replace(/start|end/g, (t) =>
|
986
|
+
function gt(e) {
|
987
|
+
return e.replace(/start|end/g, (t) => zo[t]);
|
972
988
|
}
|
973
|
-
function
|
989
|
+
function Bo(e, t, n) {
|
974
990
|
const o = ["left", "right"], i = ["right", "left"], r = ["top", "bottom"], s = ["bottom", "top"];
|
975
991
|
switch (e) {
|
976
992
|
case "top":
|
@@ -983,15 +999,15 @@ function Ho(e, t, n) {
|
|
983
999
|
return [];
|
984
1000
|
}
|
985
1001
|
}
|
986
|
-
function
|
1002
|
+
function Wo(e, t, n, o) {
|
987
1003
|
const i = je(e);
|
988
|
-
let r =
|
989
|
-
return i && (r = r.map((s) => s + "-" + i), t && (r = r.concat(r.map(
|
1004
|
+
let r = Bo(de(e), n === "start", o);
|
1005
|
+
return i && (r = r.map((s) => s + "-" + i), t && (r = r.concat(r.map(gt)))), r;
|
990
1006
|
}
|
991
1007
|
function Qe(e) {
|
992
|
-
return e.replace(/left|right|bottom|top/g, (t) =>
|
1008
|
+
return e.replace(/left|right|bottom|top/g, (t) => ko[t]);
|
993
1009
|
}
|
994
|
-
function
|
1010
|
+
function jo(e) {
|
995
1011
|
return {
|
996
1012
|
top: 0,
|
997
1013
|
right: 0,
|
@@ -1000,8 +1016,8 @@ function Wo(e) {
|
|
1000
1016
|
...e
|
1001
1017
|
};
|
1002
1018
|
}
|
1003
|
-
function
|
1004
|
-
return typeof e != "number" ?
|
1019
|
+
function Uo(e) {
|
1020
|
+
return typeof e != "number" ? jo(e) : {
|
1005
1021
|
top: e,
|
1006
1022
|
right: e,
|
1007
1023
|
bottom: e,
|
@@ -1026,116 +1042,116 @@ function Ze(e) {
|
|
1026
1042
|
y: n
|
1027
1043
|
};
|
1028
1044
|
}
|
1029
|
-
function
|
1045
|
+
function Vt(e, t, n) {
|
1030
1046
|
let {
|
1031
1047
|
reference: o,
|
1032
1048
|
floating: i
|
1033
1049
|
} = e;
|
1034
|
-
const r = ye(t), s =
|
1035
|
-
let
|
1050
|
+
const r = ye(t), s = hn(t), l = pn(s), a = de(t), u = r === "y", c = o.x + o.width / 2 - i.width / 2, d = o.y + o.height / 2 - i.height / 2, p = o[l] / 2 - i[l] / 2;
|
1051
|
+
let f;
|
1036
1052
|
switch (a) {
|
1037
1053
|
case "top":
|
1038
|
-
|
1039
|
-
x:
|
1054
|
+
f = {
|
1055
|
+
x: c,
|
1040
1056
|
y: o.y - i.height
|
1041
1057
|
};
|
1042
1058
|
break;
|
1043
1059
|
case "bottom":
|
1044
|
-
|
1045
|
-
x:
|
1060
|
+
f = {
|
1061
|
+
x: c,
|
1046
1062
|
y: o.y + o.height
|
1047
1063
|
};
|
1048
1064
|
break;
|
1049
1065
|
case "right":
|
1050
|
-
|
1066
|
+
f = {
|
1051
1067
|
x: o.x + o.width,
|
1052
1068
|
y: d
|
1053
1069
|
};
|
1054
1070
|
break;
|
1055
1071
|
case "left":
|
1056
|
-
|
1072
|
+
f = {
|
1057
1073
|
x: o.x - i.width,
|
1058
1074
|
y: d
|
1059
1075
|
};
|
1060
1076
|
break;
|
1061
1077
|
default:
|
1062
|
-
|
1078
|
+
f = {
|
1063
1079
|
x: o.x,
|
1064
1080
|
y: o.y
|
1065
1081
|
};
|
1066
1082
|
}
|
1067
1083
|
switch (je(t)) {
|
1068
1084
|
case "start":
|
1069
|
-
|
1085
|
+
f[s] -= p * (n && u ? -1 : 1);
|
1070
1086
|
break;
|
1071
1087
|
case "end":
|
1072
|
-
|
1088
|
+
f[s] += p * (n && u ? -1 : 1);
|
1073
1089
|
break;
|
1074
1090
|
}
|
1075
|
-
return
|
1091
|
+
return f;
|
1076
1092
|
}
|
1077
|
-
const
|
1093
|
+
const Yo = async (e, t, n) => {
|
1078
1094
|
const {
|
1079
1095
|
placement: o = "bottom",
|
1080
1096
|
strategy: i = "absolute",
|
1081
1097
|
middleware: r = [],
|
1082
1098
|
platform: s
|
1083
1099
|
} = n, l = r.filter(Boolean), a = await (s.isRTL == null ? void 0 : s.isRTL(t));
|
1084
|
-
let
|
1100
|
+
let u = await s.getElementRects({
|
1085
1101
|
reference: e,
|
1086
1102
|
floating: t,
|
1087
1103
|
strategy: i
|
1088
1104
|
}), {
|
1089
|
-
x:
|
1105
|
+
x: c,
|
1090
1106
|
y: d
|
1091
|
-
} =
|
1107
|
+
} = Vt(u, o, a), p = o, f = {}, m = 0;
|
1092
1108
|
for (let h = 0; h < l.length; h++) {
|
1093
1109
|
const {
|
1094
1110
|
name: g,
|
1095
1111
|
fn: v
|
1096
1112
|
} = l[h], {
|
1097
|
-
x:
|
1113
|
+
x: y,
|
1098
1114
|
y: b,
|
1099
|
-
data:
|
1115
|
+
data: E,
|
1100
1116
|
reset: O
|
1101
1117
|
} = await v({
|
1102
|
-
x:
|
1118
|
+
x: c,
|
1103
1119
|
y: d,
|
1104
1120
|
initialPlacement: o,
|
1105
1121
|
placement: p,
|
1106
1122
|
strategy: i,
|
1107
|
-
middlewareData:
|
1108
|
-
rects:
|
1123
|
+
middlewareData: f,
|
1124
|
+
rects: u,
|
1109
1125
|
platform: s,
|
1110
1126
|
elements: {
|
1111
1127
|
reference: e,
|
1112
1128
|
floating: t
|
1113
1129
|
}
|
1114
1130
|
});
|
1115
|
-
|
1116
|
-
...
|
1131
|
+
c = y ?? c, d = b ?? d, f = {
|
1132
|
+
...f,
|
1117
1133
|
[g]: {
|
1118
|
-
...
|
1119
|
-
...
|
1134
|
+
...f[g],
|
1135
|
+
...E
|
1120
1136
|
}
|
1121
|
-
}, O && m <= 50 && (m++, typeof O == "object" && (O.placement && (p = O.placement), O.rects && (
|
1137
|
+
}, O && m <= 50 && (m++, typeof O == "object" && (O.placement && (p = O.placement), O.rects && (u = O.rects === !0 ? await s.getElementRects({
|
1122
1138
|
reference: e,
|
1123
1139
|
floating: t,
|
1124
1140
|
strategy: i
|
1125
1141
|
}) : O.rects), {
|
1126
|
-
x:
|
1142
|
+
x: c,
|
1127
1143
|
y: d
|
1128
|
-
} =
|
1144
|
+
} = Vt(u, p, a)), h = -1);
|
1129
1145
|
}
|
1130
1146
|
return {
|
1131
|
-
x:
|
1147
|
+
x: c,
|
1132
1148
|
y: d,
|
1133
1149
|
placement: p,
|
1134
1150
|
strategy: i,
|
1135
|
-
middlewareData:
|
1151
|
+
middlewareData: f
|
1136
1152
|
};
|
1137
1153
|
};
|
1138
|
-
async function
|
1154
|
+
async function lt(e, t) {
|
1139
1155
|
var n;
|
1140
1156
|
t === void 0 && (t = {});
|
1141
1157
|
const {
|
@@ -1146,22 +1162,22 @@ async function rt(e, t) {
|
|
1146
1162
|
elements: l,
|
1147
1163
|
strategy: a
|
1148
1164
|
} = e, {
|
1149
|
-
boundary:
|
1150
|
-
rootBoundary:
|
1165
|
+
boundary: u = "clippingAncestors",
|
1166
|
+
rootBoundary: c = "viewport",
|
1151
1167
|
elementContext: d = "floating",
|
1152
1168
|
altBoundary: p = !1,
|
1153
|
-
padding:
|
1154
|
-
} =
|
1169
|
+
padding: f = 0
|
1170
|
+
} = $e(t, e), m = Uo(f), g = l[p ? d === "floating" ? "reference" : "floating" : d], v = Ze(await r.getClippingRect({
|
1155
1171
|
element: (n = await (r.isElement == null ? void 0 : r.isElement(g))) == null || n ? g : g.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(l.floating)),
|
1156
|
-
boundary:
|
1157
|
-
rootBoundary:
|
1172
|
+
boundary: u,
|
1173
|
+
rootBoundary: c,
|
1158
1174
|
strategy: a
|
1159
|
-
})),
|
1175
|
+
})), y = d === "floating" ? {
|
1160
1176
|
x: o,
|
1161
1177
|
y: i,
|
1162
1178
|
width: s.floating.width,
|
1163
1179
|
height: s.floating.height
|
1164
|
-
} : s.reference, b = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(l.floating)),
|
1180
|
+
} : s.reference, b = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(l.floating)), E = await (r.isElement == null ? void 0 : r.isElement(b)) ? await (r.getScale == null ? void 0 : r.getScale(b)) || {
|
1165
1181
|
x: 1,
|
1166
1182
|
y: 1
|
1167
1183
|
} : {
|
@@ -1169,18 +1185,18 @@ async function rt(e, t) {
|
|
1169
1185
|
y: 1
|
1170
1186
|
}, O = Ze(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
|
1171
1187
|
elements: l,
|
1172
|
-
rect:
|
1188
|
+
rect: y,
|
1173
1189
|
offsetParent: b,
|
1174
1190
|
strategy: a
|
1175
|
-
}) :
|
1191
|
+
}) : y);
|
1176
1192
|
return {
|
1177
|
-
top: (v.top - O.top + m.top) /
|
1178
|
-
bottom: (O.bottom - v.bottom + m.bottom) /
|
1179
|
-
left: (v.left - O.left + m.left) /
|
1180
|
-
right: (O.right - v.right + m.right) /
|
1193
|
+
top: (v.top - O.top + m.top) / E.y,
|
1194
|
+
bottom: (O.bottom - v.bottom + m.bottom) / E.y,
|
1195
|
+
left: (v.left - O.left + m.left) / E.x,
|
1196
|
+
right: (O.right - v.right + m.right) / E.x
|
1181
1197
|
};
|
1182
1198
|
}
|
1183
|
-
const
|
1199
|
+
const qo = function(e) {
|
1184
1200
|
return e === void 0 && (e = {}), {
|
1185
1201
|
name: "flip",
|
1186
1202
|
options: e,
|
@@ -1192,67 +1208,67 @@ const Uo = function(e) {
|
|
1192
1208
|
rects: s,
|
1193
1209
|
initialPlacement: l,
|
1194
1210
|
platform: a,
|
1195
|
-
elements:
|
1211
|
+
elements: u
|
1196
1212
|
} = t, {
|
1197
|
-
mainAxis:
|
1213
|
+
mainAxis: c = !0,
|
1198
1214
|
crossAxis: d = !0,
|
1199
1215
|
fallbackPlacements: p,
|
1200
|
-
fallbackStrategy:
|
1216
|
+
fallbackStrategy: f = "bestFit",
|
1201
1217
|
fallbackAxisSideDirection: m = "none",
|
1202
1218
|
flipAlignment: h = !0,
|
1203
1219
|
...g
|
1204
|
-
} =
|
1220
|
+
} = $e(e, t);
|
1205
1221
|
if ((n = r.arrow) != null && n.alignmentOffset)
|
1206
1222
|
return {};
|
1207
|
-
const v =
|
1208
|
-
!p &&
|
1209
|
-
const
|
1210
|
-
let
|
1211
|
-
if (
|
1212
|
-
const
|
1213
|
-
|
1223
|
+
const v = de(i), y = ye(l), b = de(l) === l, E = await (a.isRTL == null ? void 0 : a.isRTL(u.floating)), O = p || (b || !h ? [Qe(l)] : Vo(l)), C = m !== "none";
|
1224
|
+
!p && C && O.push(...Wo(l, h, m, E));
|
1225
|
+
const T = [l, ...O], S = await lt(t, g), L = [];
|
1226
|
+
let A = ((o = r.flip) == null ? void 0 : o.overflows) || [];
|
1227
|
+
if (c && L.push(S[v]), d) {
|
1228
|
+
const x = Ho(i, s, E);
|
1229
|
+
L.push(S[x[0]], S[x[1]]);
|
1214
1230
|
}
|
1215
|
-
if (
|
1231
|
+
if (A = [...A, {
|
1216
1232
|
placement: i,
|
1217
|
-
overflows:
|
1218
|
-
}], !
|
1233
|
+
overflows: L
|
1234
|
+
}], !L.every((x) => x <= 0)) {
|
1219
1235
|
var D, k;
|
1220
|
-
const
|
1221
|
-
if (
|
1236
|
+
const x = (((D = r.flip) == null ? void 0 : D.index) || 0) + 1, B = T[x];
|
1237
|
+
if (B)
|
1222
1238
|
return {
|
1223
1239
|
data: {
|
1224
|
-
index:
|
1225
|
-
overflows:
|
1240
|
+
index: x,
|
1241
|
+
overflows: A
|
1226
1242
|
},
|
1227
1243
|
reset: {
|
1228
|
-
placement:
|
1244
|
+
placement: B
|
1229
1245
|
}
|
1230
1246
|
};
|
1231
|
-
let
|
1232
|
-
if (!
|
1233
|
-
switch (
|
1247
|
+
let _ = (k = A.filter((z) => z.overflows[0] <= 0).sort((z, P) => z.overflows[1] - P.overflows[1])[0]) == null ? void 0 : k.placement;
|
1248
|
+
if (!_)
|
1249
|
+
switch (f) {
|
1234
1250
|
case "bestFit": {
|
1235
|
-
var
|
1236
|
-
const
|
1237
|
-
if (
|
1238
|
-
const
|
1239
|
-
return
|
1251
|
+
var F;
|
1252
|
+
const z = (F = A.filter((P) => {
|
1253
|
+
if (C) {
|
1254
|
+
const $ = ye(P.placement);
|
1255
|
+
return $ === y || // Create a bias to the `y` side axis due to horizontal
|
1240
1256
|
// reading directions favoring greater width.
|
1241
|
-
|
1257
|
+
$ === "y";
|
1242
1258
|
}
|
1243
1259
|
return !0;
|
1244
|
-
}).map((
|
1245
|
-
|
1260
|
+
}).map((P) => [P.placement, P.overflows.filter(($) => $ > 0).reduce(($, H) => $ + H, 0)]).sort((P, $) => P[1] - $[1])[0]) == null ? void 0 : F[0];
|
1261
|
+
z && (_ = z);
|
1246
1262
|
break;
|
1247
1263
|
}
|
1248
1264
|
case "initialPlacement":
|
1249
|
-
|
1265
|
+
_ = l;
|
1250
1266
|
break;
|
1251
1267
|
}
|
1252
|
-
if (i !==
|
1268
|
+
if (i !== _)
|
1253
1269
|
return {
|
1254
1270
|
reset: {
|
1255
|
-
placement:
|
1271
|
+
placement: _
|
1256
1272
|
}
|
1257
1273
|
};
|
1258
1274
|
}
|
@@ -1260,35 +1276,34 @@ const Uo = function(e) {
|
|
1260
1276
|
}
|
1261
1277
|
};
|
1262
1278
|
};
|
1263
|
-
async function
|
1279
|
+
async function Ko(e, t) {
|
1264
1280
|
const {
|
1265
1281
|
placement: n,
|
1266
1282
|
platform: o,
|
1267
1283
|
elements: i
|
1268
|
-
} = e, r = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), s =
|
1284
|
+
} = e, r = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), s = de(n), l = je(n), a = ye(n) === "y", u = ["left", "top"].includes(s) ? -1 : 1, c = r && a ? -1 : 1, d = $e(t, e);
|
1269
1285
|
let {
|
1270
1286
|
mainAxis: p,
|
1271
|
-
crossAxis:
|
1287
|
+
crossAxis: f,
|
1272
1288
|
alignmentAxis: m
|
1273
1289
|
} = typeof d == "number" ? {
|
1274
1290
|
mainAxis: d,
|
1275
1291
|
crossAxis: 0,
|
1276
1292
|
alignmentAxis: null
|
1277
1293
|
} : {
|
1278
|
-
mainAxis: 0,
|
1279
|
-
crossAxis: 0,
|
1280
|
-
alignmentAxis:
|
1281
|
-
...d
|
1294
|
+
mainAxis: d.mainAxis || 0,
|
1295
|
+
crossAxis: d.crossAxis || 0,
|
1296
|
+
alignmentAxis: d.alignmentAxis
|
1282
1297
|
};
|
1283
|
-
return l && typeof m == "number" && (
|
1284
|
-
x:
|
1285
|
-
y: p *
|
1298
|
+
return l && typeof m == "number" && (f = l === "end" ? m * -1 : m), a ? {
|
1299
|
+
x: f * c,
|
1300
|
+
y: p * u
|
1286
1301
|
} : {
|
1287
|
-
x: p *
|
1288
|
-
y:
|
1302
|
+
x: p * u,
|
1303
|
+
y: f * c
|
1289
1304
|
};
|
1290
1305
|
}
|
1291
|
-
const
|
1306
|
+
const Go = function(e) {
|
1292
1307
|
return e === void 0 && (e = 0), {
|
1293
1308
|
name: "offset",
|
1294
1309
|
options: e,
|
@@ -1299,7 +1314,7 @@ const qo = function(e) {
|
|
1299
1314
|
y: r,
|
1300
1315
|
placement: s,
|
1301
1316
|
middlewareData: l
|
1302
|
-
} = t, a = await
|
1317
|
+
} = t, a = await Ko(t, e);
|
1303
1318
|
return s === ((n = l.offset) == null ? void 0 : n.placement) && (o = l.arrow) != null && o.alignmentOffset ? {} : {
|
1304
1319
|
x: i + a.x,
|
1305
1320
|
y: r + a.y,
|
@@ -1310,7 +1325,7 @@ const qo = function(e) {
|
|
1310
1325
|
};
|
1311
1326
|
}
|
1312
1327
|
};
|
1313
|
-
},
|
1328
|
+
}, Xo = function(e) {
|
1314
1329
|
return e === void 0 && (e = {}), {
|
1315
1330
|
name: "shift",
|
1316
1331
|
options: e,
|
@@ -1326,75 +1341,80 @@ const qo = function(e) {
|
|
1326
1341
|
fn: (g) => {
|
1327
1342
|
let {
|
1328
1343
|
x: v,
|
1329
|
-
y
|
1344
|
+
y
|
1330
1345
|
} = g;
|
1331
1346
|
return {
|
1332
1347
|
x: v,
|
1333
|
-
y
|
1348
|
+
y
|
1334
1349
|
};
|
1335
1350
|
}
|
1336
1351
|
},
|
1337
1352
|
...a
|
1338
|
-
} =
|
1353
|
+
} = $e(e, t), u = {
|
1339
1354
|
x: n,
|
1340
1355
|
y: o
|
1341
|
-
},
|
1342
|
-
let
|
1356
|
+
}, c = await lt(t, a), d = ye(de(i)), p = mn(d);
|
1357
|
+
let f = u[p], m = u[d];
|
1343
1358
|
if (r) {
|
1344
|
-
const g = p === "y" ? "top" : "left", v = p === "y" ? "bottom" : "right",
|
1345
|
-
|
1359
|
+
const g = p === "y" ? "top" : "left", v = p === "y" ? "bottom" : "right", y = f + c[g], b = f - c[v];
|
1360
|
+
f = Ht(y, f, b);
|
1346
1361
|
}
|
1347
1362
|
if (s) {
|
1348
|
-
const g = d === "y" ? "top" : "left", v = d === "y" ? "bottom" : "right",
|
1349
|
-
m =
|
1363
|
+
const g = d === "y" ? "top" : "left", v = d === "y" ? "bottom" : "right", y = m + c[g], b = m - c[v];
|
1364
|
+
m = Ht(y, m, b);
|
1350
1365
|
}
|
1351
1366
|
const h = l.fn({
|
1352
1367
|
...t,
|
1353
|
-
[p]:
|
1368
|
+
[p]: f,
|
1354
1369
|
[d]: m
|
1355
1370
|
});
|
1356
1371
|
return {
|
1357
1372
|
...h,
|
1358
1373
|
data: {
|
1359
1374
|
x: h.x - n,
|
1360
|
-
y: h.y - o
|
1375
|
+
y: h.y - o,
|
1376
|
+
enabled: {
|
1377
|
+
[p]: r,
|
1378
|
+
[d]: s
|
1379
|
+
}
|
1361
1380
|
}
|
1362
1381
|
};
|
1363
1382
|
}
|
1364
1383
|
};
|
1365
|
-
},
|
1384
|
+
}, Jo = function(e) {
|
1366
1385
|
return e === void 0 && (e = {}), {
|
1367
1386
|
name: "size",
|
1368
1387
|
options: e,
|
1369
1388
|
async fn(t) {
|
1389
|
+
var n, o;
|
1370
1390
|
const {
|
1371
|
-
placement:
|
1372
|
-
rects:
|
1373
|
-
platform:
|
1374
|
-
elements:
|
1391
|
+
placement: i,
|
1392
|
+
rects: r,
|
1393
|
+
platform: s,
|
1394
|
+
elements: l
|
1375
1395
|
} = t, {
|
1376
|
-
apply:
|
1396
|
+
apply: a = () => {
|
1377
1397
|
},
|
1378
|
-
...
|
1379
|
-
} =
|
1380
|
-
width:
|
1381
|
-
height:
|
1382
|
-
} =
|
1383
|
-
let
|
1384
|
-
|
1385
|
-
const
|
1386
|
-
let
|
1387
|
-
if (
|
1388
|
-
const
|
1389
|
-
|
1398
|
+
...u
|
1399
|
+
} = $e(e, t), c = await lt(t, u), d = de(i), p = je(i), f = ye(i) === "y", {
|
1400
|
+
width: m,
|
1401
|
+
height: h
|
1402
|
+
} = r.floating;
|
1403
|
+
let g, v;
|
1404
|
+
d === "top" || d === "bottom" ? (g = d, v = p === (await (s.isRTL == null ? void 0 : s.isRTL(l.floating)) ? "start" : "end") ? "left" : "right") : (v = d, g = p === "end" ? "top" : "bottom");
|
1405
|
+
const y = h - c.top - c.bottom, b = m - c.left - c.right, E = Me(h - c[g], y), O = Me(m - c[v], b), C = !t.middlewareData.shift;
|
1406
|
+
let T = E, S = O;
|
1407
|
+
if ((n = t.middlewareData.shift) != null && n.enabled.x && (S = b), (o = t.middlewareData.shift) != null && o.enabled.y && (T = y), C && !p) {
|
1408
|
+
const A = K(c.left, 0), D = K(c.right, 0), k = K(c.top, 0), F = K(c.bottom, 0);
|
1409
|
+
f ? S = m - 2 * (A !== 0 || D !== 0 ? A + D : K(c.left, c.right)) : T = h - 2 * (k !== 0 || F !== 0 ? k + F : K(c.top, c.bottom));
|
1390
1410
|
}
|
1391
|
-
await
|
1411
|
+
await a({
|
1392
1412
|
...t,
|
1393
1413
|
availableWidth: S,
|
1394
|
-
availableHeight:
|
1414
|
+
availableHeight: T
|
1395
1415
|
});
|
1396
|
-
const
|
1397
|
-
return
|
1416
|
+
const L = await s.getDimensions(l.floating);
|
1417
|
+
return m !== L.width || h !== L.height ? {
|
1398
1418
|
reset: {
|
1399
1419
|
rects: !0
|
1400
1420
|
}
|
@@ -1402,117 +1422,118 @@ const qo = function(e) {
|
|
1402
1422
|
}
|
1403
1423
|
};
|
1404
1424
|
};
|
1405
|
-
function
|
1425
|
+
function gn(e) {
|
1406
1426
|
const t = ie(e);
|
1407
1427
|
let n = parseFloat(t.width) || 0, o = parseFloat(t.height) || 0;
|
1408
|
-
const i = se(e), r = i ? e.offsetWidth : n, s = i ? e.offsetHeight : o, l =
|
1428
|
+
const i = se(e), r = i ? e.offsetWidth : n, s = i ? e.offsetHeight : o, l = ze(n) !== r || ze(o) !== s;
|
1409
1429
|
return l && (n = r, o = s), {
|
1410
1430
|
width: n,
|
1411
1431
|
height: o,
|
1412
1432
|
$: l
|
1413
1433
|
};
|
1414
1434
|
}
|
1415
|
-
function
|
1416
|
-
return
|
1435
|
+
function Ct(e) {
|
1436
|
+
return G(e) ? e : e.contextElement;
|
1417
1437
|
}
|
1418
1438
|
function Ce(e) {
|
1419
|
-
const t =
|
1439
|
+
const t = Ct(e);
|
1420
1440
|
if (!se(t))
|
1421
|
-
return
|
1441
|
+
return fe(1);
|
1422
1442
|
const n = t.getBoundingClientRect(), {
|
1423
1443
|
width: o,
|
1424
1444
|
height: i,
|
1425
1445
|
$: r
|
1426
|
-
} =
|
1427
|
-
let s = (r ?
|
1446
|
+
} = gn(t);
|
1447
|
+
let s = (r ? ze(n.width) : n.width) / o, l = (r ? ze(n.height) : n.height) / i;
|
1428
1448
|
return (!s || !Number.isFinite(s)) && (s = 1), (!l || !Number.isFinite(l)) && (l = 1), {
|
1429
1449
|
x: s,
|
1430
1450
|
y: l
|
1431
1451
|
};
|
1432
1452
|
}
|
1433
|
-
const
|
1434
|
-
function
|
1453
|
+
const Qo = /* @__PURE__ */ fe(0);
|
1454
|
+
function vn(e) {
|
1435
1455
|
const t = ee(e);
|
1436
|
-
return !
|
1456
|
+
return !Rt() || !t.visualViewport ? Qo : {
|
1437
1457
|
x: t.visualViewport.offsetLeft,
|
1438
1458
|
y: t.visualViewport.offsetTop
|
1439
1459
|
};
|
1440
1460
|
}
|
1441
|
-
function
|
1461
|
+
function Zo(e, t, n) {
|
1442
1462
|
return t === void 0 && (t = !1), !n || t && n !== ee(e) ? !1 : t;
|
1443
1463
|
}
|
1444
|
-
function
|
1464
|
+
function Ee(e, t, n, o) {
|
1445
1465
|
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
1446
|
-
const i = e.getBoundingClientRect(), r =
|
1447
|
-
let s =
|
1448
|
-
t && (o ?
|
1449
|
-
const l =
|
1450
|
-
let a = (i.left + l.x) / s.x,
|
1466
|
+
const i = e.getBoundingClientRect(), r = Ct(e);
|
1467
|
+
let s = fe(1);
|
1468
|
+
t && (o ? G(o) && (s = Ce(o)) : s = Ce(e));
|
1469
|
+
const l = Zo(r, n, o) ? vn(r) : fe(0);
|
1470
|
+
let a = (i.left + l.x) / s.x, u = (i.top + l.y) / s.y, c = i.width / s.x, d = i.height / s.y;
|
1451
1471
|
if (r) {
|
1452
|
-
const p = ee(r),
|
1453
|
-
let m = p, h = m
|
1454
|
-
for (; h && o &&
|
1455
|
-
const g = Ce(h), v = h.getBoundingClientRect(),
|
1456
|
-
a *= g.x,
|
1472
|
+
const p = ee(r), f = o && G(o) ? ee(o) : o;
|
1473
|
+
let m = p, h = ht(m);
|
1474
|
+
for (; h && o && f !== m; ) {
|
1475
|
+
const g = Ce(h), v = h.getBoundingClientRect(), y = ie(h), b = v.left + (h.clientLeft + parseFloat(y.paddingLeft)) * g.x, E = v.top + (h.clientTop + parseFloat(y.paddingTop)) * g.y;
|
1476
|
+
a *= g.x, u *= g.y, c *= g.x, d *= g.y, a += b, u += E, m = ee(h), h = ht(m);
|
1457
1477
|
}
|
1458
1478
|
}
|
1459
1479
|
return Ze({
|
1460
|
-
width:
|
1480
|
+
width: c,
|
1461
1481
|
height: d,
|
1462
1482
|
x: a,
|
1463
|
-
y:
|
1483
|
+
y: u
|
1464
1484
|
});
|
1465
1485
|
}
|
1466
|
-
function
|
1486
|
+
function ei(e) {
|
1467
1487
|
let {
|
1468
1488
|
elements: t,
|
1469
1489
|
rect: n,
|
1470
1490
|
offsetParent: o,
|
1471
1491
|
strategy: i
|
1472
1492
|
} = e;
|
1473
|
-
const r = i === "fixed", s =
|
1493
|
+
const r = i === "fixed", s = ae(o), l = t ? it(t.floating) : !1;
|
1474
1494
|
if (o === s || l && r)
|
1475
1495
|
return n;
|
1476
1496
|
let a = {
|
1477
1497
|
scrollLeft: 0,
|
1478
1498
|
scrollTop: 0
|
1479
|
-
},
|
1480
|
-
const
|
1481
|
-
if ((d || !d && !r) && ((
|
1482
|
-
const p =
|
1483
|
-
|
1499
|
+
}, u = fe(1);
|
1500
|
+
const c = fe(0), d = se(o);
|
1501
|
+
if ((d || !d && !r) && ((Ae(o) !== "body" || We(s)) && (a = rt(o)), se(o))) {
|
1502
|
+
const p = Ee(o);
|
1503
|
+
u = Ce(o), c.x = p.x + o.clientLeft, c.y = p.y + o.clientTop;
|
1484
1504
|
}
|
1485
1505
|
return {
|
1486
|
-
width: n.width *
|
1487
|
-
height: n.height *
|
1488
|
-
x: n.x *
|
1489
|
-
y: n.y *
|
1506
|
+
width: n.width * u.x,
|
1507
|
+
height: n.height * u.y,
|
1508
|
+
x: n.x * u.x - a.scrollLeft * u.x + c.x,
|
1509
|
+
y: n.y * u.y - a.scrollTop * u.y + c.y
|
1490
1510
|
};
|
1491
1511
|
}
|
1492
|
-
function
|
1512
|
+
function ti(e) {
|
1493
1513
|
return Array.from(e.getClientRects());
|
1494
1514
|
}
|
1495
|
-
function
|
1496
|
-
|
1515
|
+
function vt(e, t) {
|
1516
|
+
const n = rt(e).scrollLeft;
|
1517
|
+
return t ? t.left + n : Ee(ae(e)).left + n;
|
1497
1518
|
}
|
1498
|
-
function
|
1499
|
-
const t =
|
1500
|
-
let s = -n.scrollLeft +
|
1519
|
+
function ni(e) {
|
1520
|
+
const t = ae(e), n = rt(e), o = e.ownerDocument.body, i = K(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), r = K(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight);
|
1521
|
+
let s = -n.scrollLeft + vt(e);
|
1501
1522
|
const l = -n.scrollTop;
|
1502
|
-
return ie(o).direction === "rtl" && (s +=
|
1523
|
+
return ie(o).direction === "rtl" && (s += K(t.clientWidth, o.clientWidth) - i), {
|
1503
1524
|
width: i,
|
1504
1525
|
height: r,
|
1505
1526
|
x: s,
|
1506
1527
|
y: l
|
1507
1528
|
};
|
1508
1529
|
}
|
1509
|
-
function
|
1510
|
-
const n = ee(e), o =
|
1530
|
+
function oi(e, t) {
|
1531
|
+
const n = ee(e), o = ae(e), i = n.visualViewport;
|
1511
1532
|
let r = o.clientWidth, s = o.clientHeight, l = 0, a = 0;
|
1512
1533
|
if (i) {
|
1513
1534
|
r = i.width, s = i.height;
|
1514
|
-
const
|
1515
|
-
(!
|
1535
|
+
const u = Rt();
|
1536
|
+
(!u || u && t === "fixed") && (l = i.offsetLeft, a = i.offsetTop);
|
1516
1537
|
}
|
1517
1538
|
return {
|
1518
1539
|
width: r,
|
@@ -1521,25 +1542,25 @@ function ti(e, t) {
|
|
1521
1542
|
y: a
|
1522
1543
|
};
|
1523
1544
|
}
|
1524
|
-
function
|
1525
|
-
const n =
|
1545
|
+
function ii(e, t) {
|
1546
|
+
const n = Ee(e, !0, t === "fixed"), o = n.top + e.clientTop, i = n.left + e.clientLeft, r = se(e) ? Ce(e) : fe(1), s = e.clientWidth * r.x, l = e.clientHeight * r.y, a = i * r.x, u = o * r.y;
|
1526
1547
|
return {
|
1527
1548
|
width: s,
|
1528
1549
|
height: l,
|
1529
1550
|
x: a,
|
1530
|
-
y:
|
1551
|
+
y: u
|
1531
1552
|
};
|
1532
1553
|
}
|
1533
|
-
function
|
1554
|
+
function Bt(e, t, n) {
|
1534
1555
|
let o;
|
1535
1556
|
if (t === "viewport")
|
1536
|
-
o =
|
1557
|
+
o = oi(e, n);
|
1537
1558
|
else if (t === "document")
|
1538
|
-
o =
|
1539
|
-
else if (
|
1540
|
-
o =
|
1559
|
+
o = ni(ae(e));
|
1560
|
+
else if (G(t))
|
1561
|
+
o = ii(t, n);
|
1541
1562
|
else {
|
1542
|
-
const i =
|
1563
|
+
const i = vn(e);
|
1543
1564
|
o = {
|
1544
1565
|
...t,
|
1545
1566
|
x: t.x - i.x,
|
@@ -1548,34 +1569,34 @@ function Nt(e, t, n) {
|
|
1548
1569
|
}
|
1549
1570
|
return Ze(o);
|
1550
1571
|
}
|
1551
|
-
function
|
1552
|
-
const n =
|
1553
|
-
return n === t || !
|
1572
|
+
function bn(e, t) {
|
1573
|
+
const n = ue(e);
|
1574
|
+
return n === t || !G(n) || Ie(n) ? !1 : ie(n).position === "fixed" || bn(n, t);
|
1554
1575
|
}
|
1555
|
-
function
|
1576
|
+
function ri(e, t) {
|
1556
1577
|
const n = t.get(e);
|
1557
1578
|
if (n)
|
1558
1579
|
return n;
|
1559
|
-
let o =
|
1580
|
+
let o = ke(e, [], !1).filter((l) => G(l) && Ae(l) !== "body"), i = null;
|
1560
1581
|
const r = ie(e).position === "fixed";
|
1561
|
-
let s = r ?
|
1562
|
-
for (;
|
1563
|
-
const l = ie(s), a =
|
1564
|
-
!a && l.position === "fixed" && (i = null), (r ? !a && !i : !a && l.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) ||
|
1582
|
+
let s = r ? ue(e) : e;
|
1583
|
+
for (; G(s) && !Ie(s); ) {
|
1584
|
+
const l = ie(s), a = St(s);
|
1585
|
+
!a && l.position === "fixed" && (i = null), (r ? !a && !i : !a && l.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || We(s) && !a && bn(e, s)) ? o = o.filter((c) => c !== s) : i = l, s = ue(s);
|
1565
1586
|
}
|
1566
1587
|
return t.set(e, o), o;
|
1567
1588
|
}
|
1568
|
-
function
|
1589
|
+
function li(e) {
|
1569
1590
|
let {
|
1570
1591
|
element: t,
|
1571
1592
|
boundary: n,
|
1572
1593
|
rootBoundary: o,
|
1573
1594
|
strategy: i
|
1574
1595
|
} = e;
|
1575
|
-
const s = [...n === "clippingAncestors" ?
|
1576
|
-
const d =
|
1577
|
-
return
|
1578
|
-
},
|
1596
|
+
const s = [...n === "clippingAncestors" ? it(t) ? [] : ri(t, this._c) : [].concat(n), o], l = s[0], a = s.reduce((u, c) => {
|
1597
|
+
const d = Bt(t, c, i);
|
1598
|
+
return u.top = K(d.top, u.top), u.right = Me(d.right, u.right), u.bottom = Me(d.bottom, u.bottom), u.left = K(d.left, u.left), u;
|
1599
|
+
}, Bt(t, l, i));
|
1579
1600
|
return {
|
1580
1601
|
width: a.right - a.left,
|
1581
1602
|
height: a.bottom - a.top,
|
@@ -1583,64 +1604,75 @@ function ii(e) {
|
|
1583
1604
|
y: a.top
|
1584
1605
|
};
|
1585
1606
|
}
|
1586
|
-
function
|
1607
|
+
function si(e) {
|
1587
1608
|
const {
|
1588
1609
|
width: t,
|
1589
1610
|
height: n
|
1590
|
-
} =
|
1611
|
+
} = gn(e);
|
1591
1612
|
return {
|
1592
1613
|
width: t,
|
1593
1614
|
height: n
|
1594
1615
|
};
|
1595
1616
|
}
|
1596
|
-
function
|
1597
|
-
const o = se(t), i =
|
1617
|
+
function ai(e, t, n) {
|
1618
|
+
const o = se(t), i = ae(t), r = n === "fixed", s = Ee(e, !0, r, t);
|
1598
1619
|
let l = {
|
1599
1620
|
scrollLeft: 0,
|
1600
1621
|
scrollTop: 0
|
1601
1622
|
};
|
1602
|
-
const a =
|
1623
|
+
const a = fe(0);
|
1603
1624
|
if (o || !o && !r)
|
1604
|
-
if ((
|
1605
|
-
const
|
1606
|
-
a.x =
|
1607
|
-
} else i && (a.x =
|
1608
|
-
|
1625
|
+
if ((Ae(t) !== "body" || We(i)) && (l = rt(t)), o) {
|
1626
|
+
const f = Ee(t, !0, r, t);
|
1627
|
+
a.x = f.x + t.clientLeft, a.y = f.y + t.clientTop;
|
1628
|
+
} else i && (a.x = vt(i));
|
1629
|
+
let u = 0, c = 0;
|
1630
|
+
if (i && !o && !r) {
|
1631
|
+
const f = i.getBoundingClientRect();
|
1632
|
+
c = f.top + l.scrollTop, u = f.left + l.scrollLeft - // RTL <body> scrollbar.
|
1633
|
+
vt(i, f);
|
1634
|
+
}
|
1635
|
+
const d = s.left + l.scrollLeft - a.x - u, p = s.top + l.scrollTop - a.y - c;
|
1609
1636
|
return {
|
1610
|
-
x:
|
1611
|
-
y:
|
1637
|
+
x: d,
|
1638
|
+
y: p,
|
1612
1639
|
width: s.width,
|
1613
1640
|
height: s.height
|
1614
1641
|
};
|
1615
1642
|
}
|
1616
|
-
function
|
1643
|
+
function at(e) {
|
1617
1644
|
return ie(e).position === "static";
|
1618
1645
|
}
|
1619
|
-
function
|
1620
|
-
|
1646
|
+
function Wt(e, t) {
|
1647
|
+
if (!se(e) || ie(e).position === "fixed")
|
1648
|
+
return null;
|
1649
|
+
if (t)
|
1650
|
+
return t(e);
|
1651
|
+
let n = e.offsetParent;
|
1652
|
+
return ae(e) === n && (n = n.ownerDocument.body), n;
|
1621
1653
|
}
|
1622
|
-
function
|
1654
|
+
function xn(e, t) {
|
1623
1655
|
const n = ee(e);
|
1624
|
-
if (
|
1656
|
+
if (it(e))
|
1625
1657
|
return n;
|
1626
1658
|
if (!se(e)) {
|
1627
|
-
let i =
|
1659
|
+
let i = ue(e);
|
1628
1660
|
for (; i && !Ie(i); ) {
|
1629
|
-
if (
|
1661
|
+
if (G(i) && !at(i))
|
1630
1662
|
return i;
|
1631
|
-
i =
|
1663
|
+
i = ue(i);
|
1632
1664
|
}
|
1633
1665
|
return n;
|
1634
1666
|
}
|
1635
|
-
let o =
|
1636
|
-
for (; o &&
|
1637
|
-
o =
|
1638
|
-
return o && Ie(o) &&
|
1667
|
+
let o = Wt(e, t);
|
1668
|
+
for (; o && Lo(o) && at(o); )
|
1669
|
+
o = Wt(o, t);
|
1670
|
+
return o && Ie(o) && at(o) && !St(o) ? n : o || _o(e) || n;
|
1639
1671
|
}
|
1640
|
-
const
|
1641
|
-
const t = this.getOffsetParent ||
|
1672
|
+
const ci = async function(e) {
|
1673
|
+
const t = this.getOffsetParent || xn, n = this.getDimensions, o = await n(e.floating);
|
1642
1674
|
return {
|
1643
|
-
reference:
|
1675
|
+
reference: ai(e.reference, await t(e.floating), e.strategy),
|
1644
1676
|
floating: {
|
1645
1677
|
x: 0,
|
1646
1678
|
y: 0,
|
@@ -1649,24 +1681,24 @@ const si = async function(e) {
|
|
1649
1681
|
}
|
1650
1682
|
};
|
1651
1683
|
};
|
1652
|
-
function
|
1684
|
+
function ui(e) {
|
1653
1685
|
return ie(e).direction === "rtl";
|
1654
1686
|
}
|
1655
|
-
const
|
1656
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
1657
|
-
getDocumentElement:
|
1658
|
-
getClippingRect:
|
1659
|
-
getOffsetParent:
|
1660
|
-
getElementRects:
|
1661
|
-
getClientRects:
|
1662
|
-
getDimensions:
|
1687
|
+
const fi = {
|
1688
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: ei,
|
1689
|
+
getDocumentElement: ae,
|
1690
|
+
getClippingRect: li,
|
1691
|
+
getOffsetParent: xn,
|
1692
|
+
getElementRects: ci,
|
1693
|
+
getClientRects: ti,
|
1694
|
+
getDimensions: si,
|
1663
1695
|
getScale: Ce,
|
1664
|
-
isElement:
|
1665
|
-
isRTL:
|
1696
|
+
isElement: G,
|
1697
|
+
isRTL: ui
|
1666
1698
|
};
|
1667
|
-
function
|
1699
|
+
function di(e, t) {
|
1668
1700
|
let n = null, o;
|
1669
|
-
const i =
|
1701
|
+
const i = ae(e);
|
1670
1702
|
function r() {
|
1671
1703
|
var l;
|
1672
1704
|
clearTimeout(o), (l = n) == null || l.disconnect(), n = null;
|
@@ -1674,43 +1706,43 @@ function ui(e, t) {
|
|
1674
1706
|
function s(l, a) {
|
1675
1707
|
l === void 0 && (l = !1), a === void 0 && (a = 1), r();
|
1676
1708
|
const {
|
1677
|
-
left:
|
1678
|
-
top:
|
1709
|
+
left: u,
|
1710
|
+
top: c,
|
1679
1711
|
width: d,
|
1680
1712
|
height: p
|
1681
1713
|
} = e.getBoundingClientRect();
|
1682
1714
|
if (l || t(), !d || !p)
|
1683
1715
|
return;
|
1684
|
-
const
|
1685
|
-
rootMargin: -
|
1686
|
-
threshold:
|
1716
|
+
const f = Ke(c), m = Ke(i.clientWidth - (u + d)), h = Ke(i.clientHeight - (c + p)), g = Ke(u), y = {
|
1717
|
+
rootMargin: -f + "px " + -m + "px " + -h + "px " + -g + "px",
|
1718
|
+
threshold: K(0, Me(1, a)) || 1
|
1687
1719
|
};
|
1688
1720
|
let b = !0;
|
1689
|
-
function
|
1690
|
-
const
|
1691
|
-
if (
|
1721
|
+
function E(O) {
|
1722
|
+
const C = O[0].intersectionRatio;
|
1723
|
+
if (C !== a) {
|
1692
1724
|
if (!b)
|
1693
1725
|
return s();
|
1694
|
-
|
1726
|
+
C ? s(!1, C) : o = setTimeout(() => {
|
1695
1727
|
s(!1, 1e-7);
|
1696
1728
|
}, 1e3);
|
1697
1729
|
}
|
1698
1730
|
b = !1;
|
1699
1731
|
}
|
1700
1732
|
try {
|
1701
|
-
n = new IntersectionObserver(
|
1702
|
-
...
|
1733
|
+
n = new IntersectionObserver(E, {
|
1734
|
+
...y,
|
1703
1735
|
// Handle <iframe>s
|
1704
1736
|
root: i.ownerDocument
|
1705
1737
|
});
|
1706
1738
|
} catch {
|
1707
|
-
n = new IntersectionObserver(
|
1739
|
+
n = new IntersectionObserver(E, y);
|
1708
1740
|
}
|
1709
1741
|
n.observe(e);
|
1710
1742
|
}
|
1711
1743
|
return s(!0), r;
|
1712
1744
|
}
|
1713
|
-
function
|
1745
|
+
function mi(e, t, n, o) {
|
1714
1746
|
o === void 0 && (o = {});
|
1715
1747
|
const {
|
1716
1748
|
ancestorScroll: i = !0,
|
@@ -1718,48 +1750,48 @@ function fi(e, t, n, o) {
|
|
1718
1750
|
elementResize: s = typeof ResizeObserver == "function",
|
1719
1751
|
layoutShift: l = typeof IntersectionObserver == "function",
|
1720
1752
|
animationFrame: a = !1
|
1721
|
-
} = o,
|
1722
|
-
|
1753
|
+
} = o, u = Ct(e), c = i || r ? [...u ? ke(u) : [], ...ke(t)] : [];
|
1754
|
+
c.forEach((v) => {
|
1723
1755
|
i && v.addEventListener("scroll", n, {
|
1724
1756
|
passive: !0
|
1725
1757
|
}), r && v.addEventListener("resize", n);
|
1726
1758
|
});
|
1727
|
-
const d =
|
1728
|
-
let p = -1,
|
1729
|
-
s && (
|
1730
|
-
let [
|
1731
|
-
|
1759
|
+
const d = u && l ? di(u, n) : null;
|
1760
|
+
let p = -1, f = null;
|
1761
|
+
s && (f = new ResizeObserver((v) => {
|
1762
|
+
let [y] = v;
|
1763
|
+
y && y.target === u && f && (f.unobserve(t), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
|
1732
1764
|
var b;
|
1733
|
-
(b =
|
1765
|
+
(b = f) == null || b.observe(t);
|
1734
1766
|
})), n();
|
1735
|
-
}),
|
1736
|
-
let m, h = a ?
|
1767
|
+
}), u && !a && f.observe(u), f.observe(t));
|
1768
|
+
let m, h = a ? Ee(e) : null;
|
1737
1769
|
a && g();
|
1738
1770
|
function g() {
|
1739
|
-
const v =
|
1771
|
+
const v = Ee(e);
|
1740
1772
|
h && (v.x !== h.x || v.y !== h.y || v.width !== h.width || v.height !== h.height) && n(), h = v, m = requestAnimationFrame(g);
|
1741
1773
|
}
|
1742
1774
|
return n(), () => {
|
1743
1775
|
var v;
|
1744
|
-
|
1745
|
-
i &&
|
1746
|
-
}), d == null || d(), (v =
|
1776
|
+
c.forEach((y) => {
|
1777
|
+
i && y.removeEventListener("scroll", n), r && y.removeEventListener("resize", n);
|
1778
|
+
}), d == null || d(), (v = f) == null || v.disconnect(), f = null, a && cancelAnimationFrame(m);
|
1747
1779
|
};
|
1748
1780
|
}
|
1749
|
-
const
|
1781
|
+
const ct = lt, pi = Go, hi = Xo, gi = qo, vi = Jo, bi = (e, t, n) => {
|
1750
1782
|
const o = /* @__PURE__ */ new Map(), i = {
|
1751
|
-
platform:
|
1783
|
+
platform: fi,
|
1752
1784
|
...n
|
1753
1785
|
}, r = {
|
1754
1786
|
...i.platform,
|
1755
1787
|
_c: o
|
1756
1788
|
};
|
1757
|
-
return
|
1789
|
+
return Yo(e, t, {
|
1758
1790
|
...i,
|
1759
1791
|
platform: r
|
1760
1792
|
});
|
1761
1793
|
};
|
1762
|
-
var Ge = typeof document < "u" ?
|
1794
|
+
var Ge = typeof document < "u" ? on : oe;
|
1763
1795
|
function et(e, t) {
|
1764
1796
|
if (e === t)
|
1765
1797
|
return !0;
|
@@ -1790,20 +1822,20 @@ function et(e, t) {
|
|
1790
1822
|
}
|
1791
1823
|
return e !== e && t !== t;
|
1792
1824
|
}
|
1793
|
-
function
|
1825
|
+
function wn(e) {
|
1794
1826
|
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
1795
1827
|
}
|
1796
|
-
function
|
1797
|
-
const n =
|
1828
|
+
function jt(e, t) {
|
1829
|
+
const n = wn(e);
|
1798
1830
|
return Math.round(t * n) / n;
|
1799
1831
|
}
|
1800
|
-
function
|
1801
|
-
const t =
|
1832
|
+
function ut(e) {
|
1833
|
+
const t = w.useRef(e);
|
1802
1834
|
return Ge(() => {
|
1803
1835
|
t.current = e;
|
1804
1836
|
}), t;
|
1805
1837
|
}
|
1806
|
-
function
|
1838
|
+
function xi(e) {
|
1807
1839
|
e === void 0 && (e = {});
|
1808
1840
|
const {
|
1809
1841
|
placement: t = "bottom",
|
@@ -1816,138 +1848,142 @@ function vi(e) {
|
|
1816
1848
|
} = {},
|
1817
1849
|
transform: l = !0,
|
1818
1850
|
whileElementsMounted: a,
|
1819
|
-
open:
|
1820
|
-
} = e, [
|
1851
|
+
open: u
|
1852
|
+
} = e, [c, d] = w.useState({
|
1821
1853
|
x: 0,
|
1822
1854
|
y: 0,
|
1823
1855
|
strategy: n,
|
1824
1856
|
placement: t,
|
1825
1857
|
middlewareData: {},
|
1826
1858
|
isPositioned: !1
|
1827
|
-
}), [p,
|
1828
|
-
et(p, o) ||
|
1829
|
-
const [m, h] =
|
1830
|
-
P !==
|
1831
|
-
}, []), b =
|
1832
|
-
P !==
|
1833
|
-
}, []),
|
1834
|
-
if (!
|
1859
|
+
}), [p, f] = w.useState(o);
|
1860
|
+
et(p, o) || f(o);
|
1861
|
+
const [m, h] = w.useState(null), [g, v] = w.useState(null), y = w.useCallback((P) => {
|
1862
|
+
P !== C.current && (C.current = P, h(P));
|
1863
|
+
}, []), b = w.useCallback((P) => {
|
1864
|
+
P !== T.current && (T.current = P, v(P));
|
1865
|
+
}, []), E = r || m, O = s || g, C = w.useRef(null), T = w.useRef(null), S = w.useRef(c), L = a != null, A = ut(a), D = ut(i), k = ut(u), F = w.useCallback(() => {
|
1866
|
+
if (!C.current || !T.current)
|
1835
1867
|
return;
|
1836
1868
|
const P = {
|
1837
1869
|
placement: t,
|
1838
1870
|
strategy: n,
|
1839
1871
|
middleware: p
|
1840
1872
|
};
|
1841
|
-
D.current && (P.platform = D.current),
|
1842
|
-
const
|
1843
|
-
|
1844
|
-
|
1873
|
+
D.current && (P.platform = D.current), bi(C.current, T.current, P).then(($) => {
|
1874
|
+
const H = {
|
1875
|
+
...$,
|
1876
|
+
// The floating element's position may be recomputed while it's closed
|
1877
|
+
// but still mounted (such as when transitioning out). To ensure
|
1878
|
+
// `isPositioned` will be `false` initially on the next open, avoid
|
1879
|
+
// setting it to `true` when `open === false` (must be specified).
|
1880
|
+
isPositioned: k.current !== !1
|
1845
1881
|
};
|
1846
|
-
|
1847
|
-
d(
|
1882
|
+
x.current && !et(S.current, H) && (S.current = H, Xe.flushSync(() => {
|
1883
|
+
d(H);
|
1848
1884
|
}));
|
1849
1885
|
});
|
1850
|
-
}, [p, t, n, D]);
|
1886
|
+
}, [p, t, n, D, k]);
|
1851
1887
|
Ge(() => {
|
1852
|
-
|
1888
|
+
u === !1 && S.current.isPositioned && (S.current.isPositioned = !1, d((P) => ({
|
1853
1889
|
...P,
|
1854
1890
|
isPositioned: !1
|
1855
1891
|
})));
|
1856
|
-
}, [
|
1857
|
-
const
|
1858
|
-
Ge(() => (
|
1859
|
-
|
1892
|
+
}, [u]);
|
1893
|
+
const x = w.useRef(!1);
|
1894
|
+
Ge(() => (x.current = !0, () => {
|
1895
|
+
x.current = !1;
|
1860
1896
|
}), []), Ge(() => {
|
1861
|
-
if (
|
1862
|
-
if (
|
1863
|
-
return
|
1864
|
-
|
1897
|
+
if (E && (C.current = E), O && (T.current = O), E && O) {
|
1898
|
+
if (A.current)
|
1899
|
+
return A.current(E, O, F);
|
1900
|
+
F();
|
1865
1901
|
}
|
1866
|
-
}, [
|
1867
|
-
const
|
1868
|
-
reference:
|
1869
|
-
floating:
|
1870
|
-
setReference:
|
1902
|
+
}, [E, O, F, A, L]);
|
1903
|
+
const B = w.useMemo(() => ({
|
1904
|
+
reference: C,
|
1905
|
+
floating: T,
|
1906
|
+
setReference: y,
|
1871
1907
|
setFloating: b
|
1872
|
-
}), [
|
1873
|
-
reference:
|
1908
|
+
}), [y, b]), _ = w.useMemo(() => ({
|
1909
|
+
reference: E,
|
1874
1910
|
floating: O
|
1875
|
-
}), [
|
1911
|
+
}), [E, O]), z = w.useMemo(() => {
|
1876
1912
|
const P = {
|
1877
1913
|
position: n,
|
1878
1914
|
left: 0,
|
1879
1915
|
top: 0
|
1880
1916
|
};
|
1881
|
-
if (!
|
1917
|
+
if (!_.floating)
|
1882
1918
|
return P;
|
1883
|
-
const
|
1919
|
+
const $ = jt(_.floating, c.x), H = jt(_.floating, c.y);
|
1884
1920
|
return l ? {
|
1885
1921
|
...P,
|
1886
|
-
transform: "translate(" +
|
1887
|
-
...
|
1922
|
+
transform: "translate(" + $ + "px, " + H + "px)",
|
1923
|
+
...wn(_.floating) >= 1.5 && {
|
1888
1924
|
willChange: "transform"
|
1889
1925
|
}
|
1890
1926
|
} : {
|
1891
1927
|
position: n,
|
1892
|
-
left:
|
1893
|
-
top:
|
1928
|
+
left: $,
|
1929
|
+
top: H
|
1894
1930
|
};
|
1895
|
-
}, [n, l,
|
1896
|
-
return
|
1897
|
-
...
|
1898
|
-
update:
|
1899
|
-
refs:
|
1900
|
-
elements:
|
1901
|
-
floatingStyles:
|
1902
|
-
}), [
|
1903
|
-
}
|
1904
|
-
const
|
1905
|
-
...di(e),
|
1906
|
-
options: [e, t]
|
1907
|
-
}), bi = (e, t) => ({
|
1908
|
-
...mi(e),
|
1909
|
-
options: [e, t]
|
1910
|
-
}), xi = (e, t) => ({
|
1931
|
+
}, [n, l, _.floating, c.x, c.y]);
|
1932
|
+
return w.useMemo(() => ({
|
1933
|
+
...c,
|
1934
|
+
update: F,
|
1935
|
+
refs: B,
|
1936
|
+
elements: _,
|
1937
|
+
floatingStyles: z
|
1938
|
+
}), [c, F, B, _, z]);
|
1939
|
+
}
|
1940
|
+
const yn = (e, t) => ({
|
1911
1941
|
...pi(e),
|
1912
1942
|
options: [e, t]
|
1913
1943
|
}), wi = (e, t) => ({
|
1914
1944
|
...hi(e),
|
1915
1945
|
options: [e, t]
|
1916
|
-
}),
|
1917
|
-
...
|
1918
|
-
|
1919
|
-
|
1920
|
-
|
1946
|
+
}), yi = (e, t) => ({
|
1947
|
+
...gi(e),
|
1948
|
+
options: [e, t]
|
1949
|
+
}), Ei = (e, t) => ({
|
1950
|
+
...vi(e),
|
1951
|
+
options: [e, t]
|
1952
|
+
}), En = {
|
1953
|
+
...w
|
1954
|
+
}, Oi = En.useInsertionEffect, Si = Oi || ((e) => e());
|
1955
|
+
function On(e) {
|
1956
|
+
const t = w.useRef(() => {
|
1921
1957
|
if (process.env.NODE_ENV !== "production")
|
1922
1958
|
throw new Error("Cannot call an event handler while rendering.");
|
1923
1959
|
});
|
1924
|
-
return
|
1960
|
+
return Si(() => {
|
1925
1961
|
t.current = e;
|
1926
|
-
}),
|
1962
|
+
}), w.useCallback(function() {
|
1927
1963
|
for (var n = arguments.length, o = new Array(n), i = 0; i < n; i++)
|
1928
1964
|
o[i] = arguments[i];
|
1929
1965
|
return t.current == null ? void 0 : t.current(...o);
|
1930
1966
|
}, []);
|
1931
1967
|
}
|
1932
|
-
var
|
1933
|
-
let
|
1934
|
-
const
|
1968
|
+
var bt = typeof document < "u" ? on : oe;
|
1969
|
+
let Ut = !1, Ri = 0;
|
1970
|
+
const Yt = () => (
|
1935
1971
|
// Ensure the id is unique with multiple independent versions of Floating UI
|
1936
1972
|
// on <React 18
|
1937
|
-
"floating-ui-" + Math.random().toString(36).slice(2, 6) +
|
1973
|
+
"floating-ui-" + Math.random().toString(36).slice(2, 6) + Ri++
|
1938
1974
|
);
|
1939
|
-
function
|
1940
|
-
const [e, t] =
|
1941
|
-
return
|
1942
|
-
e == null && t(
|
1943
|
-
}, []),
|
1944
|
-
|
1975
|
+
function Ci() {
|
1976
|
+
const [e, t] = w.useState(() => Ut ? Yt() : void 0);
|
1977
|
+
return bt(() => {
|
1978
|
+
e == null && t(Yt());
|
1979
|
+
}, []), w.useEffect(() => {
|
1980
|
+
Ut = !0;
|
1945
1981
|
}, []), e;
|
1946
1982
|
}
|
1947
|
-
const
|
1983
|
+
const Ti = En.useId, Ii = Ti || Ci;
|
1948
1984
|
let He;
|
1949
1985
|
process.env.NODE_ENV !== "production" && (He = /* @__PURE__ */ new Set());
|
1950
|
-
function
|
1986
|
+
function Mi() {
|
1951
1987
|
for (var e, t = arguments.length, n = new Array(t), o = 0; o < t; o++)
|
1952
1988
|
n[o] = arguments[o];
|
1953
1989
|
const i = "Floating UI: " + n.join(" ");
|
@@ -1956,7 +1992,7 @@ function Ti() {
|
|
1956
1992
|
(r = He) == null || r.add(i), console.warn(i);
|
1957
1993
|
}
|
1958
1994
|
}
|
1959
|
-
function
|
1995
|
+
function Pi() {
|
1960
1996
|
for (var e, t = arguments.length, n = new Array(t), o = 0; o < t; o++)
|
1961
1997
|
n[o] = arguments[o];
|
1962
1998
|
const i = "Floating UI: " + n.join(" ");
|
@@ -1965,7 +2001,7 @@ function Ii() {
|
|
1965
2001
|
(r = He) == null || r.add(i), console.error(i);
|
1966
2002
|
}
|
1967
2003
|
}
|
1968
|
-
function
|
2004
|
+
function Ai() {
|
1969
2005
|
const e = /* @__PURE__ */ new Map();
|
1970
2006
|
return {
|
1971
2007
|
emit(t, n) {
|
@@ -1981,60 +2017,60 @@ function Mi() {
|
|
1981
2017
|
}
|
1982
2018
|
};
|
1983
2019
|
}
|
1984
|
-
const
|
2020
|
+
const $i = /* @__PURE__ */ w.createContext(null), Di = /* @__PURE__ */ w.createContext(null), Fi = () => {
|
1985
2021
|
var e;
|
1986
|
-
return ((e =
|
1987
|
-
},
|
1988
|
-
function
|
2022
|
+
return ((e = w.useContext($i)) == null ? void 0 : e.id) || null;
|
2023
|
+
}, Li = () => w.useContext(Di), _i = "data-floating-ui-focusable";
|
2024
|
+
function Ni(e) {
|
1989
2025
|
const {
|
1990
2026
|
open: t = !1,
|
1991
2027
|
onOpenChange: n,
|
1992
2028
|
elements: o
|
1993
|
-
} = e, i =
|
2029
|
+
} = e, i = Ii(), r = w.useRef({}), [s] = w.useState(() => Ai()), l = Fi() != null;
|
1994
2030
|
if (process.env.NODE_ENV !== "production") {
|
1995
|
-
const
|
1996
|
-
|
2031
|
+
const f = o.reference;
|
2032
|
+
f && !G(f) && Pi("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
|
1997
2033
|
}
|
1998
|
-
const [a,
|
1999
|
-
r.current.openEvent =
|
2000
|
-
open:
|
2034
|
+
const [a, u] = w.useState(o.reference), c = On((f, m, h) => {
|
2035
|
+
r.current.openEvent = f ? m : void 0, s.emit("openchange", {
|
2036
|
+
open: f,
|
2001
2037
|
event: m,
|
2002
2038
|
reason: h,
|
2003
2039
|
nested: l
|
2004
|
-
}), n == null || n(
|
2005
|
-
}), d =
|
2006
|
-
setPositionReference:
|
2007
|
-
}), []), p =
|
2040
|
+
}), n == null || n(f, m, h);
|
2041
|
+
}), d = w.useMemo(() => ({
|
2042
|
+
setPositionReference: u
|
2043
|
+
}), []), p = w.useMemo(() => ({
|
2008
2044
|
reference: a || o.reference || null,
|
2009
2045
|
floating: o.floating || null,
|
2010
2046
|
domReference: o.reference
|
2011
2047
|
}), [a, o.reference, o.floating]);
|
2012
|
-
return
|
2048
|
+
return w.useMemo(() => ({
|
2013
2049
|
dataRef: r,
|
2014
2050
|
open: t,
|
2015
|
-
onOpenChange:
|
2051
|
+
onOpenChange: c,
|
2016
2052
|
elements: p,
|
2017
2053
|
events: s,
|
2018
2054
|
floatingId: i,
|
2019
2055
|
refs: d
|
2020
|
-
}), [t,
|
2056
|
+
}), [t, c, p, s, i, d]);
|
2021
2057
|
}
|
2022
|
-
function
|
2058
|
+
function ki(e) {
|
2023
2059
|
e === void 0 && (e = {});
|
2024
2060
|
const {
|
2025
2061
|
nodeId: t
|
2026
|
-
} = e, n =
|
2062
|
+
} = e, n = Ni({
|
2027
2063
|
...e,
|
2028
2064
|
elements: {
|
2029
2065
|
reference: null,
|
2030
2066
|
floating: null,
|
2031
2067
|
...e.elements
|
2032
2068
|
}
|
2033
|
-
}), o = e.rootContext || n, i = o.elements, [r, s] =
|
2034
|
-
|
2035
|
-
|
2036
|
-
}, [
|
2037
|
-
const
|
2069
|
+
}), o = e.rootContext || n, i = o.elements, [r, s] = w.useState(null), [l, a] = w.useState(null), c = (i == null ? void 0 : i.reference) || r, d = w.useRef(null), p = Li();
|
2070
|
+
bt(() => {
|
2071
|
+
c && (d.current = c);
|
2072
|
+
}, [c]);
|
2073
|
+
const f = xi({
|
2038
2074
|
...e,
|
2039
2075
|
elements: {
|
2040
2076
|
...i,
|
@@ -2042,102 +2078,103 @@ function Li(e) {
|
|
2042
2078
|
reference: l
|
2043
2079
|
}
|
2044
2080
|
}
|
2045
|
-
}), m =
|
2046
|
-
const
|
2081
|
+
}), m = w.useCallback((b) => {
|
2082
|
+
const E = G(b) ? {
|
2047
2083
|
getBoundingClientRect: () => b.getBoundingClientRect(),
|
2048
2084
|
contextElement: b
|
2049
2085
|
} : b;
|
2050
|
-
a(
|
2051
|
-
}, [
|
2052
|
-
(
|
2086
|
+
a(E), f.refs.setReference(E);
|
2087
|
+
}, [f.refs]), h = w.useCallback((b) => {
|
2088
|
+
(G(b) || b === null) && (d.current = b, s(b)), (G(f.refs.reference.current) || f.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
|
2053
2089
|
// `null` to support `positionReference` + an unstable `reference`
|
2054
2090
|
// callback ref.
|
2055
|
-
b !== null && !
|
2056
|
-
}, [
|
2057
|
-
...
|
2091
|
+
b !== null && !G(b)) && f.refs.setReference(b);
|
2092
|
+
}, [f.refs]), g = w.useMemo(() => ({
|
2093
|
+
...f.refs,
|
2058
2094
|
setReference: h,
|
2059
2095
|
setPositionReference: m,
|
2060
2096
|
domReference: d
|
2061
|
-
}), [
|
2062
|
-
...
|
2063
|
-
domReference:
|
2064
|
-
}), [
|
2065
|
-
...
|
2097
|
+
}), [f.refs, h, m]), v = w.useMemo(() => ({
|
2098
|
+
...f.elements,
|
2099
|
+
domReference: c
|
2100
|
+
}), [f.elements, c]), y = w.useMemo(() => ({
|
2101
|
+
...f,
|
2066
2102
|
...o,
|
2067
2103
|
refs: g,
|
2068
2104
|
elements: v,
|
2069
2105
|
nodeId: t
|
2070
|
-
}), [
|
2071
|
-
return
|
2072
|
-
o.dataRef.current.floatingContext =
|
2073
|
-
const b = p == null ? void 0 : p.nodesRef.current.find((
|
2074
|
-
b && (b.context =
|
2075
|
-
}),
|
2076
|
-
...
|
2077
|
-
context:
|
2106
|
+
}), [f, g, v, t, o]);
|
2107
|
+
return bt(() => {
|
2108
|
+
o.dataRef.current.floatingContext = y;
|
2109
|
+
const b = p == null ? void 0 : p.nodesRef.current.find((E) => E.id === t);
|
2110
|
+
b && (b.context = y);
|
2111
|
+
}), w.useMemo(() => ({
|
2112
|
+
...f,
|
2113
|
+
context: y,
|
2078
2114
|
refs: g,
|
2079
2115
|
elements: v
|
2080
|
-
}), [
|
2116
|
+
}), [f, g, v, y]);
|
2081
2117
|
}
|
2082
|
-
const
|
2083
|
-
function
|
2118
|
+
const qt = "active", Kt = "selected";
|
2119
|
+
function ft(e, t, n) {
|
2084
2120
|
const o = /* @__PURE__ */ new Map(), i = n === "item";
|
2085
2121
|
let r = e;
|
2086
2122
|
if (i && e) {
|
2087
2123
|
const {
|
2088
|
-
[
|
2089
|
-
[
|
2124
|
+
[qt]: s,
|
2125
|
+
[Kt]: l,
|
2090
2126
|
...a
|
2091
2127
|
} = e;
|
2092
2128
|
r = a;
|
2093
2129
|
}
|
2094
2130
|
return {
|
2095
2131
|
...n === "floating" && {
|
2096
|
-
tabIndex: -1
|
2132
|
+
tabIndex: -1,
|
2133
|
+
[_i]: ""
|
2097
2134
|
},
|
2098
2135
|
...r,
|
2099
2136
|
...t.map((s) => {
|
2100
2137
|
const l = s ? s[n] : null;
|
2101
2138
|
return typeof l == "function" ? e ? l(e) : null : l;
|
2102
2139
|
}).concat(e).reduce((s, l) => (l && Object.entries(l).forEach((a) => {
|
2103
|
-
let [
|
2104
|
-
if (!(i && [
|
2105
|
-
if (
|
2106
|
-
if (o.has(
|
2140
|
+
let [u, c] = a;
|
2141
|
+
if (!(i && [qt, Kt].includes(u)))
|
2142
|
+
if (u.indexOf("on") === 0) {
|
2143
|
+
if (o.has(u) || o.set(u, []), typeof c == "function") {
|
2107
2144
|
var d;
|
2108
|
-
(d = o.get(
|
2109
|
-
for (var p,
|
2145
|
+
(d = o.get(u)) == null || d.push(c), s[u] = function() {
|
2146
|
+
for (var p, f = arguments.length, m = new Array(f), h = 0; h < f; h++)
|
2110
2147
|
m[h] = arguments[h];
|
2111
|
-
return (p = o.get(
|
2148
|
+
return (p = o.get(u)) == null ? void 0 : p.map((g) => g(...m)).find((g) => g !== void 0);
|
2112
2149
|
};
|
2113
2150
|
}
|
2114
2151
|
} else
|
2115
|
-
s[
|
2152
|
+
s[u] = c;
|
2116
2153
|
}), s), {})
|
2117
2154
|
};
|
2118
2155
|
}
|
2119
|
-
function
|
2156
|
+
function zi(e) {
|
2120
2157
|
e === void 0 && (e = []);
|
2121
|
-
const t = e.map((l) => l == null ? void 0 : l.reference), n = e.map((l) => l == null ? void 0 : l.floating), o = e.map((l) => l == null ? void 0 : l.item), i =
|
2122
|
-
(l) =>
|
2158
|
+
const t = e.map((l) => l == null ? void 0 : l.reference), n = e.map((l) => l == null ? void 0 : l.floating), o = e.map((l) => l == null ? void 0 : l.item), i = w.useCallback(
|
2159
|
+
(l) => ft(l, e, "reference"),
|
2123
2160
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
2124
2161
|
t
|
2125
|
-
), r =
|
2126
|
-
(l) =>
|
2162
|
+
), r = w.useCallback(
|
2163
|
+
(l) => ft(l, e, "floating"),
|
2127
2164
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
2128
2165
|
n
|
2129
|
-
), s =
|
2130
|
-
(l) =>
|
2166
|
+
), s = w.useCallback(
|
2167
|
+
(l) => ft(l, e, "item"),
|
2131
2168
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
2132
2169
|
o
|
2133
2170
|
);
|
2134
|
-
return
|
2171
|
+
return w.useMemo(() => ({
|
2135
2172
|
getReferenceProps: i,
|
2136
2173
|
getFloatingProps: r,
|
2137
2174
|
getItemProps: s
|
2138
2175
|
}), [i, r, s]);
|
2139
2176
|
}
|
2140
|
-
function
|
2177
|
+
function Gt(e, t) {
|
2141
2178
|
return {
|
2142
2179
|
...e,
|
2143
2180
|
rects: {
|
@@ -2149,7 +2186,7 @@ function Yt(e, t) {
|
|
2149
2186
|
}
|
2150
2187
|
};
|
2151
2188
|
}
|
2152
|
-
const
|
2189
|
+
const Hi = (e) => ({
|
2153
2190
|
name: "inner",
|
2154
2191
|
options: e,
|
2155
2192
|
async fn(t) {
|
@@ -2161,32 +2198,36 @@ const ki = (e) => ({
|
|
2161
2198
|
index: s = 0,
|
2162
2199
|
minItemsVisible: l = 4,
|
2163
2200
|
referenceOverflowThreshold: a = 0,
|
2164
|
-
scrollRef:
|
2165
|
-
...
|
2166
|
-
} =
|
2201
|
+
scrollRef: u,
|
2202
|
+
...c
|
2203
|
+
} = $e(e, t), {
|
2167
2204
|
rects: d,
|
2168
2205
|
elements: {
|
2169
2206
|
floating: p
|
2170
2207
|
}
|
2171
|
-
} = t,
|
2172
|
-
if (process.env.NODE_ENV !== "production" && (t.placement.startsWith("bottom") ||
|
2208
|
+
} = t, f = n.current[s], m = (u == null ? void 0 : u.current) || p, h = p.clientTop || m.clientTop, g = p.clientTop !== 0, v = m.clientTop !== 0, y = p === m;
|
2209
|
+
if (process.env.NODE_ENV !== "production" && (t.placement.startsWith("bottom") || Mi('`placement` side must be "bottom" when using the `inner`', "middleware.")), !f)
|
2173
2210
|
return {};
|
2174
|
-
const
|
2211
|
+
const b = {
|
2175
2212
|
...t,
|
2176
|
-
...await
|
2177
|
-
},
|
2178
|
-
...
|
2213
|
+
...await yn(-f.offsetTop - p.clientTop - d.reference.height / 2 - f.offsetHeight / 2 - r).fn(t)
|
2214
|
+
}, E = await ct(Gt(b, m.scrollHeight + h + p.clientTop), c), O = await ct(b, {
|
2215
|
+
...c,
|
2179
2216
|
elementContext: "reference"
|
2180
|
-
}),
|
2181
|
-
|
2182
|
-
|
2183
|
-
|
2184
|
-
}
|
2185
|
-
|
2217
|
+
}), C = K(0, E.top), T = b.y + C, S = ze(K(0, m.scrollHeight + (g && y || v ? h * 2 : 0) - C - K(0, E.bottom)));
|
2218
|
+
if (m.style.maxHeight = S + "px", m.scrollTop = C, i) {
|
2219
|
+
const L = m.scrollHeight > m.offsetHeight && m.offsetHeight < f.offsetHeight * l - 1 || O.top >= -a || O.bottom >= -a;
|
2220
|
+
Xe.flushSync(() => i(L));
|
2221
|
+
}
|
2222
|
+
return o && (o.current = await ct(Gt({
|
2223
|
+
...b,
|
2224
|
+
y: T
|
2225
|
+
}, m.offsetHeight + h + p.clientTop), c)), {
|
2226
|
+
y: T
|
2186
2227
|
};
|
2187
2228
|
}
|
2188
2229
|
});
|
2189
|
-
function
|
2230
|
+
function Vi(e, t) {
|
2190
2231
|
const {
|
2191
2232
|
open: n,
|
2192
2233
|
elements: o
|
@@ -2195,116 +2236,119 @@ function Ni(e, t) {
|
|
2195
2236
|
overflowRef: r,
|
2196
2237
|
scrollRef: s,
|
2197
2238
|
onChange: l
|
2198
|
-
} = t, a =
|
2199
|
-
|
2239
|
+
} = t, a = On(l), u = w.useRef(!1), c = w.useRef(null), d = w.useRef(null);
|
2240
|
+
w.useEffect(() => {
|
2200
2241
|
if (!i) return;
|
2201
|
-
function
|
2242
|
+
function f(h) {
|
2202
2243
|
if (h.ctrlKey || !m || r.current == null)
|
2203
2244
|
return;
|
2204
|
-
const g = h.deltaY, v = r.current.top >= -0.5,
|
2205
|
-
m.scrollHeight <= m.clientHeight || (!v && g > 0 || !
|
2206
|
-
a((
|
2207
|
-
})) : /firefox/i.test(
|
2245
|
+
const g = h.deltaY, v = r.current.top >= -0.5, y = r.current.bottom >= -0.5, b = m.scrollHeight - m.clientHeight, E = g < 0 ? -1 : 1, O = g < 0 ? "max" : "min";
|
2246
|
+
m.scrollHeight <= m.clientHeight || (!v && g > 0 || !y && g < 0 ? (h.preventDefault(), Xe.flushSync(() => {
|
2247
|
+
a((C) => C + Math[O](g, b * E));
|
2248
|
+
})) : /firefox/i.test(No()) && (m.scrollTop += g));
|
2208
2249
|
}
|
2209
2250
|
const m = (s == null ? void 0 : s.current) || o.floating;
|
2210
2251
|
if (n && m)
|
2211
|
-
return m.addEventListener("wheel",
|
2212
|
-
|
2252
|
+
return m.addEventListener("wheel", f), requestAnimationFrame(() => {
|
2253
|
+
c.current = m.scrollTop, r.current != null && (d.current = {
|
2213
2254
|
...r.current
|
2214
2255
|
});
|
2215
2256
|
}), () => {
|
2216
|
-
|
2257
|
+
c.current = null, d.current = null, m.removeEventListener("wheel", f);
|
2217
2258
|
};
|
2218
2259
|
}, [i, n, o.floating, r, s, a]);
|
2219
|
-
const p =
|
2260
|
+
const p = w.useMemo(() => ({
|
2220
2261
|
onKeyDown() {
|
2221
|
-
|
2262
|
+
u.current = !0;
|
2222
2263
|
},
|
2223
2264
|
onWheel() {
|
2224
|
-
|
2265
|
+
u.current = !1;
|
2225
2266
|
},
|
2226
2267
|
onPointerMove() {
|
2227
|
-
|
2268
|
+
u.current = !1;
|
2228
2269
|
},
|
2229
2270
|
onScroll() {
|
2230
|
-
const
|
2231
|
-
if (!(!r.current || !
|
2232
|
-
if (
|
2233
|
-
const m =
|
2234
|
-
(r.current.bottom < -0.5 && m < -1 || r.current.top < -0.5 && m > 1) &&
|
2271
|
+
const f = (s == null ? void 0 : s.current) || o.floating;
|
2272
|
+
if (!(!r.current || !f || !u.current)) {
|
2273
|
+
if (c.current !== null) {
|
2274
|
+
const m = f.scrollTop - c.current;
|
2275
|
+
(r.current.bottom < -0.5 && m < -1 || r.current.top < -0.5 && m > 1) && Xe.flushSync(() => a((h) => h + m));
|
2235
2276
|
}
|
2236
2277
|
requestAnimationFrame(() => {
|
2237
|
-
|
2278
|
+
c.current = f.scrollTop;
|
2238
2279
|
});
|
2239
2280
|
}
|
2240
2281
|
}
|
2241
2282
|
}), [o.floating, a, r, s]);
|
2242
|
-
return
|
2283
|
+
return w.useMemo(() => i ? {
|
2243
2284
|
floating: p
|
2244
2285
|
} : {}, [i, p]);
|
2245
2286
|
}
|
2246
|
-
let Ue =
|
2287
|
+
let Ue = he({ styles: void 0, setReference: () => {
|
2247
2288
|
}, setFloating: () => {
|
2248
2289
|
}, getReferenceProps: () => ({}), getFloatingProps: () => ({}), slot: {} });
|
2249
2290
|
Ue.displayName = "FloatingContext";
|
2250
|
-
let
|
2251
|
-
|
2252
|
-
function
|
2253
|
-
return
|
2291
|
+
let Tt = he(null);
|
2292
|
+
Tt.displayName = "PlacementContext";
|
2293
|
+
function Bi(e) {
|
2294
|
+
return X(() => e ? typeof e == "string" ? { to: e } : e : null, [e]);
|
2254
2295
|
}
|
2255
|
-
function
|
2296
|
+
function Wi() {
|
2256
2297
|
return le(Ue).setReference;
|
2257
2298
|
}
|
2258
|
-
function
|
2299
|
+
function ji() {
|
2259
2300
|
let { getFloatingProps: e, slot: t } = le(Ue);
|
2260
|
-
return
|
2301
|
+
return Ne((...n) => Object.assign({}, e(...n), { "data-anchor": t.anchor }), [e, t]);
|
2261
2302
|
}
|
2262
|
-
function
|
2303
|
+
function Ui(e = null) {
|
2263
2304
|
e === !1 && (e = null), typeof e == "string" && (e = { to: e });
|
2264
|
-
let t = le(
|
2265
|
-
|
2305
|
+
let t = le(Tt), n = X(() => e, [JSON.stringify(e, (i, r) => {
|
2306
|
+
var s;
|
2307
|
+
return (s = r == null ? void 0 : r.outerHTML) != null ? s : r;
|
2308
|
+
})]);
|
2309
|
+
U(() => {
|
2266
2310
|
t == null || t(n ?? null);
|
2267
2311
|
}, [t, n]);
|
2268
2312
|
let o = le(Ue);
|
2269
|
-
return
|
2270
|
-
}
|
2271
|
-
let
|
2272
|
-
function
|
2273
|
-
let [n, o] =
|
2274
|
-
|
2275
|
-
let
|
2276
|
-
|
2277
|
-
|
2278
|
-
}, [
|
2279
|
-
let { refs: v, floatingStyles:
|
2280
|
-
var k,
|
2313
|
+
return X(() => [o.setFloating, e ? o.styles : {}], [o.setFloating, e, o.styles]);
|
2314
|
+
}
|
2315
|
+
let Xt = 4;
|
2316
|
+
function Yi({ children: e, enabled: t = !0 }) {
|
2317
|
+
let [n, o] = ce(null), [i, r] = ce(0), s = J(null), [l, a] = ce(null);
|
2318
|
+
qi(l);
|
2319
|
+
let u = t && n !== null && l !== null, { to: c = "bottom", gap: d = 0, offset: p = 0, padding: f = 0, inner: m } = Ki(n, l), [h, g = "center"] = c.split(" ");
|
2320
|
+
U(() => {
|
2321
|
+
u && r(0);
|
2322
|
+
}, [u]);
|
2323
|
+
let { refs: v, floatingStyles: y, context: b } = ki({ open: u, placement: h === "selection" ? g === "center" ? "bottom" : `bottom-${g}` : g === "center" ? `${h}` : `${h}-${g}`, strategy: "absolute", transform: !1, middleware: [yn({ mainAxis: h === "selection" ? 0 : d, crossAxis: p }), wi({ padding: f }), h !== "selection" && yi({ padding: f }), h === "selection" && m ? Hi({ ...m, padding: f, overflowRef: s, offset: i, minItemsVisible: Xt, referenceOverflowThreshold: f, onFallbackChange(D) {
|
2324
|
+
var k, F;
|
2281
2325
|
if (!D) return;
|
2282
|
-
let
|
2283
|
-
if (!
|
2284
|
-
let
|
2285
|
-
for (let
|
2286
|
-
let
|
2287
|
-
if (
|
2326
|
+
let x = b.elements.floating;
|
2327
|
+
if (!x) return;
|
2328
|
+
let B = parseFloat(getComputedStyle(x).scrollPaddingBottom) || 0, _ = Math.min(Xt, x.childElementCount), z = 0, P = 0;
|
2329
|
+
for (let $ of (F = (k = b.elements.floating) == null ? void 0 : k.childNodes) != null ? F : []) if ($ instanceof HTMLElement) {
|
2330
|
+
let H = $.offsetTop, Y = H + $.clientHeight + B, ge = x.scrollTop, R = ge + x.clientHeight;
|
2331
|
+
if (H >= ge && Y <= R) _--;
|
2288
2332
|
else {
|
2289
|
-
|
2333
|
+
P = Math.max(0, Math.min(Y, R) - Math.max(H, ge)), z = $.clientHeight;
|
2290
2334
|
break;
|
2291
2335
|
}
|
2292
2336
|
}
|
2293
|
-
|
2294
|
-
let
|
2295
|
-
return
|
2337
|
+
_ >= 1 && r(($) => {
|
2338
|
+
let H = z * _ - P + B;
|
2339
|
+
return $ >= H ? $ : H;
|
2296
2340
|
});
|
2297
|
-
} }) : null,
|
2298
|
-
Object.assign(
|
2299
|
-
} })].filter(Boolean), whileElementsMounted:
|
2300
|
-
h === "selection" && (
|
2301
|
-
let
|
2341
|
+
} }) : null, Ei({ padding: f, apply({ availableWidth: D, availableHeight: k, elements: F }) {
|
2342
|
+
Object.assign(F.floating.style, { overflow: "auto", maxWidth: `${D}px`, maxHeight: `min(var(--anchor-max-height, 100vh), ${k}px)` });
|
2343
|
+
} })].filter(Boolean), whileElementsMounted: mi }), [E = h, O = g] = b.placement.split("-");
|
2344
|
+
h === "selection" && (E = "selection");
|
2345
|
+
let C = X(() => ({ anchor: [E, O].filter(Boolean).join(" ") }), [E, O]), T = Vi(b, { overflowRef: s, onChange: r }), { getReferenceProps: S, getFloatingProps: L } = zi([T]), A = M((D) => {
|
2302
2346
|
a(D), v.setFloating(D);
|
2303
2347
|
});
|
2304
|
-
return
|
2348
|
+
return w.createElement(Tt.Provider, { value: o }, w.createElement(Ue.Provider, { value: { setFloating: A, setReference: v.setReference, styles: y, getReferenceProps: S, getFloatingProps: L, slot: C } }, e));
|
2305
2349
|
}
|
2306
|
-
function
|
2307
|
-
|
2350
|
+
function qi(e) {
|
2351
|
+
U(() => {
|
2308
2352
|
if (!e) return;
|
2309
2353
|
let t = new MutationObserver(() => {
|
2310
2354
|
let n = window.getComputedStyle(e).maxHeight, o = parseFloat(n);
|
@@ -2317,91 +2361,91 @@ function ji(e) {
|
|
2317
2361
|
};
|
2318
2362
|
}, [e]);
|
2319
2363
|
}
|
2320
|
-
function
|
2364
|
+
function Ki(e, t) {
|
2321
2365
|
var n, o, i;
|
2322
|
-
let r =
|
2366
|
+
let r = dt((n = e == null ? void 0 : e.gap) != null ? n : "var(--anchor-gap, 0)", t), s = dt((o = e == null ? void 0 : e.offset) != null ? o : "var(--anchor-offset, 0)", t), l = dt((i = e == null ? void 0 : e.padding) != null ? i : "var(--anchor-padding, 0)", t);
|
2323
2367
|
return { ...e, gap: r, offset: s, padding: l };
|
2324
2368
|
}
|
2325
|
-
function
|
2326
|
-
let o =
|
2369
|
+
function dt(e, t, n = void 0) {
|
2370
|
+
let o = Zt(), i = M((a, u) => {
|
2327
2371
|
if (a == null) return [n, null];
|
2328
2372
|
if (typeof a == "number") return [a, null];
|
2329
2373
|
if (typeof a == "string") {
|
2330
|
-
if (!
|
2331
|
-
let
|
2332
|
-
return [
|
2333
|
-
let p =
|
2374
|
+
if (!u) return [n, null];
|
2375
|
+
let c = Jt(a, u);
|
2376
|
+
return [c, (d) => {
|
2377
|
+
let p = Sn(a);
|
2334
2378
|
{
|
2335
|
-
let
|
2379
|
+
let f = p.map((m) => window.getComputedStyle(u).getPropertyValue(m));
|
2336
2380
|
o.requestAnimationFrame(function m() {
|
2337
2381
|
o.nextFrame(m);
|
2338
2382
|
let h = !1;
|
2339
|
-
for (let [v,
|
2340
|
-
let b = window.getComputedStyle(
|
2341
|
-
if (
|
2342
|
-
|
2383
|
+
for (let [v, y] of p.entries()) {
|
2384
|
+
let b = window.getComputedStyle(u).getPropertyValue(y);
|
2385
|
+
if (f[v] !== b) {
|
2386
|
+
f[v] = b, h = !0;
|
2343
2387
|
break;
|
2344
2388
|
}
|
2345
2389
|
}
|
2346
2390
|
if (!h) return;
|
2347
|
-
let g =
|
2348
|
-
|
2391
|
+
let g = Jt(a, u);
|
2392
|
+
c !== g && (d(g), c = g);
|
2349
2393
|
});
|
2350
2394
|
}
|
2351
2395
|
return o.dispose;
|
2352
2396
|
}];
|
2353
2397
|
}
|
2354
2398
|
return [n, null];
|
2355
|
-
}), r =
|
2356
|
-
return
|
2357
|
-
let [a,
|
2358
|
-
if (l(a), !!
|
2399
|
+
}), r = X(() => i(e, t)[0], [e, t]), [s = r, l] = ce();
|
2400
|
+
return U(() => {
|
2401
|
+
let [a, u] = i(e, t);
|
2402
|
+
if (l(a), !!u) return u(l);
|
2359
2403
|
}, [e, t]), s;
|
2360
2404
|
}
|
2361
|
-
function
|
2405
|
+
function Sn(e) {
|
2362
2406
|
let t = /var\((.*)\)/.exec(e);
|
2363
2407
|
if (t) {
|
2364
2408
|
let n = t[1].indexOf(",");
|
2365
2409
|
if (n === -1) return [t[1]];
|
2366
2410
|
let o = t[1].slice(0, n).trim(), i = t[1].slice(n + 1).trim();
|
2367
|
-
return i ? [o, ...
|
2411
|
+
return i ? [o, ...Sn(i)] : [o];
|
2368
2412
|
}
|
2369
2413
|
return [];
|
2370
2414
|
}
|
2371
|
-
function
|
2415
|
+
function Jt(e, t) {
|
2372
2416
|
let n = document.createElement("div");
|
2373
2417
|
t.appendChild(n), n.style.setProperty("margin-top", "0px", "important"), n.style.setProperty("margin-top", e, "important");
|
2374
2418
|
let o = parseFloat(window.getComputedStyle(n).marginTop) || 0;
|
2375
2419
|
return t.removeChild(n), o;
|
2376
2420
|
}
|
2377
|
-
function
|
2378
|
-
let n =
|
2379
|
-
return
|
2421
|
+
function Gi({ children: e, freeze: t }) {
|
2422
|
+
let n = xt(t, e);
|
2423
|
+
return j.createElement(j.Fragment, null, n);
|
2380
2424
|
}
|
2381
|
-
function
|
2382
|
-
let [n, o] =
|
2425
|
+
function xt(e, t) {
|
2426
|
+
let [n, o] = ce(t);
|
2383
2427
|
return !e && n !== t && o(t), e ? n : t;
|
2384
2428
|
}
|
2385
|
-
function
|
2429
|
+
function Xi(e) {
|
2386
2430
|
function t() {
|
2387
2431
|
document.readyState !== "loading" && (e(), document.removeEventListener("DOMContentLoaded", t));
|
2388
2432
|
}
|
2389
2433
|
typeof window < "u" && typeof document < "u" && (document.addEventListener("DOMContentLoaded", t), t());
|
2390
2434
|
}
|
2391
|
-
let
|
2392
|
-
|
2435
|
+
let be = [];
|
2436
|
+
Xi(() => {
|
2393
2437
|
function e(t) {
|
2394
|
-
if (!(t.target instanceof HTMLElement) || t.target === document.body ||
|
2438
|
+
if (!(t.target instanceof HTMLElement) || t.target === document.body || be[0] === t.target) return;
|
2395
2439
|
let n = t.target;
|
2396
|
-
n = n.closest(
|
2440
|
+
n = n.closest(Gn), be.unshift(n ?? t.target), be = be.filter((o) => o != null && o.isConnected), be.splice(10);
|
2397
2441
|
}
|
2398
2442
|
window.addEventListener("click", e, { capture: !0 }), window.addEventListener("mousedown", e, { capture: !0 }), window.addEventListener("focus", e, { capture: !0 }), document.body.addEventListener("click", e, { capture: !0 }), document.body.addEventListener("mousedown", e, { capture: !0 }), document.body.addEventListener("focus", e, { capture: !0 });
|
2399
2443
|
});
|
2400
|
-
function
|
2444
|
+
function Ji(e) {
|
2401
2445
|
throw new Error("Unexpected object: " + e);
|
2402
2446
|
}
|
2403
|
-
var
|
2404
|
-
function
|
2447
|
+
var V = ((e) => (e[e.First = 0] = "First", e[e.Previous = 1] = "Previous", e[e.Next = 2] = "Next", e[e.Last = 3] = "Last", e[e.Specific = 4] = "Specific", e[e.Nothing = 5] = "Nothing", e))(V || {});
|
2448
|
+
function Qt(e, t) {
|
2405
2449
|
let n = t.resolveItems();
|
2406
2450
|
if (n.length <= 0) return null;
|
2407
2451
|
let o = t.resolveActiveIndex(), i = o ?? -1;
|
@@ -2430,35 +2474,35 @@ function Gt(e, t) {
|
|
2430
2474
|
case 5:
|
2431
2475
|
return null;
|
2432
2476
|
default:
|
2433
|
-
|
2477
|
+
Ji(e);
|
2434
2478
|
}
|
2435
2479
|
}
|
2436
|
-
var
|
2437
|
-
function
|
2438
|
-
let t =
|
2480
|
+
var It = ((e) => (e[e.Left = 0] = "Left", e[e.Right = 2] = "Right", e))(It || {});
|
2481
|
+
function Qi(e) {
|
2482
|
+
let t = M(e), n = J(!1);
|
2439
2483
|
oe(() => (n.current = !1, () => {
|
2440
|
-
n.current = !0,
|
2484
|
+
n.current = !0, An(() => {
|
2441
2485
|
n.current && t();
|
2442
2486
|
});
|
2443
2487
|
}), [t]);
|
2444
2488
|
}
|
2445
|
-
function
|
2489
|
+
function Zi() {
|
2446
2490
|
let e = typeof document > "u";
|
2447
|
-
return "useSyncExternalStore" in
|
2491
|
+
return "useSyncExternalStore" in w ? ((t) => t.useSyncExternalStore)(w)(() => () => {
|
2448
2492
|
}, () => !1, () => !e) : !1;
|
2449
2493
|
}
|
2450
|
-
function
|
2451
|
-
let e =
|
2452
|
-
return t && Le.isHandoffComplete === !1 && n(!1),
|
2494
|
+
function er() {
|
2495
|
+
let e = Zi(), [t, n] = w.useState(Le.isHandoffComplete);
|
2496
|
+
return t && Le.isHandoffComplete === !1 && n(!1), w.useEffect(() => {
|
2453
2497
|
t !== !0 && n(!0);
|
2454
|
-
}, [t]),
|
2498
|
+
}, [t]), w.useEffect(() => Le.handoff(), []), e ? !1 : t;
|
2455
2499
|
}
|
2456
|
-
let
|
2457
|
-
function
|
2458
|
-
return le(
|
2500
|
+
let tr = he(!1);
|
2501
|
+
function nr() {
|
2502
|
+
return le(tr);
|
2459
2503
|
}
|
2460
|
-
function
|
2461
|
-
let t =
|
2504
|
+
function or(e) {
|
2505
|
+
let t = nr(), n = le(Cn), o = nt(e), [i, r] = ce(() => {
|
2462
2506
|
var s;
|
2463
2507
|
if (!t && n !== null) return (s = n.current) != null ? s : null;
|
2464
2508
|
if (Le.isServer) return null;
|
@@ -2474,38 +2518,38 @@ function er(e) {
|
|
2474
2518
|
t || n !== null && r(n.current);
|
2475
2519
|
}, [n, r, t]), i;
|
2476
2520
|
}
|
2477
|
-
let
|
2478
|
-
let n = e, o =
|
2479
|
-
o.current =
|
2480
|
-
}), t), r = nt(o), s =
|
2481
|
-
var
|
2482
|
-
return Le.isServer ? null : (
|
2483
|
-
}), a = le(
|
2484
|
-
return
|
2521
|
+
let Rn = tt, ir = me(function(e, t) {
|
2522
|
+
let n = e, o = J(null), i = Oe($n((c) => {
|
2523
|
+
o.current = c;
|
2524
|
+
}), t), r = nt(o), s = or(o), [l] = ce(() => {
|
2525
|
+
var c;
|
2526
|
+
return Le.isServer ? null : (c = r == null ? void 0 : r.createElement("div")) != null ? c : null;
|
2527
|
+
}), a = le(ar), u = er();
|
2528
|
+
return U(() => {
|
2485
2529
|
!s || !l || s.contains(l) || (l.setAttribute("data-headlessui-portal", ""), s.appendChild(l));
|
2486
|
-
}, [s, l]),
|
2530
|
+
}, [s, l]), U(() => {
|
2487
2531
|
if (l && a) return a.register(l);
|
2488
|
-
}, [a, l]),
|
2489
|
-
var
|
2490
|
-
!s || !l || (l instanceof Node && s.contains(l) && s.removeChild(l), s.childNodes.length <= 0 && ((
|
2491
|
-
}),
|
2532
|
+
}, [a, l]), Qi(() => {
|
2533
|
+
var c;
|
2534
|
+
!s || !l || (l instanceof Node && s.contains(l) && s.removeChild(l), s.childNodes.length <= 0 && ((c = s.parentElement) == null || c.removeChild(s)));
|
2535
|
+
}), u ? !s || !l ? null : _n(pe({ ourProps: { ref: i }, theirProps: n, slot: {}, defaultTag: Rn, name: "Portal" }), l) : null;
|
2492
2536
|
});
|
2493
|
-
function
|
2494
|
-
let n =
|
2495
|
-
return o ?
|
2496
|
-
}
|
2497
|
-
let
|
2498
|
-
function
|
2499
|
-
let { target: n, ...o } = e, i = { ref:
|
2500
|
-
return
|
2501
|
-
}
|
2502
|
-
let
|
2503
|
-
var
|
2504
|
-
function
|
2505
|
-
let n = e.activeOptionIndex !== null ? e.options[e.activeOptionIndex] : null, o = t(e.options.slice()), i = o.length > 0 && o[0].dataRef.current.order !== null ? o.sort((s, l) => s.dataRef.current.order - l.dataRef.current.order) :
|
2537
|
+
function rr(e, t) {
|
2538
|
+
let n = Oe(t), { enabled: o = !0, ...i } = e;
|
2539
|
+
return o ? j.createElement(ir, { ...i, ref: n }) : pe({ ourProps: { ref: n }, theirProps: i, slot: {}, defaultTag: Rn, name: "Portal" });
|
2540
|
+
}
|
2541
|
+
let lr = tt, Cn = he(null);
|
2542
|
+
function sr(e, t) {
|
2543
|
+
let { target: n, ...o } = e, i = { ref: Oe(t) };
|
2544
|
+
return j.createElement(Cn.Provider, { value: n }, pe({ ourProps: i, theirProps: o, defaultTag: lr, name: "Popover.Group" }));
|
2545
|
+
}
|
2546
|
+
let ar = he(null), cr = me(rr), ur = me(sr), fr = Object.assign(cr, { Group: ur });
|
2547
|
+
var dr = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(dr || {}), mr = ((e) => (e[e.Single = 0] = "Single", e[e.Multi = 1] = "Multi", e))(mr || {}), pr = ((e) => (e[e.Pointer = 0] = "Pointer", e[e.Focus = 1] = "Focus", e[e.Other = 2] = "Other", e))(pr || {}), hr = ((e) => (e[e.OpenCombobox = 0] = "OpenCombobox", e[e.CloseCombobox = 1] = "CloseCombobox", e[e.GoToOption = 2] = "GoToOption", e[e.SetTyping = 3] = "SetTyping", e[e.RegisterOption = 4] = "RegisterOption", e[e.UnregisterOption = 5] = "UnregisterOption", e[e.SetActivationTrigger = 6] = "SetActivationTrigger", e[e.UpdateVirtualConfiguration = 7] = "UpdateVirtualConfiguration", e[e.SetInputElement = 8] = "SetInputElement", e[e.SetButtonElement = 9] = "SetButtonElement", e[e.SetOptionsElement = 10] = "SetOptionsElement", e))(hr || {});
|
2548
|
+
function mt(e, t = (n) => n) {
|
2549
|
+
let n = e.activeOptionIndex !== null ? e.options[e.activeOptionIndex] : null, o = t(e.options.slice()), i = o.length > 0 && o[0].dataRef.current.order !== null ? o.sort((s, l) => s.dataRef.current.order - l.dataRef.current.order) : Xn(o, (s) => s.dataRef.current.domRef.current), r = n ? i.indexOf(n) : null;
|
2506
2550
|
return r === -1 && (r = null), { options: i, activeOptionIndex: r };
|
2507
2551
|
}
|
2508
|
-
let
|
2552
|
+
let gr = { 1(e) {
|
2509
2553
|
var t;
|
2510
2554
|
return (t = e.dataRef.current) != null && t.disabled || e.comboboxState === 1 ? e : { ...e, activeOptionIndex: null, comboboxState: 1, isTyping: !1, activationTrigger: 2, __demoMode: !1 };
|
2511
2555
|
}, 0(e) {
|
@@ -2522,32 +2566,32 @@ let mr = { 1(e) {
|
|
2522
2566
|
var n, o, i, r;
|
2523
2567
|
if ((n = e.dataRef.current) != null && n.disabled || e.optionsElement && !((o = e.dataRef.current) != null && o.optionsPropsRef.current.static) && e.comboboxState === 1) return e;
|
2524
2568
|
if (e.virtual) {
|
2525
|
-
let { options:
|
2526
|
-
var
|
2527
|
-
return (m = (
|
2528
|
-
}, resolveDisabled:
|
2569
|
+
let { options: u, disabled: c } = e.virtual, d = t.focus === V.Specific ? t.idx : Qt(t, { resolveItems: () => u, resolveActiveIndex: () => {
|
2570
|
+
var f, m;
|
2571
|
+
return (m = (f = e.activeOptionIndex) != null ? f : u.findIndex((h) => !c(h))) != null ? m : null;
|
2572
|
+
}, resolveDisabled: c, resolveId() {
|
2529
2573
|
throw new Error("Function not implemented.");
|
2530
2574
|
} }), p = (i = t.trigger) != null ? i : 2;
|
2531
2575
|
return e.activeOptionIndex === d && e.activationTrigger === p ? e : { ...e, activeOptionIndex: d, activationTrigger: p, isTyping: !1, __demoMode: !1 };
|
2532
2576
|
}
|
2533
|
-
let s =
|
2577
|
+
let s = mt(e);
|
2534
2578
|
if (s.activeOptionIndex === null) {
|
2535
|
-
let
|
2536
|
-
|
2579
|
+
let u = s.options.findIndex((c) => !c.dataRef.current.disabled);
|
2580
|
+
u !== -1 && (s.activeOptionIndex = u);
|
2537
2581
|
}
|
2538
|
-
let l = t.focus ===
|
2582
|
+
let l = t.focus === V.Specific ? t.idx : Qt(t, { resolveItems: () => s.options, resolveActiveIndex: () => s.activeOptionIndex, resolveId: (u) => u.id, resolveDisabled: (u) => u.dataRef.current.disabled }), a = (r = t.trigger) != null ? r : 2;
|
2539
2583
|
return e.activeOptionIndex === l && e.activationTrigger === a ? e : { ...e, ...s, isTyping: !1, activeOptionIndex: l, activationTrigger: a, __demoMode: !1 };
|
2540
2584
|
}, 4: (e, t) => {
|
2541
2585
|
var n, o, i;
|
2542
2586
|
if ((n = e.dataRef.current) != null && n.virtual) return { ...e, options: [...e.options, t.payload] };
|
2543
|
-
let r = t.payload, s =
|
2587
|
+
let r = t.payload, s = mt(e, (a) => (a.push(r), a));
|
2544
2588
|
e.activeOptionIndex === null && (o = e.dataRef.current) != null && o.isSelected(t.payload.dataRef.current.value) && (s.activeOptionIndex = s.options.indexOf(r));
|
2545
2589
|
let l = { ...e, ...s, activationTrigger: 2 };
|
2546
2590
|
return (i = e.dataRef.current) != null && i.__demoMode && e.dataRef.current.value === void 0 && (l.activeOptionIndex = 0), l;
|
2547
2591
|
}, 5: (e, t) => {
|
2548
2592
|
var n;
|
2549
2593
|
if ((n = e.dataRef.current) != null && n.virtual) return { ...e, options: e.options.filter((i) => i.id !== t.id) };
|
2550
|
-
let o =
|
2594
|
+
let o = mt(e, (i) => {
|
2551
2595
|
let r = i.findIndex((s) => s.id === t.id);
|
2552
2596
|
return r !== -1 && i.splice(r, 1), i;
|
2553
2597
|
});
|
@@ -2562,294 +2606,291 @@ let mr = { 1(e) {
|
|
2562
2606
|
r !== -1 ? i = r : i = null;
|
2563
2607
|
}
|
2564
2608
|
return { ...e, activeOptionIndex: i, virtual: { options: t.options, disabled: (o = t.disabled) != null ? o : () => !1 } };
|
2565
|
-
}, 8: (e, t) => e.inputElement === t.element ? e : { ...e, inputElement: t.element }, 9: (e, t) => e.buttonElement === t.element ? e : { ...e, buttonElement: t.element }, 10: (e, t) => e.optionsElement === t.element ? e : { ...e, optionsElement: t.element } },
|
2566
|
-
|
2609
|
+
}, 8: (e, t) => e.inputElement === t.element ? e : { ...e, inputElement: t.element }, 9: (e, t) => e.buttonElement === t.element ? e : { ...e, buttonElement: t.element }, 10: (e, t) => e.optionsElement === t.element ? e : { ...e, optionsElement: t.element } }, Mt = he(null);
|
2610
|
+
Mt.displayName = "ComboboxActionsContext";
|
2567
2611
|
function Ye(e) {
|
2568
|
-
let t = le(
|
2612
|
+
let t = le(Mt);
|
2569
2613
|
if (t === null) {
|
2570
2614
|
let n = new Error(`<${e} /> is missing a parent <Combobox /> component.`);
|
2571
2615
|
throw Error.captureStackTrace && Error.captureStackTrace(n, Ye), n;
|
2572
2616
|
}
|
2573
2617
|
return t;
|
2574
2618
|
}
|
2575
|
-
let
|
2576
|
-
function
|
2577
|
-
let t =
|
2578
|
-
let
|
2579
|
-
if (!
|
2580
|
-
let
|
2581
|
-
return [parseFloat(
|
2582
|
-
}, [t.optionsElement]), r =
|
2619
|
+
let Tn = he(null);
|
2620
|
+
function vr(e) {
|
2621
|
+
let t = De("VirtualProvider"), { options: n } = t.virtual, [o, i] = X(() => {
|
2622
|
+
let u = t.optionsElement;
|
2623
|
+
if (!u) return [0, 0];
|
2624
|
+
let c = window.getComputedStyle(u);
|
2625
|
+
return [parseFloat(c.paddingBlockStart || c.paddingTop), parseFloat(c.paddingBlockEnd || c.paddingBottom)];
|
2626
|
+
}, [t.optionsElement]), r = vo({ enabled: n.length !== 0, scrollPaddingStart: o, scrollPaddingEnd: i, count: n.length, estimateSize() {
|
2583
2627
|
return 40;
|
2584
2628
|
}, getScrollElement() {
|
2585
2629
|
return t.optionsElement;
|
2586
|
-
}, overscan: 12 }), [s, l] =
|
2587
|
-
|
2588
|
-
l((
|
2630
|
+
}, overscan: 12 }), [s, l] = ce(0);
|
2631
|
+
U(() => {
|
2632
|
+
l((u) => u + 1);
|
2589
2633
|
}, [n]);
|
2590
2634
|
let a = r.getVirtualItems();
|
2591
|
-
return a.length === 0 ? null :
|
2592
|
-
|
2593
|
-
|
2594
|
-
|
2595
|
-
}
|
2596
|
-
} }, a.map((c) => {
|
2597
|
-
var f;
|
2598
|
-
return W.createElement(tt, { key: c.key }, W.cloneElement((f = e.children) == null ? void 0 : f.call(e, { ...e.slot, option: n[c.index] }), { key: `${s}-${c.key}`, "data-index": c.index, "aria-setsize": n.length, "aria-posinset": c.index + 1, style: { position: "absolute", top: 0, left: 0, transform: `translateY(${c.start}px)`, overflowAnchor: "none" } }));
|
2635
|
+
return a.length === 0 ? null : j.createElement(Tn.Provider, { value: r }, j.createElement("div", { style: { position: "relative", width: "100%", height: `${r.getTotalSize()}px` }, ref: (u) => {
|
2636
|
+
u && t.activationTrigger !== 0 && t.activeOptionIndex !== null && n.length > t.activeOptionIndex && r.scrollToIndex(t.activeOptionIndex);
|
2637
|
+
} }, a.map((u) => {
|
2638
|
+
var c;
|
2639
|
+
return j.createElement(tt, { key: u.key }, j.cloneElement((c = e.children) == null ? void 0 : c.call(e, { ...e.slot, option: n[u.index] }), { key: `${s}-${u.key}`, "data-index": u.index, "aria-setsize": n.length, "aria-posinset": u.index + 1, style: { position: "absolute", top: 0, left: 0, transform: `translateY(${u.start}px)`, overflowAnchor: "none" } }));
|
2599
2640
|
})));
|
2600
2641
|
}
|
2601
|
-
let Ve =
|
2642
|
+
let Ve = he(null);
|
2602
2643
|
Ve.displayName = "ComboboxDataContext";
|
2603
|
-
function
|
2644
|
+
function De(e) {
|
2604
2645
|
let t = le(Ve);
|
2605
2646
|
if (t === null) {
|
2606
2647
|
let n = new Error(`<${e} /> is missing a parent <Combobox /> component.`);
|
2607
|
-
throw Error.captureStackTrace && Error.captureStackTrace(n,
|
2648
|
+
throw Error.captureStackTrace && Error.captureStackTrace(n, De), n;
|
2608
2649
|
}
|
2609
2650
|
return t;
|
2610
2651
|
}
|
2611
|
-
function
|
2612
|
-
return Re(t.type,
|
2652
|
+
function br(e, t) {
|
2653
|
+
return Re(t.type, gr, e, t);
|
2613
2654
|
}
|
2614
|
-
let
|
2615
|
-
function
|
2655
|
+
let xr = tt;
|
2656
|
+
function wr(e, t) {
|
2616
2657
|
var n, o;
|
2617
|
-
let i =
|
2618
|
-
if (
|
2658
|
+
let i = Hn(), { value: r, defaultValue: s, onChange: l, form: a, name: u, by: c, disabled: d = i || !1, onClose: p, __demoMode: f = !1, multiple: m = !1, immediate: h = !1, virtual: g = null, nullable: v, ...y } = e, b = Vn(s), [E = m ? [] : void 0, O] = Bn(r, l, b), [C, T] = nn(br, { dataRef: Ln(), comboboxState: f ? 0 : 1, isTyping: !1, options: [], virtual: g ? { options: g.options, disabled: (n = g.disabled) != null ? n : () => !1 } : null, activeOptionIndex: null, activationTrigger: 2, inputElement: null, buttonElement: null, optionsElement: null, __demoMode: f }), S = J(!1), L = J({ static: !1, hold: !1 }), A = kn(c), D = M((I) => g ? c === null ? g.options.indexOf(I) : g.options.findIndex((N) => A(N, I)) : C.options.findIndex((N) => A(N.dataRef.current.value, I))), k = Ne((I) => Re(x.mode, { 1: () => E.some((N) => A(N, I)), 0: () => A(E, I) }), [E]), F = M((I) => C.activeOptionIndex === D(I)), x = X(() => ({ ...C, immediate: h, optionsPropsRef: L, value: E, defaultValue: b, disabled: d, mode: m ? 1 : 0, virtual: g ? C.virtual : null, get activeOptionIndex() {
|
2659
|
+
if (S.current && C.activeOptionIndex === null && (g ? g.options.length > 0 : C.options.length > 0)) {
|
2619
2660
|
if (g) {
|
2620
|
-
let
|
2621
|
-
var qe,
|
2622
|
-
return !((
|
2661
|
+
let N = g.options.findIndex((re) => {
|
2662
|
+
var qe, Pt;
|
2663
|
+
return !((Pt = (qe = g.disabled) == null ? void 0 : qe.call(g, re)) != null && Pt);
|
2623
2664
|
});
|
2624
|
-
if (
|
2665
|
+
if (N !== -1) return N;
|
2625
2666
|
}
|
2626
|
-
let
|
2627
|
-
if (
|
2667
|
+
let I = C.options.findIndex((N) => !N.dataRef.current.disabled);
|
2668
|
+
if (I !== -1) return I;
|
2628
2669
|
}
|
2629
|
-
return
|
2630
|
-
}, calculateIndex: D, compare:
|
2631
|
-
|
2632
|
-
var
|
2633
|
-
g &&
|
2634
|
-
}, [g, g == null ? void 0 : g.options, g == null ? void 0 : g.disabled]),
|
2635
|
-
|
2636
|
-
}, [
|
2637
|
-
let
|
2638
|
-
|
2639
|
-
let
|
2640
|
-
var
|
2641
|
-
return { open:
|
2642
|
-
}, [
|
2643
|
-
if (
|
2644
|
-
if (
|
2670
|
+
return C.activeOptionIndex;
|
2671
|
+
}, calculateIndex: D, compare: A, isSelected: k, isActive: F }), [E, b, d, m, f, C, g]);
|
2672
|
+
U(() => {
|
2673
|
+
var I;
|
2674
|
+
g && T({ type: 7, options: g.options, disabled: (I = g.disabled) != null ? I : null });
|
2675
|
+
}, [g, g == null ? void 0 : g.options, g == null ? void 0 : g.disabled]), U(() => {
|
2676
|
+
C.dataRef.current = x;
|
2677
|
+
}, [x]);
|
2678
|
+
let B = x.comboboxState === 0;
|
2679
|
+
Ro(B, [x.buttonElement, x.inputElement, x.optionsElement], () => Q.closeCombobox());
|
2680
|
+
let _ = X(() => {
|
2681
|
+
var I, N, re;
|
2682
|
+
return { open: x.comboboxState === 0, disabled: d, activeIndex: x.activeOptionIndex, activeOption: x.activeOptionIndex === null ? null : x.virtual ? x.virtual.options[(I = x.activeOptionIndex) != null ? I : 0] : (re = (N = x.options[x.activeOptionIndex]) == null ? void 0 : N.dataRef.current.value) != null ? re : null, value: E };
|
2683
|
+
}, [x, d, E]), z = M(() => {
|
2684
|
+
if (x.activeOptionIndex !== null) {
|
2685
|
+
if (Q.setIsTyping(!1), x.virtual) R(x.virtual.options[x.activeOptionIndex]);
|
2645
2686
|
else {
|
2646
|
-
let { dataRef:
|
2647
|
-
R(
|
2687
|
+
let { dataRef: I } = x.options[x.activeOptionIndex];
|
2688
|
+
R(I.current.value);
|
2648
2689
|
}
|
2649
|
-
|
2690
|
+
Q.goToOption(V.Specific, x.activeOptionIndex);
|
2650
2691
|
}
|
2651
|
-
}),
|
2652
|
-
|
2653
|
-
}),
|
2654
|
-
|
2655
|
-
}),
|
2656
|
-
|
2657
|
-
}),
|
2658
|
-
|
2659
|
-
})), R =
|
2660
|
-
return O == null ? void 0 : O(
|
2692
|
+
}), P = M(() => {
|
2693
|
+
T({ type: 0 }), S.current = !0;
|
2694
|
+
}), $ = M(() => {
|
2695
|
+
T({ type: 1 }), S.current = !1, p == null || p();
|
2696
|
+
}), H = M((I) => {
|
2697
|
+
T({ type: 3, isTyping: I });
|
2698
|
+
}), Y = M((I, N, re) => (S.current = !1, I === V.Specific ? T({ type: 2, focus: V.Specific, idx: N, trigger: re }) : T({ type: 2, focus: I, trigger: re }))), ge = M((I, N) => (T({ type: 4, payload: { id: I, dataRef: N } }), () => {
|
2699
|
+
x.isActive(N.current.value) && (S.current = !0), T({ type: 5, id: I });
|
2700
|
+
})), R = M((I) => Re(x.mode, { 0() {
|
2701
|
+
return O == null ? void 0 : O(I);
|
2661
2702
|
}, 1() {
|
2662
|
-
let
|
2663
|
-
return re === -1 ?
|
2664
|
-
} })), te =
|
2665
|
-
|
2666
|
-
}),
|
2667
|
-
|
2668
|
-
}), ne =
|
2669
|
-
|
2670
|
-
}),
|
2671
|
-
|
2672
|
-
}),
|
2703
|
+
let N = x.value.slice(), re = N.findIndex((qe) => A(qe, I));
|
2704
|
+
return re === -1 ? N.push(I) : N.splice(re, 1), O == null ? void 0 : O(N);
|
2705
|
+
} })), te = M((I) => {
|
2706
|
+
T({ type: 6, trigger: I });
|
2707
|
+
}), q = M((I) => {
|
2708
|
+
T({ type: 8, element: I });
|
2709
|
+
}), ne = M((I) => {
|
2710
|
+
T({ type: 9, element: I });
|
2711
|
+
}), W = M((I) => {
|
2712
|
+
T({ type: 10, element: I });
|
2713
|
+
}), Q = X(() => ({ onChange: R, registerOption: ge, goToOption: Y, setIsTyping: H, closeCombobox: $, openCombobox: P, setActivationTrigger: te, selectActiveOption: z, setInputElement: q, setButtonElement: ne, setOptionsElement: W }), []), [ve, In] = Wn(), Mn = t === null ? {} : { ref: t }, Pn = Ne(() => {
|
2673
2714
|
if (b !== void 0) return O == null ? void 0 : O(b);
|
2674
2715
|
}, [O, b]);
|
2675
|
-
return
|
2716
|
+
return j.createElement(In, { value: ve, props: { htmlFor: (o = x.inputElement) == null ? void 0 : o.id }, slot: { open: x.comboboxState === 0, disabled: d } }, j.createElement(Yi, null, j.createElement(Mt.Provider, { value: Q }, j.createElement(Ve.Provider, { value: x }, j.createElement(Qn, { value: Re(x.comboboxState, { 0: Je.Open, 1: Je.Closed }) }, u != null && j.createElement(jn, { disabled: d, data: E != null ? { [u]: E } : {}, form: a, onReset: Pn }), pe({ ourProps: Mn, theirProps: y, slot: _, defaultTag: xr, name: "Combobox" }))))));
|
2676
2717
|
}
|
2677
|
-
let
|
2678
|
-
function
|
2718
|
+
let yr = "input";
|
2719
|
+
function Er(e, t) {
|
2679
2720
|
var n, o, i, r, s;
|
2680
|
-
let l =
|
2681
|
-
a.onChange(null), l.optionsElement && (l.optionsElement.scrollTop = 0), a.goToOption(
|
2682
|
-
}),
|
2721
|
+
let l = De("Combobox.Input"), a = Ye("Combobox.Input"), u = Be(), c = Un(), { id: d = c || `headlessui-combobox-input-${u}`, onChange: p, displayValue: f, disabled: m = l.disabled || !1, autoFocus: h = !1, type: g = "text", ...v } = e, y = J(null), b = Oe(y, t, Wi(), a.setInputElement), E = nt(l.inputElement), O = Zt(), C = M(() => {
|
2722
|
+
a.onChange(null), l.optionsElement && (l.optionsElement.scrollTop = 0), a.goToOption(V.Nothing);
|
2723
|
+
}), T = X(() => {
|
2683
2724
|
var R;
|
2684
|
-
return typeof
|
2685
|
-
}, [l.value,
|
2686
|
-
|
2725
|
+
return typeof f == "function" && l.value !== void 0 ? (R = f(l.value)) != null ? R : "" : typeof l.value == "string" ? l.value : "";
|
2726
|
+
}, [l.value, f]);
|
2727
|
+
kt(([R, te], [q, ne]) => {
|
2687
2728
|
if (l.isTyping) return;
|
2688
|
-
let
|
2689
|
-
|
2690
|
-
if (l.isTyping || !
|
2691
|
-
let { selectionStart:
|
2692
|
-
Math.abs((
|
2729
|
+
let W = y.current;
|
2730
|
+
W && ((ne === 0 && te === 1 || R !== q) && (W.value = R), requestAnimationFrame(() => {
|
2731
|
+
if (l.isTyping || !W || (E == null ? void 0 : E.activeElement) !== W) return;
|
2732
|
+
let { selectionStart: Q, selectionEnd: ve } = W;
|
2733
|
+
Math.abs((ve ?? 0) - (Q ?? 0)) === 0 && Q === 0 && W.setSelectionRange(W.value.length, W.value.length);
|
2693
2734
|
}));
|
2694
|
-
}, [
|
2735
|
+
}, [T, l.comboboxState, E, l.isTyping]), kt(([R], [te]) => {
|
2695
2736
|
if (R === 0 && te === 1) {
|
2696
2737
|
if (l.isTyping) return;
|
2697
|
-
let
|
2698
|
-
if (!
|
2699
|
-
let ne =
|
2700
|
-
|
2738
|
+
let q = y.current;
|
2739
|
+
if (!q) return;
|
2740
|
+
let ne = q.value, { selectionStart: W, selectionEnd: Q, selectionDirection: ve } = q;
|
2741
|
+
q.value = "", q.value = ne, ve !== null ? q.setSelectionRange(W, Q, ve) : q.setSelectionRange(W, Q);
|
2701
2742
|
}
|
2702
2743
|
}, [l.comboboxState]);
|
2703
|
-
let
|
2704
|
-
|
2705
|
-
}),
|
2744
|
+
let S = J(!1), L = M(() => {
|
2745
|
+
S.current = !0;
|
2746
|
+
}), A = M(() => {
|
2706
2747
|
O.nextFrame(() => {
|
2707
|
-
|
2748
|
+
S.current = !1;
|
2708
2749
|
});
|
2709
|
-
}), D =
|
2750
|
+
}), D = M((R) => {
|
2710
2751
|
switch (a.setIsTyping(!0), R.key) {
|
2711
|
-
case
|
2712
|
-
if (l.comboboxState !== 0 ||
|
2752
|
+
case Z.Enter:
|
2753
|
+
if (l.comboboxState !== 0 || S.current) return;
|
2713
2754
|
if (R.preventDefault(), R.stopPropagation(), l.activeOptionIndex === null) {
|
2714
2755
|
a.closeCombobox();
|
2715
2756
|
return;
|
2716
2757
|
}
|
2717
2758
|
a.selectActiveOption(), l.mode === 0 && a.closeCombobox();
|
2718
2759
|
break;
|
2719
|
-
case
|
2720
|
-
return R.preventDefault(), R.stopPropagation(), Re(l.comboboxState, { 0: () => a.goToOption(
|
2721
|
-
case
|
2722
|
-
return R.preventDefault(), R.stopPropagation(), Re(l.comboboxState, { 0: () => a.goToOption(
|
2723
|
-
|
2760
|
+
case Z.ArrowDown:
|
2761
|
+
return R.preventDefault(), R.stopPropagation(), Re(l.comboboxState, { 0: () => a.goToOption(V.Next), 1: () => a.openCombobox() });
|
2762
|
+
case Z.ArrowUp:
|
2763
|
+
return R.preventDefault(), R.stopPropagation(), Re(l.comboboxState, { 0: () => a.goToOption(V.Previous), 1: () => {
|
2764
|
+
xe(() => a.openCombobox()), l.value || a.goToOption(V.Last);
|
2724
2765
|
} });
|
2725
|
-
case
|
2766
|
+
case Z.Home:
|
2726
2767
|
if (R.shiftKey) break;
|
2727
|
-
return R.preventDefault(), R.stopPropagation(), a.goToOption(
|
2728
|
-
case
|
2729
|
-
return R.preventDefault(), R.stopPropagation(), a.goToOption(
|
2730
|
-
case
|
2768
|
+
return R.preventDefault(), R.stopPropagation(), a.goToOption(V.First);
|
2769
|
+
case Z.PageUp:
|
2770
|
+
return R.preventDefault(), R.stopPropagation(), a.goToOption(V.First);
|
2771
|
+
case Z.End:
|
2731
2772
|
if (R.shiftKey) break;
|
2732
|
-
return R.preventDefault(), R.stopPropagation(), a.goToOption(
|
2733
|
-
case
|
2734
|
-
return R.preventDefault(), R.stopPropagation(), a.goToOption(
|
2735
|
-
case
|
2736
|
-
return l.comboboxState !== 0 ? void 0 : (R.preventDefault(), l.optionsElement && !l.optionsPropsRef.current.static && R.stopPropagation(), l.mode === 0 && l.value === null &&
|
2737
|
-
case
|
2773
|
+
return R.preventDefault(), R.stopPropagation(), a.goToOption(V.Last);
|
2774
|
+
case Z.PageDown:
|
2775
|
+
return R.preventDefault(), R.stopPropagation(), a.goToOption(V.Last);
|
2776
|
+
case Z.Escape:
|
2777
|
+
return l.comboboxState !== 0 ? void 0 : (R.preventDefault(), l.optionsElement && !l.optionsPropsRef.current.static && R.stopPropagation(), l.mode === 0 && l.value === null && C(), a.closeCombobox());
|
2778
|
+
case Z.Tab:
|
2738
2779
|
if (l.comboboxState !== 0) return;
|
2739
2780
|
l.mode === 0 && l.activationTrigger !== 1 && a.selectActiveOption(), a.closeCombobox();
|
2740
2781
|
break;
|
2741
2782
|
}
|
2742
|
-
}), k =
|
2743
|
-
p == null || p(R), l.mode === 0 && R.target.value === "" &&
|
2744
|
-
}),
|
2745
|
-
var te,
|
2746
|
-
let
|
2747
|
-
if (!((
|
2748
|
-
}),
|
2749
|
-
var te,
|
2750
|
-
let
|
2751
|
-
(
|
2752
|
-
|
2783
|
+
}), k = M((R) => {
|
2784
|
+
p == null || p(R), l.mode === 0 && R.target.value === "" && C(), a.openCombobox();
|
2785
|
+
}), F = M((R) => {
|
2786
|
+
var te, q, ne;
|
2787
|
+
let W = (te = R.relatedTarget) != null ? te : be.find((Q) => Q !== R.currentTarget);
|
2788
|
+
if (!((q = l.optionsElement) != null && q.contains(W)) && !((ne = l.buttonElement) != null && ne.contains(W)) && l.comboboxState === 0) return R.preventDefault(), l.mode === 0 && l.value === null && C(), a.closeCombobox();
|
2789
|
+
}), x = M((R) => {
|
2790
|
+
var te, q, ne;
|
2791
|
+
let W = (te = R.relatedTarget) != null ? te : be.find((Q) => Q !== R.currentTarget);
|
2792
|
+
(q = l.buttonElement) != null && q.contains(W) || (ne = l.optionsElement) != null && ne.contains(W) || l.disabled || l.immediate && l.comboboxState !== 0 && O.microTask(() => {
|
2793
|
+
xe(() => a.openCombobox()), a.setActivationTrigger(1);
|
2753
2794
|
});
|
2754
|
-
}),
|
2755
|
-
return
|
2795
|
+
}), B = Et(), _ = Yn(), { isFocused: z, focusProps: P } = en({ autoFocus: h }), { isHovered: $, hoverProps: H } = tn({ isDisabled: m }), Y = X(() => ({ open: l.comboboxState === 0, disabled: m, hover: $, focus: z, autofocus: h }), [l, $, z, h, m]), ge = yt({ ref: b, id: d, role: "combobox", type: g, "aria-controls": (n = l.optionsElement) == null ? void 0 : n.id, "aria-expanded": l.comboboxState === 0, "aria-activedescendant": l.activeOptionIndex === null ? void 0 : l.virtual ? (o = l.options.find((R) => !R.dataRef.current.disabled && l.compare(R.dataRef.current.value, l.virtual.options[l.activeOptionIndex]))) == null ? void 0 : o.id : (i = l.options[l.activeOptionIndex]) == null ? void 0 : i.id, "aria-labelledby": B, "aria-describedby": _, "aria-autocomplete": "list", defaultValue: (s = (r = e.defaultValue) != null ? r : l.defaultValue !== void 0 ? f == null ? void 0 : f(l.defaultValue) : null) != null ? s : l.defaultValue, disabled: m || void 0, autoFocus: h, onCompositionStart: L, onCompositionEnd: A, onKeyDown: D, onChange: k, onFocus: x, onBlur: F }, P, H);
|
2796
|
+
return pe({ ourProps: ge, theirProps: v, slot: Y, defaultTag: yr, name: "Combobox.Input" });
|
2756
2797
|
}
|
2757
|
-
let
|
2758
|
-
function
|
2798
|
+
let Or = "button";
|
2799
|
+
function Sr(e, t) {
|
2759
2800
|
var n;
|
2760
|
-
let o =
|
2761
|
-
switch (
|
2762
|
-
case
|
2763
|
-
case
|
2764
|
-
|
2801
|
+
let o = De("Combobox.Button"), i = Ye("Combobox.Button"), r = Oe(t, i.setButtonElement), s = Dn(), l = Be(), { id: a = `headlessui-combobox-button-${l}`, disabled: u = o.disabled || !1, autoFocus: c = !1, ...d } = e, p = un(o.inputElement), f = M((S) => {
|
2802
|
+
switch (S.key) {
|
2803
|
+
case Z.Space:
|
2804
|
+
case Z.Enter:
|
2805
|
+
S.preventDefault(), S.stopPropagation(), o.comboboxState === 1 && xe(() => i.openCombobox()), p();
|
2765
2806
|
return;
|
2766
|
-
case
|
2767
|
-
|
2807
|
+
case Z.ArrowDown:
|
2808
|
+
S.preventDefault(), S.stopPropagation(), o.comboboxState === 1 && (xe(() => i.openCombobox()), o.value || i.goToOption(V.First)), p();
|
2768
2809
|
return;
|
2769
|
-
case
|
2770
|
-
|
2810
|
+
case Z.ArrowUp:
|
2811
|
+
S.preventDefault(), S.stopPropagation(), o.comboboxState === 1 && (xe(() => i.openCombobox()), o.value || i.goToOption(V.Last)), p();
|
2771
2812
|
return;
|
2772
|
-
case
|
2813
|
+
case Z.Escape:
|
2773
2814
|
if (o.comboboxState !== 0) return;
|
2774
|
-
|
2815
|
+
S.preventDefault(), o.optionsElement && !o.optionsPropsRef.current.static && S.stopPropagation(), xe(() => i.closeCombobox()), p();
|
2775
2816
|
return;
|
2776
2817
|
default:
|
2777
2818
|
return;
|
2778
2819
|
}
|
2779
|
-
}), m =
|
2780
|
-
|
2781
|
-
}), h =
|
2782
|
-
return
|
2820
|
+
}), m = M((S) => {
|
2821
|
+
S.preventDefault(), !no(S.currentTarget) && (S.button === It.Left && (o.comboboxState === 0 ? i.closeCombobox() : i.openCombobox()), p());
|
2822
|
+
}), h = Et([a]), { isFocusVisible: g, focusProps: v } = en({ autoFocus: c }), { isHovered: y, hoverProps: b } = tn({ isDisabled: u }), { pressed: E, pressProps: O } = Nn({ disabled: u }), C = X(() => ({ open: o.comboboxState === 0, active: E || o.comboboxState === 0, disabled: u, value: o.value, hover: y, focus: g }), [o, y, g, E, u]), T = yt({ ref: r, id: a, type: Jn(e, o.buttonElement), tabIndex: -1, "aria-haspopup": "listbox", "aria-controls": (n = o.optionsElement) == null ? void 0 : n.id, "aria-expanded": o.comboboxState === 0, "aria-labelledby": h, disabled: u || void 0, autoFocus: c, onMouseDown: m, onKeyDown: f }, v, b, O);
|
2823
|
+
return pe({ mergeRefs: s, ourProps: T, theirProps: d, slot: C, defaultTag: Or, name: "Combobox.Button" });
|
2783
2824
|
}
|
2784
|
-
let
|
2785
|
-
function
|
2825
|
+
let Rr = "div", Cr = At.RenderStrategy | At.Static;
|
2826
|
+
function Tr(e, t) {
|
2786
2827
|
var n, o, i;
|
2787
|
-
let r =
|
2788
|
-
h && (
|
2789
|
-
let [g, v] =
|
2790
|
-
|
2791
|
-
let
|
2792
|
-
|
2793
|
-
let D =
|
2794
|
-
|
2795
|
-
var
|
2796
|
-
|
2797
|
-
}, [
|
2798
|
-
|
2799
|
-
}, [
|
2800
|
-
return
|
2801
|
-
}, walk(
|
2802
|
-
|
2828
|
+
let r = Be(), { id: s = `headlessui-combobox-options-${r}`, hold: l = !1, anchor: a, portal: u = !1, modal: c = !0, transition: d = !1, ...p } = e, f = De("Combobox.Options"), m = Ye("Combobox.Options"), h = Bi(a);
|
2829
|
+
h && (u = !0);
|
2830
|
+
let [g, v] = Ui(h), [y, b] = ce(null), E = ji(), O = Oe(t, h ? g : null, m.setOptionsElement, b), C = nt(f.optionsElement), T = Zn(), [S, L] = eo(d, y, T !== null ? (T & Je.Open) === Je.Open : f.comboboxState === 0);
|
2831
|
+
Eo(S, f.inputElement, m.closeCombobox);
|
2832
|
+
let A = f.__demoMode ? !1 : c && f.comboboxState === 0;
|
2833
|
+
$o(A, C);
|
2834
|
+
let D = f.__demoMode ? !1 : c && f.comboboxState === 0;
|
2835
|
+
yo(D, { allowed: Ne(() => [f.inputElement, f.buttonElement, f.optionsElement], [f.inputElement, f.buttonElement, f.optionsElement]) }), U(() => {
|
2836
|
+
var Y;
|
2837
|
+
f.optionsPropsRef.current.static = (Y = e.static) != null ? Y : !1;
|
2838
|
+
}, [f.optionsPropsRef, e.static]), U(() => {
|
2839
|
+
f.optionsPropsRef.current.hold = l;
|
2840
|
+
}, [f.optionsPropsRef, l]), Fo(f.comboboxState === 0, { container: f.optionsElement, accept(Y) {
|
2841
|
+
return Y.getAttribute("role") === "option" ? NodeFilter.FILTER_REJECT : Y.hasAttribute("role") ? NodeFilter.FILTER_SKIP : NodeFilter.FILTER_ACCEPT;
|
2842
|
+
}, walk(Y) {
|
2843
|
+
Y.setAttribute("role", "none");
|
2803
2844
|
} });
|
2804
|
-
let k =
|
2845
|
+
let k = Et([(n = f.buttonElement) == null ? void 0 : n.id]), F = X(() => ({ open: f.comboboxState === 0, option: void 0 }), [f.comboboxState]), x = M(() => {
|
2805
2846
|
m.setActivationTrigger(0);
|
2806
|
-
}),
|
2807
|
-
|
2808
|
-
}),
|
2809
|
-
if (
|
2810
|
-
if (
|
2811
|
-
Object.assign(p, { children:
|
2847
|
+
}), B = M((Y) => {
|
2848
|
+
Y.preventDefault(), m.setActivationTrigger(0);
|
2849
|
+
}), _ = yt(h ? E() : {}, { "aria-labelledby": k, role: "listbox", "aria-multiselectable": f.mode === 1 ? !0 : void 0, id: s, ref: O, style: { ...p.style, ...v, "--input-width": Dt(f.inputElement, !0).width, "--button-width": Dt(f.buttonElement, !0).width }, onWheel: f.activationTrigger === 0 ? void 0 : x, onMouseDown: B, ...to(L) }), z = S && f.comboboxState === 1, P = xt(z, (o = f.virtual) == null ? void 0 : o.options), $ = xt(z, f.value), H = M((Y) => f.compare($, Y));
|
2850
|
+
if (f.virtual) {
|
2851
|
+
if (P === void 0) throw new Error("Missing `options` in virtual mode");
|
2852
|
+
Object.assign(p, { children: j.createElement(Ve.Provider, { value: P !== f.virtual.options ? { ...f, virtual: { ...f.virtual, options: P } } : f }, j.createElement(vr, { slot: F }, p.children)) });
|
2812
2853
|
}
|
2813
|
-
return
|
2854
|
+
return j.createElement(fr, { enabled: u ? e.static || S : !1 }, j.createElement(Ve.Provider, { value: f.mode === 1 ? f : { ...f, isSelected: H } }, pe({ ourProps: _, theirProps: { ...p, children: j.createElement(Gi, { freeze: z }, typeof p.children == "function" ? (i = p.children) == null ? void 0 : i.call(p, F) : p.children) }, slot: F, defaultTag: Rr, features: Cr, visible: S, name: "Combobox.Options" })));
|
2814
2855
|
}
|
2815
|
-
let
|
2816
|
-
function
|
2856
|
+
let Ir = "div";
|
2857
|
+
function Mr(e, t) {
|
2817
2858
|
var n, o, i, r;
|
2818
|
-
let s =
|
2819
|
-
l.setIsTyping(!1), l.onChange(
|
2859
|
+
let s = De("Combobox.Option"), l = Ye("Combobox.Option"), a = Be(), { id: u = `headlessui-combobox-option-${a}`, value: c, disabled: d = (i = (o = (n = s.virtual) == null ? void 0 : n.disabled) == null ? void 0 : o.call(n, c)) != null ? i : !1, order: p = null, ...f } = e, m = un(s.inputElement), h = s.virtual ? s.activeOptionIndex === s.calculateIndex(c) : s.activeOptionIndex === null ? !1 : ((r = s.options[s.activeOptionIndex]) == null ? void 0 : r.id) === u, g = s.isSelected(c), v = J(null), y = Pe({ disabled: d, value: c, domRef: v, order: p }), b = le(Tn), E = Oe(t, v, b ? b.measureElement : null), O = M(() => {
|
2860
|
+
l.setIsTyping(!1), l.onChange(c);
|
2820
2861
|
});
|
2821
|
-
|
2822
|
-
let
|
2823
|
-
|
2862
|
+
U(() => l.registerOption(u, y), [y, u]);
|
2863
|
+
let C = J(!(s.virtual || s.__demoMode));
|
2864
|
+
U(() => {
|
2824
2865
|
if (!s.virtual && !s.__demoMode) return Te().requestAnimationFrame(() => {
|
2825
|
-
|
2866
|
+
C.current = !0;
|
2826
2867
|
});
|
2827
|
-
}, [s.virtual, s.__demoMode]),
|
2828
|
-
if (
|
2829
|
-
var
|
2830
|
-
(
|
2868
|
+
}, [s.virtual, s.__demoMode]), U(() => {
|
2869
|
+
if (C.current && s.comboboxState === 0 && h && s.activationTrigger !== 0) return Te().requestAnimationFrame(() => {
|
2870
|
+
var x, B;
|
2871
|
+
(B = (x = v.current) == null ? void 0 : x.scrollIntoView) == null || B.call(x, { block: "nearest" });
|
2831
2872
|
});
|
2832
2873
|
}, [v, h, s.comboboxState, s.activationTrigger, s.activeOptionIndex]);
|
2833
|
-
let
|
2834
|
-
|
2835
|
-
}),
|
2836
|
-
if (d) return l.goToOption(
|
2837
|
-
let
|
2838
|
-
l.goToOption(
|
2839
|
-
}),
|
2840
|
-
if (!
|
2841
|
-
let
|
2842
|
-
l.goToOption(
|
2843
|
-
}), k =
|
2844
|
-
|
2845
|
-
}),
|
2846
|
-
return
|
2847
|
-
}
|
2848
|
-
let
|
2874
|
+
let T = M((x) => {
|
2875
|
+
x.preventDefault(), x.button === It.Left && (d || (O(), cn() || requestAnimationFrame(() => m()), s.mode === 0 && l.closeCombobox()));
|
2876
|
+
}), S = M(() => {
|
2877
|
+
if (d) return l.goToOption(V.Nothing);
|
2878
|
+
let x = s.calculateIndex(c);
|
2879
|
+
l.goToOption(V.Specific, x);
|
2880
|
+
}), L = Do(), A = M((x) => L.update(x)), D = M((x) => {
|
2881
|
+
if (!L.wasMoved(x) || d || h) return;
|
2882
|
+
let B = s.calculateIndex(c);
|
2883
|
+
l.goToOption(V.Specific, B, 0);
|
2884
|
+
}), k = M((x) => {
|
2885
|
+
L.wasMoved(x) && (d || h && (s.optionsPropsRef.current.hold || l.goToOption(V.Nothing)));
|
2886
|
+
}), F = X(() => ({ active: h, focus: h, selected: g, disabled: d }), [h, g, d]);
|
2887
|
+
return pe({ ourProps: { id: u, ref: E, role: "option", tabIndex: d === !0 ? void 0 : -1, "aria-disabled": d === !0 ? !0 : void 0, "aria-selected": g, disabled: void 0, onMouseDown: T, onFocus: S, onPointerEnter: A, onMouseEnter: A, onPointerMove: D, onMouseMove: D, onPointerLeave: k, onMouseLeave: k }, theirProps: f, slot: F, defaultTag: Ir, name: "Combobox.Option" });
|
2888
|
+
}
|
2889
|
+
let Pr = me(wr), Ar = me(Sr), $r = me(Er), Dr = zn, Fr = me(Tr), Lr = me(Mr), qr = Object.assign(Pr, { Input: $r, Button: Ar, Label: Dr, Options: Fr, Option: Lr });
|
2849
2890
|
export {
|
2850
|
-
|
2851
|
-
|
2852
|
-
|
2853
|
-
|
2854
|
-
|
2891
|
+
$r as G,
|
2892
|
+
qr as H,
|
2893
|
+
Fr as K,
|
2894
|
+
Ar as U,
|
2895
|
+
Lr as j
|
2855
2896
|
};
|