module.exports = [ "[externals]/pg [external] (pg, esm_import, [project]/node_modules/pg)", ((__turbopack_context__) => { "use strict"; return __turbopack_context__.a(async (__turbopack_handle_async_dependencies__, __turbopack_async_result__) => { try { var mod = await __turbopack_context__.y("pg-587764f78a6c7a9c"); __turbopack_context__.n(mod); __turbopack_async_result__(); } catch(e) { __turbopack_async_result__(e); } }, true);}), "[project]/node_modules/bcryptjs/index.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "compare", ()=>compare, "compareSync", ()=>compareSync, "decodeBase64", ()=>decodeBase64, "default", ()=>__TURBOPACK__default__export__, "encodeBase64", ()=>encodeBase64, "genSalt", ()=>genSalt, "genSaltSync", ()=>genSaltSync, "getRounds", ()=>getRounds, "getSalt", ()=>getSalt, "hash", ()=>hash, "hashSync", ()=>hashSync, "setRandomFallback", ()=>setRandomFallback, "truncates", ()=>truncates ]); /* Copyright (c) 2012 Nevins Bartolomeo Copyright (c) 2012 Shane Girish Copyright (c) 2025 Daniel Wirtz Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // The Node.js crypto module is used as a fallback for the Web Crypto API. When // building for the browser, inclusion of the crypto module should be disabled, // which the package hints at in its package.json for bundlers that support it. var __TURBOPACK__imported__module__$5b$externals$5d2f$crypto__$5b$external$5d$__$28$crypto$2c$__cjs$29$__ = __turbopack_context__.i("[externals]/crypto [external] (crypto, cjs)"); ; /** * The random implementation to use as a fallback. * @type {?function(number):!Array.} * @inner */ var randomFallback = null; /** * Generates cryptographically secure random bytes. * @function * @param {number} len Bytes length * @returns {!Array.} Random bytes * @throws {Error} If no random implementation is available * @inner */ function randomBytes(len) { // Web Crypto API. Globally available in the browser and in Node.js >=23. try { return crypto.getRandomValues(new Uint8Array(len)); } catch {} // Node.js crypto module for non-browser environments. try { return __TURBOPACK__imported__module__$5b$externals$5d2f$crypto__$5b$external$5d$__$28$crypto$2c$__cjs$29$__["default"].randomBytes(len); } catch {} // Custom fallback specified with `setRandomFallback`. if (!randomFallback) { throw Error("Neither WebCryptoAPI nor a crypto module is available. Use bcrypt.setRandomFallback to set an alternative"); } return randomFallback(len); } function setRandomFallback(random) { randomFallback = random; } function genSaltSync(rounds, seed_length) { rounds = rounds || GENSALT_DEFAULT_LOG2_ROUNDS; if (typeof rounds !== "number") throw Error("Illegal arguments: " + typeof rounds + ", " + typeof seed_length); if (rounds < 4) rounds = 4; else if (rounds > 31) rounds = 31; var salt = []; salt.push("$2b$"); if (rounds < 10) salt.push("0"); salt.push(rounds.toString()); salt.push("$"); salt.push(base64_encode(randomBytes(BCRYPT_SALT_LEN), BCRYPT_SALT_LEN)); // May throw return salt.join(""); } function genSalt(rounds, seed_length, callback) { if (typeof seed_length === "function") callback = seed_length, seed_length = undefined; // Not supported. if (typeof rounds === "function") callback = rounds, rounds = undefined; if (typeof rounds === "undefined") rounds = GENSALT_DEFAULT_LOG2_ROUNDS; else if (typeof rounds !== "number") throw Error("illegal arguments: " + typeof rounds); function _async(callback) { nextTick(function() { // Pretty thin, but salting is fast enough try { callback(null, genSaltSync(rounds)); } catch (err) { callback(err); } }); } if (callback) { if (typeof callback !== "function") throw Error("Illegal callback: " + typeof callback); _async(callback); } else return new Promise(function(resolve, reject) { _async(function(err, res) { if (err) { reject(err); return; } resolve(res); }); }); } function hashSync(password, salt) { if (typeof salt === "undefined") salt = GENSALT_DEFAULT_LOG2_ROUNDS; if (typeof salt === "number") salt = genSaltSync(salt); if (typeof password !== "string" || typeof salt !== "string") throw Error("Illegal arguments: " + typeof password + ", " + typeof salt); return _hash(password, salt); } function hash(password, salt, callback, progressCallback) { function _async(callback) { if (typeof password === "string" && typeof salt === "number") genSalt(salt, function(err, salt) { _hash(password, salt, callback, progressCallback); }); else if (typeof password === "string" && typeof salt === "string") _hash(password, salt, callback, progressCallback); else nextTick(callback.bind(this, Error("Illegal arguments: " + typeof password + ", " + typeof salt))); } if (callback) { if (typeof callback !== "function") throw Error("Illegal callback: " + typeof callback); _async(callback); } else return new Promise(function(resolve, reject) { _async(function(err, res) { if (err) { reject(err); return; } resolve(res); }); }); } /** * Compares two strings of the same length in constant time. * @param {string} known Must be of the correct length * @param {string} unknown Must be the same length as `known` * @returns {boolean} * @inner */ function safeStringCompare(known, unknown) { var diff = known.length ^ unknown.length; for(var i = 0; i < known.length; ++i){ diff |= known.charCodeAt(i) ^ unknown.charCodeAt(i); } return diff === 0; } function compareSync(password, hash) { if (typeof password !== "string" || typeof hash !== "string") throw Error("Illegal arguments: " + typeof password + ", " + typeof hash); if (hash.length !== 60) return false; return safeStringCompare(hashSync(password, hash.substring(0, hash.length - 31)), hash); } function compare(password, hashValue, callback, progressCallback) { function _async(callback) { if (typeof password !== "string" || typeof hashValue !== "string") { nextTick(callback.bind(this, Error("Illegal arguments: " + typeof password + ", " + typeof hashValue))); return; } if (hashValue.length !== 60) { nextTick(callback.bind(this, null, false)); return; } hash(password, hashValue.substring(0, 29), function(err, comp) { if (err) callback(err); else callback(null, safeStringCompare(comp, hashValue)); }, progressCallback); } if (callback) { if (typeof callback !== "function") throw Error("Illegal callback: " + typeof callback); _async(callback); } else return new Promise(function(resolve, reject) { _async(function(err, res) { if (err) { reject(err); return; } resolve(res); }); }); } function getRounds(hash) { if (typeof hash !== "string") throw Error("Illegal arguments: " + typeof hash); return parseInt(hash.split("$")[2], 10); } function getSalt(hash) { if (typeof hash !== "string") throw Error("Illegal arguments: " + typeof hash); if (hash.length !== 60) throw Error("Illegal hash length: " + hash.length + " != 60"); return hash.substring(0, 29); } function truncates(password) { if (typeof password !== "string") throw Error("Illegal arguments: " + typeof password); return utf8Length(password) > 72; } /** * Continues with the callback after yielding to the event loop. * @function * @param {function(...[*])} callback Callback to execute * @inner */ var nextTick = typeof setImmediate === "function" ? setImmediate : typeof scheduler === "object" && typeof scheduler.postTask === "function" ? scheduler.postTask.bind(scheduler) : setTimeout; /** Calculates the byte length of a string encoded as UTF8. */ function utf8Length(string) { var len = 0, c = 0; for(var i = 0; i < string.length; ++i){ c = string.charCodeAt(i); if (c < 128) len += 1; else if (c < 2048) len += 2; else if ((c & 0xfc00) === 0xd800 && (string.charCodeAt(i + 1) & 0xfc00) === 0xdc00) { ++i; len += 4; } else len += 3; } return len; } /** Converts a string to an array of UTF8 bytes. */ function utf8Array(string) { var offset = 0, c1, c2; var buffer = new Array(utf8Length(string)); for(var i = 0, k = string.length; i < k; ++i){ c1 = string.charCodeAt(i); if (c1 < 128) { buffer[offset++] = c1; } else if (c1 < 2048) { buffer[offset++] = c1 >> 6 | 192; buffer[offset++] = c1 & 63 | 128; } else if ((c1 & 0xfc00) === 0xd800 && ((c2 = string.charCodeAt(i + 1)) & 0xfc00) === 0xdc00) { c1 = 0x10000 + ((c1 & 0x03ff) << 10) + (c2 & 0x03ff); ++i; buffer[offset++] = c1 >> 18 | 240; buffer[offset++] = c1 >> 12 & 63 | 128; buffer[offset++] = c1 >> 6 & 63 | 128; buffer[offset++] = c1 & 63 | 128; } else { buffer[offset++] = c1 >> 12 | 224; buffer[offset++] = c1 >> 6 & 63 | 128; buffer[offset++] = c1 & 63 | 128; } } return buffer; } // A base64 implementation for the bcrypt algorithm. This is partly non-standard. /** * bcrypt's own non-standard base64 dictionary. * @type {!Array.} * @const * @inner **/ var BASE64_CODE = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""); /** * @type {!Array.} * @const * @inner **/ var BASE64_INDEX = [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, -1, -1, -1, -1, -1, -1, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, -1, -1, -1, -1 ]; /** * Encodes a byte array to base64 with up to len bytes of input. * @param {!Array.} b Byte array * @param {number} len Maximum input length * @returns {string} * @inner */ function base64_encode(b, len) { var off = 0, rs = [], c1, c2; if (len <= 0 || len > b.length) throw Error("Illegal len: " + len); while(off < len){ c1 = b[off++] & 0xff; rs.push(BASE64_CODE[c1 >> 2 & 0x3f]); c1 = (c1 & 0x03) << 4; if (off >= len) { rs.push(BASE64_CODE[c1 & 0x3f]); break; } c2 = b[off++] & 0xff; c1 |= c2 >> 4 & 0x0f; rs.push(BASE64_CODE[c1 & 0x3f]); c1 = (c2 & 0x0f) << 2; if (off >= len) { rs.push(BASE64_CODE[c1 & 0x3f]); break; } c2 = b[off++] & 0xff; c1 |= c2 >> 6 & 0x03; rs.push(BASE64_CODE[c1 & 0x3f]); rs.push(BASE64_CODE[c2 & 0x3f]); } return rs.join(""); } /** * Decodes a base64 encoded string to up to len bytes of output. * @param {string} s String to decode * @param {number} len Maximum output length * @returns {!Array.} * @inner */ function base64_decode(s, len) { var off = 0, slen = s.length, olen = 0, rs = [], c1, c2, c3, c4, o, code; if (len <= 0) throw Error("Illegal len: " + len); while(off < slen - 1 && olen < len){ code = s.charCodeAt(off++); c1 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; code = s.charCodeAt(off++); c2 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; if (c1 == -1 || c2 == -1) break; o = c1 << 2 >>> 0; o |= (c2 & 0x30) >> 4; rs.push(String.fromCharCode(o)); if (++olen >= len || off >= slen) break; code = s.charCodeAt(off++); c3 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; if (c3 == -1) break; o = (c2 & 0x0f) << 4 >>> 0; o |= (c3 & 0x3c) >> 2; rs.push(String.fromCharCode(o)); if (++olen >= len || off >= slen) break; code = s.charCodeAt(off++); c4 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; o = (c3 & 0x03) << 6 >>> 0; o |= c4; rs.push(String.fromCharCode(o)); ++olen; } var res = []; for(off = 0; off < olen; off++)res.push(rs[off].charCodeAt(0)); return res; } /** * @type {number} * @const * @inner */ var BCRYPT_SALT_LEN = 16; /** * @type {number} * @const * @inner */ var GENSALT_DEFAULT_LOG2_ROUNDS = 10; /** * @type {number} * @const * @inner */ var BLOWFISH_NUM_ROUNDS = 16; /** * @type {number} * @const * @inner */ var MAX_EXECUTION_TIME = 100; /** * @type {Array.} * @const * @inner */ var P_ORIG = [ 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, 0x9216d5d9, 0x8979fb1b ]; /** * @type {Array.} * @const * @inner */ var S_ORIG = [ 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e, 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677, 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82, 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a, 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7, 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87, 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281, 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0, 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7, 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504, 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c, 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0, 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51, 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd, 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048, 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964, 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d, 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a, 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9, 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6 ]; /** * @type {Array.} * @const * @inner */ var C_ORIG = [ 0x4f727068, 0x65616e42, 0x65686f6c, 0x64657253, 0x63727944, 0x6f756274 ]; /** * @param {Array.} lr * @param {number} off * @param {Array.} P * @param {Array.} S * @returns {Array.} * @inner */ function _encipher(lr, off, P, S) { // This is our bottleneck: 1714/1905 ticks / 90% - see profile.txt var n, l = lr[off], r = lr[off + 1]; l ^= P[0]; /* for (var i=0, k=BLOWFISH_NUM_ROUNDS-2; i<=k;) // Feistel substitution on left word n = S[l >>> 24], n += S[0x100 | ((l >> 16) & 0xff)], n ^= S[0x200 | ((l >> 8) & 0xff)], n += S[0x300 | (l & 0xff)], r ^= n ^ P[++i], // Feistel substitution on right word n = S[r >>> 24], n += S[0x100 | ((r >> 16) & 0xff)], n ^= S[0x200 | ((r >> 8) & 0xff)], n += S[0x300 | (r & 0xff)], l ^= n ^ P[++i]; */ //The following is an unrolled version of the above loop. //Iteration 0 n = S[l >>> 24]; n += S[0x100 | l >> 16 & 0xff]; n ^= S[0x200 | l >> 8 & 0xff]; n += S[0x300 | l & 0xff]; r ^= n ^ P[1]; n = S[r >>> 24]; n += S[0x100 | r >> 16 & 0xff]; n ^= S[0x200 | r >> 8 & 0xff]; n += S[0x300 | r & 0xff]; l ^= n ^ P[2]; //Iteration 1 n = S[l >>> 24]; n += S[0x100 | l >> 16 & 0xff]; n ^= S[0x200 | l >> 8 & 0xff]; n += S[0x300 | l & 0xff]; r ^= n ^ P[3]; n = S[r >>> 24]; n += S[0x100 | r >> 16 & 0xff]; n ^= S[0x200 | r >> 8 & 0xff]; n += S[0x300 | r & 0xff]; l ^= n ^ P[4]; //Iteration 2 n = S[l >>> 24]; n += S[0x100 | l >> 16 & 0xff]; n ^= S[0x200 | l >> 8 & 0xff]; n += S[0x300 | l & 0xff]; r ^= n ^ P[5]; n = S[r >>> 24]; n += S[0x100 | r >> 16 & 0xff]; n ^= S[0x200 | r >> 8 & 0xff]; n += S[0x300 | r & 0xff]; l ^= n ^ P[6]; //Iteration 3 n = S[l >>> 24]; n += S[0x100 | l >> 16 & 0xff]; n ^= S[0x200 | l >> 8 & 0xff]; n += S[0x300 | l & 0xff]; r ^= n ^ P[7]; n = S[r >>> 24]; n += S[0x100 | r >> 16 & 0xff]; n ^= S[0x200 | r >> 8 & 0xff]; n += S[0x300 | r & 0xff]; l ^= n ^ P[8]; //Iteration 4 n = S[l >>> 24]; n += S[0x100 | l >> 16 & 0xff]; n ^= S[0x200 | l >> 8 & 0xff]; n += S[0x300 | l & 0xff]; r ^= n ^ P[9]; n = S[r >>> 24]; n += S[0x100 | r >> 16 & 0xff]; n ^= S[0x200 | r >> 8 & 0xff]; n += S[0x300 | r & 0xff]; l ^= n ^ P[10]; //Iteration 5 n = S[l >>> 24]; n += S[0x100 | l >> 16 & 0xff]; n ^= S[0x200 | l >> 8 & 0xff]; n += S[0x300 | l & 0xff]; r ^= n ^ P[11]; n = S[r >>> 24]; n += S[0x100 | r >> 16 & 0xff]; n ^= S[0x200 | r >> 8 & 0xff]; n += S[0x300 | r & 0xff]; l ^= n ^ P[12]; //Iteration 6 n = S[l >>> 24]; n += S[0x100 | l >> 16 & 0xff]; n ^= S[0x200 | l >> 8 & 0xff]; n += S[0x300 | l & 0xff]; r ^= n ^ P[13]; n = S[r >>> 24]; n += S[0x100 | r >> 16 & 0xff]; n ^= S[0x200 | r >> 8 & 0xff]; n += S[0x300 | r & 0xff]; l ^= n ^ P[14]; //Iteration 7 n = S[l >>> 24]; n += S[0x100 | l >> 16 & 0xff]; n ^= S[0x200 | l >> 8 & 0xff]; n += S[0x300 | l & 0xff]; r ^= n ^ P[15]; n = S[r >>> 24]; n += S[0x100 | r >> 16 & 0xff]; n ^= S[0x200 | r >> 8 & 0xff]; n += S[0x300 | r & 0xff]; l ^= n ^ P[16]; lr[off] = r ^ P[BLOWFISH_NUM_ROUNDS + 1]; lr[off + 1] = l; return lr; } /** * @param {Array.} data * @param {number} offp * @returns {{key: number, offp: number}} * @inner */ function _streamtoword(data, offp) { for(var i = 0, word = 0; i < 4; ++i)word = word << 8 | data[offp] & 0xff, offp = (offp + 1) % data.length; return { key: word, offp: offp }; } /** * @param {Array.} key * @param {Array.} P * @param {Array.} S * @inner */ function _key(key, P, S) { var offset = 0, lr = [ 0, 0 ], plen = P.length, slen = S.length, sw; for(var i = 0; i < plen; i++)sw = _streamtoword(key, offset), offset = sw.offp, P[i] = P[i] ^ sw.key; for(i = 0; i < plen; i += 2)lr = _encipher(lr, 0, P, S), P[i] = lr[0], P[i + 1] = lr[1]; for(i = 0; i < slen; i += 2)lr = _encipher(lr, 0, P, S), S[i] = lr[0], S[i + 1] = lr[1]; } /** * Expensive key schedule Blowfish. * @param {Array.} data * @param {Array.} key * @param {Array.} P * @param {Array.} S * @inner */ function _ekskey(data, key, P, S) { var offp = 0, lr = [ 0, 0 ], plen = P.length, slen = S.length, sw; for(var i = 0; i < plen; i++)sw = _streamtoword(key, offp), offp = sw.offp, P[i] = P[i] ^ sw.key; offp = 0; for(i = 0; i < plen; i += 2)sw = _streamtoword(data, offp), offp = sw.offp, lr[0] ^= sw.key, sw = _streamtoword(data, offp), offp = sw.offp, lr[1] ^= sw.key, lr = _encipher(lr, 0, P, S), P[i] = lr[0], P[i + 1] = lr[1]; for(i = 0; i < slen; i += 2)sw = _streamtoword(data, offp), offp = sw.offp, lr[0] ^= sw.key, sw = _streamtoword(data, offp), offp = sw.offp, lr[1] ^= sw.key, lr = _encipher(lr, 0, P, S), S[i] = lr[0], S[i + 1] = lr[1]; } /** * Internaly crypts a string. * @param {Array.} b Bytes to crypt * @param {Array.} salt Salt bytes to use * @param {number} rounds Number of rounds * @param {function(Error, Array.=)=} callback Callback receiving the error, if any, and the resulting bytes. If * omitted, the operation will be performed synchronously. * @param {function(number)=} progressCallback Callback called with the current progress * @returns {!Array.|undefined} Resulting bytes if callback has been omitted, otherwise `undefined` * @inner */ function _crypt(b, salt, rounds, callback, progressCallback) { var cdata = C_ORIG.slice(), clen = cdata.length, err; // Validate if (rounds < 4 || rounds > 31) { err = Error("Illegal number of rounds (4-31): " + rounds); if (callback) { nextTick(callback.bind(this, err)); return; } else throw err; } if (salt.length !== BCRYPT_SALT_LEN) { err = Error("Illegal salt length: " + salt.length + " != " + BCRYPT_SALT_LEN); if (callback) { nextTick(callback.bind(this, err)); return; } else throw err; } rounds = 1 << rounds >>> 0; var P, S, i = 0, j; //Use typed arrays when available - huge speedup! if (typeof Int32Array === "function") { P = new Int32Array(P_ORIG); S = new Int32Array(S_ORIG); } else { P = P_ORIG.slice(); S = S_ORIG.slice(); } _ekskey(salt, b, P, S); /** * Calcualtes the next round. * @returns {Array.|undefined} Resulting array if callback has been omitted, otherwise `undefined` * @inner */ function next() { if (progressCallback) progressCallback(i / rounds); if (i < rounds) { var start = Date.now(); for(; i < rounds;){ i = i + 1; _key(b, P, S); _key(salt, P, S); if (Date.now() - start > MAX_EXECUTION_TIME) break; } } else { for(i = 0; i < 64; i++)for(j = 0; j < clen >> 1; j++)_encipher(cdata, j << 1, P, S); var ret = []; for(i = 0; i < clen; i++)ret.push((cdata[i] >> 24 & 0xff) >>> 0), ret.push((cdata[i] >> 16 & 0xff) >>> 0), ret.push((cdata[i] >> 8 & 0xff) >>> 0), ret.push((cdata[i] & 0xff) >>> 0); if (callback) { callback(null, ret); return; } else return ret; } if (callback) nextTick(next); } // Async if (typeof callback !== "undefined") { next(); // Sync } else { var res; while(true)if (typeof (res = next()) !== "undefined") return res || []; } } /** * Internally hashes a password. * @param {string} password Password to hash * @param {?string} salt Salt to use, actually never null * @param {function(Error, string=)=} callback Callback receiving the error, if any, and the resulting hash. If omitted, * hashing is performed synchronously. * @param {function(number)=} progressCallback Callback called with the current progress * @returns {string|undefined} Resulting hash if callback has been omitted, otherwise `undefined` * @inner */ function _hash(password, salt, callback, progressCallback) { var err; if (typeof password !== "string" || typeof salt !== "string") { err = Error("Invalid string / salt: Not a string"); if (callback) { nextTick(callback.bind(this, err)); return; } else throw err; } // Validate the salt var minor, offset; if (salt.charAt(0) !== "$" || salt.charAt(1) !== "2") { err = Error("Invalid salt version: " + salt.substring(0, 2)); if (callback) { nextTick(callback.bind(this, err)); return; } else throw err; } if (salt.charAt(2) === "$") minor = String.fromCharCode(0), offset = 3; else { minor = salt.charAt(2); if (minor !== "a" && minor !== "b" && minor !== "y" || salt.charAt(3) !== "$") { err = Error("Invalid salt revision: " + salt.substring(2, 4)); if (callback) { nextTick(callback.bind(this, err)); return; } else throw err; } offset = 4; } // Extract number of rounds if (salt.charAt(offset + 2) > "$") { err = Error("Missing salt rounds"); if (callback) { nextTick(callback.bind(this, err)); return; } else throw err; } var r1 = parseInt(salt.substring(offset, offset + 1), 10) * 10, r2 = parseInt(salt.substring(offset + 1, offset + 2), 10), rounds = r1 + r2, real_salt = salt.substring(offset + 3, offset + 25); password += minor >= "a" ? "\x00" : ""; var passwordb = utf8Array(password), saltb = base64_decode(real_salt, BCRYPT_SALT_LEN); /** * Finishes hashing. * @param {Array.} bytes Byte array * @returns {string} * @inner */ function finish(bytes) { var res = []; res.push("$2"); if (minor >= "a") res.push(minor); res.push("$"); if (rounds < 10) res.push("0"); res.push(rounds.toString()); res.push("$"); res.push(base64_encode(saltb, saltb.length)); res.push(base64_encode(bytes, C_ORIG.length * 4 - 1)); return res.join(""); } // Sync if (typeof callback == "undefined") return finish(_crypt(passwordb, saltb, rounds)); else { _crypt(passwordb, saltb, rounds, function(err, bytes) { if (err) callback(err, null); else callback(null, finish(bytes)); }, progressCallback); } } function encodeBase64(bytes, length) { return base64_encode(bytes, length); } function decodeBase64(string, length) { return base64_decode(string, length); } const __TURBOPACK__default__export__ = { setRandomFallback, genSaltSync, genSalt, hashSync, hash, compareSync, compare, getRounds, getSalt, truncates, encodeBase64, decodeBase64 }; }), "[project]/node_modules/buffer-equal-constant-time/index.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; /*jshint node:true */ var Buffer = __turbopack_context__.r("[externals]/buffer [external] (buffer, cjs)").Buffer; // browserify var SlowBuffer = __turbopack_context__.r("[externals]/buffer [external] (buffer, cjs)").SlowBuffer; module.exports = bufferEq; function bufferEq(a, b) { // shortcutting on type is necessary for correctness if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { return false; } // buffer sizes should be well-known information, so despite this // shortcutting, it doesn't leak any information about the *contents* of the // buffers. if (a.length !== b.length) { return false; } var c = 0; for(var i = 0; i < a.length; i++){ /*jshint bitwise:false */ c |= a[i] ^ b[i]; // XOR } return c === 0; } bufferEq.install = function() { Buffer.prototype.equal = SlowBuffer.prototype.equal = function equal(that) { return bufferEq(this, that); }; }; var origBufEqual = Buffer.prototype.equal; var origSlowBufEqual = SlowBuffer.prototype.equal; bufferEq.restore = function() { Buffer.prototype.equal = origBufEqual; SlowBuffer.prototype.equal = origSlowBufEqual; }; }), "[project]/node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; var Buffer = __turbopack_context__.r("[project]/node_modules/safe-buffer/index.js [app-route] (ecmascript)").Buffer; var getParamBytesForAlg = __turbopack_context__.r("[project]/node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js [app-route] (ecmascript)"); var MAX_OCTET = 0x80, CLASS_UNIVERSAL = 0, PRIMITIVE_BIT = 0x20, TAG_SEQ = 0x10, TAG_INT = 0x02, ENCODED_TAG_SEQ = TAG_SEQ | PRIMITIVE_BIT | CLASS_UNIVERSAL << 6, ENCODED_TAG_INT = TAG_INT | CLASS_UNIVERSAL << 6; function base64Url(base64) { return base64.replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_'); } function signatureAsBuffer(signature) { if (Buffer.isBuffer(signature)) { return signature; } else if ('string' === typeof signature) { return Buffer.from(signature, 'base64'); } throw new TypeError('ECDSA signature must be a Base64 string or a Buffer'); } function derToJose(signature, alg) { signature = signatureAsBuffer(signature); var paramBytes = getParamBytesForAlg(alg); // the DER encoded param should at most be the param size, plus a padding // zero, since due to being a signed integer var maxEncodedParamLength = paramBytes + 1; var inputLength = signature.length; var offset = 0; if (signature[offset++] !== ENCODED_TAG_SEQ) { throw new Error('Could not find expected "seq"'); } var seqLength = signature[offset++]; if (seqLength === (MAX_OCTET | 1)) { seqLength = signature[offset++]; } if (inputLength - offset < seqLength) { throw new Error('"seq" specified length of "' + seqLength + '", only "' + (inputLength - offset) + '" remaining'); } if (signature[offset++] !== ENCODED_TAG_INT) { throw new Error('Could not find expected "int" for "r"'); } var rLength = signature[offset++]; if (inputLength - offset - 2 < rLength) { throw new Error('"r" specified length of "' + rLength + '", only "' + (inputLength - offset - 2) + '" available'); } if (maxEncodedParamLength < rLength) { throw new Error('"r" specified length of "' + rLength + '", max of "' + maxEncodedParamLength + '" is acceptable'); } var rOffset = offset; offset += rLength; if (signature[offset++] !== ENCODED_TAG_INT) { throw new Error('Could not find expected "int" for "s"'); } var sLength = signature[offset++]; if (inputLength - offset !== sLength) { throw new Error('"s" specified length of "' + sLength + '", expected "' + (inputLength - offset) + '"'); } if (maxEncodedParamLength < sLength) { throw new Error('"s" specified length of "' + sLength + '", max of "' + maxEncodedParamLength + '" is acceptable'); } var sOffset = offset; offset += sLength; if (offset !== inputLength) { throw new Error('Expected to consume entire buffer, but "' + (inputLength - offset) + '" bytes remain'); } var rPadding = paramBytes - rLength, sPadding = paramBytes - sLength; var dst = Buffer.allocUnsafe(rPadding + rLength + sPadding + sLength); for(offset = 0; offset < rPadding; ++offset){ dst[offset] = 0; } signature.copy(dst, offset, rOffset + Math.max(-rPadding, 0), rOffset + rLength); offset = paramBytes; for(var o = offset; offset < o + sPadding; ++offset){ dst[offset] = 0; } signature.copy(dst, offset, sOffset + Math.max(-sPadding, 0), sOffset + sLength); dst = dst.toString('base64'); dst = base64Url(dst); return dst; } function countPadding(buf, start, stop) { var padding = 0; while(start + padding < stop && buf[start + padding] === 0){ ++padding; } var needsSign = buf[start + padding] >= MAX_OCTET; if (needsSign) { --padding; } return padding; } function joseToDer(signature, alg) { signature = signatureAsBuffer(signature); var paramBytes = getParamBytesForAlg(alg); var signatureBytes = signature.length; if (signatureBytes !== paramBytes * 2) { throw new TypeError('"' + alg + '" signatures must be "' + paramBytes * 2 + '" bytes, saw "' + signatureBytes + '"'); } var rPadding = countPadding(signature, 0, paramBytes); var sPadding = countPadding(signature, paramBytes, signature.length); var rLength = paramBytes - rPadding; var sLength = paramBytes - sPadding; var rsBytes = 1 + 1 + rLength + 1 + 1 + sLength; var shortLength = rsBytes < MAX_OCTET; var dst = Buffer.allocUnsafe((shortLength ? 2 : 3) + rsBytes); var offset = 0; dst[offset++] = ENCODED_TAG_SEQ; if (shortLength) { // Bit 8 has value "0" // bits 7-1 give the length. dst[offset++] = rsBytes; } else { // Bit 8 of first octet has value "1" // bits 7-1 give the number of additional length octets. dst[offset++] = MAX_OCTET | 1; // length, base 256 dst[offset++] = rsBytes & 0xff; } dst[offset++] = ENCODED_TAG_INT; dst[offset++] = rLength; if (rPadding < 0) { dst[offset++] = 0; offset += signature.copy(dst, offset, 0, paramBytes); } else { offset += signature.copy(dst, offset, rPadding, paramBytes); } dst[offset++] = ENCODED_TAG_INT; dst[offset++] = sLength; if (sPadding < 0) { dst[offset++] = 0; signature.copy(dst, offset, paramBytes); } else { signature.copy(dst, offset, paramBytes + sPadding); } return dst; } module.exports = { derToJose: derToJose, joseToDer: joseToDer }; }), "[project]/node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; function getParamSize(keySize) { var result = (keySize / 8 | 0) + (keySize % 8 === 0 ? 0 : 1); return result; } var paramBytesForAlg = { ES256: getParamSize(256), ES384: getParamSize(384), ES512: getParamSize(521) }; function getParamBytesForAlg(alg) { var paramBytes = paramBytesForAlg[alg]; if (paramBytes) { return paramBytes; } throw new Error('Unknown algorithm "' + alg + '"'); } module.exports = getParamBytesForAlg; }), "[project]/node_modules/jsonwebtoken/decode.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { var jws = __turbopack_context__.r("[project]/node_modules/jws/index.js [app-route] (ecmascript)"); module.exports = function(jwt, options) { options = options || {}; var decoded = jws.decode(jwt, options); if (!decoded) { return null; } var payload = decoded.payload; //try parse the payload if (typeof payload === 'string') { try { var obj = JSON.parse(payload); if (obj !== null && typeof obj === 'object') { payload = obj; } } catch (e) {} } //return header if `complete` option is enabled. header includes claims //such as `kid` and `alg` used to select the key within a JWKS needed to //verify the signature if (options.complete === true) { return { header: decoded.header, payload: payload, signature: decoded.signature }; } return payload; }; }), "[project]/node_modules/jsonwebtoken/index.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { module.exports = { decode: __turbopack_context__.r("[project]/node_modules/jsonwebtoken/decode.js [app-route] (ecmascript)"), verify: __turbopack_context__.r("[project]/node_modules/jsonwebtoken/verify.js [app-route] (ecmascript)"), sign: __turbopack_context__.r("[project]/node_modules/jsonwebtoken/sign.js [app-route] (ecmascript)"), JsonWebTokenError: __turbopack_context__.r("[project]/node_modules/jsonwebtoken/lib/JsonWebTokenError.js [app-route] (ecmascript)"), NotBeforeError: __turbopack_context__.r("[project]/node_modules/jsonwebtoken/lib/NotBeforeError.js [app-route] (ecmascript)"), TokenExpiredError: __turbopack_context__.r("[project]/node_modules/jsonwebtoken/lib/TokenExpiredError.js [app-route] (ecmascript)") }; }), "[project]/node_modules/jsonwebtoken/lib/JsonWebTokenError.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { var JsonWebTokenError = function(message, error) { Error.call(this, message); if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } this.name = 'JsonWebTokenError'; this.message = message; if (error) this.inner = error; }; JsonWebTokenError.prototype = Object.create(Error.prototype); JsonWebTokenError.prototype.constructor = JsonWebTokenError; module.exports = JsonWebTokenError; }), "[project]/node_modules/jsonwebtoken/lib/NotBeforeError.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { var JsonWebTokenError = __turbopack_context__.r("[project]/node_modules/jsonwebtoken/lib/JsonWebTokenError.js [app-route] (ecmascript)"); var NotBeforeError = function(message, date) { JsonWebTokenError.call(this, message); this.name = 'NotBeforeError'; this.date = date; }; NotBeforeError.prototype = Object.create(JsonWebTokenError.prototype); NotBeforeError.prototype.constructor = NotBeforeError; module.exports = NotBeforeError; }), "[project]/node_modules/jsonwebtoken/lib/TokenExpiredError.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { var JsonWebTokenError = __turbopack_context__.r("[project]/node_modules/jsonwebtoken/lib/JsonWebTokenError.js [app-route] (ecmascript)"); var TokenExpiredError = function(message, expiredAt) { JsonWebTokenError.call(this, message); this.name = 'TokenExpiredError'; this.expiredAt = expiredAt; }; TokenExpiredError.prototype = Object.create(JsonWebTokenError.prototype); TokenExpiredError.prototype.constructor = TokenExpiredError; module.exports = TokenExpiredError; }), "[project]/node_modules/jsonwebtoken/lib/asymmetricKeyDetailsSupported.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { const semver = __turbopack_context__.r("[project]/node_modules/semver/index.js [app-route] (ecmascript)"); module.exports = semver.satisfies(process.version, '>=15.7.0'); }), "[project]/node_modules/jsonwebtoken/lib/psSupported.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { var semver = __turbopack_context__.r("[project]/node_modules/semver/index.js [app-route] (ecmascript)"); module.exports = semver.satisfies(process.version, '^6.12.0 || >=8.0.0'); }), "[project]/node_modules/jsonwebtoken/lib/rsaPssKeyDetailsSupported.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { const semver = __turbopack_context__.r("[project]/node_modules/semver/index.js [app-route] (ecmascript)"); module.exports = semver.satisfies(process.version, '>=16.9.0'); }), "[project]/node_modules/jsonwebtoken/lib/timespan.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { var ms = __turbopack_context__.r("[project]/node_modules/ms/index.js [app-route] (ecmascript)"); module.exports = function(time, iat) { var timestamp = iat || Math.floor(Date.now() / 1000); if (typeof time === 'string') { var milliseconds = ms(time); if (typeof milliseconds === 'undefined') { return; } return Math.floor(timestamp + milliseconds / 1000); } else if (typeof time === 'number') { return timestamp + time; } else { return; } }; }), "[project]/node_modules/jsonwebtoken/lib/validateAsymmetricKey.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { const ASYMMETRIC_KEY_DETAILS_SUPPORTED = __turbopack_context__.r("[project]/node_modules/jsonwebtoken/lib/asymmetricKeyDetailsSupported.js [app-route] (ecmascript)"); const RSA_PSS_KEY_DETAILS_SUPPORTED = __turbopack_context__.r("[project]/node_modules/jsonwebtoken/lib/rsaPssKeyDetailsSupported.js [app-route] (ecmascript)"); const allowedAlgorithmsForKeys = { 'ec': [ 'ES256', 'ES384', 'ES512' ], 'rsa': [ 'RS256', 'PS256', 'RS384', 'PS384', 'RS512', 'PS512' ], 'rsa-pss': [ 'PS256', 'PS384', 'PS512' ] }; const allowedCurves = { ES256: 'prime256v1', ES384: 'secp384r1', ES512: 'secp521r1' }; module.exports = function(algorithm, key) { if (!algorithm || !key) return; const keyType = key.asymmetricKeyType; if (!keyType) return; const allowedAlgorithms = allowedAlgorithmsForKeys[keyType]; if (!allowedAlgorithms) { throw new Error(`Unknown key type "${keyType}".`); } if (!allowedAlgorithms.includes(algorithm)) { throw new Error(`"alg" parameter for "${keyType}" key type must be one of: ${allowedAlgorithms.join(', ')}.`); } /* * Ignore the next block from test coverage because it gets executed * conditionally depending on the Node version. Not ignoring it would * prevent us from reaching the target % of coverage for versions of * Node under 15.7.0. */ /* istanbul ignore next */ if (ASYMMETRIC_KEY_DETAILS_SUPPORTED) { switch(keyType){ case 'ec': const keyCurve = key.asymmetricKeyDetails.namedCurve; const allowedCurve = allowedCurves[algorithm]; if (keyCurve !== allowedCurve) { throw new Error(`"alg" parameter "${algorithm}" requires curve "${allowedCurve}".`); } break; case 'rsa-pss': if (RSA_PSS_KEY_DETAILS_SUPPORTED) { const length = parseInt(algorithm.slice(-3), 10); const { hashAlgorithm, mgf1HashAlgorithm, saltLength } = key.asymmetricKeyDetails; if (hashAlgorithm !== `sha${length}` || mgf1HashAlgorithm !== hashAlgorithm) { throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${algorithm}.`); } if (saltLength !== undefined && saltLength > length >> 3) { throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${algorithm}.`); } } break; } } }; }), "[project]/node_modules/jsonwebtoken/sign.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { const timespan = __turbopack_context__.r("[project]/node_modules/jsonwebtoken/lib/timespan.js [app-route] (ecmascript)"); const PS_SUPPORTED = __turbopack_context__.r("[project]/node_modules/jsonwebtoken/lib/psSupported.js [app-route] (ecmascript)"); const validateAsymmetricKey = __turbopack_context__.r("[project]/node_modules/jsonwebtoken/lib/validateAsymmetricKey.js [app-route] (ecmascript)"); const jws = __turbopack_context__.r("[project]/node_modules/jws/index.js [app-route] (ecmascript)"); const includes = __turbopack_context__.r("[project]/node_modules/lodash.includes/index.js [app-route] (ecmascript)"); const isBoolean = __turbopack_context__.r("[project]/node_modules/lodash.isboolean/index.js [app-route] (ecmascript)"); const isInteger = __turbopack_context__.r("[project]/node_modules/lodash.isinteger/index.js [app-route] (ecmascript)"); const isNumber = __turbopack_context__.r("[project]/node_modules/lodash.isnumber/index.js [app-route] (ecmascript)"); const isPlainObject = __turbopack_context__.r("[project]/node_modules/lodash.isplainobject/index.js [app-route] (ecmascript)"); const isString = __turbopack_context__.r("[project]/node_modules/lodash.isstring/index.js [app-route] (ecmascript)"); const once = __turbopack_context__.r("[project]/node_modules/lodash.once/index.js [app-route] (ecmascript)"); const { KeyObject, createSecretKey, createPrivateKey } = __turbopack_context__.r("[externals]/crypto [external] (crypto, cjs)"); const SUPPORTED_ALGS = [ 'RS256', 'RS384', 'RS512', 'ES256', 'ES384', 'ES512', 'HS256', 'HS384', 'HS512', 'none' ]; if (PS_SUPPORTED) { SUPPORTED_ALGS.splice(3, 0, 'PS256', 'PS384', 'PS512'); } const sign_options_schema = { expiresIn: { isValid: function(value) { return isInteger(value) || isString(value) && value; }, message: '"expiresIn" should be a number of seconds or string representing a timespan' }, notBefore: { isValid: function(value) { return isInteger(value) || isString(value) && value; }, message: '"notBefore" should be a number of seconds or string representing a timespan' }, audience: { isValid: function(value) { return isString(value) || Array.isArray(value); }, message: '"audience" must be a string or array' }, algorithm: { isValid: includes.bind(null, SUPPORTED_ALGS), message: '"algorithm" must be a valid string enum value' }, header: { isValid: isPlainObject, message: '"header" must be an object' }, encoding: { isValid: isString, message: '"encoding" must be a string' }, issuer: { isValid: isString, message: '"issuer" must be a string' }, subject: { isValid: isString, message: '"subject" must be a string' }, jwtid: { isValid: isString, message: '"jwtid" must be a string' }, noTimestamp: { isValid: isBoolean, message: '"noTimestamp" must be a boolean' }, keyid: { isValid: isString, message: '"keyid" must be a string' }, mutatePayload: { isValid: isBoolean, message: '"mutatePayload" must be a boolean' }, allowInsecureKeySizes: { isValid: isBoolean, message: '"allowInsecureKeySizes" must be a boolean' }, allowInvalidAsymmetricKeyTypes: { isValid: isBoolean, message: '"allowInvalidAsymmetricKeyTypes" must be a boolean' } }; const registered_claims_schema = { iat: { isValid: isNumber, message: '"iat" should be a number of seconds' }, exp: { isValid: isNumber, message: '"exp" should be a number of seconds' }, nbf: { isValid: isNumber, message: '"nbf" should be a number of seconds' } }; function validate(schema, allowUnknown, object, parameterName) { if (!isPlainObject(object)) { throw new Error('Expected "' + parameterName + '" to be a plain object.'); } Object.keys(object).forEach(function(key) { const validator = schema[key]; if (!validator) { if (!allowUnknown) { throw new Error('"' + key + '" is not allowed in "' + parameterName + '"'); } return; } if (!validator.isValid(object[key])) { throw new Error(validator.message); } }); } function validateOptions(options) { return validate(sign_options_schema, false, options, 'options'); } function validatePayload(payload) { return validate(registered_claims_schema, true, payload, 'payload'); } const options_to_payload = { 'audience': 'aud', 'issuer': 'iss', 'subject': 'sub', 'jwtid': 'jti' }; const options_for_objects = [ 'expiresIn', 'notBefore', 'noTimestamp', 'audience', 'issuer', 'subject', 'jwtid' ]; module.exports = function(payload, secretOrPrivateKey, options, callback) { if (typeof options === 'function') { callback = options; options = {}; } else { options = options || {}; } const isObjectPayload = typeof payload === 'object' && !Buffer.isBuffer(payload); const header = Object.assign({ alg: options.algorithm || 'HS256', typ: isObjectPayload ? 'JWT' : undefined, kid: options.keyid }, options.header); function failure(err) { if (callback) { return callback(err); } throw err; } if (!secretOrPrivateKey && options.algorithm !== 'none') { return failure(new Error('secretOrPrivateKey must have a value')); } if (secretOrPrivateKey != null && !(secretOrPrivateKey instanceof KeyObject)) { try { secretOrPrivateKey = createPrivateKey(secretOrPrivateKey); } catch (_) { try { secretOrPrivateKey = createSecretKey(typeof secretOrPrivateKey === 'string' ? Buffer.from(secretOrPrivateKey) : secretOrPrivateKey); } catch (_) { return failure(new Error('secretOrPrivateKey is not valid key material')); } } } if (header.alg.startsWith('HS') && secretOrPrivateKey.type !== 'secret') { return failure(new Error(`secretOrPrivateKey must be a symmetric key when using ${header.alg}`)); } else if (/^(?:RS|PS|ES)/.test(header.alg)) { if (secretOrPrivateKey.type !== 'private') { return failure(new Error(`secretOrPrivateKey must be an asymmetric key when using ${header.alg}`)); } if (!options.allowInsecureKeySizes && !header.alg.startsWith('ES') && secretOrPrivateKey.asymmetricKeyDetails !== undefined && //KeyObject.asymmetricKeyDetails is supported in Node 15+ secretOrPrivateKey.asymmetricKeyDetails.modulusLength < 2048) { return failure(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${header.alg}`)); } } if (typeof payload === 'undefined') { return failure(new Error('payload is required')); } else if (isObjectPayload) { try { validatePayload(payload); } catch (error) { return failure(error); } if (!options.mutatePayload) { payload = Object.assign({}, payload); } } else { const invalid_options = options_for_objects.filter(function(opt) { return typeof options[opt] !== 'undefined'; }); if (invalid_options.length > 0) { return failure(new Error('invalid ' + invalid_options.join(',') + ' option for ' + typeof payload + ' payload')); } } if (typeof payload.exp !== 'undefined' && typeof options.expiresIn !== 'undefined') { return failure(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.')); } if (typeof payload.nbf !== 'undefined' && typeof options.notBefore !== 'undefined') { return failure(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.')); } try { validateOptions(options); } catch (error) { return failure(error); } if (!options.allowInvalidAsymmetricKeyTypes) { try { validateAsymmetricKey(header.alg, secretOrPrivateKey); } catch (error) { return failure(error); } } const timestamp = payload.iat || Math.floor(Date.now() / 1000); if (options.noTimestamp) { delete payload.iat; } else if (isObjectPayload) { payload.iat = timestamp; } if (typeof options.notBefore !== 'undefined') { try { payload.nbf = timespan(options.notBefore, timestamp); } catch (err) { return failure(err); } if (typeof payload.nbf === 'undefined') { return failure(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60')); } } if (typeof options.expiresIn !== 'undefined' && typeof payload === 'object') { try { payload.exp = timespan(options.expiresIn, timestamp); } catch (err) { return failure(err); } if (typeof payload.exp === 'undefined') { return failure(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60')); } } Object.keys(options_to_payload).forEach(function(key) { const claim = options_to_payload[key]; if (typeof options[key] !== 'undefined') { if (typeof payload[claim] !== 'undefined') { return failure(new Error('Bad "options.' + key + '" option. The payload already has an "' + claim + '" property.')); } payload[claim] = options[key]; } }); const encoding = options.encoding || 'utf8'; if (typeof callback === 'function') { callback = callback && once(callback); jws.createSign({ header: header, privateKey: secretOrPrivateKey, payload: payload, encoding: encoding }).once('error', callback).once('done', function(signature) { // TODO: Remove in favor of the modulus length check before signing once node 15+ is the minimum supported version if (!options.allowInsecureKeySizes && /^(?:RS|PS)/.test(header.alg) && signature.length < 256) { return callback(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${header.alg}`)); } callback(null, signature); }); } else { let signature = jws.sign({ header: header, payload: payload, secret: secretOrPrivateKey, encoding: encoding }); // TODO: Remove in favor of the modulus length check before signing once node 15+ is the minimum supported version if (!options.allowInsecureKeySizes && /^(?:RS|PS)/.test(header.alg) && signature.length < 256) { throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${header.alg}`); } return signature; } }; }), "[project]/node_modules/jsonwebtoken/verify.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { const JsonWebTokenError = __turbopack_context__.r("[project]/node_modules/jsonwebtoken/lib/JsonWebTokenError.js [app-route] (ecmascript)"); const NotBeforeError = __turbopack_context__.r("[project]/node_modules/jsonwebtoken/lib/NotBeforeError.js [app-route] (ecmascript)"); const TokenExpiredError = __turbopack_context__.r("[project]/node_modules/jsonwebtoken/lib/TokenExpiredError.js [app-route] (ecmascript)"); const decode = __turbopack_context__.r("[project]/node_modules/jsonwebtoken/decode.js [app-route] (ecmascript)"); const timespan = __turbopack_context__.r("[project]/node_modules/jsonwebtoken/lib/timespan.js [app-route] (ecmascript)"); const validateAsymmetricKey = __turbopack_context__.r("[project]/node_modules/jsonwebtoken/lib/validateAsymmetricKey.js [app-route] (ecmascript)"); const PS_SUPPORTED = __turbopack_context__.r("[project]/node_modules/jsonwebtoken/lib/psSupported.js [app-route] (ecmascript)"); const jws = __turbopack_context__.r("[project]/node_modules/jws/index.js [app-route] (ecmascript)"); const { KeyObject, createSecretKey, createPublicKey } = __turbopack_context__.r("[externals]/crypto [external] (crypto, cjs)"); const PUB_KEY_ALGS = [ 'RS256', 'RS384', 'RS512' ]; const EC_KEY_ALGS = [ 'ES256', 'ES384', 'ES512' ]; const RSA_KEY_ALGS = [ 'RS256', 'RS384', 'RS512' ]; const HS_ALGS = [ 'HS256', 'HS384', 'HS512' ]; if (PS_SUPPORTED) { PUB_KEY_ALGS.splice(PUB_KEY_ALGS.length, 0, 'PS256', 'PS384', 'PS512'); RSA_KEY_ALGS.splice(RSA_KEY_ALGS.length, 0, 'PS256', 'PS384', 'PS512'); } module.exports = function(jwtString, secretOrPublicKey, options, callback) { if (typeof options === 'function' && !callback) { callback = options; options = {}; } if (!options) { options = {}; } //clone this object since we are going to mutate it. options = Object.assign({}, options); let done; if (callback) { done = callback; } else { done = function(err, data) { if (err) throw err; return data; }; } if (options.clockTimestamp && typeof options.clockTimestamp !== 'number') { return done(new JsonWebTokenError('clockTimestamp must be a number')); } if (options.nonce !== undefined && (typeof options.nonce !== 'string' || options.nonce.trim() === '')) { return done(new JsonWebTokenError('nonce must be a non-empty string')); } if (options.allowInvalidAsymmetricKeyTypes !== undefined && typeof options.allowInvalidAsymmetricKeyTypes !== 'boolean') { return done(new JsonWebTokenError('allowInvalidAsymmetricKeyTypes must be a boolean')); } const clockTimestamp = options.clockTimestamp || Math.floor(Date.now() / 1000); if (!jwtString) { return done(new JsonWebTokenError('jwt must be provided')); } if (typeof jwtString !== 'string') { return done(new JsonWebTokenError('jwt must be a string')); } const parts = jwtString.split('.'); if (parts.length !== 3) { return done(new JsonWebTokenError('jwt malformed')); } let decodedToken; try { decodedToken = decode(jwtString, { complete: true }); } catch (err) { return done(err); } if (!decodedToken) { return done(new JsonWebTokenError('invalid token')); } const header = decodedToken.header; let getSecret; if (typeof secretOrPublicKey === 'function') { if (!callback) { return done(new JsonWebTokenError('verify must be called asynchronous if secret or public key is provided as a callback')); } getSecret = secretOrPublicKey; } else { getSecret = function(header, secretCallback) { return secretCallback(null, secretOrPublicKey); }; } return getSecret(header, function(err, secretOrPublicKey) { if (err) { return done(new JsonWebTokenError('error in secret or public key callback: ' + err.message)); } const hasSignature = parts[2].trim() !== ''; if (!hasSignature && secretOrPublicKey) { return done(new JsonWebTokenError('jwt signature is required')); } if (hasSignature && !secretOrPublicKey) { return done(new JsonWebTokenError('secret or public key must be provided')); } if (!hasSignature && !options.algorithms) { return done(new JsonWebTokenError('please specify "none" in "algorithms" to verify unsigned tokens')); } if (secretOrPublicKey != null && !(secretOrPublicKey instanceof KeyObject)) { try { secretOrPublicKey = createPublicKey(secretOrPublicKey); } catch (_) { try { secretOrPublicKey = createSecretKey(typeof secretOrPublicKey === 'string' ? Buffer.from(secretOrPublicKey) : secretOrPublicKey); } catch (_) { return done(new JsonWebTokenError('secretOrPublicKey is not valid key material')); } } } if (!options.algorithms) { if (secretOrPublicKey.type === 'secret') { options.algorithms = HS_ALGS; } else if ([ 'rsa', 'rsa-pss' ].includes(secretOrPublicKey.asymmetricKeyType)) { options.algorithms = RSA_KEY_ALGS; } else if (secretOrPublicKey.asymmetricKeyType === 'ec') { options.algorithms = EC_KEY_ALGS; } else { options.algorithms = PUB_KEY_ALGS; } } if (options.algorithms.indexOf(decodedToken.header.alg) === -1) { return done(new JsonWebTokenError('invalid algorithm')); } if (header.alg.startsWith('HS') && secretOrPublicKey.type !== 'secret') { return done(new JsonWebTokenError(`secretOrPublicKey must be a symmetric key when using ${header.alg}`)); } else if (/^(?:RS|PS|ES)/.test(header.alg) && secretOrPublicKey.type !== 'public') { return done(new JsonWebTokenError(`secretOrPublicKey must be an asymmetric key when using ${header.alg}`)); } if (!options.allowInvalidAsymmetricKeyTypes) { try { validateAsymmetricKey(header.alg, secretOrPublicKey); } catch (e) { return done(e); } } let valid; try { valid = jws.verify(jwtString, decodedToken.header.alg, secretOrPublicKey); } catch (e) { return done(e); } if (!valid) { return done(new JsonWebTokenError('invalid signature')); } const payload = decodedToken.payload; if (typeof payload.nbf !== 'undefined' && !options.ignoreNotBefore) { if (typeof payload.nbf !== 'number') { return done(new JsonWebTokenError('invalid nbf value')); } if (payload.nbf > clockTimestamp + (options.clockTolerance || 0)) { return done(new NotBeforeError('jwt not active', new Date(payload.nbf * 1000))); } } if (typeof payload.exp !== 'undefined' && !options.ignoreExpiration) { if (typeof payload.exp !== 'number') { return done(new JsonWebTokenError('invalid exp value')); } if (clockTimestamp >= payload.exp + (options.clockTolerance || 0)) { return done(new TokenExpiredError('jwt expired', new Date(payload.exp * 1000))); } } if (options.audience) { const audiences = Array.isArray(options.audience) ? options.audience : [ options.audience ]; const target = Array.isArray(payload.aud) ? payload.aud : [ payload.aud ]; const match = target.some(function(targetAudience) { return audiences.some(function(audience) { return audience instanceof RegExp ? audience.test(targetAudience) : audience === targetAudience; }); }); if (!match) { return done(new JsonWebTokenError('jwt audience invalid. expected: ' + audiences.join(' or '))); } } if (options.issuer) { const invalid_issuer = typeof options.issuer === 'string' && payload.iss !== options.issuer || Array.isArray(options.issuer) && options.issuer.indexOf(payload.iss) === -1; if (invalid_issuer) { return done(new JsonWebTokenError('jwt issuer invalid. expected: ' + options.issuer)); } } if (options.subject) { if (payload.sub !== options.subject) { return done(new JsonWebTokenError('jwt subject invalid. expected: ' + options.subject)); } } if (options.jwtid) { if (payload.jti !== options.jwtid) { return done(new JsonWebTokenError('jwt jwtid invalid. expected: ' + options.jwtid)); } } if (options.nonce) { if (payload.nonce !== options.nonce) { return done(new JsonWebTokenError('jwt nonce invalid. expected: ' + options.nonce)); } } if (options.maxAge) { if (typeof payload.iat !== 'number') { return done(new JsonWebTokenError('iat required when maxAge is specified')); } const maxAgeTimestamp = timespan(options.maxAge, payload.iat); if (typeof maxAgeTimestamp === 'undefined') { return done(new JsonWebTokenError('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60')); } if (clockTimestamp >= maxAgeTimestamp + (options.clockTolerance || 0)) { return done(new TokenExpiredError('maxAge exceeded', new Date(maxAgeTimestamp * 1000))); } } if (options.complete === true) { const signature = decodedToken.signature; return done(null, { header: header, payload: payload, signature: signature }); } return done(null, payload); }); }; }), "[project]/node_modules/jwa/index.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { var Buffer = __turbopack_context__.r("[project]/node_modules/safe-buffer/index.js [app-route] (ecmascript)").Buffer; var crypto = __turbopack_context__.r("[externals]/crypto [external] (crypto, cjs)"); var formatEcdsa = __turbopack_context__.r("[project]/node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js [app-route] (ecmascript)"); var util = __turbopack_context__.r("[externals]/util [external] (util, cjs)"); var MSG_INVALID_ALGORITHM = '"%s" is not a valid algorithm.\n Supported algorithms are:\n "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".'; var MSG_INVALID_SECRET = 'secret must be a string or buffer'; var MSG_INVALID_VERIFIER_KEY = 'key must be a string or a buffer'; var MSG_INVALID_SIGNER_KEY = 'key must be a string, a buffer or an object'; var supportsKeyObjects = typeof crypto.createPublicKey === 'function'; if (supportsKeyObjects) { MSG_INVALID_VERIFIER_KEY += ' or a KeyObject'; MSG_INVALID_SECRET += 'or a KeyObject'; } function checkIsPublicKey(key) { if (Buffer.isBuffer(key)) { return; } if (typeof key === 'string') { return; } if (!supportsKeyObjects) { throw typeError(MSG_INVALID_VERIFIER_KEY); } if (typeof key !== 'object') { throw typeError(MSG_INVALID_VERIFIER_KEY); } if (typeof key.type !== 'string') { throw typeError(MSG_INVALID_VERIFIER_KEY); } if (typeof key.asymmetricKeyType !== 'string') { throw typeError(MSG_INVALID_VERIFIER_KEY); } if (typeof key.export !== 'function') { throw typeError(MSG_INVALID_VERIFIER_KEY); } } ; function checkIsPrivateKey(key) { if (Buffer.isBuffer(key)) { return; } if (typeof key === 'string') { return; } if (typeof key === 'object') { return; } throw typeError(MSG_INVALID_SIGNER_KEY); } ; function checkIsSecretKey(key) { if (Buffer.isBuffer(key)) { return; } if (typeof key === 'string') { return key; } if (!supportsKeyObjects) { throw typeError(MSG_INVALID_SECRET); } if (typeof key !== 'object') { throw typeError(MSG_INVALID_SECRET); } if (key.type !== 'secret') { throw typeError(MSG_INVALID_SECRET); } if (typeof key.export !== 'function') { throw typeError(MSG_INVALID_SECRET); } } function fromBase64(base64) { return base64.replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_'); } function toBase64(base64url) { base64url = base64url.toString(); var padding = 4 - base64url.length % 4; if (padding !== 4) { for(var i = 0; i < padding; ++i){ base64url += '='; } } return base64url.replace(/\-/g, '+').replace(/_/g, '/'); } function typeError(template) { var args = [].slice.call(arguments, 1); var errMsg = util.format.bind(util, template).apply(null, args); return new TypeError(errMsg); } function bufferOrString(obj) { return Buffer.isBuffer(obj) || typeof obj === 'string'; } function normalizeInput(thing) { if (!bufferOrString(thing)) thing = JSON.stringify(thing); return thing; } function createHmacSigner(bits) { return function sign(thing, secret) { checkIsSecretKey(secret); thing = normalizeInput(thing); var hmac = crypto.createHmac('sha' + bits, secret); var sig = (hmac.update(thing), hmac.digest('base64')); return fromBase64(sig); }; } var bufferEqual; var timingSafeEqual = 'timingSafeEqual' in crypto ? function timingSafeEqual(a, b) { if (a.byteLength !== b.byteLength) { return false; } return crypto.timingSafeEqual(a, b); } : function timingSafeEqual(a, b) { if (!bufferEqual) { bufferEqual = __turbopack_context__.r("[project]/node_modules/buffer-equal-constant-time/index.js [app-route] (ecmascript)"); } return bufferEqual(a, b); }; function createHmacVerifier(bits) { return function verify(thing, signature, secret) { var computedSig = createHmacSigner(bits)(thing, secret); return timingSafeEqual(Buffer.from(signature), Buffer.from(computedSig)); }; } function createKeySigner(bits) { return function sign(thing, privateKey) { checkIsPrivateKey(privateKey); thing = normalizeInput(thing); // Even though we are specifying "RSA" here, this works with ECDSA // keys as well. var signer = crypto.createSign('RSA-SHA' + bits); var sig = (signer.update(thing), signer.sign(privateKey, 'base64')); return fromBase64(sig); }; } function createKeyVerifier(bits) { return function verify(thing, signature, publicKey) { checkIsPublicKey(publicKey); thing = normalizeInput(thing); signature = toBase64(signature); var verifier = crypto.createVerify('RSA-SHA' + bits); verifier.update(thing); return verifier.verify(publicKey, signature, 'base64'); }; } function createPSSKeySigner(bits) { return function sign(thing, privateKey) { checkIsPrivateKey(privateKey); thing = normalizeInput(thing); var signer = crypto.createSign('RSA-SHA' + bits); var sig = (signer.update(thing), signer.sign({ key: privateKey, padding: crypto.constants.RSA_PKCS1_PSS_PADDING, saltLength: crypto.constants.RSA_PSS_SALTLEN_DIGEST }, 'base64')); return fromBase64(sig); }; } function createPSSKeyVerifier(bits) { return function verify(thing, signature, publicKey) { checkIsPublicKey(publicKey); thing = normalizeInput(thing); signature = toBase64(signature); var verifier = crypto.createVerify('RSA-SHA' + bits); verifier.update(thing); return verifier.verify({ key: publicKey, padding: crypto.constants.RSA_PKCS1_PSS_PADDING, saltLength: crypto.constants.RSA_PSS_SALTLEN_DIGEST }, signature, 'base64'); }; } function createECDSASigner(bits) { var inner = createKeySigner(bits); return function sign() { var signature = inner.apply(null, arguments); signature = formatEcdsa.derToJose(signature, 'ES' + bits); return signature; }; } function createECDSAVerifer(bits) { var inner = createKeyVerifier(bits); return function verify(thing, signature, publicKey) { signature = formatEcdsa.joseToDer(signature, 'ES' + bits).toString('base64'); var result = inner(thing, signature, publicKey); return result; }; } function createNoneSigner() { return function sign() { return ''; }; } function createNoneVerifier() { return function verify(thing, signature) { return signature === ''; }; } module.exports = function jwa(algorithm) { var signerFactories = { hs: createHmacSigner, rs: createKeySigner, ps: createPSSKeySigner, es: createECDSASigner, none: createNoneSigner }; var verifierFactories = { hs: createHmacVerifier, rs: createKeyVerifier, ps: createPSSKeyVerifier, es: createECDSAVerifer, none: createNoneVerifier }; var match = algorithm.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/); if (!match) throw typeError(MSG_INVALID_ALGORITHM, algorithm); var algo = (match[1] || match[3]).toLowerCase(); var bits = match[2]; return { sign: signerFactories[algo](bits), verify: verifierFactories[algo](bits) }; }; }), "[project]/node_modules/jws/index.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { /*global exports*/ var SignStream = __turbopack_context__.r("[project]/node_modules/jws/lib/sign-stream.js [app-route] (ecmascript)"); var VerifyStream = __turbopack_context__.r("[project]/node_modules/jws/lib/verify-stream.js [app-route] (ecmascript)"); var ALGORITHMS = [ 'HS256', 'HS384', 'HS512', 'RS256', 'RS384', 'RS512', 'PS256', 'PS384', 'PS512', 'ES256', 'ES384', 'ES512' ]; exports.ALGORITHMS = ALGORITHMS; exports.sign = SignStream.sign; exports.verify = VerifyStream.verify; exports.decode = VerifyStream.decode; exports.isValid = VerifyStream.isValid; exports.createSign = function createSign(opts) { return new SignStream(opts); }; exports.createVerify = function createVerify(opts) { return new VerifyStream(opts); }; }), "[project]/node_modules/jws/lib/data-stream.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { /*global module, process*/ var Buffer = __turbopack_context__.r("[project]/node_modules/safe-buffer/index.js [app-route] (ecmascript)").Buffer; var Stream = __turbopack_context__.r("[externals]/stream [external] (stream, cjs)"); var util = __turbopack_context__.r("[externals]/util [external] (util, cjs)"); function DataStream(data) { this.buffer = null; this.writable = true; this.readable = true; // No input if (!data) { this.buffer = Buffer.alloc(0); return this; } // Stream if (typeof data.pipe === 'function') { this.buffer = Buffer.alloc(0); data.pipe(this); return this; } // Buffer or String // or Object (assumedly a passworded key) if (data.length || typeof data === 'object') { this.buffer = data; this.writable = false; process.nextTick((function() { this.emit('end', data); this.readable = false; this.emit('close'); }).bind(this)); return this; } throw new TypeError('Unexpected data type (' + typeof data + ')'); } util.inherits(DataStream, Stream); DataStream.prototype.write = function write(data) { this.buffer = Buffer.concat([ this.buffer, Buffer.from(data) ]); this.emit('data', data); }; DataStream.prototype.end = function end(data) { if (data) this.write(data); this.emit('end', data); this.emit('close'); this.writable = false; this.readable = false; }; module.exports = DataStream; }), "[project]/node_modules/jws/lib/sign-stream.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { /*global module*/ var Buffer = __turbopack_context__.r("[project]/node_modules/safe-buffer/index.js [app-route] (ecmascript)").Buffer; var DataStream = __turbopack_context__.r("[project]/node_modules/jws/lib/data-stream.js [app-route] (ecmascript)"); var jwa = __turbopack_context__.r("[project]/node_modules/jwa/index.js [app-route] (ecmascript)"); var Stream = __turbopack_context__.r("[externals]/stream [external] (stream, cjs)"); var toString = __turbopack_context__.r("[project]/node_modules/jws/lib/tostring.js [app-route] (ecmascript)"); var util = __turbopack_context__.r("[externals]/util [external] (util, cjs)"); function base64url(string, encoding) { return Buffer.from(string, encoding).toString('base64').replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_'); } function jwsSecuredInput(header, payload, encoding) { encoding = encoding || 'utf8'; var encodedHeader = base64url(toString(header), 'binary'); var encodedPayload = base64url(toString(payload), encoding); return util.format('%s.%s', encodedHeader, encodedPayload); } function jwsSign(opts) { var header = opts.header; var payload = opts.payload; var secretOrKey = opts.secret || opts.privateKey; var encoding = opts.encoding; var algo = jwa(header.alg); var securedInput = jwsSecuredInput(header, payload, encoding); var signature = algo.sign(securedInput, secretOrKey); return util.format('%s.%s', securedInput, signature); } function SignStream(opts) { var secret = opts.secret; secret = secret == null ? opts.privateKey : secret; secret = secret == null ? opts.key : secret; if (/^hs/i.test(opts.header.alg) === true && secret == null) { throw new TypeError('secret must be a string or buffer or a KeyObject'); } var secretStream = new DataStream(secret); this.readable = true; this.header = opts.header; this.encoding = opts.encoding; this.secret = this.privateKey = this.key = secretStream; this.payload = new DataStream(opts.payload); this.secret.once('close', (function() { if (!this.payload.writable && this.readable) this.sign(); }).bind(this)); this.payload.once('close', (function() { if (!this.secret.writable && this.readable) this.sign(); }).bind(this)); } util.inherits(SignStream, Stream); SignStream.prototype.sign = function sign() { try { var signature = jwsSign({ header: this.header, payload: this.payload.buffer, secret: this.secret.buffer, encoding: this.encoding }); this.emit('done', signature); this.emit('data', signature); this.emit('end'); this.readable = false; return signature; } catch (e) { this.readable = false; this.emit('error', e); this.emit('close'); } }; SignStream.sign = jwsSign; module.exports = SignStream; }), "[project]/node_modules/jws/lib/tostring.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { /*global module*/ var Buffer = __turbopack_context__.r("[externals]/buffer [external] (buffer, cjs)").Buffer; module.exports = function toString(obj) { if (typeof obj === 'string') return obj; if (typeof obj === 'number' || Buffer.isBuffer(obj)) return obj.toString(); return JSON.stringify(obj); }; }), "[project]/node_modules/jws/lib/verify-stream.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { /*global module*/ var Buffer = __turbopack_context__.r("[project]/node_modules/safe-buffer/index.js [app-route] (ecmascript)").Buffer; var DataStream = __turbopack_context__.r("[project]/node_modules/jws/lib/data-stream.js [app-route] (ecmascript)"); var jwa = __turbopack_context__.r("[project]/node_modules/jwa/index.js [app-route] (ecmascript)"); var Stream = __turbopack_context__.r("[externals]/stream [external] (stream, cjs)"); var toString = __turbopack_context__.r("[project]/node_modules/jws/lib/tostring.js [app-route] (ecmascript)"); var util = __turbopack_context__.r("[externals]/util [external] (util, cjs)"); var JWS_REGEX = /^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/; function isObject(thing) { return Object.prototype.toString.call(thing) === '[object Object]'; } function safeJsonParse(thing) { if (isObject(thing)) return thing; try { return JSON.parse(thing); } catch (e) { return undefined; } } function headerFromJWS(jwsSig) { var encodedHeader = jwsSig.split('.', 1)[0]; return safeJsonParse(Buffer.from(encodedHeader, 'base64').toString('binary')); } function securedInputFromJWS(jwsSig) { return jwsSig.split('.', 2).join('.'); } function signatureFromJWS(jwsSig) { return jwsSig.split('.')[2]; } function payloadFromJWS(jwsSig, encoding) { encoding = encoding || 'utf8'; var payload = jwsSig.split('.')[1]; return Buffer.from(payload, 'base64').toString(encoding); } function isValidJws(string) { return JWS_REGEX.test(string) && !!headerFromJWS(string); } function jwsVerify(jwsSig, algorithm, secretOrKey) { if (!algorithm) { var err = new Error("Missing algorithm parameter for jws.verify"); err.code = "MISSING_ALGORITHM"; throw err; } jwsSig = toString(jwsSig); var signature = signatureFromJWS(jwsSig); var securedInput = securedInputFromJWS(jwsSig); var algo = jwa(algorithm); return algo.verify(securedInput, signature, secretOrKey); } function jwsDecode(jwsSig, opts) { opts = opts || {}; jwsSig = toString(jwsSig); if (!isValidJws(jwsSig)) return null; var header = headerFromJWS(jwsSig); if (!header) return null; var payload = payloadFromJWS(jwsSig); if (header.typ === 'JWT' || opts.json) payload = JSON.parse(payload, opts.encoding); return { header: header, payload: payload, signature: signatureFromJWS(jwsSig) }; } function VerifyStream(opts) { opts = opts || {}; var secretOrKey = opts.secret; secretOrKey = secretOrKey == null ? opts.publicKey : secretOrKey; secretOrKey = secretOrKey == null ? opts.key : secretOrKey; if (/^hs/i.test(opts.algorithm) === true && secretOrKey == null) { throw new TypeError('secret must be a string or buffer or a KeyObject'); } var secretStream = new DataStream(secretOrKey); this.readable = true; this.algorithm = opts.algorithm; this.encoding = opts.encoding; this.secret = this.publicKey = this.key = secretStream; this.signature = new DataStream(opts.signature); this.secret.once('close', (function() { if (!this.signature.writable && this.readable) this.verify(); }).bind(this)); this.signature.once('close', (function() { if (!this.secret.writable && this.readable) this.verify(); }).bind(this)); } util.inherits(VerifyStream, Stream); VerifyStream.prototype.verify = function verify() { try { var valid = jwsVerify(this.signature.buffer, this.algorithm, this.key.buffer); var obj = jwsDecode(this.signature.buffer, this.encoding); this.emit('done', valid, obj); this.emit('data', valid); this.emit('end'); this.readable = false; return valid; } catch (e) { this.readable = false; this.emit('error', e); this.emit('close'); } }; VerifyStream.decode = jwsDecode; VerifyStream.isValid = isValidJws; VerifyStream.verify = jwsVerify; module.exports = VerifyStream; }), "[project]/node_modules/lodash.includes/index.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { /** * lodash (Custom Build) * Build: `lodash modularize exports="npm" -o ./` * Copyright jQuery Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 1.7976931348623157e+308, NAN = 0 / 0; /** `Object#toString` result references. */ var argsTag = '[object Arguments]', funcTag = '[object Function]', genTag = '[object GeneratorFunction]', stringTag = '[object String]', symbolTag = '[object Symbol]'; /** Used to match leading and trailing whitespace. */ var reTrim = /^\s+|\s+$/g; /** Used to detect bad signed hexadecimal string values. */ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; /** Used to detect binary string values. */ var reIsBinary = /^0b[01]+$/i; /** Used to detect octal string values. */ var reIsOctal = /^0o[0-7]+$/i; /** Used to detect unsigned integer values. */ var reIsUint = /^(?:0|[1-9]\d*)$/; /** Built-in method references without a dependency on `root`. */ var freeParseInt = parseInt; /** * A specialized version of `_.map` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function arrayMap(array, iteratee) { var index = -1, length = array ? array.length : 0, result = Array(length); while(++index < length){ result[index] = iteratee(array[index], index, array); } return result; } /** * The base implementation of `_.findIndex` and `_.findLastIndex` without * support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} predicate The function invoked per iteration. * @param {number} fromIndex The index to search from. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseFindIndex(array, predicate, fromIndex, fromRight) { var length = array.length, index = fromIndex + (fromRight ? 1 : -1); while(fromRight ? index-- : ++index < length){ if (predicate(array[index], index, array)) { return index; } } return -1; } /** * The base implementation of `_.indexOf` without `fromIndex` bounds checks. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseIndexOf(array, value, fromIndex) { if (value !== value) { return baseFindIndex(array, baseIsNaN, fromIndex); } var index = fromIndex - 1, length = array.length; while(++index < length){ if (array[index] === value) { return index; } } return -1; } /** * The base implementation of `_.isNaN` without support for number objects. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. */ function baseIsNaN(value) { return value !== value; } /** * The base implementation of `_.times` without support for iteratee shorthands * or max array length checks. * * @private * @param {number} n The number of times to invoke `iteratee`. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the array of results. */ function baseTimes(n, iteratee) { var index = -1, result = Array(n); while(++index < n){ result[index] = iteratee(index); } return result; } /** * The base implementation of `_.values` and `_.valuesIn` which creates an * array of `object` property values corresponding to the property names * of `props`. * * @private * @param {Object} object The object to query. * @param {Array} props The property names to get values for. * @returns {Object} Returns the array of property values. */ function baseValues(object, props) { return arrayMap(props, function(key) { return object[key]; }); } /** * Creates a unary function that invokes `func` with its argument transformed. * * @private * @param {Function} func The function to wrap. * @param {Function} transform The argument transform. * @returns {Function} Returns the new function. */ function overArg(func, transform) { return function(arg) { return func(transform(arg)); }; } /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; /** Built-in value references. */ var propertyIsEnumerable = objectProto.propertyIsEnumerable; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeKeys = overArg(Object.keys, Object), nativeMax = Math.max; /** * Creates an array of the enumerable property names of the array-like `value`. * * @private * @param {*} value The value to query. * @param {boolean} inherited Specify returning inherited property names. * @returns {Array} Returns the array of property names. */ function arrayLikeKeys(value, inherited) { // Safari 8.1 makes `arguments.callee` enumerable in strict mode. // Safari 9 makes `arguments.length` enumerable in strict mode. var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : []; var length = result.length, skipIndexes = !!length; for(var key in value){ if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == 'length' || isIndex(key, length)))) { result.push(key); } } return result; } /** * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeys(object) { if (!isPrototype(object)) { return nativeKeys(object); } var result = []; for(var key in Object(object)){ if (hasOwnProperty.call(object, key) && key != 'constructor') { result.push(key); } } return result; } /** * Checks if `value` is a valid array-like index. * * @private * @param {*} value The value to check. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { length = length == null ? MAX_SAFE_INTEGER : length; return !!length && (typeof value == 'number' || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length; } /** * Checks if `value` is likely a prototype object. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. */ function isPrototype(value) { var Ctor = value && value.constructor, proto = typeof Ctor == 'function' && Ctor.prototype || objectProto; return value === proto; } /** * Checks if `value` is in `collection`. If `collection` is a string, it's * checked for a substring of `value`, otherwise * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * is used for equality comparisons. If `fromIndex` is negative, it's used as * the offset from the end of `collection`. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object|string} collection The collection to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=0] The index to search from. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. * @returns {boolean} Returns `true` if `value` is found, else `false`. * @example * * _.includes([1, 2, 3], 1); * // => true * * _.includes([1, 2, 3], 1, 2); * // => false * * _.includes({ 'a': 1, 'b': 2 }, 1); * // => true * * _.includes('abcd', 'bc'); * // => true */ function includes(collection, value, fromIndex, guard) { collection = isArrayLike(collection) ? collection : values(collection); fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0; var length = collection.length; if (fromIndex < 0) { fromIndex = nativeMax(length + fromIndex, 0); } return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1; } /** * Checks if `value` is likely an `arguments` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, * else `false`. * @example * * _.isArguments(function() { return arguments; }()); * // => true * * _.isArguments([1, 2, 3]); * // => false */ function isArguments(value) { // Safari 8.1 makes `arguments.callee` enumerable in strict mode. return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); } /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */ var isArray = Array.isArray; /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @example * * _.isArrayLike([1, 2, 3]); * // => true * * _.isArrayLike(document.body.children); * // => true * * _.isArrayLike('abc'); * // => true * * _.isArrayLike(_.noop); * // => false */ function isArrayLike(value) { return value != null && isLength(value.length) && !isFunction(value); } /** * This method is like `_.isArrayLike` except that it also checks if `value` * is an object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array-like object, * else `false`. * @example * * _.isArrayLikeObject([1, 2, 3]); * // => true * * _.isArrayLikeObject(document.body.children); * // => true * * _.isArrayLikeObject('abc'); * // => false * * _.isArrayLikeObject(_.noop); * // => false */ function isArrayLikeObject(value) { return isObjectLike(value) && isArrayLike(value); } /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 8-9 which returns 'object' for typed array and other constructors. var tag = isObject(value) ? objectToString.call(value) : ''; return tag == funcTag || tag == genTag; } /** * Checks if `value` is a valid array-like length. * * **Note:** This method is loosely based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); * // => true * * _.isLength(Number.MIN_VALUE); * // => false * * _.isLength(Infinity); * // => false * * _.isLength('3'); * // => false */ function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return !!value && (type == 'object' || type == 'function'); } /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return !!value && typeof value == 'object'; } /** * Checks if `value` is classified as a `String` primitive or object. * * @static * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a string, else `false`. * @example * * _.isString('abc'); * // => true * * _.isString(1); * // => false */ function isString(value) { return typeof value == 'string' || !isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag; } /** * Checks if `value` is classified as a `Symbol` primitive or object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); * // => true * * _.isSymbol('abc'); * // => false */ function isSymbol(value) { return typeof value == 'symbol' || isObjectLike(value) && objectToString.call(value) == symbolTag; } /** * Converts `value` to a finite number. * * @static * @memberOf _ * @since 4.12.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted number. * @example * * _.toFinite(3.2); * // => 3.2 * * _.toFinite(Number.MIN_VALUE); * // => 5e-324 * * _.toFinite(Infinity); * // => 1.7976931348623157e+308 * * _.toFinite('3.2'); * // => 3.2 */ function toFinite(value) { if (!value) { return value === 0 ? value : 0; } value = toNumber(value); if (value === INFINITY || value === -INFINITY) { var sign = value < 0 ? -1 : 1; return sign * MAX_INTEGER; } return value === value ? value : 0; } /** * Converts `value` to an integer. * * **Note:** This method is loosely based on * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toInteger(3.2); * // => 3 * * _.toInteger(Number.MIN_VALUE); * // => 0 * * _.toInteger(Infinity); * // => 1.7976931348623157e+308 * * _.toInteger('3.2'); * // => 3 */ function toInteger(value) { var result = toFinite(value), remainder = result % 1; return result === result ? remainder ? result - remainder : result : 0; } /** * Converts `value` to a number. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {number} Returns the number. * @example * * _.toNumber(3.2); * // => 3.2 * * _.toNumber(Number.MIN_VALUE); * // => 5e-324 * * _.toNumber(Infinity); * // => Infinity * * _.toNumber('3.2'); * // => 3.2 */ function toNumber(value) { if (typeof value == 'number') { return value; } if (isSymbol(value)) { return NAN; } if (isObject(value)) { var other = typeof value.valueOf == 'function' ? value.valueOf() : value; value = isObject(other) ? other + '' : other; } if (typeof value != 'string') { return value === 0 ? value : +value; } value = value.replace(reTrim, ''); var isBinary = reIsBinary.test(value); return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; } /** * Creates an array of the own enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. See the * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * for more details. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keys(new Foo); * // => ['a', 'b'] (iteration order is not guaranteed) * * _.keys('hi'); * // => ['0', '1'] */ function keys(object) { return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); } /** * Creates an array of the own enumerable string keyed property values of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property values. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.values(new Foo); * // => [1, 2] (iteration order is not guaranteed) * * _.values('hi'); * // => ['h', 'i'] */ function values(object) { return object ? baseValues(object, keys(object)) : []; } module.exports = includes; }), "[project]/node_modules/lodash.isboolean/index.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { /** * lodash 3.0.3 (Custom Build) * Build: `lodash modularize exports="npm" -o ./` * Copyright 2012-2016 The Dojo Foundation * Based on Underscore.js 1.8.3 * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ /** `Object#toString` result references. */ var boolTag = '[object Boolean]'; /** Used for built-in method references. */ var objectProto = Object.prototype; /** * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; /** * Checks if `value` is classified as a boolean primitive or object. * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @example * * _.isBoolean(false); * // => true * * _.isBoolean(null); * // => false */ function isBoolean(value) { return value === true || value === false || isObjectLike(value) && objectToString.call(value) == boolTag; } /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return !!value && typeof value == 'object'; } module.exports = isBoolean; }), "[project]/node_modules/lodash.isinteger/index.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { /** * lodash (Custom Build) * Build: `lodash modularize exports="npm" -o ./` * Copyright jQuery Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0, MAX_INTEGER = 1.7976931348623157e+308, NAN = 0 / 0; /** `Object#toString` result references. */ var symbolTag = '[object Symbol]'; /** Used to match leading and trailing whitespace. */ var reTrim = /^\s+|\s+$/g; /** Used to detect bad signed hexadecimal string values. */ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; /** Used to detect binary string values. */ var reIsBinary = /^0b[01]+$/i; /** Used to detect octal string values. */ var reIsOctal = /^0o[0-7]+$/i; /** Built-in method references without a dependency on `root`. */ var freeParseInt = parseInt; /** Used for built-in method references. */ var objectProto = Object.prototype; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; /** * Checks if `value` is an integer. * * **Note:** This method is based on * [`Number.isInteger`](https://mdn.io/Number/isInteger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an integer, else `false`. * @example * * _.isInteger(3); * // => true * * _.isInteger(Number.MIN_VALUE); * // => false * * _.isInteger(Infinity); * // => false * * _.isInteger('3'); * // => false */ function isInteger(value) { return typeof value == 'number' && value == toInteger(value); } /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return !!value && (type == 'object' || type == 'function'); } /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return !!value && typeof value == 'object'; } /** * Checks if `value` is classified as a `Symbol` primitive or object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); * // => true * * _.isSymbol('abc'); * // => false */ function isSymbol(value) { return typeof value == 'symbol' || isObjectLike(value) && objectToString.call(value) == symbolTag; } /** * Converts `value` to a finite number. * * @static * @memberOf _ * @since 4.12.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted number. * @example * * _.toFinite(3.2); * // => 3.2 * * _.toFinite(Number.MIN_VALUE); * // => 5e-324 * * _.toFinite(Infinity); * // => 1.7976931348623157e+308 * * _.toFinite('3.2'); * // => 3.2 */ function toFinite(value) { if (!value) { return value === 0 ? value : 0; } value = toNumber(value); if (value === INFINITY || value === -INFINITY) { var sign = value < 0 ? -1 : 1; return sign * MAX_INTEGER; } return value === value ? value : 0; } /** * Converts `value` to an integer. * * **Note:** This method is loosely based on * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toInteger(3.2); * // => 3 * * _.toInteger(Number.MIN_VALUE); * // => 0 * * _.toInteger(Infinity); * // => 1.7976931348623157e+308 * * _.toInteger('3.2'); * // => 3 */ function toInteger(value) { var result = toFinite(value), remainder = result % 1; return result === result ? remainder ? result - remainder : result : 0; } /** * Converts `value` to a number. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {number} Returns the number. * @example * * _.toNumber(3.2); * // => 3.2 * * _.toNumber(Number.MIN_VALUE); * // => 5e-324 * * _.toNumber(Infinity); * // => Infinity * * _.toNumber('3.2'); * // => 3.2 */ function toNumber(value) { if (typeof value == 'number') { return value; } if (isSymbol(value)) { return NAN; } if (isObject(value)) { var other = typeof value.valueOf == 'function' ? value.valueOf() : value; value = isObject(other) ? other + '' : other; } if (typeof value != 'string') { return value === 0 ? value : +value; } value = value.replace(reTrim, ''); var isBinary = reIsBinary.test(value); return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; } module.exports = isInteger; }), "[project]/node_modules/lodash.isnumber/index.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { /** * lodash 3.0.3 (Custom Build) * Build: `lodash modularize exports="npm" -o ./` * Copyright 2012-2016 The Dojo Foundation * Based on Underscore.js 1.8.3 * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ /** `Object#toString` result references. */ var numberTag = '[object Number]'; /** Used for built-in method references. */ var objectProto = Object.prototype; /** * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return !!value && typeof value == 'object'; } /** * Checks if `value` is classified as a `Number` primitive or object. * * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified * as numbers, use the `_.isFinite` method. * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @example * * _.isNumber(3); * // => true * * _.isNumber(Number.MIN_VALUE); * // => true * * _.isNumber(Infinity); * // => true * * _.isNumber('3'); * // => false */ function isNumber(value) { return typeof value == 'number' || isObjectLike(value) && objectToString.call(value) == numberTag; } module.exports = isNumber; }), "[project]/node_modules/lodash.isplainobject/index.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { /** * lodash (Custom Build) * Build: `lodash modularize exports="npm" -o ./` * Copyright jQuery Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ /** `Object#toString` result references. */ var objectTag = '[object Object]'; /** * Checks if `value` is a host object in IE < 9. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a host object, else `false`. */ function isHostObject(value) { // Many host objects are `Object` objects that can coerce to strings // despite having improperly defined `toString` methods. var result = false; if (value != null && typeof value.toString != 'function') { try { result = !!(value + ''); } catch (e) {} } return result; } /** * Creates a unary function that invokes `func` with its argument transformed. * * @private * @param {Function} func The function to wrap. * @param {Function} transform The argument transform. * @returns {Function} Returns the new function. */ function overArg(func, transform) { return function(arg) { return func(transform(arg)); }; } /** Used for built-in method references. */ var funcProto = Function.prototype, objectProto = Object.prototype; /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** Used to infer the `Object` constructor. */ var objectCtorString = funcToString.call(Object); /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; /** Built-in value references. */ var getPrototype = overArg(Object.getPrototypeOf, Object); /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return !!value && typeof value == 'object'; } /** * Checks if `value` is a plain object, that is, an object created by the * `Object` constructor or one with a `[[Prototype]]` of `null`. * * @static * @memberOf _ * @since 0.8.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. * @example * * function Foo() { * this.a = 1; * } * * _.isPlainObject(new Foo); * // => false * * _.isPlainObject([1, 2, 3]); * // => false * * _.isPlainObject({ 'x': 0, 'y': 0 }); * // => true * * _.isPlainObject(Object.create(null)); * // => true */ function isPlainObject(value) { if (!isObjectLike(value) || objectToString.call(value) != objectTag || isHostObject(value)) { return false; } var proto = getPrototype(value); if (proto === null) { return true; } var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; } module.exports = isPlainObject; }), "[project]/node_modules/lodash.isstring/index.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { /** * lodash 4.0.1 (Custom Build) * Build: `lodash modularize exports="npm" -o ./` * Copyright 2012-2016 The Dojo Foundation * Based on Underscore.js 1.8.3 * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ /** `Object#toString` result references. */ var stringTag = '[object String]'; /** Used for built-in method references. */ var objectProto = Object.prototype; /** * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @type Function * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */ var isArray = Array.isArray; /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return !!value && typeof value == 'object'; } /** * Checks if `value` is classified as a `String` primitive or object. * * @static * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. * @example * * _.isString('abc'); * // => true * * _.isString(1); * // => false */ function isString(value) { return typeof value == 'string' || !isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag; } module.exports = isString; }), "[project]/node_modules/lodash.once/index.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { /** * lodash (Custom Build) * Build: `lodash modularize exports="npm" -o ./` * Copyright jQuery Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ /** Used as the `TypeError` message for "Functions" methods. */ var FUNC_ERROR_TEXT = 'Expected a function'; /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0, MAX_INTEGER = 1.7976931348623157e+308, NAN = 0 / 0; /** `Object#toString` result references. */ var symbolTag = '[object Symbol]'; /** Used to match leading and trailing whitespace. */ var reTrim = /^\s+|\s+$/g; /** Used to detect bad signed hexadecimal string values. */ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; /** Used to detect binary string values. */ var reIsBinary = /^0b[01]+$/i; /** Used to detect octal string values. */ var reIsOctal = /^0o[0-7]+$/i; /** Built-in method references without a dependency on `root`. */ var freeParseInt = parseInt; /** Used for built-in method references. */ var objectProto = Object.prototype; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; /** * Creates a function that invokes `func`, with the `this` binding and arguments * of the created function, while it's called less than `n` times. Subsequent * calls to the created function return the result of the last `func` invocation. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {number} n The number of calls at which `func` is no longer invoked. * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example * * jQuery(element).on('click', _.before(5, addContactToList)); * // => Allows adding up to 4 contacts to the list. */ function before(n, func) { var result; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } n = toInteger(n); return function() { if (--n > 0) { result = func.apply(this, arguments); } if (n <= 1) { func = undefined; } return result; }; } /** * Creates a function that is restricted to invoking `func` once. Repeat calls * to the function return the value of the first invocation. The `func` is * invoked with the `this` binding and arguments of the created function. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example * * var initialize = _.once(createApplication); * initialize(); * initialize(); * // => `createApplication` is invoked once */ function once(func) { return before(2, func); } /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return !!value && (type == 'object' || type == 'function'); } /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return !!value && typeof value == 'object'; } /** * Checks if `value` is classified as a `Symbol` primitive or object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); * // => true * * _.isSymbol('abc'); * // => false */ function isSymbol(value) { return typeof value == 'symbol' || isObjectLike(value) && objectToString.call(value) == symbolTag; } /** * Converts `value` to a finite number. * * @static * @memberOf _ * @since 4.12.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted number. * @example * * _.toFinite(3.2); * // => 3.2 * * _.toFinite(Number.MIN_VALUE); * // => 5e-324 * * _.toFinite(Infinity); * // => 1.7976931348623157e+308 * * _.toFinite('3.2'); * // => 3.2 */ function toFinite(value) { if (!value) { return value === 0 ? value : 0; } value = toNumber(value); if (value === INFINITY || value === -INFINITY) { var sign = value < 0 ? -1 : 1; return sign * MAX_INTEGER; } return value === value ? value : 0; } /** * Converts `value` to an integer. * * **Note:** This method is loosely based on * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toInteger(3.2); * // => 3 * * _.toInteger(Number.MIN_VALUE); * // => 0 * * _.toInteger(Infinity); * // => 1.7976931348623157e+308 * * _.toInteger('3.2'); * // => 3 */ function toInteger(value) { var result = toFinite(value), remainder = result % 1; return result === result ? remainder ? result - remainder : result : 0; } /** * Converts `value` to a number. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {number} Returns the number. * @example * * _.toNumber(3.2); * // => 3.2 * * _.toNumber(Number.MIN_VALUE); * // => 5e-324 * * _.toNumber(Infinity); * // => Infinity * * _.toNumber('3.2'); * // => 3.2 */ function toNumber(value) { if (typeof value == 'number') { return value; } if (isSymbol(value)) { return NAN; } if (isObject(value)) { var other = typeof value.valueOf == 'function' ? value.valueOf() : value; value = isObject(other) ? other + '' : other; } if (typeof value != 'string') { return value === 0 ? value : +value; } value = value.replace(reTrim, ''); var isBinary = reIsBinary.test(value); return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; } module.exports = once; }), "[project]/node_modules/ms/index.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var w = d * 7; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function(val, options) { options = options || {}; var type = typeof val; if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isFinite(val)) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch(type){ case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'weeks': case 'week': case 'w': return n * w; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': return n; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return Math.round(ms / d) + 'd'; } if (msAbs >= h) { return Math.round(ms / h) + 'h'; } if (msAbs >= m) { return Math.round(ms / m) + 'm'; } if (msAbs >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return plural(ms, msAbs, d, 'day'); } if (msAbs >= h) { return plural(ms, msAbs, h, 'hour'); } if (msAbs >= m) { return plural(ms, msAbs, m, 'minute'); } if (msAbs >= s) { return plural(ms, msAbs, s, 'second'); } return ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, msAbs, n, name) { var isPlural = msAbs >= n * 1.5; return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); } }), "[project]/node_modules/next/dist/compiled/@edge-runtime/cookies/index.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all)=>{ for(var name in all)__defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc)=>{ if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from))if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: ()=>from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod)=>__copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/index.ts var src_exports = {}; __export(src_exports, { RequestCookies: ()=>RequestCookies, ResponseCookies: ()=>ResponseCookies, parseCookie: ()=>parseCookie, parseSetCookie: ()=>parseSetCookie, stringifyCookie: ()=>stringifyCookie }); module.exports = __toCommonJS(src_exports); // src/serialize.ts function stringifyCookie(c) { var _a; const attrs = [ "path" in c && c.path && `Path=${c.path}`, "expires" in c && (c.expires || c.expires === 0) && `Expires=${(typeof c.expires === "number" ? new Date(c.expires) : c.expires).toUTCString()}`, "maxAge" in c && typeof c.maxAge === "number" && `Max-Age=${c.maxAge}`, "domain" in c && c.domain && `Domain=${c.domain}`, "secure" in c && c.secure && "Secure", "httpOnly" in c && c.httpOnly && "HttpOnly", "sameSite" in c && c.sameSite && `SameSite=${c.sameSite}`, "partitioned" in c && c.partitioned && "Partitioned", "priority" in c && c.priority && `Priority=${c.priority}` ].filter(Boolean); const stringified = `${c.name}=${encodeURIComponent((_a = c.value) != null ? _a : "")}`; return attrs.length === 0 ? stringified : `${stringified}; ${attrs.join("; ")}`; } function parseCookie(cookie) { const map = /* @__PURE__ */ new Map(); for (const pair of cookie.split(/; */)){ if (!pair) continue; const splitAt = pair.indexOf("="); if (splitAt === -1) { map.set(pair, "true"); continue; } const [key, value] = [ pair.slice(0, splitAt), pair.slice(splitAt + 1) ]; try { map.set(key, decodeURIComponent(value != null ? value : "true")); } catch {} } return map; } function parseSetCookie(setCookie) { if (!setCookie) { return void 0; } const [[name, value], ...attributes] = parseCookie(setCookie); const { domain, expires, httponly, maxage, path, samesite, secure, partitioned, priority } = Object.fromEntries(attributes.map(([key, value2])=>[ key.toLowerCase().replace(/-/g, ""), value2 ])); const cookie = { name, value: decodeURIComponent(value), domain, ...expires && { expires: new Date(expires) }, ...httponly && { httpOnly: true }, ...typeof maxage === "string" && { maxAge: Number(maxage) }, path, ...samesite && { sameSite: parseSameSite(samesite) }, ...secure && { secure: true }, ...priority && { priority: parsePriority(priority) }, ...partitioned && { partitioned: true } }; return compact(cookie); } function compact(t) { const newT = {}; for(const key in t){ if (t[key]) { newT[key] = t[key]; } } return newT; } var SAME_SITE = [ "strict", "lax", "none" ]; function parseSameSite(string) { string = string.toLowerCase(); return SAME_SITE.includes(string) ? string : void 0; } var PRIORITY = [ "low", "medium", "high" ]; function parsePriority(string) { string = string.toLowerCase(); return PRIORITY.includes(string) ? string : void 0; } function splitCookiesString(cookiesString) { if (!cookiesString) return []; var cookiesStrings = []; var pos = 0; var start; var ch; var lastComma; var nextStart; var cookiesSeparatorFound; function skipWhitespace() { while(pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))){ pos += 1; } return pos < cookiesString.length; } function notSpecialChar() { ch = cookiesString.charAt(pos); return ch !== "=" && ch !== ";" && ch !== ","; } while(pos < cookiesString.length){ start = pos; cookiesSeparatorFound = false; while(skipWhitespace()){ ch = cookiesString.charAt(pos); if (ch === ",") { lastComma = pos; pos += 1; skipWhitespace(); nextStart = pos; while(pos < cookiesString.length && notSpecialChar()){ pos += 1; } if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") { cookiesSeparatorFound = true; pos = nextStart; cookiesStrings.push(cookiesString.substring(start, lastComma)); start = pos; } else { pos = lastComma + 1; } } else { pos += 1; } } if (!cookiesSeparatorFound || pos >= cookiesString.length) { cookiesStrings.push(cookiesString.substring(start, cookiesString.length)); } } return cookiesStrings; } // src/request-cookies.ts var RequestCookies = class { constructor(requestHeaders){ /** @internal */ this._parsed = /* @__PURE__ */ new Map(); this._headers = requestHeaders; const header = requestHeaders.get("cookie"); if (header) { const parsed = parseCookie(header); for (const [name, value] of parsed){ this._parsed.set(name, { name, value }); } } } [Symbol.iterator]() { return this._parsed[Symbol.iterator](); } /** * The amount of cookies received from the client */ get size() { return this._parsed.size; } get(...args) { const name = typeof args[0] === "string" ? args[0] : args[0].name; return this._parsed.get(name); } getAll(...args) { var _a; const all = Array.from(this._parsed); if (!args.length) { return all.map(([_, value])=>value); } const name = typeof args[0] === "string" ? args[0] : (_a = args[0]) == null ? void 0 : _a.name; return all.filter(([n])=>n === name).map(([_, value])=>value); } has(name) { return this._parsed.has(name); } set(...args) { const [name, value] = args.length === 1 ? [ args[0].name, args[0].value ] : args; const map = this._parsed; map.set(name, { name, value }); this._headers.set("cookie", Array.from(map).map(([_, value2])=>stringifyCookie(value2)).join("; ")); return this; } /** * Delete the cookies matching the passed name or names in the request. */ delete(names) { const map = this._parsed; const result = !Array.isArray(names) ? map.delete(names) : names.map((name)=>map.delete(name)); this._headers.set("cookie", Array.from(map).map(([_, value])=>stringifyCookie(value)).join("; ")); return result; } /** * Delete all the cookies in the cookies in the request. */ clear() { this.delete(Array.from(this._parsed.keys())); return this; } /** * Format the cookies in the request as a string for logging */ [Symbol.for("edge-runtime.inspect.custom")]() { return `RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`; } toString() { return [ ...this._parsed.values() ].map((v)=>`${v.name}=${encodeURIComponent(v.value)}`).join("; "); } }; // src/response-cookies.ts var ResponseCookies = class { constructor(responseHeaders){ /** @internal */ this._parsed = /* @__PURE__ */ new Map(); var _a, _b, _c; this._headers = responseHeaders; const setCookie = (_c = (_b = (_a = responseHeaders.getSetCookie) == null ? void 0 : _a.call(responseHeaders)) != null ? _b : responseHeaders.get("set-cookie")) != null ? _c : []; const cookieStrings = Array.isArray(setCookie) ? setCookie : splitCookiesString(setCookie); for (const cookieString of cookieStrings){ const parsed = parseSetCookie(cookieString); if (parsed) this._parsed.set(parsed.name, parsed); } } /** * {@link https://wicg.github.io/cookie-store/#CookieStore-get CookieStore#get} without the Promise. */ get(...args) { const key = typeof args[0] === "string" ? args[0] : args[0].name; return this._parsed.get(key); } /** * {@link https://wicg.github.io/cookie-store/#CookieStore-getAll CookieStore#getAll} without the Promise. */ getAll(...args) { var _a; const all = Array.from(this._parsed.values()); if (!args.length) { return all; } const key = typeof args[0] === "string" ? args[0] : (_a = args[0]) == null ? void 0 : _a.name; return all.filter((c)=>c.name === key); } has(name) { return this._parsed.has(name); } /** * {@link https://wicg.github.io/cookie-store/#CookieStore-set CookieStore#set} without the Promise. */ set(...args) { const [name, value, cookie] = args.length === 1 ? [ args[0].name, args[0].value, args[0] ] : args; const map = this._parsed; map.set(name, normalizeCookie({ name, value, ...cookie })); replace(map, this._headers); return this; } /** * {@link https://wicg.github.io/cookie-store/#CookieStore-delete CookieStore#delete} without the Promise. */ delete(...args) { const [name, options] = typeof args[0] === "string" ? [ args[0] ] : [ args[0].name, args[0] ]; return this.set({ ...options, name, value: "", expires: /* @__PURE__ */ new Date(0) }); } [Symbol.for("edge-runtime.inspect.custom")]() { return `ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`; } toString() { return [ ...this._parsed.values() ].map(stringifyCookie).join("; "); } }; function replace(bag, headers) { headers.delete("set-cookie"); for (const [, value] of bag){ const serialized = stringifyCookie(value); headers.append("set-cookie", serialized); } } function normalizeCookie(cookie = { name: "", value: "" }) { if (typeof cookie.expires === "number") { cookie.expires = new Date(cookie.expires); } if (cookie.maxAge) { cookie.expires = new Date(Date.now() + cookie.maxAge * 1e3); } if (cookie.path === null || cookie.path === void 0) { cookie.path = "/"; } return cookie; } // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { RequestCookies, ResponseCookies, parseCookie, parseSetCookie, stringifyCookie }); }), "[project]/node_modules/next/dist/compiled/@opentelemetry/api/index.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { (()=>{ "use strict"; var e = { 912: (e, t, r)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.ContextAPI = void 0; const n = r(108); const a = r(221); const o = r(44); const i = "context"; const c = new n.NoopContextManager; class ContextAPI { constructor(){} static getInstance() { if (!this._instance) { this._instance = new ContextAPI; } return this._instance; } setGlobalContextManager(e) { return (0, a.registerGlobal)(i, e, o.DiagAPI.instance()); } active() { return this._getContextManager().active(); } with(e, t, r, ...n) { return this._getContextManager().with(e, t, r, ...n); } bind(e, t) { return this._getContextManager().bind(e, t); } _getContextManager() { return (0, a.getGlobal)(i) || c; } disable() { this._getContextManager().disable(); (0, a.unregisterGlobal)(i, o.DiagAPI.instance()); } } t.ContextAPI = ContextAPI; }, 44: (e, t, r)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.DiagAPI = void 0; const n = r(757); const a = r(412); const o = r(711); const i = r(221); const c = "diag"; class DiagAPI { constructor(){ function _logProxy(e) { return function(...t) { const r = (0, i.getGlobal)("diag"); if (!r) return; return r[e](...t); }; } const e = this; const setLogger = (t, r = { logLevel: o.DiagLogLevel.INFO })=>{ var n, c, s; if (t === e) { const t = new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation"); e.error((n = t.stack) !== null && n !== void 0 ? n : t.message); return false; } if (typeof r === "number") { r = { logLevel: r }; } const u = (0, i.getGlobal)("diag"); const l = (0, a.createLogLevelDiagLogger)((c = r.logLevel) !== null && c !== void 0 ? c : o.DiagLogLevel.INFO, t); if (u && !r.suppressOverrideMessage) { const e = (s = (new Error).stack) !== null && s !== void 0 ? s : ""; u.warn(`Current logger will be overwritten from ${e}`); l.warn(`Current logger will overwrite one already registered from ${e}`); } return (0, i.registerGlobal)("diag", l, e, true); }; e.setLogger = setLogger; e.disable = ()=>{ (0, i.unregisterGlobal)(c, e); }; e.createComponentLogger = (e)=>new n.DiagComponentLogger(e); e.verbose = _logProxy("verbose"); e.debug = _logProxy("debug"); e.info = _logProxy("info"); e.warn = _logProxy("warn"); e.error = _logProxy("error"); } static instance() { if (!this._instance) { this._instance = new DiagAPI; } return this._instance; } } t.DiagAPI = DiagAPI; }, 262: (e, t, r)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.MetricsAPI = void 0; const n = r(586); const a = r(221); const o = r(44); const i = "metrics"; class MetricsAPI { constructor(){} static getInstance() { if (!this._instance) { this._instance = new MetricsAPI; } return this._instance; } setGlobalMeterProvider(e) { return (0, a.registerGlobal)(i, e, o.DiagAPI.instance()); } getMeterProvider() { return (0, a.getGlobal)(i) || n.NOOP_METER_PROVIDER; } getMeter(e, t, r) { return this.getMeterProvider().getMeter(e, t, r); } disable() { (0, a.unregisterGlobal)(i, o.DiagAPI.instance()); } } t.MetricsAPI = MetricsAPI; }, 25: (e, t, r)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.PropagationAPI = void 0; const n = r(221); const a = r(19); const o = r(92); const i = r(398); const c = r(504); const s = r(44); const u = "propagation"; const l = new a.NoopTextMapPropagator; class PropagationAPI { constructor(){ this.createBaggage = c.createBaggage; this.getBaggage = i.getBaggage; this.getActiveBaggage = i.getActiveBaggage; this.setBaggage = i.setBaggage; this.deleteBaggage = i.deleteBaggage; } static getInstance() { if (!this._instance) { this._instance = new PropagationAPI; } return this._instance; } setGlobalPropagator(e) { return (0, n.registerGlobal)(u, e, s.DiagAPI.instance()); } inject(e, t, r = o.defaultTextMapSetter) { return this._getGlobalPropagator().inject(e, t, r); } extract(e, t, r = o.defaultTextMapGetter) { return this._getGlobalPropagator().extract(e, t, r); } fields() { return this._getGlobalPropagator().fields(); } disable() { (0, n.unregisterGlobal)(u, s.DiagAPI.instance()); } _getGlobalPropagator() { return (0, n.getGlobal)(u) || l; } } t.PropagationAPI = PropagationAPI; }, 397: (e, t, r)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.TraceAPI = void 0; const n = r(221); const a = r(498); const o = r(477); const i = r(793); const c = r(44); const s = "trace"; class TraceAPI { constructor(){ this._proxyTracerProvider = new a.ProxyTracerProvider; this.wrapSpanContext = o.wrapSpanContext; this.isSpanContextValid = o.isSpanContextValid; this.deleteSpan = i.deleteSpan; this.getSpan = i.getSpan; this.getActiveSpan = i.getActiveSpan; this.getSpanContext = i.getSpanContext; this.setSpan = i.setSpan; this.setSpanContext = i.setSpanContext; } static getInstance() { if (!this._instance) { this._instance = new TraceAPI; } return this._instance; } setGlobalTracerProvider(e) { const t = (0, n.registerGlobal)(s, this._proxyTracerProvider, c.DiagAPI.instance()); if (t) { this._proxyTracerProvider.setDelegate(e); } return t; } getTracerProvider() { return (0, n.getGlobal)(s) || this._proxyTracerProvider; } getTracer(e, t) { return this.getTracerProvider().getTracer(e, t); } disable() { (0, n.unregisterGlobal)(s, c.DiagAPI.instance()); this._proxyTracerProvider = new a.ProxyTracerProvider; } } t.TraceAPI = TraceAPI; }, 398: (e, t, r)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.deleteBaggage = t.setBaggage = t.getActiveBaggage = t.getBaggage = void 0; const n = r(912); const a = r(23); const o = (0, a.createContextKey)("OpenTelemetry Baggage Key"); function getBaggage(e) { return e.getValue(o) || undefined; } t.getBaggage = getBaggage; function getActiveBaggage() { return getBaggage(n.ContextAPI.getInstance().active()); } t.getActiveBaggage = getActiveBaggage; function setBaggage(e, t) { return e.setValue(o, t); } t.setBaggage = setBaggage; function deleteBaggage(e) { return e.deleteValue(o); } t.deleteBaggage = deleteBaggage; }, 152: (e, t)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.BaggageImpl = void 0; class BaggageImpl { constructor(e){ this._entries = e ? new Map(e) : new Map; } getEntry(e) { const t = this._entries.get(e); if (!t) { return undefined; } return Object.assign({}, t); } getAllEntries() { return Array.from(this._entries.entries()).map(([e, t])=>[ e, t ]); } setEntry(e, t) { const r = new BaggageImpl(this._entries); r._entries.set(e, t); return r; } removeEntry(e) { const t = new BaggageImpl(this._entries); t._entries.delete(e); return t; } removeEntries(...e) { const t = new BaggageImpl(this._entries); for (const r of e){ t._entries.delete(r); } return t; } clear() { return new BaggageImpl; } } t.BaggageImpl = BaggageImpl; }, 647: (e, t)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.baggageEntryMetadataSymbol = void 0; t.baggageEntryMetadataSymbol = Symbol("BaggageEntryMetadata"); }, 504: (e, t, r)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.baggageEntryMetadataFromString = t.createBaggage = void 0; const n = r(44); const a = r(152); const o = r(647); const i = n.DiagAPI.instance(); function createBaggage(e = {}) { return new a.BaggageImpl(new Map(Object.entries(e))); } t.createBaggage = createBaggage; function baggageEntryMetadataFromString(e) { if (typeof e !== "string") { i.error(`Cannot create baggage metadata from unknown type: ${typeof e}`); e = ""; } return { __TYPE__: o.baggageEntryMetadataSymbol, toString () { return e; } }; } t.baggageEntryMetadataFromString = baggageEntryMetadataFromString; }, 778: (e, t, r)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.context = void 0; const n = r(912); t.context = n.ContextAPI.getInstance(); }, 108: (e, t, r)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.NoopContextManager = void 0; const n = r(23); class NoopContextManager { active() { return n.ROOT_CONTEXT; } with(e, t, r, ...n) { return t.call(r, ...n); } bind(e, t) { return t; } enable() { return this; } disable() { return this; } } t.NoopContextManager = NoopContextManager; }, 23: (e, t)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.ROOT_CONTEXT = t.createContextKey = void 0; function createContextKey(e) { return Symbol.for(e); } t.createContextKey = createContextKey; class BaseContext { constructor(e){ const t = this; t._currentContext = e ? new Map(e) : new Map; t.getValue = (e)=>t._currentContext.get(e); t.setValue = (e, r)=>{ const n = new BaseContext(t._currentContext); n._currentContext.set(e, r); return n; }; t.deleteValue = (e)=>{ const r = new BaseContext(t._currentContext); r._currentContext.delete(e); return r; }; } } t.ROOT_CONTEXT = new BaseContext; }, 304: (e, t, r)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.diag = void 0; const n = r(44); t.diag = n.DiagAPI.instance(); }, 757: (e, t, r)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.DiagComponentLogger = void 0; const n = r(221); class DiagComponentLogger { constructor(e){ this._namespace = e.namespace || "DiagComponentLogger"; } debug(...e) { return logProxy("debug", this._namespace, e); } error(...e) { return logProxy("error", this._namespace, e); } info(...e) { return logProxy("info", this._namespace, e); } warn(...e) { return logProxy("warn", this._namespace, e); } verbose(...e) { return logProxy("verbose", this._namespace, e); } } t.DiagComponentLogger = DiagComponentLogger; function logProxy(e, t, r) { const a = (0, n.getGlobal)("diag"); if (!a) { return; } r.unshift(t); return a[e](...r); } }, 83: (e, t)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.DiagConsoleLogger = void 0; const r = [ { n: "error", c: "error" }, { n: "warn", c: "warn" }, { n: "info", c: "info" }, { n: "debug", c: "debug" }, { n: "verbose", c: "trace" } ]; class DiagConsoleLogger { constructor(){ function _consoleFunc(e) { return function(...t) { if (console) { let r = console[e]; if (typeof r !== "function") { r = console.log; } if (typeof r === "function") { return r.apply(console, t); } } }; } for(let e = 0; e < r.length; e++){ this[r[e].n] = _consoleFunc(r[e].c); } } } t.DiagConsoleLogger = DiagConsoleLogger; }, 412: (e, t, r)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.createLogLevelDiagLogger = void 0; const n = r(711); function createLogLevelDiagLogger(e, t) { if (e < n.DiagLogLevel.NONE) { e = n.DiagLogLevel.NONE; } else if (e > n.DiagLogLevel.ALL) { e = n.DiagLogLevel.ALL; } t = t || {}; function _filterFunc(r, n) { const a = t[r]; if (typeof a === "function" && e >= n) { return a.bind(t); } return function() {}; } return { error: _filterFunc("error", n.DiagLogLevel.ERROR), warn: _filterFunc("warn", n.DiagLogLevel.WARN), info: _filterFunc("info", n.DiagLogLevel.INFO), debug: _filterFunc("debug", n.DiagLogLevel.DEBUG), verbose: _filterFunc("verbose", n.DiagLogLevel.VERBOSE) }; } t.createLogLevelDiagLogger = createLogLevelDiagLogger; }, 711: (e, t)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.DiagLogLevel = void 0; var r; (function(e) { e[e["NONE"] = 0] = "NONE"; e[e["ERROR"] = 30] = "ERROR"; e[e["WARN"] = 50] = "WARN"; e[e["INFO"] = 60] = "INFO"; e[e["DEBUG"] = 70] = "DEBUG"; e[e["VERBOSE"] = 80] = "VERBOSE"; e[e["ALL"] = 9999] = "ALL"; })(r = t.DiagLogLevel || (t.DiagLogLevel = {})); }, 221: (e, t, r)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.unregisterGlobal = t.getGlobal = t.registerGlobal = void 0; const n = r(678); const a = r(652); const o = r(662); const i = a.VERSION.split(".")[0]; const c = Symbol.for(`opentelemetry.js.api.${i}`); const s = n._globalThis; function registerGlobal(e, t, r, n = false) { var o; const i = s[c] = (o = s[c]) !== null && o !== void 0 ? o : { version: a.VERSION }; if (!n && i[e]) { const t = new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`); r.error(t.stack || t.message); return false; } if (i.version !== a.VERSION) { const t = new Error(`@opentelemetry/api: Registration of version v${i.version} for ${e} does not match previously registered API v${a.VERSION}`); r.error(t.stack || t.message); return false; } i[e] = t; r.debug(`@opentelemetry/api: Registered a global for ${e} v${a.VERSION}.`); return true; } t.registerGlobal = registerGlobal; function getGlobal(e) { var t, r; const n = (t = s[c]) === null || t === void 0 ? void 0 : t.version; if (!n || !(0, o.isCompatible)(n)) { return; } return (r = s[c]) === null || r === void 0 ? void 0 : r[e]; } t.getGlobal = getGlobal; function unregisterGlobal(e, t) { t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${a.VERSION}.`); const r = s[c]; if (r) { delete r[e]; } } t.unregisterGlobal = unregisterGlobal; }, 662: (e, t, r)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.isCompatible = t._makeCompatibilityCheck = void 0; const n = r(652); const a = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/; function _makeCompatibilityCheck(e) { const t = new Set([ e ]); const r = new Set; const n = e.match(a); if (!n) { return ()=>false; } const o = { major: +n[1], minor: +n[2], patch: +n[3], prerelease: n[4] }; if (o.prerelease != null) { return function isExactmatch(t) { return t === e; }; } function _reject(e) { r.add(e); return false; } function _accept(e) { t.add(e); return true; } return function isCompatible(e) { if (t.has(e)) { return true; } if (r.has(e)) { return false; } const n = e.match(a); if (!n) { return _reject(e); } const i = { major: +n[1], minor: +n[2], patch: +n[3], prerelease: n[4] }; if (i.prerelease != null) { return _reject(e); } if (o.major !== i.major) { return _reject(e); } if (o.major === 0) { if (o.minor === i.minor && o.patch <= i.patch) { return _accept(e); } return _reject(e); } if (o.minor <= i.minor) { return _accept(e); } return _reject(e); }; } t._makeCompatibilityCheck = _makeCompatibilityCheck; t.isCompatible = _makeCompatibilityCheck(n.VERSION); }, 120: (e, t, r)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.metrics = void 0; const n = r(262); t.metrics = n.MetricsAPI.getInstance(); }, 532: (e, t)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.ValueType = void 0; var r; (function(e) { e[e["INT"] = 0] = "INT"; e[e["DOUBLE"] = 1] = "DOUBLE"; })(r = t.ValueType || (t.ValueType = {})); }, 440: (e, t)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.createNoopMeter = t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = t.NOOP_OBSERVABLE_GAUGE_METRIC = t.NOOP_OBSERVABLE_COUNTER_METRIC = t.NOOP_UP_DOWN_COUNTER_METRIC = t.NOOP_HISTOGRAM_METRIC = t.NOOP_COUNTER_METRIC = t.NOOP_METER = t.NoopObservableUpDownCounterMetric = t.NoopObservableGaugeMetric = t.NoopObservableCounterMetric = t.NoopObservableMetric = t.NoopHistogramMetric = t.NoopUpDownCounterMetric = t.NoopCounterMetric = t.NoopMetric = t.NoopMeter = void 0; class NoopMeter { constructor(){} createHistogram(e, r) { return t.NOOP_HISTOGRAM_METRIC; } createCounter(e, r) { return t.NOOP_COUNTER_METRIC; } createUpDownCounter(e, r) { return t.NOOP_UP_DOWN_COUNTER_METRIC; } createObservableGauge(e, r) { return t.NOOP_OBSERVABLE_GAUGE_METRIC; } createObservableCounter(e, r) { return t.NOOP_OBSERVABLE_COUNTER_METRIC; } createObservableUpDownCounter(e, r) { return t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC; } addBatchObservableCallback(e, t) {} removeBatchObservableCallback(e) {} } t.NoopMeter = NoopMeter; class NoopMetric { } t.NoopMetric = NoopMetric; class NoopCounterMetric extends NoopMetric { add(e, t) {} } t.NoopCounterMetric = NoopCounterMetric; class NoopUpDownCounterMetric extends NoopMetric { add(e, t) {} } t.NoopUpDownCounterMetric = NoopUpDownCounterMetric; class NoopHistogramMetric extends NoopMetric { record(e, t) {} } t.NoopHistogramMetric = NoopHistogramMetric; class NoopObservableMetric { addCallback(e) {} removeCallback(e) {} } t.NoopObservableMetric = NoopObservableMetric; class NoopObservableCounterMetric extends NoopObservableMetric { } t.NoopObservableCounterMetric = NoopObservableCounterMetric; class NoopObservableGaugeMetric extends NoopObservableMetric { } t.NoopObservableGaugeMetric = NoopObservableGaugeMetric; class NoopObservableUpDownCounterMetric extends NoopObservableMetric { } t.NoopObservableUpDownCounterMetric = NoopObservableUpDownCounterMetric; t.NOOP_METER = new NoopMeter; t.NOOP_COUNTER_METRIC = new NoopCounterMetric; t.NOOP_HISTOGRAM_METRIC = new NoopHistogramMetric; t.NOOP_UP_DOWN_COUNTER_METRIC = new NoopUpDownCounterMetric; t.NOOP_OBSERVABLE_COUNTER_METRIC = new NoopObservableCounterMetric; t.NOOP_OBSERVABLE_GAUGE_METRIC = new NoopObservableGaugeMetric; t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = new NoopObservableUpDownCounterMetric; function createNoopMeter() { return t.NOOP_METER; } t.createNoopMeter = createNoopMeter; }, 586: (e, t, r)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.NOOP_METER_PROVIDER = t.NoopMeterProvider = void 0; const n = r(440); class NoopMeterProvider { getMeter(e, t, r) { return n.NOOP_METER; } } t.NoopMeterProvider = NoopMeterProvider; t.NOOP_METER_PROVIDER = new NoopMeterProvider; }, 678: function(e, t, r) { var n = this && this.__createBinding || (Object.create ? function(e, t, r, n) { if (n === undefined) n = r; Object.defineProperty(e, n, { enumerable: true, get: function() { return t[r]; } }); } : function(e, t, r, n) { if (n === undefined) n = r; e[n] = t[r]; }); var a = this && this.__exportStar || function(e, t) { for(var r in e)if (r !== "default" && !Object.prototype.hasOwnProperty.call(t, r)) n(t, e, r); }; Object.defineProperty(t, "__esModule", { value: true }); a(r(59), t); }, 460: (e, t)=>{ Object.defineProperty(t, "__esModule", { value: true }); t._globalThis = void 0; t._globalThis = typeof globalThis === "object" ? globalThis : /*TURBOPACK member replacement*/ __turbopack_context__.g; }, 59: function(e, t, r) { var n = this && this.__createBinding || (Object.create ? function(e, t, r, n) { if (n === undefined) n = r; Object.defineProperty(e, n, { enumerable: true, get: function() { return t[r]; } }); } : function(e, t, r, n) { if (n === undefined) n = r; e[n] = t[r]; }); var a = this && this.__exportStar || function(e, t) { for(var r in e)if (r !== "default" && !Object.prototype.hasOwnProperty.call(t, r)) n(t, e, r); }; Object.defineProperty(t, "__esModule", { value: true }); a(r(460), t); }, 27: (e, t, r)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.propagation = void 0; const n = r(25); t.propagation = n.PropagationAPI.getInstance(); }, 19: (e, t)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.NoopTextMapPropagator = void 0; class NoopTextMapPropagator { inject(e, t) {} extract(e, t) { return e; } fields() { return []; } } t.NoopTextMapPropagator = NoopTextMapPropagator; }, 92: (e, t)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.defaultTextMapSetter = t.defaultTextMapGetter = void 0; t.defaultTextMapGetter = { get (e, t) { if (e == null) { return undefined; } return e[t]; }, keys (e) { if (e == null) { return []; } return Object.keys(e); } }; t.defaultTextMapSetter = { set (e, t, r) { if (e == null) { return; } e[t] = r; } }; }, 816: (e, t, r)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.trace = void 0; const n = r(397); t.trace = n.TraceAPI.getInstance(); }, 374: (e, t, r)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.NonRecordingSpan = void 0; const n = r(546); class NonRecordingSpan { constructor(e = n.INVALID_SPAN_CONTEXT){ this._spanContext = e; } spanContext() { return this._spanContext; } setAttribute(e, t) { return this; } setAttributes(e) { return this; } addEvent(e, t) { return this; } setStatus(e) { return this; } updateName(e) { return this; } end(e) {} isRecording() { return false; } recordException(e, t) {} } t.NonRecordingSpan = NonRecordingSpan; }, 637: (e, t, r)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.NoopTracer = void 0; const n = r(912); const a = r(793); const o = r(374); const i = r(477); const c = n.ContextAPI.getInstance(); class NoopTracer { startSpan(e, t, r = c.active()) { const n = Boolean(t === null || t === void 0 ? void 0 : t.root); if (n) { return new o.NonRecordingSpan; } const s = r && (0, a.getSpanContext)(r); if (isSpanContext(s) && (0, i.isSpanContextValid)(s)) { return new o.NonRecordingSpan(s); } else { return new o.NonRecordingSpan; } } startActiveSpan(e, t, r, n) { let o; let i; let s; if (arguments.length < 2) { return; } else if (arguments.length === 2) { s = t; } else if (arguments.length === 3) { o = t; s = r; } else { o = t; i = r; s = n; } const u = i !== null && i !== void 0 ? i : c.active(); const l = this.startSpan(e, o, u); const g = (0, a.setSpan)(u, l); return c.with(g, s, undefined, l); } } t.NoopTracer = NoopTracer; function isSpanContext(e) { return typeof e === "object" && typeof e["spanId"] === "string" && typeof e["traceId"] === "string" && typeof e["traceFlags"] === "number"; } }, 76: (e, t, r)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.NoopTracerProvider = void 0; const n = r(637); class NoopTracerProvider { getTracer(e, t, r) { return new n.NoopTracer; } } t.NoopTracerProvider = NoopTracerProvider; }, 779: (e, t, r)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.ProxyTracer = void 0; const n = r(637); const a = new n.NoopTracer; class ProxyTracer { constructor(e, t, r, n){ this._provider = e; this.name = t; this.version = r; this.options = n; } startSpan(e, t, r) { return this._getTracer().startSpan(e, t, r); } startActiveSpan(e, t, r, n) { const a = this._getTracer(); return Reflect.apply(a.startActiveSpan, a, arguments); } _getTracer() { if (this._delegate) { return this._delegate; } const e = this._provider.getDelegateTracer(this.name, this.version, this.options); if (!e) { return a; } this._delegate = e; return this._delegate; } } t.ProxyTracer = ProxyTracer; }, 498: (e, t, r)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.ProxyTracerProvider = void 0; const n = r(779); const a = r(76); const o = new a.NoopTracerProvider; class ProxyTracerProvider { getTracer(e, t, r) { var a; return (a = this.getDelegateTracer(e, t, r)) !== null && a !== void 0 ? a : new n.ProxyTracer(this, e, t, r); } getDelegate() { var e; return (e = this._delegate) !== null && e !== void 0 ? e : o; } setDelegate(e) { this._delegate = e; } getDelegateTracer(e, t, r) { var n; return (n = this._delegate) === null || n === void 0 ? void 0 : n.getTracer(e, t, r); } } t.ProxyTracerProvider = ProxyTracerProvider; }, 312: (e, t)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.SamplingDecision = void 0; var r; (function(e) { e[e["NOT_RECORD"] = 0] = "NOT_RECORD"; e[e["RECORD"] = 1] = "RECORD"; e[e["RECORD_AND_SAMPLED"] = 2] = "RECORD_AND_SAMPLED"; })(r = t.SamplingDecision || (t.SamplingDecision = {})); }, 793: (e, t, r)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.getSpanContext = t.setSpanContext = t.deleteSpan = t.setSpan = t.getActiveSpan = t.getSpan = void 0; const n = r(23); const a = r(374); const o = r(912); const i = (0, n.createContextKey)("OpenTelemetry Context Key SPAN"); function getSpan(e) { return e.getValue(i) || undefined; } t.getSpan = getSpan; function getActiveSpan() { return getSpan(o.ContextAPI.getInstance().active()); } t.getActiveSpan = getActiveSpan; function setSpan(e, t) { return e.setValue(i, t); } t.setSpan = setSpan; function deleteSpan(e) { return e.deleteValue(i); } t.deleteSpan = deleteSpan; function setSpanContext(e, t) { return setSpan(e, new a.NonRecordingSpan(t)); } t.setSpanContext = setSpanContext; function getSpanContext(e) { var t; return (t = getSpan(e)) === null || t === void 0 ? void 0 : t.spanContext(); } t.getSpanContext = getSpanContext; }, 285: (e, t, r)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.TraceStateImpl = void 0; const n = r(240); const a = 32; const o = 512; const i = ","; const c = "="; class TraceStateImpl { constructor(e){ this._internalState = new Map; if (e) this._parse(e); } set(e, t) { const r = this._clone(); if (r._internalState.has(e)) { r._internalState.delete(e); } r._internalState.set(e, t); return r; } unset(e) { const t = this._clone(); t._internalState.delete(e); return t; } get(e) { return this._internalState.get(e); } serialize() { return this._keys().reduce((e, t)=>{ e.push(t + c + this.get(t)); return e; }, []).join(i); } _parse(e) { if (e.length > o) return; this._internalState = e.split(i).reverse().reduce((e, t)=>{ const r = t.trim(); const a = r.indexOf(c); if (a !== -1) { const o = r.slice(0, a); const i = r.slice(a + 1, t.length); if ((0, n.validateKey)(o) && (0, n.validateValue)(i)) { e.set(o, i); } else {} } return e; }, new Map); if (this._internalState.size > a) { this._internalState = new Map(Array.from(this._internalState.entries()).reverse().slice(0, a)); } } _keys() { return Array.from(this._internalState.keys()).reverse(); } _clone() { const e = new TraceStateImpl; e._internalState = new Map(this._internalState); return e; } } t.TraceStateImpl = TraceStateImpl; }, 240: (e, t)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.validateValue = t.validateKey = void 0; const r = "[_0-9a-z-*/]"; const n = `[a-z]${r}{0,255}`; const a = `[a-z0-9]${r}{0,240}@[a-z]${r}{0,13}`; const o = new RegExp(`^(?:${n}|${a})$`); const i = /^[ -~]{0,255}[!-~]$/; const c = /,|=/; function validateKey(e) { return o.test(e); } t.validateKey = validateKey; function validateValue(e) { return i.test(e) && !c.test(e); } t.validateValue = validateValue; }, 87: (e, t, r)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.createTraceState = void 0; const n = r(285); function createTraceState(e) { return new n.TraceStateImpl(e); } t.createTraceState = createTraceState; }, 546: (e, t, r)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.INVALID_SPAN_CONTEXT = t.INVALID_TRACEID = t.INVALID_SPANID = void 0; const n = r(731); t.INVALID_SPANID = "0000000000000000"; t.INVALID_TRACEID = "00000000000000000000000000000000"; t.INVALID_SPAN_CONTEXT = { traceId: t.INVALID_TRACEID, spanId: t.INVALID_SPANID, traceFlags: n.TraceFlags.NONE }; }, 613: (e, t)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.SpanKind = void 0; var r; (function(e) { e[e["INTERNAL"] = 0] = "INTERNAL"; e[e["SERVER"] = 1] = "SERVER"; e[e["CLIENT"] = 2] = "CLIENT"; e[e["PRODUCER"] = 3] = "PRODUCER"; e[e["CONSUMER"] = 4] = "CONSUMER"; })(r = t.SpanKind || (t.SpanKind = {})); }, 477: (e, t, r)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.wrapSpanContext = t.isSpanContextValid = t.isValidSpanId = t.isValidTraceId = void 0; const n = r(546); const a = r(374); const o = /^([0-9a-f]{32})$/i; const i = /^[0-9a-f]{16}$/i; function isValidTraceId(e) { return o.test(e) && e !== n.INVALID_TRACEID; } t.isValidTraceId = isValidTraceId; function isValidSpanId(e) { return i.test(e) && e !== n.INVALID_SPANID; } t.isValidSpanId = isValidSpanId; function isSpanContextValid(e) { return isValidTraceId(e.traceId) && isValidSpanId(e.spanId); } t.isSpanContextValid = isSpanContextValid; function wrapSpanContext(e) { return new a.NonRecordingSpan(e); } t.wrapSpanContext = wrapSpanContext; }, 854: (e, t)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.SpanStatusCode = void 0; var r; (function(e) { e[e["UNSET"] = 0] = "UNSET"; e[e["OK"] = 1] = "OK"; e[e["ERROR"] = 2] = "ERROR"; })(r = t.SpanStatusCode || (t.SpanStatusCode = {})); }, 731: (e, t)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.TraceFlags = void 0; var r; (function(e) { e[e["NONE"] = 0] = "NONE"; e[e["SAMPLED"] = 1] = "SAMPLED"; })(r = t.TraceFlags || (t.TraceFlags = {})); }, 652: (e, t)=>{ Object.defineProperty(t, "__esModule", { value: true }); t.VERSION = void 0; t.VERSION = "1.6.0"; } }; var t = {}; function __nccwpck_require__(r) { var n = t[r]; if (n !== undefined) { return n.exports; } var a = t[r] = { exports: {} }; var o = true; try { e[r].call(a.exports, a, a.exports, __nccwpck_require__); o = false; } finally{ if (o) delete t[r]; } return a.exports; } if (typeof __nccwpck_require__ !== "undefined") __nccwpck_require__.ab = ("TURBOPACK compile-time value", "/ROOT/node_modules/next/dist/compiled/@opentelemetry/api") + "/"; var r = {}; (()=>{ var e = r; Object.defineProperty(e, "__esModule", { value: true }); e.trace = e.propagation = e.metrics = e.diag = e.context = e.INVALID_SPAN_CONTEXT = e.INVALID_TRACEID = e.INVALID_SPANID = e.isValidSpanId = e.isValidTraceId = e.isSpanContextValid = e.createTraceState = e.TraceFlags = e.SpanStatusCode = e.SpanKind = e.SamplingDecision = e.ProxyTracerProvider = e.ProxyTracer = e.defaultTextMapSetter = e.defaultTextMapGetter = e.ValueType = e.createNoopMeter = e.DiagLogLevel = e.DiagConsoleLogger = e.ROOT_CONTEXT = e.createContextKey = e.baggageEntryMetadataFromString = void 0; var t = __nccwpck_require__(504); Object.defineProperty(e, "baggageEntryMetadataFromString", { enumerable: true, get: function() { return t.baggageEntryMetadataFromString; } }); var n = __nccwpck_require__(23); Object.defineProperty(e, "createContextKey", { enumerable: true, get: function() { return n.createContextKey; } }); Object.defineProperty(e, "ROOT_CONTEXT", { enumerable: true, get: function() { return n.ROOT_CONTEXT; } }); var a = __nccwpck_require__(83); Object.defineProperty(e, "DiagConsoleLogger", { enumerable: true, get: function() { return a.DiagConsoleLogger; } }); var o = __nccwpck_require__(711); Object.defineProperty(e, "DiagLogLevel", { enumerable: true, get: function() { return o.DiagLogLevel; } }); var i = __nccwpck_require__(440); Object.defineProperty(e, "createNoopMeter", { enumerable: true, get: function() { return i.createNoopMeter; } }); var c = __nccwpck_require__(532); Object.defineProperty(e, "ValueType", { enumerable: true, get: function() { return c.ValueType; } }); var s = __nccwpck_require__(92); Object.defineProperty(e, "defaultTextMapGetter", { enumerable: true, get: function() { return s.defaultTextMapGetter; } }); Object.defineProperty(e, "defaultTextMapSetter", { enumerable: true, get: function() { return s.defaultTextMapSetter; } }); var u = __nccwpck_require__(779); Object.defineProperty(e, "ProxyTracer", { enumerable: true, get: function() { return u.ProxyTracer; } }); var l = __nccwpck_require__(498); Object.defineProperty(e, "ProxyTracerProvider", { enumerable: true, get: function() { return l.ProxyTracerProvider; } }); var g = __nccwpck_require__(312); Object.defineProperty(e, "SamplingDecision", { enumerable: true, get: function() { return g.SamplingDecision; } }); var p = __nccwpck_require__(613); Object.defineProperty(e, "SpanKind", { enumerable: true, get: function() { return p.SpanKind; } }); var d = __nccwpck_require__(854); Object.defineProperty(e, "SpanStatusCode", { enumerable: true, get: function() { return d.SpanStatusCode; } }); var _ = __nccwpck_require__(731); Object.defineProperty(e, "TraceFlags", { enumerable: true, get: function() { return _.TraceFlags; } }); var f = __nccwpck_require__(87); Object.defineProperty(e, "createTraceState", { enumerable: true, get: function() { return f.createTraceState; } }); var b = __nccwpck_require__(477); Object.defineProperty(e, "isSpanContextValid", { enumerable: true, get: function() { return b.isSpanContextValid; } }); Object.defineProperty(e, "isValidTraceId", { enumerable: true, get: function() { return b.isValidTraceId; } }); Object.defineProperty(e, "isValidSpanId", { enumerable: true, get: function() { return b.isValidSpanId; } }); var v = __nccwpck_require__(546); Object.defineProperty(e, "INVALID_SPANID", { enumerable: true, get: function() { return v.INVALID_SPANID; } }); Object.defineProperty(e, "INVALID_TRACEID", { enumerable: true, get: function() { return v.INVALID_TRACEID; } }); Object.defineProperty(e, "INVALID_SPAN_CONTEXT", { enumerable: true, get: function() { return v.INVALID_SPAN_CONTEXT; } }); const O = __nccwpck_require__(778); Object.defineProperty(e, "context", { enumerable: true, get: function() { return O.context; } }); const P = __nccwpck_require__(304); Object.defineProperty(e, "diag", { enumerable: true, get: function() { return P.diag; } }); const N = __nccwpck_require__(120); Object.defineProperty(e, "metrics", { enumerable: true, get: function() { return N.metrics; } }); const S = __nccwpck_require__(27); Object.defineProperty(e, "propagation", { enumerable: true, get: function() { return S.propagation; } }); const C = __nccwpck_require__(816); Object.defineProperty(e, "trace", { enumerable: true, get: function() { return C.trace; } }); e["default"] = { context: O.context, diag: P.diag, metrics: N.metrics, propagation: S.propagation, trace: C.trace }; })(); module.exports = r; })(); }), "[project]/node_modules/next/dist/compiled/cookie/index.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { (()=>{ "use strict"; if (typeof __nccwpck_require__ !== "undefined") __nccwpck_require__.ab = ("TURBOPACK compile-time value", "/ROOT/node_modules/next/dist/compiled/cookie") + "/"; var e = {}; (()=>{ var r = e; /*! * cookie * Copyright(c) 2012-2014 Roman Shtylman * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ r.parse = parse; r.serialize = serialize; var i = decodeURIComponent; var t = encodeURIComponent; var a = /; */; var n = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/; function parse(e, r) { if (typeof e !== "string") { throw new TypeError("argument str must be a string"); } var t = {}; var n = r || {}; var o = e.split(a); var s = n.decode || i; for(var p = 0; p < o.length; p++){ var f = o[p]; var u = f.indexOf("="); if (u < 0) { continue; } var v = f.substr(0, u).trim(); var c = f.substr(++u, f.length).trim(); if ('"' == c[0]) { c = c.slice(1, -1); } if (undefined == t[v]) { t[v] = tryDecode(c, s); } } return t; } function serialize(e, r, i) { var a = i || {}; var o = a.encode || t; if (typeof o !== "function") { throw new TypeError("option encode is invalid"); } if (!n.test(e)) { throw new TypeError("argument name is invalid"); } var s = o(r); if (s && !n.test(s)) { throw new TypeError("argument val is invalid"); } var p = e + "=" + s; if (null != a.maxAge) { var f = a.maxAge - 0; if (isNaN(f) || !isFinite(f)) { throw new TypeError("option maxAge is invalid"); } p += "; Max-Age=" + Math.floor(f); } if (a.domain) { if (!n.test(a.domain)) { throw new TypeError("option domain is invalid"); } p += "; Domain=" + a.domain; } if (a.path) { if (!n.test(a.path)) { throw new TypeError("option path is invalid"); } p += "; Path=" + a.path; } if (a.expires) { if (typeof a.expires.toUTCString !== "function") { throw new TypeError("option expires is invalid"); } p += "; Expires=" + a.expires.toUTCString(); } if (a.httpOnly) { p += "; HttpOnly"; } if (a.secure) { p += "; Secure"; } if (a.sameSite) { var u = typeof a.sameSite === "string" ? a.sameSite.toLowerCase() : a.sameSite; switch(u){ case true: p += "; SameSite=Strict"; break; case "lax": p += "; SameSite=Lax"; break; case "strict": p += "; SameSite=Strict"; break; case "none": p += "; SameSite=None"; break; default: throw new TypeError("option sameSite is invalid"); } } return p; } function tryDecode(e, r) { try { return r(e); } catch (r) { return e; } } })(); module.exports = e; })(); }), "[project]/node_modules/next/dist/esm/build/output/log.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "bootstrap", ()=>bootstrap, "error", ()=>error, "errorOnce", ()=>errorOnce, "event", ()=>event, "info", ()=>info, "prefixes", ()=>prefixes, "ready", ()=>ready, "trace", ()=>trace, "wait", ()=>wait, "warn", ()=>warn, "warnOnce", ()=>warnOnce ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$picocolors$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/lib/picocolors.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$lru$2d$cache$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/lib/lru-cache.js [app-route] (ecmascript)"); ; ; const prefixes = { wait: (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$picocolors$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["white"])((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$picocolors$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["bold"])('○')), error: (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$picocolors$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["red"])((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$picocolors$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["bold"])('⨯')), warn: (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$picocolors$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["yellow"])((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$picocolors$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["bold"])('⚠')), ready: '▲', info: (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$picocolors$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["white"])((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$picocolors$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["bold"])(' ')), event: (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$picocolors$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["green"])((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$picocolors$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["bold"])('✓')), trace: (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$picocolors$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["magenta"])((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$picocolors$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["bold"])('»')) }; const LOGGING_METHOD = { log: 'log', warn: 'warn', error: 'error' }; function prefixedLog(prefixType, ...message) { if ((message[0] === '' || message[0] === undefined) && message.length === 1) { message.shift(); } const consoleMethod = prefixType in LOGGING_METHOD ? LOGGING_METHOD[prefixType] : 'log'; const prefix = prefixes[prefixType]; // If there's no message, don't print the prefix but a new line if (message.length === 0) { console[consoleMethod](''); } else { // Ensure if there's ANSI escape codes it's concatenated into one string. // Chrome DevTool can only handle color if it's in one string. if (message.length === 1 && typeof message[0] === 'string') { console[consoleMethod](prefix + ' ' + message[0]); } else { console[consoleMethod](prefix, ...message); } } } function bootstrap(message) { console.log(message); } function wait(...message) { prefixedLog('wait', ...message); } function error(...message) { prefixedLog('error', ...message); } function warn(...message) { prefixedLog('warn', ...message); } function ready(...message) { prefixedLog('ready', ...message); } function info(...message) { prefixedLog('info', ...message); } function event(...message) { prefixedLog('event', ...message); } function trace(...message) { prefixedLog('trace', ...message); } const warnOnceCache = new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$lru$2d$cache$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["LRUCache"](10000, (value)=>value.length); function warnOnce(...message) { const key = message.join(' '); if (!warnOnceCache.has(key)) { warnOnceCache.set(key, key); warn(...message); } } const errorOnceCache = new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$lru$2d$cache$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["LRUCache"](10000, (value)=>value.length); function errorOnce(...message) { const key = message.join(' '); if (!errorOnceCache.has(key)) { errorOnceCache.set(key, key); error(...message); } } }), "[project]/node_modules/next/dist/esm/build/templates/app-route.js { INNER_APP_ROUTE => \"[project]/app/api/auth/login/route.js [app-route] (ecmascript)\" } [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "handler", ()=>handler, "patchFetch", ()=>patchFetch, "routeModule", ()=>routeModule, "serverHooks", ()=>serverHooks, "workAsyncStorage", ()=>workAsyncStorage, "workUnitAsyncStorage", ()=>workUnitAsyncStorage ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$route$2d$modules$2f$app$2d$route$2f$module$2e$compiled$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/route-modules/app-route/module.compiled.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$route$2d$kind$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/route-kind.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$patch$2d$fetch$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/lib/patch-fetch.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$request$2d$meta$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/request-meta.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$tracer$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/lib/trace/tracer.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$manifests$2d$singleton$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/app-render/manifests-singleton.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$app$2d$paths$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/router/utils/app-paths.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$base$2d$http$2f$node$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/base-http/node.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$spec$2d$extension$2f$adapters$2f$next$2d$request$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/web/spec-extension/adapters/next-request.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/lib/trace/constants.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$instrumentation$2f$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/instrumentation/utils.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$send$2d$response$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/send-response.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/web/utils.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$cache$2d$control$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/lib/cache-control.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/lib/constants.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$externals$5d2f$next$2f$dist$2f$shared$2f$lib$2f$no$2d$fallback$2d$error$2e$external$2e$js__$5b$external$5d$__$28$next$2f$dist$2f$shared$2f$lib$2f$no$2d$fallback$2d$error$2e$external$2e$js$2c$__cjs$29$__ = __turbopack_context__.i("[externals]/next/dist/shared/lib/no-fallback-error.external.js [external] (next/dist/shared/lib/no-fallback-error.external.js, cjs)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$response$2d$cache$2f$index$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/response-cache/index.js [app-route] (ecmascript) "); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$response$2d$cache$2f$types$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/response-cache/types.js [app-route] (ecmascript)"); ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; // We inject the nextConfigOutput here so that we can use them in the route // module. const nextConfigOutput = ""; const routeModule = new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$route$2d$modules$2f$app$2d$route$2f$module$2e$compiled$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["AppRouteRouteModule"]({ definition: { kind: __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$route$2d$kind$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["RouteKind"].APP_ROUTE, page: "/api/auth/login/route", pathname: "/api/auth/login", filename: "route", bundlePath: "" }, distDir: ("TURBOPACK compile-time value", ".next/dev") || '', relativeProjectDir: ("TURBOPACK compile-time value", "") || '', resolvedPagePath: "[project]/app/api/auth/login/route.js", nextConfigOutput, // The lazy require factory ensures that: // - In dev: devRequestTimingInternalsEnd is set before userland executes, // correctly attributing module load time to application-code rather than // framework internals. // - In all modes: async modules (route files with top-level await) are // handled correctly — require() returns a Promise for such modules, which // ensureUserland() awaits before the first request is handled. userland: ()=>__turbopack_context__.r("[project]/app/api/auth/login/route.js [app-route] (ecmascript)"), // In Turbopack dev mode, also provide a synchronous per-request getter so // server HMR updates are picked up without re-executing the entry chunk. // Using require() (synchronous) avoids adding async overhead that would be // incorrectly attributed to application-code time in devRequestTiming. ...("TURBOPACK compile-time truthy", 1) ? { getUserland: ()=>__turbopack_context__.r("[project]/app/api/auth/login/route.js [app-route] (ecmascript)") } : "TURBOPACK unreachable" }); // Pull out the exports that we need to expose from the module. This should // be eliminated when we've moved the other routes to the new format. These // are used to hook into the route. const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule; function patchFetch() { return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$patch$2d$fetch$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["patchFetch"])({ workAsyncStorage, workUnitAsyncStorage }); } ; async function handler(req, res, ctx) { if (ctx.requestMeta) { (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$request$2d$meta$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["setRequestMeta"])(req, ctx.requestMeta); } if (routeModule.isDev) { (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$request$2d$meta$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["addRequestMeta"])(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint()); } let srcPage = "/api/auth/login/route"; // turbopack doesn't normalize `/index` in the page name // so we need to to process dynamic routes properly // TODO: fix turbopack providing differing value from webpack if ("TURBOPACK compile-time truthy", 1) { srcPage = srcPage.replace(/\/index$/, '') || '/'; } else if (srcPage === '/index') { // we always normalize /index specifically srcPage = '/'; } const multiZoneDraftMode = ("TURBOPACK compile-time value", false); const prepareResult = await routeModule.prepare(req, res, { srcPage, multiZoneDraftMode }); if (!prepareResult) { res.statusCode = 400; res.end('Bad Request'); ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve()); return null; } const { buildId, deploymentId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult; const normalizedSrcPage = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$app$2d$paths$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["normalizeAppPath"])(srcPage); let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]); const render404 = async ()=>{ // TODO: should route-module itself handle rendering the 404 if (routerServerContext == null ? void 0 : routerServerContext.render404) { await routerServerContext.render404(req, res, parsedUrl, false); } else { res.end('This page could not be found'); } return null; }; if (isIsr && !isDraftMode) { const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]); const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage]; if (prerenderInfo) { if (prerenderInfo.fallback === false && !isPrerendered) { if (nextConfig.adapterPath) { return await render404(); } throw new __TURBOPACK__imported__module__$5b$externals$5d2f$next$2f$dist$2f$shared$2f$lib$2f$no$2d$fallback$2d$error$2e$external$2e$js__$5b$external$5d$__$28$next$2f$dist$2f$shared$2f$lib$2f$no$2d$fallback$2d$error$2e$external$2e$js$2c$__cjs$29$__["NoFallbackError"](); } } } let cacheKey = null; if (isIsr && !routeModule.isDev && !isDraftMode) { cacheKey = resolvedPathname; // ensure /index and / is normalized to one key cacheKey = cacheKey === '/index' ? '/' : cacheKey; } const supportsDynamicResponse = routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports // dynamic HTML. !isIsr; // This is a revalidation request if the request is for a static // page and it is not being resumed from a postponed render and // it is not a dynamic RSC request then it is a revalidation // request. const isStaticGeneration = isIsr && !supportsDynamicResponse; // Before rendering (which initializes component tree modules), we have to // set the reference manifests to our global store so Server Action's // encryption util can access to them at the top level of the page module. if (serverActionsManifest && clientReferenceManifest) { (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$manifests$2d$singleton$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["setManifestsSingleton"])({ page: srcPage, clientReferenceManifest, serverActionsManifest }); } const method = req.method || 'GET'; const tracer = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$tracer$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["getTracer"])(); const activeSpan = tracer.getActiveScopeSpan(); const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer); const isMinimalMode = Boolean((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$request$2d$meta$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["getRequestMeta"])(req, 'minimalMode')); const incrementalCache = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$request$2d$meta$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["getRequestMeta"])(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, prerenderManifest, isMinimalMode); incrementalCache == null ? void 0 : incrementalCache.resetRequestCache(); globalThis.__incrementalCache = incrementalCache; const context = { params, previewProps: prerenderManifest.preview, renderOpts: { experimental: { authInterrupts: Boolean(nextConfig.experimental.authInterrupts), useCacheTimeout: nextConfig.experimental.useCacheTimeout }, cacheComponents: Boolean(nextConfig.cacheComponents), validationLevel: nextConfig.experimental.instantInsights.validationLevel, supportsDynamicResponse, incrementalCache, hmrRefreshHash: (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$request$2d$meta$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["getRequestMeta"])(req, 'hmrRefreshHash'), cacheLifeProfiles: nextConfig.cacheLife, staticPageGenerationTimeout: nextConfig.staticPageGenerationTimeout, waitUntil: ctx.waitUntil, onClose: (cb)=>{ res.on('close', cb); }, onAfterTaskError: undefined, onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext) }, sharedContext: { buildId, deploymentId } }; const nodeNextReq = new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$base$2d$http$2f$node$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["NodeNextRequest"](req); const nodeNextRes = new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$base$2d$http$2f$node$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["NodeNextResponse"](res); const nextReq = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$spec$2d$extension$2f$adapters$2f$next$2d$request$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["NextRequestAdapter"].fromNodeNextRequest(nodeNextReq, (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$spec$2d$extension$2f$adapters$2f$next$2d$request$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["signalFromNodeResponse"])(res)); const responseGenerator = async ({ previousCacheEntry })=>{ try { if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) { res.statusCode = 404; // on-demand revalidate always sets this header res.setHeader('x-nextjs-cache', 'REVALIDATED'); res.end('This page could not be found'); return null; } const response = await routeModule.handle(nextReq, context); req.fetchMetrics = context.renderOpts.fetchMetrics; let pendingWaitUntil = context.renderOpts.pendingWaitUntil; // Attempt using provided waitUntil if available // if it's not we fallback to sendResponse's handling if (pendingWaitUntil) { if (ctx.waitUntil) { ctx.waitUntil(pendingWaitUntil); pendingWaitUntil = undefined; } } const cacheTags = context.renderOpts.collectedTags; // If the request is for a static response, we can cache it so long // as it's not edge. if (isIsr) { const blob = await response.blob(); // Copy the headers from the response. const headers = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["toNodeOutgoingHttpHeaders"])(response.headers); if (cacheTags) { headers[__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["NEXT_CACHE_TAGS_HEADER"]] = cacheTags; } if (!headers['content-type'] && blob.type) { headers['content-type'] = blob.type; } const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["INFINITE_CACHE"] ? false : context.renderOpts.collectedRevalidate; const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["INFINITE_CACHE"] ? // explicit `expire` (e.g. via `cacheLife`). This mirrors the // build-time fallback in `build/index.ts` so cache entries // and the response Cache-Control header agree on the route's // effective expire. Routes that opt out of revalidation // (`revalidate: false`) or that are dynamic (`revalidate: 0`) // keep `expire: undefined`. revalidate !== false && revalidate > 0 ? nextConfig.expireTime : undefined : context.renderOpts.collectedExpire; // Create the cache entry for the response. const cacheEntry = { value: { kind: __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$response$2d$cache$2f$types$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["CachedRouteKind"].APP_ROUTE, status: response.status, body: Buffer.from(await blob.arrayBuffer()), headers }, cacheControl: { revalidate, expire } }; return cacheEntry; } else { // send response without caching if not ISR await (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$send$2d$response$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["sendResponse"])(nodeNextReq, nodeNextRes, response, pendingWaitUntil); return null; } } catch (err) { // if this is a background revalidate we need to report // the request error here as it won't be bubbled if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) { const silenceLog = false; await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: srcPage, routeType: 'route', revalidateReason: (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$instrumentation$2f$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["getRevalidateReason"])({ isStaticGeneration, isOnDemandRevalidate }) }, silenceLog, routerServerContext); } throw err; } }; const handleResponse = async (currentSpan, parentSpan)=>{ try { var _cacheEntry_value; const cacheEntry = await routeModule.handleResponse({ req, nextConfig, cacheKey, routeKind: __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$route$2d$kind$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["RouteKind"].APP_ROUTE, isFallback: false, prerenderManifest, isRoutePPREnabled: false, isOnDemandRevalidate, revalidateOnlyGenerated, responseGenerator, waitUntil: ctx.waitUntil, isMinimalMode }); // we don't create a cacheEntry for ISR if (!isIsr) { return; } if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$response$2d$cache$2f$types$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["CachedRouteKind"].APP_ROUTE) { var _cacheEntry_value1; throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", { value: "E701", enumerable: false, configurable: true }); } if (!isMinimalMode) { res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT'); } // Draft mode should never be cached if (isDraftMode) { res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate'); } const headers = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["fromNodeOutgoingHttpHeaders"])(cacheEntry.value.headers); if (!(isMinimalMode && isIsr)) { headers.delete(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["NEXT_CACHE_TAGS_HEADER"]); } // If cache control is already set on the response we don't // override it to allow users to customize it via next.config if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) { headers.set('Cache-Control', (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$cache$2d$control$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["getCacheControlHeader"])(cacheEntry.cacheControl)); } await (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$send$2d$response$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["sendResponse"])(nodeNextReq, nodeNextRes, new Response(cacheEntry.value.body, { headers, status: cacheEntry.value.status || 200 })); return; } catch (err) { if (!(err instanceof __TURBOPACK__imported__module__$5b$externals$5d2f$next$2f$dist$2f$shared$2f$lib$2f$no$2d$fallback$2d$error$2e$external$2e$js__$5b$external$5d$__$28$next$2f$dist$2f$shared$2f$lib$2f$no$2d$fallback$2d$error$2e$external$2e$js$2c$__cjs$29$__["NoFallbackError"])) { const silenceLog = false; await routeModule.onRequestError(req, err, { routerKind: 'App Router', routePath: normalizedSrcPage, routeType: 'route', revalidateReason: (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$instrumentation$2f$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["getRevalidateReason"])({ isStaticGeneration, isOnDemandRevalidate }) }, silenceLog, routerServerContext); } // rethrow so that we can handle serving error page // If this is during static generation, throw the error again. if (isIsr) throw err; // Otherwise, send a 500 response. await (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$send$2d$response$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["sendResponse"])(nodeNextReq, nodeNextRes, new Response(null, { status: 500 })); return; } finally{ ; (()=>{ if (!currentSpan) { return; } let statusCode = res.statusCode; currentSpan.setAttributes({ 'http.status_code': statusCode, 'next.rsc': false }); if (statusCode && statusCode >= 500) { // For 5xx status codes: SHOULD be set to 'Error' span status. // x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status currentSpan.setStatus({ code: __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$tracer$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["SpanStatusCode"].ERROR }); // For span status 'Error', SHOULD set 'error.type' attribute. currentSpan.setAttribute('error.type', statusCode.toString()); } const rootSpanAttributes = tracer.getRootSpanAttributes(); // We were unable to get attributes, probably OTEL is not enabled if (!rootSpanAttributes) { return; } if (rootSpanAttributes.get('next.span_type') !== __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["BaseServerSpan"].handleRequest) { console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`); return; } const route = rootSpanAttributes.get('next.route') || normalizedSrcPage; const name = `${method} ${route}`; currentSpan.setAttributes({ 'next.route': route, 'http.route': route, 'next.span_name': name }); currentSpan.updateName(name); // Propagate http.route to the parent span if one exists (e.g. // a platform-created HTTP span in adapter deployments). if (parentSpan && parentSpan !== currentSpan) { parentSpan.setAttribute('http.route', route); parentSpan.updateName(name); } })(); } }; // TODO: activeSpan code path is for when wrapped by // next-server can be removed when this is no longer used if (isWrappedByNextServer && activeSpan) { await handleResponse(activeSpan, undefined); } else { let parentSpan = tracer.getActiveScopeSpan(); await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["BaseServerSpan"].handleRequest, { spanName: `${method} ${srcPage}`, kind: __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$tracer$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["SpanKind"].SERVER, attributes: { 'http.method': method, 'http.target': req.url } }, (span)=>handleResponse(span, parentSpan)), undefined, !isWrappedByNextServer); } } }), "[project]/node_modules/next/dist/esm/client/components/app-router-headers.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "ACTION_HEADER", ()=>ACTION_HEADER, "FLIGHT_HEADERS", ()=>FLIGHT_HEADERS, "NEXT_ACTION_NOT_FOUND_HEADER", ()=>NEXT_ACTION_NOT_FOUND_HEADER, "NEXT_ACTION_REVALIDATED_HEADER", ()=>NEXT_ACTION_REVALIDATED_HEADER, "NEXT_DID_POSTPONE_HEADER", ()=>NEXT_DID_POSTPONE_HEADER, "NEXT_HMR_REFRESH_HEADER", ()=>NEXT_HMR_REFRESH_HEADER, "NEXT_HTML_REQUEST_ID_HEADER", ()=>NEXT_HTML_REQUEST_ID_HEADER, "NEXT_INSTANT_TEST_COOKIE", ()=>NEXT_INSTANT_TEST_COOKIE, "NEXT_IS_PRERENDER_HEADER", ()=>NEXT_IS_PRERENDER_HEADER, "NEXT_REQUEST_ID_HEADER", ()=>NEXT_REQUEST_ID_HEADER, "NEXT_REWRITTEN_PATH_HEADER", ()=>NEXT_REWRITTEN_PATH_HEADER, "NEXT_REWRITTEN_QUERY_HEADER", ()=>NEXT_REWRITTEN_QUERY_HEADER, "NEXT_ROUTER_PREFETCH_HEADER", ()=>NEXT_ROUTER_PREFETCH_HEADER, "NEXT_ROUTER_SEGMENT_PREFETCH_HEADER", ()=>NEXT_ROUTER_SEGMENT_PREFETCH_HEADER, "NEXT_ROUTER_STALE_TIME_HEADER", ()=>NEXT_ROUTER_STALE_TIME_HEADER, "NEXT_ROUTER_STATE_TREE_HEADER", ()=>NEXT_ROUTER_STATE_TREE_HEADER, "NEXT_RSC_UNION_QUERY", ()=>NEXT_RSC_UNION_QUERY, "NEXT_URL", ()=>NEXT_URL, "RSC_CONTENT_TYPE_HEADER", ()=>RSC_CONTENT_TYPE_HEADER, "RSC_HEADER", ()=>RSC_HEADER ]); const RSC_HEADER = 'rsc'; const ACTION_HEADER = 'next-action'; const NEXT_ROUTER_STATE_TREE_HEADER = 'next-router-state-tree'; const NEXT_ROUTER_PREFETCH_HEADER = 'next-router-prefetch'; const NEXT_ROUTER_SEGMENT_PREFETCH_HEADER = 'next-router-segment-prefetch'; const NEXT_HMR_REFRESH_HEADER = 'next-hmr-refresh'; const NEXT_URL = 'next-url'; const RSC_CONTENT_TYPE_HEADER = 'text/x-component'; const NEXT_INSTANT_TEST_COOKIE = 'next-instant-navigation-testing'; const FLIGHT_HEADERS = [ RSC_HEADER, NEXT_ROUTER_STATE_TREE_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_HMR_REFRESH_HEADER, NEXT_ROUTER_SEGMENT_PREFETCH_HEADER ]; const NEXT_RSC_UNION_QUERY = '_rsc'; const NEXT_ROUTER_STALE_TIME_HEADER = 'x-nextjs-stale-time'; const NEXT_DID_POSTPONE_HEADER = 'x-nextjs-postponed'; const NEXT_REWRITTEN_PATH_HEADER = 'x-nextjs-rewritten-path'; const NEXT_REWRITTEN_QUERY_HEADER = 'x-nextjs-rewritten-query'; const NEXT_IS_PRERENDER_HEADER = 'x-nextjs-prerender'; const NEXT_ACTION_NOT_FOUND_HEADER = 'x-nextjs-action-not-found'; const NEXT_REQUEST_ID_HEADER = 'x-nextjs-request-id'; const NEXT_HTML_REQUEST_ID_HEADER = 'x-nextjs-html-request-id'; const NEXT_ACTION_REVALIDATED_HEADER = 'x-action-revalidated'; }), "[project]/node_modules/next/dist/esm/client/components/hooks-server-context.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "DynamicServerError", ()=>DynamicServerError, "isDynamicServerError", ()=>isDynamicServerError ]); const DYNAMIC_ERROR_CODE = 'DYNAMIC_SERVER_USAGE'; class DynamicServerError extends Error { constructor(description){ super(`Dynamic server usage: ${description}`), this.description = description, this.digest = DYNAMIC_ERROR_CODE; } } function isDynamicServerError(err) { if (typeof err !== 'object' || err === null || !('digest' in err) || typeof err.digest !== 'string') { return false; } return err.digest === DYNAMIC_ERROR_CODE; } }), "[project]/node_modules/next/dist/esm/client/components/redirect-status-code.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "RedirectStatusCode", ()=>RedirectStatusCode ]); var RedirectStatusCode = /*#__PURE__*/ function(RedirectStatusCode) { RedirectStatusCode[RedirectStatusCode["SeeOther"] = 303] = "SeeOther"; RedirectStatusCode[RedirectStatusCode["TemporaryRedirect"] = 307] = "TemporaryRedirect"; RedirectStatusCode[RedirectStatusCode["PermanentRedirect"] = 308] = "PermanentRedirect"; return RedirectStatusCode; }({}); }), "[project]/node_modules/next/dist/esm/client/components/static-generation-bailout.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "StaticGenBailoutError", ()=>StaticGenBailoutError, "isStaticGenBailoutError", ()=>isStaticGenBailoutError ]); const NEXT_STATIC_GEN_BAILOUT = 'NEXT_STATIC_GEN_BAILOUT'; class StaticGenBailoutError extends Error { constructor(...args){ super(...args), this.code = NEXT_STATIC_GEN_BAILOUT; } } function isStaticGenBailoutError(error) { if (typeof error !== 'object' || error === null || !('code' in error)) { return false; } return error.code === NEXT_STATIC_GEN_BAILOUT; } }), "[project]/node_modules/next/dist/esm/lib/batcher.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "Batcher", ()=>Batcher ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$detached$2d$promise$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/lib/detached-promise.js [app-route] (ecmascript)"); ; class Batcher { constructor(cacheKeyFn, /** * A function that will be called to schedule the wrapped function to be * executed. This defaults to a function that will execute the function * immediately. */ schedulerFn = (fn)=>fn()){ this.cacheKeyFn = cacheKeyFn; this.schedulerFn = schedulerFn; this.pending = new Map(); } static create(options) { return new Batcher(options == null ? void 0 : options.cacheKeyFn, options == null ? void 0 : options.schedulerFn); } /** * Wraps a function in a promise that will be resolved or rejected only once * for a given key. This will allow multiple calls to the function to be * made, but only one will be executed at a time. The result of the first * call will be returned to all callers. * * @param key the key to use for the cache * @param fn the function to wrap * @returns a promise that resolves to the result of the function */ async batch(key, fn) { const cacheKey = this.cacheKeyFn ? await this.cacheKeyFn(key) : key; if (cacheKey === null) { return fn({ resolve: (value)=>Promise.resolve(value), key }); } const pending = this.pending.get(cacheKey); if (pending) return pending; const { promise, resolve, reject } = new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$detached$2d$promise$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["DetachedPromise"](); this.pending.set(cacheKey, promise); this.schedulerFn(async ()=>{ try { const result = await fn({ resolve, key }); // Resolving a promise multiple times is a no-op, so we can safely // resolve all pending promises with the same result. resolve(result); } catch (err) { reject(err); } finally{ this.pending.delete(cacheKey); } }); return promise; } } }), "[project]/node_modules/next/dist/esm/lib/constants.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "ACTION_SUFFIX", ()=>ACTION_SUFFIX, "APP_DIR_ALIAS", ()=>APP_DIR_ALIAS, "CACHE_ONE_YEAR_SECONDS", ()=>CACHE_ONE_YEAR_SECONDS, "DOT_NEXT_ALIAS", ()=>DOT_NEXT_ALIAS, "ESLINT_DEFAULT_DIRS", ()=>ESLINT_DEFAULT_DIRS, "GSP_NO_RETURNED_VALUE", ()=>GSP_NO_RETURNED_VALUE, "GSSP_COMPONENT_MEMBER_ERROR", ()=>GSSP_COMPONENT_MEMBER_ERROR, "GSSP_NO_RETURNED_VALUE", ()=>GSSP_NO_RETURNED_VALUE, "HTML_CONTENT_TYPE_HEADER", ()=>HTML_CONTENT_TYPE_HEADER, "INFINITE_CACHE", ()=>INFINITE_CACHE, "INSTRUMENTATION_HOOK_FILENAME", ()=>INSTRUMENTATION_HOOK_FILENAME, "JSON_CONTENT_TYPE_HEADER", ()=>JSON_CONTENT_TYPE_HEADER, "MATCHED_PATH_HEADER", ()=>MATCHED_PATH_HEADER, "MIDDLEWARE_FILENAME", ()=>MIDDLEWARE_FILENAME, "MIDDLEWARE_LOCATION_REGEXP", ()=>MIDDLEWARE_LOCATION_REGEXP, "NEXT_BODY_SUFFIX", ()=>NEXT_BODY_SUFFIX, "NEXT_CACHE_IMPLICIT_TAG_ID", ()=>NEXT_CACHE_IMPLICIT_TAG_ID, "NEXT_CACHE_REVALIDATED_TAGS_HEADER", ()=>NEXT_CACHE_REVALIDATED_TAGS_HEADER, "NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER", ()=>NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER, "NEXT_CACHE_ROOT_PARAM_TAG_ID", ()=>NEXT_CACHE_ROOT_PARAM_TAG_ID, "NEXT_CACHE_SOFT_TAG_MAX_LENGTH", ()=>NEXT_CACHE_SOFT_TAG_MAX_LENGTH, "NEXT_CACHE_TAGS_HEADER", ()=>NEXT_CACHE_TAGS_HEADER, "NEXT_CACHE_TAG_MAX_ITEMS", ()=>NEXT_CACHE_TAG_MAX_ITEMS, "NEXT_CACHE_TAG_MAX_LENGTH", ()=>NEXT_CACHE_TAG_MAX_LENGTH, "NEXT_DATA_SUFFIX", ()=>NEXT_DATA_SUFFIX, "NEXT_INTERCEPTION_MARKER_PREFIX", ()=>NEXT_INTERCEPTION_MARKER_PREFIX, "NEXT_META_SUFFIX", ()=>NEXT_META_SUFFIX, "NEXT_NAV_DEPLOYMENT_ID_HEADER", ()=>NEXT_NAV_DEPLOYMENT_ID_HEADER, "NEXT_QUERY_PARAM_PREFIX", ()=>NEXT_QUERY_PARAM_PREFIX, "NEXT_RESUME_HEADER", ()=>NEXT_RESUME_HEADER, "NEXT_RESUME_STATE_LENGTH_HEADER", ()=>NEXT_RESUME_STATE_LENGTH_HEADER, "NON_STANDARD_NODE_ENV", ()=>NON_STANDARD_NODE_ENV, "PAGES_DIR_ALIAS", ()=>PAGES_DIR_ALIAS, "PRERENDER_REVALIDATE_HEADER", ()=>PRERENDER_REVALIDATE_HEADER, "PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER", ()=>PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER, "PROXY_FILENAME", ()=>PROXY_FILENAME, "PROXY_LOCATION_REGEXP", ()=>PROXY_LOCATION_REGEXP, "PUBLIC_DIR_MIDDLEWARE_CONFLICT", ()=>PUBLIC_DIR_MIDDLEWARE_CONFLICT, "ROOT_DIR_ALIAS", ()=>ROOT_DIR_ALIAS, "RSC_ACTION_CLIENT_WRAPPER_ALIAS", ()=>RSC_ACTION_CLIENT_WRAPPER_ALIAS, "RSC_ACTION_ENCRYPTION_ALIAS", ()=>RSC_ACTION_ENCRYPTION_ALIAS, "RSC_ACTION_PROXY_ALIAS", ()=>RSC_ACTION_PROXY_ALIAS, "RSC_ACTION_VALIDATE_ALIAS", ()=>RSC_ACTION_VALIDATE_ALIAS, "RSC_CACHE_WRAPPER_ALIAS", ()=>RSC_CACHE_WRAPPER_ALIAS, "RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS", ()=>RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS, "RSC_MOD_REF_PROXY_ALIAS", ()=>RSC_MOD_REF_PROXY_ALIAS, "RSC_SEGMENTS_DIR_SUFFIX", ()=>RSC_SEGMENTS_DIR_SUFFIX, "RSC_SEGMENT_SUFFIX", ()=>RSC_SEGMENT_SUFFIX, "RSC_SUFFIX", ()=>RSC_SUFFIX, "SERVER_PROPS_EXPORT_ERROR", ()=>SERVER_PROPS_EXPORT_ERROR, "SERVER_PROPS_GET_INIT_PROPS_CONFLICT", ()=>SERVER_PROPS_GET_INIT_PROPS_CONFLICT, "SERVER_PROPS_SSG_CONFLICT", ()=>SERVER_PROPS_SSG_CONFLICT, "SERVER_RUNTIME", ()=>SERVER_RUNTIME, "SSG_FALLBACK_EXPORT_ERROR", ()=>SSG_FALLBACK_EXPORT_ERROR, "SSG_GET_INITIAL_PROPS_CONFLICT", ()=>SSG_GET_INITIAL_PROPS_CONFLICT, "STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR", ()=>STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR, "TEXT_PLAIN_CONTENT_TYPE_HEADER", ()=>TEXT_PLAIN_CONTENT_TYPE_HEADER, "UNSTABLE_REVALIDATE_RENAME_ERROR", ()=>UNSTABLE_REVALIDATE_RENAME_ERROR, "WEBPACK_LAYERS", ()=>WEBPACK_LAYERS, "WEBPACK_RESOURCE_QUERIES", ()=>WEBPACK_RESOURCE_QUERIES, "WEB_SOCKET_MAX_RECONNECTIONS", ()=>WEB_SOCKET_MAX_RECONNECTIONS ]); const TEXT_PLAIN_CONTENT_TYPE_HEADER = 'text/plain'; const HTML_CONTENT_TYPE_HEADER = 'text/html; charset=utf-8'; const JSON_CONTENT_TYPE_HEADER = 'application/json; charset=utf-8'; const NEXT_QUERY_PARAM_PREFIX = 'nxtP'; const NEXT_INTERCEPTION_MARKER_PREFIX = 'nxtI'; const MATCHED_PATH_HEADER = 'x-matched-path'; const PRERENDER_REVALIDATE_HEADER = 'x-prerender-revalidate'; const PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER = 'x-prerender-revalidate-if-generated'; const RSC_SEGMENTS_DIR_SUFFIX = '.segments'; const RSC_SEGMENT_SUFFIX = '.segment.rsc'; const RSC_SUFFIX = '.rsc'; const ACTION_SUFFIX = '.action'; const NEXT_DATA_SUFFIX = '.json'; const NEXT_META_SUFFIX = '.meta'; const NEXT_BODY_SUFFIX = '.body'; const NEXT_NAV_DEPLOYMENT_ID_HEADER = 'x-nextjs-deployment-id'; const NEXT_CACHE_TAGS_HEADER = 'x-next-cache-tags'; const NEXT_CACHE_REVALIDATED_TAGS_HEADER = 'x-next-revalidated-tags'; const NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER = 'x-next-revalidate-tag-token'; const NEXT_RESUME_HEADER = 'next-resume'; const NEXT_RESUME_STATE_LENGTH_HEADER = 'x-next-resume-state-length'; const NEXT_CACHE_TAG_MAX_ITEMS = 128; const NEXT_CACHE_TAG_MAX_LENGTH = 256; const NEXT_CACHE_SOFT_TAG_MAX_LENGTH = 1024; const NEXT_CACHE_IMPLICIT_TAG_ID = '_N_T_'; const NEXT_CACHE_ROOT_PARAM_TAG_ID = '_N_RP_'; const CACHE_ONE_YEAR_SECONDS = 31536000; const INFINITE_CACHE = 0xfffffffe; const MIDDLEWARE_FILENAME = 'middleware'; const MIDDLEWARE_LOCATION_REGEXP = `(?:src/)?${MIDDLEWARE_FILENAME}`; const PROXY_FILENAME = 'proxy'; const PROXY_LOCATION_REGEXP = `(?:src/)?${PROXY_FILENAME}`; const INSTRUMENTATION_HOOK_FILENAME = 'instrumentation'; const PAGES_DIR_ALIAS = 'private-next-pages'; const DOT_NEXT_ALIAS = 'private-dot-next'; const ROOT_DIR_ALIAS = 'private-next-root-dir'; const APP_DIR_ALIAS = 'private-next-app-dir'; const RSC_MOD_REF_PROXY_ALIAS = 'private-next-rsc-mod-ref-proxy'; const RSC_ACTION_VALIDATE_ALIAS = 'private-next-rsc-action-validate'; const RSC_ACTION_PROXY_ALIAS = 'private-next-rsc-server-reference'; const RSC_CACHE_WRAPPER_ALIAS = 'private-next-rsc-cache-wrapper'; const RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS = 'private-next-rsc-track-dynamic-import'; const RSC_ACTION_ENCRYPTION_ALIAS = 'private-next-rsc-action-encryption'; const RSC_ACTION_CLIENT_WRAPPER_ALIAS = 'private-next-rsc-action-client-wrapper'; const PUBLIC_DIR_MIDDLEWARE_CONFLICT = `You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict`; const SSG_GET_INITIAL_PROPS_CONFLICT = `You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps`; const SERVER_PROPS_GET_INIT_PROPS_CONFLICT = `You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.`; const SERVER_PROPS_SSG_CONFLICT = `You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps`; const STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR = `can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props`; const SERVER_PROPS_EXPORT_ERROR = `pages with \`getServerSideProps\` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export`; const GSP_NO_RETURNED_VALUE = 'Your `getStaticProps` function did not return an object. Did you forget to add a `return`?'; const GSSP_NO_RETURNED_VALUE = 'Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?'; const UNSTABLE_REVALIDATE_RENAME_ERROR = 'The `unstable_revalidate` property is available for general use.\n' + 'Please use `revalidate` instead.'; const GSSP_COMPONENT_MEMBER_ERROR = `can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member`; const NON_STANDARD_NODE_ENV = `You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env`; const SSG_FALLBACK_EXPORT_ERROR = `Pages with \`fallback\` enabled in \`getStaticPaths\` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export`; const ESLINT_DEFAULT_DIRS = [ 'app', 'pages', 'components', 'lib', 'src' ]; const SERVER_RUNTIME = { edge: 'edge', experimentalEdge: 'experimental-edge', nodejs: 'nodejs' }; const WEB_SOCKET_MAX_RECONNECTIONS = 12; /** * The names of the webpack layers. These layers are the primitives for the * webpack chunks. */ const WEBPACK_LAYERS_NAMES = { /** * The layer for the shared code between the client and server bundles. */ shared: 'shared', /** * The layer for server-only runtime and picking up `react-server` export conditions. * Including app router RSC pages and app router custom routes and metadata routes. */ reactServerComponents: 'rsc', /** * Server Side Rendering layer for app (ssr). */ serverSideRendering: 'ssr', /** * The browser client bundle layer for actions. */ actionBrowser: 'action-browser', /** * The Node.js bundle layer for the API routes. */ apiNode: 'api-node', /** * The Edge Lite bundle layer for the API routes. */ apiEdge: 'api-edge', /** * The layer for the middleware code. */ middleware: 'middleware', /** * The layer for the instrumentation hooks. */ instrument: 'instrument', /** * The layer for assets on the edge. */ edgeAsset: 'edge-asset', /** * The browser client bundle layer for App directory. */ appPagesBrowser: 'app-pages-browser', /** * The browser client bundle layer for Pages directory. */ pagesDirBrowser: 'pages-dir-browser', /** * The Edge Lite bundle layer for Pages directory. */ pagesDirEdge: 'pages-dir-edge', /** * The Node.js bundle layer for Pages directory. */ pagesDirNode: 'pages-dir-node' }; const WEBPACK_LAYERS = { ...WEBPACK_LAYERS_NAMES, GROUP: { builtinReact: [ WEBPACK_LAYERS_NAMES.reactServerComponents, WEBPACK_LAYERS_NAMES.actionBrowser ], serverOnly: [ WEBPACK_LAYERS_NAMES.reactServerComponents, WEBPACK_LAYERS_NAMES.actionBrowser, WEBPACK_LAYERS_NAMES.instrument, WEBPACK_LAYERS_NAMES.middleware ], neutralTarget: [ // pages api WEBPACK_LAYERS_NAMES.apiNode, WEBPACK_LAYERS_NAMES.apiEdge ], clientOnly: [ WEBPACK_LAYERS_NAMES.serverSideRendering, WEBPACK_LAYERS_NAMES.appPagesBrowser ], bundled: [ WEBPACK_LAYERS_NAMES.reactServerComponents, WEBPACK_LAYERS_NAMES.actionBrowser, WEBPACK_LAYERS_NAMES.serverSideRendering, WEBPACK_LAYERS_NAMES.appPagesBrowser, WEBPACK_LAYERS_NAMES.shared, WEBPACK_LAYERS_NAMES.instrument, WEBPACK_LAYERS_NAMES.middleware ], appPages: [ // app router pages and layouts WEBPACK_LAYERS_NAMES.reactServerComponents, WEBPACK_LAYERS_NAMES.serverSideRendering, WEBPACK_LAYERS_NAMES.appPagesBrowser, WEBPACK_LAYERS_NAMES.actionBrowser ] } }; const WEBPACK_RESOURCE_QUERIES = { edgeSSREntry: '__next_edge_ssr_entry__', metadata: '__next_metadata__', metadataRoute: '__next_metadata_route__', metadataImageMeta: '__next_metadata_image_meta__' }; ; }), "[project]/node_modules/next/dist/esm/lib/detached-promise.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; /** * A `Promise.withResolvers` implementation that exposes the `resolve` and * `reject` functions on a `Promise`. * * @see https://tc39.es/proposal-promise-with-resolvers/ */ __turbopack_context__.s([ "DetachedPromise", ()=>DetachedPromise ]); class DetachedPromise { constructor(){ let resolve; let reject; // Create the promise and assign the resolvers to the object. this.promise = new Promise((res, rej)=>{ resolve = res; reject = rej; }); // We know that resolvers is defined because the Promise constructor runs // synchronously. this.resolve = resolve; this.reject = reject; } } }), "[project]/node_modules/next/dist/esm/lib/framework/boundary-constants.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "METADATA_BOUNDARY_NAME", ()=>METADATA_BOUNDARY_NAME, "OUTLET_BOUNDARY_NAME", ()=>OUTLET_BOUNDARY_NAME, "ROOT_LAYOUT_BOUNDARY_NAME", ()=>ROOT_LAYOUT_BOUNDARY_NAME, "VIEWPORT_BOUNDARY_NAME", ()=>VIEWPORT_BOUNDARY_NAME ]); const METADATA_BOUNDARY_NAME = '__next_metadata_boundary__'; const VIEWPORT_BOUNDARY_NAME = '__next_viewport_boundary__'; const OUTLET_BOUNDARY_NAME = '__next_outlet_boundary__'; const ROOT_LAYOUT_BOUNDARY_NAME = '__next_root_layout_boundary__'; }), "[project]/node_modules/next/dist/esm/lib/picocolors.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "bgBlack", ()=>bgBlack, "bgBlue", ()=>bgBlue, "bgCyan", ()=>bgCyan, "bgGreen", ()=>bgGreen, "bgMagenta", ()=>bgMagenta, "bgRed", ()=>bgRed, "bgWhite", ()=>bgWhite, "bgYellow", ()=>bgYellow, "black", ()=>black, "blue", ()=>blue, "bold", ()=>bold, "cyan", ()=>cyan, "dim", ()=>dim, "gray", ()=>gray, "green", ()=>green, "hidden", ()=>hidden, "inverse", ()=>inverse, "italic", ()=>italic, "magenta", ()=>magenta, "purple", ()=>purple, "red", ()=>red, "reset", ()=>reset, "strikethrough", ()=>strikethrough, "underline", ()=>underline, "white", ()=>white, "yellow", ()=>yellow ]); // ISC License // Copyright (c) 2021 Alexey Raspopov, Kostiantyn Denysov, Anton Verinov // Permission to use, copy, modify, and/or distribute this software for any // purpose with or without fee is hereby granted, provided that the above // copyright notice and this permission notice appear in all copies. // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. // // https://github.com/alexeyraspopov/picocolors/blob/b6261487e7b81aaab2440e397a356732cad9e342/picocolors.js#L1 var _globalThis; const { env, stdout } = ((_globalThis = globalThis) == null ? void 0 : _globalThis.process) ?? {}; const enabled = env && !env.NO_COLOR && (env.FORCE_COLOR || (stdout == null ? void 0 : stdout.isTTY) && !env.CI && env.TERM !== 'dumb'); const replaceClose = (str, close, replace, index)=>{ const start = str.substring(0, index) + replace; const end = str.substring(index + close.length); const nextIndex = end.indexOf(close); return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end; }; const formatter = (open, close, replace = open)=>{ if (!enabled) return String; return (input)=>{ const string = '' + input; const index = string.indexOf(close, open.length); return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close; }; }; const reset = enabled ? (s)=>`\x1b[0m${s}\x1b[0m` : String; const bold = formatter('\x1b[1m', '\x1b[22m', '\x1b[22m\x1b[1m'); const dim = formatter('\x1b[2m', '\x1b[22m', '\x1b[22m\x1b[2m'); const italic = formatter('\x1b[3m', '\x1b[23m'); const underline = formatter('\x1b[4m', '\x1b[24m'); const inverse = formatter('\x1b[7m', '\x1b[27m'); const hidden = formatter('\x1b[8m', '\x1b[28m'); const strikethrough = formatter('\x1b[9m', '\x1b[29m'); const black = formatter('\x1b[30m', '\x1b[39m'); const red = formatter('\x1b[31m', '\x1b[39m'); const green = formatter('\x1b[32m', '\x1b[39m'); const yellow = formatter('\x1b[33m', '\x1b[39m'); const blue = formatter('\x1b[34m', '\x1b[39m'); const magenta = formatter('\x1b[35m', '\x1b[39m'); const purple = formatter('\x1b[38;2;173;127;168m', '\x1b[39m'); const cyan = formatter('\x1b[36m', '\x1b[39m'); const white = formatter('\x1b[37m', '\x1b[39m'); const gray = formatter('\x1b[90m', '\x1b[39m'); const bgBlack = formatter('\x1b[40m', '\x1b[49m'); const bgRed = formatter('\x1b[41m', '\x1b[49m'); const bgGreen = formatter('\x1b[42m', '\x1b[49m'); const bgYellow = formatter('\x1b[43m', '\x1b[49m'); const bgBlue = formatter('\x1b[44m', '\x1b[49m'); const bgMagenta = formatter('\x1b[45m', '\x1b[49m'); const bgCyan = formatter('\x1b[46m', '\x1b[49m'); const bgWhite = formatter('\x1b[47m', '\x1b[49m'); }), "[project]/node_modules/next/dist/esm/lib/scheduler.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; /** * Schedules a function to be called on the next tick after the other promises * have been resolved. * * @param cb the function to schedule */ __turbopack_context__.s([ "atLeastOneTask", ()=>atLeastOneTask, "scheduleImmediate", ()=>scheduleImmediate, "scheduleOnNextTick", ()=>scheduleOnNextTick, "waitAtLeastOneReactRenderTask", ()=>waitAtLeastOneReactRenderTask ]); const scheduleOnNextTick = (cb)=>{ // We use Promise.resolve().then() here so that the operation is scheduled at // the end of the promise job queue, we then add it to the next process tick // to ensure it's evaluated afterwards. // // This was inspired by the implementation of the DataLoader interface: https://github.com/graphql/dataloader/blob/d336bd15282664e0be4b4a657cb796f09bafbc6b/src/index.js#L213-L255 // Promise.resolve().then(()=>{ if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable ; else { process.nextTick(cb); } }); }; const scheduleImmediate = (cb)=>{ if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable ; else { setImmediate(cb); } }; function atLeastOneTask() { return new Promise((resolve)=>scheduleImmediate(resolve)); } function waitAtLeastOneReactRenderTask() { if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable ; else { return new Promise((r)=>setImmediate(r)); } } }), "[project]/node_modules/next/dist/esm/server/api-utils/get-cookie-parser.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; /** * Parse cookies from the `headers` of request * @param req request object */ __turbopack_context__.s([ "getCookieParser", ()=>getCookieParser ]); function getCookieParser(headers) { return function parseCookie() { const { cookie } = headers; if (!cookie) { return {}; } const { parse: parseCookieFn } = __turbopack_context__.r("[project]/node_modules/next/dist/compiled/cookie/index.js [app-route] (ecmascript)"); return parseCookieFn(Array.isArray(cookie) ? cookie.join('; ') : cookie); }; } }), "[project]/node_modules/next/dist/esm/server/api-utils/index.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "ApiError", ()=>ApiError, "COOKIE_NAME_PRERENDER_BYPASS", ()=>COOKIE_NAME_PRERENDER_BYPASS, "COOKIE_NAME_PRERENDER_DATA", ()=>COOKIE_NAME_PRERENDER_DATA, "RESPONSE_LIMIT_DEFAULT", ()=>RESPONSE_LIMIT_DEFAULT, "SYMBOL_CLEARED_COOKIES", ()=>SYMBOL_CLEARED_COOKIES, "SYMBOL_PREVIEW_DATA", ()=>SYMBOL_PREVIEW_DATA, "checkIsOnDemandRevalidate", ()=>checkIsOnDemandRevalidate, "clearPreviewData", ()=>clearPreviewData, "redirect", ()=>redirect, "sendError", ()=>sendError, "sendStatusCode", ()=>sendStatusCode, "setLazyProp", ()=>setLazyProp, "wrapApiHandler", ()=>wrapApiHandler ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$spec$2d$extension$2f$adapters$2f$headers$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/web/spec-extension/adapters/headers.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/lib/constants.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$tracer$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/lib/trace/tracer.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/lib/trace/constants.js [app-route] (ecmascript)"); ; ; ; ; function wrapApiHandler(page, handler) { return (...args)=>{ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$tracer$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["getTracer"])().setRootSpanAttribute('next.route', page); // Call API route method return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$tracer$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["getTracer"])().trace(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["NodeSpan"].runHandler, { spanName: `executing api route (pages) ${page}` }, ()=>handler(...args)); }; } function sendStatusCode(res, statusCode) { res.statusCode = statusCode; return res; } function redirect(res, statusOrUrl, url) { if (typeof statusOrUrl === 'string') { url = statusOrUrl; statusOrUrl = 307; } if (typeof statusOrUrl !== 'number' || typeof url !== 'string') { throw Object.defineProperty(new Error(`Invalid redirect arguments. Please use a single argument URL, e.g. res.redirect('/destination') or use a status code and URL, e.g. res.redirect(307, '/destination').`), "__NEXT_ERROR_CODE", { value: "E389", enumerable: false, configurable: true }); } res.writeHead(statusOrUrl, { Location: url }); res.write(url); res.end(); return res; } function checkIsOnDemandRevalidate(rawHeaders, previewProps) { // Headers is a plain object for Node.js, Headers object in Edge runtime if (typeof rawHeaders.get === 'function') { const headers = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$spec$2d$extension$2f$adapters$2f$headers$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["HeadersAdapter"].from(rawHeaders); const previewModeId = headers.get(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["PRERENDER_REVALIDATE_HEADER"]); const isOnDemandRevalidate = previewModeId === previewProps.previewModeId; const revalidateOnlyGenerated = headers.has(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER"]); return { isOnDemandRevalidate, revalidateOnlyGenerated }; } const headers = rawHeaders; const previewModeId = headers[__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["PRERENDER_REVALIDATE_HEADER"]]; const isOnDemandRevalidate = previewModeId === previewProps.previewModeId; const revalidateOnlyGenerated = headers.hasOwnProperty(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER"]); return { isOnDemandRevalidate, revalidateOnlyGenerated }; } const COOKIE_NAME_PRERENDER_BYPASS = `__prerender_bypass`; const COOKIE_NAME_PRERENDER_DATA = `__next_preview_data`; const RESPONSE_LIMIT_DEFAULT = 4 * 1024 * 1024; const SYMBOL_PREVIEW_DATA = Symbol(COOKIE_NAME_PRERENDER_DATA); const SYMBOL_CLEARED_COOKIES = Symbol(COOKIE_NAME_PRERENDER_BYPASS); function clearPreviewData(res, options = {}) { if (SYMBOL_CLEARED_COOKIES in res) { return res; } const { serialize } = __turbopack_context__.r("[project]/node_modules/next/dist/compiled/cookie/index.js [app-route] (ecmascript)"); const previous = res.getHeader('Set-Cookie'); res.setHeader(`Set-Cookie`, [ ...typeof previous === 'string' ? [ previous ] : Array.isArray(previous) ? previous : [], serialize(COOKIE_NAME_PRERENDER_BYPASS, '', { // To delete a cookie, set `expires` to a date in the past: // https://tools.ietf.org/html/rfc6265#section-4.1.1 // `Max-Age: 0` is not valid, thus ignored, and the cookie is persisted. expires: new Date(0), httpOnly: true, sameSite: ("TURBOPACK compile-time falsy", 0) ? "TURBOPACK unreachable" : 'lax', secure: ("TURBOPACK compile-time value", "development") !== 'development', path: '/', ...options.path !== undefined ? { path: options.path } : undefined }), serialize(COOKIE_NAME_PRERENDER_DATA, '', { // To delete a cookie, set `expires` to a date in the past: // https://tools.ietf.org/html/rfc6265#section-4.1.1 // `Max-Age: 0` is not valid, thus ignored, and the cookie is persisted. expires: new Date(0), httpOnly: true, sameSite: ("TURBOPACK compile-time falsy", 0) ? "TURBOPACK unreachable" : 'lax', secure: ("TURBOPACK compile-time value", "development") !== 'development', path: '/', ...options.path !== undefined ? { path: options.path } : undefined }) ]); Object.defineProperty(res, SYMBOL_CLEARED_COOKIES, { value: true, enumerable: false }); return res; } class ApiError extends Error { constructor(statusCode, message){ super(message); Object.defineProperty(this, "__NEXT_ERROR_CODE", { value: "E394", enumerable: false, configurable: true }); this.statusCode = statusCode; } } function sendError(res, statusCode, message) { res.statusCode = statusCode; res.statusMessage = message; res.end(message); } function setLazyProp({ req }, prop, getter) { const opts = { configurable: true, enumerable: true }; const optsReset = { ...opts, writable: true }; Object.defineProperty(req, prop, { ...opts, get: ()=>{ const value = getter(); // we set the property on the object to avoid recalculating it Object.defineProperty(req, prop, { ...optsReset, value }); return value; }, set: (value)=>{ Object.defineProperty(req, prop, { ...optsReset, value }); } }); } }), "[project]/node_modules/next/dist/esm/server/app-render/async-local-storage.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "bindSnapshot", ()=>bindSnapshot, "createAsyncLocalStorage", ()=>createAsyncLocalStorage, "createSnapshot", ()=>createSnapshot ]); const sharedAsyncLocalStorageNotAvailableError = Object.defineProperty(new Error('Invariant: AsyncLocalStorage accessed in runtime where it is not available'), "__NEXT_ERROR_CODE", { value: "E504", enumerable: false, configurable: true }); class FakeAsyncLocalStorage { disable() { throw sharedAsyncLocalStorageNotAvailableError; } getStore() { // This fake implementation of AsyncLocalStorage always returns `undefined`. return undefined; } run() { throw sharedAsyncLocalStorageNotAvailableError; } exit() { throw sharedAsyncLocalStorageNotAvailableError; } enterWith() { throw sharedAsyncLocalStorageNotAvailableError; } static bind(fn) { return fn; } } const maybeGlobalAsyncLocalStorage = typeof globalThis !== 'undefined' && globalThis.AsyncLocalStorage; function createAsyncLocalStorage() { if (maybeGlobalAsyncLocalStorage) { return new maybeGlobalAsyncLocalStorage(); } return new FakeAsyncLocalStorage(); } function bindSnapshot(fn) { if (maybeGlobalAsyncLocalStorage) { return maybeGlobalAsyncLocalStorage.bind(fn); } return FakeAsyncLocalStorage.bind(fn); } function createSnapshot() { if (maybeGlobalAsyncLocalStorage) { return maybeGlobalAsyncLocalStorage.snapshot(); } return function(fn, ...args) { return fn(...args); }; } }), "[project]/node_modules/next/dist/esm/server/app-render/blocking-route-messages.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "createDynamicBodyError", ()=>createDynamicBodyError, "createDynamicBodyErrorInNavigation", ()=>createDynamicBodyErrorInNavigation, "createDynamicMetadataError", ()=>createDynamicMetadataError, "createDynamicOrRuntimeBodyError", ()=>createDynamicOrRuntimeBodyError, "createDynamicOrRuntimeMetadataError", ()=>createDynamicOrRuntimeMetadataError, "createDynamicOrRuntimeViewportError", ()=>createDynamicOrRuntimeViewportError, "createDynamicViewportError", ()=>createDynamicViewportError, "createLinkBodyErrorInNavigation", ()=>createLinkBodyErrorInNavigation, "createLinkMetadataError", ()=>createLinkMetadataError, "createLinkViewportError", ()=>createLinkViewportError, "createRuntimeBodyError", ()=>createRuntimeBodyError, "createRuntimeBodyErrorInNavigation", ()=>createRuntimeBodyErrorInNavigation, "createRuntimeMetadataError", ()=>createRuntimeMetadataError, "createRuntimeViewportError", ()=>createRuntimeViewportError, "logBuildDebugHint", ()=>logBuildDebugHint ]); function createRuntimeBodyError(route) { return Object.defineProperty(new Error(`Route "${route}": Next.js encountered runtime data during prerendering.\n\n` + `\`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience.\n\n` + `Ways to fix this:\n` + ` - [stream] Provide a placeholder with \`\` around the data access\n` + ` - [block] Set \`export const instant = false\` to allow a blocking route\n\n` + `Learn more: https://nextjs.org/docs/messages/blocking-prerender-runtime`), "__NEXT_ERROR_CODE", { value: "E1427", enumerable: false, configurable: true }); } function createDynamicBodyError(route) { return Object.defineProperty(new Error(`Route "${route}": Next.js encountered uncached data during prerendering.\n\n` + `\`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience.\n\n` + `Ways to fix this:\n` + ` - [stream] Provide a placeholder with \`\` around the data access\n` + ` - [cache] Cache the data access with \`"use cache"\` (does not apply to \`connection()\`)\n` + ` - [block] Set \`export const instant = false\` to allow a blocking route\n\n` + `Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic`), "__NEXT_ERROR_CODE", { value: "E1440", enumerable: false, configurable: true }); } function createRuntimeBodyErrorInNavigation(route) { return Object.defineProperty(new Error(`Route "${route}": Next.js encountered runtime data during prerendering or a navigation.\n\n` + `\`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience.\n\n` + `Ways to fix this:\n` + ` - [stream] Provide a placeholder with \`\` around the data access\n` + ` - [block] Set \`export const instant = false\` to allow a blocking route\n\n` + `Learn more: https://nextjs.org/docs/messages/blocking-prerender-runtime`), "__NEXT_ERROR_CODE", { value: "E1430", enumerable: false, configurable: true }); } function createLinkBodyErrorInNavigation(route) { return Object.defineProperty(new Error(`Route "${route}": Next.js encountered URL data during prerendering or a navigation.\n\n` + `\`params\` or \`searchParams\` accessed outside of \`\` may prevent the navigation from being instant, leading to a slower user experience.\n\n` + `Ways to fix this:\n` + ` - [stream] Provide a placeholder with \`\` around the data access\n` + ` - [block] Set \`export const instant = false\` to allow a blocking route\n\n` + `Learn more: https://nextjs.org/docs/messages/instant-shell-url-data`), "__NEXT_ERROR_CODE", { value: "E1439", enumerable: false, configurable: true }); } function createDynamicBodyErrorInNavigation(route) { return Object.defineProperty(new Error(`Route "${route}": Next.js encountered uncached data during prerendering or a navigation.\n\n` + `\`fetch(...)\` or \`connection()\` accessed outside of \`\` prevents the route from being prerendered or the navigation from being instant, leading to a slower user experience.\n\n` + `Ways to fix this:\n` + ` - [stream] Provide a placeholder with \`\` around the data access\n` + ` - [cache] Cache the data access with \`"use cache"\` (does not apply to \`connection()\`)\n` + ` - [block] Set \`export const instant = false\` to allow a blocking route\n\n` + `Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic`), "__NEXT_ERROR_CODE", { value: "E1437", enumerable: false, configurable: true }); } function createDynamicOrRuntimeBodyError(route) { return Object.defineProperty(new Error(`Route "${route}": Next.js encountered uncached or runtime data during prerendering.\n\n` + `\`fetch(...)\`, \`cookies()\`, \`headers()\`, \`params\`, \`searchParams\`, or \`connection()\` accessed outside of \`\` prevents the route from being prerendered, blocking the page load and leading to a slower user experience.\n\n` + `Ways to fix this:\n` + ` - [stream] Provide a placeholder with \`\` around the data access\n` + ` - [cache] For uncached data (\`fetch\`, database calls): cache the access with \`"use cache"\` (does not apply to \`connection()\`)\n` + ` - [block] Set \`export const instant = false\` to allow a blocking route\n\n` + `Learn more: https://nextjs.org/docs/messages/blocking-prerender-dynamic`), "__NEXT_ERROR_CODE", { value: "E1428", enumerable: false, configurable: true }); } function createLinkMetadataError(route) { return Object.defineProperty(new Error(`Route "${route}": Next.js encountered URL data in \`generateMetadata()\`.\n\n` + `This route's metadata is blocked, but the rest of its content can be prefetched. \`params\` or \`searchParams\` accessed in \`generateMetadata()\` prevent it from being prefetched.\n\n` + `Ways to fix this:\n` + ` - [static] Use a static metadata export instead of \`generateMetadata()\`\n` + ` - [dynamic] Render a marker component that calls \`await connection()\` inside \`\` on the page\n\n` + `Learn more: https://nextjs.org/docs/messages/blocking-prerender-metadata-runtime`), "__NEXT_ERROR_CODE", { value: "E1429", enumerable: false, configurable: true }); } function createRuntimeMetadataError(route) { return Object.defineProperty(new Error(`Route "${route}": Next.js encountered runtime data in \`generateMetadata()\`.\n\n` + `This route's metadata is blocked, but the rest of its content can be prerendered. \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` accessed in \`generateMetadata()\` cause it to run dynamically.\n\n` + `Ways to fix this:\n` + ` - [static] Use a static metadata export instead of \`generateMetadata()\`\n` + ` - [dynamic] Render a marker component that calls \`await connection()\` inside \`\` on the page\n\n` + `Learn more: https://nextjs.org/docs/messages/blocking-prerender-metadata-runtime`), "__NEXT_ERROR_CODE", { value: "E1423", enumerable: false, configurable: true }); } function createDynamicMetadataError(route) { return Object.defineProperty(new Error(`Route "${route}": Next.js encountered uncached data in \`generateMetadata()\`.\n\n` + `This route's metadata is blocked, but the rest of its content can be prerendered. \`fetch(...)\` or \`connection()\` accessed in \`generateMetadata()\` cause it to run dynamically.\n\n` + `Ways to fix this:\n` + ` - [cache] Cache the metadata with \`"use cache"\` in \`generateMetadata()\` (does not apply to \`connection()\`)\n` + ` - [dynamic] Render a marker component that calls \`await connection()\` inside \`\` on the page\n\n` + `Learn more: https://nextjs.org/docs/messages/blocking-prerender-metadata-dynamic`), "__NEXT_ERROR_CODE", { value: "E1425", enumerable: false, configurable: true }); } function createLinkViewportError(route) { return Object.defineProperty(new Error(`Route "${route}": Next.js encountered URL data in \`generateViewport()\`.\n\n` + `\`params\` or \`searchParams\` in \`generateViewport()\` prevents the page from being prerendered, leading to a slower user experience.\n\n` + `Ways to fix this:\n` + ` - [static] Use a static viewport export instead of \`generateViewport()\`\n` + ` - [block] Set \`export const instant = false\` to allow a blocking route\n\n` + `Learn more: https://nextjs.org/docs/messages/blocking-prerender-viewport-runtime`), "__NEXT_ERROR_CODE", { value: "E1431", enumerable: false, configurable: true }); } function createRuntimeViewportError(route) { return Object.defineProperty(new Error(`Route "${route}": Next.js encountered runtime data in \`generateViewport()\`.\n\n` + `\`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` in \`generateViewport()\` prevents the page from being prerendered, leading to a slower user experience.\n\n` + `Ways to fix this:\n` + ` - [static] Use a static viewport export instead of \`generateViewport()\`\n` + ` - [block] Set \`export const instant = false\` to allow a blocking route\n\n` + `Learn more: https://nextjs.org/docs/messages/blocking-prerender-viewport-runtime`), "__NEXT_ERROR_CODE", { value: "E1424", enumerable: false, configurable: true }); } function createDynamicViewportError(route) { return Object.defineProperty(new Error(`Route "${route}": Next.js encountered uncached data in \`generateViewport()\`.\n\n` + `\`fetch(...)\` or \`connection()\` in \`generateViewport()\` prevents the page from being prerendered, leading to a slower user experience.\n\n` + `Ways to fix this:\n` + ` - [cache] Cache the viewport data with \`"use cache"\` in \`generateViewport()\` (does not apply to \`connection()\`)\n` + ` - [block] Set \`export const instant = false\` to allow a blocking route\n\n` + `Learn more: https://nextjs.org/docs/messages/blocking-prerender-viewport-dynamic`), "__NEXT_ERROR_CODE", { value: "E1438", enumerable: false, configurable: true }); } function createDynamicOrRuntimeViewportError(route) { return Object.defineProperty(new Error(`Route "${route}": Next.js encountered uncached or runtime data in \`generateViewport()\`.\n\n` + `This prevents the page from being prerendered, leading to a slower user experience. Unlike metadata, viewport cannot be streamed behind \`\` because it affects the initial page load.\n\n` + `Ways to fix this:\n` + ` - [static] Use a static viewport export instead of \`generateViewport()\`\n` + ` - [cache] For uncached data (\`fetch\`, database calls): cache the viewport with \`"use cache"\` in \`generateViewport()\` (does not apply to \`connection()\`)\n` + ` - [block] Set \`export const instant = false\` to allow a blocking route\n\n` + `Learn more: https://nextjs.org/docs/messages/blocking-prerender-viewport-runtime`), "__NEXT_ERROR_CODE", { value: "E1436", enumerable: false, configurable: true }); } function createDynamicOrRuntimeMetadataError(route) { return Object.defineProperty(new Error(`Route "${route}": Next.js encountered uncached or runtime data in \`generateMetadata()\`.\n\n` + `This route's metadata is blocked, but the rest of its content can be prerendered.\n\n` + `Ways to fix this:\n` + ` - [static] Use a static metadata export instead of \`generateMetadata()\`\n` + ` - [cache] Cache the metadata with \`"use cache"\` in \`generateMetadata()\` (does not apply to \`connection()\`)\n` + ` - [dynamic] Render a marker component that calls \`await connection()\` inside \`\` on the page\n\n` + `Learn more: https://nextjs.org/docs/messages/blocking-prerender-metadata-runtime`), "__NEXT_ERROR_CODE", { value: "E1426", enumerable: false, configurable: true }); } function logBuildDebugHint(route) { if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable ; else if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable ; } }), "[project]/node_modules/next/dist/esm/server/app-render/dynamic-rendering.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "DynamicHoleKind", ()=>DynamicHoleKind, "Postpone", ()=>Postpone, "PreludeState", ()=>PreludeState, "abortAndThrowOnSynchronousRequestDataAccess", ()=>abortAndThrowOnSynchronousRequestDataAccess, "abortOnSynchronousPlatformIOAccess", ()=>abortOnSynchronousPlatformIOAccess, "accessedDynamicData", ()=>accessedDynamicData, "annotateDynamicAccess", ()=>annotateDynamicAccess, "consumeDynamicAccess", ()=>consumeDynamicAccess, "createDynamicTrackingState", ()=>createDynamicTrackingState, "createDynamicValidationState", ()=>createDynamicValidationState, "createHangingInputAbortSignal", ()=>createHangingInputAbortSignal, "createInstantValidationState", ()=>createInstantValidationState, "createRenderInBrowserAbortSignal", ()=>createRenderInBrowserAbortSignal, "formatDynamicAPIAccesses", ()=>formatDynamicAPIAccesses, "getFirstDynamicReason", ()=>getFirstDynamicReason, "getNavigationDisallowedDynamicReasons", ()=>getNavigationDisallowedDynamicReasons, "getStaticShellDisallowedDynamicReasons", ()=>getStaticShellDisallowedDynamicReasons, "isDynamicPostpone", ()=>isDynamicPostpone, "isPrerenderInterruptedError", ()=>isPrerenderInterruptedError, "logDisallowedDynamicError", ()=>logDisallowedDynamicError, "markCurrentScopeAsDynamic", ()=>markCurrentScopeAsDynamic, "postponeWithTracking", ()=>postponeWithTracking, "throwIfDisallowedDynamic", ()=>throwIfDisallowedDynamic, "throwIfSyncIOUsed", ()=>throwIfSyncIOUsed, "throwToInterruptStaticGeneration", ()=>throwToInterruptStaticGeneration, "trackAllowedDynamicAccess", ()=>trackAllowedDynamicAccess, "trackDynamicDataInDynamicRender", ()=>trackDynamicDataInDynamicRender, "trackDynamicHoleInNavigation", ()=>trackDynamicHoleInNavigation, "trackDynamicHoleInRuntimeShell", ()=>trackDynamicHoleInRuntimeShell, "trackDynamicHoleInStaticShell", ()=>trackDynamicHoleInStaticShell, "trackThrownErrorInNavigation", ()=>trackThrownErrorInNavigation, "useDynamicRouteParams", ()=>useDynamicRouteParams, "useDynamicSearchParams", ()=>useDynamicSearchParams ]); /** * The functions provided by this module are used to communicate certain properties * about the currently running code so that Next.js can make decisions on how to handle * the current execution in different rendering modes such as pre-rendering, resuming, and SSR. * * Today Next.js treats all code as potentially static. Certain APIs may only make sense when dynamically rendering. * Traditionally this meant deopting the entire render to dynamic however with PPR we can now deopt parts * of a React tree as dynamic while still keeping other parts static. There are really two different kinds of * Dynamic indications. * * The first is simply an intention to be dynamic. unstable_noStore is an example of this where * the currently executing code simply declares that the current scope is dynamic but if you use it * inside unstable_cache it can still be cached. This type of indication can be removed if we ever * make the default dynamic to begin with because the only way you would ever be static is inside * a cache scope which this indication does not affect. * * The second is an indication that a dynamic data source was read. This is a stronger form of dynamic * because it means that it is inappropriate to cache this at all. using a dynamic data source inside * unstable_cache should error. If you want to use some dynamic data inside unstable_cache you should * read that data outside the cache and pass it in as an argument to the cached function. */ // Once postpone is in stable we should switch to importing the postpone export directly var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$rsc$2f$react$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$client$2f$components$2f$hooks$2d$server$2d$context$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/client/components/hooks-server-context.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$client$2f$components$2f$static$2d$generation$2d$bailout$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/client/components/static-generation-bailout.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$externals$5d2f$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$unit$2d$async$2d$storage$2e$external$2e$js__$5b$external$5d$__$28$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$unit$2d$async$2d$storage$2e$external$2e$js$2c$__cjs$29$__ = __turbopack_context__.i("[externals]/next/dist/server/app-render/work-unit-async-storage.external.js [external] (next/dist/server/app-render/work-unit-async-storage.external.js, cjs)"); var __TURBOPACK__imported__module__$5b$externals$5d2f$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$async$2d$storage$2e$external$2e$js__$5b$external$5d$__$28$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$async$2d$storage$2e$external$2e$js$2c$__cjs$29$__ = __turbopack_context__.i("[externals]/next/dist/server/app-render/work-async-storage.external.js [external] (next/dist/server/app-render/work-async-storage.external.js, cjs)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$dynamic$2d$rendering$2d$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/dynamic-rendering-utils.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$framework$2f$boundary$2d$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/lib/framework/boundary-constants.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$scheduler$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/lib/scheduler.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$lazy$2d$dynamic$2f$bailout$2d$to$2d$csr$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/lazy-dynamic/bailout-to-csr.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$blocking$2d$route$2d$messages$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/app-render/blocking-route-messages.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$invariant$2d$error$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/invariant-error.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$instant$2d$validation$2f$boundary$2d$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/app-render/instant-validation/boundary-constants.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$instant$2d$validation$2f$boundary$2d$tracking$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/app-render/instant-validation/boundary-tracking.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$instant$2d$messages$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/instant-messages.js [app-route] (ecmascript)"); ; ; ; ; ; ; ; ; ; ; ; ; ; ; const hasPostpone = typeof __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$rsc$2f$react$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"].unstable_postpone === 'function'; function createDynamicTrackingState(isDebugDynamicAccesses) { return { isDebugDynamicAccesses, dynamicAccesses: [], syncDynamicErrorWithStack: null, syncDynamicErrorWithStackPostMicrotask: false }; } function createDynamicValidationState() { return { hasSuspenseAboveBody: false, hasDynamicMetadata: false, dynamicMetadata: null, hasDynamicViewport: false, hasAllowedDynamic: false, dynamicErrors: [] }; } function getPendingClientSyncDynamicError(clientDynamic) { return clientDynamic.syncDynamicErrorWithStackPostMicrotask ? null : clientDynamic.syncDynamicErrorWithStack; } function getFirstDynamicReason(trackingState) { var _trackingState_dynamicAccesses_; return (_trackingState_dynamicAccesses_ = trackingState.dynamicAccesses[0]) == null ? void 0 : _trackingState_dynamicAccesses_.expression; } function markCurrentScopeAsDynamic(store, workUnitStore, expression) { if (workUnitStore) { switch(workUnitStore.type){ case 'cache': case 'unstable-cache': // Inside cache scopes, marking a scope as dynamic has no effect, // because the outer cache scope creates a cache boundary. This is // subtly different from reading a dynamic data source, which is // forbidden inside a cache scope. return; case 'private-cache': // A private cache scope is already dynamic by definition. return; case 'prerender-legacy': case 'prerender-ppr': case 'request': case 'generate-static-params': break; default: workUnitStore; } } // If we're forcing dynamic rendering or we're forcing static rendering, we // don't need to do anything here because the entire page is already dynamic // or it's static and it should not throw or postpone here. if (store.forceDynamic || store.forceStatic) return; if (store.dynamicShouldError) { throw Object.defineProperty(new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$client$2f$components$2f$static$2d$generation$2d$bailout$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["StaticGenBailoutError"](`Route ${store.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${expression}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", { value: "E553", enumerable: false, configurable: true }); } if (workUnitStore) { switch(workUnitStore.type){ case 'prerender-ppr': return postponeWithTracking(store.route, expression, workUnitStore.dynamicTracking); case 'prerender-legacy': workUnitStore.revalidate = 0; // We aren't prerendering, but we are generating a static page. We need // to bail out of static generation. const err = Object.defineProperty(new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$client$2f$components$2f$hooks$2d$server$2d$context$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["DynamicServerError"](`Route ${store.route} couldn't be rendered statically because it used ${expression}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`), "__NEXT_ERROR_CODE", { value: "E550", enumerable: false, configurable: true }); store.dynamicUsageDescription = expression; store.dynamicUsageStack = err.stack; throw err; case 'request': if ("TURBOPACK compile-time truthy", 1) { workUnitStore.usedDynamic = true; } break; case 'generate-static-params': break; default: workUnitStore; } } } function throwToInterruptStaticGeneration(expression, store, prerenderStore) { // We aren't prerendering but we are generating a static page. We need to bail out of static generation const err = Object.defineProperty(new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$client$2f$components$2f$hooks$2d$server$2d$context$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["DynamicServerError"](`Route ${store.route} couldn't be rendered statically because it used \`${expression}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`), "__NEXT_ERROR_CODE", { value: "E558", enumerable: false, configurable: true }); prerenderStore.revalidate = 0; store.dynamicUsageDescription = expression; store.dynamicUsageStack = err.stack; throw err; } function trackDynamicDataInDynamicRender(workUnitStore) { switch(workUnitStore.type){ case 'cache': case 'unstable-cache': // Inside cache scopes, marking a scope as dynamic has no effect, // because the outer cache scope creates a cache boundary. This is // subtly different from reading a dynamic data source, which is // forbidden inside a cache scope. return; case 'private-cache': // A private cache scope is already dynamic by definition. return; case 'prerender': case 'prerender-runtime': case 'prerender-legacy': case 'prerender-ppr': case 'prerender-client': case 'validation-client': case 'generate-static-params': break; case 'request': if ("TURBOPACK compile-time truthy", 1) { workUnitStore.usedDynamic = true; } break; default: workUnitStore; } } function abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore) { const reason = `Route ${route} needs to bail out of prerendering at this point because it used ${expression}.`; const error = createPrerenderInterruptedError(reason); prerenderStore.controller.abort(error); const dynamicTracking = prerenderStore.dynamicTracking; if (dynamicTracking) { dynamicTracking.dynamicAccesses.push({ // When we aren't debugging, we don't need to create another error for the // stack trace. stack: dynamicTracking.isDebugDynamicAccesses ? new Error().stack : undefined, expression }); } } function abortOnSynchronousPlatformIOAccess(route, expression, errorWithStack, prerenderStore) { const dynamicTracking = prerenderStore.dynamicTracking; if (dynamicTracking && dynamicTracking.syncDynamicErrorWithStack === null) { dynamicTracking.syncDynamicErrorWithStack = errorWithStack; // React completes the task that is currently rendering before scheduled // abort cleanup. Client tracking can attribute the sync IO only during // that current task; server tracking keeps the error regardless. queueMicrotask(()=>{ dynamicTracking.syncDynamicErrorWithStackPostMicrotask = true; }); } abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore); } function abortAndThrowOnSynchronousRequestDataAccess(route, expression, errorWithStack, prerenderStore) { // The synchronously accessed request data would have been available during // a runtime prerender, which would have rendered past this point instead of // aborting — so a runtime prefetch would produce more content than this // render. Record that, same as when request data access creates a hanging // promise (see makeRuntimeHangingPromise). Unlike // `abortOnSynchronousPlatformIOAccess`, which aborts a runtime prerender // all the same and therefore must not record anything. (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$dynamic$2d$rendering$2d$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["trackRuntimeDataAccessed"])(prerenderStore); const prerenderSignal = prerenderStore.controller.signal; if (prerenderSignal.aborted === false) { // TODO it would be better to move this aborted check into the callsite so we can avoid making // the error object when it isn't relevant to the aborting of the prerender however // since we need the throw semantics regardless of whether we abort it is easier to land // this way. See how this was handled with `abortOnSynchronousPlatformIOAccess` for a closer // to ideal implementation abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore); // Preserve the exact server-side dynamic access for final validation after // interrupting this render. const dynamicTracking = prerenderStore.dynamicTracking; if (dynamicTracking) { if (dynamicTracking.syncDynamicErrorWithStack === null) { dynamicTracking.syncDynamicErrorWithStack = errorWithStack; } } } throw createPrerenderInterruptedError(`Route ${route} needs to bail out of prerendering at this point because it used ${expression}.`); } function Postpone({ reason, route }) { const prerenderStore = __TURBOPACK__imported__module__$5b$externals$5d2f$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$unit$2d$async$2d$storage$2e$external$2e$js__$5b$external$5d$__$28$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$unit$2d$async$2d$storage$2e$external$2e$js$2c$__cjs$29$__["workUnitAsyncStorage"].getStore(); const dynamicTracking = prerenderStore && prerenderStore.type === 'prerender-ppr' ? prerenderStore.dynamicTracking : null; postponeWithTracking(route, reason, dynamicTracking); } function postponeWithTracking(route, expression, dynamicTracking) { assertPostpone(); if (dynamicTracking) { dynamicTracking.dynamicAccesses.push({ // When we aren't debugging, we don't need to create another error for the // stack trace. stack: dynamicTracking.isDebugDynamicAccesses ? new Error().stack : undefined, expression }); } __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$rsc$2f$react$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"].unstable_postpone(createPostponeReason(route, expression)); } function createPostponeReason(route, expression) { return `Route ${route} needs to bail out of prerendering at this point because it used ${expression}. ` + `React throws this special object to indicate where. It should not be caught by ` + `your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`; } function isDynamicPostpone(err) { if (typeof err === 'object' && err !== null && typeof err.message === 'string') { return isDynamicPostponeReason(err.message); } return false; } function isDynamicPostponeReason(reason) { return reason.includes('needs to bail out of prerendering at this point because it used') && reason.includes('Learn more: https://nextjs.org/docs/messages/ppr-caught-error'); } if (isDynamicPostponeReason(createPostponeReason('%%%', '^^^')) === false) { throw Object.defineProperty(new Error('Invariant: isDynamicPostpone misidentified a postpone reason. This is a bug in Next.js'), "__NEXT_ERROR_CODE", { value: "E296", enumerable: false, configurable: true }); } const NEXT_PRERENDER_INTERRUPTED = 'NEXT_PRERENDER_INTERRUPTED'; function createPrerenderInterruptedError(message) { const error = Object.defineProperty(new Error(message), "__NEXT_ERROR_CODE", { value: "E394", enumerable: false, configurable: true }); error.digest = NEXT_PRERENDER_INTERRUPTED; return error; } function isPrerenderInterruptedError(error) { return typeof error === 'object' && error !== null && error.digest === NEXT_PRERENDER_INTERRUPTED && 'name' in error && 'message' in error && error instanceof Error; } function accessedDynamicData(dynamicAccesses) { return dynamicAccesses.length > 0; } function consumeDynamicAccess(serverDynamic, clientDynamic) { // We mutate because we only call this once we are no longer writing // to the dynamicTrackingState and it's more efficient than creating a new // array. serverDynamic.dynamicAccesses.push(...clientDynamic.dynamicAccesses); return serverDynamic.dynamicAccesses; } function formatDynamicAPIAccesses(dynamicAccesses) { return dynamicAccesses.filter((access)=>typeof access.stack === 'string' && access.stack.length > 0).map(({ expression, stack })=>{ stack = stack.split('\n') // Remove the "Error: " prefix from the first line of the stack trace as // well as the first 4 lines of the stack trace which is the distance // from the user code and the `new Error().stack` call. .slice(4).filter((line)=>{ // Exclude Next.js internals from the stack trace. if (line.includes('node_modules/next/')) { return false; } // Exclude anonymous functions from the stack trace. if (line.includes(' ()')) { return false; } // Exclude Node.js internals from the stack trace. if (line.includes(' (node:')) { return false; } return true; }).join('\n'); return `Dynamic API Usage Debug - ${expression}:\n${stack}`; }); } function assertPostpone() { if (!hasPostpone) { throw Object.defineProperty(new Error(`Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js`), "__NEXT_ERROR_CODE", { value: "E224", enumerable: false, configurable: true }); } } function createRenderInBrowserAbortSignal() { const controller = new AbortController(); controller.abort(Object.defineProperty(new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$lazy$2d$dynamic$2f$bailout$2d$to$2d$csr$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["BailoutToCSRError"]('Render in Browser'), "__NEXT_ERROR_CODE", { value: "E721", enumerable: false, configurable: true })); return controller.signal; } function createHangingInputAbortSignal(workUnitStore) { switch(workUnitStore.type){ case 'prerender': case 'prerender-runtime': const controller = new AbortController(); if (workUnitStore.cacheSignal) { // If we have a cacheSignal it means we're in a prospective render. If // the input we're waiting on is coming from another cache, we do want // to wait for it so that we can resolve this cache entry too. workUnitStore.cacheSignal.inputReady().then(()=>{ controller.abort(); }); } else { // Otherwise we're in the final render and we should already have all // our caches filled. // If the prerender uses stages, we have wait until the final stage. // if an input didn't resolve at that point, then we can assume it never will. // // We might still be waiting on some microtasks so we // wait one tick before giving up. When we give up, we still want to // render the content of this cache as deeply as we can so that we can // suspend as deeply as possible in the tree or not at all if we don't // end up waiting for the input. const stagedRendering = (0, __TURBOPACK__imported__module__$5b$externals$5d2f$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$unit$2d$async$2d$storage$2e$external$2e$js__$5b$external$5d$__$28$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$unit$2d$async$2d$storage$2e$external$2e$js$2c$__cjs$29$__["getStagedRenderingController"])(workUnitStore); if (stagedRendering && stagedRendering.finalStage !== null) { stagedRendering.waitForStage(stagedRendering.finalStage).then(()=>(0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$scheduler$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["scheduleOnNextTick"])(()=>controller.abort()), noop); } else { (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$scheduler$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["scheduleOnNextTick"])(()=>controller.abort()); } } return controller.signal; case 'prerender-client': case 'validation-client': case 'prerender-ppr': case 'prerender-legacy': case 'request': case 'cache': case 'private-cache': case 'unstable-cache': case 'generate-static-params': return undefined; default: workUnitStore; } } function noop() {} function annotateDynamicAccess(expression, prerenderStore) { const dynamicTracking = prerenderStore.dynamicTracking; if (dynamicTracking) { dynamicTracking.dynamicAccesses.push({ stack: dynamicTracking.isDebugDynamicAccesses ? new Error().stack : undefined, expression }); } } function useDynamicRouteParams(expression) { const workStore = __TURBOPACK__imported__module__$5b$externals$5d2f$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$async$2d$storage$2e$external$2e$js__$5b$external$5d$__$28$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$async$2d$storage$2e$external$2e$js$2c$__cjs$29$__["workAsyncStorage"].getStore(); const workUnitStore = __TURBOPACK__imported__module__$5b$externals$5d2f$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$unit$2d$async$2d$storage$2e$external$2e$js__$5b$external$5d$__$28$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$unit$2d$async$2d$storage$2e$external$2e$js$2c$__cjs$29$__["workUnitAsyncStorage"].getStore(); if (workStore && workUnitStore) { switch(workUnitStore.type){ case 'prerender-client': { const fallbackParams = workUnitStore.fallbackRouteParams; if (fallbackParams && fallbackParams.size > 0) { // We are in a prerender with cacheComponents semantics. We are going to // hang here and never resolve. This will cause the currently // rendering component to effectively be a dynamic hole. __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$rsc$2f$react$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"].use((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$dynamic$2d$rendering$2d$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["makeClientHookHangingPromise"])(workUnitStore.renderSignal, new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$dynamic$2d$rendering$2d$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ClientHookDynamicError"](workStore.route, expression))); } break; } case 'prerender': throw Object.defineProperty(new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$invariant$2d$error$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["InvariantError"](`\`${expression}\` was called from a Server Component. Next.js should be preventing ${expression} from being included in server components statically, but did not in this case.`), "__NEXT_ERROR_CODE", { value: "E795", enumerable: false, configurable: true }); case 'prerender-ppr': { const fallbackParams = workUnitStore.fallbackRouteParams; if (fallbackParams && fallbackParams.size > 0) { return postponeWithTracking(workStore.route, expression, workUnitStore.dynamicTracking); } break; } case 'validation-client': { break; } case 'prerender-runtime': throw Object.defineProperty(new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$invariant$2d$error$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["InvariantError"](`\`${expression}\` was called during a runtime prerender. Next.js should be preventing ${expression} from being included in server components statically, but did not in this case.`), "__NEXT_ERROR_CODE", { value: "E771", enumerable: false, configurable: true }); case 'cache': case 'private-cache': throw Object.defineProperty(new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$invariant$2d$error$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["InvariantError"](`\`${expression}\` was called inside a cache scope. Next.js should be preventing ${expression} from being included in server components statically, but did not in this case.`), "__NEXT_ERROR_CODE", { value: "E745", enumerable: false, configurable: true }); case 'generate-static-params': throw Object.defineProperty(new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$invariant$2d$error$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["InvariantError"](`\`${expression}\` was called in \`generateStaticParams\`. Next.js should be preventing ${expression} from being included in server component files statically, but did not in this case.`), "__NEXT_ERROR_CODE", { value: "E1130", enumerable: false, configurable: true }); case 'prerender-legacy': case 'request': case 'unstable-cache': break; default: workUnitStore; } } } function useDynamicSearchParams(expression) { const workStore = __TURBOPACK__imported__module__$5b$externals$5d2f$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$async$2d$storage$2e$external$2e$js__$5b$external$5d$__$28$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$async$2d$storage$2e$external$2e$js$2c$__cjs$29$__["workAsyncStorage"].getStore(); const workUnitStore = __TURBOPACK__imported__module__$5b$externals$5d2f$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$unit$2d$async$2d$storage$2e$external$2e$js__$5b$external$5d$__$28$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$unit$2d$async$2d$storage$2e$external$2e$js$2c$__cjs$29$__["workUnitAsyncStorage"].getStore(); if (!workStore) { // We assume pages router context and just return return; } if (!workUnitStore) { (0, __TURBOPACK__imported__module__$5b$externals$5d2f$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$unit$2d$async$2d$storage$2e$external$2e$js__$5b$external$5d$__$28$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$unit$2d$async$2d$storage$2e$external$2e$js$2c$__cjs$29$__["throwForMissingRequestStore"])(expression); } switch(workUnitStore.type){ case 'validation-client': // During instant validation we try to behave as close to client as possible, // so this shouldn't hang during SSR. return; case 'prerender-client': { __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$rsc$2f$react$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"].use((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$dynamic$2d$rendering$2d$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["makeClientHookHangingPromise"])(workUnitStore.renderSignal, new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$dynamic$2d$rendering$2d$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ClientHookDynamicError"](workStore.route, expression))); break; } case 'prerender-legacy': case 'prerender-ppr': { if (workStore.forceStatic) { return; } throw Object.defineProperty(new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$lazy$2d$dynamic$2f$bailout$2d$to$2d$csr$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["BailoutToCSRError"](expression), "__NEXT_ERROR_CODE", { value: "E394", enumerable: false, configurable: true }); } case 'prerender': case 'prerender-runtime': throw Object.defineProperty(new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$invariant$2d$error$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["InvariantError"](`\`${expression}\` was called from a Server Component. Next.js should be preventing ${expression} from being included in server components statically, but did not in this case.`), "__NEXT_ERROR_CODE", { value: "E795", enumerable: false, configurable: true }); case 'cache': case 'unstable-cache': case 'private-cache': throw Object.defineProperty(new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$invariant$2d$error$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["InvariantError"](`\`${expression}\` was called inside a cache scope. Next.js should be preventing ${expression} from being included in server components statically, but did not in this case.`), "__NEXT_ERROR_CODE", { value: "E745", enumerable: false, configurable: true }); case 'generate-static-params': throw Object.defineProperty(new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$invariant$2d$error$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["InvariantError"](`\`${expression}\` was called in \`generateStaticParams\`. Next.js should be preventing ${expression} from being included in server component files statically, but did not in this case.`), "__NEXT_ERROR_CODE", { value: "E1130", enumerable: false, configurable: true }); case 'request': return; default: workUnitStore; } } const hasSuspenseRegex = /\n\s+at Suspense \(\)/; // Common implicit body tags that React will treat as body when placed directly in html const bodyAndImplicitTags = 'body|div|main|section|article|aside|header|footer|nav|form|p|span|h1|h2|h3|h4|h5|h6'; // Detects when RootLayoutBoundary (our framework marker component) appears // after Suspense in the component stack, indicating the root layout is wrapped // within a Suspense boundary. Ensures no body/html/implicit-body components are in between. // // Example matches: // at Suspense () // at __next_root_layout_boundary__ () // // Or with other components in between (but not body/html/implicit-body): // at Suspense () // at SomeComponent () // at __next_root_layout_boundary__ () const hasSuspenseBeforeRootLayoutWithoutBodyOrImplicitBodyRegex = new RegExp(`\\n\\s+at Suspense \\(\\)(?:(?!\\n\\s+at (?:${bodyAndImplicitTags}) \\(\\))[\\s\\S])*?\\n\\s+at ${__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$framework$2f$boundary$2d$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ROOT_LAYOUT_BOUNDARY_NAME"]} \\([^\\n]*\\)`); const hasMetadataRegex = new RegExp(`\\n\\s+at ${__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$framework$2f$boundary$2d$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["METADATA_BOUNDARY_NAME"]}[\\n\\s]`); const hasViewportRegex = new RegExp(`\\n\\s+at ${__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$framework$2f$boundary$2d$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["VIEWPORT_BOUNDARY_NAME"]}[\\n\\s]`); const hasOutletRegex = new RegExp(`\\n\\s+at ${__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$framework$2f$boundary$2d$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["OUTLET_BOUNDARY_NAME"]}[\\n\\s]`); const hasInstantValidationBoundaryRegex = new RegExp(`\\n\\s+at ${__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$instant$2d$validation$2f$boundary$2d$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["INSTANT_VALIDATION_BOUNDARY_NAME"]}[\\n\\s]`); const slotMarkerRegex = new RegExp(`\\n\\s+at ${__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$instant$2d$validation$2f$boundary$2d$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["INSTANT_SLOT_MARKER_PREFIX"]}(\\d+)${__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$instant$2d$validation$2f$boundary$2d$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["INSTANT_SLOT_MARKER_SUFFIX"]}[\\n\\s]`); /** Look up the config factory for the slot this error belongs to. * Checks the component stack for a slot marker (__next_instant_slot_N__) * and returns the config at that index. Falls back to index 0 (root * config) when no slot marker is found or the slot has no config. */ function resolveInstantStack(componentStack, dynamicValidation) { const { slotStacks } = dynamicValidation; if (slotStacks.length > 1) { const match = slotMarkerRegex.exec(componentStack); if (match) { // Slot markers are 0-indexed in the component name but // slotStacks is 1-indexed (index 0 is the root config). const slotIndex = parseInt(match[1], 10) + 1; const slotStack = slotStacks[slotIndex]; if (slotStack != null) { return slotStack; } } } // Fall back to root config (index 0) return slotStacks[0] ?? null; } /** * Inspects the component stack of an outlet boundary to discover whether the * user placed a Suspense boundary above the document body, and records the * opt-in on `dynamicValidation.hasSuspenseAboveBody` if so. * * The outlet itself isn't a meaningful source of dynamic — it only resolves * when metadata/viewport are dynamic, which we track via their own boundaries. * However, the outlet renders alongside the page content, so its stack passes * through the user's layout chain (typically reaching into `` via the * root layout). That makes the outlet stack our best opportunity to spot a * Suspense boundary above the body, even when no real body content is dynamic. * Without this, a route whose only dynamic source is `generateViewport()` would * miss the Suspense-above-body opt-in, because the viewport's stack lives in * the head and never sees the user's root layout. * * We deliberately only set `hasSuspenseAboveBody`, not `hasAllowedDynamic`. The * latter tracks whether the body has dynamic content that's been wrapped in * Suspense (i.e., the page is partially dynamic). The outlet rendering tells us * about the structural opt-in for an empty shell, not about the body being * partially dynamic. The distinction matters because dynamic metadata is only * acceptable when the page is partially dynamic (via real body holes), and we * don't want this outlet-based detection to mask that case. */ function trackOutletSuspenseAboveBody(componentStack, dynamicValidation) { if (hasSuspenseBeforeRootLayoutWithoutBodyOrImplicitBodyRegex.test(componentStack)) { dynamicValidation.hasSuspenseAboveBody = true; } } function trackAllowedDynamicAccess(dynamicReason, workStore, componentStack, dynamicValidation, clientDynamic) { const syncDynamicError = getPendingClientSyncDynamicError(clientDynamic); if (hasOutletRegex.test(componentStack)) { trackOutletSuspenseAboveBody(componentStack, dynamicValidation); return; } else if (hasMetadataRegex.test(componentStack)) { dynamicValidation.hasDynamicMetadata = true; return; } else if (hasViewportRegex.test(componentStack)) { dynamicValidation.hasDynamicViewport = true; return; } else if (hasSuspenseBeforeRootLayoutWithoutBodyOrImplicitBodyRegex.test(componentStack)) { // For Suspense within body, the prelude wouldn't be empty so it wouldn't violate the empty static shells rule. // But if you have Suspense above body, the prelude is empty but we allow that because having Suspense // is an explicit signal from the user that they acknowledge the empty shell and want dynamic rendering. dynamicValidation.hasAllowedDynamic = true; dynamicValidation.hasSuspenseAboveBody = true; return; } else if (hasSuspenseRegex.test(componentStack)) { // this error had a Suspense boundary above it so we don't need to report it as a source // of disallowed dynamicValidation.hasAllowedDynamic = true; return; } else if (syncDynamicError) { dynamicValidation.dynamicErrors.push(syncDynamicError); return; } if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$dynamic$2d$rendering$2d$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["isClientHookDynamicError"])(dynamicReason)) { dynamicValidation.dynamicErrors.push(addErrorContext(dynamicReason, componentStack, null)); return; } const error = addErrorContext((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$blocking$2d$route$2d$messages$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["createDynamicOrRuntimeBodyError"])(workStore.route), componentStack, null); dynamicValidation.dynamicErrors.push(error); return; } var DynamicHoleKind = /*#__PURE__*/ function(DynamicHoleKind) { /** We know that this hole is caused by link data. */ DynamicHoleKind[DynamicHoleKind["Link"] = 1] = "Link"; /** We know that this hole is caused by runtime data. */ DynamicHoleKind[DynamicHoleKind["Runtime"] = 2] = "Runtime"; /** We know that this hole is caused by dynamic data. */ DynamicHoleKind[DynamicHoleKind["Dynamic"] = 3] = "Dynamic"; return DynamicHoleKind; }({}); function createInstantValidationState(slotStacks) { return { hasDynamicMetadata: false, hasAllowedClientDynamicAboveBoundary: false, dynamicMetadata: null, hasDynamicViewport: false, hasAllowedDynamic: false, dynamicErrors: [], validationPreventingErrors: [], thrownErrorsOutsideBoundary: [], slotStacks }; } function trackDynamicHoleInNavigation(dynamicReason, workStore, componentStack, dynamicValidation, clientDynamic, kind, boundaryState) { const syncDynamicError = getPendingClientSyncDynamicError(clientDynamic); if (hasOutletRegex.test(componentStack)) { // We don't need to track that this is dynamic. It is only so when something else is also dynamic. return; } // Resolve the config stack for this specific error. If the error // is inside a slot marker, use that slot's config. Otherwise fall // back to the default. const effectiveCreateInstantStack = resolveInstantStack(componentStack, dynamicValidation); if (hasMetadataRegex.test(componentStack)) { const error = addErrorContext(kind === 1 ? (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$blocking$2d$route$2d$messages$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["createLinkMetadataError"])(workStore.route) : kind === 2 ? (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$blocking$2d$route$2d$messages$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["createRuntimeMetadataError"])(workStore.route) : (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$blocking$2d$route$2d$messages$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["createDynamicMetadataError"])(workStore.route), componentStack, effectiveCreateInstantStack); dynamicValidation.dynamicMetadata = error; return; } if (hasViewportRegex.test(componentStack)) { const error = addErrorContext(kind === 1 ? (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$blocking$2d$route$2d$messages$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["createLinkViewportError"])(workStore.route) : kind === 2 ? (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$blocking$2d$route$2d$messages$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["createRuntimeViewportError"])(workStore.route) : (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$blocking$2d$route$2d$messages$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["createDynamicViewportError"])(workStore.route), componentStack, effectiveCreateInstantStack); dynamicValidation.dynamicErrors.push(error); return; } const boundaryLocation = hasInstantValidationBoundaryRegex.exec(componentStack); if (!boundaryLocation) { // We don't see the validation boundary in the component stack, // so this hole must be coming from a shared parent. // Shared parents are fully resolved and don't have RSC holes, // but they can still suspend in a client component during SSR. // If we managed to render all the validation boundaries, that means // that the client holes aren't blocking validation and we can disregard them. // Note that we don't even care whether they have suspense or not. if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$instant$2d$validation$2f$boundary$2d$tracking$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["allRequiredBoundariesRendered"])(boundaryState)) { dynamicValidation.hasAllowedClientDynamicAboveBoundary = true; dynamicValidation.hasAllowedDynamic = true // Holes outside the boundary contribute to allowing dynamic metadata ; return; } else { // TODO(instant-validation) TODO(NAR-787) // If shared parents blocked us from validating, we should only log // the errors from the innermost (segments), i.e. omit layouts whose // slots managed to render (because clearly they didn't block validation) const message = `Route "${workStore.route}": Could not validate \`instant\` because a Client Component in a parent segment prevented the page from rendering.`; const error = addErrorContext(Object.defineProperty(new Error(message), "__NEXT_ERROR_CODE", { value: "E1331", enumerable: false, configurable: true }), componentStack, effectiveCreateInstantStack); dynamicValidation.validationPreventingErrors.push(error); return; } } else { // The hole originates inside the validation boundary. // // Check if we have a Suspense above the hole, but below the validation boundary. // If we do, then this dynamic usage wouldn't block a navigation to this subtree. // Conversely, if the nearest suspense is above the validation boundary, then this subtree would block. // // Note that in the component stack, children come before parents. // // Valid: // ... // at Suspense // ... // at __next_prefetch_validation_boundary__ // // Invalid: // ... // at __next_prefetch_validation_boundary__ // ... // at Suspense // const suspenseLocation = hasSuspenseRegex.exec(componentStack); if (suspenseLocation) { if (suspenseLocation.index < boundaryLocation.index) { dynamicValidation.hasAllowedDynamic = true; return; } else { // invalid - fallthrough } } } if (syncDynamicError) { if (effectiveCreateInstantStack !== null && syncDynamicError.cause === undefined) { syncDynamicError.cause = effectiveCreateInstantStack(); } dynamicValidation.dynamicErrors.push(syncDynamicError); return; } if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$dynamic$2d$rendering$2d$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["isClientHookDynamicError"])(dynamicReason)) { dynamicValidation.dynamicErrors.push(addErrorContext(dynamicReason, componentStack, effectiveCreateInstantStack)); return; } const error = addErrorContext(kind === 1 ? (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$blocking$2d$route$2d$messages$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["createLinkBodyErrorInNavigation"])(workStore.route) : kind === 2 ? (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$blocking$2d$route$2d$messages$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["createRuntimeBodyErrorInNavigation"])(workStore.route) : (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$blocking$2d$route$2d$messages$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["createDynamicBodyErrorInNavigation"])(workStore.route), componentStack, effectiveCreateInstantStack); dynamicValidation.dynamicErrors.push(error); return; } function trackThrownErrorInNavigation(workStore, dynamicValidation, thrownValue, componentStack) { const boundaryLocation = hasInstantValidationBoundaryRegex.exec(componentStack); if (!boundaryLocation) { // There's no validation boundary on the component stack. // This error may have blocked a boundary from rendering. // Wrap the error to provide component context. // This helps for errors from node_modules which would otherwise // have no useful stack information due to ignore-listing, // e.g. next/dynamic with `ssr: false`. const error = addErrorContext(Object.defineProperty(new Error('An error occurred while attempting to validate instant UI. This error may be preventing the validation from completing.', { cause: thrownValue }), "__NEXT_ERROR_CODE", { value: "E1118", enumerable: false, configurable: true }), componentStack, null); dynamicValidation.thrownErrorsOutsideBoundary.push(error); } else { // There's validation boundary on the component stack, // so we know this error didn't block a validation boundary from rendering. // However, this error might be hiding be hiding dynamic content that would // cause validation to fail. const suspenseLocation = hasSuspenseRegex.exec(componentStack); if (suspenseLocation) { if (suspenseLocation.index < boundaryLocation.index) { // There's a Suspense below the validation boundary but above this error's location. // This subtree can't fail instant validation because any potential // dynamic holes would be guarded by the Suspense anyway, // so we can allow this. return; } else { // invalid - fallthrough } } const message = `Route "${workStore.route}": Could not validate \`instant\` because an error prevented the target segment from rendering.`; const error = addErrorContext(Object.defineProperty(new Error(message, { cause: thrownValue }), "__NEXT_ERROR_CODE", { value: "E1338", enumerable: false, configurable: true }), componentStack, null // TODO(instant-validation-build): conflicting use of cause ); dynamicValidation.validationPreventingErrors.push(error); } } function trackDynamicHoleInRuntimeShell(dynamicReason, workStore, componentStack, dynamicValidation, clientDynamic) { const syncDynamicError = getPendingClientSyncDynamicError(clientDynamic); if (hasOutletRegex.test(componentStack)) { trackOutletSuspenseAboveBody(componentStack, dynamicValidation); return; } else if (hasMetadataRegex.test(componentStack)) { const error = addErrorContext((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$blocking$2d$route$2d$messages$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["createDynamicMetadataError"])(workStore.route), componentStack, null); dynamicValidation.dynamicMetadata = error; return; } else if (hasViewportRegex.test(componentStack)) { const error = addErrorContext((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$blocking$2d$route$2d$messages$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["createDynamicViewportError"])(workStore.route), componentStack, null); dynamicValidation.dynamicErrors.push(error); return; } else if (hasSuspenseBeforeRootLayoutWithoutBodyOrImplicitBodyRegex.test(componentStack)) { // For Suspense within body, the prelude wouldn't be empty so it wouldn't violate the empty static shells rule. // But if you have Suspense above body, the prelude is empty but we allow that because having Suspense // is an explicit signal from the user that they acknowledge the empty shell and want dynamic rendering. dynamicValidation.hasAllowedDynamic = true; dynamicValidation.hasSuspenseAboveBody = true; return; } else if (hasSuspenseRegex.test(componentStack)) { // this error had a Suspense boundary above it so we don't need to report it as a source // of disallowed dynamicValidation.hasAllowedDynamic = true; return; } else if (syncDynamicError) { dynamicValidation.dynamicErrors.push(syncDynamicError); return; } if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$dynamic$2d$rendering$2d$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["isClientHookDynamicError"])(dynamicReason)) { dynamicValidation.dynamicErrors.push(addErrorContext(dynamicReason, componentStack, null)); return; } const error = addErrorContext((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$blocking$2d$route$2d$messages$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["createDynamicBodyError"])(workStore.route), componentStack, null); dynamicValidation.dynamicErrors.push(error); return; } function trackDynamicHoleInStaticShell(dynamicReason, workStore, componentStack, dynamicValidation, clientDynamic) { const syncDynamicError = getPendingClientSyncDynamicError(clientDynamic); if (hasOutletRegex.test(componentStack)) { trackOutletSuspenseAboveBody(componentStack, dynamicValidation); return; } else if (hasMetadataRegex.test(componentStack)) { const error = addErrorContext((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$blocking$2d$route$2d$messages$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["createRuntimeMetadataError"])(workStore.route), componentStack, null); dynamicValidation.dynamicMetadata = error; return; } else if (hasViewportRegex.test(componentStack)) { const error = addErrorContext((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$blocking$2d$route$2d$messages$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["createRuntimeViewportError"])(workStore.route), componentStack, null); dynamicValidation.dynamicErrors.push(error); return; } else if (hasSuspenseBeforeRootLayoutWithoutBodyOrImplicitBodyRegex.test(componentStack)) { // For Suspense within body, the prelude wouldn't be empty so it wouldn't violate the empty static shells rule. // But if you have Suspense above body, the prelude is empty but we allow that because having Suspense // is an explicit signal from the user that they acknowledge the empty shell and want dynamic rendering. dynamicValidation.hasAllowedDynamic = true; dynamicValidation.hasSuspenseAboveBody = true; return; } else if (hasSuspenseRegex.test(componentStack)) { // this error had a Suspense boundary above it so we don't need to report it as a source // of disallowed dynamicValidation.hasAllowedDynamic = true; return; } else if (syncDynamicError) { dynamicValidation.dynamicErrors.push(syncDynamicError); return; } if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$dynamic$2d$rendering$2d$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["isClientHookDynamicError"])(dynamicReason)) { dynamicValidation.dynamicErrors.push(addErrorContext(dynamicReason, componentStack, null)); return; } const error = addErrorContext((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$blocking$2d$route$2d$messages$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["createRuntimeBodyError"])(workStore.route), componentStack, null); dynamicValidation.dynamicErrors.push(error); return; } /** * In dev mode, we prefer using the owner stack, otherwise the provided * component stack is used. * * Accepts an already-created Error so the SWC error-code plugin can see the * `new Error(...)` call at each call site and auto-assign error codes. */ function addErrorContext(error, componentStack, createInstantStack) { const ownerStack = ("TURBOPACK compile-time value", "development") !== 'production' && __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$rsc$2f$react$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"].captureOwnerStack ? __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$rsc$2f$react$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"].captureOwnerStack() : null; if (createInstantStack !== null) { error.cause = createInstantStack(); } // TODO go back to owner stack here if available. This is temporarily using componentStack to get the right // error.stack = error.name + ': ' + error.message + (ownerStack || componentStack); return error; } var PreludeState = /*#__PURE__*/ function(PreludeState) { PreludeState[PreludeState["Full"] = 0] = "Full"; PreludeState[PreludeState["Empty"] = 1] = "Empty"; PreludeState[PreludeState["Errored"] = 2] = "Errored"; return PreludeState; }({}); function logDisallowedDynamicError(workStore, error) { console.error(error); (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$blocking$2d$route$2d$messages$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["logBuildDebugHint"])(workStore.route); } function throwIfSyncIOUsed(workStore, serverDynamic) { if (serverDynamic.syncDynamicErrorWithStack) { logDisallowedDynamicError(workStore, serverDynamic.syncDynamicErrorWithStack); throw new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$client$2f$components$2f$static$2d$generation$2d$bailout$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["StaticGenBailoutError"](); } } function throwIfDisallowedDynamic(workStore, prelude, dynamicValidation, serverDynamic, allowEmptyStaticShell) { throwIfSyncIOUsed(workStore, serverDynamic); // The dynamic metadata error is a mistake-detection signal. It fires when the // rest of the shell is otherwise fully static apart from metadata, suggesting // the dynamic data access in `generateMetadata` was probably unintentional. // That condition is independent of whether the user or build phase accepted // an empty shell, so we surface it before any opt-in bypass. if (prelude === 0 && dynamicValidation.hasAllowedDynamic === false && dynamicValidation.hasDynamicMetadata) { console.error((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$blocking$2d$route$2d$messages$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["createDynamicOrRuntimeMetadataError"])(workStore.route).message); throw new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$client$2f$components$2f$static$2d$generation$2d$bailout$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["StaticGenBailoutError"](); } // Either flag expresses "this shell is allowed to be empty/blocking": // - `allowEmptyStaticShell` covers `instant = false` (user opt-in) // and the build-phase fallback-shell case. // - `hasSuspenseAboveBody` is the structural opt-in inside the user's root // layout. // Treat them as synonyms for the purpose of bypassing shell-failure errors. if (allowEmptyStaticShell || dynamicValidation.hasSuspenseAboveBody) { return; } if (prelude !== 0) { // We didn't have any sync bailouts but there may be user code which // blocked the root. We would have captured these during the prerender // and can log them here and then terminate the build/validating render const dynamicErrors = dynamicValidation.dynamicErrors; if (dynamicErrors.length > 0) { for(let i = 0; i < dynamicErrors.length; i++){ logDisallowedDynamicError(workStore, dynamicErrors[i]); } throw new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$client$2f$components$2f$static$2d$generation$2d$bailout$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["StaticGenBailoutError"](); } // If we got this far then the only other thing that could be blocking // the root is dynamic Viewport. If this is dynamic then // you need to opt into that by adding a Suspense boundary above the body // to indicate your are ok with fully dynamic rendering. if (dynamicValidation.hasDynamicViewport) { console.error((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$blocking$2d$route$2d$messages$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["createDynamicOrRuntimeViewportError"])(workStore.route).message); throw new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$client$2f$components$2f$static$2d$generation$2d$bailout$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["StaticGenBailoutError"](); } if (prelude === 1) { // If we ever get this far then we messed up the tracking of invalid dynamic. // We still adhere to the constraint that you must produce a shell but invite the // user to report this as a bug in Next.js. console.error(`Route "${workStore.route}" did not produce a static shell and Next.js was unable to determine a reason. This is a bug in Next.js.`); throw new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$client$2f$components$2f$static$2d$generation$2d$bailout$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["StaticGenBailoutError"](); } } } function getStaticShellDisallowedDynamicReasons(workStore, prelude, dynamicValidation, allowEmptyStaticShell) { // The dynamic metadata error is a mistake-detection signal. It fires when the // rest of the shell is otherwise fully static apart from metadata, suggesting // the dynamic data access in `generateMetadata` was probably unintentional. // That condition is independent of whether the user or build phase accepted // an empty shell, so we surface it before any opt-in bypass. if (prelude === 0 && dynamicValidation.hasAllowedDynamic === false && dynamicValidation.dynamicErrors.length === 0 && dynamicValidation.dynamicMetadata) { return [ dynamicValidation.dynamicMetadata ]; } // Either flag expresses "this shell is allowed to be empty/blocking": // - `allowEmptyStaticShell` covers `instant = false` (user opt-in) // and the build-phase fallback-shell case. // - `hasSuspenseAboveBody` is the structural opt-in inside the user's root // layout. // Treat them as synonyms for the purpose of bypassing shell-failure errors. if (allowEmptyStaticShell || dynamicValidation.hasSuspenseAboveBody) { return []; } if (prelude !== 0) { // We didn't have any sync bailouts but there may be user code which // blocked the root. We would have captured these during the prerender // and can log them here and then terminate the build/validating render const dynamicErrors = dynamicValidation.dynamicErrors; if (dynamicErrors.length > 0) { return dynamicErrors; } if (prelude === 1) { // If we ever get this far then we messed up the tracking of invalid dynamic. // We still adhere to the constraint that you must produce a shell but invite the // user to report this as a bug in Next.js. return [ Object.defineProperty(new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$invariant$2d$error$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["InvariantError"](`Route "${workStore.route}" did not produce a static shell and Next.js was unable to determine a reason.`), "__NEXT_ERROR_CODE", { value: "E936", enumerable: false, configurable: true }) ]; } } // We had a non-empty prelude and there are no dynamic holes return []; } function getNavigationDisallowedDynamicReasons(workStore, prelude, dynamicValidation, validationSampleTracking, boundaryState, devRenderDidError) { // If we have errors related to missing samples, those should take precedence over everything else. if (validationSampleTracking) { const { missingSampleErrors } = validationSampleTracking; if (missingSampleErrors.length > 0) { return missingSampleErrors; } } const { validationPreventingErrors } = dynamicValidation; if (validationPreventingErrors.length > 0) { if (("TURBOPACK compile-time value", "1") && devRenderDidError) { // The dev render already surfaced server errors to the user. // The same errors likely caused validation to be inconclusive, // so reporting them again as validation failures would be noisy. return []; } return validationPreventingErrors; } // NOTE: We don't care about Suspense above body here, // we're only concerned with the validation boundary if (prelude !== 0) { const dynamicErrors = dynamicValidation.dynamicErrors; if (dynamicErrors.length > 0) { return dynamicErrors; } if (prelude === 1 && !dynamicValidation.hasAllowedClientDynamicAboveBoundary && (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$instant$2d$validation$2f$boundary$2d$tracking$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["allRequiredBoundariesRendered"])(boundaryState)) { // If we ever get this far then we messed up the tracking of invalid // dynamic. (When boundaries are missing the deferred fallback below // will surface a more useful error.) return Object.defineProperty(new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$invariant$2d$error$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["InvariantError"](`Route "${workStore.route}" failed to render during instant validation and Next.js was unable to determine a reason.`), "__NEXT_ERROR_CODE", { value: "E1055", enumerable: false, configurable: true }); } } else { const dynamicErrors = dynamicValidation.dynamicErrors; if (dynamicErrors.length > 0) { return dynamicErrors; } if (dynamicValidation.hasAllowedDynamic === false && dynamicValidation.dynamicMetadata) { return [ dynamicValidation.dynamicMetadata ]; } } // Missing boundaries on their own aren't a strong signal — a parent // layout may legitimately omit a slot. Defer this so the caller can // try shallower validation depths first; if every depth comes up // empty we still want to surface this so the user is made aware that // validation didn't complete. When we add a markers API, the // marker-based variant of this check can become strict again. if (!(0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$instant$2d$validation$2f$boundary$2d$tracking$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["allRequiredBoundariesRendered"])(boundaryState)) { const { thrownErrorsOutsideBoundary } = dynamicValidation; const rootInstantStack = dynamicValidation.slotStacks[0]; if (thrownErrorsOutsideBoundary.length === 0) { const missingFiles = []; for (const [id, filePaths] of boundaryState.requiredIds){ if (!boundaryState.renderedIds.has(id)) { for (const filePath of filePaths){ let normalized = filePath.replace(/^\[project\][\\/]?/, '').replace(process.cwd() + '/', '').replace(process.cwd() + '\\', ''); missingFiles.push(normalized); } } } missingFiles.sort(); return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$instant$2d$messages$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["createUnrenderedSegmentError"])(workStore.route, missingFiles); } else if (("TURBOPACK compile-time value", "1") && devRenderDidError) { // Errors outside the boundary likely blocked it from rendering, // but they're already being reported to the user via the dev // render. Suppress the validation failure to avoid noise. return []; } else if (thrownErrorsOutsideBoundary.length === 1) { const message = `Route "${workStore.route}": Could not validate \`instant\` because the target segment was prevented from rendering, likely due to the following error.`; const error = rootInstantStack !== null ? rootInstantStack() : new Error(); error.name = 'Error'; error.message = message; return new AggregateError([ error, thrownErrorsOutsideBoundary[0] ]); } else { const message = `Route "${workStore.route}": Could not validate \`instant\` because the target segment was prevented from rendering, likely due to one of the following errors.`; const error = rootInstantStack !== null ? rootInstantStack() : new Error(); error.name = 'Error'; error.message = message; return new AggregateError([ error, ...thrownErrorsOutsideBoundary ]); } } // We had a non-empty prelude and there are no dynamic holes return []; } }), "[project]/node_modules/next/dist/esm/server/app-render/instant-validation/boundary-constants.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "INSTANT_SLOT_MARKER_PREFIX", ()=>INSTANT_SLOT_MARKER_PREFIX, "INSTANT_SLOT_MARKER_SUFFIX", ()=>INSTANT_SLOT_MARKER_SUFFIX, "INSTANT_VALIDATION_BOUNDARY_NAME", ()=>INSTANT_VALIDATION_BOUNDARY_NAME ]); const INSTANT_VALIDATION_BOUNDARY_NAME = '__next_instant_validation_boundary__'; const INSTANT_SLOT_MARKER_PREFIX = '__next_instant_slot_'; const INSTANT_SLOT_MARKER_SUFFIX = '__'; }), "[project]/node_modules/next/dist/esm/server/app-render/instant-validation/boundary-tracking.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "allRequiredBoundariesRendered", ()=>allRequiredBoundariesRendered, "createValidationBoundaryTracking", ()=>createValidationBoundaryTracking ]); function createValidationBoundaryTracking() { return { requiredIds: new Map(), renderedIds: new Set() }; } function allRequiredBoundariesRendered(state) { for (const id of state.requiredIds.keys()){ if (!state.renderedIds.has(id)) { return false; } } return true; } }), "[project]/node_modules/next/dist/esm/server/app-render/manifests-singleton.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "getActionNotFoundError", ()=>getActionNotFoundError, "getClientReferenceManifest", ()=>getClientReferenceManifest, "getInvalidServerReferenceIdError", ()=>getInvalidServerReferenceIdError, "getServerActionsManifest", ()=>getServerActionsManifest, "getServerModuleMap", ()=>getServerModuleMap, "selectWorkerForForwarding", ()=>selectWorkerForForwarding, "setManifestsSingleton", ()=>setManifestsSingleton ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$invariant$2d$error$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/invariant-error.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$app$2d$paths$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/router/utils/app-paths.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$path$2d$has$2d$prefix$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/router/utils/path-has-prefix.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$remove$2d$path$2d$prefix$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/router/utils/remove-path-prefix.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$server$2d$reference$2d$info$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/server-reference-info.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$utils$2f$reflect$2d$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/utils/reflect-utils.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$externals$5d2f$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$async$2d$storage$2e$external$2e$js__$5b$external$5d$__$28$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$async$2d$storage$2e$external$2e$js$2c$__cjs$29$__ = __turbopack_context__.i("[externals]/next/dist/server/app-render/work-async-storage.external.js [external] (next/dist/server/app-render/work-async-storage.external.js, cjs)"); ; ; ; ; ; ; ; function getActionNotFoundError(actionId) { return Object.defineProperty(new Error(`Failed to find Server Action${actionId ? ` "${actionId}"` : ''}. This request might be from an older or newer deployment.\nRead more: https://nextjs.org/docs/messages/failed-to-find-server-action`), "__NEXT_ERROR_CODE", { value: "E974", enumerable: false, configurable: true }); } function getInvalidServerReferenceIdError(id) { // `id` is arbitrary client-provided input. Unlike the not-found case, it has // not passed the length gate and can reach this error via a malformed server // reference in an action payload, so it may be of any length and contain // control characters. `JSON.stringify` escapes newlines and quotes so it // can't forge log lines, and truncating overly long ids prevents log // flooding. Ids at or below the cap are logged in full so that we only add an // ellipsis to ids that are meaningfully longer than the truncated length. const encoded = JSON.stringify(id.length > MAX_LOGGED_SERVER_REFERENCE_ID_LENGTH ? id.slice(0, TRUNCATED_SERVER_REFERENCE_ID_LENGTH) + '…' : id); return Object.defineProperty(new Error(`The Server Reference ID did not match the expected format. Received ${encoded}.\nRead more: https://nextjs.org/docs/messages/failed-to-find-server-action`), "__NEXT_ERROR_CODE", { value: "E1442", enumerable: false, configurable: true }); } // Ids at or below the cap are logged in full. Longer ids are truncated to the // shorter length and marked with an ellipsis, so the cap leaves headroom over // the truncated length rather than ellipsizing ids that are barely too long. const MAX_LOGGED_SERVER_REFERENCE_ID_LENGTH = 100; const TRUNCATED_SERVER_REFERENCE_ID_LENGTH = 90; // This is a global singleton that is, among other things, also used to // encode/decode bound args of server function closures. This can't be using a // AsyncLocalStorage as it might happen at the module level. const MANIFESTS_SINGLETON = Symbol.for('next.server.manifests'); const globalThisWithManifests = globalThis; function createProxiedClientReferenceManifest(clientReferenceManifestsPerRoute) { const createMappingProxy = (prop)=>{ return new Proxy({}, { get (_, id) { const workStore = __TURBOPACK__imported__module__$5b$externals$5d2f$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$async$2d$storage$2e$external$2e$js__$5b$external$5d$__$28$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$async$2d$storage$2e$external$2e$js$2c$__cjs$29$__["workAsyncStorage"].getStore(); if (workStore) { var _clientReferenceManifestsPerRoute_get; const currentManifest = (_clientReferenceManifestsPerRoute_get = clientReferenceManifestsPerRoute.get(workStore.route)) == null ? void 0 : _clientReferenceManifestsPerRoute_get.clientReferenceManifest; if (currentManifest == null ? void 0 : currentManifest[prop][id]) { return currentManifest[prop][id]; } // In development, we also check all other manifests to see if the // module exists there. This is to support a scenario where React's // I/O tracking (dev-only) creates a connection from one page to // another through an emitted async I/O node that references client // components from the other page, e.g. in owner props. // TODO: Maybe we need to add a `debugBundlerConfig` option to React // to avoid this workaround. The current workaround has the // disadvantage that one might accidentally or intentionally share // client references across pages (e.g. by storing them in a global // variable), which would then only be caught in production. if ("TURBOPACK compile-time truthy", 1) { for (const [route, { page, clientReferenceManifest }] of clientReferenceManifestsPerRoute){ if (route === workStore.route) { continue; } const entry = clientReferenceManifest[prop][id]; if (entry !== undefined) { if ("TURBOPACK compile-time truthy", 1) { // The dev validation worker rebuilds this registry in its // own thread, seeded with only the route it validates, so // it has to be told which other manifests it needs. workStore.additionalClientReferenceManifestPages ??= new Set(); workStore.additionalClientReferenceManifestPages.add(page); } return entry; } } } } else { // If there's no work store defined, we can assume that a client // reference manifest is needed during module evaluation, e.g. to // create a server function using a higher-order function. This // might also use client components which need to be serialized by // Flight, and therefore client references need to be resolvable. In // that case we search all page manifests to find the module. for (const { clientReferenceManifest } of clientReferenceManifestsPerRoute.values()){ const entry = clientReferenceManifest[prop][id]; if (entry !== undefined) { return entry; } } } return undefined; } }); }; const mappingProxies = new Map(); return new Proxy({}, { get (_, prop) { const workStore = __TURBOPACK__imported__module__$5b$externals$5d2f$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$async$2d$storage$2e$external$2e$js__$5b$external$5d$__$28$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$async$2d$storage$2e$external$2e$js$2c$__cjs$29$__["workAsyncStorage"].getStore(); switch(prop){ case 'moduleLoading': case 'entryCSSFiles': case 'entryJSFiles': { if (!workStore) { throw Object.defineProperty(new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$invariant$2d$error$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["InvariantError"](`Cannot access "${prop}" without a work store.`), "__NEXT_ERROR_CODE", { value: "E952", enumerable: false, configurable: true }); } const registeredManifest = clientReferenceManifestsPerRoute.get(workStore.route); if (!registeredManifest) { throw Object.defineProperty(new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$invariant$2d$error$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["InvariantError"](`The client reference manifest for route "${workStore.route}" does not exist.`), "__NEXT_ERROR_CODE", { value: "E951", enumerable: false, configurable: true }); } return registeredManifest.clientReferenceManifest[prop]; } case 'clientModules': case 'rscModuleMapping': case 'edgeRscModuleMapping': case 'ssrModuleMapping': case 'edgeSSRModuleMapping': { let proxy = mappingProxies.get(prop); if (!proxy) { proxy = createMappingProxy(prop); mappingProxies.set(prop, proxy); } return proxy; } default: { throw Object.defineProperty(new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$invariant$2d$error$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["InvariantError"](`This is a proxied client reference manifest. The property "${String(prop)}" is not handled.`), "__NEXT_ERROR_CODE", { value: "E953", enumerable: false, configurable: true }); } } } }); } /** * This function creates a Flight-acceptable server module map proxy from our * Server Reference Manifest similar to our client module map. This is because * our manifest contains a lot of internal Next.js data that are relevant to the * runtime, workers, etc. that React doesn't need to know. */ function createServerModuleMap() { return new Proxy(Object.create(null), { get: (target, id, receiver)=>{ var _getServerActionsManifest__id, _getServerActionsManifest_; // React's debug serialization can probe the module map like a plain object. // These probes are not server reference lookups. if (typeof id !== 'string') { return Reflect.get(target, id, receiver); } if (__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$utils$2f$reflect$2d$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["wellKnownProperties"].has(id)) { return Reflect.get(target, id, receiver); } if (!(0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$server$2d$reference$2d$info$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["mightBeServerReferenceId"])(id)) { throw getInvalidServerReferenceIdError(id); } const workers = (_getServerActionsManifest_ = getServerActionsManifest()[("TURBOPACK compile-time falsy", 0) ? "TURBOPACK unreachable" : 'node']) == null ? void 0 : (_getServerActionsManifest__id = _getServerActionsManifest_[id]) == null ? void 0 : _getServerActionsManifest__id.workers; if (!workers) { throw getActionNotFoundError(id); } const workStore = __TURBOPACK__imported__module__$5b$externals$5d2f$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$async$2d$storage$2e$external$2e$js__$5b$external$5d$__$28$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$async$2d$storage$2e$external$2e$js$2c$__cjs$29$__["workAsyncStorage"].getStore(); let workerEntry; if (workStore) { workerEntry = workers[normalizeWorkerPageName(workStore.page)]; } else { // If there's no work store defined, we can assume that a server // module map is needed during module evaluation, e.g. to create a // server action using a higher-order function. Therefore it should be // safe to return any entry from the manifest that matches the action // ID. They all refer to the same module ID, which must also exist in // the current page bundle. TODO: This is currently not guaranteed in // Turbopack, and needs to be fixed. workerEntry = Object.values(workers).at(0); } if (!workerEntry) { throw getActionNotFoundError(id); } const { moduleId, async } = workerEntry; return { id: moduleId, name: id, chunks: [], async }; } }); } /** * The flight entry loader keys actions by bundlePath. bundlePath corresponds * with the relative path (including 'app') to the page entrypoint. */ function normalizeWorkerPageName(pageName) { if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$path$2d$has$2d$prefix$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["pathHasPrefix"])(pageName, 'app')) { return pageName; } return 'app' + pageName; } /** * Converts a bundlePath (relative path to the entrypoint) to a routable page * name. */ function denormalizeWorkerPageName(bundlePath) { return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$app$2d$paths$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["normalizeAppPath"])((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$remove$2d$path$2d$prefix$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["removePathPrefix"])(bundlePath, 'app')); } function selectWorkerForForwarding(actionId, pageName) { var _serverActionsManifest__actionId; const serverActionsManifest = getServerActionsManifest(); const workers = (_serverActionsManifest__actionId = serverActionsManifest[("TURBOPACK compile-time falsy", 0) ? "TURBOPACK unreachable" : 'node'][actionId]) == null ? void 0 : _serverActionsManifest__actionId.workers; // There are no workers to handle this action, nothing to forward to. if (!workers) { return; } // If there is an entry for the current page, we don't need to forward. if (workers[normalizeWorkerPageName(pageName)]) { return; } // Otherwise, grab the first worker that has a handler for this action id. return denormalizeWorkerPageName(Object.keys(workers)[0]); } function setManifestsSingleton({ page, clientReferenceManifest, serverActionsManifest: rawServerActionsManifest }) { const existingSingleton = globalThisWithManifests[MANIFESTS_SINGLETON]; const route = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$app$2d$paths$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["normalizeAppPath"])(page); const serverActionsManifest = { encryptionKey: rawServerActionsManifest.encryptionKey, // Use null-prototypes for the action objects to prevent prototype pollution // from affecting action ID lookups. node: Object.assign(Object.create(null), rawServerActionsManifest.node), edge: Object.assign(Object.create(null), rawServerActionsManifest.edge) }; if (existingSingleton) { existingSingleton.clientReferenceManifestsPerRoute.set(route, { page, clientReferenceManifest }); existingSingleton.serverActionsManifest = serverActionsManifest; } else { const clientReferenceManifestsPerRoute = new Map([ [ route, { page, clientReferenceManifest } ] ]); const proxiedClientReferenceManifest = createProxiedClientReferenceManifest(clientReferenceManifestsPerRoute); globalThisWithManifests[MANIFESTS_SINGLETON] = { clientReferenceManifestsPerRoute, proxiedClientReferenceManifest, serverActionsManifest, serverModuleMap: createServerModuleMap() }; } } function getManifestsSingleton() { const manifestSingleton = globalThisWithManifests[MANIFESTS_SINGLETON]; if (!manifestSingleton) { throw Object.defineProperty(new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$invariant$2d$error$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["InvariantError"]('The manifests singleton was not initialized.'), "__NEXT_ERROR_CODE", { value: "E950", enumerable: false, configurable: true }); } return manifestSingleton; } function getClientReferenceManifest() { return getManifestsSingleton().proxiedClientReferenceManifest; } function getServerActionsManifest() { return getManifestsSingleton().serverActionsManifest; } function getServerModuleMap() { return getManifestsSingleton().serverModuleMap; } }), "[project]/node_modules/next/dist/esm/server/app-render/staged-rendering.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "RENDER_STAGE_ADVANCE_ORDER", ()=>RENDER_STAGE_ADVANCE_ORDER, "RenderStage", ()=>RenderStage, "StagedRenderingController", ()=>StagedRenderingController, "SyncIOMode", ()=>SyncIOMode, "getNextStage", ()=>getNextStage, "isAdvanceableRenderStage", ()=>isAdvanceableRenderStage ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$invariant$2d$error$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/invariant-error.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$promise$2d$with$2d$resolvers$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/promise-with-resolvers.js [app-route] (ecmascript)"); ; ; var RenderStage = /*#__PURE__*/ function(RenderStage) { RenderStage[RenderStage["Before"] = 1] = "Before"; // RenderStage[RenderStage["ShellStatic"] = 11] = "ShellStatic"; RenderStage[RenderStage["Static"] = 13] = "Static"; // RenderStage[RenderStage["ShellRuntime"] = 21] = "ShellRuntime"; RenderStage[RenderStage["Runtime"] = 23] = "Runtime"; // RenderStage[RenderStage["Dynamic"] = 30] = "Dynamic"; // RenderStage[RenderStage["Abandoned"] = 40] = "Abandoned"; return RenderStage; }({}); const RENDER_STAGE_ADVANCE_ORDER = [ 11, 13, 21, 23, 30 ]; function getNextStage(stage) { return RENDER_STAGE_ADVANCE_ORDER[RENDER_STAGE_ADVANCE_ORDER.indexOf(stage) + 1]; } function isAdvanceableRenderStage(stage) { return 1 < stage && stage <= 30; } var SyncIOMode = /*#__PURE__*/ function(SyncIOMode) { /** Sync IO does not error in any stage. */ SyncIOMode[SyncIOMode["Untracked"] = 1] = "Untracked"; /** Before `partialPrefetching`: Sync IO errors in static stages, and is allowed otherwise. */ SyncIOMode[SyncIOMode["AllowedInRuntimeOrDynamic"] = 2] = "AllowedInRuntimeOrDynamic"; /** After `partialPrefetching`: Sync IO errors in all stages other than dynamic. */ SyncIOMode[SyncIOMode["AllowedInDynamic"] = 3] = "AllowedInDynamic"; return SyncIOMode; }({}); class StagedRenderingController { constructor({ abortSignal, abandonController, syncIO, finalStage }){ this.currentStage = 1; this.syncInterruptReason = null; this.triggers = { [11]: createStageTrigger(), [13]: createStageTrigger(), // [21]: createStageTrigger(), [23]: createStageTrigger(), // [30]: createStageTrigger() }; this.abortSignal = abortSignal; this.abandonController = abandonController; this.syncIOMode = syncIO; this.finalStage = finalStage; if (abortSignal) { abortSignal.addEventListener('abort', ()=>{ // Reject all stage promises that haven't already been resolved. // `cancelStageTrigger` is a noop if the trigger already resolved. const { reason } = abortSignal; for (const trigger of Object.values(this.triggers)){ cancelStageTrigger(trigger, reason); } }, { once: true }); } if (abandonController) { abandonController.signal.addEventListener('abort', ()=>{ this.abandonRender(); }, { once: true }); } } onStage(stage, callback) { addSyncTriggerListener(this.triggers[stage], callback); } shouldTrackSyncInterrupt() { if (this.syncIOMode === 1) { return false; } switch(this.currentStage){ case 1: // If we haven't started the render yet, it can't be interrupted. return false; case 11: case 13: return true; case 21: case 23: { switch(this.syncIOMode){ case 2: { // Before `partialPrefetching`: Sync IO only errors in static stages. return false; } case 3: { return true; } } // NOT a fallthrough, but eslint doesn't understand that } case 30: case 40: return false; default: this.currentStage; return false; } } /** Note: only call this if `shouldTrackSyncInterrupt()` returned true */ syncInterruptCurrentStageWithReason(reason) { const { currentStage } = this; if (currentStage === 1 || currentStage === 30 || currentStage === 40) { // Not interruptible. Defensive noop. return; } // If Sync IO occurs during an abandonable render, we trigger the abandon. // The abandon listener will call abandonRender which advances through // stages to let caches fill before marking as Abandoned. if (this.abandonController) { this.abandonController.abort(); return; } if (this.abortSignal) { // If this is an abortable render, we capture the interruption reason and stop advancing. // We don't release any more promises. // The caller is expected to abort the signal. this.syncInterruptReason = reason; this.currentStage = 40; return; } // If we're in a non-abandonable & non-abortable render, // we need to advance to the Dynamic stage and capture the interruption reason. // (in dev, this will be the restarted render) this.syncInterruptReason = reason; this.advanceStage(30); } getSyncInterruptReason() { return this.syncInterruptReason; } getStageEndTime(stage) { return this.triggers[getNextStage(stage)].triggeredAt ?? Infinity; } abandonRender() { // In staged rendering, only the initial render is abandonable. // We can abandon the initial render if // 1. We notice a cache miss, and need to wait for caches to fill // 2. A sync IO error occurs, and the render should be interrupted // (this might be a lazy intitialization of a module, // so we still want to restart in this case and see if it still occurs) // In either case, we'll be doing another render after this one, // so we only want to unblock the next stage, not Dynamic, because // unblocking the dynamic stage would likely lead to wasted (uncached) IO. const { currentStage } = this; if (currentStage === 1) { throw Object.defineProperty(new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$invariant$2d$error$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["InvariantError"]("A render that hasn't started yet cannot be abandoned"), "__NEXT_ERROR_CODE", { value: "E1300", enumerable: false, configurable: true }); } if (currentStage === 30 || currentStage === 40) { // We shouldn't ever trigger an abandon in these. Defensive noop. return; } // Resolve all stages after the current one, up to runtime (excluding dynamic) const nextStageIx = RENDER_STAGE_ADVANCE_ORDER.indexOf(currentStage) + 1; const dynamicStageIx = RENDER_STAGE_ADVANCE_ORDER.indexOf(30); for(let i = nextStageIx; i < dynamicStageIx; i++){ this.resolveStage(RENDER_STAGE_ADVANCE_ORDER[i]); } this.currentStage = 40; } advanceStage(targetStage) { if (this.finalStage !== null && targetStage > this.finalStage) { throw Object.defineProperty(new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$invariant$2d$error$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["InvariantError"](`Attempted to advance to stage ${RenderStage[targetStage]} but the render is limited to ${RenderStage[this.finalStage]}`), "__NEXT_ERROR_CODE", { value: "E1302", enumerable: false, configurable: true }); } const { currentStage } = this; if (currentStage === 30 || currentStage === 40) { // Terminal stages, nowhere left to advance. return; } // If we're already at the target stage or beyond, do nothing. if (targetStage <= currentStage) { return; } this.currentStage = targetStage; // Resolve all stages between the current stage and the target. const nextStageIx = currentStage === 1 ? 0 : RENDER_STAGE_ADVANCE_ORDER.indexOf(currentStage) + 1; const targetStageIx = RENDER_STAGE_ADVANCE_ORDER.indexOf(targetStage); for(let i = nextStageIx; i <= targetStageIx; i++){ this.resolveStage(RENDER_STAGE_ADVANCE_ORDER[i]); } } resolveStage(stage) { fireStageTrigger(this.triggers[stage]); } getStagePromise(stage) { return this.triggers[stage].promise; } waitForStage(stage) { return this.getStagePromise(stage); } delayUntilStage(stage, displayName, resolvedValue) { const stagePromise = this.getStagePromise(stage); const promise = ("TURBOPACK compile-time truthy", 1) ? makeDevtoolsIOPromiseFromIOTrigger(stagePromise, displayName, resolvedValue) : "TURBOPACK unreachable"; // Analogously to `makeDynamicHangingPromise`, we might reject this promise if the signal is invoked. // (e.g. in the case where we don't want want the render to proceed to the dynamic stage and abort it). // We shouldn't consider this an unhandled rejection, so we attach a noop catch handler here to suppress this warning. if (this.abortSignal) { promise.catch(ignoreReject); } return promise; } } function ignoreReject() {} // TODO(restart-on-cache-miss): the layering of `delayUntilStage`, // `makeDevtoolsIOPromiseFromIOTrigger` and and `makeDevtoolsIOAwarePromise` // is confusing, we should clean it up. function makeDevtoolsIOPromiseFromIOTrigger(ioTrigger, displayName, resolvedValue) { // If we create a `new Promise` and give it a displayName // (with no userspace code above us in the stack) // React Devtools will use it as the IO cause when determining "suspended by". // In particular, it should shadow any inner IO that resolved/rejected the promise // (in case of staged rendering, this will be the `setTimeout` that triggers the relevant stage) const promise = new Promise((resolve, reject)=>{ ioTrigger.then(resolve.bind(null, resolvedValue), reject); }); if (displayName !== undefined) { // @ts-expect-error promise.displayName = displayName; } return promise; } function addSyncTriggerListener(trigger, listener) { if (trigger.state === 'pending') { trigger._listeners.push(listener); } else { listener(); } } function createStageTrigger() { const { promise, resolve, reject } = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$promise$2d$with$2d$resolvers$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["createPromiseWithResolvers"])(); return { state: 'pending', triggeredAt: null, promise, _listeners: [], _resolvePromise: resolve, _rejectPromise: reject }; } function fireStageTrigger(trigger) { if (trigger.state !== 'pending') { return; } trigger.state = 'triggered'; trigger.triggeredAt = performance.now() + performance.timeOrigin; try { const { _listeners: listeners } = trigger; for(let i = 0; i < listeners.length; i++){ listeners[i](); } listeners.length = 0; } finally{ trigger._resolvePromise(); } } function cancelStageTrigger(trigger, reason) { if (trigger.state !== 'pending') { return; } trigger.state = 'cancelled'; // we didn't trigger, so don't save `triggeredAt`. // We're not gonna fire the listeners, we may as well free them. trigger._listeners.length = 0; // Suppress unhandled rejection warnings for promises that no one is awaiting. trigger.promise.catch(ignoreReject); trigger._rejectPromise(reason); } }), "[project]/node_modules/next/dist/esm/server/base-http/helpers.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; /** * This file provides some helpers that should be used in conjunction with * explicit environment checks. When combined with the environment checks, it * will ensure that the correct typings are used as well as enable code * elimination. */ /** * Type guard to determine if a request is a WebNextRequest. This does not * actually check the type of the request, but rather the runtime environment. * It's expected that when the runtime environment is the edge runtime, that any * base request is a WebNextRequest. */ __turbopack_context__.s([ "isNodeNextRequest", ()=>isNodeNextRequest, "isNodeNextResponse", ()=>isNodeNextResponse, "isWebNextRequest", ()=>isWebNextRequest, "isWebNextResponse", ()=>isWebNextResponse ]); const isWebNextRequest = (req)=>("TURBOPACK compile-time value", "nodejs") === 'edge'; const isWebNextResponse = (res)=>("TURBOPACK compile-time value", "nodejs") === 'edge'; const isNodeNextRequest = (req)=>("TURBOPACK compile-time value", "nodejs") !== 'edge'; const isNodeNextResponse = (res)=>("TURBOPACK compile-time value", "nodejs") !== 'edge'; }), "[project]/node_modules/next/dist/esm/server/base-http/index.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "BaseNextRequest", ()=>BaseNextRequest, "BaseNextResponse", ()=>BaseNextResponse ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$client$2f$components$2f$redirect$2d$status$2d$code$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/client/components/redirect-status-code.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$api$2d$utils$2f$get$2d$cookie$2d$parser$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/api-utils/get-cookie-parser.js [app-route] (ecmascript)"); ; ; class BaseNextRequest { constructor(method, url, body){ this.method = method; this.url = url; this.body = body; } // Utils implemented using the abstract methods above get cookies() { if (this._cookies) return this._cookies; return this._cookies = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$api$2d$utils$2f$get$2d$cookie$2d$parser$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["getCookieParser"])(this.headers)(); } } class BaseNextResponse { constructor(destination){ this.destination = destination; } // Utils implemented using the abstract methods above redirect(destination, statusCode) { this.setHeader('Location', destination); this.statusCode = statusCode; // Since IE11 doesn't support the 308 header add backwards // compatibility using refresh header if (statusCode === __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$client$2f$components$2f$redirect$2d$status$2d$code$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["RedirectStatusCode"].PermanentRedirect) { this.setHeader('Refresh', `0;url=${destination}`); } return this; } } }), "[project]/node_modules/next/dist/esm/server/base-http/node.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "NodeNextRequest", ()=>NodeNextRequest, "NodeNextResponse", ()=>NodeNextResponse ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$api$2d$utils$2f$index$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/api-utils/index.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$request$2d$meta$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/request-meta.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$base$2d$http$2f$index$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/base-http/index.js [app-route] (ecmascript)"); ; ; ; let prop; class NodeNextRequest extends __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$base$2d$http$2f$index$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["BaseNextRequest"] { static #_ = prop = _NEXT_REQUEST_META = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$request$2d$meta$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["NEXT_REQUEST_META"]; constructor(_req){ var _this__req; super(_req.method.toUpperCase(), _req.url, _req), this._req = _req, this.headers = this._req.headers, this.fetchMetrics = (_this__req = this._req) == null ? void 0 : _this__req.fetchMetrics, this[_NEXT_REQUEST_META] = this._req[__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$request$2d$meta$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["NEXT_REQUEST_META"]] || {}, this.streaming = false; } get originalRequest() { // Need to mimic these changes to the original req object for places where we use it: // render.tsx, api/ssg requests this._req[__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$request$2d$meta$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["NEXT_REQUEST_META"]] = this[__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$request$2d$meta$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["NEXT_REQUEST_META"]]; this._req.url = this.url; this._req.cookies = this.cookies; return this._req; } set originalRequest(value) { this._req = value; } /** * Returns the request body as a Web Readable Stream. The body here can only * be read once as the body will start flowing as soon as the data handler * is attached. * * @internal */ stream() { if (this.streaming) { throw Object.defineProperty(new Error('Invariant: NodeNextRequest.stream() can only be called once'), "__NEXT_ERROR_CODE", { value: "E467", enumerable: false, configurable: true }); } this.streaming = true; return new ReadableStream({ start: (controller)=>{ this._req.on('data', (chunk)=>{ controller.enqueue(new Uint8Array(chunk)); }); this._req.on('end', ()=>{ controller.close(); }); this._req.on('error', (err)=>{ controller.error(err); }); } }); } } class NodeNextResponse extends __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$base$2d$http$2f$index$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["BaseNextResponse"] { get originalResponse() { if (__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$api$2d$utils$2f$index$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["SYMBOL_CLEARED_COOKIES"] in this) { this._res[__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$api$2d$utils$2f$index$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["SYMBOL_CLEARED_COOKIES"]] = this[__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$api$2d$utils$2f$index$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["SYMBOL_CLEARED_COOKIES"]]; } return this._res; } constructor(_res){ super(_res), this._res = _res, this.textBody = undefined; } get sent() { return this._res.finished || this._res.headersSent; } get statusCode() { return this._res.statusCode; } set statusCode(value) { this._res.statusCode = value; } get statusMessage() { return this._res.statusMessage; } set statusMessage(value) { this._res.statusMessage = value; } setHeader(name, value) { this._res.setHeader(name, value); return this; } removeHeader(name) { this._res.removeHeader(name); return this; } getHeaderValues(name) { const values = this._res.getHeader(name); if (values === undefined) return undefined; return (Array.isArray(values) ? values : [ values ]).map((value)=>value.toString()); } hasHeader(name) { return this._res.hasHeader(name); } getHeader(name) { const values = this.getHeaderValues(name); return Array.isArray(values) ? values.join(',') : undefined; } getHeaders() { return this._res.getHeaders(); } appendHeader(name, value) { const currentValues = this.getHeaderValues(name) ?? []; if (!currentValues.includes(value)) { this._res.setHeader(name, [ ...currentValues, value ]); } return this; } body(value) { this.textBody = value; return this; } send() { this._res.end(this.textBody); } onClose(callback) { this.originalResponse.on('close', callback); } } var _NEXT_REQUEST_META; }), "[project]/node_modules/next/dist/esm/server/client-component-renderer-logger.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "getClientComponentLoaderMetrics", ()=>getClientComponentLoaderMetrics, "wrapClientComponentLoader", ()=>wrapClientComponentLoader ]); // Combined load times for loading client components let clientComponentLoadStart = 0; let clientComponentLoadTimes = 0; let clientComponentLoadCount = 0; function wrapClientComponentLoader(ComponentMod, isTracingEnabled) { if (!('performance' in globalThis) || !process.env.NEXT_OTEL_PERFORMANCE_PREFIX && !isTracingEnabled) { return ComponentMod.__next_app__; } return { require: (...args)=>{ const startTime = performance.now(); if (clientComponentLoadStart === 0) { clientComponentLoadStart = startTime; } try { clientComponentLoadCount += 1; return ComponentMod.__next_app__.require(...args); } finally{ clientComponentLoadTimes += performance.now() - startTime; } }, loadChunk: (...args)=>{ const startTime = performance.now(); const result = ComponentMod.__next_app__.loadChunk(...args); // Avoid wrapping `loadChunk`'s result in an extra promise in case something like React depends on its identity. // We only need to know when it's settled. result.finally(()=>{ clientComponentLoadTimes += performance.now() - startTime; }); return result; } }; } function getClientComponentLoaderMetrics(options = {}) { const metrics = clientComponentLoadStart === 0 ? undefined : { clientComponentLoadStart, clientComponentLoadTimes, clientComponentLoadCount }; if (options.reset) { clientComponentLoadStart = 0; clientComponentLoadTimes = 0; clientComponentLoadCount = 0; } return metrics; } }), "[project]/node_modules/next/dist/esm/server/dynamic-rendering-utils.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "ClientHookDynamicError", ()=>ClientHookDynamicError, "RENDER_STAGES_BY_DATA_KIND", ()=>RENDER_STAGES_BY_DATA_KIND, "applyOwnerStack", ()=>applyOwnerStack, "isClientHookDynamicError", ()=>isClientHookDynamicError, "isHangingPromiseRejectionError", ()=>isHangingPromiseRejectionError, "makeClientHookHangingPromise", ()=>makeClientHookHangingPromise, "makeDevtoolsIOAwarePromise", ()=>makeDevtoolsIOAwarePromise, "makeDynamicHangingPromise", ()=>makeDynamicHangingPromise, "makeFallbackParamsHangingPromise", ()=>makeFallbackParamsHangingPromise, "makePromiseFromTrigger", ()=>makePromiseFromTrigger, "makeRuntimeHangingPromise", ()=>makeRuntimeHangingPromise, "makeStageHangingPromise", ()=>makeStageHangingPromise, "makeUntrackedHangingPromise", ()=>makeUntrackedHangingPromise, "trackFallbackParamsAccessed", ()=>trackFallbackParamsAccessed, "trackRuntimeDataAccessed", ()=>trackRuntimeDataAccessed ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$staged$2d$rendering$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/app-render/staged-rendering.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$externals$5d2f$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$unit$2d$async$2d$storage$2e$external$2e$js__$5b$external$5d$__$28$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$unit$2d$async$2d$storage$2e$external$2e$js$2c$__cjs$29$__ = __turbopack_context__.i("[externals]/next/dist/server/app-render/work-unit-async-storage.external.js [external] (next/dist/server/app-render/work-unit-async-storage.external.js, cjs)"); var __TURBOPACK__imported__module__$5b$externals$5d2f$next$2f$dist$2f$server$2f$runtime$2d$reacts$2e$external$2e$js__$5b$external$5d$__$28$next$2f$dist$2f$server$2f$runtime$2d$reacts$2e$external$2e$js$2c$__cjs$29$__ = __turbopack_context__.i("[externals]/next/dist/server/runtime-reacts.external.js [external] (next/dist/server/runtime-reacts.external.js, cjs)"); ; ; ; function isHangingPromiseRejectionError(err) { if (typeof err !== 'object' || err === null || !('digest' in err)) { return false; } return err.digest === HANGING_PROMISE_REJECTION; } const HANGING_PROMISE_REJECTION = 'HANGING_PROMISE_REJECTION'; class HangingPromiseRejectionError extends Error { constructor(route, expression){ super(`During prerendering, ${expression} rejects when the prerender is complete. Typically these errors are handled by React but if you move ${expression} to a different context by using \`setTimeout\`, \`after\`, or similar functions you may observe this error and you should handle it in that context. This occurred at route "${route}".`), this.route = route, this.expression = expression, this.digest = HANGING_PROMISE_REJECTION; } } const CLIENT_HOOK_DYNAMIC = 'CLIENT_HOOK_DYNAMIC'; class ClientHookDynamicError extends Error { constructor(route, expression){ super(`Route "${route}": Next.js encountered URL data \`${expression}\` in a Client Component outside of \`\`.\n\n` + `This blocks prerendering because the value is only available at runtime.\n\n` + `Ways to fix this:\n` + ` - [stream] Wrap the component in \`\` so the hook value streams in after prerendering\n` + ` - [block] Set \`export const instant = false\` to allow a blocking route\n\n` + `Learn more: https://nextjs.org/docs/messages/blocking-prerender-client-hook`), this.digest = CLIENT_HOOK_DYNAMIC; Object.defineProperty(this, "__NEXT_ERROR_CODE", { value: "E1433", enumerable: false, configurable: true }); } } function isClientHookDynamicError(err) { if (typeof err !== 'object' || err === null || !('digest' in err)) { return false; } return err.digest === CLIENT_HOOK_DYNAMIC; } const abortListenersBySignal = new WeakMap(); function makeDynamicHangingPromise(signal, route, expression) { return makeHangingPromiseWithError(signal, new HangingPromiseRejectionError(route, expression)); } function makeUntrackedHangingPromise(signal, route, expression) { return makeHangingPromiseWithError(signal, new HangingPromiseRejectionError(route, expression)); } function makeRuntimeHangingPromise(signal, route, expression, workUnitStore) { if (workUnitStore !== null) { trackRuntimeDataAccessed(workUnitStore); } return makeHangingPromiseWithError(signal, new HangingPromiseRejectionError(route, expression)); } function makeFallbackParamsHangingPromise(signal, route, expression, workUnitStore) { if (workUnitStore !== null) { trackFallbackParamsAccessed(workUnitStore); } return makeHangingPromiseWithError(signal, new HangingPromiseRejectionError(route, expression)); } function makeStageHangingPromise(signal, route, expression, workUnitStore) { trackRuntimeDataAccessed(workUnitStore); return makeHangingPromiseWithError(signal, new HangingPromiseRejectionError(route, expression)); } function trackRuntimeDataAccessed(workUnitStore) { trackRuntimeDataAccessedImpl(workUnitStore, false); } function trackFallbackParamsAccessed(workUnitStore) { trackRuntimeDataAccessedImpl(workUnitStore, true); } function trackRuntimeDataAccessedImpl(workUnitStore, isFallbackParamAccess) { switch(workUnitStore.type){ case 'prerender': { var // responses as `needsRuntimeRequest`): resolved for every kind of // access — a pre-upgrade fallback response must keep reporting that // a runtime request would return more. The fulfillment row lands at // the current position in the Flight stream, which is what makes the // value rewindable per stage. Promise resolution is idempotent, so // repeated accesses are free. _workUnitStore_runtimeDataAccessed; (_workUnitStore_runtimeDataAccessed = workUnitStore.runtimeDataAccessed) == null ? void 0 : _workUnitStore_runtimeDataAccessed.resolve(true); // Hint cell (holds the build-constant // PrefetchHint.ShouldAttemptStaticPrefetch value directly): a // fallback-param access is transient when the route is // fallback-upgradeable — ISR later produces the concrete prerender a // static prefetch attempt would hit — so it leaves the hint intact. // (Until that upgrade, the response-level flag above keeps directing // the client to a runtime fallback; the hint only costs a wasted // static attempt in the interim.) Every other access clears it. const hintCell = workUnitStore.shouldAttemptStaticPrefetch; if (hintCell !== null && (!isFallbackParamAccess || !workUnitStore.isFallbackUpgradeable)) { hintCell.current = false; } break; } case 'prerender-client': case 'prerender-ppr': case 'prerender-legacy': case 'prerender-runtime': case 'validation-client': case 'request': case 'cache': case 'private-cache': case 'unstable-cache': case 'generate-static-params': break; default: workUnitStore; } } function makeClientHookHangingPromise(signal, error) { return makeHangingPromiseWithError(signal, error); } function makeHangingPromiseWithError(signal, error) { if (signal.aborted) { return Promise.reject(error); } else { const hangingPromise = new Promise((_, reject)=>{ const boundRejection = reject.bind(null, error); let currentListeners = abortListenersBySignal.get(signal); if (currentListeners) { currentListeners.push(boundRejection); } else { const listeners = [ boundRejection ]; abortListenersBySignal.set(signal, listeners); signal.addEventListener('abort', ()=>{ for(let i = 0; i < listeners.length; i++){ listeners[i](); } }, { once: true }); } }); // We are fine if no one actually awaits this promise. We shouldn't consider this an unhandled rejection so // we attach a noop catch handler here to suppress this warning. If you actually await somewhere or construct // your own promise out of it you'll need to ensure you handle the error when it rejects. hangingPromise.catch(ignoreReject); return hangingPromise; } } function ignoreReject() {} function makePromiseFromTrigger(trigger, value) { const promise = trigger.then(()=>value); promise.catch(ignoreReject); return promise; } function makeDevtoolsIOAwarePromise(underlying, requestStore, stage) { if (requestStore.stagedRendering) { // We resolve each stage in a timeout, so React DevTools will pick this up as IO. return requestStore.stagedRendering.delayUntilStage(stage, undefined, underlying); } // in React DevTools if we resolve in a setTimeout we will observe // the promise resolution as something that can suspend a boundary or root. return new Promise((resolve)=>{ // Must use setTimeout to be considered IO React DevTools. setImmediate will not work. setTimeout(()=>{ resolve(underlying); }, 0); }); } const RENDER_STAGES_BY_DATA_KIND = { sessionData: __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$staged$2d$rendering$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["RenderStage"].ShellRuntime, staticLinkData: __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$staged$2d$rendering$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["RenderStage"].Static, runtimeLinkData: __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$staged$2d$rendering$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["RenderStage"].Runtime }; function applyOwnerStack(error) { if ("TURBOPACK compile-time truthy", 1) { var _getClientReact_captureOwnerStack, _getClientReact, _getServerReact_captureOwnerStack, _getServerReact; let ownerStack; const workUnitStore = __TURBOPACK__imported__module__$5b$externals$5d2f$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$unit$2d$async$2d$storage$2e$external$2e$js__$5b$external$5d$__$28$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$unit$2d$async$2d$storage$2e$external$2e$js$2c$__cjs$29$__["workUnitAsyncStorage"].getStore(); // captureOwnerStack() returns the owner stack for the current React // rendering context. Inside a cache scope this only includes the inner // component tree. The outer owner stack (captured before entering the // cache boundary in use-cache-wrapper.ts) is stored on the cache store. // We concatenate both to get the full component tree. const innerOwnerStack = ((_getClientReact = (0, __TURBOPACK__imported__module__$5b$externals$5d2f$next$2f$dist$2f$server$2f$runtime$2d$reacts$2e$external$2e$js__$5b$external$5d$__$28$next$2f$dist$2f$server$2f$runtime$2d$reacts$2e$external$2e$js$2c$__cjs$29$__["getClientReact"])()) == null ? void 0 : (_getClientReact_captureOwnerStack = _getClientReact.captureOwnerStack) == null ? void 0 : _getClientReact_captureOwnerStack.call(_getClientReact)) ?? ((_getServerReact = (0, __TURBOPACK__imported__module__$5b$externals$5d2f$next$2f$dist$2f$server$2f$runtime$2d$reacts$2e$external$2e$js__$5b$external$5d$__$28$next$2f$dist$2f$server$2f$runtime$2d$reacts$2e$external$2e$js$2c$__cjs$29$__["getServerReact"])()) == null ? void 0 : (_getServerReact_captureOwnerStack = _getServerReact.captureOwnerStack) == null ? void 0 : _getServerReact_captureOwnerStack.call(_getServerReact)); switch(workUnitStore == null ? void 0 : workUnitStore.type){ case 'cache': case 'private-cache': ownerStack = (innerOwnerStack || '') + (workUnitStore.outerOwnerStack || '') || undefined; break; case 'unstable-cache': case 'request': case 'prerender': case 'prerender-ppr': case 'prerender-legacy': case 'prerender-runtime': case 'prerender-client': case 'validation-client': case 'generate-static-params': case undefined: ownerStack = innerOwnerStack; break; default: workUnitStore; } if (ownerStack) { let stack = ownerStack; if (error.stack) { const frames = []; for (const frame of error.stack.split('\n').slice(1)){ if (frame.includes('react_stack_bottom_frame')) { break; } frames.push(frame); } stack = '\n' + frames.join('\n') + stack; } error.stack = error.name + ': ' + error.message + stack; } } return error; } }), "[project]/node_modules/next/dist/esm/server/instrumentation/utils.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "getRevalidateReason", ()=>getRevalidateReason ]); function getRevalidateReason(params) { if (params.isOnDemandRevalidate) { return 'on-demand'; } if (params.isStaticGeneration) { return 'stale'; } return undefined; } }), "[project]/node_modules/next/dist/esm/server/lib/cache-control.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "getCacheControlHeader", ()=>getCacheControlHeader ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/lib/constants.js [app-route] (ecmascript)"); ; function getCacheControlHeader({ revalidate, expire }) { const swrHeader = typeof revalidate === 'number' && expire !== undefined && revalidate < expire ? `, stale-while-revalidate=${expire - revalidate}` : ''; if (revalidate === 0) { return 'private, no-cache, no-store, max-age=0, must-revalidate'; } else if (typeof revalidate === 'number') { return `s-maxage=${revalidate}${swrHeader}`; } return `s-maxage=${__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["CACHE_ONE_YEAR_SECONDS"]}${swrHeader}`; } }), "[project]/node_modules/next/dist/esm/server/lib/clone-response.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "cloneResponse", ()=>cloneResponse ]); const noop = ()=>{}; let registry; if (globalThis.FinalizationRegistry) { registry = new FinalizationRegistry((weakRef)=>{ const stream = weakRef.deref(); if (stream && !stream.locked) { stream.cancel('Response object has been garbage collected').then(noop); } }); } function cloneResponse(original) { // If the response has no body, then we can just return the original response // twice because it's immutable. if (!original.body) { return [ original, original ]; } const [body1, body2] = original.body.tee(); const cloned1 = new Response(body1, { status: original.status, statusText: original.statusText, headers: original.headers }); Object.defineProperty(cloned1, 'url', { value: original.url, // How the original response.url behaves configurable: true, enumerable: true, writable: false }); const cloned2 = new Response(body2, { status: original.status, statusText: original.statusText, headers: original.headers }); Object.defineProperty(cloned2, 'url', { value: original.url, // How the original response.url behaves configurable: true, enumerable: true, writable: false }); // The Fetch Standard allows users to skip consuming the response body by // relying on garbage collection to release connection resources. // https://github.com/nodejs/undici?tab=readme-ov-file#garbage-collection // // To cancel the stream you then need to cancel both resulting branches. // Teeing a stream will generally lock it for the duration, preventing other // readers from locking it. // https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/tee if (registry) { if (cloned1.body) { registry.register(cloned1, new WeakRef(cloned1.body)); } if (cloned2.body) { registry.register(cloned2, new WeakRef(cloned2.body)); } } return [ cloned1, cloned2 ]; } }), "[project]/node_modules/next/dist/esm/server/lib/dedupe-fetch.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "createDedupeFetch", ()=>createDedupeFetch ]); /** * Based on https://github.com/facebook/react/blob/d4e78c42a94be027b4dc7ed2659a5fddfbf9bd4e/packages/react/src/ReactFetch.js */ var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$rsc$2f$react$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$clone$2d$response$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/lib/clone-response.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$invariant$2d$error$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/invariant-error.js [app-route] (ecmascript)"); ; ; ; const simpleCacheKey = '["GET",[],null,"follow",null,null,null,null]' // generateCacheKey(new Request('https://blank')); ; // Headers that should not affect deduplication // traceparent and tracestate are used for distributed tracing and should not affect cache keys const headersToExcludeInCacheKey = new Set([ 'traceparent', 'tracestate' ]); function generateCacheKey(request) { // We pick the fields that goes into the key used to dedupe requests. // We don't include the `cache` field, because we end up using whatever // caching resulted from the first request. // Notably we currently don't consider non-standard (or future) options. // This might not be safe. TODO: warn for non-standard extensions differing. // IF YOU CHANGE THIS UPDATE THE simpleCacheKey ABOVE. const filteredHeaders = Array.from(request.headers.entries()).filter(([key])=>!headersToExcludeInCacheKey.has(key.toLowerCase())); return JSON.stringify([ request.method, filteredHeaders, request.mode, request.redirect, request.credentials, request.referrer, request.referrerPolicy, request.integrity ]); } function createDedupeFetch(originalFetch) { const getCacheEntries = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$rsc$2f$react$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["cache"]((url)=>[]); return function dedupeFetch(resource, options) { if (options && options.signal) { // If we're passed a signal, then we assume that // someone else controls the lifetime of this object and opts out of // caching. It's effectively the opt-out mechanism. // Ideally we should be able to check this on the Request but // it always gets initialized with its own signal so we don't // know if it's supposed to override - unless we also override the // Request constructor. return originalFetch(resource, options); } // Normalize the Request let url; let cacheKey; if (typeof resource === 'string' && !options) { // Fast path. cacheKey = simpleCacheKey; url = resource; } else { // Normalize the request. // if resource is not a string or a URL (its an instance of Request) // then do not instantiate a new Request but instead // reuse the request as to not disturb the body in the event it's a ReadableStream. const request = typeof resource === 'string' || resource instanceof URL ? new Request(resource, options) : resource; if (request.method !== 'GET' && request.method !== 'HEAD' || request.keepalive) { // We currently don't dedupe requests that might have side-effects. Those // have to be explicitly cached. We assume that the request doesn't have a // body if it's GET or HEAD. // keepalive gets treated the same as if you passed a custom cache signal. return originalFetch(resource, options); } cacheKey = generateCacheKey(request); url = request.url; } const cacheEntries = getCacheEntries(url); for(let i = 0, j = cacheEntries.length; i < j; i += 1){ const [key, promise] = cacheEntries[i]; if (key === cacheKey) { return promise.then(()=>{ const response = cacheEntries[i][2]; if (!response) throw Object.defineProperty(new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$invariant$2d$error$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["InvariantError"]('No cached response'), "__NEXT_ERROR_CODE", { value: "E579", enumerable: false, configurable: true }); // We're cloning the response using this utility because there exists // a bug in the undici library around response cloning. See the // following pull request for more details: // https://github.com/vercel/next.js/pull/73274 const [cloned1, cloned2] = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$clone$2d$response$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["cloneResponse"])(response); cacheEntries[i][2] = cloned2; return cloned1; }); } } // We pass the original arguments here in case normalizing the Request // doesn't include all the options in this environment. const promise = originalFetch(resource, options); const entry = [ cacheKey, promise, null ]; cacheEntries.push(entry); return promise.then((response)=>{ // We're cloning the response using this utility because there exists // a bug in the undici library around response cloning. See the // following pull request for more details: // https://github.com/vercel/next.js/pull/73274 const [cloned1, cloned2] = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$clone$2d$response$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["cloneResponse"])(response); entry[2] = cloned2; return cloned1; }); }; } }), "[project]/node_modules/next/dist/esm/server/lib/encode-cache-tag.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "encodeCacheTag", ()=>encodeCacheTag ]); /** * Percent-encode every character outside printable ASCII so a tag value can be * safely serialized as part of the `x-next-cache-tags` HTTP header. * * Node's `validateHeaderValue` rejects any code unit outside `\t\x20-\x7e`, so * a matched route path or user-supplied tag containing a non-ASCII character * (Hebrew, Arabic, Chinese, emoji, …) would otherwise throw `ERR_INVALID_CHAR` * and crash ISR on every affected request. * * This is applied at the public boundaries — tag construction * (`getImplicitTags`, `validateTags`) and invalidation input (`revalidatePath`, * `revalidateTag`, `updateTag`) — so storage, comparison, and the wire all see * the same canonical ASCII-safe form. * * The character class `[\t\x20-\x7e]` mirrors Node's `validHdrChars` table — * `\t` plus printable ASCII through `~`. Anything outside that is rejected * by `validateHeaderValue`, so we encode runs of those characters and leave * everything else (`,`, `/`, `%`, `[`, `]`, `_`, `-`, `\t`, …) byte-for-byte * unchanged. This preserves the comma-separated header format and the * dynamic-segment markers in derived tags (`_N_T_/[slug]/page`). * * Properties: * - Fast-path: input that already fits the validation class is returned * unchanged. This makes the encoder idempotent on already-encoded `%xx` * sequences. * - Matches *runs* of out-of-class code units so surrogate pairs (e.g. an * emoji) are handed to `encodeURIComponent` as a complete code point — a * per-code-unit regex would split the pair and throw `URIError`. */ const OUT_OF_CLASS_CHAR = /[^\t\x20-\x7e]/; const OUT_OF_CLASS_RUN = /[^\t\x20-\x7e]+/g; function encodeCacheTag(tag) { return OUT_OF_CLASS_CHAR.test(tag) ? tag.replace(OUT_OF_CLASS_RUN, (run)=>encodeURIComponent(run)) : tag; } }), "[project]/node_modules/next/dist/esm/server/lib/lru-cache.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "LRUCache", ()=>LRUCache ]); /** * Node in the doubly-linked list used for LRU tracking. * Each node represents a cache entry with bidirectional pointers. */ class LRUNode { constructor(key, data, size){ this.prev = null; this.next = null; this.key = key; this.data = data; this.size = size; } } /** * Sentinel node used for head/tail boundaries. * These nodes don't contain actual cache data but simplify list operations. */ class SentinelNode { constructor(){ this.prev = null; this.next = null; } } class LRUCache { constructor(maxSize, calculateSize, onEvict){ this.cache = new Map(); this.totalSize = 0; this.maxSize = maxSize; this.calculateSize = calculateSize; this.onEvict = onEvict; // Create sentinel nodes to simplify doubly-linked list operations // HEAD <-> TAIL (empty list) this.head = new SentinelNode(); this.tail = new SentinelNode(); this.head.next = this.tail; this.tail.prev = this.head; } /** * Adds a node immediately after the head (marks as most recently used). * Used when inserting new items or when an item is accessed. * PRECONDITION: node must be disconnected (prev/next should be null) */ addToHead(node) { node.prev = this.head; node.next = this.head.next; // head.next is always non-null (points to tail or another node) this.head.next.prev = node; this.head.next = node; } /** * Removes a node from its current position in the doubly-linked list. * Updates the prev/next pointers of adjacent nodes to maintain list integrity. * PRECONDITION: node must be connected (prev/next are non-null) */ removeNode(node) { // Connected nodes always have non-null prev/next node.prev.next = node.next; node.next.prev = node.prev; } /** * Moves an existing node to the head position (marks as most recently used). * This is the core LRU operation - accessed items become most recent. */ moveToHead(node) { this.removeNode(node); this.addToHead(node); } /** * Removes and returns the least recently used node (the one before tail). * This is called during eviction when the cache exceeds capacity. * PRECONDITION: cache is not empty (ensured by caller) */ removeTail() { const lastNode = this.tail.prev; // tail.prev is always non-null and always LRUNode when cache is not empty this.removeNode(lastNode); return lastNode; } /** * Sets a key-value pair in the cache. * If the key exists, updates the value and moves to head. * If new, adds at head and evicts from tail if necessary. * * Time Complexity: * - O(1) for uniform item sizes * - O(k) where k is the number of items evicted (can be O(N) for variable sizes) */ set(key, value) { const size = (this.calculateSize == null ? void 0 : this.calculateSize.call(this, value, key)) ?? 1; if (size <= 0) { throw Object.defineProperty(new Error(`LRUCache: calculateSize returned ${size}, but size must be > 0. ` + `Items with size 0 would never be evicted, causing unbounded cache growth.`), "__NEXT_ERROR_CODE", { value: "E1045", enumerable: false, configurable: true }); } if (size > this.maxSize) { console.warn('Single item size exceeds maxSize'); return false; } const existing = this.cache.get(key); if (existing) { // Update existing node: adjust size and move to head (most recent) existing.data = value; this.totalSize = this.totalSize - existing.size + size; existing.size = size; this.moveToHead(existing); } else { // Add new node at head (most recent position) const newNode = new LRUNode(key, value, size); this.cache.set(key, newNode); this.addToHead(newNode); this.totalSize += size; } // Evict least recently used items until under capacity while(this.totalSize > this.maxSize && this.cache.size > 0){ const tail = this.removeTail(); this.cache.delete(tail.key); this.totalSize -= tail.size; this.onEvict == null ? void 0 : this.onEvict.call(this, tail.key, tail.data); } return true; } /** * Checks if a key exists in the cache. * This is a pure query operation - does NOT update LRU order. * * Time Complexity: O(1) */ has(key) { return this.cache.has(key); } /** * Retrieves a value by key and marks it as most recently used. * Moving to head maintains the LRU property for future evictions. * * Time Complexity: O(1) */ get(key) { const node = this.cache.get(key); if (!node) return undefined; // Mark as most recently used by moving to head this.moveToHead(node); return node.data; } /** * Returns an iterator over the cache entries. The order is outputted in the * order of most recently used to least recently used. */ *[Symbol.iterator]() { let current = this.head.next; while(current && current !== this.tail){ // Between head and tail, current is always LRUNode const node = current; yield [ node.key, node.data ]; current = current.next; } } /** * Removes a specific key from the cache. * Updates both the hash map and doubly-linked list. * * Note: This is an explicit removal and does NOT trigger the `onEvict` * callback. Use this for intentional deletions where eviction tracking * is not needed. * * Time Complexity: O(1) */ remove(key) { const node = this.cache.get(key); if (!node) return; this.removeNode(node); this.cache.delete(key); this.totalSize -= node.size; } /** * Returns the number of items in the cache. */ get size() { return this.cache.size; } /** * Returns the current total size of all cached items. * This uses the custom size calculation if provided. */ get currentSize() { return this.totalSize; } } }), "[project]/node_modules/next/dist/esm/server/lib/patch-fetch.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "NEXT_PATCH_SYMBOL", ()=>NEXT_PATCH_SYMBOL, "createPatchedFetcher", ()=>createPatchedFetcher, "patchFetch", ()=>patchFetch, "validateRevalidate", ()=>validateRevalidate, "validateTags", ()=>validateTags ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/lib/trace/constants.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$request$2d$insights$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/lib/trace/request-insights.js [app-route] (ecmascript) "); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$span$2d$store$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/lib/trace/span-store.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$request$2d$insights$2d$identity$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/lib/trace/request-insights-identity.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$tracer$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/lib/trace/tracer.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/lib/constants.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$dynamic$2d$rendering$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/app-render/dynamic-rendering.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$dynamic$2d$rendering$2d$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/dynamic-rendering-utils.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$dedupe$2d$fetch$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/lib/dedupe-fetch.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$externals$5d2f$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$unit$2d$async$2d$storage$2e$external$2e$js__$5b$external$5d$__$28$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$unit$2d$async$2d$storage$2e$external$2e$js$2c$__cjs$29$__ = __turbopack_context__.i("[externals]/next/dist/server/app-render/work-unit-async-storage.external.js [external] (next/dist/server/app-render/work-unit-async-storage.external.js, cjs)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$response$2d$cache$2f$index$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/response-cache/index.js [app-route] (ecmascript) "); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$response$2d$cache$2f$types$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/response-cache/types.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$clone$2d$response$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/lib/clone-response.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$staged$2d$rendering$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/app-render/staged-rendering.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$encode$2d$cache$2d$tag$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/lib/encode-cache-tag.js [app-route] (ecmascript)"); ; ; ; ; ; ; ; ; ; ; ; ; ; const isEdgeRuntime = ("TURBOPACK compile-time value", "nodejs") === 'edge'; const NEXT_PATCH_SYMBOL = Symbol.for('next-patch'); function isFetchPatched() { return globalThis[NEXT_PATCH_SYMBOL] === true; } function validateRevalidate(revalidateVal, route) { try { let normalizedRevalidate = undefined; if (revalidateVal === false || revalidateVal === Infinity) { // Unlike Infinity, INFINITE_CACHE survives JSON serialization (e.g. in // the fetch cache). normalizedRevalidate = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["INFINITE_CACHE"]; } else if (typeof revalidateVal === 'number' && !isNaN(revalidateVal) && revalidateVal > -1) { normalizedRevalidate = revalidateVal; } else if (typeof revalidateVal !== 'undefined') { throw Object.defineProperty(new Error(`Invalid revalidate value "${revalidateVal}" on "${route}", must be a non-negative number or false`), "__NEXT_ERROR_CODE", { value: "E179", enumerable: false, configurable: true }); } return normalizedRevalidate; } catch (err) { // handle client component error from attempting to check revalidate value if (err instanceof Error && err.message.includes('Invalid revalidate')) { throw err; } return undefined; } } function validateTags(tags, description) { const validTags = []; const invalidTags = []; for(let i = 0; i < tags.length; i++){ const tag = tags[i]; if (typeof tag !== 'string') { invalidTags.push({ tag, reason: 'invalid type, must be a string' }); } else if (tag.length > __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["NEXT_CACHE_TAG_MAX_LENGTH"]) { invalidTags.push({ tag, reason: `exceeded max length of ${__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["NEXT_CACHE_TAG_MAX_LENGTH"]}` }); } else { // Encode so a non-ASCII tag can be safely serialized into the // `x-next-cache-tags` HTTP header without tripping Node's header // validation. Length is checked on the raw input above. validTags.push((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$encode$2d$cache$2d$tag$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["encodeCacheTag"])(tag)); } if (validTags.length > __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["NEXT_CACHE_TAG_MAX_ITEMS"]) { console.warn(`Warning: exceeded max tag count for ${description}, dropped tags:`, tags.slice(i).join(', ')); break; } } if (invalidTags.length > 0) { console.warn(`Warning: invalid tags passed to ${description}: `); for (const { tag, reason } of invalidTags){ console.log(`tag: "${tag}" ${reason}`); } } return validTags; } function trackFetchMetric(workStore, span, ctx) { const metric = { ...ctx, end: performance.timeOrigin + performance.now(), idx: workStore.nextFetchId || 0 }; span == null ? void 0 : span.setAttributes({ 'http.status_code': metric.status, 'next.fetch.idx': metric.idx, 'next.fetch.cache_status': metric.cacheStatus, 'next.fetch.cache_reason': metric.cacheReason }); if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$span$2d$store$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["isRequestInsightsEnabled"])()) { const requestInsightsIdentity = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$request$2d$insights$2d$identity$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["getRequestInsightsIdentity"])(); const requestInsightsRequestId = (requestInsightsIdentity == null ? void 0 : requestInsightsIdentity.requestId) ?? workStore.requestId; if (requestInsightsRequestId) { (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$request$2d$insights$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__["recordRequestInsightFetch"])({ requestId: requestInsightsRequestId, kind: requestInsightsIdentity == null ? void 0 : requestInsightsIdentity.kind, htmlRequestId: (requestInsightsIdentity == null ? void 0 : requestInsightsIdentity.htmlRequestId) ?? workStore.htmlRequestId, route: workStore.route }, { url: metric.url, method: metric.method, statusCode: metric.status, startTime: metric.start, durationMs: metric.end - metric.start, cacheStatus: metric.cacheStatus, cacheReason: metric.cacheReason, index: metric.idx }); } } if (!workStore.shouldTrackFetchMetrics) { return; } workStore.fetchMetrics ??= []; workStore.fetchMetrics.push(metric); } async function createCachedPrerenderResponse(res, cacheKey, incrementalCacheContext, incrementalCache, revalidate, handleUnlock) { // We are prerendering at build time or revalidate time with cacheComponents so we // need to buffer the response so we can guarantee it can be read in a // microtask. const bodyBuffer = await res.arrayBuffer(); const fetchedData = { headers: Object.fromEntries(res.headers.entries()), body: Buffer.from(bodyBuffer).toString('base64'), status: res.status, url: res.url }; // We can skip setting the serverComponentsHmrCache because we aren't in dev // mode. if (incrementalCacheContext) { await incrementalCache.set(cacheKey, { kind: __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$response$2d$cache$2f$types$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["CachedRouteKind"].FETCH, data: fetchedData, revalidate }, incrementalCacheContext); } await handleUnlock(); // We return a new Response to the caller. return new Response(bodyBuffer, { headers: res.headers, status: res.status, statusText: res.statusText }); } async function createCachedDynamicResponse(workStore, res, cacheKey, incrementalCacheContext, incrementalCache, serverComponentsHmrCache, revalidate, input, handleUnlock, signal) { // We're cloning the response using this utility because there exists a bug in // the undici library around response cloning. See the following pull request // for more details: https://github.com/vercel/next.js/pull/73274 const [cloned1, cloned2] = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$clone$2d$response$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["cloneResponse"])(res); // We are dynamically rendering including dev mode. We want to return the // response to the caller as soon as possible because it might stream over a // very long time. const cacheSetPromise = cloned1.arrayBuffer().then(async (arrayBuffer)=>{ const bodyBuffer = Buffer.from(arrayBuffer); const fetchedData = { headers: Object.fromEntries(cloned1.headers.entries()), body: bodyBuffer.toString('base64'), status: cloned1.status, url: cloned1.url }; serverComponentsHmrCache == null ? void 0 : serverComponentsHmrCache.set(cacheKey, fetchedData); if (incrementalCacheContext) { await incrementalCache.set(cacheKey, { kind: __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$response$2d$cache$2f$types$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["CachedRouteKind"].FETCH, data: fetchedData, revalidate }, incrementalCacheContext); } }).catch((error)=>{ // Don't warn if the request was aborted intentionally. if (!(signal == null ? void 0 : signal.aborted)) { console.warn(`Failed to set fetch cache`, input, error); } }).finally(handleUnlock); const pendingRevalidateKey = `cache-set-${cacheKey}`; const pendingRevalidates = workStore.pendingRevalidates ??= {}; let pendingRevalidatePromise = Promise.resolve(); if (pendingRevalidateKey in pendingRevalidates) { // There is already a pending revalidate entry that we need to await to // avoid race conditions. pendingRevalidatePromise = pendingRevalidates[pendingRevalidateKey]; } pendingRevalidates[pendingRevalidateKey] = pendingRevalidatePromise.then(()=>cacheSetPromise).finally(()=>{ // If the pending revalidate is not present in the store, then we have // nothing to delete. if (!(pendingRevalidates == null ? void 0 : pendingRevalidates[pendingRevalidateKey])) { return; } delete pendingRevalidates[pendingRevalidateKey]; }); return cloned2; } function createPatchedFetcher(originFetch, { workAsyncStorage, workUnitAsyncStorage }) { // Create the patched fetch function. const patched = async function fetch(input, init) { var _init_method, _init_next; let url; try { url = new URL(input instanceof Request ? input.url : input); url.username = ''; url.password = ''; } catch { // Error caused by malformed URL should be handled by native fetch url = undefined; } const fetchUrl = (url == null ? void 0 : url.href) ?? ''; const method = (init == null ? void 0 : (_init_method = init.method) == null ? void 0 : _init_method.toUpperCase()) || 'GET'; // Do create a new span trace for internal fetches in the // non-verbose mode. const isInternal = (init == null ? void 0 : (_init_next = init.next) == null ? void 0 : _init_next.internal) === true; const hideSpan = process.env.NEXT_OTEL_FETCH_DISABLED === '1'; // We don't track fetch metrics for internal fetches // so it's not critical that we have a start time, as it won't be recorded. // This is to workaround a flaky issue where performance APIs might // not be available and will require follow-up investigation. const fetchStart = isInternal ? undefined : performance.timeOrigin + performance.now(); const workStore = workAsyncStorage.getStore(); const workUnitStore = workUnitAsyncStorage.getStore(); let cacheSignal = workUnitStore ? (0, __TURBOPACK__imported__module__$5b$externals$5d2f$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$unit$2d$async$2d$storage$2e$external$2e$js__$5b$external$5d$__$28$next$2f$dist$2f$server$2f$app$2d$render$2f$work$2d$unit$2d$async$2d$storage$2e$external$2e$js$2c$__cjs$29$__["getCacheSignal"])(workUnitStore) : null; if (cacheSignal) { cacheSignal.beginRead(); } const result = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$tracer$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["getTracer"])().trace(isInternal ? __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["NextNodeServerSpan"].internalFetch : __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["AppRenderSpan"].fetch, { hideSpan, kind: __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$tracer$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["SpanKind"].CLIENT, spanName: [ 'fetch', method, fetchUrl ].filter(Boolean).join(' '), attributes: { 'http.url': fetchUrl, 'http.method': method, 'net.peer.name': url == null ? void 0 : url.hostname, 'net.peer.port': (url == null ? void 0 : url.port) || undefined } }, async (span)=>{ var _getRequestMeta; // If this is an internal fetch, we should not do any special treatment. if (isInternal) { return originFetch(input, init); } // If the workStore is not available, we can't do any // special treatment of fetch, therefore fallback to the original // fetch implementation. if (!workStore) { return originFetch(input, init); } // We should also fallback to the original fetch implementation if we // are in draft mode, it does not constitute a static generation. if (workStore.isDraftMode) { return originFetch(input, init); } const isRequestInput = input && typeof input === 'object' && typeof input.method === 'string'; // With `fetch(new Request(url), init)`, native fetch lets `init` // override the base Request. Merge them into a single effective Request // so cacheability, the cache key, and the upstream request all describe // the same thing. if (isRequestInput && init) { // `next` (revalidate/tags) is Next-specific and dropped by // `new Request`, so keep it on `init` and move the rest onto input. const { next, ...overrides } = init; input = new Request(input, overrides); init = next ? { next } : undefined; } const getRequestMeta = (field)=>{ // If request input is present but init is not, retrieve from input first. const value = init == null ? void 0 : init[field]; return value || (isRequestInput ? input[field] : null); }; let finalRevalidate = undefined; const getNextField = (field)=>{ var _init_next, _init_next1, _input_next; return typeof (init == null ? void 0 : (_init_next = init.next) == null ? void 0 : _init_next[field]) !== 'undefined' ? init == null ? void 0 : (_init_next1 = init.next) == null ? void 0 : _init_next1[field] : isRequestInput ? (_input_next = input.next) == null ? void 0 : _input_next[field] : undefined; }; // RequestInit doesn't keep extra fields e.g. next so it's // only available if init is used separate const originalFetchRevalidate = getNextField('revalidate'); let currentFetchRevalidate = originalFetchRevalidate; const tags = validateTags(getNextField('tags') || [], `fetch ${input.toString()}`); let revalidateStore; if (workUnitStore) { switch(workUnitStore.type){ case 'prerender': case 'prerender-runtime': // TODO: Stop accumulating tags in client prerender. (fallthrough) case 'prerender-client': case 'validation-client': case 'prerender-ppr': case 'prerender-legacy': case 'cache': case 'private-cache': revalidateStore = workUnitStore; break; case 'request': case 'unstable-cache': case 'generate-static-params': break; default: workUnitStore; } } if (revalidateStore) { if (Array.isArray(tags)) { // Collect tags onto parent caches or parent prerenders. const collectedTags = revalidateStore.tags ?? (revalidateStore.tags = []); for (const tag of tags){ if (!collectedTags.includes(tag)) { collectedTags.push(tag); } } } } const implicitTags = workUnitStore == null ? void 0 : workUnitStore.implicitTags; let pageFetchCacheMode = workStore.fetchCache; if (workUnitStore) { switch(workUnitStore.type){ case 'unstable-cache': // Inside unstable-cache we treat it the same as force-no-store on // the page. pageFetchCacheMode = 'force-no-store'; break; case 'prerender': case 'prerender-client': case 'validation-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'request': case 'cache': case 'private-cache': case 'generate-static-params': break; default: workUnitStore; } } const isUsingNoStore = !!workStore.isUnstableNoStore; let currentFetchCacheConfig = getRequestMeta('cache'); let cacheReason = ''; let cacheWarning; if (typeof currentFetchCacheConfig === 'string' && typeof currentFetchRevalidate !== 'undefined') { // If the revalidate value conflicts with the cache value, we should warn the user and unset the conflicting values. const isConflictingRevalidate = currentFetchCacheConfig === 'force-cache' && currentFetchRevalidate === 0 || // revalidate: >0 or revalidate: false and cache: no-store currentFetchCacheConfig === 'no-store' && (currentFetchRevalidate > 0 || currentFetchRevalidate === false); if (isConflictingRevalidate) { cacheWarning = `Specified "cache: ${currentFetchCacheConfig}" and "revalidate: ${currentFetchRevalidate}", only one should be specified.`; currentFetchCacheConfig = undefined; currentFetchRevalidate = undefined; } } const hasExplicitFetchCacheOptOut = currentFetchCacheConfig === 'no-cache' || currentFetchCacheConfig === 'no-store' || // the fetch isn't explicitly caching and the segment level cache config signals not to cache // note: `pageFetchCacheMode` is also set by being in an unstable_cache context. pageFetchCacheMode === 'force-no-store' || pageFetchCacheMode === 'only-no-store'; // If no explicit fetch cache mode is set, but dynamic = `force-dynamic` is set, // we shouldn't consider caching the fetch. This is because the `dynamic` cache // is considered a "top-level" cache mode, whereas something like `fetchCache` is more // fine-grained. Top-level modes are responsible for setting reasonable defaults for the // other configurations. const noFetchConfigAndForceDynamic = !pageFetchCacheMode && !currentFetchCacheConfig && !currentFetchRevalidate && workStore.forceDynamic; if (// which will signal the cache to not revalidate currentFetchCacheConfig === 'force-cache' && typeof currentFetchRevalidate === 'undefined') { currentFetchRevalidate = false; } else if (hasExplicitFetchCacheOptOut || noFetchConfigAndForceDynamic) { currentFetchRevalidate = 0; } if (currentFetchCacheConfig === 'no-cache' || currentFetchCacheConfig === 'no-store') { cacheReason = `cache: ${currentFetchCacheConfig}`; } finalRevalidate = validateRevalidate(currentFetchRevalidate, workStore.route); const _headers = getRequestMeta('headers'); const initHeaders = typeof (_headers == null ? void 0 : _headers.get) === 'function' ? _headers : new Headers(_headers || {}); const hasUnCacheableHeader = initHeaders.get('authorization') || initHeaders.get('cookie'); const isUnCacheableMethod = ![ 'get', 'head' ].includes(((_getRequestMeta = getRequestMeta('method')) == null ? void 0 : _getRequestMeta.toLowerCase()) || 'get'); /** * We automatically disable fetch caching under the following conditions: * - Fetch cache configs are not set. Specifically: * - A page fetch cache mode is not set (export const fetchCache=...) * - A fetch cache mode is not set in the fetch call (fetch(url, { cache: ... })) * or the fetch cache mode is set to 'default' * - A fetch revalidate value is not set in the fetch call (fetch(url, { revalidate: ... })) * - OR the fetch comes after a configuration that triggered dynamic rendering (e.g., reading cookies()) * and the fetch was considered uncacheable (e.g., POST method or has authorization headers) */ const hasNoExplicitCacheConfig = pageFetchCacheMode == undefined && // eslint-disable-next-line eqeqeq (currentFetchCacheConfig == undefined || // when considering whether to opt into the default "no-cache" fetch semantics, // a "default" cache config should be treated the same as no cache config currentFetchCacheConfig === 'default') && // eslint-disable-next-line eqeqeq currentFetchRevalidate == undefined; let autoNoCache = Boolean((hasUnCacheableHeader || isUnCacheableMethod) && (revalidateStore == null ? void 0 : revalidateStore.revalidate) === 0); let isImplicitBuildTimeCache = false; if (!autoNoCache && hasNoExplicitCacheConfig) { // We don't enable automatic no-cache behavior during build-time // prerendering so that we can still leverage the fetch cache between // export workers. if (workStore.isBuildTimePrerendering) { isImplicitBuildTimeCache = true; } else { autoNoCache = true; } } // If we have no cache config, and we're in Dynamic I/O prerendering, // it'll be a dynamic call. We don't have to issue that dynamic call. if (hasNoExplicitCacheConfig && workUnitStore !== undefined) { switch(workUnitStore.type){ case 'prerender': case 'prerender-runtime': // While we don't want to do caching in the client scope we know the // fetch will be dynamic for cacheComponents so we may as well avoid the // call here. (fallthrough) case 'prerender-client': if (cacheSignal) { cacheSignal.endRead(); cacheSignal = null; } return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$dynamic$2d$rendering$2d$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["makeDynamicHangingPromise"])(workUnitStore.renderSignal, workStore.route, 'fetch()'); case 'validation-client': break; case 'request': if (("TURBOPACK compile-time value", "development") === 'development' && workUnitStore.stagedRendering) { if (cacheSignal) { cacheSignal.endRead(); cacheSignal = null; } await workUnitStore.stagedRendering.waitForStage(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$staged$2d$rendering$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["RenderStage"].Dynamic); } break; case 'prerender-ppr': case 'prerender-legacy': case 'cache': case 'private-cache': case 'unstable-cache': case 'generate-static-params': break; default: workUnitStore; } } switch(pageFetchCacheMode){ case 'force-no-store': { cacheReason = 'fetchCache = force-no-store'; break; } case 'only-no-store': { if (currentFetchCacheConfig === 'force-cache' || typeof finalRevalidate !== 'undefined' && finalRevalidate > 0) { throw Object.defineProperty(new Error(`cache: 'force-cache' used on fetch for ${fetchUrl} with 'export const fetchCache = 'only-no-store'`), "__NEXT_ERROR_CODE", { value: "E448", enumerable: false, configurable: true }); } cacheReason = 'fetchCache = only-no-store'; break; } case 'only-cache': { if (currentFetchCacheConfig === 'no-store') { throw Object.defineProperty(new Error(`cache: 'no-store' used on fetch for ${fetchUrl} with 'export const fetchCache = 'only-cache'`), "__NEXT_ERROR_CODE", { value: "E521", enumerable: false, configurable: true }); } break; } case 'force-cache': { if (typeof currentFetchRevalidate === 'undefined' || currentFetchRevalidate === 0) { cacheReason = 'fetchCache = force-cache'; finalRevalidate = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["INFINITE_CACHE"]; } break; } case 'default-cache': case 'default-no-store': case 'auto': case undefined: break; default: pageFetchCacheMode; } if (typeof finalRevalidate === 'undefined') { if (pageFetchCacheMode === 'default-cache' && !isUsingNoStore) { finalRevalidate = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["INFINITE_CACHE"]; cacheReason = 'fetchCache = default-cache'; } else if (pageFetchCacheMode === 'default-no-store') { finalRevalidate = 0; cacheReason = 'fetchCache = default-no-store'; } else if (isUsingNoStore) { finalRevalidate = 0; cacheReason = 'noStore call'; } else if (autoNoCache) { finalRevalidate = 0; cacheReason = 'auto no cache'; } else { // TODO: should we consider this case an invariant? cacheReason = 'auto cache'; finalRevalidate = revalidateStore ? revalidateStore.revalidate : __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["INFINITE_CACHE"]; } } else if (!cacheReason) { cacheReason = `revalidate: ${finalRevalidate}`; } if (// `revalidate: 0` values !(workStore.forceStatic && finalRevalidate === 0) && // we don't consider autoNoCache to switch to dynamic for ISR !autoNoCache && // If the revalidate value isn't currently set or the value is less // than the current revalidate value, we should update the revalidate // value. revalidateStore && finalRevalidate < revalidateStore.revalidate) { // If we were setting the revalidate value to 0, we should try to // postpone instead first. if (finalRevalidate === 0) { if (workUnitStore) { switch(workUnitStore.type){ case 'prerender': case 'prerender-client': case 'prerender-runtime': // If we're in an instant validation, a dynamic fetch won't // have time to resolve during the validation prerender anyway, // so we leave it hanging. This can cause false negatives in shared parents, // but we accept that for now, because client data fetching is non-idiomatic. // eslint-disable-next-line no-fallthrough case 'validation-client': if (cacheSignal) { cacheSignal.endRead(); cacheSignal = null; } return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$dynamic$2d$rendering$2d$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["makeDynamicHangingPromise"])(workUnitStore.renderSignal, workStore.route, 'fetch()'); case 'request': if (("TURBOPACK compile-time value", "development") === 'development' && workUnitStore.stagedRendering) { if (cacheSignal) { cacheSignal.endRead(); cacheSignal = null; } await workUnitStore.stagedRendering.waitForStage(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$staged$2d$rendering$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["RenderStage"].Dynamic); } break; case 'prerender-ppr': case 'prerender-legacy': case 'cache': case 'private-cache': case 'unstable-cache': case 'generate-static-params': break; default: workUnitStore; } } (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$dynamic$2d$rendering$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["markCurrentScopeAsDynamic"])(workStore, workUnitStore, `revalidate: 0 fetch ${input} ${workStore.route}`); } // We only want to set the revalidate store's revalidate time if it // was explicitly set for the fetch call, i.e. // originalFetchRevalidate. if (revalidateStore && originalFetchRevalidate === finalRevalidate) { revalidateStore.revalidate = finalRevalidate; } } const isCacheableRevalidate = typeof finalRevalidate === 'number' && finalRevalidate > 0; let cacheKey; const { incrementalCache } = workStore; let isHmrRefresh = false; let serverComponentsHmrCache; if (workUnitStore) { switch(workUnitStore.type){ case 'request': case 'cache': case 'private-cache': isHmrRefresh = workUnitStore.isHmrRefresh ?? false; serverComponentsHmrCache = workUnitStore.serverComponentsHmrCache; break; case 'prerender': case 'prerender-client': case 'validation-client': case 'prerender-runtime': case 'prerender-ppr': case 'prerender-legacy': case 'unstable-cache': case 'generate-static-params': break; default: workUnitStore; } } if (incrementalCache && (isCacheableRevalidate || serverComponentsHmrCache)) { try { cacheKey = await incrementalCache.generateCacheKey(fetchUrl, isRequestInput ? input : init); } catch (cause) { console.error(`Failed to generate cache key for`, input, cause); } } const fetchIdx = workStore.nextFetchId ?? 1; workStore.nextFetchId = fetchIdx + 1; let handleUnlock = ()=>{}; const doOriginalFetch = async (isStale, cacheReasonOverride)=>{ const requestInputFields = [ 'cache', 'credentials', 'headers', 'integrity', 'keepalive', 'method', 'mode', 'redirect', 'referrer', 'referrerPolicy', 'window', 'duplex', // don't pass through signal when revalidating ...isStale ? [] : [ 'signal' ] ]; if (isRequestInput) { const reqInput = input; const reqOptions = { body: reqInput._ogBody || reqInput.body }; for (const field of requestInputFields){ // @ts-expect-error custom fields reqOptions[field] = reqInput[field]; } input = new Request(reqInput.url, reqOptions); } else if (init) { const { _ogBody, body, signal, ...otherInput } = init; init = { ...otherInput, body: _ogBody || body, signal: isStale ? undefined : signal }; } // add metadata to init without editing the original const clonedInit = { ...init, next: { ...init == null ? void 0 : init.next, fetchType: 'origin', fetchIdx } }; return originFetch(input, clonedInit).then(async (res)=>{ if (!isStale && fetchStart) { trackFetchMetric(workStore, span, { start: fetchStart, url: fetchUrl, cacheReason: cacheReasonOverride || cacheReason, cacheStatus: finalRevalidate === 0 || cacheReasonOverride ? 'skip' : 'miss', cacheWarning, status: res.status, method: clonedInit.method || 'GET' }); } if (res.status === 200 && incrementalCache && cacheKey && (isCacheableRevalidate || serverComponentsHmrCache)) { const normalizedRevalidate = finalRevalidate >= __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["INFINITE_CACHE"] ? __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["CACHE_ONE_YEAR_SECONDS"] : finalRevalidate; const incrementalCacheConfig = isCacheableRevalidate ? { fetchCache: true, fetchUrl, fetchIdx, tags, isImplicitBuildTimeCache } : undefined; switch(workUnitStore == null ? void 0 : workUnitStore.type){ case 'prerender': case 'prerender-client': case 'validation-client': case 'prerender-runtime': return createCachedPrerenderResponse(res, cacheKey, incrementalCacheConfig, incrementalCache, normalizedRevalidate, handleUnlock); case 'request': if (("TURBOPACK compile-time value", "development") === 'development' && workUnitStore.stagedRendering && workUnitStore.cacheSignal && isCacheableRevalidate) { // We're filling caches for a staged render with an // explicit cache config, so we need to wait for the // response to finish instead of streaming. For HMR-only // caching (no explicit revalidate), we fall through to // createCachedDynamicResponse which handles streaming // and abort gracefully. return createCachedPrerenderResponse(res, cacheKey, incrementalCacheConfig, incrementalCache, normalizedRevalidate, handleUnlock); } // fallthrough case 'prerender-ppr': case 'prerender-legacy': case 'cache': case 'private-cache': case 'unstable-cache': case 'generate-static-params': case undefined: return createCachedDynamicResponse(workStore, res, cacheKey, incrementalCacheConfig, incrementalCache, serverComponentsHmrCache, normalizedRevalidate, input, handleUnlock, getRequestMeta('signal')); default: workUnitStore; } } // we had response that we determined shouldn't be cached so we return it // and don't cache it. This also needs to unlock the cache lock we acquired. await handleUnlock(); return res; }).catch((error)=>{ handleUnlock(); throw error; }); }; let cacheReasonOverride; let isForegroundRevalidate = false; let isHmrRefreshCache = false; if (cacheKey && incrementalCache) { let cachedFetchData; if (isHmrRefresh && serverComponentsHmrCache) { cachedFetchData = serverComponentsHmrCache.get(cacheKey); isHmrRefreshCache = true; } if (isCacheableRevalidate && !cachedFetchData) { handleUnlock = await incrementalCache.lock(cacheKey); const entry = workStore.isOnDemandRevalidate ? null : await incrementalCache.get(cacheKey, { kind: __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$response$2d$cache$2f$types$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["IncrementalCacheKind"].FETCH, revalidate: finalRevalidate, fetchUrl, fetchIdx, tags, softTags: implicitTags == null ? void 0 : implicitTags.tags }); if (hasNoExplicitCacheConfig && workUnitStore) { switch(workUnitStore.type){ case 'prerender': case 'prerender-client': case 'validation-client': case 'prerender-runtime': // We sometimes use the cache to dedupe fetches that do not // specify a cache configuration. In these cases we want to // make sure we still exclude them from prerenders if // cacheComponents is on so we introduce an artificial task boundary // here. await getTimeoutBoundary(); break; case 'request': if (("TURBOPACK compile-time value", "development") === 'development' && workUnitStore.stagedRendering) { await workUnitStore.stagedRendering.waitForStage(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$staged$2d$rendering$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["RenderStage"].Dynamic); } break; case 'prerender-ppr': case 'prerender-legacy': case 'cache': case 'private-cache': case 'unstable-cache': case 'generate-static-params': break; default: workUnitStore; } } if (entry) { await handleUnlock(); } else { // in dev, incremental cache response will be null in case the browser adds `cache-control: no-cache` in the request headers // TODO: it seems like we also hit this after revalidates in dev? cacheReasonOverride = 'cache-control: no-cache (hard refresh)'; } if ((entry == null ? void 0 : entry.value) && entry.value.kind === __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$response$2d$cache$2f$types$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["CachedRouteKind"].FETCH) { // when stale and is revalidating we wait for fresh data // so the revalidated entry has the updated data if (workStore.isStaticGeneration && entry.isStale) { isForegroundRevalidate = true; } else { if (entry.isStale) { workStore.pendingRevalidates ??= {}; if (!workStore.pendingRevalidates[cacheKey]) { const pendingRevalidate = doOriginalFetch(true).then(async (response)=>({ body: await response.arrayBuffer(), headers: response.headers, status: response.status, statusText: response.statusText })).finally(()=>{ workStore.pendingRevalidates ??= {}; delete workStore.pendingRevalidates[cacheKey || '']; }); // Attach the empty catch here so we don't get a "unhandled // promise rejection" warning. pendingRevalidate.catch(console.error); workStore.pendingRevalidates[cacheKey] = pendingRevalidate; } } cachedFetchData = entry.value.data; } } } if (cachedFetchData) { if (fetchStart) { trackFetchMetric(workStore, span, { start: fetchStart, url: fetchUrl, cacheReason, cacheStatus: isHmrRefreshCache ? 'hmr' : 'hit', cacheWarning, status: cachedFetchData.status || 200, method: (init == null ? void 0 : init.method) || 'GET' }); } const response = new Response(Buffer.from(cachedFetchData.body, 'base64'), { headers: cachedFetchData.headers, status: cachedFetchData.status }); Object.defineProperty(response, 'url', { value: cachedFetchData.url }); return response; } } if ((workStore.isStaticGeneration || ("TURBOPACK compile-time value", "development") === 'development' && ("TURBOPACK compile-time value", false) && workUnitStore && // eslint-disable-next-line no-restricted-syntax workUnitStore.type === 'request' && workUnitStore.stagedRendering) && init && typeof init === 'object') { const { cache } = init; // Delete `cache` property as Cloudflare Workers will throw an error if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable ; if (cache === 'no-store') { // If enabled, we should bail out of static generation. if (workUnitStore) { switch(workUnitStore.type){ case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'validation-client': if (cacheSignal) { cacheSignal.endRead(); cacheSignal = null; } return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$dynamic$2d$rendering$2d$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["makeDynamicHangingPromise"])(workUnitStore.renderSignal, workStore.route, 'fetch()'); case 'request': if (("TURBOPACK compile-time value", "development") === 'development' && workUnitStore.stagedRendering) { if (cacheSignal) { cacheSignal.endRead(); cacheSignal = null; } await workUnitStore.stagedRendering.waitForStage(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$staged$2d$rendering$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["RenderStage"].Dynamic); } break; case 'prerender-ppr': case 'prerender-legacy': case 'cache': case 'private-cache': case 'unstable-cache': case 'generate-static-params': break; default: workUnitStore; } } (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$dynamic$2d$rendering$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["markCurrentScopeAsDynamic"])(workStore, workUnitStore, `no-store fetch ${input} ${workStore.route}`); } const hasNextConfig = 'next' in init; const { next = {} } = init; if (typeof next.revalidate === 'number' && revalidateStore && next.revalidate < revalidateStore.revalidate) { if (next.revalidate === 0) { // If enabled, we should bail out of static generation. if (workUnitStore) { switch(workUnitStore.type){ case 'prerender': case 'prerender-client': case 'prerender-runtime': case 'validation-client': return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$dynamic$2d$rendering$2d$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["makeDynamicHangingPromise"])(workUnitStore.renderSignal, workStore.route, 'fetch()'); case 'request': if (("TURBOPACK compile-time value", "development") === 'development' && workUnitStore.stagedRendering) { await workUnitStore.stagedRendering.waitForStage(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$staged$2d$rendering$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["RenderStage"].Dynamic); } break; case 'cache': case 'private-cache': case 'unstable-cache': case 'prerender-legacy': case 'prerender-ppr': case 'generate-static-params': break; default: workUnitStore; } } (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$dynamic$2d$rendering$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["markCurrentScopeAsDynamic"])(workStore, workUnitStore, `revalidate: 0 fetch ${input} ${workStore.route}`); } if (!workStore.forceStatic || next.revalidate !== 0) { revalidateStore.revalidate = next.revalidate; } } if (hasNextConfig) delete init.next; } // if we are revalidating the whole page via time or on-demand and // the fetch cache entry is stale we should still de-dupe the // origin hit if it's a cache-able entry if (cacheKey && isForegroundRevalidate) { const pendingRevalidateKey = cacheKey; workStore.pendingRevalidates ??= {}; let pendingRevalidate = workStore.pendingRevalidates[pendingRevalidateKey]; if (pendingRevalidate) { const revalidatedResult = await pendingRevalidate; return new Response(revalidatedResult.body, { headers: revalidatedResult.headers, status: revalidatedResult.status, statusText: revalidatedResult.statusText }); } // We used to just resolve the Response and clone it however for // static generation with cacheComponents we need the response to be able to // be resolved in a microtask and cloning the response will never have // a body that can resolve in a microtask in node (as observed through // experimentation) So instead we await the body and then when it is // available we construct manually cloned Response objects with the // body as an ArrayBuffer. This will be resolvable in a microtask // making it compatible with cacheComponents. const pendingResponse = doOriginalFetch(true, cacheReasonOverride) // We're cloning the response using this utility because there // exists a bug in the undici library around response cloning. // See the following pull request for more details: // https://github.com/vercel/next.js/pull/73274 .then(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$clone$2d$response$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["cloneResponse"]); pendingRevalidate = pendingResponse.then(async (responses)=>{ const response = responses[0]; return { body: await response.arrayBuffer(), headers: response.headers, status: response.status, statusText: response.statusText }; }).finally(()=>{ var _workStore_pendingRevalidates; // If the pending revalidate is not present in the store, then // we have nothing to delete. if (!((_workStore_pendingRevalidates = workStore.pendingRevalidates) == null ? void 0 : _workStore_pendingRevalidates[pendingRevalidateKey])) { return; } delete workStore.pendingRevalidates[pendingRevalidateKey]; }); // Attach the empty catch here so we don't get a "unhandled promise // rejection" warning pendingRevalidate.catch(()=>{}); workStore.pendingRevalidates[pendingRevalidateKey] = pendingRevalidate; return pendingResponse.then((responses)=>responses[1]); } else { return doOriginalFetch(false, cacheReasonOverride); } }); if (cacheSignal) { try { return await result; } finally{ if (cacheSignal) { cacheSignal.endRead(); } } } return result; }; // Attach the necessary properties to the patched fetch function. // We don't use this to determine if the fetch function has been patched, // but for external consumers to determine if the fetch function has been // patched. patched.__nextPatched = true; patched.__nextGetStaticStore = ()=>workAsyncStorage; patched._nextOriginalFetch = originFetch; globalThis[NEXT_PATCH_SYMBOL] = true; // Assign the function name also as a name property, so that it's preserved // even when mangling is enabled. Object.defineProperty(patched, 'name', { value: 'fetch', writable: false }); return patched; } function patchFetch(options) { // If we've already patched fetch, we should not patch it again. if (isFetchPatched()) return; // Grab the original fetch function. We'll attach this so we can use it in // the patched fetch function. const original = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$dedupe$2d$fetch$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["createDedupeFetch"])(globalThis.fetch); // Set the global fetch to the patched fetch. globalThis.fetch = createPatchedFetcher(original, options); } let currentTimeoutBoundary = null; function getTimeoutBoundary() { if (!currentTimeoutBoundary) { currentTimeoutBoundary = new Promise((r)=>{ setTimeout(()=>{ currentTimeoutBoundary = null; r(); }, 0); }); } return currentTimeoutBoundary; } }), "[project]/node_modules/next/dist/esm/server/lib/trace/constants.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "AppRenderSpan", ()=>AppRenderSpan, "AppRouteRouteHandlersSpan", ()=>AppRouteRouteHandlersSpan, "BaseServerSpan", ()=>BaseServerSpan, "LoadComponentsSpan", ()=>LoadComponentsSpan, "LogSpanAllowList", ()=>LogSpanAllowList, "MiddlewareSpan", ()=>MiddlewareSpan, "NextNodeServerSpan", ()=>NextNodeServerSpan, "NextServerSpan", ()=>NextServerSpan, "NextVanillaSpanAllowlist", ()=>NextVanillaSpanAllowlist, "NodeSpan", ()=>NodeSpan, "RenderSpan", ()=>RenderSpan, "ResolveMetadataSpan", ()=>ResolveMetadataSpan, "RouterSpan", ()=>RouterSpan, "StartServerSpan", ()=>StartServerSpan ]); /** * Contains predefined constants for the trace span name in next/server. * * Currently, next/server/tracer is internal implementation only for tracking * next.js's implementation only with known span names defined here. **/ // eslint typescript has a bug with TS enums var BaseServerSpan = /*#__PURE__*/ function(BaseServerSpan) { BaseServerSpan["handleRequest"] = "BaseServer.handleRequest"; BaseServerSpan["run"] = "BaseServer.run"; BaseServerSpan["pipe"] = "BaseServer.pipe"; BaseServerSpan["getStaticHTML"] = "BaseServer.getStaticHTML"; BaseServerSpan["render"] = "BaseServer.render"; BaseServerSpan["renderToResponseWithComponents"] = "BaseServer.renderToResponseWithComponents"; BaseServerSpan["renderToResponse"] = "BaseServer.renderToResponse"; BaseServerSpan["renderToHTML"] = "BaseServer.renderToHTML"; BaseServerSpan["renderError"] = "BaseServer.renderError"; BaseServerSpan["renderErrorToResponse"] = "BaseServer.renderErrorToResponse"; BaseServerSpan["renderErrorToHTML"] = "BaseServer.renderErrorToHTML"; BaseServerSpan["render404"] = "BaseServer.render404"; return BaseServerSpan; }(BaseServerSpan || {}); var LoadComponentsSpan = /*#__PURE__*/ function(LoadComponentsSpan) { LoadComponentsSpan["loadDefaultErrorComponents"] = "LoadComponents.loadDefaultErrorComponents"; LoadComponentsSpan["loadComponents"] = "LoadComponents.loadComponents"; return LoadComponentsSpan; }(LoadComponentsSpan || {}); var NextServerSpan = /*#__PURE__*/ function(NextServerSpan) { NextServerSpan["getRequestHandler"] = "NextServer.getRequestHandler"; NextServerSpan["getRequestHandlerWithMetadata"] = "NextServer.getRequestHandlerWithMetadata"; NextServerSpan["getServer"] = "NextServer.getServer"; NextServerSpan["getServerRequestHandler"] = "NextServer.getServerRequestHandler"; NextServerSpan["createServer"] = "createServer.createServer"; return NextServerSpan; }(NextServerSpan || {}); var NextNodeServerSpan = /*#__PURE__*/ function(NextNodeServerSpan) { NextNodeServerSpan["compression"] = "NextNodeServer.compression"; NextNodeServerSpan["getBuildId"] = "NextNodeServer.getBuildId"; NextNodeServerSpan["createComponentTree"] = "NextNodeServer.createComponentTree"; NextNodeServerSpan["clientComponentLoading"] = "NextNodeServer.clientComponentLoading"; NextNodeServerSpan["getLayoutOrPageModule"] = "NextNodeServer.getLayoutOrPageModule"; NextNodeServerSpan["generateStaticRoutes"] = "NextNodeServer.generateStaticRoutes"; NextNodeServerSpan["generateFsStaticRoutes"] = "NextNodeServer.generateFsStaticRoutes"; NextNodeServerSpan["generatePublicRoutes"] = "NextNodeServer.generatePublicRoutes"; NextNodeServerSpan["generateImageRoutes"] = "NextNodeServer.generateImageRoutes.route"; NextNodeServerSpan["sendRenderResult"] = "NextNodeServer.sendRenderResult"; NextNodeServerSpan["proxyRequest"] = "NextNodeServer.proxyRequest"; NextNodeServerSpan["runApi"] = "NextNodeServer.runApi"; NextNodeServerSpan["render"] = "NextNodeServer.render"; NextNodeServerSpan["renderHTML"] = "NextNodeServer.renderHTML"; NextNodeServerSpan["imageOptimizer"] = "NextNodeServer.imageOptimizer"; NextNodeServerSpan["getPagePath"] = "NextNodeServer.getPagePath"; NextNodeServerSpan["getRoutesManifest"] = "NextNodeServer.getRoutesManifest"; NextNodeServerSpan["findPageComponents"] = "NextNodeServer.findPageComponents"; NextNodeServerSpan["getFontManifest"] = "NextNodeServer.getFontManifest"; NextNodeServerSpan["getServerComponentManifest"] = "NextNodeServer.getServerComponentManifest"; NextNodeServerSpan["getRequestHandler"] = "NextNodeServer.getRequestHandler"; NextNodeServerSpan["renderToHTML"] = "NextNodeServer.renderToHTML"; NextNodeServerSpan["renderError"] = "NextNodeServer.renderError"; NextNodeServerSpan["renderErrorToHTML"] = "NextNodeServer.renderErrorToHTML"; NextNodeServerSpan["render404"] = "NextNodeServer.render404"; NextNodeServerSpan["startResponse"] = "NextNodeServer.startResponse"; // nested inner span, does not require parent scope name NextNodeServerSpan["route"] = "route"; NextNodeServerSpan["onProxyReq"] = "onProxyReq"; NextNodeServerSpan["apiResolver"] = "apiResolver"; NextNodeServerSpan["internalFetch"] = "internalFetch"; return NextNodeServerSpan; }(NextNodeServerSpan || {}); var StartServerSpan = /*#__PURE__*/ function(StartServerSpan) { StartServerSpan["startServer"] = "startServer.startServer"; return StartServerSpan; }(StartServerSpan || {}); var RenderSpan = /*#__PURE__*/ function(RenderSpan) { RenderSpan["getServerSideProps"] = "Render.getServerSideProps"; RenderSpan["getStaticProps"] = "Render.getStaticProps"; RenderSpan["renderToString"] = "Render.renderToString"; RenderSpan["renderDocument"] = "Render.renderDocument"; RenderSpan["createBodyResult"] = "Render.createBodyResult"; return RenderSpan; }(RenderSpan || {}); var AppRenderSpan = /*#__PURE__*/ function(AppRenderSpan) { AppRenderSpan["renderToString"] = "AppRender.renderToString"; AppRenderSpan["renderToReadableStream"] = "AppRender.renderToReadableStream"; AppRenderSpan["getBodyResult"] = "AppRender.getBodyResult"; AppRenderSpan["fetch"] = "AppRender.fetch"; AppRenderSpan["waitShellReady"] = "AppRender.waitShellReady"; AppRenderSpan["renderToNodeFizzStream"] = "AppRender.renderToNodeFizzStream"; AppRenderSpan["instantInsights"] = "AppRender.instantInsights"; AppRenderSpan["instantInsightsPrepareValidation"] = "AppRender.instantInsights.prepareValidation"; AppRenderSpan["instantInsightsRunValidation"] = "AppRender.instantInsights.runValidation"; return AppRenderSpan; }(AppRenderSpan || {}); var RouterSpan = /*#__PURE__*/ function(RouterSpan) { RouterSpan["executeRoute"] = "Router.executeRoute"; return RouterSpan; }(RouterSpan || {}); var NodeSpan = /*#__PURE__*/ function(NodeSpan) { NodeSpan["runHandler"] = "Node.runHandler"; return NodeSpan; }(NodeSpan || {}); var AppRouteRouteHandlersSpan = /*#__PURE__*/ function(AppRouteRouteHandlersSpan) { AppRouteRouteHandlersSpan["runHandler"] = "AppRouteRouteHandlers.runHandler"; return AppRouteRouteHandlersSpan; }(AppRouteRouteHandlersSpan || {}); var ResolveMetadataSpan = /*#__PURE__*/ function(ResolveMetadataSpan) { ResolveMetadataSpan["generateMetadata"] = "ResolveMetadata.generateMetadata"; ResolveMetadataSpan["generateViewport"] = "ResolveMetadata.generateViewport"; return ResolveMetadataSpan; }(ResolveMetadataSpan || {}); var MiddlewareSpan = /*#__PURE__*/ function(MiddlewareSpan) { MiddlewareSpan["execute"] = "Middleware.execute"; return MiddlewareSpan; }(MiddlewareSpan || {}); const NextVanillaSpanAllowlist = new Set([ "Middleware.execute", "BaseServer.handleRequest", "Render.getServerSideProps", "Render.getStaticProps", "AppRender.fetch", "AppRender.getBodyResult", "Render.renderDocument", "Node.runHandler", "AppRouteRouteHandlers.runHandler", "ResolveMetadata.generateMetadata", "ResolveMetadata.generateViewport", "NextNodeServer.createComponentTree", "NextNodeServer.findPageComponents", "NextNodeServer.getLayoutOrPageModule", "NextNodeServer.startResponse", "NextNodeServer.clientComponentLoading" ]); const LogSpanAllowList = new Set([ "NextNodeServer.findPageComponents", "NextNodeServer.createComponentTree", "NextNodeServer.clientComponentLoading" ]); ; }), "[project]/node_modules/next/dist/esm/server/lib/trace/request-insights-identity.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "getRequestInsightsIdentity", ()=>getRequestInsightsIdentity, "runWithRequestInsightsIdentity", ()=>runWithRequestInsightsIdentity ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$async$2d$local$2d$storage$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/app-render/async-local-storage.js [app-route] (ecmascript)"); ; // This storage covers the part of BaseServer request handling that runs before // App Render creates workAsyncStorage. Once available, workStore remains the // primary identity source for locally recorded spans. const REQUEST_INSIGHTS_IDENTITY_STORAGE_KEY = Symbol.for('@next/request-insights-identity-storage'); function getRequestInsightsIdentityStorage() { const globalStore = globalThis; return globalStore[REQUEST_INSIGHTS_IDENTITY_STORAGE_KEY] ??= (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$app$2d$render$2f$async$2d$local$2d$storage$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["createAsyncLocalStorage"])(); } function runWithRequestInsightsIdentity(identity, fn) { return getRequestInsightsIdentityStorage().run(identity, fn); } function getRequestInsightsIdentity() { return getRequestInsightsIdentityStorage().getStore(); } }), "[project]/node_modules/next/dist/esm/server/lib/trace/request-insights.js [app-route] (ecmascript) ", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "clearRequestInsightsForTest", ()=>clearRequestInsightsForTest, "getRequestInsightsSnapshot", ()=>getRequestInsightsSnapshot, "recordRequestInsightFetch", ()=>recordRequestInsightFetch, "recordRequestInsightSpan", ()=>recordRequestInsightSpan, "subscribeRequestInsights", ()=>subscribeRequestInsights ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$request$2d$insights$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/request-insights.js [app-route] (ecmascript)"); ; ; const MAX_REQUEST_INSIGHTS = 100; const REQUEST_INSIGHTS_STORE_KEY = Symbol.for('@next/request-insights-store'); const CLIENT_COMPONENT_LOADING_SPAN_TYPE = 'NextNodeServer.clientComponentLoading'; const REDACTED_VALUE = 'redacted'; const SAFE_SPAN_ATTRIBUTE_KEYS = new Set([ 'http.method', 'http.route', 'http.status_code', 'http.url', 'net.peer.name', 'net.peer.port', 'next.fetch.cache_reason', 'next.fetch.cache_status', 'next.fetch.idx', 'next.route', 'next.rsc', 'next.segment', 'next.span_category', 'next.span_name', 'next.span_type' ]); const SENSITIVE_PARAM_NAME_RE = /(?:^|[_-])(?:access[_-]?token|api[_-]?key|auth|authorization|code|cookie|credential|id[_-]?token|jwt|key|password|secret|session|signature|sig|token)(?:$|[_-])/i; class InMemoryRequestInsightsStore { recordSpan(span) { var _span_attributes; if (!span.requestId) { return; } const insight = this.getOrCreateRequest({ requestId: span.requestId, kind: span.requestInsightKind, htmlRequestId: span.htmlRequestId, route: span.route, url: span.url }, span.startTime ?? span.timestamp); const spanStartTime = span.startTime ?? span.timestamp; insight.htmlRequestId = span.htmlRequestId ?? insight.htmlRequestId; insight.route = insight.route ?? span.route; insight.url = insight.url ?? sanitizeUrl(span.url); this.updateTiming(insight, spanStartTime, span.durationMs, ((_span_attributes = span.attributes) == null ? void 0 : _span_attributes['next.span_type']) === 'BaseServer.handleRequest'); insight.status = insight.status === 'error' || span.status === 'error' ? 'error' : span.status === 'ok' ? 'ok' : insight.status; insight.spans.push({ name: span.name, startTime: spanStartTime, durationMs: span.durationMs, status: span.status, traceId: span.traceId, spanId: span.spanId, parentSpanId: span.parentSpanId, attributes: sanitizeSpanAttributes(span.attributes), links: sanitizeSpanLinks(span.links), events: sanitizeSpanEvents(span.events), error: span.error }); const fetch = getFetchInsight(span); if (fetch) { this.recordFetchForInsight(insight, fetch); } this.notify(insight); } recordFetch(identity, fetch) { if (!identity.requestId) { return; } const fetchStartTime = fetch.startTime ?? getCurrentTimestamp(); const insight = this.getOrCreateRequest(identity, fetchStartTime); this.updateTiming(insight, fetchStartTime, fetch.durationMs, false); this.recordFetchForInsight(insight, sanitizeFetchInsight(fetch)); this.notify(insight); } getSnapshot() { return { requests: this.requestOrder.map((insightKey)=>this.requests.get(insightKey)).filter((request)=>request !== undefined) }; } subscribe(listener) { this.listeners.add(listener); return ()=>{ this.listeners.delete(listener); }; } clear() { this.requests.clear(); this.requestTimings.clear(); this.requestOrder.length = 0; } updateTiming(insight, startTime, durationMs, isRequestSpan) { const insightKey = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$request$2d$insights$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["getRequestInsightKey"])(insight); if (isRequestSpan && durationMs !== undefined) { const requestTiming = { startTime, durationMs }; this.requestTimings.set(insightKey, requestTiming); insight.startTime = requestTiming.startTime; insight.durationMs = requestTiming.durationMs; return; } const requestTiming = this.requestTimings.get(insightKey); if (requestTiming) { insight.startTime = requestTiming.startTime; insight.durationMs = requestTiming.durationMs; return; } const endTime = startTime + (durationMs ?? 0); const requestEndTime = insight.startTime + (insight.durationMs ?? 0); insight.startTime = Math.min(insight.startTime, startTime); insight.durationMs = Math.max(requestEndTime, endTime) - insight.startTime; } notify(insight) { for (const listener of this.listeners){ listener(insight); } } getOrCreateRequest(identity, startTime) { const requestId = identity.requestId; const insightKey = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$request$2d$insights$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["getRequestInsightKey"])({ requestId, kind: identity.kind }); let insight = this.requests.get(insightKey); if (!insight) { insight = { requestId, kind: (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$request$2d$insights$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["getRequestInsightKind"])(identity), htmlRequestId: identity.htmlRequestId ?? requestId, route: identity.route, url: sanitizeUrl(identity.url), startTime, status: 'pending', spans: [], fetches: [] }; this.requests.set(insightKey, insight); this.requestOrder.push(insightKey); this.trim(); } insight.htmlRequestId = identity.htmlRequestId ?? insight.htmlRequestId; insight.route = insight.route ?? identity.route; insight.url = insight.url ?? sanitizeUrl(identity.url); insight.startTime = Math.min(insight.startTime, startTime); return insight; } recordFetchForInsight(insight, fetch) { if (insight.fetches.some((existingFetch)=>existingFetch.url === fetch.url && (existingFetch.index !== undefined && fetch.index !== undefined ? existingFetch.index === fetch.index : existingFetch.startTime === fetch.startTime))) { return; } insight.fetches.push(sanitizeFetchInsight(fetch)); } trim() { while(this.requestOrder.length > MAX_REQUEST_INSIGHTS){ const insightKey = this.requestOrder.shift(); if (insightKey) { this.requests.delete(insightKey); this.requestTimings.delete(insightKey); } } } constructor(){ this.requests = new Map(); this.requestTimings = new Map(); this.requestOrder = []; this.listeners = new Set(); } } function recordRequestInsightSpan(span) { var _span_attributes; if (((_span_attributes = span.attributes) == null ? void 0 : _span_attributes['next.span_type']) === CLIENT_COMPONENT_LOADING_SPAN_TYPE) { return; } getRequestInsightsStore().recordSpan(span); } function recordRequestInsightFetch(identity, fetch) { getRequestInsightsStore().recordFetch(identity, fetch); } function getRequestInsightsSnapshot() { return getRequestInsightsStore().getSnapshot(); } function subscribeRequestInsights(listener) { return getRequestInsightsStore().subscribe(listener); } function clearRequestInsightsForTest() { getRequestInsightsStore().clear(); } function getRequestInsightsStore() { const globalStore = globalThis; return globalStore[REQUEST_INSIGHTS_STORE_KEY] ??= new InMemoryRequestInsightsStore(); } function getFetchInsight(span) { const attributes = span.attributes; if (!attributes || attributes['next.span_type'] !== 'AppRender.fetch') { return null; } return { url: sanitizeUrl(getStringAttribute(attributes['http.url']) ?? span.url), method: getStringAttribute(attributes['http.method']), statusCode: getNumberAttribute(attributes['http.status_code']), startTime: span.startTime ?? span.timestamp, durationMs: span.durationMs, cacheStatus: getStringAttribute(attributes['next.fetch.cache_status']), cacheReason: getStringAttribute(attributes['next.fetch.cache_reason']), index: getNumberAttribute(attributes['next.fetch.idx']) }; } function sanitizeFetchInsight(fetch) { return { ...fetch, url: sanitizeUrl(fetch.url) }; } function getCurrentTimestamp() { return performance.timeOrigin + performance.now(); } function sanitizeSpanAttributes(attributes) { if (!attributes) { return undefined; } const sanitized = {}; for (const [key, value] of Object.entries(attributes)){ if (!SAFE_SPAN_ATTRIBUTE_KEYS.has(key)) { continue; } sanitized[key] = key === 'http.url' ? sanitizeUrlAttribute(value) : value; } return Object.keys(sanitized).length > 0 ? sanitized : undefined; } function sanitizeSpanEvents(events) { return events == null ? void 0 : events.map((event)=>({ ...event, attributes: sanitizeSpanAttributes(event.attributes) })); } function sanitizeSpanLinks(links) { return links == null ? void 0 : links.map((link)=>({ ...link, attributes: sanitizeSpanAttributes(link.attributes) })); } function sanitizeUrlAttribute(value) { return typeof value === 'string' ? sanitizeUrl(value) ?? '' : value; } function sanitizeUrl(value) { if (!value) { return value; } const isRelativeUrl = value.startsWith('/'); try { const url = isRelativeUrl ? new URL(value, 'http://n') : new URL(value); url.username = ''; url.password = ''; for (const name of Array.from(url.searchParams.keys())){ if (SENSITIVE_PARAM_NAME_RE.test(name)) { url.searchParams.set(name, REDACTED_VALUE); } } return isRelativeUrl ? `${url.pathname}${url.search}${url.hash}` : url.href; } catch { return value; } } function getStringAttribute(value) { return typeof value === 'string' ? value : undefined; } function getNumberAttribute(value) { return typeof value === 'number' ? value : undefined; } }), "[project]/node_modules/next/dist/esm/server/lib/trace/span-store.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "isLocalSpanRecordingEnabled", ()=>isLocalSpanRecordingEnabled, "isRequestInsightsEnabled", ()=>isRequestInsightsEnabled, "recordSpan", ()=>recordSpan, "setSpanRecorderForTest", ()=>setSpanRecorderForTest ]); let spanRecorderForTest; function recordSpan(record) { if (!isLocalSpanRecordingEnabled()) { return; } const spanRecord = { timestamp: getCurrentTimestamp(), ...record }; spanRecorderForTest == null ? void 0 : spanRecorderForTest(spanRecord); if (isRequestInsightsEnabled() && spanRecord.requestId) //TURBOPACK unreachable ; } function setSpanRecorderForTest(recorder) { spanRecorderForTest = recorder; } function isLocalSpanRecordingEnabled() { if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable ; return spanRecorderForTest !== undefined || isRequestInsightsEnabled(); } function isRequestInsightsEnabled() { if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable ; const value = ("TURBOPACK compile-time value", false); return isEnabledEnvValue(value); } function isEnabledEnvValue(value) { return value === '1' || value === 'true' || value === true; } function getCurrentTimestamp() { return performance.timeOrigin + performance.now(); } }), "[project]/node_modules/next/dist/esm/server/lib/trace/tracer.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "BubbledError", ()=>BubbledError, "SpanKind", ()=>SpanKind, "SpanStatusCode", ()=>SpanStatusCode, "getTracer", ()=>getTracer, "isBubbledError", ()=>isBubbledError ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/lib/trace/constants.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$is$2d$thenable$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/is-thenable.js [app-route] (ecmascript)"); ; ; const NEXT_OTEL_PERFORMANCE_PREFIX = process.env.NEXT_OTEL_PERFORMANCE_PREFIX; const LOCAL_SPAN_RECORDER_KEY = Symbol.for('@next/local-span-recorder'); let api; function getLocalSpanRecorder() { if ("TURBOPACK compile-time truthy", 1) { return globalThis[LOCAL_SPAN_RECORDER_KEY]; } else //TURBOPACK unreachable ; } // we want to allow users to use their own version of @opentelemetry/api if they // want to, so we try to require it first, and if it fails we fall back to the // version that is bundled with Next.js // this is because @opentelemetry/api has to be synced with the version of // @opentelemetry/tracing that is used, and we don't want to force users to use // the version that is bundled with Next.js. // the API is ~stable, so this should be fine if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable ; else { try { api = __turbopack_context__.r("[externals]/next/dist/compiled/@opentelemetry/api [external] (next/dist/compiled/@opentelemetry/api, cjs)"); } catch (err) { api = __turbopack_context__.r("[project]/node_modules/next/dist/compiled/@opentelemetry/api/index.js [app-route] (ecmascript)"); } } const { context, propagation, trace, SpanStatusCode, SpanKind, ROOT_CONTEXT } = api; class BubbledError extends Error { constructor(bubble, result){ super(), this.bubble = bubble, this.result = result; } } function isBubbledError(error) { if (typeof error !== 'object' || error === null) return false; return error instanceof BubbledError; } const closeSpanWithError = (span, error)=>{ if (isBubbledError(error) && error.bubble) { span.setAttribute('next.bubble', true); } else { if (error) { span.recordException(error); span.setAttribute('error.type', error.name); } span.setStatus({ code: SpanStatusCode.ERROR, message: error == null ? void 0 : error.message }); } span.end(); }; /** we use this map to propagate attributes from nested spans to the top span */ const rootSpanAttributesStore = new Map(); const rootSpanIdKey = api.createContextKey('next.rootSpanId'); let lastSpanId = 0; const getSpanId = ()=>lastSpanId++; const clientTraceDataSetter = { set (carrier, key, value) { carrier.push({ key, value }); } }; class NextTracerImpl { /** * Returns an instance to the trace with configured name. * Since wrap / trace can be defined in any place prior to actual trace subscriber initialization, * This should be lazily evaluated. */ getTracerInstance() { return trace.getTracer('next.js', '0.0.1'); } isOpenTelemetryEnabled() { var _tracerProvider_getDelegate_constructor, _tracerProvider_getDelegate; const activeSpan = trace.getSpan(context.active()); if (activeSpan == null ? void 0 : activeSpan.isRecording()) { return true; } const tracerProvider = trace.getTracerProvider(); if (!('getDelegate' in tracerProvider)) { return true; } return (tracerProvider.getDelegate == null ? void 0 : (_tracerProvider_getDelegate = tracerProvider.getDelegate.call(tracerProvider)) == null ? void 0 : (_tracerProvider_getDelegate_constructor = _tracerProvider_getDelegate.constructor) == null ? void 0 : _tracerProvider_getDelegate_constructor.name) !== 'NoopTracerProvider'; } getContext() { return context; } getTracePropagationData() { const activeContext = context.active(); const entries = []; propagation.inject(activeContext, entries, clientTraceDataSetter); return entries; } getActiveScopeSpan() { const localSpanRecorder = getLocalSpanRecorder(); const activeLocalSpan = localSpanRecorder == null ? void 0 : localSpanRecorder.getActiveLocalSpan(); if (activeLocalSpan && (localSpanRecorder == null ? void 0 : localSpanRecorder.isOpenTelemetryIsolatedSpan(activeLocalSpan))) { return activeLocalSpan; } const activeSpan = trace.getSpan(context.active()); if (activeSpan || !("TURBOPACK compile-time value", "1")) { return activeSpan; } return activeLocalSpan; } /** * Run `fn` with the active span cleared, so spans created inside become new * roots (or parent to incoming propagated context). Used for in-process * Node.js middleware so its span is a sibling of the request span, matching * edge middleware which runs in a detached sandbox. */ runWithDetachedContext(fn) { if (!NEXT_OTEL_PERFORMANCE_PREFIX && !this.isOpenTelemetryEnabled()) { return fn(); } return context.with(ROOT_CONTEXT, fn); } withPropagatedContext(carrier, fn, getter, force = false) { const activeContext = context.active(); if (!NEXT_OTEL_PERFORMANCE_PREFIX && !this.isOpenTelemetryEnabled() && !trace.getSpanContext(activeContext)) { return fn(); } if (force) { const remoteContext = propagation.extract(ROOT_CONTEXT, carrier, getter); if (trace.getSpanContext(remoteContext)) { return context.with(remoteContext, fn); } // Preserve the current active span while still merging any extracted // baggage/context values from the carrier. const mergedContext = propagation.extract(activeContext, carrier, getter); return context.with(mergedContext, fn); } if (trace.getSpanContext(activeContext)) { // Active span is already set, too late to propagate. return fn(); } const remoteContext = propagation.extract(activeContext, carrier, getter); return context.with(remoteContext, fn); } trace(...args) { const [type, fnOrOptions, fnOrEmpty] = args; const tracingEnabled = Boolean(NEXT_OTEL_PERFORMANCE_PREFIX) || this.isOpenTelemetryEnabled(); const localSpanRecorder = getLocalSpanRecorder(); const localSpanRecordingEnabled = (localSpanRecorder == null ? void 0 : localSpanRecorder.isLocalSpanRecordingEnabled()) ?? false; if (!tracingEnabled && !localSpanRecordingEnabled) { return typeof fnOrOptions === 'function' ? fnOrOptions() : fnOrEmpty(); } // coerce options form overload const { fn, options } = typeof fnOrOptions === 'function' ? { fn: fnOrOptions, options: {} } : { fn: fnOrEmpty, options: { ...fnOrOptions } }; const spanName = options.spanName ?? type; const parentSpan = options.parentSpan ?? this.getActiveScopeSpan(); const isolatedParentSpan = parentSpan && (localSpanRecorder == null ? void 0 : localSpanRecorder.isOpenTelemetryIsolatedSpan(parentSpan)) ? parentSpan : undefined; const shouldDelegateSpan = !isolatedParentSpan && (__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["NextVanillaSpanAllowlist"].has(type) || process.env.NEXT_OTEL_VERBOSE === '1'); const shouldTraceSpan = shouldDelegateSpan || ((localSpanRecorder == null ? void 0 : localSpanRecorder.isRequestInsightsEnabled()) ?? false); if (!shouldTraceSpan || options.hideSpan) { return fn(); } // Trying to get active scoped span to assign parent. If option specifies parent span manually, will try to use it. let spanContext = isolatedParentSpan ? context.active() : this.getSpanContext(parentSpan); if (!spanContext) { spanContext = (context == null ? void 0 : context.active()) ?? ROOT_CONTEXT; } // Check if there's already a root span in the store for this trace // We are intentionally not checking whether there is an active context // from outside of nextjs to ensure that we can provide the same level // of telemetry when using a custom server const existingRootSpanId = spanContext.getValue(rootSpanIdKey); const isRootSpan = typeof existingRootSpanId !== 'number' || !rootSpanAttributesStore.has(existingRootSpanId); const spanId = getSpanId(); options.attributes = { 'next.span_category': 'nextjs', 'next.span_name': spanName, 'next.span_type': type, ...options.attributes }; return context.with(spanContext.setValue(rootSpanIdKey, spanId), ()=>this.runWithActiveSpan(spanName, options, spanContext, tracingEnabled && shouldDelegateSpan, localSpanRecordingEnabled, isolatedParentSpan, (span)=>{ let startTime; if (NEXT_OTEL_PERFORMANCE_PREFIX && type && __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["LogSpanAllowList"].has(type)) { startTime = 'performance' in globalThis && 'measure' in performance ? globalThis.performance.now() : undefined; } let cleanedUp = false; const onCleanup = ()=>{ if (cleanedUp) return; cleanedUp = true; rootSpanAttributesStore.delete(spanId); if (startTime) { performance.measure(`${NEXT_OTEL_PERFORMANCE_PREFIX}:next-${(type.split('.').pop() || '').replace(/[A-Z]/g, (match)=>'-' + match.toLowerCase())}`, { start: startTime, end: performance.now() }); } }; if (isRootSpan) { rootSpanAttributesStore.set(spanId, new Map(Object.entries(options.attributes ?? {}))); } if (fn.length > 1) { try { return fn(span, (err)=>{ if (err) { closeSpanWithError(span, err); } else { span.end(); } }); } catch (err) { closeSpanWithError(span, err); throw err; } finally{ onCleanup(); } } try { const result = fn(span); if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$is$2d$thenable$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["isThenable"])(result)) { // If there's error make sure it throws return result.then((res)=>{ span.end(); // Need to pass down the promise result, // it could be react stream response with error { error, stream } return res; }).catch((err)=>{ closeSpanWithError(span, err); throw err; }).finally(onCleanup); } else { span.end(); onCleanup(); } return result; } catch (err) { closeSpanWithError(span, err); onCleanup(); throw err; } })); } runWithActiveSpan(spanName, options, parentContext, tracingEnabled, localSpanRecordingEnabled, isolatedParentSpan, fn) { if (tracingEnabled) { return this.getTracerInstance().startActiveSpan(spanName, options, (span)=>fn(localSpanRecordingEnabled ? this.createLocalRecordingSpan(spanName, options, parentContext, span, isolatedParentSpan) : span)); } const span = this.createLocalRecordingSpan(spanName, options, parentContext, undefined, isolatedParentSpan); const localSpanRecorder = getLocalSpanRecorder(); return localSpanRecorder.withLocalSpan(span, ()=>localSpanRecorder.isOpenTelemetryIsolatedSpan(span) ? fn(span) : context.with(trace.setSpan(context.active(), span), fn, undefined, span)); } createLocalRecordingSpan(name, options, parentContext, delegateSpan, isolatedParentSpan) { const parentSpanContext = (isolatedParentSpan == null ? void 0 : isolatedParentSpan.spanContext()) ?? trace.getSpanContext(parentContext); const delegateSpanContext = delegateSpan == null ? void 0 : delegateSpan.spanContext(); return getLocalSpanRecorder().createLocalSpan({ name, attributes: options.attributes, links: options.links, startTime: options.startTime, delegateSpan, traceId: (delegateSpanContext == null ? void 0 : delegateSpanContext.traceId) ?? (parentSpanContext == null ? void 0 : parentSpanContext.traceId), spanId: delegateSpanContext == null ? void 0 : delegateSpanContext.spanId, parentSpanId: parentSpanContext == null ? void 0 : parentSpanContext.spanId, isolateOpenTelemetry: isolatedParentSpan !== undefined }); } wrap(...args) { const tracer = this; const [name, options, fn] = args.length === 3 ? args : [ args[0], {}, args[1] ]; if (!__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["NextVanillaSpanAllowlist"].has(name) && process.env.NEXT_OTEL_VERBOSE !== '1' && !("TURBOPACK compile-time value", "1")) //TURBOPACK unreachable ; return function() { let optionsObj = options; if (typeof optionsObj === 'function' && typeof fn === 'function') { optionsObj = optionsObj.apply(this, arguments); } const lastArgId = arguments.length - 1; const cb = arguments[lastArgId]; if (typeof cb === 'function') { const scopeBoundCb = tracer.getContext().bind(context.active(), cb); return tracer.trace(name, optionsObj, (_span, done)=>{ arguments[lastArgId] = function(err) { done == null ? void 0 : done(err); return scopeBoundCb.apply(this, arguments); }; return fn.apply(this, arguments); }); } else { return tracer.trace(name, optionsObj, ()=>fn.apply(this, arguments)); } }; } startSpan(...args) { const [type, passedOptions] = args; const options = passedOptions ? { ...passedOptions, attributes: { 'next.span_category': 'nextjs', ...passedOptions.attributes } } : { attributes: { 'next.span_category': 'nextjs' } }; const localSpanRecorder = getLocalSpanRecorder(); const parentSpan = options.parentSpan ?? this.getActiveScopeSpan(); const isolatedParentSpan = parentSpan && (localSpanRecorder == null ? void 0 : localSpanRecorder.isOpenTelemetryIsolatedSpan(parentSpan)) ? parentSpan : undefined; const parentContext = (isolatedParentSpan ? undefined : this.getSpanContext(parentSpan)) ?? context.active(); const localSpanRecordingEnabled = (localSpanRecorder == null ? void 0 : localSpanRecorder.isLocalSpanRecordingEnabled()) ?? false; if (!localSpanRecordingEnabled) { return this.getTracerInstance().startSpan(type, options, parentContext); } const delegateSpan = !isolatedParentSpan && this.isOpenTelemetryEnabled() ? this.getTracerInstance().startSpan(type, options, parentContext) : undefined; return this.createLocalRecordingSpan(type, options, parentContext, delegateSpan, isolatedParentSpan); } getSpanContext(parentSpan) { const spanContext = parentSpan ? trace.setSpan(context.active(), parentSpan) : undefined; return spanContext; } getRootSpanAttributes() { const spanId = context.active().getValue(rootSpanIdKey); return rootSpanAttributesStore.get(spanId); } setRootSpanAttribute(key, value) { const spanId = context.active().getValue(rootSpanIdKey); const attributes = rootSpanAttributesStore.get(spanId); if (attributes && !attributes.has(key)) { attributes.set(key, value); } if ("TURBOPACK compile-time truthy", 1) { var _getLocalSpanRecorder; const localSpan = (_getLocalSpanRecorder = getLocalSpanRecorder()) == null ? void 0 : _getLocalSpanRecorder.getActiveLocalSpan(); if (localSpan) { localSpan.setAttribute(key, value); } } } withSpan(span, fn) { const recorder = getLocalSpanRecorder(); if (recorder == null ? void 0 : recorder.isLocalRecordingSpan(span)) { return recorder.withLocalSpan(span, ()=>recorder.isOpenTelemetryIsolatedSpan(span) ? fn() : context.with(trace.setSpan(context.active(), span), fn)); } return context.with(trace.setSpan(context.active(), span), fn); } } const getTracer = (()=>{ const tracer = new NextTracerImpl(); return ()=>tracer; })(); ; }), "[project]/node_modules/next/dist/esm/server/pipe-readable.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "isAbortError", ()=>isAbortError, "pipeNodeReadableToNodeResponse", ()=>pipeNodeReadableToNodeResponse, "pipeToNodeResponse", ()=>pipeToNodeResponse ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$spec$2d$extension$2f$adapters$2f$next$2d$request$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/web/spec-extension/adapters/next-request.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$detached$2d$promise$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/lib/detached-promise.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$tracer$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/lib/trace/tracer.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/lib/trace/constants.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$client$2d$component$2d$renderer$2d$logger$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/client-component-renderer-logger.js [app-route] (ecmascript)"); ; ; ; ; ; function isAbortError(e) { return (e == null ? void 0 : e.name) === 'AbortError' || (e == null ? void 0 : e.name) === __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$spec$2d$extension$2f$adapters$2f$next$2d$request$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ResponseAbortedName"]; } const HAS_CLIENT_COMPONENT_METRICS_ENABLED = 'performance' in globalThis && process.env.NEXT_OTEL_PERFORMANCE_PREFIX; function createWriterFromResponse(res, waitUntilForEnd) { let started = false; // Create a promise that will resolve once the response has drained. See // https://nodejs.org/api/stream.html#stream_event_drain let drained = new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$detached$2d$promise$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["DetachedPromise"](); function onDrain() { drained.resolve(); } res.on('drain', onDrain); // If the finish event fires, it means we shouldn't block and wait for the // drain event. res.once('close', ()=>{ res.off('drain', onDrain); drained.resolve(); }); // Create a promise that will resolve once the response has finished. See // https://nodejs.org/api/http.html#event-finish_1 const finished = new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$detached$2d$promise$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["DetachedPromise"](); res.once('finish', ()=>{ finished.resolve(); }); // Create a writable stream that will write to the response. return new WritableStream({ write: async (chunk)=>{ // You'd think we'd want to use `start` instead of placing this in `write` // but this ensures that we don't actually flush the headers until we've // started writing chunks. if (!started) { started = true; if (HAS_CLIENT_COMPONENT_METRICS_ENABLED) { const metrics = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$client$2d$component$2d$renderer$2d$logger$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["getClientComponentLoaderMetrics"])(); if (metrics) { performance.measure(`${process.env.NEXT_OTEL_PERFORMANCE_PREFIX}:next-client-component-loading`, { start: metrics.clientComponentLoadStart, end: metrics.clientComponentLoadStart + metrics.clientComponentLoadTimes }); } } res.flushHeaders(); (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$tracer$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["getTracer"])().trace(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["NextNodeServerSpan"].startResponse, { spanName: 'start response' }, ()=>undefined); } try { const ok = res.write(chunk); // Added by the `compression` middleware, this is a function that will // flush the partially-compressed response to the client. if ('flush' in res && typeof res.flush === 'function') { res.flush(); } // If the write returns false, it means there's some backpressure, so // wait until it's streamed before continuing. if (!ok) { await drained.promise; // Reset the drained promise so that we can wait for the next drain event. drained = new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$detached$2d$promise$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["DetachedPromise"](); } } catch (err) { res.end(); throw Object.defineProperty(new Error('failed to write chunk to response', { cause: err }), "__NEXT_ERROR_CODE", { value: "E321", enumerable: false, configurable: true }); } }, abort: (err)=>{ if (res.writableFinished) return; res.destroy(err); }, close: async ()=>{ // if a waitUntil promise was passed, wait for it to resolve before // ending the response. if (waitUntilForEnd) { await waitUntilForEnd; } if (res.writableFinished) return; res.end(); return finished.promise; } }); } async function pipeToNodeResponse(readable, res, waitUntilForEnd) { try { // If the response has already errored, then just return now. const { errored, destroyed } = res; if (errored || destroyed) return; // Create a new AbortController so that we can abort the readable if the // client disconnects. const controller = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$spec$2d$extension$2f$adapters$2f$next$2d$request$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["createAbortController"])(res); const writer = createWriterFromResponse(res, waitUntilForEnd); await readable.pipeTo(writer, { signal: controller.signal }); } catch (err) { // If this isn't related to an abort error, re-throw it. if (isAbortError(err)) return; throw Object.defineProperty(new Error('failed to pipe response', { cause: err }), "__NEXT_ERROR_CODE", { value: "E180", enumerable: false, configurable: true }); } } async function pipeNodeReadableToNodeResponse(readable, res, waitUntilForEnd) { try { const { errored, destroyed } = res; if (errored || destroyed) return; let started = false; const finished = new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$detached$2d$promise$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["DetachedPromise"](); res.once('close', ()=>{ readable.destroy(); finished.resolve(); }); readable.on('data', (chunk)=>{ if (!started) { started = true; if ('performance' in globalThis && process.env.NEXT_OTEL_PERFORMANCE_PREFIX) { const metrics = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$client$2d$component$2d$renderer$2d$logger$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["getClientComponentLoaderMetrics"])(); if (metrics) { performance.measure(`${process.env.NEXT_OTEL_PERFORMANCE_PREFIX}:next-client-component-loading`, { start: metrics.clientComponentLoadStart, end: metrics.clientComponentLoadStart + metrics.clientComponentLoadTimes }); } } res.flushHeaders(); (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$tracer$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["getTracer"])().trace(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["NextNodeServerSpan"].startResponse, { spanName: 'start response' }, ()=>undefined); } const ok = res.write(chunk); if ('flush' in res && typeof res.flush === 'function') { res.flush(); } if (!ok) { readable.pause(); res.once('drain', ()=>{ readable.resume(); }); } }); readable.on('end', async ()=>{ if (waitUntilForEnd) { await waitUntilForEnd; } if (!res.writableFinished) { res.end(); } finished.resolve(); }); readable.on('error', (err)=>{ if (isAbortError(err)) { finished.resolve(); return; } res.destroy(err); finished.resolve(); }); await finished.promise; } catch (err) { if (isAbortError(err)) return; throw Object.defineProperty(new Error('failed to pipe response', { cause: err }), "__NEXT_ERROR_CODE", { value: "E180", enumerable: false, configurable: true }); } } }), "[project]/node_modules/next/dist/esm/server/render-result.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "default", ()=>RenderResult ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$node$2d$web$2d$streams$2d$helper$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/stream-utils/node-web-streams-helper.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$pipe$2d$readable$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/pipe-readable.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$invariant$2d$error$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/invariant-error.js [app-route] (ecmascript)"); ; ; ; function isNodeReadable(value) { return value !== null && typeof value === 'object' && typeof value.pipe === 'function' && typeof value.on === 'function' && !(value instanceof ReadableStream); } class RenderResult { static #_ = /** * A render result that represents an empty response. This is used to * represent a response that was not found or was already sent. */ this.EMPTY = new RenderResult(null, { metadata: {}, contentType: null }); /** * Creates a new RenderResult instance from a static response. * * @param value the static response value * @param contentType the content type of the response * @returns a new RenderResult instance */ static fromStatic(value, contentType) { return new RenderResult(value, { metadata: {}, contentType }); } constructor(response, { contentType, waitUntil, metadata }){ this.response = response; this.contentType = contentType; this.metadata = metadata; this.waitUntil = waitUntil; } assignMetadata(metadata) { Object.assign(this.metadata, metadata); } /** * Returns true if the response is null. It can be null if the response was * not found or was already sent. */ get isNull() { return this.response === null; } /** * Returns false if the response is a string. It can be a string if the page * was prerendered. If it's not, then it was generated dynamically. */ get isDynamic() { return typeof this.response !== 'string'; } toUnchunkedString(stream = false) { if (this.response === null) { // If the response is null, return an empty string. This behavior is // intentional as we're now providing the `RenderResult.EMPTY` value. return ''; } if (typeof this.response !== 'string') { if (!stream) { throw Object.defineProperty(new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$invariant$2d$error$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["InvariantError"]('dynamic responses cannot be unchunked. This is a bug in Next.js'), "__NEXT_ERROR_CODE", { value: "E732", enumerable: false, configurable: true }); } return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$node$2d$web$2d$streams$2d$helper$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["streamToString"])(this.readable); } return this.response; } /** * Returns a readable stream of the response. */ get readable() { if (this.response === null) { // If the response is null, return an empty stream. This behavior is // intentional as we're now providing the `RenderResult.EMPTY` value. return new ReadableStream({ start (controller) { controller.close(); } }); } if (typeof this.response === 'string') { return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$node$2d$web$2d$streams$2d$helper$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["streamFromString"])(this.response); } if (Buffer.isBuffer(this.response)) { return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$node$2d$web$2d$streams$2d$helper$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["streamFromBuffer"])(this.response); } // If the response is an array of streams, then chain them together. if (Array.isArray(this.response)) { return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$node$2d$web$2d$streams$2d$helper$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["chainStreams"])(...this.response); } if (isNodeReadable(this.response)) { if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable ; else { let Readable; if ("TURBOPACK compile-time truthy", 1) { Readable = __turbopack_context__.r("[externals]/node:stream [external] (node:stream, cjs)").Readable; } else //TURBOPACK unreachable ; return Readable.toWeb(this.response); } } return this.response; } /** * Coerces the response to an array of streams. This will convert the response * to an array of streams if it is not already one. * * @returns An array of streams */ coerce() { if (this.response === null) { // If the response is null, return an empty stream. This behavior is // intentional as we're now providing the `RenderResult.EMPTY` value. return []; } if (typeof this.response === 'string') { return [ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$node$2d$web$2d$streams$2d$helper$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["streamFromString"])(this.response) ]; } else if (Array.isArray(this.response)) { return this.response; } else if (Buffer.isBuffer(this.response)) { return [ (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$node$2d$web$2d$streams$2d$helper$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["streamFromBuffer"])(this.response) ]; } else if (isNodeReadable(this.response)) { if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable ; else { let Readable; if ("TURBOPACK compile-time truthy", 1) { Readable = __turbopack_context__.r("[externals]/node:stream [external] (node:stream, cjs)").Readable; } else //TURBOPACK unreachable ; return [ Readable.toWeb(this.response) ]; } } else { return [ this.response ]; } } /** * Pipes the response through a transform stream. This converts the response * to a single readable stream (chaining if needed) and pipes it through the * provided transform. * * @param transform The transform stream to pipe through */ pipeThrough(transform) { this.response = this.readable.pipeThrough(transform); } /** * Unshifts a new stream to the response. This will convert the response to an * array of streams if it is not already one and will add the new stream to * the start of the array. When this response is piped, all of the streams * will be piped one after the other. * * @param readable The new stream to unshift */ unshift(readable) { // Coerce the response to an array of streams. this.response = this.coerce(); // Add the new stream to the start of the array. this.response.unshift(readable); } /** * Chains a new stream to the response. This will convert the response to an * array of streams if it is not already one and will add the new stream to * the end. When this response is piped, all of the streams will be piped * one after the other. * * @param readable The new stream to chain */ push(readable) { // Coerce the response to an array of streams. this.response = this.coerce(); // Add the new stream to the end of the array. this.response.push(readable); } /** * Pipes the response to a writable stream. This will close/cancel the * writable stream if an error is encountered. If this doesn't throw, then * the writable stream will be closed or aborted. * * @param writable Writable stream to pipe the response to */ async pipeTo(writable) { try { await this.readable.pipeTo(writable, { // We want to close the writable stream ourselves so that we can wait // for the waitUntil promise to resolve before closing it. If an error // is encountered, we'll abort the writable stream if we swallowed the // error. preventClose: true }); // If there is a waitUntil promise, wait for it to resolve before // closing the writable stream. if (this.waitUntil) await this.waitUntil; // Close the writable stream. await writable.close(); } catch (err) { // If this is an abort error, we should abort the writable stream (as we // took ownership of it when we started piping). We don't need to re-throw // because we handled the error. if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$pipe$2d$readable$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["isAbortError"])(err)) { // Abort the writable stream if an error is encountered. await writable.abort(err); return; } // We're not aborting the writer here as when this method throws it's not // clear as to how so the caller should assume it's their responsibility // to clean up the writer. throw err; } } /** * Pipes the response to a node response. This will close/cancel the node * response if an error is encountered. * * @param res */ async pipeToNodeResponse(res) { if (this.response !== null && typeof this.response !== 'string' && !Buffer.isBuffer(this.response) && !Array.isArray(this.response) && isNodeReadable(this.response)) { await (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$pipe$2d$readable$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["pipeNodeReadableToNodeResponse"])(this.response, res, this.waitUntil); return; } await (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$pipe$2d$readable$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["pipeToNodeResponse"])(this.readable, res, this.waitUntil); } } }), "[project]/node_modules/next/dist/esm/server/request-meta.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; // FIXME: (wyattjoh) this is a temporary solution to allow us to pass data between bundled modules __turbopack_context__.s([ "NEXT_REQUEST_META", ()=>NEXT_REQUEST_META, "addRequestMeta", ()=>addRequestMeta, "getRequestMeta", ()=>getRequestMeta, "removeRequestMeta", ()=>removeRequestMeta, "setRequestMeta", ()=>setRequestMeta ]); const NEXT_REQUEST_META = Symbol.for('NextInternalRequestMeta'); function getRequestMeta(req, key) { const meta = req[NEXT_REQUEST_META] || {}; return typeof key === 'string' ? meta[key] : meta; } function setRequestMeta(req, meta) { req[NEXT_REQUEST_META] = meta; return meta; } function addRequestMeta(request, key, value) { const meta = getRequestMeta(request); meta[key] = value; return setRequestMeta(request, meta); } function removeRequestMeta(request, key) { const meta = getRequestMeta(request); delete meta[key]; return setRequestMeta(request, meta); } }), "[project]/node_modules/next/dist/esm/server/response-cache/index.js [app-route] (ecmascript) ", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "default", ()=>ResponseCache ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$batcher$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/lib/batcher.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$lru$2d$cache$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/lib/lru-cache.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$build$2f$output$2f$log$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/build/output/log.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$scheduler$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/lib/scheduler.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$response$2d$cache$2f$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/response-cache/utils.js [app-route] (ecmascript)"); ; ; ; ; ; /** * Parses an environment variable as a positive integer, returning the fallback * if the value is missing, not a number, or not positive. */ function parsePositiveInt(envValue, fallback) { if (!envValue) return fallback; const parsed = parseInt(envValue, 10); return Number.isFinite(parsed) && parsed > 0 ? parsed : fallback; } /** * Default TTL (in milliseconds) for minimal mode response cache entries. * Used for cache hit validation as a fallback for providers that don't * send the x-invocation-id header yet. * * 10 seconds chosen because: * - Long enough to dedupe rapid successive requests (e.g., page + data) * - Short enough to not serve stale data across unrelated requests * * Can be configured via `NEXT_PRIVATE_RESPONSE_CACHE_TTL` environment variable. */ const DEFAULT_TTL_MS = parsePositiveInt(process.env.NEXT_PRIVATE_RESPONSE_CACHE_TTL, 10000); /** * Default maximum number of entries in the response cache. * Can be configured via `NEXT_PRIVATE_RESPONSE_CACHE_MAX_SIZE` environment variable. */ const DEFAULT_MAX_SIZE = parsePositiveInt(process.env.NEXT_PRIVATE_RESPONSE_CACHE_MAX_SIZE, 150); /** * Separator used in compound cache keys to join pathname and invocationID. * Using null byte (\0) since it cannot appear in valid URL paths or UUIDs. */ const KEY_SEPARATOR = '\0'; /** * Sentinel value used for TTL-based cache entries (when invocationID is undefined). * Chosen to be a clearly reserved marker for internal cache keys. */ const TTL_SENTINEL = '__ttl_sentinel__'; /** * Creates a compound cache key from pathname and invocationID. */ function createCacheKey(pathname, invocationID) { return `${pathname}${KEY_SEPARATOR}${invocationID ?? TTL_SENTINEL}`; } /** * Extracts the invocationID from a compound cache key. * Returns undefined if the key used TTL_SENTINEL. */ function extractInvocationID(compoundKey) { const separatorIndex = compoundKey.lastIndexOf(KEY_SEPARATOR); if (separatorIndex === -1) return undefined; const invocationID = compoundKey.slice(separatorIndex + 1); return invocationID === TTL_SENTINEL ? undefined : invocationID; } ; class ResponseCache { constructor(minimal_mode, maxSize = DEFAULT_MAX_SIZE, ttl = DEFAULT_TTL_MS){ this.getBatcher = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$batcher$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["Batcher"].create({ // Ensure on-demand revalidate doesn't block normal requests, it should be // safe to run an on-demand revalidate for the same key as a normal request. cacheKeyFn: ({ key, isOnDemandRevalidate })=>`${key}-${isOnDemandRevalidate ? '1' : '0'}`, // We wait to do any async work until after we've added our promise to // `pendingResponses` to ensure that any any other calls will reuse the // same promise until we've fully finished our work. schedulerFn: __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$scheduler$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["scheduleOnNextTick"] }); this.revalidateBatcher = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$batcher$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["Batcher"].create({ // We wait to do any async work until after we've added our promise to // `pendingResponses` to ensure that any any other calls will reuse the // same promise until we've fully finished our work. schedulerFn: __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$scheduler$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["scheduleOnNextTick"] }); /** * Set of invocation IDs that have had cache entries evicted. * Used to detect when the cache size may be too small. * Bounded to prevent memory growth. */ this.evictedInvocationIDs = new Set(); this.minimal_mode = minimal_mode; this.maxSize = maxSize; this.ttl = ttl; // Create the LRU cache with eviction tracking this.cache = new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$lru$2d$cache$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["LRUCache"](maxSize, undefined, (compoundKey)=>{ const invocationID = extractInvocationID(compoundKey); if (invocationID) { // Bound to 100 entries to prevent unbounded memory growth. // FIFO eviction is acceptable here because: // 1. Invocations are short-lived (single request lifecycle), so older // invocations are unlikely to still be active after 100 newer ones // 2. This warning mechanism is best-effort for developer guidance— // missing occasional eviction warnings doesn't affect correctness // 3. If a long-running invocation is somehow evicted and then has // another cache entry evicted, it will simply be re-added if (this.evictedInvocationIDs.size >= 100) { const first = this.evictedInvocationIDs.values().next().value; if (first) this.evictedInvocationIDs.delete(first); } this.evictedInvocationIDs.add(invocationID); } }); } /** * Gets the response cache entry for the given key. * * @param key - The key to get the response cache entry for. * @param responseGenerator - The response generator to use to generate the response cache entry. * @param context - The context for the get request. * @returns The response cache entry. */ async get(key, responseGenerator, context) { // If there is no key for the cache, we can't possibly look this up in the // cache so just return the result of the response generator. if (!key) { return responseGenerator({ hasResolved: false, previousCacheEntry: null }); } // Check minimal mode cache before doing any other work. if (this.minimal_mode) { const cacheKey = createCacheKey(key, context.invocationID); const cachedItem = this.cache.get(cacheKey); if (cachedItem) { // With invocationID: exact match found - always a hit // With TTL mode: must check expiration if (context.invocationID !== undefined) { return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$response$2d$cache$2f$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["toResponseCacheEntry"])(cachedItem.entry); } // TTL mode: check expiration const now = Date.now(); if (cachedItem.expiresAt > now) { return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$response$2d$cache$2f$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["toResponseCacheEntry"])(cachedItem.entry); } // TTL expired - clean up this.cache.remove(cacheKey); } // Warn if this invocation had entries evicted - indicates cache may be too small. if (context.invocationID && this.evictedInvocationIDs.has(context.invocationID)) { (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$build$2f$output$2f$log$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["warnOnce"])(`Response cache entry was evicted for invocation ${context.invocationID}. ` + `Consider increasing NEXT_PRIVATE_RESPONSE_CACHE_MAX_SIZE (current: ${this.maxSize}).`); } } const { incrementalCache, isOnDemandRevalidate = false, isFallback = false, isRoutePPREnabled = false, isPrefetch = false, waitUntil, routeKind, invocationID } = context; const response = await this.getBatcher.batch({ key, isOnDemandRevalidate }, ({ resolve })=>{ const promise = this.handleGet(key, responseGenerator, { incrementalCache, isOnDemandRevalidate, isFallback, isRoutePPREnabled, isPrefetch, routeKind, invocationID }, resolve); // We need to ensure background revalidates are passed to waitUntil. if (waitUntil) waitUntil(promise); return promise; }); if (this.minimal_mode && (response == null ? void 0 : response.cacheControl)) { const cacheKey = createCacheKey(key, invocationID); this.cache.set(cacheKey, { entry: response, expiresAt: Date.now() + this.ttl }); } return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$response$2d$cache$2f$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["toResponseCacheEntry"])(response); } /** * Handles the get request for the response cache. * * @param key - The key to get the response cache entry for. * @param responseGenerator - The response generator to use to generate the response cache entry. * @param context - The context for the get request. * @param resolve - The resolve function to use to resolve the response cache entry. * @returns The response cache entry. */ async handleGet(key, responseGenerator, context, resolve) { let previousIncrementalCacheEntry = null; let resolved = false; try { // Get the previous cache entry if not in minimal mode previousIncrementalCacheEntry = !this.minimal_mode ? await context.incrementalCache.get(key, { kind: (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$response$2d$cache$2f$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["routeKindToIncrementalCacheKind"])(context.routeKind), isRoutePPREnabled: context.isRoutePPREnabled, isFallback: context.isFallback }) : null; // `isStale === -1` signals that the entry is past its `expire` (either // via an expired tag or, with `cacheLife({ expire })`, past the route's // expire time in the prerender manifest). In that case we must NOT // early-resolve with the stale value — instead we fall through to a // blocking revalidation so the response returned to the user is fresh. if (previousIncrementalCacheEntry && !context.isOnDemandRevalidate && previousIncrementalCacheEntry.isStale !== -1) { resolve(previousIncrementalCacheEntry); resolved = true; if (!previousIncrementalCacheEntry.isStale || context.isPrefetch) { // The cached value is still valid, so we don't need to update it yet. return previousIncrementalCacheEntry; } } // Revalidate the cache entry. // // A prefetch request that missed must run its own response generator // rather than joining an in-flight revalidation through the batcher. A // background revalidation may be regenerating the concrete (non-fallback) // entry for this route — e.g. an ISR fallback-shell upgrade scheduled by // an earlier prefetch sub-request. Joining it would serve that concrete // result to the prefetch instead of the fallback shell, and which segment // wins would depend purely on request timing. Running the generator // directly lets every prefetch segment take the same fallback-shell path, // independent of any concurrent background upgrade. const incrementalResponseCacheEntry = context.isPrefetch && previousIncrementalCacheEntry === null ? await this.handleRevalidate(key, context.incrementalCache, context.isRoutePPREnabled, context.isFallback, responseGenerator, previousIncrementalCacheEntry, resolved) : await this.revalidate(key, context.incrementalCache, context.isRoutePPREnabled, context.isFallback, responseGenerator, previousIncrementalCacheEntry, resolved); // Handle null response if (!incrementalResponseCacheEntry) { // Remove the cache item if it was set so we don't use it again. if (this.minimal_mode) { const cacheKey = createCacheKey(key, context.invocationID); this.cache.remove(cacheKey); } return null; } // Resolve for on-demand revalidation or if not already resolved if (context.isOnDemandRevalidate && !resolved) { return incrementalResponseCacheEntry; } return incrementalResponseCacheEntry; } catch (err) { // If we've already resolved the cache entry, we can't reject as we // already resolved the cache entry so log the error here. if (resolved) { console.error(err); return null; } throw err; } } /** * Revalidates the cache entry for the given key. * * @param key - The key to revalidate the cache entry for. * @param incrementalCache - The incremental cache to use to revalidate the cache entry. * @param isRoutePPREnabled - Whether the route is PPR enabled. * @param isFallback - Whether the route is a fallback. * @param responseGenerator - The response generator to use to generate the response cache entry. * @param previousIncrementalCacheEntry - The previous cache entry to use to revalidate the cache entry. * @param hasResolved - Whether the response has been resolved. * @param waitUntil - Optional function to register background work. * @param invocationID - The invocation ID for cache key scoping. * @returns The revalidated cache entry. */ async revalidate(key, incrementalCache, isRoutePPREnabled, isFallback, responseGenerator, previousIncrementalCacheEntry, hasResolved, waitUntil) { return this.revalidateBatcher.batch(key, ()=>{ const promise = this.handleRevalidate(key, incrementalCache, isRoutePPREnabled, isFallback, responseGenerator, previousIncrementalCacheEntry, hasResolved); // We need to ensure background revalidates are passed to waitUntil. if (waitUntil) waitUntil(promise); return promise; }); } async handleRevalidate(key, incrementalCache, isRoutePPREnabled, isFallback, responseGenerator, previousIncrementalCacheEntry, hasResolved) { try { // Generate the response cache entry using the response generator. const responseCacheEntry = await responseGenerator({ hasResolved, previousCacheEntry: previousIncrementalCacheEntry, isRevalidating: true }); if (!responseCacheEntry) { return null; } // Convert the response cache entry to an incremental response cache entry. const incrementalResponseCacheEntry = await (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$response$2d$cache$2f$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["fromResponseCacheEntry"])({ ...responseCacheEntry, isMiss: !previousIncrementalCacheEntry }); // We want to persist the result only if it has a cache control value // defined. The minimal mode LRU write is handled in get() so that // every caller — including batched invocations — populates the cache. if (incrementalResponseCacheEntry.cacheControl && !this.minimal_mode) { await incrementalCache.set(key, incrementalResponseCacheEntry.value, { cacheControl: incrementalResponseCacheEntry.cacheControl, isRoutePPREnabled, isFallback }); } return incrementalResponseCacheEntry; } catch (err) { // When a path is erroring we automatically re-set the existing cache // with new revalidate and expire times to prevent non-stop retrying. if (previousIncrementalCacheEntry == null ? void 0 : previousIncrementalCacheEntry.cacheControl) { const revalidate = Math.min(Math.max(previousIncrementalCacheEntry.cacheControl.revalidate || 3, 3), 30); const expire = previousIncrementalCacheEntry.cacheControl.expire === undefined ? undefined : Math.max(revalidate + 3, previousIncrementalCacheEntry.cacheControl.expire); await incrementalCache.set(key, previousIncrementalCacheEntry.value, { cacheControl: { revalidate: revalidate, expire: expire }, isRoutePPREnabled, isFallback }); } // We haven't resolved yet, so let's throw to indicate an error. throw err; } } } }), "[project]/node_modules/next/dist/esm/server/response-cache/types.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "CachedRouteKind", ()=>CachedRouteKind, "IncrementalCacheKind", ()=>IncrementalCacheKind ]); var CachedRouteKind = /*#__PURE__*/ function(CachedRouteKind) { CachedRouteKind["APP_PAGE"] = "APP_PAGE"; CachedRouteKind["APP_ROUTE"] = "APP_ROUTE"; CachedRouteKind["PAGES"] = "PAGES"; CachedRouteKind["FETCH"] = "FETCH"; CachedRouteKind["REDIRECT"] = "REDIRECT"; CachedRouteKind["IMAGE"] = "IMAGE"; return CachedRouteKind; }({}); var IncrementalCacheKind = /*#__PURE__*/ function(IncrementalCacheKind) { IncrementalCacheKind["APP_PAGE"] = "APP_PAGE"; IncrementalCacheKind["APP_ROUTE"] = "APP_ROUTE"; IncrementalCacheKind["PAGES"] = "PAGES"; IncrementalCacheKind["FETCH"] = "FETCH"; IncrementalCacheKind["IMAGE"] = "IMAGE"; return IncrementalCacheKind; }({}); }), "[project]/node_modules/next/dist/esm/server/response-cache/utils.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "fromResponseCacheEntry", ()=>fromResponseCacheEntry, "routeKindToIncrementalCacheKind", ()=>routeKindToIncrementalCacheKind, "toResponseCacheEntry", ()=>toResponseCacheEntry ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$response$2d$cache$2f$types$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/response-cache/types.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$render$2d$result$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/render-result.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$route$2d$kind$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/route-kind.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/lib/constants.js [app-route] (ecmascript)"); ; ; ; ; async function fromResponseCacheEntry(cacheEntry) { var _cacheEntry_value, _cacheEntry_value1; return { ...cacheEntry, value: ((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) === __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$response$2d$cache$2f$types$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["CachedRouteKind"].PAGES ? { kind: __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$response$2d$cache$2f$types$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["CachedRouteKind"].PAGES, html: await cacheEntry.value.html.toUnchunkedString(true), pageData: cacheEntry.value.pageData, headers: cacheEntry.value.headers, status: cacheEntry.value.status } : ((_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind) === __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$response$2d$cache$2f$types$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["CachedRouteKind"].APP_PAGE ? { kind: __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$response$2d$cache$2f$types$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["CachedRouteKind"].APP_PAGE, html: await cacheEntry.value.html.toUnchunkedString(true), postponed: cacheEntry.value.postponed, rscData: cacheEntry.value.rscData, headers: cacheEntry.value.headers, status: cacheEntry.value.status, segmentData: cacheEntry.value.segmentData } : cacheEntry.value }; } async function toResponseCacheEntry(response) { var _response_value, _response_value1; if (!response) return null; return { isMiss: response.isMiss, isStale: response.isStale, cacheControl: response.cacheControl, isFallback: response.isFallback, value: ((_response_value = response.value) == null ? void 0 : _response_value.kind) === __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$response$2d$cache$2f$types$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["CachedRouteKind"].PAGES ? { kind: __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$response$2d$cache$2f$types$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["CachedRouteKind"].PAGES, html: __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$render$2d$result$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"].fromStatic(response.value.html, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["HTML_CONTENT_TYPE_HEADER"]), pageData: response.value.pageData, headers: response.value.headers, status: response.value.status } : ((_response_value1 = response.value) == null ? void 0 : _response_value1.kind) === __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$response$2d$cache$2f$types$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["CachedRouteKind"].APP_PAGE ? { kind: __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$response$2d$cache$2f$types$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["CachedRouteKind"].APP_PAGE, html: __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$render$2d$result$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["default"].fromStatic(response.value.html, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["HTML_CONTENT_TYPE_HEADER"]), rscData: response.value.rscData, headers: response.value.headers, status: response.value.status, postponed: response.value.postponed, segmentData: response.value.segmentData } : response.value }; } function routeKindToIncrementalCacheKind(routeKind) { switch(routeKind){ case __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$route$2d$kind$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["RouteKind"].PAGES: return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$response$2d$cache$2f$types$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["IncrementalCacheKind"].PAGES; case __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$route$2d$kind$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["RouteKind"].APP_PAGE: return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$response$2d$cache$2f$types$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["IncrementalCacheKind"].APP_PAGE; case __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$route$2d$kind$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["RouteKind"].IMAGE: return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$response$2d$cache$2f$types$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["IncrementalCacheKind"].IMAGE; case __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$route$2d$kind$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["RouteKind"].APP_ROUTE: return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$response$2d$cache$2f$types$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["IncrementalCacheKind"].APP_ROUTE; case __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$route$2d$kind$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["RouteKind"].PAGES_API: // Pages Router API routes are not cached in the incremental cache. throw Object.defineProperty(new Error(`Unexpected route kind ${routeKind}`), "__NEXT_ERROR_CODE", { value: "E64", enumerable: false, configurable: true }); default: return routeKind; } } }), "[project]/node_modules/next/dist/esm/server/route-kind.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "RouteKind", ()=>RouteKind ]); var RouteKind = /*#__PURE__*/ function(RouteKind) { /** * `PAGES` represents all the React pages that are under `pages/`. */ RouteKind["PAGES"] = "PAGES"; /** * `PAGES_API` represents all the API routes under `pages/api/`. */ RouteKind["PAGES_API"] = "PAGES_API"; /** * `APP_PAGE` represents all the React pages that are under `app/` with the * filename of `page.{j,t}s{,x}`. */ RouteKind["APP_PAGE"] = "APP_PAGE"; /** * `APP_ROUTE` represents all the API routes and metadata routes that are under `app/` with the * filename of `route.{j,t}s{,x}`. */ RouteKind["APP_ROUTE"] = "APP_ROUTE"; /** * `IMAGE` represents all the images that are generated by `next/image`. */ RouteKind["IMAGE"] = "IMAGE"; return RouteKind; }({}); }), "[project]/node_modules/next/dist/esm/server/route-modules/app-route/module.compiled.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable ; else { if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable ; else { if ("TURBOPACK compile-time truthy", 1) { if ("TURBOPACK compile-time truthy", 1) { module.exports = __turbopack_context__.r("[externals]/next/dist/compiled/next-server/app-route-turbo.runtime.dev.js [external] (next/dist/compiled/next-server/app-route-turbo.runtime.dev.js, cjs)"); } else //TURBOPACK unreachable ; } else //TURBOPACK unreachable ; } } }), "[project]/node_modules/next/dist/esm/server/send-response.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "sendResponse", ()=>sendResponse ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$base$2d$http$2f$helpers$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/base-http/helpers.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$pipe$2d$readable$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/pipe-readable.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/web/utils.js [app-route] (ecmascript)"); ; ; ; async function sendResponse(req, res, response, waitUntil) { if (// environment variable check provides dead code elimination. ("TURBOPACK compile-time value", "nodejs") !== 'edge' && (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$base$2d$http$2f$helpers$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["isNodeNextResponse"])(res)) { var _response_headers; // Copy over the response status. res.statusCode = response.status; res.statusMessage = response.statusText; // TODO: this is not spec-compliant behavior and we should not restrict // headers that are allowed to appear many times. // // See: // https://github.com/vercel/next.js/pull/70127 const headersWithMultipleValuesAllowed = [ // can add more headers to this list if needed 'set-cookie', 'www-authenticate', 'proxy-authenticate', 'vary' ]; (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{ // `x-middleware-set-cookie` is an internal header not needed for the response if (name.toLowerCase() === 'x-middleware-set-cookie') { return; } // The append handling is special cased for `set-cookie`. if (name.toLowerCase() === 'set-cookie') { // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici for (const cookie of (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["splitCookiesString"])(value)){ res.appendHeader(name, cookie); } } else { // only append the header if it is either not present in the outbound response // or if the header supports multiple values const isHeaderPresent = typeof res.getHeader(name) !== 'undefined'; if (headersWithMultipleValuesAllowed.includes(name.toLowerCase()) || !isHeaderPresent) { res.appendHeader(name, value); } } }); /** * The response can't be directly piped to the underlying response. The * following is duplicated from the edge runtime handler. * * See packages/next/server/next-server.ts */ const { originalResponse } = res; // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD if (response.body && req.method !== 'HEAD') { await (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$pipe$2d$readable$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["pipeToNodeResponse"])(response.body, originalResponse, waitUntil); } else { originalResponse.end(); } } } }), "[project]/node_modules/next/dist/esm/server/stream-utils/encoded-tags.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "ENCODED_TAGS", ()=>ENCODED_TAGS ]); const ENCODED_TAGS = { // opening tags do not have the closing `>` since they can contain other attributes such as `` OPENING: { // HEAD: new Uint8Array([ 60, 47, 104, 101, 97, 100, 62 ]), // BODY: new Uint8Array([ 60, 47, 98, 111, 100, 121, 62 ]), // HTML: new Uint8Array([ 60, 47, 104, 116, 109, 108, 62 ]), // BODY_AND_HTML: new Uint8Array([ 60, 47, 98, 111, 100, 121, 62, 60, 47, 104, 116, 109, 108, 62 ]) }, META: { // Only the match the prefix cause the suffix can be different wether it's xml compatible or not ">" or "/>" // { "use strict"; __turbopack_context__.s([ "CLOSE_TAG", ()=>CLOSE_TAG, "chainStreams", ()=>chainStreams, "chainTransformers", ()=>chainTransformers, "continueDynamicHTMLResume", ()=>continueDynamicHTMLResume, "continueDynamicPrerender", ()=>continueDynamicPrerender, "continueFizzStream", ()=>continueFizzStream, "continueStaticFallbackPrerender", ()=>continueStaticFallbackPrerender, "continueStaticPrerender", ()=>continueStaticPrerender, "createBufferedTransformStream", ()=>createBufferedTransformStream, "createDeferredSuffixStream", ()=>createDeferredSuffixStream, "createDocumentClosingStream", ()=>createDocumentClosingStream, "createFlightDataInjectionTransformStream", ()=>createFlightDataInjectionTransformStream, "createHeadInsertionTransformStream", ()=>createHeadInsertionTransformStream, "createHtmlDataDplIdTransformStream", ()=>createHtmlDataDplIdTransformStream, "createMetadataTransformStream", ()=>createMetadataTransformStream, "createMoveSuffixStream", ()=>createMoveSuffixStream, "createRootLayoutValidatorStream", ()=>createRootLayoutValidatorStream, "createRuntimePrefetchTransformStream", ()=>createRuntimePrefetchTransformStream, "nodestreamToUint8Array", ()=>nodestreamToUint8Array, "renderToInitialFizzStream", ()=>renderToInitialFizzStream, "streamFromBuffer", ()=>streamFromBuffer, "streamFromString", ()=>streamFromString, "streamToBuffer", ()=>streamToBuffer, "streamToString", ()=>streamToString, "streamToUint8Array", ()=>streamToUint8Array, "webstreamToUint8Array", ()=>webstreamToUint8Array ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$tracer$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/lib/trace/tracer.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/lib/trace/constants.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$detached$2d$promise$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/lib/detached-promise.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$scheduler$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/lib/scheduler.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$encoded$2d$tags$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/stream-utils/encoded-tags.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$uint8array$2d$helpers$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/stream-utils/uint8array-helpers.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$errors$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/errors/constants.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$client$2f$components$2f$app$2d$router$2d$headers$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/client/components/app-router-headers.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$cache$2d$busting$2d$search$2d$param$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/router/utils/cache-busting-search-param.js [app-route] (ecmascript)"); ; ; ; ; ; ; ; ; ; function voidCatch() { // this catcher is designed to be used with pipeTo where we expect the underlying // pipe implementation to forward errors but we don't want the pipeTo promise to reject // and be unhandled } // We can share the same encoder instance everywhere // Notably we cannot do the same for TextDecoder because it is stateful // when handling streaming data const encoder = new TextEncoder(); function chainStreams(...streams) { // If we have no streams, return an empty stream. This behavior is // intentional as we're now providing the `RenderResult.EMPTY` value. if (streams.length === 0) { return new ReadableStream({ start (controller) { controller.close(); } }); } // If we only have 1 stream we fast path it by returning just this stream if (streams.length === 1) { return streams[0]; } const { readable, writable } = new TransformStream(); // We always initiate pipeTo immediately. We know we have at least 2 streams // so we need to avoid closing the writable when this one finishes. let promise = streams[0].pipeTo(writable, { preventClose: true }); let i = 1; for(; i < streams.length - 1; i++){ const nextStream = streams[i]; promise = promise.then(()=>nextStream.pipeTo(writable, { preventClose: true })); } // We can omit the length check because we halted before the last stream and there // is at least two streams so the lastStream here will always be defined const lastStream = streams[i]; promise = promise.then(()=>lastStream.pipeTo(writable)); // Catch any errors from the streams and ignore them, they will be handled // by whatever is consuming the readable stream. promise.catch(voidCatch); return readable; } function streamFromString(str) { return new ReadableStream({ start (controller) { controller.enqueue(encoder.encode(str)); controller.close(); } }); } function streamFromBuffer(chunk) { return new ReadableStream({ start (controller) { controller.enqueue(chunk); controller.close(); } }); } async function streamToChunks(stream) { const reader = stream.getReader(); const chunks = []; while(true){ const { done, value } = await reader.read(); if (done) { break; } chunks.push(value); } return chunks; } function concatUint8Arrays(chunks) { const totalLength = chunks.reduce((sum, chunk)=>sum + chunk.length, 0); const result = new Uint8Array(totalLength); let offset = 0; for (const chunk of chunks){ result.set(chunk, offset); offset += chunk.length; } return result; } async function webstreamToUint8Array(stream) { return concatUint8Arrays(await streamToChunks(stream)); } function webToReadable(stream) { if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable ; else { let Readable; if ("TURBOPACK compile-time truthy", 1) { Readable = __turbopack_context__.r("[externals]/node:stream [external] (node:stream, cjs)").Readable; } else //TURBOPACK unreachable ; if (stream instanceof Readable) { return stream; } return Readable.fromWeb(stream); } } async function nodestreamToUint8Array(stream) { const chunks = []; for await (const chunk of webToReadable(stream)){ chunks.push(typeof chunk === 'string' ? Buffer.from(chunk) : chunk); } return Buffer.concat(chunks); } async function streamToUint8Array(stream) { if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable ; else { let Readable; if ("TURBOPACK compile-time truthy", 1) { Readable = __turbopack_context__.r("[externals]/node:stream [external] (node:stream, cjs)").Readable; } else //TURBOPACK unreachable ; if (stream instanceof Readable) { return nodestreamToUint8Array(stream); } return webstreamToUint8Array(stream); } } async function streamToBuffer(stream) { return Buffer.concat(await streamToChunks(stream)); } async function streamToString(stream, signal) { const decoder = new TextDecoder('utf-8', { fatal: true }); let string = ''; for await (const chunk of stream){ if (signal == null ? void 0 : signal.aborted) { return string; } string += decoder.decode(chunk, { stream: true }); } string += decoder.decode(); return string; } function createBufferedTransformStream(options = {}) { const { maxBufferByteLength = Infinity } = options; let bufferedChunks = []; let bufferByteLength = 0; let pending; const flush = (controller)=>{ try { if (bufferedChunks.length === 0) { return; } const chunk = new Uint8Array(bufferByteLength); let copiedBytes = 0; for(let i = 0; i < bufferedChunks.length; i++){ const bufferedChunk = bufferedChunks[i]; chunk.set(bufferedChunk, copiedBytes); copiedBytes += bufferedChunk.byteLength; } // We just wrote all the buffered chunks so we need to reset the bufferedChunks array // and our bufferByteLength to prepare for the next round of buffered chunks bufferedChunks.length = 0; bufferByteLength = 0; controller.enqueue(chunk); } catch { // If an error occurs while enqueuing, it can't be due to this // transformer. It's most likely caused by the controller having been // errored (for example, if the stream was cancelled). } }; const scheduleFlush = (controller)=>{ if (pending) { return; } const detached = new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$detached$2d$promise$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["DetachedPromise"](); pending = detached; (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$scheduler$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["scheduleImmediate"])(()=>{ try { flush(controller); } finally{ pending = undefined; detached.resolve(); } }); }; return new TransformStream({ transform (chunk, controller) { // Combine the previous buffer with the new chunk. bufferedChunks.push(chunk); bufferByteLength += chunk.byteLength; if (bufferByteLength >= maxBufferByteLength) { flush(controller); } else { scheduleFlush(controller); } }, flush () { return pending == null ? void 0 : pending.promise; } }); } function renderToInitialFizzStream({ ReactDOMServer, element, streamOptions }) { return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$tracer$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["getTracer"])().trace(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$lib$2f$trace$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["AppRenderSpan"].renderToReadableStream, async ()=>ReactDOMServer.renderToReadableStream(element, streamOptions)); } function createMetadataTransformStream(insert) { let chunkIndex = -1; let isMarkRemoved = false; return new TransformStream({ async transform (chunk, controller) { let iconMarkIndex = -1; let closedHeadIndex = -1; chunkIndex++; if (isMarkRemoved) { controller.enqueue(chunk); return; } let iconMarkLength = 0; // Only search for the closed head tag once if (iconMarkIndex === -1) { iconMarkIndex = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$uint8array$2d$helpers$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["indexOfUint8Array"])(chunk, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$encoded$2d$tags$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ENCODED_TAGS"].META.ICON_MARK); if (iconMarkIndex === -1) { controller.enqueue(chunk); return; } else { // When we found the `` or `>`, checking the next char to ensure we cover both cases. iconMarkLength = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$encoded$2d$tags$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ENCODED_TAGS"].META.ICON_MARK.length; // Check if next char is /, this is for xml mode. if (chunk[iconMarkIndex + iconMarkLength] === 47) { iconMarkLength += 2; } else { // The last char is `>` iconMarkLength++; } } } // Check if icon mark is inside tag in the first chunk. if (chunkIndex === 0) { closedHeadIndex = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$uint8array$2d$helpers$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["indexOfUint8Array"])(chunk, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$encoded$2d$tags$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ENCODED_TAGS"].CLOSED.HEAD); if (iconMarkIndex !== -1) { // The mark icon is located in the 1st chunk before the head tag. // We do not need to insert the script tag in this case because it's in the head. // Just remove the icon mark from the chunk. if (iconMarkIndex < closedHeadIndex) { const replaced = new Uint8Array(chunk.length - iconMarkLength); // Remove the icon mark from the chunk. replaced.set(chunk.subarray(0, iconMarkIndex)); replaced.set(chunk.subarray(iconMarkIndex + iconMarkLength), iconMarkIndex); chunk = replaced; } else { // The icon mark is after the head tag, replace and insert the script tag at that position. const insertion = await insert(); const encodedInsertion = encoder.encode(insertion); const insertionLength = encodedInsertion.length; const replaced = new Uint8Array(chunk.length - iconMarkLength + insertionLength); replaced.set(chunk.subarray(0, iconMarkIndex)); replaced.set(encodedInsertion, iconMarkIndex); replaced.set(chunk.subarray(iconMarkIndex + iconMarkLength), iconMarkIndex + insertionLength); chunk = replaced; } isMarkRemoved = true; } // If there's no icon mark located, it will be handled later when if present in the following chunks. } else { // When it's appeared in the following chunks, we'll need to // remove the mark and then insert the script tag at that position. const insertion = await insert(); const encodedInsertion = encoder.encode(insertion); const insertionLength = encodedInsertion.length; // Replace the icon mark with the hoist script or empty string. const replaced = new Uint8Array(chunk.length - iconMarkLength + insertionLength); // Set the first part of the chunk, before the icon mark. replaced.set(chunk.subarray(0, iconMarkIndex)); // Set the insertion after the icon mark. replaced.set(encodedInsertion, iconMarkIndex); // Set the rest of the chunk after the icon mark. replaced.set(chunk.subarray(iconMarkIndex + iconMarkLength), iconMarkIndex + insertionLength); chunk = replaced; isMarkRemoved = true; } controller.enqueue(chunk); } }); } function createHeadInsertionTransformStream(insert) { let inserted = false; // We need to track if this transform saw any bytes because if it didn't // we won't want to insert any server HTML at all let hasBytes = false; return new TransformStream({ async transform (chunk, controller) { hasBytes = true; const insertion = await insert(); if (inserted) { if (insertion) { const encodedInsertion = encoder.encode(insertion); controller.enqueue(encodedInsertion); } controller.enqueue(chunk); } else { // TODO (@Ethan-Arrowood): Replace the generic `indexOfUint8Array` method with something finely tuned for the subset of things actually being checked for. const index = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$uint8array$2d$helpers$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["indexOfUint8Array"])(chunk, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$encoded$2d$tags$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ENCODED_TAGS"].CLOSED.HEAD); // In fully static rendering or non PPR rendering cases: // `/head>` will always be found in the chunk in first chunk rendering. if (index !== -1) { if (insertion) { const encodedInsertion = encoder.encode(insertion); // Get the total count of the bytes in the chunk and the insertion // e.g. // chunk = // insertion = // output = [ ] const insertedHeadContent = new Uint8Array(chunk.length + encodedInsertion.length); // Append the first part of the chunk, before the head tag insertedHeadContent.set(chunk.slice(0, index)); // Append the server inserted content insertedHeadContent.set(encodedInsertion, index); // Append the rest of the chunk insertedHeadContent.set(chunk.slice(index), index + encodedInsertion.length); controller.enqueue(insertedHeadContent); } else { controller.enqueue(chunk); } inserted = true; } else { // This will happens in PPR rendering during next start, when the page is partially rendered. // When the page resumes, the head tag will be found in the middle of the chunk. // Where we just need to append the insertion and chunk to the current stream. // e.g. // PPR-static: ... [ resume content ] // PPR-resume: [ insertion ] [ rest content ] if (insertion) { controller.enqueue(encoder.encode(insertion)); } controller.enqueue(chunk); inserted = true; } } }, async flush (controller) { // Check before closing if there's anything remaining to insert. if (hasBytes) { const insertion = await insert(); if (insertion) { controller.enqueue(encoder.encode(insertion)); } } } }); } async function createClientResumeScriptInsertionTransformStream() { const segmentPath = '/_full'; const cacheBustingHeader = await (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$cache$2d$busting$2d$search$2d$param$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["computeCacheBustingSearchParam"])('1', '/_full', undefined, undefined // headers[NEXT_URL] ); const searchStr = `${__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$client$2f$components$2f$app$2d$router$2d$headers$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["NEXT_RSC_UNION_QUERY"]}=${cacheBustingHeader}`; const NEXT_CLIENT_RESUME_SCRIPT = ``; let didAlreadyInsert = false; return new TransformStream({ transform (chunk, controller) { if (didAlreadyInsert) { // Already inserted the script into the head. Pass through. controller.enqueue(chunk); return; } // TODO (@Ethan-Arrowood): Replace the generic `indexOfUint8Array` method with something finely tuned for the subset of things actually being checked for. const headClosingTagIndex = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$uint8array$2d$helpers$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["indexOfUint8Array"])(chunk, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$encoded$2d$tags$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ENCODED_TAGS"].CLOSED.HEAD); if (headClosingTagIndex === -1) { // In fully static rendering or non PPR rendering cases: // `/head>` will always be found in the chunk in first chunk rendering. controller.enqueue(chunk); return; } const encodedInsertion = encoder.encode(NEXT_CLIENT_RESUME_SCRIPT); // Get the total count of the bytes in the chunk and the insertion // e.g. // chunk = // insertion = // output = [ ] const insertedHeadContent = new Uint8Array(chunk.length + encodedInsertion.length); // Append the first part of the chunk, before the head tag insertedHeadContent.set(chunk.slice(0, headClosingTagIndex)); // Append the server inserted content insertedHeadContent.set(encodedInsertion, headClosingTagIndex); // Append the rest of the chunk insertedHeadContent.set(chunk.slice(headClosingTagIndex), headClosingTagIndex + encodedInsertion.length); controller.enqueue(insertedHeadContent); didAlreadyInsert = true; } }); } function createDeferredSuffixStream(suffix) { let flushed = false; let pending; const flush = (controller)=>{ const detached = new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$detached$2d$promise$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["DetachedPromise"](); pending = detached; (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$scheduler$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["scheduleImmediate"])(()=>{ try { controller.enqueue(encoder.encode(suffix)); } catch { // If an error occurs while enqueuing it can't be due to this // transformers fault. It's likely due to the controller being // errored due to the stream being cancelled. } finally{ pending = undefined; detached.resolve(); } }); }; return new TransformStream({ transform (chunk, controller) { controller.enqueue(chunk); // If we've already flushed, we're done. if (flushed) return; // Schedule the flush to happen. flushed = true; flush(controller); }, flush (controller) { if (pending) return pending.promise; if (flushed) return; // Flush now. controller.enqueue(encoder.encode(suffix)); } }); } function createFlightDataInjectionTransformStream(stream, delayDataUntilFirstHtmlChunk) { let htmlStreamFinished = false; let pull = null; let donePulling = false; function startOrContinuePulling(controller) { if (!pull) { pull = startPulling(controller); } return pull; } async function startPulling(controller) { const reader = stream.getReader(); if (delayDataUntilFirstHtmlChunk) { // NOTE: streaming flush // We are buffering here for the inlined data stream because the // "shell" stream might be chunkenized again by the underlying stream // implementation, e.g. with a specific high-water mark. To ensure it's // the safe timing to pipe the data stream, this extra tick is // necessary. // We don't start reading until we've left the current Task to ensure // that it's inserted after flushing the shell. Note that this implementation // might get stale if impl details of Fizz change in the future. await (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$scheduler$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["atLeastOneTask"])(); } try { while(true){ const { done, value } = await reader.read(); if (done) { donePulling = true; return; } // We want to prioritize HTML over RSC data. // The SSR render is based on the same RSC stream, so when we get a new RSC chunk, // we're likely to produce an HTML chunk as well, so give it a chance to flush first. if (!delayDataUntilFirstHtmlChunk && !htmlStreamFinished) { await (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$scheduler$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["atLeastOneTask"])(); } controller.enqueue(value); } } catch (err) { controller.error(err); } } return new TransformStream({ start (controller) { if (!delayDataUntilFirstHtmlChunk) { startOrContinuePulling(controller); } }, transform (chunk, controller) { controller.enqueue(chunk); // Start the streaming if it hasn't already been started yet. if (delayDataUntilFirstHtmlChunk) { startOrContinuePulling(controller); } }, flush (controller) { htmlStreamFinished = true; if (donePulling) { return; } return startOrContinuePulling(controller); } }); } const CLOSE_TAG = ''; function createMoveSuffixStream() { let foundSuffix = false; return new TransformStream({ transform (chunk, controller) { if (foundSuffix) { return controller.enqueue(chunk); } const index = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$uint8array$2d$helpers$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["indexOfUint8Array"])(chunk, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$encoded$2d$tags$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ENCODED_TAGS"].CLOSED.BODY_AND_HTML); if (index > -1) { foundSuffix = true; // If the whole chunk is the suffix, then don't write anything, it will // be written in the flush. if (chunk.length === __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$encoded$2d$tags$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ENCODED_TAGS"].CLOSED.BODY_AND_HTML.length) { return; } // Write out the part before the suffix. const before = chunk.slice(0, index); controller.enqueue(before); // In the case where the suffix is in the middle of the chunk, we need // to split the chunk into two parts. if (chunk.length > __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$encoded$2d$tags$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ENCODED_TAGS"].CLOSED.BODY_AND_HTML.length + index) { // Write out the part after the suffix. const after = chunk.slice(index + __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$encoded$2d$tags$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ENCODED_TAGS"].CLOSED.BODY_AND_HTML.length); controller.enqueue(after); } } else { controller.enqueue(chunk); } }, flush (controller) { // Even if we didn't find the suffix, the HTML is not valid if we don't // add it, so insert it at the end. controller.enqueue(__TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$encoded$2d$tags$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ENCODED_TAGS"].CLOSED.BODY_AND_HTML); } }); } function createStripDocumentClosingTagsTransform() { return new TransformStream({ transform (chunk, controller) { // We rely on the assumption that chunks will never break across a code unit. // This is reasonable because we currently concat all of React's output from a single // flush into one chunk before streaming it forward which means the chunk will represent // a single coherent utf-8 string. This is not safe to use if we change our streaming to no // longer do this large buffered chunk if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$uint8array$2d$helpers$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["isEquivalentUint8Arrays"])(chunk, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$encoded$2d$tags$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ENCODED_TAGS"].CLOSED.BODY_AND_HTML) || (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$uint8array$2d$helpers$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["isEquivalentUint8Arrays"])(chunk, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$encoded$2d$tags$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ENCODED_TAGS"].CLOSED.BODY) || (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$uint8array$2d$helpers$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["isEquivalentUint8Arrays"])(chunk, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$encoded$2d$tags$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ENCODED_TAGS"].CLOSED.HTML)) { // the entire chunk is the closing tags; return without enqueueing anything. return; } // We assume these tags will go at together at the end of the document and that // they won't appear anywhere else in the document. This is not really a safe assumption // but until we revamp our streaming infra this is a performant way to string the tags chunk = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$uint8array$2d$helpers$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["removeFromUint8Array"])(chunk, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$encoded$2d$tags$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ENCODED_TAGS"].CLOSED.BODY); chunk = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$uint8array$2d$helpers$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["removeFromUint8Array"])(chunk, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$encoded$2d$tags$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ENCODED_TAGS"].CLOSED.HTML); controller.enqueue(chunk); } }); } function createHtmlDataDplIdTransformStream(dplId) { let didTransform = false; return new TransformStream({ transform (chunk, controller) { if (didTransform) { controller.enqueue(chunk); return; } const htmlTagIndex = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$uint8array$2d$helpers$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["indexOfUint8Array"])(chunk, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$encoded$2d$tags$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ENCODED_TAGS"].OPENING.HTML); if (htmlTagIndex === -1) { controller.enqueue(chunk); return; } // Insert the data-dpl-id attribute right after " -1) { foundHtml = true; } if (!foundBody && (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$uint8array$2d$helpers$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["indexOfUint8Array"])(chunk, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$stream$2d$utils$2f$encoded$2d$tags$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ENCODED_TAGS"].OPENING.BODY) > -1) { foundBody = true; } controller.enqueue(chunk); }, flush (controller) { const missingTags = []; if (!foundHtml) missingTags.push('html'); if (!foundBody) missingTags.push('body'); if (!missingTags.length) return; controller.enqueue(encoder.encode(` `)); } }); } function chainTransformers(readable, transformers) { let stream = readable; for (const transformer of transformers){ if (!transformer) continue; stream = stream.pipeThrough(transformer); } return stream; } async function continueFizzStream(renderStream, { suffix, inlinedDataStream, isStaticGeneration, deploymentId, getServerInsertedHTML, getServerInsertedMetadata, validateRootLayout }) { // Suffix itself might contain close tags at the end, so we need to split it. const suffixUnclosed = suffix ? suffix.split(CLOSE_TAG, 1)[0] : null; if (isStaticGeneration) { // If we're generating static HTML we need to wait for it to resolve before continuing. await renderStream.allReady; } else { // Otherwise, we want to make sure Fizz is done with all microtasky work // before we start pulling the stream and cause a flush. await (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$scheduler$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["waitAtLeastOneReactRenderTask"])(); } return chainTransformers(renderStream, [ // Buffer everything to avoid flushing too frequently createBufferedTransformStream(), // Insert data-dpl-id attribute on the html tag deploymentId ? createHtmlDataDplIdTransformStream(deploymentId) : null, // Transform metadata createMetadataTransformStream(getServerInsertedMetadata), // Insert suffix content suffixUnclosed != null && suffixUnclosed.length > 0 ? createDeferredSuffixStream(suffixUnclosed) : null, // Insert the inlined data (Flight data, form state, etc.) stream into the HTML inlinedDataStream ? createFlightDataInjectionTransformStream(inlinedDataStream, true) : null, // Validate the root layout for missing html or body tags validateRootLayout ? createRootLayoutValidatorStream() : null, // Close tags should always be deferred to the end createMoveSuffixStream(), // Special head insertions // TODO-APP: Insert server side html to end of head in app layout rendering, to avoid // hydration errors. Remove this once it's ready to be handled by react itself. createHeadInsertionTransformStream(getServerInsertedHTML) ]); } async function continueDynamicPrerender(prerenderStream, { getServerInsertedHTML, getServerInsertedMetadata, deploymentId }) { return chainTransformers(prerenderStream, [ // Buffer everything to avoid flushing too frequently createBufferedTransformStream(), createStripDocumentClosingTagsTransform(), // Insert data-dpl-id attribute on the html tag deploymentId ? createHtmlDataDplIdTransformStream(deploymentId) : null, // Insert generated tags to head createHeadInsertionTransformStream(getServerInsertedHTML), // Transform metadata createMetadataTransformStream(getServerInsertedMetadata) ]); } async function continueStaticPrerender(prerenderStream, { inlinedDataStream, getServerInsertedHTML, getServerInsertedMetadata, deploymentId }) { return chainTransformers(prerenderStream, [ // Buffer everything to avoid flushing too frequently createBufferedTransformStream(), // Add build id comment to start of the HTML document (in export mode) // Insert data-dpl-id attribute on the html tag deploymentId ? createHtmlDataDplIdTransformStream(deploymentId) : null, // Insert generated tags to head createHeadInsertionTransformStream(getServerInsertedHTML), // Transform metadata createMetadataTransformStream(getServerInsertedMetadata), // Insert the inlined data (Flight data, form state, etc.) stream into the HTML createFlightDataInjectionTransformStream(inlinedDataStream, true), // Close tags should always be deferred to the end createMoveSuffixStream() ]); } async function continueStaticFallbackPrerender(prerenderStream, { inlinedDataStream, getServerInsertedHTML, getServerInsertedMetadata, deploymentId }) { // Same as `continueStaticPrerender`, but also inserts an additional script // to instruct the client to start fetching the hydration data as early // as possible. return chainTransformers(prerenderStream, [ // Buffer everything to avoid flushing too frequently createBufferedTransformStream(), // Insert data-dpl-id attribute on the html tag deploymentId ? createHtmlDataDplIdTransformStream(deploymentId) : null, // Insert generated tags to head createHeadInsertionTransformStream(getServerInsertedHTML), // Insert the client resume script into the head await createClientResumeScriptInsertionTransformStream(), // Transform metadata createMetadataTransformStream(getServerInsertedMetadata), // Insert the inlined data (Flight data, form state, etc.) stream into the HTML createFlightDataInjectionTransformStream(inlinedDataStream, true), // Close tags should always be deferred to the end createMoveSuffixStream() ]); } async function continueDynamicHTMLResume(renderStream, { delayDataUntilFirstHtmlChunk, inlinedDataStream, getServerInsertedHTML, getServerInsertedMetadata, deploymentId }) { return chainTransformers(renderStream, [ // Buffer everything to avoid flushing too frequently createBufferedTransformStream(), // Insert data-dpl-id attribute on the html tag deploymentId ? createHtmlDataDplIdTransformStream(deploymentId) : null, // Insert generated tags to head createHeadInsertionTransformStream(getServerInsertedHTML), // Transform metadata createMetadataTransformStream(getServerInsertedMetadata), // Insert the inlined data (Flight data, form state, etc.) stream into the HTML createFlightDataInjectionTransformStream(inlinedDataStream, delayDataUntilFirstHtmlChunk), // Close tags should always be deferred to the end createMoveSuffixStream() ]); } function createDocumentClosingStream() { return streamFromString(CLOSE_TAG); } function createRuntimePrefetchTransformStream(sentinel, isPartial, staleTime) { const enc = new TextEncoder(); // Search for: [] // Replace with: [,] const search = enc.encode(`[${sentinel}]`); const first = search[0]; const replace = enc.encode(`[${isPartial},${staleTime}]`); const searchLen = search.length; let currentChunk = null; let found = false; function processChunk(controller, nextChunk) { if (found) { if (nextChunk) { controller.enqueue(nextChunk); } return; } if (currentChunk) { // We can't search past the index that can contain a full match let exclusiveUpperBound = currentChunk.length - (searchLen - 1); if (nextChunk) { // If we have any overflow bytes we can search up to the chunk's final byte exclusiveUpperBound += Math.min(nextChunk.length, searchLen - 1); } if (exclusiveUpperBound < 1) { // we can't match the current chunk. controller.enqueue(currentChunk); currentChunk = nextChunk // advance so we don't process this chunk again ; return; } let currentIndex = currentChunk.indexOf(first); // check the current candidate match if it is within the bounds of our search space for the currentChunk candidateLoop: while(-1 < currentIndex && currentIndex < exclusiveUpperBound){ // We already know index 0 matches because we used indexOf to find the candidateIndex so we start at index 1 let matchIndex = 1; while(matchIndex < searchLen){ const candidateIndex = currentIndex + matchIndex; const candidateValue = candidateIndex < currentChunk.length ? currentChunk[candidateIndex] : nextChunk[candidateIndex - currentChunk.length]; if (candidateValue !== search[matchIndex]) { // No match, reset and continue the search from the next position currentIndex = currentChunk.indexOf(first, currentIndex + 1); continue candidateLoop; } matchIndex++; } // We found a complete match. currentIndex is our starting point to replace the value. found = true; // enqueue everything up to the match controller.enqueue(currentChunk.subarray(0, currentIndex)); // enqueue the replacement value controller.enqueue(replace); // If there are bytes in the currentChunk after the match enqueue them if (currentIndex + searchLen < currentChunk.length) { controller.enqueue(currentChunk.slice(currentIndex + searchLen)); } // If we have a next chunk we enqueue it now if (nextChunk) { // if replacement spills over to the next chunk we first exclude the replaced bytes const overflowBytes = currentIndex + searchLen - currentChunk.length; const truncatedChunk = overflowBytes > 0 ? nextChunk.subarray(overflowBytes) : nextChunk; controller.enqueue(truncatedChunk); } // We are now in found mode and don't need to track currentChunk anymore currentChunk = null; return; } // No match found in this chunk, emit it and wait for the next one controller.enqueue(currentChunk); } // Advance to the next chunk currentChunk = nextChunk; } return new TransformStream({ transform (chunk, controller) { processChunk(controller, chunk); }, flush (controller) { processChunk(controller, null); } }); } }), "[project]/node_modules/next/dist/esm/server/stream-utils/uint8array-helpers.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; /** * Find the starting index of Uint8Array `b` within Uint8Array `a`. */ __turbopack_context__.s([ "indexOfUint8Array", ()=>indexOfUint8Array, "isEquivalentUint8Arrays", ()=>isEquivalentUint8Arrays, "removeFromUint8Array", ()=>removeFromUint8Array ]); function indexOfUint8Array(a, b) { if (b.length === 0) return 0; if (a.length === 0 || b.length > a.length) return -1; // Use Node's native implementation when available. if (typeof Buffer !== 'undefined') { const haystack = Buffer.isBuffer(a) ? a : Buffer.from(a.buffer, a.byteOffset, a.byteLength); return haystack.indexOf(b); } // start iterating through `a` for(let i = 0; i <= a.length - b.length; i++){ let completeMatch = true; // from index `i`, iterate through `b` and check for mismatch for(let j = 0; j < b.length; j++){ // if the values do not match, then this isn't a complete match, exit `b` iteration early and iterate to next index of `a`. if (a[i + j] !== b[j]) { completeMatch = false; break; } } if (completeMatch) { return i; } } return -1; } function isEquivalentUint8Arrays(a, b) { if (a.length !== b.length) return false; for(let i = 0; i < a.length; i++){ if (a[i] !== b[i]) return false; } return true; } function removeFromUint8Array(a, b) { const tagIndex = indexOfUint8Array(a, b); if (tagIndex === 0) return a.subarray(b.length); if (tagIndex > -1) { const removed = new Uint8Array(a.length - b.length); removed.set(a.subarray(0, tagIndex)); removed.set(a.subarray(tagIndex + b.length), tagIndex); return removed; } else { return a; } } }), "[project]/node_modules/next/dist/esm/server/web/error.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "PageSignatureError", ()=>PageSignatureError, "RemovedPageError", ()=>RemovedPageError, "RemovedUAError", ()=>RemovedUAError ]); class PageSignatureError extends Error { constructor({ page }){ super(`The middleware "${page}" accepts an async API directly with the form: export function middleware(request, event) { return NextResponse.redirect('/new-location') } Read more: https://nextjs.org/docs/messages/middleware-new-signature `); Object.defineProperty(this, "__NEXT_ERROR_CODE", { value: "E1177", enumerable: false, configurable: true }); } } class RemovedPageError extends Error { constructor(){ super(`The request.page has been deprecated in favour of \`URLPattern\`. Read more: https://nextjs.org/docs/messages/middleware-request-page `); Object.defineProperty(this, "__NEXT_ERROR_CODE", { value: "E1178", enumerable: false, configurable: true }); } } class RemovedUAError extends Error { constructor(){ super(`The request.ua has been removed in favour of \`userAgent\` function. Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent `); Object.defineProperty(this, "__NEXT_ERROR_CODE", { value: "E1172", enumerable: false, configurable: true }); } } }), "[project]/node_modules/next/dist/esm/server/web/next-url.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "NextURL", ()=>NextURL ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$i18n$2f$detect$2d$domain$2d$locale$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/i18n/detect-domain-locale.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$format$2d$next$2d$pathname$2d$info$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/router/utils/format-next-pathname-info.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$get$2d$hostname$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/get-hostname.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$get$2d$next$2d$pathname$2d$info$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/router/utils/get-next-pathname-info.js [app-route] (ecmascript)"); ; ; ; ; const REGEX_LOCALHOST_HOSTNAME = /^(?:127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)$/; function parseURL(url, base) { const parsed = new URL(String(url), base && String(base)); if (REGEX_LOCALHOST_HOSTNAME.test(parsed.hostname)) { parsed.hostname = 'localhost'; } return parsed; } const Internal = Symbol('NextURLInternal'); class NextURL { constructor(input, baseOrOpts, opts){ let base; let options; if (typeof baseOrOpts === 'object' && 'pathname' in baseOrOpts || typeof baseOrOpts === 'string') { base = baseOrOpts; options = opts || {}; } else { options = opts || baseOrOpts || {}; } this[Internal] = { url: parseURL(input, base ?? options.base), options: options, basePath: '' }; this.analyze(); } analyze() { var _this_Internal_options_nextConfig_i18n, _this_Internal_options_nextConfig, _this_Internal_domainLocale, _this_Internal_options_nextConfig_i18n1, _this_Internal_options_nextConfig1; const info = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$get$2d$next$2d$pathname$2d$info$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["getNextPathnameInfo"])(this[Internal].url.pathname, { nextConfig: this[Internal].options.nextConfig, parseData: !("TURBOPACK compile-time value", void 0), i18nProvider: this[Internal].options.i18nProvider }); const hostname = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$get$2d$hostname$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["getHostname"])(this[Internal].url, this[Internal].options.headers); this[Internal].domainLocale = this[Internal].options.i18nProvider ? this[Internal].options.i18nProvider.detectDomainLocale(hostname) : (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$i18n$2f$detect$2d$domain$2d$locale$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["detectDomainLocale"])((_this_Internal_options_nextConfig = this[Internal].options.nextConfig) == null ? void 0 : (_this_Internal_options_nextConfig_i18n = _this_Internal_options_nextConfig.i18n) == null ? void 0 : _this_Internal_options_nextConfig_i18n.domains, hostname); const defaultLocale = ((_this_Internal_domainLocale = this[Internal].domainLocale) == null ? void 0 : _this_Internal_domainLocale.defaultLocale) || ((_this_Internal_options_nextConfig1 = this[Internal].options.nextConfig) == null ? void 0 : (_this_Internal_options_nextConfig_i18n1 = _this_Internal_options_nextConfig1.i18n) == null ? void 0 : _this_Internal_options_nextConfig_i18n1.defaultLocale); this[Internal].url.pathname = info.pathname; this[Internal].defaultLocale = defaultLocale; this[Internal].basePath = info.basePath ?? ''; this[Internal].buildId = info.buildId; this[Internal].locale = info.locale ?? defaultLocale; this[Internal].trailingSlash = info.trailingSlash; } formatPathname() { return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$format$2d$next$2d$pathname$2d$info$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["formatNextPathnameInfo"])({ basePath: this[Internal].basePath, buildId: this[Internal].buildId, defaultLocale: !this[Internal].options.forceLocale ? this[Internal].defaultLocale : undefined, locale: this[Internal].locale, pathname: this[Internal].url.pathname, trailingSlash: this[Internal].trailingSlash }); } formatSearch() { return this[Internal].url.search; } get buildId() { return this[Internal].buildId; } set buildId(buildId) { this[Internal].buildId = buildId; } get locale() { return this[Internal].locale ?? ''; } set locale(locale) { var _this_Internal_options_nextConfig_i18n, _this_Internal_options_nextConfig; if (!this[Internal].locale || !((_this_Internal_options_nextConfig = this[Internal].options.nextConfig) == null ? void 0 : (_this_Internal_options_nextConfig_i18n = _this_Internal_options_nextConfig.i18n) == null ? void 0 : _this_Internal_options_nextConfig_i18n.locales.includes(locale))) { throw Object.defineProperty(new TypeError(`The NextURL configuration includes no locale "${locale}"`), "__NEXT_ERROR_CODE", { value: "E597", enumerable: false, configurable: true }); } this[Internal].locale = locale; } get defaultLocale() { return this[Internal].defaultLocale; } get domainLocale() { return this[Internal].domainLocale; } get searchParams() { return this[Internal].url.searchParams; } get host() { return this[Internal].url.host; } set host(value) { this[Internal].url.host = value; } get hostname() { return this[Internal].url.hostname; } set hostname(value) { this[Internal].url.hostname = value; } get port() { return this[Internal].url.port; } set port(value) { this[Internal].url.port = value; } get protocol() { return this[Internal].url.protocol; } set protocol(value) { this[Internal].url.protocol = value; } get href() { const pathname = this.formatPathname(); const search = this.formatSearch(); return `${this.protocol}//${this.host}${pathname}${search}${this.hash}`; } set href(url) { this[Internal].url = parseURL(url); this.analyze(); } get origin() { return this[Internal].url.origin; } get pathname() { return this[Internal].url.pathname; } set pathname(value) { this[Internal].url.pathname = value; } get hash() { return this[Internal].url.hash; } set hash(value) { this[Internal].url.hash = value; } get search() { return this[Internal].url.search; } set search(value) { this[Internal].url.search = value; } get password() { return this[Internal].url.password; } set password(value) { this[Internal].url.password = value; } get username() { return this[Internal].url.username; } set username(value) { this[Internal].url.username = value; } get basePath() { return this[Internal].basePath; } set basePath(value) { this[Internal].basePath = value.startsWith('/') ? value : `/${value}`; } 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 NextURL(String(this), this[Internal].options); } } }), "[project]/node_modules/next/dist/esm/server/web/spec-extension/adapters/headers.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "HeadersAdapter", ()=>HeadersAdapter, "ReadonlyHeadersError", ()=>ReadonlyHeadersError ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$spec$2d$extension$2f$adapters$2f$reflect$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/web/spec-extension/adapters/reflect.js [app-route] (ecmascript)"); ; class ReadonlyHeadersError extends Error { constructor(){ super('Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers'); Object.defineProperty(this, "__NEXT_ERROR_CODE", { value: "E1176", enumerable: false, configurable: true }); } static callable() { throw new ReadonlyHeadersError(); } } class HeadersAdapter extends Headers { constructor(headers){ // We've already overridden the methods that would be called, so we're just // calling the super constructor to ensure that the instanceof check works. super(); this.headers = new Proxy(headers, { get (target, prop, receiver) { // Because this is just an object, we expect that all "get" operations // are for properties. If it's a "get" for a symbol, we'll just return // the symbol. if (typeof prop === 'symbol') { return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$spec$2d$extension$2f$adapters$2f$reflect$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ReflectAdapter"].get(target, prop, receiver); } const lowercased = prop.toLowerCase(); // Let's find the original casing of the key. This assumes that there is // no mixed case keys (e.g. "Content-Type" and "content-type") in the // headers object. const original = Object.keys(headers).find((o)=>o.toLowerCase() === lowercased); // If the original casing doesn't exist, return undefined. if (typeof original === 'undefined') return; // If the original casing exists, return the value. return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$spec$2d$extension$2f$adapters$2f$reflect$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ReflectAdapter"].get(target, original, receiver); }, set (target, prop, value, receiver) { if (typeof prop === 'symbol') { return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$spec$2d$extension$2f$adapters$2f$reflect$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ReflectAdapter"].set(target, prop, value, receiver); } const lowercased = prop.toLowerCase(); // Let's find the original casing of the key. This assumes that there is // no mixed case keys (e.g. "Content-Type" and "content-type") in the // headers object. const original = Object.keys(headers).find((o)=>o.toLowerCase() === lowercased); // If the original casing doesn't exist, use the prop as the key. return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$spec$2d$extension$2f$adapters$2f$reflect$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ReflectAdapter"].set(target, original ?? prop, value, receiver); }, has (target, prop) { if (typeof prop === 'symbol') return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$spec$2d$extension$2f$adapters$2f$reflect$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ReflectAdapter"].has(target, prop); const lowercased = prop.toLowerCase(); // Let's find the original casing of the key. This assumes that there is // no mixed case keys (e.g. "Content-Type" and "content-type") in the // headers object. const original = Object.keys(headers).find((o)=>o.toLowerCase() === lowercased); // If the original casing doesn't exist, return false. if (typeof original === 'undefined') return false; // If the original casing exists, return true. return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$spec$2d$extension$2f$adapters$2f$reflect$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ReflectAdapter"].has(target, original); }, deleteProperty (target, prop) { if (typeof prop === 'symbol') return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$spec$2d$extension$2f$adapters$2f$reflect$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ReflectAdapter"].deleteProperty(target, prop); const lowercased = prop.toLowerCase(); // Let's find the original casing of the key. This assumes that there is // no mixed case keys (e.g. "Content-Type" and "content-type") in the // headers object. const original = Object.keys(headers).find((o)=>o.toLowerCase() === lowercased); // If the original casing doesn't exist, return true. if (typeof original === 'undefined') return true; // If the original casing exists, delete the property. return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$spec$2d$extension$2f$adapters$2f$reflect$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ReflectAdapter"].deleteProperty(target, original); } }); } /** * Seals a Headers instance to prevent modification by throwing an error when * any mutating method is called. */ static seal(headers) { return new Proxy(headers, { get (target, prop, receiver) { switch(prop){ case 'append': case 'delete': case 'set': return ReadonlyHeadersError.callable; default: return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$spec$2d$extension$2f$adapters$2f$reflect$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ReflectAdapter"].get(target, prop, receiver); } } }); } /** * @param headers * @returns A fresh object identity backed by the original value */ static fresh(headers) { return new Proxy(headers, { get (target, prop, receiver) { return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$spec$2d$extension$2f$adapters$2f$reflect$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ReflectAdapter"].get(target, prop, receiver); } }); } /** * Merges a header value into a string. This stores multiple values as an * array, so we need to merge them into a string. * * @param value a header value * @returns a merged header value (a string) */ merge(value) { if (Array.isArray(value)) return value.join(', '); return value; } /** * Creates a Headers instance from a plain object or a Headers instance. * * @param headers a plain object or a Headers instance * @returns a headers instance */ static from(headers) { if (headers instanceof Headers) return headers; return new HeadersAdapter(headers); } append(name, value) { const existing = this.headers[name]; if (typeof existing === 'string') { this.headers[name] = [ existing, value ]; } else if (Array.isArray(existing)) { existing.push(value); } else { this.headers[name] = value; } } delete(name) { delete this.headers[name]; } get(name) { const value = this.headers[name]; if (typeof value !== 'undefined') return this.merge(value); return null; } has(name) { return typeof this.headers[name] !== 'undefined'; } set(name, value) { this.headers[name] = value; } forEach(callbackfn, thisArg) { for (const [name, value] of this.entries()){ callbackfn.call(thisArg, value, name, this); } } *entries() { for (const key of Object.keys(this.headers)){ const name = key.toLowerCase(); // We assert here that this is a string because we got it from the // Object.keys() call above. const value = this.get(name); yield [ name, value ]; } } *keys() { for (const key of Object.keys(this.headers)){ const name = key.toLowerCase(); yield name; } } *values() { for (const key of Object.keys(this.headers)){ // We assert here that this is a string because we got it from the // Object.keys() call above. const value = this.get(key); yield value; } } [Symbol.iterator]() { return this.entries(); } } }), "[project]/node_modules/next/dist/esm/server/web/spec-extension/adapters/next-request.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "NextRequestAdapter", ()=>NextRequestAdapter, "ResponseAborted", ()=>ResponseAborted, "ResponseAbortedName", ()=>ResponseAbortedName, "createAbortController", ()=>createAbortController, "signalFromNodeResponse", ()=>signalFromNodeResponse ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$request$2d$meta$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/request-meta.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/web/utils.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$spec$2d$extension$2f$request$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/web/spec-extension/request.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$base$2d$http$2f$helpers$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/base-http/helpers.js [app-route] (ecmascript)"); ; ; ; ; const ResponseAbortedName = 'ResponseAborted'; class ResponseAborted extends Error { constructor(...args){ super(...args), this.name = ResponseAbortedName; } } function createAbortController(response) { const controller = new AbortController(); // If `finish` fires first, then `res.end()` has been called and the close is // just us finishing the stream on our side. If `close` fires first, then we // know the client disconnected before we finished. response.once('close', ()=>{ if (response.writableFinished) return; controller.abort(new ResponseAborted()); }); return controller; } function signalFromNodeResponse(response) { const { errored, destroyed } = response; if (errored || destroyed) { return AbortSignal.abort(errored ?? new ResponseAborted()); } const { signal } = createAbortController(response); return signal; } class NextRequestAdapter { static fromBaseNextRequest(request, signal) { if (// environment variable check provides dead code elimination. ("TURBOPACK compile-time value", "nodejs") === 'edge' && (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$base$2d$http$2f$helpers$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["isWebNextRequest"])(request)) //TURBOPACK unreachable ; else if (// environment variable check provides dead code elimination. ("TURBOPACK compile-time value", "nodejs") !== 'edge' && (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$base$2d$http$2f$helpers$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["isNodeNextRequest"])(request)) { return NextRequestAdapter.fromNodeNextRequest(request, signal); } else { throw Object.defineProperty(new Error('Invariant: Unsupported NextRequest type'), "__NEXT_ERROR_CODE", { value: "E345", enumerable: false, configurable: true }); } } static fromNodeNextRequest(request, signal) { // HEAD and GET requests can not have a body. let body = null; if (request.method !== 'GET' && request.method !== 'HEAD' && request.body) { // @ts-expect-error - this is handled by undici, when streams/web land use it instead body = request.body; } let url; if (request.url.startsWith('http')) { url = new URL(request.url); } else { // Grab the full URL from the request metadata. const base = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$request$2d$meta$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["getRequestMeta"])(request, 'initURL'); if (!base || !base.startsWith('http')) { // Because the URL construction relies on the fact that the URL provided // is absolute, we need to provide a base URL. We can't use the request // URL because it's relative, so we use a dummy URL instead. url = new URL(request.url, 'http://n'); } else { url = new URL(request.url, base); } } return new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$spec$2d$extension$2f$request$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["NextRequest"](url, { method: request.method, headers: (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["fromNodeOutgoingHttpHeaders"])(request.headers), duplex: 'half', signal, // geo // ip // nextConfig // body can not be passed if request was aborted // or we get a Request body was disturbed error ...signal.aborted ? {} : { body } }); } static fromWebNextRequest(request) { // HEAD and GET requests can not have a body. let body = null; if (request.method !== 'GET' && request.method !== 'HEAD') { body = request.body; } return new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$spec$2d$extension$2f$request$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["NextRequest"](request.url, { method: request.method, headers: (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["fromNodeOutgoingHttpHeaders"])(request.headers), duplex: 'half', signal: request.request.signal, // geo // ip // nextConfig // body can not be passed if request was aborted // or we get a Request body was disturbed error ...request.request.signal.aborted ? {} : { body } }); } } }), "[project]/node_modules/next/dist/esm/server/web/spec-extension/adapters/reflect.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "ReflectAdapter", ()=>ReflectAdapter ]); class ReflectAdapter { static get(target, prop, receiver) { const value = Reflect.get(target, prop, receiver); if (typeof value === 'function') { return value.bind(target); } return value; } static set(target, prop, value, receiver) { return Reflect.set(target, prop, value, receiver); } static has(target, prop) { return Reflect.has(target, prop); } static deleteProperty(target, prop) { return Reflect.deleteProperty(target, prop); } } }), "[project]/node_modules/next/dist/esm/server/web/spec-extension/cookies.js [app-route] (ecmascript) ", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f40$edge$2d$runtime$2f$cookies$2f$index$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/compiled/@edge-runtime/cookies/index.js [app-route] (ecmascript)"); ; }), "[project]/node_modules/next/dist/esm/server/web/spec-extension/request.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "INTERNALS", ()=>INTERNALS, "NextRequest", ()=>NextRequest ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$next$2d$url$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/web/next-url.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/web/utils.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$error$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/web/error.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$spec$2d$extension$2f$cookies$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__$3c$locals$3e$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/server/web/spec-extension/cookies.js [app-route] (ecmascript) "); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f40$edge$2d$runtime$2f$cookies$2f$index$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/compiled/@edge-runtime/cookies/index.js [app-route] (ecmascript)"); ; ; ; ; const INTERNALS = Symbol('internal request'); class NextRequest extends Request { constructor(input, init = {}){ const url = typeof input !== 'string' && 'url' in input ? input.url : String(input); (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["validateURL"])(url); // node Request instance requires duplex option when a body // is present or it errors, we don't handle this for // Request being passed in since it would have already // errored if this wasn't configured if ("TURBOPACK compile-time truthy", 1) { if (init.body && init.duplex !== 'half') { init.duplex = 'half'; } } if (input instanceof Request) super(input, init); else super(url, init); const nextUrl = new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$next$2d$url$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["NextURL"](url, { headers: (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$utils$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["toNodeOutgoingHttpHeaders"])(this.headers), nextConfig: init.nextConfig }); this[INTERNALS] = { cookies: new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$compiled$2f40$edge$2d$runtime$2f$cookies$2f$index$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["RequestCookies"](this.headers), nextUrl, url: ("TURBOPACK compile-time falsy", 0) ? "TURBOPACK unreachable" : nextUrl.toString() }; } [Symbol.for('edge-runtime.inspect.custom')]() { return { cookies: this.cookies, nextUrl: this.nextUrl, url: this.url, // rest of props come from Request 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[INTERNALS].cookies; } get nextUrl() { return this[INTERNALS].nextUrl; } /** * @deprecated * `page` has been deprecated in favour of `URLPattern`. * Read more: https://nextjs.org/docs/messages/middleware-request-page */ get page() { throw new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$error$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["RemovedPageError"](); } /** * @deprecated * `ua` has been removed in favour of \`userAgent\` function. * Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent */ get ua() { throw new __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$server$2f$web$2f$error$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["RemovedUAError"](); } get url() { return this[INTERNALS].url; } } }), "[project]/node_modules/next/dist/esm/server/web/utils.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "fromNodeOutgoingHttpHeaders", ()=>fromNodeOutgoingHttpHeaders, "normalizeNextQueryParam", ()=>normalizeNextQueryParam, "splitCookiesString", ()=>splitCookiesString, "toNodeOutgoingHttpHeaders", ()=>toNodeOutgoingHttpHeaders, "validateURL", ()=>validateURL ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/lib/constants.js [app-route] (ecmascript)"); ; function fromNodeOutgoingHttpHeaders(nodeHeaders) { const headers = new Headers(); for (let [key, value] of Object.entries(nodeHeaders)){ const values = Array.isArray(value) ? value : [ value ]; for (let v of values){ if (typeof v === 'undefined') continue; if (typeof v === 'number') { v = v.toString(); } headers.append(key, v); } } return headers; } function splitCookiesString(cookiesString) { var cookiesStrings = []; var pos = 0; var start; var ch; var lastComma; var nextStart; var cookiesSeparatorFound; function skipWhitespace() { while(pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))){ pos += 1; } return pos < cookiesString.length; } function notSpecialChar() { ch = cookiesString.charAt(pos); return ch !== '=' && ch !== ';' && ch !== ','; } while(pos < cookiesString.length){ start = pos; cookiesSeparatorFound = false; while(skipWhitespace()){ ch = cookiesString.charAt(pos); if (ch === ',') { // ',' is a cookie separator if we have later first '=', not ';' or ',' lastComma = pos; pos += 1; skipWhitespace(); nextStart = pos; while(pos < cookiesString.length && notSpecialChar()){ pos += 1; } // currently special character if (pos < cookiesString.length && cookiesString.charAt(pos) === '=') { // we found cookies separator cookiesSeparatorFound = true; // pos is inside the next cookie, so back up and return it. pos = nextStart; cookiesStrings.push(cookiesString.substring(start, lastComma)); start = pos; } else { // in param ',' or param separator ';', // we continue from that comma pos = lastComma + 1; } } else { pos += 1; } } if (!cookiesSeparatorFound || pos >= cookiesString.length) { cookiesStrings.push(cookiesString.substring(start, cookiesString.length)); } } return cookiesStrings; } function toNodeOutgoingHttpHeaders(headers) { const nodeHeaders = {}; const cookies = []; if (headers) { for (const [key, value] of headers.entries()){ if (key.toLowerCase() === 'set-cookie') { // We may have gotten a comma joined string of cookies, or multiple // set-cookie headers. We need to merge them into one header array // to represent all the cookies. cookies.push(...splitCookiesString(value)); nodeHeaders[key] = cookies.length === 1 ? cookies[0] : cookies; } else { nodeHeaders[key] = value; } } } return nodeHeaders; } function validateURL(url) { try { return String(new URL(String(url))); } catch (error) { throw Object.defineProperty(new Error(`URL is malformed "${String(url)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`, { cause: error }), "__NEXT_ERROR_CODE", { value: "E61", enumerable: false, configurable: true }); } } function normalizeNextQueryParam(key) { const prefixes = [ __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["NEXT_QUERY_PARAM_PREFIX"], __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$lib$2f$constants$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["NEXT_INTERCEPTION_MARKER_PREFIX"] ]; for (const prefix of prefixes){ if (key !== prefix && key.startsWith(prefix)) { return key.substring(prefix.length); } } return null; } }), "[project]/node_modules/next/dist/esm/shared/lib/errors/constants.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "MISSING_ROOT_TAGS_ERROR", ()=>MISSING_ROOT_TAGS_ERROR ]); const MISSING_ROOT_TAGS_ERROR = 'NEXT_MISSING_ROOT_TAGS'; }), "[project]/node_modules/next/dist/esm/shared/lib/get-hostname.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; /** * Takes an object with a hostname property (like a parsed URL) and some * headers that may contain Host and returns the preferred hostname. * @param parsed An object containing a hostname property. * @param headers A dictionary with headers containing a `host`. */ __turbopack_context__.s([ "getHostname", ()=>getHostname ]); function getHostname(parsed, headers) { // Get the hostname from the headers if it exists, otherwise use the parsed // hostname. let hostname; if (headers?.host && !Array.isArray(headers.host)) { hostname = headers.host.toString().split(':', 1)[0]; } else if (parsed.hostname) { hostname = parsed.hostname; } else return; return hostname.toLowerCase(); } }), "[project]/node_modules/next/dist/esm/shared/lib/hash.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; // http://www.cse.yorku.ca/~oz/hash.html // More specifically, 32-bit hash via djbxor // (ref: https://gist.github.com/eplawless/52813b1d8ad9af510d85?permalink_comment_id=3367765#gistcomment-3367765) // This is due to number type differences between rust for turbopack to js number types, // where rust does not have easy way to repreesnt js's 53-bit float number type for the matching // overflow behavior. This is more `correct` in terms of having canonical hash across different runtime / implementation // as can gaurantee determinstic output from 32bit hash. __turbopack_context__.s([ "djb2Hash", ()=>djb2Hash, "hexHash", ()=>hexHash ]); function djb2Hash(str) { let hash = 5381; for(let i = 0; i < str.length; i++){ const char = str.charCodeAt(i); hash = (hash << 5) + hash + char & 0xffffffff; } return hash >>> 0; } function hexHash(str) { return djb2Hash(str).toString(36).slice(0, 5); } }), "[project]/node_modules/next/dist/esm/shared/lib/i18n/detect-domain-locale.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "detectDomainLocale", ()=>detectDomainLocale ]); function detectDomainLocale(domainItems, hostname, detectedLocale) { if (!domainItems) return; if (detectedLocale) { detectedLocale = detectedLocale.toLowerCase(); } for (const item of domainItems){ // remove port if present const domainHostname = item.domain?.split(':', 1)[0].toLowerCase(); if (hostname === domainHostname || detectedLocale === item.defaultLocale.toLowerCase() || item.locales?.some((locale)=>locale.toLowerCase() === detectedLocale)) { return item; } } } }), "[project]/node_modules/next/dist/esm/shared/lib/i18n/normalize-locale-path.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "normalizeLocalePath", ()=>normalizeLocalePath ]); /** * A cache of lowercased locales for each list of locales. This is stored as a * WeakMap so if the locales are garbage collected, the cache entry will be * removed as well. */ const cache = new WeakMap(); function normalizeLocalePath(pathname, locales) { // If locales is undefined, return the pathname as is. if (!locales) return { pathname }; // Get the cached lowercased locales or create a new cache entry. let lowercasedLocales = cache.get(locales); if (!lowercasedLocales) { lowercasedLocales = locales.map((locale)=>locale.toLowerCase()); cache.set(locales, lowercasedLocales); } let detectedLocale; // The first segment will be empty, because it has a leading `/`. If // there is no further segment, there is no locale (or it's the default). const segments = pathname.split('/', 2); // If there's no second segment (ie, the pathname is just `/`), there's no // locale. if (!segments[1]) return { pathname }; // The second segment will contain the locale part if any. const segment = segments[1].toLowerCase(); // See if the segment matches one of the locales. If it doesn't, there is // no locale (or it's the default). const index = lowercasedLocales.indexOf(segment); if (index < 0) return { pathname }; // Return the case-sensitive locale. detectedLocale = locales[index]; // Remove the `/${locale}` part of the pathname. pathname = pathname.slice(detectedLocale.length + 1) || '/'; return { pathname, detectedLocale }; } }), "[project]/node_modules/next/dist/esm/shared/lib/instant-messages.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "createLinkPrefetchPartialError", ()=>createLinkPrefetchPartialError, "createUnrenderedSegmentError", ()=>createUnrenderedSegmentError ]); function createUnrenderedSegmentError(route, missingFiles) { let message = `Route "${route}": Could not validate that a segment in your UI has instant navigation.`; if (missingFiles.length > 0) { const label = missingFiles.length === 1 ? 'Dropped segment' : 'Dropped segments'; message += `\n\nThis segment was dropped from rendering. Issues that would prevent instant navigation will go undetected.` + `\n\n${label}:\n${missingFiles.map((p)=>` ${p}`).join('\n')}` + `\n\nWays to fix this:` + `\n - [render] Render the dropped segment` + `\n - [ignore] Set \`export const instant = false\` to opt the dropped segment out of instant-navigation validation` + `\n\nLearn more: https://nextjs.org/docs/messages/instant-unrendered-segment`; } return Object.defineProperty(new Error(message), "__NEXT_ERROR_CODE", { value: "E1286", enumerable: false, configurable: true }); } function createLinkPrefetchPartialError(pathname) { return Object.defineProperty(new Error(`Next.js encountered dynamic data during prefetching for "${pathname}".\n\n` + `This will lead to slower, more expensive prefetches.\n\n` + `Ways to fix this:\n` + ` - [upgrade] Opt into Partial Prefetching by exporting \`const prefetch = 'partial'\` from the page or layout, or by setting \`partialPrefetching: true\` in next.config to opt the whole app in\n` + ` - [disable] Remove \`prefetch={true}\` from the to use the default prefetch\n` + ` - [ignore] Set \`export const instant = false\` to opt the route out of instant-navigation validation\n\n` + `Learn more: https://nextjs.org/docs/messages/instant-link-prefetch-partial`), "__NEXT_ERROR_CODE", { value: "E1435", enumerable: false, configurable: true }); } }), "[project]/node_modules/next/dist/esm/shared/lib/invariant-error.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "InvariantError", ()=>InvariantError ]); class InvariantError extends Error { constructor(message, options){ super(`Invariant: ${message.endsWith('.') ? message : message + '.'} This is a bug in Next.js.`, options); Object.defineProperty(this, "__NEXT_ERROR_CODE", { value: "E1179", enumerable: false, configurable: true }); this.name = 'InvariantError'; } } }), "[project]/node_modules/next/dist/esm/shared/lib/is-thenable.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; /** * Check to see if a value is Thenable. * * @param promise the maybe-thenable value * @returns true if the value is thenable */ __turbopack_context__.s([ "isThenable", ()=>isThenable ]); function isThenable(promise) { return promise !== null && typeof promise === 'object' && 'then' in promise && typeof promise.then === 'function'; } }), "[project]/node_modules/next/dist/esm/shared/lib/lazy-dynamic/bailout-to-csr.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "BailoutToCSRError", ()=>BailoutToCSRError, "isBailoutToCSRError", ()=>isBailoutToCSRError ]); // This has to be a shared module which is shared between client component error boundary and dynamic component const BAILOUT_TO_CSR = 'BAILOUT_TO_CLIENT_SIDE_RENDERING'; class BailoutToCSRError extends Error { constructor(reason){ super(`Bail out to client-side rendering: ${reason}`), this.reason = reason, this.digest = BAILOUT_TO_CSR; } } function isBailoutToCSRError(err) { if (typeof err !== 'object' || err === null || !('digest' in err)) { return false; } return err.digest === BAILOUT_TO_CSR; } }), "[project]/node_modules/next/dist/esm/shared/lib/page-path/ensure-leading-slash.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; /** * For a given page path, this function ensures that there is a leading slash. * If there is not a leading slash, one is added, otherwise it is noop. */ __turbopack_context__.s([ "ensureLeadingSlash", ()=>ensureLeadingSlash ]); function ensureLeadingSlash(path) { return path.startsWith('/') ? path : `/${path}`; } }), "[project]/node_modules/next/dist/esm/shared/lib/promise-with-resolvers.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "createPromiseWithResolvers", ()=>createPromiseWithResolvers ]); function createPromiseWithResolvers() { // Shim of Stage 4 Promise.withResolvers proposal let resolve; let reject; const promise = new Promise((res, rej)=>{ resolve = res; reject = rej; }); return { resolve: resolve, reject: reject, promise }; } }), "[project]/node_modules/next/dist/esm/shared/lib/request-insights.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "getRequestInsightKey", ()=>getRequestInsightKey, "getRequestInsightKind", ()=>getRequestInsightKind ]); function getRequestInsightKind(insight) { return insight.kind ?? 'request'; } function getRequestInsightKey(insight) { return `${getRequestInsightKind(insight)}:${insight.requestId}`; } }), "[project]/node_modules/next/dist/esm/shared/lib/router/utils/add-locale.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "addLocale", ()=>addLocale ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$add$2d$path$2d$prefix$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/router/utils/add-path-prefix.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$path$2d$has$2d$prefix$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/router/utils/path-has-prefix.js [app-route] (ecmascript)"); ; ; function addLocale(path, locale, defaultLocale, ignorePrefix) { // If no locale was given or the locale is the default locale, we don't need // to prefix the path. if (!locale || locale === defaultLocale) return path; const lower = path.toLowerCase(); // If the path is an API path or the path already has the locale prefix, we // don't need to prefix the path. if (!ignorePrefix) { if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$path$2d$has$2d$prefix$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["pathHasPrefix"])(lower, '/api')) return path; if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$path$2d$has$2d$prefix$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["pathHasPrefix"])(lower, `/${locale.toLowerCase()}`)) return path; } // Add the locale prefix to the path. return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$add$2d$path$2d$prefix$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["addPathPrefix"])(path, `/${locale}`); } }), "[project]/node_modules/next/dist/esm/shared/lib/router/utils/add-path-prefix.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "addPathPrefix", ()=>addPathPrefix ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$parse$2d$path$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/router/utils/parse-path.js [app-route] (ecmascript)"); ; function addPathPrefix(path, prefix) { if (!path.startsWith('/') || !prefix) { return path; } const { pathname, query, hash } = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$parse$2d$path$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["parsePath"])(path); return `${prefix}${pathname}${query}${hash}`; } }), "[project]/node_modules/next/dist/esm/shared/lib/router/utils/add-path-suffix.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "addPathSuffix", ()=>addPathSuffix ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$parse$2d$path$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/router/utils/parse-path.js [app-route] (ecmascript)"); ; function addPathSuffix(path, suffix) { if (!path.startsWith('/') || !suffix) { return path; } const { pathname, query, hash } = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$parse$2d$path$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["parsePath"])(path); return `${pathname}${suffix}${query}${hash}`; } }), "[project]/node_modules/next/dist/esm/shared/lib/router/utils/app-paths.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "compareAppPaths", ()=>compareAppPaths, "normalizeAppPath", ()=>normalizeAppPath, "normalizeRscURL", ()=>normalizeRscURL ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$page$2d$path$2f$ensure$2d$leading$2d$slash$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/page-path/ensure-leading-slash.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$segment$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/segment.js [app-route] (ecmascript)"); ; ; function normalizeAppPath(route) { return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$page$2d$path$2f$ensure$2d$leading$2d$slash$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["ensureLeadingSlash"])(route.split('/').reduce((pathname, segment, index, segments)=>{ // Empty segments are ignored. if (!segment) { return pathname; } // Groups are ignored. if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$segment$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["isGroupSegment"])(segment)) { return pathname; } // Parallel segments are ignored. if (segment[0] === '@') { return pathname; } // The last segment (if it's a leaf) should be ignored. if ((segment === 'page' || segment === 'route') && index === segments.length - 1) { return pathname; } return `${pathname}/${segment}`; }, '')); } function compareAppPaths(a, b) { const aHasSlot = a.includes('/@'); const bHasSlot = b.includes('/@'); if (aHasSlot && !bHasSlot) return -1; if (!aHasSlot && bHasSlot) return 1; return a.localeCompare(b); } function normalizeRscURL(url) { return url.replace(/\.rsc($|\?)/, '$1'); } }), "[project]/node_modules/next/dist/esm/shared/lib/router/utils/cache-busting-search-param.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "computeCacheBustingSearchParam", ()=>computeCacheBustingSearchParam, "computeLegacyCacheBustingSearchParam", ()=>computeLegacyCacheBustingSearchParam ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$hash$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/hash.js [app-route] (ecmascript)"); ; const CACHE_BUSTING_SEARCH_PARAM_DIGEST_BYTES = 12; const textEncoder = new TextEncoder(); function encodeCacheBustingSearchParam(bytes) { let binary = ''; for(let i = 0; i < bytes.length; i++){ binary += String.fromCharCode(bytes[i]); } return btoa(binary).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''); } function normalizeCacheBustingInput(value) { if (value === undefined) { return '0'; } return Array.isArray(value) ? value.join(',') : value; } function createCacheBustingSearchParamInput(prefetchHeader, segmentPrefetchHeader, stateTreeHeader, nextUrlHeader) { if ((prefetchHeader === undefined || prefetchHeader === '0') && segmentPrefetchHeader === undefined && stateTreeHeader === undefined && nextUrlHeader === undefined) { return null; } return [ prefetchHeader ?? '0', normalizeCacheBustingInput(segmentPrefetchHeader), normalizeCacheBustingInput(stateTreeHeader), normalizeCacheBustingInput(nextUrlHeader) ].join(','); } async function computeCacheBustingSearchParamFromInput(input) { // Truncate SHA-256 to 96 bits to keep `_rsc` compact const digest = await globalThis.crypto.subtle.digest('SHA-256', textEncoder.encode(input)); return encodeCacheBustingSearchParam(new Uint8Array(digest).subarray(0, CACHE_BUSTING_SEARCH_PARAM_DIGEST_BYTES)); } async function computeCacheBustingSearchParam(prefetchHeader, segmentPrefetchHeader, stateTreeHeader, nextUrlHeader) { const input = createCacheBustingSearchParamInput(prefetchHeader, segmentPrefetchHeader, stateTreeHeader, nextUrlHeader); if (input === null) { return ''; } return computeCacheBustingSearchParamFromInput(input); } function computeLegacyCacheBustingSearchParam(prefetchHeader, segmentPrefetchHeader, stateTreeHeader, nextUrlHeader) { const input = createCacheBustingSearchParamInput(prefetchHeader, segmentPrefetchHeader, stateTreeHeader, nextUrlHeader); if (input === null) { return ''; } return (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$hash$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["hexHash"])(input); } }), "[project]/node_modules/next/dist/esm/shared/lib/router/utils/format-next-pathname-info.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "formatNextPathnameInfo", ()=>formatNextPathnameInfo ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$remove$2d$trailing$2d$slash$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/router/utils/remove-trailing-slash.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$add$2d$path$2d$prefix$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/router/utils/add-path-prefix.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$add$2d$path$2d$suffix$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/router/utils/add-path-suffix.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$add$2d$locale$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/router/utils/add-locale.js [app-route] (ecmascript)"); ; ; ; ; function formatNextPathnameInfo(info) { let pathname = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$add$2d$locale$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["addLocale"])(info.pathname, info.locale, info.buildId ? undefined : info.defaultLocale, info.ignorePrefix); if (info.buildId || !info.trailingSlash) { pathname = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$remove$2d$trailing$2d$slash$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["removeTrailingSlash"])(pathname); } if (info.buildId) { pathname = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$add$2d$path$2d$suffix$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["addPathSuffix"])((0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$add$2d$path$2d$prefix$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["addPathPrefix"])(pathname, `/_next/data/${info.buildId}`), info.pathname === '/' ? 'index.json' : '.json'); } pathname = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$add$2d$path$2d$prefix$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["addPathPrefix"])(pathname, info.basePath); return !info.buildId && info.trailingSlash ? !pathname.endsWith('/') ? (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$add$2d$path$2d$suffix$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["addPathSuffix"])(pathname, '/') : pathname : (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$remove$2d$trailing$2d$slash$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["removeTrailingSlash"])(pathname); } }), "[project]/node_modules/next/dist/esm/shared/lib/router/utils/get-next-pathname-info.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "getNextPathnameInfo", ()=>getNextPathnameInfo ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$i18n$2f$normalize$2d$locale$2d$path$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/i18n/normalize-locale-path.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$remove$2d$path$2d$prefix$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/router/utils/remove-path-prefix.js [app-route] (ecmascript)"); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$path$2d$has$2d$prefix$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/router/utils/path-has-prefix.js [app-route] (ecmascript)"); ; ; ; function getNextPathnameInfo(pathname, options) { const { basePath, i18n, trailingSlash } = options.nextConfig ?? {}; const info = { pathname, trailingSlash: pathname !== '/' ? pathname.endsWith('/') : trailingSlash }; if (basePath && (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$path$2d$has$2d$prefix$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["pathHasPrefix"])(info.pathname, basePath)) { info.pathname = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$remove$2d$path$2d$prefix$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["removePathPrefix"])(info.pathname, basePath); info.basePath = basePath; } let pathnameNoDataPrefix = info.pathname; if (info.pathname.startsWith('/_next/data/') && info.pathname.endsWith('.json')) { const paths = info.pathname.replace(/^\/_next\/data\//, '').replace(/\.json$/, '').split('/'); const buildId = paths[0]; info.buildId = buildId; pathnameNoDataPrefix = paths[1] !== 'index' ? `/${paths.slice(1).join('/')}` : '/'; // update pathname with normalized if enabled although // we use normalized to populate locale info still if (options.parseData === true) { info.pathname = pathnameNoDataPrefix; } } // If provided, use the locale route normalizer to detect the locale instead // of the function below. if (i18n) { let result = options.i18nProvider ? options.i18nProvider.analyze(info.pathname) : (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$i18n$2f$normalize$2d$locale$2d$path$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["normalizeLocalePath"])(info.pathname, i18n.locales); info.locale = result.detectedLocale; info.pathname = result.pathname ?? info.pathname; if (!result.detectedLocale && info.buildId) { result = options.i18nProvider ? options.i18nProvider.analyze(pathnameNoDataPrefix) : (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$i18n$2f$normalize$2d$locale$2d$path$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["normalizeLocalePath"])(pathnameNoDataPrefix, i18n.locales); if (result.detectedLocale) { info.locale = result.detectedLocale; } } } return info; } }), "[project]/node_modules/next/dist/esm/shared/lib/router/utils/parse-path.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; /** * Given a path this function will find the pathname, query and hash and return * them. This is useful to parse full paths on the client side. * @param path A path to parse e.g. /foo/bar?id=1#hash */ __turbopack_context__.s([ "parsePath", ()=>parsePath ]); function parsePath(path) { const hashIndex = path.indexOf('#'); const queryIndex = path.indexOf('?'); const hasQuery = queryIndex > -1 && (hashIndex < 0 || queryIndex < hashIndex); if (hasQuery || hashIndex > -1) { return { pathname: path.substring(0, hasQuery ? queryIndex : hashIndex), query: hasQuery ? path.substring(queryIndex, hashIndex > -1 ? hashIndex : undefined) : '', hash: hashIndex > -1 ? path.slice(hashIndex) : '' }; } return { pathname: path, query: '', hash: '' }; } }), "[project]/node_modules/next/dist/esm/shared/lib/router/utils/path-has-prefix.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "pathHasPrefix", ()=>pathHasPrefix ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$parse$2d$path$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/router/utils/parse-path.js [app-route] (ecmascript)"); ; function pathHasPrefix(path, prefix) { if (typeof path !== 'string') { return false; } const { pathname } = (0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$parse$2d$path$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["parsePath"])(path); return pathname === prefix || pathname.startsWith(prefix + '/'); } }), "[project]/node_modules/next/dist/esm/shared/lib/router/utils/remove-path-prefix.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "removePathPrefix", ()=>removePathPrefix ]); var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$path$2d$has$2d$prefix$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/dist/esm/shared/lib/router/utils/path-has-prefix.js [app-route] (ecmascript)"); ; function removePathPrefix(path, prefix) { // If the path doesn't start with the prefix we can return it as is. This // protects us from situations where the prefix is a substring of the path // prefix such as: // // For prefix: /blog // // /blog -> true // /blog/ -> true // /blog/1 -> true // /blogging -> false // /blogging/ -> false // /blogging/1 -> false if (!(0, __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$dist$2f$esm$2f$shared$2f$lib$2f$router$2f$utils$2f$path$2d$has$2d$prefix$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["pathHasPrefix"])(path, prefix)) { return path; } // Remove the prefix from the path via slicing. const withoutPrefix = path.slice(prefix.length); // If the path without the prefix starts with a `/` we can return it as is. if (withoutPrefix.startsWith('/')) { return withoutPrefix; } // If the path without the prefix doesn't start with a `/` we need to add it // back to the path to make sure it's a valid path. return `/${withoutPrefix}`; } }), "[project]/node_modules/next/dist/esm/shared/lib/router/utils/remove-trailing-slash.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; /** * Removes the trailing slash for a given route or page path. Examples: * - `/foo/bar/` -> `/foo/bar` * - `/foo/bar` -> `/foo/bar` * * Uses charCodeAt (47 === '/') instead of regex to avoid the overhead of * compiling and executing a RegExp on every call (~3-5x faster). */ __turbopack_context__.s([ "removeTrailingSlash", ()=>removeTrailingSlash ]); function removeTrailingSlash(route) { return route.charCodeAt(route.length - 1) === 47 && route.length > 1 ? route.slice(0, -1) : route; } }), "[project]/node_modules/next/dist/esm/shared/lib/segment.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "DEFAULT_SEGMENT_KEY", ()=>DEFAULT_SEGMENT_KEY, "NOT_FOUND_SEGMENT_KEY", ()=>NOT_FOUND_SEGMENT_KEY, "PAGE_SEGMENT_KEY", ()=>PAGE_SEGMENT_KEY, "addSearchParamsIfPageSegment", ()=>addSearchParamsIfPageSegment, "computeSelectedLayoutSegment", ()=>computeSelectedLayoutSegment, "getSegmentValue", ()=>getSegmentValue, "getSelectedLayoutSegmentPath", ()=>getSelectedLayoutSegmentPath, "isGroupSegment", ()=>isGroupSegment, "isParallelRouteSegment", ()=>isParallelRouteSegment ]); function getSegmentValue(segment) { return Array.isArray(segment) ? segment[1] : segment; } function isGroupSegment(segment) { // Use array[0] for performant purpose return segment[0] === '(' && segment.endsWith(')'); } function isParallelRouteSegment(segment) { return segment.startsWith('@') && segment !== '@children'; } function addSearchParamsIfPageSegment(segment, searchParams) { const isPageSegment = segment.includes(PAGE_SEGMENT_KEY); if (isPageSegment) { const stringifiedQuery = JSON.stringify(searchParams); return stringifiedQuery !== '{}' ? PAGE_SEGMENT_KEY + '?' + stringifiedQuery : PAGE_SEGMENT_KEY; } return segment; } function computeSelectedLayoutSegment(segments, parallelRouteKey) { if (!segments || segments.length === 0) { return null; } // For 'children', use first segment; for other parallel routes, use last segment const rawSegment = parallelRouteKey === 'children' ? segments[0] : segments[segments.length - 1]; // If the default slot is showing, return null since it's not technically "selected" (it's a fallback) // Returning an internal value like `__DEFAULT__` would be confusing return rawSegment === DEFAULT_SEGMENT_KEY ? null : rawSegment; } function getSelectedLayoutSegmentPath(tree, parallelRouteKey, first = true, segmentPath = []) { let node; if (first) { // Use the provided parallel route key on the first parallel route node = tree[1][parallelRouteKey]; } else { // After first parallel route prefer children, if there's no children pick the first parallel route. const parallelRoutes = tree[1]; node = parallelRoutes.children ?? Object.values(parallelRoutes)[0]; } if (!node) return segmentPath; const segment = node[0]; let segmentValue = getSegmentValue(segment); if (!segmentValue || segmentValue.startsWith(PAGE_SEGMENT_KEY)) { return segmentPath; } segmentPath.push(segmentValue); return getSelectedLayoutSegmentPath(node, parallelRouteKey, false, segmentPath); } const PAGE_SEGMENT_KEY = '__PAGE__'; const DEFAULT_SEGMENT_KEY = '__DEFAULT__'; const NOT_FOUND_SEGMENT_KEY = '/_not-found'; }), "[project]/node_modules/next/dist/esm/shared/lib/server-reference-info.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "SERVER_REFERENCE_ID_LENGTH", ()=>SERVER_REFERENCE_ID_LENGTH, "extractInfoFromServerReferenceId", ()=>extractInfoFromServerReferenceId, "mightBeServerReferenceId", ()=>mightBeServerReferenceId, "omitUnusedArgs", ()=>omitUnusedArgs ]); const SERVER_REFERENCE_ID_LENGTH = 42; function mightBeServerReferenceId(id) { return id.length === SERVER_REFERENCE_ID_LENGTH; } function extractInfoFromServerReferenceId(id) { const infoByte = parseInt(id.slice(0, 2), 16); const typeBit = infoByte >> 7 & 0x1; const argMask = infoByte >> 1 & 0x3f; const restArgs = infoByte & 0x1; const usedArgs = Array(6); for(let index = 0; index < 6; index++){ const bitPosition = 5 - index; const bit = argMask >> bitPosition & 0x1; usedArgs[index] = bit === 1; } return { type: typeBit === 1 ? 'use-cache' : 'server-action', usedArgs: usedArgs, hasRestArgs: restArgs === 1 }; } function omitUnusedArgs(args, info) { const filteredArgs = new Array(args.length); let length = 0; for(let index = 0; index < args.length; index++){ if (index < 6 && info.usedArgs[index] || // This assumes that the server reference info byte has the restArgs bit // set to 1 if there are more than 6 args. index >= 6 && info.hasRestArgs) { filteredArgs[index] = args[index]; length = index + 1; } } // Trim trailing unused args from the array. filteredArgs.length = length; return filteredArgs; } }), "[project]/node_modules/next/dist/esm/shared/lib/utils/reflect-utils.js [app-route] (ecmascript)", ((__turbopack_context__) => { "use strict"; __turbopack_context__.s([ "describeHasCheckingStringProperty", ()=>describeHasCheckingStringProperty, "describeStringPropertyAccess", ()=>describeStringPropertyAccess, "wellKnownProperties", ()=>wellKnownProperties ]); // This regex will have fast negatives meaning valid identifiers may not pass // this test. However this is only used during static generation to provide hints // about why a page bailed out of some or all prerendering and we can use bracket notation // for example while `ಠ_ಠ` is a valid identifier it's ok to print `searchParams['ಠ_ಠ']` // even if this would have been fine too `searchParams.ಠ_ಠ` const isDefinitelyAValidIdentifier = /^[A-Za-z_$][A-Za-z0-9_$]*$/; function describeStringPropertyAccess(target, prop) { if (isDefinitelyAValidIdentifier.test(prop)) { return `\`${target}.${prop}\``; } return `\`${target}[${JSON.stringify(prop)}]\``; } function describeHasCheckingStringProperty(target, prop) { const stringifiedProp = JSON.stringify(prop); return `\`Reflect.has(${target}, ${stringifiedProp})\`, \`${stringifiedProp} in ${target}\`, or similar`; } const wellKnownProperties = new Set([ 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toString', 'valueOf', 'toLocaleString', // Promise prototype 'then', 'catch', 'finally', // React Promise extension 'status', // 'value', // 'error', // React introspection 'displayName', '_debugInfo', // Common tested properties 'toJSON', '$$typeof', '__esModule', // Tested by flight when checking for iterables '@@iterator' ]); }), "[project]/node_modules/next/dist/server/route-modules/app-page/module.compiled.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable ; else { if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable ; else { if ("TURBOPACK compile-time truthy", 1) { if ("TURBOPACK compile-time truthy", 1) { module.exports = __turbopack_context__.r("[externals]/next/dist/compiled/next-server/app-page-turbo.runtime.dev.js [external] (next/dist/compiled/next-server/app-page-turbo.runtime.dev.js, cjs)"); } else //TURBOPACK unreachable ; } else //TURBOPACK unreachable ; } } }), "[project]/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; module.exports = __turbopack_context__.r("[project]/node_modules/next/dist/server/route-modules/app-page/module.compiled.js [app-route] (ecmascript)").vendored['react-rsc'].React; }), "[project]/node_modules/safe-buffer/index.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { /*! safe-buffer. MIT License. Feross Aboukhadijeh */ /* eslint-disable node/no-deprecated-api */ var buffer = __turbopack_context__.r("[externals]/buffer [external] (buffer, cjs)"); var Buffer = buffer.Buffer; // alternative to using Object.keys for old browsers function copyProps(src, dst) { for(var key in src){ dst[key] = src[key]; } } if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { module.exports = buffer; } else { // Copy properties from require('buffer') copyProps(buffer, exports); exports.Buffer = SafeBuffer; } function SafeBuffer(arg, encodingOrOffset, length) { return Buffer(arg, encodingOrOffset, length); } SafeBuffer.prototype = Object.create(Buffer.prototype); // Copy static methods from Buffer copyProps(Buffer, SafeBuffer); SafeBuffer.from = function(arg, encodingOrOffset, length) { if (typeof arg === 'number') { throw new TypeError('Argument must not be a number'); } return Buffer(arg, encodingOrOffset, length); }; SafeBuffer.alloc = function(size, fill, encoding) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number'); } var buf = Buffer(size); if (fill !== undefined) { if (typeof encoding === 'string') { buf.fill(fill, encoding); } else { buf.fill(fill); } } else { buf.fill(0); } return buf; }; SafeBuffer.allocUnsafe = function(size) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number'); } return Buffer(size); }; SafeBuffer.allocUnsafeSlow = function(size) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number'); } return buffer.SlowBuffer(size); }; }), "[project]/node_modules/semver/classes/comparator.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const ANY = Symbol('SemVer ANY'); // hoisted class for cyclic dependency class Comparator { static get ANY() { return ANY; } constructor(comp, options){ options = parseOptions(options); if (comp instanceof Comparator) { if (comp.loose === !!options.loose) { return comp; } else { comp = comp.value; } } comp = comp.trim().split(/\s+/).join(' '); debug('comparator', comp, options); this.options = options; this.loose = !!options.loose; this.parse(comp); if (this.semver === ANY) { this.value = ''; } else { this.value = this.operator + this.semver.version; } debug('comp', this); } parse(comp) { const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]; const m = comp.match(r); if (!m) { throw new TypeError(`Invalid comparator: ${comp}`); } this.operator = m[1] !== undefined ? m[1] : ''; if (this.operator === '=') { this.operator = ''; } // if it literally is just '>' or '' then allow anything. if (!m[2]) { this.semver = ANY; } else { this.semver = new SemVer(m[2], this.options.loose); } } toString() { return this.value; } test(version) { debug('Comparator.test', version, this.options.loose); if (this.semver === ANY || version === ANY) { return true; } if (typeof version === 'string') { try { version = new SemVer(version, this.options); } catch (er) { return false; } } return cmp(version, this.operator, this.semver, this.options); } intersects(comp, options) { if (!(comp instanceof Comparator)) { throw new TypeError('a Comparator is required'); } if (this.operator === '') { if (this.value === '') { return true; } return new Range(comp.value, options).test(this.value); } else if (comp.operator === '') { if (comp.value === '') { return true; } return new Range(this.value, options).test(comp.semver); } options = parseOptions(options); // Special cases where nothing can possibly be lower if (options.includePrerelease && (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) { return false; } if (!options.includePrerelease && (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) { return false; } // Same direction increasing (> or >=) if (this.operator.startsWith('>') && comp.operator.startsWith('>')) { return true; } // Same direction decreasing (< or <=) if (this.operator.startsWith('<') && comp.operator.startsWith('<')) { return true; } // same SemVer and both sides are inclusive (<= or >=) if (this.semver.version === comp.semver.version && this.operator.includes('=') && comp.operator.includes('=')) { return true; } // opposite directions less than if (cmp(this.semver, '<', comp.semver, options) && this.operator.startsWith('>') && comp.operator.startsWith('<')) { return true; } // opposite directions greater than if (cmp(this.semver, '>', comp.semver, options) && this.operator.startsWith('<') && comp.operator.startsWith('>')) { return true; } return false; } } module.exports = Comparator; const parseOptions = __turbopack_context__.r("[project]/node_modules/semver/internal/parse-options.js [app-route] (ecmascript)"); const { safeRe: re, t } = __turbopack_context__.r("[project]/node_modules/semver/internal/re.js [app-route] (ecmascript)"); const cmp = __turbopack_context__.r("[project]/node_modules/semver/functions/cmp.js [app-route] (ecmascript)"); const debug = __turbopack_context__.r("[project]/node_modules/semver/internal/debug.js [app-route] (ecmascript)"); const SemVer = __turbopack_context__.r("[project]/node_modules/semver/classes/semver.js [app-route] (ecmascript)"); const Range = __turbopack_context__.r("[project]/node_modules/semver/classes/range.js [app-route] (ecmascript)"); }), "[project]/node_modules/semver/classes/range.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const SPACE_CHARACTERS = /\s+/g; // hoisted class for cyclic dependency class Range { constructor(range, options){ options = parseOptions(options); if (range instanceof Range) { if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { return range; } else { return new Range(range.raw, options); } } if (range instanceof Comparator) { // just put it in the set and return this.raw = range.value; this.set = [ [ range ] ]; this.formatted = undefined; return this; } this.options = options; this.loose = !!options.loose; this.includePrerelease = !!options.includePrerelease; // First reduce all whitespace as much as possible so we do not have to rely // on potentially slow regexes like \s*. This is then stored and used for // future error messages as well. this.raw = range.trim().replace(SPACE_CHARACTERS, ' '); // First, split on || this.set = this.raw.split('||')// map the range to a 2d array of comparators .map((r)=>this.parseRange(r.trim()))// throw out any comparator lists that are empty // this generally means that it was not a valid range, which is allowed // in loose mode, but will still throw if the WHOLE range is invalid. .filter((c)=>c.length); if (!this.set.length) { throw new TypeError(`Invalid SemVer Range: ${this.raw}`); } // if we have any that are not the null set, throw out null sets. if (this.set.length > 1) { // keep the first one, in case they're all null sets const first = this.set[0]; this.set = this.set.filter((c)=>!isNullSet(c[0])); if (this.set.length === 0) { this.set = [ first ]; } else if (this.set.length > 1) { // if we have any that are *, then the range is just * for (const c of this.set){ if (c.length === 1 && isAny(c[0])) { this.set = [ c ]; break; } } } } this.formatted = undefined; } get range() { if (this.formatted === undefined) { this.formatted = ''; for(let i = 0; i < this.set.length; i++){ if (i > 0) { this.formatted += '||'; } const comps = this.set[i]; for(let k = 0; k < comps.length; k++){ if (k > 0) { this.formatted += ' '; } this.formatted += comps[k].toString().trim(); } } } return this.formatted; } format() { return this.range; } toString() { return this.range; } parseRange(range) { // strip build metadata so it can't bleed into the version range = range.replace(BUILDSTRIPRE, ''); // memoize range parsing for performance. // this is a very hot path, and fully deterministic. const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE); const memoKey = memoOpts + ':' + range; const cached = cache.get(memoKey); if (cached) { return cached; } const loose = this.options.loose; // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]; range = range.replace(hr, hyphenReplace(this.options.includePrerelease)); debug('hyphen replace', range); // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace); debug('comparator trim', range); // `~ 1.2.3` => `~1.2.3` range = range.replace(re[t.TILDETRIM], tildeTrimReplace); debug('tilde trim', range); // `^ 1.2.3` => `^1.2.3` range = range.replace(re[t.CARETTRIM], caretTrimReplace); debug('caret trim', range); // At this point, the range is completely trimmed and // ready to be split into comparators. let rangeList = range.split(' ').map((comp)=>parseComparator(comp, this.options)).join(' ').split(/\s+/)// >=0.0.0 is equivalent to * .map((comp)=>replaceGTE0(comp, this.options)); if (loose) { // in loose mode, throw out any that are not valid comparators rangeList = rangeList.filter((comp)=>{ debug('loose invalid filter', comp, this.options); return !!comp.match(re[t.COMPARATORLOOSE]); }); } debug('range list', rangeList); // if any comparators are the null set, then replace with JUST null set // if more than one comparator, remove any * comparators // also, don't include the same comparator more than once const rangeMap = new Map(); const comparators = rangeList.map((comp)=>new Comparator(comp, this.options)); for (const comp of comparators){ if (isNullSet(comp)) { return [ comp ]; } rangeMap.set(comp.value, comp); } if (rangeMap.size > 1 && rangeMap.has('')) { rangeMap.delete(''); } const result = [ ...rangeMap.values() ]; cache.set(memoKey, result); return result; } intersects(range, options) { if (!(range instanceof Range)) { throw new TypeError('a Range is required'); } return this.set.some((thisComparators)=>{ return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators)=>{ return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator)=>{ return rangeComparators.every((rangeComparator)=>{ return thisComparator.intersects(rangeComparator, options); }); }); }); }); } // if ANY of the sets match ALL of its comparators, then pass test(version) { if (!version) { return false; } if (typeof version === 'string') { try { version = new SemVer(version, this.options); } catch (er) { return false; } } for(let i = 0; i < this.set.length; i++){ if (testSet(this.set[i], version, this.options)) { return true; } } return false; } } module.exports = Range; const LRU = __turbopack_context__.r("[project]/node_modules/semver/internal/lrucache.js [app-route] (ecmascript)"); const cache = new LRU(); const parseOptions = __turbopack_context__.r("[project]/node_modules/semver/internal/parse-options.js [app-route] (ecmascript)"); const Comparator = __turbopack_context__.r("[project]/node_modules/semver/classes/comparator.js [app-route] (ecmascript)"); const debug = __turbopack_context__.r("[project]/node_modules/semver/internal/debug.js [app-route] (ecmascript)"); const SemVer = __turbopack_context__.r("[project]/node_modules/semver/classes/semver.js [app-route] (ecmascript)"); const { safeRe: re, src, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = __turbopack_context__.r("[project]/node_modules/semver/internal/re.js [app-route] (ecmascript)"); const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = __turbopack_context__.r("[project]/node_modules/semver/internal/constants.js [app-route] (ecmascript)"); // unbounded global build-metadata stripper used by parseRange const BUILDSTRIPRE = new RegExp(src[t.BUILD], 'g'); const isNullSet = (c)=>c.value === '<0.0.0-0'; const isAny = (c)=>c.value === ''; // take a set of comparators and determine whether there // exists a version which can satisfy it const isSatisfiable = (comparators, options)=>{ let result = true; const remainingComparators = comparators.slice(); let testComparator = remainingComparators.pop(); while(result && remainingComparators.length){ result = remainingComparators.every((otherComparator)=>{ return testComparator.intersects(otherComparator, options); }); testComparator = remainingComparators.pop(); } return result; }; // comprised of xranges, tildes, stars, and gtlt's at this point. // already replaced the hyphen ranges // turn into a set of JUST comparators. const parseComparator = (comp, options)=>{ comp = comp.replace(re[t.BUILD], ''); debug('comp', comp, options); comp = replaceCarets(comp, options); debug('caret', comp); comp = replaceTildes(comp, options); debug('tildes', comp); comp = replaceXRanges(comp, options); debug('xrange', comp); comp = replaceStars(comp, options); debug('stars', comp); return comp; }; const isX = (id)=>!id || id.toLowerCase() === 'x' || id === '*'; const invalidXRangeOrder = (M, m, p)=>isX(M) && !isX(m) || isX(m) && p && !isX(p); // ~, ~> --> * (any, kinda silly) // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 // ~0.0.1 --> >=0.0.1 <0.1.0-0 const replaceTildes = (comp, options)=>{ return comp.trim().split(/\s+/).map((c)=>replaceTilde(c, options)).join(' '); }; const replaceTilde = (comp, options)=>{ const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]; // if we're including prereleases in the match, then the lower bound is // -0, the lowest possible prerelease value, just like x-ranges and carets. // this keeps `~1.2` equivalent to the `1.2.x` x-range it's documented as. const z = options.includePrerelease ? '-0' : ''; return comp.replace(r, (_, M, m, p, pr)=>{ debug('tilde', comp, _, M, m, p, pr); let ret; if (isX(M)) { ret = ''; } else if (isX(m)) { ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`; } else if (isX(p)) { // ~1.2 == >=1.2.0 <1.3.0-0 ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`; } else if (pr) { debug('replaceTilde pr', pr); ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; } else { // ~1.2.3 == >=1.2.3 <1.3.0-0 ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`; } debug('tilde return', ret); return ret; }); }; // ^ --> * (any, kinda silly) // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 // ^1.2.3 --> >=1.2.3 <2.0.0-0 // ^1.2.0 --> >=1.2.0 <2.0.0-0 // ^0.0.1 --> >=0.0.1 <0.0.2-0 // ^0.1.0 --> >=0.1.0 <0.2.0-0 const replaceCarets = (comp, options)=>{ return comp.trim().split(/\s+/).map((c)=>replaceCaret(c, options)).join(' '); }; const replaceCaret = (comp, options)=>{ debug('caret', comp, options); const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]; const z = options.includePrerelease ? '-0' : ''; return comp.replace(r, (_, M, m, p, pr)=>{ debug('caret', comp, _, M, m, p, pr); let ret; if (isX(M)) { ret = ''; } else if (isX(m)) { ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`; } else if (isX(p)) { if (M === '0') { ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`; } else { ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`; } } else if (pr) { debug('replaceCaret pr', pr); if (M === '0') { if (m === '0') { ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`; } else { ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; } } else { ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`; } } else { debug('no pr'); if (M === '0') { if (m === '0') { ret = `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0`; } else { ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`; } } else { ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`; } } debug('caret return', ret); return ret; }); }; const replaceXRanges = (comp, options)=>{ debug('replaceXRanges', comp, options); return comp.split(/\s+/).map((c)=>replaceXRange(c, options)).join(' '); }; const replaceXRange = (comp, options)=>{ comp = comp.trim(); const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]; return comp.replace(r, (ret, gtlt, M, m, p, pr)=>{ debug('xRange', comp, ret, gtlt, M, m, p, pr); if (invalidXRangeOrder(M, m, p)) { return comp; } const xM = isX(M); const xm = xM || isX(m); const xp = xm || isX(p); const anyX = xp; if (gtlt === '=' && anyX) { gtlt = ''; } // if we're including prereleases in the match, then we need // to fix this to -0, the lowest possible prerelease value pr = options.includePrerelease ? '-0' : ''; if (xM) { if (gtlt === '>' || gtlt === '<') { // nothing is allowed ret = '<0.0.0-0'; } else { // nothing is forbidden ret = '*'; } } else if (gtlt && anyX) { // we know patch is an x, because we have any x at all. // replace X with 0 if (xm) { m = 0; } p = 0; if (gtlt === '>') { // >1 => >=2.0.0 // >1.2 => >=1.3.0 gtlt = '>='; if (xm) { M = +M + 1; m = 0; p = 0; } else { m = +m + 1; p = 0; } } else if (gtlt === '<=') { // <=0.7.x is actually <0.8.0, since any 0.7.x should // pass. Similarly, <=7.x is actually <8.0.0, etc. gtlt = '<'; if (xm) { M = +M + 1; } else { m = +m + 1; } } if (gtlt === '<') { pr = '-0'; } ret = `${gtlt + M}.${m}.${p}${pr}`; } else if (xm) { ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`; } else if (xp) { ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`; } debug('xRange return', ret); return ret; }); }; // Because * is AND-ed with everything else in the comparator, // and '' means "any version", just remove the *s entirely. const replaceStars = (comp, options)=>{ debug('replaceStars', comp, options); // Looseness is ignored here. star is always as loose as it gets! return comp.trim().replace(re[t.STAR], ''); }; const replaceGTE0 = (comp, options)=>{ debug('replaceGTE0', comp, options); return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], ''); }; // This function is passed to string.replace(re[t.HYPHENRANGE]) // M, m, patch, prerelease, build // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 // 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do // 1.2 - 3.4 => >=1.2.0 <3.5.0-0 // TODO build? const hyphenReplace = (incPr)=>($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr)=>{ if (isX(fM)) { from = ''; } else if (isX(fm)) { from = `>=${fM}.0.0${incPr ? '-0' : ''}`; } else if (isX(fp)) { from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`; } else if (fpr) { from = `>=${from}`; } else { from = `>=${from}${incPr ? '-0' : ''}`; } if (isX(tM)) { to = ''; } else if (isX(tm)) { to = `<${+tM + 1}.0.0-0`; } else if (isX(tp)) { to = `<${tM}.${+tm + 1}.0-0`; } else if (tpr) { to = `<=${tM}.${tm}.${tp}-${tpr}`; } else if (incPr) { to = `<${tM}.${tm}.${+tp + 1}-0`; } else { to = `<=${to}`; } return `${from} ${to}`.trim(); }; const testSet = (set, version, options)=>{ for(let i = 0; i < set.length; i++){ if (!set[i].test(version)) { return false; } } if (version.prerelease.length && !options.includePrerelease) { // Find the set of versions that are allowed to have prereleases // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 // That should allow `1.2.3-pr.2` to pass. // However, `1.2.4-alpha.notready` should NOT be allowed, // even though it's within the range set by the comparators. for(let i = 0; i < set.length; i++){ debug(set[i].semver); if (set[i].semver === Comparator.ANY) { continue; } if (set[i].semver.prerelease.length > 0) { const allowed = set[i].semver; if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { return true; } } } // Version has a -pre, but it's not one of the ones we like. return false; } return true; }; }), "[project]/node_modules/semver/classes/semver.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const debug = __turbopack_context__.r("[project]/node_modules/semver/internal/debug.js [app-route] (ecmascript)"); const { MAX_LENGTH, MAX_SAFE_INTEGER } = __turbopack_context__.r("[project]/node_modules/semver/internal/constants.js [app-route] (ecmascript)"); const { safeRe: re, t } = __turbopack_context__.r("[project]/node_modules/semver/internal/re.js [app-route] (ecmascript)"); const parseOptions = __turbopack_context__.r("[project]/node_modules/semver/internal/parse-options.js [app-route] (ecmascript)"); const { compareIdentifiers } = __turbopack_context__.r("[project]/node_modules/semver/internal/identifiers.js [app-route] (ecmascript)"); const isPrereleaseIdentifier = (prerelease, identifier)=>{ const identifiers = identifier.split('.'); if (identifiers.length > prerelease.length) { return false; } for(let i = 0; i < identifiers.length; i++){ if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) { return false; } } return true; }; class SemVer { constructor(version, options){ options = parseOptions(options); if (version instanceof SemVer) { if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) { return version; } else { version = version.version; } } else if (typeof version !== 'string') { throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`); } if (version.length > MAX_LENGTH) { throw new TypeError(`version is longer than ${MAX_LENGTH} characters`); } debug('SemVer', version, options); this.options = options; this.loose = !!options.loose; // this isn't actually relevant for versions, but keep it so that we // don't run into trouble passing this.options around. this.includePrerelease = !!options.includePrerelease; const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]); if (!m) { throw new TypeError(`Invalid Version: ${version}`); } this.raw = version; // these are actually numbers this.major = +m[1]; this.minor = +m[2]; this.patch = +m[3]; if (this.major > MAX_SAFE_INTEGER || this.major < 0) { throw new TypeError('Invalid major version'); } if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { throw new TypeError('Invalid minor version'); } if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { throw new TypeError('Invalid patch version'); } // numberify any prerelease numeric ids if (!m[4]) { this.prerelease = []; } else { this.prerelease = m[4].split('.').map((id)=>{ if (/^[0-9]+$/.test(id)) { const num = +id; if (num >= 0 && num < MAX_SAFE_INTEGER) { return num; } } return id; }); } this.build = m[5] ? m[5].split('.') : []; this.format(); } format() { this.version = `${this.major}.${this.minor}.${this.patch}`; if (this.prerelease.length) { this.version += `-${this.prerelease.join('.')}`; } return this.version; } toString() { return this.version; } compare(other) { debug('SemVer.compare', this.version, this.options, other); if (!(other instanceof SemVer)) { if (typeof other === 'string' && other === this.version) { return 0; } other = new SemVer(other, this.options); } if (other.version === this.version) { return 0; } return this.compareMain(other) || this.comparePre(other); } compareMain(other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options); } if (this.major < other.major) { return -1; } if (this.major > other.major) { return 1; } if (this.minor < other.minor) { return -1; } if (this.minor > other.minor) { return 1; } if (this.patch < other.patch) { return -1; } if (this.patch > other.patch) { return 1; } return 0; } comparePre(other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options); } // NOT having a prerelease is > having one if (this.prerelease.length && !other.prerelease.length) { return -1; } else if (!this.prerelease.length && other.prerelease.length) { return 1; } else if (!this.prerelease.length && !other.prerelease.length) { return 0; } let i = 0; do { const a = this.prerelease[i]; const b = other.prerelease[i]; debug('prerelease compare', i, a, b); if (a === undefined && b === undefined) { return 0; } else if (b === undefined) { return 1; } else if (a === undefined) { return -1; } else if (a === b) { continue; } else { return compareIdentifiers(a, b); } }while (++i) } compareBuild(other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options); } let i = 0; do { const a = this.build[i]; const b = other.build[i]; debug('build compare', i, a, b); if (a === undefined && b === undefined) { return 0; } else if (b === undefined) { return 1; } else if (a === undefined) { return -1; } else if (a === b) { continue; } else { return compareIdentifiers(a, b); } }while (++i) } // preminor will bump the version up to the next minor release, and immediately // down to pre-release. premajor and prepatch work the same way. inc(release, identifier, identifierBase) { if (release.startsWith('pre')) { if (!identifier && identifierBase === false) { throw new Error('invalid increment argument: identifier is empty'); } // Avoid an invalid semver results if (identifier) { const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]); if (!match || match[1] !== identifier) { throw new Error(`invalid identifier: ${identifier}`); } } } switch(release){ case 'premajor': this.prerelease.length = 0; this.patch = 0; this.minor = 0; this.major++; this.inc('pre', identifier, identifierBase); break; case 'preminor': this.prerelease.length = 0; this.patch = 0; this.minor++; this.inc('pre', identifier, identifierBase); break; case 'prepatch': // If this is already a prerelease, it will bump to the next version // drop any prereleases that might already exist, since they are not // relevant at this point. this.prerelease.length = 0; this.inc('patch', identifier, identifierBase); this.inc('pre', identifier, identifierBase); break; // If the input is a non-prerelease version, this acts the same as // prepatch. case 'prerelease': if (this.prerelease.length === 0) { this.inc('patch', identifier, identifierBase); } this.inc('pre', identifier, identifierBase); break; case 'release': if (this.prerelease.length === 0) { throw new Error(`version ${this.raw} is not a prerelease`); } this.prerelease.length = 0; break; case 'major': // If this is a pre-major version, bump up to the same major version. // Otherwise increment major. // 1.0.0-5 bumps to 1.0.0 // 1.1.0 bumps to 2.0.0 if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { this.major++; } this.minor = 0; this.patch = 0; this.prerelease = []; break; case 'minor': // If this is a pre-minor version, bump up to the same minor version. // Otherwise increment minor. // 1.2.0-5 bumps to 1.2.0 // 1.2.1 bumps to 1.3.0 if (this.patch !== 0 || this.prerelease.length === 0) { this.minor++; } this.patch = 0; this.prerelease = []; break; case 'patch': // If this is not a pre-release version, it will increment the patch. // If it is a pre-release it will bump up to the same patch version. // 1.2.0-5 patches to 1.2.0 // 1.2.0 patches to 1.2.1 if (this.prerelease.length === 0) { this.patch++; } this.prerelease = []; break; // This probably shouldn't be used publicly. // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. case 'pre': { const base = Number(identifierBase) ? 1 : 0; if (this.prerelease.length === 0) { this.prerelease = [ base ]; } else { let i = this.prerelease.length; while(--i >= 0){ if (typeof this.prerelease[i] === 'number') { this.prerelease[i]++; i = -2; } } if (i === -1) { // didn't increment anything if (identifier === this.prerelease.join('.') && identifierBase === false) { throw new Error('invalid increment argument: identifier already exists'); } this.prerelease.push(base); } } if (identifier) { // 1.2.0-beta.1 bumps to 1.2.0-beta.2, // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 let prerelease = [ identifier, base ]; if (identifierBase === false) { prerelease = [ identifier ]; } if (isPrereleaseIdentifier(this.prerelease, identifier)) { const prereleaseBase = this.prerelease[identifier.split('.').length]; if (isNaN(prereleaseBase)) { this.prerelease = prerelease; } } else { this.prerelease = prerelease; } } break; } default: throw new Error(`invalid increment argument: ${release}`); } this.raw = this.format(); if (this.build.length) { this.raw += `+${this.build.join('.')}`; } return this; } } module.exports = SemVer; }), "[project]/node_modules/semver/functions/clean.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const parse = __turbopack_context__.r("[project]/node_modules/semver/functions/parse.js [app-route] (ecmascript)"); const clean = (version, options)=>{ const s = parse(version.trim().replace(/^[=v]+/, ''), options); return s ? s.version : null; }; module.exports = clean; }), "[project]/node_modules/semver/functions/cmp.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const eq = __turbopack_context__.r("[project]/node_modules/semver/functions/eq.js [app-route] (ecmascript)"); const neq = __turbopack_context__.r("[project]/node_modules/semver/functions/neq.js [app-route] (ecmascript)"); const gt = __turbopack_context__.r("[project]/node_modules/semver/functions/gt.js [app-route] (ecmascript)"); const gte = __turbopack_context__.r("[project]/node_modules/semver/functions/gte.js [app-route] (ecmascript)"); const lt = __turbopack_context__.r("[project]/node_modules/semver/functions/lt.js [app-route] (ecmascript)"); const lte = __turbopack_context__.r("[project]/node_modules/semver/functions/lte.js [app-route] (ecmascript)"); const cmp = (a, op, b, loose)=>{ switch(op){ case '===': if (typeof a === 'object') { a = a.version; } if (typeof b === 'object') { b = b.version; } return a === b; case '!==': if (typeof a === 'object') { a = a.version; } if (typeof b === 'object') { b = b.version; } return a !== b; case '': case '=': case '==': return eq(a, b, loose); case '!=': return neq(a, b, loose); case '>': return gt(a, b, loose); case '>=': return gte(a, b, loose); case '<': return lt(a, b, loose); case '<=': return lte(a, b, loose); default: throw new TypeError(`Invalid operator: ${op}`); } }; module.exports = cmp; }), "[project]/node_modules/semver/functions/coerce.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const SemVer = __turbopack_context__.r("[project]/node_modules/semver/classes/semver.js [app-route] (ecmascript)"); const parse = __turbopack_context__.r("[project]/node_modules/semver/functions/parse.js [app-route] (ecmascript)"); const { safeRe: re, t } = __turbopack_context__.r("[project]/node_modules/semver/internal/re.js [app-route] (ecmascript)"); const coerce = (version, options)=>{ if (version instanceof SemVer) { return version; } if (typeof version === 'number') { version = String(version); } if (typeof version !== 'string') { return null; } options = options || {}; let match = null; if (!options.rtl) { match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]); } else { // Find the right-most coercible string that does not share // a terminus with a more left-ward coercible string. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' // With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4' // // Walk through the string checking with a /g regexp // Manually set the index so as to pick up overlapping matches. // Stop when we get a match that ends at the string end, since no // coercible string can be more right-ward without the same terminus. const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL]; let next; while((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)){ if (!match || next.index + next[0].length !== match.index + match[0].length) { match = next; } coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length; } // leave it in a clean state coerceRtlRegex.lastIndex = -1; } if (match === null) { return null; } const major = match[2]; const minor = match[3] || '0'; const patch = match[4] || '0'; const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : ''; const build = options.includePrerelease && match[6] ? `+${match[6]}` : ''; return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options); }; module.exports = coerce; }), "[project]/node_modules/semver/functions/compare-build.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const SemVer = __turbopack_context__.r("[project]/node_modules/semver/classes/semver.js [app-route] (ecmascript)"); const compareBuild = (a, b, loose)=>{ const versionA = new SemVer(a, loose); const versionB = new SemVer(b, loose); return versionA.compare(versionB) || versionA.compareBuild(versionB); }; module.exports = compareBuild; }), "[project]/node_modules/semver/functions/compare-loose.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const compare = __turbopack_context__.r("[project]/node_modules/semver/functions/compare.js [app-route] (ecmascript)"); const compareLoose = (a, b)=>compare(a, b, true); module.exports = compareLoose; }), "[project]/node_modules/semver/functions/compare.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const SemVer = __turbopack_context__.r("[project]/node_modules/semver/classes/semver.js [app-route] (ecmascript)"); const compare = (a, b, loose)=>new SemVer(a, loose).compare(new SemVer(b, loose)); module.exports = compare; }), "[project]/node_modules/semver/functions/diff.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const parse = __turbopack_context__.r("[project]/node_modules/semver/functions/parse.js [app-route] (ecmascript)"); const diff = (version1, version2)=>{ const v1 = parse(version1, null, true); const v2 = parse(version2, null, true); const comparison = v1.compare(v2); if (comparison === 0) { return null; } const v1Higher = comparison > 0; const highVersion = v1Higher ? v1 : v2; const lowVersion = v1Higher ? v2 : v1; const highHasPre = !!highVersion.prerelease.length; const lowHasPre = !!lowVersion.prerelease.length; if (lowHasPre && !highHasPre) { // Going from prerelease -> no prerelease requires some special casing // If the low version has only a major, then it will always be a major // Some examples: // 1.0.0-1 -> 1.0.0 // 1.0.0-1 -> 1.1.1 // 1.0.0-1 -> 2.0.0 if (!lowVersion.patch && !lowVersion.minor) { return 'major'; } // If the main part has no difference if (lowVersion.compareMain(highVersion) === 0) { if (lowVersion.minor && !lowVersion.patch) { return 'minor'; } return 'patch'; } } // add the `pre` prefix if we are going to a prerelease version const prefix = highHasPre ? 'pre' : ''; if (v1.major !== v2.major) { return prefix + 'major'; } if (v1.minor !== v2.minor) { return prefix + 'minor'; } if (v1.patch !== v2.patch) { return prefix + 'patch'; } // high and low are prereleases return 'prerelease'; }; module.exports = diff; }), "[project]/node_modules/semver/functions/eq.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const compare = __turbopack_context__.r("[project]/node_modules/semver/functions/compare.js [app-route] (ecmascript)"); const eq = (a, b, loose)=>compare(a, b, loose) === 0; module.exports = eq; }), "[project]/node_modules/semver/functions/gt.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const compare = __turbopack_context__.r("[project]/node_modules/semver/functions/compare.js [app-route] (ecmascript)"); const gt = (a, b, loose)=>compare(a, b, loose) > 0; module.exports = gt; }), "[project]/node_modules/semver/functions/gte.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const compare = __turbopack_context__.r("[project]/node_modules/semver/functions/compare.js [app-route] (ecmascript)"); const gte = (a, b, loose)=>compare(a, b, loose) >= 0; module.exports = gte; }), "[project]/node_modules/semver/functions/inc.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const SemVer = __turbopack_context__.r("[project]/node_modules/semver/classes/semver.js [app-route] (ecmascript)"); const inc = (version, release, options, identifier, identifierBase)=>{ if (typeof options === 'string') { identifierBase = identifier; identifier = options; options = undefined; } try { return new SemVer(version instanceof SemVer ? version.version : version, options).inc(release, identifier, identifierBase).version; } catch (er) { return null; } }; module.exports = inc; }), "[project]/node_modules/semver/functions/lt.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const compare = __turbopack_context__.r("[project]/node_modules/semver/functions/compare.js [app-route] (ecmascript)"); const lt = (a, b, loose)=>compare(a, b, loose) < 0; module.exports = lt; }), "[project]/node_modules/semver/functions/lte.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const compare = __turbopack_context__.r("[project]/node_modules/semver/functions/compare.js [app-route] (ecmascript)"); const lte = (a, b, loose)=>compare(a, b, loose) <= 0; module.exports = lte; }), "[project]/node_modules/semver/functions/major.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const SemVer = __turbopack_context__.r("[project]/node_modules/semver/classes/semver.js [app-route] (ecmascript)"); const major = (a, loose)=>new SemVer(a, loose).major; module.exports = major; }), "[project]/node_modules/semver/functions/minor.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const SemVer = __turbopack_context__.r("[project]/node_modules/semver/classes/semver.js [app-route] (ecmascript)"); const minor = (a, loose)=>new SemVer(a, loose).minor; module.exports = minor; }), "[project]/node_modules/semver/functions/neq.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const compare = __turbopack_context__.r("[project]/node_modules/semver/functions/compare.js [app-route] (ecmascript)"); const neq = (a, b, loose)=>compare(a, b, loose) !== 0; module.exports = neq; }), "[project]/node_modules/semver/functions/parse.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const SemVer = __turbopack_context__.r("[project]/node_modules/semver/classes/semver.js [app-route] (ecmascript)"); const parse = (version, options, throwErrors = false)=>{ if (version instanceof SemVer) { return version; } try { return new SemVer(version, options); } catch (er) { if (!throwErrors) { return null; } throw er; } }; module.exports = parse; }), "[project]/node_modules/semver/functions/patch.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const SemVer = __turbopack_context__.r("[project]/node_modules/semver/classes/semver.js [app-route] (ecmascript)"); const patch = (a, loose)=>new SemVer(a, loose).patch; module.exports = patch; }), "[project]/node_modules/semver/functions/prerelease.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const parse = __turbopack_context__.r("[project]/node_modules/semver/functions/parse.js [app-route] (ecmascript)"); const prerelease = (version, options)=>{ const parsed = parse(version, options); return parsed && parsed.prerelease.length ? parsed.prerelease : null; }; module.exports = prerelease; }), "[project]/node_modules/semver/functions/rcompare.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const compare = __turbopack_context__.r("[project]/node_modules/semver/functions/compare.js [app-route] (ecmascript)"); const rcompare = (a, b, loose)=>compare(b, a, loose); module.exports = rcompare; }), "[project]/node_modules/semver/functions/rsort.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const compareBuild = __turbopack_context__.r("[project]/node_modules/semver/functions/compare-build.js [app-route] (ecmascript)"); const rsort = (list, loose)=>list.sort((a, b)=>compareBuild(b, a, loose)); module.exports = rsort; }), "[project]/node_modules/semver/functions/satisfies.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const Range = __turbopack_context__.r("[project]/node_modules/semver/classes/range.js [app-route] (ecmascript)"); const satisfies = (version, range, options)=>{ try { range = new Range(range, options); } catch (er) { return false; } return range.test(version); }; module.exports = satisfies; }), "[project]/node_modules/semver/functions/sort.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const compareBuild = __turbopack_context__.r("[project]/node_modules/semver/functions/compare-build.js [app-route] (ecmascript)"); const sort = (list, loose)=>list.sort((a, b)=>compareBuild(a, b, loose)); module.exports = sort; }), "[project]/node_modules/semver/functions/truncate.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const parse = __turbopack_context__.r("[project]/node_modules/semver/functions/parse.js [app-route] (ecmascript)"); const constants = __turbopack_context__.r("[project]/node_modules/semver/internal/constants.js [app-route] (ecmascript)"); const SemVer = __turbopack_context__.r("[project]/node_modules/semver/classes/semver.js [app-route] (ecmascript)"); const truncate = (version, truncation, options)=>{ if (!constants.RELEASE_TYPES.includes(truncation)) { return null; } const clonedVersion = cloneInputVersion(version, options); return clonedVersion && doTruncation(clonedVersion, truncation); }; const cloneInputVersion = (version, options)=>{ const versionStringToParse = version instanceof SemVer ? version.version : version; return parse(versionStringToParse, options); }; const doTruncation = (version, truncation)=>{ if (isPrerelease(truncation)) { return version.version; } version.prerelease = []; switch(truncation){ case 'major': version.minor = 0; version.patch = 0; break; case 'minor': version.patch = 0; break; } return version.format(); }; const isPrerelease = (type)=>{ return type.startsWith('pre'); }; module.exports = truncate; }), "[project]/node_modules/semver/functions/valid.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const parse = __turbopack_context__.r("[project]/node_modules/semver/functions/parse.js [app-route] (ecmascript)"); const valid = (version, options)=>{ const v = parse(version, options); return v ? v.version : null; }; module.exports = valid; }), "[project]/node_modules/semver/index.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; // just pre-load all the stuff that index.js lazily exports const internalRe = __turbopack_context__.r("[project]/node_modules/semver/internal/re.js [app-route] (ecmascript)"); const constants = __turbopack_context__.r("[project]/node_modules/semver/internal/constants.js [app-route] (ecmascript)"); const SemVer = __turbopack_context__.r("[project]/node_modules/semver/classes/semver.js [app-route] (ecmascript)"); const identifiers = __turbopack_context__.r("[project]/node_modules/semver/internal/identifiers.js [app-route] (ecmascript)"); const parse = __turbopack_context__.r("[project]/node_modules/semver/functions/parse.js [app-route] (ecmascript)"); const valid = __turbopack_context__.r("[project]/node_modules/semver/functions/valid.js [app-route] (ecmascript)"); const clean = __turbopack_context__.r("[project]/node_modules/semver/functions/clean.js [app-route] (ecmascript)"); const inc = __turbopack_context__.r("[project]/node_modules/semver/functions/inc.js [app-route] (ecmascript)"); const diff = __turbopack_context__.r("[project]/node_modules/semver/functions/diff.js [app-route] (ecmascript)"); const major = __turbopack_context__.r("[project]/node_modules/semver/functions/major.js [app-route] (ecmascript)"); const minor = __turbopack_context__.r("[project]/node_modules/semver/functions/minor.js [app-route] (ecmascript)"); const patch = __turbopack_context__.r("[project]/node_modules/semver/functions/patch.js [app-route] (ecmascript)"); const prerelease = __turbopack_context__.r("[project]/node_modules/semver/functions/prerelease.js [app-route] (ecmascript)"); const compare = __turbopack_context__.r("[project]/node_modules/semver/functions/compare.js [app-route] (ecmascript)"); const rcompare = __turbopack_context__.r("[project]/node_modules/semver/functions/rcompare.js [app-route] (ecmascript)"); const compareLoose = __turbopack_context__.r("[project]/node_modules/semver/functions/compare-loose.js [app-route] (ecmascript)"); const compareBuild = __turbopack_context__.r("[project]/node_modules/semver/functions/compare-build.js [app-route] (ecmascript)"); const sort = __turbopack_context__.r("[project]/node_modules/semver/functions/sort.js [app-route] (ecmascript)"); const rsort = __turbopack_context__.r("[project]/node_modules/semver/functions/rsort.js [app-route] (ecmascript)"); const gt = __turbopack_context__.r("[project]/node_modules/semver/functions/gt.js [app-route] (ecmascript)"); const lt = __turbopack_context__.r("[project]/node_modules/semver/functions/lt.js [app-route] (ecmascript)"); const eq = __turbopack_context__.r("[project]/node_modules/semver/functions/eq.js [app-route] (ecmascript)"); const neq = __turbopack_context__.r("[project]/node_modules/semver/functions/neq.js [app-route] (ecmascript)"); const gte = __turbopack_context__.r("[project]/node_modules/semver/functions/gte.js [app-route] (ecmascript)"); const lte = __turbopack_context__.r("[project]/node_modules/semver/functions/lte.js [app-route] (ecmascript)"); const cmp = __turbopack_context__.r("[project]/node_modules/semver/functions/cmp.js [app-route] (ecmascript)"); const coerce = __turbopack_context__.r("[project]/node_modules/semver/functions/coerce.js [app-route] (ecmascript)"); const truncate = __turbopack_context__.r("[project]/node_modules/semver/functions/truncate.js [app-route] (ecmascript)"); const Comparator = __turbopack_context__.r("[project]/node_modules/semver/classes/comparator.js [app-route] (ecmascript)"); const Range = __turbopack_context__.r("[project]/node_modules/semver/classes/range.js [app-route] (ecmascript)"); const satisfies = __turbopack_context__.r("[project]/node_modules/semver/functions/satisfies.js [app-route] (ecmascript)"); const toComparators = __turbopack_context__.r("[project]/node_modules/semver/ranges/to-comparators.js [app-route] (ecmascript)"); const maxSatisfying = __turbopack_context__.r("[project]/node_modules/semver/ranges/max-satisfying.js [app-route] (ecmascript)"); const minSatisfying = __turbopack_context__.r("[project]/node_modules/semver/ranges/min-satisfying.js [app-route] (ecmascript)"); const minVersion = __turbopack_context__.r("[project]/node_modules/semver/ranges/min-version.js [app-route] (ecmascript)"); const validRange = __turbopack_context__.r("[project]/node_modules/semver/ranges/valid.js [app-route] (ecmascript)"); const outside = __turbopack_context__.r("[project]/node_modules/semver/ranges/outside.js [app-route] (ecmascript)"); const gtr = __turbopack_context__.r("[project]/node_modules/semver/ranges/gtr.js [app-route] (ecmascript)"); const ltr = __turbopack_context__.r("[project]/node_modules/semver/ranges/ltr.js [app-route] (ecmascript)"); const intersects = __turbopack_context__.r("[project]/node_modules/semver/ranges/intersects.js [app-route] (ecmascript)"); const simplifyRange = __turbopack_context__.r("[project]/node_modules/semver/ranges/simplify.js [app-route] (ecmascript)"); const subset = __turbopack_context__.r("[project]/node_modules/semver/ranges/subset.js [app-route] (ecmascript)"); module.exports = { parse, valid, clean, inc, diff, major, minor, patch, prerelease, compare, rcompare, compareLoose, compareBuild, sort, rsort, gt, lt, eq, neq, gte, lte, cmp, coerce, truncate, Comparator, Range, satisfies, toComparators, maxSatisfying, minSatisfying, minVersion, validRange, outside, gtr, ltr, intersects, simplifyRange, subset, SemVer, re: internalRe.re, src: internalRe.src, tokens: internalRe.t, SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION, RELEASE_TYPES: constants.RELEASE_TYPES, compareIdentifiers: identifiers.compareIdentifiers, rcompareIdentifiers: identifiers.rcompareIdentifiers }; }), "[project]/node_modules/semver/internal/constants.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; // Note: this is the semver.org version of the spec that it implements // Not necessarily the package version of this code. const SEMVER_SPEC_VERSION = '2.0.0'; const MAX_LENGTH = 256; const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ 9007199254740991; // Max safe segment length for coercion. const MAX_SAFE_COMPONENT_LENGTH = 16; // Max safe length for a build identifier. The max length minus 6 characters for // the shortest version with a build 0.0.0+BUILD. const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6; const RELEASE_TYPES = [ 'major', 'premajor', 'minor', 'preminor', 'patch', 'prepatch', 'prerelease' ]; module.exports = { MAX_LENGTH, MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_SAFE_INTEGER, RELEASE_TYPES, SEMVER_SPEC_VERSION, FLAG_INCLUDE_PRERELEASE: 0b001, FLAG_LOOSE: 0b010 }; }), "[project]/node_modules/semver/internal/debug.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const debug = typeof process === 'object' && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args)=>console.error('SEMVER', ...args) : ()=>{}; module.exports = debug; }), "[project]/node_modules/semver/internal/identifiers.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const numeric = /^[0-9]+$/; const compareIdentifiers = (a, b)=>{ if (typeof a === 'number' && typeof b === 'number') { return a === b ? 0 : a < b ? -1 : 1; } const anum = numeric.test(a); const bnum = numeric.test(b); if (anum && bnum) { a = +a; b = +b; } return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; }; const rcompareIdentifiers = (a, b)=>compareIdentifiers(b, a); module.exports = { compareIdentifiers, rcompareIdentifiers }; }), "[project]/node_modules/semver/internal/lrucache.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; class LRUCache { constructor(){ this.max = 1000; this.map = new Map(); } get(key) { const value = this.map.get(key); if (value === undefined) { return undefined; } else { // Remove the key from the map and add it to the end this.map.delete(key); this.map.set(key, value); return value; } } delete(key) { return this.map.delete(key); } set(key, value) { const deleted = this.delete(key); if (!deleted && value !== undefined) { // If cache is full, delete the least recently used item if (this.map.size >= this.max) { const firstKey = this.map.keys().next().value; this.delete(firstKey); } this.map.set(key, value); } return this; } } module.exports = LRUCache; }), "[project]/node_modules/semver/internal/parse-options.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; // parse out just the options we care about const looseOption = Object.freeze({ loose: true }); const emptyOpts = Object.freeze({}); const parseOptions = (options)=>{ if (!options) { return emptyOpts; } if (typeof options !== 'object') { return looseOption; } return options; }; module.exports = parseOptions; }), "[project]/node_modules/semver/internal/re.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH } = __turbopack_context__.r("[project]/node_modules/semver/internal/constants.js [app-route] (ecmascript)"); const debug = __turbopack_context__.r("[project]/node_modules/semver/internal/debug.js [app-route] (ecmascript)"); exports = module.exports = {}; // The actual regexps go on exports.re const re = exports.re = []; const safeRe = exports.safeRe = []; const src = exports.src = []; const safeSrc = exports.safeSrc = []; const t = exports.t = {}; let R = 0; const LETTERDASHNUMBER = '[a-zA-Z0-9-]'; // Replace some greedy regex tokens to prevent regex dos issues. These regex are // used internally via the safeRe object since all inputs in this library get // normalized first to trim and collapse all extra whitespace. The original // regexes are exported for userland consumption and lower level usage. A // future breaking change could export the safer regex only with a note that // all input should have extra whitespace removed. const safeRegexReplacements = [ [ '\\s', 1 ], [ '\\d', MAX_LENGTH ], [ LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH ] ]; const makeSafeRegex = (value)=>{ for (const [token, max] of safeRegexReplacements){ value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`); } return value; }; const createToken = (name, value, isGlobal)=>{ const safe = makeSafeRegex(value); const index = R++; debug(name, index, value); t[name] = index; src[index] = value; safeSrc[index] = safe; re[index] = new RegExp(value, isGlobal ? 'g' : undefined); safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined); }; // The following Regular Expressions can be used for tokenizing, // validating, and parsing SemVer version strings. // ## Numeric Identifier // A single `0`, or a non-zero digit followed by zero or more digits. createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*'); createToken('NUMERICIDENTIFIERLOOSE', '\\d+'); // ## Non-numeric Identifier // Zero or more digits, followed by a letter or hyphen, and then zero or // more letters, digits, or hyphens. createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`); // ## Main Version // Three dot-separated numeric identifiers. createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + `(${src[t.NUMERICIDENTIFIER]})\\.` + `(${src[t.NUMERICIDENTIFIER]})`); createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + `(${src[t.NUMERICIDENTIFIERLOOSE]})`); // ## Pre-release Version Identifier // A numeric identifier, or a non-numeric identifier. // Non-numeric identifiers include numeric identifiers but can be longer. // Therefore non-numeric identifiers must go first. createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`); createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`); // ## Pre-release Version // Hyphen, followed by one or more dot-separated pre-release version // identifiers. createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`); createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`); // ## Build Metadata Identifier // Any combination of digits, letters, or hyphens. createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`); // ## Build Metadata // Plus sign, followed by one or more period-separated build metadata // identifiers. createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`); // ## Full Version String // A main version, followed optionally by a pre-release version and // build metadata. // Note that the only major, minor, patch, and pre-release sections of // the version string are capturing groups. The build metadata is not a // capturing group, because it should not ever be used in version // comparison. createToken('FULLPLAIN', `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`); createToken('FULL', `^${src[t.FULLPLAIN]}$`); // like full, but allows v1.2.3 and =1.2.3, which people do sometimes. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty // common in the npm registry. createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`); createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`); createToken('GTLT', '((?:<|>)?=?)'); // Something like "2.*" or "1.2.x". // Note that "x.x" is a valid xRange identifier, meaning "any version" // Only the first item is strictly required. createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`); createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`); createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + `(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?` + `)?)?`); createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?` + `)?)?`); createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`); createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`); // Coercion. // Extract anything that could conceivably be a part of a valid semver createToken('COERCEPLAIN', `${'(^|[^\\d])' + '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`); createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`); createToken('COERCEFULL', src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?` + `(?:${src[t.BUILD]})?` + `(?:$|[^\\d])`); createToken('COERCERTL', src[t.COERCE], true); createToken('COERCERTLFULL', src[t.COERCEFULL], true); // Tilde ranges. // Meaning is "reasonably at or greater than" createToken('LONETILDE', '(?:~>?)'); createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true); exports.tildeTrimReplace = '$1~'; createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`); createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`); // Caret ranges. // Meaning is "at least and backwards compatible with" createToken('LONECARET', '(?:\\^)'); createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true); exports.caretTrimReplace = '$1^'; createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`); createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`); // A simple gt/lt/eq thing, or just "" to indicate "any version" createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`); createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`); // An expression to strip any whitespace between the gtlt and the thing // it modifies, so that `> 1.2.3` ==> `>1.2.3` createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true); exports.comparatorTrimReplace = '$1$2$3'; // Something like `1.2.3 - 1.2.4` // Note that these all use the loose form, because they'll be // checked against either the strict or loose comparator form // later. createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + `\\s+-\\s+` + `(${src[t.XRANGEPLAIN]})` + `\\s*$`); createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + `\\s+-\\s+` + `(${src[t.XRANGEPLAINLOOSE]})` + `\\s*$`); // Star ranges basically just allow anything at all. createToken('STAR', '(<|>)?=?\\s*\\*'); // >=0.0.0 is like a star createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$'); createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$'); }), "[project]/node_modules/semver/ranges/gtr.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; // Determine if version is greater than all the versions possible in the range. const outside = __turbopack_context__.r("[project]/node_modules/semver/ranges/outside.js [app-route] (ecmascript)"); const gtr = (version, range, options)=>outside(version, range, '>', options); module.exports = gtr; }), "[project]/node_modules/semver/ranges/intersects.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const Range = __turbopack_context__.r("[project]/node_modules/semver/classes/range.js [app-route] (ecmascript)"); const intersects = (r1, r2, options)=>{ r1 = new Range(r1, options); r2 = new Range(r2, options); return r1.intersects(r2, options); }; module.exports = intersects; }), "[project]/node_modules/semver/ranges/ltr.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const outside = __turbopack_context__.r("[project]/node_modules/semver/ranges/outside.js [app-route] (ecmascript)"); // Determine if version is less than all the versions possible in the range const ltr = (version, range, options)=>outside(version, range, '<', options); module.exports = ltr; }), "[project]/node_modules/semver/ranges/max-satisfying.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const SemVer = __turbopack_context__.r("[project]/node_modules/semver/classes/semver.js [app-route] (ecmascript)"); const Range = __turbopack_context__.r("[project]/node_modules/semver/classes/range.js [app-route] (ecmascript)"); const maxSatisfying = (versions, range, options)=>{ let max = null; let maxSV = null; let rangeObj = null; try { rangeObj = new Range(range, options); } catch (er) { return null; } versions.forEach((v)=>{ if (rangeObj.test(v)) { // satisfies(v, range, options) if (!max || maxSV.compare(v) === -1) { // compare(max, v, true) max = v; maxSV = new SemVer(max, options); } } }); return max; }; module.exports = maxSatisfying; }), "[project]/node_modules/semver/ranges/min-satisfying.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const SemVer = __turbopack_context__.r("[project]/node_modules/semver/classes/semver.js [app-route] (ecmascript)"); const Range = __turbopack_context__.r("[project]/node_modules/semver/classes/range.js [app-route] (ecmascript)"); const minSatisfying = (versions, range, options)=>{ let min = null; let minSV = null; let rangeObj = null; try { rangeObj = new Range(range, options); } catch (er) { return null; } versions.forEach((v)=>{ if (rangeObj.test(v)) { // satisfies(v, range, options) if (!min || minSV.compare(v) === 1) { // compare(min, v, true) min = v; minSV = new SemVer(min, options); } } }); return min; }; module.exports = minSatisfying; }), "[project]/node_modules/semver/ranges/min-version.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const SemVer = __turbopack_context__.r("[project]/node_modules/semver/classes/semver.js [app-route] (ecmascript)"); const Range = __turbopack_context__.r("[project]/node_modules/semver/classes/range.js [app-route] (ecmascript)"); const gt = __turbopack_context__.r("[project]/node_modules/semver/functions/gt.js [app-route] (ecmascript)"); const minVersion = (range, loose)=>{ range = new Range(range, loose); let minver = new SemVer('0.0.0'); if (range.test(minver)) { return minver; } minver = new SemVer('0.0.0-0'); if (range.test(minver)) { return minver; } minver = null; for(let i = 0; i < range.set.length; ++i){ const comparators = range.set[i]; let setMin = null; comparators.forEach((comparator)=>{ // Clone to avoid manipulating the comparator's semver object. const compver = new SemVer(comparator.semver.version); switch(comparator.operator){ case '>': if (compver.prerelease.length === 0) { compver.patch++; } else { compver.prerelease.push(0); } compver.raw = compver.format(); /* fallthrough */ case '': case '>=': if (!setMin || gt(compver, setMin)) { setMin = compver; } break; case '<': case '<=': break; /* istanbul ignore next */ default: throw new Error(`Unexpected operation: ${comparator.operator}`); } }); if (setMin && (!minver || gt(minver, setMin))) { minver = setMin; } } if (minver && range.test(minver)) { return minver; } return null; }; module.exports = minVersion; }), "[project]/node_modules/semver/ranges/outside.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const SemVer = __turbopack_context__.r("[project]/node_modules/semver/classes/semver.js [app-route] (ecmascript)"); const Comparator = __turbopack_context__.r("[project]/node_modules/semver/classes/comparator.js [app-route] (ecmascript)"); const { ANY } = Comparator; const Range = __turbopack_context__.r("[project]/node_modules/semver/classes/range.js [app-route] (ecmascript)"); const satisfies = __turbopack_context__.r("[project]/node_modules/semver/functions/satisfies.js [app-route] (ecmascript)"); const gt = __turbopack_context__.r("[project]/node_modules/semver/functions/gt.js [app-route] (ecmascript)"); const lt = __turbopack_context__.r("[project]/node_modules/semver/functions/lt.js [app-route] (ecmascript)"); const lte = __turbopack_context__.r("[project]/node_modules/semver/functions/lte.js [app-route] (ecmascript)"); const gte = __turbopack_context__.r("[project]/node_modules/semver/functions/gte.js [app-route] (ecmascript)"); const outside = (version, range, hilo, options)=>{ version = new SemVer(version, options); range = new Range(range, options); let gtfn, ltefn, ltfn, comp, ecomp; switch(hilo){ case '>': gtfn = gt; ltefn = lte; ltfn = lt; comp = '>'; ecomp = '>='; break; case '<': gtfn = lt; ltefn = gte; ltfn = gt; comp = '<'; ecomp = '<='; break; default: throw new TypeError('Must provide a hilo val of "<" or ">"'); } // If it satisfies the range it is not outside if (satisfies(version, range, options)) { return false; } // From now on, variable terms are as if we're in "gtr" mode. // but note that everything is flipped for the "ltr" function. for(let i = 0; i < range.set.length; ++i){ const comparators = range.set[i]; let high = null; let low = null; comparators.forEach((comparator)=>{ if (comparator.semver === ANY) { comparator = new Comparator('>=0.0.0'); } high = high || comparator; low = low || comparator; if (gtfn(comparator.semver, high.semver, options)) { high = comparator; } else if (ltfn(comparator.semver, low.semver, options)) { low = comparator; } }); // If the edge version comparator has a operator then our version // isn't outside it if (high.operator === comp || high.operator === ecomp) { return false; } // If the lowest version comparator has an operator and our version // is less than it then it isn't higher than the range if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { return false; } else if (low.operator === ecomp && ltfn(version, low.semver)) { return false; } } return true; }; module.exports = outside; }), "[project]/node_modules/semver/ranges/simplify.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; // given a set of versions and a range, create a "simplified" range // that includes the same versions that the original range does // If the original range is shorter than the simplified one, return that. const satisfies = __turbopack_context__.r("[project]/node_modules/semver/functions/satisfies.js [app-route] (ecmascript)"); const compare = __turbopack_context__.r("[project]/node_modules/semver/functions/compare.js [app-route] (ecmascript)"); module.exports = (versions, range, options)=>{ const set = []; let first = null; let prev = null; const v = versions.sort((a, b)=>compare(a, b, options)); for (const version of v){ const included = satisfies(version, range, options); if (included) { prev = version; if (!first) { first = version; } } else { if (prev) { set.push([ first, prev ]); } prev = null; first = null; } } if (first) { set.push([ first, null ]); } const ranges = []; for (const [min, max] of set){ if (min === max) { ranges.push(min); } else if (!max && min === v[0]) { ranges.push('*'); } else if (!max) { ranges.push(`>=${min}`); } else if (min === v[0]) { ranges.push(`<=${max}`); } else { ranges.push(`${min} - ${max}`); } } const simplified = ranges.join(' || '); const original = typeof range.raw === 'string' ? range.raw : String(range); return simplified.length < original.length ? simplified : range; }; }), "[project]/node_modules/semver/ranges/subset.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const Range = __turbopack_context__.r("[project]/node_modules/semver/classes/range.js [app-route] (ecmascript)"); const Comparator = __turbopack_context__.r("[project]/node_modules/semver/classes/comparator.js [app-route] (ecmascript)"); const { ANY } = Comparator; const satisfies = __turbopack_context__.r("[project]/node_modules/semver/functions/satisfies.js [app-route] (ecmascript)"); const compare = __turbopack_context__.r("[project]/node_modules/semver/functions/compare.js [app-route] (ecmascript)"); // Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: // - Every simple range `r1, r2, ...` is a null set, OR // - Every simple range `r1, r2, ...` which is not a null set is a subset of // some `R1, R2, ...` // // Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: // - If c is only the ANY comparator // - If C is only the ANY comparator, return true // - Else if in prerelease mode, return false // - else replace c with `[>=0.0.0]` // - If C is only the ANY comparator // - if in prerelease mode, return true // - else replace C with `[>=0.0.0]` // - Let EQ be the set of = comparators in c // - If EQ is more than one, return true (null set) // - Let GT be the highest > or >= comparator in c // - Let LT be the lowest < or <= comparator in c // - If GT and LT, and GT.semver > LT.semver, return true (null set) // - If any C is a = range, and GT or LT are set, return false // - If EQ // - If GT, and EQ does not satisfy GT, return true (null set) // - If LT, and EQ does not satisfy LT, return true (null set) // - If EQ satisfies every C, return true // - Else return false // - If GT // - If GT.semver is lower than any > or >= comp in C, return false // - If GT is >=, and GT.semver does not satisfy every C, return false // - If GT.semver has a prerelease, and not in prerelease mode // - If no C has a prerelease and the GT.semver tuple, return false // - If LT // - If LT.semver is greater than any < or <= comp in C, return false // - If LT is <=, and LT.semver does not satisfy every C, return false // - If LT.semver has a prerelease, and not in prerelease mode // - If no C has a prerelease and the LT.semver tuple, return false // - Else return true const subset = (sub, dom, options = {})=>{ if (sub === dom) { return true; } sub = new Range(sub, options); dom = new Range(dom, options); let sawNonNull = false; OUTER: for (const simpleSub of sub.set){ for (const simpleDom of dom.set){ const isSub = simpleSubset(simpleSub, simpleDom, options); sawNonNull = sawNonNull || isSub !== null; if (isSub) { continue OUTER; } } // the null set is a subset of everything, but null simple ranges in // a complex range should be ignored. so if we saw a non-null range, // then we know this isn't a subset, but if EVERY simple range was null, // then it is a subset. if (sawNonNull) { return false; } } return true; }; const minimumVersionWithPreRelease = [ new Comparator('>=0.0.0-0') ]; const minimumVersion = [ new Comparator('>=0.0.0') ]; const simpleSubset = (sub, dom, options)=>{ if (sub === dom) { return true; } if (sub.length === 1 && sub[0].semver === ANY) { if (dom.length === 1 && dom[0].semver === ANY) { return true; } else if (options.includePrerelease) { sub = minimumVersionWithPreRelease; } else { sub = minimumVersion; } } if (dom.length === 1 && dom[0].semver === ANY) { if (options.includePrerelease) { return true; } else { dom = minimumVersion; } } const eqSet = new Set(); let gt, lt; for (const c of sub){ if (c.operator === '>' || c.operator === '>=') { gt = higherGT(gt, c, options); } else if (c.operator === '<' || c.operator === '<=') { lt = lowerLT(lt, c, options); } else { eqSet.add(c.semver); } } if (eqSet.size > 1) { return null; } let gtltComp; if (gt && lt) { gtltComp = compare(gt.semver, lt.semver, options); if (gtltComp > 0) { return null; } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) { return null; } } // will iterate one or zero times for (const eq of eqSet){ if (gt && !satisfies(eq, String(gt), options)) { return null; } if (lt && !satisfies(eq, String(lt), options)) { return null; } for (const c of dom){ if (!satisfies(eq, String(c), options)) { return false; } } return true; } let higher, lower; let hasDomLT, hasDomGT; // if the subset has a prerelease, we need a comparator in the superset // with the same tuple and a prerelease, or it's not a subset let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false; let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false; // exception: <1.2.3-0 is the same as <1.2.3 if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === '<' && needDomLTPre.prerelease[0] === 0) { needDomLTPre = false; } for (const c of dom){ hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>='; hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<='; if (gt) { if (needDomGTPre) { if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) { needDomGTPre = false; } } if (c.operator === '>' || c.operator === '>=') { higher = higherGT(gt, c, options); if (higher === c && higher !== gt) { return false; } } else if (gt.operator === '>=' && !c.test(gt.semver)) { return false; } } if (lt) { if (needDomLTPre) { if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) { needDomLTPre = false; } } if (c.operator === '<' || c.operator === '<=') { lower = lowerLT(lt, c, options); if (lower === c && lower !== lt) { return false; } } else if (lt.operator === '<=' && !c.test(lt.semver)) { return false; } } if (!c.operator && (lt || gt) && gtltComp !== 0) { return false; } } // if there was a < or >, and nothing in the dom, then must be false // UNLESS it was limited by another range in the other direction. // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 if (gt && hasDomLT && !lt && gtltComp !== 0) { return false; } if (lt && hasDomGT && !gt && gtltComp !== 0) { return false; } // we needed a prerelease range in a specific tuple, but didn't get one // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, // because it includes prereleases in the 1.2.3 tuple if (needDomGTPre || needDomLTPre) { return false; } return true; }; // >=1.2.3 is lower than >1.2.3 const higherGT = (a, b, options)=>{ if (!a) { return b; } const comp = compare(a.semver, b.semver, options); return comp > 0 ? a : comp < 0 ? b : b.operator === '>' && a.operator === '>=' ? b : a; }; // <=1.2.3 is higher than <1.2.3 const lowerLT = (a, b, options)=>{ if (!a) { return b; } const comp = compare(a.semver, b.semver, options); return comp < 0 ? a : comp > 0 ? b : b.operator === '<' && a.operator === '<=' ? b : a; }; module.exports = subset; }), "[project]/node_modules/semver/ranges/to-comparators.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const Range = __turbopack_context__.r("[project]/node_modules/semver/classes/range.js [app-route] (ecmascript)"); // Mostly just for testing and legacy API reasons const toComparators = (range, options)=>new Range(range, options).set.map((comp)=>comp.map((c)=>c.value).join(' ').trim().split(' ')); module.exports = toComparators; }), "[project]/node_modules/semver/ranges/valid.js [app-route] (ecmascript)", ((__turbopack_context__, module, exports) => { "use strict"; const Range = __turbopack_context__.r("[project]/node_modules/semver/classes/range.js [app-route] (ecmascript)"); const validRange = (range, options)=>{ try { // Return '*' instead of '' so that truthiness works. // This will throw if it's invalid anyway return new Range(range, options).range || '*'; } catch (er) { return null; } }; module.exports = validRange; }), ]; //# sourceMappingURL=%5Broot-of-the-server%5D__0-qh_jf._.js.map