@netlify/plugin-nextjs 4.40.0 → 4.40.2

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 (164) hide show
  1. package/lib/helpers/edge.js +4 -2
  2. package/lib/templates/getHandler.js +1 -2
  3. package/lib/templates/handlerUtils.js +14 -1
  4. package/lib/templates/server.js +9 -8
  5. package/lib/templates/vendor.js +20 -0
  6. package/package.json +7 -4
  7. package/src/templates/edge/next-dev.js +3 -3
  8. package/src/templates/edge/shims.js +6 -6
  9. package/src/templates/edge-shared/next-utils.ts +3 -3
  10. package/src/templates/edge-shared/utils.ts +1 -1
  11. package/src/templates/vendor/deno.land/std@0.134.0/fmt/colors.ts +536 -0
  12. package/src/templates/vendor/deno.land/std@0.134.0/testing/_diff.ts +360 -0
  13. package/src/templates/vendor/deno.land/std@0.134.0/testing/asserts.ts +866 -0
  14. package/src/templates/vendor/deno.land/std@0.175.0/_util/asserts.ts +25 -0
  15. package/src/templates/vendor/deno.land/std@0.175.0/_util/os.ts +23 -0
  16. package/src/templates/vendor/deno.land/std@0.175.0/async/abortable.ts +149 -0
  17. package/src/templates/vendor/deno.land/std@0.175.0/async/deadline.ts +30 -0
  18. package/src/templates/vendor/deno.land/std@0.175.0/async/debounce.ts +79 -0
  19. package/src/templates/vendor/deno.land/std@0.175.0/async/deferred.ts +48 -0
  20. package/src/templates/vendor/deno.land/std@0.175.0/async/delay.ts +67 -0
  21. package/src/templates/vendor/deno.land/std@0.175.0/async/mod.ts +18 -0
  22. package/src/templates/vendor/deno.land/std@0.175.0/async/mux_async_iterator.ts +97 -0
  23. package/src/templates/vendor/deno.land/std@0.175.0/async/pool.ts +95 -0
  24. package/src/templates/vendor/deno.land/std@0.175.0/async/retry.ts +81 -0
  25. package/src/templates/vendor/deno.land/std@0.175.0/async/tee.ts +100 -0
  26. package/src/templates/vendor/deno.land/std@0.175.0/bytes/index_of_needle.ts +49 -0
  27. package/src/templates/vendor/deno.land/std@0.175.0/crypto/timing_safe_equal.ts +29 -0
  28. package/src/templates/vendor/deno.land/std@0.175.0/datetime/to_imf.ts +45 -0
  29. package/src/templates/vendor/deno.land/std@0.175.0/encoding/base64.ts +144 -0
  30. package/src/templates/vendor/deno.land/std@0.175.0/encoding/base64url.ts +70 -0
  31. package/src/templates/vendor/deno.land/std@0.175.0/flags/mod.ts +785 -0
  32. package/src/templates/vendor/deno.land/std@0.175.0/fmt/colors.ts +569 -0
  33. package/src/templates/vendor/deno.land/std@0.175.0/fmt/printf.ts +939 -0
  34. package/src/templates/vendor/deno.land/std@0.175.0/http/cookie.ts +403 -0
  35. package/src/templates/vendor/deno.land/std@0.175.0/node/_core.ts +77 -0
  36. package/src/templates/vendor/deno.land/std@0.175.0/node/_events.d.ts +848 -0
  37. package/src/templates/vendor/deno.land/std@0.175.0/node/_events.mjs +1033 -0
  38. package/src/templates/vendor/deno.land/std@0.175.0/node/_global.d.ts +66 -0
  39. package/src/templates/vendor/deno.land/std@0.175.0/node/_next_tick.ts +173 -0
  40. package/src/templates/vendor/deno.land/std@0.175.0/node/_process/exiting.ts +4 -0
  41. package/src/templates/vendor/deno.land/std@0.175.0/node/_process/process.ts +131 -0
  42. package/src/templates/vendor/deno.land/std@0.175.0/node/_process/stdio.mjs +7 -0
  43. package/src/templates/vendor/deno.land/std@0.175.0/node/_process/streams.mjs +146 -0
  44. package/src/templates/vendor/deno.land/std@0.175.0/node/_stream.d.ts +1488 -0
  45. package/src/templates/vendor/deno.land/std@0.175.0/node/_stream.mjs +746 -0
  46. package/src/templates/vendor/deno.land/std@0.175.0/node/_util/_util_callbackify.ts +129 -0
  47. package/src/templates/vendor/deno.land/std@0.175.0/node/_utils.ts +206 -0
  48. package/src/templates/vendor/deno.land/std@0.175.0/node/assert.ts +940 -0
  49. package/src/templates/vendor/deno.land/std@0.175.0/node/assertion_error.ts +579 -0
  50. package/src/templates/vendor/deno.land/std@0.175.0/node/async_hooks.ts +331 -0
  51. package/src/templates/vendor/deno.land/std@0.175.0/node/buffer.ts +13 -0
  52. package/src/templates/vendor/deno.land/std@0.175.0/node/events.ts +14 -0
  53. package/src/templates/vendor/deno.land/std@0.175.0/node/internal/buffer.d.ts +2074 -0
  54. package/src/templates/vendor/deno.land/std@0.175.0/node/internal/buffer.mjs +2607 -0
  55. package/src/templates/vendor/deno.land/std@0.175.0/node/internal/crypto/_keys.ts +16 -0
  56. package/src/templates/vendor/deno.land/std@0.175.0/node/internal/crypto/constants.ts +5 -0
  57. package/src/templates/vendor/deno.land/std@0.175.0/node/internal/error_codes.ts +7 -0
  58. package/src/templates/vendor/deno.land/std@0.175.0/node/internal/errors.ts +2867 -0
  59. package/src/templates/vendor/deno.land/std@0.175.0/node/internal/fixed_queue.ts +123 -0
  60. package/src/templates/vendor/deno.land/std@0.175.0/node/internal/hide_stack_frames.ts +16 -0
  61. package/src/templates/vendor/deno.land/std@0.175.0/node/internal/net.ts +95 -0
  62. package/src/templates/vendor/deno.land/std@0.175.0/node/internal/normalize_encoding.mjs +72 -0
  63. package/src/templates/vendor/deno.land/std@0.175.0/node/internal/options.ts +45 -0
  64. package/src/templates/vendor/deno.land/std@0.175.0/node/internal/primordials.mjs +30 -0
  65. package/src/templates/vendor/deno.land/std@0.175.0/node/internal/process/per_thread.mjs +272 -0
  66. package/src/templates/vendor/deno.land/std@0.175.0/node/internal/readline/callbacks.mjs +137 -0
  67. package/src/templates/vendor/deno.land/std@0.175.0/node/internal/readline/utils.mjs +580 -0
  68. package/src/templates/vendor/deno.land/std@0.175.0/node/internal/streams/destroy.mjs +320 -0
  69. package/src/templates/vendor/deno.land/std@0.175.0/node/internal/streams/end-of-stream.mjs +229 -0
  70. package/src/templates/vendor/deno.land/std@0.175.0/node/internal/streams/utils.mjs +242 -0
  71. package/src/templates/vendor/deno.land/std@0.175.0/node/internal/util/comparisons.ts +669 -0
  72. package/src/templates/vendor/deno.land/std@0.175.0/node/internal/util/debuglog.ts +118 -0
  73. package/src/templates/vendor/deno.land/std@0.175.0/node/internal/util/inspect.mjs +2237 -0
  74. package/src/templates/vendor/deno.land/std@0.175.0/node/internal/util/types.ts +113 -0
  75. package/src/templates/vendor/deno.land/std@0.175.0/node/internal/util.mjs +143 -0
  76. package/src/templates/vendor/deno.land/std@0.175.0/node/internal/validators.mjs +317 -0
  77. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/_libuv_winerror.ts +229 -0
  78. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/_listen.ts +16 -0
  79. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/_node.ts +18 -0
  80. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/_timingSafeEqual.ts +12 -0
  81. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/_utils.ts +86 -0
  82. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/_winerror.ts +16873 -0
  83. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/ares.ts +66 -0
  84. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/async_wrap.ts +152 -0
  85. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/buffer.ts +130 -0
  86. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/cares_wrap.ts +541 -0
  87. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/config.ts +3 -0
  88. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/connection_wrap.ts +80 -0
  89. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/constants.ts +900 -0
  90. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/contextify.ts +3 -0
  91. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/credentials.ts +3 -0
  92. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/crypto.ts +14 -0
  93. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/errors.ts +3 -0
  94. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/fs.ts +3 -0
  95. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/fs_dir.ts +3 -0
  96. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/fs_event_wrap.ts +3 -0
  97. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/handle_wrap.ts +50 -0
  98. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/heap_utils.ts +3 -0
  99. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/http_parser.ts +3 -0
  100. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/icu.ts +3 -0
  101. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/inspector.ts +3 -0
  102. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/js_stream.ts +3 -0
  103. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/messaging.ts +3 -0
  104. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/mod.ts +108 -0
  105. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/module_wrap.ts +3 -0
  106. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/native_module.ts +3 -0
  107. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/natives.ts +3 -0
  108. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/node_file.ts +84 -0
  109. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/node_options.ts +39 -0
  110. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/options.ts +3 -0
  111. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/os.ts +3 -0
  112. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/performance.ts +3 -0
  113. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/pipe_wrap.ts +392 -0
  114. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/process_methods.ts +3 -0
  115. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/report.ts +3 -0
  116. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/serdes.ts +3 -0
  117. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/signal_wrap.ts +3 -0
  118. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/spawn_sync.ts +3 -0
  119. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/stream_wrap.ts +354 -0
  120. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/string_decoder.ts +15 -0
  121. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/symbols.ts +27 -0
  122. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/task_queue.ts +3 -0
  123. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/tcp_wrap.ts +488 -0
  124. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/timers.ts +3 -0
  125. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/tls_wrap.ts +3 -0
  126. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/trace_events.ts +3 -0
  127. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/tty_wrap.ts +3 -0
  128. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/types.ts +186 -0
  129. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/udp_wrap.ts +496 -0
  130. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/url.ts +3 -0
  131. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/util.ts +126 -0
  132. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/uv.ts +437 -0
  133. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/v8.ts +3 -0
  134. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/worker.ts +3 -0
  135. package/src/templates/vendor/deno.land/std@0.175.0/node/internal_binding/zlib.ts +3 -0
  136. package/src/templates/vendor/deno.land/std@0.175.0/node/process.ts +705 -0
  137. package/src/templates/vendor/deno.land/std@0.175.0/node/stream.ts +37 -0
  138. package/src/templates/vendor/deno.land/std@0.175.0/node/string_decoder.ts +337 -0
  139. package/src/templates/vendor/deno.land/std@0.175.0/node/util/types.ts +4 -0
  140. package/src/templates/vendor/deno.land/std@0.175.0/node/util.ts +289 -0
  141. package/src/templates/vendor/deno.land/std@0.175.0/path/_constants.ts +49 -0
  142. package/src/templates/vendor/deno.land/std@0.175.0/path/_interface.ts +30 -0
  143. package/src/templates/vendor/deno.land/std@0.175.0/path/_util.ts +194 -0
  144. package/src/templates/vendor/deno.land/std@0.175.0/path/common.ts +40 -0
  145. package/src/templates/vendor/deno.land/std@0.175.0/path/glob.ts +418 -0
  146. package/src/templates/vendor/deno.land/std@0.175.0/path/mod.ts +53 -0
  147. package/src/templates/vendor/deno.land/std@0.175.0/path/posix.ts +487 -0
  148. package/src/templates/vendor/deno.land/std@0.175.0/path/separator.ts +7 -0
  149. package/src/templates/vendor/deno.land/std@0.175.0/path/win32.ts +962 -0
  150. package/src/templates/vendor/deno.land/std@0.175.0/streams/write_all.ts +64 -0
  151. package/src/templates/vendor/deno.land/std@0.175.0/testing/_diff.ts +440 -0
  152. package/src/templates/vendor/deno.land/std@0.175.0/testing/_format.ts +23 -0
  153. package/src/templates/vendor/deno.land/std@0.175.0/testing/asserts.ts +906 -0
  154. package/src/templates/vendor/deno.land/std@0.175.0/types.d.ts +89 -0
  155. package/src/templates/vendor/deno.land/x/html_rewriter@v0.1.0-pre.17/index.ts +133 -0
  156. package/src/templates/vendor/deno.land/x/html_rewriter@v0.1.0-pre.17/vendor/asyncify.js +112 -0
  157. package/src/templates/vendor/deno.land/x/html_rewriter@v0.1.0-pre.17/vendor/html_rewriter.d.ts +88 -0
  158. package/src/templates/vendor/deno.land/x/html_rewriter@v0.1.0-pre.17/vendor/html_rewriter.js +974 -0
  159. package/src/templates/vendor/deno.land/x/path_to_regexp@v6.2.1/index.ts +621 -0
  160. package/src/templates/vendor/esm.sh/v91/next@12.2.5/deno/dist/compiled/cookie.js +13 -0
  161. package/src/templates/vendor/esm.sh/v91/next@12.2.5/deno/dist/server/web/spec-extension/request.js +12 -0
  162. package/src/templates/vendor/esm.sh/v91/next@12.2.5/deno/dist/server/web/spec-extension/response.js +5 -0
  163. package/src/templates/vendor/import_map.json +13 -0
  164. package/src/templates/vendor/raw.githubusercontent.com/worker-tools/resolvable-promise/master/index.ts +50 -0
