@netlify/plugin-nextjs 4.40.2 → 4.41.0-alpha-isr-blobs.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 (30) hide show
  1. package/lib/constants.js +1 -0
  2. package/lib/helpers/files.js +34 -6
  3. package/lib/helpers/functions.js +3 -0
  4. package/lib/index.js +12 -1
  5. package/lib/templates/blob.js +341 -0
  6. package/lib/templates/blobStorage.js +31 -0
  7. package/lib/templates/getHandler.js +28 -8
  8. package/lib/templates/handlerUtils.js +46 -26
  9. package/lib/templates/server.js +26 -3
  10. package/package.json +4 -2
  11. package/src/templates/vendor/esm.sh/v91/next@12.2.5/deno/dist/compiled/cookie.js +7 -12
  12. package/src/templates/vendor/esm.sh/v91/next@12.2.5/deno/dist/server/web/error.js +9 -0
  13. package/src/templates/vendor/esm.sh/v91/next@12.2.5/deno/dist/server/web/next-url.js +2 -0
  14. package/src/templates/vendor/esm.sh/v91/next@12.2.5/deno/dist/server/web/spec-extension/cookies.js +2 -0
  15. package/src/templates/vendor/esm.sh/v91/next@12.2.5/deno/dist/server/web/spec-extension/request.js +1 -11
  16. package/src/templates/vendor/esm.sh/v91/next@12.2.5/deno/dist/server/web/spec-extension/response.js +1 -4
  17. package/src/templates/vendor/esm.sh/v91/next@12.2.5/deno/dist/server/web/utils.js +2 -0
  18. package/src/templates/vendor/esm.sh/v91/next@12.2.5/deno/dist/shared/lib/get-hostname.js +2 -0
  19. package/src/templates/vendor/esm.sh/v91/next@12.2.5/deno/dist/shared/lib/i18n/detect-domain-locale.js +2 -0
  20. package/src/templates/vendor/esm.sh/v91/next@12.2.5/deno/dist/shared/lib/i18n/normalize-locale-path.js +2 -0
  21. package/src/templates/vendor/esm.sh/v91/next@12.2.5/deno/dist/shared/lib/router/utils/add-locale.js +2 -0
  22. package/src/templates/vendor/esm.sh/v91/next@12.2.5/deno/dist/shared/lib/router/utils/add-path-prefix.js +2 -0
  23. package/src/templates/vendor/esm.sh/v91/next@12.2.5/deno/dist/shared/lib/router/utils/add-path-suffix.js +2 -0
  24. package/src/templates/vendor/esm.sh/v91/next@12.2.5/deno/dist/shared/lib/router/utils/format-next-pathname-info.js +2 -0
  25. package/src/templates/vendor/esm.sh/v91/next@12.2.5/deno/dist/shared/lib/router/utils/get-next-pathname-info.js +2 -0
  26. package/src/templates/vendor/esm.sh/v91/next@12.2.5/deno/dist/shared/lib/router/utils/parse-path.js +2 -0
  27. package/src/templates/vendor/esm.sh/v91/next@12.2.5/deno/dist/shared/lib/router/utils/path-has-prefix.js +2 -0
  28. package/src/templates/vendor/esm.sh/v91/next@12.2.5/deno/dist/shared/lib/router/utils/remove-path-prefix.js +2 -0
  29. package/src/templates/vendor/esm.sh/v91/next@12.2.5/deno/dist/shared/lib/router/utils/remove-trailing-slash.js +2 -0
  30. package/src/templates/vendor/import_map.json +17 -1
package/lib/constants.js CHANGED
@@ -38,6 +38,7 @@ exports.HIDDEN_PATHS = (0, destr_1.default)(process.env.NEXT_KEEP_METADATA_FILES
38
38
  '/prerender-manifest.js',
39
39
  '/required-server-files.json',
40
40
  '/static-manifest.json',
41
+ '/blobs-manifest.json',
41
42
  ];
42
43
  exports.ODB_FUNCTION_PATH = `/.netlify/builders/${exports.ODB_FUNCTION_NAME}`;
43
44
  exports.HANDLER_FUNCTION_PATH = `/.netlify/functions/${exports.HANDLER_FUNCTION_NAME}`;
@@ -13,6 +13,7 @@ const p_limit_1 = __importDefault(require("p-limit"));
13
13
  const pathe_1 = require("pathe");
14
14
  const slash_1 = __importDefault(require("slash"));
15
15
  const constants_1 = require("../constants");
16
+ const blobStorage_1 = require("../templates/blobStorage");
16
17
  const edge_1 = require("./edge");
17
18
  const utils_1 = require("./utils");
18
19
  const TEST_ROUTE = /(|\/)\[[^/]+?](\/|\.html|$)/;
@@ -66,7 +67,8 @@ const getMiddleware = async (publish) => {
66
67
  };
67
68
  exports.getMiddleware = getMiddleware;
68
69
  // eslint-disable-next-line max-lines-per-function
69
- const moveStaticPages = async ({ netlifyConfig, target, i18n, basePath, }) => {
70
+ const moveStaticPages = async ({ netlifyConfig, target, nextConfig, netliBlob, }) => {
71
+ const { i18n, basePath } = nextConfig;
70
72
  console.log('Moving static page files to serve from CDN...');
71
73
  const outputDir = (0, pathe_1.join)(netlifyConfig.build.publish, target === 'serverless' ? 'serverless' : 'server');
72
74
  const buildId = (0, fs_extra_1.readFileSync)((0, pathe_1.join)(netlifyConfig.build.publish, 'BUILD_ID'), 'utf8').trim();
@@ -93,15 +95,24 @@ const moveStaticPages = async ({ netlifyConfig, target, i18n, basePath, }) => {
93
95
  }
94
96
  });
95
97
  let fileCount = 0;
98
+ let blobCount = 0;
96
99
  const filesManifest = {};
