@uva-glass/component-library 1.43.0 → 1.44.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.
Files changed (41) hide show
  1. package/dist/{MultiSelect-DFMb82q4.js → MultiSelect-B9JaIPXs.js} +17 -12
  2. package/dist/{MultiSelect-DFMb82q4.js.map → MultiSelect-B9JaIPXs.js.map} +1 -1
  3. package/dist/assets/MenuLink.css +1 -1
  4. package/dist/assets/MenuLink2.css +1 -1
  5. package/dist/assets/Spinner.css +1 -1
  6. package/dist/components/Drawer/Drawer.js +39 -37
  7. package/dist/components/Drawer/Drawer.js.map +1 -1
  8. package/dist/components/Drawer/Drawer.stories.js +18 -18
  9. package/dist/components/InputField/InputField.stories.js +24 -19
  10. package/dist/components/InputField/InputField.stories.js.map +1 -1
  11. package/dist/components/MenuButton/MenuButton.d.ts +2 -3
  12. package/dist/components/MenuButton/MenuButton.js +11 -605
  13. package/dist/components/MenuButton/MenuButton.js.map +1 -1
  14. package/dist/components/MenuLink/MenuLink.js +14 -4
  15. package/dist/components/MenuLink/MenuLink.js.map +1 -1
  16. package/dist/components/MenuLink/MenuLink.stories.js +5 -4
  17. package/dist/components/MenuLink/MenuLink.stories.js.map +1 -1
  18. package/dist/components/MenuLink/index.js +1 -1
  19. package/dist/components/ModalDialog/ModalDialog.js +62 -60
  20. package/dist/components/ModalDialog/ModalDialog.js.map +1 -1
  21. package/dist/components/ModalDialog/ModalDialog.stories.js +12 -12
  22. package/dist/components/MultiSelect/MultiSelect.js +1 -1
  23. package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
  24. package/dist/components/MultiSelect/components/MultiSelectHeader.js +7 -2
  25. package/dist/components/MultiSelect/components/MultiSelectHeader.js.map +1 -1
  26. package/dist/components/MultiSelect/index.js +1 -1
  27. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +28 -23
  28. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js.map +1 -1
  29. package/dist/components/Spinner/Spinner.js +13 -12
  30. package/dist/components/Spinner/Spinner.js.map +1 -1
  31. package/dist/components/index.js +6 -6
  32. package/dist/index.js +6 -6
  33. package/package.json +10 -12
  34. package/dist/MenuLink-yPEEfABB.js +0 -859
  35. package/dist/MenuLink-yPEEfABB.js.map +0 -1
  36. package/dist/focusSafely-b94Glb9J.js +0 -402
  37. package/dist/focusSafely-b94Glb9J.js.map +0 -1
  38. package/dist/index-HuvfQN5H.js +0 -19071
  39. package/dist/index-HuvfQN5H.js.map +0 -1
  40. package/dist/useDialog-DZhIlo2a.js +0 -785
  41. package/dist/useDialog-DZhIlo2a.js.map +0 -1
@@ -1,859 +0,0 @@
1
- import { jsx as be } from "react/jsx-runtime";
2
- import { c as Ee } from "./clsx-OuTLNxxd.js";
3
- import * as s from "react";
4
- import "./index-HuvfQN5H.js";
5
- import './assets/MenuLink2.css';/**
6
- * @remix-run/router v1.19.0
7
- *
8
- * Copyright (c) Remix Software Inc.
9
- *
10
- * This source code is licensed under the MIT license found in the
11
- * LICENSE.md file in the root directory of this source tree.
12
- *
13
- * @license MIT
14
- */
15
- function I() {
16
- return I = Object.assign ? Object.assign.bind() : function(e) {
17
- for (var t = 1; t < arguments.length; t++) {
18
- var n = arguments[t];
19
- for (var r in n)
20
- Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
21
- }
22
- return e;
23
- }, I.apply(this, arguments);
24
- }
25
- var w;
26
- (function(e) {
27
- e.Pop = "POP", e.Push = "PUSH", e.Replace = "REPLACE";
28
- })(w || (w = {}));
29
- function Ne(e) {
30
- e === void 0 && (e = {});
31
- let {
32
- initialEntries: t = ["/"],
33
- initialIndex: n,
34
- v5Compat: r = !1
35
- } = e, a;
36
- a = t.map((f, p) => h(f, typeof f == "string" ? null : f.state, p === 0 ? "default" : void 0));
37
- let i = c(n ?? a.length - 1), o = w.Pop, l = null;
38
- function c(f) {
39
- return Math.min(Math.max(f, 0), a.length - 1);
40
- }
41
- function u() {
42
- return a[i];
43
- }
44
- function h(f, p, v) {
45
- p === void 0 && (p = null);
46
- let N = we(a ? u().pathname : "/", f, p, v);
47
- return R(N.pathname.charAt(0) === "/", "relative pathnames are not supported in memory history: " + JSON.stringify(f)), N;
48
- }
49
- function d(f) {
50
- return typeof f == "string" ? f : F(f);
51
- }
52
- return {
53
- get index() {
54
- return i;
55
- },
56
- get action() {
57
- return o;
58
- },
59
- get location() {
60
- return u();
61
- },
62
- createHref: d,
63
- createURL(f) {
64
- return new URL(d(f), "http://localhost");
65
- },
66
- encodeLocation(f) {
67
- let p = typeof f == "string" ? O(f) : f;
68
- return {
69
- pathname: p.pathname || "",
70
- search: p.search || "",
71
- hash: p.hash || ""
72
- };
73
- },
74
- push(f, p) {
75
- o = w.Push;
76
- let v = h(f, p);
77
- i += 1, a.splice(i, a.length, v), r && l && l({
78
- action: o,
79
- location: v,
80
- delta: 1
81
- });
82
- },
83
- replace(f, p) {
84
- o = w.Replace;
85
- let v = h(f, p);
86
- a[i] = v, r && l && l({
87
- action: o,
88
- location: v,
89
- delta: 0
90
- });
91
- },
92
- go(f) {
93
- o = w.Pop;
94
- let p = c(i + f), v = a[p];
95
- i = p, l && l({
96
- action: o,
97
- location: v,
98
- delta: f
99
- });
100
- },
101
- listen(f) {
102
- return l = f, () => {
103
- l = null;
104
- };
105
- }
106
- };
107
- }
108
- function g(e, t) {
109
- if (e === !1 || e === null || typeof e > "u")
110
- throw new Error(t);
111
- }
112
- function R(e, t) {
113
- if (!e) {
114
- typeof console < "u" && console.warn(t);
115
- try {
116
- throw new Error(t);
117
- } catch {
118
- }
119
- }
120
- }
121
- function xe() {
122
- return Math.random().toString(36).substr(2, 8);
123
- }
124
- function we(e, t, n, r) {
125
- return n === void 0 && (n = null), I({
126
- pathname: typeof e == "string" ? e : e.pathname,
127
- search: "",
128
- hash: ""
129
- }, typeof t == "string" ? O(t) : t, {
130
- state: n,
131
- // TODO: This could be cleaned up. push/replace should probably just take
132
- // full Locations now and avoid the need to run through this flow at all
133
- // But that's a pretty big refactor to the current test suite so going to
134
- // keep as is for the time being and just let any incoming keys take precedence
135
- key: t && t.key || r || xe()
136
- });
137
- }
138
- function F(e) {
139
- let {
140
- pathname: t = "/",
141
- search: n = "",
142
- hash: r = ""
143
- } = e;
144
- return n && n !== "?" && (t += n.charAt(0) === "?" ? n : "?" + n), r && r !== "#" && (t += r.charAt(0) === "#" ? r : "#" + r), t;
145
- }
146
- function O(e) {
147
- let t = {};
148
- if (e) {
149
- let n = e.indexOf("#");
150
- n >= 0 && (t.hash = e.substr(n), e = e.substr(0, n));
151
- let r = e.indexOf("?");
152
- r >= 0 && (t.search = e.substr(r), e = e.substr(0, r)), e && (t.pathname = e);
153
- }
154
- return t;
155
- }
156
- var H;
157
- (function(e) {
158
- e.data = "data", e.deferred = "deferred", e.redirect = "redirect", e.error = "error";
159
- })(H || (H = {}));
160
- function ee(e, t) {
161
- typeof e == "string" && (e = {
162
- path: e,
163
- caseSensitive: !1,
164
- end: !0
165
- });
166
- let [n, r] = Ce(e.path, e.caseSensitive, e.end), a = t.match(n);
167
- if (!a) return null;
168
- let i = a[0], o = i.replace(/(.)\/+$/, "$1"), l = a.slice(1);
169
- return {
170
- params: r.reduce((u, h, d) => {
171
- let {
172
- paramName: m,
173
- isOptional: f
174
- } = h;
175
- if (m === "*") {
176
- let v = l[d] || "";
177
- o = i.slice(0, i.length - v.length).replace(/(.)\/+$/, "$1");
178
- }
179
- const p = l[d];
180
- return f && !p ? u[m] = void 0 : u[m] = (p || "").replace(/%2F/g, "/"), u;
181
- }, {}),
182
- pathname: i,
183
- pathnameBase: o,
184
- pattern: e
185
- };
186
- }
187
- function Ce(e, t, n) {
188
- t === void 0 && (t = !1), n === void 0 && (n = !0), R(e === "*" || !e.endsWith("*") || e.endsWith("/*"), 'Route path "' + e + '" will be treated as if it were ' + ('"' + e.replace(/\*$/, "/*") + '" because the `*` character must ') + "always follow a `/` in the pattern. To get rid of this warning, " + ('please change the route path to "' + e.replace(/\*$/, "/*") + '".'));
189
- let r = [], a = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(/\/:([\w-]+)(\?)?/g, (o, l, c) => (r.push({
190
- paramName: l,
191
- isOptional: c != null
192
- }), c ? "/?([^\\/]+)?" : "/([^\\/]+)"));
193
- return e.endsWith("*") ? (r.push({
194
- paramName: "*"
195
- }), a += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : n ? a += "\\/*$" : e !== "" && e !== "/" && (a += "(?:(?=\\/|$))"), [new RegExp(a, t ? void 0 : "i"), r];
196
- }
197
- function C(e, t) {
198
- if (t === "/") return e;
199
- if (!e.toLowerCase().startsWith(t.toLowerCase()))
200
- return null;
201
- let n = t.endsWith("/") ? t.length - 1 : t.length, r = e.charAt(n);
202
- return r && r !== "/" ? null : e.slice(n) || "/";
203
- }
204
- function Re(e, t) {
205
- t === void 0 && (t = "/");
206
- let {
207
- pathname: n,
208
- search: r = "",
209
- hash: a = ""
210
- } = typeof e == "string" ? O(e) : e;
211
- return {
212
- pathname: n ? n.startsWith("/") ? n : Se(n, t) : t,
213
- search: Le(r),
214
- hash: Oe(a)
215
- };
216
- }
217
- function Se(e, t) {
218
- let n = t.replace(/\/+$/, "").split("/");
219
- return e.split("/").forEach((a) => {
220
- a === ".." ? n.length > 1 && n.pop() : a !== "." && n.push(a);
221
- }), n.length > 1 ? n.join("/") : "/";
222
- }
223
- function Y(e, t, n, r) {
224
- return "Cannot include a '" + e + "' character in a manually specified " + ("`to." + t + "` field [" + JSON.stringify(r) + "]. Please separate it out to the ") + ("`to." + n + "` field. Alternatively you may provide the full path as ") + 'a string in <Link to="..."> and the router will parse it for you.';
225
- }
226
- function _e(e) {
227
- return e.filter((t, n) => n === 0 || t.route.path && t.route.path.length > 0);
228
- }
229
- function re(e, t) {
230
- let n = _e(e);
231
- return t ? n.map((r, a) => a === n.length - 1 ? r.pathname : r.pathnameBase) : n.map((r) => r.pathnameBase);
232
- }
233
- function ie(e, t, n, r) {
234
- r === void 0 && (r = !1);
235
- let a;
236
- typeof e == "string" ? a = O(e) : (a = I({}, e), g(!a.pathname || !a.pathname.includes("?"), Y("?", "pathname", "search", a)), g(!a.pathname || !a.pathname.includes("#"), Y("#", "pathname", "hash", a)), g(!a.search || !a.search.includes("#"), Y("#", "search", "hash", a)));
237
- let i = e === "" || a.pathname === "", o = i ? "/" : a.pathname, l;
238
- if (o == null)
239
- l = n;
240
- else {
241
- let d = t.length - 1;
242
- if (!r && o.startsWith("..")) {
243
- let m = o.split("/");
244
- for (; m[0] === ".."; )
245
- m.shift(), d -= 1;
246
- a.pathname = m.join("/");
247
- }
248
- l = d >= 0 ? t[d] : "/";
249
- }
250
- let c = Re(a, l), u = o && o !== "/" && o.endsWith("/"), h = (i || o === ".") && n.endsWith("/");
251
- return !c.pathname.endsWith("/") && (u || h) && (c.pathname += "/"), c;
252
- }
253
- const G = (e) => e.join("/").replace(/\/\/+/g, "/"), Le = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, Oe = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e, oe = ["post", "put", "patch", "delete"];
254
- new Set(oe);
255
- const Pe = ["get", ...oe];
256
- new Set(Pe);
257
- /**
258
- * React Router v6.26.0
259
- *
260
- * Copyright (c) Remix Software Inc.
261
- *
262
- * This source code is licensed under the MIT license found in the
263
- * LICENSE.md file in the root directory of this source tree.
264
- *
265
- * @license MIT
266
- */
267
- function M() {
268
- return M = Object.assign ? Object.assign.bind() : function(e) {
269
- for (var t = 1; t < arguments.length; t++) {
270
- var n = arguments[t];
271
- for (var r in n)
272
- Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
273
- }
274
- return e;
275
- }, M.apply(this, arguments);
276
- }
277
- const W = /* @__PURE__ */ s.createContext(null);
278
- process.env.NODE_ENV !== "production" && (W.displayName = "DataRouter");
279
- const le = /* @__PURE__ */ s.createContext(null);
280
- process.env.NODE_ENV !== "production" && (le.displayName = "DataRouterState");
281
- const De = /* @__PURE__ */ s.createContext(null);
282
- process.env.NODE_ENV !== "production" && (De.displayName = "Await");
283
- const x = /* @__PURE__ */ s.createContext(null);
284
- process.env.NODE_ENV !== "production" && (x.displayName = "Navigation");
285
- const $ = /* @__PURE__ */ s.createContext(null);
286
- process.env.NODE_ENV !== "production" && ($.displayName = "Location");
287
- const L = /* @__PURE__ */ s.createContext({
288
- outlet: null,
289
- matches: [],
290
- isDataRoute: !1
291
- });
292
- process.env.NODE_ENV !== "production" && (L.displayName = "Route");
293
- const Te = /* @__PURE__ */ s.createContext(null);
294
- process.env.NODE_ENV !== "production" && (Te.displayName = "RouteError");
295
- function Ue(e, t) {
296
- let {
297
- relative: n
298
- } = t === void 0 ? {} : t;
299
- j() || (process.env.NODE_ENV !== "production" ? g(
300
- !1,
301
- // TODO: This error is probably because they somehow have 2 versions of the
302
- // router loaded. We can help them understand how to avoid that.
303
- "useHref() may be used only in the context of a <Router> component."
304
- ) : g(!1));
305
- let {
306
- basename: r,
307
- navigator: a
308
- } = s.useContext(x), {
309
- hash: i,
310
- pathname: o,
311
- search: l
312
- } = D(e, {
313
- relative: n
314
- }), c = o;
315
- return r !== "/" && (c = o === "/" ? r : G([r, o])), a.createHref({
316
- pathname: c,
317
- search: l,
318
- hash: i
319
- });
320
- }
321
- function j() {
322
- return s.useContext($) != null;
323
- }
324
- function P() {
325
- return j() || (process.env.NODE_ENV !== "production" ? g(
326
- !1,
327
- // TODO: This error is probably because they somehow have 2 versions of the
328
- // router loaded. We can help them understand how to avoid that.
329
- "useLocation() may be used only in the context of a <Router> component."
330
- ) : g(!1)), s.useContext($).location;
331
- }
332
- const se = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
333
- function ue(e) {
334
- s.useContext(x).static || s.useLayoutEffect(e);
335
- }
336
- function Ve() {
337
- let {
338
- isDataRoute: e
339
- } = s.useContext(L);
340
- return e ? ke() : Ae();
341
- }
342
- function Ae() {
343
- j() || (process.env.NODE_ENV !== "production" ? g(
344
- !1,
345
- // TODO: This error is probably because they somehow have 2 versions of the
346
- // router loaded. We can help them understand how to avoid that.
347
- "useNavigate() may be used only in the context of a <Router> component."
348
- ) : g(!1));
349
- let e = s.useContext(W), {
350
- basename: t,
351
- future: n,
352
- navigator: r
353
- } = s.useContext(x), {
354
- matches: a
355
- } = s.useContext(L), {
356
- pathname: i
357
- } = P(), o = JSON.stringify(re(a, n.v7_relativeSplatPath)), l = s.useRef(!1);
358
- return ue(() => {
359
- l.current = !0;
360
- }), s.useCallback(function(u, h) {
361
- if (h === void 0 && (h = {}), process.env.NODE_ENV !== "production" && R(l.current, se), !l.current) return;
362
- if (typeof u == "number") {
363
- r.go(u);
364
- return;
365
- }
366
- let d = ie(u, JSON.parse(o), i, h.relative === "path");
367
- e == null && t !== "/" && (d.pathname = d.pathname === "/" ? t : G([t, d.pathname])), (h.replace ? r.replace : r.push)(d, h.state, h);
368
- }, [t, r, o, i, e]);
369
- }
370
- function D(e, t) {
371
- let {
372
- relative: n
373
- } = t === void 0 ? {} : t, {
374
- future: r
375
- } = s.useContext(x), {
376
- matches: a
377
- } = s.useContext(L), {
378
- pathname: i
379
- } = P(), o = JSON.stringify(re(a, r.v7_relativeSplatPath));
380
- return s.useMemo(() => ie(e, JSON.parse(o), i, n === "path"), [e, o, i, n]);
381
- }
382
- var ce = /* @__PURE__ */ function(e) {
383
- return e.UseBlocker = "useBlocker", e.UseRevalidator = "useRevalidator", e.UseNavigateStable = "useNavigate", e;
384
- }(ce || {}), X = /* @__PURE__ */ function(e) {
385
- return e.UseBlocker = "useBlocker", e.UseLoaderData = "useLoaderData", e.UseActionData = "useActionData", e.UseRouteError = "useRouteError", e.UseNavigation = "useNavigation", e.UseRouteLoaderData = "useRouteLoaderData", e.UseMatches = "useMatches", e.UseRevalidator = "useRevalidator", e.UseNavigateStable = "useNavigate", e.UseRouteId = "useRouteId", e;
386
- }(X || {});
387
- function fe(e) {
388
- return e + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router.";
389
- }
390
- function Ie(e) {
391
- let t = s.useContext(W);
392
- return t || (process.env.NODE_ENV !== "production" ? g(!1, fe(e)) : g(!1)), t;
393
- }
394
- function Fe(e) {
395
- let t = s.useContext(L);
396
- return t || (process.env.NODE_ENV !== "production" ? g(!1, fe(e)) : g(!1)), t;
397
- }
398
- function he(e) {
399
- let t = Fe(e), n = t.matches[t.matches.length - 1];
400
- return n.route.id || (process.env.NODE_ENV !== "production" ? g(!1, e + ' can only be used on routes that contain a unique "id"') : g(!1)), n.route.id;
401
- }
402
- function Me() {
403
- return he(X.UseRouteId);
404
- }
405
- function ke() {
406
- let {
407
- router: e
408
- } = Ie(ce.UseNavigateStable), t = he(X.UseNavigateStable), n = s.useRef(!1);
409
- return ue(() => {
410
- n.current = !0;
411
- }), s.useCallback(function(a, i) {
412
- i === void 0 && (i = {}), process.env.NODE_ENV !== "production" && R(n.current, se), n.current && (typeof a == "number" ? e.navigate(a) : e.navigate(a, M({
413
- fromRouteId: t
414
- }, i)));
415
- }, [e, t]);
416
- }
417
- const We = "startTransition", te = s[We];
418
- function mt(e) {
419
- let {
420
- basename: t,
421
- children: n,
422
- initialEntries: r,
423
- initialIndex: a,
424
- future: i
425
- } = e, o = s.useRef();
426
- o.current == null && (o.current = Ne({
427
- initialEntries: r,
428
- initialIndex: a,
429
- v5Compat: !0
430
- }));
431
- let l = o.current, [c, u] = s.useState({
432
- action: l.action,
433
- location: l.location
434
- }), {
435
- v7_startTransition: h
436
- } = i || {}, d = s.useCallback((m) => {
437
- h && te ? te(() => u(m)) : u(m);
438
- }, [u, h]);
439
- return s.useLayoutEffect(() => l.listen(d), [l, d]), /* @__PURE__ */ s.createElement($e, {
440
- basename: t,
441
- children: n,
442
- location: c.location,
443
- navigationType: c.action,
444
- navigator: l,
445
- future: i
446
- });
447
- }
448
- function $e(e) {
449
- let {
450
- basename: t = "/",
451
- children: n = null,
452
- location: r,
453
- navigationType: a = w.Pop,
454
- navigator: i,
455
- static: o = !1,
456
- future: l
457
- } = e;
458
- j() && (process.env.NODE_ENV !== "production" ? g(!1, "You cannot render a <Router> inside another <Router>. You should never have more than one in your app.") : g(!1));
459
- let c = t.replace(/^\/*/, "/"), u = s.useMemo(() => ({
460
- basename: c,
461
- navigator: i,
462
- static: o,
463
- future: M({
464
- v7_relativeSplatPath: !1
465
- }, l)
466
- }), [c, l, i, o]);
467
- typeof r == "string" && (r = O(r));
468
- let {
469
- pathname: h = "/",
470
- search: d = "",
471
- hash: m = "",
472
- state: f = null,
473
- key: p = "default"
474
- } = r, v = s.useMemo(() => {
475
- let N = C(h, c);
476
- return N == null ? null : {
477
- location: {
478
- pathname: N,
479
- search: d,
480
- hash: m,
481
- state: f,
482
- key: p
483
- },
484
- navigationType: a
485
- };
486
- }, [c, h, d, m, f, p, a]);
487
- return process.env.NODE_ENV !== "production" && R(v != null, '<Router basename="' + c + '"> is not able to match the URL ' + ('"' + h + d + m + '" because it does not start with the ') + "basename, so the <Router> won't render anything."), v == null ? null : /* @__PURE__ */ s.createElement(x.Provider, {
488
- value: u
489
- }, /* @__PURE__ */ s.createElement($.Provider, {
490
- children: n,
491
- value: v
492
- }));
493
- }
494
- new Promise(() => {
495
- });
496
- /**
497
- * React Router DOM v6.26.0
498
- *
499
- * Copyright (c) Remix Software Inc.
500
- *
501
- * This source code is licensed under the MIT license found in the
502
- * LICENSE.md file in the root directory of this source tree.
503
- *
504
- * @license MIT
505
- */
506
- function _() {
507
- return _ = Object.assign ? Object.assign.bind() : function(e) {
508
- for (var t = 1; t < arguments.length; t++) {
509
- var n = arguments[t];
510
- for (var r in n)
511
- Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
512
- }
513
- return e;
514
- }, _.apply(this, arguments);
515
- }
516
- function Q(e, t) {
517
- if (e == null) return {};
518
- var n = {}, r = Object.keys(e), a, i;
519
- for (i = 0; i < r.length; i++)
520
- a = r[i], !(t.indexOf(a) >= 0) && (n[a] = e[a]);
521
- return n;
522
- }
523
- const V = "get", A = "application/x-www-form-urlencoded";
524
- function B(e) {
525
- return e != null && typeof e.tagName == "string";
526
- }
527
- function je(e) {
528
- return B(e) && e.tagName.toLowerCase() === "button";
529
- }
530
- function Be(e) {
531
- return B(e) && e.tagName.toLowerCase() === "form";
532
- }
533
- function Ke(e) {
534
- return B(e) && e.tagName.toLowerCase() === "input";
535
- }
536
- function Je(e) {
537
- return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
538
- }
539
- function ze(e, t) {
540
- return e.button === 0 && // Ignore everything but left clicks
541
- (!t || t === "_self") && // Let browser handle "target=_blank" etc.
542
- !Je(e);
543
- }
544
- let U = null;
545
- function Ye() {
546
- if (U === null)
547
- try {
548
- new FormData(
549
- document.createElement("form"),
550
- // @ts-expect-error if FormData supports the submitter parameter, this will throw
551
- 0
552
- ), U = !1;
553
- } catch {
554
- U = !0;
555
- }
556
- return U;
557
- }
558
- const qe = /* @__PURE__ */ new Set(["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"]);
559
- function q(e) {
560
- return e != null && !qe.has(e) ? (process.env.NODE_ENV !== "production" && R(!1, '"' + e + '" is not a valid `encType` for `<Form>`/`<fetcher.Form>` ' + ('and will default to "' + A + '"')), null) : e;
561
- }
562
- function Ge(e, t) {
563
- let n, r, a, i, o;
564
- if (Be(e)) {
565
- let l = e.getAttribute("action");
566
- r = l ? C(l, t) : null, n = e.getAttribute("method") || V, a = q(e.getAttribute("enctype")) || A, i = new FormData(e);
567
- } else if (je(e) || Ke(e) && (e.type === "submit" || e.type === "image")) {
568
- let l = e.form;
569
- if (l == null)
570
- throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');
571
- let c = e.getAttribute("formaction") || l.getAttribute("action");
572
- if (r = c ? C(c, t) : null, n = e.getAttribute("formmethod") || l.getAttribute("method") || V, a = q(e.getAttribute("formenctype")) || q(l.getAttribute("enctype")) || A, i = new FormData(l, e), !Ye()) {
573
- let {
574
- name: u,
575
- type: h,
576
- value: d
577
- } = e;
578
- if (h === "image") {
579
- let m = u ? u + "." : "";
580
- i.append(m + "x", "0"), i.append(m + "y", "0");
581
- } else u && i.append(u, d);
582
- }
583
- } else {
584
- if (B(e))
585
- throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');
586
- n = V, r = null, a = A, o = e;
587
- }
588
- return i && a === "text/plain" && (o = i, i = void 0), {
589
- action: r,
590
- method: n.toLowerCase(),
591
- encType: a,
592
- formData: i,
593
- body: o
594
- };
595
- }
596
- const Xe = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset", "unstable_viewTransition"], Qe = ["aria-current", "caseSensitive", "className", "end", "style", "to", "unstable_viewTransition", "children"], Ze = ["fetcherKey", "navigate", "reloadDocument", "replace", "state", "method", "action", "onSubmit", "relative", "preventScrollReset", "unstable_viewTransition"], He = "6";
597
- try {
598
- window.__reactRouterVersion = He;
599
- } catch {
600
- }
601
- const de = /* @__PURE__ */ s.createContext({
602
- isTransitioning: !1
603
- });
604
- process.env.NODE_ENV !== "production" && (de.displayName = "ViewTransition");
605
- const et = /* @__PURE__ */ s.createContext(/* @__PURE__ */ new Map());
606
- process.env.NODE_ENV !== "production" && (et.displayName = "Fetchers");
607
- process.env.NODE_ENV;
608
- const tt = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", nt = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, pe = /* @__PURE__ */ s.forwardRef(function(t, n) {
609
- let {
610
- onClick: r,
611
- relative: a,
612
- reloadDocument: i,
613
- replace: o,
614
- state: l,
615
- target: c,
616
- to: u,
617
- preventScrollReset: h,
618
- unstable_viewTransition: d
619
- } = t, m = Q(t, Xe), {
620
- basename: f
621
- } = s.useContext(x), p, v = !1;
622
- if (typeof u == "string" && nt.test(u) && (p = u, tt))
623
- try {
624
- let E = new URL(window.location.href), b = u.startsWith("//") ? new URL(E.protocol + u) : new URL(u), T = C(b.pathname, f);
625
- b.origin === E.origin && T != null ? u = T + b.search + b.hash : v = !0;
626
- } catch {
627
- process.env.NODE_ENV !== "production" && R(!1, '<Link to="' + u + '"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.');
628
- }
629
- let N = Ue(u, {
630
- relative: a
631
- }), S = it(u, {
632
- replace: o,
633
- state: l,
634
- target: c,
635
- preventScrollReset: h,
636
- relative: a,
637
- unstable_viewTransition: d
638
- });
639
- function y(E) {
640
- r && r(E), E.defaultPrevented || S(E);
641
- }
642
- return (
643
- // eslint-disable-next-line jsx-a11y/anchor-has-content
644
- /* @__PURE__ */ s.createElement("a", _({}, m, {
645
- href: p || N,
646
- onClick: v || i ? r : y,
647
- ref: n,
648
- target: c
649
- }))
650
- );
651
- });
652
- process.env.NODE_ENV !== "production" && (pe.displayName = "Link");
653
- const me = /* @__PURE__ */ s.forwardRef(function(t, n) {
654
- let {
655
- "aria-current": r = "page",
656
- caseSensitive: a = !1,
657
- className: i = "",
658
- end: o = !1,
659
- style: l,
660
- to: c,
661
- unstable_viewTransition: u,
662
- children: h
663
- } = t, d = Q(t, Qe), m = D(c, {
664
- relative: d.relative
665
- }), f = P(), p = s.useContext(le), {
666
- navigator: v,
667
- basename: N
668
- } = s.useContext(x), S = p != null && // Conditional usage is OK here because the usage of a data router is static
669
- // eslint-disable-next-line react-hooks/rules-of-hooks
670
- ft(m) && u === !0, y = v.encodeLocation ? v.encodeLocation(m).pathname : m.pathname, E = f.pathname, b = p && p.navigation && p.navigation.location ? p.navigation.location.pathname : null;
671
- a || (E = E.toLowerCase(), b = b ? b.toLowerCase() : null, y = y.toLowerCase()), b && N && (b = C(b, N) || b);
672
- const T = y !== "/" && y.endsWith("/") ? y.length - 1 : y.length;
673
- let K = E === y || !o && E.startsWith(y) && E.charAt(T) === "/", Z = b != null && (b === y || !o && b.startsWith(y) && b.charAt(y.length) === "/"), J = {
674
- isActive: K,
675
- isPending: Z,
676
- isTransitioning: S
677
- }, ge = K ? r : void 0, z;
678
- typeof i == "function" ? z = i(J) : z = [i, K ? "active" : null, Z ? "pending" : null, S ? "transitioning" : null].filter(Boolean).join(" ");
679
- let ye = typeof l == "function" ? l(J) : l;
680
- return /* @__PURE__ */ s.createElement(pe, _({}, d, {
681
- "aria-current": ge,
682
- className: z,
683
- ref: n,
684
- style: ye,
685
- to: c,
686
- unstable_viewTransition: u
687
- }), typeof h == "function" ? h(J) : h);
688
- });
689
- process.env.NODE_ENV !== "production" && (me.displayName = "NavLink");
690
- const at = /* @__PURE__ */ s.forwardRef((e, t) => {
691
- let {
692
- fetcherKey: n,
693
- navigate: r,
694
- reloadDocument: a,
695
- replace: i,
696
- state: o,
697
- method: l = V,
698
- action: c,
699
- onSubmit: u,
700
- relative: h,
701
- preventScrollReset: d,
702
- unstable_viewTransition: m
703
- } = e, f = Q(e, Ze), p = ut(), v = ct(c, {
704
- relative: h
705
- }), N = l.toLowerCase() === "get" ? "get" : "post", S = (y) => {
706
- if (u && u(y), y.defaultPrevented) return;
707
- y.preventDefault();
708
- let E = y.nativeEvent.submitter, b = (E == null ? void 0 : E.getAttribute("formmethod")) || l;
709
- p(E || y.currentTarget, {
710
- fetcherKey: n,
711
- method: b,
712
- navigate: r,
713
- replace: i,
714
- state: o,
715
- relative: h,
716
- preventScrollReset: d,
717
- unstable_viewTransition: m
718
- });
719
- };
720
- return /* @__PURE__ */ s.createElement("form", _({
721
- ref: t,
722
- method: N,
723
- action: v,
724
- onSubmit: a ? u : S
725
- }, f));
726
- });
727
- process.env.NODE_ENV !== "production" && (at.displayName = "Form");
728
- process.env.NODE_ENV;
729
- var k;
730
- (function(e) {
731
- e.UseScrollRestoration = "useScrollRestoration", e.UseSubmit = "useSubmit", e.UseSubmitFetcher = "useSubmitFetcher", e.UseFetcher = "useFetcher", e.useViewTransitionState = "useViewTransitionState";
732
- })(k || (k = {}));
733
- var ne;
734
- (function(e) {
735
- e.UseFetcher = "useFetcher", e.UseFetchers = "useFetchers", e.UseScrollRestoration = "useScrollRestoration";
736
- })(ne || (ne = {}));
737
- function rt(e) {
738
- return e + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router.";
739
- }
740
- function ve(e) {
741
- let t = s.useContext(W);
742
- return t || (process.env.NODE_ENV !== "production" ? g(!1, rt(e)) : g(!1)), t;
743
- }
744
- function it(e, t) {
745
- let {
746
- target: n,
747
- replace: r,
748
- state: a,
749
- preventScrollReset: i,
750
- relative: o,
751
- unstable_viewTransition: l
752
- } = t === void 0 ? {} : t, c = Ve(), u = P(), h = D(e, {
753
- relative: o
754
- });
755
- return s.useCallback((d) => {
756
- if (ze(d, n)) {
757
- d.preventDefault();
758
- let m = r !== void 0 ? r : F(u) === F(h);
759
- c(e, {
760
- replace: m,
761
- state: a,
762
- preventScrollReset: i,
763
- relative: o,
764
- unstable_viewTransition: l
765
- });
766
- }
767
- }, [u, c, h, r, a, n, e, i, o, l]);
768
- }
769
- function ot() {
770
- if (typeof document > "u")
771
- throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.");
772
- }
773
- let lt = 0, st = () => "__" + String(++lt) + "__";
774
- function ut() {
775
- let {
776
- router: e
777
- } = ve(k.UseSubmit), {
778
- basename: t
779
- } = s.useContext(x), n = Me();
780
- return s.useCallback(function(r, a) {
781
- a === void 0 && (a = {}), ot();
782
- let {
783
- action: i,
784
- method: o,
785
- encType: l,
786
- formData: c,
787
- body: u
788
- } = Ge(r, t);
789
- if (a.navigate === !1) {
790
- let h = a.fetcherKey || st();
791
- e.fetch(h, n, a.action || i, {
792
- preventScrollReset: a.preventScrollReset,
793
- formData: c,
794
- body: u,
795
- formMethod: a.method || o,
796
- formEncType: a.encType || l,
797
- unstable_flushSync: a.unstable_flushSync
798
- });
799
- } else
800
- e.navigate(a.action || i, {
801
- preventScrollReset: a.preventScrollReset,
802
- formData: c,
803
- body: u,
804
- formMethod: a.method || o,
805
- formEncType: a.encType || l,
806
- replace: a.replace,
807
- state: a.state,
808
- fromRouteId: n,
809
- unstable_flushSync: a.unstable_flushSync,
810
- unstable_viewTransition: a.unstable_viewTransition
811
- });
812
- }, [e, t, n]);
813
- }
814
- function ct(e, t) {
815
- let {
816
- relative: n
817
- } = t === void 0 ? {} : t, {
818
- basename: r
819
- } = s.useContext(x), a = s.useContext(L);
820
- a || (process.env.NODE_ENV !== "production" ? g(!1, "useFormAction must be used inside a RouteContext") : g(!1));
821
- let [i] = a.matches.slice(-1), o = _({}, D(e || ".", {
822
- relative: n
823
- })), l = P();
824
- if (e == null) {
825
- o.search = l.search;
826
- let c = new URLSearchParams(o.search);
827
- c.has("index") && c.get("index") === "" && (c.delete("index"), o.search = c.toString() ? "?" + c.toString() : "");
828
- }
829
- return (!e || e === ".") && i.route.index && (o.search = o.search ? o.search.replace(/^\?/, "?index&") : "?index"), r !== "/" && (o.pathname = o.pathname === "/" ? r : G([r, o.pathname])), F(o);
830
- }
831
- function ft(e, t) {
832
- t === void 0 && (t = {});
833
- let n = s.useContext(de);
834
- n == null && (process.env.NODE_ENV !== "production" ? g(!1, "`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?") : g(!1));
835
- let {
836
- basename: r
837
- } = ve(k.useViewTransitionState), a = D(e, {
838
- relative: t.relative
839
- });
840
- if (!n.isTransitioning)
841
- return !1;
842
- let i = C(n.currentLocation.pathname, r) || n.currentLocation.pathname, o = C(n.nextLocation.pathname, r) || n.nextLocation.pathname;
843
- return ee(a.pathname, o) != null || ee(a.pathname, i) != null;
844
- }
845
- const ae = {
846
- "menu-link": "_menu-link_8gjhh_1",
847
- "menu-link--active": "_menu-link--active_8gjhh_8"
848
- }, vt = (e) => /* @__PURE__ */ be(
849
- me,
850
- {
851
- ...e,
852
- className: ({ isActive: t }) => Ee(ae["menu-link"], { [ae["menu-link--active"]]: t })
853
- }
854
- );
855
- export {
856
- vt as M,
857
- mt as a
858
- };
859
- //# sourceMappingURL=MenuLink-yPEEfABB.js.map