rsnext/packages/next/compiled/@vercel/nft/index.js

12 lines
253 KiB
JavaScript
Raw Normal View History

(()=>{var __webpack_modules__={5841:(e,t,r)=>{"use strict";e.exports=t;t.mockS3Http=r(9361).get_mockS3Http();t.mockS3Http("on");const a=t.mockS3Http("get");const s=r(7147);const o=r(1017);const u=r(1758);const c=r(9544);c.disableProgress();const f=r(5977);const d=r(2361).EventEmitter;const p=r(3837).inherits;const h=["clean","install","reinstall","build","rebuild","package","testpackage","publish","unpublish","info","testbinary","reveal","configure"];const v={};c.heading="node-pre-gyp";if(a){c.warn(`mocking s3 to ${process.env.node_pre_gyp_mock_s3}`)}Object.defineProperty(t,"find",{get:function(){return r(5921).find},enumerable:true});function Run({package_json_path:e="./package.json",argv:t}){this.package_json_path=e;this.commands={};const r=this;h.forEach((e=>{r.commands[e]=function(t,a){c.verbose("command",e,t);return require("./"+e)(r,t,a)}}));this.parseArgv(t);this.binaryHostSet=false}p(Run,d);t.Run=Run;const g=Run.prototype;g.package=r(7399);g.configDefs={help:Boolean,arch:String,debug:Boolean,directory:String,proxy:String,loglevel:String};g.shorthands={release:"--no-debug",C:"--directory",debug:"--debug",j:"--jobs",silent:"--loglevel=silent",silly:"--loglevel=silly",verbose:"--loglevel=verbose"};g.aliases=v;g.parseArgv=function parseOpts(e){this.opts=u(this.configDefs,this.shorthands,e);this.argv=this.opts.argv.remain.slice();const t=this.todo=[];e=this.argv.map((e=>{if(e in this.aliases){e=this.aliases[e]}return e}));e.slice().forEach((r=>{if(r in this.commands){const a=e.splice(0,e.indexOf(r));e.shift();if(t.length>0){t[t.length-1].args=a}t.push({name:r,args:[]})}}));if(t.length>0){t[t.length-1].args=e.splice(0)}let r=this.package_json_path;if(this.opts.directory){r=o.join(this.opts.directory,r)}this.package_json=JSON.parse(s.readFileSync(r));this.todo=f.expand_commands(this.package_json,this.opts,t);const a="npm_config_";Object.keys(process.env).forEach((e=>{if(e.indexOf(a)!==0)return;const t=process.env[e];if(e===a+"loglevel"){c.level=t}else{e=e.substring(a.length);if(e==="argv"){if(this.opts.argv&&this.opts.argv.remain&&this.opts.argv.remain.length){}else{this.opts[e]=t}}else{this.opts[e]=t}}}));if(this.opts.loglevel){c.level=this.opts.loglevel}c.resume()};g.setBinaryHostProperty=function(e){if(this.binaryHostSet){return this.package_json.binary.host}const t=this.package_json;if(!t||!t.binary||t.binary.host){return""}if(!t.binary.staging_host||!t.binary.production_host){return""}let r="production_host";if(e==="publish"){r="staging_host"}const a=process.env.node_pre_gyp_s3_host;if(a==="staging"||a==="production"){r=`${a}_host`}else if(this.opts["s3_host"]==="staging"||this.opts["s3_host"]==="production"){r=`${this.opts["s3_host"]}_host`}else if(this.opts["s3_host"]||a){throw new Error(`invalid s3_host ${this.opts["s3_host"]||a}`)}t.binary.host=t.binary[r];this.binaryHostSet=true;return t.binary.host};g.usage=function usage(){const e=[""," Usage: node-pre-gyp <command> [options]",""," where <command> is one of:",h.map((e=>" - "+e+" - "+require("./"+e).usage)).join("\n"),"","node-pre-gyp@"+this.version+" "+o.resolve(__dirname,".."),"node@"+process.versions.node].join("\n");return e};Object.defineProperty(g,"version",{get:function(){return this.package.version},enumerable:true})},5921:(e,t,r)=>{"use strict";const a=r(5841);const s=r(2821);const o=r(5977);const u=r(7147).existsSync||r(1017).existsSync;const c=r(1017);e.exports=t;t.usage="Finds the require path for the node-pre-gyp installed module";t.validate=function(e,t){s.validate_config(e,t)};t.find=function(e,t){if(!u(e)){throw new Error(e+"does not exist")}const r=new a.Run({package_json_path:e,argv:process.argv});r.setBinaryHostProperty();const f=r.package_json;s.validate_config(f,t);let d;if(o.get_napi_build_versions(f,t)){d=o.get_best_napi_build_version(f,t)}t=t||{};if(!t.module_root)t.module_root=c.dirname(e);const p=s.evaluate(f,t,d);return p.module}},5977:(e,t,r)=>{"use strict";const a=r(7147);e.exports=t;const s=process.version.substr(1).replace(/-.*$/,"").split(".").map((e=>+e));const o=["build","clean","configure","package","publish","reveal"
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var t=Object.getOwnPropertySymbols;var r=Object.prototype.hasOwnProperty;var a=Object.prototype.propertyIsEnumerable;function toObject(e){if(e===null||e===undefined){throw new TypeError("Object.assign cannot be called with null or undefined")}return Object(e)}function shouldUseNative(){try{if(!Object.assign){return false}var e=new String("abc");e[5]="de";if(Object.getOwnPropertyNames(e)[0]==="5"){return false}var t={};for(var r=0;r<10;r++){t["_"+String.fromCharCode(r)]=r}var a=Object.getOwnPropertyNames(t).map((function(e){return t[e]}));if(a.join("")!=="0123456789"){return false}var s={};"abcdefghijklmnopqrst".split("").forEach((function(e){s[e]=e}));if(Object.keys(Object.assign({},s)).join("")!=="abcdefghijklmnopqrst"){return false}return true}catch(e){return false}}e.exports=shouldUseNative()?Object.assign:function(e,s){var o;var u=toObject(e);var c;for(var f=1;f<arguments.length;f++){o=Object(arguments[f]);for(var d in o){if(r.call(o,d)){u[d]=o[d]}}if(t){c=t(o);for(var p=0;p<c.length;p++){if(a.call(o,c[p])){u[c[p]]=o[c[p]]}}}}return u}},9182:e=>{"use strict";if(typeof process==="undefined"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0){e.exports={nextTick:nextTick}}else{e.exports=process}function nextTick(e,t,r,a){if(typeof e!=="function"){throw new TypeError('"callback" argument must be a function')}var s=arguments.length;var o,u;switch(s){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick((function afterTickOne(){e.call(null,t)}));case 3:return process.nextTick((function afterTickTwo(){e.call(null,t,r)}));case 4:return process.nextTick((function afterTickThree(){e.call(null,t,r,a)}));default:o=new Array(s-1);u=0;while(u<o.length){o[u++]=arguments[u]}return process.nextTick((function afterTick(){e.apply(null,o)}))}}},4928:(e,t,r)=>{"use strict";var a=r(9182);var s=Object.keys||function(e){var t=[];for(var r in e){t.push(r)}return t};e.exports=Duplex;var o=Object.create(r(1504));o.inherits=r(2842);var u=r(7355);var c=r(3517);o.inherits(Duplex,u);{var f=s(c.prototype);for(var d=0;d<f.length;d++){var p=f[d];if(!Duplex.prototype[p])Duplex.prototype[p]=c.prototype[p]}}function Duplex(e){if(!(this instanceof Duplex))return new Duplex(e);u.call(this,e);c.call(this,e);if(e&&e.readable===false)this.readable=false;if(e&&e.writable===false)this.writable=false;this.allowHalfOpen=true;if(e&&e.allowHalfOpen===false)this.allowHalfOpen=false;this.once("end",onend)}Object.defineProperty(Duplex.prototype,"writableHighWaterMark",{enumerable:false,get:function(){return this._writableState.highWaterMark}});function onend(){if(this.allowHalfOpen||this._writableState.ended)return;a.nextTick(onEndNT,this)}function onEndNT(e){e.end()}Object.defineProperty(Duplex.prototype,"destroyed",{get:function(){if(this._readableState===undefined||this._writableState===undefined){return false}return this._readableState.destroyed&&this._writableState.destroyed},set:function(e){if(this._readableState===undefined||this._writableState===undefined){return}this._readableState.destroyed=e;this._writableState.destroyed=e}});Duplex.prototype._destroy=function(e,t){this.push(null);this.end();a.nextTick(t,e)}},9924:(e,t,r)=>{"use strict";e.exports=PassThrough;var a=r(2162);var s=Object.create(r(1504));s.inherits=r(2842);s.inherits(PassThrough,a);function PassThrough(e){if(!(this instanceof PassThrough))return new PassThrough(e);a.call(this,e)}PassThrough.prototype._transform=function(e,t,r){r(null,e)}},7355:(e,t,r)=>{"use strict";var a=r(9182);e.exports=Readable;var s=r(1551);var o;Readable.ReadableState=ReadableState;var u=r(2361).EventEmitter;var EElistenerCount=function(e,t){return e.listeners(t).length};var c=r(2641);var f=r(291).Buffer;var d=global.Uint8Array||function(){};function _uint8ArrayToBuffer(e){return f.from(e)}function _isUint8Array(e){return f.isBuffer(e)||e instanceof d}var p=Object.create(r(1504));p.inherits=r(2842);var h=r(3837);var v=void 0;if(h&&h.debuglog){v=h.debuglog("stream")}else{v=function(){}}var g=r(4865);var y=r(2604);var m;p.inh
/*!
* is-number <https://github.com/jonschlinkert/is-number>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Released under the MIT License.
*/var isNumber=function(e){if(typeof e==="number"){return e-e===0}if(typeof e==="string"&&e.trim()!==""){return Number.isFinite?Number.isFinite(+e):isFinite(+e)}return false};const toRegexRange=(e,t,r)=>{if(isNumber(e)===false){throw new TypeError("toRegexRange: expected the first argument to be a number")}if(t===void 0||e===t){return String(e)}if(isNumber(t)===false){throw new TypeError("toRegexRange: expected the second argument to be a number.")}let a=Object.assign({relaxZeros:true},r);if(typeof a.strictZeros==="boolean"){a.relaxZeros=a.strictZeros===false}let s=String(a.relaxZeros);let o=String(a.shorthand);let u=String(a.capture);let c=String(a.wrap);let f=e+":"+t+"="+s+o+u+c;if(toRegexRange.cache.hasOwnProperty(f)){return toRegexRange.cache[f].result}let d=Math.min(e,t);let p=Math.max(e,t);if(Math.abs(d-p)===1){let r=e+"|"+t;if(a.capture){return`(${r})`}if(a.wrap===false){return r}return`(?:${r})`}let h=hasPadding(e)||hasPadding(t);let v={min:e,max:t,a:d,b:p};let g=[];let y=[];if(h){v.isPadded=h;v.maxLen=String(v.max).length}if(d<0){let e=p<0?Math.abs(p):1;y=splitToPatterns(e,Math.abs(d),v,a);d=v.a=0}if(p>=0){g=splitToPatterns(d,p,v,a)}v.negatives=y;v.positives=g;v.result=collatePatterns(y,g,a);if(a.capture===true){v.result=`(${v.result})`}else if(a.wrap!==false&&g.length+y.length>1){v.result=`(?:${v.result})`}toRegexRange.cache[f]=v;return v.result};function collatePatterns(e,t,r){let a=filterPatterns(e,t,"-",false,r)||[];let s=filterPatterns(t,e,"",false,r)||[];let o=filterPatterns(e,t,"-?",true,r)||[];let u=a.concat(o).concat(s);return u.join("|")}function splitToRanges(e,t){let r=1;let a=1;let s=countNines(e,r);let o=new Set([t]);while(e<=s&&s<=t){o.add(s);r+=1;s=countNines(e,r)}s=countZeros(t+1,a)-1;while(e<s&&s<=t){o.add(s);a+=1;s=countZeros(t+1,a)-1}o=[...o];o.sort(compare);return o}function rangeToPattern(e,t,r){if(e===t){return{pattern:e,count:[],digits:0}}let a=zip(e,t);let s=a.length;let o="";let u=0;for(let e=0;e<s;e++){let[t,s]=a[e];if(t===s){o+=t}else if(t!=="0"||s!=="9"){o+=toCharacterClass(t,s,r)}else{u++}}if(u){o+=r.shorthand===true?"\\d":"[0-9]"}return{pattern:o,count:[u],digits:s}}function splitToPatterns(e,t,r,a){let s=splitToRanges(e,t);let o=[];let u=e;let c;for(let e=0;e<s.length;e++){let t=s[e];let f=rangeToPattern(String(u),String(t),a);let d="";if(!r.isPadded&&c&&c.pattern===f.pattern){if(c.count.length>1){c.count.pop()}c.count.push(f.count[0]);c.string=c.pattern+toQuantifier(c.count);u=t+1;continue}if(r.isPadded){d=padZeros(t,r,a)}f.string=d+f.pattern+toQuantifier(f.count);o.push(f);u=t+1;c=f}return o}function filterPatterns(e,t,r,a,s){let o=[];for(let s of e){let{string:e}=s;if(!a&&!contains(t,"string",e)){o.push(r+e)}if(a&&contains(t,"string",e)){o.push(r+e)}}return o}function zip(e,t){let r=[];for(let a=0;a<e.length;a++)r.push([e[a],t[a]]);return r}function compare(e,t){return e>t?1:t>e?-1:0}function contains(e,t,r){return e.some((e=>e[t]===r))}function countNines(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function countZeros(e,t){return e-e%Math.pow(10,t)}function toQuantifier(e){let[t=0,r=""]=e;if(r||t>1){return`{${t+(r?","+r:"")}}`}return""}function toCharacterClass(e,t,r){return`[${e}${t-e===1?"":"-"}${t}]`}function hasPadding(e){return/^-?(0+)\d/.test(e)}function padZeros(e,t,r){if(!t.isPadded){return e}let a=Math.abs(t.maxLen-String(e).length);let s=r.relaxZeros!==false;switch(a){case 0:return"";case 1:return s?"0?":"0";case 2:return s?"0{0,2}":"00";default:{return s?`0{0,${a}}`:`0{${a}}`}}}toRegexRange.cache={};toRegexRange.clearCache=()=>toRegexRange.cache={};var k=toRegexRange;const isObject=e=>e!==null&&typeof e==="object"&&!Array.isArray(e);const transform=e=>t=>e===true?Number(t):String(t);const isValidValue=e=>typeof e==="number"||typeof e==="string"&&e!=="";const isNumber$1=e=>Number.isInteger(+e);const zeros=e=>{let t=`${e}`;let r=-1;if(t[0]==="-")t=t.slice(1);if(t==="0")return false;while(t[++r]==="0");return r>0};const stringify$1=(e,t,r)=>{if(typeof e==="string"||typeof t==="string"){return true}return r.stringify===true};const pad=(e,t,r)=>{if(t>0){let