97
- const moveFile = async (file) => {
100
+ const blobsManifest = new Set();
101
+ const getSourceAndTargetPath = (file) => {
102
+ const source = (0, pathe_1.join)(outputDir, file);
98
103
  // Strip the initial 'app' or 'pages' directory from the output path
99
104
  const pathname = file.split('/').slice(1).join('/');
100
105
  // .rsc data files go next to the html file
101
106
  const isData = file.endsWith('.json');
102
- const source = (0, pathe_1.join)(outputDir, file);
103
107
  const targetFile = isData ? (0, pathe_1.join)(dataDir, pathname) : pathname;
104
108
  const targetPath = basePath ? (0, pathe_1.join)(basePath, targetFile) : targetFile;
109
+ return {
110
+ targetPath,
111
+ source,
112
+ };
113
+ };
114
+ const moveFile = async (file) => {
115
+ const { source, targetPath } = getSourceAndTargetPath(file);
105
116
  fileCount += 1;
106
117
  filesManifest[file] = targetPath;
107
118
  const dest = (0, pathe_1.join)(netlifyConfig.build.publish, targetPath);
@@ -112,6 +123,14 @@ const moveStaticPages = async ({ netlifyConfig, target, i18n, basePath, }) => {
112
123
  console.warn('Error moving file', source, error);
113
124
  }
114
125
  };
126
+ const uploadFileToBlobStorageAndDelete = async (file) => {
127
+ const { source } = getSourceAndTargetPath(file);
128
+ blobsManifest.add(file);
129
+ const content = await (0, fs_extra_1.readFile)(source, 'utf8');
130
+ blobCount += 1;
131
+ await netliBlob.set((0, blobStorage_1.getNormalizedBlobKey)(file), content);
132
+ await (0, fs_extra_1.remove)(source);
133
+ };
115
134
  // Move all static files, except nft manifests
116
135
  const pages = await (0, globby_1.default)(['{app,pages}/**/*.{html,json,rsc}', '!**/*.js.nft.{html,json}'], {
117
136
  cwd: outputDir,
@@ -128,8 +147,13 @@ const moveStaticPages = async ({ netlifyConfig, target, i18n, basePath, }) => {
128
147
  const filePath = (0, slash_1.default)(rawPath);
129
148
  // Remove the initial 'app' or 'pages' directory from the output path
130
149
  const pagePath = filePath.split('/').slice(1).join('/');
131
- // Don't move ISR files, as they're used for the first request
132
150
  if (isrFiles.has(pagePath)) {
151
+ if (netliBlob) {
152
+ // if netliblob is enabled, we will move ISR assets to blob store and delete files after that
153
+ // to minimize the number of files needed in lambda
154
+ return limit(uploadFileToBlobStorageAndDelete, filePath);
155
+ }
156
+ // Don't move ISR files, as they're used for the first request
133
157
  return;
134
158
  }
135
159
  if ((0, exports.isDynamicRoute)(pagePath)) {
@@ -155,7 +179,10 @@ const moveStaticPages = async ({ netlifyConfig, target, i18n, basePath, }) => {
155
179
  return limit(moveFile, filePath);
156
180
  });
157
181
  await Promise.all(promises);
158
- console.log(`Moved ${fileCount} files`);
182
+ console.log(`Moved ${fileCount} files to CDN`);
183
+ if (netliBlob) {
184
+ console.log(`Moved ${blobCount} files to Blob Storage`);
185
+ }
159
186
  if (matchedPages.size !== 0) {
160
187
  console.log((0, chalk_1.yellowBright)((0, outdent_1.outdent) `
161
188
  Skipped moving ${matchedPages.size} ${matchedPages.size === 1 ? 'file because it matches' : 'files because they match'} middleware, so cannot be deployed to the CDN and will be served from the origin instead.
@@ -198,8 +225,9 @@ const moveStaticPages = async ({ netlifyConfig, target, i18n, basePath, }) => {
198
225
  `);
199
226
  }
200
227
  }
201
- // Write the manifest for use in the serverless functions
228
+ // Write the manifests for use in the serverless functions
202
229
  await (0, fs_extra_1.writeJson)((0, pathe_1.join)(netlifyConfig.build.publish, 'static-manifest.json'), Object.entries(filesManifest));
230
+ await (0, fs_extra_1.writeJson)((0, pathe_1.join)(netlifyConfig.build.publish, 'blobs-manifest.json'), [...blobsManifest]);
203
231
  if (i18n === null || i18n === void 0 ? void 0 : i18n.defaultLocale) {
204
232
  const rootPath = basePath ? (0, pathe_1.join)(netlifyConfig.build.publish, basePath) : netlifyConfig.build.publish;
205
233
  // Copy the default locale into the root
@@ -80,6 +80,8 @@ const generateFunctions = async ({ INTERNAL_FUNCTIONS_SRC, PUBLISH_DIR, PACKAGE_
80
80
  await (0, fs_extra_1.copyFile)((0, pathe_1.join)(__dirname, '..', '..', 'lib', 'templates', 'server.js'), (0, pathe_1.join)(functionsDir, functionName, 'server.js'));
81
81
  await (0, fs_extra_1.copyFile)((0, pathe_1.join)(__dirname, '..', '..', 'lib', 'templates', 'requireHooks.js'), (0, pathe_1.join)(functionsDir, functionName, 'requireHooks.js'));
82
82
  await (0, fs_extra_1.copyFile)((0, pathe_1.join)(__dirname, '..', '..', 'lib', 'templates', 'handlerUtils.js'), (0, pathe_1.join)(functionsDir, functionName, 'handlerUtils.js'));
83
+ await (0, fs_extra_1.copyFile)((0, pathe_1.join)(__dirname, '..', '..', 'lib', 'templates', 'blob.js'), (0, pathe_1.join)(functionsDir, functionName, 'blob.js'));
84
+ await (0, fs_extra_1.copyFile)((0, pathe_1.join)(__dirname, '..', '..', 'lib', 'templates', 'blobStorage.js'), (0, pathe_1.join)(functionsDir, functionName, 'blobStorage.js'));
83
85
  await (0, functionsMetaData_1.writeFunctionConfiguration)({ functionName, functionTitle, functionsDir });
84
86
  const nfInternalFiles = await (0, tiny_glob_1.default)((0, pathe_1.join)(functionsDir, functionName, '**'));
85
87
  const lambda = ssrLambdas.find((l) => l.functionName === functionName);
@@ -257,6 +259,7 @@ const getSSRDependencies = async (publish) => {
257
259
  }),
258
260
  (0, pathe_1.join)(publish, '**', '*.html'),
259
261
  (0, pathe_1.join)(publish, 'static-manifest.json'),
262
+ (0, pathe_1.join)(publish, 'blobs-manifest.json'),
260
263
  ];
261
264
  };
262
265
  const getSSRLambdas = async (publish) => {
package/lib/index.js CHANGED
@@ -19,6 +19,7 @@ const functions_1 = require("./helpers/functions");
19
19
  const redirects_1 = require("./helpers/redirects");
20
20
  const utils_1 = require("./helpers/utils");
21
21
  const verification_1 = require("./helpers/verification");
22
+ const blobStorage_1 = require("./templates/blobStorage");
22
23
  const plugin = {
23
24
  async onPreBuild({ constants, netlifyConfig, utils: { build: { failBuild }, cache, }, }) {
24
25
  var _a;
@@ -108,7 +109,17 @@ const plugin = {
108
109
  });
109
110
  await (0, files_1.movePublicFiles)({ appDir, outdir, publish, basePath });
110
111
  if (!(0, destr_1.default)(process.env.SERVE_STATIC_FILES_FROM_ORIGIN)) {
111
- await (0, files_1.moveStaticPages)({ target, netlifyConfig, i18n, basePath });
112
+ const { NETLIFY_API_HOST, NETLIFY_API_TOKEN, SITE_ID } = constants;
113
+ const testBlobStorage = new blobStorage_1.Blobs({
114
+ authentication: {
115
+ apiURL: `https://${NETLIFY_API_HOST}`,
116
+ token: NETLIFY_API_TOKEN,
117
+ },
118
+ context: `deploy:${process.env.DEPLOY_ID}`,
119
+ siteID: SITE_ID,
120
+ });
121
+ const netliBlob = (await (0, blobStorage_1.isBlobStorageAvailable)(testBlobStorage)) ? testBlobStorage : undefined;
122
+ await (0, files_1.moveStaticPages)({ target, netlifyConfig, nextConfig: { basePath, i18n }, netliBlob });
112
123
  }
113
124
  await (0, redirects_1.generateStaticRedirects)({
114
125
  netlifyConfig,
@@ -0,0 +1,341 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ // src/templates/netliblob.mts
19
+ var netliblob_exports = {};
20
+ __export(netliblob_exports, {
21
+ Blobs: () => Blobs
22
+ });
23
+ module.exports = __toCommonJS(netliblob_exports);
24
+ // ../../node_modules/@netlify/blobs/dist/src/main.js
25
+ var import_node_fs = require("fs");
26
+ var import_promises = require("fs/promises");
27
+ var import_node_stream = require("stream");
28
+ var AbortError = class extends Error {
29
+ constructor(message) {
30
+ super();
31
+ this.name = "AbortError";
32
+ this.message = message;
33
+ }
34
+ };
35
+ var getDOMException = (errorMessage) => globalThis.DOMException === void 0 ? new AbortError(errorMessage) : new DOMException(errorMessage);
36
+ var getAbortedReason = (signal) => {
37
+ const reason = signal.reason === void 0 ? getDOMException("This operation was aborted.") : signal.reason;
38
+ return reason instanceof Error ? reason : getDOMException(reason);
39
+ };
40
+ async function pMap(iterable, mapper, { concurrency = Number.POSITIVE_INFINITY, stopOnError = true, signal } = {}) {
41
+ return new Promise((resolve, reject_) => {
42
+ if (iterable[Symbol.iterator] === void 0 && iterable[Symbol.asyncIterator] === void 0) {
43
+ throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`);
44
+ }
45
+ if (typeof mapper !== "function") {
46
+ throw new TypeError("Mapper function is required");
47
+ }
48
+ if (!((Number.isSafeInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency >= 1)) {
49
+ throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`);
50
+ }
51
+ const result = [];
52
+ const errors = [];
53
+ const skippedIndexesMap = /* @__PURE__ */ new Map();
54
+ let isRejected = false;
55
+ let isResolved = false;
56
+ let isIterableDone = false;
57
+ let resolvingCount = 0;
58
+ let currentIndex = 0;
59
+ const iterator = iterable[Symbol.iterator] === void 0 ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();
60
+ const reject = (reason) => {
61
+ isRejected = true;
62
+ isResolved = true;
63
+ reject_(reason);
64
+ };
65
+ if (signal) {
66
+ if (signal.aborted) {
67
+ reject(getAbortedReason(signal));
68
+ }
69
+ signal.addEventListener("abort", () => {
70
+ reject(getAbortedReason(signal));
71
+ });
72
+ }
73
+ const next = async () => {
74
+ if (isResolved) {
75
+ return;
76
+ }
77
+ const nextItem = await iterator.next();
78
+ const index = currentIndex;
79
+ currentIndex++;
80
+ if (nextItem.done) {
81
+ isIterableDone = true;
82
+ if (resolvingCount === 0 && !isResolved) {
83
+ if (!stopOnError && errors.length > 0) {
84
+ reject(new AggregateError(errors));
85
+ return;
86
+ }
87
+ isResolved = true;
88
+ if (skippedIndexesMap.size === 0) {
89
+ resolve(result);
90
+ return;
91
+ }
92
+ const pureResult = [];
93
+ for (const [index2, value] of result.entries()) {
94
+ if (skippedIndexesMap.get(index2) === pMapSkip) {
95
+ continue;
96
+ }
97
+ pureResult.push(value);
98
+ }
99
+ resolve(pureResult);
100
+ }
101
+ return;
102
+ }
103
+ resolvingCount++;
104
+ (async () => {
105
+ try {
106
+ const element = await nextItem.value;
107
+ if (isResolved) {
108
+ return;
109
+ }
110
+ const value = await mapper(element, index);
111
+ if (value === pMapSkip) {
112
+ skippedIndexesMap.set(index, value);
113
+ }
114
+ result[index] = value;
115
+ resolvingCount--;
116
+ await next();
117
+ }
118
+ catch (error) {
119
+ if (stopOnError) {
120
+ reject(error);
121
+ }
122
+ else {
123
+ errors.push(error);
124
+ resolvingCount--;
125
+ try {
126
+ await next();
127
+ }
128
+ catch (error2) {
129
+ reject(error2);
130
+ }
131
+ }
132
+ }
133
+ })();
134
+ };
135
+ (async () => {
136
+ for (let index = 0; index < concurrency; index++) {
137
+ try {
138
+ await next();
139
+ }
140
+ catch (error) {
141
+ reject(error);
142
+ break;
143
+ }
144
+ if (isIterableDone || isRejected) {
145
+ break;
146
+ }
147
+ }
148
+ })();
149
+ });
150
+ }
151
+ var pMapSkip = Symbol("skip");
152
+ var DEFAULT_RETRY_DELAY = 5e3;
153
+ var MIN_RETRY_DELAY = 1e3;
154
+ var MAX_RETRY = 5;
155
+ var RATE_LIMIT_HEADER = "X-RateLimit-Reset";
156
+ var fetchAndRetry = async (fetcher, url, options, attemptsLeft = MAX_RETRY) => {
157
+ try {
158
+ const res = await fetcher(url, options);
159
+ if (attemptsLeft > 0 && (res.status === 429 || res.status >= 500)) {
160
+ const delay = getDelay(res.headers.get(RATE_LIMIT_HEADER));
161
+ await sleep(delay);
162
+ return fetchAndRetry(fetcher, url, options, attemptsLeft - 1);
163
+ }
164
+ return res;
165
+ }
166
+ catch (error) {
167
+ if (attemptsLeft === 0) {
168
+ throw error;
169
+ }
170
+ const delay = getDelay();
171
+ await sleep(delay);
172
+ return fetchAndRetry(fetcher, url, options, attemptsLeft - 1);
173
+ }
174
+ };
175
+ var getDelay = (rateLimitReset) => {
176
+ if (!rateLimitReset) {
177
+ return DEFAULT_RETRY_DELAY;
178
+ }
179
+ return Math.max(Number(rateLimitReset) * 1e3 - Date.now(), MIN_RETRY_DELAY);
180
+ };
181
+ var sleep = (ms) => new Promise((resolve) => {
182
+ setTimeout(resolve, ms);
183
+ });
184
+ var EXPIRY_HEADER = "x-nf-expires-at";
185
+ var Blobs = class _Blobs {
186
+ constructor({ authentication, context, fetcher, siteID }) {
187
+ var _a;
188
+ this.context = context !== null && context !== void 0 ? context : "production";
189
+ this.fetcher = fetcher !== null && fetcher !== void 0 ? fetcher : globalThis.fetch;
190
+ this.siteID = siteID;
191
+ if ("contextURL" in authentication) {
192
+ this.authentication = authentication;
193
+ }
194
+ else {
195
+ this.authentication = {
196
+ apiURL: (_a = authentication.apiURL) !== null && _a !== void 0 ? _a : "https://api.netlify.com",
197
+ token: authentication.token
198
+ };
199
+ }
200
+ if (fetcher) {
201
+ this.fetcher = fetcher;
202
+ }
203
+ else if (globalThis.fetch) {
204
+ this.fetcher = globalThis.fetch;
205
+ }
206
+ else {
207
+ throw new Error("You must specify a fetch-compatible `fetcher` parameter when `fetch` is not available globally");
208
+ }
209
+ }
210
+ async getFinalRequest(key, method) {
211
+ const encodedKey = encodeURIComponent(key);
212
+ if ("contextURL" in this.authentication) {
213
+ return {
214
+ headers: {
215
+ authorization: `Bearer ${this.authentication.token}`
216
+ },
217
+ url: `${this.authentication.contextURL}/${this.siteID}/${this.context}/${encodedKey}`
218
+ };
219
+ }
220
+ const apiURL = `${this.authentication.apiURL}/api/v1/sites/${this.siteID}/blobs/${encodedKey}?context=${this.context}`;
221
+ const headers = { authorization: `Bearer ${this.authentication.token}` };
222
+ const res = await this.fetcher(apiURL, { headers, method });
223
+ if (res.status !== 200) {
224
+ throw new Error(`${method} operation has failed: API returned a ${res.status} response`);
225
+ }
226
+ const { url } = await res.json();
227
+ return {
228
+ url
229
+ };
230
+ }
231
+ static getExpirationHeaders(expiration) {
232
+ if (typeof expiration === "number") {
233
+ return {
234
+ [EXPIRY_HEADER]: (Date.now() + expiration).toString()
235
+ };
236
+ }
237
+ if (expiration instanceof Date) {
238
+ return {
239
+ [EXPIRY_HEADER]: expiration.getTime().toString()
240
+ };
241
+ }
242
+ if (expiration === void 0) {
243
+ return {};
244
+ }
245
+ throw new TypeError(`'expiration' value must be a number or a Date, ${typeof expiration} found.`);
246
+ }
247
+ isConfigured() {
248
+ var _a;
249
+ return Boolean((_a = this.authentication) === null || _a === void 0 ? void 0 : _a.token) && Boolean(this.siteID);
250
+ }
251
+ async makeStoreRequest(key, method, extraHeaders, body) {
252
+ if (!this.isConfigured()) {
253
+ throw new Error("The blob store is unavailable because it's missing required configuration properties");
254
+ }
255
+ const { headers: baseHeaders = {}, url } = await this.getFinalRequest(key, method);
256
+ const headers = {
257
+ ...baseHeaders,
258
+ ...extraHeaders
259
+ };
260
+ if (method === "put") {
261
+ headers["cache-control"] = "max-age=0, stale-while-revalidate=60";
262
+ }
263
+ const options = {
264
+ body,
265
+ headers,
266
+ method
267
+ };
268
+ if (body instanceof ReadableStream) {
269
+ options.duplex = "half";
270
+ }
271
+ const res = await fetchAndRetry(this.fetcher, url, options);
272
+ if (res.status === 404 && method === "get") {
273
+ return null;
274
+ }
275
+ if (res.status !== 200) {
276
+ throw new Error(`${method} operation has failed: store returned a ${res.status} response`);
277
+ }
278
+ return res;
279
+ }
280
+ async delete(key) {
281
+ await this.makeStoreRequest(key, "delete");
282
+ }
283
+ async get(key, options) {
284
+ const { type } = options !== null && options !== void 0 ? options : {};
285
+ const res = await this.makeStoreRequest(key, "get");
286
+ const expiration = res === null || res === void 0 ? void 0 : res.headers.get(EXPIRY_HEADER);
287
+ if (typeof expiration === "string") {
288
+ const expirationTS = Number.parseInt(expiration);
289
+ if (!Number.isNaN(expirationTS) && expirationTS <= Date.now()) {
290
+ return null;
291
+ }
292
+ }
293
+ if (res === null) {
294
+ return res;
295
+ }
296
+ if (type === void 0 || type === "text") {
297
+ return res.text();
298
+ }
299
+ if (type === "arrayBuffer") {
300
+ return res.arrayBuffer();
301
+ }
302
+ if (type === "blob") {
303
+ return res.blob();
304
+ }
305
+ if (type === "json") {
306
+ return res.json();
307
+ }
308
+ if (type === "stream") {
309
+ return res.body;
310
+ }
311
+ throw new Error(`Invalid 'type' property: ${type}. Expected: arrayBuffer, blob, json, stream, or text.`);
312
+ }
313
+ async set(key, data, { expiration } = {}) {
314
+ const headers = _Blobs.getExpirationHeaders(expiration);
315
+ await this.makeStoreRequest(key, "put", headers, data);
316
+ }
317
+ async setFile(key, path, { expiration } = {}) {
318
+ const { size } = await (0, import_promises.stat)(path);
319
+ const file = import_node_stream.Readable.toWeb((0, import_node_fs.createReadStream)(path));
320
+ const headers = {
321
+ ..._Blobs.getExpirationHeaders(expiration),
322
+ "content-length": size.toString()
323
+ };
324
+ await this.makeStoreRequest(key, "put", headers, file);
325
+ }
326
+ setFiles(files, { concurrency = 5 } = {}) {
327
+ return pMap(files, ({ key, path, ...options }) => this.setFile(key, path, options), { concurrency });
328
+ }
329
+ async setJSON(key, data, { expiration } = {}) {
330
+ const payload = JSON.stringify(data);
331
+ const headers = {
332
+ ..._Blobs.getExpirationHeaders(expiration),
333
+ "content-type": "application/json"
334
+ };
335
+ await this.makeStoreRequest(key, "put", headers, payload);
336
+ }
337
+ };
338
+ // Annotate the CommonJS export names for ESM import in node:
339
+ 0 && (module.exports = {
340
+ Blobs
341
+ });
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Blobs = exports.getNormalizedBlobKey = exports.getBlobInit = exports.setBlobInit = exports.isBlobStorageAvailable = void 0;
4
+ const buffer_1 = require("buffer");
5
+ const blob_1 = require("./blob");
6
+ const Blobs = blob_1.Blobs;
7
+ exports.Blobs = Blobs;
8
+ const isBlobStorageAvailable = async (netliBlob) => {
9
+ try {
10
+ // request a key that is not present. If it returns `null` then the blob storage is available
11
+ // if it throws it's not available.
12
+ await netliBlob.get('any-key');
13
+ return true;
14
+ }
15
+ catch {
16
+ return false;
17
+ }
18
+ };
19
+ exports.isBlobStorageAvailable = isBlobStorageAvailable;
20
+ let blobInit;
21
+ const setBlobInit = (init) => {
22
+ blobInit = init;
23
+ };
24
+ exports.setBlobInit = setBlobInit;
25
+ const getBlobInit = () => blobInit;
26
+ exports.getBlobInit = getBlobInit;
27
+ /**
28
+ * @netlify/blobs ATM has some limitation to keys, so we need to normalize it for now (they will be resolved so we will be able to remove this code)
29
+ */
30
+ const getNormalizedBlobKey = (key) => buffer_1.Buffer.from(key).toString('base64url');
31
+ exports.getNormalizedBlobKey = getNormalizedBlobKey;
@@ -4,18 +4,20 @@ exports.getHandler = void 0;
4
4
  // Aliasing like this means the editor may be able to syntax-highlight the string
5
5
  const outdent_1 = require("outdent");
6
6
  /* eslint-disable @typescript-eslint/no-var-requires */
7
+ const { Buffer } = require('buffer');
7
8
  const { promises } = require('fs');
8
9
  const { Server } = require('http');
9
10
  const path = require('path');
10
11
  // eslint-disable-next-line n/prefer-global/url, n/prefer-global/url-search-params
11
12
  const { URLSearchParams, URL } = require('url');
12
13
  const { Bridge } = require('@vercel/node-bridge/bridge');
13
- const { augmentFsModule, getMaxAge, getMultiValueHeaders, getPrefetchResponse, normalizePath, } = require('./handlerUtils');
14
+ const { setBlobInit } = require('./blobStorage');
15
+ const { augmentFsModule, getMaxAge, getMultiValueHeaders, getPrefetchResponse, normalizePath } = require('./handlerUtils');
14
16
  const { overrideRequireHooks, applyRequireHooks } = require('./requireHooks');
15
17
  const { getNetlifyNextServer } = require('./server');
16
18
  // We return a function and then call `toString()` on it to serialise it as the launcher function
17
19
  // eslint-disable-next-line max-lines-per-function
18
- const makeHandler = ({ conf, app, pageRoot, NextServer, staticManifest = [], mode = 'ssr' }) => {
20
+ const makeHandler = ({ conf, app, pageRoot, NextServer, staticManifest = [], blobsManifest = new Set(), mode = 'ssr', }) => {
19
21
  var _a;
20
22
  // Change working directory into the site root, unless using Nx, which moves the
21
23
  // dist directory and handles this itself
@@ -42,7 +44,7 @@ const makeHandler = ({ conf, app, pageRoot, NextServer, staticManifest = [], mod
42
44
  }
43
45
  // Set during the request as it needs to get it from the request URL. Defaults to the URL env var
44
46
  let base = process.env.URL;
45
- augmentFsModule({ promises, staticManifest, pageRoot, getBase: () => base });
47
+ augmentFsModule({ promises, staticManifest, blobsManifest, pageRoot, getBase: () => base });
46
48
  // We memoize this because it can be shared between requests, but don't instantiate it until
47
49
  // the first request because we need the host and port.
48
50
  let bridge;
@@ -77,7 +79,7 @@ const makeHandler = ({ conf, app, pageRoot, NextServer, staticManifest = [], mod
77
79
  return bridge;
78
80
  };
79
81
  return async function handler(event, context) {
80
- var _a, _b, _c;
82
+ var _a, _b, _c, _d, _e;
81
83
  let requestMode = mode;
82
84
  const prefetchResponse = getPrefetchResponse(event, mode);
83
85
  if (prefetchResponse) {
@@ -96,6 +98,18 @@ const makeHandler = ({ conf, app, pageRoot, NextServer, staticManifest = [], mod
96
98
  // 'x-next-just-first-accept-language' header is escape hatch to be able to hit this code for tests (both automated and manual)
97
99
  event.headers['accept-language'] = event.headers['accept-language'].replace(/\s*,.*$/, '');
98
100
  }
101
+ if ((_b = (_a = context === null || context === void 0 ? void 0 : context.clientContext) === null || _a === void 0 ? void 0 : _a.custom) === null || _b === void 0 ? void 0 : _b.blobs) {
102
+ const rawData = Buffer.from(context.clientContext.custom.blobs, 'base64');
103
+ const data = JSON.parse(rawData.toString('ascii'));
104
+ setBlobInit({
105
+ authentication: {
106
+ contextURL: data.url,
107
+ token: data.token,
108
+ },
109
+ context: `deploy:${event.headers['x-nf-deploy-id']}`,
110
+ siteID: event.headers['x-nf-site-id'],
111
+ });
112
+ }
99
113
  const { headers, ...result } = await getBridge(event, context).launcher(event, context);
100
114
  // Convert all headers to multiValueHeaders
101
115
  const multiValueHeaders = getMultiValueHeaders(headers);
@@ -106,12 +120,12 @@ const makeHandler = ({ conf, app, pageRoot, NextServer, staticManifest = [], mod
106
120
  };
107
121
  console.log('Next server response:', JSON.stringify(response, null, 2));
108
122
  }
109
- if ((_b = (_a = multiValueHeaders['set-cookie']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.includes('__prerender_bypass')) {
123
+ if ((_d = (_c = multiValueHeaders['set-cookie']) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.includes('__prerender_bypass')) {
110
124
  delete multiValueHeaders.etag;
111
125
  multiValueHeaders['cache-control'] = ['no-cache'];
112
126
  }
113
127
  // Sending SWR headers causes undefined behaviour with the Netlify CDN
114
- const cacheHeader = (_c = multiValueHeaders['cache-control']) === null || _c === void 0 ? void 0 : _c[0];
128
+ const cacheHeader = (_e = multiValueHeaders['cache-control']) === null || _e === void 0 ? void 0 : _e[0];
115
129
  if (cacheHeader === null || cacheHeader === void 0 ? void 0 : cacheHeader.includes('stale-while-revalidate')) {
116
130
  if (requestMode === 'odb') {
117
131
  const ttl = getMaxAge(cacheHeader);
@@ -153,8 +167,10 @@ const getHandler = ({ isODB = false, publishDir = '../../../.next', appDir = '..
153
167
 
154
168
  process.env.NODE_ENV = 'production';
155
169
 
170
+ const { Buffer } = require('buffer')
156
171
  const { Server } = require("http");
157
172
  const { promises } = require("fs");
173
+ const { setBlobInit } = require('./blobStorage')
158
174
  // We copy the file here rather than requiring from the node module
159
175
  const { Bridge } = require("./bridge");
160
176
  const { augmentFsModule, getMaxAge, getMultiValueHeaders, getPrefetchResponse, normalizePath } = require('./handlerUtils')
@@ -167,10 +183,14 @@ const getHandler = ({ isODB = false, publishDir = '../../../.next', appDir = '..
167
183
  try {
168
184
  staticManifest = require("${publishDir}/static-manifest.json")
169
185
  } catch {}
186
+ let blobsManifest
187
+ try {
188
+ blobsManifest = new Set(require("${publishDir}/blobs-manifest.json"))
189
+ } catch {}
170
190
  const path = require("path");
171
191
  const pageRoot = path.resolve(path.join(__dirname, "${publishDir}", "server"));
172
192
  exports.handler = ${isODB
173
- ? `builder((${makeHandler.toString()})({ conf: config, app: "${appDir}", pageRoot, NextServer, staticManifest, mode: 'odb' }));`
174
- : `(${makeHandler.toString()})({ conf: config, app: "${appDir}", pageRoot, NextServer, staticManifest, mode: 'ssr' });`}
193
+ ? `builder((${makeHandler.toString()})({ conf: config, app: "${appDir}", pageRoot, NextServer, staticManifest, blobsManifest, mode: 'odb' }));`
194
+ : `(${makeHandler.toString()})({ conf: config, app: "${appDir}", pageRoot, NextServer, staticManifest, blobsManifest, mode: 'ssr' });`}
175
195
  `;
176
196
  exports.getHandler = getHandler;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getMatchedRoute = exports.localizeDataRoute = exports.localizeRoute = exports.unlocalizeRoute = exports.joinPaths = exports.normalizeRoute = exports.netlifyApiFetch = exports.normalizePath = exports.getPrefetchResponse = exports.augmentFsModule = exports.getMultiValueHeaders = exports.getMaxAge = exports.downloadFile = void 0;
6
+ exports.getMatchedRoute = exports.localizeDataRoute = exports.localizeRoute = exports.unlocalizeRoute = exports.joinPaths = exports.normalizeRoute = exports.netlifyApiFetch = exports.normalizePath = exports.getPrefetchResponse = exports.augmentFsModule = exports.getMultiValueHeaders = exports.getMaxAge = exports.downloadFileFromCDN = void 0;
7
7
  const fs_1 = require("fs");
8
8
  const os_1 = require("os");
9
9
  const path_1 = __importDefault(require("path"));
@@ -11,12 +11,13 @@ const stream_1 = require("stream");
11
11
  const util_1 = require("util");
12
12
  const follow_redirects_1 = require("follow-redirects");
13
13
  const streamPipeline = (0, util_1.promisify)(stream_1.pipeline);
14
+ const writeFilePromisified = (0, util_1.promisify)(fs_1.writeFile);
14
15
  /**
15
16
  * Downloads a file from the CDN to the local aliased filesystem. This is a fallback, because in most cases we'd expect
16
17
  * files required at runtime to not be sent to the CDN.
17
18
  */
18
- const downloadFile = async (url, destination) => {
19
- console.log(`Downloading ${url} to ${destination}`);
19
+ const downloadFileFromCDN = async (url, destination) => {
20
+ console.log(`Downloading ${url} from CDN to ${destination}`);
20
21
  const httpx = url.startsWith('https') ? follow_redirects_1.https : follow_redirects_1.http;
21
22
  await new Promise((resolve, reject) => {
22
23
  const req = httpx.get(url, { timeout: 10000, maxRedirects: 1 }, (response) => {
@@ -38,7 +39,17 @@ const downloadFile = async (url, destination) => {
38
39
  });
39
40
  });
40
41
  };
41
- exports.downloadFile = downloadFile;
42
+ exports.downloadFileFromCDN = downloadFileFromCDN;
43
+ const downloadFileFromBlobs = async (filePath, destination) => {
44
+ console.log(`Downloading ${filePath} from Blobs Storage to ${destination}`);
45
+ const { Blobs, getNormalizedBlobKey, getBlobInit } =
46
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
47
+ require('./blobStorage');
48
+ const netliBlob = new Blobs(getBlobInit());
49
+ const blobKey = getNormalizedBlobKey(filePath);
50
+ const fileContent = await netliBlob.get(blobKey, { type: 'text' });
51
+ await writeFilePromisified(destination, fileContent);
52
+ };
42
53
  /**
43
54
  * Parse maxage from a cache-control header
44
55
  */
@@ -75,7 +86,7 @@ exports.getMultiValueHeaders = getMultiValueHeaders;
75
86
  /**
76
87
  * Monkey-patch the fs module to download missing files from the CDN
77
88
  */
78
- const augmentFsModule = ({ promises, staticManifest, pageRoot, getBase, }) => {
89
+ const augmentFsModule = ({ promises, staticManifest, blobsManifest, pageRoot, getBase, }) => {
79
90
  // Only do this if we have some static files moved to the CDN
80
91
  if (staticManifest.length === 0) {
81
92
  return;
@@ -91,6 +102,9 @@ const augmentFsModule = ({ promises, staticManifest, pageRoot, getBase, }) => {
91
102
  // Grab the real fs.promises.readFile...
92
103
  const readfileOrig = promises.readFile;
93
104
  const statsOrig = promises.stat;
105
+ const { getBlobInit } =
106
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
107
+ require('./blobStorage');
94
108
  // ...then monkey-patch it to see if it's requesting a CDN file
95
109
  promises.readFile = (async (file, options) => {
96
110
  const baseUrl = getBase();
@@ -98,30 +112,36 @@ const augmentFsModule = ({ promises, staticManifest, pageRoot, getBase, }) => {
98
112
  if (file.startsWith(pageRoot)) {
99
113
  // We only want the part after `.next/server/`
100
114
  const filePath = file.slice(pageRoot.length + 1);
101
- // Is it in the CDN and not local?
102
- if (staticFiles.has(filePath) && !(0, fs_1.existsSync)(file)) {
103
- // This name is safe to use, because it's one that was already created by Next
104
- const cacheFile = path_1.default.join(cacheDir, filePath);
105
- const url = `${baseUrl}/${staticFiles.get(filePath)}`;
106
- // If it's already downloading we can wait for it to finish
107
- if (downloadPromises.has(url)) {
108
- await downloadPromises.get(url);
109
- }
110
- // Have we already cached it? We download every time if running locally to avoid staleness
111
- if ((!(0, fs_1.existsSync)(cacheFile) || process.env.NETLIFY_DEV) && baseUrl) {
112
- await promises.mkdir(path_1.default.dirname(cacheFile), { recursive: true });
113
- try {
114
- // Append the path to our host and we can load it like a regular page
115
- const downloadPromise = (0, exports.downloadFile)(url, cacheFile);
116
- downloadPromises.set(url, downloadPromise);
117
- await downloadPromise;
115
+ if (!(0, fs_1.existsSync)(file)) {
116
+ // Is it in the CDN or Blobs Storage and not local?
117
+ const isStatic = staticFiles.has(filePath);
118
+ const isBlob = getBlobInit() ? blobsManifest.has(filePath) : false;
119
+ if (isStatic || isBlob) {
120
+ // This name is safe to use, because it's one that was already created by Next
121
+ const cacheFile = path_1.default.join(cacheDir, filePath);
122
+ const url = `${baseUrl}/${staticFiles.get(filePath)}`;
123
+ // If it's already downloading we can wait for it to finish
124
+ if (downloadPromises.has(url)) {
125
+ await downloadPromises.get(url);
118
126
  }
119
- finally {
120
- downloadPromises.delete(url);
127
+ // Have we already cached it? We download every time if running locally to avoid staleness
128
+ if ((!(0, fs_1.existsSync)(cacheFile) || process.env.NETLIFY_DEV) && baseUrl) {
129
+ await promises.mkdir(path_1.default.dirname(cacheFile), { recursive: true });
130
+ try {
131
+ // Append the path to our host and we can load it like a regular page
132
+ const downloadPromise = isStatic
133
+ ? (0, exports.downloadFileFromCDN)(url, cacheFile)
134
+ : downloadFileFromBlobs(filePath, cacheFile);
135
+ downloadPromises.set(url, downloadPromise);
136
+ await downloadPromise;
137
+ }
138
+ finally {
139
+ downloadPromises.delete(url);
140
+ }
121
141
  }
142
+ // Return the cache file
143
+ return readfileOrig(cacheFile, options);
122
144
  }
123
- // Return the cache file
124
- return readfileOrig(cacheFile, options);
125
145
  }
126
146
  }
127
147
  return readfileOrig(file, options);
@@ -22,6 +22,25 @@ const getNetlifyNextServer = (NextServer) => {
22
22
  dynamicRoutes: { ...manifest.dynamicRoutes },
23
23
  };
24
24
  }
25
+ getPrerenderManifest() {
26
+ const manifest = super.getPrerenderManifest();
27
+ if (typeof (manifest === null || manifest === void 0 ? void 0 : manifest.dynamicRoutes) === 'object') {
28
+ for (const route of Object.values(manifest.dynamicRoutes)) {
29
+ // 'fallback' property is:
30
+ // - a string when fallback: true is used
31
+ // - `null` when fallback: blocking is used
32
+ // - `false` when fallback: false is used
33
+ // `fallback: true` is not working correctly with ODBs
34
+ // as we will cache fallback html forever, so
35
+ // we are treating those as `fallback: blocking`
36
+ // by editing the manifest
37
+ if (typeof route.fallback === 'string') {
38
+ route.fallback = null;
39
+ }
40
+ }
41
+ }
42
+ return manifest;
43
+ }
25
44
  getRequestHandler() {
26
45
  const handler = super.getRequestHandler();
27
46
  return async (req, res, parsedUrl) => {
@@ -48,9 +67,13 @@ const getNetlifyNextServer = (NextServer) => {
48
67
  // but ignore in preview mode (prerender_bypass is set to true in preview mode)
49
68
  // because otherwise revalidate will override preview mode
50
69
  if (!((_b = headers.cookie) === null || _b === void 0 ? void 0 : _b.includes('__prerender_bypass'))) {
51
- // this header controls whether Next.js will revalidate the page
52
- // and needs to be set to the preview mode id to enable it
53
- headers['x-prerender-revalidate'] = this.renderOpts.previewProps.previewModeId;
70
+ const isFirstODBRequest = headers['x-nf-builder-cache'] === 'miss';
71
+ // first ODB request should NOT be revalidated and instead it should try to serve cached version
72
+ if (!isFirstODBRequest) {
73
+ // this header controls whether Next.js will revalidate the page
74
+ // and needs to be set to the preview mode id to enable it
75
+ headers['x-prerender-revalidate'] = this.renderOpts.previewProps.previewModeId;
76
+ }
54
77
  }
55
78
  return handler(req, res, parsedUrl);
56
79
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/plugin-nextjs",
3
- "version": "4.40.2",
3
+ "version": "4.41.0-alpha-isr-blobs.0",
4
4
  "description": "Run Next.js seamlessly on Netlify",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -12,7 +12,8 @@
12
12
  "manifest.yml"
13
13
  ],
14
14
  "dependencies": {
15
- "@netlify/esbuild": "0.14.39",
15
+ "@netlify/blobs": "^2.0.0",
16
+ "@netlify/esbuild": "0.14.39-1",
16
17
  "@netlify/functions": "^1.6.0",
17
18
  "@netlify/ipx": "^1.4.5",
18
19
  "@vercel/node-bridge": "^2.1.0",
@@ -54,6 +55,7 @@
54
55
  "publish:test": "cd .. && npm ci && npm test",
55
56
  "clean": "rimraf lib dist-types",
56
57
  "build": "run-s build:*",
58
+ "build:blob": "node blob-cjs-build.mjs",
57
59
  "build:vendor": "rimraf src/templates/vendor && deno vendor src/templates/vendor.ts --output=src/templates/vendor && patch src/templates/vendor/deno.land/x/html_rewriter@v0.1.0-pre.17/index.ts html_rewriter.patch",
58
60
  "build:tsc": "tsc",
59
61
  "watch": "tsc --watch",
@@ -1,13 +1,8 @@
1
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
2
+ var E=Object.create;var h=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var C=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var U=(i,r)=>()=>(r||i((r={exports:{}}).exports,r),r.exports);var N=(i,r,o,m)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of k(r))!A.call(i,s)&&s!==o&&h(i,s,{get:()=>r[s],enumerable:!(m=b(r,s))||m.enumerable});return i};var O=(i,r,o)=>(o=i!=null?E(C(i)):{},N(r||!i||!i.__esModule?h(o,"default",{value:i,enumerable:!0}):o,i));var S=U((I,y)=>{(()=>{"use strict";typeof __nccwpck_require__<"u"&&(__nccwpck_require__.ab="https://esm.sh/v91/next@12.2.5/deno/dist/compiled/");var i={};(()=>{var r=i;r.parse=g,r.serialize=x;var o=decodeURIComponent,m=encodeURIComponent,s=/; */,v=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function g(a,f){if(typeof a!="string")throw new TypeError("argument str must be a string");for(var p={},e=f||{},u=a.split(s),d=e.decode||o,t=0;t<u.length;t++){var n=u[t],c=n.indexOf("=");if(!(c<0)){var w=n.substr(0,c).trim(),l=n.substr(++c,n.length).trim();l[0]=='"'&&(l=l.slice(1,-1)),p[w]==null&&(p[w]=T(l,d))}}return p}function x(a,f,p){var e=p||{},u=e.encode||m;if(typeof u!="function")throw new TypeError("option encode is invalid");if(!v.test(a))throw new TypeError("argument name is invalid");var d=u(f);if(d&&!v.test(d))throw new TypeError("argument val is invalid");var t=a+"="+d;if(e.maxAge!=null){var n=e.maxAge-0;if(isNaN(n)||!isFinite(n))throw new TypeError("option maxAge is invalid");t+="; Max-Age="+Math.floor(n)}if(e.domain){if(!v.test(e.domain))throw new TypeError("option domain is invalid");t+="; Domain="+e.domain}if(e.path){if(!v.test(e.path))throw new TypeError("option path is invalid");t+="; Path="+e.path}if(e.expires){if(typeof e.expires.toUTCString!="function")throw new TypeError("option expires is invalid");t+="; Expires="+e.expires.toUTCString()}if(e.httpOnly&&(t+="; HttpOnly"),e.secure&&(t+="; Secure"),e.sameSite){var c=typeof e.sameSite=="string"?e.sameSite.toLowerCase():e.sameSite;switch(c){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 T(a,f){try{return f(a)}catch{return a}}})(),y.exports=i})()});var q=O(S()),{default:_,...z}=q,L=_!==void 0?_:z;export{L as default};
3
+ /*!
4
+ * cookie
5
+ * Copyright(c) 2012-2014 Roman Shtylman
6
+ * Copyright(c) 2015 Douglas Christopher Wilson
7
+ * MIT Licensed
8
+ */
@@ -0,0 +1,9 @@
1
+ /* esm.sh - esbuild bundle(next@12.2.5/dist/server/web/error) deno production */
2
+ var l=Object.create;var c=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var _=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var w=(e,r,t,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of f(r))!h.call(e,s)&&s!==t&&c(e,s,{get:()=>r[s],enumerable:!(u=g(r,s))||u.enumerable});return e};var v=(e,r,t)=>(t=e!=null?l(x(e)):{},w(r||!e||!e.__esModule?c(t,"default",{value:e,enumerable:!0}):t,e));var i=_(o=>{"use strict";Object.defineProperty(o,"__esModule",{value:!0});var a=class extends Error{constructor({page:r}){super(`The middleware "${r}" accepts an async API directly with the form:
3
+
4
+ export function middleware(request, event) {
5
+ return NextResponse.redirect('/new-location')
6
+ }
7
+
8
+ Read more: https://nextjs.org/docs/messages/middleware-new-signature
9
+ `)}};o.PageSignatureError=a;var n=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 ")}};o.RemovedPageError=n;var d=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 ")}};o.RemovedUAError=d});var p=v(i()),j=!0,{PageSignatureError:q,RemovedPageError:b,RemovedUAError:y}=p,{default:m,...R}=p,A=m!==void 0?m:R;export{q as PageSignatureError,b as RemovedPageError,y as RemovedUAError,j as __esModule,A as default};
@@ -0,0 +1,2 @@
1
+ /* esm.sh - esbuild bundle(next@12.2.5/dist/server/web/next-url) deno production */
2
+ import __next_dist_shared_lib_router_utils_get_next_pathname_info$ from "/v91/next@12.2.5/deno/dist/shared/lib/router/utils/get-next-pathname-info.js";import __next_dist_shared_lib_get_hostname$ from "/v91/next@12.2.5/deno/dist/shared/lib/get-hostname.js";import __next_dist_shared_lib_router_utils_format_next_pathname_info$ from "/v91/next@12.2.5/deno/dist/shared/lib/router/utils/format-next-pathname-info.js";import __next_dist_shared_lib_i18n_detect_domain_locale$ from "/v91/next@12.2.5/deno/dist/shared/lib/i18n/detect-domain-locale.js";var _=Object.create;var p=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty;var l=(s=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(s,{get:(t,r)=>(typeof require!="undefined"?require:t)[r]}):s)(function(s){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+s+'" is not supported')});var w=(s,t)=>()=>(t||s((t={exports:{}}).exports,t),t.exports);var y=(s,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of I(t))!S.call(s,a)&&a!==r&&p(s,a,{get:()=>t[a],enumerable:!(o=v(t,a))||o.enumerable});return s};var N=(s,t,r)=>(r=s!=null?_(x(s)):{},y(t||!s||!s.__esModule?p(r,"default",{value:s,enumerable:!0}):r,s));var L=w(u=>{"use strict";Object.defineProperty(u,"__esModule",{value:!0});var U=__next_dist_shared_lib_i18n_detect_domain_locale$,C=__next_dist_shared_lib_router_utils_format_next_pathname_info$,$=__next_dist_shared_lib_get_hostname$,R=__next_dist_shared_lib_router_utils_get_next_pathname_info$,e=Symbol("NextURLInternal"),n=class{constructor(t,r,o){let a,h;typeof r=="object"&&"pathname"in r||typeof r=="string"?(a=r,h=o||{}):h=o||r||{},this[e]={url:g(t,a??h.base),options:h,basePath:""},this.analyzeUrl()}analyzeUrl(){var t,r,o,a,h;let i=R.getNextPathnameInfo(this[e].url.pathname,{nextConfig:this[e].options.nextConfig,parseData:!0});this[e].domainLocale=U.detectDomainLocale((t=this[e].options.nextConfig)==null||(r=t.i18n)==null?void 0:r.domains,$.getHostname(this[e].url,this[e].options.headers));let c=((o=this[e].domainLocale)==null?void 0:o.defaultLocale)||((a=this[e].options.nextConfig)==null||(h=a.i18n)==null?void 0:h.defaultLocale);this[e].url.pathname=i.pathname,this[e].defaultLocale=c;var d;this[e].basePath=(d=i.basePath)!=null?d:"",this[e].buildId=i.buildId;var m;this[e].locale=(m=i.locale)!=null?m:c,this[e].trailingSlash=i.trailingSlash}formatPathname(){return C.formatNextPathnameInfo({basePath:this[e].basePath,buildId:this[e].buildId,defaultLocale:this[e].options.forceLocale?void 0:this[e].defaultLocale,locale:this[e].locale,pathname:this[e].url.pathname,trailingSlash:this[e].trailingSlash})}get buildId(){return this[e].buildId}set buildId(t){this[e].buildId=t}get locale(){var t;return(t=this[e].locale)!=null?t:""}set locale(t){var r,o;if(!this[e].locale||!(!((r=this[e].options.nextConfig)==null||(o=r.i18n)==null)&&o.locales.includes(t)))throw new TypeError(`The NextURL configuration includes no locale "${t}"`);this[e].locale=t}get defaultLocale(){return this[e].defaultLocale}get domainLocale(){return this[e].domainLocale}get searchParams(){return this[e].url.searchParams}get host(){return this[e].url.host}set host(t){this[e].url.host=t}get hostname(){return this[e].url.hostname}set hostname(t){this[e].url.hostname=t}get port(){return this[e].url.port}set port(t){this[e].url.port=t}get protocol(){return this[e].url.protocol}set protocol(t){this[e].url.protocol=t}get href(){let t=this.formatPathname();return`${this.protocol}//${this.host}${t}${this[e].url.search}`}set href(t){this[e].url=g(t),this.analyzeUrl()}get origin(){return this[e].url.origin}get pathname(){return this[e].url.pathname}set pathname(t){this[e].url.pathname=t}get hash(){return this[e].url.hash}set hash(t){this[e].url.hash=t}get search(){return this[e].url.search}set search(t){this[e].url.search=t}get password(){return this[e].url.password}set password(t){this[e].url.password=t}get username(){return this[e].url.username}set username(t){this[e].url.username=t}get basePath(){return this[e].basePath}set basePath(t){this[e].basePath=t.startsWith("/")?t:`/${t}`}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 n(String(this),this[e].options)}};u.NextURL=n;var f=/(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|::1|localhost)/;function g(s,t){return new URL(String(s).replace(f,"localhost"),t&&String(t).replace(f,"localhost"))}});var b=N(L()),T=!0,{NextURL:z}=b,{default:P,...q}=b,D=P!==void 0?P:q;export{z as NextURL,T as __esModule,D as default};
@@ -0,0 +1,2 @@
1
+ /* esm.sh - esbuild bundle(next@12.2.5/dist/server/web/spec-extension/cookies) deno production */
2
+ import __next_dist_compiled_cookie$ from "/v91/next@12.2.5/deno/dist/compiled/cookie.js";var x=Object.create;var l=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var O=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var j=(t=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(t,{get:(e,s)=>(typeof require!="undefined"?require:e)[s]}):t)(function(t){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var z=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var w=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of C(e))!y.call(t,i)&&i!==s&&l(t,i,{get:()=>e[i],enumerable:!(r=m(e,i))||r.enumerable});return t};var v=(t,e,s)=>(s=t!=null?x(O(t)):{},w(e||!t||!t.__esModule?l(s,"default",{value:t,enumerable:!0}):s,t));var h=z(a=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});var o=A(__next_dist_compiled_cookie$);function A(t){return t&&t.__esModule?t:{default:t}}var D=t=>(t=Object.assign({},t),t.maxAge&&(t.expires=new Date(Date.now()+t.maxAge*1e3)),t.path==null&&(t.path="/"),t),M=t=>typeof t=="object"?`j:${JSON.stringify(t)}`:String(t),p=(t,e={})=>o.default.serialize(t,"",{expires:new Date(0),path:"/",...e}),d=t=>{let e=t.headers.get("set-cookie");return e!=null?e.split(", "):[]},f=t=>t.join(", "),n=class extends Map{constructor(e){let s=typeof e=="string"?o.default.parse(e):{};super(Object.entries(s))}set(e,s,r={}){return super.set(e,o.default.serialize(e,M(s),D(r)))}[Symbol.for("edge-runtime.inspect.custom")](){return Object.fromEntries(this.entries())}};a.Cookies=n;var c=class extends n{constructor(e){super(e.headers.get("cookie")),this.response=e}get=(...e)=>this.getWithOptions(...e).value;getWithOptions=(...e)=>{let s=super.get(...e);if(typeof s!="string")return{value:s,options:{}};let{[e[0]]:r,...i}=o.default.parse(s);return{value:r,options:i}};set=(...e)=>{let s=super.has(e[0]);super.set(...e);let r=super.get(e[0]);if(typeof r!="string")throw new Error(`Invariant: failed to generate cookie for ${JSON.stringify(e)}`);if(s){let i=f(d(this.response).filter(u=>!u.startsWith(`${e[0]}=`)));i?this.response.headers.set("set-cookie",[r,i].join(", ")):this.response.headers.set("set-cookie",r)}else this.response.headers.append("set-cookie",r);return this};delete=(e,s={})=>{let r=super.delete(e);if(r){let i=f(d(this.response).filter(g=>!g.startsWith(`${e}=`))),u=p(e,s);this.response.headers.set("set-cookie",[u,i].join(", "))}return r};clear=(e={})=>{let s=Array.from(super.keys()).map(r=>p(r,e)).join(", ");return s&&this.response.headers.set("set-cookie",s),super.clear()}};a.NextCookies=c});var _=v(h()),b=!0,{Cookies:E,NextCookies:N}=_,{default:k,...S}=_,q=k!==void 0?k:S;export{E as Cookies,N as NextCookies,b as __esModule,q as default};
@@ -1,12 +1,2 @@
1
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
2
+ import __next_dist_server_web_error$ from "/v91/next@12.2.5/deno/dist/server/web/error.js";import __next_dist_server_web_utils$ from "/v91/next@12.2.5/deno/dist/server/web/utils.js";import __next_dist_server_web_next_url$ from "/v91/next@12.2.5/deno/dist/server/web/next-url.js";import __next_dist_server_web_spec_extension_cookies$ from "/v91/next@12.2.5/deno/dist/server/web/spec-extension/cookies.js";var m=Object.create;var d=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var h=(r=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(r,{get:(e,t)=>(typeof require!="undefined"?require:e)[t]}):r)(function(r){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+r+'" is not supported')});var v=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var y=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of _(e))!N.call(r,o)&&o!==t&&d(r,o,{get:()=>e[o],enumerable:!(i=p(e,o))||i.enumerable});return r};var R=(r,e,t)=>(t=r!=null?m(x(r)):{},y(e||!r||!r.__esModule?d(t,"default",{value:r,enumerable:!0}):t,r));var c=v(n=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.INTERNALS=void 0;var k=__next_dist_server_web_next_url$,l=__next_dist_server_web_utils$,a=__next_dist_server_web_error$,U=__next_dist_server_web_spec_extension_cookies$,s=Symbol("internal request");n.INTERNALS=s;var u=class extends Request{constructor(e,t={}){let i=typeof e!="string"&&"url"in e?e.url:String(e);l.validateURL(i),super(i,t),this[s]={cookies:new U.NextCookies(this),geo:t.geo||{},ip:t.ip,url:new k.NextURL(i,{headers:l.toNodeHeaders(this.headers),nextConfig:t.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[s].cookies}get geo(){return this[s].geo}get ip(){return this[s].ip}get nextUrl(){return this[s].url}get page(){throw new a.RemovedPageError}get ua(){throw new a.RemovedUAError}get url(){return this[s].url.toString()}};n.NextRequest=u});var f=R(c()),b=!0,{INTERNALS:w,NextRequest:L}=f,{default:g,...S}=f,A=g!==void 0?g:S;export{w as INTERNALS,L as NextRequest,b as __esModule,A as default};
@@ -1,5 +1,2 @@
1
1
  /* esm.sh - esbuild bundle(next@12.2.5/dist/server/web/spec-extension/response) 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 fe=Object.create;var b=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var me=Object.getOwnPropertyNames;var Pe=Object.getPrototypeOf,ve=Object.prototype.hasOwnProperty;var ge=(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 u=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),xe=(t,e)=>{for(var r in e)b(t,r,{get:e[r],enumerable:!0})},_=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of me(e))!ve.call(t,o)&&o!==r&&b(t,o,{get:()=>e[o],enumerable:!(s=pe(e,o))||s.enumerable});return t},c=(t,e,r)=>(_(t,e,"default"),r&&_(r,e,"default")),D=(t,e,r)=>(r=t!=null?fe(Pe(t)):{},_(e||!t||!t.__esModule?b(r,"default",{value:t,enumerable:!0}):r,t));var T=u(y=>{"use strict";Object.defineProperty(y,"__esModule",{value:!0});y.detectDomainLocale=_e;function _e(t,e,r){let s;if(t){r&&(r=r.toLowerCase());for(let n of t){var o,i;let l=(o=n.domain)==null?void 0:o.split(":")[0].toLowerCase();if(e===l||r===n.defaultLocale.toLowerCase()||(i=n.locales)!=null&&i.some(h=>h.toLowerCase()===r)){s=n;break}}}return s}});var J=u(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.removeTrailingSlash=be;function be(t){return t.replace(/\/$/,"")||"/"}});var m=u(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.parsePath=ye;function ye(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 C=u(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.addPathPrefix=Le;var we=m();function Le(t,e){if(!t.startsWith("/")||!e)return t;let{pathname:r,query:s,hash:o}=we.parsePath(t);return`${e}${r}${s}${o}`}});var F=u(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.addPathSuffix=Ce;var je=m();function Ce(t,e){if(!t.startsWith("/")||!e)return t;let{pathname:r,query:s,hash:o}=je.parsePath(t);return`${r}${e}${s}${o}`}});var P=u(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.pathHasPrefix=Se;var Ie=m();function Se(t,e){if(typeof t!="string")return!1;let{pathname:r}=Ie.parsePath(t);return r===e||r.startsWith(e+"/")}});var Q=u(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.addLocale=He;var qe=C(),G=P();function He(t,e,r,s){return e&&e!==r&&(s||!G.pathHasPrefix(t.toLowerCase(),`/${e.toLowerCase()}`)&&!G.pathHasPrefix(t.toLowerCase(),"/api"))?qe.addPathPrefix(t,`/${e}`):t}});var B=u(H=>{"use strict";Object.defineProperty(H,"__esModule",{value:!0});H.formatNextPathnameInfo=Ne;var Oe=J(),V=C(),X=F(),$e=Q();function Ne(t){let e=$e.addLocale(t.pathname,t.locale,t.buildId?void 0:t.defaultLocale,t.ignorePrefix);return t.buildId&&(e=X.addPathSuffix(V.addPathPrefix(e,`/_next/data/${t.buildId}`),t.pathname==="/"?"index.json":".json")),e=V.addPathPrefix(e,t.basePath),t.trailingSlash?!t.buildId&&!e.endsWith("/")?X.addPathSuffix(e,"/"):e:Oe.removeTrailingSlash(e)}});var K=u(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.getHostname=ke;function ke(t,e){var r;return(r=!Array.isArray(e?.host)&&e?.host||t.hostname)==null?void 0:r.split(":")[0].toLowerCase()}});var Y=u($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.normalizeLocalePath=Re;function Re(t,e){let r,s=t.split("/");return(e||[]).some(o=>s[1]&&s[1].toLowerCase()===o.toLowerCase()?(r=o,s.splice(1,1),t=s.join("/")||"/",!0):!1),{pathname:t,detectedLocale:r}}});var Z=u(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.removePathPrefix=Ue;var Me=P();function Ue(t,e){if(Me.pathHasPrefix(t,e)){let r=t.slice(e.length);return r.startsWith("/")?r:`/${r}`}return t}});var ee=u(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.getNextPathnameInfo=Ee;var Ae=Y(),ze=Z(),We=P();function Ee(t,e){var r;let{basePath:s,i18n:o,trailingSlash:i}=(r=e.nextConfig)!=null?r:{},n={pathname:t,trailingSlash:t!=="/"?t.endsWith("/"):i};if(s&&We.pathHasPrefix(n.pathname,s)&&(n.pathname=ze.removePathPrefix(n.pathname,s),n.basePath=s),e.parseData===!0&&n.pathname.startsWith("/_next/data/")&&n.pathname.endsWith(".json")){let l=n.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/"),h=l[0];n.pathname=l[1]!=="index"?`/${l.slice(1).join("/")}`:"/",n.buildId=h}if(o){let l=Ae.normalizeLocalePath(n.pathname,o.locales);n.locale=l?.detectedLocale,n.pathname=l?.pathname||n.pathname}return n}});var se=u(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});var De=T(),Te=B(),Je=K(),Fe=ee(),a=Symbol("NextURLInternal"),R=class t{constructor(e,r,s){let o,i;typeof r=="object"&&"pathname"in r||typeof r=="string"?(o=r,i=s||{}):i=s||r||{},this[a]={url:re(e,o??i.base),options:i,basePath:""},this.analyzeUrl()}analyzeUrl(){var e,r,s,o,i;let n=Fe.getNextPathnameInfo(this[a].url.pathname,{nextConfig:this[a].options.nextConfig,parseData:!0});this[a].domainLocale=De.detectDomainLocale((e=this[a].options.nextConfig)==null||(r=e.i18n)==null?void 0:r.domains,Je.getHostname(this[a].url,this[a].options.headers));let l=((s=this[a].domainLocale)==null?void 0:s.defaultLocale)||((o=this[a].options.nextConfig)==null||(i=o.i18n)==null?void 0:i.defaultLocale);this[a].url.pathname=n.pathname,this[a].defaultLocale=l;var h;this[a].basePath=(h=n.basePath)!=null?h:"",this[a].buildId=n.buildId;var p;this[a].locale=(p=n.locale)!=null?p:l,this[a].trailingSlash=n.trailingSlash}formatPathname(){return Te.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=re(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)}};M.NextURL=R;var te=/(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|::1|localhost)/;function re(t,e){return new URL(String(t).replace(te,"localhost"),e&&String(e).replace(te,"localhost"))}});var oe=u(f=>{"use strict";Object.defineProperty(f,"__esModule",{value:!0});f.fromNodeHeaders=Ge;f.toNodeHeaders=Qe;f.splitCookiesString=ae;f.validateURL=Ve;function Ge(t){let e=new Headers;for(let[r,s]of Object.entries(t)){let o=Array.isArray(s)?s:[s];for(let i of o)i!==void 0&&e.append(r,i)}return e}function Qe(t){let e={};if(t)for(let[r,s]of t.entries())e[r]=s,r.toLowerCase()==="set-cookie"&&(e[r]=ae(s));return e}function ae(t){var e=[],r=0,s,o,i,n,l;function h(){for(;r<t.length&&/\s/.test(t.charAt(r));)r+=1;return r<t.length}function p(){return o=t.charAt(r),o!=="="&&o!==";"&&o!==","}for(;r<t.length;){for(s=r,l=!1;h();)if(o=t.charAt(r),o===","){for(i=r,r+=1,h(),n=r;r<t.length&&p();)r+=1;r<t.length&&t.charAt(r)==="="?(l=!0,r=n,e.push(t.substring(s,i)),s=r):r=i+1}else r+=1;(!l||r>=t.length)&&e.push(t.substring(s,t.length))}return e}function Ve(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 ue=u(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});var v=Xe(ge("next/dist/compiled/cookie"));function Xe(t){return t&&t.__esModule?t:{default:t}}var Be=t=>(t=Object.assign({},t),t.maxAge&&(t.expires=new Date(Date.now()+t.maxAge*1e3)),t.path==null&&(t.path="/"),t),Ke=t=>typeof t=="object"?`j:${JSON.stringify(t)}`:String(t),ne=(t,e={})=>v.default.serialize(t,"",{expires:new Date(0),path:"/",...e}),ie=t=>{let e=t.headers.get("set-cookie");return e!=null?e.split(", "):[]},le=t=>t.join(", "),g=class extends Map{constructor(e){let r=typeof e=="string"?v.default.parse(e):{};super(Object.entries(r))}set(e,r,s={}){return super.set(e,v.default.serialize(e,Ke(r),Be(s)))}[Symbol.for("edge-runtime.inspect.custom")](){return Object.fromEntries(this.entries())}};x.Cookies=g;var U=class extends g{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,...o}=v.default.parse(r);return{value:s,options:o}};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 o=le(ie(this.response).filter(i=>!i.startsWith(`${e[0]}=`)));o?this.response.headers.set("set-cookie",[s,o].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 o=le(ie(this.response).filter(n=>!n.startsWith(`${e}=`))),i=ne(e,r);this.response.headers.set("set-cookie",[i,o].join(", "))}return s};clear=(e={})=>{let r=Array.from(super.keys()).map(s=>ne(s,e)).join(", ");return r&&this.response.headers.set("set-cookie",r),super.clear()}};x.NextCookies=U});var E=u(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});var Ye=se(),A=oe(),Ze=ue(),he=Symbol("internal response"),et=new Set([301,302,303,307,308]),z=class t extends Response{constructor(e,r={}){super(e,r),this[he]={cookies:new Ze.NextCookies(this),url:r.url?new Ye.NextURL(r.url,{headers:A.toNodeHeaders(this.headers),nextConfig:r.nextConfig}):void 0}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,url:this.url,body:this.body,bodyUsed:this.bodyUsed,headers:Object.fromEntries(this.headers),ok:this.ok,redirected:this.redirected,status:this.status,statusText:this.statusText,type:this.type}}get cookies(){return this[he].cookies}static json(e,r){let s=Response.json(e,r);return new t(s.body,s)}static redirect(e,r){var s;let o=typeof r=="number"?r:(s=r?.status)!=null?s:307;if(!et.has(o))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');let i=typeof r=="object"?r:{},n=new Headers(i?.headers);return n.set("Location",A.validateURL(e)),new t(null,{...i,headers:n,status:o})}static rewrite(e,r){let s=new Headers(r?.headers);return s.set("x-middleware-rewrite",A.validateURL(e)),new t(null,{...r,headers:s})}static next(e){let r=new Headers(e?.headers);return r.set("x-middleware-next","1"),new t(null,{...e,headers:r})}};W.NextResponse=z});var d={};xe(d,{NextResponse:()=>rt,__esModule:()=>tt,default:()=>at});var ce=D(E());c(d,D(E()));var{__esModule:tt,NextResponse:rt}=ce,{default:de,...st}=ce,at=de!==void 0?de:st;export{rt as NextResponse,tt as __esModule,at as default};
5
- //# sourceMappingURL=response.js.map
2
+ import __next_dist_server_web_spec_extension_cookies$ from "/v91/next@12.2.5/deno/dist/server/web/spec-extension/cookies.js";import __next_dist_server_web_utils$ from "/v91/next@12.2.5/deno/dist/server/web/utils.js";import __next_dist_server_web_next_url$ from "/v91/next@12.2.5/deno/dist/server/web/next-url.js";var x=Object.create;var i=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty;var u=(s=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(s,{get:(t,e)=>(typeof require!="undefined"?require:t)[e]}):s)(function(s){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+s+'" is not supported')});var k=(s,t)=>()=>(t||s((t={exports:{}}).exports,t),t.exports);var _=(s,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of v(t))!m.call(s,o)&&o!==e&&i(s,o,{get:()=>t[o],enumerable:!(r=b(t,o))||r.enumerable});return s};var j=(s,t,e)=>(e=s!=null?x(y(s)):{},_(t||!s||!s.__esModule?i(e,"default",{value:s,enumerable:!0}):e,s));var w=k(l=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0});var R=__next_dist_server_web_next_url$,a=__next_dist_server_web_utils$,U=__next_dist_server_web_spec_extension_cookies$,h=Symbol("internal response"),g=new Set([301,302,303,307,308]),d=class extends Response{constructor(t,e={}){super(t,e),this[h]={cookies:new U.NextCookies(this),url:e.url?new R.NextURL(e.url,{headers:a.toNodeHeaders(this.headers),nextConfig:e.nextConfig}):void 0}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,url:this.url,body:this.body,bodyUsed:this.bodyUsed,headers:Object.fromEntries(this.headers),ok:this.ok,redirected:this.redirected,status:this.status,statusText:this.statusText,type:this.type}}get cookies(){return this[h].cookies}static json(t,e){let r=Response.json(t,e);return new d(r.body,r)}static redirect(t,e){var r;let o=typeof e=="number"?e:(r=e?.status)!=null?r:307;if(!g.has(o))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');let n=typeof e=="object"?e:{},c=new Headers(n?.headers);return c.set("Location",a.validateURL(t)),new d(null,{...n,headers:c,status:o})}static rewrite(t,e){let r=new Headers(e?.headers);return r.set("x-middleware-rewrite",a.validateURL(t)),new d(null,{...e,headers:r})}static next(t){let e=new Headers(t?.headers);return e.set("x-middleware-next","1"),new d(null,{...t,headers:e})}};l.NextResponse=d});var p=j(w()),C=!0,{NextResponse:H}=p,{default:f,...E}=p,T=f!==void 0?f:E;export{H as NextResponse,C as __esModule,T as default};
@@ -0,0 +1,2 @@
1
+ /* esm.sh - esbuild bundle(next@12.2.5/dist/server/web/utils) deno production */
2
+ var m=Object.create;var f=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty;var L=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var A=(e,r,t,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of _(r))!H.call(e,s)&&s!==t&&f(e,s,{get:()=>r[s],enumerable:!(a=w(r,s))||a.enumerable});return e};var C=(e,r,t)=>(t=e!=null?m(y(e)):{},A(r||!e||!e.__esModule?f(t,"default",{value:e,enumerable:!0}):t,e));var h=L(o=>{"use strict";Object.defineProperty(o,"__esModule",{value:!0});o.fromNodeHeaders=N;o.toNodeHeaders=R;o.splitCookiesString=i;o.validateURL=U;function N(e){let r=new Headers;for(let[t,a]of Object.entries(e)){let s=Array.isArray(a)?a:[a];for(let n of s)n!==void 0&&r.append(t,n)}return r}function R(e){let r={};if(e)for(let[t,a]of e.entries())r[t]=a,t.toLowerCase()==="set-cookie"&&(r[t]=i(a));return r}function i(e){var r=[],t=0,a,s,n,u,l;function d(){for(;t<e.length&&/\s/.test(e.charAt(t));)t+=1;return t<e.length}function v(){return s=e.charAt(t),s!=="="&&s!==";"&&s!==","}for(;t<e.length;){for(a=t,l=!1;d();)if(s=e.charAt(t),s===","){for(n=t,t+=1,d(),u=t;t<e.length&&v();)t+=1;t<e.length&&e.charAt(t)==="="?(l=!0,t=u,r.push(e.substring(a,n)),a=t):t=n+1}else t+=1;(!l||t>=e.length)&&r.push(e.substring(a,e.length))}return r}function U(e){try{return String(new URL(String(e)))}catch(r){throw new Error("URLs is malformed. Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls",{cause:r})}}});var p=C(h()),j=!0,{fromNodeHeaders:M,toNodeHeaders:O,splitCookiesString:P,validateURL:E}=p,{default:c,...b}=p,F=c!==void 0?c:b;export{j as __esModule,F as default,M as fromNodeHeaders,P as splitCookiesString,O as toNodeHeaders,E as validateURL};
@@ -0,0 +1,2 @@
1
+ /* esm.sh - esbuild bundle(next@12.2.5/dist/shared/lib/get-hostname) deno production */
2
+ var _=Object.create;var s=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var m=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty;var p=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var v=(e,t,o,u)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of f(t))!c.call(e,r)&&r!==o&&s(e,r,{get:()=>t[r],enumerable:!(u=d(t,r))||u.enumerable});return e};var g=(e,t,o)=>(o=e!=null?_(m(e)):{},v(t||!e||!e.__esModule?s(o,"default",{value:e,enumerable:!0}):o,e));var l=p(n=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.getHostname=x;function x(e,t){var o;return(o=!Array.isArray(t?.host)&&t?.host||e.hostname)==null?void 0:o.split(":")[0].toLowerCase()}});var i=g(l()),M=!0,{getHostname:b}=i,{default:a,...y}=i,j=a!==void 0?a:y;export{M as __esModule,j as default,b as getHostname};
@@ -0,0 +1,2 @@
1
+ /* esm.sh - esbuild bundle(next@12.2.5/dist/shared/lib/i18n/detect-domain-locale) deno production */
2
+ var c=Object.create;var l=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var w=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var L=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var x=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of v(e))!C.call(o,a)&&a!==t&&l(o,a,{get:()=>e[a],enumerable:!(n=p(e,a))||n.enumerable});return o};var D=(o,e,t)=>(t=o!=null?c(w(o)):{},x(e||!o||!o.__esModule?l(t,"default",{value:o,enumerable:!0}):t,o));var u=L(s=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0});s.detectDomainLocale=b;function b(o,e,t){let n;if(o){t&&(t=t.toLowerCase());for(let r of o){var a,i;let _=(a=r.domain)==null?void 0:a.split(":")[0].toLowerCase();if(e===_||t===r.defaultLocale.toLowerCase()||((i=r.locales)==null?void 0:i.some(d=>d.toLowerCase()===t))){n=r;break}}}return n}});var m=D(u()),y=!0,{detectDomainLocale:H}=m,{default:f,...M}=m,O=f!==void 0?f:M;export{y as __esModule,O as default,H as detectDomainLocale};
@@ -0,0 +1,2 @@
1
+ /* esm.sh - esbuild bundle(next@12.2.5/dist/shared/lib/i18n/normalize-locale-path) deno production */
2
+ var i=Object.create;var l=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty;var p=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var L=(e,t,o,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of _(t))!m.call(e,r)&&r!==o&&l(e,r,{get:()=>t[r],enumerable:!(s=d(t,r))||s.enumerable});return e};var P=(e,t,o)=>(o=e!=null?i(f(e)):{},L(t||!e||!e.__esModule?l(o,"default",{value:e,enumerable:!0}):o,e));var u=p(a=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.normalizeLocalePath=x;function x(e,t){let o,s=e.split("/");return(t||[]).some(r=>s[1]&&s[1].toLowerCase()===r.toLowerCase()?(o=r,s.splice(1,1),e=s.join("/")||"/",!0):!1),{pathname:e,detectedLocale:o}}});var c=P(u()),w=!0,{normalizeLocalePath:C}=c,{default:n,...z}=c,M=n!==void 0?n:z;export{w as __esModule,M as default,C as normalizeLocalePath};
@@ -0,0 +1,2 @@
1
+ /* esm.sh - esbuild bundle(next@12.2.5/dist/shared/lib/router/utils/add-locale) deno production */
2
+ import __next_dist_shared_lib_router_utils_path_has_prefix$ from "/v91/next@12.2.5/deno/dist/shared/lib/router/utils/path-has-prefix.js";import __next_dist_shared_lib_router_utils_add_path_prefix$ from "/v91/next@12.2.5/deno/dist/shared/lib/router/utils/add-path-prefix.js";var x=Object.create;var u=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var p=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty;var s=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(r,t)=>(typeof require!="undefined"?require:r)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var l=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var m=(e,r,t,d)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of c(r))!L.call(e,a)&&a!==t&&u(e,a,{get:()=>r[a],enumerable:!(d=P(r,a))||d.enumerable});return e};var v=(e,r,t)=>(t=e!=null?x(p(e)):{},m(r||!e||!e.__esModule?u(t,"default",{value:e,enumerable:!0}):t,e));var f=l(o=>{"use strict";Object.defineProperty(o,"__esModule",{value:!0});o.addLocale=C;var w=__next_dist_shared_lib_router_utils_add_path_prefix$,i=__next_dist_shared_lib_router_utils_path_has_prefix$;function C(e,r,t,d){return r&&r!==t&&(d||!i.pathHasPrefix(e.toLowerCase(),`/${r.toLowerCase()}`)&&!i.pathHasPrefix(e.toLowerCase(),"/api"))?w.addPathPrefix(e,`/${r}`):e}});var n=v(f()),M=!0,{addLocale:$}=n,{default:_,...H}=n,b=_!==void 0?_:H;export{M as __esModule,$ as addLocale,b as default};
@@ -0,0 +1,2 @@
1
+ /* esm.sh - esbuild bundle(next@12.2.5/dist/shared/lib/router/utils/add-path-prefix) deno production */
2
+ import __next_dist_shared_lib_router_utils_parse_path$ from "/v91/next@12.2.5/deno/dist/shared/lib/router/utils/parse-path.js";var f=Object.create;var s=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var c=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var l=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,r)=>(typeof require!="undefined"?require:t)[r]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var p=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var x=(e,t,r,u)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of P(t))!h.call(e,a)&&a!==r&&s(e,a,{get:()=>t[a],enumerable:!(u=i(t,a))||u.enumerable});return e};var m=(e,t,r)=>(r=e!=null?f(c(e)):{},x(t||!e||!e.__esModule?s(r,"default",{value:e,enumerable:!0}):r,e));var o=p(d=>{"use strict";Object.defineProperty(d,"__esModule",{value:!0});d.addPathPrefix=q;var $=__next_dist_shared_lib_router_utils_parse_path$;function q(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:u,hash:a}=$.parsePath(e);return`${t}${r}${u}${a}`}});var _=m(o()),b=!0,{addPathPrefix:j}=_,{default:n,...v}=_,O=n!==void 0?n:v;export{b as __esModule,j as addPathPrefix,O as default};
@@ -0,0 +1,2 @@
1
+ /* esm.sh - esbuild bundle(next@12.2.5/dist/shared/lib/router/utils/add-path-suffix) deno production */
2
+ import __next_dist_shared_lib_router_utils_parse_path$ from "/v91/next@12.2.5/deno/dist/shared/lib/router/utils/parse-path.js";var _=Object.create;var o=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty;var p=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,r)=>(typeof require!="undefined"?require:t)[r]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var P=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var x=(e,t,r,u)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of c(t))!l.call(e,a)&&a!==r&&o(e,a,{get:()=>t[a],enumerable:!(u=i(t,a))||u.enumerable});return e};var m=(e,t,r)=>(r=e!=null?_(h(e)):{},x(t||!e||!e.__esModule?o(r,"default",{value:e,enumerable:!0}):r,e));var s=P(d=>{"use strict";Object.defineProperty(d,"__esModule",{value:!0});d.addPathSuffix=S;var $=__next_dist_shared_lib_router_utils_parse_path$;function S(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:u,hash:a}=$.parsePath(e);return`${r}${t}${u}${a}`}});var n=m(s()),M=!0,{addPathSuffix:b}=n,{default:f,...q}=n,j=f!==void 0?f:q;export{M as __esModule,b as addPathSuffix,j as default};
@@ -0,0 +1,2 @@
1
+ /* esm.sh - esbuild bundle(next@12.2.5/dist/shared/lib/router/utils/format-next-pathname-info) deno production */
2
+ import __next_dist_shared_lib_router_utils_add_locale$ from "/v91/next@12.2.5/deno/dist/shared/lib/router/utils/add-locale.js";import __next_dist_shared_lib_router_utils_add_path_suffix$ from "/v91/next@12.2.5/deno/dist/shared/lib/router/utils/add-path-suffix.js";import __next_dist_shared_lib_router_utils_add_path_prefix$ from "/v91/next@12.2.5/deno/dist/shared/lib/router/utils/add-path-prefix.js";import __next_dist_shared_lib_router_utils_remove_trailing_slash$ from "/v91/next@12.2.5/deno/dist/shared/lib/router/utils/remove-trailing-slash.js";var x=Object.create;var i=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var m=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty;var r=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(a,t)=>(typeof require!="undefined"?require:a)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var p=(e,a)=>()=>(a||e((a={exports:{}}).exports,a),a.exports);var v=(e,a,t,l)=>{if(a&&typeof a=="object"||typeof a=="function")for(let d of _(a))!c.call(e,d)&&d!==t&&i(e,d,{get:()=>a[d],enumerable:!(l=P(a,d))||l.enumerable});return e};var I=(e,a,t)=>(t=e!=null?x(m(e)):{},v(a||!e||!e.__esModule?i(t,"default",{value:e,enumerable:!0}):t,e));var h=p(u=>{"use strict";Object.defineProperty(u,"__esModule",{value:!0});u.formatNextPathnameInfo=g;var b=__next_dist_shared_lib_router_utils_remove_trailing_slash$,n=__next_dist_shared_lib_router_utils_add_path_prefix$,o=__next_dist_shared_lib_router_utils_add_path_suffix$,S=__next_dist_shared_lib_router_utils_add_locale$;function g(e){let a=S.addLocale(e.pathname,e.locale,e.buildId?void 0:e.defaultLocale,e.ignorePrefix);return e.buildId&&(a=o.addPathSuffix(n.addPathPrefix(a,`/_next/data/${e.buildId}`),e.pathname==="/"?"index.json":".json")),a=n.addPathPrefix(a,e.basePath),e.trailingSlash?!e.buildId&&!a.endsWith("/")?o.addPathSuffix(a,"/"):a:b.removeTrailingSlash(a)}});var s=I(h()),N=!0,{formatNextPathnameInfo:M}=s,{default:f,...q}=s,T=f!==void 0?f:q;export{N as __esModule,T as default,M as formatNextPathnameInfo};
@@ -0,0 +1,2 @@
1
+ /* esm.sh - esbuild bundle(next@12.2.5/dist/shared/lib/router/utils/get-next-pathname-info) deno production */
2
+ import __next_dist_shared_lib_i18n_normalize_locale_path$ from "/v91/next@12.2.5/deno/dist/shared/lib/i18n/normalize-locale-path.js";import __next_dist_shared_lib_router_utils_path_has_prefix$ from "/v91/next@12.2.5/deno/dist/shared/lib/router/utils/path-has-prefix.js";import __next_dist_shared_lib_router_utils_remove_path_prefix$ from "/v91/next@12.2.5/deno/dist/shared/lib/router/utils/remove-path-prefix.js";var m=Object.create;var h=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var l=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(a,n)=>(typeof require!="undefined"?require:a)[n]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var g=(e,a)=>()=>(a||e((a={exports:{}}).exports,a),a.exports);var b=(e,a,n,i)=>{if(a&&typeof a=="object"||typeof a=="function")for(let r of x(a))!v.call(e,r)&&r!==n&&h(e,r,{get:()=>a[r],enumerable:!(i=_(a,r))||i.enumerable});return e};var I=(e,a,n)=>(n=e!=null?m(P(e)):{},b(a||!e||!e.__esModule?h(n,"default",{value:e,enumerable:!0}):n,e));var d=g(s=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0});s.getNextPathnameInfo=N;var j=__next_dist_shared_lib_i18n_normalize_locale_path$,L=__next_dist_shared_lib_router_utils_remove_path_prefix$,q=__next_dist_shared_lib_router_utils_path_has_prefix$;function N(e,a){var n;let{basePath:i,i18n:r,trailingSlash:c}=(n=a.nextConfig)!=null?n:{},t={pathname:e,trailingSlash:e!=="/"?e.endsWith("/"):c};if(i&&q.pathHasPrefix(t.pathname,i)&&(t.pathname=L.removePathPrefix(t.pathname,i),t.basePath=i),a.parseData===!0&&t.pathname.startsWith("/_next/data/")&&t.pathname.endsWith(".json")){let o=t.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/"),f=o[0];t.pathname=o[1]!=="index"?`/${o.slice(1).join("/")}`:"/",t.buildId=f}if(r){let o=j.normalizeLocalePath(t.pathname,r.locales);t.locale=o?.detectedLocale,t.pathname=o?.pathname||t.pathname}return t}});var u=I(d()),H=!0,{getNextPathnameInfo:M}=u,{default:p,...W}=u,S=p!==void 0?p:W;export{H as __esModule,S as default,M as getNextPathnameInfo};
@@ -0,0 +1,2 @@
1
+ /* esm.sh - esbuild bundle(next@12.2.5/dist/shared/lib/router/utils/parse-path) deno production */
2
+ var f=Object.create;var o=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var l=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var x=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var m=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of _(e))!h.call(t,n)&&n!==r&&o(t,n,{get:()=>e[n],enumerable:!(s=c(e,n))||s.enumerable});return t};var p=(t,e,r)=>(r=t!=null?f(l(t)):{},m(e||!t||!t.__esModule?o(r,"default",{value:t,enumerable:!0}):r,t));var d=x(u=>{"use strict";Object.defineProperty(u,"__esModule",{value:!0});u.parsePath=y;function y(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 i=p(d()),O=!0,{parsePath:g}=i,{default:a,...P}=i,I=a!==void 0?a:P;export{O as __esModule,I as default,g as parsePath};
@@ -0,0 +1,2 @@
1
+ /* esm.sh - esbuild bundle(next@12.2.5/dist/shared/lib/router/utils/path-has-prefix) deno production */
2
+ import __next_dist_shared_lib_router_utils_parse_path$ from "/v91/next@12.2.5/deno/dist/shared/lib/router/utils/parse-path.js";var _=Object.create;var u=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty;var h=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,r)=>(typeof require!="undefined"?require:t)[r]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var P=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var x=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of d(t))!c.call(e,a)&&a!==r&&u(e,a,{get:()=>t[a],enumerable:!(o=p(t,a))||o.enumerable});return e};var m=(e,t,r)=>(r=e!=null?_(l(e)):{},x(t||!e||!e.__esModule?u(r,"default",{value:e,enumerable:!0}):r,e));var n=P(s=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0});s.pathHasPrefix=v;var H=__next_dist_shared_lib_router_utils_parse_path$;function v(e,t){if(typeof e!="string")return!1;let{pathname:r}=H.parsePath(e);return r===t||r.startsWith(t+"/")}});var i=m(n()),g=!0,{pathHasPrefix:j}=i,{default:f,...y}=i,q=f!==void 0?f:y;export{g as __esModule,q as default,j as pathHasPrefix};
@@ -0,0 +1,2 @@
1
+ /* esm.sh - esbuild bundle(next@12.2.5/dist/shared/lib/router/utils/remove-path-prefix) deno production */
2
+ import __next_dist_shared_lib_router_utils_path_has_prefix$ from "/v91/next@12.2.5/deno/dist/shared/lib/router/utils/path-has-prefix.js";var _=Object.create;var s=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty;var x=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,r)=>(typeof require!="undefined"?require:t)[r]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var h=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var m=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of d(t))!c.call(e,o)&&o!==r&&s(e,o,{get:()=>t[o],enumerable:!(i=P(t,o))||i.enumerable});return e};var v=(e,t,r)=>(r=e!=null?_(l(e)):{},m(t||!e||!e.__esModule?s(r,"default",{value:e,enumerable:!0}):r,e));var f=h(u=>{"use strict";Object.defineProperty(u,"__esModule",{value:!0});u.removePathPrefix=H;var p=__next_dist_shared_lib_router_utils_path_has_prefix$;function H(e,t){if(p.pathHasPrefix(e,t)){let r=e.slice(t.length);return r.startsWith("/")?r:`/${r}`}return e}});var n=v(f()),j=!0,{removePathPrefix:q}=n,{default:a,...M}=n,w=a!==void 0?a:M;export{j as __esModule,w as default,q as removePathPrefix};
@@ -0,0 +1,2 @@
1
+ /* esm.sh - esbuild bundle(next@12.2.5/dist/shared/lib/router/utils/remove-trailing-slash) deno production */
2
+ var _=Object.create;var a=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty;var p=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var v=(e,r,t,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of c(r))!m.call(e,o)&&o!==t&&a(e,o,{get:()=>r[o],enumerable:!(u=d(r,o))||u.enumerable});return e};var g=(e,r,t)=>(t=e!=null?_(f(e)):{},v(r||!e||!e.__esModule?a(t,"default",{value:e,enumerable:!0}):t,e));var n=p(l=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0});l.removeTrailingSlash=h;function h(e){return e.replace(/\/$/,"")||"/"}});var i=g(n()),M=!0,{removeTrailingSlash:b}=i,{default:s,...x}=i,j=s!==void 0?s:x;export{M as __esModule,j as default,b as removeTrailingSlash};
@@ -7,7 +7,23 @@
7
7
  },
