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