{"version":3,"sources":["../../src/server/server-utils.ts"],"names":["normalizeVercelUrl","interpolateDynamicPath","getUtils","req","trustQuery","paramKeys","pageIsDynamic","defaultRouteRegex","_parsedUrl","parseUrl","url","search","key","Object","keys","query","NEXT_QUERY_PARAM_PREFIX","startsWith","groups","includes","formatUrl","pathname","params","param","optional","repeat","builtParam","paramIdx","indexOf","paramValue","value","Array","isArray","map","v","encodeURIComponent","join","slice","length","page","i18n","basePath","rewrites","trailingSlash","caseSensitive","dynamicRouteMatcher","defaultRouteMatches","getNamedRouteRegex","getRouteMatcher","handleRewrites","parsedUrl","rewriteParams","fsPathname","matchesPage","fsPathnameNoSlash","removeTrailingSlash","checkRewrite","rewrite","matcher","getPathMatch","source","removeUnnamedParams","strict","sensitive","has","missing","hasParams","matchHas","assign","parsedDestination","destQuery","prepareDestination","appendParamsToQuery","destination","protocol","replace","RegExp","destLocalePathResult","normalizeLocalePath","locales","nextInternalLocale","detectedLocale","dynamicParams","beforeFiles","finished","afterFiles","fallback","getParamsFromRouteMatches","renderOpts","routeKeys","re","exec","str","obj","fromEntries","URLSearchParams","matchesHasLocale","normalizedKey","substring","routeKeyNames","filterLocaleItem","val","isCatchAll","_val","some","item","toLowerCase","locale","splice","every","name","reduce","prev","keyName","paramName","pos","parseInt","headers","normalizeDynamicRouteParams","ignoreOptional","hasValidParams","normalizeRscPath","defaultValue","isOptional","isDefaultValue","defaultVal","undefined","split"],"mappings":";;;;;;;;;;;;;;;;IAoBgBA,kBAAkB;eAAlBA;;IA0BAC,sBAAsB;eAAtBA;;IAuCAC,QAAQ;eAARA;;;qBA9EuC;qCACnB;2BACP;4BACM;8BACH;oCAIzB;qCAC6B;0BACH;2BACO;AAEjC,SAASF,mBACdG,GAAoB,EACpBC,UAAmB,EACnBC,SAAoB,EACpBC,aAAuB,EACvBC,iBAAqE;IAErE,mEAAmE;IACnE,gDAAgD;IAChD,IAAID,iBAAiBF,cAAcG,mBAAmB;QACpD,MAAMC,aAAaC,IAAAA,UAAQ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