8
8
  "scopes": {
9
9
  "./esm.sh/": {
10
- "/v91/next@12.2.5/deno/dist/compiled/cookie.js": "./esm.sh/v91/next@12.2.5/deno/dist/compiled/cookie.js"
10
+ "/v91/next@12.2.5/deno/dist/shared/lib/router/utils/get-next-pathname-info.js": "./esm.sh/v91/next@12.2.5/deno/dist/shared/lib/router/utils/get-next-pathname-info.js",
11
+ "/v91/next@12.2.5/deno/dist/shared/lib/get-hostname.js": "./esm.sh/v91/next@12.2.5/deno/dist/shared/lib/get-hostname.js",
12
+ "/v91/next@12.2.5/deno/dist/shared/lib/router/utils/format-next-pathname-info.js": "./esm.sh/v91/next@12.2.5/deno/dist/shared/lib/router/utils/format-next-pathname-info.js",
13
+ "/v91/next@12.2.5/deno/dist/shared/lib/i18n/detect-domain-locale.js": "./esm.sh/v91/next@12.2.5/deno/dist/shared/lib/i18n/detect-domain-locale.js",
14
+ "/v91/next@12.2.5/deno/dist/compiled/cookie.js": "./esm.sh/v91/next@12.2.5/deno/dist/compiled/cookie.js",
15
+ "/v91/next@12.2.5/deno/dist/server/web/error.js": "./esm.sh/v91/next@12.2.5/deno/dist/server/web/error.js",
16
+ "/v91/next@12.2.5/deno/dist/server/web/utils.js": "./esm.sh/v91/next@12.2.5/deno/dist/server/web/utils.js",
17
+ "/v91/next@12.2.5/deno/dist/server/web/next-url.js": "./esm.sh/v91/next@12.2.5/deno/dist/server/web/next-url.js",
18
+ "/v91/next@12.2.5/deno/dist/server/web/spec-extension/cookies.js": "./esm.sh/v91/next@12.2.5/deno/dist/server/web/spec-extension/cookies.js",
19
+ "/v91/next@12.2.5/deno/dist/shared/lib/router/utils/path-has-prefix.js": "./esm.sh/v91/next@12.2.5/deno/dist/shared/lib/router/utils/path-has-prefix.js",
20
+ "/v91/next@12.2.5/deno/dist/shared/lib/router/utils/add-path-prefix.js": "./esm.sh/v91/next@12.2.5/deno/dist/shared/lib/router/utils/add-path-prefix.js",
21
+ "/v91/next@12.2.5/deno/dist/shared/lib/router/utils/parse-path.js": "./esm.sh/v91/next@12.2.5/deno/dist/shared/lib/router/utils/parse-path.js",
22
+ "/v91/next@12.2.5/deno/dist/shared/lib/router/utils/add-locale.js": "./esm.sh/v91/next@12.2.5/deno/dist/shared/lib/router/utils/add-locale.js",
23
+ "/v91/next@12.2.5/deno/dist/shared/lib/router/utils/add-path-suffix.js": "./esm.sh/v91/next@12.2.5/deno/dist/shared/lib/router/utils/add-path-suffix.js",
24
+ "/v91/next@12.2.5/deno/dist/shared/lib/router/utils/remove-trailing-slash.js": "./esm.sh/v91/next@12.2.5/deno/dist/shared/lib/router/utils/remove-trailing-slash.js",
25
+ "/v91/next@12.2.5/deno/dist/shared/lib/i18n/normalize-locale-path.js": "./esm.sh/v91/next@12.2.5/deno/dist/shared/lib/i18n/normalize-locale-path.js",
26
+ "/v91/next@12.2.5/deno/dist/shared/lib/router/utils/remove-path-prefix.js": "./esm.sh/v91/next@12.2.5/deno/dist/shared/lib/router/utils/remove-path-prefix.js"
11
27
  }
12
28
  }
13
29
  }