UNPKG

next

Version:

The React Framework

1 lines • 18.1 kB
(()=>{let BACKEND;var SourceType,chunksToRegister=globalThis.TURBOPACK;if(void 0===chunksToRegister)chunksToRegister=[];else if(!Array.isArray(chunksToRegister))return;var ASSET_SUFFIX=getAssetSuffixFromScriptSrc(),SourceType1=((SourceType=SourceType1||{})[SourceType.Runtime=0]="Runtime",SourceType[SourceType.Parent=1]="Parent",SourceType[SourceType.Update=2]="Update",SourceType);let REEXPORTED_OBJECTS=new WeakMap;function Context(module,exports){this.m=module,this.e=exports}let contextPrototype=Context.prototype,hasOwnProperty=Object.prototype.hasOwnProperty,toStringTag="u">typeof Symbol&&Symbol.toStringTag;function defineProp(obj,name,options){hasOwnProperty.call(obj,name)||Object.defineProperty(obj,name,options)}function getOverwrittenModule(moduleCache,id){let module=moduleCache[id];return module||(module=createModuleObject(id),moduleCache[id]=module),module}function createModuleObject(id){return{exports:{},error:void 0,id,namespaceObject:void 0}}function esm(exports,bindings,dynamic){defineProp(exports,"__esModule",{value:!0}),toStringTag&&defineProp(exports,toStringTag,{value:"Module"});let i=0;for(;i<bindings.length;){let propName=bindings[i++],tagOrFunction=bindings[i++];if("number"==typeof tagOrFunction)if(0===tagOrFunction)defineProp(exports,propName,{value:bindings[i++],enumerable:!0,writable:!1});else throw Error(`unexpected tag: ${tagOrFunction}`);else"function"==typeof bindings[i]?defineProp(exports,propName,{get:tagOrFunction,set:bindings[i++],enumerable:!0}):defineProp(exports,propName,{get:tagOrFunction,enumerable:!0})}dynamic||Object.seal(exports)}function ensureDynamicExports(module,exports){let reexportedObjects=REEXPORTED_OBJECTS.get(module);if(!reexportedObjects){REEXPORTED_OBJECTS.set(module,reexportedObjects=[]);let reexportOwning=prop=>{if("default"!==prop){for(let obj of reexportedObjects)if(hasOwnProperty.call(obj,prop))return obj}};module.exports=module.namespaceObject=new Proxy(exports,{get(target,prop){if(hasOwnProperty.call(target,prop)||"default"===prop||"__esModule"===prop)return Reflect.get(target,prop);let obj=reexportOwning(prop);return obj&&Reflect.get(obj,prop)},set:()=>!1,defineProperty:()=>!1,deleteProperty:()=>!1,has:(target,prop)=>!!Reflect.has(target,prop)||"default"!==prop&&"__esModule"!==prop&&void 0!==reexportOwning(prop),ownKeys(target){let keys=Reflect.ownKeys(target);for(let obj of reexportedObjects)for(let key of Reflect.ownKeys(obj))"default"===key||keys.includes(key)||keys.push(key);return keys},getOwnPropertyDescriptor(target,prop){let own=Reflect.getOwnPropertyDescriptor(target,prop);if(own||"default"===prop||"__esModule"===prop)return own;let obj=reexportOwning(prop);if(obj)return{enumerable:!0,configurable:!0,get:()=>Reflect.get(obj,prop)}}})}return reexportedObjects}function exportValue(value,id){(null!=id?getOverwrittenModule(this.c,id):this.m).exports=value}function createGetter(obj,key){return()=>obj[key]}contextPrototype.s=function esmExport(bindings,id,dynamic){let module,exports;null!=id?exports=(module=getOverwrittenModule(this.c,id)).exports:(module=this.m,exports=this.e),module.namespaceObject=exports,esm(exports,bindings,dynamic)},contextPrototype.j=function dynamicExport(object,id){let module,exports;null!=id?exports=(module=getOverwrittenModule(this.c,id)).exports:(module=this.m,exports=this.e);let reexportedObjects=ensureDynamicExports(module,exports);"object"==typeof object&&null!==object&&reexportedObjects.push(object)},contextPrototype.v=exportValue,contextPrototype.n=function exportNamespace(namespace,id){let module;(module=null!=id?getOverwrittenModule(this.c,id):this.m).exports=module.namespaceObject=namespace};let getProto=Object.getPrototypeOf?obj=>Object.getPrototypeOf(obj):obj=>obj.__proto__,LEAF_PROTOTYPES=[null,getProto({}),getProto([]),getProto(getProto)];function interopEsm(raw,ns,allowExportDefault){let bindings=[],defaultLocation=-1;for(let current=raw;("object"==typeof current||"function"==typeof current)&&!LEAF_PROTOTYPES.includes(current);current=getProto(current))for(let key of Object.getOwnPropertyNames(current))bindings.push(key,createGetter(raw,key)),-1===defaultLocation&&"default"===key&&(defaultLocation=bindings.length-1);return allowExportDefault&&defaultLocation>=0||(defaultLocation>=0?bindings.splice(defaultLocation,1,0,raw):bindings.push("default",0,raw)),esm(ns,bindings),ns}function createNS(raw){return"function"==typeof raw?function(...args){return raw.apply(this,args)}:Object.create(null)}function esmImport(id){let module=getOrInstantiateModuleFromParent(id,this.m);if(module.namespaceObject)return module.namespaceObject;let raw=module.exports;return module.namespaceObject=interopEsm(raw,createNS(raw),raw&&raw.__esModule)}function parseRequest(request){let hashIndex=request.indexOf("#");-1!==hashIndex&&(request=request.substring(0,hashIndex));let queryIndex=request.indexOf("?");return -1!==queryIndex&&(request=request.substring(0,queryIndex)),request}function getChunkPath(chunkData){return"string"==typeof chunkData?chunkData:chunkData.path}function installCompressedModuleFactories(chunkModules,offset,moduleFactories,newModuleId){let i=offset,strictFactories=chunkModules[i];for(Array.isArray(strictFactories)&&(installCompressedModuleFactories(strictFactories,0,moduleFactories,newModuleId),i++);i<chunkModules.length;){let existingGroupFactory,end=i+1;for(;end<chunkModules.length&&"function"!=typeof chunkModules[end];)end++;if(end===chunkModules.length)throw Error("malformed chunk format, expected a factory function");let moduleFactoryFn=chunkModules[end];for(let j=i;j<end;j++){let id=chunkModules[j],existingFactory=moduleFactories.get(id);if(existingFactory){existingGroupFactory=existingFactory;break}}let factoryToInstall=existingGroupFactory??moduleFactoryFn,didInstallFactory=!1;for(let j=i;j<end;j++){let id=chunkModules[j];moduleFactories.has(id)||(didInstallFactory||(factoryToInstall===moduleFactoryFn&&applyModuleFactoryName(moduleFactoryFn),didInstallFactory=!0),moduleFactories.set(id,factoryToInstall),newModuleId?.(id))}i=end+1}}contextPrototype.i=esmImport,contextPrototype.A=function asyncLoader(moduleId){return this.r(moduleId)(esmImport.bind(this))},contextPrototype.t="function"==typeof require?require:function require1(){throw Error("Unexpected use of runtime require")},contextPrototype.r=function commonJsRequire(id){return getOrInstantiateModuleFromParent(id,this.m).exports},contextPrototype.f=function moduleContext(map){function moduleContext(id){if(id=parseRequest(id),hasOwnProperty.call(map,id))return map[id].module();let e=Error(`Cannot find module '${id}'`);throw e.code="MODULE_NOT_FOUND",e}return moduleContext.keys=()=>Object.keys(map),moduleContext.resolve=id=>{if(id=parseRequest(id),hasOwnProperty.call(map,id))return map[id].id();let e=Error(`Cannot find module '${id}'`);throw e.code="MODULE_NOT_FOUND",e},moduleContext.import=async id=>await moduleContext(id),moduleContext};let relativeURL=function relativeURL(inputUrl){let realUrl=new URL(inputUrl,"x:/"),values={};for(let key in realUrl)values[key]=realUrl[key];for(let key in values.href=inputUrl,values.pathname=inputUrl.replace(/[?#].*/,""),values.origin=values.protocol="",values.toString=values.toJSON=(..._args)=>inputUrl,values)Object.defineProperty(this,key,{enumerable:!0,configurable:!0,value:values[key]})};function invariant(never,computeMessage){throw Error(`Invariant: ${computeMessage(never)}`)}function factoryNotAvailableMessage(moduleId,sourceType,sourceData){let instantiationReason;switch(sourceType){case 0:instantiationReason=`as a runtime entry of chunk ${sourceData}`;break;case 1:instantiationReason=`because it was required from module ${sourceData}`;break;case 2:instantiationReason="because of an HMR update";break;default:invariant(sourceType,sourceType=>`Unknown source type: ${sourceType}`)}return`Module ${moduleId} was instantiated ${instantiationReason}, but the module factory is not available.`}function applyModuleFactoryName(factory){Object.defineProperty(factory,"name",{value:"module evaluation"})}relativeURL.prototype=URL.prototype,contextPrototype.U=relativeURL,contextPrototype.z=function requireStub(_moduleId){throw Error("dynamic usage of require is not supported")},contextPrototype.g=globalThis;let browserContextPrototype=Context.prototype,RUNTIME_CHUNK_BASE_PATH="string"==typeof TURBOPACK_CHUNK_BASE_PATH?TURBOPACK_CHUNK_BASE_PATH:"/_next/",moduleFactories=new Map;contextPrototype.M=moduleFactories;let availableModules=new Map,availableModuleChunks=new Map,chunkComponents=new Map,componentChunkSizes=new Map;function loadInitialChunk(chunkPath,chunkData){return loadChunkInternal(SourceType1.Runtime,chunkPath,chunkData)}async function loadChunkInternal(sourceType,sourceData,chunkData){let promise;if("string"==typeof chunkData)return function(sourceType,sourceData,chunkEntry){return loadChunkByUrlWhole(sourceType,sourceData,chunkEntry)}(sourceType,sourceData,getChunkRelativeUrl(chunkData));let includedList=chunkData.included||[],modulesPromises=includedList.map(included=>!!moduleFactories.has(included)||availableModules.get(included));if(modulesPromises.length>0&&modulesPromises.every(p=>p))return void await Promise.all(modulesPromises);for(let included of(promise=loadChunkByUrlWhole(sourceType,sourceData,getChunkRelativeUrl(chunkData.path)),includedList))availableModules.has(included)||availableModules.set(included,promise);await promise}browserContextPrototype.l=function loadChunk(chunkData){return loadChunkInternal(SourceType1.Parent,this.m.id,chunkData)};let loadedChunk=Promise.resolve(void 0),instrumentedBackendLoadChunks=new WeakMap;function loadChunkByUrlWhole(sourceType,sourceData,chunkUrl){let thenable=BACKEND.loadChunkCached(sourceType,chunkUrl),entry=instrumentedBackendLoadChunks.get(thenable);if(void 0===entry){let resolve=instrumentedBackendLoadChunks.set.bind(instrumentedBackendLoadChunks,thenable,loadedChunk);entry=thenable.then(resolve).catch(cause=>{let loadReason;switch(sourceType){case SourceType1.Runtime:loadReason=`as a runtime dependency of chunk ${sourceData}`;break;case SourceType1.Parent:loadReason=`from module ${sourceData}`;break;case SourceType1.Update:loadReason="from an HMR update";break;default:invariant(sourceType,sourceType=>`Unknown source type: ${sourceType}`)}let error=Error(`Failed to load chunk ${chunkUrl} ${loadReason}${cause?`: ${cause}`:""}`,cause?{cause}:void 0);throw error.name="ChunkLoadError",error}),instrumentedBackendLoadChunks.set(thenable,entry)}return entry}browserContextPrototype.L=function loadChunkByUrl(chunkEntry){var sourceType,sourceData;return sourceType=SourceType1.Parent,sourceData=this.m.id,loadChunkByUrlWhole(sourceType,sourceData,chunkEntry)},browserContextPrototype.R=function resolvePathFromModule(moduleId){let exported=this.r(moduleId);return exported?.default??exported},browserContextPrototype.P=function resolveAbsolutePath(modulePath){return`/ROOT/${modulePath??""}`},browserContextPrototype.F=function resolveFileUrl(modulePath){return modulePath?`file:///ROOT/${modulePath.split("/").map(encodeURIComponent).join("/")}`:"file:///ROOT/"},browserContextPrototype.q=function exportUrl(url,id){exportValue.call(this,`${url}${ASSET_SUFFIX}`,id)};let CHUNK_PATH_NEEDS_ENCODING=/[^A-Za-z0-9\-_.!~*'()/]/;function getChunkRelativeUrl(chunkPath,basePath=RUNTIME_CHUNK_BASE_PATH){let encodedPath=CHUNK_PATH_NEEDS_ENCODING.test(chunkPath)?chunkPath.split("/").map(encodeURIComponent).join("/"):chunkPath;return`${basePath}${encodedPath}${ASSET_SUFFIX}`}function getPathFromScript(chunkScript){if("string"==typeof chunkScript)return chunkScript;let src=decodeURIComponent(chunkScript.src.replace(/[?#].*$/,""));return src.startsWith(RUNTIME_CHUNK_BASE_PATH)?src.slice(RUNTIME_CHUNK_BASE_PATH.length):src}function getUrlFromScript(chunk){return"string"==typeof chunk?getChunkRelativeUrl(chunk):chunk.src}function getChunkFromRegistration(chunk){if("string"==typeof chunk)return chunk;if(chunk)return{src:chunk.getAttribute("src")};if("u">typeof TURBOPACK_NEXT_CHUNK_URLS)return{src:TURBOPACK_NEXT_CHUNK_URLS.pop()};throw Error("chunk path empty but not in a worker")}function endsWithExtension(chunkUrlOrPath,ext){let end,q=chunkUrlOrPath.indexOf("?");if(-1!==q)end=q;else{let h=chunkUrlOrPath.indexOf("#");end=-1!==h?h:chunkUrlOrPath.length}return end>=ext.length&&chunkUrlOrPath.startsWith(ext,end-ext.length)}function isCss(chunkUrl){return endsWithExtension(chunkUrl,".css")}browserContextPrototype.b=RUNTIME_CHUNK_BASE_PATH,browserContextPrototype.X=ASSET_SUFFIX,browserContextPrototype.h=getChunkRelativeUrl;let moduleCache={};function getOrInstantiateRuntimeModule(chunkPath,moduleId){let module=moduleCache[moduleId];if(module){if(module.error)throw module.error;return module}return instantiateModule(moduleId,SourceType1.Runtime,chunkPath)}contextPrototype.c=moduleCache;let getOrInstantiateModuleFromParent=(id,sourceModule)=>{let module=moduleCache[id];if(module){if(module.error)throw module.error;return module}return instantiateModule(id,SourceType1.Parent,sourceModule.id)};function instantiateModule(id,sourceType,sourceData){let moduleFactory=moduleFactories.get(id);if("function"!=typeof moduleFactory)throw Error(factoryNotAvailableMessage(id,sourceType,sourceData));let module=createModuleObject(id),exports=module.exports;moduleCache[id]=module;let context=new Context(module,exports);try{moduleFactory(context,module,exports)}catch(error){throw module.error=error,error}return module.namespaceObject&&module.exports!==module.namespaceObject&&interopEsm(module.exports,module.namespaceObject),module}function registerChunk(registration){let runtimeParams;if(!Array.isArray(registration))return BACKEND.registerChunk(void 0,registration);let chunk=getChunkFromRegistration(registration[0]);return 2===registration.length?runtimeParams=registration[1]:(runtimeParams=void 0,installCompressedModuleFactories(registration,1,moduleFactories)),BACKEND.registerChunk(chunk,runtimeParams)}function getAssetSuffixFromScriptSrc(){if(null!=self.TURBOPACK_ASSET_SUFFIX)return self.TURBOPACK_ASSET_SUFFIX;let src=document?.currentScript?.getAttribute?.("src")??"",qi=src.indexOf("?");return qi>=0?src.slice(qi):""}let chunkResolvers=new Map;(()=>{function getOrCreateResolver(chunkUrl){let resolver=chunkResolvers.get(chunkUrl);if(!resolver){let resolve,reject;resolver={resolved:!1,loadingStarted:!1,retryAttempts:0,promise:new Promise((innerResolve,innerReject)=>{resolve=innerResolve,reject=innerReject}),resolve:()=>{resolver.resolved=!0,resolve()},reject:reject},chunkResolvers.set(chunkUrl,resolver)}return resolver}function rejectChunkResolver(chunkUrl,resolver,error){chunkResolvers.get(chunkUrl)===resolver&&chunkResolvers.delete(chunkUrl),resolver.reject(error)}function getChunkLoadRetryDelayMs(){return 200+Math.floor(401*Math.random())}function isRetryableChunkLoadError(error){return null==error||error instanceof DOMException&&"NetworkError"===error.name}function onChunkLoadError(sourceType,chunkUrl,resolver,error,reload){!isRetryableChunkLoadError(error)||resolver.retryAttempts>=1||chunkResolvers.get(chunkUrl)!==resolver?rejectChunkResolver(chunkUrl,resolver,error):(resolver.retryAttempts++,setTimeout(()=>{resolver.resolved||chunkResolvers.get(chunkUrl)!==resolver||(reload?reload():(resolver.loadingStarted=!1,doLoadChunk(sourceType,chunkUrl)))},getChunkLoadRetryDelayMs()))}function doLoadChunk(sourceType,chunkUrl){let resolver=getOrCreateResolver(chunkUrl);if(resolver.loadingStarted)return resolver.promise;if(sourceType===SourceType1.Runtime)return resolver.loadingStarted=!0,isCss(chunkUrl)&&resolver.resolve(),resolver.promise;if("function"==typeof importScripts)if(isCss(chunkUrl));else if(endsWithExtension(chunkUrl,".js")){self.TURBOPACK_NEXT_CHUNK_URLS.push(chunkUrl);try{importScripts(chunkUrl)}catch(error){onChunkLoadError(sourceType,chunkUrl,resolver,error)}}else throw Error(`can't infer type of chunk from URL ${chunkUrl} in worker`);else{let decodedChunkUrl=decodeURI(chunkUrl);if(isCss(chunkUrl))if(document.querySelectorAll(`link[rel=stylesheet][href="${chunkUrl}"],link[rel=stylesheet][href^="${chunkUrl}?"],link[rel=stylesheet][href="${decodedChunkUrl}"],link[rel=stylesheet][href^="${decodedChunkUrl}?"]`).length>0)resolver.resolve();else{let createLink=()=>{let link=document.createElement("link");return link.rel="stylesheet",link.crossOrigin=null,link.href=chunkUrl,link.onerror=()=>{let anchor=document.createComment("");link.replaceWith(anchor),onChunkLoadError(sourceType,chunkUrl,resolver,void 0,()=>anchor.replaceWith(createLink()))},link.onload=()=>{resolver.resolve()},link};document.head.appendChild(createLink())}else if(endsWithExtension(chunkUrl,".js")){let previousScripts=document.querySelectorAll(`script[src="${chunkUrl}"],script[src^="${chunkUrl}?"],script[src="${decodedChunkUrl}"],script[src^="${decodedChunkUrl}?"]`);if(previousScripts.length>0)for(let script of Array.from(previousScripts))script.addEventListener("error",()=>{script.remove(),onChunkLoadError(sourceType,chunkUrl,resolver)},{once:!0});else{let script=document.createElement("script");script.crossOrigin=null,script.src=chunkUrl,script.onerror=()=>{script.remove(),onChunkLoadError(sourceType,chunkUrl,resolver)},document.head.appendChild(script)}}else throw Error(`can't infer type of chunk from URL ${chunkUrl}`)}return resolver.loadingStarted=!0,resolver.promise}BACKEND={async registerChunk(chunk,params){let chunkPath;if(null!=chunk&&(chunkPath=getPathFromScript(chunk),getOrCreateResolver(getUrlFromScript(chunk)).resolve()),null!=params){for(let otherChunkData of params.otherChunks)getOrCreateResolver(getChunkRelativeUrl(getChunkPath(otherChunkData)));if(await Promise.all(params.otherChunks.map(otherChunkData=>loadInitialChunk(chunkPath,otherChunkData))),params.runtimeModuleIds.length>0)for(let moduleId of params.runtimeModuleIds)getOrInstantiateRuntimeModule(chunkPath,moduleId)}},loadChunkCached:(sourceType,chunkUrl)=>doLoadChunk(sourceType,chunkUrl)}})(),globalThis.TURBOPACK={push:registerChunk},chunksToRegister.forEach(registerChunk)})();