Unverified Commit e0cc9cd4 authored by Ethan Arrowood's avatar Ethan Arrowood Committed by GitHub

feat(experimental): option to polyfill `fetch` using `undici` in Node.js <18 (#40318)

This PR adds a new `experimental.enableUndici` option to let the
developer switch from `next-fetch` to `undici` as the underlying
polyfill for `fetch` in Node.js.

In the current implementation, Next.js makes sure that `fetch` is always
available by using `node-fetch`. However, we do not polyfill in Node.js
18+, since those versions come with their own `fetch` implementation
already, built-in.

Node.js 18+ uses `undici` under the hood, so letting the developer use
`undici` earlier could make the migration easier later on.

Eventually, we hope to be able to stop polyfilling `fetch` in an
upcoming major version of Next.js, shipping less code.


## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
Co-authored-by: 's avatarBalázs Orbán <info@balazsorban.com>
Co-authored-by: 's avatarSukka <isukkaw@gmail.com>
Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
Co-authored-by: 's avatarSteven <steven@ceriously.com>
parent bc685142
......@@ -3,6 +3,7 @@ const nextJest = require('next/jest')
const createJestConfig = nextJest()
// Any custom config you want to pass to Jest
/** @type {import('jest').Config} */
const customJestConfig = {
testMatch: ['**/*.test.js', '**/*.test.ts', '**/*.test.tsx'],
setupFilesAfterEnv: ['<rootDir>/jest-setup-after-env.ts'],
......@@ -10,6 +11,9 @@ const customJestConfig = {
rootDir: 'test',
modulePaths: ['<rootDir>/lib'],
transformIgnorePatterns: ['/next[/\\\\]dist/', '/\\.next/'],
globals: {
AbortSignal: global.AbortSignal,
},
}
// createJestConfig is exported in this way to ensure that next/jest can load the Next.js config which is async
......
......@@ -1205,6 +1205,7 @@ export default async function build(
configFileName,
runtimeEnvConfig,
httpAgentOptions: config.httpAgentOptions,
enableUndici: config.experimental.enableUndici,
locales: config.i18n?.locales,
defaultLocale: config.i18n?.defaultLocale,
pageRuntime: config.experimental.runtime,
......@@ -1352,6 +1353,7 @@ export default async function build(
configFileName,
runtimeEnvConfig,
httpAgentOptions: config.httpAgentOptions,
enableUndici: config.experimental.enableUndici,
locales: config.i18n?.locales,
defaultLocale: config.i18n?.defaultLocale,
parentId: isPageStaticSpan.id,
......
......@@ -41,7 +41,7 @@ import {
LoadComponentsReturnType,
} from '../server/load-components'
import { trace } from '../trace'
import { setHttpAgentOptions } from '../server/config'
import { setHttpClientAndAgentOptions } from '../server/config'
import { recursiveDelete } from '../lib/recursive-delete'
import { Sema } from 'next/dist/compiled/async-sema'
import { MiddlewareManifest } from './webpack/plugins/middleware-plugin'
......@@ -1169,6 +1169,7 @@ export async function isPageStatic({
configFileName,
runtimeEnvConfig,
httpAgentOptions,
enableUndici,
locales,
defaultLocale,
parentId,
......@@ -1184,6 +1185,7 @@ export async function isPageStatic({
configFileName: string
runtimeEnvConfig: any
httpAgentOptions: NextConfigComplete['httpAgentOptions']
enableUndici?: NextConfigComplete['experimental']['enableUndici']
locales?: string[]
defaultLocale?: string
parentId?: any
......@@ -1210,7 +1212,10 @@ export async function isPageStatic({
return isPageStaticSpan
.traceAsyncFn(async () => {
require('../shared/lib/runtime-config').setConfig(runtimeEnvConfig)
setHttpAgentOptions(httpAgentOptions)
setHttpClientAndAgentOptions({
httpAgentOptions,
experimental: { enableUndici },
})
let componentsResult: LoadComponentsReturnType
let prerenderRoutes: Array<string> | undefined
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -10,6 +10,6 @@
* @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
* @see http://sites.google.com/site/murmurhash/
*/
(function(){var r;function MurmurHash3(e,t){var a=this instanceof MurmurHash3?this:r;a.reset(t);if(typeof e==="string"&&e.length>0){a.hash(e)}if(a!==this){return a}}MurmurHash3.prototype.hash=function(e){var r,t,a,s,i;i=e.length;this.len+=i;t=this.k1;a=0;switch(this.rem){case 0:t^=i>a?e.charCodeAt(a++)&65535:0;case 1:t^=i>a?(e.charCodeAt(a++)&65535)<<8:0;case 2:t^=i>a?(e.charCodeAt(a++)&65535)<<16:0;case 3:t^=i>a?(e.charCodeAt(a)&255)<<24:0;t^=i>a?(e.charCodeAt(a++)&65280)>>8:0}this.rem=i+this.rem&3;i-=this.rem;if(i>0){r=this.h1;while(1){t=t*11601+(t&65535)*3432906752&4294967295;t=t<<15|t>>>17;t=t*13715+(t&65535)*461832192&4294967295;r^=t;r=r<<13|r>>>19;r=r*5+3864292196&4294967295;if(a>=i){break}t=e.charCodeAt(a++)&65535^(e.charCodeAt(a++)&65535)<<8^(e.charCodeAt(a++)&65535)<<16;s=e.charCodeAt(a++);t^=(s&255)<<24^(s&65280)>>8}t=0;switch(this.rem){case 3:t^=(e.charCodeAt(a+2)&65535)<<16;case 2:t^=(e.charCodeAt(a+1)&65535)<<8;case 1:t^=e.charCodeAt(a)&65535}this.h1=r}this.k1=t;return this};MurmurHash3.prototype.result=function(){var e,r;e=this.k1;r=this.h1;if(e>0){e=e*11601+(e&65535)*3432906752&4294967295;e=e<<15|e>>>17;e=e*13715+(e&65535)*461832192&4294967295;r^=e}r^=this.len;r^=r>>>16;r=r*51819+(r&65535)*2246770688&4294967295;r^=r>>>13;r=r*44597+(r&65535)*3266445312&4294967295;r^=r>>>16;return r>>>0};MurmurHash3.prototype.reset=function(e){this.h1=typeof e==="number"?e:0;this.rem=this.k1=this.len=0;return this};r=new MurmurHash3;if(true){e.exports=MurmurHash3}else{}})()},8683:e=>{"use strict";e.exports=e=>{const r=typeof e;return e!==null&&(r==="object"||r==="function")}},9232:e=>{e.exports=isTypedArray;isTypedArray.strict=isStrictTypedArray;isTypedArray.loose=isLooseTypedArray;var r=Object.prototype.toString;var t={"[object Int8Array]":true,"[object Int16Array]":true,"[object Int32Array]":true,"[object Uint8Array]":true,"[object Uint8ClampedArray]":true,"[object Uint16Array]":true,"[object Uint32Array]":true,"[object Float32Array]":true,"[object Float64Array]":true};function isTypedArray(e){return isStrictTypedArray(e)||isLooseTypedArray(e)}function isStrictTypedArray(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function isLooseTypedArray(e){return t[r.call(e)]}},6042:e=>{"use strict";var r=e.exports=function(e,r,t){if(typeof r=="function"){t=r;r={}}t=r.cb||t;var a=typeof t=="function"?t:t.pre||function(){};var s=t.post||function(){};_traverse(r,a,s,e,"",e)};r.keywords={additionalItems:true,items:true,contains:true,additionalProperties:true,propertyNames:true,not:true};r.arrayKeywords={items:true,allOf:true,anyOf:true,oneOf:true};r.propsKeywords={definitions:true,properties:true,patternProperties:true,dependencies:true};r.skipKeywords={default:true,enum:true,const:true,required:true,maximum:true,minimum:true,exclusiveMaximum:true,exclusiveMinimum:true,multipleOf:true,maxLength:true,minLength:true,pattern:true,format:true,maxItems:true,minItems:true,uniqueItems:true,maxProperties:true,minProperties:true};function _traverse(e,t,a,s,i,o,n,l,f,c){if(s&&typeof s=="object"&&!Array.isArray(s)){t(s,i,o,n,l,f,c);for(var u in s){var h=s[u];if(Array.isArray(h)){if(u in r.arrayKeywords){for(var d=0;d<h.length;d++)_traverse(e,t,a,h[d],i+"/"+u+"/"+d,o,i,u,s,d)}}else if(u in r.propsKeywords){if(h&&typeof h=="object"){for(var p in h)_traverse(e,t,a,h[p],i+"/"+u+"/"+escapeJsonPtr(p),o,i,u,s,p)}}else if(u in r.keywords||e.allKeys&&!(u in r.skipKeywords)){_traverse(e,t,a,h,i+"/"+u,o,i,u,s)}}a(s,i,o,n,l,f,c)}}function escapeJsonPtr(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}},5940:(e,r,t)=>{"use strict";const a=t(7147);const s=t(1017);const{promisify:i}=t(3837);const o=t(7849);const n=o.satisfies(process.version,">=10.12.0");const checkPath=e=>{if(process.platform==="win32"){const r=/[<>:"|?*]/.test(e.replace(s.parse(e).root,""));if(r){const r=new Error(`Path contains invalid characters: ${e}`);r.code="EINVAL";throw r}}};const processOptions=e=>{const r={mode:511,fs:a};return{...r,...e}};const permissionError=e=>{const r=new Error(`operation not permitted, mkdir '${e}'`);r.code="EPERM";r.errno=-4048;r.path=e;r.syscall="mkdir";return r};const makeDir=async(e,r)=>{checkPath(e);r=processOptions(r);const t=i(r.fs.mkdir);const o=i(r.fs.stat);if(n&&r.fs.mkdir===a.mkdir){const a=s.resolve(e);await t(a,{mode:r.mode,recursive:true});return a}const make=async e=>{try{await t(e,r.mode);return e}catch(r){if(r.code==="EPERM"){throw r}if(r.code==="ENOENT"){if(s.dirname(e)===e){throw permissionError(e)}if(r.message.includes("null bytes")){throw r}await make(s.dirname(e));return make(e)}try{const r=await o(e);if(!r.isDirectory()){throw new Error("The path is not a directory")}}catch(e){throw r}return e}};return make(s.resolve(e))};e.exports=makeDir;e.exports.sync=(e,r)=>{checkPath(e);r=processOptions(r);if(n&&r.fs.mkdirSync===a.mkdirSync){const t=s.resolve(e);a.mkdirSync(t,{mode:r.mode,recursive:true});return t}const make=e=>{try{r.fs.mkdirSync(e,r.mode)}catch(t){if(t.code==="EPERM"){throw t}if(t.code==="ENOENT"){if(s.dirname(e)===e){throw permissionError(e)}if(t.message.includes("null bytes")){throw t}make(s.dirname(e));return make(e)}try{if(!r.fs.statSync(e).isDirectory()){throw new Error("The path is not a directory")}}catch(e){throw t}}return e};return make(s.resolve(e))}},990:(e,r,t)=>{"use strict";const a=t(5055);e.exports=async({cwd:e}={})=>a("package.json",{cwd:e});e.exports.sync=({cwd:e}={})=>a.sync("package.json",{cwd:e})},2483:(e,r,t)=>{var a=t(9491);var s=t(8589);var i=/^win/i.test(process.platform);var o=t(2361);if(typeof o!=="function"){o=o.EventEmitter}var n;if(process.__signal_exit_emitter__){n=process.__signal_exit_emitter__}else{n=process.__signal_exit_emitter__=new o;n.count=0;n.emitted={}}if(!n.infinite){n.setMaxListeners(Infinity);n.infinite=true}e.exports=function(e,r){a.equal(typeof e,"function","a callback must be provided for exit handler");if(f===false){load()}var t="exit";if(r&&r.alwaysLast){t="afterexit"}var remove=function(){n.removeListener(t,e);if(n.listeners("exit").length===0&&n.listeners("afterexit").length===0){unload()}};n.on(t,e);return remove};e.exports.unload=unload;function unload(){if(!f){return}f=false;s.forEach((function(e){try{process.removeListener(e,l[e])}catch(e){}}));process.emit=u;process.reallyExit=c;n.count-=1}function emit(e,r,t){if(n.emitted[e]){return}n.emitted[e]=true;n.emit(e,r,t)}var l={};s.forEach((function(e){l[e]=function listener(){var r=process.listeners(e);if(r.length===n.count){unload();emit("exit",null,e);emit("afterexit",null,e);if(i&&e==="SIGHUP"){e="SIGINT"}process.kill(process.pid,e)}}}));e.exports.signals=function(){return s};e.exports.load=load;var f=false;function load(){if(f){return}f=true;n.count+=1;s=s.filter((function(e){try{process.on(e,l[e]);return true}catch(e){return false}}));process.emit=processEmit;process.reallyExit=processReallyExit}var c=process.reallyExit;function processReallyExit(e){process.exitCode=e||0;emit("exit",process.exitCode,null);emit("afterexit",process.exitCode,null);c.call(process,process.exitCode)}var u=process.emit;function processEmit(e,r){if(e==="exit"){if(r!==undefined){process.exitCode=r}var t=u.apply(this,arguments);emit("exit",process.exitCode,null);emit("afterexit",process.exitCode,null);return t}else{return u.apply(this,arguments)}}},8589:e=>{e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32"){e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(process.platform==="linux"){e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}},1449:(e,r,t)=>{var a=t(9232).strict;e.exports=function typedarrayToBuffer(e){if(a(e)){var r=Buffer.from(e.buffer);if(e.byteLength!==e.buffer.byteLength){r=r.slice(e.byteOffset,e.byteOffset+e.byteLength)}return r}else{return Buffer.from(e)}}},4618:function(e,r){
(function(){var r;function MurmurHash3(e,t){var a=this instanceof MurmurHash3?this:r;a.reset(t);if(typeof e==="string"&&e.length>0){a.hash(e)}if(a!==this){return a}}MurmurHash3.prototype.hash=function(e){var r,t,a,s,i;i=e.length;this.len+=i;t=this.k1;a=0;switch(this.rem){case 0:t^=i>a?e.charCodeAt(a++)&65535:0;case 1:t^=i>a?(e.charCodeAt(a++)&65535)<<8:0;case 2:t^=i>a?(e.charCodeAt(a++)&65535)<<16:0;case 3:t^=i>a?(e.charCodeAt(a)&255)<<24:0;t^=i>a?(e.charCodeAt(a++)&65280)>>8:0}this.rem=i+this.rem&3;i-=this.rem;if(i>0){r=this.h1;while(1){t=t*11601+(t&65535)*3432906752&4294967295;t=t<<15|t>>>17;t=t*13715+(t&65535)*461832192&4294967295;r^=t;r=r<<13|r>>>19;r=r*5+3864292196&4294967295;if(a>=i){break}t=e.charCodeAt(a++)&65535^(e.charCodeAt(a++)&65535)<<8^(e.charCodeAt(a++)&65535)<<16;s=e.charCodeAt(a++);t^=(s&255)<<24^(s&65280)>>8}t=0;switch(this.rem){case 3:t^=(e.charCodeAt(a+2)&65535)<<16;case 2:t^=(e.charCodeAt(a+1)&65535)<<8;case 1:t^=e.charCodeAt(a)&65535}this.h1=r}this.k1=t;return this};MurmurHash3.prototype.result=function(){var e,r;e=this.k1;r=this.h1;if(e>0){e=e*11601+(e&65535)*3432906752&4294967295;e=e<<15|e>>>17;e=e*13715+(e&65535)*461832192&4294967295;r^=e}r^=this.len;r^=r>>>16;r=r*51819+(r&65535)*2246770688&4294967295;r^=r>>>13;r=r*44597+(r&65535)*3266445312&4294967295;r^=r>>>16;return r>>>0};MurmurHash3.prototype.reset=function(e){this.h1=typeof e==="number"?e:0;this.rem=this.k1=this.len=0;return this};r=new MurmurHash3;if(true){e.exports=MurmurHash3}else{}})()},8683:e=>{"use strict";e.exports=e=>{const r=typeof e;return e!==null&&(r==="object"||r==="function")}},9232:e=>{e.exports=isTypedArray;isTypedArray.strict=isStrictTypedArray;isTypedArray.loose=isLooseTypedArray;var r=Object.prototype.toString;var t={"[object Int8Array]":true,"[object Int16Array]":true,"[object Int32Array]":true,"[object Uint8Array]":true,"[object Uint8ClampedArray]":true,"[object Uint16Array]":true,"[object Uint32Array]":true,"[object Float32Array]":true,"[object Float64Array]":true};function isTypedArray(e){return isStrictTypedArray(e)||isLooseTypedArray(e)}function isStrictTypedArray(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function isLooseTypedArray(e){return t[r.call(e)]}},6042:e=>{"use strict";var r=e.exports=function(e,r,t){if(typeof r=="function"){t=r;r={}}t=r.cb||t;var a=typeof t=="function"?t:t.pre||function(){};var s=t.post||function(){};_traverse(r,a,s,e,"",e)};r.keywords={additionalItems:true,items:true,contains:true,additionalProperties:true,propertyNames:true,not:true};r.arrayKeywords={items:true,allOf:true,anyOf:true,oneOf:true};r.propsKeywords={definitions:true,properties:true,patternProperties:true,dependencies:true};r.skipKeywords={default:true,enum:true,const:true,required:true,maximum:true,minimum:true,exclusiveMaximum:true,exclusiveMinimum:true,multipleOf:true,maxLength:true,minLength:true,pattern:true,format:true,maxItems:true,minItems:true,uniqueItems:true,maxProperties:true,minProperties:true};function _traverse(e,t,a,s,i,o,n,l,f,c){if(s&&typeof s=="object"&&!Array.isArray(s)){t(s,i,o,n,l,f,c);for(var u in s){var h=s[u];if(Array.isArray(h)){if(u in r.arrayKeywords){for(var d=0;d<h.length;d++)_traverse(e,t,a,h[d],i+"/"+u+"/"+d,o,i,u,s,d)}}else if(u in r.propsKeywords){if(h&&typeof h=="object"){for(var p in h)_traverse(e,t,a,h[p],i+"/"+u+"/"+escapeJsonPtr(p),o,i,u,s,p)}}else if(u in r.keywords||e.allKeys&&!(u in r.skipKeywords)){_traverse(e,t,a,h,i+"/"+u,o,i,u,s)}}a(s,i,o,n,l,f,c)}}function escapeJsonPtr(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}},5940:(e,r,t)=>{"use strict";const a=t(7147);const s=t(1017);const{promisify:i}=t(3837);const o=t(7849);const n=o.satisfies(process.version,">=10.12.0");const checkPath=e=>{if(process.platform==="win32"){const r=/[<>:"|?*]/.test(e.replace(s.parse(e).root,""));if(r){const r=new Error(`Path contains invalid characters: ${e}`);r.code="EINVAL";throw r}}};const processOptions=e=>{const r={mode:511,fs:a};return{...r,...e}};const permissionError=e=>{const r=new Error(`operation not permitted, mkdir '${e}'`);r.code="EPERM";r.errno=-4048;r.path=e;r.syscall="mkdir";return r};const makeDir=async(e,r)=>{checkPath(e);r=processOptions(r);const t=i(r.fs.mkdir);const o=i(r.fs.stat);if(n&&r.fs.mkdir===a.mkdir){const a=s.resolve(e);await t(a,{mode:r.mode,recursive:true});return a}const make=async e=>{try{await t(e,r.mode);return e}catch(r){if(r.code==="EPERM"){throw r}if(r.code==="ENOENT"){if(s.dirname(e)===e){throw permissionError(e)}if(r.message.includes("null bytes")){throw r}await make(s.dirname(e));return make(e)}try{const r=await o(e);if(!r.isDirectory()){throw new Error("The path is not a directory")}}catch(e){throw r}return e}};return make(s.resolve(e))};e.exports=makeDir;e.exports.sync=(e,r)=>{checkPath(e);r=processOptions(r);if(n&&r.fs.mkdirSync===a.mkdirSync){const t=s.resolve(e);a.mkdirSync(t,{mode:r.mode,recursive:true});return t}const make=e=>{try{r.fs.mkdirSync(e,r.mode)}catch(t){if(t.code==="EPERM"){throw t}if(t.code==="ENOENT"){if(s.dirname(e)===e){throw permissionError(e)}if(t.message.includes("null bytes")){throw t}make(s.dirname(e));return make(e)}try{if(!r.fs.statSync(e).isDirectory()){throw new Error("The path is not a directory")}}catch(e){throw t}}return e};return make(s.resolve(e))}},990:(e,r,t)=>{"use strict";const a=t(5055);e.exports=async({cwd:e}={})=>a("package.json",{cwd:e});e.exports.sync=({cwd:e}={})=>a.sync("package.json",{cwd:e})},7234:(e,r,t)=>{var a=global.process;const processOk=function(e){return e&&typeof e==="object"&&typeof e.removeListener==="function"&&typeof e.emit==="function"&&typeof e.reallyExit==="function"&&typeof e.listeners==="function"&&typeof e.kill==="function"&&typeof e.pid==="number"&&typeof e.on==="function"};if(!processOk(a)){e.exports=function(){return function(){}}}else{var s=t(9491);var i=t(8986);var o=/^win/i.test(a.platform);var n=t(2361);if(typeof n!=="function"){n=n.EventEmitter}var l;if(a.__signal_exit_emitter__){l=a.__signal_exit_emitter__}else{l=a.__signal_exit_emitter__=new n;l.count=0;l.emitted={}}if(!l.infinite){l.setMaxListeners(Infinity);l.infinite=true}e.exports=function(e,r){if(!processOk(global.process)){return function(){}}s.equal(typeof e,"function","a callback must be provided for exit handler");if(h===false){d()}var t="exit";if(r&&r.alwaysLast){t="afterexit"}var remove=function(){l.removeListener(t,e);if(l.listeners("exit").length===0&&l.listeners("afterexit").length===0){f()}};l.on(t,e);return remove};var f=function unload(){if(!h||!processOk(global.process)){return}h=false;i.forEach((function(e){try{a.removeListener(e,u[e])}catch(e){}}));a.emit=m;a.reallyExit=p;l.count-=1};e.exports.unload=f;var c=function emit(e,r,t){if(l.emitted[e]){return}l.emitted[e]=true;l.emit(e,r,t)};var u={};i.forEach((function(e){u[e]=function listener(){if(!processOk(global.process)){return}var r=a.listeners(e);if(r.length===l.count){f();c("exit",null,e);c("afterexit",null,e);if(o&&e==="SIGHUP"){e="SIGINT"}a.kill(a.pid,e)}}}));e.exports.signals=function(){return i};var h=false;var d=function load(){if(h||!processOk(global.process)){return}h=true;l.count+=1;i=i.filter((function(e){try{a.on(e,u[e]);return true}catch(e){return false}}));a.emit=y;a.reallyExit=v};e.exports.load=d;var p=a.reallyExit;var v=function processReallyExit(e){if(!processOk(global.process)){return}a.exitCode=e||0;c("exit",a.exitCode,null);c("afterexit",a.exitCode,null);p.call(a,a.exitCode)};var m=a.emit;var y=function processEmit(e,r){if(e==="exit"&&processOk(global.process)){if(r!==undefined){a.exitCode=r}var t=m.apply(this,arguments);c("exit",a.exitCode,null);c("afterexit",a.exitCode,null);return t}else{return m.apply(this,arguments)}}}},8986:e=>{e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32"){e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(process.platform==="linux"){e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}},1449:(e,r,t)=>{var a=t(9232).strict;e.exports=function typedarrayToBuffer(e){if(a(e)){var r=Buffer.from(e.buffer);if(e.byteLength!==e.buffer.byteLength){r=r.slice(e.byteOffset,e.byteOffset+e.byteLength)}return r}else{return Buffer.from(e)}}},4618:function(e,r){
/** @license URI.js v4.2.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
(function(e,t){true?t(r):0})(this,(function(e){"use strict";function merge(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++){r[t]=arguments[t]}if(r.length>1){r[0]=r[0].slice(0,-1);var a=r.length-1;for(var s=1;s<a;++s){r[s]=r[s].slice(1,-1)}r[a]=r[a].slice(1);return r.join("")}else{return r[0]}}function subexp(e){return"(?:"+e+")"}function typeOf(e){return e===undefined?"undefined":e===null?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function toUpperCase(e){return e.toUpperCase()}function toArray(e){return e!==undefined&&e!==null?e instanceof Array?e:typeof e.length!=="number"||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function assign(e,r){var t=e;if(r){for(var a in r){t[a]=r[a]}}return t}function buildExps(e){var r="[A-Za-z]",t="[\\x0D]",a="[0-9]",s="[\\x22]",i=merge(a,"[A-Fa-f]"),o="[\\x0A]",n="[\\x20]",l=subexp(subexp("%[EFef]"+i+"%"+i+i+"%"+i+i)+"|"+subexp("%[89A-Fa-f]"+i+"%"+i+i)+"|"+subexp("%"+i+i)),f="[\\:\\/\\?\\#\\[\\]\\@]",c="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",u=merge(f,c),h=e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",d=e?"[\\uE000-\\uF8FF]":"[]",p=merge(r,a,"[\\-\\.\\_\\~]",h),v=subexp(r+merge(r,a,"[\\+\\-\\.]")+"*"),m=subexp(subexp(l+"|"+merge(p,c,"[\\:]"))+"*"),y=subexp(subexp("25[0-5]")+"|"+subexp("2[0-4]"+a)+"|"+subexp("1"+a+a)+"|"+subexp("[1-9]"+a)+"|"+a),g=subexp(subexp("25[0-5]")+"|"+subexp("2[0-4]"+a)+"|"+subexp("1"+a+a)+"|"+subexp("0?[1-9]"+a)+"|0?0?"+a),P=subexp(g+"\\."+g+"\\."+g+"\\."+g),E=subexp(i+"{1,4}"),b=subexp(subexp(E+"\\:"+E)+"|"+P),w=subexp(subexp(E+"\\:")+"{6}"+b),S=subexp("\\:\\:"+subexp(E+"\\:")+"{5}"+b),x=subexp(subexp(E)+"?\\:\\:"+subexp(E+"\\:")+"{4}"+b),_=subexp(subexp(subexp(E+"\\:")+"{0,1}"+E)+"?\\:\\:"+subexp(E+"\\:")+"{3}"+b),j=subexp(subexp(subexp(E+"\\:")+"{0,2}"+E)+"?\\:\\:"+subexp(E+"\\:")+"{2}"+b),R=subexp(subexp(subexp(E+"\\:")+"{0,3}"+E)+"?\\:\\:"+E+"\\:"+b),F=subexp(subexp(subexp(E+"\\:")+"{0,4}"+E)+"?\\:\\:"+b),D=subexp(subexp(subexp(E+"\\:")+"{0,5}"+E)+"?\\:\\:"+E),$=subexp(subexp(subexp(E+"\\:")+"{0,6}"+E)+"?\\:\\:"),A=subexp([w,S,x,_,j,R,F,D,$].join("|")),I=subexp(subexp(p+"|"+l)+"+"),C=subexp(A+"\\%25"+I),O=subexp(A+subexp("\\%25|\\%(?!"+i+"{2})")+I),k=subexp("[vV]"+i+"+\\."+merge(p,c,"[\\:]")+"+"),T=subexp("\\["+subexp(O+"|"+A+"|"+k)+"\\]"),z=subexp(subexp(l+"|"+merge(p,c))+"*"),L=subexp(T+"|"+P+"(?!"+z+")"+"|"+z),N=subexp(a+"*"),U=subexp(subexp(m+"@")+"?"+L+subexp("\\:"+N)+"?"),q=subexp(l+"|"+merge(p,c,"[\\:\\@]")),V=subexp(q+"*"),Q=subexp(q+"+"),M=subexp(subexp(l+"|"+merge(p,c,"[\\@]"))+"+"),H=subexp(subexp("\\/"+V)+"*"),K=subexp("\\/"+subexp(Q+H)+"?"),B=subexp(M+H),J=subexp(Q+H),G="(?!"+q+")",Z=subexp(H+"|"+K+"|"+B+"|"+J+"|"+G),X=subexp(subexp(q+"|"+merge("[\\/\\?]",d))+"*"),Y=subexp(subexp(q+"|[\\/\\?]")+"*"),W=subexp(subexp("\\/\\/"+U+H)+"|"+K+"|"+J+"|"+G),ee=subexp(v+"\\:"+W+subexp("\\?"+X)+"?"+subexp("\\#"+Y)+"?"),re=subexp(subexp("\\/\\/"+U+H)+"|"+K+"|"+B+"|"+G),te=subexp(re+subexp("\\?"+X)+"?"+subexp("\\#"+Y)+"?"),ae=subexp(ee+"|"+te),se=subexp(v+"\\:"+W+subexp("\\?"+X)+"?"),ie="^("+v+")\\:"+subexp(subexp("\\/\\/("+subexp("("+m+")@")+"?("+L+")"+subexp("\\:("+N+")")+"?)")+"?("+H+"|"+K+"|"+J+"|"+G+")")+subexp("\\?("+X+")")+"?"+subexp("\\#("+Y+")")+"?$",oe="^(){0}"+subexp(subexp("\\/\\/("+subexp("("+m+")@")+"?("+L+")"+subexp("\\:("+N+")")+"?)")+"?("+H+"|"+K+"|"+B+"|"+G+")")+subexp("\\?("+X+")")+"?"+subexp("\\#("+Y+")")+"?$",ne="^("+v+")\\:"+subexp(subexp("\\/\\/("+subexp("("+m+")@")+"?("+L+")"+subexp("\\:("+N+")")+"?)")+"?("+H+"|"+K+"|"+J+"|"+G+")")+subexp("\\?("+X+")")+"?$",le="^"+subexp("\\#("+Y+")")+"?$",fe="^"+subexp("("+m+")@")+"?("+L+")"+subexp("\\:("+N+")")+"?$";return{NOT_SCHEME:new RegExp(merge("[^]",r,a,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(merge("[^\\%\\:]",p,c),"g"),NOT_HOST:new RegExp(merge("[^\\%\\[\\]\\:]",p,c),"g"),NOT_PATH:new RegExp(merge("[^\\%\\/\\:\\@]",p,c),"g"),NOT_PATH_NOSCHEME:new RegExp(merge("[^\\%\\/\\@]",p,c),"g"),NOT_QUERY:new RegExp(merge("[^\\%]",p,c,"[\\:\\@\\/\\?]",d),"g"),NOT_FRAGMENT:new RegExp(merge("[^\\%]",p,c,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(merge("[^]",p,c),"g"),UNRESERVED:new RegExp(p,"g"),OTHER_CHARS:new RegExp(merge("[^\\%]",p,u),"g"),PCT_ENCODED:new RegExp(l,"g"),IPV4ADDRESS:new RegExp("^("+P+")$"),IPV6ADDRESS:new RegExp("^\\[?("+A+")"+subexp(subexp("\\%25|\\%(?!"+i+"{2})")+"("+I+")")+"?\\]?$")}}var r=buildExps(false);var t=buildExps(true);var a=function(){function sliceIterator(e,r){var t=[];var a=true;var s=false;var i=undefined;try{for(var o=e[Symbol.iterator](),n;!(a=(n=o.next()).done);a=true){t.push(n.value);if(r&&t.length===r)break}}catch(e){s=true;i=e}finally{try{if(!a&&o["return"])o["return"]()}finally{if(s)throw i}}return t}return function(e,r){if(Array.isArray(e)){return e}else if(Symbol.iterator in Object(e)){return sliceIterator(e,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var toConsumableArray=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}else{return Array.from(e)}};var s=2147483647;var i=36;var o=1;var n=26;var l=38;var f=700;var c=72;var u=128;var h="-";var d=/^xn--/;var p=/[^\0-\x7E]/;var v=/[\x2E\u3002\uFF0E\uFF61]/g;var m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"};var y=i-o;var g=Math.floor;var P=String.fromCharCode;function error$1(e){throw new RangeError(m[e])}function map(e,r){var t=[];var a=e.length;while(a--){t[a]=r(e[a])}return t}function mapDomain(e,r){var t=e.split("@");var a="";if(t.length>1){a=t[0]+"@";e=t[1]}e=e.replace(v,".");var s=e.split(".");var i=map(s,r).join(".");return a+i}function ucs2decode(e){var r=[];var t=0;var a=e.length;while(t<a){var s=e.charCodeAt(t++);if(s>=55296&&s<=56319&&t<a){var i=e.charCodeAt(t++);if((i&64512)==56320){r.push(((s&1023)<<10)+(i&1023)+65536)}else{r.push(s);t--}}else{r.push(s)}}return r}var E=function ucs2encode(e){return String.fromCodePoint.apply(String,toConsumableArray(e))};var b=function basicToDigit(e){if(e-48<10){return e-22}if(e-65<26){return e-65}if(e-97<26){return e-97}return i};var w=function digitToBasic(e,r){return e+22+75*(e<26)-((r!=0)<<5)};var S=function adapt(e,r,t){var a=0;e=t?g(e/f):e>>1;e+=g(e/r);for(;e>y*n>>1;a+=i){e=g(e/y)}return g(a+(y+1)*e/(e+l))};var x=function decode(e){var r=[];var t=e.length;var a=0;var l=u;var f=c;var d=e.lastIndexOf(h);if(d<0){d=0}for(var p=0;p<d;++p){if(e.charCodeAt(p)>=128){error$1("not-basic")}r.push(e.charCodeAt(p))}for(var v=d>0?d+1:0;v<t;){var m=a;for(var y=1,P=i;;P+=i){if(v>=t){error$1("invalid-input")}var E=b(e.charCodeAt(v++));if(E>=i||E>g((s-a)/y)){error$1("overflow")}a+=E*y;var w=P<=f?o:P>=f+n?n:P-f;if(E<w){break}var x=i-w;if(y>g(s/x)){error$1("overflow")}y*=x}var _=r.length+1;f=S(a-m,_,m==0);if(g(a/_)>s-l){error$1("overflow")}l+=g(a/_);a%=_;r.splice(a++,0,l)}return String.fromCodePoint.apply(String,r)};var _=function encode(e){var r=[];e=ucs2decode(e);var t=e.length;var a=u;var l=0;var f=c;var d=true;var p=false;var v=undefined;try{for(var m=e[Symbol.iterator](),y;!(d=(y=m.next()).done);d=true){var E=y.value;if(E<128){r.push(P(E))}}}catch(e){p=true;v=e}finally{try{if(!d&&m.return){m.return()}}finally{if(p){throw v}}}var b=r.length;var x=b;if(b){r.push(h)}while(x<t){var _=s;var j=true;var R=false;var F=undefined;try{for(var D=e[Symbol.iterator](),$;!(j=($=D.next()).done);j=true){var A=$.value;if(A>=a&&A<_){_=A}}}catch(e){R=true;F=e}finally{try{if(!j&&D.return){D.return()}}finally{if(R){throw F}}}var I=x+1;if(_-a>g((s-l)/I)){error$1("overflow")}l+=(_-a)*I;a=_;var C=true;var O=false;var k=undefined;try{for(var T=e[Symbol.iterator](),z;!(C=(z=T.next()).done);C=true){var L=z.value;if(L<a&&++l>s){error$1("overflow")}if(L==a){var N=l;for(var U=i;;U+=i){var q=U<=f?o:U>=f+n?n:U-f;if(N<q){break}var V=N-q;var Q=i-q;r.push(P(w(q+V%Q,0)));N=g(V/Q)}r.push(P(w(N,0)));f=S(l,I,x==b);l=0;++x}}}catch(e){O=true;k=e}finally{try{if(!C&&T.return){T.return()}}finally{if(O){throw k}}}++l;++a}return r.join("")};var j=function toUnicode(e){return mapDomain(e,(function(e){return d.test(e)?x(e.slice(4).toLowerCase()):e}))};var R=function toASCII(e){return mapDomain(e,(function(e){return p.test(e)?"xn--"+_(e):e}))};var F={version:"2.1.0",ucs2:{decode:ucs2decode,encode:E},decode:x,encode:_,toASCII:R,toUnicode:j};var D={};function pctEncChar(e){var r=e.charCodeAt(0);var t=void 0;if(r<16)t="%0"+r.toString(16).toUpperCase();else if(r<128)t="%"+r.toString(16).toUpperCase();else if(r<2048)t="%"+(r>>6|192).toString(16).toUpperCase()+"%"+(r&63|128).toString(16).toUpperCase();else t="%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(r&63|128).toString(16).toUpperCase();return t}function pctDecChars(e){var r="";var t=0;var a=e.length;while(t<a){var s=parseInt(e.substr(t+1,2),16);if(s<128){r+=String.fromCharCode(s);t+=3}else if(s>=194&&s<224){if(a-t>=6){var i=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((s&31)<<6|i&63)}else{r+=e.substr(t,6)}t+=6}else if(s>=224){if(a-t>=9){var o=parseInt(e.substr(t+4,2),16);var n=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((s&15)<<12|(o&63)<<6|n&63)}else{r+=e.substr(t,9)}t+=9}else{r+=e.substr(t,3);t+=3}}return r}function _normalizeComponentEncoding(e,r){function decodeUnreserved(e){var t=pctDecChars(e);return!t.match(r.UNRESERVED)?e:t}if(e.scheme)e.scheme=String(e.scheme).replace(r.PCT_ENCODED,decodeUnreserved).toLowerCase().replace(r.NOT_SCHEME,"");if(e.userinfo!==undefined)e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,decodeUnreserved).replace(r.NOT_USERINFO,pctEncChar).replace(r.PCT_ENCODED,toUpperCase);if(e.host!==undefined)e.host=String(e.host).replace(r.PCT_ENCODED,decodeUnreserved).toLowerCase().replace(r.NOT_HOST,pctEncChar).replace(r.PCT_ENCODED,toUpperCase);if(e.path!==undefined)e.path=String(e.path).replace(r.PCT_ENCODED,decodeUnreserved).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,pctEncChar).replace(r.PCT_ENCODED,toUpperCase);if(e.query!==undefined)e.query=String(e.query).replace(r.PCT_ENCODED,decodeUnreserved).replace(r.NOT_QUERY,pctEncChar).replace(r.PCT_ENCODED,toUpperCase);if(e.fragment!==undefined)e.fragment=String(e.fragment).replace(r.PCT_ENCODED,decodeUnreserved).replace(r.NOT_FRAGMENT,pctEncChar).replace(r.PCT_ENCODED,toUpperCase);return e}function _stripLeadingZeros(e){return e.replace(/^0*(.*)/,"$1")||"0"}function _normalizeIPv4(e,r){var t=e.match(r.IPV4ADDRESS)||[];var s=a(t,2),i=s[1];if(i){return i.split(".").map(_stripLeadingZeros).join(".")}else{return e}}function _normalizeIPv6(e,r){var t=e.match(r.IPV6ADDRESS)||[];var s=a(t,3),i=s[1],o=s[2];if(i){var n=i.toLowerCase().split("::").reverse(),l=a(n,2),f=l[0],c=l[1];var u=c?c.split(":").map(_stripLeadingZeros):[];var h=f.split(":").map(_stripLeadingZeros);var d=r.IPV4ADDRESS.test(h[h.length-1]);var p=d?7:8;var v=h.length-p;var m=Array(p);for(var y=0;y<p;++y){m[y]=u[y]||h[v+y]||""}if(d){m[p-1]=_normalizeIPv4(m[p-1],r)}var g=m.reduce((function(e,r,t){if(!r||r==="0"){var a=e[e.length-1];if(a&&a.index+a.length===t){a.length++}else{e.push({index:t,length:1})}}return e}),[]);var P=g.sort((function(e,r){return r.length-e.length}))[0];var E=void 0;if(P&&P.length>1){var b=m.slice(0,P.index);var w=m.slice(P.index+P.length);E=b.join(":")+"::"+w.join(":")}else{E=m.join(":")}if(o){E+="%"+o}return E}else{return e}}var $=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;var A="".match(/(){0}/)[1]===undefined;function parse(e){var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var s={};var i=a.iri!==false?t:r;if(a.reference==="suffix")e=(a.scheme?a.scheme+":":"")+"//"+e;var o=e.match($);if(o){if(A){s.scheme=o[1];s.userinfo=o[3];s.host=o[4];s.port=parseInt(o[5],10);s.path=o[6]||"";s.query=o[7];s.fragment=o[8];if(isNaN(s.port)){s.port=o[5]}}else{s.scheme=o[1]||undefined;s.userinfo=e.indexOf("@")!==-1?o[3]:undefined;s.host=e.indexOf("//")!==-1?o[4]:undefined;s.port=parseInt(o[5],10);s.path=o[6]||"";s.query=e.indexOf("?")!==-1?o[7]:undefined;s.fragment=e.indexOf("#")!==-1?o[8]:undefined;if(isNaN(s.port)){s.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:undefined}}if(s.host){s.host=_normalizeIPv6(_normalizeIPv4(s.host,i),i)}if(s.scheme===undefined&&s.userinfo===undefined&&s.host===undefined&&s.port===undefined&&!s.path&&s.query===undefined){s.reference="same-document"}else if(s.scheme===undefined){s.reference="relative"}else if(s.fragment===undefined){s.reference="absolute"}else{s.reference="uri"}if(a.reference&&a.reference!=="suffix"&&a.reference!==s.reference){s.error=s.error||"URI is not a "+a.reference+" reference."}var n=D[(a.scheme||s.scheme||"").toLowerCase()];if(!a.unicodeSupport&&(!n||!n.unicodeSupport)){if(s.host&&(a.domainHost||n&&n.domainHost)){try{s.host=F.toASCII(s.host.replace(i.PCT_ENCODED,pctDecChars).toLowerCase())}catch(e){s.error=s.error||"Host's domain name can not be converted to ASCII via punycode: "+e}}_normalizeComponentEncoding(s,r)}else{_normalizeComponentEncoding(s,i)}if(n&&n.parse){n.parse(s,a)}}else{s.error=s.error||"URI can not be parsed."}return s}function _recomposeAuthority(e,a){var s=a.iri!==false?t:r;var i=[];if(e.userinfo!==undefined){i.push(e.userinfo);i.push("@")}if(e.host!==undefined){i.push(_normalizeIPv6(_normalizeIPv4(String(e.host),s),s).replace(s.IPV6ADDRESS,(function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"})))}if(typeof e.port==="number"){i.push(":");i.push(e.port.toString(10))}return i.length?i.join(""):undefined}var I=/^\.\.?\//;var C=/^\/\.(\/|$)/;var O=/^\/\.\.(\/|$)/;var k=/^\/?(?:.|\n)*?(?=\/|$)/;function removeDotSegments(e){var r=[];while(e.length){if(e.match(I)){e=e.replace(I,"")}else if(e.match(C)){e=e.replace(C,"/")}else if(e.match(O)){e=e.replace(O,"/");r.pop()}else if(e==="."||e===".."){e=""}else{var t=e.match(k);if(t){var a=t[0];e=e.slice(a.length);r.push(a)}else{throw new Error("Unexpected dot segment condition")}}}return r.join("")}function serialize(e){var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var s=a.iri?t:r;var i=[];var o=D[(a.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize)o.serialize(e,a);if(e.host){if(s.IPV6ADDRESS.test(e.host)){}else if(a.domainHost||o&&o.domainHost){try{e.host=!a.iri?F.toASCII(e.host.replace(s.PCT_ENCODED,pctDecChars).toLowerCase()):F.toUnicode(e.host)}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(!a.iri?"ASCII":"Unicode")+" via punycode: "+r}}}_normalizeComponentEncoding(e,s);if(a.reference!=="suffix"&&e.scheme){i.push(e.scheme);i.push(":")}var n=_recomposeAuthority(e,a);if(n!==undefined){if(a.reference!=="suffix"){i.push("//")}i.push(n);if(e.path&&e.path.charAt(0)!=="/"){i.push("/")}}if(e.path!==undefined){var l=e.path;if(!a.absolutePath&&(!o||!o.absolutePath)){l=removeDotSegments(l)}if(n===undefined){l=l.replace(/^\/\//,"/%2F")}i.push(l)}if(e.query!==undefined){i.push("?");i.push(e.query)}if(e.fragment!==undefined){i.push("#");i.push(e.fragment)}return i.join("")}function resolveComponents(e,r){var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var a=arguments[3];var s={};if(!a){e=parse(serialize(e,t),t);r=parse(serialize(r,t),t)}t=t||{};if(!t.tolerant&&r.scheme){s.scheme=r.scheme;s.userinfo=r.userinfo;s.host=r.host;s.port=r.port;s.path=removeDotSegments(r.path||"");s.query=r.query}else{if(r.userinfo!==undefined||r.host!==undefined||r.port!==undefined){s.userinfo=r.userinfo;s.host=r.host;s.port=r.port;s.path=removeDotSegments(r.path||"");s.query=r.query}else{if(!r.path){s.path=e.path;if(r.query!==undefined){s.query=r.query}else{s.query=e.query}}else{if(r.path.charAt(0)==="/"){s.path=removeDotSegments(r.path)}else{if((e.userinfo!==undefined||e.host!==undefined||e.port!==undefined)&&!e.path){s.path="/"+r.path}else if(!e.path){s.path=r.path}else{s.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path}s.path=removeDotSegments(s.path)}s.query=r.query}s.userinfo=e.userinfo;s.host=e.host;s.port=e.port}s.scheme=e.scheme}s.fragment=r.fragment;return s}function resolve(e,r,t){var a=assign({scheme:"null"},t);return serialize(resolveComponents(parse(e,a),parse(r,a),a,true),a)}function normalize(e,r){if(typeof e==="string"){e=serialize(parse(e,r),r)}else if(typeOf(e)==="object"){e=parse(serialize(e,r),r)}return e}function equal(e,r,t){if(typeof e==="string"){e=serialize(parse(e,t),t)}else if(typeOf(e)==="object"){e=serialize(e,t)}if(typeof r==="string"){r=serialize(parse(r,t),t)}else if(typeOf(r)==="object"){r=serialize(r,t)}return e===r}function escapeComponent(e,a){return e&&e.toString().replace(!a||!a.iri?r.ESCAPE:t.ESCAPE,pctEncChar)}function unescapeComponent(e,a){return e&&e.toString().replace(!a||!a.iri?r.PCT_ENCODED:t.PCT_ENCODED,pctDecChars)}var T={scheme:"http",domainHost:true,parse:function parse(e,r){if(!e.host){e.error=e.error||"HTTP URIs must have a host."}return e},serialize:function serialize(e,r){if(e.port===(String(e.scheme).toLowerCase()!=="https"?80:443)||e.port===""){e.port=undefined}if(!e.path){e.path="/"}return e}};var z={scheme:"https",domainHost:T.domainHost,parse:T.parse,serialize:T.serialize};var L={};var N=true;var U="[A-Za-z0-9\\-\\.\\_\\~"+(N?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]";var q="[0-9A-Fa-f]";var V=subexp(subexp("%[EFef]"+q+"%"+q+q+"%"+q+q)+"|"+subexp("%[89A-Fa-f]"+q+"%"+q+q)+"|"+subexp("%"+q+q));var Q="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]";var M="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]";var H=merge(M,'[\\"\\\\]');var K="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]";var B=new RegExp(U,"g");var J=new RegExp(V,"g");var G=new RegExp(merge("[^]",Q,"[\\.]",'[\\"]',H),"g");var Z=new RegExp(merge("[^]",U,K),"g");var X=Z;function decodeUnreserved(e){var r=pctDecChars(e);return!r.match(B)?e:r}var Y={scheme:"mailto",parse:function parse$$1(e,r){var t=e;var a=t.to=t.path?t.path.split(","):[];t.path=undefined;if(t.query){var s=false;var i={};var o=t.query.split("&");for(var n=0,l=o.length;n<l;++n){var f=o[n].split("=");switch(f[0]){case"to":var c=f[1].split(",");for(var u=0,h=c.length;u<h;++u){a.push(c[u])}break;case"subject":t.subject=unescapeComponent(f[1],r);break;case"body":t.body=unescapeComponent(f[1],r);break;default:s=true;i[unescapeComponent(f[0],r)]=unescapeComponent(f[1],r);break}}if(s)t.headers=i}t.query=undefined;for(var d=0,p=a.length;d<p;++d){var v=a[d].split("@");v[0]=unescapeComponent(v[0]);if(!r.unicodeSupport){try{v[1]=F.toASCII(unescapeComponent(v[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}}else{v[1]=unescapeComponent(v[1],r).toLowerCase()}a[d]=v.join("@")}return t},serialize:function serialize$$1(e,r){var t=e;var a=toArray(e.to);if(a){for(var s=0,i=a.length;s<i;++s){var o=String(a[s]);var n=o.lastIndexOf("@");var l=o.slice(0,n).replace(J,decodeUnreserved).replace(J,toUpperCase).replace(G,pctEncChar);var f=o.slice(n+1);try{f=!r.iri?F.toASCII(unescapeComponent(f,r).toLowerCase()):F.toUnicode(f)}catch(e){t.error=t.error||"Email address's domain name can not be converted to "+(!r.iri?"ASCII":"Unicode")+" via punycode: "+e}a[s]=l+"@"+f}t.path=a.join(",")}var c=e.headers=e.headers||{};if(e.subject)c["subject"]=e.subject;if(e.body)c["body"]=e.body;var u=[];for(var h in c){if(c[h]!==L[h]){u.push(h.replace(J,decodeUnreserved).replace(J,toUpperCase).replace(Z,pctEncChar)+"="+c[h].replace(J,decodeUnreserved).replace(J,toUpperCase).replace(X,pctEncChar))}}if(u.length){t.query=u.join("&")}return t}};var W=/^([^\:]+)\:(.*)/;var ee={scheme:"urn",parse:function parse$$1(e,r){var t=e.path&&e.path.match(W);var a=e;if(t){var s=r.scheme||a.scheme||"urn";var i=t[1].toLowerCase();var o=t[2];var n=s+":"+(r.nid||i);var l=D[n];a.nid=i;a.nss=o;a.path=undefined;if(l){a=l.parse(a,r)}}else{a.error=a.error||"URN can not be parsed."}return a},serialize:function serialize$$1(e,r){var t=r.scheme||e.scheme||"urn";var a=e.nid;var s=t+":"+(r.nid||a);var i=D[s];if(i){e=i.serialize(e,r)}var o=e;var n=e.nss;o.path=(a||r.nid)+":"+n;return o}};var re=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;var te={scheme:"urn:uuid",parse:function parse(e,r){var t=e;t.uuid=t.nss;t.nss=undefined;if(!r.tolerant&&(!t.uuid||!t.uuid.match(re))){t.error=t.error||"UUID is not valid."}return t},serialize:function serialize(e,r){var t=e;t.nss=(e.uuid||"").toLowerCase();return t}};D[T.scheme]=T;D[z.scheme]=z;D[Y.scheme]=Y;D[ee.scheme]=ee;D[te.scheme]=te;e.SCHEMES=D;e.pctEncChar=pctEncChar;e.pctDecChars=pctDecChars;e.parse=parse;e.removeDotSegments=removeDotSegments;e.serialize=serialize;e.resolveComponents=resolveComponents;e.resolve=resolve;e.normalize=normalize;e.equal=equal;e.escapeComponent=escapeComponent;e.unescapeComponent=unescapeComponent;Object.defineProperty(e,"__esModule",{value:true})}))},6363:(e,r,t)=>{"use strict";e.exports=writeFile;e.exports.sync=writeFileSync;e.exports._getTmpname=getTmpname;e.exports._cleanupOnExit=cleanupOnExit;const a=t(7147);const s=t(2141);const i=t(2483);const o=t(1017);const n=t(9232);const l=t(1449);const{promisify:f}=t(3837);const c={};const u=function getId(){try{const e=t(1267);return e.threadId}catch(e){return 0}}();let h=0;function getTmpname(e){return e+"."+s(__filename).hash(String(process.pid)).hash(String(u)).hash(String(++h)).result()}function cleanupOnExit(e){return()=>{try{a.unlinkSync(typeof e==="function"?e():e)}catch(e){}}}function serializeActiveFile(e){return new Promise((r=>{if(!c[e])c[e]=[];c[e].push(r);if(c[e].length===1)r()}))}function isChownErrOk(e){if(e.code==="ENOSYS"){return true}const r=!process.getuid||process.getuid()!==0;if(r){if(e.code==="EINVAL"||e.code==="EPERM"){return true}}return false}async function writeFileAsync(e,r,t={}){if(typeof t==="string"){t={encoding:t}}let s;let u;const h=i(cleanupOnExit((()=>u)));const d=o.resolve(e);try{await serializeActiveFile(d);const i=await f(a.realpath)(e).catch((()=>e));u=getTmpname(i);if(!t.mode||!t.chown){const e=await f(a.stat)(i).catch((()=>{}));if(e){if(t.mode==null){t.mode=e.mode}if(t.chown==null&&process.getuid){t.chown={uid:e.uid,gid:e.gid}}}}s=await f(a.open)(u,"w",t.mode);if(t.tmpfileCreated){await t.tmpfileCreated(u)}if(n(r)){r=l(r)}if(Buffer.isBuffer(r)){await f(a.write)(s,r,0,r.length,0)}else if(r!=null){await f(a.write)(s,String(r),0,String(t.encoding||"utf8"))}if(t.fsync!==false){await f(a.fsync)(s)}await f(a.close)(s);s=null;if(t.chown){await f(a.chown)(u,t.chown.uid,t.chown.gid).catch((e=>{if(!isChownErrOk(e)){throw e}}))}if(t.mode){await f(a.chmod)(u,t.mode).catch((e=>{if(!isChownErrOk(e)){throw e}}))}await f(a.rename)(u,i)}finally{if(s){await f(a.close)(s).catch((()=>{}))}h();await f(a.unlink)(u).catch((()=>{}));c[d].shift();if(c[d].length>0){c[d][0]()}else delete c[d]}}function writeFile(e,r,t,a){if(t instanceof Function){a=t;t={}}const s=writeFileAsync(e,r,t);if(a){s.then(a,a)}return s}function writeFileSync(e,r,t){if(typeof t==="string")t={encoding:t};else if(!t)t={};try{e=a.realpathSync(e)}catch(e){}const s=getTmpname(e);if(!t.mode||!t.chown){try{const r=a.statSync(e);t=Object.assign({},t);if(!t.mode){t.mode=r.mode}if(!t.chown&&process.getuid){t.chown={uid:r.uid,gid:r.gid}}}catch(e){}}let o;const f=cleanupOnExit(s);const c=i(f);let u=true;try{o=a.openSync(s,"w",t.mode||438);if(t.tmpfileCreated){t.tmpfileCreated(s)}if(n(r)){r=l(r)}if(Buffer.isBuffer(r)){a.writeSync(o,r,0,r.length,0)}else if(r!=null){a.writeSync(o,String(r),0,String(t.encoding||"utf8"))}if(t.fsync!==false){a.fsyncSync(o)}a.closeSync(o);o=null;if(t.chown){try{a.chownSync(s,t.chown.uid,t.chown.gid)}catch(e){if(!isChownErrOk(e)){throw e}}}if(t.mode){try{a.chmodSync(s,t.mode)}catch(e){if(!isChownErrOk(e)){throw e}}}a.renameSync(s,e);u=false}finally{if(o){try{a.closeSync(o)}catch(e){}}c();if(u){f()}}}},9491:e=>{"use strict";e.exports=require("assert")},6113:e=>{"use strict";e.exports=require("crypto")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},5055:e=>{"use strict";e.exports=require("next/dist/compiled/find-up")},7849:e=>{"use strict";e.exports=require("next/dist/compiled/semver")},2037:e=>{"use strict";e.exports=require("os")},1017:e=>{"use strict";e.exports=require("path")},3837:e=>{"use strict";e.exports=require("util")},1267:e=>{"use strict";e.exports=require("worker_threads")},7664:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON Schema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},7136:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')}};var r={};function __nccwpck_require__(t){var a=r[t];if(a!==undefined){return a.exports}var s=r[t]={id:t,loaded:false,exports:{}};var i=true;try{e[t].call(s.exports,s,s.exports,__nccwpck_require__);i=false}finally{if(i)delete r[t]}s.loaded=true;return s.exports}(()=>{__nccwpck_require__.nmd=e=>{e.paths=[];if(!e.children)e.children=[];return e}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var t=__nccwpck_require__(9041);module.exports=t})();
\ No newline at end of file
(function(e,t){true?t(r):0})(this,(function(e){"use strict";function merge(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++){r[t]=arguments[t]}if(r.length>1){r[0]=r[0].slice(0,-1);var a=r.length-1;for(var s=1;s<a;++s){r[s]=r[s].slice(1,-1)}r[a]=r[a].slice(1);return r.join("")}else{return r[0]}}function subexp(e){return"(?:"+e+")"}function typeOf(e){return e===undefined?"undefined":e===null?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function toUpperCase(e){return e.toUpperCase()}function toArray(e){return e!==undefined&&e!==null?e instanceof Array?e:typeof e.length!=="number"||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function assign(e,r){var t=e;if(r){for(var a in r){t[a]=r[a]}}return t}function buildExps(e){var r="[A-Za-z]",t="[\\x0D]",a="[0-9]",s="[\\x22]",i=merge(a,"[A-Fa-f]"),o="[\\x0A]",n="[\\x20]",l=subexp(subexp("%[EFef]"+i+"%"+i+i+"%"+i+i)+"|"+subexp("%[89A-Fa-f]"+i+"%"+i+i)+"|"+subexp("%"+i+i)),f="[\\:\\/\\?\\#\\[\\]\\@]",c="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",u=merge(f,c),h=e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",d=e?"[\\uE000-\\uF8FF]":"[]",p=merge(r,a,"[\\-\\.\\_\\~]",h),v=subexp(r+merge(r,a,"[\\+\\-\\.]")+"*"),m=subexp(subexp(l+"|"+merge(p,c,"[\\:]"))+"*"),y=subexp(subexp("25[0-5]")+"|"+subexp("2[0-4]"+a)+"|"+subexp("1"+a+a)+"|"+subexp("[1-9]"+a)+"|"+a),g=subexp(subexp("25[0-5]")+"|"+subexp("2[0-4]"+a)+"|"+subexp("1"+a+a)+"|"+subexp("0?[1-9]"+a)+"|0?0?"+a),P=subexp(g+"\\."+g+"\\."+g+"\\."+g),E=subexp(i+"{1,4}"),b=subexp(subexp(E+"\\:"+E)+"|"+P),w=subexp(subexp(E+"\\:")+"{6}"+b),S=subexp("\\:\\:"+subexp(E+"\\:")+"{5}"+b),x=subexp(subexp(E)+"?\\:\\:"+subexp(E+"\\:")+"{4}"+b),_=subexp(subexp(subexp(E+"\\:")+"{0,1}"+E)+"?\\:\\:"+subexp(E+"\\:")+"{3}"+b),j=subexp(subexp(subexp(E+"\\:")+"{0,2}"+E)+"?\\:\\:"+subexp(E+"\\:")+"{2}"+b),R=subexp(subexp(subexp(E+"\\:")+"{0,3}"+E)+"?\\:\\:"+E+"\\:"+b),F=subexp(subexp(subexp(E+"\\:")+"{0,4}"+E)+"?\\:\\:"+b),D=subexp(subexp(subexp(E+"\\:")+"{0,5}"+E)+"?\\:\\:"+E),$=subexp(subexp(subexp(E+"\\:")+"{0,6}"+E)+"?\\:\\:"),A=subexp([w,S,x,_,j,R,F,D,$].join("|")),I=subexp(subexp(p+"|"+l)+"+"),C=subexp(A+"\\%25"+I),O=subexp(A+subexp("\\%25|\\%(?!"+i+"{2})")+I),k=subexp("[vV]"+i+"+\\."+merge(p,c,"[\\:]")+"+"),T=subexp("\\["+subexp(O+"|"+A+"|"+k)+"\\]"),z=subexp(subexp(l+"|"+merge(p,c))+"*"),L=subexp(T+"|"+P+"(?!"+z+")"+"|"+z),N=subexp(a+"*"),U=subexp(subexp(m+"@")+"?"+L+subexp("\\:"+N)+"?"),q=subexp(l+"|"+merge(p,c,"[\\:\\@]")),V=subexp(q+"*"),Q=subexp(q+"+"),M=subexp(subexp(l+"|"+merge(p,c,"[\\@]"))+"+"),H=subexp(subexp("\\/"+V)+"*"),K=subexp("\\/"+subexp(Q+H)+"?"),B=subexp(M+H),J=subexp(Q+H),G="(?!"+q+")",Z=subexp(H+"|"+K+"|"+B+"|"+J+"|"+G),X=subexp(subexp(q+"|"+merge("[\\/\\?]",d))+"*"),Y=subexp(subexp(q+"|[\\/\\?]")+"*"),W=subexp(subexp("\\/\\/"+U+H)+"|"+K+"|"+J+"|"+G),ee=subexp(v+"\\:"+W+subexp("\\?"+X)+"?"+subexp("\\#"+Y)+"?"),re=subexp(subexp("\\/\\/"+U+H)+"|"+K+"|"+B+"|"+G),te=subexp(re+subexp("\\?"+X)+"?"+subexp("\\#"+Y)+"?"),ae=subexp(ee+"|"+te),se=subexp(v+"\\:"+W+subexp("\\?"+X)+"?"),ie="^("+v+")\\:"+subexp(subexp("\\/\\/("+subexp("("+m+")@")+"?("+L+")"+subexp("\\:("+N+")")+"?)")+"?("+H+"|"+K+"|"+J+"|"+G+")")+subexp("\\?("+X+")")+"?"+subexp("\\#("+Y+")")+"?$",oe="^(){0}"+subexp(subexp("\\/\\/("+subexp("("+m+")@")+"?("+L+")"+subexp("\\:("+N+")")+"?)")+"?("+H+"|"+K+"|"+B+"|"+G+")")+subexp("\\?("+X+")")+"?"+subexp("\\#("+Y+")")+"?$",ne="^("+v+")\\:"+subexp(subexp("\\/\\/("+subexp("("+m+")@")+"?("+L+")"+subexp("\\:("+N+")")+"?)")+"?("+H+"|"+K+"|"+J+"|"+G+")")+subexp("\\?("+X+")")+"?$",le="^"+subexp("\\#("+Y+")")+"?$",fe="^"+subexp("("+m+")@")+"?("+L+")"+subexp("\\:("+N+")")+"?$";return{NOT_SCHEME:new RegExp(merge("[^]",r,a,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(merge("[^\\%\\:]",p,c),"g"),NOT_HOST:new RegExp(merge("[^\\%\\[\\]\\:]",p,c),"g"),NOT_PATH:new RegExp(merge("[^\\%\\/\\:\\@]",p,c),"g"),NOT_PATH_NOSCHEME:new RegExp(merge("[^\\%\\/\\@]",p,c),"g"),NOT_QUERY:new RegExp(merge("[^\\%]",p,c,"[\\:\\@\\/\\?]",d),"g"),NOT_FRAGMENT:new RegExp(merge("[^\\%]",p,c,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(merge("[^]",p,c),"g"),UNRESERVED:new RegExp(p,"g"),OTHER_CHARS:new RegExp(merge("[^\\%]",p,u),"g"),PCT_ENCODED:new RegExp(l,"g"),IPV4ADDRESS:new RegExp("^("+P+")$"),IPV6ADDRESS:new RegExp("^\\[?("+A+")"+subexp(subexp("\\%25|\\%(?!"+i+"{2})")+"("+I+")")+"?\\]?$")}}var r=buildExps(false);var t=buildExps(true);var a=function(){function sliceIterator(e,r){var t=[];var a=true;var s=false;var i=undefined;try{for(var o=e[Symbol.iterator](),n;!(a=(n=o.next()).done);a=true){t.push(n.value);if(r&&t.length===r)break}}catch(e){s=true;i=e}finally{try{if(!a&&o["return"])o["return"]()}finally{if(s)throw i}}return t}return function(e,r){if(Array.isArray(e)){return e}else if(Symbol.iterator in Object(e)){return sliceIterator(e,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var toConsumableArray=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}else{return Array.from(e)}};var s=2147483647;var i=36;var o=1;var n=26;var l=38;var f=700;var c=72;var u=128;var h="-";var d=/^xn--/;var p=/[^\0-\x7E]/;var v=/[\x2E\u3002\uFF0E\uFF61]/g;var m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"};var y=i-o;var g=Math.floor;var P=String.fromCharCode;function error$1(e){throw new RangeError(m[e])}function map(e,r){var t=[];var a=e.length;while(a--){t[a]=r(e[a])}return t}function mapDomain(e,r){var t=e.split("@");var a="";if(t.length>1){a=t[0]+"@";e=t[1]}e=e.replace(v,".");var s=e.split(".");var i=map(s,r).join(".");return a+i}function ucs2decode(e){var r=[];var t=0;var a=e.length;while(t<a){var s=e.charCodeAt(t++);if(s>=55296&&s<=56319&&t<a){var i=e.charCodeAt(t++);if((i&64512)==56320){r.push(((s&1023)<<10)+(i&1023)+65536)}else{r.push(s);t--}}else{r.push(s)}}return r}var E=function ucs2encode(e){return String.fromCodePoint.apply(String,toConsumableArray(e))};var b=function basicToDigit(e){if(e-48<10){return e-22}if(e-65<26){return e-65}if(e-97<26){return e-97}return i};var w=function digitToBasic(e,r){return e+22+75*(e<26)-((r!=0)<<5)};var S=function adapt(e,r,t){var a=0;e=t?g(e/f):e>>1;e+=g(e/r);for(;e>y*n>>1;a+=i){e=g(e/y)}return g(a+(y+1)*e/(e+l))};var x=function decode(e){var r=[];var t=e.length;var a=0;var l=u;var f=c;var d=e.lastIndexOf(h);if(d<0){d=0}for(var p=0;p<d;++p){if(e.charCodeAt(p)>=128){error$1("not-basic")}r.push(e.charCodeAt(p))}for(var v=d>0?d+1:0;v<t;){var m=a;for(var y=1,P=i;;P+=i){if(v>=t){error$1("invalid-input")}var E=b(e.charCodeAt(v++));if(E>=i||E>g((s-a)/y)){error$1("overflow")}a+=E*y;var w=P<=f?o:P>=f+n?n:P-f;if(E<w){break}var x=i-w;if(y>g(s/x)){error$1("overflow")}y*=x}var _=r.length+1;f=S(a-m,_,m==0);if(g(a/_)>s-l){error$1("overflow")}l+=g(a/_);a%=_;r.splice(a++,0,l)}return String.fromCodePoint.apply(String,r)};var _=function encode(e){var r=[];e=ucs2decode(e);var t=e.length;var a=u;var l=0;var f=c;var d=true;var p=false;var v=undefined;try{for(var m=e[Symbol.iterator](),y;!(d=(y=m.next()).done);d=true){var E=y.value;if(E<128){r.push(P(E))}}}catch(e){p=true;v=e}finally{try{if(!d&&m.return){m.return()}}finally{if(p){throw v}}}var b=r.length;var x=b;if(b){r.push(h)}while(x<t){var _=s;var j=true;var R=false;var F=undefined;try{for(var D=e[Symbol.iterator](),$;!(j=($=D.next()).done);j=true){var A=$.value;if(A>=a&&A<_){_=A}}}catch(e){R=true;F=e}finally{try{if(!j&&D.return){D.return()}}finally{if(R){throw F}}}var I=x+1;if(_-a>g((s-l)/I)){error$1("overflow")}l+=(_-a)*I;a=_;var C=true;var O=false;var k=undefined;try{for(var T=e[Symbol.iterator](),z;!(C=(z=T.next()).done);C=true){var L=z.value;if(L<a&&++l>s){error$1("overflow")}if(L==a){var N=l;for(var U=i;;U+=i){var q=U<=f?o:U>=f+n?n:U-f;if(N<q){break}var V=N-q;var Q=i-q;r.push(P(w(q+V%Q,0)));N=g(V/Q)}r.push(P(w(N,0)));f=S(l,I,x==b);l=0;++x}}}catch(e){O=true;k=e}finally{try{if(!C&&T.return){T.return()}}finally{if(O){throw k}}}++l;++a}return r.join("")};var j=function toUnicode(e){return mapDomain(e,(function(e){return d.test(e)?x(e.slice(4).toLowerCase()):e}))};var R=function toASCII(e){return mapDomain(e,(function(e){return p.test(e)?"xn--"+_(e):e}))};var F={version:"2.1.0",ucs2:{decode:ucs2decode,encode:E},decode:x,encode:_,toASCII:R,toUnicode:j};var D={};function pctEncChar(e){var r=e.charCodeAt(0);var t=void 0;if(r<16)t="%0"+r.toString(16).toUpperCase();else if(r<128)t="%"+r.toString(16).toUpperCase();else if(r<2048)t="%"+(r>>6|192).toString(16).toUpperCase()+"%"+(r&63|128).toString(16).toUpperCase();else t="%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(r&63|128).toString(16).toUpperCase();return t}function pctDecChars(e){var r="";var t=0;var a=e.length;while(t<a){var s=parseInt(e.substr(t+1,2),16);if(s<128){r+=String.fromCharCode(s);t+=3}else if(s>=194&&s<224){if(a-t>=6){var i=parseInt(e.substr(t+4,2),16);r+=String.fromCharCode((s&31)<<6|i&63)}else{r+=e.substr(t,6)}t+=6}else if(s>=224){if(a-t>=9){var o=parseInt(e.substr(t+4,2),16);var n=parseInt(e.substr(t+7,2),16);r+=String.fromCharCode((s&15)<<12|(o&63)<<6|n&63)}else{r+=e.substr(t,9)}t+=9}else{r+=e.substr(t,3);t+=3}}return r}function _normalizeComponentEncoding(e,r){function decodeUnreserved(e){var t=pctDecChars(e);return!t.match(r.UNRESERVED)?e:t}if(e.scheme)e.scheme=String(e.scheme).replace(r.PCT_ENCODED,decodeUnreserved).toLowerCase().replace(r.NOT_SCHEME,"");if(e.userinfo!==undefined)e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,decodeUnreserved).replace(r.NOT_USERINFO,pctEncChar).replace(r.PCT_ENCODED,toUpperCase);if(e.host!==undefined)e.host=String(e.host).replace(r.PCT_ENCODED,decodeUnreserved).toLowerCase().replace(r.NOT_HOST,pctEncChar).replace(r.PCT_ENCODED,toUpperCase);if(e.path!==undefined)e.path=String(e.path).replace(r.PCT_ENCODED,decodeUnreserved).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,pctEncChar).replace(r.PCT_ENCODED,toUpperCase);if(e.query!==undefined)e.query=String(e.query).replace(r.PCT_ENCODED,decodeUnreserved).replace(r.NOT_QUERY,pctEncChar).replace(r.PCT_ENCODED,toUpperCase);if(e.fragment!==undefined)e.fragment=String(e.fragment).replace(r.PCT_ENCODED,decodeUnreserved).replace(r.NOT_FRAGMENT,pctEncChar).replace(r.PCT_ENCODED,toUpperCase);return e}function _stripLeadingZeros(e){return e.replace(/^0*(.*)/,"$1")||"0"}function _normalizeIPv4(e,r){var t=e.match(r.IPV4ADDRESS)||[];var s=a(t,2),i=s[1];if(i){return i.split(".").map(_stripLeadingZeros).join(".")}else{return e}}function _normalizeIPv6(e,r){var t=e.match(r.IPV6ADDRESS)||[];var s=a(t,3),i=s[1],o=s[2];if(i){var n=i.toLowerCase().split("::").reverse(),l=a(n,2),f=l[0],c=l[1];var u=c?c.split(":").map(_stripLeadingZeros):[];var h=f.split(":").map(_stripLeadingZeros);var d=r.IPV4ADDRESS.test(h[h.length-1]);var p=d?7:8;var v=h.length-p;var m=Array(p);for(var y=0;y<p;++y){m[y]=u[y]||h[v+y]||""}if(d){m[p-1]=_normalizeIPv4(m[p-1],r)}var g=m.reduce((function(e,r,t){if(!r||r==="0"){var a=e[e.length-1];if(a&&a.index+a.length===t){a.length++}else{e.push({index:t,length:1})}}return e}),[]);var P=g.sort((function(e,r){return r.length-e.length}))[0];var E=void 0;if(P&&P.length>1){var b=m.slice(0,P.index);var w=m.slice(P.index+P.length);E=b.join(":")+"::"+w.join(":")}else{E=m.join(":")}if(o){E+="%"+o}return E}else{return e}}var $=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;var A="".match(/(){0}/)[1]===undefined;function parse(e){var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var s={};var i=a.iri!==false?t:r;if(a.reference==="suffix")e=(a.scheme?a.scheme+":":"")+"//"+e;var o=e.match($);if(o){if(A){s.scheme=o[1];s.userinfo=o[3];s.host=o[4];s.port=parseInt(o[5],10);s.path=o[6]||"";s.query=o[7];s.fragment=o[8];if(isNaN(s.port)){s.port=o[5]}}else{s.scheme=o[1]||undefined;s.userinfo=e.indexOf("@")!==-1?o[3]:undefined;s.host=e.indexOf("//")!==-1?o[4]:undefined;s.port=parseInt(o[5],10);s.path=o[6]||"";s.query=e.indexOf("?")!==-1?o[7]:undefined;s.fragment=e.indexOf("#")!==-1?o[8]:undefined;if(isNaN(s.port)){s.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:undefined}}if(s.host){s.host=_normalizeIPv6(_normalizeIPv4(s.host,i),i)}if(s.scheme===undefined&&s.userinfo===undefined&&s.host===undefined&&s.port===undefined&&!s.path&&s.query===undefined){s.reference="same-document"}else if(s.scheme===undefined){s.reference="relative"}else if(s.fragment===undefined){s.reference="absolute"}else{s.reference="uri"}if(a.reference&&a.reference!=="suffix"&&a.reference!==s.reference){s.error=s.error||"URI is not a "+a.reference+" reference."}var n=D[(a.scheme||s.scheme||"").toLowerCase()];if(!a.unicodeSupport&&(!n||!n.unicodeSupport)){if(s.host&&(a.domainHost||n&&n.domainHost)){try{s.host=F.toASCII(s.host.replace(i.PCT_ENCODED,pctDecChars).toLowerCase())}catch(e){s.error=s.error||"Host's domain name can not be converted to ASCII via punycode: "+e}}_normalizeComponentEncoding(s,r)}else{_normalizeComponentEncoding(s,i)}if(n&&n.parse){n.parse(s,a)}}else{s.error=s.error||"URI can not be parsed."}return s}function _recomposeAuthority(e,a){var s=a.iri!==false?t:r;var i=[];if(e.userinfo!==undefined){i.push(e.userinfo);i.push("@")}if(e.host!==undefined){i.push(_normalizeIPv6(_normalizeIPv4(String(e.host),s),s).replace(s.IPV6ADDRESS,(function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"})))}if(typeof e.port==="number"){i.push(":");i.push(e.port.toString(10))}return i.length?i.join(""):undefined}var I=/^\.\.?\//;var C=/^\/\.(\/|$)/;var O=/^\/\.\.(\/|$)/;var k=/^\/?(?:.|\n)*?(?=\/|$)/;function removeDotSegments(e){var r=[];while(e.length){if(e.match(I)){e=e.replace(I,"")}else if(e.match(C)){e=e.replace(C,"/")}else if(e.match(O)){e=e.replace(O,"/");r.pop()}else if(e==="."||e===".."){e=""}else{var t=e.match(k);if(t){var a=t[0];e=e.slice(a.length);r.push(a)}else{throw new Error("Unexpected dot segment condition")}}}return r.join("")}function serialize(e){var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var s=a.iri?t:r;var i=[];var o=D[(a.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize)o.serialize(e,a);if(e.host){if(s.IPV6ADDRESS.test(e.host)){}else if(a.domainHost||o&&o.domainHost){try{e.host=!a.iri?F.toASCII(e.host.replace(s.PCT_ENCODED,pctDecChars).toLowerCase()):F.toUnicode(e.host)}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(!a.iri?"ASCII":"Unicode")+" via punycode: "+r}}}_normalizeComponentEncoding(e,s);if(a.reference!=="suffix"&&e.scheme){i.push(e.scheme);i.push(":")}var n=_recomposeAuthority(e,a);if(n!==undefined){if(a.reference!=="suffix"){i.push("//")}i.push(n);if(e.path&&e.path.charAt(0)!=="/"){i.push("/")}}if(e.path!==undefined){var l=e.path;if(!a.absolutePath&&(!o||!o.absolutePath)){l=removeDotSegments(l)}if(n===undefined){l=l.replace(/^\/\//,"/%2F")}i.push(l)}if(e.query!==undefined){i.push("?");i.push(e.query)}if(e.fragment!==undefined){i.push("#");i.push(e.fragment)}return i.join("")}function resolveComponents(e,r){var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var a=arguments[3];var s={};if(!a){e=parse(serialize(e,t),t);r=parse(serialize(r,t),t)}t=t||{};if(!t.tolerant&&r.scheme){s.scheme=r.scheme;s.userinfo=r.userinfo;s.host=r.host;s.port=r.port;s.path=removeDotSegments(r.path||"");s.query=r.query}else{if(r.userinfo!==undefined||r.host!==undefined||r.port!==undefined){s.userinfo=r.userinfo;s.host=r.host;s.port=r.port;s.path=removeDotSegments(r.path||"");s.query=r.query}else{if(!r.path){s.path=e.path;if(r.query!==undefined){s.query=r.query}else{s.query=e.query}}else{if(r.path.charAt(0)==="/"){s.path=removeDotSegments(r.path)}else{if((e.userinfo!==undefined||e.host!==undefined||e.port!==undefined)&&!e.path){s.path="/"+r.path}else if(!e.path){s.path=r.path}else{s.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path}s.path=removeDotSegments(s.path)}s.query=r.query}s.userinfo=e.userinfo;s.host=e.host;s.port=e.port}s.scheme=e.scheme}s.fragment=r.fragment;return s}function resolve(e,r,t){var a=assign({scheme:"null"},t);return serialize(resolveComponents(parse(e,a),parse(r,a),a,true),a)}function normalize(e,r){if(typeof e==="string"){e=serialize(parse(e,r),r)}else if(typeOf(e)==="object"){e=parse(serialize(e,r),r)}return e}function equal(e,r,t){if(typeof e==="string"){e=serialize(parse(e,t),t)}else if(typeOf(e)==="object"){e=serialize(e,t)}if(typeof r==="string"){r=serialize(parse(r,t),t)}else if(typeOf(r)==="object"){r=serialize(r,t)}return e===r}function escapeComponent(e,a){return e&&e.toString().replace(!a||!a.iri?r.ESCAPE:t.ESCAPE,pctEncChar)}function unescapeComponent(e,a){return e&&e.toString().replace(!a||!a.iri?r.PCT_ENCODED:t.PCT_ENCODED,pctDecChars)}var T={scheme:"http",domainHost:true,parse:function parse(e,r){if(!e.host){e.error=e.error||"HTTP URIs must have a host."}return e},serialize:function serialize(e,r){if(e.port===(String(e.scheme).toLowerCase()!=="https"?80:443)||e.port===""){e.port=undefined}if(!e.path){e.path="/"}return e}};var z={scheme:"https",domainHost:T.domainHost,parse:T.parse,serialize:T.serialize};var L={};var N=true;var U="[A-Za-z0-9\\-\\.\\_\\~"+(N?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]";var q="[0-9A-Fa-f]";var V=subexp(subexp("%[EFef]"+q+"%"+q+q+"%"+q+q)+"|"+subexp("%[89A-Fa-f]"+q+"%"+q+q)+"|"+subexp("%"+q+q));var Q="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]";var M="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]";var H=merge(M,'[\\"\\\\]');var K="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]";var B=new RegExp(U,"g");var J=new RegExp(V,"g");var G=new RegExp(merge("[^]",Q,"[\\.]",'[\\"]',H),"g");var Z=new RegExp(merge("[^]",U,K),"g");var X=Z;function decodeUnreserved(e){var r=pctDecChars(e);return!r.match(B)?e:r}var Y={scheme:"mailto",parse:function parse$$1(e,r){var t=e;var a=t.to=t.path?t.path.split(","):[];t.path=undefined;if(t.query){var s=false;var i={};var o=t.query.split("&");for(var n=0,l=o.length;n<l;++n){var f=o[n].split("=");switch(f[0]){case"to":var c=f[1].split(",");for(var u=0,h=c.length;u<h;++u){a.push(c[u])}break;case"subject":t.subject=unescapeComponent(f[1],r);break;case"body":t.body=unescapeComponent(f[1],r);break;default:s=true;i[unescapeComponent(f[0],r)]=unescapeComponent(f[1],r);break}}if(s)t.headers=i}t.query=undefined;for(var d=0,p=a.length;d<p;++d){var v=a[d].split("@");v[0]=unescapeComponent(v[0]);if(!r.unicodeSupport){try{v[1]=F.toASCII(unescapeComponent(v[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}}else{v[1]=unescapeComponent(v[1],r).toLowerCase()}a[d]=v.join("@")}return t},serialize:function serialize$$1(e,r){var t=e;var a=toArray(e.to);if(a){for(var s=0,i=a.length;s<i;++s){var o=String(a[s]);var n=o.lastIndexOf("@");var l=o.slice(0,n).replace(J,decodeUnreserved).replace(J,toUpperCase).replace(G,pctEncChar);var f=o.slice(n+1);try{f=!r.iri?F.toASCII(unescapeComponent(f,r).toLowerCase()):F.toUnicode(f)}catch(e){t.error=t.error||"Email address's domain name can not be converted to "+(!r.iri?"ASCII":"Unicode")+" via punycode: "+e}a[s]=l+"@"+f}t.path=a.join(",")}var c=e.headers=e.headers||{};if(e.subject)c["subject"]=e.subject;if(e.body)c["body"]=e.body;var u=[];for(var h in c){if(c[h]!==L[h]){u.push(h.replace(J,decodeUnreserved).replace(J,toUpperCase).replace(Z,pctEncChar)+"="+c[h].replace(J,decodeUnreserved).replace(J,toUpperCase).replace(X,pctEncChar))}}if(u.length){t.query=u.join("&")}return t}};var W=/^([^\:]+)\:(.*)/;var ee={scheme:"urn",parse:function parse$$1(e,r){var t=e.path&&e.path.match(W);var a=e;if(t){var s=r.scheme||a.scheme||"urn";var i=t[1].toLowerCase();var o=t[2];var n=s+":"+(r.nid||i);var l=D[n];a.nid=i;a.nss=o;a.path=undefined;if(l){a=l.parse(a,r)}}else{a.error=a.error||"URN can not be parsed."}return a},serialize:function serialize$$1(e,r){var t=r.scheme||e.scheme||"urn";var a=e.nid;var s=t+":"+(r.nid||a);var i=D[s];if(i){e=i.serialize(e,r)}var o=e;var n=e.nss;o.path=(a||r.nid)+":"+n;return o}};var re=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;var te={scheme:"urn:uuid",parse:function parse(e,r){var t=e;t.uuid=t.nss;t.nss=undefined;if(!r.tolerant&&(!t.uuid||!t.uuid.match(re))){t.error=t.error||"UUID is not valid."}return t},serialize:function serialize(e,r){var t=e;t.nss=(e.uuid||"").toLowerCase();return t}};D[T.scheme]=T;D[z.scheme]=z;D[Y.scheme]=Y;D[ee.scheme]=ee;D[te.scheme]=te;e.SCHEMES=D;e.pctEncChar=pctEncChar;e.pctDecChars=pctDecChars;e.parse=parse;e.removeDotSegments=removeDotSegments;e.serialize=serialize;e.resolveComponents=resolveComponents;e.resolve=resolve;e.normalize=normalize;e.equal=equal;e.escapeComponent=escapeComponent;e.unescapeComponent=unescapeComponent;Object.defineProperty(e,"__esModule",{value:true})}))},6363:(e,r,t)=>{"use strict";e.exports=writeFile;e.exports.sync=writeFileSync;e.exports._getTmpname=getTmpname;e.exports._cleanupOnExit=cleanupOnExit;const a=t(7147);const s=t(2141);const i=t(7234);const o=t(1017);const n=t(9232);const l=t(1449);const{promisify:f}=t(3837);const c={};const u=function getId(){try{const e=t(1267);return e.threadId}catch(e){return 0}}();let h=0;function getTmpname(e){return e+"."+s(__filename).hash(String(process.pid)).hash(String(u)).hash(String(++h)).result()}function cleanupOnExit(e){return()=>{try{a.unlinkSync(typeof e==="function"?e():e)}catch(e){}}}function serializeActiveFile(e){return new Promise((r=>{if(!c[e])c[e]=[];c[e].push(r);if(c[e].length===1)r()}))}function isChownErrOk(e){if(e.code==="ENOSYS"){return true}const r=!process.getuid||process.getuid()!==0;if(r){if(e.code==="EINVAL"||e.code==="EPERM"){return true}}return false}async function writeFileAsync(e,r,t={}){if(typeof t==="string"){t={encoding:t}}let s;let u;const h=i(cleanupOnExit((()=>u)));const d=o.resolve(e);try{await serializeActiveFile(d);const i=await f(a.realpath)(e).catch((()=>e));u=getTmpname(i);if(!t.mode||!t.chown){const e=await f(a.stat)(i).catch((()=>{}));if(e){if(t.mode==null){t.mode=e.mode}if(t.chown==null&&process.getuid){t.chown={uid:e.uid,gid:e.gid}}}}s=await f(a.open)(u,"w",t.mode);if(t.tmpfileCreated){await t.tmpfileCreated(u)}if(n(r)){r=l(r)}if(Buffer.isBuffer(r)){await f(a.write)(s,r,0,r.length,0)}else if(r!=null){await f(a.write)(s,String(r),0,String(t.encoding||"utf8"))}if(t.fsync!==false){await f(a.fsync)(s)}await f(a.close)(s);s=null;if(t.chown){await f(a.chown)(u,t.chown.uid,t.chown.gid).catch((e=>{if(!isChownErrOk(e)){throw e}}))}if(t.mode){await f(a.chmod)(u,t.mode).catch((e=>{if(!isChownErrOk(e)){throw e}}))}await f(a.rename)(u,i)}finally{if(s){await f(a.close)(s).catch((()=>{}))}h();await f(a.unlink)(u).catch((()=>{}));c[d].shift();if(c[d].length>0){c[d][0]()}else delete c[d]}}function writeFile(e,r,t,a){if(t instanceof Function){a=t;t={}}const s=writeFileAsync(e,r,t);if(a){s.then(a,a)}return s}function writeFileSync(e,r,t){if(typeof t==="string")t={encoding:t};else if(!t)t={};try{e=a.realpathSync(e)}catch(e){}const s=getTmpname(e);if(!t.mode||!t.chown){try{const r=a.statSync(e);t=Object.assign({},t);if(!t.mode){t.mode=r.mode}if(!t.chown&&process.getuid){t.chown={uid:r.uid,gid:r.gid}}}catch(e){}}let o;const f=cleanupOnExit(s);const c=i(f);let u=true;try{o=a.openSync(s,"w",t.mode||438);if(t.tmpfileCreated){t.tmpfileCreated(s)}if(n(r)){r=l(r)}if(Buffer.isBuffer(r)){a.writeSync(o,r,0,r.length,0)}else if(r!=null){a.writeSync(o,String(r),0,String(t.encoding||"utf8"))}if(t.fsync!==false){a.fsyncSync(o)}a.closeSync(o);o=null;if(t.chown){try{a.chownSync(s,t.chown.uid,t.chown.gid)}catch(e){if(!isChownErrOk(e)){throw e}}}if(t.mode){try{a.chmodSync(s,t.mode)}catch(e){if(!isChownErrOk(e)){throw e}}}a.renameSync(s,e);u=false}finally{if(o){try{a.closeSync(o)}catch(e){}}c();if(u){f()}}}},9491:e=>{"use strict";e.exports=require("assert")},6113:e=>{"use strict";e.exports=require("crypto")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},5055:e=>{"use strict";e.exports=require("next/dist/compiled/find-up")},7849:e=>{"use strict";e.exports=require("next/dist/compiled/semver")},2037:e=>{"use strict";e.exports=require("os")},1017:e=>{"use strict";e.exports=require("path")},3837:e=>{"use strict";e.exports=require("util")},1267:e=>{"use strict";e.exports=require("worker_threads")},7664:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON Schema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},7136:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')}};var r={};function __nccwpck_require__(t){var a=r[t];if(a!==undefined){return a.exports}var s=r[t]={id:t,loaded:false,exports:{}};var i=true;try{e[t].call(s.exports,s,s.exports,__nccwpck_require__);i=false}finally{if(i)delete r[t]}s.loaded=true;return s.exports}(()=>{__nccwpck_require__.nmd=e=>{e.paths=[];if(!e.children)e.children=[];return e}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var t=__nccwpck_require__(9041);module.exports=t})();
\ No newline at end of file
(()=>{var e={581:(e,t,r)=>{"use strict";const s=r(154);let i=false;t.show=(e=process.stderr)=>{if(!e.isTTY){return}i=false;e.write("[?25h")};t.hide=(e=process.stderr)=>{if(!e.isTTY){return}s();i=true;e.write("[?25l")};t.toggle=(e,r)=>{if(e!==undefined){i=e}if(i){t.show(r)}else{t.hide(r)}}},494:(e,t,r)=>{"use strict";const s=Object.assign({},r(32));const i=Object.keys(s);Object.defineProperty(s,"random",{get(){const e=Math.floor(Math.random()*i.length);const t=i[e];return s[t]}});e.exports=s},578:e=>{var t=function(){"use strict";function clone(e,t,r,s){var i;if(typeof t==="object"){r=t.depth;s=t.prototype;i=t.filter;t=t.circular}var n=[];var o=[];var a=typeof Buffer!="undefined";if(typeof t=="undefined")t=true;if(typeof r=="undefined")r=Infinity;function _clone(e,r){if(e===null)return null;if(r==0)return e;var i;var l;if(typeof e!="object"){return e}if(clone.__isArray(e)){i=[]}else if(clone.__isRegExp(e)){i=new RegExp(e.source,__getRegExpFlags(e));if(e.lastIndex)i.lastIndex=e.lastIndex}else if(clone.__isDate(e)){i=new Date(e.getTime())}else if(a&&Buffer.isBuffer(e)){if(Buffer.allocUnsafe){i=Buffer.allocUnsafe(e.length)}else{i=new Buffer(e.length)}e.copy(i);return i}else{if(typeof s=="undefined"){l=Object.getPrototypeOf(e);i=Object.create(l)}else{i=Object.create(s);l=s}}if(t){var _=n.indexOf(e);if(_!=-1){return o[_]}n.push(e);o.push(i)}for(var f in e){var u;if(l){u=Object.getOwnPropertyDescriptor(l,f)}if(u&&u.set==null){continue}i[f]=_clone(e[f],r-1)}return i}return _clone(e,r)}clone.clonePrototype=function clonePrototype(e){if(e===null)return null;var c=function(){};c.prototype=e;return new c};function __objToStr(e){return Object.prototype.toString.call(e)}clone.__objToStr=__objToStr;function __isDate(e){return typeof e==="object"&&__objToStr(e)==="[object Date]"}clone.__isDate=__isDate;function __isArray(e){return typeof e==="object"&&__objToStr(e)==="[object Array]"}clone.__isArray=__isArray;function __isRegExp(e){return typeof e==="object"&&__objToStr(e)==="[object RegExp]"}clone.__isRegExp=__isRegExp;function __getRegExpFlags(e){var t="";if(e.global)t+="g";if(e.ignoreCase)t+="i";if(e.multiline)t+="m";return t}clone.__getRegExpFlags=__getRegExpFlags;return clone}();if(true&&e.exports){e.exports=t}},987:(e,t,r)=>{var s=r(578);e.exports=function(e,t){e=e||{};Object.keys(t).forEach((function(r){if(typeof e[r]==="undefined"){e[r]=s(t[r])}}));return e}},934:e=>{"use strict";e.exports=({stream:e=process.stdout}={})=>Boolean(e&&e.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))},663:(e,t,r)=>{"use strict";const s=r(542);const i=process.platform!=="win32"||process.env.CI||process.env.TERM==="xterm-256color";const n={info:s.blue("ℹ"),success:s.green("✔"),warning:s.yellow("⚠"),error:s.red("✖")};const o={info:s.blue("i"),success:s.green("√"),warning:s.yellow("‼"),error:s.red("×")};e.exports=i?n:o},469:e=>{"use strict";const mimicFn=(e,t)=>{for(const r of Reflect.ownKeys(t)){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}return e};e.exports=mimicFn;e.exports["default"]=mimicFn},502:(e,t,r)=>{var s=r(781);e.exports=MuteStream;function MuteStream(e){s.apply(this);e=e||{};this.writable=this.readable=true;this.muted=false;this.on("pipe",this._onpipe);this.replace=e.replace;this._prompt=e.prompt||null;this._hadControl=false}MuteStream.prototype=Object.create(s.prototype);Object.defineProperty(MuteStream.prototype,"constructor",{value:MuteStream,enumerable:false});MuteStream.prototype.mute=function(){this.muted=true};MuteStream.prototype.unmute=function(){this.muted=false};Object.defineProperty(MuteStream.prototype,"_onpipe",{value:onPipe,enumerable:false,writable:true,configurable:true});function onPipe(e){this._src=e}Object.defineProperty(MuteStream.prototype,"isTTY",{get:getIsTTY,set:setIsTTY,enumerable:true,configurable:true});function getIsTTY(){return this._dest?this._dest.isTTY:this._src?this._src.isTTY:false}function setIsTTY(e){Object.defineProperty(this,"isTTY",{value:e,enumerable:true,writable:true,configurable:true})}Object.defineProperty(MuteStream.prototype,"rows",{get:function(){return this._dest?this._dest.rows:this._src?this._src.rows:undefined},enumerable:true,configurable:true});Object.defineProperty(MuteStream.prototype,"columns",{get:function(){return this._dest?this._dest.columns:this._src?this._src.columns:undefined},enumerable:true,configurable:true});MuteStream.prototype.pipe=function(e,t){this._dest=e;return s.prototype.pipe.call(this,e,t)};MuteStream.prototype.pause=function(){if(this._src)return this._src.pause()};MuteStream.prototype.resume=function(){if(this._src)return this._src.resume()};MuteStream.prototype.write=function(e){if(this.muted){if(!this.replace)return true;if(e.match(/^\u001b/)){if(e.indexOf(this._prompt)===0){e=e.substr(this._prompt.length);e=e.replace(/./g,this.replace);e=this._prompt+e}this._hadControl=true;return this.emit("data",e)}else{if(this._prompt&&this._hadControl&&e.indexOf(this._prompt)===0){this._hadControl=false;this.emit("data",this._prompt);e=e.substr(this._prompt.length)}e=e.toString().replace(/./g,this.replace)}}this.emit("data",e)};MuteStream.prototype.end=function(e){if(this.muted){if(e&&this.replace){e=e.toString().replace(/./g,this.replace)}else{e=null}}if(e)this.emit("data",e);this.emit("end")};function proxy(e){return function(){var t=this._dest;var r=this._src;if(t&&t[e])t[e].apply(t,arguments);if(r&&r[e])r[e].apply(r,arguments)}}MuteStream.prototype.destroy=proxy("destroy");MuteStream.prototype.destroySoon=proxy("destroySoon");MuteStream.prototype.close=proxy("close")},430:(e,t,r)=>{"use strict";const s=r(469);const i=new WeakMap;const onetime=(e,t={})=>{if(typeof e!=="function"){throw new TypeError("Expected a function")}let r;let n=0;const o=e.displayName||e.name||"<anonymous>";const onetime=function(...s){i.set(onetime,++n);if(n===1){r=e.apply(this,s);e=null}else if(t.throw===true){throw new Error(`Function \`${o}\` can only be called once`)}return r};s(onetime,e);i.set(onetime,n);return onetime};e.exports=onetime;e.exports["default"]=onetime;e.exports.callCount=e=>{if(!i.has(e)){throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`)}return i.get(e)}},327:(e,t,r)=>{"use strict";const s=r(521);const i=r(542);const n=r(581);const o=r(494);const a=r(663);const l=r(518);const _=r(457);const f=r(934);const u=r(502);const p=Symbol("text");const h=Symbol("prefixText");const m=3;class StdinDiscarder{constructor(){this.requests=0;this.mutedStream=new u;this.mutedStream.pipe(process.stdout);this.mutedStream.mute();const e=this;this.ourEmit=function(t,r,...s){const{stdin:i}=process;if(e.requests>0||i.emit===e.ourEmit){if(t==="keypress"){return}if(t==="data"&&r.includes(m)){process.emit("SIGINT")}Reflect.apply(e.oldEmit,this,[t,r,...s])}else{Reflect.apply(process.stdin.emit,this,[t,r,...s])}}}start(){this.requests++;if(this.requests===1){this.realStart()}}stop(){if(this.requests<=0){throw new Error("`stop` called more times than `start`")}this.requests--;if(this.requests===0){this.realStop()}}realStart(){if(process.platform==="win32"){return}this.rl=s.createInterface({input:process.stdin,output:this.mutedStream});this.rl.on("SIGINT",(()=>{if(process.listenerCount("SIGINT")===0){process.emit("SIGINT")}else{this.rl.close();process.kill(process.pid,"SIGINT")}}))}realStop(){if(process.platform==="win32"){return}this.rl.close();this.rl=undefined}}const d=new StdinDiscarder;class Ora{constructor(e){if(typeof e==="string"){e={text:e}}this.options={text:"",color:"cyan",stream:process.stderr,discardStdin:true,...e};this.spinner=this.options.spinner;this.color=this.options.color;this.hideCursor=this.options.hideCursor!==false;this.interval=this.options.interval||this.spinner.interval||100;this.stream=this.options.stream;this.id=undefined;this.isEnabled=typeof this.options.isEnabled==="boolean"?this.options.isEnabled:f({stream:this.stream});this.text=this.options.text;this.prefixText=this.options.prefixText;this.linesToClear=0;this.indent=this.options.indent;this.discardStdin=this.options.discardStdin;this.isDiscardingStdin=false}get indent(){return this._indent}set indent(e=0){if(!(e>=0&&Number.isInteger(e))){throw new Error("The `indent` option must be an integer from 0 and up")}this._indent=e}_updateInterval(e){if(e!==undefined){this.interval=e}}get spinner(){return this._spinner}set spinner(e){this.frameIndex=0;if(typeof e==="object"){if(e.frames===undefined){throw new Error("The given spinner must have a `frames` property")}this._spinner=e}else if(process.platform==="win32"){this._spinner=o.line}else if(e===undefined){this._spinner=o.dots}else if(o[e]){this._spinner=o[e]}else{throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/master/spinners.json for a full list.`)}this._updateInterval(this._spinner.interval)}get text(){return this[p]}get prefixText(){return this[h]}get isSpinning(){return this.id!==undefined}updateLineCount(){const e=this.stream.columns||80;const t=typeof this[h]==="string"?this[h]+"-":"";this.lineCount=l(t+"--"+this[p]).split("\n").reduce(((t,r)=>t+Math.max(1,Math.ceil(_(r)/e))),0)}set text(e){this[p]=e;this.updateLineCount()}set prefixText(e){this[h]=e;this.updateLineCount()}frame(){const{frames:e}=this.spinner;let t=e[this.frameIndex];if(this.color){t=i[this.color](t)}this.frameIndex=++this.frameIndex%e.length;const r=typeof this.prefixText==="string"&&this.prefixText!==""?this.prefixText+" ":"";const s=typeof this.text==="string"?" "+this.text:"";return r+t+s}clear(){if(!this.isEnabled||!this.stream.isTTY){return this}for(let e=0;e<this.linesToClear;e++){if(e>0){this.stream.moveCursor(0,-1)}this.stream.clearLine();this.stream.cursorTo(this.indent)}this.linesToClear=0;return this}render(){this.clear();this.stream.write(this.frame());this.linesToClear=this.lineCount;return this}start(e){if(e){this.text=e}if(!this.isEnabled){if(this.text){this.stream.write(`- ${this.text}\n`)}return this}if(this.isSpinning){return this}if(this.hideCursor){n.hide(this.stream)}if(this.discardStdin&&process.stdin.isTTY){this.isDiscardingStdin=true;d.start()}this.render();this.id=setInterval(this.render.bind(this),this.interval);return this}stop(){if(!this.isEnabled){return this}clearInterval(this.id);this.id=undefined;this.frameIndex=0;this.clear();if(this.hideCursor){n.show(this.stream)}if(this.discardStdin&&process.stdin.isTTY&&this.isDiscardingStdin){d.stop();this.isDiscardingStdin=false}return this}succeed(e){return this.stopAndPersist({symbol:a.success,text:e})}fail(e){return this.stopAndPersist({symbol:a.error,text:e})}warn(e){return this.stopAndPersist({symbol:a.warning,text:e})}info(e){return this.stopAndPersist({symbol:a.info,text:e})}stopAndPersist(e={}){const t=e.prefixText||this.prefixText;const r=typeof t==="string"&&t!==""?t+" ":"";const s=e.text||this.text;const i=typeof s==="string"?" "+s:"";this.stop();this.stream.write(`${r}${e.symbol||" "}${i}\n`);return this}}const oraFactory=function(e){return new Ora(e)};e.exports=oraFactory;e.exports.promise=(e,t)=>{if(typeof e.then!=="function"){throw new TypeError("Parameter `action` must be a Promise")}const r=new Ora(t);r.start();(async()=>{try{await e;r.succeed()}catch(e){r.fail()}})();return r}},154:(e,t,r)=>{"use strict";const s=r(430);const i=r(234);e.exports=s((()=>{i((()=>{process.stderr.write("[?25h")}),{alwaysLast:true})}))},234:(e,t,r)=>{var s=global.process;const processOk=function(e){return e&&typeof e==="object"&&typeof e.removeListener==="function"&&typeof e.emit==="function"&&typeof e.reallyExit==="function"&&typeof e.listeners==="function"&&typeof e.kill==="function"&&typeof e.pid==="number"&&typeof e.on==="function"};if(!processOk(s)){e.exports=function(){return function(){}}}else{var i=r(491);var n=r(986);var o=/^win/i.test(s.platform);var a=r(361);if(typeof a!=="function"){a=a.EventEmitter}var l;if(s.__signal_exit_emitter__){l=s.__signal_exit_emitter__}else{l=s.__signal_exit_emitter__=new a;l.count=0;l.emitted={}}if(!l.infinite){l.setMaxListeners(Infinity);l.infinite=true}e.exports=function(e,t){if(!processOk(global.process)){return function(){}}i.equal(typeof e,"function","a callback must be provided for exit handler");if(p===false){h()}var r="exit";if(t&&t.alwaysLast){r="afterexit"}var remove=function(){l.removeListener(r,e);if(l.listeners("exit").length===0&&l.listeners("afterexit").length===0){_()}};l.on(r,e);return remove};var _=function unload(){if(!p||!processOk(global.process)){return}p=false;n.forEach((function(e){try{s.removeListener(e,u[e])}catch(e){}}));s.emit=v;s.reallyExit=m;l.count-=1};e.exports.unload=_;var f=function emit(e,t,r){if(l.emitted[e]){return}l.emitted[e]=true;l.emit(e,t,r)};var u={};n.forEach((function(e){u[e]=function listener(){if(!processOk(global.process)){return}var t=s.listeners(e);if(t.length===l.count){_();f("exit",null,e);f("afterexit",null,e);if(o&&e==="SIGHUP"){e="SIGINT"}s.kill(s.pid,e)}}}));e.exports.signals=function(){return n};var p=false;var h=function load(){if(p||!processOk(global.process)){return}p=true;l.count+=1;n=n.filter((function(e){try{s.on(e,u[e]);return true}catch(e){return false}}));s.emit=x;s.reallyExit=d};e.exports.load=h;var m=s.reallyExit;var d=function processReallyExit(e){if(!processOk(global.process)){return}s.exitCode=e||0;f("exit",s.exitCode,null);f("afterexit",s.exitCode,null);m.call(s,s.exitCode)};var v=s.emit;var x=function processEmit(e,t){if(e==="exit"&&processOk(global.process)){if(t!==undefined){s.exitCode=t}var r=v.apply(this,arguments);f("exit",s.exitCode,null);f("afterexit",s.exitCode,null);return r}else{return v.apply(this,arguments)}}}},986:e=>{e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32"){e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(process.platform==="linux"){e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}},567:e=>{e.exports=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]]},457:(e,t,r)=>{"use strict";var s=r(987);var i=r(567);var n={nul:0,control:0};e.exports=function wcwidth(e){return wcswidth(e,n)};e.exports.config=function(e){e=s(e||{},n);return function wcwidth(t){return wcswidth(t,e)}};function wcswidth(e,t){if(typeof e!=="string")return wcwidth(e,t);var r=0;for(var s=0;s<e.length;s++){var i=wcwidth(e.charCodeAt(s),t);if(i<0)return-1;r+=i}return r}function wcwidth(e,t){if(e===0)return t.nul;if(e<32||e>=127&&e<160)return t.control;if(bisearch(e))return 0;return 1+(e>=4352&&(e<=4447||e==9001||e==9002||e>=11904&&e<=42191&&e!=12351||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65135||e>=65280&&e<=65376||e>=65504&&e<=65510||e>=131072&&e<=196605||e>=196608&&e<=262141))}function bisearch(e){var t=0;var r=i.length-1;var s;if(e<i[0][0]||e>i[r][1])return false;while(r>=t){s=Math.floor((t+r)/2);if(e>i[s][1])t=s+1;else if(e<i[s][0])r=s-1;else return true}return false}},491:e=>{"use strict";e.exports=require("assert")},361:e=>{"use strict";e.exports=require("events")},542:e=>{"use strict";e.exports=require("next/dist/compiled/chalk")},518:e=>{"use strict";e.exports=require("next/dist/compiled/strip-ansi")},521:e=>{"use strict";e.exports=require("readline")},781:e=>{"use strict";e.exports=require("stream")},32:e=>{"use strict";e.exports=JSON.parse('{"dots":{"interval":80,"frames":["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},"dots2":{"interval":80,"frames":["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},"dots3":{"interval":80,"frames":["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},"dots4":{"interval":80,"frames":["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},"dots5":{"interval":80,"frames":["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},"dots6":{"interval":80,"frames":["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},"dots7":{"interval":80,"frames":["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},"dots8":{"interval":80,"frames":["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},"dots9":{"interval":80,"frames":["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},"dots10":{"interval":80,"frames":["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},"dots11":{"interval":100,"frames":["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},"dots12":{"interval":80,"frames":["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},"dots8Bit":{"interval":80,"frames":["⠀","⠁","⠂","⠃","⠄","⠅","⠆","⠇","⡀","⡁","⡂","⡃","⡄","⡅","⡆","⡇","⠈","⠉","⠊","⠋","⠌","⠍","⠎","⠏","⡈","⡉","⡊","⡋","⡌","⡍","⡎","⡏","⠐","⠑","⠒","⠓","⠔","⠕","⠖","⠗","⡐","⡑","⡒","⡓","⡔","⡕","⡖","⡗","⠘","⠙","⠚","⠛","⠜","⠝","⠞","⠟","⡘","⡙","⡚","⡛","⡜","⡝","⡞","⡟","⠠","⠡","⠢","⠣","⠤","⠥","⠦","⠧","⡠","⡡","⡢","⡣","⡤","⡥","⡦","⡧","⠨","⠩","⠪","⠫","⠬","⠭","⠮","⠯","⡨","⡩","⡪","⡫","⡬","⡭","⡮","⡯","⠰","⠱","⠲","⠳","⠴","⠵","⠶","⠷","⡰","⡱","⡲","⡳","⡴","⡵","⡶","⡷","⠸","⠹","⠺","⠻","⠼","⠽","⠾","⠿","⡸","⡹","⡺","⡻","⡼","⡽","⡾","⡿","⢀","⢁","⢂","⢃","⢄","⢅","⢆","⢇","⣀","⣁","⣂","⣃","⣄","⣅","⣆","⣇","⢈","⢉","⢊","⢋","⢌","⢍","⢎","⢏","⣈","⣉","⣊","⣋","⣌","⣍","⣎","⣏","⢐","⢑","⢒","⢓","⢔","⢕","⢖","⢗","⣐","⣑","⣒","⣓","⣔","⣕","⣖","⣗","⢘","⢙","⢚","⢛","⢜","⢝","⢞","⢟","⣘","⣙","⣚","⣛","⣜","⣝","⣞","⣟","⢠","⢡","⢢","⢣","⢤","⢥","⢦","⢧","⣠","⣡","⣢","⣣","⣤","⣥","⣦","⣧","⢨","⢩","⢪","⢫","⢬","⢭","⢮","⢯","⣨","⣩","⣪","⣫","⣬","⣭","⣮","⣯","⢰","⢱","⢲","⢳","⢴","⢵","⢶","⢷","⣰","⣱","⣲","⣳","⣴","⣵","⣶","⣷","⢸","⢹","⢺","⢻","⢼","⢽","⢾","⢿","⣸","⣹","⣺","⣻","⣼","⣽","⣾","⣿"]},"line":{"interval":130,"frames":["-","\\\\","|","/"]},"line2":{"interval":100,"frames":["⠂","-","–","—","–","-"]},"pipe":{"interval":100,"frames":["┤","┘","┴","└","├","┌","┬","┐"]},"simpleDots":{"interval":400,"frames":[". ",".. ","..."," "]},"simpleDotsScrolling":{"interval":200,"frames":[". ",".. ","..."," .."," ."," "]},"star":{"interval":70,"frames":["✶","✸","✹","✺","✹","✷"]},"star2":{"interval":80,"frames":["+","x","*"]},"flip":{"interval":70,"frames":["_","_","_","-","`","`","\'","´","-","_","_","_"]},"hamburger":{"interval":100,"frames":["☱","☲","☴"]},"growVertical":{"interval":120,"frames":["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},"growHorizontal":{"interval":120,"frames":["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},"balloon":{"interval":140,"frames":[" ",".","o","O","@","*"," "]},"balloon2":{"interval":120,"frames":[".","o","O","°","O","o","."]},"noise":{"interval":100,"frames":["▓","▒","░"]},"bounce":{"interval":120,"frames":["⠁","⠂","⠄","⠂"]},"boxBounce":{"interval":120,"frames":["▖","▘","▝","▗"]},"boxBounce2":{"interval":100,"frames":["▌","▀","▐","▄"]},"triangle":{"interval":50,"frames":["◢","◣","◤","◥"]},"arc":{"interval":100,"frames":["◜","◠","◝","◞","◡","◟"]},"circle":{"interval":120,"frames":["◡","⊙","◠"]},"squareCorners":{"interval":180,"frames":["◰","◳","◲","◱"]},"circleQuarters":{"interval":120,"frames":["◴","◷","◶","◵"]},"circleHalves":{"interval":50,"frames":["◐","◓","◑","◒"]},"squish":{"interval":100,"frames":["╫","╪"]},"toggle":{"interval":250,"frames":["⊶","⊷"]},"toggle2":{"interval":80,"frames":["▫","▪"]},"toggle3":{"interval":120,"frames":["□","■"]},"toggle4":{"interval":100,"frames":["■","□","▪","▫"]},"toggle5":{"interval":100,"frames":["▮","▯"]},"toggle6":{"interval":300,"frames":["ဝ","၀"]},"toggle7":{"interval":80,"frames":["⦾","⦿"]},"toggle8":{"interval":100,"frames":["◍","◌"]},"toggle9":{"interval":100,"frames":["◉","◎"]},"toggle10":{"interval":100,"frames":["㊂","㊀","㊁"]},"toggle11":{"interval":50,"frames":["⧇","⧆"]},"toggle12":{"interval":120,"frames":["☗","☖"]},"toggle13":{"interval":80,"frames":["=","*","-"]},"arrow":{"interval":100,"frames":["←","↖","↑","↗","→","↘","↓","↙"]},"arrow2":{"interval":80,"frames":["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},"arrow3":{"interval":120,"frames":["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},"bouncingBar":{"interval":80,"frames":["[ ]","[= ]","[== ]","[=== ]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},"bouncingBall":{"interval":80,"frames":["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},"smiley":{"interval":200,"frames":["😄 ","😝 "]},"monkey":{"interval":300,"frames":["🙈 ","🙈 ","🙉 ","🙊 "]},"hearts":{"interval":100,"frames":["💛 ","💙 ","💜 ","💚 ","❤️ "]},"clock":{"interval":100,"frames":["🕛 ","🕐 ","🕑 ","🕒 ","🕓 ","🕔 ","🕕 ","🕖 ","🕗 ","🕘 ","🕙 ","🕚 "]},"earth":{"interval":180,"frames":["🌍 ","🌎 ","🌏 "]},"material":{"interval":17,"frames":["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███████▁▁▁▁▁▁▁▁▁▁▁▁▁","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","██████████▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","█████████████▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁██████████████▁▁▁▁","▁▁▁██████████████▁▁▁","▁▁▁▁█████████████▁▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁▁▁████████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","██████▁▁▁▁▁▁▁▁▁▁▁▁▁█","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁▁█████████████▁▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁▁███████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁▁█████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"]},"moon":{"interval":80,"frames":["🌑 ","🌒 ","🌓 ","🌔 ","🌕 ","🌖 ","🌗 ","🌘 "]},"runner":{"interval":140,"frames":["🚶 ","🏃 "]},"pong":{"interval":80,"frames":["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},"shark":{"interval":120,"frames":["▐|\\\\____________▌","▐_|\\\\___________▌","▐__|\\\\__________▌","▐___|\\\\_________▌","▐____|\\\\________▌","▐_____|\\\\_______▌","▐______|\\\\______▌","▐_______|\\\\_____▌","▐________|\\\\____▌","▐_________|\\\\___▌","▐__________|\\\\__▌","▐___________|\\\\_▌","▐____________|\\\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},"dqpb":{"interval":100,"frames":["d","q","p","b"]},"weather":{"interval":100,"frames":["☀️ ","☀️ ","☀️ ","🌤 ","⛅️ ","🌥 ","☁️ ","🌧 ","🌨 ","🌧 ","🌨 ","🌧 ","🌨 ","⛈ ","🌨 ","🌧 ","🌨 ","☁️ ","🌥 ","⛅️ ","🌤 ","☀️ ","☀️ "]},"christmas":{"interval":400,"frames":["🌲","🎄"]},"grenade":{"interval":80,"frames":["، ","′ "," ´ "," ‾ "," ⸌"," ⸊"," |"," ⁎"," ⁕"," ෴ "," ⁓"," "," "," "]},"point":{"interval":125,"frames":["∙∙∙","●∙∙","∙●∙","∙∙●","∙∙∙"]},"layer":{"interval":150,"frames":["-","=","≡"]},"betaWave":{"interval":80,"frames":["ρββββββ","βρβββββ","ββρββββ","βββρβββ","ββββρββ","βββββρβ","ββββββρ"]},"fingerDance":{"interval":160,"frames":["🤘 ","🤟 ","🖖 ","✋ ","🤚 ","👆 "]},"fistBump":{"interval":80,"frames":["🤜    🤛 ","🤜    🤛 ","🤜    🤛 "," 🤜  🤛  ","  🤜🤛   "," 🤜✨🤛   ","🤜 ✨ 🤛  "]},"soccerHeader":{"interval":80,"frames":[" 🧑⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 "]},"mindblown":{"interval":160,"frames":["😐 ","😐 ","😮 ","😮 ","😦 ","😦 ","😧 ","😧 ","🤯 ","💥 ","✨ ","  ","  ","  "]},"speaker":{"interval":160,"frames":["🔈 ","🔉 ","🔊 ","🔉 "]},"orangePulse":{"interval":100,"frames":["🔸 ","🔶 ","🟠 ","🟠 ","🔶 "]},"bluePulse":{"interval":100,"frames":["🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},"orangeBluePulse":{"interval":100,"frames":["🔸 ","🔶 ","🟠 ","🟠 ","🔶 ","🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},"timeTravel":{"interval":100,"frames":["🕛 ","🕚 ","🕙 ","🕘 ","🕗 ","🕖 ","🕕 ","🕔 ","🕓 ","🕒 ","🕑 ","🕐 "]},"aesthetic":{"interval":80,"frames":["▰▱▱▱▱▱▱","▰▰▱▱▱▱▱","▰▰▰▱▱▱▱","▰▰▰▰▱▱▱","▰▰▰▰▰▱▱","▰▰▰▰▰▰▱","▰▰▰▰▰▰▰","▰▱▱▱▱▱▱"]}}')}};var t={};function __nccwpck_require__(r){var s=t[r];if(s!==undefined){return s.exports}var i=t[r]={exports:{}};var n=true;try{e[r](i,i.exports,__nccwpck_require__);n=false}finally{if(n)delete t[r]}return i.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(327);module.exports=r})();
\ No newline at end of file
(()=>{var e={581:(e,t,r)=>{"use strict";const s=r(154);let i=false;t.show=(e=process.stderr)=>{if(!e.isTTY){return}i=false;e.write("[?25h")};t.hide=(e=process.stderr)=>{if(!e.isTTY){return}s();i=true;e.write("[?25l")};t.toggle=(e,r)=>{if(e!==undefined){i=e}if(i){t.show(r)}else{t.hide(r)}}},494:(e,t,r)=>{"use strict";const s=Object.assign({},r(32));const i=Object.keys(s);Object.defineProperty(s,"random",{get(){const e=Math.floor(Math.random()*i.length);const t=i[e];return s[t]}});e.exports=s},578:e=>{var t=function(){"use strict";function clone(e,t,r,s){var i;if(typeof t==="object"){r=t.depth;s=t.prototype;i=t.filter;t=t.circular}var n=[];var o=[];var a=typeof Buffer!="undefined";if(typeof t=="undefined")t=true;if(typeof r=="undefined")r=Infinity;function _clone(e,r){if(e===null)return null;if(r==0)return e;var i;var _;if(typeof e!="object"){return e}if(clone.__isArray(e)){i=[]}else if(clone.__isRegExp(e)){i=new RegExp(e.source,__getRegExpFlags(e));if(e.lastIndex)i.lastIndex=e.lastIndex}else if(clone.__isDate(e)){i=new Date(e.getTime())}else if(a&&Buffer.isBuffer(e)){if(Buffer.allocUnsafe){i=Buffer.allocUnsafe(e.length)}else{i=new Buffer(e.length)}e.copy(i);return i}else{if(typeof s=="undefined"){_=Object.getPrototypeOf(e);i=Object.create(_)}else{i=Object.create(s);_=s}}if(t){var l=n.indexOf(e);if(l!=-1){return o[l]}n.push(e);o.push(i)}for(var f in e){var u;if(_){u=Object.getOwnPropertyDescriptor(_,f)}if(u&&u.set==null){continue}i[f]=_clone(e[f],r-1)}return i}return _clone(e,r)}clone.clonePrototype=function clonePrototype(e){if(e===null)return null;var c=function(){};c.prototype=e;return new c};function __objToStr(e){return Object.prototype.toString.call(e)}clone.__objToStr=__objToStr;function __isDate(e){return typeof e==="object"&&__objToStr(e)==="[object Date]"}clone.__isDate=__isDate;function __isArray(e){return typeof e==="object"&&__objToStr(e)==="[object Array]"}clone.__isArray=__isArray;function __isRegExp(e){return typeof e==="object"&&__objToStr(e)==="[object RegExp]"}clone.__isRegExp=__isRegExp;function __getRegExpFlags(e){var t="";if(e.global)t+="g";if(e.ignoreCase)t+="i";if(e.multiline)t+="m";return t}clone.__getRegExpFlags=__getRegExpFlags;return clone}();if(true&&e.exports){e.exports=t}},987:(e,t,r)=>{var s=r(578);e.exports=function(e,t){e=e||{};Object.keys(t).forEach((function(r){if(typeof e[r]==="undefined"){e[r]=s(t[r])}}));return e}},934:e=>{"use strict";e.exports=({stream:e=process.stdout}={})=>Boolean(e&&e.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))},663:(e,t,r)=>{"use strict";const s=r(542);const i=process.platform!=="win32"||process.env.CI||process.env.TERM==="xterm-256color";const n={info:s.blue("ℹ"),success:s.green("✔"),warning:s.yellow("⚠"),error:s.red("✖")};const o={info:s.blue("i"),success:s.green("√"),warning:s.yellow("‼"),error:s.red("×")};e.exports=i?n:o},469:e=>{"use strict";const mimicFn=(e,t)=>{for(const r of Reflect.ownKeys(t)){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}return e};e.exports=mimicFn;e.exports["default"]=mimicFn},502:(e,t,r)=>{var s=r(781);e.exports=MuteStream;function MuteStream(e){s.apply(this);e=e||{};this.writable=this.readable=true;this.muted=false;this.on("pipe",this._onpipe);this.replace=e.replace;this._prompt=e.prompt||null;this._hadControl=false}MuteStream.prototype=Object.create(s.prototype);Object.defineProperty(MuteStream.prototype,"constructor",{value:MuteStream,enumerable:false});MuteStream.prototype.mute=function(){this.muted=true};MuteStream.prototype.unmute=function(){this.muted=false};Object.defineProperty(MuteStream.prototype,"_onpipe",{value:onPipe,enumerable:false,writable:true,configurable:true});function onPipe(e){this._src=e}Object.defineProperty(MuteStream.prototype,"isTTY",{get:getIsTTY,set:setIsTTY,enumerable:true,configurable:true});function getIsTTY(){return this._dest?this._dest.isTTY:this._src?this._src.isTTY:false}function setIsTTY(e){Object.defineProperty(this,"isTTY",{value:e,enumerable:true,writable:true,configurable:true})}Object.defineProperty(MuteStream.prototype,"rows",{get:function(){return this._dest?this._dest.rows:this._src?this._src.rows:undefined},enumerable:true,configurable:true});Object.defineProperty(MuteStream.prototype,"columns",{get:function(){return this._dest?this._dest.columns:this._src?this._src.columns:undefined},enumerable:true,configurable:true});MuteStream.prototype.pipe=function(e,t){this._dest=e;return s.prototype.pipe.call(this,e,t)};MuteStream.prototype.pause=function(){if(this._src)return this._src.pause()};MuteStream.prototype.resume=function(){if(this._src)return this._src.resume()};MuteStream.prototype.write=function(e){if(this.muted){if(!this.replace)return true;if(e.match(/^\u001b/)){if(e.indexOf(this._prompt)===0){e=e.substr(this._prompt.length);e=e.replace(/./g,this.replace);e=this._prompt+e}this._hadControl=true;return this.emit("data",e)}else{if(this._prompt&&this._hadControl&&e.indexOf(this._prompt)===0){this._hadControl=false;this.emit("data",this._prompt);e=e.substr(this._prompt.length)}e=e.toString().replace(/./g,this.replace)}}this.emit("data",e)};MuteStream.prototype.end=function(e){if(this.muted){if(e&&this.replace){e=e.toString().replace(/./g,this.replace)}else{e=null}}if(e)this.emit("data",e);this.emit("end")};function proxy(e){return function(){var t=this._dest;var r=this._src;if(t&&t[e])t[e].apply(t,arguments);if(r&&r[e])r[e].apply(r,arguments)}}MuteStream.prototype.destroy=proxy("destroy");MuteStream.prototype.destroySoon=proxy("destroySoon");MuteStream.prototype.close=proxy("close")},430:(e,t,r)=>{"use strict";const s=r(469);const i=new WeakMap;const onetime=(e,t={})=>{if(typeof e!=="function"){throw new TypeError("Expected a function")}let r;let n=0;const o=e.displayName||e.name||"<anonymous>";const onetime=function(...s){i.set(onetime,++n);if(n===1){r=e.apply(this,s);e=null}else if(t.throw===true){throw new Error(`Function \`${o}\` can only be called once`)}return r};s(onetime,e);i.set(onetime,n);return onetime};e.exports=onetime;e.exports["default"]=onetime;e.exports.callCount=e=>{if(!i.has(e)){throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`)}return i.get(e)}},327:(e,t,r)=>{"use strict";const s=r(521);const i=r(542);const n=r(581);const o=r(494);const a=r(663);const _=r(518);const l=r(457);const f=r(934);const u=r(502);const p=Symbol("text");const h=Symbol("prefixText");const m=3;class StdinDiscarder{constructor(){this.requests=0;this.mutedStream=new u;this.mutedStream.pipe(process.stdout);this.mutedStream.mute();const e=this;this.ourEmit=function(t,r,...s){const{stdin:i}=process;if(e.requests>0||i.emit===e.ourEmit){if(t==="keypress"){return}if(t==="data"&&r.includes(m)){process.emit("SIGINT")}Reflect.apply(e.oldEmit,this,[t,r,...s])}else{Reflect.apply(process.stdin.emit,this,[t,r,...s])}}}start(){this.requests++;if(this.requests===1){this.realStart()}}stop(){if(this.requests<=0){throw new Error("`stop` called more times than `start`")}this.requests--;if(this.requests===0){this.realStop()}}realStart(){if(process.platform==="win32"){return}this.rl=s.createInterface({input:process.stdin,output:this.mutedStream});this.rl.on("SIGINT",(()=>{if(process.listenerCount("SIGINT")===0){process.emit("SIGINT")}else{this.rl.close();process.kill(process.pid,"SIGINT")}}))}realStop(){if(process.platform==="win32"){return}this.rl.close();this.rl=undefined}}const d=new StdinDiscarder;class Ora{constructor(e){if(typeof e==="string"){e={text:e}}this.options={text:"",color:"cyan",stream:process.stderr,discardStdin:true,...e};this.spinner=this.options.spinner;this.color=this.options.color;this.hideCursor=this.options.hideCursor!==false;this.interval=this.options.interval||this.spinner.interval||100;this.stream=this.options.stream;this.id=undefined;this.isEnabled=typeof this.options.isEnabled==="boolean"?this.options.isEnabled:f({stream:this.stream});this.text=this.options.text;this.prefixText=this.options.prefixText;this.linesToClear=0;this.indent=this.options.indent;this.discardStdin=this.options.discardStdin;this.isDiscardingStdin=false}get indent(){return this._indent}set indent(e=0){if(!(e>=0&&Number.isInteger(e))){throw new Error("The `indent` option must be an integer from 0 and up")}this._indent=e}_updateInterval(e){if(e!==undefined){this.interval=e}}get spinner(){return this._spinner}set spinner(e){this.frameIndex=0;if(typeof e==="object"){if(e.frames===undefined){throw new Error("The given spinner must have a `frames` property")}this._spinner=e}else if(process.platform==="win32"){this._spinner=o.line}else if(e===undefined){this._spinner=o.dots}else if(o[e]){this._spinner=o[e]}else{throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/master/spinners.json for a full list.`)}this._updateInterval(this._spinner.interval)}get text(){return this[p]}get prefixText(){return this[h]}get isSpinning(){return this.id!==undefined}updateLineCount(){const e=this.stream.columns||80;const t=typeof this[h]==="string"?this[h]+"-":"";this.lineCount=_(t+"--"+this[p]).split("\n").reduce(((t,r)=>t+Math.max(1,Math.ceil(l(r)/e))),0)}set text(e){this[p]=e;this.updateLineCount()}set prefixText(e){this[h]=e;this.updateLineCount()}frame(){const{frames:e}=this.spinner;let t=e[this.frameIndex];if(this.color){t=i[this.color](t)}this.frameIndex=++this.frameIndex%e.length;const r=typeof this.prefixText==="string"&&this.prefixText!==""?this.prefixText+" ":"";const s=typeof this.text==="string"?" "+this.text:"";return r+t+s}clear(){if(!this.isEnabled||!this.stream.isTTY){return this}for(let e=0;e<this.linesToClear;e++){if(e>0){this.stream.moveCursor(0,-1)}this.stream.clearLine();this.stream.cursorTo(this.indent)}this.linesToClear=0;return this}render(){this.clear();this.stream.write(this.frame());this.linesToClear=this.lineCount;return this}start(e){if(e){this.text=e}if(!this.isEnabled){if(this.text){this.stream.write(`- ${this.text}\n`)}return this}if(this.isSpinning){return this}if(this.hideCursor){n.hide(this.stream)}if(this.discardStdin&&process.stdin.isTTY){this.isDiscardingStdin=true;d.start()}this.render();this.id=setInterval(this.render.bind(this),this.interval);return this}stop(){if(!this.isEnabled){return this}clearInterval(this.id);this.id=undefined;this.frameIndex=0;this.clear();if(this.hideCursor){n.show(this.stream)}if(this.discardStdin&&process.stdin.isTTY&&this.isDiscardingStdin){d.stop();this.isDiscardingStdin=false}return this}succeed(e){return this.stopAndPersist({symbol:a.success,text:e})}fail(e){return this.stopAndPersist({symbol:a.error,text:e})}warn(e){return this.stopAndPersist({symbol:a.warning,text:e})}info(e){return this.stopAndPersist({symbol:a.info,text:e})}stopAndPersist(e={}){const t=e.prefixText||this.prefixText;const r=typeof t==="string"&&t!==""?t+" ":"";const s=e.text||this.text;const i=typeof s==="string"?" "+s:"";this.stop();this.stream.write(`${r}${e.symbol||" "}${i}\n`);return this}}const oraFactory=function(e){return new Ora(e)};e.exports=oraFactory;e.exports.promise=(e,t)=>{if(typeof e.then!=="function"){throw new TypeError("Parameter `action` must be a Promise")}const r=new Ora(t);r.start();(async()=>{try{await e;r.succeed()}catch(e){r.fail()}})();return r}},154:(e,t,r)=>{"use strict";const s=r(430);const i=r(483);e.exports=s((()=>{i((()=>{process.stderr.write("[?25h")}),{alwaysLast:true})}))},483:(e,t,r)=>{var s=r(491);var i=r(589);var n=/^win/i.test(process.platform);var o=r(361);if(typeof o!=="function"){o=o.EventEmitter}var a;if(process.__signal_exit_emitter__){a=process.__signal_exit_emitter__}else{a=process.__signal_exit_emitter__=new o;a.count=0;a.emitted={}}if(!a.infinite){a.setMaxListeners(Infinity);a.infinite=true}e.exports=function(e,t){s.equal(typeof e,"function","a callback must be provided for exit handler");if(l===false){load()}var r="exit";if(t&&t.alwaysLast){r="afterexit"}var remove=function(){a.removeListener(r,e);if(a.listeners("exit").length===0&&a.listeners("afterexit").length===0){unload()}};a.on(r,e);return remove};e.exports.unload=unload;function unload(){if(!l){return}l=false;i.forEach((function(e){try{process.removeListener(e,_[e])}catch(e){}}));process.emit=u;process.reallyExit=f;a.count-=1}function emit(e,t,r){if(a.emitted[e]){return}a.emitted[e]=true;a.emit(e,t,r)}var _={};i.forEach((function(e){_[e]=function listener(){var t=process.listeners(e);if(t.length===a.count){unload();emit("exit",null,e);emit("afterexit",null,e);if(n&&e==="SIGHUP"){e="SIGINT"}process.kill(process.pid,e)}}}));e.exports.signals=function(){return i};e.exports.load=load;var l=false;function load(){if(l){return}l=true;a.count+=1;i=i.filter((function(e){try{process.on(e,_[e]);return true}catch(e){return false}}));process.emit=processEmit;process.reallyExit=processReallyExit}var f=process.reallyExit;function processReallyExit(e){process.exitCode=e||0;emit("exit",process.exitCode,null);emit("afterexit",process.exitCode,null);f.call(process,process.exitCode)}var u=process.emit;function processEmit(e,t){if(e==="exit"){if(t!==undefined){process.exitCode=t}var r=u.apply(this,arguments);emit("exit",process.exitCode,null);emit("afterexit",process.exitCode,null);return r}else{return u.apply(this,arguments)}}},589:e=>{e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32"){e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(process.platform==="linux"){e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}},567:e=>{e.exports=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]]},457:(e,t,r)=>{"use strict";var s=r(987);var i=r(567);var n={nul:0,control:0};e.exports=function wcwidth(e){return wcswidth(e,n)};e.exports.config=function(e){e=s(e||{},n);return function wcwidth(t){return wcswidth(t,e)}};function wcswidth(e,t){if(typeof e!=="string")return wcwidth(e,t);var r=0;for(var s=0;s<e.length;s++){var i=wcwidth(e.charCodeAt(s),t);if(i<0)return-1;r+=i}return r}function wcwidth(e,t){if(e===0)return t.nul;if(e<32||e>=127&&e<160)return t.control;if(bisearch(e))return 0;return 1+(e>=4352&&(e<=4447||e==9001||e==9002||e>=11904&&e<=42191&&e!=12351||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65135||e>=65280&&e<=65376||e>=65504&&e<=65510||e>=131072&&e<=196605||e>=196608&&e<=262141))}function bisearch(e){var t=0;var r=i.length-1;var s;if(e<i[0][0]||e>i[r][1])return false;while(r>=t){s=Math.floor((t+r)/2);if(e>i[s][1])t=s+1;else if(e<i[s][0])r=s-1;else return true}return false}},491:e=>{"use strict";e.exports=require("assert")},361:e=>{"use strict";e.exports=require("events")},542:e=>{"use strict";e.exports=require("next/dist/compiled/chalk")},518:e=>{"use strict";e.exports=require("next/dist/compiled/strip-ansi")},521:e=>{"use strict";e.exports=require("readline")},781:e=>{"use strict";e.exports=require("stream")},32:e=>{"use strict";e.exports=JSON.parse('{"dots":{"interval":80,"frames":["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},"dots2":{"interval":80,"frames":["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},"dots3":{"interval":80,"frames":["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},"dots4":{"interval":80,"frames":["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},"dots5":{"interval":80,"frames":["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},"dots6":{"interval":80,"frames":["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},"dots7":{"interval":80,"frames":["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},"dots8":{"interval":80,"frames":["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},"dots9":{"interval":80,"frames":["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},"dots10":{"interval":80,"frames":["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},"dots11":{"interval":100,"frames":["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},"dots12":{"interval":80,"frames":["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},"dots8Bit":{"interval":80,"frames":["⠀","⠁","⠂","⠃","⠄","⠅","⠆","⠇","⡀","⡁","⡂","⡃","⡄","⡅","⡆","⡇","⠈","⠉","⠊","⠋","⠌","⠍","⠎","⠏","⡈","⡉","⡊","⡋","⡌","⡍","⡎","⡏","⠐","⠑","⠒","⠓","⠔","⠕","⠖","⠗","⡐","⡑","⡒","⡓","⡔","⡕","⡖","⡗","⠘","⠙","⠚","⠛","⠜","⠝","⠞","⠟","⡘","⡙","⡚","⡛","⡜","⡝","⡞","⡟","⠠","⠡","⠢","⠣","⠤","⠥","⠦","⠧","⡠","⡡","⡢","⡣","⡤","⡥","⡦","⡧","⠨","⠩","⠪","⠫","⠬","⠭","⠮","⠯","⡨","⡩","⡪","⡫","⡬","⡭","⡮","⡯","⠰","⠱","⠲","⠳","⠴","⠵","⠶","⠷","⡰","⡱","⡲","⡳","⡴","⡵","⡶","⡷","⠸","⠹","⠺","⠻","⠼","⠽","⠾","⠿","⡸","⡹","⡺","⡻","⡼","⡽","⡾","⡿","⢀","⢁","⢂","⢃","⢄","⢅","⢆","⢇","⣀","⣁","⣂","⣃","⣄","⣅","⣆","⣇","⢈","⢉","⢊","⢋","⢌","⢍","⢎","⢏","⣈","⣉","⣊","⣋","⣌","⣍","⣎","⣏","⢐","⢑","⢒","⢓","⢔","⢕","⢖","⢗","⣐","⣑","⣒","⣓","⣔","⣕","⣖","⣗","⢘","⢙","⢚","⢛","⢜","⢝","⢞","⢟","⣘","⣙","⣚","⣛","⣜","⣝","⣞","⣟","⢠","⢡","⢢","⢣","⢤","⢥","⢦","⢧","⣠","⣡","⣢","⣣","⣤","⣥","⣦","⣧","⢨","⢩","⢪","⢫","⢬","⢭","⢮","⢯","⣨","⣩","⣪","⣫","⣬","⣭","⣮","⣯","⢰","⢱","⢲","⢳","⢴","⢵","⢶","⢷","⣰","⣱","⣲","⣳","⣴","⣵","⣶","⣷","⢸","⢹","⢺","⢻","⢼","⢽","⢾","⢿","⣸","⣹","⣺","⣻","⣼","⣽","⣾","⣿"]},"line":{"interval":130,"frames":["-","\\\\","|","/"]},"line2":{"interval":100,"frames":["⠂","-","–","—","–","-"]},"pipe":{"interval":100,"frames":["┤","┘","┴","└","├","┌","┬","┐"]},"simpleDots":{"interval":400,"frames":[". ",".. ","..."," "]},"simpleDotsScrolling":{"interval":200,"frames":[". ",".. ","..."," .."," ."," "]},"star":{"interval":70,"frames":["✶","✸","✹","✺","✹","✷"]},"star2":{"interval":80,"frames":["+","x","*"]},"flip":{"interval":70,"frames":["_","_","_","-","`","`","\'","´","-","_","_","_"]},"hamburger":{"interval":100,"frames":["☱","☲","☴"]},"growVertical":{"interval":120,"frames":["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},"growHorizontal":{"interval":120,"frames":["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},"balloon":{"interval":140,"frames":[" ",".","o","O","@","*"," "]},"balloon2":{"interval":120,"frames":[".","o","O","°","O","o","."]},"noise":{"interval":100,"frames":["▓","▒","░"]},"bounce":{"interval":120,"frames":["⠁","⠂","⠄","⠂"]},"boxBounce":{"interval":120,"frames":["▖","▘","▝","▗"]},"boxBounce2":{"interval":100,"frames":["▌","▀","▐","▄"]},"triangle":{"interval":50,"frames":["◢","◣","◤","◥"]},"arc":{"interval":100,"frames":["◜","◠","◝","◞","◡","◟"]},"circle":{"interval":120,"frames":["◡","⊙","◠"]},"squareCorners":{"interval":180,"frames":["◰","◳","◲","◱"]},"circleQuarters":{"interval":120,"frames":["◴","◷","◶","◵"]},"circleHalves":{"interval":50,"frames":["◐","◓","◑","◒"]},"squish":{"interval":100,"frames":["╫","╪"]},"toggle":{"interval":250,"frames":["⊶","⊷"]},"toggle2":{"interval":80,"frames":["▫","▪"]},"toggle3":{"interval":120,"frames":["□","■"]},"toggle4":{"interval":100,"frames":["■","□","▪","▫"]},"toggle5":{"interval":100,"frames":["▮","▯"]},"toggle6":{"interval":300,"frames":["ဝ","၀"]},"toggle7":{"interval":80,"frames":["⦾","⦿"]},"toggle8":{"interval":100,"frames":["◍","◌"]},"toggle9":{"interval":100,"frames":["◉","◎"]},"toggle10":{"interval":100,"frames":["㊂","㊀","㊁"]},"toggle11":{"interval":50,"frames":["⧇","⧆"]},"toggle12":{"interval":120,"frames":["☗","☖"]},"toggle13":{"interval":80,"frames":["=","*","-"]},"arrow":{"interval":100,"frames":["←","↖","↑","↗","→","↘","↓","↙"]},"arrow2":{"interval":80,"frames":["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},"arrow3":{"interval":120,"frames":["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},"bouncingBar":{"interval":80,"frames":["[ ]","[= ]","[== ]","[=== ]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},"bouncingBall":{"interval":80,"frames":["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},"smiley":{"interval":200,"frames":["😄 ","😝 "]},"monkey":{"interval":300,"frames":["🙈 ","🙈 ","🙉 ","🙊 "]},"hearts":{"interval":100,"frames":["💛 ","💙 ","💜 ","💚 ","❤️ "]},"clock":{"interval":100,"frames":["🕛 ","🕐 ","🕑 ","🕒 ","🕓 ","🕔 ","🕕 ","🕖 ","🕗 ","🕘 ","🕙 ","🕚 "]},"earth":{"interval":180,"frames":["🌍 ","🌎 ","🌏 "]},"material":{"interval":17,"frames":["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███████▁▁▁▁▁▁▁▁▁▁▁▁▁","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","██████████▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","█████████████▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁██████████████▁▁▁▁","▁▁▁██████████████▁▁▁","▁▁▁▁█████████████▁▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁▁▁████████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","██████▁▁▁▁▁▁▁▁▁▁▁▁▁█","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁▁█████████████▁▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁▁███████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁▁█████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"]},"moon":{"interval":80,"frames":["🌑 ","🌒 ","🌓 ","🌔 ","🌕 ","🌖 ","🌗 ","🌘 "]},"runner":{"interval":140,"frames":["🚶 ","🏃 "]},"pong":{"interval":80,"frames":["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},"shark":{"interval":120,"frames":["▐|\\\\____________▌","▐_|\\\\___________▌","▐__|\\\\__________▌","▐___|\\\\_________▌","▐____|\\\\________▌","▐_____|\\\\_______▌","▐______|\\\\______▌","▐_______|\\\\_____▌","▐________|\\\\____▌","▐_________|\\\\___▌","▐__________|\\\\__▌","▐___________|\\\\_▌","▐____________|\\\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},"dqpb":{"interval":100,"frames":["d","q","p","b"]},"weather":{"interval":100,"frames":["☀️ ","☀️ ","☀️ ","🌤 ","⛅️ ","🌥 ","☁️ ","🌧 ","🌨 ","🌧 ","🌨 ","🌧 ","🌨 ","⛈ ","🌨 ","🌧 ","🌨 ","☁️ ","🌥 ","⛅️ ","🌤 ","☀️ ","☀️ "]},"christmas":{"interval":400,"frames":["🌲","🎄"]},"grenade":{"interval":80,"frames":["، ","′ "," ´ "," ‾ "," ⸌"," ⸊"," |"," ⁎"," ⁕"," ෴ "," ⁓"," "," "," "]},"point":{"interval":125,"frames":["∙∙∙","●∙∙","∙●∙","∙∙●","∙∙∙"]},"layer":{"interval":150,"frames":["-","=","≡"]},"betaWave":{"interval":80,"frames":["ρββββββ","βρβββββ","ββρββββ","βββρβββ","ββββρββ","βββββρβ","ββββββρ"]},"fingerDance":{"interval":160,"frames":["🤘 ","🤟 ","🖖 ","✋ ","🤚 ","👆 "]},"fistBump":{"interval":80,"frames":["🤜    🤛 ","🤜    🤛 ","🤜    🤛 "," 🤜  🤛  ","  🤜🤛   "," 🤜✨🤛   ","🤜 ✨ 🤛  "]},"soccerHeader":{"interval":80,"frames":[" 🧑⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 "]},"mindblown":{"interval":160,"frames":["😐 ","😐 ","😮 ","😮 ","😦 ","😦 ","😧 ","😧 ","🤯 ","💥 ","✨ ","  ","  ","  "]},"speaker":{"interval":160,"frames":["🔈 ","🔉 ","🔊 ","🔉 "]},"orangePulse":{"interval":100,"frames":["🔸 ","🔶 ","🟠 ","🟠 ","🔶 "]},"bluePulse":{"interval":100,"frames":["🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},"orangeBluePulse":{"interval":100,"frames":["🔸 ","🔶 ","🟠 ","🟠 ","🔶 ","🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},"timeTravel":{"interval":100,"frames":["🕛 ","🕚 ","🕙 ","🕘 ","🕗 ","🕖 ","🕕 ","🕔 ","🕓 ","🕒 ","🕑 ","🕐 "]},"aesthetic":{"interval":80,"frames":["▰▱▱▱▱▱▱","▰▰▱▱▱▱▱","▰▰▰▱▱▱▱","▰▰▰▰▱▱▱","▰▰▰▰▰▱▱","▰▰▰▰▰▰▱","▰▰▰▰▰▰▰","▰▱▱▱▱▱▱"]}}')}};var t={};function __nccwpck_require__(r){var s=t[r];if(s!==undefined){return s.exports}var i=t[r]={exports:{}};var n=true;try{e[r](i,i.exports,__nccwpck_require__);n=false}finally{if(n)delete t[r]}return i.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(327);module.exports=r})();
\ No newline at end of file
MIT License
Copyright (c) Matteo Collina and Undici contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
This source diff could not be displayed because it is too large. You can view the blob instead.
{"name":"undici","main":"index.js","author":"Matteo Collina <hello@matteocollina.com>","license":"MIT"}
......@@ -619,6 +619,7 @@ export default async function exportApp(
httpAgentOptions: nextConfig.httpAgentOptions,
serverComponents: !!nextConfig.experimental.appDir,
appPaths: options.appPaths || [],
enableUndici: nextConfig.experimental.enableUndici,
})
for (const validation of result.ampValidations || []) {
......
......@@ -23,7 +23,7 @@ import { requireFontManifest } from '../server/require'
import { normalizeLocalePath } from '../shared/lib/i18n/normalize-locale-path'
import { trace } from '../trace'
import { isInAmpMode } from '../shared/lib/amp-mode'
import { setHttpAgentOptions } from '../server/config'
import { setHttpClientAndAgentOptions } from '../server/config'
import RenderResult from '../server/render-result'
import isError from '../lib/is-error'
import { addRequestMeta } from '../server/request-meta'
......@@ -70,6 +70,7 @@ interface ExportPageInput {
httpAgentOptions: NextConfigComplete['httpAgentOptions']
serverComponents?: boolean
appPaths: string[]
enableUndici: NextConfigComplete['experimental']['enableUndici']
}
interface ExportPageResults {
......@@ -119,8 +120,12 @@ export default async function exportPage({
disableOptimizedLoading,
httpAgentOptions,
serverComponents,
enableUndici,
}: ExportPageInput): Promise<ExportPageResults> {
setHttpAgentOptions(httpAgentOptions)
setHttpClientAndAgentOptions({
httpAgentOptions,
experimental: { enableUndici },
})
const exportPageSpan = trace('export-page-worker', parentSpanId)
return exportPageSpan.traceAsyncFn(async () => {
......
......@@ -264,6 +264,7 @@
"timers-browserify": "2.0.12",
"tty-browserify": "0.0.1",
"ua-parser-js": "0.7.28",
"undici": "5.10.0",
"unistore": "3.4.1",
"util": "0.12.4",
"uuid": "8.3.2",
......
......@@ -390,6 +390,9 @@ const configSchema = {
},
type: 'array',
},
enableUndici: {
type: 'boolean',
},
workerThreads: {
type: 'boolean',
},
......
......@@ -146,6 +146,7 @@ export interface ExperimentalConfig {
* [webpack/webpack#ModuleNotoundError.js#L13-L42](https://github.com/webpack/webpack/blob/2a0536cf510768111a3a6dceeb14cb79b9f59273/lib/ModuleNotFoundError.js#L13-L42)
*/
fallbackNodePolyfills?: false
enableUndici?: boolean
sri?: {
algorithm?: SubresourceIntegrityAlgorithm
}
......@@ -585,6 +586,7 @@ export const defaultConfig: NextConfig = {
amp: undefined,
urlImports: undefined,
modularizeImports: undefined,
enableUndici: false,
adjustFontFallbacks: false,
},
}
......
......@@ -139,6 +139,7 @@ export function loadWebpackHook() {
'next/dist/compiled/@babel/runtime/package.json',
],
['node-fetch', 'next/dist/compiled/node-fetch'],
['undici', 'next/dist/compiled/undici'],
].map(
// Use dynamic require.resolve to avoid statically analyzable since they're only for build time
([request, replacement]) => [request, require.resolve(replacement)]
......
......@@ -13,6 +13,7 @@ import {
ExperimentalConfig,
NextConfigComplete,
validateConfig,
NextConfig,
} from './config-shared'
import { loadWebpackHook } from './config-utils'
import {
......@@ -22,6 +23,7 @@ import {
} from '../shared/lib/image-config'
import { loadEnvConfig } from '@next/env'
import { hasNextSupport } from '../telemetry/ci-info'
import { gte as semverGte } from 'next/dist/compiled/semver'
export { DomainLocale, NextConfig, normalizeConfig } from './config-shared'
......@@ -45,12 +47,22 @@ const experimentalWarning = execOnce(
}
)
export function setHttpAgentOptions(
options: NextConfigComplete['httpAgentOptions']
) {
export function setHttpClientAndAgentOptions(options: NextConfig) {
if (semverGte(process.version, '16.8.0')) {
if (semverGte(process.version, '18.0.0')) {
Log.warn(
'`enableUndici` option is unnecessary in Node.js v18.0.0 or greater.'
)
}
;(global as any).__NEXT_USE_UNDICI = options.experimental?.enableUndici
} else if (options.experimental?.enableUndici) {
Log.warn(
'`enableUndici` option requires Node.js v16.8.0 or greater. Falling back to `node-fetch`'
)
}
if ((global as any).__NEXT_HTTP_AGENT) {
// We only need to assign once because we want
// to resuse the same agent for all requests.
// to reuse the same agent for all requests.
return
}
......@@ -58,8 +70,9 @@ export function setHttpAgentOptions(
throw new Error('Expected config.httpAgentOptions to be an object')
}
;(global as any).__NEXT_HTTP_AGENT = new HttpAgent(options)
;(global as any).__NEXT_HTTPS_AGENT = new HttpsAgent(options)
;(global as any).__NEXT_HTTP_AGENT_OPTIONS = options.httpAgentOptions
;(global as any).__NEXT_HTTP_AGENT = new HttpAgent(options.httpAgentOptions)
;(global as any).__NEXT_HTTPS_AGENT = new HttpsAgent(options.httpAgentOptions)
}
function assignDefaults(userConfig: { [key: string]: any }) {
......@@ -545,9 +558,7 @@ function assignDefaults(userConfig: { [key: string]: any }) {
// TODO: Change defaultConfig type to NextConfigComplete
// so we don't need "!" here.
setHttpAgentOptions(
result.httpAgentOptions || defaultConfig.httpAgentOptions!
)
setHttpClientAndAgentOptions(result || defaultConfig)
if (result.i18n) {
const { i18n } = result
......@@ -855,6 +866,6 @@ export default async function loadConfig(
// reactRoot can be updated correctly even with no next.config.js
const completeConfig = assignDefaults(defaultConfig) as NextConfigComplete
completeConfig.configFileName = configFileName
setHttpAgentOptions(completeConfig.httpAgentOptions)
setHttpClientAndAgentOptions(completeConfig)
return completeConfig
}
......@@ -1286,6 +1286,7 @@ export default class DevServer extends Server {
publicRuntimeConfig,
serverRuntimeConfig,
httpAgentOptions,
experimental: { enableUndici },
} = this.nextConfig
const { locales, defaultLocale } = this.nextConfig.i18n || {}
......@@ -1299,6 +1300,7 @@ export default class DevServer extends Server {
serverRuntimeConfig,
},
httpAgentOptions,
enableUndici,
locales,
defaultLocale,
originalAppPath,
......
......@@ -7,7 +7,7 @@ import {
collectGenerateParams,
} from '../../build/utils'
import { loadComponents } from '../load-components'
import { setHttpAgentOptions } from '../config'
import { setHttpClientAndAgentOptions } from '../config'
type RuntimeConfig = any
......@@ -22,6 +22,7 @@ export async function loadStaticPaths({
serverless,
config,
httpAgentOptions,
enableUndici,
locales,
defaultLocale,
isAppPath,
......@@ -32,6 +33,7 @@ export async function loadStaticPaths({
serverless: boolean
config: RuntimeConfig
httpAgentOptions: NextConfigComplete['httpAgentOptions']
enableUndici: NextConfigComplete['enableUndici']
locales?: string[]
defaultLocale?: string
isAppPath?: boolean
......@@ -49,7 +51,10 @@ export async function loadStaticPaths({
// update work memory runtime-config
require('../../shared/lib/runtime-config').setConfig(config)
setHttpAgentOptions(httpAgentOptions)
setHttpClientAndAgentOptions({
httpAgentOptions,
experimental: { enableUndici },
})
const components = await loadComponents({
distDir,
......
import fetch, {
Headers,
Request,
Response,
} from 'next/dist/compiled/node-fetch'
// Polyfill fetch() in the Node.js environment
if (!global.fetch) {
const agent = ({ protocol }) =>
protocol === 'http:' ? global.__NEXT_HTTP_AGENT : global.__NEXT_HTTPS_AGENT
const fetchWithAgent = (url, opts, ...rest) => {
if (!opts) {
opts = { agent }
} else if (!opts.agent) {
opts.agent = agent
function getFetchImpl() {
return global.__NEXT_USE_UNDICI
? require('next/dist/compiled/undici')
: require('next/dist/compiled/node-fetch')
}
// Due to limitation of global configuration, we have to do this resolution at runtime
global.fetch = (...args) => {
const fetchImpl = getFetchImpl()
if (global.__NEXT_USE_UNDICI) {
// Undici does not support the `keepAlive` option,
// instead we have to pass a custom dispatcher
if (
!global.__NEXT_HTTP_AGENT_OPTIONS?.keepAlive &&
!global.__NEXT_UNDICI_AGENT_SET
) {
global.__NEXT_UNDICI_AGENT_SET = true
fetchImpl.setGlobalDispatcher(new fetchImpl.Agent({ pipelining: 0 }))
}
return fetchImpl.fetch(...args)
}
return fetch(url, opts, ...rest)
const agent = ({ protocol }) =>
protocol === 'http:'
? global.__NEXT_HTTP_AGENT
: global.__NEXT_HTTPS_AGENT
if (!args[1]) {
args[1] = { agent }
} else if (!args[1].agent) {
args[1].agent = agent
}
return fetchImpl(...args)
}
global.fetch = fetchWithAgent
global.Headers = Headers
global.Request = Request
global.Response = Response
Object.defineProperties(global, {
Headers: {
get() {
return getFetchImpl().Headers
},
},
Request: {
get() {
return getFetchImpl().Request
},
},
Response: {
get() {
return getFetchImpl().Response
},
},
})
}
......@@ -86,6 +86,8 @@ const externals = {
'next/dist/build/webpack/plugins/terser-webpack-plugin',
// TODO: Add @swc/helpers to externals once @vercel/ncc switch to swc-loader
undici: 'undici',
}
// eslint-disable-next-line camelcase
externals['node-html-parser'] = 'next/dist/compiled/node-html-parser'
......@@ -167,6 +169,14 @@ export async function ncc_node_fetch(task, opts) {
.target('compiled/node-fetch')
}
externals['undici'] = 'next/dist/compiled/undici'
export async function ncc_undici(task, opts) {
await task
.source(opts.src || relative(__dirname, require.resolve('undici')))
.ncc({ packageName: 'undici', externals })
.target('compiled/undici')
}
// eslint-disable-next-line camelcase
export async function compile_config_schema(task, opts) {
const { configSchema } = require('./dist/server/config-schema')
......@@ -1818,6 +1828,7 @@ export async function ncc(task, opts) {
'ncc_get_orientation',
'ncc_hapi_accept',
'ncc_node_fetch',
'ncc_undici',
'ncc_acorn',
'ncc_amphtml_validator',
'ncc_arg',
......
......@@ -28,6 +28,8 @@ declare module 'next/dist/compiled/node-fetch' {
export * from 'node-fetch'
}
declare module 'next/dist/compiled/undici' {}
declare module 'next/dist/compiled/jest-worker' {
export * from 'jest-worker'
}
......
......@@ -601,6 +601,7 @@ importers:
timers-browserify: 2.0.12
tty-browserify: 0.0.1
ua-parser-js: 0.7.28
undici: 5.10.0
unistore: 3.4.1
use-sync-external-store: 1.2.0
util: 0.12.4
......@@ -789,6 +790,7 @@ importers:
timers-browserify: 2.0.12
tty-browserify: 0.0.1
ua-parser-js: 0.7.28
undici: 5.10.0
unistore: 3.4.1
util: 0.12.4
uuid: 8.3.2
......@@ -3896,7 +3898,7 @@ packages:
integrity: sha512-OoUX2+yhtBH6FGtPoI3gP0YQfjDyLWUzifuvZ3cZwF8AF8Gs7DWM9Lg8/9OfhP4I9ZL8DAuK+hSwxOKdvOLXew==,
}
dependencies:
'@edge-runtime/vm': 1.1.0-beta.33
'@edge-runtime/vm': 1.1.0-beta.34
'@jest/environment': 28.1.3
'@jest/fake-timers': 28.1.3
'@jest/types': 28.1.3
......@@ -3911,15 +3913,6 @@ packages:
}
dev: true
/@edge-runtime/vm/1.1.0-beta.33:
resolution:
{
integrity: sha512-Aifd/elNDeI01oEzUnCF5URPtMgBIVDhnuy/F6SgS2OMJvzts/U5Rl2hxYliViU2OpC8ZkM/XT/t+Q7rQPJsgw==,
}
dependencies:
'@edge-runtime/primitives': 1.1.0-beta.34
dev: true
/@edge-runtime/vm/1.1.0-beta.34:
resolution:
{
......@@ -4346,13 +4339,6 @@ packages:
purgecss: 1.4.2
dev: true
/@gar/promisify/1.1.3:
resolution:
{
integrity: sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==,
}
dev: true
/@grpc/grpc-js/0.8.1:
resolution:
{
......@@ -5280,7 +5266,7 @@ packages:
fs-extra: 9.1.0
npm-package-arg: 8.1.0
npmlog: 4.1.2
signal-exit: 3.0.7
signal-exit: 3.0.3
write-pkg: 4.0.0
dev: true
......@@ -5789,16 +5775,6 @@ packages:
}
dev: true
/@npmcli/fs/1.1.1:
resolution:
{
integrity: sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==,
}
dependencies:
'@gar/promisify': 1.1.3
semver: 7.3.7
dev: true
/@npmcli/git/2.0.4:
resolution:
{
......@@ -8267,7 +8243,7 @@ packages:
dependencies:
acorn: 7.4.1
/acorn-jsx/5.3.1_acorn@8.8.0:
/acorn-jsx/5.3.1_acorn@8.6.0:
resolution:
{
integrity: sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==,
......@@ -8275,7 +8251,7 @@ packages:
peerDependencies:
acorn: ^6.0.0 || ^7.0.0 || ^8.0.0
dependencies:
acorn: 8.8.0
acorn: 8.6.0
dev: true
/acorn-walk/7.1.1:
......@@ -9988,14 +9964,13 @@ packages:
engines: { node: '>= 0.8' }
dev: true
/cacache/15.3.0:
/cacache/15.0.5:
resolution:
{
integrity: sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==,
integrity: sha512-lloiL22n7sOjEEXdL8NAjTgv9a1u43xICE9/203qonkZUCj5X1UEWIdf2/Y0d6QcCtMzbKQyhrcDbdvlZTs/+A==,
}
engines: { node: '>= 10' }
dependencies:
'@npmcli/fs': 1.1.1
'@npmcli/move-file': 1.0.1
chownr: 2.0.0
fs-minipass: 2.1.0
......@@ -11074,7 +11049,10 @@ packages:
dev: true
/concat-map/0.0.1:
resolution: { integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= }
resolution:
{
integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==,
}
/concat-stream/1.6.2:
resolution:
......@@ -13246,10 +13224,7 @@ packages:
dev: true
/err-code/1.1.2:
resolution:
{
integrity: sha512-CJAN+O0/yA1CKfRn9SXOGctSpEM7DCon/r/5r2eXFMY2zCCJBasFhcM5I+1kh3Ap11FsQCX+vGHceNPvpWKhoA==,
}
resolution: { integrity: sha1-BuARbTAo9q70gGhJ6w6mp0iuaWA= }
dev: true
/err-code/2.0.3:
......@@ -14127,7 +14102,7 @@ packages:
merge-stream: 2.0.0
npm-run-path: 4.0.1
onetime: 5.1.2
signal-exit: 3.0.7
signal-exit: 3.0.3
strip-final-newline: 2.0.0
dev: true
......@@ -15112,10 +15087,10 @@ packages:
console-control-strings: 1.1.0
has-unicode: 2.0.1
object-assign: 4.1.1
signal-exit: 3.0.7
signal-exit: 3.0.3
string-width: 1.0.2
strip-ansi: 3.0.1
wide-align: 1.1.5
wide-align: 1.1.3
dev: true
/generic-names/2.0.1:
......@@ -16702,10 +16677,7 @@ packages:
engines: { node: '>=0.8.19' }
/indent-string/2.1.0:
resolution:
{
integrity: sha512-aqwDFWSgSgfRaEwao5lg5KEcVd/2a+D1rvoG7NdilmYz0NwRk6StWpWdz/Hpk34MKPpx7s8XxUqimfcQK6gGlg==,
}
resolution: { integrity: sha1-ji1INIdCEhtKghi3oTfppSBJ3IA= }
engines: { node: '>=0.10.0' }
dependencies:
repeating: 2.0.1
......@@ -18747,7 +18719,7 @@ packages:
optional: true
dependencies:
abab: 2.0.5
acorn: 8.8.0
acorn: 8.6.0
acorn-globals: 6.0.0
cssom: 0.4.4
cssstyle: 2.3.0
......@@ -19195,10 +19167,7 @@ packages:
dev: true
/levn/0.3.0:
resolution:
{
integrity: sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==,
}
resolution: { integrity: sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= }
engines: { node: '>= 0.8.0' }
dependencies:
prelude-ls: 1.1.2
......@@ -19816,7 +19785,7 @@ packages:
engines: { node: '>=0.10.0' }
dependencies:
currently-unhandled: 0.4.1
signal-exit: 3.0.7
signal-exit: 3.0.3
dev: true
/lower-case-first/1.0.2:
......@@ -19939,7 +19908,7 @@ packages:
engines: { node: '>= 10' }
dependencies:
agentkeepalive: 4.1.4
cacache: 15.3.0
cacache: 15.0.5
http-cache-semantics: 4.1.0
http-proxy-agent: 4.0.1
https-proxy-agent: 5.0.0
......@@ -20198,10 +20167,7 @@ packages:
dev: true
/meow/3.7.0:
resolution:
{
integrity: sha512-TNdwZs0skRlpPpCUK25StC4VH+tP5GgeY1HQOOGP+lQ2xtdkN2VtT/5tiX9k3IWpkBPV9b3LsAWXn4GGi/PrSA==,
}
resolution: { integrity: sha1-cstmi0JSKCkKu/qFaJJYcwioAfs= }
engines: { node: '>=0.10.0' }
dependencies:
camelcase-keys: 2.1.0
......@@ -20423,8 +20389,8 @@ packages:
integrity: sha512-NQuiYA0lw+eFDtSG4+c7ao3RG9dM4P0Kx/sn8OLyPhxtIc6k+9n14k5VfLxRKfAxYRTo8c5PLZPaRNmslGWxJw==,
}
dependencies:
acorn: 8.8.0
acorn-jsx: 5.3.1_acorn@8.8.0
acorn: 8.6.0
acorn-jsx: 5.3.1_acorn@8.6.0
micromark: 2.11.4
micromark-extension-mdx-expression: 0.3.2
micromark-extension-mdx-jsx: 0.3.3
......@@ -22222,7 +22188,7 @@ packages:
'@npmcli/installed-package-contents': 1.0.7
'@npmcli/promise-spawn': 1.3.2
'@npmcli/run-script': 1.8.3
cacache: 15.3.0
cacache: 15.0.5
chownr: 2.0.0
fs-minipass: 2.1.0
infer-owner: 1.0.4
......@@ -23961,10 +23927,7 @@ packages:
dev: true
/prelude-ls/1.1.2:
resolution:
{
integrity: sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==,
}
resolution: { integrity: sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= }
engines: { node: '>= 0.8.0' }
dev: true
......@@ -24111,10 +24074,7 @@ packages:
dev: true
/process-nextick-args/1.0.7:
resolution:
{
integrity: sha512-yN0WQmuCX63LP/TMvAg31nvT6m4vDqJEiiv2CAZqWOGNWutc9DfDk1NPYYmKUFmaVM2UwDowH4u5AHWYP/jxKw==,
}
resolution: { integrity: sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M= }
dev: true
/process-nextick-args/2.0.1:
......@@ -24163,10 +24123,7 @@ packages:
dev: true
/promise-retry/1.1.1:
resolution:
{
integrity: sha512-StEy2osPr28o17bIW776GtwO6+Q+M9zPiZkYfosciUUMYqjhU/ffwRAH0zN2+uvGyUsn8/YICIHRzLbPacpZGw==,
}
resolution: { integrity: sha1-ZznpaOMFHaIM5kl/srUPaRHfPW0= }
engines: { node: '>=0.12' }
dependencies:
err-code: 1.1.2
......@@ -24773,10 +24730,7 @@ packages:
dev: true
/read-pkg-up/1.0.1:
resolution:
{
integrity: sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==,
}
resolution: { integrity: sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI= }
engines: { node: '>=0.10.0' }
dependencies:
find-up: 1.1.2
......@@ -24792,10 +24746,7 @@ packages:
dev: true
/read-pkg-up/3.0.0:
resolution:
{
integrity: sha512-YFzFrVvpC6frF1sz8psoHDBGF7fLPc+llq/8NB43oagqWkx8ar5zYtsTORtOjw9W2RHLpWP+zTWwBvf1bCmcSw==,
}
resolution: { integrity: sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc= }
engines: { node: '>=4' }
dependencies:
find-up: 2.1.0
......@@ -24872,10 +24823,7 @@ packages:
dev: true
/readable-stream/1.1.14:
resolution:
{
integrity: sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==,
}
resolution: { integrity: sha1-fPTFTvZI44EwhMY23SB54WbAgdk= }
dependencies:
core-util-is: 1.0.2
inherits: 2.0.4
......@@ -24990,10 +24938,7 @@ packages:
dev: true
/redent/1.0.0:
resolution:
{
integrity: sha512-qtW5hKzGQZqKoh6JNSD+4lfitfPKGz42e6QwiRmPM5mmKtR0N41AbJRYu0xJi7nhOJ4WDgRkKvAk6tw4WIwR4g==,
}
resolution: { integrity: sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94= }
engines: { node: '>=0.10.0' }
dependencies:
indent-string: 2.1.0
......@@ -25453,7 +25398,10 @@ packages:
dev: true
/replace-ext/1.0.0:
resolution: { integrity: sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs= }
resolution:
{
integrity: sha512-vuNYXC7gG7IeVNBC1xUllqCcZKRbJoSPOBhnTEcAIiKCsbuef6zO3F0Rve3isPMMoNoQRWjQwbAgAjHUHniyEA==,
}
engines: { node: '>= 0.10' }
dev: true
......@@ -25501,10 +25449,7 @@ packages:
dev: true
/require-directory/2.1.1:
resolution:
{
integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==,
}
resolution: { integrity: sha1-jGStX9MNqxyXbiNE/+f3kqam30I= }
engines: { node: '>=0.10.0' }
dev: true
......@@ -25647,7 +25592,7 @@ packages:
engines: { node: '>=4' }
dependencies:
onetime: 2.0.1
signal-exit: 3.0.7
signal-exit: 3.0.3
dev: true
/restore-cursor/3.1.0:
......@@ -25658,7 +25603,7 @@ packages:
engines: { node: '>=8' }
dependencies:
onetime: 5.1.2
signal-exit: 3.0.7
signal-exit: 3.0.3
/restore-cursor/4.0.0:
resolution:
......@@ -25668,7 +25613,7 @@ packages:
engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 }
dependencies:
onetime: 5.1.2
signal-exit: 3.0.7
signal-exit: 3.0.3
dev: true
/ret/0.1.15:
......@@ -26422,6 +26367,7 @@ packages:
{
integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==,
}
dev: true
/simple-swizzle/0.2.2:
resolution:
......@@ -26474,10 +26420,7 @@ packages:
dev: true
/slice-ansi/0.0.4:
resolution:
{
integrity: sha512-up04hB2hR92PgjpyU3y/eg91yIBILyjVY26NvvciY3EVVPjybkMszMpXQ9QAkcS3I5rtJBDLoTxxg+qvW8c7rw==,
}
resolution: { integrity: sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU= }
engines: { node: '>=0.10.0' }
dev: true
......@@ -28121,10 +28064,7 @@ packages:
dev: true
/trim-newlines/1.0.0:
resolution:
{
integrity: sha512-Nm4cF79FhSTzrLKGDMi3I4utBtFv8qKy4sq1enftf2gMdpqI8oVQTAfySkTz5r49giVzDj88SVZXP4CeYQwjaw==,
}
resolution: { integrity: sha1-WIeWa7WCpFA6QetST301ARgVphM= }
engines: { node: '>=0.10.0' }
dev: true
......@@ -28331,10 +28271,7 @@ packages:
dev: true
/type-check/0.3.2:
resolution:
{
integrity: sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==,
}
resolution: { integrity: sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= }
engines: { node: '>= 0.8.0' }
dependencies:
prelude-ls: 1.1.2
......@@ -28535,6 +28472,14 @@ packages:
engines: { node: '>=0.10.0' }
dev: true
/undici/5.10.0:
resolution:
{
integrity: sha512-c8HsD3IbwmjjbLvoZuRI26TZic+TSEe8FPMLLOkN1AfYRhdjnKBU6yL+IwcSCbdZiX4e5t0lfMDLDCqj4Sq70g==,
}
engines: { node: '>=12.18' }
dev: true
/unfetch/4.1.0:
resolution:
{
......@@ -29260,7 +29205,10 @@ packages:
dev: true
/verror/1.10.0:
resolution: { integrity: sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= }
resolution:
{
integrity: sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==,
}
engines: { '0': node >=0.6.0 }
dependencies:
assert-plus: 1.0.0
......@@ -29761,13 +29709,13 @@ packages:
dependencies:
isexe: 2.0.0
/wide-align/1.1.5:
/wide-align/1.1.3:
resolution:
{
integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==,
integrity: sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==,
}
dependencies:
string-width: 4.2.3
string-width: 2.1.1
dev: true
/widest-line/3.1.0:
......@@ -29792,10 +29740,7 @@ packages:
dev: true
/wrap-ansi/3.0.1:
resolution:
{
integrity: sha512-iXR3tDXpbnTpzjKSylUJRkLuOrEC7hwEB221cgn6wtF8wpmz28puFXAEfPT5zrjM3wahygB//VuWEr1vTkDcNQ==,
}
resolution: { integrity: sha1-KIoE2H7aXChuBg3+jxNc6NAH+Lo= }
engines: { node: '>=4' }
dependencies:
string-width: 2.1.1
......@@ -29861,7 +29806,7 @@ packages:
dependencies:
imurmurhash: 0.1.4
is-typedarray: 1.0.0
signal-exit: 3.0.3
signal-exit: 3.0.7
typedarray-to-buffer: 3.1.5
dev: true
......
import { createNext } from 'e2e-utils'
import { NextInstance } from 'test/lib/next-modes/base'
import { fetchViaHTTP } from 'next-test-utils'
import semver from 'semver'
if (
semver.lt(process.version, '16.8.0') ||
semver.gte(process.version, '18.0.0')
) {
it('skipping for Node.js versions <16.8.0 and >18.0.0', () => {
expect(true).toBe(true)
})
} else {
describe('undici fetch', () => {
let next: NextInstance
beforeAll(async () => {
next = await createNext({
files: {
'pages/api/globalFetch.js': `
import { ReadableStream } from 'node:stream/web';
export default async function globalFetch(req, res) {
try {
const response = await fetch('https://example.vercel.sh')
res.json({ value: response.body instanceof ReadableStream })
} catch (error) {
console.error(error);
res.send(error);
}
}
`,
'pages/api/globalHeaders.js': `
export default async function globalHeaders(req, res) {
res.json({
value: (new Headers())[Symbol.iterator].name === 'entries'
})
}
`,
'pages/api/globalRequest.js': `
export default async function globalRequest(req, res) {
res.json({
value: (new Request('https://example.vercel.sh')).headers[Symbol.iterator].name === 'entries'
})
}
`,
'pages/api/globalResponse.js': `
export default async function globalResponse(req, res) {
res.json({
value: (new Response()).headers[Symbol.iterator].name === 'entries'
})
}
`,
},
dependencies: {},
nextConfig: {
experimental: {
enableUndici: true,
},
},
})
})
afterAll(() => next.destroy())
describe('undici', () => {
it('global fetch should return true when undici is used', async () => {
const result = await fetchViaHTTP(next.url, '/api/globalFetch')
const data = await result.json()
expect(data.value).toBe(true)
})
it('global Headers should return true when undici is used', async () => {
const result = await fetchViaHTTP(next.url, '/api/globalHeaders')
const data = await result.json()
expect(data.value).toBe(true)
})
it('global Request should return true when undici is used', async () => {
const result = await fetchViaHTTP(next.url, '/api/globalRequest')
const data = await result.json()
expect(data.value).toBe(true)
})
it('global Response should return true when undici is used', async () => {
const result = await fetchViaHTTP(next.url, '/api/globalResponse')
const data = await result.json()
expect(data.value).toBe(true)
})
})
describe('node-fetch', () => {
beforeAll(async () => {
await next.stop()
await next.patchFile(
'next.config.js',
`module.exports = ${JSON.stringify({
experimental: {
enableUndici: false,
},
})}`
)
await next.start()
})
it('global fetch should return false when node-fetch is used', async () => {
const result = await fetchViaHTTP(next.url, '/api/globalFetch')
const data = await result.json()
expect(data.value).toBe(false)
})
it('global Headers should return false when node-fetch is used', async () => {
const result = await fetchViaHTTP(next.url, '/api/globalHeaders')
const data = await result.json()
expect(data.value).toBe(false)
})
it('global Request should return false when node-fetch is used', async () => {
const result = await fetchViaHTTP(next.url, '/api/globalRequest')
const data = await result.json()
expect(data.value).toBe(false)
})
it('global Response should return false when node-fetch is used', async () => {
const result = await fetchViaHTTP(next.url, '/api/globalResponse')
const data = await result.json()
expect(data.value).toBe(false)
})
})
})
}
module.exports = {
experimental: {
enableUndici: true,
},
}
export default async function handler(_req, res) {
const fetchRes = await fetch('http://localhost:44001')
const props = await fetchRes.json()
res.json(props)
}
export default function Blog(props) {
return <pre id="props">{JSON.stringify(props)}</pre>
}
export async function getStaticProps({ params: { slug } }) {
return { props: { slug } }
}
export async function getStaticPaths() {
const res = await fetch('http://localhost:44001')
const obj = await res.json()
if (obj.connection === 'keep-alive') {
return {
paths: [{ params: { slug: 'first' } }],
fallback: false,
}
}
return {
paths: [],
fallback: false,
}
}
export default function SSG(props) {
return <pre id="props">{JSON.stringify(props)}</pre>
}
export async function getStaticProps() {
const res = await fetch('http://localhost:44001')
const props = await res.json()
return { props }
}
export default function SSR(props) {
return <pre id="props">{JSON.stringify(props)}</pre>
}
export async function getServerSideProps() {
const res = await fetch('http://localhost:44001')
const props = await res.json()
return { props }
}
/* eslint-env jest */
import { join } from 'path'
import { createServer } from 'http'
import {
fetchViaHTTP,
nextBuild,
findPort,
nextStart,
launchApp,
killApp,
} from 'next-test-utils'
import webdriver from 'next-webdriver'
const appDir = join(__dirname, '../')
let appPort
let app
let mockServer
describe('undici-keep-alive', () => {
describe('dev', () => {
beforeAll(async () => {
mockServer = createServer((req, res) => {
// we can test request headers by sending them
// back with the response
const { connection } = req.headers
res.end(JSON.stringify({ connection }))
})
mockServer.listen(44001)
appPort = await findPort()
app = await launchApp(appDir, appPort)
})
afterAll(async () => {
await killApp(app)
mockServer.close()
})
runTests()
})
describe('production', () => {
beforeAll(async () => {
mockServer = createServer((req, res) => {
// we can test request headers by sending them
// back with the response
const { connection } = req.headers
res.end(JSON.stringify({ connection }))
})
mockServer.listen(44001)
const { stdout, stderr } = await nextBuild(appDir, [], {
stdout: true,
stderr: true,
})
if (stdout) console.log(stdout)
if (stderr) console.error(stderr)
appPort = await findPort()
app = await nextStart(appDir, appPort)
})
afterAll(async () => {
await killApp(app)
mockServer.close()
})
runTests()
})
function runTests() {
it('should send keep-alive for json API', async () => {
const res = await fetchViaHTTP(appPort, '/api/json')
const obj = await res.json()
expect(obj).toEqual({ connection: 'keep-alive' })
})
it('should send keep-alive for getStaticProps', async () => {
const browser = await webdriver(appPort, '/ssg')
const props = await browser.elementById('props').text()
const obj = JSON.parse(props)
expect(obj).toEqual({ connection: 'keep-alive' })
await browser.close()
})
it('should send keep-alive for getStaticPaths', async () => {
const browser = await webdriver(appPort, '/blog/first')
const props = await browser.elementById('props').text()
const obj = JSON.parse(props)
expect(obj).toEqual({ slug: 'first' })
await browser.close()
})
it('should send keep-alive for getServerSideProps', async () => {
const browser = await webdriver(appPort, '/ssr')
const props = await browser.elementById('props').text()
const obj = JSON.parse(props)
expect(obj).toEqual({ connection: 'keep-alive' })
await browser.close()
})
}
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment