flowlink-auth 2.7.9 → 2.8.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 (3) hide show
  1. package/dist/index.js +4604 -7
  2. package/package.json +1 -1
  3. package/src/SignUp.jsx +342 -335
package/dist/index.js CHANGED
@@ -1,10 +1,4607 @@
1
- import { default as default2 } from "./provider";
2
- import { default as default3 } from "./SignIn";
3
- import { default as default4 } from "./SignUp";
4
- import { useAuth } from "./provider";
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
+ }) : x)(function(x) {
10
+ if (typeof require !== "undefined") return require.apply(this, arguments);
11
+ throw Error('Dynamic require of "' + x + '" is not supported');
12
+ });
13
+ var __commonJS = (cb, mod) => function __require2() {
14
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
15
+ };
16
+ var __copyProps = (to, from, except, desc) => {
17
+ if (from && typeof from === "object" || typeof from === "function") {
18
+ for (let key of __getOwnPropNames(from))
19
+ if (!__hasOwnProp.call(to, key) && key !== except)
20
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21
+ }
22
+ return to;
23
+ };
24
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
+ // If the importer is in node compatibility mode or this is not an ESM
26
+ // file that has been converted to a CommonJS file using a Babel-
27
+ // compatible transform (i.e. "__esModule" has not been set), then set
28
+ // "default" to the CommonJS "module.exports" for node compatibility.
29
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30
+ mod
31
+ ));
32
+
33
+ // node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs
34
+ var require_interop_require_wildcard = __commonJS({
35
+ "node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs"(exports) {
36
+ "use strict";
37
+ function _getRequireWildcardCache(nodeInterop) {
38
+ if (typeof WeakMap !== "function") return null;
39
+ var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
40
+ var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
41
+ return (_getRequireWildcardCache = function(nodeInterop2) {
42
+ return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
43
+ })(nodeInterop);
44
+ }
45
+ function _interop_require_wildcard(obj, nodeInterop) {
46
+ if (!nodeInterop && obj && obj.__esModule) return obj;
47
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { default: obj };
48
+ var cache = _getRequireWildcardCache(nodeInterop);
49
+ if (cache && cache.has(obj)) return cache.get(obj);
50
+ var newObj = { __proto__: null };
51
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
52
+ for (var key in obj) {
53
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
54
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
55
+ if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc);
56
+ else newObj[key] = obj[key];
57
+ }
58
+ }
59
+ newObj.default = obj;
60
+ if (cache) cache.set(obj, newObj);
61
+ return newObj;
62
+ }
63
+ exports._ = _interop_require_wildcard;
64
+ }
65
+ });
66
+
67
+ // node_modules/next/dist/shared/lib/router/utils/querystring.js
68
+ var require_querystring = __commonJS({
69
+ "node_modules/next/dist/shared/lib/router/utils/querystring.js"(exports) {
70
+ "use strict";
71
+ Object.defineProperty(exports, "__esModule", {
72
+ value: true
73
+ });
74
+ function _export(target, all) {
75
+ for (var name in all) Object.defineProperty(target, name, {
76
+ enumerable: true,
77
+ get: all[name]
78
+ });
79
+ }
80
+ _export(exports, {
81
+ assign: function() {
82
+ return assign;
83
+ },
84
+ searchParamsToUrlQuery: function() {
85
+ return searchParamsToUrlQuery;
86
+ },
87
+ urlQueryToSearchParams: function() {
88
+ return urlQueryToSearchParams;
89
+ }
90
+ });
91
+ function searchParamsToUrlQuery(searchParams) {
92
+ const query = {};
93
+ for (const [key, value] of searchParams.entries()) {
94
+ const existing = query[key];
95
+ if (typeof existing === "undefined") {
96
+ query[key] = value;
97
+ } else if (Array.isArray(existing)) {
98
+ existing.push(value);
99
+ } else {
100
+ query[key] = [
101
+ existing,
102
+ value
103
+ ];
104
+ }
105
+ }
106
+ return query;
107
+ }
108
+ function stringifyUrlQueryParam(param) {
109
+ if (typeof param === "string") {
110
+ return param;
111
+ }
112
+ if (typeof param === "number" && !isNaN(param) || typeof param === "boolean") {
113
+ return String(param);
114
+ } else {
115
+ return "";
116
+ }
117
+ }
118
+ function urlQueryToSearchParams(query) {
119
+ const searchParams = new URLSearchParams();
120
+ for (const [key, value] of Object.entries(query)) {
121
+ if (Array.isArray(value)) {
122
+ for (const item of value) {
123
+ searchParams.append(key, stringifyUrlQueryParam(item));
124
+ }
125
+ } else {
126
+ searchParams.set(key, stringifyUrlQueryParam(value));
127
+ }
128
+ }
129
+ return searchParams;
130
+ }
131
+ function assign(target, ...searchParamsList) {
132
+ for (const searchParams of searchParamsList) {
133
+ for (const key of searchParams.keys()) {
134
+ target.delete(key);
135
+ }
136
+ for (const [key, value] of searchParams.entries()) {
137
+ target.append(key, value);
138
+ }
139
+ }
140
+ return target;
141
+ }
142
+ }
143
+ });
144
+
145
+ // node_modules/next/dist/shared/lib/router/utils/format-url.js
146
+ var require_format_url = __commonJS({
147
+ "node_modules/next/dist/shared/lib/router/utils/format-url.js"(exports) {
148
+ "use strict";
149
+ Object.defineProperty(exports, "__esModule", {
150
+ value: true
151
+ });
152
+ function _export(target, all) {
153
+ for (var name in all) Object.defineProperty(target, name, {
154
+ enumerable: true,
155
+ get: all[name]
156
+ });
157
+ }
158
+ _export(exports, {
159
+ formatUrl: function() {
160
+ return formatUrl;
161
+ },
162
+ formatWithValidation: function() {
163
+ return formatWithValidation;
164
+ },
165
+ urlObjectKeys: function() {
166
+ return urlObjectKeys;
167
+ }
168
+ });
169
+ var _interop_require_wildcard = require_interop_require_wildcard();
170
+ var _querystring = /* @__PURE__ */ _interop_require_wildcard._(require_querystring());
171
+ var slashedProtocols = /https?|ftp|gopher|file/;
172
+ function formatUrl(urlObj) {
173
+ let { auth, hostname } = urlObj;
174
+ let protocol = urlObj.protocol || "";
175
+ let pathname = urlObj.pathname || "";
176
+ let hash = urlObj.hash || "";
177
+ let query = urlObj.query || "";
178
+ let host = false;
179
+ auth = auth ? encodeURIComponent(auth).replace(/%3A/i, ":") + "@" : "";
180
+ if (urlObj.host) {
181
+ host = auth + urlObj.host;
182
+ } else if (hostname) {
183
+ host = auth + (~hostname.indexOf(":") ? `[${hostname}]` : hostname);
184
+ if (urlObj.port) {
185
+ host += ":" + urlObj.port;
186
+ }
187
+ }
188
+ if (query && typeof query === "object") {
189
+ query = String(_querystring.urlQueryToSearchParams(query));
190
+ }
191
+ let search = urlObj.search || query && `?${query}` || "";
192
+ if (protocol && !protocol.endsWith(":")) protocol += ":";
193
+ if (urlObj.slashes || (!protocol || slashedProtocols.test(protocol)) && host !== false) {
194
+ host = "//" + (host || "");
195
+ if (pathname && pathname[0] !== "/") pathname = "/" + pathname;
196
+ } else if (!host) {
197
+ host = "";
198
+ }
199
+ if (hash && hash[0] !== "#") hash = "#" + hash;
200
+ if (search && search[0] !== "?") search = "?" + search;
201
+ pathname = pathname.replace(/[?#]/g, encodeURIComponent);
202
+ search = search.replace("#", "%23");
203
+ return `${protocol}${host}${pathname}${search}${hash}`;
204
+ }
205
+ var urlObjectKeys = [
206
+ "auth",
207
+ "hash",
208
+ "host",
209
+ "hostname",
210
+ "href",
211
+ "path",
212
+ "pathname",
213
+ "port",
214
+ "protocol",
215
+ "query",
216
+ "search",
217
+ "slashes"
218
+ ];
219
+ function formatWithValidation(url) {
220
+ if (true) {
221
+ if (url !== null && typeof url === "object") {
222
+ Object.keys(url).forEach((key) => {
223
+ if (!urlObjectKeys.includes(key)) {
224
+ console.warn(`Unknown key passed via urlObject into url.format: ${key}`);
225
+ }
226
+ });
227
+ }
228
+ }
229
+ return formatUrl(url);
230
+ }
231
+ }
232
+ });
233
+
234
+ // node_modules/next/dist/shared/lib/router/utils/omit.js
235
+ var require_omit = __commonJS({
236
+ "node_modules/next/dist/shared/lib/router/utils/omit.js"(exports) {
237
+ "use strict";
238
+ Object.defineProperty(exports, "__esModule", {
239
+ value: true
240
+ });
241
+ Object.defineProperty(exports, "omit", {
242
+ enumerable: true,
243
+ get: function() {
244
+ return omit;
245
+ }
246
+ });
247
+ function omit(object, keys) {
248
+ const omitted = {};
249
+ Object.keys(object).forEach((key) => {
250
+ if (!keys.includes(key)) {
251
+ omitted[key] = object[key];
252
+ }
253
+ });
254
+ return omitted;
255
+ }
256
+ }
257
+ });
258
+
259
+ // node_modules/next/dist/shared/lib/utils.js
260
+ var require_utils = __commonJS({
261
+ "node_modules/next/dist/shared/lib/utils.js"(exports) {
262
+ "use strict";
263
+ Object.defineProperty(exports, "__esModule", {
264
+ value: true
265
+ });
266
+ function _export(target, all) {
267
+ for (var name in all) Object.defineProperty(target, name, {
268
+ enumerable: true,
269
+ get: all[name]
270
+ });
271
+ }
272
+ _export(exports, {
273
+ DecodeError: function() {
274
+ return DecodeError;
275
+ },
276
+ MiddlewareNotFoundError: function() {
277
+ return MiddlewareNotFoundError;
278
+ },
279
+ MissingStaticPage: function() {
280
+ return MissingStaticPage;
281
+ },
282
+ NormalizeError: function() {
283
+ return NormalizeError;
284
+ },
285
+ PageNotFoundError: function() {
286
+ return PageNotFoundError;
287
+ },
288
+ SP: function() {
289
+ return SP;
290
+ },
291
+ ST: function() {
292
+ return ST;
293
+ },
294
+ WEB_VITALS: function() {
295
+ return WEB_VITALS;
296
+ },
297
+ execOnce: function() {
298
+ return execOnce;
299
+ },
300
+ getDisplayName: function() {
301
+ return getDisplayName;
302
+ },
303
+ getLocationOrigin: function() {
304
+ return getLocationOrigin;
305
+ },
306
+ getURL: function() {
307
+ return getURL;
308
+ },
309
+ isAbsoluteUrl: function() {
310
+ return isAbsoluteUrl;
311
+ },
312
+ isResSent: function() {
313
+ return isResSent;
314
+ },
315
+ loadGetInitialProps: function() {
316
+ return loadGetInitialProps;
317
+ },
318
+ normalizeRepeatedSlashes: function() {
319
+ return normalizeRepeatedSlashes;
320
+ },
321
+ stringifyError: function() {
322
+ return stringifyError;
323
+ }
324
+ });
325
+ var WEB_VITALS = [
326
+ "CLS",
327
+ "FCP",
328
+ "FID",
329
+ "INP",
330
+ "LCP",
331
+ "TTFB"
332
+ ];
333
+ function execOnce(fn) {
334
+ let used = false;
335
+ let result;
336
+ return (...args) => {
337
+ if (!used) {
338
+ used = true;
339
+ result = fn(...args);
340
+ }
341
+ return result;
342
+ };
343
+ }
344
+ var ABSOLUTE_URL_REGEX = /^[a-zA-Z][a-zA-Z\d+\-.]*?:/;
345
+ var isAbsoluteUrl = (url) => ABSOLUTE_URL_REGEX.test(url);
346
+ function getLocationOrigin() {
347
+ const { protocol, hostname, port } = window.location;
348
+ return `${protocol}//${hostname}${port ? ":" + port : ""}`;
349
+ }
350
+ function getURL() {
351
+ const { href } = window.location;
352
+ const origin = getLocationOrigin();
353
+ return href.substring(origin.length);
354
+ }
355
+ function getDisplayName(Component) {
356
+ return typeof Component === "string" ? Component : Component.displayName || Component.name || "Unknown";
357
+ }
358
+ function isResSent(res) {
359
+ return res.finished || res.headersSent;
360
+ }
361
+ function normalizeRepeatedSlashes(url) {
362
+ const urlParts = url.split("?");
363
+ const urlNoQuery = urlParts[0];
364
+ return urlNoQuery.replace(/\\/g, "/").replace(/\/\/+/g, "/") + (urlParts[1] ? `?${urlParts.slice(1).join("?")}` : "");
365
+ }
366
+ async function loadGetInitialProps(App, ctx) {
367
+ if (true) {
368
+ if (App.prototype?.getInitialProps) {
369
+ const message = `"${getDisplayName(App)}.getInitialProps()" is defined as an instance method - visit https://nextjs.org/docs/messages/get-initial-props-as-an-instance-method for more information.`;
370
+ throw Object.defineProperty(new Error(message), "__NEXT_ERROR_CODE", {
371
+ value: "E394",
372
+ enumerable: false,
373
+ configurable: true
374
+ });
375
+ }
376
+ }
377
+ const res = ctx.res || ctx.ctx && ctx.ctx.res;
378
+ if (!App.getInitialProps) {
379
+ if (ctx.ctx && ctx.Component) {
380
+ return {
381
+ pageProps: await loadGetInitialProps(ctx.Component, ctx.ctx)
382
+ };
383
+ }
384
+ return {};
385
+ }
386
+ const props = await App.getInitialProps(ctx);
387
+ if (res && isResSent(res)) {
388
+ return props;
389
+ }
390
+ if (!props) {
391
+ const message = `"${getDisplayName(App)}.getInitialProps()" should resolve to an object. But found "${props}" instead.`;
392
+ throw Object.defineProperty(new Error(message), "__NEXT_ERROR_CODE", {
393
+ value: "E394",
394
+ enumerable: false,
395
+ configurable: true
396
+ });
397
+ }
398
+ if (true) {
399
+ if (Object.keys(props).length === 0 && !ctx.ctx) {
400
+ console.warn(`${getDisplayName(App)} returned an empty object from \`getInitialProps\`. This de-optimizes and prevents automatic static optimization. https://nextjs.org/docs/messages/empty-object-getInitialProps`);
401
+ }
402
+ }
403
+ return props;
404
+ }
405
+ var SP = typeof performance !== "undefined";
406
+ var ST = SP && [
407
+ "mark",
408
+ "measure",
409
+ "getEntriesByName"
410
+ ].every((method) => typeof performance[method] === "function");
411
+ var DecodeError = class extends Error {
412
+ };
413
+ var NormalizeError = class extends Error {
414
+ };
415
+ var PageNotFoundError = class extends Error {
416
+ constructor(page) {
417
+ super();
418
+ this.code = "ENOENT";
419
+ this.name = "PageNotFoundError";
420
+ this.message = `Cannot find module for page: ${page}`;
421
+ }
422
+ };
423
+ var MissingStaticPage = class extends Error {
424
+ constructor(page, message) {
425
+ super();
426
+ this.message = `Failed to load static file for page: ${page} ${message}`;
427
+ }
428
+ };
429
+ var MiddlewareNotFoundError = class extends Error {
430
+ constructor() {
431
+ super();
432
+ this.code = "ENOENT";
433
+ this.message = `Cannot find the middleware module`;
434
+ }
435
+ };
436
+ function stringifyError(error) {
437
+ return JSON.stringify({
438
+ message: error.message,
439
+ stack: error.stack
440
+ });
441
+ }
442
+ }
443
+ });
444
+
445
+ // node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js
446
+ var require_remove_trailing_slash = __commonJS({
447
+ "node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js"(exports) {
448
+ "use strict";
449
+ Object.defineProperty(exports, "__esModule", {
450
+ value: true
451
+ });
452
+ Object.defineProperty(exports, "removeTrailingSlash", {
453
+ enumerable: true,
454
+ get: function() {
455
+ return removeTrailingSlash;
456
+ }
457
+ });
458
+ function removeTrailingSlash(route) {
459
+ return route.replace(/\/$/, "") || "/";
460
+ }
461
+ }
462
+ });
463
+
464
+ // node_modules/next/dist/shared/lib/router/utils/parse-path.js
465
+ var require_parse_path = __commonJS({
466
+ "node_modules/next/dist/shared/lib/router/utils/parse-path.js"(exports) {
467
+ "use strict";
468
+ Object.defineProperty(exports, "__esModule", {
469
+ value: true
470
+ });
471
+ Object.defineProperty(exports, "parsePath", {
472
+ enumerable: true,
473
+ get: function() {
474
+ return parsePath;
475
+ }
476
+ });
477
+ function parsePath(path) {
478
+ const hashIndex = path.indexOf("#");
479
+ const queryIndex = path.indexOf("?");
480
+ const hasQuery = queryIndex > -1 && (hashIndex < 0 || queryIndex < hashIndex);
481
+ if (hasQuery || hashIndex > -1) {
482
+ return {
483
+ pathname: path.substring(0, hasQuery ? queryIndex : hashIndex),
484
+ query: hasQuery ? path.substring(queryIndex, hashIndex > -1 ? hashIndex : void 0) : "",
485
+ hash: hashIndex > -1 ? path.slice(hashIndex) : ""
486
+ };
487
+ }
488
+ return {
489
+ pathname: path,
490
+ query: "",
491
+ hash: ""
492
+ };
493
+ }
494
+ }
495
+ });
496
+
497
+ // node_modules/next/dist/client/normalize-trailing-slash.js
498
+ var require_normalize_trailing_slash = __commonJS({
499
+ "node_modules/next/dist/client/normalize-trailing-slash.js"(exports, module) {
500
+ "use strict";
501
+ Object.defineProperty(exports, "__esModule", {
502
+ value: true
503
+ });
504
+ Object.defineProperty(exports, "normalizePathTrailingSlash", {
505
+ enumerable: true,
506
+ get: function() {
507
+ return normalizePathTrailingSlash;
508
+ }
509
+ });
510
+ var _removetrailingslash = require_remove_trailing_slash();
511
+ var _parsepath = require_parse_path();
512
+ var normalizePathTrailingSlash = (path) => {
513
+ if (!path.startsWith("/") || process.env.__NEXT_MANUAL_TRAILING_SLASH) {
514
+ return path;
515
+ }
516
+ const { pathname, query, hash } = (0, _parsepath.parsePath)(path);
517
+ if (process.env.__NEXT_TRAILING_SLASH) {
518
+ if (/\.[^/]+\/?$/.test(pathname)) {
519
+ return `${(0, _removetrailingslash.removeTrailingSlash)(pathname)}${query}${hash}`;
520
+ } else if (pathname.endsWith("/")) {
521
+ return `${pathname}${query}${hash}`;
522
+ } else {
523
+ return `${pathname}/${query}${hash}`;
524
+ }
525
+ }
526
+ return `${(0, _removetrailingslash.removeTrailingSlash)(pathname)}${query}${hash}`;
527
+ };
528
+ if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
529
+ Object.defineProperty(exports.default, "__esModule", { value: true });
530
+ Object.assign(exports.default, exports);
531
+ module.exports = exports.default;
532
+ }
533
+ }
534
+ });
535
+
536
+ // node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js
537
+ var require_path_has_prefix = __commonJS({
538
+ "node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js"(exports) {
539
+ "use strict";
540
+ Object.defineProperty(exports, "__esModule", {
541
+ value: true
542
+ });
543
+ Object.defineProperty(exports, "pathHasPrefix", {
544
+ enumerable: true,
545
+ get: function() {
546
+ return pathHasPrefix;
547
+ }
548
+ });
549
+ var _parsepath = require_parse_path();
550
+ function pathHasPrefix(path, prefix) {
551
+ if (typeof path !== "string") {
552
+ return false;
553
+ }
554
+ const { pathname } = (0, _parsepath.parsePath)(path);
555
+ return pathname === prefix || pathname.startsWith(prefix + "/");
556
+ }
557
+ }
558
+ });
559
+
560
+ // node_modules/next/dist/client/has-base-path.js
561
+ var require_has_base_path = __commonJS({
562
+ "node_modules/next/dist/client/has-base-path.js"(exports, module) {
563
+ "use strict";
564
+ Object.defineProperty(exports, "__esModule", {
565
+ value: true
566
+ });
567
+ Object.defineProperty(exports, "hasBasePath", {
568
+ enumerable: true,
569
+ get: function() {
570
+ return hasBasePath;
571
+ }
572
+ });
573
+ var _pathhasprefix = require_path_has_prefix();
574
+ var basePath = process.env.__NEXT_ROUTER_BASEPATH || "";
575
+ function hasBasePath(path) {
576
+ return (0, _pathhasprefix.pathHasPrefix)(path, basePath);
577
+ }
578
+ if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
579
+ Object.defineProperty(exports.default, "__esModule", { value: true });
580
+ Object.assign(exports.default, exports);
581
+ module.exports = exports.default;
582
+ }
583
+ }
584
+ });
585
+
586
+ // node_modules/next/dist/shared/lib/router/utils/is-local-url.js
587
+ var require_is_local_url = __commonJS({
588
+ "node_modules/next/dist/shared/lib/router/utils/is-local-url.js"(exports) {
589
+ "use strict";
590
+ Object.defineProperty(exports, "__esModule", {
591
+ value: true
592
+ });
593
+ Object.defineProperty(exports, "isLocalURL", {
594
+ enumerable: true,
595
+ get: function() {
596
+ return isLocalURL;
597
+ }
598
+ });
599
+ var _utils = require_utils();
600
+ var _hasbasepath = require_has_base_path();
601
+ function isLocalURL(url) {
602
+ if (!(0, _utils.isAbsoluteUrl)(url)) return true;
603
+ try {
604
+ const locationOrigin = (0, _utils.getLocationOrigin)();
605
+ const resolved = new URL(url, locationOrigin);
606
+ return resolved.origin === locationOrigin && (0, _hasbasepath.hasBasePath)(resolved.pathname);
607
+ } catch (_) {
608
+ return false;
609
+ }
610
+ }
611
+ }
612
+ });
613
+
614
+ // node_modules/next/dist/shared/lib/router/utils/sorted-routes.js
615
+ var require_sorted_routes = __commonJS({
616
+ "node_modules/next/dist/shared/lib/router/utils/sorted-routes.js"(exports) {
617
+ "use strict";
618
+ Object.defineProperty(exports, "__esModule", {
619
+ value: true
620
+ });
621
+ function _export(target, all) {
622
+ for (var name in all) Object.defineProperty(target, name, {
623
+ enumerable: true,
624
+ get: all[name]
625
+ });
626
+ }
627
+ _export(exports, {
628
+ getSortedRouteObjects: function() {
629
+ return getSortedRouteObjects;
630
+ },
631
+ getSortedRoutes: function() {
632
+ return getSortedRoutes;
633
+ }
634
+ });
635
+ var UrlNode = class _UrlNode {
636
+ insert(urlPath) {
637
+ this._insert(urlPath.split("/").filter(Boolean), [], false);
638
+ }
639
+ smoosh() {
640
+ return this._smoosh();
641
+ }
642
+ _smoosh(prefix = "/") {
643
+ const childrenPaths = [
644
+ ...this.children.keys()
645
+ ].sort();
646
+ if (this.slugName !== null) {
647
+ childrenPaths.splice(childrenPaths.indexOf("[]"), 1);
648
+ }
649
+ if (this.restSlugName !== null) {
650
+ childrenPaths.splice(childrenPaths.indexOf("[...]"), 1);
651
+ }
652
+ if (this.optionalRestSlugName !== null) {
653
+ childrenPaths.splice(childrenPaths.indexOf("[[...]]"), 1);
654
+ }
655
+ const routes = childrenPaths.map((c) => this.children.get(c)._smoosh(`${prefix}${c}/`)).reduce((prev, curr) => [
656
+ ...prev,
657
+ ...curr
658
+ ], []);
659
+ if (this.slugName !== null) {
660
+ routes.push(...this.children.get("[]")._smoosh(`${prefix}[${this.slugName}]/`));
661
+ }
662
+ if (!this.placeholder) {
663
+ const r = prefix === "/" ? "/" : prefix.slice(0, -1);
664
+ if (this.optionalRestSlugName != null) {
665
+ throw Object.defineProperty(new Error(`You cannot define a route with the same specificity as a optional catch-all route ("${r}" and "${r}[[...${this.optionalRestSlugName}]]").`), "__NEXT_ERROR_CODE", {
666
+ value: "E458",
667
+ enumerable: false,
668
+ configurable: true
669
+ });
670
+ }
671
+ routes.unshift(r);
672
+ }
673
+ if (this.restSlugName !== null) {
674
+ routes.push(...this.children.get("[...]")._smoosh(`${prefix}[...${this.restSlugName}]/`));
675
+ }
676
+ if (this.optionalRestSlugName !== null) {
677
+ routes.push(...this.children.get("[[...]]")._smoosh(`${prefix}[[...${this.optionalRestSlugName}]]/`));
678
+ }
679
+ return routes;
680
+ }
681
+ _insert(urlPaths, slugNames, isCatchAll) {
682
+ if (urlPaths.length === 0) {
683
+ this.placeholder = false;
684
+ return;
685
+ }
686
+ if (isCatchAll) {
687
+ throw Object.defineProperty(new Error(`Catch-all must be the last part of the URL.`), "__NEXT_ERROR_CODE", {
688
+ value: "E392",
689
+ enumerable: false,
690
+ configurable: true
691
+ });
692
+ }
693
+ let nextSegment = urlPaths[0];
694
+ if (nextSegment.startsWith("[") && nextSegment.endsWith("]")) {
695
+ let handleSlug = function(previousSlug, nextSlug) {
696
+ if (previousSlug !== null) {
697
+ if (previousSlug !== nextSlug) {
698
+ throw Object.defineProperty(new Error(`You cannot use different slug names for the same dynamic path ('${previousSlug}' !== '${nextSlug}').`), "__NEXT_ERROR_CODE", {
699
+ value: "E337",
700
+ enumerable: false,
701
+ configurable: true
702
+ });
703
+ }
704
+ }
705
+ slugNames.forEach((slug) => {
706
+ if (slug === nextSlug) {
707
+ throw Object.defineProperty(new Error(`You cannot have the same slug name "${nextSlug}" repeat within a single dynamic path`), "__NEXT_ERROR_CODE", {
708
+ value: "E247",
709
+ enumerable: false,
710
+ configurable: true
711
+ });
712
+ }
713
+ if (slug.replace(/\W/g, "") === nextSegment.replace(/\W/g, "")) {
714
+ throw Object.defineProperty(new Error(`You cannot have the slug names "${slug}" and "${nextSlug}" differ only by non-word symbols within a single dynamic path`), "__NEXT_ERROR_CODE", {
715
+ value: "E499",
716
+ enumerable: false,
717
+ configurable: true
718
+ });
719
+ }
720
+ });
721
+ slugNames.push(nextSlug);
722
+ };
723
+ let segmentName = nextSegment.slice(1, -1);
724
+ let isOptional = false;
725
+ if (segmentName.startsWith("[") && segmentName.endsWith("]")) {
726
+ segmentName = segmentName.slice(1, -1);
727
+ isOptional = true;
728
+ }
729
+ if (segmentName.startsWith("\u2026")) {
730
+ throw Object.defineProperty(new Error(`Detected a three-dot character ('\u2026') at ('${segmentName}'). Did you mean ('...')?`), "__NEXT_ERROR_CODE", {
731
+ value: "E147",
732
+ enumerable: false,
733
+ configurable: true
734
+ });
735
+ }
736
+ if (segmentName.startsWith("...")) {
737
+ segmentName = segmentName.substring(3);
738
+ isCatchAll = true;
739
+ }
740
+ if (segmentName.startsWith("[") || segmentName.endsWith("]")) {
741
+ throw Object.defineProperty(new Error(`Segment names may not start or end with extra brackets ('${segmentName}').`), "__NEXT_ERROR_CODE", {
742
+ value: "E421",
743
+ enumerable: false,
744
+ configurable: true
745
+ });
746
+ }
747
+ if (segmentName.startsWith(".")) {
748
+ throw Object.defineProperty(new Error(`Segment names may not start with erroneous periods ('${segmentName}').`), "__NEXT_ERROR_CODE", {
749
+ value: "E288",
750
+ enumerable: false,
751
+ configurable: true
752
+ });
753
+ }
754
+ if (isCatchAll) {
755
+ if (isOptional) {
756
+ if (this.restSlugName != null) {
757
+ throw Object.defineProperty(new Error(`You cannot use both an required and optional catch-all route at the same level ("[...${this.restSlugName}]" and "${urlPaths[0]}" ).`), "__NEXT_ERROR_CODE", {
758
+ value: "E299",
759
+ enumerable: false,
760
+ configurable: true
761
+ });
762
+ }
763
+ handleSlug(this.optionalRestSlugName, segmentName);
764
+ this.optionalRestSlugName = segmentName;
765
+ nextSegment = "[[...]]";
766
+ } else {
767
+ if (this.optionalRestSlugName != null) {
768
+ throw Object.defineProperty(new Error(`You cannot use both an optional and required catch-all route at the same level ("[[...${this.optionalRestSlugName}]]" and "${urlPaths[0]}").`), "__NEXT_ERROR_CODE", {
769
+ value: "E300",
770
+ enumerable: false,
771
+ configurable: true
772
+ });
773
+ }
774
+ handleSlug(this.restSlugName, segmentName);
775
+ this.restSlugName = segmentName;
776
+ nextSegment = "[...]";
777
+ }
778
+ } else {
779
+ if (isOptional) {
780
+ throw Object.defineProperty(new Error(`Optional route parameters are not yet supported ("${urlPaths[0]}").`), "__NEXT_ERROR_CODE", {
781
+ value: "E435",
782
+ enumerable: false,
783
+ configurable: true
784
+ });
785
+ }
786
+ handleSlug(this.slugName, segmentName);
787
+ this.slugName = segmentName;
788
+ nextSegment = "[]";
789
+ }
790
+ }
791
+ if (!this.children.has(nextSegment)) {
792
+ this.children.set(nextSegment, new _UrlNode());
793
+ }
794
+ this.children.get(nextSegment)._insert(urlPaths.slice(1), slugNames, isCatchAll);
795
+ }
796
+ constructor() {
797
+ this.placeholder = true;
798
+ this.children = /* @__PURE__ */ new Map();
799
+ this.slugName = null;
800
+ this.restSlugName = null;
801
+ this.optionalRestSlugName = null;
802
+ }
803
+ };
804
+ function getSortedRoutes(normalizedPages) {
805
+ const root = new UrlNode();
806
+ normalizedPages.forEach((pagePath) => root.insert(pagePath));
807
+ return root.smoosh();
808
+ }
809
+ function getSortedRouteObjects(objects, getter) {
810
+ const indexes = {};
811
+ const pathnames = [];
812
+ for (let i = 0; i < objects.length; i++) {
813
+ const pathname = getter(objects[i]);
814
+ indexes[pathname] = i;
815
+ pathnames[i] = pathname;
816
+ }
817
+ const sorted = getSortedRoutes(pathnames);
818
+ return sorted.map((pathname) => objects[indexes[pathname]]);
819
+ }
820
+ }
821
+ });
822
+
823
+ // node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.js
824
+ var require_ensure_leading_slash = __commonJS({
825
+ "node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.js"(exports) {
826
+ "use strict";
827
+ Object.defineProperty(exports, "__esModule", {
828
+ value: true
829
+ });
830
+ Object.defineProperty(exports, "ensureLeadingSlash", {
831
+ enumerable: true,
832
+ get: function() {
833
+ return ensureLeadingSlash;
834
+ }
835
+ });
836
+ function ensureLeadingSlash(path) {
837
+ return path.startsWith("/") ? path : `/${path}`;
838
+ }
839
+ }
840
+ });
841
+
842
+ // node_modules/next/dist/shared/lib/segment.js
843
+ var require_segment = __commonJS({
844
+ "node_modules/next/dist/shared/lib/segment.js"(exports) {
845
+ "use strict";
846
+ Object.defineProperty(exports, "__esModule", {
847
+ value: true
848
+ });
849
+ function _export(target, all) {
850
+ for (var name in all) Object.defineProperty(target, name, {
851
+ enumerable: true,
852
+ get: all[name]
853
+ });
854
+ }
855
+ _export(exports, {
856
+ DEFAULT_SEGMENT_KEY: function() {
857
+ return DEFAULT_SEGMENT_KEY;
858
+ },
859
+ PAGE_SEGMENT_KEY: function() {
860
+ return PAGE_SEGMENT_KEY;
861
+ },
862
+ addSearchParamsIfPageSegment: function() {
863
+ return addSearchParamsIfPageSegment;
864
+ },
865
+ computeSelectedLayoutSegment: function() {
866
+ return computeSelectedLayoutSegment;
867
+ },
868
+ getSegmentValue: function() {
869
+ return getSegmentValue;
870
+ },
871
+ getSelectedLayoutSegmentPath: function() {
872
+ return getSelectedLayoutSegmentPath;
873
+ },
874
+ isGroupSegment: function() {
875
+ return isGroupSegment;
876
+ },
877
+ isParallelRouteSegment: function() {
878
+ return isParallelRouteSegment;
879
+ }
880
+ });
881
+ function getSegmentValue(segment) {
882
+ return Array.isArray(segment) ? segment[1] : segment;
883
+ }
884
+ function isGroupSegment(segment) {
885
+ return segment[0] === "(" && segment.endsWith(")");
886
+ }
887
+ function isParallelRouteSegment(segment) {
888
+ return segment.startsWith("@") && segment !== "@children";
889
+ }
890
+ function addSearchParamsIfPageSegment(segment, searchParams) {
891
+ const isPageSegment = segment.includes(PAGE_SEGMENT_KEY);
892
+ if (isPageSegment) {
893
+ const stringifiedQuery = JSON.stringify(searchParams);
894
+ return stringifiedQuery !== "{}" ? PAGE_SEGMENT_KEY + "?" + stringifiedQuery : PAGE_SEGMENT_KEY;
895
+ }
896
+ return segment;
897
+ }
898
+ function computeSelectedLayoutSegment(segments, parallelRouteKey) {
899
+ if (!segments || segments.length === 0) {
900
+ return null;
901
+ }
902
+ const rawSegment = parallelRouteKey === "children" ? segments[0] : segments[segments.length - 1];
903
+ return rawSegment === DEFAULT_SEGMENT_KEY ? null : rawSegment;
904
+ }
905
+ function getSelectedLayoutSegmentPath(tree, parallelRouteKey, first = true, segmentPath = []) {
906
+ let node;
907
+ if (first) {
908
+ node = tree[1][parallelRouteKey];
909
+ } else {
910
+ const parallelRoutes = tree[1];
911
+ node = parallelRoutes.children ?? Object.values(parallelRoutes)[0];
912
+ }
913
+ if (!node) return segmentPath;
914
+ const segment = node[0];
915
+ let segmentValue = getSegmentValue(segment);
916
+ if (!segmentValue || segmentValue.startsWith(PAGE_SEGMENT_KEY)) {
917
+ return segmentPath;
918
+ }
919
+ segmentPath.push(segmentValue);
920
+ return getSelectedLayoutSegmentPath(node, parallelRouteKey, false, segmentPath);
921
+ }
922
+ var PAGE_SEGMENT_KEY = "__PAGE__";
923
+ var DEFAULT_SEGMENT_KEY = "__DEFAULT__";
924
+ }
925
+ });
926
+
927
+ // node_modules/next/dist/shared/lib/router/utils/app-paths.js
928
+ var require_app_paths = __commonJS({
929
+ "node_modules/next/dist/shared/lib/router/utils/app-paths.js"(exports) {
930
+ "use strict";
931
+ Object.defineProperty(exports, "__esModule", {
932
+ value: true
933
+ });
934
+ function _export(target, all) {
935
+ for (var name in all) Object.defineProperty(target, name, {
936
+ enumerable: true,
937
+ get: all[name]
938
+ });
939
+ }
940
+ _export(exports, {
941
+ normalizeAppPath: function() {
942
+ return normalizeAppPath;
943
+ },
944
+ normalizeRscURL: function() {
945
+ return normalizeRscURL;
946
+ }
947
+ });
948
+ var _ensureleadingslash = require_ensure_leading_slash();
949
+ var _segment = require_segment();
950
+ function normalizeAppPath(route) {
951
+ return (0, _ensureleadingslash.ensureLeadingSlash)(route.split("/").reduce((pathname, segment, index, segments) => {
952
+ if (!segment) {
953
+ return pathname;
954
+ }
955
+ if ((0, _segment.isGroupSegment)(segment)) {
956
+ return pathname;
957
+ }
958
+ if (segment[0] === "@") {
959
+ return pathname;
960
+ }
961
+ if ((segment === "page" || segment === "route") && index === segments.length - 1) {
962
+ return pathname;
963
+ }
964
+ return `${pathname}/${segment}`;
965
+ }, ""));
966
+ }
967
+ function normalizeRscURL(url) {
968
+ return url.replace(
969
+ /\.rsc($|\?)/,
970
+ // $1 ensures `?` is preserved
971
+ "$1"
972
+ );
973
+ }
974
+ }
975
+ });
976
+
977
+ // node_modules/next/dist/shared/lib/router/utils/interception-routes.js
978
+ var require_interception_routes = __commonJS({
979
+ "node_modules/next/dist/shared/lib/router/utils/interception-routes.js"(exports) {
980
+ "use strict";
981
+ Object.defineProperty(exports, "__esModule", {
982
+ value: true
983
+ });
984
+ function _export(target, all) {
985
+ for (var name in all) Object.defineProperty(target, name, {
986
+ enumerable: true,
987
+ get: all[name]
988
+ });
989
+ }
990
+ _export(exports, {
991
+ INTERCEPTION_ROUTE_MARKERS: function() {
992
+ return INTERCEPTION_ROUTE_MARKERS;
993
+ },
994
+ extractInterceptionRouteInformation: function() {
995
+ return extractInterceptionRouteInformation;
996
+ },
997
+ isInterceptionRouteAppPath: function() {
998
+ return isInterceptionRouteAppPath;
999
+ }
1000
+ });
1001
+ var _apppaths = require_app_paths();
1002
+ var INTERCEPTION_ROUTE_MARKERS = [
1003
+ "(..)(..)",
1004
+ "(.)",
1005
+ "(..)",
1006
+ "(...)"
1007
+ ];
1008
+ function isInterceptionRouteAppPath(path) {
1009
+ return path.split("/").find((segment) => INTERCEPTION_ROUTE_MARKERS.find((m) => segment.startsWith(m))) !== void 0;
1010
+ }
1011
+ function extractInterceptionRouteInformation(path) {
1012
+ let interceptingRoute;
1013
+ let marker;
1014
+ let interceptedRoute;
1015
+ for (const segment of path.split("/")) {
1016
+ marker = INTERCEPTION_ROUTE_MARKERS.find((m) => segment.startsWith(m));
1017
+ if (marker) {
1018
+ ;
1019
+ [interceptingRoute, interceptedRoute] = path.split(marker, 2);
1020
+ break;
1021
+ }
1022
+ }
1023
+ if (!interceptingRoute || !marker || !interceptedRoute) {
1024
+ throw Object.defineProperty(new Error(`Invalid interception route: ${path}. Must be in the format /<intercepting route>/(..|...|..)(..)/<intercepted route>`), "__NEXT_ERROR_CODE", {
1025
+ value: "E269",
1026
+ enumerable: false,
1027
+ configurable: true
1028
+ });
1029
+ }
1030
+ interceptingRoute = (0, _apppaths.normalizeAppPath)(interceptingRoute);
1031
+ switch (marker) {
1032
+ case "(.)":
1033
+ if (interceptingRoute === "/") {
1034
+ interceptedRoute = `/${interceptedRoute}`;
1035
+ } else {
1036
+ interceptedRoute = interceptingRoute + "/" + interceptedRoute;
1037
+ }
1038
+ break;
1039
+ case "(..)":
1040
+ if (interceptingRoute === "/") {
1041
+ throw Object.defineProperty(new Error(`Invalid interception route: ${path}. Cannot use (..) marker at the root level, use (.) instead.`), "__NEXT_ERROR_CODE", {
1042
+ value: "E207",
1043
+ enumerable: false,
1044
+ configurable: true
1045
+ });
1046
+ }
1047
+ interceptedRoute = interceptingRoute.split("/").slice(0, -1).concat(interceptedRoute).join("/");
1048
+ break;
1049
+ case "(...)":
1050
+ interceptedRoute = "/" + interceptedRoute;
1051
+ break;
1052
+ case "(..)(..)":
1053
+ const splitInterceptingRoute = interceptingRoute.split("/");
1054
+ if (splitInterceptingRoute.length <= 2) {
1055
+ throw Object.defineProperty(new Error(`Invalid interception route: ${path}. Cannot use (..)(..) marker at the root level or one level up.`), "__NEXT_ERROR_CODE", {
1056
+ value: "E486",
1057
+ enumerable: false,
1058
+ configurable: true
1059
+ });
1060
+ }
1061
+ interceptedRoute = splitInterceptingRoute.slice(0, -2).concat(interceptedRoute).join("/");
1062
+ break;
1063
+ default:
1064
+ throw Object.defineProperty(new Error("Invariant: unexpected marker"), "__NEXT_ERROR_CODE", {
1065
+ value: "E112",
1066
+ enumerable: false,
1067
+ configurable: true
1068
+ });
1069
+ }
1070
+ return {
1071
+ interceptingRoute,
1072
+ interceptedRoute
1073
+ };
1074
+ }
1075
+ }
1076
+ });
1077
+
1078
+ // node_modules/next/dist/shared/lib/router/utils/is-dynamic.js
1079
+ var require_is_dynamic = __commonJS({
1080
+ "node_modules/next/dist/shared/lib/router/utils/is-dynamic.js"(exports) {
1081
+ "use strict";
1082
+ Object.defineProperty(exports, "__esModule", {
1083
+ value: true
1084
+ });
1085
+ Object.defineProperty(exports, "isDynamicRoute", {
1086
+ enumerable: true,
1087
+ get: function() {
1088
+ return isDynamicRoute;
1089
+ }
1090
+ });
1091
+ var _interceptionroutes = require_interception_routes();
1092
+ var TEST_ROUTE = /\/[^/]*\[[^/]+\][^/]*(?=\/|$)/;
1093
+ var TEST_STRICT_ROUTE = /\/\[[^/]+\](?=\/|$)/;
1094
+ function isDynamicRoute(route, strict = true) {
1095
+ if ((0, _interceptionroutes.isInterceptionRouteAppPath)(route)) {
1096
+ route = (0, _interceptionroutes.extractInterceptionRouteInformation)(route).interceptedRoute;
1097
+ }
1098
+ if (strict) {
1099
+ return TEST_STRICT_ROUTE.test(route);
1100
+ }
1101
+ return TEST_ROUTE.test(route);
1102
+ }
1103
+ }
1104
+ });
1105
+
1106
+ // node_modules/next/dist/shared/lib/router/utils/index.js
1107
+ var require_utils2 = __commonJS({
1108
+ "node_modules/next/dist/shared/lib/router/utils/index.js"(exports) {
1109
+ "use strict";
1110
+ Object.defineProperty(exports, "__esModule", {
1111
+ value: true
1112
+ });
1113
+ function _export(target, all) {
1114
+ for (var name in all) Object.defineProperty(target, name, {
1115
+ enumerable: true,
1116
+ get: all[name]
1117
+ });
1118
+ }
1119
+ _export(exports, {
1120
+ getSortedRouteObjects: function() {
1121
+ return _sortedroutes.getSortedRouteObjects;
1122
+ },
1123
+ getSortedRoutes: function() {
1124
+ return _sortedroutes.getSortedRoutes;
1125
+ },
1126
+ isDynamicRoute: function() {
1127
+ return _isdynamic.isDynamicRoute;
1128
+ }
1129
+ });
1130
+ var _sortedroutes = require_sorted_routes();
1131
+ var _isdynamic = require_is_dynamic();
1132
+ }
1133
+ });
1134
+
1135
+ // node_modules/next/dist/compiled/path-to-regexp/index.js
1136
+ var require_path_to_regexp = __commonJS({
1137
+ "node_modules/next/dist/compiled/path-to-regexp/index.js"(exports, module) {
1138
+ (() => {
1139
+ "use strict";
1140
+ if (typeof __nccwpck_require__ !== "undefined") __nccwpck_require__.ab = __dirname + "/";
1141
+ var e = {};
1142
+ (() => {
1143
+ var n = e;
1144
+ Object.defineProperty(n, "__esModule", { value: true });
1145
+ n.pathToRegexp = n.tokensToRegexp = n.regexpToFunction = n.match = n.tokensToFunction = n.compile = n.parse = void 0;
1146
+ function lexer(e2) {
1147
+ var n2 = [];
1148
+ var r = 0;
1149
+ while (r < e2.length) {
1150
+ var t = e2[r];
1151
+ if (t === "*" || t === "+" || t === "?") {
1152
+ n2.push({ type: "MODIFIER", index: r, value: e2[r++] });
1153
+ continue;
1154
+ }
1155
+ if (t === "\\") {
1156
+ n2.push({ type: "ESCAPED_CHAR", index: r++, value: e2[r++] });
1157
+ continue;
1158
+ }
1159
+ if (t === "{") {
1160
+ n2.push({ type: "OPEN", index: r, value: e2[r++] });
1161
+ continue;
1162
+ }
1163
+ if (t === "}") {
1164
+ n2.push({ type: "CLOSE", index: r, value: e2[r++] });
1165
+ continue;
1166
+ }
1167
+ if (t === ":") {
1168
+ var a = "";
1169
+ var i = r + 1;
1170
+ while (i < e2.length) {
1171
+ var o = e2.charCodeAt(i);
1172
+ if (o >= 48 && o <= 57 || o >= 65 && o <= 90 || o >= 97 && o <= 122 || o === 95) {
1173
+ a += e2[i++];
1174
+ continue;
1175
+ }
1176
+ break;
1177
+ }
1178
+ if (!a) throw new TypeError("Missing parameter name at ".concat(r));
1179
+ n2.push({ type: "NAME", index: r, value: a });
1180
+ r = i;
1181
+ continue;
1182
+ }
1183
+ if (t === "(") {
1184
+ var c = 1;
1185
+ var f = "";
1186
+ var i = r + 1;
1187
+ if (e2[i] === "?") {
1188
+ throw new TypeError('Pattern cannot start with "?" at '.concat(i));
1189
+ }
1190
+ while (i < e2.length) {
1191
+ if (e2[i] === "\\") {
1192
+ f += e2[i++] + e2[i++];
1193
+ continue;
1194
+ }
1195
+ if (e2[i] === ")") {
1196
+ c--;
1197
+ if (c === 0) {
1198
+ i++;
1199
+ break;
1200
+ }
1201
+ } else if (e2[i] === "(") {
1202
+ c++;
1203
+ if (e2[i + 1] !== "?") {
1204
+ throw new TypeError("Capturing groups are not allowed at ".concat(i));
1205
+ }
1206
+ }
1207
+ f += e2[i++];
1208
+ }
1209
+ if (c) throw new TypeError("Unbalanced pattern at ".concat(r));
1210
+ if (!f) throw new TypeError("Missing pattern at ".concat(r));
1211
+ n2.push({ type: "PATTERN", index: r, value: f });
1212
+ r = i;
1213
+ continue;
1214
+ }
1215
+ n2.push({ type: "CHAR", index: r, value: e2[r++] });
1216
+ }
1217
+ n2.push({ type: "END", index: r, value: "" });
1218
+ return n2;
1219
+ }
1220
+ function parse(e2, n2) {
1221
+ if (n2 === void 0) {
1222
+ n2 = {};
1223
+ }
1224
+ var r = lexer(e2);
1225
+ var t = n2.prefixes, a = t === void 0 ? "./" : t, i = n2.delimiter, o = i === void 0 ? "/#?" : i;
1226
+ var c = [];
1227
+ var f = 0;
1228
+ var u = 0;
1229
+ var p = "";
1230
+ var tryConsume = function(e3) {
1231
+ if (u < r.length && r[u].type === e3) return r[u++].value;
1232
+ };
1233
+ var mustConsume = function(e3) {
1234
+ var n3 = tryConsume(e3);
1235
+ if (n3 !== void 0) return n3;
1236
+ var t2 = r[u], a2 = t2.type, i2 = t2.index;
1237
+ throw new TypeError("Unexpected ".concat(a2, " at ").concat(i2, ", expected ").concat(e3));
1238
+ };
1239
+ var consumeText = function() {
1240
+ var e3 = "";
1241
+ var n3;
1242
+ while (n3 = tryConsume("CHAR") || tryConsume("ESCAPED_CHAR")) {
1243
+ e3 += n3;
1244
+ }
1245
+ return e3;
1246
+ };
1247
+ var isSafe = function(e3) {
1248
+ for (var n3 = 0, r2 = o; n3 < r2.length; n3++) {
1249
+ var t2 = r2[n3];
1250
+ if (e3.indexOf(t2) > -1) return true;
1251
+ }
1252
+ return false;
1253
+ };
1254
+ var safePattern = function(e3) {
1255
+ var n3 = c[c.length - 1];
1256
+ var r2 = e3 || (n3 && typeof n3 === "string" ? n3 : "");
1257
+ if (n3 && !r2) {
1258
+ throw new TypeError('Must have text between two parameters, missing text after "'.concat(n3.name, '"'));
1259
+ }
1260
+ if (!r2 || isSafe(r2)) return "[^".concat(escapeString(o), "]+?");
1261
+ return "(?:(?!".concat(escapeString(r2), ")[^").concat(escapeString(o), "])+?");
1262
+ };
1263
+ while (u < r.length) {
1264
+ var v = tryConsume("CHAR");
1265
+ var s = tryConsume("NAME");
1266
+ var d = tryConsume("PATTERN");
1267
+ if (s || d) {
1268
+ var g = v || "";
1269
+ if (a.indexOf(g) === -1) {
1270
+ p += g;
1271
+ g = "";
1272
+ }
1273
+ if (p) {
1274
+ c.push(p);
1275
+ p = "";
1276
+ }
1277
+ c.push({ name: s || f++, prefix: g, suffix: "", pattern: d || safePattern(g), modifier: tryConsume("MODIFIER") || "" });
1278
+ continue;
1279
+ }
1280
+ var x = v || tryConsume("ESCAPED_CHAR");
1281
+ if (x) {
1282
+ p += x;
1283
+ continue;
1284
+ }
1285
+ if (p) {
1286
+ c.push(p);
1287
+ p = "";
1288
+ }
1289
+ var h = tryConsume("OPEN");
1290
+ if (h) {
1291
+ var g = consumeText();
1292
+ var l = tryConsume("NAME") || "";
1293
+ var m = tryConsume("PATTERN") || "";
1294
+ var T = consumeText();
1295
+ mustConsume("CLOSE");
1296
+ c.push({ name: l || (m ? f++ : ""), pattern: l && !m ? safePattern(g) : m, prefix: g, suffix: T, modifier: tryConsume("MODIFIER") || "" });
1297
+ continue;
1298
+ }
1299
+ mustConsume("END");
1300
+ }
1301
+ return c;
1302
+ }
1303
+ n.parse = parse;
1304
+ function compile(e2, n2) {
1305
+ return tokensToFunction(parse(e2, n2), n2);
1306
+ }
1307
+ n.compile = compile;
1308
+ function tokensToFunction(e2, n2) {
1309
+ if (n2 === void 0) {
1310
+ n2 = {};
1311
+ }
1312
+ var r = flags(n2);
1313
+ var t = n2.encode, a = t === void 0 ? function(e3) {
1314
+ return e3;
1315
+ } : t, i = n2.validate, o = i === void 0 ? true : i;
1316
+ var c = e2.map((function(e3) {
1317
+ if (typeof e3 === "object") {
1318
+ return new RegExp("^(?:".concat(e3.pattern, ")$"), r);
1319
+ }
1320
+ }));
1321
+ return function(n3) {
1322
+ var r2 = "";
1323
+ for (var t2 = 0; t2 < e2.length; t2++) {
1324
+ var i2 = e2[t2];
1325
+ if (typeof i2 === "string") {
1326
+ r2 += i2;
1327
+ continue;
1328
+ }
1329
+ var f = n3 ? n3[i2.name] : void 0;
1330
+ var u = i2.modifier === "?" || i2.modifier === "*";
1331
+ var p = i2.modifier === "*" || i2.modifier === "+";
1332
+ if (Array.isArray(f)) {
1333
+ if (!p) {
1334
+ throw new TypeError('Expected "'.concat(i2.name, '" to not repeat, but got an array'));
1335
+ }
1336
+ if (f.length === 0) {
1337
+ if (u) continue;
1338
+ throw new TypeError('Expected "'.concat(i2.name, '" to not be empty'));
1339
+ }
1340
+ for (var v = 0; v < f.length; v++) {
1341
+ var s = a(f[v], i2);
1342
+ if (o && !c[t2].test(s)) {
1343
+ throw new TypeError('Expected all "'.concat(i2.name, '" to match "').concat(i2.pattern, '", but got "').concat(s, '"'));
1344
+ }
1345
+ r2 += i2.prefix + s + i2.suffix;
1346
+ }
1347
+ continue;
1348
+ }
1349
+ if (typeof f === "string" || typeof f === "number") {
1350
+ var s = a(String(f), i2);
1351
+ if (o && !c[t2].test(s)) {
1352
+ throw new TypeError('Expected "'.concat(i2.name, '" to match "').concat(i2.pattern, '", but got "').concat(s, '"'));
1353
+ }
1354
+ r2 += i2.prefix + s + i2.suffix;
1355
+ continue;
1356
+ }
1357
+ if (u) continue;
1358
+ var d = p ? "an array" : "a string";
1359
+ throw new TypeError('Expected "'.concat(i2.name, '" to be ').concat(d));
1360
+ }
1361
+ return r2;
1362
+ };
1363
+ }
1364
+ n.tokensToFunction = tokensToFunction;
1365
+ function match(e2, n2) {
1366
+ var r = [];
1367
+ var t = pathToRegexp(e2, r, n2);
1368
+ return regexpToFunction(t, r, n2);
1369
+ }
1370
+ n.match = match;
1371
+ function regexpToFunction(e2, n2, r) {
1372
+ if (r === void 0) {
1373
+ r = {};
1374
+ }
1375
+ var t = r.decode, a = t === void 0 ? function(e3) {
1376
+ return e3;
1377
+ } : t;
1378
+ return function(r2) {
1379
+ var t2 = e2.exec(r2);
1380
+ if (!t2) return false;
1381
+ var i = t2[0], o = t2.index;
1382
+ var c = /* @__PURE__ */ Object.create(null);
1383
+ var _loop_1 = function(e3) {
1384
+ if (t2[e3] === void 0) return "continue";
1385
+ var r3 = n2[e3 - 1];
1386
+ if (r3.modifier === "*" || r3.modifier === "+") {
1387
+ c[r3.name] = t2[e3].split(r3.prefix + r3.suffix).map((function(e4) {
1388
+ return a(e4, r3);
1389
+ }));
1390
+ } else {
1391
+ c[r3.name] = a(t2[e3], r3);
1392
+ }
1393
+ };
1394
+ for (var f = 1; f < t2.length; f++) {
1395
+ _loop_1(f);
1396
+ }
1397
+ return { path: i, index: o, params: c };
1398
+ };
1399
+ }
1400
+ n.regexpToFunction = regexpToFunction;
1401
+ function escapeString(e2) {
1402
+ return e2.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1");
1403
+ }
1404
+ function flags(e2) {
1405
+ return e2 && e2.sensitive ? "" : "i";
1406
+ }
1407
+ function regexpToRegexp(e2, n2) {
1408
+ if (!n2) return e2;
1409
+ var r = /\((?:\?<(.*?)>)?(?!\?)/g;
1410
+ var t = 0;
1411
+ var a = r.exec(e2.source);
1412
+ while (a) {
1413
+ n2.push({ name: a[1] || t++, prefix: "", suffix: "", modifier: "", pattern: "" });
1414
+ a = r.exec(e2.source);
1415
+ }
1416
+ return e2;
1417
+ }
1418
+ function arrayToRegexp(e2, n2, r) {
1419
+ var t = e2.map((function(e3) {
1420
+ return pathToRegexp(e3, n2, r).source;
1421
+ }));
1422
+ return new RegExp("(?:".concat(t.join("|"), ")"), flags(r));
1423
+ }
1424
+ function stringToRegexp(e2, n2, r) {
1425
+ return tokensToRegexp(parse(e2, r), n2, r);
1426
+ }
1427
+ function tokensToRegexp(e2, n2, r) {
1428
+ if (r === void 0) {
1429
+ r = {};
1430
+ }
1431
+ var t = r.strict, a = t === void 0 ? false : t, i = r.start, o = i === void 0 ? true : i, c = r.end, f = c === void 0 ? true : c, u = r.encode, p = u === void 0 ? function(e3) {
1432
+ return e3;
1433
+ } : u, v = r.delimiter, s = v === void 0 ? "/#?" : v, d = r.endsWith, g = d === void 0 ? "" : d;
1434
+ var x = "[".concat(escapeString(g), "]|$");
1435
+ var h = "[".concat(escapeString(s), "]");
1436
+ var l = o ? "^" : "";
1437
+ for (var m = 0, T = e2; m < T.length; m++) {
1438
+ var E = T[m];
1439
+ if (typeof E === "string") {
1440
+ l += escapeString(p(E));
1441
+ } else {
1442
+ var w = escapeString(p(E.prefix));
1443
+ var y = escapeString(p(E.suffix));
1444
+ if (E.pattern) {
1445
+ if (n2) n2.push(E);
1446
+ if (w || y) {
1447
+ if (E.modifier === "+" || E.modifier === "*") {
1448
+ var R = E.modifier === "*" ? "?" : "";
1449
+ l += "(?:".concat(w, "((?:").concat(E.pattern, ")(?:").concat(y).concat(w, "(?:").concat(E.pattern, "))*)").concat(y, ")").concat(R);
1450
+ } else {
1451
+ l += "(?:".concat(w, "(").concat(E.pattern, ")").concat(y, ")").concat(E.modifier);
1452
+ }
1453
+ } else {
1454
+ if (E.modifier === "+" || E.modifier === "*") {
1455
+ throw new TypeError('Can not repeat "'.concat(E.name, '" without a prefix and suffix'));
1456
+ }
1457
+ l += "(".concat(E.pattern, ")").concat(E.modifier);
1458
+ }
1459
+ } else {
1460
+ l += "(?:".concat(w).concat(y, ")").concat(E.modifier);
1461
+ }
1462
+ }
1463
+ }
1464
+ if (f) {
1465
+ if (!a) l += "".concat(h, "?");
1466
+ l += !r.endsWith ? "$" : "(?=".concat(x, ")");
1467
+ } else {
1468
+ var A = e2[e2.length - 1];
1469
+ var _ = typeof A === "string" ? h.indexOf(A[A.length - 1]) > -1 : A === void 0;
1470
+ if (!a) {
1471
+ l += "(?:".concat(h, "(?=").concat(x, "))?");
1472
+ }
1473
+ if (!_) {
1474
+ l += "(?=".concat(h, "|").concat(x, ")");
1475
+ }
1476
+ }
1477
+ return new RegExp(l, flags(r));
1478
+ }
1479
+ n.tokensToRegexp = tokensToRegexp;
1480
+ function pathToRegexp(e2, n2, r) {
1481
+ if (e2 instanceof RegExp) return regexpToRegexp(e2, n2);
1482
+ if (Array.isArray(e2)) return arrayToRegexp(e2, n2, r);
1483
+ return stringToRegexp(e2, n2, r);
1484
+ }
1485
+ n.pathToRegexp = pathToRegexp;
1486
+ })();
1487
+ module.exports = e;
1488
+ })();
1489
+ }
1490
+ });
1491
+
1492
+ // node_modules/next/dist/lib/route-pattern-normalizer.js
1493
+ var require_route_pattern_normalizer = __commonJS({
1494
+ "node_modules/next/dist/lib/route-pattern-normalizer.js"(exports) {
1495
+ "use strict";
1496
+ Object.defineProperty(exports, "__esModule", {
1497
+ value: true
1498
+ });
1499
+ function _export(target, all) {
1500
+ for (var name in all) Object.defineProperty(target, name, {
1501
+ enumerable: true,
1502
+ get: all[name]
1503
+ });
1504
+ }
1505
+ _export(exports, {
1506
+ PARAM_SEPARATOR: function() {
1507
+ return PARAM_SEPARATOR;
1508
+ },
1509
+ hasAdjacentParameterIssues: function() {
1510
+ return hasAdjacentParameterIssues;
1511
+ },
1512
+ normalizeAdjacentParameters: function() {
1513
+ return normalizeAdjacentParameters;
1514
+ },
1515
+ normalizeTokensForRegexp: function() {
1516
+ return normalizeTokensForRegexp;
1517
+ },
1518
+ stripNormalizedSeparators: function() {
1519
+ return stripNormalizedSeparators;
1520
+ },
1521
+ stripParameterSeparators: function() {
1522
+ return stripParameterSeparators;
1523
+ }
1524
+ });
1525
+ var PARAM_SEPARATOR = "_NEXTSEP_";
1526
+ function hasAdjacentParameterIssues(route) {
1527
+ if (typeof route !== "string") return false;
1528
+ if (/\/\(\.{1,3}\):[^/\s]+/.test(route)) {
1529
+ return true;
1530
+ }
1531
+ if (/:[a-zA-Z_][a-zA-Z0-9_]*:[a-zA-Z_][a-zA-Z0-9_]*/.test(route)) {
1532
+ return true;
1533
+ }
1534
+ return false;
1535
+ }
1536
+ function normalizeAdjacentParameters(route) {
1537
+ let normalized = route;
1538
+ normalized = normalized.replace(/(\([^)]*\)):([^/\s]+)/g, `$1${PARAM_SEPARATOR}:$2`);
1539
+ normalized = normalized.replace(/:([^:/\s)]+)(?=:)/g, `:$1${PARAM_SEPARATOR}`);
1540
+ return normalized;
1541
+ }
1542
+ function normalizeTokensForRegexp(tokens) {
1543
+ return tokens.map((token) => {
1544
+ if (typeof token === "object" && token !== null && // Not all token objects have 'modifier' property (e.g., simple text tokens)
1545
+ "modifier" in token && // Only repeating modifiers (* or +) cause the validation error
1546
+ // Other modifiers like '?' (optional) are fine
1547
+ (token.modifier === "*" || token.modifier === "+") && // Token objects can have different shapes depending on route pattern
1548
+ "prefix" in token && "suffix" in token && // Both prefix and suffix must be empty strings
1549
+ // This is what causes the validation error in path-to-regexp
1550
+ token.prefix === "" && token.suffix === "") {
1551
+ return {
1552
+ ...token,
1553
+ prefix: "/"
1554
+ };
1555
+ }
1556
+ return token;
1557
+ });
1558
+ }
1559
+ function stripNormalizedSeparators(pathname) {
1560
+ return pathname.replace(new RegExp(`\\)${PARAM_SEPARATOR}`, "g"), ")");
1561
+ }
1562
+ function stripParameterSeparators(params) {
1563
+ const cleaned = {};
1564
+ for (const [key, value] of Object.entries(params)) {
1565
+ if (typeof value === "string") {
1566
+ cleaned[key] = value.replace(new RegExp(`^${PARAM_SEPARATOR}`), "");
1567
+ } else if (Array.isArray(value)) {
1568
+ cleaned[key] = value.map((item) => typeof item === "string" ? item.replace(new RegExp(`^${PARAM_SEPARATOR}`), "") : item);
1569
+ } else {
1570
+ cleaned[key] = value;
1571
+ }
1572
+ }
1573
+ return cleaned;
1574
+ }
1575
+ }
1576
+ });
1577
+
1578
+ // node_modules/next/dist/shared/lib/router/utils/route-match-utils.js
1579
+ var require_route_match_utils = __commonJS({
1580
+ "node_modules/next/dist/shared/lib/router/utils/route-match-utils.js"(exports) {
1581
+ "use strict";
1582
+ Object.defineProperty(exports, "__esModule", {
1583
+ value: true
1584
+ });
1585
+ function _export(target, all) {
1586
+ for (var name in all) Object.defineProperty(target, name, {
1587
+ enumerable: true,
1588
+ get: all[name]
1589
+ });
1590
+ }
1591
+ _export(exports, {
1592
+ safeCompile: function() {
1593
+ return safeCompile;
1594
+ },
1595
+ safePathToRegexp: function() {
1596
+ return safePathToRegexp;
1597
+ },
1598
+ safeRegexpToFunction: function() {
1599
+ return safeRegexpToFunction;
1600
+ },
1601
+ safeRouteMatcher: function() {
1602
+ return safeRouteMatcher;
1603
+ }
1604
+ });
1605
+ var _pathtoregexp = require_path_to_regexp();
1606
+ var _routepatternnormalizer = require_route_pattern_normalizer();
1607
+ function safePathToRegexp(route, keys, options) {
1608
+ if (typeof route !== "string") {
1609
+ return (0, _pathtoregexp.pathToRegexp)(route, keys, options);
1610
+ }
1611
+ const needsNormalization = (0, _routepatternnormalizer.hasAdjacentParameterIssues)(route);
1612
+ const routeToUse = needsNormalization ? (0, _routepatternnormalizer.normalizeAdjacentParameters)(route) : route;
1613
+ try {
1614
+ return (0, _pathtoregexp.pathToRegexp)(routeToUse, keys, options);
1615
+ } catch (error) {
1616
+ if (!needsNormalization) {
1617
+ try {
1618
+ const normalizedRoute = (0, _routepatternnormalizer.normalizeAdjacentParameters)(route);
1619
+ return (0, _pathtoregexp.pathToRegexp)(normalizedRoute, keys, options);
1620
+ } catch (retryError) {
1621
+ throw error;
1622
+ }
1623
+ }
1624
+ throw error;
1625
+ }
1626
+ }
1627
+ function safeCompile(route, options) {
1628
+ const needsNormalization = (0, _routepatternnormalizer.hasAdjacentParameterIssues)(route);
1629
+ const routeToUse = needsNormalization ? (0, _routepatternnormalizer.normalizeAdjacentParameters)(route) : route;
1630
+ try {
1631
+ const compiler = (0, _pathtoregexp.compile)(routeToUse, options);
1632
+ if (needsNormalization) {
1633
+ return (params) => {
1634
+ return (0, _routepatternnormalizer.stripNormalizedSeparators)(compiler(params));
1635
+ };
1636
+ }
1637
+ return compiler;
1638
+ } catch (error) {
1639
+ if (!needsNormalization) {
1640
+ try {
1641
+ const normalizedRoute = (0, _routepatternnormalizer.normalizeAdjacentParameters)(route);
1642
+ const compiler = (0, _pathtoregexp.compile)(normalizedRoute, options);
1643
+ return (params) => {
1644
+ return (0, _routepatternnormalizer.stripNormalizedSeparators)(compiler(params));
1645
+ };
1646
+ } catch (retryError) {
1647
+ throw error;
1648
+ }
1649
+ }
1650
+ throw error;
1651
+ }
1652
+ }
1653
+ function safeRegexpToFunction(regexp, keys) {
1654
+ const originalMatcher = (0, _pathtoregexp.regexpToFunction)(regexp, keys || []);
1655
+ return (pathname) => {
1656
+ const result = originalMatcher(pathname);
1657
+ if (!result) return false;
1658
+ return {
1659
+ ...result,
1660
+ params: (0, _routepatternnormalizer.stripParameterSeparators)(result.params)
1661
+ };
1662
+ };
1663
+ }
1664
+ function safeRouteMatcher(matcherFn) {
1665
+ return (pathname) => {
1666
+ const result = matcherFn(pathname);
1667
+ if (!result) return false;
1668
+ return (0, _routepatternnormalizer.stripParameterSeparators)(result);
1669
+ };
1670
+ }
1671
+ }
1672
+ });
1673
+
1674
+ // node_modules/next/dist/shared/lib/router/utils/route-matcher.js
1675
+ var require_route_matcher = __commonJS({
1676
+ "node_modules/next/dist/shared/lib/router/utils/route-matcher.js"(exports) {
1677
+ "use strict";
1678
+ Object.defineProperty(exports, "__esModule", {
1679
+ value: true
1680
+ });
1681
+ Object.defineProperty(exports, "getRouteMatcher", {
1682
+ enumerable: true,
1683
+ get: function() {
1684
+ return getRouteMatcher;
1685
+ }
1686
+ });
1687
+ var _utils = require_utils();
1688
+ var _routematchutils = require_route_match_utils();
1689
+ function getRouteMatcher({ re, groups }) {
1690
+ const rawMatcher = (pathname) => {
1691
+ const routeMatch = re.exec(pathname);
1692
+ if (!routeMatch) return false;
1693
+ const decode = (param) => {
1694
+ try {
1695
+ return decodeURIComponent(param);
1696
+ } catch {
1697
+ throw Object.defineProperty(new _utils.DecodeError("failed to decode param"), "__NEXT_ERROR_CODE", {
1698
+ value: "E528",
1699
+ enumerable: false,
1700
+ configurable: true
1701
+ });
1702
+ }
1703
+ };
1704
+ const params = {};
1705
+ for (const [key, group] of Object.entries(groups)) {
1706
+ const match = routeMatch[group.pos];
1707
+ if (match !== void 0) {
1708
+ if (group.repeat) {
1709
+ params[key] = match.split("/").map((entry) => decode(entry));
1710
+ } else {
1711
+ params[key] = decode(match);
1712
+ }
1713
+ }
1714
+ }
1715
+ return params;
1716
+ };
1717
+ return (0, _routematchutils.safeRouteMatcher)(rawMatcher);
1718
+ }
1719
+ }
1720
+ });
1721
+
1722
+ // node_modules/next/dist/lib/constants.js
1723
+ var require_constants = __commonJS({
1724
+ "node_modules/next/dist/lib/constants.js"(exports) {
1725
+ "use strict";
1726
+ Object.defineProperty(exports, "__esModule", {
1727
+ value: true
1728
+ });
1729
+ function _export(target, all) {
1730
+ for (var name in all) Object.defineProperty(target, name, {
1731
+ enumerable: true,
1732
+ get: all[name]
1733
+ });
1734
+ }
1735
+ _export(exports, {
1736
+ ACTION_SUFFIX: function() {
1737
+ return ACTION_SUFFIX;
1738
+ },
1739
+ APP_DIR_ALIAS: function() {
1740
+ return APP_DIR_ALIAS;
1741
+ },
1742
+ CACHE_ONE_YEAR: function() {
1743
+ return CACHE_ONE_YEAR;
1744
+ },
1745
+ DOT_NEXT_ALIAS: function() {
1746
+ return DOT_NEXT_ALIAS;
1747
+ },
1748
+ ESLINT_DEFAULT_DIRS: function() {
1749
+ return ESLINT_DEFAULT_DIRS;
1750
+ },
1751
+ GSP_NO_RETURNED_VALUE: function() {
1752
+ return GSP_NO_RETURNED_VALUE;
1753
+ },
1754
+ GSSP_COMPONENT_MEMBER_ERROR: function() {
1755
+ return GSSP_COMPONENT_MEMBER_ERROR;
1756
+ },
1757
+ GSSP_NO_RETURNED_VALUE: function() {
1758
+ return GSSP_NO_RETURNED_VALUE;
1759
+ },
1760
+ HTML_CONTENT_TYPE_HEADER: function() {
1761
+ return HTML_CONTENT_TYPE_HEADER;
1762
+ },
1763
+ INFINITE_CACHE: function() {
1764
+ return INFINITE_CACHE;
1765
+ },
1766
+ INSTRUMENTATION_HOOK_FILENAME: function() {
1767
+ return INSTRUMENTATION_HOOK_FILENAME;
1768
+ },
1769
+ JSON_CONTENT_TYPE_HEADER: function() {
1770
+ return JSON_CONTENT_TYPE_HEADER;
1771
+ },
1772
+ MATCHED_PATH_HEADER: function() {
1773
+ return MATCHED_PATH_HEADER;
1774
+ },
1775
+ MIDDLEWARE_FILENAME: function() {
1776
+ return MIDDLEWARE_FILENAME;
1777
+ },
1778
+ MIDDLEWARE_LOCATION_REGEXP: function() {
1779
+ return MIDDLEWARE_LOCATION_REGEXP;
1780
+ },
1781
+ NEXT_BODY_SUFFIX: function() {
1782
+ return NEXT_BODY_SUFFIX;
1783
+ },
1784
+ NEXT_CACHE_IMPLICIT_TAG_ID: function() {
1785
+ return NEXT_CACHE_IMPLICIT_TAG_ID;
1786
+ },
1787
+ NEXT_CACHE_REVALIDATED_TAGS_HEADER: function() {
1788
+ return NEXT_CACHE_REVALIDATED_TAGS_HEADER;
1789
+ },
1790
+ NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER: function() {
1791
+ return NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER;
1792
+ },
1793
+ NEXT_CACHE_SOFT_TAG_MAX_LENGTH: function() {
1794
+ return NEXT_CACHE_SOFT_TAG_MAX_LENGTH;
1795
+ },
1796
+ NEXT_CACHE_TAGS_HEADER: function() {
1797
+ return NEXT_CACHE_TAGS_HEADER;
1798
+ },
1799
+ NEXT_CACHE_TAG_MAX_ITEMS: function() {
1800
+ return NEXT_CACHE_TAG_MAX_ITEMS;
1801
+ },
1802
+ NEXT_CACHE_TAG_MAX_LENGTH: function() {
1803
+ return NEXT_CACHE_TAG_MAX_LENGTH;
1804
+ },
1805
+ NEXT_DATA_SUFFIX: function() {
1806
+ return NEXT_DATA_SUFFIX;
1807
+ },
1808
+ NEXT_INTERCEPTION_MARKER_PREFIX: function() {
1809
+ return NEXT_INTERCEPTION_MARKER_PREFIX;
1810
+ },
1811
+ NEXT_META_SUFFIX: function() {
1812
+ return NEXT_META_SUFFIX;
1813
+ },
1814
+ NEXT_QUERY_PARAM_PREFIX: function() {
1815
+ return NEXT_QUERY_PARAM_PREFIX;
1816
+ },
1817
+ NEXT_RESUME_HEADER: function() {
1818
+ return NEXT_RESUME_HEADER;
1819
+ },
1820
+ NON_STANDARD_NODE_ENV: function() {
1821
+ return NON_STANDARD_NODE_ENV;
1822
+ },
1823
+ PAGES_DIR_ALIAS: function() {
1824
+ return PAGES_DIR_ALIAS;
1825
+ },
1826
+ PRERENDER_REVALIDATE_HEADER: function() {
1827
+ return PRERENDER_REVALIDATE_HEADER;
1828
+ },
1829
+ PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER: function() {
1830
+ return PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER;
1831
+ },
1832
+ PROXY_FILENAME: function() {
1833
+ return PROXY_FILENAME;
1834
+ },
1835
+ PROXY_LOCATION_REGEXP: function() {
1836
+ return PROXY_LOCATION_REGEXP;
1837
+ },
1838
+ PUBLIC_DIR_MIDDLEWARE_CONFLICT: function() {
1839
+ return PUBLIC_DIR_MIDDLEWARE_CONFLICT;
1840
+ },
1841
+ ROOT_DIR_ALIAS: function() {
1842
+ return ROOT_DIR_ALIAS;
1843
+ },
1844
+ RSC_ACTION_CLIENT_WRAPPER_ALIAS: function() {
1845
+ return RSC_ACTION_CLIENT_WRAPPER_ALIAS;
1846
+ },
1847
+ RSC_ACTION_ENCRYPTION_ALIAS: function() {
1848
+ return RSC_ACTION_ENCRYPTION_ALIAS;
1849
+ },
1850
+ RSC_ACTION_PROXY_ALIAS: function() {
1851
+ return RSC_ACTION_PROXY_ALIAS;
1852
+ },
1853
+ RSC_ACTION_VALIDATE_ALIAS: function() {
1854
+ return RSC_ACTION_VALIDATE_ALIAS;
1855
+ },
1856
+ RSC_CACHE_WRAPPER_ALIAS: function() {
1857
+ return RSC_CACHE_WRAPPER_ALIAS;
1858
+ },
1859
+ RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS: function() {
1860
+ return RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS;
1861
+ },
1862
+ RSC_MOD_REF_PROXY_ALIAS: function() {
1863
+ return RSC_MOD_REF_PROXY_ALIAS;
1864
+ },
1865
+ RSC_PREFETCH_SUFFIX: function() {
1866
+ return RSC_PREFETCH_SUFFIX;
1867
+ },
1868
+ RSC_SEGMENTS_DIR_SUFFIX: function() {
1869
+ return RSC_SEGMENTS_DIR_SUFFIX;
1870
+ },
1871
+ RSC_SEGMENT_SUFFIX: function() {
1872
+ return RSC_SEGMENT_SUFFIX;
1873
+ },
1874
+ RSC_SUFFIX: function() {
1875
+ return RSC_SUFFIX;
1876
+ },
1877
+ SERVER_PROPS_EXPORT_ERROR: function() {
1878
+ return SERVER_PROPS_EXPORT_ERROR;
1879
+ },
1880
+ SERVER_PROPS_GET_INIT_PROPS_CONFLICT: function() {
1881
+ return SERVER_PROPS_GET_INIT_PROPS_CONFLICT;
1882
+ },
1883
+ SERVER_PROPS_SSG_CONFLICT: function() {
1884
+ return SERVER_PROPS_SSG_CONFLICT;
1885
+ },
1886
+ SERVER_RUNTIME: function() {
1887
+ return SERVER_RUNTIME;
1888
+ },
1889
+ SSG_FALLBACK_EXPORT_ERROR: function() {
1890
+ return SSG_FALLBACK_EXPORT_ERROR;
1891
+ },
1892
+ SSG_GET_INITIAL_PROPS_CONFLICT: function() {
1893
+ return SSG_GET_INITIAL_PROPS_CONFLICT;
1894
+ },
1895
+ STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR: function() {
1896
+ return STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR;
1897
+ },
1898
+ TEXT_PLAIN_CONTENT_TYPE_HEADER: function() {
1899
+ return TEXT_PLAIN_CONTENT_TYPE_HEADER;
1900
+ },
1901
+ UNSTABLE_REVALIDATE_RENAME_ERROR: function() {
1902
+ return UNSTABLE_REVALIDATE_RENAME_ERROR;
1903
+ },
1904
+ WEBPACK_LAYERS: function() {
1905
+ return WEBPACK_LAYERS;
1906
+ },
1907
+ WEBPACK_RESOURCE_QUERIES: function() {
1908
+ return WEBPACK_RESOURCE_QUERIES;
1909
+ },
1910
+ WEB_SOCKET_MAX_RECONNECTIONS: function() {
1911
+ return WEB_SOCKET_MAX_RECONNECTIONS;
1912
+ }
1913
+ });
1914
+ var TEXT_PLAIN_CONTENT_TYPE_HEADER = "text/plain";
1915
+ var HTML_CONTENT_TYPE_HEADER = "text/html; charset=utf-8";
1916
+ var JSON_CONTENT_TYPE_HEADER = "application/json; charset=utf-8";
1917
+ var NEXT_QUERY_PARAM_PREFIX = "nxtP";
1918
+ var NEXT_INTERCEPTION_MARKER_PREFIX = "nxtI";
1919
+ var MATCHED_PATH_HEADER = "x-matched-path";
1920
+ var PRERENDER_REVALIDATE_HEADER = "x-prerender-revalidate";
1921
+ var PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER = "x-prerender-revalidate-if-generated";
1922
+ var RSC_PREFETCH_SUFFIX = ".prefetch.rsc";
1923
+ var RSC_SEGMENTS_DIR_SUFFIX = ".segments";
1924
+ var RSC_SEGMENT_SUFFIX = ".segment.rsc";
1925
+ var RSC_SUFFIX = ".rsc";
1926
+ var ACTION_SUFFIX = ".action";
1927
+ var NEXT_DATA_SUFFIX = ".json";
1928
+ var NEXT_META_SUFFIX = ".meta";
1929
+ var NEXT_BODY_SUFFIX = ".body";
1930
+ var NEXT_CACHE_TAGS_HEADER = "x-next-cache-tags";
1931
+ var NEXT_CACHE_REVALIDATED_TAGS_HEADER = "x-next-revalidated-tags";
1932
+ var NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER = "x-next-revalidate-tag-token";
1933
+ var NEXT_RESUME_HEADER = "next-resume";
1934
+ var NEXT_CACHE_TAG_MAX_ITEMS = 128;
1935
+ var NEXT_CACHE_TAG_MAX_LENGTH = 256;
1936
+ var NEXT_CACHE_SOFT_TAG_MAX_LENGTH = 1024;
1937
+ var NEXT_CACHE_IMPLICIT_TAG_ID = "_N_T_";
1938
+ var CACHE_ONE_YEAR = 31536e3;
1939
+ var INFINITE_CACHE = 4294967294;
1940
+ var MIDDLEWARE_FILENAME = "middleware";
1941
+ var MIDDLEWARE_LOCATION_REGEXP = `(?:src/)?${MIDDLEWARE_FILENAME}`;
1942
+ var PROXY_FILENAME = "proxy";
1943
+ var PROXY_LOCATION_REGEXP = `(?:src/)?${PROXY_FILENAME}`;
1944
+ var INSTRUMENTATION_HOOK_FILENAME = "instrumentation";
1945
+ var PAGES_DIR_ALIAS = "private-next-pages";
1946
+ var DOT_NEXT_ALIAS = "private-dot-next";
1947
+ var ROOT_DIR_ALIAS = "private-next-root-dir";
1948
+ var APP_DIR_ALIAS = "private-next-app-dir";
1949
+ var RSC_MOD_REF_PROXY_ALIAS = "private-next-rsc-mod-ref-proxy";
1950
+ var RSC_ACTION_VALIDATE_ALIAS = "private-next-rsc-action-validate";
1951
+ var RSC_ACTION_PROXY_ALIAS = "private-next-rsc-server-reference";
1952
+ var RSC_CACHE_WRAPPER_ALIAS = "private-next-rsc-cache-wrapper";
1953
+ var RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS = "private-next-rsc-track-dynamic-import";
1954
+ var RSC_ACTION_ENCRYPTION_ALIAS = "private-next-rsc-action-encryption";
1955
+ var RSC_ACTION_CLIENT_WRAPPER_ALIAS = "private-next-rsc-action-client-wrapper";
1956
+ var PUBLIC_DIR_MIDDLEWARE_CONFLICT = `You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict`;
1957
+ var SSG_GET_INITIAL_PROPS_CONFLICT = `You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps`;
1958
+ var SERVER_PROPS_GET_INIT_PROPS_CONFLICT = `You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.`;
1959
+ var SERVER_PROPS_SSG_CONFLICT = `You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps`;
1960
+ var STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR = `can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props`;
1961
+ var SERVER_PROPS_EXPORT_ERROR = `pages with \`getServerSideProps\` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export`;
1962
+ var GSP_NO_RETURNED_VALUE = "Your `getStaticProps` function did not return an object. Did you forget to add a `return`?";
1963
+ var GSSP_NO_RETURNED_VALUE = "Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?";
1964
+ var UNSTABLE_REVALIDATE_RENAME_ERROR = "The `unstable_revalidate` property is available for general use.\nPlease use `revalidate` instead.";
1965
+ var GSSP_COMPONENT_MEMBER_ERROR = `can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member`;
1966
+ var NON_STANDARD_NODE_ENV = `You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env`;
1967
+ var SSG_FALLBACK_EXPORT_ERROR = `Pages with \`fallback\` enabled in \`getStaticPaths\` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export`;
1968
+ var ESLINT_DEFAULT_DIRS = [
1969
+ "app",
1970
+ "pages",
1971
+ "components",
1972
+ "lib",
1973
+ "src"
1974
+ ];
1975
+ var SERVER_RUNTIME = {
1976
+ edge: "edge",
1977
+ experimentalEdge: "experimental-edge",
1978
+ nodejs: "nodejs"
1979
+ };
1980
+ var WEB_SOCKET_MAX_RECONNECTIONS = 12;
1981
+ var WEBPACK_LAYERS_NAMES = {
1982
+ /**
1983
+ * The layer for the shared code between the client and server bundles.
1984
+ */
1985
+ shared: "shared",
1986
+ /**
1987
+ * The layer for server-only runtime and picking up `react-server` export conditions.
1988
+ * Including app router RSC pages and app router custom routes and metadata routes.
1989
+ */
1990
+ reactServerComponents: "rsc",
1991
+ /**
1992
+ * Server Side Rendering layer for app (ssr).
1993
+ */
1994
+ serverSideRendering: "ssr",
1995
+ /**
1996
+ * The browser client bundle layer for actions.
1997
+ */
1998
+ actionBrowser: "action-browser",
1999
+ /**
2000
+ * The Node.js bundle layer for the API routes.
2001
+ */
2002
+ apiNode: "api-node",
2003
+ /**
2004
+ * The Edge Lite bundle layer for the API routes.
2005
+ */
2006
+ apiEdge: "api-edge",
2007
+ /**
2008
+ * The layer for the middleware code.
2009
+ */
2010
+ middleware: "middleware",
2011
+ /**
2012
+ * The layer for the instrumentation hooks.
2013
+ */
2014
+ instrument: "instrument",
2015
+ /**
2016
+ * The layer for assets on the edge.
2017
+ */
2018
+ edgeAsset: "edge-asset",
2019
+ /**
2020
+ * The browser client bundle layer for App directory.
2021
+ */
2022
+ appPagesBrowser: "app-pages-browser",
2023
+ /**
2024
+ * The browser client bundle layer for Pages directory.
2025
+ */
2026
+ pagesDirBrowser: "pages-dir-browser",
2027
+ /**
2028
+ * The Edge Lite bundle layer for Pages directory.
2029
+ */
2030
+ pagesDirEdge: "pages-dir-edge",
2031
+ /**
2032
+ * The Node.js bundle layer for Pages directory.
2033
+ */
2034
+ pagesDirNode: "pages-dir-node"
2035
+ };
2036
+ var WEBPACK_LAYERS = {
2037
+ ...WEBPACK_LAYERS_NAMES,
2038
+ GROUP: {
2039
+ builtinReact: [
2040
+ WEBPACK_LAYERS_NAMES.reactServerComponents,
2041
+ WEBPACK_LAYERS_NAMES.actionBrowser
2042
+ ],
2043
+ serverOnly: [
2044
+ WEBPACK_LAYERS_NAMES.reactServerComponents,
2045
+ WEBPACK_LAYERS_NAMES.actionBrowser,
2046
+ WEBPACK_LAYERS_NAMES.instrument,
2047
+ WEBPACK_LAYERS_NAMES.middleware
2048
+ ],
2049
+ neutralTarget: [
2050
+ // pages api
2051
+ WEBPACK_LAYERS_NAMES.apiNode,
2052
+ WEBPACK_LAYERS_NAMES.apiEdge
2053
+ ],
2054
+ clientOnly: [
2055
+ WEBPACK_LAYERS_NAMES.serverSideRendering,
2056
+ WEBPACK_LAYERS_NAMES.appPagesBrowser
2057
+ ],
2058
+ bundled: [
2059
+ WEBPACK_LAYERS_NAMES.reactServerComponents,
2060
+ WEBPACK_LAYERS_NAMES.actionBrowser,
2061
+ WEBPACK_LAYERS_NAMES.serverSideRendering,
2062
+ WEBPACK_LAYERS_NAMES.appPagesBrowser,
2063
+ WEBPACK_LAYERS_NAMES.shared,
2064
+ WEBPACK_LAYERS_NAMES.instrument,
2065
+ WEBPACK_LAYERS_NAMES.middleware
2066
+ ],
2067
+ appPages: [
2068
+ // app router pages and layouts
2069
+ WEBPACK_LAYERS_NAMES.reactServerComponents,
2070
+ WEBPACK_LAYERS_NAMES.serverSideRendering,
2071
+ WEBPACK_LAYERS_NAMES.appPagesBrowser,
2072
+ WEBPACK_LAYERS_NAMES.actionBrowser
2073
+ ]
2074
+ }
2075
+ };
2076
+ var WEBPACK_RESOURCE_QUERIES = {
2077
+ edgeSSREntry: "__next_edge_ssr_entry__",
2078
+ metadata: "__next_metadata__",
2079
+ metadataRoute: "__next_metadata_route__",
2080
+ metadataImageMeta: "__next_metadata_image_meta__"
2081
+ };
2082
+ }
2083
+ });
2084
+
2085
+ // node_modules/next/dist/shared/lib/escape-regexp.js
2086
+ var require_escape_regexp = __commonJS({
2087
+ "node_modules/next/dist/shared/lib/escape-regexp.js"(exports) {
2088
+ "use strict";
2089
+ Object.defineProperty(exports, "__esModule", {
2090
+ value: true
2091
+ });
2092
+ Object.defineProperty(exports, "escapeStringRegexp", {
2093
+ enumerable: true,
2094
+ get: function() {
2095
+ return escapeStringRegexp;
2096
+ }
2097
+ });
2098
+ var reHasRegExp = /[|\\{}()[\]^$+*?.-]/;
2099
+ var reReplaceRegExp = /[|\\{}()[\]^$+*?.-]/g;
2100
+ function escapeStringRegexp(str) {
2101
+ if (reHasRegExp.test(str)) {
2102
+ return str.replace(reReplaceRegExp, "\\$&");
2103
+ }
2104
+ return str;
2105
+ }
2106
+ }
2107
+ });
2108
+
2109
+ // node_modules/next/dist/shared/lib/invariant-error.js
2110
+ var require_invariant_error = __commonJS({
2111
+ "node_modules/next/dist/shared/lib/invariant-error.js"(exports) {
2112
+ "use strict";
2113
+ Object.defineProperty(exports, "__esModule", {
2114
+ value: true
2115
+ });
2116
+ Object.defineProperty(exports, "InvariantError", {
2117
+ enumerable: true,
2118
+ get: function() {
2119
+ return InvariantError;
2120
+ }
2121
+ });
2122
+ var InvariantError = class extends Error {
2123
+ constructor(message, options) {
2124
+ super(`Invariant: ${message.endsWith(".") ? message : message + "."} This is a bug in Next.js.`, options);
2125
+ this.name = "InvariantError";
2126
+ }
2127
+ };
2128
+ }
2129
+ });
2130
+
2131
+ // node_modules/next/dist/shared/lib/router/utils/parse-loader-tree.js
2132
+ var require_parse_loader_tree = __commonJS({
2133
+ "node_modules/next/dist/shared/lib/router/utils/parse-loader-tree.js"(exports) {
2134
+ "use strict";
2135
+ Object.defineProperty(exports, "__esModule", {
2136
+ value: true
2137
+ });
2138
+ Object.defineProperty(exports, "parseLoaderTree", {
2139
+ enumerable: true,
2140
+ get: function() {
2141
+ return parseLoaderTree;
2142
+ }
2143
+ });
2144
+ var _segment = require_segment();
2145
+ function parseLoaderTree(tree) {
2146
+ const [segment, parallelRoutes, modules] = tree;
2147
+ const { layout, template } = modules;
2148
+ let { page } = modules;
2149
+ page = segment === _segment.DEFAULT_SEGMENT_KEY ? modules.defaultPage : page;
2150
+ const conventionPath = layout?.[1] || template?.[1] || page?.[1];
2151
+ return {
2152
+ page,
2153
+ segment,
2154
+ modules,
2155
+ /* it can be either layout / template / page */
2156
+ conventionPath,
2157
+ parallelRoutes
2158
+ };
2159
+ }
2160
+ }
2161
+ });
2162
+
2163
+ // node_modules/next/dist/shared/lib/router/utils/get-segment-param.js
2164
+ var require_get_segment_param = __commonJS({
2165
+ "node_modules/next/dist/shared/lib/router/utils/get-segment-param.js"(exports) {
2166
+ "use strict";
2167
+ Object.defineProperty(exports, "__esModule", {
2168
+ value: true
2169
+ });
2170
+ function _export(target, all) {
2171
+ for (var name in all) Object.defineProperty(target, name, {
2172
+ enumerable: true,
2173
+ get: all[name]
2174
+ });
2175
+ }
2176
+ _export(exports, {
2177
+ getParamProperties: function() {
2178
+ return getParamProperties;
2179
+ },
2180
+ getSegmentParam: function() {
2181
+ return getSegmentParam;
2182
+ },
2183
+ isCatchAll: function() {
2184
+ return isCatchAll;
2185
+ }
2186
+ });
2187
+ var _interceptionroutes = require_interception_routes();
2188
+ function getSegmentParam(segment) {
2189
+ const interceptionMarker = _interceptionroutes.INTERCEPTION_ROUTE_MARKERS.find((marker) => segment.startsWith(marker));
2190
+ if (interceptionMarker) {
2191
+ segment = segment.slice(interceptionMarker.length);
2192
+ }
2193
+ if (segment.startsWith("[[...") && segment.endsWith("]]")) {
2194
+ return {
2195
+ // TODO-APP: Optional catchall does not currently work with parallel routes,
2196
+ // so for now aren't handling a potential interception marker.
2197
+ type: "optional-catchall",
2198
+ param: segment.slice(5, -2)
2199
+ };
2200
+ }
2201
+ if (segment.startsWith("[...") && segment.endsWith("]")) {
2202
+ return {
2203
+ type: interceptionMarker ? `catchall-intercepted-${interceptionMarker}` : "catchall",
2204
+ param: segment.slice(4, -1)
2205
+ };
2206
+ }
2207
+ if (segment.startsWith("[") && segment.endsWith("]")) {
2208
+ return {
2209
+ type: interceptionMarker ? `dynamic-intercepted-${interceptionMarker}` : "dynamic",
2210
+ param: segment.slice(1, -1)
2211
+ };
2212
+ }
2213
+ return null;
2214
+ }
2215
+ function isCatchAll(type) {
2216
+ return type === "catchall" || type === "catchall-intercepted-(..)(..)" || type === "catchall-intercepted-(.)" || type === "catchall-intercepted-(..)" || type === "catchall-intercepted-(...)" || type === "optional-catchall";
2217
+ }
2218
+ function getParamProperties(paramType) {
2219
+ let repeat = false;
2220
+ let optional = false;
2221
+ switch (paramType) {
2222
+ case "catchall":
2223
+ case "catchall-intercepted-(..)(..)":
2224
+ case "catchall-intercepted-(.)":
2225
+ case "catchall-intercepted-(..)":
2226
+ case "catchall-intercepted-(...)":
2227
+ repeat = true;
2228
+ break;
2229
+ case "optional-catchall":
2230
+ repeat = true;
2231
+ optional = true;
2232
+ break;
2233
+ case "dynamic":
2234
+ case "dynamic-intercepted-(..)(..)":
2235
+ case "dynamic-intercepted-(.)":
2236
+ case "dynamic-intercepted-(..)":
2237
+ case "dynamic-intercepted-(...)":
2238
+ break;
2239
+ default:
2240
+ paramType;
2241
+ }
2242
+ return {
2243
+ repeat,
2244
+ optional
2245
+ };
2246
+ }
2247
+ }
2248
+ });
2249
+
2250
+ // node_modules/next/dist/shared/lib/router/utils/get-dynamic-param.js
2251
+ var require_get_dynamic_param = __commonJS({
2252
+ "node_modules/next/dist/shared/lib/router/utils/get-dynamic-param.js"(exports) {
2253
+ "use strict";
2254
+ Object.defineProperty(exports, "__esModule", {
2255
+ value: true
2256
+ });
2257
+ function _export(target, all) {
2258
+ for (var name in all) Object.defineProperty(target, name, {
2259
+ enumerable: true,
2260
+ get: all[name]
2261
+ });
2262
+ }
2263
+ _export(exports, {
2264
+ PARAMETER_PATTERN: function() {
2265
+ return PARAMETER_PATTERN;
2266
+ },
2267
+ getDynamicParam: function() {
2268
+ return getDynamicParam;
2269
+ },
2270
+ interpolateParallelRouteParams: function() {
2271
+ return interpolateParallelRouteParams;
2272
+ },
2273
+ parseMatchedParameter: function() {
2274
+ return parseMatchedParameter;
2275
+ },
2276
+ parseParameter: function() {
2277
+ return parseParameter;
2278
+ }
2279
+ });
2280
+ var _invarianterror = require_invariant_error();
2281
+ var _parseloadertree = require_parse_loader_tree();
2282
+ var _getsegmentparam = require_get_segment_param();
2283
+ function getParamValue(interpolatedParams, segmentKey, fallbackRouteParams) {
2284
+ let value = interpolatedParams[segmentKey];
2285
+ if (fallbackRouteParams?.has(segmentKey)) {
2286
+ const [searchValue] = fallbackRouteParams.get(segmentKey);
2287
+ value = searchValue;
2288
+ } else if (Array.isArray(value)) {
2289
+ value = value.map((i) => encodeURIComponent(i));
2290
+ } else if (typeof value === "string") {
2291
+ value = encodeURIComponent(value);
2292
+ }
2293
+ return value;
2294
+ }
2295
+ function interpolateParallelRouteParams(loaderTree, params, pagePath, fallbackRouteParams) {
2296
+ const interpolated = structuredClone(params);
2297
+ const stack = [
2298
+ {
2299
+ tree: loaderTree,
2300
+ depth: 0
2301
+ }
2302
+ ];
2303
+ const pathSegments = pagePath.split("/").slice(1);
2304
+ while (stack.length > 0) {
2305
+ const { tree, depth } = stack.pop();
2306
+ const { segment, parallelRoutes } = (0, _parseloadertree.parseLoaderTree)(tree);
2307
+ const segmentParam = (0, _getsegmentparam.getSegmentParam)(segment);
2308
+ if (segmentParam && !interpolated.hasOwnProperty(segmentParam.param) && // If the param is in the fallback route params, we don't need to
2309
+ // interpolate it because it's already marked as being unknown.
2310
+ !fallbackRouteParams?.has(segmentParam.param)) {
2311
+ switch (segmentParam.type) {
2312
+ case "catchall":
2313
+ case "optional-catchall":
2314
+ case "catchall-intercepted-(..)(..)":
2315
+ case "catchall-intercepted-(.)":
2316
+ case "catchall-intercepted-(..)":
2317
+ case "catchall-intercepted-(...)":
2318
+ const remainingSegments = pathSegments.slice(depth);
2319
+ const processedSegments = remainingSegments.flatMap((pathSegment) => {
2320
+ const param = (0, _getsegmentparam.getSegmentParam)(pathSegment);
2321
+ return param ? interpolated[param.param] : pathSegment;
2322
+ }).filter((s) => s !== void 0);
2323
+ if (processedSegments.length > 0) {
2324
+ interpolated[segmentParam.param] = processedSegments;
2325
+ }
2326
+ break;
2327
+ case "dynamic":
2328
+ case "dynamic-intercepted-(..)(..)":
2329
+ case "dynamic-intercepted-(.)":
2330
+ case "dynamic-intercepted-(..)":
2331
+ case "dynamic-intercepted-(...)":
2332
+ if (depth < pathSegments.length) {
2333
+ const pathSegment = pathSegments[depth];
2334
+ const param = (0, _getsegmentparam.getSegmentParam)(pathSegment);
2335
+ interpolated[segmentParam.param] = param ? interpolated[param.param] : pathSegment;
2336
+ }
2337
+ break;
2338
+ default:
2339
+ segmentParam.type;
2340
+ }
2341
+ }
2342
+ let nextDepth = depth;
2343
+ const isRouteGroup = segment.startsWith("(") && segment.endsWith(")");
2344
+ if (!isRouteGroup && segment !== "") {
2345
+ nextDepth++;
2346
+ }
2347
+ for (const route of Object.values(parallelRoutes)) {
2348
+ stack.push({
2349
+ tree: route,
2350
+ depth: nextDepth
2351
+ });
2352
+ }
2353
+ }
2354
+ return interpolated;
2355
+ }
2356
+ function getDynamicParam(interpolatedParams, segmentKey, dynamicParamType, fallbackRouteParams) {
2357
+ let value = getParamValue(interpolatedParams, segmentKey, fallbackRouteParams);
2358
+ if (!value || value.length === 0) {
2359
+ if (dynamicParamType === "oc") {
2360
+ return {
2361
+ param: segmentKey,
2362
+ value: null,
2363
+ type: dynamicParamType,
2364
+ treeSegment: [
2365
+ segmentKey,
2366
+ "",
2367
+ dynamicParamType
2368
+ ]
2369
+ };
2370
+ }
2371
+ throw Object.defineProperty(new _invarianterror.InvariantError(`Missing value for segment key: "${segmentKey}" with dynamic param type: ${dynamicParamType}`), "__NEXT_ERROR_CODE", {
2372
+ value: "E864",
2373
+ enumerable: false,
2374
+ configurable: true
2375
+ });
2376
+ }
2377
+ return {
2378
+ param: segmentKey,
2379
+ // The value that is passed to user code.
2380
+ value,
2381
+ // The value that is rendered in the router tree.
2382
+ treeSegment: [
2383
+ segmentKey,
2384
+ Array.isArray(value) ? value.join("/") : value,
2385
+ dynamicParamType
2386
+ ],
2387
+ type: dynamicParamType
2388
+ };
2389
+ }
2390
+ var PARAMETER_PATTERN = /^([^[]*)\[((?:\[[^\]]*\])|[^\]]+)\](.*)$/;
2391
+ function parseParameter(param) {
2392
+ const match = param.match(PARAMETER_PATTERN);
2393
+ if (!match) {
2394
+ return parseMatchedParameter(param);
2395
+ }
2396
+ return parseMatchedParameter(match[2]);
2397
+ }
2398
+ function parseMatchedParameter(param) {
2399
+ const optional = param.startsWith("[") && param.endsWith("]");
2400
+ if (optional) {
2401
+ param = param.slice(1, -1);
2402
+ }
2403
+ const repeat = param.startsWith("...");
2404
+ if (repeat) {
2405
+ param = param.slice(3);
2406
+ }
2407
+ return {
2408
+ key: param,
2409
+ repeat,
2410
+ optional
2411
+ };
2412
+ }
2413
+ }
2414
+ });
2415
+
2416
+ // node_modules/next/dist/shared/lib/router/utils/route-regex.js
2417
+ var require_route_regex = __commonJS({
2418
+ "node_modules/next/dist/shared/lib/router/utils/route-regex.js"(exports) {
2419
+ "use strict";
2420
+ Object.defineProperty(exports, "__esModule", {
2421
+ value: true
2422
+ });
2423
+ function _export(target, all) {
2424
+ for (var name in all) Object.defineProperty(target, name, {
2425
+ enumerable: true,
2426
+ get: all[name]
2427
+ });
2428
+ }
2429
+ _export(exports, {
2430
+ getNamedMiddlewareRegex: function() {
2431
+ return getNamedMiddlewareRegex;
2432
+ },
2433
+ getNamedRouteRegex: function() {
2434
+ return getNamedRouteRegex;
2435
+ },
2436
+ getRouteRegex: function() {
2437
+ return getRouteRegex;
2438
+ }
2439
+ });
2440
+ var _constants = require_constants();
2441
+ var _interceptionroutes = require_interception_routes();
2442
+ var _escaperegexp = require_escape_regexp();
2443
+ var _removetrailingslash = require_remove_trailing_slash();
2444
+ var _getdynamicparam = require_get_dynamic_param();
2445
+ function getParametrizedRoute(route, includeSuffix, includePrefix) {
2446
+ const groups = {};
2447
+ let groupIndex = 1;
2448
+ const segments = [];
2449
+ for (const segment of (0, _removetrailingslash.removeTrailingSlash)(route).slice(1).split("/")) {
2450
+ const markerMatch = _interceptionroutes.INTERCEPTION_ROUTE_MARKERS.find((m) => segment.startsWith(m));
2451
+ const paramMatches = segment.match(_getdynamicparam.PARAMETER_PATTERN);
2452
+ if (markerMatch && paramMatches && paramMatches[2]) {
2453
+ const { key, optional, repeat } = (0, _getdynamicparam.parseMatchedParameter)(paramMatches[2]);
2454
+ groups[key] = {
2455
+ pos: groupIndex++,
2456
+ repeat,
2457
+ optional
2458
+ };
2459
+ segments.push(`/${(0, _escaperegexp.escapeStringRegexp)(markerMatch)}([^/]+?)`);
2460
+ } else if (paramMatches && paramMatches[2]) {
2461
+ const { key, repeat, optional } = (0, _getdynamicparam.parseMatchedParameter)(paramMatches[2]);
2462
+ groups[key] = {
2463
+ pos: groupIndex++,
2464
+ repeat,
2465
+ optional
2466
+ };
2467
+ if (includePrefix && paramMatches[1]) {
2468
+ segments.push(`/${(0, _escaperegexp.escapeStringRegexp)(paramMatches[1])}`);
2469
+ }
2470
+ let s = repeat ? optional ? "(?:/(.+?))?" : "/(.+?)" : "/([^/]+?)";
2471
+ if (includePrefix && paramMatches[1]) {
2472
+ s = s.substring(1);
2473
+ }
2474
+ segments.push(s);
2475
+ } else {
2476
+ segments.push(`/${(0, _escaperegexp.escapeStringRegexp)(segment)}`);
2477
+ }
2478
+ if (includeSuffix && paramMatches && paramMatches[3]) {
2479
+ segments.push((0, _escaperegexp.escapeStringRegexp)(paramMatches[3]));
2480
+ }
2481
+ }
2482
+ return {
2483
+ parameterizedRoute: segments.join(""),
2484
+ groups
2485
+ };
2486
+ }
2487
+ function getRouteRegex(normalizedRoute, { includeSuffix = false, includePrefix = false, excludeOptionalTrailingSlash = false } = {}) {
2488
+ const { parameterizedRoute, groups } = getParametrizedRoute(normalizedRoute, includeSuffix, includePrefix);
2489
+ let re = parameterizedRoute;
2490
+ if (!excludeOptionalTrailingSlash) {
2491
+ re += "(?:/)?";
2492
+ }
2493
+ return {
2494
+ re: new RegExp(`^${re}$`),
2495
+ groups
2496
+ };
2497
+ }
2498
+ function buildGetSafeRouteKey() {
2499
+ let i = 0;
2500
+ return () => {
2501
+ let routeKey = "";
2502
+ let j = ++i;
2503
+ while (j > 0) {
2504
+ routeKey += String.fromCharCode(97 + (j - 1) % 26);
2505
+ j = Math.floor((j - 1) / 26);
2506
+ }
2507
+ return routeKey;
2508
+ };
2509
+ }
2510
+ function getSafeKeyFromSegment({ interceptionMarker, getSafeRouteKey, segment, routeKeys, keyPrefix, backreferenceDuplicateKeys }) {
2511
+ const { key, optional, repeat } = (0, _getdynamicparam.parseMatchedParameter)(segment);
2512
+ let cleanedKey = key.replace(/\W/g, "");
2513
+ if (keyPrefix) {
2514
+ cleanedKey = `${keyPrefix}${cleanedKey}`;
2515
+ }
2516
+ let invalidKey = false;
2517
+ if (cleanedKey.length === 0 || cleanedKey.length > 30) {
2518
+ invalidKey = true;
2519
+ }
2520
+ if (!isNaN(parseInt(cleanedKey.slice(0, 1)))) {
2521
+ invalidKey = true;
2522
+ }
2523
+ if (invalidKey) {
2524
+ cleanedKey = getSafeRouteKey();
2525
+ }
2526
+ const duplicateKey = cleanedKey in routeKeys;
2527
+ if (keyPrefix) {
2528
+ routeKeys[cleanedKey] = `${keyPrefix}${key}`;
2529
+ } else {
2530
+ routeKeys[cleanedKey] = key;
2531
+ }
2532
+ const interceptionPrefix = interceptionMarker ? (0, _escaperegexp.escapeStringRegexp)(interceptionMarker) : "";
2533
+ let pattern;
2534
+ if (duplicateKey && backreferenceDuplicateKeys) {
2535
+ pattern = `\\k<${cleanedKey}>`;
2536
+ } else if (repeat) {
2537
+ pattern = `(?<${cleanedKey}>.+?)`;
2538
+ } else {
2539
+ pattern = `(?<${cleanedKey}>[^/]+?)`;
2540
+ }
2541
+ return {
2542
+ key,
2543
+ pattern: optional ? `(?:/${interceptionPrefix}${pattern})?` : `/${interceptionPrefix}${pattern}`,
2544
+ cleanedKey,
2545
+ optional,
2546
+ repeat
2547
+ };
2548
+ }
2549
+ function getNamedParametrizedRoute(route, prefixRouteKeys, includeSuffix, includePrefix, backreferenceDuplicateKeys, reference = {
2550
+ names: {},
2551
+ intercepted: {}
2552
+ }) {
2553
+ const getSafeRouteKey = buildGetSafeRouteKey();
2554
+ const routeKeys = {};
2555
+ const segments = [];
2556
+ const inverseParts = [];
2557
+ reference = structuredClone(reference);
2558
+ for (const segment of (0, _removetrailingslash.removeTrailingSlash)(route).slice(1).split("/")) {
2559
+ const hasInterceptionMarker = _interceptionroutes.INTERCEPTION_ROUTE_MARKERS.some((m) => segment.startsWith(m));
2560
+ const paramMatches = segment.match(_getdynamicparam.PARAMETER_PATTERN);
2561
+ const interceptionMarker = hasInterceptionMarker ? paramMatches?.[1] : void 0;
2562
+ let keyPrefix;
2563
+ if (interceptionMarker && paramMatches?.[2]) {
2564
+ keyPrefix = prefixRouteKeys ? _constants.NEXT_INTERCEPTION_MARKER_PREFIX : void 0;
2565
+ reference.intercepted[paramMatches[2]] = interceptionMarker;
2566
+ } else if (paramMatches?.[2] && reference.intercepted[paramMatches[2]]) {
2567
+ keyPrefix = prefixRouteKeys ? _constants.NEXT_INTERCEPTION_MARKER_PREFIX : void 0;
2568
+ } else {
2569
+ keyPrefix = prefixRouteKeys ? _constants.NEXT_QUERY_PARAM_PREFIX : void 0;
2570
+ }
2571
+ if (interceptionMarker && paramMatches && paramMatches[2]) {
2572
+ const { key, pattern, cleanedKey, repeat, optional } = getSafeKeyFromSegment({
2573
+ getSafeRouteKey,
2574
+ interceptionMarker,
2575
+ segment: paramMatches[2],
2576
+ routeKeys,
2577
+ keyPrefix,
2578
+ backreferenceDuplicateKeys
2579
+ });
2580
+ segments.push(pattern);
2581
+ inverseParts.push(`/${paramMatches[1]}:${reference.names[key] ?? cleanedKey}${repeat ? optional ? "*" : "+" : ""}`);
2582
+ reference.names[key] ??= cleanedKey;
2583
+ } else if (paramMatches && paramMatches[2]) {
2584
+ if (includePrefix && paramMatches[1]) {
2585
+ segments.push(`/${(0, _escaperegexp.escapeStringRegexp)(paramMatches[1])}`);
2586
+ inverseParts.push(`/${paramMatches[1]}`);
2587
+ }
2588
+ const { key, pattern, cleanedKey, repeat, optional } = getSafeKeyFromSegment({
2589
+ getSafeRouteKey,
2590
+ segment: paramMatches[2],
2591
+ routeKeys,
2592
+ keyPrefix,
2593
+ backreferenceDuplicateKeys
2594
+ });
2595
+ let s = pattern;
2596
+ if (includePrefix && paramMatches[1]) {
2597
+ s = s.substring(1);
2598
+ }
2599
+ segments.push(s);
2600
+ inverseParts.push(`/:${reference.names[key] ?? cleanedKey}${repeat ? optional ? "*" : "+" : ""}`);
2601
+ reference.names[key] ??= cleanedKey;
2602
+ } else {
2603
+ segments.push(`/${(0, _escaperegexp.escapeStringRegexp)(segment)}`);
2604
+ inverseParts.push(`/${segment}`);
2605
+ }
2606
+ if (includeSuffix && paramMatches && paramMatches[3]) {
2607
+ segments.push((0, _escaperegexp.escapeStringRegexp)(paramMatches[3]));
2608
+ inverseParts.push(paramMatches[3]);
2609
+ }
2610
+ }
2611
+ return {
2612
+ namedParameterizedRoute: segments.join(""),
2613
+ routeKeys,
2614
+ pathToRegexpPattern: inverseParts.join(""),
2615
+ reference
2616
+ };
2617
+ }
2618
+ function getNamedRouteRegex(normalizedRoute, options) {
2619
+ const result = getNamedParametrizedRoute(normalizedRoute, options.prefixRouteKeys, options.includeSuffix ?? false, options.includePrefix ?? false, options.backreferenceDuplicateKeys ?? false, options.reference);
2620
+ let namedRegex = result.namedParameterizedRoute;
2621
+ if (!options.excludeOptionalTrailingSlash) {
2622
+ namedRegex += "(?:/)?";
2623
+ }
2624
+ return {
2625
+ ...getRouteRegex(normalizedRoute, options),
2626
+ namedRegex: `^${namedRegex}$`,
2627
+ routeKeys: result.routeKeys,
2628
+ pathToRegexpPattern: result.pathToRegexpPattern,
2629
+ reference: result.reference
2630
+ };
2631
+ }
2632
+ function getNamedMiddlewareRegex(normalizedRoute, options) {
2633
+ const { parameterizedRoute } = getParametrizedRoute(normalizedRoute, false, false);
2634
+ const { catchAll = true } = options;
2635
+ if (parameterizedRoute === "/") {
2636
+ let catchAllRegex = catchAll ? ".*" : "";
2637
+ return {
2638
+ namedRegex: `^/${catchAllRegex}$`
2639
+ };
2640
+ }
2641
+ const { namedParameterizedRoute } = getNamedParametrizedRoute(normalizedRoute, false, false, false, false, void 0);
2642
+ let catchAllGroupedRegex = catchAll ? "(?:(/.*)?)" : "";
2643
+ return {
2644
+ namedRegex: `^${namedParameterizedRoute}${catchAllGroupedRegex}$`
2645
+ };
2646
+ }
2647
+ }
2648
+ });
2649
+
2650
+ // node_modules/next/dist/shared/lib/router/utils/interpolate-as.js
2651
+ var require_interpolate_as = __commonJS({
2652
+ "node_modules/next/dist/shared/lib/router/utils/interpolate-as.js"(exports) {
2653
+ "use strict";
2654
+ Object.defineProperty(exports, "__esModule", {
2655
+ value: true
2656
+ });
2657
+ Object.defineProperty(exports, "interpolateAs", {
2658
+ enumerable: true,
2659
+ get: function() {
2660
+ return interpolateAs;
2661
+ }
2662
+ });
2663
+ var _routematcher = require_route_matcher();
2664
+ var _routeregex = require_route_regex();
2665
+ function interpolateAs(route, asPathname, query) {
2666
+ let interpolatedRoute = "";
2667
+ const dynamicRegex = (0, _routeregex.getRouteRegex)(route);
2668
+ const dynamicGroups = dynamicRegex.groups;
2669
+ const dynamicMatches = (
2670
+ // Try to match the dynamic route against the asPath
2671
+ (asPathname !== route ? (0, _routematcher.getRouteMatcher)(dynamicRegex)(asPathname) : "") || // Fall back to reading the values from the href
2672
+ // TODO: should this take priority; also need to change in the router.
2673
+ query
2674
+ );
2675
+ interpolatedRoute = route;
2676
+ const params = Object.keys(dynamicGroups);
2677
+ if (!params.every((param) => {
2678
+ let value = dynamicMatches[param] || "";
2679
+ const { repeat, optional } = dynamicGroups[param];
2680
+ let replaced = `[${repeat ? "..." : ""}${param}]`;
2681
+ if (optional) {
2682
+ replaced = `${!value ? "/" : ""}[${replaced}]`;
2683
+ }
2684
+ if (repeat && !Array.isArray(value)) value = [
2685
+ value
2686
+ ];
2687
+ return (optional || param in dynamicMatches) && // Interpolate group into data URL if present
2688
+ (interpolatedRoute = interpolatedRoute.replace(replaced, repeat ? value.map(
2689
+ // these values should be fully encoded instead of just
2690
+ // path delimiter escaped since they are being inserted
2691
+ // into the URL and we expect URL encoded segments
2692
+ // when parsing dynamic route params
2693
+ (segment) => encodeURIComponent(segment)
2694
+ ).join("/") : encodeURIComponent(value)) || "/");
2695
+ })) {
2696
+ interpolatedRoute = "";
2697
+ }
2698
+ return {
2699
+ params,
2700
+ result: interpolatedRoute
2701
+ };
2702
+ }
2703
+ }
2704
+ });
2705
+
2706
+ // node_modules/next/dist/client/resolve-href.js
2707
+ var require_resolve_href = __commonJS({
2708
+ "node_modules/next/dist/client/resolve-href.js"(exports, module) {
2709
+ "use strict";
2710
+ Object.defineProperty(exports, "__esModule", {
2711
+ value: true
2712
+ });
2713
+ Object.defineProperty(exports, "resolveHref", {
2714
+ enumerable: true,
2715
+ get: function() {
2716
+ return resolveHref;
2717
+ }
2718
+ });
2719
+ var _querystring = require_querystring();
2720
+ var _formaturl = require_format_url();
2721
+ var _omit = require_omit();
2722
+ var _utils = require_utils();
2723
+ var _normalizetrailingslash = require_normalize_trailing_slash();
2724
+ var _islocalurl = require_is_local_url();
2725
+ var _utils1 = require_utils2();
2726
+ var _interpolateas = require_interpolate_as();
2727
+ var _routeregex = require_route_regex();
2728
+ var _routematcher = require_route_matcher();
2729
+ function resolveHref(router, href, resolveAs) {
2730
+ let base;
2731
+ let urlAsString = typeof href === "string" ? href : (0, _formaturl.formatWithValidation)(href);
2732
+ const urlProtoMatch = urlAsString.match(/^[a-z][a-z0-9+.-]*:\/\//i);
2733
+ const urlAsStringNoProto = urlProtoMatch ? urlAsString.slice(urlProtoMatch[0].length) : urlAsString;
2734
+ const urlParts = urlAsStringNoProto.split("?", 1);
2735
+ if ((urlParts[0] || "").match(/(\/\/|\\)/)) {
2736
+ console.error(`Invalid href '${urlAsString}' passed to next/router in page: '${router.pathname}'. Repeated forward-slashes (//) or backslashes \\ are not valid in the href.`);
2737
+ const normalizedUrl = (0, _utils.normalizeRepeatedSlashes)(urlAsStringNoProto);
2738
+ urlAsString = (urlProtoMatch ? urlProtoMatch[0] : "") + normalizedUrl;
2739
+ }
2740
+ if (!(0, _islocalurl.isLocalURL)(urlAsString)) {
2741
+ return resolveAs ? [
2742
+ urlAsString
2743
+ ] : urlAsString;
2744
+ }
2745
+ try {
2746
+ let baseBase = urlAsString.startsWith("#") ? router.asPath : router.pathname;
2747
+ if (urlAsString.startsWith("?")) {
2748
+ baseBase = router.asPath;
2749
+ if ((0, _utils1.isDynamicRoute)(router.pathname)) {
2750
+ baseBase = router.pathname;
2751
+ const routeRegex = (0, _routeregex.getRouteRegex)(router.pathname);
2752
+ const match = (0, _routematcher.getRouteMatcher)(routeRegex)(router.asPath);
2753
+ if (!match) {
2754
+ baseBase = router.asPath;
2755
+ }
2756
+ }
2757
+ }
2758
+ base = new URL(baseBase, "http://n");
2759
+ } catch (_) {
2760
+ base = new URL("/", "http://n");
2761
+ }
2762
+ try {
2763
+ const finalUrl = new URL(urlAsString, base);
2764
+ finalUrl.pathname = (0, _normalizetrailingslash.normalizePathTrailingSlash)(finalUrl.pathname);
2765
+ let interpolatedAs = "";
2766
+ if ((0, _utils1.isDynamicRoute)(finalUrl.pathname) && finalUrl.searchParams && resolveAs) {
2767
+ const query = (0, _querystring.searchParamsToUrlQuery)(finalUrl.searchParams);
2768
+ const { result, params } = (0, _interpolateas.interpolateAs)(finalUrl.pathname, finalUrl.pathname, query);
2769
+ if (result) {
2770
+ interpolatedAs = (0, _formaturl.formatWithValidation)({
2771
+ pathname: result,
2772
+ hash: finalUrl.hash,
2773
+ query: (0, _omit.omit)(query, params)
2774
+ });
2775
+ }
2776
+ }
2777
+ const resolvedHref = finalUrl.origin === base.origin ? finalUrl.href.slice(finalUrl.origin.length) : finalUrl.href;
2778
+ return resolveAs ? [
2779
+ resolvedHref,
2780
+ interpolatedAs || resolvedHref
2781
+ ] : resolvedHref;
2782
+ } catch (_) {
2783
+ return resolveAs ? [
2784
+ urlAsString
2785
+ ] : urlAsString;
2786
+ }
2787
+ }
2788
+ if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
2789
+ Object.defineProperty(exports.default, "__esModule", { value: true });
2790
+ Object.assign(exports.default, exports);
2791
+ module.exports = exports.default;
2792
+ }
2793
+ }
2794
+ });
2795
+
2796
+ // node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js
2797
+ var require_add_path_prefix = __commonJS({
2798
+ "node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js"(exports) {
2799
+ "use strict";
2800
+ Object.defineProperty(exports, "__esModule", {
2801
+ value: true
2802
+ });
2803
+ Object.defineProperty(exports, "addPathPrefix", {
2804
+ enumerable: true,
2805
+ get: function() {
2806
+ return addPathPrefix;
2807
+ }
2808
+ });
2809
+ var _parsepath = require_parse_path();
2810
+ function addPathPrefix(path, prefix) {
2811
+ if (!path.startsWith("/") || !prefix) {
2812
+ return path;
2813
+ }
2814
+ const { pathname, query, hash } = (0, _parsepath.parsePath)(path);
2815
+ return `${prefix}${pathname}${query}${hash}`;
2816
+ }
2817
+ }
2818
+ });
2819
+
2820
+ // node_modules/next/dist/shared/lib/router/utils/add-locale.js
2821
+ var require_add_locale = __commonJS({
2822
+ "node_modules/next/dist/shared/lib/router/utils/add-locale.js"(exports) {
2823
+ "use strict";
2824
+ Object.defineProperty(exports, "__esModule", {
2825
+ value: true
2826
+ });
2827
+ Object.defineProperty(exports, "addLocale", {
2828
+ enumerable: true,
2829
+ get: function() {
2830
+ return addLocale;
2831
+ }
2832
+ });
2833
+ var _addpathprefix = require_add_path_prefix();
2834
+ var _pathhasprefix = require_path_has_prefix();
2835
+ function addLocale(path, locale, defaultLocale, ignorePrefix) {
2836
+ if (!locale || locale === defaultLocale) return path;
2837
+ const lower = path.toLowerCase();
2838
+ if (!ignorePrefix) {
2839
+ if ((0, _pathhasprefix.pathHasPrefix)(lower, "/api")) return path;
2840
+ if ((0, _pathhasprefix.pathHasPrefix)(lower, `/${locale.toLowerCase()}`)) return path;
2841
+ }
2842
+ return (0, _addpathprefix.addPathPrefix)(path, `/${locale}`);
2843
+ }
2844
+ }
2845
+ });
2846
+
2847
+ // node_modules/next/dist/client/add-locale.js
2848
+ var require_add_locale2 = __commonJS({
2849
+ "node_modules/next/dist/client/add-locale.js"(exports, module) {
2850
+ "use strict";
2851
+ Object.defineProperty(exports, "__esModule", {
2852
+ value: true
2853
+ });
2854
+ Object.defineProperty(exports, "addLocale", {
2855
+ enumerable: true,
2856
+ get: function() {
2857
+ return addLocale;
2858
+ }
2859
+ });
2860
+ var _normalizetrailingslash = require_normalize_trailing_slash();
2861
+ var addLocale = (path, ...args) => {
2862
+ if (process.env.__NEXT_I18N_SUPPORT) {
2863
+ return (0, _normalizetrailingslash.normalizePathTrailingSlash)(require_add_locale().addLocale(path, ...args));
2864
+ }
2865
+ return path;
2866
+ };
2867
+ if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
2868
+ Object.defineProperty(exports.default, "__esModule", { value: true });
2869
+ Object.assign(exports.default, exports);
2870
+ module.exports = exports.default;
2871
+ }
2872
+ }
2873
+ });
2874
+
2875
+ // node_modules/@swc/helpers/cjs/_interop_require_default.cjs
2876
+ var require_interop_require_default = __commonJS({
2877
+ "node_modules/@swc/helpers/cjs/_interop_require_default.cjs"(exports) {
2878
+ "use strict";
2879
+ function _interop_require_default(obj) {
2880
+ return obj && obj.__esModule ? obj : { default: obj };
2881
+ }
2882
+ exports._ = _interop_require_default;
2883
+ }
2884
+ });
2885
+
2886
+ // node_modules/next/dist/shared/lib/router-context.shared-runtime.js
2887
+ var require_router_context_shared_runtime = __commonJS({
2888
+ "node_modules/next/dist/shared/lib/router-context.shared-runtime.js"(exports) {
2889
+ "use strict";
2890
+ Object.defineProperty(exports, "__esModule", {
2891
+ value: true
2892
+ });
2893
+ Object.defineProperty(exports, "RouterContext", {
2894
+ enumerable: true,
2895
+ get: function() {
2896
+ return RouterContext;
2897
+ }
2898
+ });
2899
+ var _interop_require_default = require_interop_require_default();
2900
+ var _react = /* @__PURE__ */ _interop_require_default._(__require("react"));
2901
+ var RouterContext = _react.default.createContext(null);
2902
+ if (true) {
2903
+ RouterContext.displayName = "RouterContext";
2904
+ }
2905
+ }
2906
+ });
2907
+
2908
+ // node_modules/next/dist/client/request-idle-callback.js
2909
+ var require_request_idle_callback = __commonJS({
2910
+ "node_modules/next/dist/client/request-idle-callback.js"(exports, module) {
2911
+ "use strict";
2912
+ Object.defineProperty(exports, "__esModule", {
2913
+ value: true
2914
+ });
2915
+ function _export(target, all) {
2916
+ for (var name in all) Object.defineProperty(target, name, {
2917
+ enumerable: true,
2918
+ get: all[name]
2919
+ });
2920
+ }
2921
+ _export(exports, {
2922
+ cancelIdleCallback: function() {
2923
+ return cancelIdleCallback;
2924
+ },
2925
+ requestIdleCallback: function() {
2926
+ return requestIdleCallback;
2927
+ }
2928
+ });
2929
+ var requestIdleCallback = typeof self !== "undefined" && self.requestIdleCallback && self.requestIdleCallback.bind(window) || function(cb) {
2930
+ let start = Date.now();
2931
+ return self.setTimeout(function() {
2932
+ cb({
2933
+ didTimeout: false,
2934
+ timeRemaining: function() {
2935
+ return Math.max(0, 50 - (Date.now() - start));
2936
+ }
2937
+ });
2938
+ }, 1);
2939
+ };
2940
+ var cancelIdleCallback = typeof self !== "undefined" && self.cancelIdleCallback && self.cancelIdleCallback.bind(window) || function(id) {
2941
+ return clearTimeout(id);
2942
+ };
2943
+ if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
2944
+ Object.defineProperty(exports.default, "__esModule", { value: true });
2945
+ Object.assign(exports.default, exports);
2946
+ module.exports = exports.default;
2947
+ }
2948
+ }
2949
+ });
2950
+
2951
+ // node_modules/next/dist/client/use-intersection.js
2952
+ var require_use_intersection = __commonJS({
2953
+ "node_modules/next/dist/client/use-intersection.js"(exports, module) {
2954
+ "use strict";
2955
+ Object.defineProperty(exports, "__esModule", {
2956
+ value: true
2957
+ });
2958
+ Object.defineProperty(exports, "useIntersection", {
2959
+ enumerable: true,
2960
+ get: function() {
2961
+ return useIntersection;
2962
+ }
2963
+ });
2964
+ var _react = __require("react");
2965
+ var _requestidlecallback = require_request_idle_callback();
2966
+ var hasIntersectionObserver = typeof IntersectionObserver === "function";
2967
+ var observers = /* @__PURE__ */ new Map();
2968
+ var idList = [];
2969
+ function createObserver(options) {
2970
+ const id = {
2971
+ root: options.root || null,
2972
+ margin: options.rootMargin || ""
2973
+ };
2974
+ const existing = idList.find((obj) => obj.root === id.root && obj.margin === id.margin);
2975
+ let instance;
2976
+ if (existing) {
2977
+ instance = observers.get(existing);
2978
+ if (instance) {
2979
+ return instance;
2980
+ }
2981
+ }
2982
+ const elements = /* @__PURE__ */ new Map();
2983
+ const observer = new IntersectionObserver((entries) => {
2984
+ entries.forEach((entry) => {
2985
+ const callback = elements.get(entry.target);
2986
+ const isVisible = entry.isIntersecting || entry.intersectionRatio > 0;
2987
+ if (callback && isVisible) {
2988
+ callback(isVisible);
2989
+ }
2990
+ });
2991
+ }, options);
2992
+ instance = {
2993
+ id,
2994
+ observer,
2995
+ elements
2996
+ };
2997
+ idList.push(id);
2998
+ observers.set(id, instance);
2999
+ return instance;
3000
+ }
3001
+ function observe(element, callback, options) {
3002
+ const { id, observer, elements } = createObserver(options);
3003
+ elements.set(element, callback);
3004
+ observer.observe(element);
3005
+ return function unobserve() {
3006
+ elements.delete(element);
3007
+ observer.unobserve(element);
3008
+ if (elements.size === 0) {
3009
+ observer.disconnect();
3010
+ observers.delete(id);
3011
+ const index = idList.findIndex((obj) => obj.root === id.root && obj.margin === id.margin);
3012
+ if (index > -1) {
3013
+ idList.splice(index, 1);
3014
+ }
3015
+ }
3016
+ };
3017
+ }
3018
+ function useIntersection({ rootRef, rootMargin, disabled }) {
3019
+ const isDisabled = disabled || !hasIntersectionObserver;
3020
+ const [visible, setVisible] = (0, _react.useState)(false);
3021
+ const elementRef = (0, _react.useRef)(null);
3022
+ const setElement = (0, _react.useCallback)((element) => {
3023
+ elementRef.current = element;
3024
+ }, []);
3025
+ (0, _react.useEffect)(() => {
3026
+ if (hasIntersectionObserver) {
3027
+ if (isDisabled || visible) return;
3028
+ const element = elementRef.current;
3029
+ if (element && element.tagName) {
3030
+ const unobserve = observe(element, (isVisible) => isVisible && setVisible(isVisible), {
3031
+ root: rootRef?.current,
3032
+ rootMargin
3033
+ });
3034
+ return unobserve;
3035
+ }
3036
+ } else {
3037
+ if (!visible) {
3038
+ const idleCallback = (0, _requestidlecallback.requestIdleCallback)(() => setVisible(true));
3039
+ return () => (0, _requestidlecallback.cancelIdleCallback)(idleCallback);
3040
+ }
3041
+ }
3042
+ }, [
3043
+ isDisabled,
3044
+ rootMargin,
3045
+ rootRef,
3046
+ visible,
3047
+ elementRef.current
3048
+ ]);
3049
+ const resetVisible = (0, _react.useCallback)(() => {
3050
+ setVisible(false);
3051
+ }, []);
3052
+ return [
3053
+ setElement,
3054
+ visible,
3055
+ resetVisible
3056
+ ];
3057
+ }
3058
+ if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
3059
+ Object.defineProperty(exports.default, "__esModule", { value: true });
3060
+ Object.assign(exports.default, exports);
3061
+ module.exports = exports.default;
3062
+ }
3063
+ }
3064
+ });
3065
+
3066
+ // node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js
3067
+ var require_normalize_locale_path = __commonJS({
3068
+ "node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js"(exports) {
3069
+ "use strict";
3070
+ Object.defineProperty(exports, "__esModule", {
3071
+ value: true
3072
+ });
3073
+ Object.defineProperty(exports, "normalizeLocalePath", {
3074
+ enumerable: true,
3075
+ get: function() {
3076
+ return normalizeLocalePath;
3077
+ }
3078
+ });
3079
+ var cache = /* @__PURE__ */ new WeakMap();
3080
+ function normalizeLocalePath(pathname, locales) {
3081
+ if (!locales) return {
3082
+ pathname
3083
+ };
3084
+ let lowercasedLocales = cache.get(locales);
3085
+ if (!lowercasedLocales) {
3086
+ lowercasedLocales = locales.map((locale) => locale.toLowerCase());
3087
+ cache.set(locales, lowercasedLocales);
3088
+ }
3089
+ let detectedLocale;
3090
+ const segments = pathname.split("/", 2);
3091
+ if (!segments[1]) return {
3092
+ pathname
3093
+ };
3094
+ const segment = segments[1].toLowerCase();
3095
+ const index = lowercasedLocales.indexOf(segment);
3096
+ if (index < 0) return {
3097
+ pathname
3098
+ };
3099
+ detectedLocale = locales[index];
3100
+ pathname = pathname.slice(detectedLocale.length + 1) || "/";
3101
+ return {
3102
+ pathname,
3103
+ detectedLocale
3104
+ };
3105
+ }
3106
+ }
3107
+ });
3108
+
3109
+ // node_modules/next/dist/client/normalize-locale-path.js
3110
+ var require_normalize_locale_path2 = __commonJS({
3111
+ "node_modules/next/dist/client/normalize-locale-path.js"(exports, module) {
3112
+ "use strict";
3113
+ Object.defineProperty(exports, "__esModule", {
3114
+ value: true
3115
+ });
3116
+ Object.defineProperty(exports, "normalizeLocalePath", {
3117
+ enumerable: true,
3118
+ get: function() {
3119
+ return normalizeLocalePath;
3120
+ }
3121
+ });
3122
+ var normalizeLocalePath = (pathname, locales) => {
3123
+ if (process.env.__NEXT_I18N_SUPPORT) {
3124
+ return require_normalize_locale_path().normalizeLocalePath(pathname, locales);
3125
+ }
3126
+ return {
3127
+ pathname,
3128
+ detectedLocale: void 0
3129
+ };
3130
+ };
3131
+ if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
3132
+ Object.defineProperty(exports.default, "__esModule", { value: true });
3133
+ Object.assign(exports.default, exports);
3134
+ module.exports = exports.default;
3135
+ }
3136
+ }
3137
+ });
3138
+
3139
+ // node_modules/next/dist/shared/lib/i18n/detect-domain-locale.js
3140
+ var require_detect_domain_locale = __commonJS({
3141
+ "node_modules/next/dist/shared/lib/i18n/detect-domain-locale.js"(exports) {
3142
+ "use strict";
3143
+ Object.defineProperty(exports, "__esModule", {
3144
+ value: true
3145
+ });
3146
+ Object.defineProperty(exports, "detectDomainLocale", {
3147
+ enumerable: true,
3148
+ get: function() {
3149
+ return detectDomainLocale;
3150
+ }
3151
+ });
3152
+ function detectDomainLocale(domainItems, hostname, detectedLocale) {
3153
+ if (!domainItems) return;
3154
+ if (detectedLocale) {
3155
+ detectedLocale = detectedLocale.toLowerCase();
3156
+ }
3157
+ for (const item of domainItems) {
3158
+ const domainHostname = item.domain?.split(":", 1)[0].toLowerCase();
3159
+ if (hostname === domainHostname || detectedLocale === item.defaultLocale.toLowerCase() || item.locales?.some((locale) => locale.toLowerCase() === detectedLocale)) {
3160
+ return item;
3161
+ }
3162
+ }
3163
+ }
3164
+ }
3165
+ });
3166
+
3167
+ // node_modules/next/dist/client/detect-domain-locale.js
3168
+ var require_detect_domain_locale2 = __commonJS({
3169
+ "node_modules/next/dist/client/detect-domain-locale.js"(exports, module) {
3170
+ "use strict";
3171
+ Object.defineProperty(exports, "__esModule", {
3172
+ value: true
3173
+ });
3174
+ Object.defineProperty(exports, "detectDomainLocale", {
3175
+ enumerable: true,
3176
+ get: function() {
3177
+ return detectDomainLocale;
3178
+ }
3179
+ });
3180
+ var detectDomainLocale = (...args) => {
3181
+ if (process.env.__NEXT_I18N_SUPPORT) {
3182
+ return require_detect_domain_locale().detectDomainLocale(...args);
3183
+ }
3184
+ };
3185
+ if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
3186
+ Object.defineProperty(exports.default, "__esModule", { value: true });
3187
+ Object.assign(exports.default, exports);
3188
+ module.exports = exports.default;
3189
+ }
3190
+ }
3191
+ });
3192
+
3193
+ // node_modules/next/dist/client/get-domain-locale.js
3194
+ var require_get_domain_locale = __commonJS({
3195
+ "node_modules/next/dist/client/get-domain-locale.js"(exports, module) {
3196
+ "use strict";
3197
+ Object.defineProperty(exports, "__esModule", {
3198
+ value: true
3199
+ });
3200
+ Object.defineProperty(exports, "getDomainLocale", {
3201
+ enumerable: true,
3202
+ get: function() {
3203
+ return getDomainLocale;
3204
+ }
3205
+ });
3206
+ var _normalizetrailingslash = require_normalize_trailing_slash();
3207
+ var basePath = process.env.__NEXT_ROUTER_BASEPATH || "";
3208
+ function getDomainLocale(path, locale, locales, domainLocales) {
3209
+ if (process.env.__NEXT_I18N_SUPPORT) {
3210
+ const normalizeLocalePath = require_normalize_locale_path2().normalizeLocalePath;
3211
+ const detectDomainLocale = require_detect_domain_locale2().detectDomainLocale;
3212
+ const target = locale || normalizeLocalePath(path, locales).detectedLocale;
3213
+ const domain = detectDomainLocale(domainLocales, void 0, target);
3214
+ if (domain) {
3215
+ const proto = `http${domain.http ? "" : "s"}://`;
3216
+ const finalLocale = target === domain.defaultLocale ? "" : `/${target}`;
3217
+ return `${proto}${domain.domain}${(0, _normalizetrailingslash.normalizePathTrailingSlash)(`${basePath}${finalLocale}${path}`)}`;
3218
+ }
3219
+ return false;
3220
+ } else {
3221
+ return false;
3222
+ }
3223
+ }
3224
+ if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
3225
+ Object.defineProperty(exports.default, "__esModule", { value: true });
3226
+ Object.assign(exports.default, exports);
3227
+ module.exports = exports.default;
3228
+ }
3229
+ }
3230
+ });
3231
+
3232
+ // node_modules/next/dist/client/add-base-path.js
3233
+ var require_add_base_path = __commonJS({
3234
+ "node_modules/next/dist/client/add-base-path.js"(exports, module) {
3235
+ "use strict";
3236
+ Object.defineProperty(exports, "__esModule", {
3237
+ value: true
3238
+ });
3239
+ Object.defineProperty(exports, "addBasePath", {
3240
+ enumerable: true,
3241
+ get: function() {
3242
+ return addBasePath;
3243
+ }
3244
+ });
3245
+ var _addpathprefix = require_add_path_prefix();
3246
+ var _normalizetrailingslash = require_normalize_trailing_slash();
3247
+ var basePath = process.env.__NEXT_ROUTER_BASEPATH || "";
3248
+ function addBasePath(path, required) {
3249
+ return (0, _normalizetrailingslash.normalizePathTrailingSlash)(process.env.__NEXT_MANUAL_CLIENT_BASE_PATH && !required ? path : (0, _addpathprefix.addPathPrefix)(path, basePath));
3250
+ }
3251
+ if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
3252
+ Object.defineProperty(exports.default, "__esModule", { value: true });
3253
+ Object.assign(exports.default, exports);
3254
+ module.exports = exports.default;
3255
+ }
3256
+ }
3257
+ });
3258
+
3259
+ // node_modules/next/dist/client/use-merged-ref.js
3260
+ var require_use_merged_ref = __commonJS({
3261
+ "node_modules/next/dist/client/use-merged-ref.js"(exports, module) {
3262
+ "use strict";
3263
+ Object.defineProperty(exports, "__esModule", {
3264
+ value: true
3265
+ });
3266
+ Object.defineProperty(exports, "useMergedRef", {
3267
+ enumerable: true,
3268
+ get: function() {
3269
+ return useMergedRef;
3270
+ }
3271
+ });
3272
+ var _react = __require("react");
3273
+ function useMergedRef(refA, refB) {
3274
+ const cleanupA = (0, _react.useRef)(null);
3275
+ const cleanupB = (0, _react.useRef)(null);
3276
+ return (0, _react.useCallback)((current) => {
3277
+ if (current === null) {
3278
+ const cleanupFnA = cleanupA.current;
3279
+ if (cleanupFnA) {
3280
+ cleanupA.current = null;
3281
+ cleanupFnA();
3282
+ }
3283
+ const cleanupFnB = cleanupB.current;
3284
+ if (cleanupFnB) {
3285
+ cleanupB.current = null;
3286
+ cleanupFnB();
3287
+ }
3288
+ } else {
3289
+ if (refA) {
3290
+ cleanupA.current = applyRef(refA, current);
3291
+ }
3292
+ if (refB) {
3293
+ cleanupB.current = applyRef(refB, current);
3294
+ }
3295
+ }
3296
+ }, [
3297
+ refA,
3298
+ refB
3299
+ ]);
3300
+ }
3301
+ function applyRef(refA, current) {
3302
+ if (typeof refA === "function") {
3303
+ const cleanup = refA(current);
3304
+ if (typeof cleanup === "function") {
3305
+ return cleanup;
3306
+ } else {
3307
+ return () => refA(null);
3308
+ }
3309
+ } else {
3310
+ refA.current = current;
3311
+ return () => {
3312
+ refA.current = null;
3313
+ };
3314
+ }
3315
+ }
3316
+ if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
3317
+ Object.defineProperty(exports.default, "__esModule", { value: true });
3318
+ Object.assign(exports.default, exports);
3319
+ module.exports = exports.default;
3320
+ }
3321
+ }
3322
+ });
3323
+
3324
+ // node_modules/next/dist/shared/lib/utils/error-once.js
3325
+ var require_error_once = __commonJS({
3326
+ "node_modules/next/dist/shared/lib/utils/error-once.js"(exports) {
3327
+ "use strict";
3328
+ Object.defineProperty(exports, "__esModule", {
3329
+ value: true
3330
+ });
3331
+ Object.defineProperty(exports, "errorOnce", {
3332
+ enumerable: true,
3333
+ get: function() {
3334
+ return errorOnce;
3335
+ }
3336
+ });
3337
+ var errorOnce = (_) => {
3338
+ };
3339
+ if (true) {
3340
+ const errors = /* @__PURE__ */ new Set();
3341
+ errorOnce = (msg) => {
3342
+ if (!errors.has(msg)) {
3343
+ console.error(msg);
3344
+ }
3345
+ errors.add(msg);
3346
+ };
3347
+ }
3348
+ }
3349
+ });
3350
+
3351
+ // node_modules/next/dist/client/link.js
3352
+ var require_link = __commonJS({
3353
+ "node_modules/next/dist/client/link.js"(exports, module) {
3354
+ "use client";
3355
+ "use strict";
3356
+ Object.defineProperty(exports, "__esModule", {
3357
+ value: true
3358
+ });
3359
+ function _export(target, all) {
3360
+ for (var name in all) Object.defineProperty(target, name, {
3361
+ enumerable: true,
3362
+ get: all[name]
3363
+ });
3364
+ }
3365
+ _export(exports, {
3366
+ default: function() {
3367
+ return _default;
3368
+ },
3369
+ useLinkStatus: function() {
3370
+ return useLinkStatus;
3371
+ }
3372
+ });
3373
+ var _interop_require_wildcard = require_interop_require_wildcard();
3374
+ var _jsxruntime = __require("react/jsx-runtime");
3375
+ var _react = /* @__PURE__ */ _interop_require_wildcard._(__require("react"));
3376
+ var _resolvehref = require_resolve_href();
3377
+ var _islocalurl = require_is_local_url();
3378
+ var _formaturl = require_format_url();
3379
+ var _utils = require_utils();
3380
+ var _addlocale = require_add_locale2();
3381
+ var _routercontextsharedruntime = require_router_context_shared_runtime();
3382
+ var _useintersection = require_use_intersection();
3383
+ var _getdomainlocale = require_get_domain_locale();
3384
+ var _addbasepath = require_add_base_path();
3385
+ var _usemergedref = require_use_merged_ref();
3386
+ var _erroronce = require_error_once();
3387
+ var prefetched = /* @__PURE__ */ new Set();
3388
+ function prefetch(router, href, as, options) {
3389
+ if (typeof window === "undefined") {
3390
+ return;
3391
+ }
3392
+ if (!(0, _islocalurl.isLocalURL)(href)) {
3393
+ return;
3394
+ }
3395
+ if (!options.bypassPrefetchedCheck) {
3396
+ const locale = (
3397
+ // Let the link's locale prop override the default router locale.
3398
+ typeof options.locale !== "undefined" ? options.locale : "locale" in router ? router.locale : void 0
3399
+ );
3400
+ const prefetchedKey = href + "%" + as + "%" + locale;
3401
+ if (prefetched.has(prefetchedKey)) {
3402
+ return;
3403
+ }
3404
+ prefetched.add(prefetchedKey);
3405
+ }
3406
+ router.prefetch(href, as, options).catch((err) => {
3407
+ if (true) {
3408
+ throw err;
3409
+ }
3410
+ });
3411
+ }
3412
+ function isModifiedEvent(event) {
3413
+ const eventTarget = event.currentTarget;
3414
+ const target = eventTarget.getAttribute("target");
3415
+ return target && target !== "_self" || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || // triggers resource download
3416
+ event.nativeEvent && event.nativeEvent.which === 2;
3417
+ }
3418
+ function linkClicked(e, router, href, as, replace, shallow, scroll, locale, onNavigate) {
3419
+ const { nodeName } = e.currentTarget;
3420
+ const isAnchorNodeName = nodeName.toUpperCase() === "A";
3421
+ if (isAnchorNodeName && isModifiedEvent(e) || e.currentTarget.hasAttribute("download")) {
3422
+ return;
3423
+ }
3424
+ if (!(0, _islocalurl.isLocalURL)(href)) {
3425
+ if (replace) {
3426
+ e.preventDefault();
3427
+ location.replace(href);
3428
+ }
3429
+ return;
3430
+ }
3431
+ e.preventDefault();
3432
+ const navigate = () => {
3433
+ if (onNavigate) {
3434
+ let isDefaultPrevented = false;
3435
+ onNavigate({
3436
+ preventDefault: () => {
3437
+ isDefaultPrevented = true;
3438
+ }
3439
+ });
3440
+ if (isDefaultPrevented) {
3441
+ return;
3442
+ }
3443
+ }
3444
+ const routerScroll = scroll ?? true;
3445
+ if ("beforePopState" in router) {
3446
+ router[replace ? "replace" : "push"](href, as, {
3447
+ shallow,
3448
+ locale,
3449
+ scroll: routerScroll
3450
+ });
3451
+ } else {
3452
+ router[replace ? "replace" : "push"](as || href, {
3453
+ scroll: routerScroll
3454
+ });
3455
+ }
3456
+ };
3457
+ navigate();
3458
+ }
3459
+ function formatStringOrUrl(urlObjOrString) {
3460
+ if (typeof urlObjOrString === "string") {
3461
+ return urlObjOrString;
3462
+ }
3463
+ return (0, _formaturl.formatUrl)(urlObjOrString);
3464
+ }
3465
+ var Link2 = /* @__PURE__ */ _react.default.forwardRef(function LinkComponent(props, forwardedRef) {
3466
+ let children;
3467
+ const { href: hrefProp, as: asProp, children: childrenProp, prefetch: prefetchProp = null, passHref, replace, shallow, scroll, locale, onClick, onNavigate, onMouseEnter: onMouseEnterProp, onTouchStart: onTouchStartProp, legacyBehavior = false, ...restProps } = props;
3468
+ children = childrenProp;
3469
+ if (legacyBehavior && (typeof children === "string" || typeof children === "number")) {
3470
+ children = /* @__PURE__ */ (0, _jsxruntime.jsx)("a", {
3471
+ children
3472
+ });
3473
+ }
3474
+ const router = _react.default.useContext(_routercontextsharedruntime.RouterContext);
3475
+ const prefetchEnabled = prefetchProp !== false;
3476
+ if (true) {
3477
+ let createPropError = function(args) {
3478
+ return Object.defineProperty(new Error(`Failed prop type: The prop \`${args.key}\` expects a ${args.expected} in \`<Link>\`, but got \`${args.actual}\` instead.` + (typeof window !== "undefined" ? "\nOpen your browser's console to view the Component stack trace." : "")), "__NEXT_ERROR_CODE", {
3479
+ value: "E319",
3480
+ enumerable: false,
3481
+ configurable: true
3482
+ });
3483
+ };
3484
+ const requiredPropsGuard = {
3485
+ href: true
3486
+ };
3487
+ const requiredProps = Object.keys(requiredPropsGuard);
3488
+ requiredProps.forEach((key) => {
3489
+ if (key === "href") {
3490
+ if (props[key] == null || typeof props[key] !== "string" && typeof props[key] !== "object") {
3491
+ throw createPropError({
3492
+ key,
3493
+ expected: "`string` or `object`",
3494
+ actual: props[key] === null ? "null" : typeof props[key]
3495
+ });
3496
+ }
3497
+ } else {
3498
+ const _ = key;
3499
+ }
3500
+ });
3501
+ const optionalPropsGuard = {
3502
+ as: true,
3503
+ replace: true,
3504
+ scroll: true,
3505
+ shallow: true,
3506
+ passHref: true,
3507
+ prefetch: true,
3508
+ locale: true,
3509
+ onClick: true,
3510
+ onMouseEnter: true,
3511
+ onTouchStart: true,
3512
+ legacyBehavior: true,
3513
+ onNavigate: true
3514
+ };
3515
+ const optionalProps = Object.keys(optionalPropsGuard);
3516
+ optionalProps.forEach((key) => {
3517
+ const valType = typeof props[key];
3518
+ if (key === "as") {
3519
+ if (props[key] && valType !== "string" && valType !== "object") {
3520
+ throw createPropError({
3521
+ key,
3522
+ expected: "`string` or `object`",
3523
+ actual: valType
3524
+ });
3525
+ }
3526
+ } else if (key === "locale") {
3527
+ if (props[key] && valType !== "string") {
3528
+ throw createPropError({
3529
+ key,
3530
+ expected: "`string`",
3531
+ actual: valType
3532
+ });
3533
+ }
3534
+ } else if (key === "onClick" || key === "onMouseEnter" || key === "onTouchStart" || key === "onNavigate") {
3535
+ if (props[key] && valType !== "function") {
3536
+ throw createPropError({
3537
+ key,
3538
+ expected: "`function`",
3539
+ actual: valType
3540
+ });
3541
+ }
3542
+ } else if (key === "replace" || key === "scroll" || key === "shallow" || key === "passHref" || key === "legacyBehavior") {
3543
+ if (props[key] != null && valType !== "boolean") {
3544
+ throw createPropError({
3545
+ key,
3546
+ expected: "`boolean`",
3547
+ actual: valType
3548
+ });
3549
+ }
3550
+ } else if (key === "prefetch") {
3551
+ if (props[key] != null && valType !== "boolean" && props[key] !== "auto") {
3552
+ throw createPropError({
3553
+ key,
3554
+ expected: '`boolean | "auto"`',
3555
+ actual: valType
3556
+ });
3557
+ }
3558
+ } else {
3559
+ const _ = key;
3560
+ }
3561
+ });
3562
+ }
3563
+ const { href, as } = _react.default.useMemo(() => {
3564
+ if (!router) {
3565
+ const resolvedHref2 = formatStringOrUrl(hrefProp);
3566
+ return {
3567
+ href: resolvedHref2,
3568
+ as: asProp ? formatStringOrUrl(asProp) : resolvedHref2
3569
+ };
3570
+ }
3571
+ const [resolvedHref, resolvedAs] = (0, _resolvehref.resolveHref)(router, hrefProp, true);
3572
+ return {
3573
+ href: resolvedHref,
3574
+ as: asProp ? (0, _resolvehref.resolveHref)(router, asProp) : resolvedAs || resolvedHref
3575
+ };
3576
+ }, [
3577
+ router,
3578
+ hrefProp,
3579
+ asProp
3580
+ ]);
3581
+ const previousHref = _react.default.useRef(href);
3582
+ const previousAs = _react.default.useRef(as);
3583
+ let child;
3584
+ if (legacyBehavior) {
3585
+ if (true) {
3586
+ if (onClick) {
3587
+ console.warn(`"onClick" was passed to <Link> with \`href\` of \`${hrefProp}\` but "legacyBehavior" was set. The legacy behavior requires onClick be set on the child of next/link`);
3588
+ }
3589
+ if (onMouseEnterProp) {
3590
+ console.warn(`"onMouseEnter" was passed to <Link> with \`href\` of \`${hrefProp}\` but "legacyBehavior" was set. The legacy behavior requires onMouseEnter be set on the child of next/link`);
3591
+ }
3592
+ try {
3593
+ child = _react.default.Children.only(children);
3594
+ } catch (err) {
3595
+ if (!children) {
3596
+ throw Object.defineProperty(new Error(`No children were passed to <Link> with \`href\` of \`${hrefProp}\` but one child is required https://nextjs.org/docs/messages/link-no-children`), "__NEXT_ERROR_CODE", {
3597
+ value: "E320",
3598
+ enumerable: false,
3599
+ configurable: true
3600
+ });
3601
+ }
3602
+ throw Object.defineProperty(new Error(`Multiple children were passed to <Link> with \`href\` of \`${hrefProp}\` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children` + (typeof window !== "undefined" ? " \nOpen your browser's console to view the Component stack trace." : "")), "__NEXT_ERROR_CODE", {
3603
+ value: "E266",
3604
+ enumerable: false,
3605
+ configurable: true
3606
+ });
3607
+ }
3608
+ } else {
3609
+ child = _react.default.Children.only(children);
3610
+ }
3611
+ } else {
3612
+ if (true) {
3613
+ if (children?.type === "a") {
3614
+ throw Object.defineProperty(new Error("Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>.\nLearn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor"), "__NEXT_ERROR_CODE", {
3615
+ value: "E209",
3616
+ enumerable: false,
3617
+ configurable: true
3618
+ });
3619
+ }
3620
+ }
3621
+ }
3622
+ const childRef = legacyBehavior ? child && typeof child === "object" && child.ref : forwardedRef;
3623
+ const [setIntersectionRef, isVisible, resetVisible] = (0, _useintersection.useIntersection)({
3624
+ rootMargin: "200px"
3625
+ });
3626
+ const setIntersectionWithResetRef = _react.default.useCallback((el) => {
3627
+ if (previousAs.current !== as || previousHref.current !== href) {
3628
+ resetVisible();
3629
+ previousAs.current = as;
3630
+ previousHref.current = href;
3631
+ }
3632
+ setIntersectionRef(el);
3633
+ }, [
3634
+ as,
3635
+ href,
3636
+ resetVisible,
3637
+ setIntersectionRef
3638
+ ]);
3639
+ const setRef = (0, _usemergedref.useMergedRef)(setIntersectionWithResetRef, childRef);
3640
+ _react.default.useEffect(() => {
3641
+ if (true) {
3642
+ return;
3643
+ }
3644
+ if (!router) {
3645
+ return;
3646
+ }
3647
+ if (!isVisible || !prefetchEnabled) {
3648
+ return;
3649
+ }
3650
+ prefetch(router, href, as, {
3651
+ locale
3652
+ });
3653
+ }, [
3654
+ as,
3655
+ href,
3656
+ isVisible,
3657
+ locale,
3658
+ prefetchEnabled,
3659
+ router?.locale,
3660
+ router
3661
+ ]);
3662
+ const childProps = {
3663
+ ref: setRef,
3664
+ onClick(e) {
3665
+ if (true) {
3666
+ if (!e) {
3667
+ throw Object.defineProperty(new Error(`Component rendered inside next/link has to pass click event to "onClick" prop.`), "__NEXT_ERROR_CODE", {
3668
+ value: "E312",
3669
+ enumerable: false,
3670
+ configurable: true
3671
+ });
3672
+ }
3673
+ }
3674
+ if (!legacyBehavior && typeof onClick === "function") {
3675
+ onClick(e);
3676
+ }
3677
+ if (legacyBehavior && child.props && typeof child.props.onClick === "function") {
3678
+ child.props.onClick(e);
3679
+ }
3680
+ if (!router) {
3681
+ return;
3682
+ }
3683
+ if (e.defaultPrevented) {
3684
+ return;
3685
+ }
3686
+ linkClicked(e, router, href, as, replace, shallow, scroll, locale, onNavigate);
3687
+ },
3688
+ onMouseEnter(e) {
3689
+ if (!legacyBehavior && typeof onMouseEnterProp === "function") {
3690
+ onMouseEnterProp(e);
3691
+ }
3692
+ if (legacyBehavior && child.props && typeof child.props.onMouseEnter === "function") {
3693
+ child.props.onMouseEnter(e);
3694
+ }
3695
+ if (!router) {
3696
+ return;
3697
+ }
3698
+ prefetch(router, href, as, {
3699
+ locale,
3700
+ priority: true,
3701
+ // @see {https://github.com/vercel/next.js/discussions/40268?sort=top#discussioncomment-3572642}
3702
+ bypassPrefetchedCheck: true
3703
+ });
3704
+ },
3705
+ onTouchStart: process.env.__NEXT_LINK_NO_TOUCH_START ? void 0 : function onTouchStart(e) {
3706
+ if (!legacyBehavior && typeof onTouchStartProp === "function") {
3707
+ onTouchStartProp(e);
3708
+ }
3709
+ if (legacyBehavior && child.props && typeof child.props.onTouchStart === "function") {
3710
+ child.props.onTouchStart(e);
3711
+ }
3712
+ if (!router) {
3713
+ return;
3714
+ }
3715
+ prefetch(router, href, as, {
3716
+ locale,
3717
+ priority: true,
3718
+ // @see {https://github.com/vercel/next.js/discussions/40268?sort=top#discussioncomment-3572642}
3719
+ bypassPrefetchedCheck: true
3720
+ });
3721
+ }
3722
+ };
3723
+ if ((0, _utils.isAbsoluteUrl)(as)) {
3724
+ childProps.href = as;
3725
+ } else if (!legacyBehavior || passHref || child.type === "a" && !("href" in child.props)) {
3726
+ const curLocale = typeof locale !== "undefined" ? locale : router?.locale;
3727
+ const localeDomain = router?.isLocaleDomain && (0, _getdomainlocale.getDomainLocale)(as, curLocale, router?.locales, router?.domainLocales);
3728
+ childProps.href = localeDomain || (0, _addbasepath.addBasePath)((0, _addlocale.addLocale)(as, curLocale, router?.defaultLocale));
3729
+ }
3730
+ if (legacyBehavior) {
3731
+ if (true) {
3732
+ (0, _erroronce.errorOnce)("`legacyBehavior` is deprecated and will be removed in a future release. A codemod is available to upgrade your components:\n\nnpx @next/codemod@latest new-link .\n\nLearn more: https://nextjs.org/docs/app/building-your-application/upgrading/codemods#remove-a-tags-from-link-components");
3733
+ }
3734
+ return /* @__PURE__ */ _react.default.cloneElement(child, childProps);
3735
+ }
3736
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)("a", {
3737
+ ...restProps,
3738
+ ...childProps,
3739
+ children
3740
+ });
3741
+ });
3742
+ var LinkStatusContext = /* @__PURE__ */ (0, _react.createContext)({
3743
+ // We do not support link status in the Pages Router, so we always return false
3744
+ pending: false
3745
+ });
3746
+ var useLinkStatus = () => {
3747
+ return (0, _react.useContext)(LinkStatusContext);
3748
+ };
3749
+ var _default = Link2;
3750
+ if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
3751
+ Object.defineProperty(exports.default, "__esModule", { value: true });
3752
+ Object.assign(exports.default, exports);
3753
+ module.exports = exports.default;
3754
+ }
3755
+ }
3756
+ });
3757
+
3758
+ // node_modules/next/link.js
3759
+ var require_link2 = __commonJS({
3760
+ "node_modules/next/link.js"(exports, module) {
3761
+ module.exports = require_link();
3762
+ }
3763
+ });
3764
+
3765
+ // src/provider.js
3766
+ import React, { createContext, useContext, useEffect, useState, useCallback, useRef } from "react";
3767
+
3768
+ // src/securityUtils.js
3769
+ function isSecureContext() {
3770
+ if (typeof window === "undefined") return true;
3771
+ const isLocalhost = window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname === "[::1]";
3772
+ const isHttps = window.location.protocol === "https:";
3773
+ return isHttps || isLocalhost;
3774
+ }
3775
+ function checkSecureContext() {
3776
+ if (!isSecureContext()) {
3777
+ console.warn(
3778
+ "flowlink-auth: HTTPS is required for production. Your connection is not secure. Authentication may fail."
3779
+ );
3780
+ }
3781
+ }
3782
+ function getSafeErrorMessage(error) {
3783
+ if (typeof error === "string") {
3784
+ if (error.includes("password") || error.includes("token") || error.includes("secret")) {
3785
+ return "An error occurred. Please try again.";
3786
+ }
3787
+ return error;
3788
+ }
3789
+ if (error?.message) {
3790
+ return getSafeErrorMessage(error.message);
3791
+ }
3792
+ return "An error occurred. Please try again.";
3793
+ }
3794
+
3795
+ // src/provider.js
3796
+ var AuthContext = createContext(null);
3797
+ var FlowlinkAuthProvider = ({ children, publishableKey, baseUrl, redirect }) => {
3798
+ const [ready, setReady] = useState(false);
3799
+ const [error, setError] = useState(null);
3800
+ const [user, setUser] = useState(null);
3801
+ const [loadingUser, setLoadingUser] = useState(true);
3802
+ const [sessionTimeout, setSessionTimeout] = useState(null);
3803
+ const redirectedRef = useRef(false);
3804
+ const sessionTimerRef = useRef(null);
3805
+ useEffect(() => {
3806
+ checkSecureContext();
3807
+ }, []);
3808
+ useEffect(() => {
3809
+ if (!publishableKey || !publishableKey.trim()) {
3810
+ setError("Missing publishable key");
3811
+ setReady(false);
3812
+ return;
3813
+ }
3814
+ if (!baseUrl || !baseUrl.trim()) {
3815
+ setError("Missing baseUrl");
3816
+ setReady(false);
3817
+ return;
3818
+ }
3819
+ if (!publishableKey.startsWith("pk_")) {
3820
+ console.warn('flowlink-auth: publishableKey should start with "pk_"');
3821
+ }
3822
+ setError(null);
3823
+ setReady(true);
3824
+ }, [publishableKey, baseUrl]);
3825
+ const normalizedBase = useCallback(() => {
3826
+ return baseUrl?.replace(/\/+$/, "") || "";
3827
+ }, [baseUrl]);
3828
+ const redirectTo = (url, { replace = true } = {}) => {
3829
+ if (!url) return;
3830
+ if (typeof window === "undefined") return;
3831
+ if (url.startsWith("//") || url.startsWith("http")) {
3832
+ console.error("flowlink-auth: Redirect URL must be relative");
3833
+ return;
3834
+ }
3835
+ try {
3836
+ if (replace) window.location.replace(url);
3837
+ else window.location.assign(url);
3838
+ } catch (_) {
3839
+ window.location.href = url;
3840
+ }
3841
+ };
3842
+ const resetSessionTimeout = useCallback(() => {
3843
+ if (sessionTimerRef.current) {
3844
+ clearTimeout(sessionTimerRef.current);
3845
+ }
3846
+ sessionTimerRef.current = setTimeout(() => {
3847
+ setSessionTimeout(true);
3848
+ logout();
3849
+ }, 24 * 60 * 60 * 1e3);
3850
+ }, []);
3851
+ const fetchMe = useCallback(async () => {
3852
+ setLoadingUser(true);
3853
+ try {
3854
+ const base = normalizedBase();
3855
+ if (!base) {
3856
+ setUser(null);
3857
+ setLoadingUser(false);
3858
+ return null;
3859
+ }
3860
+ const fullUrl = new URL(`${base}/api/sdk/me`).href;
3861
+ const res = await fetch(fullUrl, {
3862
+ method: "GET",
3863
+ credentials: "include",
3864
+ headers: {
3865
+ "Content-Type": "application/json"
3866
+ },
3867
+ referrerPolicy: "strict-origin-when-cross-origin"
3868
+ });
3869
+ if (!res.ok) {
3870
+ setUser(null);
3871
+ setLoadingUser(false);
3872
+ return null;
3873
+ }
3874
+ const data = await res.json();
3875
+ const u = data?.user ?? null;
3876
+ setUser(u);
3877
+ setLoadingUser(false);
3878
+ resetSessionTimeout();
3879
+ return u;
3880
+ } catch (err) {
3881
+ console.error("Failed to fetch user:", getSafeErrorMessage(err));
3882
+ setUser(null);
3883
+ setLoadingUser(false);
3884
+ return null;
3885
+ }
3886
+ }, [normalizedBase, resetSessionTimeout]);
3887
+ useEffect(() => {
3888
+ if (!ready) return;
3889
+ fetchMe();
3890
+ const onStorage = (e) => {
3891
+ if (!e.key) return;
3892
+ if (e.key === "flowlink_login" || e.key === "flowlink_logout") {
3893
+ fetchMe();
3894
+ }
3895
+ };
3896
+ if (typeof window !== "undefined") {
3897
+ window.addEventListener("storage", onStorage);
3898
+ }
3899
+ return () => {
3900
+ if (typeof window !== "undefined") {
3901
+ window.removeEventListener("storage", onStorage);
3902
+ }
3903
+ };
3904
+ }, [ready, fetchMe]);
3905
+ useEffect(() => {
3906
+ if (!ready) return;
3907
+ if (loadingUser) return;
3908
+ if (!user) {
3909
+ redirectedRef.current = false;
3910
+ return;
3911
+ }
3912
+ if (user && redirect && !redirectedRef.current) {
3913
+ redirectedRef.current = true;
3914
+ redirectTo(redirect, { replace: true });
3915
+ }
3916
+ }, [ready, loadingUser, user, redirect]);
3917
+ const completeLogin = useCallback(async (opts = {}) => {
3918
+ const { redirectTo: redirectUrl, replace = true } = opts;
3919
+ const u = await fetchMe();
3920
+ try {
3921
+ localStorage.setItem("flowlink_login", String(Date.now()));
3922
+ } catch (_) {
3923
+ }
3924
+ const dest = redirectUrl ?? redirect;
3925
+ if (u && dest) {
3926
+ redirectTo(dest, { replace });
3927
+ }
3928
+ return u;
3929
+ }, [fetchMe, redirect]);
3930
+ const logout = useCallback(async (opts = {}) => {
3931
+ const { callServer = true, redirectTo: redirectUrl, replace = true } = opts;
3932
+ const base = normalizedBase();
3933
+ if (callServer && base) {
3934
+ try {
3935
+ await fetch(`${base}/api/sdk/logout`, {
3936
+ method: "POST",
3937
+ credentials: "include",
3938
+ headers: { "Content-Type": "application/json" }
3939
+ });
3940
+ } catch (_) {
3941
+ }
3942
+ }
3943
+ setUser(null);
3944
+ try {
3945
+ localStorage.setItem("flowlink_logout", String(Date.now()));
3946
+ } catch (_) {
3947
+ }
3948
+ const dest = redirectUrl ?? redirect;
3949
+ if (dest) redirectTo(dest, { replace });
3950
+ }, [normalizedBase, redirect]);
3951
+ const value = {
3952
+ publishableKey,
3953
+ baseUrl,
3954
+ redirectTo: (url, opts) => redirectTo(url, opts),
3955
+ user,
3956
+ setUser,
3957
+ loadingUser,
3958
+ fetchMe,
3959
+ logout,
3960
+ completeLogin
3961
+ };
3962
+ return /* @__PURE__ */ React.createElement(AuthContext.Provider, { value }, error ? /* @__PURE__ */ React.createElement("div", { style: { padding: "20px", background: "#220000", color: "white" } }, /* @__PURE__ */ React.createElement("h2", null, "flowlink Auth Error"), /* @__PURE__ */ React.createElement("p", null, error)) : !ready ? null : children);
3963
+ };
3964
+ var useAuth = () => {
3965
+ const ctx = useContext(AuthContext);
3966
+ if (!ctx) throw new Error("useAuth must be used within FlowlinkAuthProvider");
3967
+ return ctx;
3968
+ };
3969
+ var provider_default = FlowlinkAuthProvider;
3970
+
3971
+ // src/SignIn.jsx
3972
+ import React2, { useState as useState2 } from "react";
3973
+ function SignIn({ onSuccess } = {}) {
3974
+ const {
3975
+ publishableKey,
3976
+ baseUrl,
3977
+ redirect,
3978
+ redirectTo,
3979
+ user,
3980
+ loadingUser,
3981
+ completeLogin,
3982
+ fetchMe,
3983
+ setUser
3984
+ } = useAuth();
3985
+ const [email, setEmail] = useState2("");
3986
+ const [password, setPassword] = useState2("");
3987
+ const [loading, setLoading] = useState2(false);
3988
+ const [error, setError] = useState2(null);
3989
+ const [message, setMessage] = useState2(null);
3990
+ if (loadingUser) return null;
3991
+ if (user && redirect) {
3992
+ if (typeof redirectTo === "function") redirectTo(redirect);
3993
+ else if (typeof window !== "undefined") window.location.assign(redirect);
3994
+ return null;
3995
+ }
3996
+ async function submit(e) {
3997
+ e.preventDefault();
3998
+ setError(null);
3999
+ setMessage(null);
4000
+ if (!email || !password) {
4001
+ setError("Email and password are required");
4002
+ return;
4003
+ }
4004
+ setLoading(true);
4005
+ try {
4006
+ const endpoint = `${(baseUrl || "").replace(/\/+$/, "")}/api/sdk/login`;
4007
+ const res = await fetch(endpoint, {
4008
+ method: "POST",
4009
+ credentials: "include",
4010
+ headers: {
4011
+ "Content-Type": "application/json",
4012
+ "x-publishable-key": publishableKey || ""
4013
+ },
4014
+ body: JSON.stringify({ email, password })
4015
+ });
4016
+ const ct = res.headers.get("content-type") || "";
4017
+ let data = {};
4018
+ if (ct.includes("application/json")) data = await res.json();
4019
+ else {
4020
+ const text = await res.text();
4021
+ throw new Error(`Unexpected response (status ${res.status}): ${text.slice(0, 200)}`);
4022
+ }
4023
+ if (!res.ok) throw new Error(data.error || data.message || `Login failed (status ${res.status})`);
4024
+ const serverUser = data.user ?? null;
4025
+ if (serverUser && typeof setUser === "function") {
4026
+ try {
4027
+ setUser(serverUser);
4028
+ } catch (_) {
4029
+ }
4030
+ }
4031
+ if (typeof completeLogin === "function") {
4032
+ try {
4033
+ await completeLogin();
4034
+ } catch (e2) {
4035
+ if (typeof fetchMe === "function") await fetchMe();
4036
+ }
4037
+ } else if (typeof fetchMe === "function") {
4038
+ await fetchMe();
4039
+ }
4040
+ if (onSuccess) {
4041
+ try {
4042
+ onSuccess(data);
4043
+ } catch (_) {
4044
+ }
4045
+ }
4046
+ setMessage("Signed in. Redirecting...");
4047
+ if (redirect) {
4048
+ setTimeout(() => {
4049
+ if (typeof redirectTo === "function") redirectTo(redirect);
4050
+ else if (typeof window !== "undefined") window.location.assign(redirect);
4051
+ }, 250);
4052
+ }
4053
+ } catch (err) {
4054
+ setError(err.message || "Network error");
4055
+ } finally {
4056
+ setLoading(false);
4057
+ }
4058
+ }
4059
+ async function startOAuthFlow(provider) {
4060
+ setError(null);
4061
+ setLoading(true);
4062
+ try {
4063
+ const rid = typeof crypto !== "undefined" && typeof crypto.randomUUID === "function" ? crypto.randomUUID() : `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
4064
+ const callbackUrl = encodeURIComponent(`${window.location.origin}/signin`);
4065
+ const sdkBase = typeof process !== "undefined" && process.env && process.env.NEXT_PUBLIC_FLOWLINK_BASE_URL || baseUrl || "http://localhost:3001";
4066
+ const startUrl = `${sdkBase.replace(/\/+$/, "")}/sdk/auth/start?rid=${rid}&source=${encodeURIComponent(provider)}&callbackUrl=${callbackUrl}`;
4067
+ if (!publishableKey) {
4068
+ throw new Error("Missing publishable key (client side). Set NEXT_PUBLIC_FLOWLINK_PUBLISHABLE_KEY or provide publishableKey in provider.");
4069
+ }
4070
+ const res = await fetch(startUrl, {
4071
+ method: "GET",
4072
+ headers: { "x-publishable-key": publishableKey },
4073
+ mode: "cors"
4074
+ });
4075
+ const data = await res.json().catch(() => null);
4076
+ if (!res.ok) throw new Error(data?.error || `OAuth start failed (${res.status})`);
4077
+ if (!data?.oauthUrl) throw new Error("SDK start did not return oauthUrl");
4078
+ window.location.href = data.oauthUrl;
4079
+ } catch (err) {
4080
+ console.error("OAuth start error:", err);
4081
+ setError(err?.message || "OAuth start failed");
4082
+ setLoading(false);
4083
+ }
4084
+ }
4085
+ const handleGoogle = (e) => {
4086
+ if (e && typeof e.preventDefault === "function") e.preventDefault();
4087
+ startOAuthFlow("google");
4088
+ };
4089
+ const handleGithub = (e) => {
4090
+ if (e && typeof e.preventDefault === "function") e.preventDefault();
4091
+ startOAuthFlow("github");
4092
+ };
4093
+ return /* @__PURE__ */ React2.createElement("div", { style: overlay }, /* @__PURE__ */ React2.createElement("div", { style: modal }, /* @__PURE__ */ React2.createElement("h2", { style: title }, "Sign in"), /* @__PURE__ */ React2.createElement("p", { style: subtitle }, "Welcome back \u2014 enter your credentials."), /* @__PURE__ */ React2.createElement("form", { onSubmit: submit, style: { width: "100%" } }, /* @__PURE__ */ React2.createElement("label", { style: label }, "Email"), /* @__PURE__ */ React2.createElement(
4094
+ "input",
4095
+ {
4096
+ style: input,
4097
+ value: email,
4098
+ onChange: (e) => setEmail(e.target.value),
4099
+ type: "email",
4100
+ required: true
4101
+ }
4102
+ ), /* @__PURE__ */ React2.createElement("label", { style: label }, "Password"), /* @__PURE__ */ React2.createElement(
4103
+ "input",
4104
+ {
4105
+ style: input,
4106
+ type: "password",
4107
+ value: password,
4108
+ onChange: (e) => setPassword(e.target.value),
4109
+ required: true
4110
+ }
4111
+ ), /* @__PURE__ */ React2.createElement("div", { style: { marginTop: 12 } }, /* @__PURE__ */ React2.createElement("button", { style: button, type: "submit", disabled: loading }, loading ? "Signing in\u2026" : "Sign in")), /* @__PURE__ */ React2.createElement("div", { style: { display: "flex", gap: 8, marginTop: 16 } }, /* @__PURE__ */ React2.createElement("button", { type: "button", onClick: handleGoogle, style: oauthButtonGoogle, disabled: loading }, "Continue with Google"), /* @__PURE__ */ React2.createElement("button", { type: "button", onClick: handleGithub, style: oauthButtonGithub, disabled: loading }, "Continue with GitHub")), error && /* @__PURE__ */ React2.createElement("div", { style: errorBox }, error), message && /* @__PURE__ */ React2.createElement("div", { style: successBox }, message))));
4112
+ }
4113
+ var overlay = { position: "fixed", inset: 0, display: "flex", alignItems: "center", justifyContent: "center", background: "rgba(0,0,0,0.45)", zIndex: 9999, padding: 20 };
4114
+ var modal = { width: "100%", maxWidth: 420, background: "#0f1724", color: "#fff", borderRadius: 12, padding: 22, boxShadow: "0 10px 30px rgba(2,6,23,0.6)", border: "1px solid rgba(255,255,255,0.04)" };
4115
+ var title = { margin: 0, fontSize: 20, fontWeight: 600 };
4116
+ var subtitle = { marginTop: 6, marginBottom: 14, color: "#cbd5e1", fontSize: 13 };
4117
+ var label = { display: "block", color: "#cbd5e1", fontSize: 13, marginTop: 8 };
4118
+ var input = { width: "100%", padding: "10px 12px", marginTop: 6, borderRadius: 8, border: "1px solid rgba(255,255,255,0.06)", background: "#0b1220", color: "#fff", boxSizing: "border-box" };
4119
+ var button = { width: "100%", padding: "10px 12px", borderRadius: 8, background: "linear-gradient(90deg,#06b6d4,#2563eb)", color: "#0b1220", border: "none", fontWeight: 700, cursor: "pointer" };
4120
+ var oauthButtonGoogle = { flex: 1, padding: "10px 12px", borderRadius: 8, background: "#db4437", color: "#fff", border: "none", cursor: "pointer" };
4121
+ var oauthButtonGithub = { flex: 1, padding: "10px 12px", borderRadius: 8, background: "#24292f", color: "#fff", border: "none", cursor: "pointer" };
4122
+ var errorBox = { marginTop: 10, color: "#ffb4b4", fontSize: 13 };
4123
+ var successBox = { marginTop: 10, color: "#bef264", fontSize: 13 };
4124
+
4125
+ // src/SignUp.jsx
4126
+ var import_link = __toESM(require_link2(), 1);
4127
+ import React3, { useState as useState3, useRef as useRef2, useEffect as useEffect2 } from "react";
4128
+ function SignUp({ agency = { name: "MyApp", logo: "" } }) {
4129
+ const {
4130
+ publishableKey,
4131
+ baseUrl,
4132
+ redirect,
4133
+ redirectTo,
4134
+ user,
4135
+ loadingUser,
4136
+ fetchMe,
4137
+ setUser
4138
+ } = (typeof useAuth === "function" ? useAuth() : {}) || {};
4139
+ const [name, setName] = useState3("");
4140
+ const [email, setEmail] = useState3("");
4141
+ const [password, setPassword] = useState3("");
4142
+ const [loading, setLoading] = useState3(false);
4143
+ const [loadingOauth, setLoadingOauth] = useState3({ google: false, github: false });
4144
+ const redirectTimer = useRef2(null);
4145
+ const toastId = useRef2(0);
4146
+ const [toasts, setToasts] = useState3([]);
4147
+ useEffect2(() => {
4148
+ const meta = document.createElement("meta");
4149
+ meta.name = "viewport";
4150
+ meta.content = "width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no";
4151
+ document.head.appendChild(meta);
4152
+ return () => {
4153
+ if (redirectTimer.current) clearTimeout(redirectTimer.current);
4154
+ const existing = document.querySelector('meta[name="viewport"]');
4155
+ if (existing && existing.content === meta.content) {
4156
+ document.head.removeChild(existing);
4157
+ }
4158
+ toasts.forEach((t) => {
4159
+ if (t._timer) clearTimeout(t._timer);
4160
+ });
4161
+ };
4162
+ }, []);
4163
+ function showToast(type, message, ms = 5e3) {
4164
+ const id = ++toastId.current;
4165
+ const t = { id, type, message, _timer: null };
4166
+ setToasts((prev) => [t, ...prev].slice(0, 6));
4167
+ const timer = setTimeout(() => {
4168
+ setToasts((prev) => prev.filter((x) => x.id !== id));
4169
+ }, ms);
4170
+ t._timer = timer;
4171
+ }
4172
+ function removeToast(id) {
4173
+ setToasts((prev) => {
4174
+ prev.forEach((t) => {
4175
+ if (t.id === id && t._timer) clearTimeout(t._timer);
4176
+ });
4177
+ return prev.filter((x) => x.id !== id);
4178
+ });
4179
+ }
4180
+ if (loadingUser) return null;
4181
+ if (user && redirect) {
4182
+ if (typeof redirectTo === "function") redirectTo(redirect);
4183
+ else if (typeof window !== "undefined") window.location.assign(redirect);
4184
+ return null;
4185
+ }
4186
+ async function submit(e) {
4187
+ e.preventDefault();
4188
+ if (loading) return;
4189
+ setLoading(true);
4190
+ if (!name.trim()) {
4191
+ showToast("error", "Please enter your name.");
4192
+ setLoading(false);
4193
+ return;
4194
+ }
4195
+ if (!email.includes("@")) {
4196
+ showToast("error", "Please enter a valid email address.");
4197
+ setLoading(false);
4198
+ return;
4199
+ }
4200
+ if (password.length < 8) {
4201
+ showToast("error", "Password must be at least 8 characters.");
4202
+ setLoading(false);
4203
+ return;
4204
+ }
4205
+ const url = `${(baseUrl || "").replace(/\/+$/, "")}/api/sdk/signup`;
4206
+ try {
4207
+ const res = await fetch(url, {
4208
+ method: "POST",
4209
+ credentials: "include",
4210
+ headers: {
4211
+ "Content-Type": "application/json",
4212
+ "x-publishable-key": publishableKey || ""
4213
+ },
4214
+ body: JSON.stringify({ name: name.trim(), email: email.trim(), password })
4215
+ });
4216
+ const data = await res.json().catch(async () => {
4217
+ const txt = await res.text().catch(() => "");
4218
+ return { _raw: txt };
4219
+ });
4220
+ if (!res.ok) {
4221
+ const errMsg = data?.error || data?._raw || `Signup failed (${res.status})`;
4222
+ throw new Error(errMsg);
4223
+ }
4224
+ if (data.user && typeof setUser === "function") setUser(data.user);
4225
+ if (typeof fetchMe === "function") await fetchMe();
4226
+ showToast("success", "Account created. Redirecting\u2026");
4227
+ if (redirect) {
4228
+ redirectTimer.current = setTimeout(() => {
4229
+ if (typeof redirectTo === "function") redirectTo(redirect);
4230
+ else if (typeof window !== "undefined") window.location.assign(redirect);
4231
+ }, 450);
4232
+ }
4233
+ } catch (err) {
4234
+ const text = err?.message ?? "Network error";
4235
+ showToast("error", text);
4236
+ console.error("Signup error:", err);
4237
+ } finally {
4238
+ setLoading(false);
4239
+ }
4240
+ }
4241
+ async function startOAuthFlow(provider) {
4242
+ if (loading || loadingOauth[provider]) return;
4243
+ setLoadingOauth((prev) => ({ ...prev, [provider]: true }));
4244
+ try {
4245
+ const rid = typeof crypto !== "undefined" && typeof crypto.randomUUID === "function" ? crypto.randomUUID() : `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
4246
+ const callbackUrl = encodeURIComponent(`${typeof window !== "undefined" ? window.location.origin : ""}/signup`);
4247
+ const sdkBase = baseUrl || (typeof window !== "undefined" ? window.location.origin.replace(/\/+$/, "") : "");
4248
+ const startUrl = `${sdkBase}/sdk/auth/start?rid=${rid}&source=${encodeURIComponent(provider)}&callbackUrl=${callbackUrl}`;
4249
+ if (!publishableKey) throw new Error("Missing publishable key (client side).");
4250
+ const res = await fetch(startUrl, {
4251
+ method: "GET",
4252
+ headers: { "x-publishable-key": publishableKey }
4253
+ });
4254
+ const data = await res.json().catch(() => null);
4255
+ if (!res.ok) throw new Error(data?.error || `OAuth start failed (${res.status})`);
4256
+ if (!data?.oauthUrl) throw new Error("SDK start did not return oauthUrl");
4257
+ if (typeof window !== "undefined") window.location.href = data.oauthUrl;
4258
+ } catch (err) {
4259
+ showToast("error", err?.message || "OAuth start failed");
4260
+ console.error("OAuth start error:", err);
4261
+ setLoadingOauth((prev) => ({ ...prev, [provider]: false }));
4262
+ }
4263
+ }
4264
+ const handleGoogle = (e) => {
4265
+ if (e && typeof e.preventDefault === "function") e.preventDefault();
4266
+ startOAuthFlow("google");
4267
+ };
4268
+ const handleGithub = (e) => {
4269
+ if (e && typeof e.preventDefault === "function") e.preventDefault();
4270
+ startOAuthFlow("github");
4271
+ };
4272
+ return /* @__PURE__ */ React3.createElement("div", { style: styles.overlay }, /* @__PURE__ */ React3.createElement("div", { style: styles.toastContainer, "aria-live": "polite", "aria-atomic": "true" }, toasts.map((t) => /* @__PURE__ */ React3.createElement(
4273
+ "div",
4274
+ {
4275
+ key: t.id,
4276
+ role: "status",
4277
+ style: {
4278
+ ...styles.toastBase,
4279
+ ...t.type === "error" ? styles.toastError : t.type === "success" ? styles.toastSuccess : styles.toastInfo
4280
+ },
4281
+ onMouseEnter: () => {
4282
+ if (t._timer) clearTimeout(t._timer);
4283
+ },
4284
+ onMouseLeave: () => {
4285
+ const timer = setTimeout(() => removeToast(t.id), 3e3);
4286
+ setToasts((prev) => prev.map((x) => x.id === t.id ? { ...x, _timer: timer } : x));
4287
+ }
4288
+ },
4289
+ /* @__PURE__ */ React3.createElement("div", { style: { flex: 1 } }, t.message),
4290
+ /* @__PURE__ */ React3.createElement("button", { "aria-label": "Dismiss", onClick: () => removeToast(t.id), style: styles.toastCloseBtn }, "\u2715")
4291
+ ))), /* @__PURE__ */ React3.createElement("div", { style: styles.modal, role: "dialog", "aria-modal": "true", "aria-labelledby": "signup-title" }, /* @__PURE__ */ React3.createElement("div", { style: styles.modalInner }, /* @__PURE__ */ React3.createElement("header", { style: styles.header }, /* @__PURE__ */ React3.createElement("div", { style: styles.brandRow }, /* @__PURE__ */ React3.createElement("div", { style: styles.logo, "aria-hidden": true }, /* @__PURE__ */ React3.createElement("div", { style: styles.logoCircle })), /* @__PURE__ */ React3.createElement("div", null, /* @__PURE__ */ React3.createElement("h1", { id: "signup-title", style: styles.title }, "Sign up to ", agency?.name || "App"), /* @__PURE__ */ React3.createElement("div", { style: styles.subtitle }, "Welcome \u2014 create your account.")))), /* @__PURE__ */ React3.createElement("section", { style: styles.oauthSection }, /* @__PURE__ */ React3.createElement(
4292
+ "button",
4293
+ {
4294
+ onClick: handleGoogle,
4295
+ type: "button",
4296
+ style: { ...styles.oauthButton, ...styles.oauthGoogle },
4297
+ disabled: loading || loadingOauth.google,
4298
+ "aria-disabled": loading || loadingOauth.google
4299
+ },
4300
+ /* @__PURE__ */ React3.createElement("svg", { width: 18, style: { marginRight: 10 }, viewBox: "-3 0 262 262", xmlns: "http://www.w3.org/2000/svg", fill: "#000000", "aria-hidden": true }, /* @__PURE__ */ React3.createElement("path", { d: "M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622 38.755 30.023 2.685.268c24.659-22.774 38.875-56.282 38.875-96.027", fill: "#4285F4" }), /* @__PURE__ */ React3.createElement("path", { d: "M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055-34.523 0-63.824-22.773-74.269-54.25l-1.531.13-40.298 31.187-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1", fill: "#34A853" }), /* @__PURE__ */ React3.createElement("path", { d: "M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82 0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602l42.356-32.782", fill: "#FBBC05" }), /* @__PURE__ */ React3.createElement("path", { d: "M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0 79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251", fill: "#EB4335" })),
4301
+ /* @__PURE__ */ React3.createElement("span", null, loadingOauth.google ? "Loading..." : "Continue with Google")
4302
+ ), /* @__PURE__ */ React3.createElement(
4303
+ "button",
4304
+ {
4305
+ onClick: handleGithub,
4306
+ type: "button",
4307
+ style: { ...styles.oauthButton, ...styles.oauthGithub },
4308
+ disabled: loading || loadingOauth.github,
4309
+ "aria-disabled": loading || loadingOauth.github
4310
+ },
4311
+ /* @__PURE__ */ React3.createElement("svg", { width: 18, style: { marginRight: 10 }, xmlns: "http://www.w3.org/2000/svg", fill: "white", viewBox: "0 0 20 20", "aria-hidden": true }, /* @__PURE__ */ React3.createElement("path", { fillRule: "evenodd", d: "M10 .333A9.911 9.911 0 0 0 6.866 19.65c.5.092.678-.215.678-.477 0-.237-.01-1.017-.014-1.845-2.757.6-3.338-1.169-3.338-1.169a2.627 2.627 0 0 0-1.1-1.451c-.9-.615.07-.6.07-.6a2.084 2.084 0 0 1 1.518 1.021 2.11 2.11 0 0 0 2.884.823c.044-.503.268-.973.63-1.325-2.2-.25-4.516-1.1-4.516-4.9A3.832 3.832 0 0 1 4.7 7.068a3.56 3.56 0 0 1 .095-2.623s.832-.266 2.726 1.016a9.409 9.409 0 0 1 4.962 0c1.89-1.282 2.717-1.016 2.717-1.016.366.83.402 1.768.1 2.623a3.827 3.827 0 0 1 1.02 2.659c0 3.807-2.319 4.644-4.525 4.889a2.366 2.366 0 0 1 .673 1.834c0 1.326-.012 2.394-.012 2.72 0 .263.18.572.681.475A9.911 9.911 0 0 0 10 .333Z", clipRule: "evenodd" })),
4312
+ /* @__PURE__ */ React3.createElement("span", null, loadingOauth.github ? "Loading..." : "Continue with GitHub")
4313
+ )), /* @__PURE__ */ React3.createElement("div", { style: styles.dividerRow }, /* @__PURE__ */ React3.createElement("div", { style: styles.line }), /* @__PURE__ */ React3.createElement("div", { style: styles.orText }, "or"), /* @__PURE__ */ React3.createElement("div", { style: styles.line })), /* @__PURE__ */ React3.createElement("form", { onSubmit: submit, style: styles.form }, /* @__PURE__ */ React3.createElement("label", { style: styles.label, htmlFor: "name" }, /* @__PURE__ */ React3.createElement("span", { style: styles.labelText }, "Name"), /* @__PURE__ */ React3.createElement(
4314
+ "input",
4315
+ {
4316
+ id: "name",
4317
+ type: "text",
4318
+ value: name,
4319
+ onChange: (e) => setName(e.target.value),
4320
+ placeholder: "Your name",
4321
+ style: styles.input,
4322
+ autoComplete: "name"
4323
+ }
4324
+ )), /* @__PURE__ */ React3.createElement("label", { style: styles.label, htmlFor: "email" }, /* @__PURE__ */ React3.createElement("span", { style: styles.labelText }, "Email address"), /* @__PURE__ */ React3.createElement(
4325
+ "input",
4326
+ {
4327
+ id: "email",
4328
+ type: "email",
4329
+ value: email,
4330
+ onChange: (e) => setEmail(e.target.value),
4331
+ required: true,
4332
+ placeholder: "you@example.com",
4333
+ style: styles.input,
4334
+ autoComplete: "email"
4335
+ }
4336
+ )), /* @__PURE__ */ React3.createElement("label", { style: styles.label, htmlFor: "password" }, /* @__PURE__ */ React3.createElement("span", { style: styles.labelText }, "Password"), /* @__PURE__ */ React3.createElement(
4337
+ "input",
4338
+ {
4339
+ id: "password",
4340
+ type: "password",
4341
+ value: password,
4342
+ onChange: (e) => setPassword(e.target.value),
4343
+ required: true,
4344
+ placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",
4345
+ style: styles.input,
4346
+ autoComplete: "new-password"
4347
+ }
4348
+ )), /* @__PURE__ */ React3.createElement(
4349
+ "button",
4350
+ {
4351
+ type: "submit",
4352
+ style: styles.submitButton,
4353
+ disabled: loading,
4354
+ "aria-disabled": loading
4355
+ },
4356
+ loading ? "Signing up..." : "Sign Up"
4357
+ ))), /* @__PURE__ */ React3.createElement("div", { style: styles.modalFooter }, /* @__PURE__ */ React3.createElement("div", { style: styles.belowRow }, /* @__PURE__ */ React3.createElement("span", { style: styles.muted }, "Already have an account? "), /* @__PURE__ */ React3.createElement(import_link.default, { href: "/sign-in", style: styles.link }, "Sign in")), /* @__PURE__ */ React3.createElement("div", { style: styles.dividerThin }), /* @__PURE__ */ React3.createElement("div", { style: styles.secured }, /* @__PURE__ */ React3.createElement("div", { style: styles.securedText }, "Secured by auth")))));
4358
+ }
4359
+ var styles = {
4360
+ overlay: {
4361
+ position: "fixed",
4362
+ inset: 0,
4363
+ display: "block",
4364
+ // use block + scrolling container for zoom resilience
4365
+ padding: 20,
4366
+ background: "linear-gradient(180deg, rgba(2,6,23,0.22), rgba(2,6,23,0.32))",
4367
+ backdropFilter: "blur(6px)",
4368
+ overflowY: "auto",
4369
+ // allow page scroll when zoomed
4370
+ WebkitOverflowScrolling: "touch",
4371
+ minHeight: "100vh",
4372
+ zIndex: 9999
4373
+ },
4374
+ // modal: reduced width (not too wide), centered with margin auto, allows internal scroll
4375
+ modal: {
4376
+ width: "100%",
4377
+ maxWidth: 460,
4378
+ // reduced width per request
4379
+ margin: "40px auto",
4380
+ // vertical margin so modal isn't glued to top when zoomed
4381
+ borderRadius: 14,
4382
+ background: "linear-gradient(180deg, rgba(15,19,24,0.85), rgba(10,12,16,0.85))",
4383
+ // translucent neutral
4384
+ border: "1px solid rgba(99,102,106,0.12)",
4385
+ // visible neutral border
4386
+ boxShadow: "0 18px 48px rgba(2,6,23,0.55), inset 0 1px 0 rgba(255,255,255,0.02)",
4387
+ overflow: "hidden",
4388
+ display: "flex",
4389
+ flexDirection: "column",
4390
+ maxHeight: "calc(100vh - 80px)"
4391
+ // keep inside viewport
4392
+ },
4393
+ modalInner: {
4394
+ padding: 18,
4395
+ display: "flex",
4396
+ flexDirection: "column",
4397
+ gap: 12,
4398
+ overflowY: "auto"
4399
+ },
4400
+ header: {
4401
+ paddingBottom: 6,
4402
+ borderBottom: "1px solid rgba(148,163,184,0.04)"
4403
+ },
4404
+ brandRow: {
4405
+ display: "flex",
4406
+ alignItems: "center",
4407
+ gap: 12
4408
+ },
4409
+ logo: {
4410
+ width: 44,
4411
+ height: 44,
4412
+ display: "flex",
4413
+ alignItems: "center",
4414
+ justifyContent: "center"
4415
+ },
4416
+ logoCircle: {
4417
+ width: 36,
4418
+ height: 36,
4419
+ borderRadius: 999,
4420
+ background: "linear-gradient(135deg,#2f3438,#11151a)",
4421
+ boxShadow: "0 4px 12px rgba(2,6,23,0.6)"
4422
+ },
4423
+ title: {
4424
+ margin: 0,
4425
+ fontSize: 18,
4426
+ fontWeight: 600,
4427
+ color: "#e6e6e6"
4428
+ },
4429
+ subtitle: {
4430
+ fontSize: 13,
4431
+ color: "rgba(230,230,230,0.72)",
4432
+ marginTop: 4
4433
+ },
4434
+ oauthSection: {
4435
+ marginTop: 8,
4436
+ display: "flex",
4437
+ gap: 8
4438
+ },
4439
+ oauthButton: {
4440
+ flex: 1,
4441
+ display: "inline-flex",
4442
+ alignItems: "center",
4443
+ justifyContent: "center",
4444
+ padding: "10px 12px",
4445
+ borderRadius: 10,
4446
+ border: "1px solid rgba(148,163,184,0.08)",
4447
+ fontSize: 14,
4448
+ cursor: "pointer",
4449
+ userSelect: "none",
4450
+ gap: 8,
4451
+ minHeight: 40,
4452
+ background: "transparent",
4453
+ color: "#fff"
4454
+ },
4455
+ oauthGoogle: {
4456
+ background: "linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01))"
4457
+ },
4458
+ oauthGithub: {
4459
+ background: "linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.00))"
4460
+ },
4461
+ dividerRow: {
4462
+ display: "flex",
4463
+ alignItems: "center",
4464
+ gap: 10,
4465
+ marginTop: 12
4466
+ },
4467
+ line: {
4468
+ flex: 1,
4469
+ height: 1,
4470
+ background: "rgba(148,163,184,0.06)"
4471
+ },
4472
+ orText: {
4473
+ fontSize: 13,
4474
+ color: "rgba(230,230,230,0.65)",
4475
+ padding: "0 8px"
4476
+ },
4477
+ form: {
4478
+ display: "flex",
4479
+ flexDirection: "column",
4480
+ gap: 10,
4481
+ marginTop: 6
4482
+ },
4483
+ label: {
4484
+ display: "flex",
4485
+ flexDirection: "column",
4486
+ gap: 6
4487
+ },
4488
+ labelText: {
4489
+ fontSize: 13,
4490
+ color: "rgba(230,230,230,0.68)"
4491
+ },
4492
+ input: {
4493
+ width: "100%",
4494
+ padding: "10px 12px",
4495
+ borderRadius: 10,
4496
+ background: "rgba(255,255,255,0.02)",
4497
+ color: "#e6e6e6",
4498
+ border: "1px solid rgba(148,163,184,0.10)",
4499
+ fontSize: 14,
4500
+ outline: "none",
4501
+ boxSizing: "border-box",
4502
+ transition: "box-shadow 120ms, border-color 120ms"
4503
+ },
4504
+ submitButton: {
4505
+ marginTop: 6,
4506
+ width: "100%",
4507
+ padding: "10px 12px",
4508
+ borderRadius: 10,
4509
+ background: "linear-gradient(180deg,#475569,#94a3b8)",
4510
+ border: "none",
4511
+ color: "#fff",
4512
+ fontWeight: 600,
4513
+ cursor: "pointer",
4514
+ fontSize: 15,
4515
+ display: "inline-flex",
4516
+ alignItems: "center",
4517
+ justifyContent: "center",
4518
+ minHeight: 44
4519
+ },
4520
+ modalFooter: {
4521
+ padding: "12px 18px 18px 18px",
4522
+ borderTop: "1px solid rgba(148,163,184,0.03)",
4523
+ display: "flex",
4524
+ flexDirection: "column",
4525
+ gap: 8
4526
+ },
4527
+ belowRow: {
4528
+ textAlign: "center",
4529
+ display: "flex",
4530
+ justifyContent: "center",
4531
+ gap: 8,
4532
+ alignItems: "center"
4533
+ },
4534
+ muted: {
4535
+ color: "rgba(230,230,230,0.66)",
4536
+ fontSize: 13
4537
+ },
4538
+ link: {
4539
+ color: "#9fb0d9",
4540
+ textDecoration: "none",
4541
+ fontWeight: 600
4542
+ },
4543
+ dividerThin: {
4544
+ height: 1,
4545
+ background: "rgba(148,163,184,0.04)",
4546
+ marginTop: 6,
4547
+ marginBottom: 6
4548
+ },
4549
+ secured: {
4550
+ textAlign: "center"
4551
+ },
4552
+ securedText: {
4553
+ color: "rgba(230,230,230,0.9)",
4554
+ fontSize: 13,
4555
+ fontWeight: 600
4556
+ },
4557
+ /* Toasts: black background */
4558
+ toastContainer: {
4559
+ position: "fixed",
4560
+ top: 18,
4561
+ right: 18,
4562
+ width: 360,
4563
+ maxWidth: "calc(100% - 36px)",
4564
+ display: "flex",
4565
+ flexDirection: "column",
4566
+ gap: 10,
4567
+ zIndex: 6e4
4568
+ },
4569
+ toastBase: {
4570
+ display: "flex",
4571
+ gap: 10,
4572
+ alignItems: "center",
4573
+ padding: "10px 12px",
4574
+ borderRadius: 10,
4575
+ boxShadow: "0 8px 20px rgba(2,6,23,0.6)",
4576
+ color: "#fff",
4577
+ fontSize: 13,
4578
+ minWidth: 120
4579
+ },
4580
+ toastError: {
4581
+ background: "#000000",
4582
+ border: "1px solid rgba(255,255,255,0.06)"
4583
+ },
4584
+ toastSuccess: {
4585
+ background: "#000000",
4586
+ border: "1px solid rgba(255,255,255,0.06)"
4587
+ },
4588
+ toastInfo: {
4589
+ background: "#000000",
4590
+ border: "1px solid rgba(255,255,255,0.06)"
4591
+ },
4592
+ toastCloseBtn: {
4593
+ marginLeft: 8,
4594
+ background: "transparent",
4595
+ border: "none",
4596
+ color: "rgba(255,255,255,0.7)",
4597
+ cursor: "pointer",
4598
+ fontSize: 14,
4599
+ lineHeight: 1
4600
+ }
4601
+ };
5
4602
  export {
6
- default2 as FlowlinkAuthProvider,
7
- default3 as SignIn,
8
- default4 as SignUp,
4603
+ provider_default as FlowlinkAuthProvider,
4604
+ SignIn,
4605
+ SignUp,
9
4606
  useAuth
10
4607
  };