@pittorica/dialog-react 0.22.0
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/LICENSE +21 -0
- package/README.md +84 -0
- package/dist/Dialog.d.ts +34 -0
- package/dist/Dialog.d.ts.map +1 -0
- package/dist/Dialog.stories.d.ts +8 -0
- package/dist/Dialog.stories.d.ts.map +1 -0
- package/dist/Dialog.test.d.ts +5 -0
- package/dist/Dialog.test.d.ts.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1981 -0
- package/package.json +44 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1981 @@
|
|
|
1
|
+
import { jsx as Y, jsxs as pt, Fragment as yt } from "react/jsx-runtime";
|
|
2
|
+
import * as ir from "react";
|
|
3
|
+
import X, { useState as fe, createContext as Sr, forwardRef as Pr, useRef as xe, useCallback as pe, useEffect as we, useMemo as mt, Fragment as bt, PureComponent as ht, useId as ur, useLayoutEffect as gt, useContext as Et } from "react";
|
|
4
|
+
import { createPortal as Tt } from "react-dom";
|
|
5
|
+
function Ot(e, r) {
|
|
6
|
+
if (e == null) return {};
|
|
7
|
+
var t = {};
|
|
8
|
+
for (var n in e) if ({}.hasOwnProperty.call(e, n)) {
|
|
9
|
+
if (r.indexOf(n) !== -1) continue;
|
|
10
|
+
t[n] = e[n];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
}
|
|
14
|
+
function me() {
|
|
15
|
+
return me = Object.assign ? Object.assign.bind() : function(e) {
|
|
16
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
17
|
+
var t = arguments[r];
|
|
18
|
+
for (var n in t) ({}).hasOwnProperty.call(t, n) && (e[n] = t[n]);
|
|
19
|
+
}
|
|
20
|
+
return e;
|
|
21
|
+
}, me.apply(null, arguments);
|
|
22
|
+
}
|
|
23
|
+
function xt(e) {
|
|
24
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
25
|
+
}
|
|
26
|
+
var ke = { exports: {} }, Oe = { exports: {} }, N = {};
|
|
27
|
+
/** @license React v16.13.1
|
|
28
|
+
* react-is.production.min.js
|
|
29
|
+
*
|
|
30
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the MIT license found in the
|
|
33
|
+
* LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/
|
|
35
|
+
var cr;
|
|
36
|
+
function wt() {
|
|
37
|
+
if (cr) return N;
|
|
38
|
+
cr = 1;
|
|
39
|
+
var e = typeof Symbol == "function" && Symbol.for, r = e ? Symbol.for("react.element") : 60103, t = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, o = e ? Symbol.for("react.strict_mode") : 60108, a = e ? Symbol.for("react.profiler") : 60114, i = e ? Symbol.for("react.provider") : 60109, u = e ? Symbol.for("react.context") : 60110, b = e ? Symbol.for("react.async_mode") : 60111, f = e ? Symbol.for("react.concurrent_mode") : 60111, v = e ? Symbol.for("react.forward_ref") : 60112, d = e ? Symbol.for("react.suspense") : 60113, p = e ? Symbol.for("react.suspense_list") : 60120, h = e ? Symbol.for("react.memo") : 60115, g = e ? Symbol.for("react.lazy") : 60116, m = e ? Symbol.for("react.block") : 60121, E = e ? Symbol.for("react.fundamental") : 60117, C = e ? Symbol.for("react.responder") : 60118, $ = e ? Symbol.for("react.scope") : 60119;
|
|
40
|
+
function O(s) {
|
|
41
|
+
if (typeof s == "object" && s !== null) {
|
|
42
|
+
var k = s.$$typeof;
|
|
43
|
+
switch (k) {
|
|
44
|
+
case r:
|
|
45
|
+
switch (s = s.type, s) {
|
|
46
|
+
case b:
|
|
47
|
+
case f:
|
|
48
|
+
case n:
|
|
49
|
+
case a:
|
|
50
|
+
case o:
|
|
51
|
+
case d:
|
|
52
|
+
return s;
|
|
53
|
+
default:
|
|
54
|
+
switch (s = s && s.$$typeof, s) {
|
|
55
|
+
case u:
|
|
56
|
+
case v:
|
|
57
|
+
case g:
|
|
58
|
+
case h:
|
|
59
|
+
case i:
|
|
60
|
+
return s;
|
|
61
|
+
default:
|
|
62
|
+
return k;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
case t:
|
|
66
|
+
return k;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function F(s) {
|
|
71
|
+
return O(s) === f;
|
|
72
|
+
}
|
|
73
|
+
return N.AsyncMode = b, N.ConcurrentMode = f, N.ContextConsumer = u, N.ContextProvider = i, N.Element = r, N.ForwardRef = v, N.Fragment = n, N.Lazy = g, N.Memo = h, N.Portal = t, N.Profiler = a, N.StrictMode = o, N.Suspense = d, N.isAsyncMode = function(s) {
|
|
74
|
+
return F(s) || O(s) === b;
|
|
75
|
+
}, N.isConcurrentMode = F, N.isContextConsumer = function(s) {
|
|
76
|
+
return O(s) === u;
|
|
77
|
+
}, N.isContextProvider = function(s) {
|
|
78
|
+
return O(s) === i;
|
|
79
|
+
}, N.isElement = function(s) {
|
|
80
|
+
return typeof s == "object" && s !== null && s.$$typeof === r;
|
|
81
|
+
}, N.isForwardRef = function(s) {
|
|
82
|
+
return O(s) === v;
|
|
83
|
+
}, N.isFragment = function(s) {
|
|
84
|
+
return O(s) === n;
|
|
85
|
+
}, N.isLazy = function(s) {
|
|
86
|
+
return O(s) === g;
|
|
87
|
+
}, N.isMemo = function(s) {
|
|
88
|
+
return O(s) === h;
|
|
89
|
+
}, N.isPortal = function(s) {
|
|
90
|
+
return O(s) === t;
|
|
91
|
+
}, N.isProfiler = function(s) {
|
|
92
|
+
return O(s) === a;
|
|
93
|
+
}, N.isStrictMode = function(s) {
|
|
94
|
+
return O(s) === o;
|
|
95
|
+
}, N.isSuspense = function(s) {
|
|
96
|
+
return O(s) === d;
|
|
97
|
+
}, N.isValidElementType = function(s) {
|
|
98
|
+
return typeof s == "string" || typeof s == "function" || s === n || s === f || s === a || s === o || s === d || s === p || typeof s == "object" && s !== null && (s.$$typeof === g || s.$$typeof === h || s.$$typeof === i || s.$$typeof === u || s.$$typeof === v || s.$$typeof === E || s.$$typeof === C || s.$$typeof === $ || s.$$typeof === m);
|
|
99
|
+
}, N.typeOf = O, N;
|
|
100
|
+
}
|
|
101
|
+
var j = {};
|
|
102
|
+
/** @license React v16.13.1
|
|
103
|
+
* react-is.development.js
|
|
104
|
+
*
|
|
105
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
106
|
+
*
|
|
107
|
+
* This source code is licensed under the MIT license found in the
|
|
108
|
+
* LICENSE file in the root directory of this source tree.
|
|
109
|
+
*/
|
|
110
|
+
var sr;
|
|
111
|
+
function St() {
|
|
112
|
+
return sr || (sr = 1, process.env.NODE_ENV !== "production" && function() {
|
|
113
|
+
var e = typeof Symbol == "function" && Symbol.for, r = e ? Symbol.for("react.element") : 60103, t = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, o = e ? Symbol.for("react.strict_mode") : 60108, a = e ? Symbol.for("react.profiler") : 60114, i = e ? Symbol.for("react.provider") : 60109, u = e ? Symbol.for("react.context") : 60110, b = e ? Symbol.for("react.async_mode") : 60111, f = e ? Symbol.for("react.concurrent_mode") : 60111, v = e ? Symbol.for("react.forward_ref") : 60112, d = e ? Symbol.for("react.suspense") : 60113, p = e ? Symbol.for("react.suspense_list") : 60120, h = e ? Symbol.for("react.memo") : 60115, g = e ? Symbol.for("react.lazy") : 60116, m = e ? Symbol.for("react.block") : 60121, E = e ? Symbol.for("react.fundamental") : 60117, C = e ? Symbol.for("react.responder") : 60118, $ = e ? Symbol.for("react.scope") : 60119;
|
|
114
|
+
function O(l) {
|
|
115
|
+
return typeof l == "string" || typeof l == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
116
|
+
l === n || l === f || l === a || l === o || l === d || l === p || typeof l == "object" && l !== null && (l.$$typeof === g || l.$$typeof === h || l.$$typeof === i || l.$$typeof === u || l.$$typeof === v || l.$$typeof === E || l.$$typeof === C || l.$$typeof === $ || l.$$typeof === m);
|
|
117
|
+
}
|
|
118
|
+
function F(l) {
|
|
119
|
+
if (typeof l == "object" && l !== null) {
|
|
120
|
+
var U = l.$$typeof;
|
|
121
|
+
switch (U) {
|
|
122
|
+
case r:
|
|
123
|
+
var ue = l.type;
|
|
124
|
+
switch (ue) {
|
|
125
|
+
case b:
|
|
126
|
+
case f:
|
|
127
|
+
case n:
|
|
128
|
+
case a:
|
|
129
|
+
case o:
|
|
130
|
+
case d:
|
|
131
|
+
return ue;
|
|
132
|
+
default:
|
|
133
|
+
var Te = ue && ue.$$typeof;
|
|
134
|
+
switch (Te) {
|
|
135
|
+
case u:
|
|
136
|
+
case v:
|
|
137
|
+
case g:
|
|
138
|
+
case h:
|
|
139
|
+
case i:
|
|
140
|
+
return Te;
|
|
141
|
+
default:
|
|
142
|
+
return U;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
case t:
|
|
146
|
+
return U;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
var s = b, k = f, B = u, G = i, z = r, _ = v, V = n, ne = g, Z = h, J = t, oe = a, q = o, K = d, ae = !1;
|
|
151
|
+
function ie(l) {
|
|
152
|
+
return ae || (ae = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), c(l) || F(l) === b;
|
|
153
|
+
}
|
|
154
|
+
function c(l) {
|
|
155
|
+
return F(l) === f;
|
|
156
|
+
}
|
|
157
|
+
function y(l) {
|
|
158
|
+
return F(l) === u;
|
|
159
|
+
}
|
|
160
|
+
function w(l) {
|
|
161
|
+
return F(l) === i;
|
|
162
|
+
}
|
|
163
|
+
function x(l) {
|
|
164
|
+
return typeof l == "object" && l !== null && l.$$typeof === r;
|
|
165
|
+
}
|
|
166
|
+
function T(l) {
|
|
167
|
+
return F(l) === v;
|
|
168
|
+
}
|
|
169
|
+
function R(l) {
|
|
170
|
+
return F(l) === n;
|
|
171
|
+
}
|
|
172
|
+
function S(l) {
|
|
173
|
+
return F(l) === g;
|
|
174
|
+
}
|
|
175
|
+
function P(l) {
|
|
176
|
+
return F(l) === h;
|
|
177
|
+
}
|
|
178
|
+
function A(l) {
|
|
179
|
+
return F(l) === t;
|
|
180
|
+
}
|
|
181
|
+
function M(l) {
|
|
182
|
+
return F(l) === a;
|
|
183
|
+
}
|
|
184
|
+
function I(l) {
|
|
185
|
+
return F(l) === o;
|
|
186
|
+
}
|
|
187
|
+
function L(l) {
|
|
188
|
+
return F(l) === d;
|
|
189
|
+
}
|
|
190
|
+
j.AsyncMode = s, j.ConcurrentMode = k, j.ContextConsumer = B, j.ContextProvider = G, j.Element = z, j.ForwardRef = _, j.Fragment = V, j.Lazy = ne, j.Memo = Z, j.Portal = J, j.Profiler = oe, j.StrictMode = q, j.Suspense = K, j.isAsyncMode = ie, j.isConcurrentMode = c, j.isContextConsumer = y, j.isContextProvider = w, j.isElement = x, j.isForwardRef = T, j.isFragment = R, j.isLazy = S, j.isMemo = P, j.isPortal = A, j.isProfiler = M, j.isStrictMode = I, j.isSuspense = L, j.isValidElementType = O, j.typeOf = F;
|
|
191
|
+
}()), j;
|
|
192
|
+
}
|
|
193
|
+
var fr;
|
|
194
|
+
function _r() {
|
|
195
|
+
return fr || (fr = 1, process.env.NODE_ENV === "production" ? Oe.exports = wt() : Oe.exports = St()), Oe.exports;
|
|
196
|
+
}
|
|
197
|
+
/*
|
|
198
|
+
object-assign
|
|
199
|
+
(c) Sindre Sorhus
|
|
200
|
+
@license MIT
|
|
201
|
+
*/
|
|
202
|
+
var _e, dr;
|
|
203
|
+
function Pt() {
|
|
204
|
+
if (dr) return _e;
|
|
205
|
+
dr = 1;
|
|
206
|
+
var e = Object.getOwnPropertySymbols, r = Object.prototype.hasOwnProperty, t = Object.prototype.propertyIsEnumerable;
|
|
207
|
+
function n(a) {
|
|
208
|
+
if (a == null)
|
|
209
|
+
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
210
|
+
return Object(a);
|
|
211
|
+
}
|
|
212
|
+
function o() {
|
|
213
|
+
try {
|
|
214
|
+
if (!Object.assign)
|
|
215
|
+
return !1;
|
|
216
|
+
var a = new String("abc");
|
|
217
|
+
if (a[5] = "de", Object.getOwnPropertyNames(a)[0] === "5")
|
|
218
|
+
return !1;
|
|
219
|
+
for (var i = {}, u = 0; u < 10; u++)
|
|
220
|
+
i["_" + String.fromCharCode(u)] = u;
|
|
221
|
+
var b = Object.getOwnPropertyNames(i).map(function(v) {
|
|
222
|
+
return i[v];
|
|
223
|
+
});
|
|
224
|
+
if (b.join("") !== "0123456789")
|
|
225
|
+
return !1;
|
|
226
|
+
var f = {};
|
|
227
|
+
return "abcdefghijklmnopqrst".split("").forEach(function(v) {
|
|
228
|
+
f[v] = v;
|
|
229
|
+
}), Object.keys(Object.assign({}, f)).join("") === "abcdefghijklmnopqrst";
|
|
230
|
+
} catch {
|
|
231
|
+
return !1;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return _e = o() ? Object.assign : function(a, i) {
|
|
235
|
+
for (var u, b = n(a), f, v = 1; v < arguments.length; v++) {
|
|
236
|
+
u = Object(arguments[v]);
|
|
237
|
+
for (var d in u)
|
|
238
|
+
r.call(u, d) && (b[d] = u[d]);
|
|
239
|
+
if (e) {
|
|
240
|
+
f = e(u);
|
|
241
|
+
for (var p = 0; p < f.length; p++)
|
|
242
|
+
t.call(u, f[p]) && (b[f[p]] = u[f[p]]);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return b;
|
|
246
|
+
}, _e;
|
|
247
|
+
}
|
|
248
|
+
var Fe, lr;
|
|
249
|
+
function Ge() {
|
|
250
|
+
if (lr) return Fe;
|
|
251
|
+
lr = 1;
|
|
252
|
+
var e = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
253
|
+
return Fe = e, Fe;
|
|
254
|
+
}
|
|
255
|
+
var Re, vr;
|
|
256
|
+
function Fr() {
|
|
257
|
+
return vr || (vr = 1, Re = Function.call.bind(Object.prototype.hasOwnProperty)), Re;
|
|
258
|
+
}
|
|
259
|
+
var Ae, pr;
|
|
260
|
+
function _t() {
|
|
261
|
+
if (pr) return Ae;
|
|
262
|
+
pr = 1;
|
|
263
|
+
var e = function() {
|
|
264
|
+
};
|
|
265
|
+
if (process.env.NODE_ENV !== "production") {
|
|
266
|
+
var r = Ge(), t = {}, n = Fr();
|
|
267
|
+
e = function(a) {
|
|
268
|
+
var i = "Warning: " + a;
|
|
269
|
+
typeof console < "u" && console.error(i);
|
|
270
|
+
try {
|
|
271
|
+
throw new Error(i);
|
|
272
|
+
} catch {
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
function o(a, i, u, b, f) {
|
|
277
|
+
if (process.env.NODE_ENV !== "production") {
|
|
278
|
+
for (var v in a)
|
|
279
|
+
if (n(a, v)) {
|
|
280
|
+
var d;
|
|
281
|
+
try {
|
|
282
|
+
if (typeof a[v] != "function") {
|
|
283
|
+
var p = Error(
|
|
284
|
+
(b || "React class") + ": " + u + " type `" + v + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof a[v] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
|
|
285
|
+
);
|
|
286
|
+
throw p.name = "Invariant Violation", p;
|
|
287
|
+
}
|
|
288
|
+
d = a[v](i, v, b, u, null, r);
|
|
289
|
+
} catch (g) {
|
|
290
|
+
d = g;
|
|
291
|
+
}
|
|
292
|
+
if (d && !(d instanceof Error) && e(
|
|
293
|
+
(b || "React class") + ": type specification of " + u + " `" + v + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof d + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
|
|
294
|
+
), d instanceof Error && !(d.message in t)) {
|
|
295
|
+
t[d.message] = !0;
|
|
296
|
+
var h = f ? f() : "";
|
|
297
|
+
e(
|
|
298
|
+
"Failed " + u + " type: " + d.message + (h ?? "")
|
|
299
|
+
);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
return o.resetWarningCache = function() {
|
|
305
|
+
process.env.NODE_ENV !== "production" && (t = {});
|
|
306
|
+
}, Ae = o, Ae;
|
|
307
|
+
}
|
|
308
|
+
var Ie, yr;
|
|
309
|
+
function Ft() {
|
|
310
|
+
if (yr) return Ie;
|
|
311
|
+
yr = 1;
|
|
312
|
+
var e = _r(), r = Pt(), t = Ge(), n = Fr(), o = _t(), a = function() {
|
|
313
|
+
};
|
|
314
|
+
process.env.NODE_ENV !== "production" && (a = function(u) {
|
|
315
|
+
var b = "Warning: " + u;
|
|
316
|
+
typeof console < "u" && console.error(b);
|
|
317
|
+
try {
|
|
318
|
+
throw new Error(b);
|
|
319
|
+
} catch {
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
function i() {
|
|
323
|
+
return null;
|
|
324
|
+
}
|
|
325
|
+
return Ie = function(u, b) {
|
|
326
|
+
var f = typeof Symbol == "function" && Symbol.iterator, v = "@@iterator";
|
|
327
|
+
function d(c) {
|
|
328
|
+
var y = c && (f && c[f] || c[v]);
|
|
329
|
+
if (typeof y == "function")
|
|
330
|
+
return y;
|
|
331
|
+
}
|
|
332
|
+
var p = "<<anonymous>>", h = {
|
|
333
|
+
array: C("array"),
|
|
334
|
+
bigint: C("bigint"),
|
|
335
|
+
bool: C("boolean"),
|
|
336
|
+
func: C("function"),
|
|
337
|
+
number: C("number"),
|
|
338
|
+
object: C("object"),
|
|
339
|
+
string: C("string"),
|
|
340
|
+
symbol: C("symbol"),
|
|
341
|
+
any: $(),
|
|
342
|
+
arrayOf: O,
|
|
343
|
+
element: F(),
|
|
344
|
+
elementType: s(),
|
|
345
|
+
instanceOf: k,
|
|
346
|
+
node: _(),
|
|
347
|
+
objectOf: G,
|
|
348
|
+
oneOf: B,
|
|
349
|
+
oneOfType: z,
|
|
350
|
+
shape: ne,
|
|
351
|
+
exact: Z
|
|
352
|
+
};
|
|
353
|
+
function g(c, y) {
|
|
354
|
+
return c === y ? c !== 0 || 1 / c === 1 / y : c !== c && y !== y;
|
|
355
|
+
}
|
|
356
|
+
function m(c, y) {
|
|
357
|
+
this.message = c, this.data = y && typeof y == "object" ? y : {}, this.stack = "";
|
|
358
|
+
}
|
|
359
|
+
m.prototype = Error.prototype;
|
|
360
|
+
function E(c) {
|
|
361
|
+
if (process.env.NODE_ENV !== "production")
|
|
362
|
+
var y = {}, w = 0;
|
|
363
|
+
function x(R, S, P, A, M, I, L) {
|
|
364
|
+
if (A = A || p, I = I || P, L !== t) {
|
|
365
|
+
if (b) {
|
|
366
|
+
var l = new Error(
|
|
367
|
+
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
|
|
368
|
+
);
|
|
369
|
+
throw l.name = "Invariant Violation", l;
|
|
370
|
+
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
|
|
371
|
+
var U = A + ":" + P;
|
|
372
|
+
!y[U] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
373
|
+
w < 3 && (a(
|
|
374
|
+
"You are manually calling a React.PropTypes validation function for the `" + I + "` prop on `" + A + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
|
|
375
|
+
), y[U] = !0, w++);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
return S[P] == null ? R ? S[P] === null ? new m("The " + M + " `" + I + "` is marked as required " + ("in `" + A + "`, but its value is `null`.")) : new m("The " + M + " `" + I + "` is marked as required in " + ("`" + A + "`, but its value is `undefined`.")) : null : c(S, P, A, M, I);
|
|
379
|
+
}
|
|
380
|
+
var T = x.bind(null, !1);
|
|
381
|
+
return T.isRequired = x.bind(null, !0), T;
|
|
382
|
+
}
|
|
383
|
+
function C(c) {
|
|
384
|
+
function y(w, x, T, R, S, P) {
|
|
385
|
+
var A = w[x], M = q(A);
|
|
386
|
+
if (M !== c) {
|
|
387
|
+
var I = K(A);
|
|
388
|
+
return new m(
|
|
389
|
+
"Invalid " + R + " `" + S + "` of type " + ("`" + I + "` supplied to `" + T + "`, expected ") + ("`" + c + "`."),
|
|
390
|
+
{ expectedType: c }
|
|
391
|
+
);
|
|
392
|
+
}
|
|
393
|
+
return null;
|
|
394
|
+
}
|
|
395
|
+
return E(y);
|
|
396
|
+
}
|
|
397
|
+
function $() {
|
|
398
|
+
return E(i);
|
|
399
|
+
}
|
|
400
|
+
function O(c) {
|
|
401
|
+
function y(w, x, T, R, S) {
|
|
402
|
+
if (typeof c != "function")
|
|
403
|
+
return new m("Property `" + S + "` of component `" + T + "` has invalid PropType notation inside arrayOf.");
|
|
404
|
+
var P = w[x];
|
|
405
|
+
if (!Array.isArray(P)) {
|
|
406
|
+
var A = q(P);
|
|
407
|
+
return new m("Invalid " + R + " `" + S + "` of type " + ("`" + A + "` supplied to `" + T + "`, expected an array."));
|
|
408
|
+
}
|
|
409
|
+
for (var M = 0; M < P.length; M++) {
|
|
410
|
+
var I = c(P, M, T, R, S + "[" + M + "]", t);
|
|
411
|
+
if (I instanceof Error)
|
|
412
|
+
return I;
|
|
413
|
+
}
|
|
414
|
+
return null;
|
|
415
|
+
}
|
|
416
|
+
return E(y);
|
|
417
|
+
}
|
|
418
|
+
function F() {
|
|
419
|
+
function c(y, w, x, T, R) {
|
|
420
|
+
var S = y[w];
|
|
421
|
+
if (!u(S)) {
|
|
422
|
+
var P = q(S);
|
|
423
|
+
return new m("Invalid " + T + " `" + R + "` of type " + ("`" + P + "` supplied to `" + x + "`, expected a single ReactElement."));
|
|
424
|
+
}
|
|
425
|
+
return null;
|
|
426
|
+
}
|
|
427
|
+
return E(c);
|
|
428
|
+
}
|
|
429
|
+
function s() {
|
|
430
|
+
function c(y, w, x, T, R) {
|
|
431
|
+
var S = y[w];
|
|
432
|
+
if (!e.isValidElementType(S)) {
|
|
433
|
+
var P = q(S);
|
|
434
|
+
return new m("Invalid " + T + " `" + R + "` of type " + ("`" + P + "` supplied to `" + x + "`, expected a single ReactElement type."));
|
|
435
|
+
}
|
|
436
|
+
return null;
|
|
437
|
+
}
|
|
438
|
+
return E(c);
|
|
439
|
+
}
|
|
440
|
+
function k(c) {
|
|
441
|
+
function y(w, x, T, R, S) {
|
|
442
|
+
if (!(w[x] instanceof c)) {
|
|
443
|
+
var P = c.name || p, A = ie(w[x]);
|
|
444
|
+
return new m("Invalid " + R + " `" + S + "` of type " + ("`" + A + "` supplied to `" + T + "`, expected ") + ("instance of `" + P + "`."));
|
|
445
|
+
}
|
|
446
|
+
return null;
|
|
447
|
+
}
|
|
448
|
+
return E(y);
|
|
449
|
+
}
|
|
450
|
+
function B(c) {
|
|
451
|
+
if (!Array.isArray(c))
|
|
452
|
+
return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? a(
|
|
453
|
+
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
|
|
454
|
+
) : a("Invalid argument supplied to oneOf, expected an array.")), i;
|
|
455
|
+
function y(w, x, T, R, S) {
|
|
456
|
+
for (var P = w[x], A = 0; A < c.length; A++)
|
|
457
|
+
if (g(P, c[A]))
|
|
458
|
+
return null;
|
|
459
|
+
var M = JSON.stringify(c, function(L, l) {
|
|
460
|
+
var U = K(l);
|
|
461
|
+
return U === "symbol" ? String(l) : l;
|
|
462
|
+
});
|
|
463
|
+
return new m("Invalid " + R + " `" + S + "` of value `" + String(P) + "` " + ("supplied to `" + T + "`, expected one of " + M + "."));
|
|
464
|
+
}
|
|
465
|
+
return E(y);
|
|
466
|
+
}
|
|
467
|
+
function G(c) {
|
|
468
|
+
function y(w, x, T, R, S) {
|
|
469
|
+
if (typeof c != "function")
|
|
470
|
+
return new m("Property `" + S + "` of component `" + T + "` has invalid PropType notation inside objectOf.");
|
|
471
|
+
var P = w[x], A = q(P);
|
|
472
|
+
if (A !== "object")
|
|
473
|
+
return new m("Invalid " + R + " `" + S + "` of type " + ("`" + A + "` supplied to `" + T + "`, expected an object."));
|
|
474
|
+
for (var M in P)
|
|
475
|
+
if (n(P, M)) {
|
|
476
|
+
var I = c(P, M, T, R, S + "." + M, t);
|
|
477
|
+
if (I instanceof Error)
|
|
478
|
+
return I;
|
|
479
|
+
}
|
|
480
|
+
return null;
|
|
481
|
+
}
|
|
482
|
+
return E(y);
|
|
483
|
+
}
|
|
484
|
+
function z(c) {
|
|
485
|
+
if (!Array.isArray(c))
|
|
486
|
+
return process.env.NODE_ENV !== "production" && a("Invalid argument supplied to oneOfType, expected an instance of array."), i;
|
|
487
|
+
for (var y = 0; y < c.length; y++) {
|
|
488
|
+
var w = c[y];
|
|
489
|
+
if (typeof w != "function")
|
|
490
|
+
return a(
|
|
491
|
+
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + ae(w) + " at index " + y + "."
|
|
492
|
+
), i;
|
|
493
|
+
}
|
|
494
|
+
function x(T, R, S, P, A) {
|
|
495
|
+
for (var M = [], I = 0; I < c.length; I++) {
|
|
496
|
+
var L = c[I], l = L(T, R, S, P, A, t);
|
|
497
|
+
if (l == null)
|
|
498
|
+
return null;
|
|
499
|
+
l.data && n(l.data, "expectedType") && M.push(l.data.expectedType);
|
|
500
|
+
}
|
|
501
|
+
var U = M.length > 0 ? ", expected one of type [" + M.join(", ") + "]" : "";
|
|
502
|
+
return new m("Invalid " + P + " `" + A + "` supplied to " + ("`" + S + "`" + U + "."));
|
|
503
|
+
}
|
|
504
|
+
return E(x);
|
|
505
|
+
}
|
|
506
|
+
function _() {
|
|
507
|
+
function c(y, w, x, T, R) {
|
|
508
|
+
return J(y[w]) ? null : new m("Invalid " + T + " `" + R + "` supplied to " + ("`" + x + "`, expected a ReactNode."));
|
|
509
|
+
}
|
|
510
|
+
return E(c);
|
|
511
|
+
}
|
|
512
|
+
function V(c, y, w, x, T) {
|
|
513
|
+
return new m(
|
|
514
|
+
(c || "React class") + ": " + y + " type `" + w + "." + x + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + T + "`."
|
|
515
|
+
);
|
|
516
|
+
}
|
|
517
|
+
function ne(c) {
|
|
518
|
+
function y(w, x, T, R, S) {
|
|
519
|
+
var P = w[x], A = q(P);
|
|
520
|
+
if (A !== "object")
|
|
521
|
+
return new m("Invalid " + R + " `" + S + "` of type `" + A + "` " + ("supplied to `" + T + "`, expected `object`."));
|
|
522
|
+
for (var M in c) {
|
|
523
|
+
var I = c[M];
|
|
524
|
+
if (typeof I != "function")
|
|
525
|
+
return V(T, R, S, M, K(I));
|
|
526
|
+
var L = I(P, M, T, R, S + "." + M, t);
|
|
527
|
+
if (L)
|
|
528
|
+
return L;
|
|
529
|
+
}
|
|
530
|
+
return null;
|
|
531
|
+
}
|
|
532
|
+
return E(y);
|
|
533
|
+
}
|
|
534
|
+
function Z(c) {
|
|
535
|
+
function y(w, x, T, R, S) {
|
|
536
|
+
var P = w[x], A = q(P);
|
|
537
|
+
if (A !== "object")
|
|
538
|
+
return new m("Invalid " + R + " `" + S + "` of type `" + A + "` " + ("supplied to `" + T + "`, expected `object`."));
|
|
539
|
+
var M = r({}, w[x], c);
|
|
540
|
+
for (var I in M) {
|
|
541
|
+
var L = c[I];
|
|
542
|
+
if (n(c, I) && typeof L != "function")
|
|
543
|
+
return V(T, R, S, I, K(L));
|
|
544
|
+
if (!L)
|
|
545
|
+
return new m(
|
|
546
|
+
"Invalid " + R + " `" + S + "` key `" + I + "` supplied to `" + T + "`.\nBad object: " + JSON.stringify(w[x], null, " ") + `
|
|
547
|
+
Valid keys: ` + JSON.stringify(Object.keys(c), null, " ")
|
|
548
|
+
);
|
|
549
|
+
var l = L(P, I, T, R, S + "." + I, t);
|
|
550
|
+
if (l)
|
|
551
|
+
return l;
|
|
552
|
+
}
|
|
553
|
+
return null;
|
|
554
|
+
}
|
|
555
|
+
return E(y);
|
|
556
|
+
}
|
|
557
|
+
function J(c) {
|
|
558
|
+
switch (typeof c) {
|
|
559
|
+
case "number":
|
|
560
|
+
case "string":
|
|
561
|
+
case "undefined":
|
|
562
|
+
return !0;
|
|
563
|
+
case "boolean":
|
|
564
|
+
return !c;
|
|
565
|
+
case "object":
|
|
566
|
+
if (Array.isArray(c))
|
|
567
|
+
return c.every(J);
|
|
568
|
+
if (c === null || u(c))
|
|
569
|
+
return !0;
|
|
570
|
+
var y = d(c);
|
|
571
|
+
if (y) {
|
|
572
|
+
var w = y.call(c), x;
|
|
573
|
+
if (y !== c.entries) {
|
|
574
|
+
for (; !(x = w.next()).done; )
|
|
575
|
+
if (!J(x.value))
|
|
576
|
+
return !1;
|
|
577
|
+
} else
|
|
578
|
+
for (; !(x = w.next()).done; ) {
|
|
579
|
+
var T = x.value;
|
|
580
|
+
if (T && !J(T[1]))
|
|
581
|
+
return !1;
|
|
582
|
+
}
|
|
583
|
+
} else
|
|
584
|
+
return !1;
|
|
585
|
+
return !0;
|
|
586
|
+
default:
|
|
587
|
+
return !1;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
function oe(c, y) {
|
|
591
|
+
return c === "symbol" ? !0 : y ? y["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && y instanceof Symbol : !1;
|
|
592
|
+
}
|
|
593
|
+
function q(c) {
|
|
594
|
+
var y = typeof c;
|
|
595
|
+
return Array.isArray(c) ? "array" : c instanceof RegExp ? "object" : oe(y, c) ? "symbol" : y;
|
|
596
|
+
}
|
|
597
|
+
function K(c) {
|
|
598
|
+
if (typeof c > "u" || c === null)
|
|
599
|
+
return "" + c;
|
|
600
|
+
var y = q(c);
|
|
601
|
+
if (y === "object") {
|
|
602
|
+
if (c instanceof Date)
|
|
603
|
+
return "date";
|
|
604
|
+
if (c instanceof RegExp)
|
|
605
|
+
return "regexp";
|
|
606
|
+
}
|
|
607
|
+
return y;
|
|
608
|
+
}
|
|
609
|
+
function ae(c) {
|
|
610
|
+
var y = K(c);
|
|
611
|
+
switch (y) {
|
|
612
|
+
case "array":
|
|
613
|
+
case "object":
|
|
614
|
+
return "an " + y;
|
|
615
|
+
case "boolean":
|
|
616
|
+
case "date":
|
|
617
|
+
case "regexp":
|
|
618
|
+
return "a " + y;
|
|
619
|
+
default:
|
|
620
|
+
return y;
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
function ie(c) {
|
|
624
|
+
return !c.constructor || !c.constructor.name ? p : c.constructor.name;
|
|
625
|
+
}
|
|
626
|
+
return h.checkPropTypes = o, h.resetWarningCache = o.resetWarningCache, h.PropTypes = h, h;
|
|
627
|
+
}, Ie;
|
|
628
|
+
}
|
|
629
|
+
var Ce, mr;
|
|
630
|
+
function Rt() {
|
|
631
|
+
if (mr) return Ce;
|
|
632
|
+
mr = 1;
|
|
633
|
+
var e = Ge();
|
|
634
|
+
function r() {
|
|
635
|
+
}
|
|
636
|
+
function t() {
|
|
637
|
+
}
|
|
638
|
+
return t.resetWarningCache = r, Ce = function() {
|
|
639
|
+
function n(i, u, b, f, v, d) {
|
|
640
|
+
if (d !== e) {
|
|
641
|
+
var p = new Error(
|
|
642
|
+
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
|
|
643
|
+
);
|
|
644
|
+
throw p.name = "Invariant Violation", p;
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
n.isRequired = n;
|
|
648
|
+
function o() {
|
|
649
|
+
return n;
|
|
650
|
+
}
|
|
651
|
+
var a = {
|
|
652
|
+
array: n,
|
|
653
|
+
bigint: n,
|
|
654
|
+
bool: n,
|
|
655
|
+
func: n,
|
|
656
|
+
number: n,
|
|
657
|
+
object: n,
|
|
658
|
+
string: n,
|
|
659
|
+
symbol: n,
|
|
660
|
+
any: n,
|
|
661
|
+
arrayOf: o,
|
|
662
|
+
element: n,
|
|
663
|
+
elementType: n,
|
|
664
|
+
instanceOf: o,
|
|
665
|
+
node: n,
|
|
666
|
+
objectOf: o,
|
|
667
|
+
oneOf: o,
|
|
668
|
+
oneOfType: o,
|
|
669
|
+
shape: o,
|
|
670
|
+
exact: o,
|
|
671
|
+
checkPropTypes: t,
|
|
672
|
+
resetWarningCache: r
|
|
673
|
+
};
|
|
674
|
+
return a.PropTypes = a, a;
|
|
675
|
+
}, Ce;
|
|
676
|
+
}
|
|
677
|
+
if (process.env.NODE_ENV !== "production") {
|
|
678
|
+
var At = _r(), It = !0;
|
|
679
|
+
ke.exports = Ft()(At.isElement, It);
|
|
680
|
+
} else
|
|
681
|
+
ke.exports = Rt()();
|
|
682
|
+
var D = ke.exports;
|
|
683
|
+
const Rr = /* @__PURE__ */ xt(D);
|
|
684
|
+
var Le = "data-focus-lock", Ar = "data-focus-lock-disabled", Ct = "data-no-focus-lock", $t = "data-autofocus-inside", Mt = "data-no-autofocus";
|
|
685
|
+
function $e(e, r) {
|
|
686
|
+
return typeof e == "function" ? e(r) : e && (e.current = r), e;
|
|
687
|
+
}
|
|
688
|
+
function Nt(e, r) {
|
|
689
|
+
var t = fe(function() {
|
|
690
|
+
return {
|
|
691
|
+
// value
|
|
692
|
+
value: e,
|
|
693
|
+
// last callback
|
|
694
|
+
callback: r,
|
|
695
|
+
// "memoized" public interface
|
|
696
|
+
facade: {
|
|
697
|
+
get current() {
|
|
698
|
+
return t.value;
|
|
699
|
+
},
|
|
700
|
+
set current(n) {
|
|
701
|
+
var o = t.value;
|
|
702
|
+
o !== n && (t.value = n, t.callback(n, o));
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
};
|
|
706
|
+
})[0];
|
|
707
|
+
return t.callback = r, t.facade;
|
|
708
|
+
}
|
|
709
|
+
var jt = typeof window < "u" ? ir.useLayoutEffect : ir.useEffect, br = /* @__PURE__ */ new WeakMap();
|
|
710
|
+
function Dt(e, r) {
|
|
711
|
+
var t = Nt(null, function(n) {
|
|
712
|
+
return e.forEach(function(o) {
|
|
713
|
+
return $e(o, n);
|
|
714
|
+
});
|
|
715
|
+
});
|
|
716
|
+
return jt(function() {
|
|
717
|
+
var n = br.get(t);
|
|
718
|
+
if (n) {
|
|
719
|
+
var o = new Set(n), a = new Set(e), i = t.current;
|
|
720
|
+
o.forEach(function(u) {
|
|
721
|
+
a.has(u) || $e(u, null);
|
|
722
|
+
}), a.forEach(function(u) {
|
|
723
|
+
o.has(u) || $e(u, i);
|
|
724
|
+
});
|
|
725
|
+
}
|
|
726
|
+
br.set(t, e);
|
|
727
|
+
}, [e]), t;
|
|
728
|
+
}
|
|
729
|
+
var Me = {
|
|
730
|
+
width: "1px",
|
|
731
|
+
height: "0px",
|
|
732
|
+
padding: 0,
|
|
733
|
+
overflow: "hidden",
|
|
734
|
+
position: "fixed",
|
|
735
|
+
top: "1px",
|
|
736
|
+
left: "1px"
|
|
737
|
+
};
|
|
738
|
+
process.env.NODE_ENV !== "production" && Rr.node;
|
|
739
|
+
var We = function() {
|
|
740
|
+
return We = Object.assign || function(r) {
|
|
741
|
+
for (var t, n = 1, o = arguments.length; n < o; n++) {
|
|
742
|
+
t = arguments[n];
|
|
743
|
+
for (var a in t) Object.prototype.hasOwnProperty.call(t, a) && (r[a] = t[a]);
|
|
744
|
+
}
|
|
745
|
+
return r;
|
|
746
|
+
}, We.apply(this, arguments);
|
|
747
|
+
};
|
|
748
|
+
function Ir(e) {
|
|
749
|
+
return e;
|
|
750
|
+
}
|
|
751
|
+
function Cr(e, r) {
|
|
752
|
+
r === void 0 && (r = Ir);
|
|
753
|
+
var t = [], n = !1, o = {
|
|
754
|
+
read: function() {
|
|
755
|
+
if (n)
|
|
756
|
+
throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
|
|
757
|
+
return t.length ? t[t.length - 1] : e;
|
|
758
|
+
},
|
|
759
|
+
useMedium: function(a) {
|
|
760
|
+
var i = r(a, n);
|
|
761
|
+
return t.push(i), function() {
|
|
762
|
+
t = t.filter(function(u) {
|
|
763
|
+
return u !== i;
|
|
764
|
+
});
|
|
765
|
+
};
|
|
766
|
+
},
|
|
767
|
+
assignSyncMedium: function(a) {
|
|
768
|
+
for (n = !0; t.length; ) {
|
|
769
|
+
var i = t;
|
|
770
|
+
t = [], i.forEach(a);
|
|
771
|
+
}
|
|
772
|
+
t = {
|
|
773
|
+
push: function(u) {
|
|
774
|
+
return a(u);
|
|
775
|
+
},
|
|
776
|
+
filter: function() {
|
|
777
|
+
return t;
|
|
778
|
+
}
|
|
779
|
+
};
|
|
780
|
+
},
|
|
781
|
+
assignMedium: function(a) {
|
|
782
|
+
n = !0;
|
|
783
|
+
var i = [];
|
|
784
|
+
if (t.length) {
|
|
785
|
+
var u = t;
|
|
786
|
+
t = [], u.forEach(a), i = t;
|
|
787
|
+
}
|
|
788
|
+
var b = function() {
|
|
789
|
+
var v = i;
|
|
790
|
+
i = [], v.forEach(a);
|
|
791
|
+
}, f = function() {
|
|
792
|
+
return Promise.resolve().then(b);
|
|
793
|
+
};
|
|
794
|
+
f(), t = {
|
|
795
|
+
push: function(v) {
|
|
796
|
+
i.push(v), f();
|
|
797
|
+
},
|
|
798
|
+
filter: function(v) {
|
|
799
|
+
return i = i.filter(v), t;
|
|
800
|
+
}
|
|
801
|
+
};
|
|
802
|
+
}
|
|
803
|
+
};
|
|
804
|
+
return o;
|
|
805
|
+
}
|
|
806
|
+
function Ve(e, r) {
|
|
807
|
+
return r === void 0 && (r = Ir), Cr(e, r);
|
|
808
|
+
}
|
|
809
|
+
function kt(e) {
|
|
810
|
+
e === void 0 && (e = {});
|
|
811
|
+
var r = Cr(null);
|
|
812
|
+
return r.options = We({ async: !0, ssr: !1 }, e), r;
|
|
813
|
+
}
|
|
814
|
+
var $r = Ve({}, function(e) {
|
|
815
|
+
var r = e.target, t = e.currentTarget;
|
|
816
|
+
return {
|
|
817
|
+
target: r,
|
|
818
|
+
currentTarget: t
|
|
819
|
+
};
|
|
820
|
+
}), Mr = Ve(), Lt = Ve(), Wt = kt({
|
|
821
|
+
async: !0,
|
|
822
|
+
ssr: typeof document < "u"
|
|
823
|
+
}), qt = /* @__PURE__ */ Sr(void 0), Ut = [], He = /* @__PURE__ */ Pr(function(r, t) {
|
|
824
|
+
var n, o = fe(), a = o[0], i = o[1], u = xe(), b = xe(!1), f = xe(null), v = fe({}), d = v[1], p = r.children, h = r.disabled, g = h === void 0 ? !1 : h, m = r.noFocusGuards, E = m === void 0 ? !1 : m, C = r.persistentFocus, $ = C === void 0 ? !1 : C, O = r.crossFrame, F = O === void 0 ? !0 : O, s = r.autoFocus, k = s === void 0 ? !0 : s, B = r.allowTextSelection, G = r.group, z = r.className, _ = r.whiteList, V = r.hasPositiveIndices, ne = r.shards, Z = ne === void 0 ? Ut : ne, J = r.as, oe = J === void 0 ? "div" : J, q = r.lockProps, K = q === void 0 ? {} : q, ae = r.sideCar, ie = r.returnFocus, c = ie === void 0 ? !1 : ie, y = r.focusOptions, w = r.onActivation, x = r.onDeactivation, T = fe({}), R = T[0], S = pe(function(Q) {
|
|
825
|
+
var ce = Q.captureFocusRestore;
|
|
826
|
+
if (!f.current) {
|
|
827
|
+
var se, ee = (se = document) == null ? void 0 : se.activeElement;
|
|
828
|
+
f.current = ee, ee !== document.body && (f.current = ce(ee));
|
|
829
|
+
}
|
|
830
|
+
u.current && w && w(u.current), b.current = !0, d();
|
|
831
|
+
}, [w]), P = pe(function() {
|
|
832
|
+
b.current = !1, x && x(u.current), d();
|
|
833
|
+
}, [x]), A = pe(function(Q) {
|
|
834
|
+
var ce = f.current;
|
|
835
|
+
if (ce) {
|
|
836
|
+
var se = (typeof ce == "function" ? ce() : ce) || document.body, ee = typeof c == "function" ? c(se) : c;
|
|
837
|
+
if (ee) {
|
|
838
|
+
var ar = typeof ee == "object" ? ee : void 0;
|
|
839
|
+
f.current = null, Q ? Promise.resolve().then(function() {
|
|
840
|
+
return se.focus(ar);
|
|
841
|
+
}) : se.focus(ar);
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
}, [c]), M = pe(function(Q) {
|
|
845
|
+
b.current && $r.useMedium(Q);
|
|
846
|
+
}, []), I = Mr.useMedium, L = pe(function(Q) {
|
|
847
|
+
u.current !== Q && (u.current = Q, i(Q));
|
|
848
|
+
}, []);
|
|
849
|
+
process.env.NODE_ENV !== "production" && (typeof B < "u" && console.warn("React-Focus-Lock: allowTextSelection is deprecated and enabled by default"), we(function() {
|
|
850
|
+
!u.current && typeof oe != "string" && console.error("FocusLock: could not obtain ref to internal node");
|
|
851
|
+
}, []));
|
|
852
|
+
var l = me((n = {}, n[Ar] = g && "disabled", n[Le] = G, n), K), U = E !== !0, ue = U && E !== "tail", Te = Dt([t, L]), vt = mt(function() {
|
|
853
|
+
return {
|
|
854
|
+
observed: u,
|
|
855
|
+
shards: Z,
|
|
856
|
+
enabled: !g,
|
|
857
|
+
get active() {
|
|
858
|
+
return b.current;
|
|
859
|
+
}
|
|
860
|
+
};
|
|
861
|
+
}, [g, b, Z, u]);
|
|
862
|
+
return /* @__PURE__ */ X.createElement(bt, null, U && [
|
|
863
|
+
/* @__PURE__ */ X.createElement("div", {
|
|
864
|
+
key: "guard-first",
|
|
865
|
+
"data-focus-guard": !0,
|
|
866
|
+
tabIndex: g ? -1 : 0,
|
|
867
|
+
style: Me
|
|
868
|
+
}),
|
|
869
|
+
V ? /* @__PURE__ */ X.createElement("div", {
|
|
870
|
+
key: "guard-nearest",
|
|
871
|
+
"data-focus-guard": !0,
|
|
872
|
+
tabIndex: g ? -1 : 1,
|
|
873
|
+
style: Me
|
|
874
|
+
}) : null
|
|
875
|
+
], !g && /* @__PURE__ */ X.createElement(ae, {
|
|
876
|
+
id: R,
|
|
877
|
+
sideCar: Wt,
|
|
878
|
+
observed: a,
|
|
879
|
+
disabled: g,
|
|
880
|
+
persistentFocus: $,
|
|
881
|
+
crossFrame: F,
|
|
882
|
+
autoFocus: k,
|
|
883
|
+
whiteList: _,
|
|
884
|
+
shards: Z,
|
|
885
|
+
onActivation: S,
|
|
886
|
+
onDeactivation: P,
|
|
887
|
+
returnFocus: A,
|
|
888
|
+
focusOptions: y,
|
|
889
|
+
noFocusGuards: E
|
|
890
|
+
}), /* @__PURE__ */ X.createElement(oe, me({
|
|
891
|
+
ref: Te
|
|
892
|
+
}, l, {
|
|
893
|
+
className: z,
|
|
894
|
+
onBlur: I,
|
|
895
|
+
onFocus: M
|
|
896
|
+
}), /* @__PURE__ */ X.createElement(qt.Provider, {
|
|
897
|
+
value: vt
|
|
898
|
+
}, p)), ue && /* @__PURE__ */ X.createElement("div", {
|
|
899
|
+
"data-focus-guard": !0,
|
|
900
|
+
tabIndex: g ? -1 : 0,
|
|
901
|
+
style: Me
|
|
902
|
+
}));
|
|
903
|
+
});
|
|
904
|
+
He.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
905
|
+
children: D.node,
|
|
906
|
+
disabled: D.bool,
|
|
907
|
+
returnFocus: D.oneOfType([D.bool, D.object, D.func]),
|
|
908
|
+
focusOptions: D.object,
|
|
909
|
+
noFocusGuards: D.bool,
|
|
910
|
+
hasPositiveIndices: D.bool,
|
|
911
|
+
allowTextSelection: D.bool,
|
|
912
|
+
autoFocus: D.bool,
|
|
913
|
+
persistentFocus: D.bool,
|
|
914
|
+
crossFrame: D.bool,
|
|
915
|
+
group: D.string,
|
|
916
|
+
className: D.string,
|
|
917
|
+
whiteList: D.func,
|
|
918
|
+
shards: D.arrayOf(D.any),
|
|
919
|
+
as: D.oneOfType([D.string, D.func, D.object]),
|
|
920
|
+
lockProps: D.object,
|
|
921
|
+
onActivation: D.func,
|
|
922
|
+
onDeactivation: D.func,
|
|
923
|
+
sideCar: D.any.isRequired
|
|
924
|
+
} : {};
|
|
925
|
+
function qe(e, r) {
|
|
926
|
+
return qe = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, n) {
|
|
927
|
+
return t.__proto__ = n, t;
|
|
928
|
+
}, qe(e, r);
|
|
929
|
+
}
|
|
930
|
+
function Bt(e, r) {
|
|
931
|
+
e.prototype = Object.create(r.prototype), e.prototype.constructor = e, qe(e, r);
|
|
932
|
+
}
|
|
933
|
+
function be(e) {
|
|
934
|
+
"@babel/helpers - typeof";
|
|
935
|
+
return be = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(r) {
|
|
936
|
+
return typeof r;
|
|
937
|
+
} : function(r) {
|
|
938
|
+
return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
|
|
939
|
+
}, be(e);
|
|
940
|
+
}
|
|
941
|
+
function Yt(e, r) {
|
|
942
|
+
if (be(e) != "object" || !e) return e;
|
|
943
|
+
var t = e[Symbol.toPrimitive];
|
|
944
|
+
if (t !== void 0) {
|
|
945
|
+
var n = t.call(e, r);
|
|
946
|
+
if (be(n) != "object") return n;
|
|
947
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
948
|
+
}
|
|
949
|
+
return (r === "string" ? String : Number)(e);
|
|
950
|
+
}
|
|
951
|
+
function Gt(e) {
|
|
952
|
+
var r = Yt(e, "string");
|
|
953
|
+
return be(r) == "symbol" ? r : r + "";
|
|
954
|
+
}
|
|
955
|
+
function Vt(e, r, t) {
|
|
956
|
+
return (r = Gt(r)) in e ? Object.defineProperty(e, r, {
|
|
957
|
+
value: t,
|
|
958
|
+
enumerable: !0,
|
|
959
|
+
configurable: !0,
|
|
960
|
+
writable: !0
|
|
961
|
+
}) : e[r] = t, e;
|
|
962
|
+
}
|
|
963
|
+
function Ht(e, r) {
|
|
964
|
+
if (process.env.NODE_ENV !== "production") {
|
|
965
|
+
if (typeof e != "function")
|
|
966
|
+
throw new Error("Expected reducePropsToState to be a function.");
|
|
967
|
+
if (typeof r != "function")
|
|
968
|
+
throw new Error("Expected handleStateChangeOnClient to be a function.");
|
|
969
|
+
}
|
|
970
|
+
function t(n) {
|
|
971
|
+
return n.displayName || n.name || "Component";
|
|
972
|
+
}
|
|
973
|
+
return function(o) {
|
|
974
|
+
if (process.env.NODE_ENV !== "production" && typeof o != "function")
|
|
975
|
+
throw new Error("Expected WrappedComponent to be a React component.");
|
|
976
|
+
var a = [], i;
|
|
977
|
+
function u() {
|
|
978
|
+
i = e(a.map(function(f) {
|
|
979
|
+
return f.props;
|
|
980
|
+
})), r(i);
|
|
981
|
+
}
|
|
982
|
+
var b = /* @__PURE__ */ function(f) {
|
|
983
|
+
Bt(v, f);
|
|
984
|
+
function v() {
|
|
985
|
+
return f.apply(this, arguments) || this;
|
|
986
|
+
}
|
|
987
|
+
v.peek = function() {
|
|
988
|
+
return i;
|
|
989
|
+
};
|
|
990
|
+
var d = v.prototype;
|
|
991
|
+
return d.componentDidMount = function() {
|
|
992
|
+
a.push(this), u();
|
|
993
|
+
}, d.componentDidUpdate = function() {
|
|
994
|
+
u();
|
|
995
|
+
}, d.componentWillUnmount = function() {
|
|
996
|
+
var h = a.indexOf(this);
|
|
997
|
+
a.splice(h, 1), u();
|
|
998
|
+
}, d.render = function() {
|
|
999
|
+
return /* @__PURE__ */ X.createElement(o, this.props);
|
|
1000
|
+
}, v;
|
|
1001
|
+
}(ht);
|
|
1002
|
+
return Vt(b, "displayName", "SideEffect(" + t(o) + ")"), b;
|
|
1003
|
+
};
|
|
1004
|
+
}
|
|
1005
|
+
var H = function(e) {
|
|
1006
|
+
for (var r = Array(e.length), t = 0; t < e.length; ++t)
|
|
1007
|
+
r[t] = e[t];
|
|
1008
|
+
return r;
|
|
1009
|
+
}, te = function(e) {
|
|
1010
|
+
return Array.isArray(e) ? e : [e];
|
|
1011
|
+
}, Nr = function(e) {
|
|
1012
|
+
return Array.isArray(e) ? e[0] : e;
|
|
1013
|
+
}, zt = function(e) {
|
|
1014
|
+
if (e.nodeType !== Node.ELEMENT_NODE)
|
|
1015
|
+
return !1;
|
|
1016
|
+
var r = window.getComputedStyle(e, null);
|
|
1017
|
+
return !r || !r.getPropertyValue ? !1 : r.getPropertyValue("display") === "none" || r.getPropertyValue("visibility") === "hidden";
|
|
1018
|
+
}, jr = function(e) {
|
|
1019
|
+
return e.parentNode && e.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? (
|
|
1020
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1021
|
+
e.parentNode.host
|
|
1022
|
+
) : e.parentNode;
|
|
1023
|
+
}, Dr = function(e) {
|
|
1024
|
+
return e === document || e && e.nodeType === Node.DOCUMENT_NODE;
|
|
1025
|
+
}, Jt = function(e) {
|
|
1026
|
+
return e.hasAttribute("inert");
|
|
1027
|
+
}, Kt = function(e, r) {
|
|
1028
|
+
return !e || Dr(e) || !zt(e) && !Jt(e) && r(jr(e));
|
|
1029
|
+
}, kr = function(e, r) {
|
|
1030
|
+
var t = e.get(r);
|
|
1031
|
+
if (t !== void 0)
|
|
1032
|
+
return t;
|
|
1033
|
+
var n = Kt(r, kr.bind(void 0, e));
|
|
1034
|
+
return e.set(r, n), n;
|
|
1035
|
+
}, Qt = function(e, r) {
|
|
1036
|
+
return e && !Dr(e) ? en(e) ? r(jr(e)) : !1 : !0;
|
|
1037
|
+
}, Lr = function(e, r) {
|
|
1038
|
+
var t = e.get(r);
|
|
1039
|
+
if (t !== void 0)
|
|
1040
|
+
return t;
|
|
1041
|
+
var n = Qt(r, Lr.bind(void 0, e));
|
|
1042
|
+
return e.set(r, n), n;
|
|
1043
|
+
}, Wr = function(e) {
|
|
1044
|
+
return e.dataset;
|
|
1045
|
+
}, Xt = function(e) {
|
|
1046
|
+
return e.tagName === "BUTTON";
|
|
1047
|
+
}, qr = function(e) {
|
|
1048
|
+
return e.tagName === "INPUT";
|
|
1049
|
+
}, Ur = function(e) {
|
|
1050
|
+
return qr(e) && e.type === "radio";
|
|
1051
|
+
}, Zt = function(e) {
|
|
1052
|
+
return !((qr(e) || Xt(e)) && (e.type === "hidden" || e.disabled));
|
|
1053
|
+
}, en = function(e) {
|
|
1054
|
+
var r = e.getAttribute(Mt);
|
|
1055
|
+
return ![!0, "true", ""].includes(r);
|
|
1056
|
+
}, ze = function(e) {
|
|
1057
|
+
var r;
|
|
1058
|
+
return !!(e && (!((r = Wr(e)) === null || r === void 0) && r.focusGuard));
|
|
1059
|
+
}, Ue = function(e) {
|
|
1060
|
+
return !ze(e);
|
|
1061
|
+
}, rn = function(e) {
|
|
1062
|
+
return !!e;
|
|
1063
|
+
}, tn = function(e, r) {
|
|
1064
|
+
var t = Math.max(0, e.tabIndex), n = Math.max(0, r.tabIndex), o = t - n, a = e.index - r.index;
|
|
1065
|
+
if (o) {
|
|
1066
|
+
if (!t)
|
|
1067
|
+
return 1;
|
|
1068
|
+
if (!n)
|
|
1069
|
+
return -1;
|
|
1070
|
+
}
|
|
1071
|
+
return o || a;
|
|
1072
|
+
}, nn = function(e) {
|
|
1073
|
+
return e.tabIndex < 0 && !e.hasAttribute("tabindex") ? 0 : e.tabIndex;
|
|
1074
|
+
}, Je = function(e, r, t) {
|
|
1075
|
+
return H(e).map(function(n, o) {
|
|
1076
|
+
var a = nn(n);
|
|
1077
|
+
return {
|
|
1078
|
+
node: n,
|
|
1079
|
+
index: o,
|
|
1080
|
+
tabIndex: t && a === -1 ? (n.dataset || {}).focusGuard ? 0 : -1 : a
|
|
1081
|
+
};
|
|
1082
|
+
}).filter(function(n) {
|
|
1083
|
+
return !r || n.tabIndex >= 0;
|
|
1084
|
+
}).sort(tn);
|
|
1085
|
+
}, on = [
|
|
1086
|
+
"button:enabled",
|
|
1087
|
+
"select:enabled",
|
|
1088
|
+
"textarea:enabled",
|
|
1089
|
+
"input:enabled",
|
|
1090
|
+
// elements with explicit roles will also use explicit tabindex
|
|
1091
|
+
// '[role="button"]',
|
|
1092
|
+
"a[href]",
|
|
1093
|
+
"area[href]",
|
|
1094
|
+
"summary",
|
|
1095
|
+
"iframe",
|
|
1096
|
+
"object",
|
|
1097
|
+
"embed",
|
|
1098
|
+
"audio[controls]",
|
|
1099
|
+
"video[controls]",
|
|
1100
|
+
"[tabindex]",
|
|
1101
|
+
"[contenteditable]",
|
|
1102
|
+
"[autofocus]"
|
|
1103
|
+
], Ke = on.join(","), an = "".concat(Ke, ", [data-focus-guard]"), Br = function(e, r) {
|
|
1104
|
+
return H((e.shadowRoot || e).children).reduce(function(t, n) {
|
|
1105
|
+
return t.concat(n.matches(r ? an : Ke) ? [n] : [], Br(n));
|
|
1106
|
+
}, []);
|
|
1107
|
+
}, un = function(e, r) {
|
|
1108
|
+
var t;
|
|
1109
|
+
return e instanceof HTMLIFrameElement && (!((t = e.contentDocument) === null || t === void 0) && t.body) ? ve([e.contentDocument.body], r) : [e];
|
|
1110
|
+
}, ve = function(e, r) {
|
|
1111
|
+
return e.reduce(function(t, n) {
|
|
1112
|
+
var o, a = Br(n, r), i = (o = []).concat.apply(o, a.map(function(u) {
|
|
1113
|
+
return un(u, r);
|
|
1114
|
+
}));
|
|
1115
|
+
return t.concat(
|
|
1116
|
+
// add all tabbables inside and within shadow DOMs in DOM order
|
|
1117
|
+
i,
|
|
1118
|
+
// add if node is tabbable itself
|
|
1119
|
+
n.parentNode ? H(n.parentNode.querySelectorAll(Ke)).filter(function(u) {
|
|
1120
|
+
return u === n;
|
|
1121
|
+
}) : []
|
|
1122
|
+
);
|
|
1123
|
+
}, []);
|
|
1124
|
+
}, cn = function(e) {
|
|
1125
|
+
var r = e.querySelectorAll("[".concat($t, "]"));
|
|
1126
|
+
return H(r).map(function(t) {
|
|
1127
|
+
return ve([t]);
|
|
1128
|
+
}).reduce(function(t, n) {
|
|
1129
|
+
return t.concat(n);
|
|
1130
|
+
}, []);
|
|
1131
|
+
}, Qe = function(e, r) {
|
|
1132
|
+
return H(e).filter(function(t) {
|
|
1133
|
+
return kr(r, t);
|
|
1134
|
+
}).filter(function(t) {
|
|
1135
|
+
return Zt(t);
|
|
1136
|
+
});
|
|
1137
|
+
}, hr = function(e, r) {
|
|
1138
|
+
return r === void 0 && (r = /* @__PURE__ */ new Map()), H(e).filter(function(t) {
|
|
1139
|
+
return Lr(r, t);
|
|
1140
|
+
});
|
|
1141
|
+
}, Xe = function(e, r, t) {
|
|
1142
|
+
return Je(Qe(ve(e, t), r), !0, t);
|
|
1143
|
+
}, he = function(e, r) {
|
|
1144
|
+
return Je(Qe(ve(e), r), !1);
|
|
1145
|
+
}, sn = function(e, r) {
|
|
1146
|
+
return Qe(cn(e), r);
|
|
1147
|
+
}, re = function(e, r) {
|
|
1148
|
+
return e.shadowRoot ? re(e.shadowRoot, r) : Object.getPrototypeOf(e).contains !== void 0 && Object.getPrototypeOf(e).contains.call(e, r) ? !0 : H(e.children).some(function(t) {
|
|
1149
|
+
var n;
|
|
1150
|
+
if (t instanceof HTMLIFrameElement) {
|
|
1151
|
+
var o = (n = t.contentDocument) === null || n === void 0 ? void 0 : n.body;
|
|
1152
|
+
return o ? re(o, r) : !1;
|
|
1153
|
+
}
|
|
1154
|
+
return re(t, r);
|
|
1155
|
+
});
|
|
1156
|
+
}, fn = function(e) {
|
|
1157
|
+
for (var r = /* @__PURE__ */ new Set(), t = e.length, n = 0; n < t; n += 1)
|
|
1158
|
+
for (var o = n + 1; o < t; o += 1) {
|
|
1159
|
+
var a = e[n].compareDocumentPosition(e[o]);
|
|
1160
|
+
(a & Node.DOCUMENT_POSITION_CONTAINED_BY) > 0 && r.add(o), (a & Node.DOCUMENT_POSITION_CONTAINS) > 0 && r.add(n);
|
|
1161
|
+
}
|
|
1162
|
+
return e.filter(function(i, u) {
|
|
1163
|
+
return !r.has(u);
|
|
1164
|
+
});
|
|
1165
|
+
}, Yr = function(e) {
|
|
1166
|
+
return e.parentNode ? Yr(e.parentNode) : e;
|
|
1167
|
+
}, Ze = function(e) {
|
|
1168
|
+
var r = te(e);
|
|
1169
|
+
return r.filter(Boolean).reduce(function(t, n) {
|
|
1170
|
+
var o = n.getAttribute(Le);
|
|
1171
|
+
return t.push.apply(t, o ? fn(H(Yr(n).querySelectorAll("[".concat(Le, '="').concat(o, '"]:not([').concat(Ar, '="disabled"])')))) : [n]), t;
|
|
1172
|
+
}, []);
|
|
1173
|
+
}, dn = function(e) {
|
|
1174
|
+
try {
|
|
1175
|
+
return e();
|
|
1176
|
+
} catch {
|
|
1177
|
+
return;
|
|
1178
|
+
}
|
|
1179
|
+
}, ge = function(e) {
|
|
1180
|
+
if (e === void 0 && (e = document), !(!e || !e.activeElement)) {
|
|
1181
|
+
var r = e.activeElement;
|
|
1182
|
+
return r.shadowRoot ? ge(r.shadowRoot) : r instanceof HTMLIFrameElement && dn(function() {
|
|
1183
|
+
return r.contentWindow.document;
|
|
1184
|
+
}) ? ge(r.contentWindow.document) : r;
|
|
1185
|
+
}
|
|
1186
|
+
}, ln = function(e, r) {
|
|
1187
|
+
return e === r;
|
|
1188
|
+
}, vn = function(e, r) {
|
|
1189
|
+
return !!H(e.querySelectorAll("iframe")).some(function(t) {
|
|
1190
|
+
return ln(t, r);
|
|
1191
|
+
});
|
|
1192
|
+
}, Gr = function(e, r) {
|
|
1193
|
+
return r === void 0 && (r = ge(Nr(e).ownerDocument)), !r || r.dataset && r.dataset.focusGuard ? !1 : Ze(e).some(function(t) {
|
|
1194
|
+
return re(t, r) || vn(t, r);
|
|
1195
|
+
});
|
|
1196
|
+
}, pn = function(e) {
|
|
1197
|
+
e === void 0 && (e = document);
|
|
1198
|
+
var r = ge(e);
|
|
1199
|
+
return r ? H(e.querySelectorAll("[".concat(Ct, "]"))).some(function(t) {
|
|
1200
|
+
return re(t, r);
|
|
1201
|
+
}) : !1;
|
|
1202
|
+
}, yn = function(e, r) {
|
|
1203
|
+
return r.filter(Ur).filter(function(t) {
|
|
1204
|
+
return t.name === e.name;
|
|
1205
|
+
}).filter(function(t) {
|
|
1206
|
+
return t.checked;
|
|
1207
|
+
})[0] || e;
|
|
1208
|
+
}, er = function(e, r) {
|
|
1209
|
+
return Ur(e) && e.name ? yn(e, r) : e;
|
|
1210
|
+
}, mn = function(e) {
|
|
1211
|
+
var r = /* @__PURE__ */ new Set();
|
|
1212
|
+
return e.forEach(function(t) {
|
|
1213
|
+
return r.add(er(t, e));
|
|
1214
|
+
}), e.filter(function(t) {
|
|
1215
|
+
return r.has(t);
|
|
1216
|
+
});
|
|
1217
|
+
}, gr = function(e) {
|
|
1218
|
+
return e[0] && e.length > 1 ? er(e[0], e) : e[0];
|
|
1219
|
+
}, Er = function(e, r) {
|
|
1220
|
+
return e.indexOf(er(r, e));
|
|
1221
|
+
}, Be = "NEW_FOCUS", bn = function(e, r, t, n, o) {
|
|
1222
|
+
var a = e.length, i = e[0], u = e[a - 1], b = ze(n);
|
|
1223
|
+
if (!(n && e.indexOf(n) >= 0)) {
|
|
1224
|
+
var f = n !== void 0 ? t.indexOf(n) : -1, v = o ? t.indexOf(o) : f, d = o ? e.indexOf(o) : -1;
|
|
1225
|
+
if (f === -1)
|
|
1226
|
+
return d !== -1 ? d : Be;
|
|
1227
|
+
if (d === -1)
|
|
1228
|
+
return Be;
|
|
1229
|
+
var p = f - v, h = t.indexOf(i), g = t.indexOf(u), m = mn(t), E = n !== void 0 ? m.indexOf(n) : -1, C = o ? m.indexOf(o) : E, $ = m.filter(function(G) {
|
|
1230
|
+
return G.tabIndex >= 0;
|
|
1231
|
+
}), O = n !== void 0 ? $.indexOf(n) : -1, F = o ? $.indexOf(o) : O, s = O >= 0 && F >= 0 ? (
|
|
1232
|
+
// old/new are tabbables, measure distance in tabbable space
|
|
1233
|
+
F - O
|
|
1234
|
+
) : (
|
|
1235
|
+
// or else measure in focusable space
|
|
1236
|
+
C - E
|
|
1237
|
+
);
|
|
1238
|
+
if (!p && d >= 0 || r.length === 0)
|
|
1239
|
+
return d;
|
|
1240
|
+
var k = Er(e, r[0]), B = Er(e, r[r.length - 1]);
|
|
1241
|
+
if (f <= h && b && Math.abs(p) > 1)
|
|
1242
|
+
return B;
|
|
1243
|
+
if (f >= g && b && Math.abs(p) > 1)
|
|
1244
|
+
return k;
|
|
1245
|
+
if (p && Math.abs(s) > 1)
|
|
1246
|
+
return d;
|
|
1247
|
+
if (f <= h)
|
|
1248
|
+
return B;
|
|
1249
|
+
if (f > g)
|
|
1250
|
+
return k;
|
|
1251
|
+
if (p)
|
|
1252
|
+
return Math.abs(p) > 1 ? d : (a + d + p) % a;
|
|
1253
|
+
}
|
|
1254
|
+
}, hn = function(e) {
|
|
1255
|
+
return function(r) {
|
|
1256
|
+
var t, n = (t = Wr(r)) === null || t === void 0 ? void 0 : t.autofocus;
|
|
1257
|
+
return (
|
|
1258
|
+
// @ts-expect-error
|
|
1259
|
+
r.autofocus || //
|
|
1260
|
+
n !== void 0 && n !== "false" || //
|
|
1261
|
+
e.indexOf(r) >= 0
|
|
1262
|
+
);
|
|
1263
|
+
};
|
|
1264
|
+
}, Tr = function(e, r, t) {
|
|
1265
|
+
var n = e.map(function(a) {
|
|
1266
|
+
var i = a.node;
|
|
1267
|
+
return i;
|
|
1268
|
+
}), o = hr(n.filter(hn(t)));
|
|
1269
|
+
return o && o.length ? gr(o) : gr(hr(r));
|
|
1270
|
+
}, Ye = function(e, r) {
|
|
1271
|
+
return r === void 0 && (r = []), r.push(e), e.parentNode && Ye(e.parentNode.host || e.parentNode, r), r;
|
|
1272
|
+
}, Ne = function(e, r) {
|
|
1273
|
+
for (var t = Ye(e), n = Ye(r), o = 0; o < t.length; o += 1) {
|
|
1274
|
+
var a = t[o];
|
|
1275
|
+
if (n.indexOf(a) >= 0)
|
|
1276
|
+
return a;
|
|
1277
|
+
}
|
|
1278
|
+
return !1;
|
|
1279
|
+
}, Vr = function(e, r, t) {
|
|
1280
|
+
var n = te(e), o = te(r), a = n[0], i = !1;
|
|
1281
|
+
return o.filter(Boolean).forEach(function(u) {
|
|
1282
|
+
i = Ne(i || u, u) || i, t.filter(Boolean).forEach(function(b) {
|
|
1283
|
+
var f = Ne(a, b);
|
|
1284
|
+
f && (!i || re(f, i) ? i = f : i = Ne(f, i));
|
|
1285
|
+
});
|
|
1286
|
+
}), i;
|
|
1287
|
+
}, Or = function(e, r) {
|
|
1288
|
+
return e.reduce(function(t, n) {
|
|
1289
|
+
return t.concat(sn(n, r));
|
|
1290
|
+
}, []);
|
|
1291
|
+
}, gn = function(e, r) {
|
|
1292
|
+
var t = /* @__PURE__ */ new Map();
|
|
1293
|
+
return r.forEach(function(n) {
|
|
1294
|
+
return t.set(n.node, n);
|
|
1295
|
+
}), e.map(function(n) {
|
|
1296
|
+
return t.get(n);
|
|
1297
|
+
}).filter(rn);
|
|
1298
|
+
}, En = function(e, r) {
|
|
1299
|
+
var t = ge(te(e).length > 0 ? document : Nr(e).ownerDocument), n = Ze(e).filter(Ue), o = Vr(t || e, e, n), a = /* @__PURE__ */ new Map(), i = he(n, a), u = i.filter(function(g) {
|
|
1300
|
+
var m = g.node;
|
|
1301
|
+
return Ue(m);
|
|
1302
|
+
});
|
|
1303
|
+
if (u[0]) {
|
|
1304
|
+
var b = he([o], a).map(function(g) {
|
|
1305
|
+
var m = g.node;
|
|
1306
|
+
return m;
|
|
1307
|
+
}), f = gn(b, u), v = f.map(function(g) {
|
|
1308
|
+
var m = g.node;
|
|
1309
|
+
return m;
|
|
1310
|
+
}), d = f.filter(function(g) {
|
|
1311
|
+
var m = g.tabIndex;
|
|
1312
|
+
return m >= 0;
|
|
1313
|
+
}).map(function(g) {
|
|
1314
|
+
var m = g.node;
|
|
1315
|
+
return m;
|
|
1316
|
+
}), p = bn(v, d, b, t, r);
|
|
1317
|
+
if (p === Be) {
|
|
1318
|
+
var h = (
|
|
1319
|
+
// first try only tabbable, and the fallback to all focusable, as long as at least one element should be picked for focus
|
|
1320
|
+
Tr(i, d, Or(n, a)) || Tr(i, v, Or(n, a))
|
|
1321
|
+
);
|
|
1322
|
+
if (h)
|
|
1323
|
+
return { node: h };
|
|
1324
|
+
console.warn("focus-lock: cannot find any node to move focus into");
|
|
1325
|
+
return;
|
|
1326
|
+
}
|
|
1327
|
+
return p === void 0 ? p : f[p];
|
|
1328
|
+
}
|
|
1329
|
+
}, Tn = function(e) {
|
|
1330
|
+
var r = Ze(e).filter(Ue), t = Vr(e, e, r), n = Je(ve([t], !0), !0, !0), o = ve(r, !1);
|
|
1331
|
+
return n.map(function(a) {
|
|
1332
|
+
var i = a.node, u = a.index;
|
|
1333
|
+
return {
|
|
1334
|
+
node: i,
|
|
1335
|
+
index: u,
|
|
1336
|
+
lockItem: o.indexOf(i) >= 0,
|
|
1337
|
+
guard: ze(i)
|
|
1338
|
+
};
|
|
1339
|
+
});
|
|
1340
|
+
}, rr = function(e, r) {
|
|
1341
|
+
e && ("focus" in e && e.focus(r), "contentWindow" in e && e.contentWindow && e.contentWindow.focus());
|
|
1342
|
+
}, je = 0, De = !1, Hr = function(e, r, t) {
|
|
1343
|
+
t === void 0 && (t = {});
|
|
1344
|
+
var n = En(e, r);
|
|
1345
|
+
if (!De && n) {
|
|
1346
|
+
if (je > 2) {
|
|
1347
|
+
console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"), De = !0, setTimeout(function() {
|
|
1348
|
+
De = !1;
|
|
1349
|
+
}, 1);
|
|
1350
|
+
return;
|
|
1351
|
+
}
|
|
1352
|
+
je++, rr(n.node, t.focusOptions), je--;
|
|
1353
|
+
}
|
|
1354
|
+
};
|
|
1355
|
+
function ye(e) {
|
|
1356
|
+
if (!e)
|
|
1357
|
+
return null;
|
|
1358
|
+
if (typeof WeakRef > "u")
|
|
1359
|
+
return function() {
|
|
1360
|
+
return e || null;
|
|
1361
|
+
};
|
|
1362
|
+
var r = e ? new WeakRef(e) : null;
|
|
1363
|
+
return function() {
|
|
1364
|
+
return (r == null ? void 0 : r.deref()) || null;
|
|
1365
|
+
};
|
|
1366
|
+
}
|
|
1367
|
+
var On = function(e) {
|
|
1368
|
+
if (!e)
|
|
1369
|
+
return null;
|
|
1370
|
+
for (var r = [], t = e; t && t !== document.body; )
|
|
1371
|
+
r.push({
|
|
1372
|
+
current: ye(t),
|
|
1373
|
+
parent: ye(t.parentElement),
|
|
1374
|
+
left: ye(t.previousElementSibling),
|
|
1375
|
+
right: ye(t.nextElementSibling)
|
|
1376
|
+
}), t = t.parentElement;
|
|
1377
|
+
return {
|
|
1378
|
+
element: ye(e),
|
|
1379
|
+
stack: r,
|
|
1380
|
+
ownerDocument: e.ownerDocument
|
|
1381
|
+
};
|
|
1382
|
+
}, xn = function(e) {
|
|
1383
|
+
var r, t, n, o, a;
|
|
1384
|
+
if (e)
|
|
1385
|
+
for (var i = e.stack, u = e.ownerDocument, b = /* @__PURE__ */ new Map(), f = 0, v = i; f < v.length; f++) {
|
|
1386
|
+
var d = v[f], p = (r = d.parent) === null || r === void 0 ? void 0 : r.call(d);
|
|
1387
|
+
if (p && u.contains(p)) {
|
|
1388
|
+
for (var h = (t = d.left) === null || t === void 0 ? void 0 : t.call(d), g = d.current(), m = p.contains(g) ? g : void 0, E = (n = d.right) === null || n === void 0 ? void 0 : n.call(d), C = Xe([p], b), $ = (
|
|
1389
|
+
// that is element itself
|
|
1390
|
+
(a = (o = m ?? // or something in it's place
|
|
1391
|
+
(h == null ? void 0 : h.nextElementSibling)) !== null && o !== void 0 ? o : (
|
|
1392
|
+
// or somebody to the right, still close enough
|
|
1393
|
+
E
|
|
1394
|
+
)) !== null && a !== void 0 ? a : (
|
|
1395
|
+
// or somebody to the left, something?
|
|
1396
|
+
h
|
|
1397
|
+
)
|
|
1398
|
+
); $; ) {
|
|
1399
|
+
for (var O = 0, F = C; O < F.length; O++) {
|
|
1400
|
+
var s = F[O];
|
|
1401
|
+
if ($ != null && $.contains(s.node))
|
|
1402
|
+
return s.node;
|
|
1403
|
+
}
|
|
1404
|
+
$ = $.nextElementSibling;
|
|
1405
|
+
}
|
|
1406
|
+
if (C.length)
|
|
1407
|
+
return C[0].node;
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
}, zr = function(e) {
|
|
1411
|
+
var r = On(e);
|
|
1412
|
+
return function() {
|
|
1413
|
+
return xn(r);
|
|
1414
|
+
};
|
|
1415
|
+
}, wn = function(e, r, t) {
|
|
1416
|
+
if (!e || !r)
|
|
1417
|
+
return console.error("no element or scope given"), {};
|
|
1418
|
+
var n = te(r);
|
|
1419
|
+
if (n.every(function(i) {
|
|
1420
|
+
return !re(i, e);
|
|
1421
|
+
}))
|
|
1422
|
+
return console.error("Active element is not contained in the scope"), {};
|
|
1423
|
+
var o = t ? Xe(n, /* @__PURE__ */ new Map()) : he(n, /* @__PURE__ */ new Map()), a = o.findIndex(function(i) {
|
|
1424
|
+
var u = i.node;
|
|
1425
|
+
return u === e;
|
|
1426
|
+
});
|
|
1427
|
+
if (a !== -1)
|
|
1428
|
+
return {
|
|
1429
|
+
prev: o[a - 1],
|
|
1430
|
+
next: o[a + 1],
|
|
1431
|
+
first: o[0],
|
|
1432
|
+
last: o[o.length - 1]
|
|
1433
|
+
};
|
|
1434
|
+
}, Sn = function(e, r) {
|
|
1435
|
+
var t = r ? Xe(te(e), /* @__PURE__ */ new Map()) : he(te(e), /* @__PURE__ */ new Map());
|
|
1436
|
+
return {
|
|
1437
|
+
first: t[0],
|
|
1438
|
+
last: t[t.length - 1]
|
|
1439
|
+
};
|
|
1440
|
+
}, Pn = function(e) {
|
|
1441
|
+
return Object.assign({
|
|
1442
|
+
scope: document.body,
|
|
1443
|
+
cycle: !0,
|
|
1444
|
+
onlyTabbable: !0
|
|
1445
|
+
}, e);
|
|
1446
|
+
}, Jr = function(e, r, t) {
|
|
1447
|
+
r === void 0 && (r = {});
|
|
1448
|
+
var n = Pn(r), o = wn(e, n.scope, n.onlyTabbable);
|
|
1449
|
+
if (o) {
|
|
1450
|
+
var a = t(o, n.cycle);
|
|
1451
|
+
a && rr(a.node, n.focusOptions);
|
|
1452
|
+
}
|
|
1453
|
+
}, _n = function(e, r) {
|
|
1454
|
+
r === void 0 && (r = {}), Jr(e, r, function(t, n) {
|
|
1455
|
+
var o = t.next, a = t.first;
|
|
1456
|
+
return o || n && a;
|
|
1457
|
+
});
|
|
1458
|
+
}, Fn = function(e, r) {
|
|
1459
|
+
r === void 0 && (r = {}), Jr(e, r, function(t, n) {
|
|
1460
|
+
var o = t.prev, a = t.last;
|
|
1461
|
+
return o || n && a;
|
|
1462
|
+
});
|
|
1463
|
+
}, Kr = function(e, r, t) {
|
|
1464
|
+
var n, o = Sn(e, (n = r.onlyTabbable) !== null && n !== void 0 ? n : !0), a = o[t];
|
|
1465
|
+
a && rr(a.node, r.focusOptions);
|
|
1466
|
+
}, Rn = function(e, r) {
|
|
1467
|
+
r === void 0 && (r = {}), Kr(e, r, "first");
|
|
1468
|
+
}, An = function(e, r) {
|
|
1469
|
+
r === void 0 && (r = {}), Kr(e, r, "last");
|
|
1470
|
+
};
|
|
1471
|
+
function tr(e) {
|
|
1472
|
+
setTimeout(e, 1);
|
|
1473
|
+
}
|
|
1474
|
+
var In = function(r) {
|
|
1475
|
+
return r && "current" in r ? r.current : r;
|
|
1476
|
+
}, Qr = function() {
|
|
1477
|
+
return document && document.activeElement === document.body;
|
|
1478
|
+
}, Cn = function() {
|
|
1479
|
+
return Qr() || pn();
|
|
1480
|
+
}, de = null, W = null, xr = function() {
|
|
1481
|
+
return null;
|
|
1482
|
+
}, le = null, Ee = !1, nr = !1, $n = function() {
|
|
1483
|
+
return !0;
|
|
1484
|
+
}, Mn = function(r) {
|
|
1485
|
+
return (de.whiteList || $n)(r);
|
|
1486
|
+
}, Nn = function(r, t) {
|
|
1487
|
+
le = {
|
|
1488
|
+
observerNode: r,
|
|
1489
|
+
portaledElement: t
|
|
1490
|
+
};
|
|
1491
|
+
}, jn = function(r) {
|
|
1492
|
+
return le && le.portaledElement === r;
|
|
1493
|
+
};
|
|
1494
|
+
function wr(e, r, t, n) {
|
|
1495
|
+
var o = null, a = e;
|
|
1496
|
+
do {
|
|
1497
|
+
var i = n[a];
|
|
1498
|
+
if (i.guard)
|
|
1499
|
+
i.node.dataset.focusAutoGuard && (o = i);
|
|
1500
|
+
else if (i.lockItem) {
|
|
1501
|
+
if (a !== e)
|
|
1502
|
+
return;
|
|
1503
|
+
o = null;
|
|
1504
|
+
} else
|
|
1505
|
+
break;
|
|
1506
|
+
} while ((a += t) !== r);
|
|
1507
|
+
o && (o.node.tabIndex = 0);
|
|
1508
|
+
}
|
|
1509
|
+
var Dn = function(r) {
|
|
1510
|
+
return r ? !!Ee : Ee === "meanwhile";
|
|
1511
|
+
}, kn = function e(r, t, n) {
|
|
1512
|
+
return t && (t.host === r && (!t.activeElement || n.contains(t.activeElement)) || t.parentNode && e(r, t.parentNode, n));
|
|
1513
|
+
}, Ln = function(r, t) {
|
|
1514
|
+
return t.some(function(n) {
|
|
1515
|
+
return kn(r, n, n);
|
|
1516
|
+
});
|
|
1517
|
+
}, Xr = function(r) {
|
|
1518
|
+
return he(r, /* @__PURE__ */ new Map());
|
|
1519
|
+
}, Wn = function(r) {
|
|
1520
|
+
return !Xr([r.parentNode]).some(function(t) {
|
|
1521
|
+
return t.node === r;
|
|
1522
|
+
});
|
|
1523
|
+
}, Se = function() {
|
|
1524
|
+
var r = !1;
|
|
1525
|
+
if (de) {
|
|
1526
|
+
var t = de, n = t.observed, o = t.persistentFocus, a = t.autoFocus, i = t.shards, u = t.crossFrame, b = t.focusOptions, f = t.noFocusGuards, v = n || le && le.portaledElement;
|
|
1527
|
+
if (Qr() && W && W !== document.body && (!document.body.contains(W) || Wn(W))) {
|
|
1528
|
+
var d = xr();
|
|
1529
|
+
d && d.focus();
|
|
1530
|
+
}
|
|
1531
|
+
var p = document && document.activeElement;
|
|
1532
|
+
if (v) {
|
|
1533
|
+
var h = [v].concat(i.map(In).filter(Boolean)), g = function() {
|
|
1534
|
+
if (!Dn(u) || !f || !W || nr)
|
|
1535
|
+
return !1;
|
|
1536
|
+
var O = Xr(h), F = O.findIndex(function(s) {
|
|
1537
|
+
var k = s.node;
|
|
1538
|
+
return k === W;
|
|
1539
|
+
});
|
|
1540
|
+
return F === 0 || F === O.length - 1;
|
|
1541
|
+
};
|
|
1542
|
+
if ((!p || Mn(p)) && (o || g() || !Cn() || !W && a) && (v && !(Gr(h) || p && Ln(p, h) || jn(p)) && (document && !W && p && !a ? (p.blur && p.blur(), document.body.focus()) : (r = Hr(h, W, {
|
|
1543
|
+
focusOptions: b
|
|
1544
|
+
}), le = {})), W = document && document.activeElement, W !== document.body && (xr = zr(W)), Ee = !1), document && p !== document.activeElement && document.querySelector("[data-focus-auto-guard]")) {
|
|
1545
|
+
var m = document && document.activeElement, E = Tn(h), C = E.map(function($) {
|
|
1546
|
+
var O = $.node;
|
|
1547
|
+
return O;
|
|
1548
|
+
}).indexOf(m);
|
|
1549
|
+
C > -1 && (E.filter(function($) {
|
|
1550
|
+
var O = $.guard, F = $.node;
|
|
1551
|
+
return O && F.dataset.focusAutoGuard;
|
|
1552
|
+
}).forEach(function($) {
|
|
1553
|
+
var O = $.node;
|
|
1554
|
+
return O.removeAttribute("tabIndex");
|
|
1555
|
+
}), wr(C, E.length, 1, E), wr(C, -1, -1, E));
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
return r;
|
|
1560
|
+
}, Zr = function(r) {
|
|
1561
|
+
Se() && r && (r.stopPropagation(), r.preventDefault());
|
|
1562
|
+
}, or = function() {
|
|
1563
|
+
return tr(Se);
|
|
1564
|
+
}, qn = function(r) {
|
|
1565
|
+
var t = r.target, n = r.currentTarget;
|
|
1566
|
+
n.contains(t) || Nn(n, t);
|
|
1567
|
+
}, Un = function() {
|
|
1568
|
+
return null;
|
|
1569
|
+
};
|
|
1570
|
+
process.env.NODE_ENV !== "production" && Rr.node.isRequired;
|
|
1571
|
+
var et = function() {
|
|
1572
|
+
nr = !0;
|
|
1573
|
+
}, rt = function() {
|
|
1574
|
+
nr = !1, Ee = "just", tr(function() {
|
|
1575
|
+
Ee = "meanwhile";
|
|
1576
|
+
});
|
|
1577
|
+
}, Bn = function() {
|
|
1578
|
+
document.addEventListener("focusin", Zr), document.addEventListener("focusout", or), window.addEventListener("focus", et), window.addEventListener("blur", rt);
|
|
1579
|
+
}, Yn = function() {
|
|
1580
|
+
document.removeEventListener("focusin", Zr), document.removeEventListener("focusout", or), window.removeEventListener("focus", et), window.removeEventListener("blur", rt);
|
|
1581
|
+
};
|
|
1582
|
+
function Gn(e) {
|
|
1583
|
+
return e.filter(function(r) {
|
|
1584
|
+
var t = r.disabled;
|
|
1585
|
+
return !t;
|
|
1586
|
+
});
|
|
1587
|
+
}
|
|
1588
|
+
var tt = {
|
|
1589
|
+
moveFocusInside: Hr,
|
|
1590
|
+
focusInside: Gr,
|
|
1591
|
+
focusNextElement: _n,
|
|
1592
|
+
focusPrevElement: Fn,
|
|
1593
|
+
focusFirstElement: Rn,
|
|
1594
|
+
focusLastElement: An,
|
|
1595
|
+
captureFocusRestore: zr
|
|
1596
|
+
};
|
|
1597
|
+
function Vn(e) {
|
|
1598
|
+
var r = e.slice(-1)[0];
|
|
1599
|
+
r && !de && Bn();
|
|
1600
|
+
var t = de, n = t && r && r.id === t.id;
|
|
1601
|
+
de = r, t && !n && (t.onDeactivation(), e.filter(function(o) {
|
|
1602
|
+
var a = o.id;
|
|
1603
|
+
return a === t.id;
|
|
1604
|
+
}).length || t.returnFocus(!r)), r ? (W = null, (!n || t.observed !== r.observed) && r.onActivation(tt), Se(), tr(Se)) : (Yn(), W = null);
|
|
1605
|
+
}
|
|
1606
|
+
$r.assignSyncMedium(qn);
|
|
1607
|
+
Mr.assignMedium(or);
|
|
1608
|
+
Lt.assignMedium(function(e) {
|
|
1609
|
+
return e(tt);
|
|
1610
|
+
});
|
|
1611
|
+
const Hn = Ht(Gn, Vn)(Un);
|
|
1612
|
+
var nt = /* @__PURE__ */ Pr(function(r, t) {
|
|
1613
|
+
return /* @__PURE__ */ X.createElement(He, me({
|
|
1614
|
+
sideCar: Hn,
|
|
1615
|
+
ref: t
|
|
1616
|
+
}, r));
|
|
1617
|
+
}), ot = He.propTypes || {};
|
|
1618
|
+
ot.sideCar;
|
|
1619
|
+
var zn = Ot(ot, ["sideCar"]);
|
|
1620
|
+
nt.propTypes = process.env.NODE_ENV !== "production" ? zn : {};
|
|
1621
|
+
function at(e) {
|
|
1622
|
+
var r, t, n = "";
|
|
1623
|
+
if (typeof e == "string" || typeof e == "number") n += e;
|
|
1624
|
+
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
1625
|
+
var o = e.length;
|
|
1626
|
+
for (r = 0; r < o; r++) e[r] && (t = at(e[r])) && (n && (n += " "), n += t);
|
|
1627
|
+
} else for (t in e) e[t] && (n && (n += " "), n += t);
|
|
1628
|
+
return n;
|
|
1629
|
+
}
|
|
1630
|
+
function Jn() {
|
|
1631
|
+
for (var e, r, t = 0, n = "", o = arguments.length; t < o; t++) (e = arguments[t]) && (r = at(e)) && (n && (n += " "), n += r);
|
|
1632
|
+
return n;
|
|
1633
|
+
}
|
|
1634
|
+
function it(e) {
|
|
1635
|
+
var r, t, n = "";
|
|
1636
|
+
if (typeof e == "string" || typeof e == "number") n += e;
|
|
1637
|
+
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
1638
|
+
var o = e.length;
|
|
1639
|
+
for (r = 0; r < o; r++) e[r] && (t = it(e[r])) && (n && (n += " "), n += t);
|
|
1640
|
+
} else for (t in e) e[t] && (n && (n += " "), n += t);
|
|
1641
|
+
return n;
|
|
1642
|
+
}
|
|
1643
|
+
function Kn() {
|
|
1644
|
+
for (var e, r, t = 0, n = "", o = arguments.length; t < o; t++) (e = arguments[t]) && (r = it(e)) && (n && (n += " "), n += r);
|
|
1645
|
+
return n;
|
|
1646
|
+
}
|
|
1647
|
+
const Pe = ({
|
|
1648
|
+
ref: e,
|
|
1649
|
+
as: r = "div",
|
|
1650
|
+
children: t,
|
|
1651
|
+
display: n,
|
|
1652
|
+
m: o,
|
|
1653
|
+
mt: a,
|
|
1654
|
+
mr: i,
|
|
1655
|
+
mb: u,
|
|
1656
|
+
ml: b,
|
|
1657
|
+
p: f,
|
|
1658
|
+
pt: v,
|
|
1659
|
+
pr: d,
|
|
1660
|
+
pb: p,
|
|
1661
|
+
pl: h,
|
|
1662
|
+
width: g,
|
|
1663
|
+
height: m,
|
|
1664
|
+
position: E,
|
|
1665
|
+
style: C,
|
|
1666
|
+
className: $,
|
|
1667
|
+
href: O,
|
|
1668
|
+
target: F,
|
|
1669
|
+
rel: s,
|
|
1670
|
+
htmlFor: k,
|
|
1671
|
+
type: B,
|
|
1672
|
+
disabled: G,
|
|
1673
|
+
...z
|
|
1674
|
+
}) => {
|
|
1675
|
+
const _ = {};
|
|
1676
|
+
n && (_.display = n), g && (_.width = g), m && (_.height = m), E && (_.position = E), o && (_.margin = `var(--pittorica-space-${o})`), a && (_.marginTop = `var(--pittorica-space-${a})`), i && (_.marginRight = `var(--pittorica-space-${i})`), u && (_.marginBottom = `var(--pittorica-space-${u})`), b && (_.marginLeft = `var(--pittorica-space-${b})`), f && (_.padding = `var(--pittorica-space-${f})`), v && (_.paddingTop = `var(--pittorica-space-${v})`), d && (_.paddingRight = `var(--pittorica-space-${d})`), p && (_.paddingBottom = `var(--pittorica-space-${p})`), h && (_.paddingLeft = `var(--pittorica-space-${h})`);
|
|
1677
|
+
const V = {
|
|
1678
|
+
...C,
|
|
1679
|
+
..._
|
|
1680
|
+
};
|
|
1681
|
+
return /* @__PURE__ */ Y(
|
|
1682
|
+
r,
|
|
1683
|
+
{
|
|
1684
|
+
ref: e,
|
|
1685
|
+
className: Kn("pittorica-box", $),
|
|
1686
|
+
style: V,
|
|
1687
|
+
href: O,
|
|
1688
|
+
target: F,
|
|
1689
|
+
rel: s,
|
|
1690
|
+
htmlFor: k,
|
|
1691
|
+
type: B,
|
|
1692
|
+
disabled: G,
|
|
1693
|
+
...z,
|
|
1694
|
+
children: t
|
|
1695
|
+
}
|
|
1696
|
+
);
|
|
1697
|
+
};
|
|
1698
|
+
Pe.displayName = "Box";
|
|
1699
|
+
function ut(e) {
|
|
1700
|
+
var r, t, n = "";
|
|
1701
|
+
if (typeof e == "string" || typeof e == "number") n += e;
|
|
1702
|
+
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
1703
|
+
var o = e.length;
|
|
1704
|
+
for (r = 0; r < o; r++) e[r] && (t = ut(e[r])) && (n && (n += " "), n += t);
|
|
1705
|
+
} else for (t in e) e[t] && (n && (n += " "), n += t);
|
|
1706
|
+
return n;
|
|
1707
|
+
}
|
|
1708
|
+
function Qn() {
|
|
1709
|
+
for (var e, r, t = 0, n = "", o = arguments.length; t < o; t++) (e = arguments[t]) && (r = ut(e)) && (n && (n += " "), n += r);
|
|
1710
|
+
return n;
|
|
1711
|
+
}
|
|
1712
|
+
function ct(e) {
|
|
1713
|
+
var r, t, n = "";
|
|
1714
|
+
if (typeof e == "string" || typeof e == "number") n += e;
|
|
1715
|
+
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
1716
|
+
var o = e.length;
|
|
1717
|
+
for (r = 0; r < o; r++) e[r] && (t = ct(e[r])) && (n && (n += " "), n += t);
|
|
1718
|
+
} else for (t in e) e[t] && (n && (n += " "), n += t);
|
|
1719
|
+
return n;
|
|
1720
|
+
}
|
|
1721
|
+
function Xn() {
|
|
1722
|
+
for (var e, r, t = 0, n = "", o = arguments.length; t < o; t++) (e = arguments[t]) && (r = ct(e)) && (n && (n += " "), n += r);
|
|
1723
|
+
return n;
|
|
1724
|
+
}
|
|
1725
|
+
function st(e) {
|
|
1726
|
+
var r, t, n = "";
|
|
1727
|
+
if (typeof e == "string" || typeof e == "number") n += e;
|
|
1728
|
+
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
1729
|
+
var o = e.length;
|
|
1730
|
+
for (r = 0; r < o; r++) e[r] && (t = st(e[r])) && (n && (n += " "), n += t);
|
|
1731
|
+
} else for (t in e) e[t] && (n && (n += " "), n += t);
|
|
1732
|
+
return n;
|
|
1733
|
+
}
|
|
1734
|
+
function Zn() {
|
|
1735
|
+
for (var e, r, t = 0, n = "", o = arguments.length; t < o; t++) (e = arguments[t]) && (r = st(e)) && (n && (n += " "), n += r);
|
|
1736
|
+
return n;
|
|
1737
|
+
}
|
|
1738
|
+
const ft = ({
|
|
1739
|
+
ref: e,
|
|
1740
|
+
as: r = "div",
|
|
1741
|
+
children: t,
|
|
1742
|
+
display: n,
|
|
1743
|
+
m: o,
|
|
1744
|
+
mt: a,
|
|
1745
|
+
mr: i,
|
|
1746
|
+
mb: u,
|
|
1747
|
+
ml: b,
|
|
1748
|
+
p: f,
|
|
1749
|
+
pt: v,
|
|
1750
|
+
pr: d,
|
|
1751
|
+
pb: p,
|
|
1752
|
+
pl: h,
|
|
1753
|
+
width: g,
|
|
1754
|
+
height: m,
|
|
1755
|
+
position: E,
|
|
1756
|
+
style: C,
|
|
1757
|
+
className: $,
|
|
1758
|
+
href: O,
|
|
1759
|
+
target: F,
|
|
1760
|
+
rel: s,
|
|
1761
|
+
htmlFor: k,
|
|
1762
|
+
type: B,
|
|
1763
|
+
disabled: G,
|
|
1764
|
+
...z
|
|
1765
|
+
}) => {
|
|
1766
|
+
const _ = {};
|
|
1767
|
+
n && (_.display = n), g && (_.width = g), m && (_.height = m), E && (_.position = E), o && (_.margin = `var(--pittorica-space-${o})`), a && (_.marginTop = `var(--pittorica-space-${a})`), i && (_.marginRight = `var(--pittorica-space-${i})`), u && (_.marginBottom = `var(--pittorica-space-${u})`), b && (_.marginLeft = `var(--pittorica-space-${b})`), f && (_.padding = `var(--pittorica-space-${f})`), v && (_.paddingTop = `var(--pittorica-space-${v})`), d && (_.paddingRight = `var(--pittorica-space-${d})`), p && (_.paddingBottom = `var(--pittorica-space-${p})`), h && (_.paddingLeft = `var(--pittorica-space-${h})`);
|
|
1768
|
+
const V = {
|
|
1769
|
+
...C,
|
|
1770
|
+
..._
|
|
1771
|
+
};
|
|
1772
|
+
return /* @__PURE__ */ Y(
|
|
1773
|
+
r,
|
|
1774
|
+
{
|
|
1775
|
+
ref: e,
|
|
1776
|
+
className: Zn("pittorica-box", $),
|
|
1777
|
+
style: V,
|
|
1778
|
+
href: O,
|
|
1779
|
+
target: F,
|
|
1780
|
+
rel: s,
|
|
1781
|
+
htmlFor: k,
|
|
1782
|
+
type: B,
|
|
1783
|
+
disabled: G,
|
|
1784
|
+
...z,
|
|
1785
|
+
children: t
|
|
1786
|
+
}
|
|
1787
|
+
);
|
|
1788
|
+
};
|
|
1789
|
+
ft.displayName = "Box";
|
|
1790
|
+
const eo = (e, r) => r ? typeof r == "string" ? [`pittorica-text--${e}-${r}`] : Object.entries(r).filter(([t, n]) => n !== void 0).map(
|
|
1791
|
+
([t, n]) => t === "initial" ? `pittorica-text--${e}-${n}` : `pittorica-text--${t}-${e}-${n}`
|
|
1792
|
+
) : [], ro = ({
|
|
1793
|
+
children: e,
|
|
1794
|
+
as: r = "span",
|
|
1795
|
+
size: t = "3",
|
|
1796
|
+
weight: n = "regular",
|
|
1797
|
+
align: o,
|
|
1798
|
+
truncate: a = !1,
|
|
1799
|
+
color: i,
|
|
1800
|
+
className: u,
|
|
1801
|
+
style: b,
|
|
1802
|
+
href: f,
|
|
1803
|
+
target: v,
|
|
1804
|
+
rel: d,
|
|
1805
|
+
htmlFor: p,
|
|
1806
|
+
...h
|
|
1807
|
+
}) => {
|
|
1808
|
+
const g = (i == null ? void 0 : i.startsWith("#")) || (i == null ? void 0 : i.startsWith("rgb")), m = [
|
|
1809
|
+
"danger",
|
|
1810
|
+
"success",
|
|
1811
|
+
"error",
|
|
1812
|
+
"info",
|
|
1813
|
+
"indigo",
|
|
1814
|
+
"crimson",
|
|
1815
|
+
"teal",
|
|
1816
|
+
"amber",
|
|
1817
|
+
"slate",
|
|
1818
|
+
"blue",
|
|
1819
|
+
"red"
|
|
1820
|
+
].includes(i), E = (() => {
|
|
1821
|
+
if (i) {
|
|
1822
|
+
if (i === "inherit") return "inherit";
|
|
1823
|
+
if (g) return i;
|
|
1824
|
+
if (m) return `var(--pittorica-${i}-9)`;
|
|
1825
|
+
}
|
|
1826
|
+
})(), C = {
|
|
1827
|
+
...b,
|
|
1828
|
+
textAlign: o,
|
|
1829
|
+
color: E
|
|
1830
|
+
}, $ = eo("size", t);
|
|
1831
|
+
return /* @__PURE__ */ Y(
|
|
1832
|
+
ft,
|
|
1833
|
+
{
|
|
1834
|
+
as: r,
|
|
1835
|
+
className: Xn(
|
|
1836
|
+
"pittorica-text",
|
|
1837
|
+
{ "pittorica-text--truncate": a },
|
|
1838
|
+
$,
|
|
1839
|
+
u
|
|
1840
|
+
),
|
|
1841
|
+
"data-weight": n,
|
|
1842
|
+
style: C,
|
|
1843
|
+
href: f,
|
|
1844
|
+
target: v,
|
|
1845
|
+
rel: d,
|
|
1846
|
+
htmlFor: p,
|
|
1847
|
+
...h,
|
|
1848
|
+
children: e
|
|
1849
|
+
}
|
|
1850
|
+
);
|
|
1851
|
+
}, to = (e, r) => r ? typeof r == "string" ? [`pittorica-heading--${e}-${r}`] : Object.entries(r).filter(([t, n]) => n !== void 0).map(
|
|
1852
|
+
([t, n]) => t === "initial" ? `pittorica-heading--${e}-${n}` : `pittorica-heading--${t}-${e}-${n}`
|
|
1853
|
+
) : [], no = ({
|
|
1854
|
+
children: e,
|
|
1855
|
+
as: r = "h1",
|
|
1856
|
+
size: t = "6",
|
|
1857
|
+
weight: n = "bold",
|
|
1858
|
+
className: o,
|
|
1859
|
+
...a
|
|
1860
|
+
}) => {
|
|
1861
|
+
const i = to("size", t);
|
|
1862
|
+
return /* @__PURE__ */ Y(
|
|
1863
|
+
ro,
|
|
1864
|
+
{
|
|
1865
|
+
as: r,
|
|
1866
|
+
weight: n,
|
|
1867
|
+
className: Qn("pittorica-heading", i, o),
|
|
1868
|
+
...a,
|
|
1869
|
+
children: e
|
|
1870
|
+
}
|
|
1871
|
+
);
|
|
1872
|
+
}, dt = Sr(null), lt = () => {
|
|
1873
|
+
const e = Et(dt);
|
|
1874
|
+
if (!e)
|
|
1875
|
+
throw new Error("Dialog compound components must be used within a Dialog");
|
|
1876
|
+
return e;
|
|
1877
|
+
}, uo = ({
|
|
1878
|
+
open: e,
|
|
1879
|
+
onClose: r,
|
|
1880
|
+
children: t,
|
|
1881
|
+
className: n,
|
|
1882
|
+
appearance: o,
|
|
1883
|
+
closeOnOverlayClick: a = !0,
|
|
1884
|
+
closeOnEsc: i = !0
|
|
1885
|
+
}) => {
|
|
1886
|
+
const u = ur(), b = ur(), [f, v] = fe(), d = xe(null), [p, h] = fe(!1);
|
|
1887
|
+
return we(() => {
|
|
1888
|
+
h(!0);
|
|
1889
|
+
}, []), we(() => {
|
|
1890
|
+
if (!e) return;
|
|
1891
|
+
const m = (E) => {
|
|
1892
|
+
E.key === "Escape" && i && r();
|
|
1893
|
+
};
|
|
1894
|
+
return globalThis.addEventListener("keydown", m), () => globalThis.removeEventListener("keydown", m);
|
|
1895
|
+
}, [e, r, i]), we(() => {
|
|
1896
|
+
if (!e) return;
|
|
1897
|
+
const m = globalThis.getComputedStyle(document.body).overflow;
|
|
1898
|
+
return document.body.style.overflow = "hidden", () => {
|
|
1899
|
+
document.body.style.overflow = m;
|
|
1900
|
+
};
|
|
1901
|
+
}, [e]), gt(() => {
|
|
1902
|
+
if (e && d.current) {
|
|
1903
|
+
const m = d.current.closest(".pittorica-theme");
|
|
1904
|
+
if (m) {
|
|
1905
|
+
const E = m.getAttribute(
|
|
1906
|
+
"data-appearance"
|
|
1907
|
+
);
|
|
1908
|
+
v(E || void 0);
|
|
1909
|
+
}
|
|
1910
|
+
}
|
|
1911
|
+
}, [e]), !e || !p ? null : /* @__PURE__ */ pt(yt, { children: [
|
|
1912
|
+
/* @__PURE__ */ Y("div", { ref: d, style: { display: "none" }, "aria-hidden": "true" }),
|
|
1913
|
+
Tt(
|
|
1914
|
+
/* @__PURE__ */ Y(
|
|
1915
|
+
"div",
|
|
1916
|
+
{
|
|
1917
|
+
className: "pittorica-dialog-overlay pittorica-theme",
|
|
1918
|
+
onClick: a ? r : void 0,
|
|
1919
|
+
"data-appearance": o ?? f,
|
|
1920
|
+
"aria-hidden": "true",
|
|
1921
|
+
children: /* @__PURE__ */ Y(nt, { returnFocus: !0, children: /* @__PURE__ */ Y(
|
|
1922
|
+
Pe,
|
|
1923
|
+
{
|
|
1924
|
+
className: Jn("pittorica-dialog-content", n),
|
|
1925
|
+
onClick: (m) => m.stopPropagation(),
|
|
1926
|
+
role: "dialog",
|
|
1927
|
+
"aria-modal": "true",
|
|
1928
|
+
"aria-labelledby": u,
|
|
1929
|
+
"aria-describedby": b,
|
|
1930
|
+
children: /* @__PURE__ */ Y(dt, { value: { titleId: u, descriptionId: b }, children: t })
|
|
1931
|
+
}
|
|
1932
|
+
) })
|
|
1933
|
+
}
|
|
1934
|
+
),
|
|
1935
|
+
document.body
|
|
1936
|
+
)
|
|
1937
|
+
] });
|
|
1938
|
+
}, co = ({
|
|
1939
|
+
children: e,
|
|
1940
|
+
id: r,
|
|
1941
|
+
...t
|
|
1942
|
+
}) => {
|
|
1943
|
+
const { titleId: n } = lt();
|
|
1944
|
+
return /* @__PURE__ */ Y(no, { as: "h2", id: n, size: "6", mb: "3", ...t, children: e });
|
|
1945
|
+
}, so = ({
|
|
1946
|
+
children: e,
|
|
1947
|
+
id: r,
|
|
1948
|
+
...t
|
|
1949
|
+
}) => {
|
|
1950
|
+
const { descriptionId: n } = lt();
|
|
1951
|
+
return /* @__PURE__ */ Y(
|
|
1952
|
+
Pe,
|
|
1953
|
+
{
|
|
1954
|
+
id: n,
|
|
1955
|
+
mb: "4",
|
|
1956
|
+
style: {
|
|
1957
|
+
color: "inherit",
|
|
1958
|
+
fontSize: "var(--pittorica-font-size-3)"
|
|
1959
|
+
},
|
|
1960
|
+
...t,
|
|
1961
|
+
children: e
|
|
1962
|
+
}
|
|
1963
|
+
);
|
|
1964
|
+
}, fo = ({ children: e }) => /* @__PURE__ */ Y(
|
|
1965
|
+
Pe,
|
|
1966
|
+
{
|
|
1967
|
+
style: {
|
|
1968
|
+
display: "flex",
|
|
1969
|
+
justifyContent: "flex-end",
|
|
1970
|
+
gap: "var(--pittorica-space-3)",
|
|
1971
|
+
marginTop: "var(--pittorica-space-6)"
|
|
1972
|
+
},
|
|
1973
|
+
children: e
|
|
1974
|
+
}
|
|
1975
|
+
);
|
|
1976
|
+
export {
|
|
1977
|
+
uo as Dialog,
|
|
1978
|
+
fo as DialogActions,
|
|
1979
|
+
so as DialogDescription,
|
|
1980
|
+
co as DialogTitle
|
|
1981
|
+
};
|