@@ -0,0 +1,621 @@
1
+ /**
2
+ * Tokenizer results.
3
+ */
4
+ interface LexToken {
5
+ type:
6
+ | "OPEN"
7
+ | "CLOSE"
8
+ | "PATTERN"
9
+ | "NAME"
10
+ | "CHAR"
11
+ | "ESCAPED_CHAR"
12
+ | "MODIFIER"
13
+ | "END";
14
+ index: number;
15
+ value: string;
16
+ }
17
+
18
+ /**
19
+ * Tokenize input string.
20
+ */
21
+ function lexer(str: string): LexToken[] {
22
+ const tokens: LexToken[] = [];
23
+ let i = 0;
24
+
25
+ while (i < str.length) {
26
+ const char = str[i];
27
+
28
+ if (char === "*" || char === "+" || char === "?") {
29
+ tokens.push({ type: "MODIFIER", index: i, value: str[i++] });
30
+ continue;
31
+ }
32
+
33
+ if (char === "\\") {
34
+ tokens.push({ type: "ESCAPED_CHAR", index: i++, value: str[i++] });
35
+ continue;
36
+ }
37
+
38
+ if (char === "{") {
39
+ tokens.push({ type: "OPEN", index: i, value: str[i++] });
40
+ continue;
41
+ }
42
+
43
+ if (char === "}") {
44
+ tokens.push({ type: "CLOSE", index: i, value: str[i++] });
45
+ continue;
46
+ }
47
+
48
+ if (char === ":") {
49
+ let name = "";
50
+ let j = i + 1;
51
+
52
+ while (j < str.length) {
53
+ const code = str.charCodeAt(j);
54
+
55
+ if (
56
+ // `0-9`
57
+ (code >= 48 && code <= 57) ||
58
+ // `A-Z`
59
+ (code >= 65 && code <= 90) ||
60
+ // `a-z`
61
+ (code >= 97 && code <= 122) ||
62
+ // `_`
63
+ code === 95
64
+ ) {
65
+ name += str[j++];
66
+ continue;
67
+ }
68
+
69
+ break;
70
+ }
71
+
72
+ if (!name) throw new TypeError(`Missing parameter name at ${i}`);
73
+
74
+ tokens.push({ type: "NAME", index: i, value: name });
75
+ i = j;
76
+ continue;
77
+ }
78
+
79
+ if (char === "(") {
80
+ let count = 1;
81
+ let pattern = "";
82
+ let j = i + 1;
83
+
84
+ if (str[j] === "?") {
85
+ throw new TypeError(`Pattern cannot start with "?" at ${j}`);
86
+ }
87
+
88
+ while (j < str.length) {
89
+ if (str[j] === "\\") {
90
+ pattern += str[j++] + str[j++];
91
+ continue;
92
+ }
93
+
94
+ if (str[j] === ")") {
95
+ count--;
96
+ if (count === 0) {
97
+ j++;
98
+ break;
99
+ }
100
+ } else if (str[j] === "(") {
101
+ count++;
102
+ if (str[j + 1] !== "?") {
103
+ throw new TypeError(`Capturing groups are not allowed at ${j}`);
104
+ }
105
+ }
106
+
107
+ pattern += str[j++];
108
+ }
109
+
110
+ if (count) throw new TypeError(`Unbalanced pattern at ${i}`);
111
+ if (!pattern) throw new TypeError(`Missing pattern at ${i}`);
112
+
113
+ tokens.push({ type: "PATTERN", index: i, value: pattern });
114
+ i = j;
115
+ continue;
116
+ }
117
+
118
+ tokens.push({ type: "CHAR", index: i, value: str[i++] });
119
+ }
120
+
121
+ tokens.push({ type: "END", index: i, value: "" });
122
+
123
+ return tokens;
124
+ }
125
+
126
+ export interface ParseOptions {
127
+ /**
128
+ * Set the default delimiter for repeat parameters. (default: `'/'`)
129
+ */
130
+ delimiter?: string;
131
+ /**
132
+ * List of characters to automatically consider prefixes when parsing.
133
+ */
134
+ prefixes?: string;
135
+ }
136
+
137
+ /**
138
+ * Parse a string for the raw tokens.
139
+ */
140
+ export function parse(str: string, options: ParseOptions = {}): Token[] {
141
+ const tokens = lexer(str);
142
+ const { prefixes = "./" } = options;
143
+ const defaultPattern = `[^${escapeString(options.delimiter || "/#?")}]+?`;
144
+ const result: Token[] = [];
145
+ let key = 0;
146
+ let i = 0;
147
+ let path = "";
148
+
149
+ const tryConsume = (type: LexToken["type"]): string | undefined => {
150
+ if (i < tokens.length && tokens[i].type === type) return tokens[i++].value;
151
+ };
152
+
153
+ const mustConsume = (type: LexToken["type"]): string => {
154
+ const value = tryConsume(type);
155
+ if (value !== undefined) return value;
156
+ const { type: nextType, index } = tokens[i];
157
+ throw new TypeError(`Unexpected ${nextType} at ${index}, expected ${type}`);
158
+ };
159
+
160
+ const consumeText = (): string => {
161
+ let result = "";
162
+ let value: string | undefined;
163
+ while ((value = tryConsume("CHAR") || tryConsume("ESCAPED_CHAR"))) {
164
+ result += value;
165
+ }
166
+ return result;
167
+ };
168
+
169
+ while (i < tokens.length) {
170
+ const char = tryConsume("CHAR");
171
+ const name = tryConsume("NAME");
172
+ const pattern = tryConsume("PATTERN");
173
+
174
+ if (name || pattern) {
175
+ let prefix = char || "";
176
+
177
+ if (prefixes.indexOf(prefix) === -1) {
178
+ path += prefix;
179
+ prefix = "";
180
+ }
181
+
182
+ if (path) {
183
+ result.push(path);
184
+ path = "";
185
+ }
186
+
187
+ result.push({
188
+ name: name || key++,
189
+ prefix,
190
+ suffix: "",
191
+ pattern: pattern || defaultPattern,
192
+ modifier: tryConsume("MODIFIER") || "",
193
+ });
194
+ continue;
195
+ }
196
+
197
+ const value = char || tryConsume("ESCAPED_CHAR");
198
+ if (value) {
199
+ path += value;
200
+ continue;
201
+ }
202
+
203
+ if (path) {
204
+ result.push(path);
205
+ path = "";
206
+ }
207
+
208
+ const open = tryConsume("OPEN");
209
+ if (open) {
210
+ const prefix = consumeText();
211
+ const name = tryConsume("NAME") || "";
212
+ const pattern = tryConsume("PATTERN") || "";
213
+ const suffix = consumeText();
214
+
215
+ mustConsume("CLOSE");
216
+
217
+ result.push({
218
+ name: name || (pattern ? key++ : ""),
219
+ pattern: name && !pattern ? defaultPattern : pattern,
220
+ prefix,
221
+ suffix,
222
+ modifier: tryConsume("MODIFIER") || "",
223
+ });
224
+ continue;
225
+ }
226
+
227
+ mustConsume("END");
228
+ }
229
+
230
+ return result;
231
+ }
232
+
233
+ export interface TokensToFunctionOptions {
234
+ /**
235
+ * When `true` the regexp will be case sensitive. (default: `false`)
236
+ */
237
+ sensitive?: boolean;
238
+ /**
239
+ * Function for encoding input strings for output.
240
+ */
241
+ encode?: (value: string, token: Key) => string;
242
+ /**
243
+ * When `false` the function can produce an invalid (unmatched) path. (default: `true`)
244
+ */
245
+ validate?: boolean;
246
+ }
247
+
248
+ /**
249
+ * Compile a string to a template function for the path.
250
+ */
251
+ export function compile<P extends object = object>(
252
+ str: string,
253
+ options?: ParseOptions & TokensToFunctionOptions
254
+ ) {
255
+ return tokensToFunction<P>(parse(str, options), options);
256
+ }
257
+
258
+ export type PathFunction<P extends object = object> = (data?: P) => string;
259
+
260
+ /**
261
+ * Expose a method for transforming tokens into the path function.
262
+ */
263
+ export function tokensToFunction<P extends object = object>(
264
+ tokens: Token[],
265
+ options: TokensToFunctionOptions = {}
266
+ ): PathFunction<P> {
267
+ const reFlags = flags(options);
268
+ const { encode = (x: string) => x, validate = true } = options;
269
+
270
+ // Compile all the tokens into regexps.
271
+ const matches = tokens.map((token) => {
272
+ if (typeof token === "object") {
273
+ return new RegExp(`^(?:${token.pattern})$`, reFlags);
274
+ }
275
+ });
276
+
277
+ return (data: Record<string, any> | null | undefined) => {
278
+ let path = "";
279
+
280
+ for (let i = 0; i < tokens.length; i++) {
281
+ const token = tokens[i];
282
+
283
+ if (typeof token === "string") {
284
+ path += token;
285
+ continue;
286
+ }
287
+
288
+ const value = data ? data[token.name] : undefined;
289
+ const optional = token.modifier === "?" || token.modifier === "*";
290
+ const repeat = token.modifier === "*" || token.modifier === "+";
291
+
292
+ if (Array.isArray(value)) {
293
+ if (!repeat) {
294
+ throw new TypeError(
295
+ `Expected "${token.name}" to not repeat, but got an array`
296
+ );
297
+ }
298
+
299
+ if (value.length === 0) {
300
+ if (optional) continue;
301
+
302
+ throw new TypeError(`Expected "${token.name}" to not be empty`);
303
+ }
304
+
305
+ for (let j = 0; j < value.length; j++) {
306
+ const segment = encode(value[j], token);
307
+
308
+ if (validate && !(matches[i] as RegExp).test(segment)) {
309
+ throw new TypeError(
310
+ `Expected all "${token.name}" to match "${token.pattern}", but got "${segment}"`
311
+ );
312
+ }
313
+
314
+ path += token.prefix + segment + token.suffix;
315
+ }
316
+
317
+ continue;
318
+ }
319
+
320
+ if (typeof value === "string" || typeof value === "number") {
321
+ const segment = encode(String(value), token);
322
+
323
+ if (validate && !(matches[i] as RegExp).test(segment)) {
324
+ throw new TypeError(
325
+ `Expected "${token.name}" to match "${token.pattern}", but got "${segment}"`
326
+ );
327
+ }
328
+
329
+ path += token.prefix + segment + token.suffix;
330
+ continue;
331
+ }
332
+
333
+ if (optional) continue;
334
+
335
+ const typeOfMessage = repeat ? "an array" : "a string";
336
+ throw new TypeError(`Expected "${token.name}" to be ${typeOfMessage}`);
337
+ }
338
+
339
+ return path;
340
+ };
341
+ }
342
+
343
+ export interface RegexpToFunctionOptions {
344
+ /**
345
+ * Function for decoding strings for params.
346
+ */
347
+ decode?: (value: string, token: Key) => string;
348
+ }
349
+
350
+ /**
351
+ * A match result contains data about the path match.
352
+ */
353
+ export interface MatchResult<P extends object = object> {
354
+ path: string;
355
+ index: number;
356
+ params: P;
357
+ }
358
+
359
+ /**
360
+ * A match is either `false` (no match) or a match result.
361
+ */
362
+ export type Match<P extends object = object> = false | MatchResult<P>;
363
+
364
+ /**
365
+ * The match function takes a string and returns whether it matched the path.
366
+ */
367
+ export type MatchFunction<P extends object = object> = (
368
+ path: string
369
+ ) => Match<P>;
370
+
371
+ /**
372
+ * Create path match function from `path-to-regexp` spec.
373
+ */
374
+ export function match<P extends object = object>(
375
+ str: Path,
376
+ options?: ParseOptions & TokensToRegexpOptions & RegexpToFunctionOptions
377
+ ) {
378
+ const keys: Key[] = [];
379
+ const re = pathToRegexp(str, keys, options);
380
+ return regexpToFunction<P>(re, keys, options);
381
+ }
382
+
383
+ /**
384
+ * Create a path match function from `path-to-regexp` output.
385
+ */
386
+ export function regexpToFunction<P extends object = object>(
387
+ re: RegExp,
388
+ keys: Key[],
389
+ options: RegexpToFunctionOptions = {}
390
+ ): MatchFunction<P> {
391
+ const { decode = (x: string) => x } = options;
392
+
393
+ return function (pathname: string) {
394
+ const m = re.exec(pathname);
395
+ if (!m) return false;
396
+
397
+ const { 0: path, index } = m;
398
+ const params = Object.create(null);
399
+
400
+ for (let i = 1; i < m.length; i++) {
401
+ if (m[i] === undefined) continue;
402
+
403
+ const key = keys[i - 1];
404
+
405
+ if (key.modifier === "*" || key.modifier === "+") {
406
+ params[key.name] = m[i].split(key.prefix + key.suffix).map((value) => {
407
+ return decode(value, key);
408
+ });
409
+ } else {
410
+ params[key.name] = decode(m[i], key);
411
+ }
412
+ }
413
+
414
+ return { path, index, params };
415
+ };
416
+ }
417
+
418
+ /**
419
+ * Escape a regular expression string.
420
+ */
421
+ function escapeString(str: string) {
422
+ return str.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1");
423
+ }
424
+
425
+ /**
426
+ * Get the flags for a regexp from the options.
427
+ */
428
+ function flags(options?: { sensitive?: boolean }) {
429
+ return options && options.sensitive ? "" : "i";
430
+ }
431
+
432
+ /**
433
+ * Metadata about a key.
434
+ */
435
+ export interface Key {
436
+ name: string | number;
437
+ prefix: string;
438
+ suffix: string;
439
+ pattern: string;
440
+ modifier: string;
441
+ }
442
+
443
+ /**
444
+ * A token is a string (nothing special) or key metadata (capture group).
445
+ */
446
+ export type Token = string | Key;
447
+
448
+ /**
449
+ * Pull out keys from a regexp.
450
+ */
451
+ function regexpToRegexp(path: RegExp, keys?: Key[]): RegExp {
452
+ if (!keys) return path;
453
+
454
+ const groupsRegex = /\((?:\?<(.*?)>)?(?!\?)/g;
455
+
456
+ let index = 0;
457
+ let execResult = groupsRegex.exec(path.source);
458
+ while (execResult) {
459
+ keys.push({
460
+ // Use parenthesized substring match if available, index otherwise
461
+ name: execResult[1] || index++,
462
+ prefix: "",
463
+ suffix: "",
464
+ modifier: "",
465
+ pattern: "",
466
+ });
467
+ execResult = groupsRegex.exec(path.source);
468
+ }
469
+
470
+ return path;
471
+ }
472
+
473
+ /**
474
+ * Transform an array into a regexp.
475
+ */
476
+ function arrayToRegexp(
477
+ paths: Array<string | RegExp>,
478
+ keys?: Key[],
479
+ options?: TokensToRegexpOptions & ParseOptions
480
+ ): RegExp {
481
+ const parts = paths.map((path) => pathToRegexp(path, keys, options).source);
482
+ return new RegExp(`(?:${parts.join("|")})`, flags(options));
483
+ }
484
+
485
+ /**
486
+ * Create a path regexp from string input.
487
+ */
488
+ function stringToRegexp(
489
+ path: string,
490
+ keys?: Key[],
491
+ options?: TokensToRegexpOptions & ParseOptions
492
+ ) {
493
+ return tokensToRegexp(parse(path, options), keys, options);
494
+ }
495
+
496
+ export interface TokensToRegexpOptions {
497
+ /**
498
+ * When `true` the regexp will be case sensitive. (default: `false`)
499
+ */
500
+ sensitive?: boolean;
501
+ /**
502
+ * When `true` the regexp won't allow an optional trailing delimiter to match. (default: `false`)
503
+ */
504
+ strict?: boolean;
505
+ /**
506
+ * When `true` the regexp will match to the end of the string. (default: `true`)
507
+ */
508
+ end?: boolean;
509
+ /**
510
+ * When `true` the regexp will match from the beginning of the string. (default: `true`)
511
+ */
512
+ start?: boolean;
513
+ /**
514
+ * Sets the final character for non-ending optimistic matches. (default: `/`)
515
+ */
516
+ delimiter?: string;
517
+ /**
518
+ * List of characters that can also be "end" characters.
519
+ */
520
+ endsWith?: string;
521
+ /**
522
+ * Encode path tokens for use in the `RegExp`.
523
+ */
524
+ encode?: (value: string) => string;
525
+ }
526
+
527
+ /**
528
+ * Expose a function for taking tokens and returning a RegExp.
529
+ */
530
+ export function tokensToRegexp(
531
+ tokens: Token[],
532
+ keys?: Key[],
533
+ options: TokensToRegexpOptions = {}
534
+ ) {
535
+ const {
536
+ strict = false,
537
+ start = true,
538
+ end = true,
539
+ encode = (x: string) => x,
540
+ delimiter = "/#?",
541
+ endsWith = "",
542
+ } = options;
543
+ const endsWithRe = `[${escapeString(endsWith)}]|$`;
544
+ const delimiterRe = `[${escapeString(delimiter)}]`;
545
+ let route = start ? "^" : "";
546
+
547
+ // Iterate over the tokens and create our regexp string.
548
+ for (const token of tokens) {
549
+ if (typeof token === "string") {
550
+ route += escapeString(encode(token));
551
+ } else {
552
+ const prefix = escapeString(encode(token.prefix));
553
+ const suffix = escapeString(encode(token.suffix));
554
+
555
+ if (token.pattern) {
556
+ if (keys) keys.push(token);
557
+
558
+ if (prefix || suffix) {
559
+ if (token.modifier === "+" || token.modifier === "*") {
560
+ const mod = token.modifier === "*" ? "?" : "";
561
+ route += `(?:${prefix}((?:${token.pattern})(?:${suffix}${prefix}(?:${token.pattern}))*)${suffix})${mod}`;
562
+ } else {
563
+ route += `(?:${prefix}(${token.pattern})${suffix})${token.modifier}`;
564
+ }
565
+ } else {
566
+ if (token.modifier === "+" || token.modifier === "*") {
567
+ route += `((?:${token.pattern})${token.modifier})`;
568
+ } else {
569
+ route += `(${token.pattern})${token.modifier}`;
570
+ }
571
+ }
572
+ } else {
573
+ route += `(?:${prefix}${suffix})${token.modifier}`;
574
+ }
575
+ }
576
+ }
577
+
578
+ if (end) {
579
+ if (!strict) route += `${delimiterRe}?`;
580
+
581
+ route += !options.endsWith ? "$" : `(?=${endsWithRe})`;
582
+ } else {
583
+ const endToken = tokens[tokens.length - 1];
584
+ const isEndDelimited =
585
+ typeof endToken === "string"
586
+ ? delimiterRe.indexOf(endToken[endToken.length - 1]) > -1
587
+ : endToken === undefined;
588
+
589
+ if (!strict) {
590
+ route += `(?:${delimiterRe}(?=${endsWithRe}))?`;
591
+ }
592
+
593
+ if (!isEndDelimited) {
594
+ route += `(?=${delimiterRe}|${endsWithRe})`;
595
+ }
596
+ }
597
+
598
+ return new RegExp(route, flags(options));
599
+ }
600
+
601
+ /**
602
+ * Supported `path-to-regexp` input types.
603
+ */
604
+ export type Path = string | RegExp | Array<string | RegExp>;
605
+
606
+ /**
607
+ * Normalize the given path string, returning a regular expression.
608
+ *
609
+ * An empty array can be passed in for the keys, which will hold the
610
+ * placeholder key descriptions. For example, using `/user/:id`, `keys` will
611
+ * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
612
+ */
613
+ export function pathToRegexp(
614
+ path: Path,
615
+ keys?: Key[],
616
+ options?: TokensToRegexpOptions & ParseOptions
617
+ ) {
618
+ if (path instanceof RegExp) return regexpToRegexp(path, keys);
619
+ if (Array.isArray(path)) return arrayToRegexp(path, keys, options);
620
+ return stringToRegexp(path, keys, options);
621
+ }
@@ -0,0 +1,13 @@
1
+ /* esm.sh - esbuild bundle(next@12.2.5/dist/compiled/cookie) deno production */
2
+ var A=Object.create;var S=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var O=Object.getPrototypeOf,q=Object.prototype.hasOwnProperty;var z=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),D=(i,e)=>{for(var a in e)S(i,a,{get:e[a],enumerable:!0})},y=(i,e,a,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of N(e))!q.call(i,s)&&s!==a&&S(i,s,{get:()=>e[s],enumerable:!(l=U(e,s))||l.enumerable});return i},u=(i,e,a)=>(y(i,e,"default"),a&&y(a,e,"default")),g=(i,e,a)=>(a=i!=null?A(O(i)):{},y(e||!i||!i.__esModule?S(a,"default",{value:i,enumerable:!0}):a,i));var _=z((F,T)=>{(()=>{"use strict";typeof __nccwpck_require__<"u"&&(__nccwpck_require__.ab="/_virtual/esm.sh/v91/next@12.2.5/deno/dist/compiled/");var i={};(()=>{var e=i;e.parse=b,e.serialize=k;var a=decodeURIComponent,l=encodeURIComponent,s=/; */,w=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function b(n,d){if(typeof n!="string")throw new TypeError("argument str must be a string");for(var f={},r=d||{},m=n.split(s),c=r.decode||a,t=0;t<m.length;t++){var o=m[t],v=o.indexOf("=");if(!(v<0)){var x=o.substr(0,v).trim(),h=o.substr(++v,o.length).trim();h[0]=='"'&&(h=h.slice(1,-1)),f[x]==null&&(f[x]=C(h,c))}}return f}function k(n,d,f){var r=f||{},m=r.encode||l;if(typeof m!="function")throw new TypeError("option encode is invalid");if(!w.test(n))throw new TypeError("argument name is invalid");var c=m(d);if(c&&!w.test(c))throw new TypeError("argument val is invalid");var t=n+"="+c;if(r.maxAge!=null){var o=r.maxAge-0;if(isNaN(o)||!isFinite(o))throw new TypeError("option maxAge is invalid");t+="; Max-Age="+Math.floor(o)}if(r.domain){if(!w.test(r.domain))throw new TypeError("option domain is invalid");t+="; Domain="+r.domain}if(r.path){if(!w.test(r.path))throw new TypeError("option path is invalid");t+="; Path="+r.path}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");t+="; Expires="+r.expires.toUTCString()}if(r.httpOnly&&(t+="; HttpOnly"),r.secure&&(t+="; Secure"),r.sameSite){var v=typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite;switch(v){case!0:t+="; SameSite=Strict";break;case"lax":t+="; SameSite=Lax";break;case"strict":t+="; SameSite=Strict";break;case"none":t+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return t}function C(n,d){try{return d(n)}catch{return n}}})(),T.exports=i})()});var p={};D(p,{default:()=>M});var I=g(_());u(p,g(_()));var{default:E,...L}=I,M=E!==void 0?E:L;export{M as default};
3
+ /*! Bundled license information:
4
+
5
+ next/dist/compiled/cookie/index.js:
6
+ (*!
7
+ * cookie
8
+ * Copyright(c) 2012-2014 Roman Shtylman
9
+ * Copyright(c) 2015 Douglas Christopher Wilson
10
+ * MIT Licensed
11
+ *)
12
+ */
13
+ //# sourceMappingURL=cookie.js.map
@@ -0,0 +1,12 @@
1
+ /* esm.sh - esbuild bundle(next@12.2.5/dist/server/web/spec-extension/request) deno production */
2
+ import * as __0$ from "/v91/next@12.2.5/deno/dist/compiled/cookie.js";
3
+ var require=n=>{const e=m=>typeof m.default<"u"?m.default:m,c=m=>Object.assign({},m);switch(n){case"next/dist/compiled/cookie":return e(__0$);default:throw new Error("module \""+n+"\" not found");}};
4
+ var xe=Object.create;var w=Object.defineProperty;var _e=Object.getOwnPropertyDescriptor;var be=Object.getOwnPropertyNames;var ye=Object.getPrototypeOf,Le=Object.prototype.hasOwnProperty;var we=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var l=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),je=(t,e)=>{for(var r in e)w(t,r,{get:e[r],enumerable:!0})},L=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of be(e))!Le.call(t,i)&&i!==r&&w(t,i,{get:()=>e[i],enumerable:!(s=_e(e,i))||s.enumerable});return t},c=(t,e,r)=>(L(t,e,"default"),r&&L(r,e,"default")),G=(t,e,r)=>(r=t!=null?xe(ye(t)):{},L(e||!t||!t.__esModule?w(r,"default",{value:t,enumerable:!0}):r,t));var Q=l(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.detectDomainLocale=qe;function qe(t,e,r){let s;if(t){r&&(r=r.toLowerCase());for(let o of t){var i,n;let u=(i=o.domain)==null?void 0:i.split(":")[0].toLowerCase();if(e===u||r===o.defaultLocale.toLowerCase()||(n=o.locales)!=null&&n.some(h=>h.toLowerCase()===r)){s=o;break}}}return s}});var V=l(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.removeTrailingSlash=Ce;function Ce(t){return t.replace(/\/$/,"")||"/"}});var v=l(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.parsePath=Ie;function Ie(t){let e=t.indexOf("#"),r=t.indexOf("?"),s=r>-1&&(e<0||r<e);return s||e>-1?{pathname:t.substring(0,s?r:e),query:s?t.substring(r,e>-1?e:void 0):"",hash:e>-1?t.slice(e):""}:{pathname:t,query:"",hash:""}}});var S=l(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.addPathPrefix=Ne;var Se=v();function Ne(t,e){if(!t.startsWith("/")||!e)return t;let{pathname:r,query:s,hash:i}=Se.parsePath(t);return`${e}${r}${s}${i}`}});var X=l(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.addPathSuffix=$e;var Re=v();function $e(t,e){if(!t.startsWith("/")||!e)return t;let{pathname:r,query:s,hash:i}=Re.parsePath(t);return`${r}${e}${s}${i}`}});var x=l(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.pathHasPrefix=ke;var Oe=v();function ke(t,e){if(typeof t!="string")return!1;let{pathname:r}=Oe.parsePath(t);return r===e||r.startsWith(e+"/")}});var K=l($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.addLocale=He;var Ae=S(),B=x();function He(t,e,r,s){return e&&e!==r&&(s||!B.pathHasPrefix(t.toLowerCase(),`/${e.toLowerCase()}`)&&!B.pathHasPrefix(t.toLowerCase(),"/api"))?Ae.addPathPrefix(t,`/${e}`):t}});var ee=l(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.formatNextPathnameInfo=Ee;var Ue=V(),Y=S(),Z=X(),Me=K();function Ee(t){let e=Me.addLocale(t.pathname,t.locale,t.buildId?void 0:t.defaultLocale,t.ignorePrefix);return t.buildId&&(e=Z.addPathSuffix(Y.addPathPrefix(e,`/_next/data/${t.buildId}`),t.pathname==="/"?"index.json":".json")),e=Y.addPathPrefix(e,t.basePath),t.trailingSlash?!t.buildId&&!e.endsWith("/")?Z.addPathSuffix(e,"/"):e:Ue.removeTrailingSlash(e)}});var te=l(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.getHostname=Te;function Te(t,e){var r;return(r=!Array.isArray(e?.host)&&e?.host||t.hostname)==null?void 0:r.split(":")[0].toLowerCase()}});var re=l(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.normalizeLocalePath=ze;function ze(t,e){let r,s=t.split("/");return(e||[]).some(i=>s[1]&&s[1].toLowerCase()===i.toLowerCase()?(r=i,s.splice(1,1),t=s.join("/")||"/",!0):!1),{pathname:t,detectedLocale:r}}});var se=l(H=>{"use strict";Object.defineProperty(H,"__esModule",{value:!0});H.removePathPrefix=De;var We=x();function De(t,e){if(We.pathHasPrefix(t,e)){let r=t.slice(e.length);return r.startsWith("/")?r:`/${r}`}return t}});var ae=l(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.getNextPathnameInfo=Qe;var Je=re(),Fe=se(),Ge=x();function Qe(t,e){var r;let{basePath:s,i18n:i,trailingSlash:n}=(r=e.nextConfig)!=null?r:{},o={pathname:t,trailingSlash:t!=="/"?t.endsWith("/"):n};if(s&&Ge.pathHasPrefix(o.pathname,s)&&(o.pathname=Fe.removePathPrefix(o.pathname,s),o.basePath=s),e.parseData===!0&&o.pathname.startsWith("/_next/data/")&&o.pathname.endsWith(".json")){let u=o.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/"),h=u[0];o.pathname=u[1]!=="index"?`/${u.slice(1).join("/")}`:"/",o.buildId=h}if(i){let u=Je.normalizeLocalePath(o.pathname,i.locales);o.locale=u?.detectedLocale,o.pathname=u?.pathname||o.pathname}return o}});var ne=l(E=>{"use strict";Object.defineProperty(E,"__esModule",{value:!0});var Ve=Q(),Xe=ee(),Be=te(),Ke=ae(),a=Symbol("NextURLInternal"),M=class t{constructor(e,r,s){let i,n;typeof r=="object"&&"pathname"in r||typeof r=="string"?(i=r,n=s||{}):n=s||r||{},this[a]={url:oe(e,i??n.base),options:n,basePath:""},this.analyzeUrl()}analyzeUrl(){var e,r,s,i,n;let o=Ke.getNextPathnameInfo(this[a].url.pathname,{nextConfig:this[a].options.nextConfig,parseData:!0});this[a].domainLocale=Ve.detectDomainLocale((e=this[a].options.nextConfig)==null||(r=e.i18n)==null?void 0:r.domains,Be.getHostname(this[a].url,this[a].options.headers));let u=((s=this[a].domainLocale)==null?void 0:s.defaultLocale)||((i=this[a].options.nextConfig)==null||(n=i.i18n)==null?void 0:n.defaultLocale);this[a].url.pathname=o.pathname,this[a].defaultLocale=u;var h;this[a].basePath=(h=o.basePath)!=null?h:"",this[a].buildId=o.buildId;var P;this[a].locale=(P=o.locale)!=null?P:u,this[a].trailingSlash=o.trailingSlash}formatPathname(){return Xe.formatNextPathnameInfo({basePath:this[a].basePath,buildId:this[a].buildId,defaultLocale:this[a].options.forceLocale?void 0:this[a].defaultLocale,locale:this[a].locale,pathname:this[a].url.pathname,trailingSlash:this[a].trailingSlash})}get buildId(){return this[a].buildId}set buildId(e){this[a].buildId=e}get locale(){var e;return(e=this[a].locale)!=null?e:""}set locale(e){var r,s;if(!this[a].locale||!(!((r=this[a].options.nextConfig)==null||(s=r.i18n)==null)&&s.locales.includes(e)))throw new TypeError(`The NextURL configuration includes no locale "${e}"`);this[a].locale=e}get defaultLocale(){return this[a].defaultLocale}get domainLocale(){return this[a].domainLocale}get searchParams(){return this[a].url.searchParams}get host(){return this[a].url.host}set host(e){this[a].url.host=e}get hostname(){return this[a].url.hostname}set hostname(e){this[a].url.hostname=e}get port(){return this[a].url.port}set port(e){this[a].url.port=e}get protocol(){return this[a].url.protocol}set protocol(e){this[a].url.protocol=e}get href(){let e=this.formatPathname();return`${this.protocol}//${this.host}${e}${this[a].url.search}`}set href(e){this[a].url=oe(e),this.analyzeUrl()}get origin(){return this[a].url.origin}get pathname(){return this[a].url.pathname}set pathname(e){this[a].url.pathname=e}get hash(){return this[a].url.hash}set hash(e){this[a].url.hash=e}get search(){return this[a].url.search}set search(e){this[a].url.search=e}get password(){return this[a].url.password}set password(e){this[a].url.password=e}get username(){return this[a].url.username}set username(e){this[a].url.username=e}get basePath(){return this[a].basePath}set basePath(e){this[a].basePath=e.startsWith("/")?e:`/${e}`}toString(){return this.href}toJSON(){return this.href}[Symbol.for("edge-runtime.inspect.custom")](){return{href:this.href,origin:this.origin,protocol:this.protocol,username:this.username,password:this.password,host:this.host,hostname:this.hostname,port:this.port,pathname:this.pathname,search:this.search,searchParams:this.searchParams,hash:this.hash}}clone(){return new t(String(this),this[a].options)}};E.NextURL=M;var ie=/(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|::1|localhost)/;function oe(t,e){return new URL(String(t).replace(ie,"localhost"),e&&String(e).replace(ie,"localhost"))}});var le=l(p=>{"use strict";Object.defineProperty(p,"__esModule",{value:!0});p.fromNodeHeaders=Ye;p.toNodeHeaders=Ze;p.splitCookiesString=ue;p.validateURL=et;function Ye(t){let e=new Headers;for(let[r,s]of Object.entries(t)){let i=Array.isArray(s)?s:[s];for(let n of i)n!==void 0&&e.append(r,n)}return e}function Ze(t){let e={};if(t)for(let[r,s]of t.entries())e[r]=s,r.toLowerCase()==="set-cookie"&&(e[r]=ue(s));return e}function ue(t){var e=[],r=0,s,i,n,o,u;function h(){for(;r<t.length&&/\s/.test(t.charAt(r));)r+=1;return r<t.length}function P(){return i=t.charAt(r),i!=="="&&i!==";"&&i!==","}for(;r<t.length;){for(s=r,u=!1;h();)if(i=t.charAt(r),i===","){for(n=r,r+=1,h(),o=r;r<t.length&&P();)r+=1;r<t.length&&t.charAt(r)==="="?(u=!0,r=o,e.push(t.substring(s,n)),s=r):r=n+1}else r+=1;(!u||r>=t.length)&&e.push(t.substring(s,t.length))}return e}function et(t){try{return String(new URL(String(t)))}catch(e){throw new Error("URLs is malformed. Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls",{cause:e})}}});var he=l(m=>{"use strict";Object.defineProperty(m,"__esModule",{value:!0});var T=class extends Error{constructor({page:e}){super(`The middleware "${e}" accepts an async API directly with the form:
5
+
6
+ export function middleware(request, event) {
7
+ return NextResponse.redirect('/new-location')
8
+ }
9
+
10
+ Read more: https://nextjs.org/docs/messages/middleware-new-signature
11
+ `)}};m.PageSignatureError=T;var z=class extends Error{constructor(){super("The request.page has been deprecated in favour of `URLPattern`.\n Read more: https://nextjs.org/docs/messages/middleware-request-page\n ")}};m.RemovedPageError=z;var W=class extends Error{constructor(){super("The request.ua has been removed in favour of `userAgent` function.\n Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent\n ")}};m.RemovedUAError=W});var pe=l(y=>{"use strict";Object.defineProperty(y,"__esModule",{value:!0});var _=tt(we("next/dist/compiled/cookie"));function tt(t){return t&&t.__esModule?t:{default:t}}var rt=t=>(t=Object.assign({},t),t.maxAge&&(t.expires=new Date(Date.now()+t.maxAge*1e3)),t.path==null&&(t.path="/"),t),st=t=>typeof t=="object"?`j:${JSON.stringify(t)}`:String(t),de=(t,e={})=>_.default.serialize(t,"",{expires:new Date(0),path:"/",...e}),ce=t=>{let e=t.headers.get("set-cookie");return e!=null?e.split(", "):[]},fe=t=>t.join(", "),b=class extends Map{constructor(e){let r=typeof e=="string"?_.default.parse(e):{};super(Object.entries(r))}set(e,r,s={}){return super.set(e,_.default.serialize(e,st(r),rt(s)))}[Symbol.for("edge-runtime.inspect.custom")](){return Object.fromEntries(this.entries())}};y.Cookies=b;var D=class extends b{constructor(e){super(e.headers.get("cookie")),this.response=e}get=(...e)=>this.getWithOptions(...e).value;getWithOptions=(...e)=>{let r=super.get(...e);if(typeof r!="string")return{value:r,options:{}};let{[e[0]]:s,...i}=_.default.parse(r);return{value:s,options:i}};set=(...e)=>{let r=super.has(e[0]);super.set(...e);let s=super.get(e[0]);if(typeof s!="string")throw new Error(`Invariant: failed to generate cookie for ${JSON.stringify(e)}`);if(r){let i=fe(ce(this.response).filter(n=>!n.startsWith(`${e[0]}=`)));i?this.response.headers.set("set-cookie",[s,i].join(", ")):this.response.headers.set("set-cookie",s)}else this.response.headers.append("set-cookie",s);return this};delete=(e,r={})=>{let s=super.delete(e);if(s){let i=fe(ce(this.response).filter(o=>!o.startsWith(`${e}=`))),n=de(e,r);this.response.headers.set("set-cookie",[n,i].join(", "))}return s};clear=(e={})=>{let r=Array.from(super.keys()).map(s=>de(s,e)).join(", ");return r&&this.response.headers.set("set-cookie",r),super.clear()}};y.NextCookies=D});var F=l(g=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});g.INTERNALS=void 0;var at=ne(),me=le(),ge=he(),it=pe(),f=Symbol("internal request");g.INTERNALS=f;var J=class extends Request{constructor(e,r={}){let s=typeof e!="string"&&"url"in e?e.url:String(e);me.validateURL(s),super(s,r),this[f]={cookies:new it.NextCookies(this),geo:r.geo||{},ip:r.ip,url:new at.NextURL(s,{headers:me.toNodeHeaders(this.headers),nextConfig:r.nextConfig})}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,geo:this.geo,ip:this.ip,nextUrl:this.nextUrl,url:this.url,bodyUsed:this.bodyUsed,cache:this.cache,credentials:this.credentials,destination:this.destination,headers:Object.fromEntries(this.headers),integrity:this.integrity,keepalive:this.keepalive,method:this.method,mode:this.mode,redirect:this.redirect,referrer:this.referrer,referrerPolicy:this.referrerPolicy,signal:this.signal}}get cookies(){return this[f].cookies}get geo(){return this[f].geo}get ip(){return this[f].ip}get nextUrl(){return this[f].url}get page(){throw new ge.RemovedPageError}get ua(){throw new ge.RemovedUAError}get url(){return this[f].url.toString()}};g.NextRequest=J});var d={};je(d,{INTERNALS:()=>nt,NextRequest:()=>ut,__esModule:()=>ot,default:()=>ht});var ve=G(F());c(d,G(F()));var{__esModule:ot,INTERNALS:nt,NextRequest:ut}=ve,{default:Pe,...lt}=ve,ht=Pe!==void 0?Pe:lt;export{nt as INTERNALS,ut as NextRequest,ot as __esModule,ht as default};
12
+ //# sourceMappingURL=request.js.map