2592 lines
2.1 MiB
JavaScript
2592 lines
2.1 MiB
JavaScript
|
|
#!/usr/bin/env node
|
|||
|
|
"use strict";var lOe=Object.create;var Ag=Object.defineProperty;var fOe=Object.getOwnPropertyDescriptor;var pOe=Object.getOwnPropertyNames;var dOe=Object.getPrototypeOf,hOe=Object.prototype.hasOwnProperty;var QB=e=>{throw TypeError(e)};var mOe=(e,r,n)=>r in e?Ag(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n;var Np=(e,r)=>()=>(e&&(r=e(e=0)),r);var S=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Xn=(e,r)=>{for(var n in r)Ag(e,n,{get:r[n],enumerable:!0})},jx=(e,r,n,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of pOe(r))!hOe.call(e,a)&&a!==n&&Ag(e,a,{get:()=>r[a],enumerable:!(i=fOe(r,a))||i.enumerable});return e},Bx=(e,r,n)=>(jx(e,r,"default"),n&&jx(n,r,"default")),B=(e,r,n)=>(n=e!=null?lOe(dOe(e)):{},jx(r||!e||!e.__esModule?Ag(n,"default",{value:e,enumerable:!0}):n,e)),gOe=e=>jx(Ag({},"__esModule",{value:!0}),e);var Je=(e,r,n)=>mOe(e,typeof r!="symbol"?r+"":r,n),ZT=(e,r,n)=>r.has(e)||QB("Cannot "+n);var $=(e,r,n)=>(ZT(e,r,"read from private field"),n?n.call(e):r.get(e)),Ee=(e,r,n)=>r.has(e)?QB("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(e):r.set(e,n),fe=(e,r,n,i)=>(ZT(e,r,"write to private field"),i?i.call(e,n):r.set(e,n),n),de=(e,r,n)=>(ZT(e,r,"access private method"),n);var Ic=(e,r,n,i)=>({set _(a){fe(e,r,a,n)},get _(){return $(e,r,i)}});var dR=S((wAt,pR)=>{"use strict";var st=pR.exports;pR.exports.default=st;var Rt="\x1B[",Ng="\x1B]",qp="\x07",Xx=";",y9=process.env.TERM_PROGRAM==="Apple_Terminal";st.cursorTo=(e,r)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");return typeof r!="number"?Rt+(e+1)+"G":Rt+(r+1)+";"+(e+1)+"H"};st.cursorMove=(e,r)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");let n="";return e<0?n+=Rt+-e+"D":e>0&&(n+=Rt+e+"C"),r<0?n+=Rt+-r+"A":r>0&&(n+=Rt+r+"B"),n};st.cursorUp=(e=1)=>Rt+e+"A";st.cursorDown=(e=1)=>Rt+e+"B";st.cursorForward=(e=1)=>Rt+e+"C";st.cursorBackward=(e=1)=>Rt+e+"D";st.cursorLeft=Rt+"G";st.cursorSavePosition=y9?"\x1B7":Rt+"s";st.cursorRestorePosition=y9?"\x1B8":Rt+"u";st.cursorGetPosition=Rt+"6n";st.cursorNextLine=Rt+"E";st.cursorPrevLine=Rt+"F";st.cursorHide=Rt+"?25l";st.cursorShow=Rt+"?25h";st.eraseLines=e=>{let r="";for(let n=0;n<e;n++)r+=st.eraseLine+(n<e-1?st.cursorUp():"");return e&&(r+=st.cursorLeft),r};st.eraseEndLine=Rt+"K";st.eraseStartLine=Rt+"1K";st.eraseLine=Rt+"2K";st.eraseDown=Rt+"J";st.eraseUp=Rt+"1J";st.eraseScreen=Rt+"2J";st.scrollUp=Rt+"S";st.scrollDown=Rt+"T";st.clearScreen="\x1Bc";st.clearTerminal=process.platform==="win32"?`${st.eraseScreen}${Rt}0f`:`${st.eraseScreen}${Rt}3J${Rt}H`;st.beep=qp;st.link=(e,r)=>[Ng,"8",Xx,Xx,r,qp,e,Ng,"8",Xx,Xx,qp].join("");st.image=(e,r={})=>{let n=`${Ng}1337;File=inline=1`;return r.width&&(n+=`;width=${r.width}`),r.height&&(n+=`;height=${r.height}`),r.preserveAspectRatio===!1&&(n+=";preserveAspectRatio=0"),n+":"+e.toString("base64")+qp};st.iTerm={setCwd:(e=process.cwd())=>`${Ng}50;CurrentDir=${e}${qp}`,annotation:(e,r={})=>{let n=`${Ng}1337;`,i=typeof r.x<"u",a=typeof r.y<"u";if((i||a)&&!(i&&a&&typeof r.length<"u"))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replace(/\|/g,""),n+=r.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",r.length>0?n+=(i?[e,r.length,r.x,r.y]:[r.length,e]).join("|"):n+=e,n+qp}}});var Jx=S((_At,b9)=>{"use strict";b9.exports=(e,r=process.argv)=>{let n=e.startsWith("-")?"":e.length===1?"-":"--",i=r.indexOf(n+e),a=r.indexOf("--");return i!==-1&&(a===-1||i<a)}});var gR=S((EAt,w9)=>{"use strict";var iIe=require("os"),x9=require("tty"),vs=Jx(),{env:rn}=process,Nc;vs("no-color")||vs("no-colors")||vs("color=false")||vs("color=never")?Nc=0:(vs("color")||vs("colors")||vs("color=true")||vs("color=always"))&&(Nc=1);"FORCE_COLOR"in rn&&(rn.FORCE_COLOR==="true"?Nc=1:rn.FORCE_COLOR==="false"?Nc=0:Nc=rn.FORCE_COLOR.length===0?1:Math.min(parseInt(rn.FORCE_COLOR,10),3));function hR(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function mR(e,r){if(Nc===0)return 0;if(vs("color=16m")||vs("color=full")||vs("color=truecolor"))re
|
|||
|
|
`:10,n=typeof e=="string"?"\r":13;return e[e.length-1]===r&&(e=e.slice(0,e.length-1)),e[e.length-1]===n&&(e=e.slice(0,e.length-1)),e}});var vU=S((GAt,jg)=>{"use strict";var qg=require("path"),mU=ER(),gU=e=>{e={cwd:process.cwd(),path:process.env[mU()],execPath:process.execPath,...e};let r,n=qg.resolve(e.cwd),i=[];for(;r!==n;)i.push(qg.join(n,"node_modules/.bin")),r=n,n=qg.resolve(n,"..");let a=qg.resolve(e.cwd,e.execPath,"..");return i.push(a),i.concat(e.path).join(qg.delimiter)};jg.exports=gU;jg.exports.default=gU;jg.exports.env=e=>{e={env:process.env,...e};let r={...e.env},n=mU({env:r});return e.path=r[n],r[n]=jg.exports(e),r}});var bU=S((WAt,IR)=>{"use strict";var yU=(e,r)=>{for(let n of Reflect.ownKeys(r))Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n));return e};IR.exports=yU;IR.exports.default=yU});var kR=S((HAt,ew)=>{"use strict";var FIe=bU(),Zx=new WeakMap,xU=(e,r={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let n,i=0,a=e.displayName||e.name||"<anonymous>",o=function(...c){if(Zx.set(o,++i),i===1)n=e.apply(this,c),e=null;else if(r.throw===!0)throw new Error(`Function \`${a}\` can only be called once`);return n};return FIe(o,e),Zx.set(o,i),o};ew.exports=xU;ew.exports.default=xU;ew.exports.callCount=e=>{if(!Zx.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Zx.get(e)}});var wU=S(tw=>{"use strict";Object.defineProperty(tw,"__esModule",{value:!0});tw.SIGNALS=void 0;var $Ie=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",d
|
|||
|
|
${i.message}`:D,k=[R,r,e].filter(Boolean).join(`
|
|||
|
|
`);return P?(i.originalMessage=i.message,i.message=k):i=new Error(k),i.shortMessage=R,i.command=c,i.escapedCommand=u,i.exitCode=o,i.signal=a,i.signalDescription=v,i.stdout=e,i.stderr=r,n!==void 0&&(i.all=n),"bufferedData"in i&&delete i.bufferedData,i.failed=!0,i.timedOut=!!l,i.isCanceled=f,i.killed=p&&!l,i};PU.exports=eke});var AU=S((JAt,$R)=>{"use strict";var nw=["stdin","stdout","stderr"],tke=e=>nw.some(r=>e[r]!==void 0),RU=e=>{if(!e)return;let{stdio:r}=e;if(r===void 0)return nw.map(i=>e[i]);if(tke(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${nw.map(i=>`\`${i}\``).join(", ")}`);if(typeof r=="string")return r;if(!Array.isArray(r))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof r}\``);let n=Math.max(r.length,nw.length);return Array.from({length:n},(i,a)=>r[a])};$R.exports=RU;$R.exports.node=e=>{let r=RU(e);return r==="ipc"?"ipc":r===void 0||typeof r=="string"?[r,r,r,"ipc"]:r.includes("ipc")?r:[...r,"ipc"]}});var OU=S((QAt,iw)=>{"use strict";iw.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&iw.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&iw.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var MR=S((ZAt,Vp)=>{"use strict";var ar=global.process,Dl=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"};Dl(ar)?(IU=require("assert"),Hp=OU(),kU=/^win/i.test(ar.platform),Bg=require("events"),typeof Bg!="function"&&(Bg=Bg.EventEmitter),ar.__signal_exit_emitter__?nn=ar.__signal_exit_emitter__:(nn=ar.__signal_exit_emitter__=new Bg,nn.count=0,nn.emitted={}),nn.infinite||(nn.setMaxListeners(1/0),nn.infinite=!0),Vp.exports=function(e,r){if(!Dl(global.process))return function(){};IU.equal(typeof e,"function","a callback must be provided for exit handler"),zp===!1&&LR();var n="exit";r&&r.alwaysLast&&(n="afterexit");var i=function(){nn.removeListener(n,e),nn.listeners("exit").length===0&&nn.listeners("afterexit").length===0&&sw()};return nn.on(n,e),i},sw=function(){!zp||!Dl(global.process)||(zp=!1,Hp.forEach(function(r){try{ar.removeListener(r,aw[r])}catch{}}),ar.emit=ow,ar.reallyExit=NR,nn.count-=1)},Vp.exports.unload=sw,Cl=function(r,n,i){nn.emitted[r]||(nn.emitted[r]=!0,nn.emit(r,n,i))},aw={},Hp.forEach(function(e){aw[e]=function(){if(Dl(global.process)){var n=ar.listeners(e);n.length===nn.count&&(sw(),Cl("exit",null,e),Cl("afterexit",null,e),kU&&e==="SIGHUP"&&(e="SIGINT"),ar.kill(ar.pid,e))}}}),Vp.exports.signals=function(){return Hp},zp=!1,LR=function(){zp||!Dl(global.process)||(zp=!0,nn.count+=1,Hp=Hp.filter(function(r){try{return ar.on(r,aw[r]),!0}catch{return!1}}),ar.emit=$U,ar.reallyExit=FU)},Vp.exports.load=LR,NR=ar.reallyExit,FU=function(r){Dl(global.process)&&(ar.exitCode=r||0,Cl("exit",ar.exitCode,null),Cl("afterexit",ar.exitCode,null),NR.call(ar,ar.exitCode))},ow=ar.emit,$U=function(r,n){if(r==="exit"&&Dl(global.process)){n!==void 0&&(ar.exitCode=n);var i=ow.apply(this,arguments);return Cl("exit",ar.exitCode,null),Cl("afterexit",ar.exitCode,null),i}else return ow.apply(this,arguments)}):Vp.exports=function(){return function(){}};var IU,Hp,kU,Bg,nn,sw,Cl,aw,zp,LR,NR,FU,ow,$U});var NU=S((eOt,LU)=>{"use strict";var rke=require("os"),nke=MR(),ike=1e3*5,ske=(e,r="SIGTERM",n={})=>{let i=e(r);return ake(e,r,n,i),i},ake=(e,r,n,i)=>{if(!oke(r,n,i))return;let a=uke(n),o=setTimeout(()=>{e("SIGKILL")},a);o.unref&&o.unref()},oke=(e,{forceKillAfterTimeout:r},n)=>cke(e)&&r!==!1&&n,cke=e=>e===rke.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",uke=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return ike;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},lke=(e,r)=>{e.kill()&&(r.isCanceled=!0)},fke
|
|||
|
|
globstar while`,r,g,n,v,x),this.matchOne(r.slice(g),n.slice(v),i))return this.debug("globstar found match!",g,u,x),!0;if(x==="."||x===".."||!a.dot&&x.charAt(0)==="."){this.debug("dot detected!",r,g,n,v);break}this.debug("globstar swallow a segment, and continue"),g++}return!!(i&&(this.debug(`
|
|||
|
|
>>> no match, partial?`,r,g,n,v),g===u))}var E;if(typeof f=="string"?(E=p===f,this.debug("string match",f,p,E)):(E=p.match(f),this.debug("pattern match",f,p,E)),!E)return!1}if(o===u&&c===l)return!0;if(o===u)return i;if(c===l)return o===u-1&&r[o]==="";throw new Error("wtf?")}braceExpand(){return J7(this.pattern,this.options)}parse(r,n){Aw(r);let i=this.options;if(r==="**")if(i.noglobstar)r="*";else return ta;if(r==="")return"";let a="",o=!!i.nocase,c=!1,u=[],l=[],f,p=!1,g=-1,v=-1,x,E,D,P=r.charAt(0)==="."?"":i.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",R=()=>{if(f){switch(f){case"*":a+=n2,o=!0;break;case"?":a+=s2,o=!0;break;default:a+="\\"+f;break}this.debug("clearStateChar %j %j",f,a),f=!1}};for(let L=0,U;L<r.length&&(U=r.charAt(L));L++){if(this.debug("%s %s %s %j",r,L,a,U),c){if(U==="/")return!1;Y7[U]&&(a+="\\"),a+=U,c=!1;continue}switch(U){case"/":return!1;case"\\":R(),c=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s %s %s %j <-- stateChar",r,L,a,U),p){this.debug(" in class"),U==="!"&&L===v+1&&(U="^"),a+=U;continue}this.debug("call clearStateChar %j",f),R(),f=U,i.noext&&R();continue;case"(":if(p){a+="(";continue}if(!f){a+="\\(";continue}u.push({type:f,start:L-1,reStart:a.length,open:V7[f].open,close:V7[f].close}),a+=f==="!"?"(?:(?!(?:":"(?:",this.debug("plType %j %j",f,a),f=!1;continue;case")":if(p||!u.length){a+="\\)";continue}R(),o=!0,E=u.pop(),a+=E.close,E.type==="!"&&l.push(E),E.reEnd=a.length;continue;case"|":if(p||!u.length){a+="\\|";continue}R(),a+="|";continue;case"[":if(R(),p){a+="\\"+U;continue}p=!0,v=L,g=a.length,a+=U;continue;case"]":if(L===v+1||!p){a+="\\"+U;continue}x=r.substring(v+1,L);try{RegExp("["+x+"]")}catch{D=this.parse(x,Rw),a=a.substr(0,g)+"\\["+D[0]+"\\]",o=o||D[1],p=!1;continue}o=!0,p=!1,a+=U;continue;default:R(),Y7[U]&&!(U==="^"&&p)&&(a+="\\"),a+=U;break}}for(p&&(x=r.substr(v+1),D=this.parse(x,Rw),a=a.substr(0,g)+"\\["+D[0],o=o||D[1]),E=u.pop();E;E=u.pop()){let L;L=a.slice(E.reStart+E.open.length),this.debug("setting tail",a,E),L=L.replace(/((?:\\{2}){0,64})(\\?)\|/g,(V,j,W)=>(W||(W="\\"),j+j+W+"|")),this.debug(`tail=%j
|
|||
|
|
%s`,L,L,E,a);let U=E.type==="*"?n2:E.type==="?"?s2:"\\"+E.type;o=!0,a=a.slice(0,E.reStart)+U+"\\("+L}R(),c&&(a+="\\\\");let k=f$e[a.charAt(0)];for(let L=l.length-1;L>-1;L--){let U=l[L],V=a.slice(0,U.reStart),j=a.slice(U.reStart,U.reEnd-8),W=a.slice(U.reEnd),q=a.slice(U.reEnd-8,U.reEnd)+W,X=V.split("(").length-1,M=W;for(let ee=0;ee<X;ee++)M=M.replace(/\)[+*?]?/,"");W=M;let Q=W===""&&n!==Rw?"$":"";a=V+j+W+Q+q}if(a!==""&&o&&(a="(?=.)"+a),k&&(a=P+a),n===Rw)return[a,o];if(!o)return d$e(r);let F=i.nocase?"i":"";try{return Object.assign(new RegExp("^"+a+"$",F),{_glob:r,_src:a})}catch{return new RegExp("$.")}}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let r=this.set;if(!r.length)return this.regexp=!1,this.regexp;let n=this.options,i=n.noglobstar?n2:n.dot?u$e:l$e,a=n.nocase?"i":"",o=r.map(c=>(c=c.map(u=>typeof u=="string"?h$e(u):u===ta?ta:u._src).reduce((u,l)=>(u[u.length-1]===ta&&l===ta||u.push(l),u),[]),c.forEach((u,l)=>{u!==ta||c[l-1]===ta||(l===0?c.length>1?c[l+1]="(?:\\/|"+i+"\\/)?"+c[l+1]:c[l]=i:l===c.length-1?c[l-1]+="(?:\\/|"+i+")?":(c[l-1]+="(?:\\/|\\/"+i+"\\/)"+c[l+1],c[l+1]=ta))}),c.filter(u=>u!==ta).join("/"))).join("|");o="^(?:"+o+")$",this.negate&&(o="^(?!"+o+").*$");try{this.regexp=new RegExp(o,a)}catch{this.regexp=!1}return this.regexp}match(r,n=this.partial){if(this.debug("match",r,this.pattern),this.comment)return!1;if(this.empty)return r==="";if(r==="/"&&n)return!0;let i=this.options;i2.sep!=="/"&&(r=r.split(i2.sep).join("/")),r=r.split(K7),this.debug(this.pattern,"split",r);let a=this.set;this.debug(this.pattern,"set",a);let o;for(let c=r.length-1;c>=0&&(o=r[c],!o);c--);for(let c=0;c<a.length;c++){let u=a[c],l=r;if(i.matchBase&&u.length===1&&(l=[o]),this.matchOne(l,u,n))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(r){return qi.defaults(r).Minimatch}};qi.Minimatch=Zp});var o2=S(Z7=>{"use strict";var m$e=Q7().Minimatch,g$e=(e,r)=>{let n=r.indexOf("/")!==-1,i=/^!?\//.test(r),a=/^!/.test(r),o;if(!i&&n){let c=r.replace(/^!/,"").replace(/^\.\//,"");return/\/$/.test(e)?o="":o="/",a?`!${e}${o}${c}`:`${e}${o}${c}`}return r};Z7.create=(e,r,n)=>{let i;typeof r=="string"?i=[r]:i=r;let a=i.map(c=>g$e(e,c)).map(c=>new m$e(c,{matchBase:!0,nocomment:!0,nocase:n||!1,dot:!0,windowsPathsNoEscape:!0}));return c=>{let u="matching",l=!1,f,p;for(p=0;p<a.length;p+=1){if(f=a[p],f.negate&&(u="negation",p===0&&(l=!0)),u==="negation"&&l&&!f.match(c))return!1;u==="matching"&&!l&&(l=f.match(c))}return l}}});var cG=S(Ow=>{"use strict";var v$e=require("path"),tG=Tw(),rG=Qp(),nG=o2(),eG=Sn(),y$e=(e,r,n)=>{let i=`${e}([path], options)`;eG.argument(i,"path",r,["string"]),eG.options(i,"options",n,{matching:["string","array of string"],filter:["function"],files:["boolean"],directories:["boolean"],recursive:["boolean"],ignoreCase:["boolean"]})},iG=e=>{let r=e||{};return r.matching===void 0&&(r.matching="*"),r.files===void 0&&(r.files=!0),r.ignoreCase===void 0&&(r.ignoreCase=!1),r.directories===void 0&&(r.directories=!1),r.recursive===void 0&&(r.recursive=!0),r},sG=(e,r)=>e.map(n=>v$e.relative(r,n)),aG=e=>{let r=new Error(`Path you want to find stuff in doesn't exist ${e}`);return r.code="ENOENT",r},oG=e=>{let r=new Error(`Path you want to find stuff in must be a directory ${e}`);return r.code="ENOTDIR",r},b$e=(e,r)=>{let n=[],i=nG.create(e,r.matching,r.ignoreCase),a=1/0;return r.recursive===!1&&(a=1),tG.sync(e,{maxLevelsDeep:a,symlinks:"follow",inspectOptions:{times:!0,absolutePath:!0}},(o,c)=>{c&&o!==e&&i(o)&&(c.type==="file"&&r.files===!0||c.type==="dir"&&r.directories===!0)&&(r.filter?r.filter(c)&&n.push(o):n.push(o))}),n.sort(),sG(n,r.cwd)},x$e=(e,r)=>{let n=rG.sync(e,{symlinks:"follow"});if(n===void 0)throw aG(e);if(n.type!=="dir")throw oG(e);return b$e(e,iG(r))},w$e=(e,r)=>new Promise((n,i)=>{let a=[],o=nG.create(e,r.matching,r.ignoreCase),c=1/0;r.recursive===!1&&(c=1);let u=0,l=!1,f=()=>{l&&u===0&&(a.sort(),n(sG(a,r.cwd)))};tG.async(e,{maxLevelsDeep:c,symlinks:"follow",inspectOptions:{times:!0,absolutePath:!0}},(p,g)=>{if(g&&p!==e&&o(p)&&(g.type==="file"&&r.files===!0||g.type==
|
|||
|
|
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var QW=S((oIt,JW)=>{"use strict";var cLe=m1(),{MAX_LENGTH:YW,CHAR_BACKSLASH:O2,CHAR_BACKTICK:uLe,CHAR_COMMA:lLe,CHAR_DOT:fLe,CHAR_LEFT_PARENTHESES:pLe,CHAR_RIGHT_PARENTHESES:dLe,CHAR_LEFT_CURLY_BRACE:hLe,CHAR_RIGHT_CURLY_BRACE:mLe,CHAR_LEFT_SQUARE_BRACKET:KW,CHAR_RIGHT_SQUARE_BRACKET:XW,CHAR_DOUBLE_QUOTE:gLe,CHAR_SINGLE_QUOTE:vLe,CHAR_NO_BREAK_SPACE:yLe,CHAR_ZERO_WIDTH_NOBREAK_SPACE:bLe}=VW(),xLe=(e,r={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let n=r||{},i=typeof n.maxLength=="number"?Math.min(YW,n.maxLength):YW;if(e.length>i)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${i})`);let a={type:"root",input:e,nodes:[]},o=[a],c=a,u=a,l=0,f=e.length,p=0,g=0,v,x={},E=()=>e[p++],D=P=>{if(P.type==="text"&&u.type==="dot"&&(u.type="text"),u&&u.type==="text"&&P.type==="text"){u.value+=P.value;return}return c.nodes.push(P),P.parent=c,P.prev=u,u=P,P};for(D({type:"bos"});p<f;)if(c=o[o.length-1],v=E(),!(v===bLe||v===yLe)){if(v===O2){D({type:"text",value:(r.keepEscaping?v:"")+E()});continue}if(v===XW){D({type:"text",value:"\\"+v});continue}if(v===KW){l++;let P=!0,R;for(;p<f&&(R=E());){if(v+=R,R===KW){l++;continue}if(R===O2){v+=E();continue}if(R===XW&&(l--,l===0))break}D({type:"text",value:v});continue}if(v===pLe){c=D({type:"paren",nodes:[]}),o.push(c),D({type:"text",value:v});continue}if(v===dLe){if(c.type!=="paren"){D({type:"text",value:v});continue}c=o.pop(),D({type:"text",value:v}),c=o[o.length-1];continue}if(v===gLe||v===vLe||v===uLe){let P=v,R;for(r.keepQuotes!==!0&&(v="");p<f&&(R=E());){if(R===O2){v+=R+E();continue}if(R===P){r.keepQuotes===!0&&(v+=R);break}v+=R}D({type:"text",value:v});continue}if(v===hLe){g++;let R={type:"brace",open:!0,close:!1,dollar:u.value&&u.value.slice(-1)==="$"||c.dollar===!0,depth:g,commas:0,ranges:0,nodes:[]};c=D(R),o.push(c),D({type:"open",value:v});continue}if(v===mLe){if(c.type!=="brace"){D({type:"text",value:v});continue}let P="close";c=o.pop(),c.close=!0,D({type:P,value:v}),g--,c=o[o.length-1];continue}if(v===lLe&&g>0){if(c.ranges>0){c.ranges=0;let P=c.nodes.shift();c.nodes=[P,{type:"text",value:cLe(c)}]}D({type:"comma",value:v}),c.commas++;continue}if(v===fLe&&g>0&&c.commas===0){let P=c.nodes;if(g===0||P.length===0){D({type:"text",value:v});continue}if(u.type==="dot"){if(c.range=[],u.value+=v,u.type="range",c.nodes.length!==3&&c.nodes.length!==5){c.invalid=!0,c.ranges=0,u.type="text";continue}c.ranges++,c.args=[];continue}if(u.type==="range"){P.pop();let R=P[P.length-1];R.value+=u.value+v,u=R,c.ranges--;continue}D({type:"dot",value:v});continue}D({type:"text",value:v})}do if(c=o.pop(),c.type!=="root"){c.nodes.forEach(k=>{k.nodes||(k.type==="open"&&(k.isOpen=!0),k.type==="close"&&(k.isClose=!0),k.nodes||(k.type="text"),k.invalid=!0)});let P=o[o.length-1],R=P.nodes.indexOf(c);P.nodes.splice(R,1,...c.nodes)}while(o.length>0);return D({type:"eos"}),a};JW.exports=xLe});var I2=S((cIt,eH)=>{"use strict";var ZW=m1(),wLe=UW(),_Le=HW(),ELe=QW(),Bi=(e,r={})=>{let n=[];if(Array.isArray(e))for(let i of e){let a=Bi.create(i,r);Array.isArray(a)?n.push(...a):n.push(a)}else n=[].concat(Bi.create(e,r));return r&&r.expand===!0&&r.nodupes===!0&&(n=[...new Set(n)]),n};Bi.parse=(e,r={})=>ELe(e,r);Bi.stringify=(e,r={})=>ZW(typeof e=="string"?Bi.parse(e,r):e,r);Bi.compile=(e,r={})=>(typeof e=="string"&&(e=Bi.parse(e,r)),wLe(e,r));Bi.expand=(e,r={})=>{typeof e=="string"&&(e=Bi.parse(e,r));let n=_Le(e,r);return r.noempty===!0&&(n=n.filter(Boolean)),r.nodupes===!0&&(n=[...new Set(n)]),n};Bi.create=(e,r={})=>e===""||e.length<3?[e]:r.expand!==!0?Bi.compile(e,r):Bi.expand(e,r);eH.exports=Bi});var Qg=S((uIt,sH)=>{"use strict";var SLe=require("path"),Wa="\\\\/",tH=`[^${Wa}]`,Io="\\.",DLe="\\+",CLe="\\?",y1="\\/",PLe="(?=.)",rH="[^/]",k2=`(?:${y1}|$)`,nH=`(?:
|
|||
|
|
GFS4: `),console.error(e)});lr[Dn]||(SV=global[Dn]||[],CV(lr,SV),lr.close=function(e){function r(n,i){return e.call(lr,n,function(a){a||DV(),typeof i=="function"&&i.apply(this,arguments)})}return Object.defineProperty(r,Q1,{value:e}),r}(lr.close),lr.closeSync=function(e){function r(n){e.apply(lr,arguments),DV()}return Object.defineProperty(r,Q1,{value:e}),r}(lr.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Ll(lr[Dn]),require("assert").equal(lr[Dn].length,0)}));var SV;global[Dn]||CV(global,lr[Dn]);DO.exports=EO(l4e(lr));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!lr.__patched&&(DO.exports=EO(lr),lr.__patched=!0);function EO(e){c4e(e),e.gracefulify=EO,e.createReadStream=U,e.createWriteStream=V;var r=e.readFile;e.readFile=n;function n(q,X,M){return typeof X=="function"&&(M=X,X=null),Q(q,X,M);function Q(ee,ce,H,Y){return r(ee,ce,function(ie){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?cd([Q,[ee,ce,H],ie,Y||Date.now(),Date.now()]):typeof H=="function"&&H.apply(this,arguments)})}}var i=e.writeFile;e.writeFile=a;function a(q,X,M,Q){return typeof M=="function"&&(Q=M,M=null),ee(q,X,M,Q);function ee(ce,H,Y,ie,ae){return i(ce,H,Y,function(le){le&&(le.code==="EMFILE"||le.code==="ENFILE")?cd([ee,[ce,H,Y,ie],le,ae||Date.now(),Date.now()]):typeof ie=="function"&&ie.apply(this,arguments)})}}var o=e.appendFile;o&&(e.appendFile=c);function c(q,X,M,Q){return typeof M=="function"&&(Q=M,M=null),ee(q,X,M,Q);function ee(ce,H,Y,ie,ae){return o(ce,H,Y,function(le){le&&(le.code==="EMFILE"||le.code==="ENFILE")?cd([ee,[ce,H,Y,ie],le,ae||Date.now(),Date.now()]):typeof ie=="function"&&ie.apply(this,arguments)})}}var u=e.copyFile;u&&(e.copyFile=l);function l(q,X,M,Q){return typeof M=="function"&&(Q=M,M=0),ee(q,X,M,Q);function ee(ce,H,Y,ie,ae){return u(ce,H,Y,function(le){le&&(le.code==="EMFILE"||le.code==="ENFILE")?cd([ee,[ce,H,Y,ie],le,ae||Date.now(),Date.now()]):typeof ie=="function"&&ie.apply(this,arguments)})}}var f=e.readdir;e.readdir=g;var p=/^v[0-5]\./;function g(q,X,M){typeof X=="function"&&(M=X,X=null);var Q=p.test(process.version)?function(H,Y,ie,ae){return f(H,ee(H,Y,ie,ae))}:function(H,Y,ie,ae){return f(H,Y,ee(H,Y,ie,ae))};return Q(q,X,M);function ee(ce,H,Y,ie){return function(ae,le){ae&&(ae.code==="EMFILE"||ae.code==="ENFILE")?cd([Q,[ce,H,Y],ae,ie||Date.now(),Date.now()]):(le&&le.sort&&le.sort(),typeof Y=="function"&&Y.call(this,ae,le))}}}if(process.version.substr(0,4)==="v0.8"){var v=u4e(e);R=v.ReadStream,F=v.WriteStream}var x=e.ReadStream;x&&(R.prototype=Object.create(x.prototype),R.prototype.open=k);var E=e.WriteStream;E&&(F.prototype=Object.create(E.prototype),F.prototype.open=L),Object.defineProperty(e,"ReadStream",{get:function(){return R},set:function(q){R=q},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return F},set:function(q){F=q},enumerable:!0,configurable:!0});var D=R;Object.defineProperty(e,"FileReadStream",{get:function(){return D},set:function(q){D=q},enumerable:!0,configurable:!0});var P=F;Object.defineProperty(e,"FileWriteStream",{get:function(){return P},set:function(q){P=q},enumerable:!0,configurable:!0});function R(q,X){return this instanceof R?(x.apply(this,arguments),this):R.apply(Object.create(R.prototype),arguments)}function k(){var q=this;W(q.path,q.flags,q.mode,function(X,M){X?(q.autoClose&&q.destroy(),q.emit("error",X)):(q.fd=M,q.emit("open",M),q.read())})}function F(q,X){return this instanceof F?(E.apply(this,arguments),this):F.apply(Object.create(F.prototype),arguments)}function L(){var q=this;W(q.path,q.flags,q.mode,function(X,M){X?(q.destroy(),q.emit("error",X)):(q.fd=M,q.emit("open",M))})}function U(q,X){return new e.ReadStream(q,X)}function V(q,X){return new e.WriteStream(q,X)}var j=e.open;e.open=W;function W(q,X,M,Q){return typeof M=="function"&&(Q=M,M=null),ee(q,X,M,Q);function ee(ce,H,Y,ie,ae){return j(ce,H,Y,function(le,$t){le&&(le.code==="EMFILE"||le.code==="ENFILE")?cd([ee,[ce,H,Y,ie],le,ae||Date.now(),Date.now()]):typeof ie=="function"&&ie.apply(this,arguments)})}}return e}function cd(e){Ll("ENQUEUE",e[0].name,e[1]),l
|
|||
|
|
%s`,U,U,k,i);var V=k.type==="*"?FO:k.type==="?"?kO:"\\"+k.type;a=!0,i=i.slice(0,k.reStart)+V+"\\("+U}E(),o&&(i+="\\\\");var j=!1;switch(i.charAt(0)){case"[":case".":case"(":j=!0}for(var W=u.length-1;W>-1;W--){var q=u[W],X=i.slice(0,q.reStart),M=i.slice(q.reStart,q.reEnd-8),Q=i.slice(q.reEnd-8,q.reEnd),ee=i.slice(q.reEnd);Q+=ee;var ce=X.split("(").length-1,H=ee;for(D=0;D<ce;D++)H=H.replace(/\)[+*?]?/,"");ee=H;var Y="";ee===""&&r!==Z1&&(Y="$");var ie=X+M+ee+Y+Q;i=ie}if(i!==""&&a&&(i="(?=.)"+i),j&&(i=v+i),r===Z1)return[i,a];if(!a)return M4e(e);var ae=n.nocase?"i":"";try{var le=new RegExp("^"+i+"$",ae)}catch{return new RegExp("$.")}return le._glob=e,le._src=i,le}Gi.makeRe=function(e,r){return new Cn(e,r||{}).makeRe()};Cn.prototype.makeRe=N4e;function N4e(){if(this.regexp||this.regexp===!1)return this.regexp;var e=this.set;if(!e.length)return this.regexp=!1,this.regexp;var r=this.options,n=r.noglobstar?FO:r.dot?R4e:A4e,i=r.nocase?"i":"",a=e.map(function(o){return o.map(function(c){return c===$O?n:typeof c=="string"?q4e(c):c._src}).join("\\/")}).join("|");a="^(?:"+a+")$",this.negate&&(a="^(?!"+a+").*$");try{this.regexp=new RegExp(a,i)}catch{this.regexp=!1}return this.regexp}Gi.match=function(e,r,n){n=n||{};var i=new Cn(r,n);return e=e.filter(function(a){return i.match(a)}),i.options.nonull&&!e.length&&e.push(r),e};Cn.prototype.match=function(r,n){if(typeof n>"u"&&(n=this.partial),this.debug("match",r,this.pattern),this.comment)return!1;if(this.empty)return r==="";if(r==="/"&&n)return!0;var i=this.options;av.sep!=="/"&&(r=r.split(av.sep).join("/")),r=r.split(YV),this.debug(this.pattern,"split",r);var a=this.set;this.debug(this.pattern,"set",a);var o,c;for(c=r.length-1;c>=0&&(o=r[c],!o);c--);for(c=0;c<a.length;c++){var u=a[c],l=r;i.matchBase&&u.length===1&&(l=[o]);var f=this.matchOne(l,u,n);if(f)return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate};Cn.prototype.matchOne=function(e,r,n){var i=this.options;this.debug("matchOne",{this:this,file:e,pattern:r}),this.debug("matchOne",e.length,r.length);for(var a=0,o=0,c=e.length,u=r.length;a<c&&o<u;a++,o++){this.debug("matchOne loop");var l=r[o],f=e[a];if(this.debug(r,l,f),l===!1)return!1;if(l===$O){this.debug("GLOBSTAR",[r,l,f]);var p=a,g=o+1;if(g===u){for(this.debug("** at the end");a<c;a++)if(e[a]==="."||e[a]===".."||!i.dot&&e[a].charAt(0)===".")return!1;return!0}for(;p<c;){var v=e[p];if(this.debug(`
|
|||
|
|
globstar while`,e,p,r,g,v),this.matchOne(e.slice(p),r.slice(g),n))return this.debug("globstar found match!",p,c,v),!0;if(v==="."||v===".."||!i.dot&&v.charAt(0)==="."){this.debug("dot detected!",e,p,r,g);break}this.debug("globstar swallow a segment, and continue"),p++}return!!(n&&(this.debug(`
|
|||
|
|
>>> no match, partial?`,e,p,r,g),p===c))}var x;if(typeof l=="string"?(x=f===l,this.debug("string match",l,f,x)):(x=f.match(l),this.debug("pattern match",l,f,x)),!x)return!1}if(a===c&&o===u)return!0;if(a===c)return n;if(o===u)return a===c-1&&e[a]==="";throw new Error("wtf?")};function M4e(e){return e.replace(/\\(.)/g,"$1")}function q4e(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var JV=S((Rkt,LO)=>{"use strict";typeof Object.create=="function"?LO.exports=function(r,n){n&&(r.super_=n,r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:LO.exports=function(r,n){if(n){r.super_=n;var i=function(){};i.prototype=n.prototype,r.prototype=new i,r.prototype.constructor=r}}});var ei=S((Akt,MO)=>{"use strict";try{if(NO=require("util"),typeof NO.inherits!="function")throw"";MO.exports=NO.inherits}catch{MO.exports=JV()}var NO});var n_=S((Okt,r_)=>{"use strict";function QV(e){return e.charAt(0)==="/"}function ZV(e){var r=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,n=r.exec(e),i=n[1]||"",a=!!(i&&i.charAt(1)!==":");return!!(n[2]||a)}r_.exports=process.platform==="win32"?ZV:QV;r_.exports.posix=QV;r_.exports.win32=ZV});var jO=S(Jc=>{"use strict";Jc.setopts=H4e;Jc.ownProp=eY;Jc.makeAbs=ov;Jc.finish=z4e;Jc.mark=V4e;Jc.isIgnored=rY;Jc.childrenIgnored=Y4e;function eY(e,r){return Object.prototype.hasOwnProperty.call(e,r)}var j4e=require("fs"),fd=require("path"),B4e=t_(),tY=n_(),qO=B4e.Minimatch;function U4e(e,r){return e.localeCompare(r,"en")}function G4e(e,r){e.ignore=r.ignore||[],Array.isArray(e.ignore)||(e.ignore=[e.ignore]),e.ignore.length&&(e.ignore=e.ignore.map(W4e))}function W4e(e){var r=null;if(e.slice(-3)==="/**"){var n=e.replace(/(\/\*\*)+$/,"");r=new qO(n,{dot:!0})}return{matcher:new qO(e,{dot:!0}),gmatcher:r}}function H4e(e,r,n){if(n||(n={}),n.matchBase&&r.indexOf("/")===-1){if(n.noglobstar)throw new Error("base matching requires globstar");r="**/"+r}e.silent=!!n.silent,e.pattern=r,e.strict=n.strict!==!1,e.realpath=!!n.realpath,e.realpathCache=n.realpathCache||Object.create(null),e.follow=!!n.follow,e.dot=!!n.dot,e.mark=!!n.mark,e.nodir=!!n.nodir,e.nodir&&(e.mark=!0),e.sync=!!n.sync,e.nounique=!!n.nounique,e.nonull=!!n.nonull,e.nosort=!!n.nosort,e.nocase=!!n.nocase,e.stat=!!n.stat,e.noprocess=!!n.noprocess,e.absolute=!!n.absolute,e.fs=n.fs||j4e,e.maxLength=n.maxLength||1/0,e.cache=n.cache||Object.create(null),e.statCache=n.statCache||Object.create(null),e.symlinks=n.symlinks||Object.create(null),G4e(e,n),e.changedCwd=!1;var i=process.cwd();eY(n,"cwd")?(e.cwd=fd.resolve(n.cwd),e.changedCwd=e.cwd!==i):e.cwd=i,e.root=n.root||fd.resolve(e.cwd,"/"),e.root=fd.resolve(e.root),process.platform==="win32"&&(e.root=e.root.replace(/\\/g,"/")),e.cwdAbs=tY(e.cwd)?e.cwd:ov(e,e.cwd),process.platform==="win32"&&(e.cwdAbs=e.cwdAbs.replace(/\\/g,"/")),e.nomount=!!n.nomount,n.nonegate=!0,n.nocomment=!0,n.allowWindowsEscape=!1,e.minimatch=new qO(r,n),e.options=e.minimatch.options}function z4e(e){for(var r=e.nounique,n=r?[]:Object.create(null),i=0,a=e.matches.length;i<a;i++){var o=e.matches[i];if(!o||Object.keys(o).length===0){if(e.nonull){var c=e.minimatch.globSet[i];r?n.push(c):n[c]=!0}}else{var u=Object.keys(o);r?n.push.apply(n,u):u.forEach(function(l){n[l]=!0})}}if(r||(n=Object.keys(n)),e.nosort||(n=n.sort(U4e)),e.mark){for(var i=0;i<n.length;i++)n[i]=e._mark(n[i]);e.nodir&&(n=n.filter(function(l){var f=!/\/$/.test(l),p=e.cache[l]||e.cache[ov(e,l)];return f&&p&&(f=p!=="DIR"&&!Array.isArray(p)),f}))}e.ignore.length&&(n=n.filter(function(l){return!rY(e,l)})),e.found=n}function V4e(e,r){var n=ov(e,r),i=e.cache[n],a=r;if(i){var o=i==="DIR"||Array.isArray(i),c=r.slice(-1)==="/";if(o&&!c?a+="/":!o&&c&&(a=a.slice(0,-1)),a!==r){var u=ov(e,a);e.statCache[u]=e.statCache[n],e.cache[u]=e.cache[n]}}return a}function ov(e,r){var n=r;return r.charAt(0)==="/"?n=fd.join(e.root,r):tY(r)||r===""?n=r:e.changedCwd?n=fd.resolve(e.cwd,r):n=fd.resolve(r),process.platform==="win32"&&(n=n.replace(/\\/g,"/")),n}function rY(e,r){return e.ignore.length?e.ignore.some(function(n){return n.
|
|||
|
|
See: https://github.com/isaacs/node-glob/issues/167`);return new zr(e,r).found}function zr(e,r){if(!e)throw new Error("must provide pattern");if(typeof r=="function"||arguments.length===3)throw new TypeError(`callback provided to sync glob
|
|||
|
|
See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof zr))return new zr(e,r);if(X4e(this,e,r),this.noprocess)return this;var n=this.minimatch.set.length;this.matches=new Array(n);for(var i=0;i<n;i++)this._process(this.minimatch.set[i],i,!1);this._finish()}zr.prototype._finish=function(){if(iY.ok(this instanceof zr),this.realpath){var e=this;this.matches.forEach(function(r,n){var i=e.matches[n]=Object.create(null);for(var a in r)try{a=e._makeAbs(a);var o=K4e.realpathSync(a,e.realpathCache);i[o]=!0}catch(c){if(c.syscall==="stat")i[e._makeAbs(a)]=!0;else throw c}})}Ml.finish(this)};zr.prototype._process=function(e,r,n){iY.ok(this instanceof zr);for(var i=0;typeof e[i]=="string";)i++;var a;switch(i){case e.length:this._processSimple(e.join("/"),r);return;case 0:a=null;break;default:a=e.slice(0,i).join("/");break}var o=e.slice(i),c;a===null?c=".":((i_(a)||i_(e.map(function(f){return typeof f=="string"?f:"[*]"}).join("/")))&&(!a||!i_(a))&&(a="/"+a),c=a);var u=this._makeAbs(c);if(!J4e(this,c)){var l=o[0]===nY.GLOBSTAR;l?this._processGlobStar(a,c,u,o,r,n):this._processReaddir(a,c,u,o,r,n)}};zr.prototype._processReaddir=function(e,r,n,i,a,o){var c=this._readdir(n,o);if(c){for(var u=i[0],l=!!this.minimatch.negate,f=u._glob,p=this.dot||f.charAt(0)===".",g=[],v=0;v<c.length;v++){var x=c[v];if(x.charAt(0)!=="."||p){var E;l&&!e?E=!x.match(u):E=x.match(u),E&&g.push(x)}}var D=g.length;if(D!==0){if(i.length===1&&!this.mark&&!this.stat){this.matches[a]||(this.matches[a]=Object.create(null));for(var v=0;v<D;v++){var x=g[v];e&&(e.slice(-1)!=="/"?x=e+"/"+x:x=e+x),x.charAt(0)==="/"&&!this.nomount&&(x=BO.join(this.root,x)),this._emitMatch(a,x)}return}i.shift();for(var v=0;v<D;v++){var x=g[v],P;e?P=[e,x]:P=[x],this._process(P.concat(i),a,o)}}}};zr.prototype._emitMatch=function(e,r){if(!Q4e(this,r)){var n=this._makeAbs(r);if(this.mark&&(r=this._mark(r)),this.absolute&&(r=n),!this.matches[e][r]){if(this.nodir){var i=this.cache[n];if(i==="DIR"||Array.isArray(i))return}this.matches[e][r]=!0,this.stat&&this._stat(r)}}};zr.prototype._readdirInGlobStar=function(e){if(this.follow)return this._readdir(e,!1);var r,n,i;try{n=this.fs.lstatSync(e)}catch(o){if(o.code==="ENOENT")return null}var a=n&&n.isSymbolicLink();return this.symlinks[e]=a,!a&&n&&!n.isDirectory()?this.cache[e]="FILE":r=this._readdir(e,!1),r};zr.prototype._readdir=function(e,r){var n;if(r&&!UO(this.symlinks,e))return this._readdirInGlobStar(e);if(UO(this.cache,e)){var i=this.cache[e];if(!i||i==="FILE")return null;if(Array.isArray(i))return i}try{return this._readdirEntries(e,this.fs.readdirSync(e))}catch(a){return this._readdirError(e,a),null}};zr.prototype._readdirEntries=function(e,r){if(!this.mark&&!this.stat)for(var n=0;n<r.length;n++){var i=r[n];e==="/"?i=e+i:i=e+"/"+i,this.cache[i]=!0}return this.cache[e]=r,r};zr.prototype._readdirError=function(e,r){switch(r.code){case"ENOTSUP":case"ENOTDIR":var n=this._makeAbs(e);if(this.cache[n]="FILE",n===this.cwdAbs){var i=new Error(r.code+" invalid cwd "+this.cwd);throw i.path=this.cwd,i.code=r.code,i}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=!1;break;default:if(this.cache[this._makeAbs(e)]=!1,this.strict)throw r;this.silent||console.error("glob error",r);break}};zr.prototype._processGlobStar=function(e,r,n,i,a,o){var c=this._readdir(n,o);if(c){var u=i.slice(1),l=e?[e]:[],f=l.concat(u);this._process(f,a,!1);var p=c.length,g=this.symlinks[n];if(!(g&&o))for(var v=0;v<p;v++){var x=c[v];if(!(x.charAt(0)==="."&&!this.dot)){var E=l.concat(c[v],u);this._process(E,a,!0);var D=l.concat(c[v],i);this._process(D,a,!0)}}}};zr.prototype._processSimple=function(e,r){var n=this._stat(e);if(this.matches[r]||(this.matches[r]=Object.create(null)),!!n){if(e&&i_(e)&&!this.nomount){var i=/[\/\\]$/.test(e);e.charAt(0)==="/"?e=BO.join(this.root,e):(e=BO.resolve(this.root,e),i&&(e+="/"))}process.platform==="win32"&&(e=e.replace(/\\/g,"/")),this._emitMatch(r,e)}};zr.prototype._stat=function(e){var r=this._makeAbs(e),n=e.slice(-1)==="/";if(e.length>this.maxLength)return!1;if(!this.stat&&UO(this.cach
|
|||
|
|
`).filter(n=>{let i=n.match(SY);if(i===null||!i[1])return!0;let a=i[1];return a.includes(".app/Contents/Resources/electron.asar")||a.includes(".app/Contents/Resources/default_app.asar")?!1:!v6e.test(a)}).filter(n=>n.trim()!=="").map(n=>r.pretty?n.replace(SY,(i,a)=>i.replace(a,a.replace(y6e,"~"))):n).join(`
|
|||
|
|
`))});var TY=S((zkt,PY)=>{"use strict";var b6e=fv(),x6e=CY(),w6e=e=>e.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,""),tI=class extends Error{constructor(r){if(!Array.isArray(r))throw new TypeError(`Expected input to be an Array, got ${typeof r}`);r=[...r].map(i=>i instanceof Error?i:i!==null&&typeof i=="object"?Object.assign(new Error(i.message),i):new Error(i));let n=r.map(i=>typeof i.stack=="string"?w6e(x6e(i.stack)):String(i)).join(`
|
|||
|
|
`);n=`
|
|||
|
|
`+b6e(n,4),super(n),this.name="AggregateError",Object.defineProperty(this,"_errors",{value:r})}*[Symbol.iterator](){for(let r of this._errors)yield r}};PY.exports=tI});var l_=S((Vkt,RY)=>{"use strict";var _6e=TY();RY.exports=async(e,r,{concurrency:n=1/0,stopOnError:i=!0}={})=>new Promise((a,o)=>{if(typeof r!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(n)||n===1/0)&&n>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${n}\` (${typeof n})`);let c=[],u=[],l=e[Symbol.iterator](),f=!1,p=!1,g=0,v=0,x=()=>{if(f)return;let E=l.next(),D=v;if(v++,E.done){p=!0,g===0&&(!i&&u.length!==0?o(new _6e(u)):a(c));return}g++,(async()=>{try{let P=await E.value;c[D]=await r(P,D),g--,x()}catch(P){i?(f=!0,o(P)):(u.push(P),g--,x())}})()};for(let E=0;E<n&&(x(),!p);E++);})});var LY=S((Ykt,rI)=>{"use strict";var{promisify:E6e}=require("util"),AY=require("path"),OY=nv(),S6e=d1(),D6e=mO(),ws=Zn(),C6e=TV(),P6e=AV(),IY=u_(),T6e=l_(),R6e=E6e(IY),kY={glob:!1,unlink:ws.unlink,unlinkSync:ws.unlinkSync,chmod:ws.chmod,chmodSync:ws.chmodSync,stat:ws.stat,statSync:ws.statSync,lstat:ws.lstat,lstatSync:ws.lstatSync,rmdir:ws.rmdir,rmdirSync:ws.rmdirSync,readdir:ws.readdir,readdirSync:ws.readdirSync};function FY(e,r){if(C6e(e))throw new Error("Cannot delete the current working directory. Can be overridden with the `force` option.");if(!P6e(e,r))throw new Error("Cannot delete files/directories outside the current working directory. Can be overridden with the `force` option.")}function $Y(e){return e=Array.isArray(e)?e:[e],e=e.map(r=>process.platform==="win32"&&S6e(r)===!1?D6e(r):r),e}rI.exports=async(e,{force:r,dryRun:n,cwd:i=process.cwd(),onProgress:a=()=>{},...o}={})=>{o={expandDirectories:!1,onlyFiles:!1,followSymbolicLinks:!1,cwd:i,...o},e=$Y(e);let c=(await OY(e,o)).sort((p,g)=>g.localeCompare(p));c.length===0&&a({totalCount:0,deletedCount:0,percent:1});let u=0,f=await T6e(c,async p=>(p=AY.resolve(i,p),r||FY(p,i),n||await R6e(p,kY),u+=1,a({totalCount:c.length,deletedCount:u,percent:u/c.length}),p),o);return f.sort((p,g)=>p.localeCompare(g)),f};rI.exports.sync=(e,{force:r,dryRun:n,cwd:i=process.cwd(),...a}={})=>{a={expandDirectories:!1,onlyFiles:!1,followSymbolicLinks:!1,cwd:i,...a},e=$Y(e);let c=OY.sync(e,a).sort((u,l)=>l.localeCompare(u)).map(u=>(u=AY.resolve(i,u),r||FY(u,i),n||IY.sync(u,kY),u));return c.sort((u,l)=>u.localeCompare(l)),c}});var jY=S((Kkt,ti)=>{"use strict";var f_=require("fs"),NY=require("path"),A6e=tW(),MY=l1(),O6e=cw(),I6e=LY(),k6e=require("stream"),{promisify:F6e}=require("util"),$6e=F6e(k6e.pipeline),{writeFile:L6e}=f_.promises,qY=(e="")=>NY.join(MY,e+A6e()),N6e=async(e,r)=>$6e(r,f_.createWriteStream(e)),nI=(e,{extraArguments:r=0}={})=>async(...n)=>{let[i,a]=n.slice(r),o=await e(...n.slice(0,r),a);try{return await i(o)}finally{await I6e(o,{force:!0})}};ti.exports.file=e=>{if(e={...e},e.name){if(e.extension!==void 0&&e.extension!==null)throw new Error("The `name` and `extension` options are mutually exclusive");return NY.join(ti.exports.directory(),e.name)}return qY()+(e.extension===void 0||e.extension===null?"":"."+e.extension.replace(/^\./,""))};ti.exports.file.task=nI(ti.exports.file);ti.exports.directory=({prefix:e=""}={})=>{let r=qY(e);return f_.mkdirSync(r),r};ti.exports.directory.task=nI(ti.exports.directory);ti.exports.write=async(e,r)=>{let n=ti.exports.file(r);return await(O6e(e)?N6e:L6e)(n,e),n};ti.exports.write.task=nI(ti.exports.write,{extraArguments:1});ti.exports.writeSync=(e,r)=>{let n=ti.exports.file(r);return f_.writeFileSync(n,e),n};Object.defineProperty(ti.exports,"root",{get(){return MY}})});var Nt=S(Ie=>{"use strict";var V6e=Ie&&Ie.__spreadArray||function(e,r,n){if(n||arguments.length===2)for(var i=0,a=r.length,o;i<a;i++)(o||!(i in r))&&(o||(o=Array.prototype.slice.call(r,0,i)),o[i]=r[i]);return e.concat(o||Array.prototype.slice.call(r))};Object.defineProperty(Ie,"__esModule",{value:!0});Ie.dual=Ie.getEndomorphismMonoid=Ie.SK=Ie.hole=Ie.constVoid=Ie.constUndefined=Ie.constNull=Ie.constFalse=Ie.constTrue=Ie.unsafeCoerce=I
|
|||
|
|
|
|||
|
|
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001"),_v.checkPaths(e,r,"copy",n,(a,o)=>{if(a)return i(a);let{srcStat:c,destStat:u}=o;_v.checkParentPaths(e,c,r,"copy",l=>{if(l)return i(l);mX(e,r,n,(f,p)=>{if(f)return i(f);if(!p)return i();Cqe(u,e,r,n,i)})})})}function Cqe(e,r,n,i,a){let o=wv.dirname(n);Eqe(o,(c,u)=>{if(c)return a(c);if(u)return qI(e,r,n,i,a);_qe(o,l=>l?a(l):qI(e,r,n,i,a))})}function mX(e,r,n,i){if(!n.filter)return i(null,!0);Promise.resolve(n.filter(e,r)).then(a=>i(null,a),a=>i(a))}function qI(e,r,n,i,a){(i.dereference?wi.stat:wi.lstat)(r,(c,u)=>c?a(c):u.isDirectory()?kqe(u,e,r,n,i,a):u.isFile()||u.isCharacterDevice()||u.isBlockDevice()?Pqe(u,e,r,n,i,a):u.isSymbolicLink()?Lqe(e,r,n,i,a):u.isSocket()?a(new Error(`Cannot copy a socket file: ${r}`)):u.isFIFO()?a(new Error(`Cannot copy a FIFO pipe: ${r}`)):a(new Error(`Unknown file: ${r}`)))}function Pqe(e,r,n,i,a,o){return r?Tqe(e,n,i,a,o):gX(e,n,i,a,o)}function Tqe(e,r,n,i,a){if(i.overwrite)wi.unlink(n,o=>o?a(o):gX(e,r,n,i,a));else return i.errorOnExist?a(new Error(`'${n}' already exists`)):a()}function gX(e,r,n,i,a){wi.copyFile(r,n,o=>o?a(o):i.preserveTimestamps?Rqe(e.mode,r,n,a):q_(n,e.mode,a))}function Rqe(e,r,n,i){return Aqe(e)?Oqe(n,e,a=>a?i(a):hX(e,r,n,i)):hX(e,r,n,i)}function Aqe(e){return(e&128)===0}function Oqe(e,r,n){return q_(e,r|128,n)}function hX(e,r,n,i){Iqe(r,n,a=>a?i(a):q_(n,e,i))}function q_(e,r,n){return wi.chmod(e,r,n)}function Iqe(e,r,n){wi.stat(e,(i,a)=>i?n(i):Sqe(r,a.atime,a.mtime,n))}function kqe(e,r,n,i,a,o){return r?vX(n,i,a,o):Fqe(e.mode,n,i,a,o)}function Fqe(e,r,n,i,a){wi.mkdir(n,o=>{if(o)return a(o);vX(r,n,i,c=>c?a(c):q_(n,e,a))})}function vX(e,r,n,i){wi.readdir(e,(a,o)=>a?i(a):jI(o,e,r,n,i))}function jI(e,r,n,i,a){let o=e.pop();return o?$qe(e,o,r,n,i,a):a()}function $qe(e,r,n,i,a,o){let c=wv.join(n,r),u=wv.join(i,r);mX(c,u,a,(l,f)=>{if(l)return o(l);if(!f)return jI(e,n,i,a,o);_v.checkPaths(c,u,"copy",a,(p,g)=>{if(p)return o(p);let{destStat:v}=g;qI(v,c,u,a,x=>x?o(x):jI(e,n,i,a,o))})})}function Lqe(e,r,n,i,a){wi.readlink(r,(o,c)=>{if(o)return a(o);if(i.dereference&&(c=wv.resolve(process.cwd(),c)),e)wi.readlink(n,(u,l)=>u?u.code==="EINVAL"||u.code==="UNKNOWN"?wi.symlink(c,n,a):a(u):(i.dereference&&(l=wv.resolve(process.cwd(),l)),_v.isSrcSubdir(c,l)?a(new Error(`Cannot copy '${c}' to a subdirectory of itself, '${l}'.`)):_v.isSrcSubdir(l,c)?a(new Error(`Cannot overwrite '${l}' with '${c}'.`)):Nqe(c,n,a)));else return wi.symlink(c,n,a)})}function Nqe(e,r,n){wi.unlink(r,i=>i?n(i):wi.symlink(e,r,n))}yX.exports=Dqe});var SX=S((C3t,EX)=>{"use strict";var ni=Zn(),Ev=require("path"),Mqe=sa().mkdirsSync,qqe=NI().utimesMillisSync,Sv=Yl();function jqe(e,r,n){typeof n=="function"&&(n={filter:n}),n=n||{},n.clobber="clobber"in n?!!n.clobber:!0,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|||
|
|
|
|||
|
|
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:i,destStat:a}=Sv.checkPathsSync(e,r,"copy",n);if(Sv.checkParentPathsSync(e,i,r,"copy"),n.filter&&!n.filter(e,r))return;let o=Ev.dirname(r);return ni.existsSync(o)||Mqe(o),xX(a,e,r,n)}function xX(e,r,n,i){let o=(i.dereference?ni.statSync:ni.lstatSync)(r);if(o.isDirectory())return Vqe(o,e,r,n,i);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return Bqe(o,e,r,n,i);if(o.isSymbolicLink())return Xqe(e,r,n,i);throw o.isSocket()?new Error(`Cannot copy a socket file: ${r}`):o.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${r}`):new Error(`Unknown file: ${r}`)}function Bqe(e,r,n,i,a){return r?Uqe(e,n,i,a):wX(e,n,i,a)}function Uqe(e,r,n,i){if(i.overwrite)return ni.unlinkSync(n),wX(e,r,n,i);if(i.errorOnExist)throw new Error(`'${n}' already exists`)}function wX(e,r,n,i){return ni.copyFileSync(r,n),i.preserveTimestamps&&Gqe(e.mode,r,n),BI(n,e.mode)}function Gqe(e,r,n){return Wqe(e)&&Hqe(n,e),zqe(r,n)}function Wqe(e){return(e&128)===0}function Hqe(e,r){return BI(e,r|128)}function BI(e,r){return ni.chmodSync(e,r)}function zqe(e,r){let n=ni.statSync(e);return qqe(r,n.atime,n.mtime)}function Vqe(e,r,n,i,a){return r?_X(n,i,a):Yqe(e.mode,n,i,a)}function Yqe(e,r,n,i){return ni.mkdirSync(n),_X(r,n,i),BI(n,e)}function _X(e,r,n){ni.readdirSync(e).forEach(i=>Kqe(i,e,r,n))}function Kqe(e,r,n,i){let a=Ev.join(r,e),o=Ev.join(n,e);if(i.filter&&!i.filter(a,o))return;let{destStat:c}=Sv.checkPathsSync(a,o,"copy",i);return xX(c,a,o,i)}function Xqe(e,r,n,i){let a=ni.readlinkSync(r);if(i.dereference&&(a=Ev.resolve(process.cwd(),a)),e){let o;try{o=ni.readlinkSync(n)}catch(c){if(c.code==="EINVAL"||c.code==="UNKNOWN")return ni.symlinkSync(a,n);throw c}if(i.dereference&&(o=Ev.resolve(process.cwd(),o)),Sv.isSrcSubdir(a,o))throw new Error(`Cannot copy '${a}' to a subdirectory of itself, '${o}'.`);if(Sv.isSrcSubdir(o,a))throw new Error(`Cannot overwrite '${o}' with '${a}'.`);return Jqe(a,n)}else return ni.symlinkSync(a,n)}function Jqe(e,r){return ni.unlinkSync(r),ni.symlinkSync(e,r)}EX.exports=jqe});var j_=S((P3t,DX)=>{"use strict";var Qqe=xi().fromCallback;DX.exports={copy:Qqe(bX()),copySync:SX()}});var Dv=S((T3t,PX)=>{"use strict";var CX=Zn(),Zqe=xi().fromCallback;function eje(e,r){CX.rm(e,{recursive:!0,force:!0},r)}function tje(e){CX.rmSync(e,{recursive:!0,force:!0})}PX.exports={remove:Zqe(eje),removeSync:tje}});var $X=S((R3t,FX)=>{"use strict";var rje=xi().fromPromise,AX=Vl(),OX=require("path"),IX=sa(),kX=Dv(),TX=rje(async function(r){let n;try{n=await AX.readdir(r)}catch{return IX.mkdirs(r)}return Promise.all(n.map(i=>kX.remove(OX.join(r,i))))});function RX(e){let r;try{r=AX.readdirSync(e)}catch{return IX.mkdirsSync(e)}r.forEach(n=>{n=OX.join(e,n),kX.removeSync(n)})}FX.exports={emptyDirSync:RX,emptydirSync:RX,emptyDir:TX,emptydir:TX}});var qX=S((A3t,MX)=>{"use strict";var nje=xi().fromCallback,LX=require("path"),au=Zn(),NX=sa();function ije(e,r){function n(){au.writeFile(e,"",i=>{if(i)return r(i);r()})}au.stat(e,(i,a)=>{if(!i&&a.isFile())return r();let o=LX.dirname(e);au.stat(o,(c,u)=>{if(c)return c.code==="ENOENT"?NX.mkdirs(o,l=>{if(l)return r(l);n()}):r(c);u.isDirectory()?n():au.readdir(o,l=>{if(l)return r(l)})})})}function sje(e){let r;try{r=au.statSync(e)}catch{}if(r&&r.isFile())return;let n=LX.dirname(e);try{au.statSync(n).isDirectory()||au.readdirSync(n)}catch(i){if(i&&i.code==="ENOENT")NX.mkdirsSync(n);else throw i}au.writeFileSync(e,"")}MX.exports={createFile:nje(ije),createFileSync:sje}});var WX=S((O3t,GX)=>{"use strict";var aje=xi().fromCallback,jX=require("path"),ou=Zn(),BX=sa(),oje=su().pathExists,{areIdentical:UX}=Yl();function cje(e,r,n){function i(a,o){ou.link(a,o,c=>{if(c)return n(c);n(null)})}ou.lstat(r,(a,o)=>{ou.lstat(e,(c,u)=>{if(c)return c.message=c.message.replace("lstat","ensureLink"),n(c);if(o&&UX(u,o))return n(null);let l=jX.dirname(r);oje(l,(f,p)=>{if(f)return n(f);if(p)return i(e,r);BX.mkdirs(l,g=>{if(g)return n(g);i(e,r)})})})})}function uje(e,r){let n;try{n=ou.lstatSync(r)}catch{}try{let o=ou.lstatSync(e);if(n&&UX(o
|
|||
|
|
`,finalEOL:n=!0,replacer:i=null,spaces:a}={}){let o=n?r:"";return JSON.stringify(e,i,a).replace(/\n/g,r)+o}function Cje(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}pJ.exports={stringify:Dje,stripBom:Cje}});var gJ=S((N3t,mJ)=>{"use strict";var wd;try{wd=Zn()}catch{wd=require("fs")}var U_=xi(),{stringify:dJ,stripBom:hJ}=B_();async function Pje(e,r={}){typeof r=="string"&&(r={encoding:r});let n=r.fs||wd,i="throws"in r?r.throws:!0,a=await U_.fromCallback(n.readFile)(e,r);a=hJ(a);let o;try{o=JSON.parse(a,r?r.reviver:null)}catch(c){if(i)throw c.message=`${e}: ${c.message}`,c;return null}return o}var Tje=U_.fromPromise(Pje);function Rje(e,r={}){typeof r=="string"&&(r={encoding:r});let n=r.fs||wd,i="throws"in r?r.throws:!0;try{let a=n.readFileSync(e,r);return a=hJ(a),JSON.parse(a,r.reviver)}catch(a){if(i)throw a.message=`${e}: ${a.message}`,a;return null}}async function Aje(e,r,n={}){let i=n.fs||wd,a=dJ(r,n);await U_.fromCallback(i.writeFile)(e,a,n)}var Oje=U_.fromPromise(Aje);function Ije(e,r,n={}){let i=n.fs||wd,a=dJ(r,n);return i.writeFileSync(e,a,n)}var kje={readFile:Tje,readFileSync:Rje,writeFile:Oje,writeFileSync:Ije};mJ.exports=kje});var yJ=S((M3t,vJ)=>{"use strict";var G_=gJ();vJ.exports={readJson:G_.readFile,readJsonSync:G_.readFileSync,writeJson:G_.writeFile,writeJsonSync:G_.writeFileSync}});var W_=S((q3t,wJ)=>{"use strict";var Fje=xi().fromCallback,Pv=Zn(),bJ=require("path"),xJ=sa(),$je=su().pathExists;function Lje(e,r,n,i){typeof n=="function"&&(i=n,n="utf8");let a=bJ.dirname(e);$je(a,(o,c)=>{if(o)return i(o);if(c)return Pv.writeFile(e,r,n,i);xJ.mkdirs(a,u=>{if(u)return i(u);Pv.writeFile(e,r,n,i)})})}function Nje(e,...r){let n=bJ.dirname(e);if(Pv.existsSync(n))return Pv.writeFileSync(e,...r);xJ.mkdirsSync(n),Pv.writeFileSync(e,...r)}wJ.exports={outputFile:Fje(Lje),outputFileSync:Nje}});var EJ=S((j3t,_J)=>{"use strict";var{stringify:Mje}=B_(),{outputFile:qje}=W_();async function jje(e,r,n={}){let i=Mje(r,n);await qje(e,i,n)}_J.exports=jje});var DJ=S((B3t,SJ)=>{"use strict";var{stringify:Bje}=B_(),{outputFileSync:Uje}=W_();function Gje(e,r,n){let i=Bje(r,n);Uje(e,i,n)}SJ.exports=Gje});var PJ=S((U3t,CJ)=>{"use strict";var Wje=xi().fromPromise,ii=yJ();ii.outputJson=Wje(EJ());ii.outputJsonSync=DJ();ii.outputJSON=ii.outputJson;ii.outputJSONSync=ii.outputJsonSync;ii.writeJSON=ii.writeJson;ii.writeJSONSync=ii.writeJsonSync;ii.readJSON=ii.readJson;ii.readJSONSync=ii.readJsonSync;CJ.exports=ii});var IJ=S((G3t,OJ)=>{"use strict";var Hje=Zn(),GI=require("path"),zje=j_().copy,AJ=Dv().remove,Vje=sa().mkdirp,Yje=su().pathExists,TJ=Yl();function Kje(e,r,n,i){typeof n=="function"&&(i=n,n={}),n=n||{};let a=n.overwrite||n.clobber||!1;TJ.checkPaths(e,r,"move",n,(o,c)=>{if(o)return i(o);let{srcStat:u,isChangingCase:l=!1}=c;TJ.checkParentPaths(e,u,r,"move",f=>{if(f)return i(f);if(Xje(r))return RJ(e,r,a,l,i);Vje(GI.dirname(r),p=>p?i(p):RJ(e,r,a,l,i))})})}function Xje(e){let r=GI.dirname(e);return GI.parse(r).root===r}function RJ(e,r,n,i,a){if(i)return UI(e,r,n,a);if(n)return AJ(r,o=>o?a(o):UI(e,r,n,a));Yje(r,(o,c)=>o?a(o):c?a(new Error("dest already exists.")):UI(e,r,n,a))}function UI(e,r,n,i){Hje.rename(e,r,a=>a?a.code!=="EXDEV"?i(a):Jje(e,r,n,i):i())}function Jje(e,r,n,i){zje(e,r,{overwrite:n,errorOnExist:!0,preserveTimestamps:!0},o=>o?i(o):AJ(e,i))}OJ.exports=Kje});var NJ=S((W3t,LJ)=>{"use strict";var FJ=Zn(),HI=require("path"),Qje=j_().copySync,$J=Dv().removeSync,Zje=sa().mkdirpSync,kJ=Yl();function eBe(e,r,n){n=n||{};let i=n.overwrite||n.clobber||!1,{srcStat:a,isChangingCase:o=!1}=kJ.checkPathsSync(e,r,"move",n);return kJ.checkParentPathsSync(e,a,r,"move"),tBe(r)||Zje(HI.dirname(r)),rBe(e,r,i,o)}function tBe(e){let r=HI.dirname(e);return HI.parse(r).root===r}function rBe(e,r,n,i){if(i)return WI(e,r,n);if(n)return $J(r),WI(e,r,n);if(FJ.existsSync(r))throw new Error("dest already exists.");return WI(e,r,n)}function WI(e,r,n){try{FJ.renameSync(e,r)}catch(i){if(i.code!=="EXDEV")throw i;return nBe(e,r,n)}}function nBe(e,r,n){return Qje(e,r,{overwrite:n,errorOnExist:!0,preserveTimestamps:!0}),$J(e)}LJ.expor
|
|||
|
|
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function OQ(e){return e[0]==="u"&&e.length===5||e[0]==="x"&&e.length===3?String.fromCharCode(parseInt(e.slice(1),16)):HBe.get(e)||e}function zBe(e,r){let n=[],i=r.trim().split(/\s*,\s*/g),a;for(let o of i)if(!isNaN(o))n.push(Number(o));else if(a=o.match(GBe))n.push(a[2].replace(WBe,(c,u,l)=>u?OQ(u):l));else throw new Error(`Invalid Chalk template style argument: ${o} (in style '${e}')`);return n}function VBe(e){RQ.lastIndex=0;let r=[],n;for(;(n=RQ.exec(e))!==null;){let i=n[1];if(n[2]){let a=zBe(i,n[2]);r.push([i].concat(a))}else r.push([i])}return r}function AQ(e,r){let n={};for(let a of r)for(let o of a.styles)n[o[0]]=a.inverse?null:o.slice(1);let i=e;for(let a of Object.keys(n))if(Array.isArray(n[a])){if(!(a in i))throw new Error(`Unknown Chalk style: ${a}`);n[a].length>0?i=i[a].apply(i,n[a]):i=i[a]}return i}IQ.exports=(e,r)=>{let n=[],i=[],a=[];if(r.replace(UBe,(o,c,u,l,f,p)=>{if(c)a.push(OQ(c));else if(l){let g=a.join("");a=[],i.push(n.length===0?g:AQ(e,n)(g)),n.push({inverse:u,styles:VBe(l)})}else if(f){if(n.length===0)throw new Error("Found extraneous } in Chalk template literal");i.push(AQ(e,n)(a.join(""))),a=[],n.pop()}else a.push(p)}),i.push(a.join("")),n.length>0){let o=`Chalk template literal is missing ${n.length} closing bracket${n.length===1?"":"s"} (\`}\`)`;throw new Error(o)}return i.join("")}});var ak=S((lLt,Ov)=>{"use strict";var sk=pQ(),kr=SQ(),ik=TQ().stdout,YBe=kQ(),$Q=process.platform==="win32"&&!(process.env.TERM||"").toLowerCase().startsWith("xterm"),LQ=["ansi","ansi","ansi256","ansi16m"],NQ=new Set(["gray"]),Dd=Object.create(null);function FQ(e,r){r=r||{};let n=ik?ik.level:0;e.level=r.level===void 0?n:r.level,e.enabled="enabled"in r?r.enabled:e.level>0}function Av(e){if(!this||!(this instanceof Av)||this.template){let r={};return FQ(r,e),r.template=function(){let n=[].slice.call(arguments);return JBe.apply(null,[r.template].concat(n))},Object.setPrototypeOf(r,Av.prototype),Object.setPrototypeOf(r.template,r),r.template.constructor=Av,r.template}FQ(this,e)}$Q&&(kr.blue.open="\x1B[94m");for(let e of Object.keys(kr))kr[e].closeRe=new RegExp(sk(kr[e].close),"g"),Dd[e]={get(){let r=kr[e];return Z_.call(this,this._styles?this._styles.concat(r):[r],this._empty,e)}};Dd.visible={get(){return Z_.call(this,this._styles||[],!0,"visible")}};kr.color.closeRe=new RegExp(sk(kr.color.close),"g");for(let e of Object.keys(kr.color.ansi))NQ.has(e)||(Dd[e]={get(){let r=this.level;return function(){let i={open:kr.color[LQ[r]][e].apply(null,arguments),close:kr.color.close,closeRe:kr.color.closeRe};return Z_.call(this,this._styles?this._styles.concat(i):[i],this._empty,e)}}});kr.bgColor.closeRe=new RegExp(sk(kr.bgColor.close),"g");for(let e of Object.keys(kr.bgColor.ansi)){if(NQ.has(e))continue;let r="bg"+e[0].toUpperCase()+e.slice(1);Dd[r]={get(){let n=this.level;return function(){let a={open:kr.bgColor[LQ[n]][e].apply(null,arguments),close:kr.bgColor.close,closeRe:kr.bgColor.closeRe};return Z_.call(this,this._styles?this._styles.concat(a):[a],this._empty,e)}}}}var KBe=Object.defineProperties(()=>{},Dd);function Z_(e,r,n){let i=function(){return XBe.apply(i,arguments)};i._styles=e,i._empty=r;let a=this;return Object.defineProperty(i,"level",{enumerable:!0,get(){return a.level},set(o){a.level=o}}),Object.defineProperty(i,"enabled",{enumerable:!0,get(){return a.enabled},set(o){a.enabled=o}}),i.hasGrey=this.hasGrey||n==="gray"||n==="grey",i.__proto__=KBe,i}function XBe(){let e=arguments,r=e.length,n=String(arguments[0]);if(r===0)return"";if(r>1)for(let a=1;a<r;a++)n+=" "+e[a];if(!this.enabled||this.level<=0||!n)return this._empty?"":n;let i=kr.dim.open;$Q&&this.hasGrey&&(kr.dim.open="");for(let a of this._styles.slice().reverse())n=a.open+n.replace(a.closeRe,a.open)+a.close,n=n.replace(/\r?\n/g,`${a.close}$&${a.open}`);return kr.dim.open=i,n}function JBe(e,r){if(!Array.isArray(r))return[].slice.call(arguments,1).join(" ");let n=[].slice.call(arguments,2),i=[r.raw[0]];for(let a=1;a<r.length;a++)i.push(String(n[a-1])
|
|||
|
|
`):n+=a}return n}function UQ(e){return ck.default.level>0||e.forceColor}var ok;function GQ(e){if(e){var r;return(r=ok)!=null||(ok=new ck.default.constructor({enabled:!0,level:1})),ok}return ck.default}Iv.getChalk=e=>GQ(e.forceColor);function i9e(e,r={}){if(e!==""&&UQ(r)){let n=e9e(GQ(r.forceColor));return n9e(n,e)}else return e}});var JQ=S(eE=>{"use strict";Object.defineProperty(eE,"__esModule",{value:!0});eE.codeFrameColumns=XQ;eE.default=u9e;var HQ=WQ(),zQ=s9e(ak(),!0);function KQ(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,n=new WeakMap;return(KQ=function(i){return i?n:r})(e)}function s9e(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=KQ(r);if(n&&n.has(e))return n.get(e);var i={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var c=a?Object.getOwnPropertyDescriptor(e,o):null;c&&(c.get||c.set)?Object.defineProperty(i,o,c):i[o]=e[o]}return i.default=e,n&&n.set(e,i),i}var uk;function a9e(e){if(e){var r;return(r=uk)!=null||(uk=new zQ.default.constructor({enabled:!0,level:1})),uk}return zQ.default}var VQ=!1;function o9e(e){return{gutter:e.grey,marker:e.red.bold,message:e.red.bold}}var YQ=/\r\n|[\n\r\u2028\u2029]/;function c9e(e,r,n){let i=Object.assign({column:0,line:-1},e.start),a=Object.assign({},i,e.end),{linesAbove:o=2,linesBelow:c=3}=n||{},u=i.line,l=i.column,f=a.line,p=a.column,g=Math.max(u-(o+1),0),v=Math.min(r.length,f+c);u===-1&&(g=0),f===-1&&(v=r.length);let x=f-u,E={};if(x)for(let D=0;D<=x;D++){let P=D+u;if(!l)E[P]=!0;else if(D===0){let R=r[P-1].length;E[P]=[l,R-l+1]}else if(D===x)E[P]=[0,p];else{let R=r[P-D].length;E[P]=[0,R]}}else l===p?l?E[u]=[l,0]:E[u]=!0:E[u]=[l,p-l];return{start:g,end:v,markerLines:E}}function XQ(e,r,n={}){let i=(n.highlightCode||n.forceColor)&&(0,HQ.shouldHighlight)(n),a=a9e(n.forceColor),o=o9e(a),c=(D,P)=>i?D(P):P,u=e.split(YQ),{start:l,end:f,markerLines:p}=c9e(r,u,n),g=r.start&&typeof r.start.column=="number",v=String(f).length,E=(i?(0,HQ.default)(e,n):e).split(YQ,f).slice(l,f).map((D,P)=>{let R=l+1+P,F=` ${` ${R}`.slice(-v)} |`,L=p[R],U=!p[R+1];if(L){let V="";if(Array.isArray(L)){let j=D.slice(0,Math.max(L[0]-1,0)).replace(/[^\t]/g," "),W=L[1]||1;V=[`
|
|||
|
|
`,c(o.gutter,F.replace(/\d/g," "))," ",j,c(o.marker,"^").repeat(W)].join(""),U&&n.message&&(V+=" "+c(o.message,n.message))}return[c(o.marker,">"),c(o.gutter,F),D.length>0?` ${D}`:"",V].join("")}else return` ${c(o.gutter,F)}${D.length>0?` ${D}`:""}`}).join(`
|
|||
|
|
`);return n.message&&!g&&(E=`${" ".repeat(v+1)}${n.message}
|
|||
|
|
${E}`),i?a.reset(E):E}function u9e(e,r,n,i={}){if(!VQ){VQ=!0;let o="Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";if(process.emitWarning)process.emitWarning(o,"DeprecationWarning");else{let c=new Error(o);c.name="DeprecationWarning",console.warn(new Error(o))}}return n=Math.max(n,0),XQ(e,{start:{column:n,line:r}},i)}});var dk=S((vLt,tZ)=>{"use strict";var h9e=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};tZ.exports=h9e});var hk=S((yLt,rZ)=>{"use strict";var m9e="2.0.0",g9e=Number.MAX_SAFE_INTEGER||9007199254740991,v9e=16,y9e=250,b9e=["major","premajor","minor","preminor","patch","prepatch","prerelease"];rZ.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:v9e,MAX_SAFE_BUILD_LENGTH:y9e,MAX_SAFE_INTEGER:g9e,RELEASE_TYPES:b9e,SEMVER_SPEC_VERSION:m9e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var iZ=S((Uo,nZ)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:mk,MAX_SAFE_BUILD_LENGTH:x9e,MAX_LENGTH:w9e}=hk(),_9e=dk();Uo=nZ.exports={};var E9e=Uo.re=[],S9e=Uo.safeRe=[],ve=Uo.src=[],ye=Uo.t={},D9e=0,gk="[a-zA-Z0-9-]",C9e=[["\\s",1],["\\d",w9e],[gk,x9e]],P9e=e=>{for(let[r,n]of C9e)e=e.split(`${r}*`).join(`${r}{0,${n}}`).split(`${r}+`).join(`${r}{1,${n}}`);return e},je=(e,r,n)=>{let i=P9e(r),a=D9e++;_9e(e,a,r),ye[e]=a,ve[a]=r,E9e[a]=new RegExp(r,n?"g":void 0),S9e[a]=new RegExp(i,n?"g":void 0)};je("NUMERICIDENTIFIER","0|[1-9]\\d*");je("NUMERICIDENTIFIERLOOSE","\\d+");je("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${gk}*`);je("MAINVERSION",`(${ve[ye.NUMERICIDENTIFIER]})\\.(${ve[ye.NUMERICIDENTIFIER]})\\.(${ve[ye.NUMERICIDENTIFIER]})`);je("MAINVERSIONLOOSE",`(${ve[ye.NUMERICIDENTIFIERLOOSE]})\\.(${ve[ye.NUMERICIDENTIFIERLOOSE]})\\.(${ve[ye.NUMERICIDENTIFIERLOOSE]})`);je("PRERELEASEIDENTIFIER",`(?:${ve[ye.NUMERICIDENTIFIER]}|${ve[ye.NONNUMERICIDENTIFIER]})`);je("PRERELEASEIDENTIFIERLOOSE",`(?:${ve[ye.NUMERICIDENTIFIERLOOSE]}|${ve[ye.NONNUMERICIDENTIFIER]})`);je("PRERELEASE",`(?:-(${ve[ye.PRERELEASEIDENTIFIER]}(?:\\.${ve[ye.PRERELEASEIDENTIFIER]})*))`);je("PRERELEASELOOSE",`(?:-?(${ve[ye.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${ve[ye.PRERELEASEIDENTIFIERLOOSE]})*))`);je("BUILDIDENTIFIER",`${gk}+`);je("BUILD",`(?:\\+(${ve[ye.BUILDIDENTIFIER]}(?:\\.${ve[ye.BUILDIDENTIFIER]})*))`);je("FULLPLAIN",`v?${ve[ye.MAINVERSION]}${ve[ye.PRERELEASE]}?${ve[ye.BUILD]}?`);je("FULL",`^${ve[ye.FULLPLAIN]}$`);je("LOOSEPLAIN",`[v=\\s]*${ve[ye.MAINVERSIONLOOSE]}${ve[ye.PRERELEASELOOSE]}?${ve[ye.BUILD]}?`);je("LOOSE",`^${ve[ye.LOOSEPLAIN]}$`);je("GTLT","((?:<|>)?=?)");je("XRANGEIDENTIFIERLOOSE",`${ve[ye.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);je("XRANGEIDENTIFIER",`${ve[ye.NUMERICIDENTIFIER]}|x|X|\\*`);je("XRANGEPLAIN",`[v=\\s]*(${ve[ye.XRANGEIDENTIFIER]})(?:\\.(${ve[ye.XRANGEIDENTIFIER]})(?:\\.(${ve[ye.XRANGEIDENTIFIER]})(?:${ve[ye.PRERELEASE]})?${ve[ye.BUILD]}?)?)?`);je("XRANGEPLAINLOOSE",`[v=\\s]*(${ve[ye.XRANGEIDENTIFIERLOOSE]})(?:\\.(${ve[ye.XRANGEIDENTIFIERLOOSE]})(?:\\.(${ve[ye.XRANGEIDENTIFIERLOOSE]})(?:${ve[ye.PRERELEASELOOSE]})?${ve[ye.BUILD]}?)?)?`);je("XRANGE",`^${ve[ye.GTLT]}\\s*${ve[ye.XRANGEPLAIN]}$`);je("XRANGELOOSE",`^${ve[ye.GTLT]}\\s*${ve[ye.XRANGEPLAINLOOSE]}$`);je("COERCEPLAIN",`(^|[^\\d])(\\d{1,${mk}})(?:\\.(\\d{1,${mk}}))?(?:\\.(\\d{1,${mk}}))?`);je("COERCE",`${ve[ye.COERCEPLAIN]}(?:$|[^\\d])`);je("COERCEFULL",ve[ye.COERCEPLAIN]+`(?:${ve[ye.PRERELEASE]})?(?:${ve[ye.BUILD]})?(?:$|[^\\d])`);je("COERCERTL",ve[ye.COERCE],!0);je("COERCERTLFULL",ve[ye.COERCEFULL],!0);je("LONETILDE","(?:~>?)");je("TILDETRIM",`(\\s*)${ve[ye.LONETILDE]}\\s+`,!0);Uo.tildeTrimReplace="$1~";je("TILDE",`^${ve[ye.LONETILDE]}${ve[ye.XRANGEPLAIN]}$`);je("TILDELOOSE",`^${ve[ye.LONETILDE]}${ve[ye.XRANGEPLAINLOOSE]}$`);je("LONECARET","(?:\\^)");je("CARETTRIM",`(\\s*)${ve[ye.LONECARET]}\\s+`,!0);Uo.caretTrimReplace="$1^";je("CARET",`^${ve[ye.LONECARET]}${ve[ye.XRANGEPLAIN]}$`);je("CARETLOOSE",`^${ve[ye.LONECARET]}${ve[ye.XRANGEPLAINLOOSE]}$`);je("COMPARATORLOOSE",`^${ve[ye.GTLT]}\\s*(${ve[ye.LOOSEPLAIN]})$|^$`);je("COMPARATOR",`^${ve[ye.G
|
|||
|
|
`);let r=0;for(;e[r]&&e[r].trim().match(/^(#|$)/);)r++;let n=e.length,i=r+1;for(;i<n&&e[i].trim();)i++;return e.slice(r,i).join(" ").trim()}});var gee=S((YLt,PUe)=>{PUe.exports={topLevel:{dependancies:"dependencies",dependecies:"dependencies",depdenencies:"dependencies",devEependencies:"devDependencies",depends:"dependencies","dev-dependencies":"devDependencies",devDependences:"devDependencies",devDepenencies:"devDependencies",devdependencies:"devDependencies",repostitory:"repository",repo:"repository",prefereGlobal:"preferGlobal",hompage:"homepage",hampage:"homepage",autohr:"author",autor:"author",contributers:"contributors",publicationConfig:"publishConfig",script:"scripts"},bugs:{web:"url",name:"url"},script:{server:"start",tests:"test"}}});var xee=S((KLt,bee)=>{"use strict";var TUe=bZ(),RUe=wZ(),AUe=qZ(),fE=ree(),OUe=kd(),IUe=["dependencies","devDependencies","optionalDependencies"],kUe=mee(),Ik=require("url"),gu=gee(),vee=e=>e.includes("@")&&e.indexOf("@")<e.lastIndexOf(".");bee.exports={warn:function(){},fixRepositoryField:function(e){if(e.repositories&&(this.warn("repositories"),e.repository=e.repositories[0]),!e.repository)return this.warn("missingRepository");typeof e.repository=="string"&&(e.repository={type:"git",url:e.repository});var r=e.repository.url||"";if(r){var n=fE.fromUrl(r);n&&(r=e.repository.url=n.getDefaultRepresentation()==="shortcut"?n.https():n.toString())}r.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)&&this.warn("brokenGitUrl",r)},fixTypos:function(e){Object.keys(gu.topLevel).forEach(function(r){Object.prototype.hasOwnProperty.call(e,r)&&this.warn("typo",r,gu.topLevel[r])},this)},fixScriptsField:function(e){if(e.scripts){if(typeof e.scripts!="object"){this.warn("nonObjectScripts"),delete e.scripts;return}Object.keys(e.scripts).forEach(function(r){typeof e.scripts[r]!="string"?(this.warn("nonStringScript"),delete e.scripts[r]):gu.script[r]&&!e.scripts[gu.script[r]]&&this.warn("typo",r,gu.script[r],"scripts")},this)}},fixFilesField:function(e){var r=e.files;r&&!Array.isArray(r)?(this.warn("nonArrayFiles"),delete e.files):e.files&&(e.files=e.files.filter(function(n){return!n||typeof n!="string"?(this.warn("invalidFilename",n),!1):!0},this))},fixBinField:function(e){if(e.bin&&typeof e.bin=="string"){var r={},n;(n=e.name.match(/^@[^/]+[/](.*)$/))?r[n[1]]=e.bin:r[e.name]=e.bin,e.bin=r}},fixManField:function(e){e.man&&typeof e.man=="string"&&(e.man=[e.man])},fixBundleDependenciesField:function(e){var r="bundledDependencies",n="bundleDependencies";e[r]&&!e[n]&&(e[n]=e[r],delete e[r]),e[n]&&!Array.isArray(e[n])?(this.warn("nonArrayBundleDependencies"),delete e[n]):e[n]&&(e[n]=e[n].filter(function(i){return!i||typeof i!="string"?(this.warn("nonStringBundleDependency",i),!1):(e.dependencies||(e.dependencies={}),Object.prototype.hasOwnProperty.call(e.dependencies,i)||(this.warn("nonDependencyBundleDependency",i),e.dependencies[i]="*"),!0)},this))},fixDependencies:function(e,r){BUe(e,this.warn),qUe(e,this.warn),this.fixBundleDependenciesField(e),["dependencies","devDependencies"].forEach(function(n){if(n in e){if(!e[n]||typeof e[n]!="object"){this.warn("nonObjectDependencies",n),delete e[n];return}Object.keys(e[n]).forEach(function(i){var a=e[n][i];typeof a!="string"&&(this.warn("nonStringDependency",i,JSON.stringify(a)),delete e[n][i]);var o=fE.fromUrl(e[n][i]);o&&(e[n][i]=o.toString())},this)}},this)},fixModulesField:function(e){e.modules&&(this.warn("deprecatedModules"),delete e.modules)},fixKeywordsField:function(e){typeof e.keywords=="string"&&(e.keywords=e.keywords.split(/,\s+/)),e.keywords&&!Array.isArray(e.keywords)?(delete e.keywords,this.warn("nonArrayKeywords")):e.keywords&&(e.keywords=e.keywords.filter(function(r){return typeof r!="string"||!r?(this.warn("nonStringKeyword"),!1):!0},this))},fixVersionField:function(e,r){var n=!r;if(!e.version)return e.version="",!0;if(!TUe(e.version,n))throw new Error('Invalid version: "'+e.version+'"');return e.version=RUe(e.version,n),!0},fixPeople:function(e){yee(e,NUe),yee(e,MUe)},fixNameField:function(e,r){typeof r=="boolean"?r={strict:r}:typeof r>"u"&&(r={
|
|||
|
|
Content-Disposition: form-data; name="`;return e.forEach((o,c)=>typeof o=="string"?i.push(a+Qk(c)+`"\r
|
|||
|
|
\r
|
|||
|
|
${o.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
|
|||
|
|
`)}\r
|
|||
|
|
`):i.push(a+Qk(c)+`"; filename="${Qk(o.name,1)}"\r
|
|||
|
|
Content-Type: ${o.type||"application/octet-stream"}\r
|
|||
|
|
\r
|
|||
|
|
`,o,`\r
|
|||
|
|
`)),i.push(`--${n}--`),new r(i,{type:"multipart/form-data; boundary="+n})}var Vv,S7e,D7e,Ste,C7e,Dte,Qk,sf,Ps,Cte,af,bE=Np(()=>{"use strict";Wv();Jk();({toStringTag:Vv,iterator:S7e,hasInstance:D7e}=Symbol),Ste=Math.random,C7e="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),Dte=(e,r,n)=>(e+="",/^(Blob|File)$/.test(r&&r[Vv])?[(n=n!==void 0?n+"":r[Vv]=="File"?r.name:"blob",e),r.name!==n||r[Vv]=="blob"?new Md([r],n,r):r]:[e,r+""]),Qk=(e,r)=>(r?e:e.replace(/\r?\n|\r/g,`\r
|
|||
|
|
`)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),sf=(e,r,n)=>{if(r.length<n)throw new TypeError(`Failed to execute '${e}' on 'FormData': ${n} arguments required, but only ${r.length} present.`)},af=(Cte=class{constructor(...r){Ee(this,Ps,[]);if(r.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[Vv](){return"FormData"}[S7e](){return this.entries()}static[D7e](r){return r&&typeof r=="object"&&r[Vv]==="FormData"&&!C7e.some(n=>typeof r[n]!="function")}append(...r){sf("append",arguments,2),$(this,Ps).push(Dte(...r))}delete(r){sf("delete",arguments,1),r+="",fe(this,Ps,$(this,Ps).filter(([n])=>n!==r))}get(r){sf("get",arguments,1),r+="";for(var n=$(this,Ps),i=n.length,a=0;a<i;a++)if(n[a][0]===r)return n[a][1];return null}getAll(r,n){return sf("getAll",arguments,1),n=[],r+="",$(this,Ps).forEach(i=>i[0]===r&&n.push(i[1])),n}has(r){return sf("has",arguments,1),r+="",$(this,Ps).some(n=>n[0]===r)}forEach(r,n){sf("forEach",arguments,1);for(var[i,a]of this)r.call(n,a,i,this)}set(...r){sf("set",arguments,2);var n=[],i=!0;r=Dte(...r),$(this,Ps).forEach(a=>{a[0]===r[0]?i&&(i=!n.push(r)):n.push(a)}),i&&n.push(r),fe(this,Ps,n)}*entries(){yield*$(this,Ps)}*keys(){for(var[r]of this)yield r}*values(){for(var[,r]of this)yield r}},Ps=new WeakMap,Cte)});var Ite=S(($Nt,Ote)=>{"use strict";if(!globalThis.DOMException)try{let{MessageChannel:e}=require("worker_threads"),r=new e().port1,n=new ArrayBuffer;r.postMessage(n,[n,n])}catch(e){e.constructor.name==="DOMException"&&(globalThis.DOMException=e.constructor)}Ote.exports=globalThis.DOMException});var wE,P7e,MNt,eF=Np(()=>{"use strict";wE=require("fs"),P7e=B(Ite(),1);Jk();Wv();({stat:MNt}=wE.promises)});var Fte={};Xn(Fte,{toFormData:()=>F7e});function k7e(e){let r=e.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!r)return;let n=r[2]||r[3]||"",i=n.slice(n.lastIndexOf("\\")+1);return i=i.replace(/%22/g,'"'),i=i.replace(/&#(\d{4});/g,(a,o)=>String.fromCharCode(o)),i}async function F7e(e,r){if(!/multipart/i.test(r))throw new TypeError("Failed to fetch");let n=r.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!n)throw new TypeError("no or bad content-type header, no multipart boundary");let i=new tF(n[1]||n[2]),a,o,c,u,l,f,p=[],g=new af,v=R=>{c+=P.decode(R,{stream:!0})},x=R=>{p.push(R)},E=()=>{let R=new Md(p,f,{type:l});g.append(u,R)},D=()=>{g.append(u,c)},P=new TextDecoder("utf-8");P.decode(),i.onPartBegin=function(){i.onPartData=v,i.onPartEnd=D,a="",o="",c="",u="",l="",f=null,p.length=0},i.onHeaderField=function(R){a+=P.decode(R,{stream:!0})},i.onHeaderValue=function(R){o+=P.decode(R,{stream:!0})},i.onHeaderEnd=function(){if(o+=P.decode(),a=a.toLowerCase(),a==="content-disposition"){let R=o.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);R&&(u=R[2]||R[3]||""),f=k7e(o),f&&(i.onPartData=x,i.onPartEnd=E)}else a==="content-type"&&(l=o);o="",a=""};for await(let R of e)i.write(R);return i.end(),g}var Ka,Yt,kte,vu,_E,EE,T7e,Kv,R7e,A7e,O7e,I7e,of,tF,$te=Np(()=>{"use strict";eF();bE();Ka=0,Yt={START_BOUNDARY:Ka++,HEADER_FIELD_START:Ka++,HEADER_FIELD:Ka++,HEADER_VALUE_START:Ka++,HEADER_VALUE:Ka++,HEADER_VALUE_ALMOST_DONE:Ka++,HEADERS_ALMOST_DONE:Ka++,PART_DATA_START:Ka++,PART_DATA:Ka++,END:Ka++},kte=1,vu={PART_BOUNDARY:kte,LAST_BOUNDARY:kte*=2},_E=10,EE=13,T7e=32,Kv=45,R7e=58,A7e=97,O7e=122,I7e=e=>e|32,of=()=>{},tF=class{constructor(r){this.index=0,this.flags=0,this.onHeaderEnd=of,this.onHeaderField=of,this.onHeadersEnd=of,this.onHeaderValue=of,this.onPartBegin=of,this.onPartData=of,this.onPartEnd=of,this.boundaryChars={},r=`\r
|
|||
|
|
--`+r;let n=new Uint8Array(r.length);for(let i=0;i<r.length;i++)n[i]=r.charCodeAt(i),this.boundaryChars[n[i]]=!0;this.boundary=n,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=Yt.START_BOUNDARY}write(r){let n=0,i=r.length,a=this.index,{lookbehind:o,boundary:c,boundaryChars:u,index:l,state:f,flags:p}=this,g=this.boundary.length,v=g-1,x=r.length,E,D,P=L=>{this[L+"Mark"]=n},R=L=>{delete this[L+"Mark"]},k=(L,U,V,j)=>{(U===void 0||U!==V)&&this[L](j&&j.subarray(U,V))},F=(L,U)=>{let V=L+"Mark";V in this&&(U?(k(L,this[V],n,r),delete this[V]):(k(L,this[V],r.length,r),this[V]=0))};for(n=0;n<i;n++)switch(E=r[n],f){case Yt.START_BOUNDARY:if(l===c.length-2){if(E===Kv)p|=vu.LAST_BOUNDARY;else if(E!==EE)return;l++;break}else if(l-1===c.length-2){if(p&vu.LAST_BOUNDARY&&E===Kv)f=Yt.END,p=0;else if(!(p&vu.LAST_BOUNDARY)&&E===_E)l=0,k("onPartBegin"),f=Yt.HEADER_FIELD_START;else return;break}E!==c[l+2]&&(l=-2),E===c[l+2]&&l++;break;case Yt.HEADER_FIELD_START:f=Yt.HEADER_FIELD,P("onHeaderField"),l=0;case Yt.HEADER_FIELD:if(E===EE){R("onHeaderField"),f=Yt.HEADERS_ALMOST_DONE;break}if(l++,E===Kv)break;if(E===R7e){if(l===1)return;F("onHeaderField",!0),f=Yt.HEADER_VALUE_START;break}if(D=I7e(E),D<A7e||D>O7e)return;break;case Yt.HEADER_VALUE_START:if(E===T7e)break;P("onHeaderValue"),f=Yt.HEADER_VALUE;case Yt.HEADER_VALUE:E===EE&&(F("onHeaderValue",!0),k("onHeaderEnd"),f=Yt.HEADER_VALUE_ALMOST_DONE);break;case Yt.HEADER_VALUE_ALMOST_DONE:if(E!==_E)return;f=Yt.HEADER_FIELD_START;break;case Yt.HEADERS_ALMOST_DONE:if(E!==_E)return;k("onHeadersEnd"),f=Yt.PART_DATA_START;break;case Yt.PART_DATA_START:f=Yt.PART_DATA,P("onPartData");case Yt.PART_DATA:if(a=l,l===0){for(n+=v;n<x&&!(r[n]in u);)n+=g;n-=v,E=r[n]}if(l<c.length)c[l]===E?(l===0&&F("onPartData",!0),l++):l=0;else if(l===c.length)l++,E===EE?p|=vu.PART_BOUNDARY:E===Kv?p|=vu.LAST_BOUNDARY:l=0;else if(l-1===c.length)if(p&vu.PART_BOUNDARY){if(l=0,E===_E){p&=~vu.PART_BOUNDARY,k("onPartEnd"),k("onPartBegin"),f=Yt.HEADER_FIELD_START;break}}else p&vu.LAST_BOUNDARY&&E===Kv?(k("onPartEnd"),f=Yt.END,p=0):l=0;if(l>0)o[l-1]=E;else if(a>0){let L=new Uint8Array(o.buffer,o.byteOffset,o.byteLength);k("onPartData",0,a,L),a=0,P("onPartData"),n--}break;case Yt.END:break;default:throw new Error(`Unexpected state entered: ${f}`)}F("onHeaderField"),F("onHeaderValue"),F("onPartData"),this.index=l,this.state=f,this.flags=p}end(){if(this.state===Yt.HEADER_FIELD_START&&this.index===0||this.state===Yt.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==Yt.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}}});var Zte=S((TMt,Qte)=>{"use strict";function As(e,r){typeof r=="boolean"&&(r={forever:r}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=r||{},this._maxRetryTime=r&&r.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}Qte.exports=As;As.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};As.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};As.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var r=new Date().getTime();if(e&&r-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1);else return!1;var i=this;return this._timer=setTimeout(function(){i._attempts++,i._operationTimeoutCb&&(i._timeout=setTimeout(function(){i._operationTimeoutCb(i._attempts)},i._operationTimeout),i._options.unref&&i._timeout.unref()),i._fn(i._attempts)},n),this._options.unref&&this._timer.unref(),!0};As.prototype.attempt=f
|
|||
|
|
`).join(`
|
|||
|
|
`+o),e.push(a+"m+"+FE.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=pGe()+r+" "+e[0]}function pGe(){return hn.inspectOpts.hideDate?"":new Date().toISOString()+" "}function dGe(...e){return process.stderr.write(kE.formatWithOptions(hn.inspectOpts,...e)+`
|
|||
|
|
`)}function hGe(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function mGe(){return process.env.DEBUG}function gGe(e){e.inspectOpts={};let r=Object.keys(hn.inspectOpts);for(let n=0;n<r.length;n++)e.inspectOpts[r[n]]=hn.inspectOpts[r[n]]}FE.exports=aF()(hn);var{formatters:lre}=FE.exports;lre.o=function(e){return this.inspectOpts.colors=this.useColors,kE.inspect(e,this.inspectOpts).split(`
|
|||
|
|
`).map(r=>r.trim()).join(" ")};lre.O=function(e){return this.inspectOpts.colors=this.useColors,kE.inspect(e,this.inspectOpts)}});var $E=S(($Mt,uF)=>{"use strict";typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?uF.exports=ore():uF.exports=fre()});var hre=S(Si=>{"use strict";var vGe=Si&&Si.__createBinding||(Object.create?function(e,r,n,i){i===void 0&&(i=n);var a=Object.getOwnPropertyDescriptor(r,n);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(e,i,a)}:function(e,r,n,i){i===void 0&&(i=n),e[i]=r[n]}),yGe=Si&&Si.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),pre=Si&&Si.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&vGe(r,e,n);return yGe(r,e),r};Object.defineProperty(Si,"__esModule",{value:!0});Si.req=Si.json=Si.toBuffer=void 0;var bGe=pre(require("http")),xGe=pre(require("https"));async function dre(e){let r=0,n=[];for await(let i of e)r+=i.length,n.push(i);return Buffer.concat(n,r)}Si.toBuffer=dre;async function wGe(e){let n=(await dre(e)).toString("utf8");try{return JSON.parse(n)}catch(i){let a=i;throw a.message+=` (input: ${n})`,a}}Si.json=wGe;function _Ge(e,r={}){let i=((typeof e=="string"?e:e.href).startsWith("https:")?xGe:bGe).request(e,r),a=new Promise((o,c)=>{i.once("response",o).once("error",c).end()});return i.then=a.then.bind(a),i}Si.req=_Ge});var fF=S(Qi=>{"use strict";var gre=Qi&&Qi.__createBinding||(Object.create?function(e,r,n,i){i===void 0&&(i=n);var a=Object.getOwnPropertyDescriptor(r,n);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(e,i,a)}:function(e,r,n,i){i===void 0&&(i=n),e[i]=r[n]}),EGe=Qi&&Qi.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),SGe=Qi&&Qi.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&gre(r,e,n);return EGe(r,e),r},DGe=Qi&&Qi.__exportStar||function(e,r){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(r,n)&&gre(r,e,n)};Object.defineProperty(Qi,"__esModule",{value:!0});Qi.Agent=void 0;var mre=SGe(require("http"));DGe(hre(),Qi);var Qa=Symbol("AgentBaseInternalState"),lF=class extends mre.Agent{constructor(r){super(r),this[Qa]={}}isSecureEndpoint(r){if(r){if(typeof r.secureEndpoint=="boolean")return r.secureEndpoint;if(typeof r.protocol=="string")return r.protocol==="https:"}let{stack:n}=new Error;return typeof n!="string"?!1:n.split(`
|
|||
|
|
`).some(i=>i.indexOf("(https.js:")!==-1||i.indexOf("node:https:")!==-1)}createSocket(r,n,i){let a={...n,secureEndpoint:this.isSecureEndpoint(n)};Promise.resolve().then(()=>this.connect(r,a)).then(o=>{if(o instanceof mre.Agent)return o.addRequest(r,a);this[Qa].currentSocket=o,super.createSocket(r,n,i)},i)}createConnection(){let r=this[Qa].currentSocket;if(this[Qa].currentSocket=void 0,!r)throw new Error("No socket was returned in the `connect()` function");return r}get defaultPort(){return this[Qa].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(r){this[Qa]&&(this[Qa].defaultPort=r)}get protocol(){return this[Qa].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(r){this[Qa]&&(this[Qa].protocol=r)}};Qi.Agent=lF});var bre=S(Is=>{"use strict";var CGe=Is&&Is.__createBinding||(Object.create?function(e,r,n,i){i===void 0&&(i=n);var a=Object.getOwnPropertyDescriptor(r,n);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(e,i,a)}:function(e,r,n,i){i===void 0&&(i=n),e[i]=r[n]}),PGe=Is&&Is.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),yre=Is&&Is.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&CGe(r,e,n);return PGe(r,e),r},TGe=Is&&Is.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Is,"__esModule",{value:!0});Is.HttpProxyAgent=void 0;var RGe=yre(require("net")),AGe=yre(require("tls")),OGe=TGe($E()),IGe=require("events"),kGe=fF(),vre=require("url"),Wd=(0,OGe.default)("http-proxy-agent"),LE=class extends kGe.Agent{constructor(r,n){super(n),this.proxy=typeof r=="string"?new vre.URL(r):r,this.proxyHeaders=n?.headers??{},Wd("Creating new HttpProxyAgent instance: %o",this.proxy.href);let i=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),a=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={...n?FGe(n,"headers"):null,host:i,port:a}}addRequest(r,n){r._header=null,this.setRequestProps(r,n),super.addRequest(r,n)}setRequestProps(r,n){let{proxy:i}=this,a=n.secureEndpoint?"https:":"http:",o=r.getHeader("host")||"localhost",c=`${a}//${o}`,u=new vre.URL(r.path,c);n.port!==80&&(u.port=String(n.port)),r.path=String(u);let l=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders};if(i.username||i.password){let f=`${decodeURIComponent(i.username)}:${decodeURIComponent(i.password)}`;l["Proxy-Authorization"]=`Basic ${Buffer.from(f).toString("base64")}`}l["Proxy-Connection"]||(l["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let f of Object.keys(l)){let p=l[f];p&&r.setHeader(f,p)}}async connect(r,n){r._header=null,r.path.includes("://")||this.setRequestProps(r,n);let i,a;Wd("Regenerating stored HTTP header string for request"),r._implicitHeader(),r.outputData&&r.outputData.length>0&&(Wd("Patching connection write() output buffer with updated header"),i=r.outputData[0].data,a=i.indexOf(`\r
|
|||
|
|
\r
|
|||
|
|
`)+4,r.outputData[0].data=r._header+i.substring(a),Wd("Output buffer: %o",r.outputData[0].data));let o;return this.proxy.protocol==="https:"?(Wd("Creating `tls.Socket`: %o",this.connectOpts),o=AGe.connect(this.connectOpts)):(Wd("Creating `net.Socket`: %o",this.connectOpts),o=RGe.connect(this.connectOpts)),await(0,IGe.once)(o,"connect"),o}};LE.protocols=["http","https"];Is.HttpProxyAgent=LE;function FGe(e,...r){let n={},i;for(i in e)r.includes(i)||(n[i]=e[i]);return n}});var xre=S(Hd=>{"use strict";var $Ge=Hd&&Hd.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Hd,"__esModule",{value:!0});Hd.parseProxyResponse=void 0;var LGe=$Ge($E()),NE=(0,LGe.default)("https-proxy-agent:parse-proxy-response");function NGe(e){return new Promise((r,n)=>{let i=0,a=[];function o(){let p=e.read();p?f(p):e.once("readable",o)}function c(){e.removeListener("end",u),e.removeListener("error",l),e.removeListener("readable",o)}function u(){c(),NE("onend"),n(new Error("Proxy connection ended before receiving CONNECT response"))}function l(p){c(),NE("onerror %o",p),n(p)}function f(p){a.push(p),i+=p.length;let g=Buffer.concat(a,i),v=g.indexOf(`\r
|
|||
|
|
\r
|
|||
|
|
`);if(v===-1){NE("have not received end of HTTP headers yet..."),o();return}let x=g.slice(0,v).toString("ascii").split(`\r
|
|||
|
|
`),E=x.shift();if(!E)return e.destroy(),n(new Error("No header received from proxy CONNECT response"));let D=E.split(" "),P=+D[1],R=D.slice(2).join(" "),k={};for(let F of x){if(!F)continue;let L=F.indexOf(":");if(L===-1)return e.destroy(),n(new Error(`Invalid header from proxy CONNECT response: "${F}"`));let U=F.slice(0,L).toLowerCase(),V=F.slice(L+1).trimStart(),j=k[U];typeof j=="string"?k[U]=[j,V]:Array.isArray(j)?j.push(V):k[U]=V}NE("got proxy server response: %o %o",E,k),c(),r({connect:{statusCode:P,statusText:R,headers:k},buffered:g})}e.on("error",l),e.on("end",u),o()})}Hd.parseProxyResponse=NGe});var Dre=S(ks=>{"use strict";var MGe=ks&&ks.__createBinding||(Object.create?function(e,r,n,i){i===void 0&&(i=n);var a=Object.getOwnPropertyDescriptor(r,n);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(e,i,a)}:function(e,r,n,i){i===void 0&&(i=n),e[i]=r[n]}),qGe=ks&&ks.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),Ere=ks&&ks.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&MGe(r,e,n);return qGe(r,e),r},Sre=ks&&ks.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ks,"__esModule",{value:!0});ks.HttpsProxyAgent=void 0;var pF=Ere(require("net")),wre=Ere(require("tls")),jGe=Sre(require("assert")),BGe=Sre($E()),UGe=fF(),GGe=require("url"),WGe=xre(),Zv=(0,BGe.default)("https-proxy-agent"),ME=class extends UGe.Agent{constructor(r,n){super(n),this.options={path:void 0},this.proxy=typeof r=="string"?new GGe.URL(r):r,this.proxyHeaders=n?.headers??{},Zv("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let i=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),a=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...n?_re(n,"headers"):null,host:i,port:a}}async connect(r,n){let{proxy:i}=this;if(!n.host)throw new TypeError('No "host" provided');let a;if(i.protocol==="https:"){Zv("Creating `tls.Socket`: %o",this.connectOpts);let v=this.connectOpts.servername||this.connectOpts.host;a=wre.connect({...this.connectOpts,servername:v})}else Zv("Creating `net.Socket`: %o",this.connectOpts),a=pF.connect(this.connectOpts);let o=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},c=pF.isIPv6(n.host)?`[${n.host}]`:n.host,u=`CONNECT ${c}:${n.port} HTTP/1.1\r
|
|||
|
|
`;if(i.username||i.password){let v=`${decodeURIComponent(i.username)}:${decodeURIComponent(i.password)}`;o["Proxy-Authorization"]=`Basic ${Buffer.from(v).toString("base64")}`}o.Host=`${c}:${n.port}`,o["Proxy-Connection"]||(o["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let v of Object.keys(o))u+=`${v}: ${o[v]}\r
|
|||
|
|
`;let l=(0,WGe.parseProxyResponse)(a);a.write(`${u}\r
|
|||
|
|
`);let{connect:f,buffered:p}=await l;if(r.emit("proxyConnect",f),this.emit("proxyConnect",f,r),f.statusCode===200){if(r.once("socket",HGe),n.secureEndpoint){Zv("Upgrading socket connection to TLS");let v=n.servername||n.host;return wre.connect({..._re(n,"host","path","port"),socket:a,servername:v})}return a}a.destroy();let g=new pF.Socket({writable:!1});return g.readable=!0,r.once("socket",v=>{Zv("Replaying proxy buffer for failed request"),(0,jGe.default)(v.listenerCount("data")>0),v.push(p),v.push(null)}),g}};ME.protocols=["http","https"];ks.HttpsProxyAgent=ME;function HGe(e){e.resume()}function _re(e,...r){let n={},i;for(i in e)r.includes(i)||(n[i]=e[i]);return n}});var zre=S((Wre,Hre)=>{"use strict";Wre=Hre.exports=zd;function zd(e,r){if(this.stream=r.stream||process.stderr,typeof r=="number"){var n=r;r={},r.total=n}else{if(r=r||{},typeof e!="string")throw new Error("format required");if(typeof r.total!="number")throw new Error("total required")}this.fmt=e,this.curr=r.curr||0,this.total=r.total,this.width=r.width||this.total,this.clear=r.clear,this.chars={complete:r.complete||"=",incomplete:r.incomplete||"-",head:r.head||r.complete||"="},this.renderThrottle=r.renderThrottle!==0?r.renderThrottle||16:0,this.lastRender=-1/0,this.callback=r.callback||function(){},this.tokens={},this.lastDraw=""}zd.prototype.tick=function(e,r){if(e!==0&&(e=e||1),typeof e=="object"&&(r=e,e=1),r&&(this.tokens=r),this.curr==0&&(this.start=new Date),this.curr+=e,this.render(),this.curr>=this.total){this.render(void 0,!0),this.complete=!0,this.terminate(),this.callback(this);return}};zd.prototype.render=function(e,r){if(r=r!==void 0?r:!1,e&&(this.tokens=e),!!this.stream.isTTY){var n=Date.now(),i=n-this.lastRender;if(!(!r&&i<this.renderThrottle)){this.lastRender=n;var a=this.curr/this.total;a=Math.min(Math.max(a,0),1);var o=Math.floor(a*100),c,u,l,f=new Date-this.start,p=o==100?0:f*(this.total/this.curr-1),g=this.curr/(f/1e3),v=this.fmt.replace(":current",this.curr).replace(":total",this.total).replace(":elapsed",isNaN(f)?"0.0":(f/1e3).toFixed(1)).replace(":eta",isNaN(p)||!isFinite(p)?"0.0":(p/1e3).toFixed(1)).replace(":percent",o.toFixed(0)+"%").replace(":rate",Math.round(g)),x=Math.max(0,this.stream.columns-v.replace(":bar","").length);x&&process.platform==="win32"&&(x=x-1);var E=Math.min(this.width,x);if(l=Math.round(E*a),u=Array(Math.max(0,l+1)).join(this.chars.complete),c=Array(Math.max(0,E-l+1)).join(this.chars.incomplete),l>0&&(u=u.slice(0,-1)+this.chars.head),v=v.replace(":bar",u+c),this.tokens)for(var D in this.tokens)v=v.replace(":"+D,this.tokens[D]);this.lastDraw!==v&&(this.stream.cursorTo(0),this.stream.write(v),this.stream.clearLine(1),this.lastDraw=v)}}};zd.prototype.update=function(e,r){var n=Math.floor(e*this.total),i=n-this.curr;this.tick(i,r)};zd.prototype.interrupt=function(e){this.stream.clearLine(),this.stream.cursorTo(0),this.stream.write(e),this.stream.write(`
|
|||
|
|
`),this.stream.write(this.lastDraw)};zd.prototype.terminate=function(){this.clear?this.stream.clearLine&&(this.stream.clearLine(),this.stream.cursorTo(0)):this.stream.write(`
|
|||
|
|
`)}});var Yre=S((QMt,Vre)=>{"use strict";Vre.exports=zre()});var Jre=S((e4t,QGe)=>{QGe.exports={name:"@prisma/fetch-engine",version:"5.22.0",description:"This package is intended for Prisma's internal use",main:"dist/index.js",types:"dist/index.d.ts",license:"Apache-2.0",author:"Tim Suchanek <suchanek@prisma.io>",homepage:"https://www.prisma.io",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/fetch-engine"},bugs:"https://github.com/prisma/prisma/issues",enginesOverride:{},devDependencies:{"@swc/core":"1.6.13","@swc/jest":"0.2.36","@types/jest":"29.5.12","@types/node":"18.19.31","@types/progress":"2.0.7",del:"6.1.1",execa:"5.1.1","find-cache-dir":"5.0.0","fs-extra":"11.1.1",hasha:"5.2.2","http-proxy-agent":"7.0.2","https-proxy-agent":"7.0.5",jest:"29.7.0",kleur:"4.1.5","node-fetch":"3.3.2","p-filter":"2.1.0","p-map":"4.0.0","p-retry":"4.6.2",progress:"2.0.3",rimraf:"3.0.2","strip-ansi":"6.0.1","temp-dir":"2.0.0",tempy:"1.0.1","timeout-signal":"2.0.0",typescript:"5.4.5"},dependencies:{"@prisma/debug":"workspace:*","@prisma/engines-version":"5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2","@prisma/get-platform":"workspace:*"},scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",test:"jest",prepublishOnly:"pnpm run build"},files:["README.md","dist"],sideEffects:!1}});var Ane=S((P6t,bWe)=>{bWe.exports={name:"dotenv",version:"16.0.3",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{require:"./lib/main.js",types:"./lib/main.d.ts",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^17.0.9",decache:"^4.6.1",dtslint:"^3.7.0",sinon:"^12.0.1",standard:"^16.0.4","standard-markdown":"^7.1.0","standard-version":"^9.3.2",tap:"^15.1.6",tar:"^6.1.11",typescript:"^4.5.4"},engines:{node:">=12"}}});var RF=S((T6t,VE)=>{"use strict";var xWe=require("fs"),One=require("path"),wWe=require("os"),_We=Ane(),EWe=_We.version,SWe=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function DWe(e){let r={},n=e.toString();n=n.replace(/\r\n?/mg,`
|
|||
|
|
`);let i;for(;(i=SWe.exec(n))!=null;){let a=i[1],o=i[2]||"";o=o.trim();let c=o[0];o=o.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),c==='"'&&(o=o.replace(/\\n/g,`
|
|||
|
|
`),o=o.replace(/\\r/g,"\r")),r[a]=o}return r}function TF(e){console.log(`[dotenv@${EWe}][DEBUG] ${e}`)}function CWe(e){return e[0]==="~"?One.join(wWe.homedir(),e.slice(1)):e}function PWe(e){let r=One.resolve(process.cwd(),".env"),n="utf8",i=!!(e&&e.debug),a=!!(e&&e.override);e&&(e.path!=null&&(r=CWe(e.path)),e.encoding!=null&&(n=e.encoding));try{let o=zE.parse(xWe.readFileSync(r,{encoding:n}));return Object.keys(o).forEach(function(c){Object.prototype.hasOwnProperty.call(process.env,c)?(a===!0&&(process.env[c]=o[c]),i&&TF(a===!0?`"${c}" is already defined in \`process.env\` and WAS overwritten`:`"${c}" is already defined in \`process.env\` and was NOT overwritten`)):process.env[c]=o[c]}),{parsed:o}}catch(o){return i&&TF(`Failed to load ${r} ${o.message}`),{error:o}}}var zE={config:PWe,parse:DWe};VE.exports.config=zE.config;VE.exports.parse=zE.parse;VE.exports=zE});var MF=S((r5t,jne)=>{"use strict";var NF=Symbol("arg flag"),Fs=class e extends Error{constructor(r,n){super(r),this.name="ArgError",this.code=n,Object.setPrototypeOf(this,e.prototype)}};function ay(e,{argv:r=process.argv.slice(2),permissive:n=!1,stopAtPositional:i=!1}={}){if(!e)throw new Fs("argument specification object is required","ARG_CONFIG_NO_SPEC");let a={_:[]},o={},c={};for(let u of Object.keys(e)){if(!u)throw new Fs("argument key cannot be an empty string","ARG_CONFIG_EMPTY_KEY");if(u[0]!=="-")throw new Fs(`argument key must start with '-' but found: '${u}'`,"ARG_CONFIG_NONOPT_KEY");if(u.length===1)throw new Fs(`argument key must have a name; singular '-' keys are not allowed: ${u}`,"ARG_CONFIG_NONAME_KEY");if(typeof e[u]=="string"){o[u]=e[u];continue}let l=e[u],f=!1;if(Array.isArray(l)&&l.length===1&&typeof l[0]=="function"){let[p]=l;l=(g,v,x=[])=>(x.push(p(g,v,x[x.length-1])),x),f=p===Boolean||p[NF]===!0}else if(typeof l=="function")f=l===Boolean||l[NF]===!0;else throw new Fs(`type missing or not a function or valid array type: ${u}`,"ARG_CONFIG_VAD_TYPE");if(u[1]!=="-"&&u.length>2)throw new Fs(`short argument keys (with a single hyphen) must have only one character: ${u}`,"ARG_CONFIG_SHORTOPT_TOOLONG");c[u]=[l,f]}for(let u=0,l=r.length;u<l;u++){let f=r[u];if(i&&a._.length>0){a._=a._.concat(r.slice(u));break}if(f==="--"){a._=a._.concat(r.slice(u+1));break}if(f.length>1&&f[0]==="-"){let p=f[1]==="-"||f.length===2?[f]:f.slice(1).split("").map(g=>`-${g}`);for(let g=0;g<p.length;g++){let v=p[g],[x,E]=v[1]==="-"?v.split(/=(.*)/,2):[v,void 0],D=x;for(;D in o;)D=o[D];if(!(D in c))if(n){a._.push(v);continue}else throw new Fs(`unknown or unexpected option: ${x}`,"ARG_UNKNOWN_OPTION");let[P,R]=c[D];if(!R&&g+1<p.length)throw new Fs(`option requires argument (but was followed by another short argument): ${x}`,"ARG_MISSING_REQUIRED_SHORTARG");if(R)a[D]=P(!0,D,a[D]);else if(E===void 0){if(r.length<u+2||r[u+1].length>1&&r[u+1][0]==="-"&&!(r[u+1].match(/^-?\d*(\.(?=\d))?\d*$/)&&(P===Number||typeof BigInt<"u"&&P===BigInt))){let k=x===D?"":` (alias for ${D})`;throw new Fs(`option requires argument: ${x}${k}`,"ARG_MISSING_REQUIRED_LONGARG")}a[D]=P(r[u+1],D,a[D]),++u}else a[D]=P(E,D,a[D])}}else a._.push(f)}return a}ay.flag=e=>(e[NF]=!0,e);ay.COUNT=ay.flag((e,r,n)=>(n||0)+1);ay.ArgError=Fs;jne.exports=ay});var Une=S((n5t,Bne)=>{"use strict";Bne.exports=e=>{let r=e.match(/^[ \t]*(?=\S)/gm);return r?r.reduce((n,i)=>Math.min(n,i.length),1/0):0}});var Wne=S((i5t,Gne)=>{"use strict";var LWe=Une();Gne.exports=e=>{let r=LWe(e);if(r===0)return e;let n=new RegExp(`^[ \\t]{${r}}`,"gm");return e.replace(n,"")}});var G$=S((kqt,dae)=>{"use strict";var QKe=require("os");dae.exports=QKe.homedir||function(){var r=process.env.HOME,n=process.env.LOGNAME||process.env.USER||process.env.LNAME||process.env.USERNAME;return process.platform==="win32"?process.env.USERPROFILE||process.env.HOMEDRIVE+process.env.HOMEPATH||r||null:process.platform==="darwin"?r||(n?"/Users/"+n:null):process.platform==="linux"?r||(process.getuid()===0?"/root":n?"/home/"+n:null):r||null}});var W$=S((Fqt,hae)=>{"use strict";hae.exports=function(){var e=Error.prepareStackTrace;Error.prepareStackTrace=function(n,i){retur
|
|||
|
|
globstar while`,r,g,n,v,x),this.matchOne(r.slice(g),n.slice(v),i))return this.debug("globstar found match!",g,u,x),!0;if(x==="."||x===".."||!a.dot&&x.charAt(0)==="."){this.debug("dot detected!",r,g,n,v);break}this.debug("globstar swallow a segment, and continue"),g++}return!!(i&&(this.debug(`
|
|||
|
|
>>> no match, partial?`,r,g,n,v),g===u))}var E;if(typeof f=="string"?(E=p===f,this.debug("string match",f,p,E)):(E=p.match(f),this.debug("pattern match",f,p,E)),!E)return!1}if(o===u&&c===l)return!0;if(o===u)return i;if(c===l)return o===u-1&&r[o]==="";throw new Error("wtf?")}braceExpand(){return boe(this.pattern,this.options)}parse(r,n){_S(r);let i=this.options;if(r==="**")if(i.noglobstar)r="*";else return wa;if(r==="")return"";let a="",o=!1,c=!1,u=[],l=[],f,p=!1,g=-1,v=-1,x,E,D,P=r.charAt(0)===".",R=i.dot||P,k=()=>P?"":R?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",F=j=>j.charAt(0)==="."?"":i.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",L=()=>{if(f){switch(f){case"*":a+=i3,o=!0;break;case"?":a+=o3,o=!0;break;default:a+="\\"+f;break}this.debug("clearStateChar %j %j",f,a),f=!1}};for(let j=0,W;j<r.length&&(W=r.charAt(j));j++){if(this.debug("%s %s %s %j",r,j,a,W),c){if(W==="/")return!1;goe[W]&&(a+="\\"),a+=W,c=!1;continue}switch(W){case"/":return!1;case"\\":if(p&&r.charAt(j+1)==="-"){a+=W;continue}L(),c=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s %s %s %j <-- stateChar",r,j,a,W),p){this.debug(" in class"),W==="!"&&j===v+1&&(W="^"),a+=W;continue}this.debug("call clearStateChar %j",f),L(),f=W,i.noext&&L();continue;case"(":{if(p){a+="(";continue}if(!f){a+="\\(";continue}let q={type:f,start:j-1,reStart:a.length,open:moe[f].open,close:moe[f].close};this.debug(this.pattern," ",q),u.push(q),a+=q.open,q.start===0&&q.type!=="!"&&(P=!0,a+=F(r.slice(j+1))),this.debug("plType %j %j",f,a),f=!1;continue}case")":{let q=u[u.length-1];if(p||!q){a+="\\)";continue}u.pop(),L(),o=!0,E=q,a+=E.close,E.type==="!"&&l.push(Object.assign(E,{reEnd:a.length}));continue}case"|":{let q=u[u.length-1];if(p||!q){a+="\\|";continue}L(),a+="|",q.start===0&&q.type!=="!"&&(P=!0,a+=F(r.slice(j+1)));continue}case"[":if(L(),p){a+="\\"+W;continue}p=!0,v=j,g=a.length,a+=W;continue;case"]":if(j===v+1||!p){a+="\\"+W;continue}x=r.substring(v+1,j);try{RegExp("["+tJe(ZXe(x))+"]"),a+=W}catch{a=a.substring(0,g)+"(?:$.)"}o=!0,p=!1;continue;default:L(),goe[W]&&!(W==="^"&&p)&&(a+="\\"),a+=W;break}}for(p&&(x=r.slice(v+1),D=this.parse(x,s3),a=a.substring(0,g)+"\\["+D[0],o=o||D[1]),E=u.pop();E;E=u.pop()){let j;j=a.slice(E.reStart+E.open.length),this.debug("setting tail",a,E),j=j.replace(/((?:\\{2}){0,64})(\\?)\|/g,(q,X,M)=>(M||(M="\\"),X+X+M+"|")),this.debug(`tail=%j
|
|||
|
|
%s`,j,j,E,a);let W=E.type==="*"?i3:E.type==="?"?o3:"\\"+E.type;o=!0,a=a.slice(0,E.reStart)+W+"\\("+j}L(),c&&(a+="\\\\");let U=XXe[a.charAt(0)];for(let j=l.length-1;j>-1;j--){let W=l[j],q=a.slice(0,W.reStart),X=a.slice(W.reStart,W.reEnd-8),M=a.slice(W.reEnd),Q=a.slice(W.reEnd-8,W.reEnd)+M,ee=q.split(")").length,ce=q.split("(").length-ee,H=M;for(let ie=0;ie<ce;ie++)H=H.replace(/\)[+*?]?/,"");M=H;let Y=M===""&&n!==s3?"(?:$|\\/)":"";a=q+X+M+Y+Q}if(a!==""&&o&&(a="(?=.)"+a),U&&(a=k()+a),n===s3)return[a,o];if(i.nocase&&!o&&(o=r.toUpperCase()!==r.toLowerCase()),!o)return QXe(r);let V=i.nocase?"i":"";try{return Object.assign(new RegExp("^"+a+"$",V),{_glob:r,_src:a})}catch{return new RegExp("$.")}}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let r=this.set;if(!r.length)return this.regexp=!1,this.regexp;let n=this.options,i=n.noglobstar?i3:n.dot?YXe:KXe,a=n.nocase?"i":"",o=r.map(c=>(c=c.map(u=>typeof u=="string"?eJe(u):u===wa?wa:u._src).reduce((u,l)=>(u[u.length-1]===wa&&l===wa||u.push(l),u),[]),c.forEach((u,l)=>{u!==wa||c[l-1]===wa||(l===0?c.length>1?c[l+1]="(?:\\/|"+i+"\\/)?"+c[l+1]:c[l]=i:l===c.length-1?c[l-1]+="(?:\\/|"+i+")?":(c[l-1]+="(?:\\/|\\/"+i+"\\/)"+c[l+1],c[l+1]=wa))}),c.filter(u=>u!==wa).join("/"))).join("|");o="^(?:"+o+")$",this.negate&&(o="^(?!"+o+").*$");try{this.regexp=new RegExp(o,a)}catch{this.regexp=!1}return this.regexp}match(r,n=this.partial){if(this.debug("match",r,this.pattern),this.comment)return!1;if(this.empty)return r==="";if(r==="/"&&n)return!0;let i=this.options;a3.sep!=="/"&&(r=r.split(a3.sep).join("/")),r=r.split(voe),this.debug(this.pattern,"split",r);let a=this.set;this.debug(this.pattern,"set",a);let o;for(let c=r.length-1;c>=0&&(o=r[c],!o);c--);for(let c=0;c<a.length;c++){let u=a[c],l=r;if(i.matchBase&&u.length===1&&(l=[o]),this.matchOne(l,u,n))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(r){return es.defaults(r).Minimatch}};es.Minimatch=hh});var Soe=S((dBt,Eoe)=>{"use strict";Eoe.exports=_oe;var l3=require("fs"),{EventEmitter:rJe}=require("events"),{Minimatch:u3}=Py(),{resolve:nJe}=require("path");function iJe(e,r){return new Promise((n,i)=>{l3.readdir(e,{withFileTypes:!0},(a,o)=>{if(a)switch(a.code){case"ENOTDIR":r?i(a):n([]);break;case"ENOTSUP":case"ENOENT":case"ENAMETOOLONG":case"UNKNOWN":n([]);break;case"ELOOP":default:i(a);break}else n(o)})})}function xoe(e,r){return new Promise((n,i)=>{(r?l3.stat:l3.lstat)(e,(o,c)=>{if(o)switch(o.code){case"ENOENT":n(r?xoe(e,!1):null);break;default:n(null);break}else n(c)})})}async function*woe(e,r,n,i,a,o){let c=await iJe(r+e,o);for(let u of c){let l=u.name;l===void 0&&(l=u,i=!0);let f=e+"/"+l,p=f.slice(1),g=r+"/"+p,v=null;(i||n)&&(v=await xoe(g,n)),!v&&u.name!==void 0&&(v=u),v===null&&(v={isDirectory:()=>!1}),v.isDirectory()?a(p)||(yield{relative:p,absolute:g,stats:v},yield*woe(f,r,n,i,a,!1)):yield{relative:p,absolute:g,stats:v}}}async function*sJe(e,r,n,i){yield*woe("",e,r,n,i,!0)}function aJe(e){return{pattern:e.pattern,dot:!!e.dot,noglobstar:!!e.noglobstar,matchBase:!!e.matchBase,nocase:!!e.nocase,ignore:e.ignore,skip:e.skip,follow:!!e.follow,stat:!!e.stat,nodir:!!e.nodir,mark:!!e.mark,silent:!!e.silent,absolute:!!e.absolute}}var ES=class extends rJe{constructor(r,n,i){if(super(),typeof n=="function"&&(i=n,n=null),this.options=aJe(n||{}),this.matchers=[],this.options.pattern){let a=Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern];this.matchers=a.map(o=>new u3(o,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase}))}if(this.ignoreMatchers=[],this.options.ignore){let a=Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore];this.ignoreMatchers=a.map(o=>new u3(o,{dot:!0}))}if(this.skipMatchers=[],this.options.skip){let a=Array.isArray(this.options.skip)?this.options.skip:[this.options.skip];this.skipMatchers=a.map(o=>new u3(o,{dot:!0}))}this.iterator=sJe(nJe(r||"."),this.options.follow,this.options.stat,this._shouldSkipDirectory.bind(this)),this.paused=!1,this.inactive=!1,this.
|
|||
|
|
`,n);n=a===-1?e.length:a}else if(i!==-1&&e[n]==="/"&&e[n+1]==="*"){let a=e.indexOf("*/",n);a!==-1?(n=a+2,i=e.indexOf("*/",n)):(r+=e[n],n++)}else r+=e[n],n++;return r}function PJe(e){let r=CJe(e.toString()),n=r.match(_Je);if(n||(n=r.match(EJe)),!n)throw new Error(`could not parse args in autoInject
|
|||
|
|
Source:
|
|||
|
|
`+r);let[,i]=n;return i.replace(/\s/g,"").split(SJe).map(a=>a.replace(DJe,"").trim())}function Moe(e,r){var n={};return Object.keys(e).forEach(i=>{var a=e[i],o,c=Iy(a),u=!c&&a.length===1||c&&a.length===0;if(Array.isArray(a))o=[...a],a=o.pop(),n[i]=o.concat(o.length>0?l:a);else if(u)n[i]=a;else{if(o=PJe(a),a.length===0&&!c&&o.length===0)throw new Error("autoInject task functions require explicit parameters.");c||o.pop(),n[i]=o.concat(l)}function l(f,p){var g=o.map(v=>f[v]);g.push(p),Qe(a)(...g)}}),k3(n,r)}function Toe(e,r){e.length=1,e.head=e.tail=r}function F3(e,r,n){if(r==null)r=1;else if(r===0)throw new RangeError("Concurrency must not be zero");var i=Qe(e),a=0,o=[];let c={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function u(k,F){c[k].push(F)}function l(k,F){let L=(...U)=>{f(k,L),F(...U)};c[k].push(L)}function f(k,F){if(!k)return Object.keys(c).forEach(L=>c[L]=[]);if(!F)return c[k]=[];c[k]=c[k].filter(L=>L!==F)}function p(k,...F){c[k].forEach(L=>L(...F))}var g=!1;function v(k,F,L,U){if(U!=null&&typeof U!="function")throw new Error("task callback must be a function");R.started=!0;var V,j;function W(X,...M){if(X)return L?j(X):V();if(M.length<=1)return V(M[0]);V(M)}var q=R._createTaskItem(k,L?W:U||W);if(F?R._tasks.unshift(q):R._tasks.push(q),g||(g=!0,Tu(()=>{g=!1,R.process()})),L||!U)return new Promise((X,M)=>{V=X,j=M})}function x(k){return function(F,...L){a-=1;for(var U=0,V=k.length;U<V;U++){var j=k[U],W=o.indexOf(j);W===0?o.shift():W>0&&o.splice(W,1),j.callback(F,...L),F!=null&&p("error",F,j.data)}a<=R.concurrency-R.buffer&&p("unsaturated"),R.idle()&&p("drain"),R.process()}}function E(k){return k.length===0&&R.idle()?(Tu(()=>p("drain")),!0):!1}let D=k=>F=>{if(!F)return new Promise((L,U)=>{l(k,(V,j)=>{if(V)return U(V);L(j)})});f(k),u(k,F)};var P=!1,R={_tasks:new p3,_createTaskItem(k,F){return{data:k,callback:F}},*[Symbol.iterator](){yield*R._tasks[Symbol.iterator]()},concurrency:r,payload:n,buffer:r/4,started:!1,paused:!1,push(k,F){return Array.isArray(k)?E(k)?void 0:k.map(L=>v(L,!1,!1,F)):v(k,!1,!1,F)},pushAsync(k,F){return Array.isArray(k)?E(k)?void 0:k.map(L=>v(L,!1,!0,F)):v(k,!1,!0,F)},kill(){f(),R._tasks.empty()},unshift(k,F){return Array.isArray(k)?E(k)?void 0:k.map(L=>v(L,!0,!1,F)):v(k,!0,!1,F)},unshiftAsync(k,F){return Array.isArray(k)?E(k)?void 0:k.map(L=>v(L,!0,!0,F)):v(k,!0,!0,F)},remove(k){R._tasks.remove(k)},process(){if(!P){for(P=!0;!R.paused&&a<R.concurrency&&R._tasks.length;){var k=[],F=[],L=R._tasks.length;R.payload&&(L=Math.min(L,R.payload));for(var U=0;U<L;U++){var V=R._tasks.shift();k.push(V),o.push(V),F.push(V.data)}a+=1,R._tasks.length===0&&p("empty"),a===R.concurrency&&p("saturated");var j=Au(x(k));i(F,j)}P=!1}},length(){return R._tasks.length},running(){return a},workersList(){return o},idle(){return R._tasks.length+a===0},pause(){R.paused=!0},resume(){R.paused!==!1&&(R.paused=!1,Tu(R.process))}};return Object.defineProperties(R,{saturated:{writable:!1,value:D("saturated")},unsaturated:{writable:!1,value:D("unsaturated")},empty:{writable:!1,value:D("empty")},drain:{writable:!1,value:D("drain")},error:{writable:!1,value:D("error")}}),R}function qoe(e,r){return F3(e,1,r)}function joe(e,r,n){return F3(e,r,n)}function TJe(e,r,n,i){i=Ru(i);var a=Qe(n);return io(e,(o,c,u)=>{a(r,o,(l,f)=>{r=f,u(l)})},o=>i(o,r))}function $3(...e){var r=e.map(Qe);return function(...n){var i=this,a=n[n.length-1];return typeof a=="function"?n.pop():a=gh(),mh(r,n,(o,c,u)=>{c.apply(i,o.concat((l,...f)=>{u(l,f)}))},(o,c)=>a(o,...c)),a[vh]}}function Boe(...e){return $3(...e.reverse())}function RJe(e,r,n,i){return O3(_a(r),e,n,i)}function AJe(e,r,n,i){var a=Qe(n);return ky(e,r,(o,c)=>{a(o,(u,...l)=>u?c(u):c(u,l))},(o,c)=>{for(var u=[],l=0;l<c.length;l++)c[l]&&(u=u.concat(...c[l]));return i(o,u)})}function OJe(e,r,n){return Ay(e,1/0,r,n)}function IJe(e,r,n){return Ay(e,1,r,n)}function Uoe(...e){return function(...r){var n=r.pop();return n(null,...e)}}function rc(e,r){return(n,i,a,o)=>{var c=!1,u;let l=Qe(a);n(i,(f,p,g)=>{l(f,(v,x)=>{if(v||v===!1)return g(v);if(e(x)&&!u)return c=!0,u=r(!0,f),g(null,kS);g()})},f=>{if
|
|||
|
|
GFS4: `),console.error(e)});hr[Tn]||(Oce=global[Tn]||[],kce(hr,Oce),hr.close=function(e){function r(n,i){return e.call(hr,n,function(a){a||Ice(),typeof i=="function"&&i.apply(this,arguments)})}return Object.defineProperty(r,US,{value:e}),r}(hr.close),hr.closeSync=function(e){function r(n){e.apply(hr,arguments),Ice()}return Object.defineProperty(r,US,{value:e}),r}(hr.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Pf(hr[Tn]),require("assert").equal(hr[Tn].length,0)}));var Oce;global[Tn]||kce(global,hr[Tn]);G3.exports=B3(wQe(hr));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!hr.__patched&&(G3.exports=B3(hr),hr.__patched=!0);function B3(e){bQe(e),e.gracefulify=B3,e.createReadStream=U,e.createWriteStream=V;var r=e.readFile;e.readFile=n;function n(q,X,M){return typeof X=="function"&&(M=X,X=null),Q(q,X,M);function Q(ee,ce,H,Y){return r(ee,ce,function(ie){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?yh([Q,[ee,ce,H],ie,Y||Date.now(),Date.now()]):typeof H=="function"&&H.apply(this,arguments)})}}var i=e.writeFile;e.writeFile=a;function a(q,X,M,Q){return typeof M=="function"&&(Q=M,M=null),ee(q,X,M,Q);function ee(ce,H,Y,ie,ae){return i(ce,H,Y,function(le){le&&(le.code==="EMFILE"||le.code==="ENFILE")?yh([ee,[ce,H,Y,ie],le,ae||Date.now(),Date.now()]):typeof ie=="function"&&ie.apply(this,arguments)})}}var o=e.appendFile;o&&(e.appendFile=c);function c(q,X,M,Q){return typeof M=="function"&&(Q=M,M=null),ee(q,X,M,Q);function ee(ce,H,Y,ie,ae){return o(ce,H,Y,function(le){le&&(le.code==="EMFILE"||le.code==="ENFILE")?yh([ee,[ce,H,Y,ie],le,ae||Date.now(),Date.now()]):typeof ie=="function"&&ie.apply(this,arguments)})}}var u=e.copyFile;u&&(e.copyFile=l);function l(q,X,M,Q){return typeof M=="function"&&(Q=M,M=0),ee(q,X,M,Q);function ee(ce,H,Y,ie,ae){return u(ce,H,Y,function(le){le&&(le.code==="EMFILE"||le.code==="ENFILE")?yh([ee,[ce,H,Y,ie],le,ae||Date.now(),Date.now()]):typeof ie=="function"&&ie.apply(this,arguments)})}}var f=e.readdir;e.readdir=g;var p=/^v[0-5]\./;function g(q,X,M){typeof X=="function"&&(M=X,X=null);var Q=p.test(process.version)?function(H,Y,ie,ae){return f(H,ee(H,Y,ie,ae))}:function(H,Y,ie,ae){return f(H,Y,ee(H,Y,ie,ae))};return Q(q,X,M);function ee(ce,H,Y,ie){return function(ae,le){ae&&(ae.code==="EMFILE"||ae.code==="ENFILE")?yh([Q,[ce,H,Y],ae,ie||Date.now(),Date.now()]):(le&&le.sort&&le.sort(),typeof Y=="function"&&Y.call(this,ae,le))}}}if(process.version.substr(0,4)==="v0.8"){var v=xQe(e);R=v.ReadStream,F=v.WriteStream}var x=e.ReadStream;x&&(R.prototype=Object.create(x.prototype),R.prototype.open=k);var E=e.WriteStream;E&&(F.prototype=Object.create(E.prototype),F.prototype.open=L),Object.defineProperty(e,"ReadStream",{get:function(){return R},set:function(q){R=q},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return F},set:function(q){F=q},enumerable:!0,configurable:!0});var D=R;Object.defineProperty(e,"FileReadStream",{get:function(){return D},set:function(q){D=q},enumerable:!0,configurable:!0});var P=F;Object.defineProperty(e,"FileWriteStream",{get:function(){return P},set:function(q){P=q},enumerable:!0,configurable:!0});function R(q,X){return this instanceof R?(x.apply(this,arguments),this):R.apply(Object.create(R.prototype),arguments)}function k(){var q=this;W(q.path,q.flags,q.mode,function(X,M){X?(q.autoClose&&q.destroy(),q.emit("error",X)):(q.fd=M,q.emit("open",M),q.read())})}function F(q,X){return this instanceof F?(E.apply(this,arguments),this):F.apply(Object.create(F.prototype),arguments)}function L(){var q=this;W(q.path,q.flags,q.mode,function(X,M){X?(q.destroy(),q.emit("error",X)):(q.fd=M,q.emit("open",M))})}function U(q,X){return new e.ReadStream(q,X)}function V(q,X){return new e.WriteStream(q,X)}var j=e.open;e.open=W;function W(q,X,M,Q){return typeof M=="function"&&(Q=M,M=null),ee(q,X,M,Q);function ee(ce,H,Y,ie,ae){return j(ce,H,Y,function(le,$t){le&&(le.code==="EMFILE"||le.code==="ENFILE")?yh([ee,[ce,H,Y,ie],le,ae||Date.now(),Date.now()]):typeof ie=="function"&&ie.apply(this,arguments)})}}return e}function yh(e){Pf("ENQUEUE",e[0].name,
|
|||
|
|
See: https://github.com/isaacs/node-glob/issues/167`);return new Xr(e,r).found}function Xr(e,r){if(!e)throw new Error("must provide pattern");if(typeof r=="function"||arguments.length===3)throw new TypeError(`callback provided to sync glob
|
|||
|
|
See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof Xr))return new Xr(e,r);if(Oot(this,e,r),this.noprocess)return this;var n=this.minimatch.set.length;this.matches=new Array(n);for(var i=0;i<n;i++)this._process(this.minimatch.set[i],i,!1);this._finish()}Xr.prototype._finish=function(){if(rhe.ok(this instanceof Xr),this.realpath){var e=this;this.matches.forEach(function(r,n){var i=e.matches[n]=Object.create(null);for(var a in r)try{a=e._makeAbs(a);var o=Aot.realpathSync(a,e.realpathCache);i[o]=!0}catch(c){if(c.syscall==="stat")i[e._makeAbs(a)]=!0;else throw c}})}Lf.finish(this)};Xr.prototype._process=function(e,r,n){rhe.ok(this instanceof Xr);for(var i=0;typeof e[i]=="string";)i++;var a;switch(i){case e.length:this._processSimple(e.join("/"),r);return;case 0:a=null;break;default:a=e.slice(0,i).join("/");break}var o=e.slice(i),c;a===null?c=".":((_D(a)||_D(e.map(function(f){return typeof f=="string"?f:"[*]"}).join("/")))&&(!a||!_D(a))&&(a="/"+a),c=a);var u=this._makeAbs(c);if(!Iot(this,c)){var l=o[0]===the.GLOBSTAR;l?this._processGlobStar(a,c,u,o,r,n):this._processReaddir(a,c,u,o,r,n)}};Xr.prototype._processReaddir=function(e,r,n,i,a,o){var c=this._readdir(n,o);if(c){for(var u=i[0],l=!!this.minimatch.negate,f=u._glob,p=this.dot||f.charAt(0)===".",g=[],v=0;v<c.length;v++){var x=c[v];if(x.charAt(0)!=="."||p){var E;l&&!e?E=!x.match(u):E=x.match(u),E&&g.push(x)}}var D=g.length;if(D!==0){if(i.length===1&&!this.mark&&!this.stat){this.matches[a]||(this.matches[a]=Object.create(null));for(var v=0;v<D;v++){var x=g[v];e&&(e.slice(-1)!=="/"?x=e+"/"+x:x=e+x),x.charAt(0)==="/"&&!this.nomount&&(x=i8.join(this.root,x)),this._emitMatch(a,x)}return}i.shift();for(var v=0;v<D;v++){var x=g[v],P;e?P=[e,x]:P=[x],this._process(P.concat(i),a,o)}}}};Xr.prototype._emitMatch=function(e,r){if(!kot(this,r)){var n=this._makeAbs(r);if(this.mark&&(r=this._mark(r)),this.absolute&&(r=n),!this.matches[e][r]){if(this.nodir){var i=this.cache[n];if(i==="DIR"||Array.isArray(i))return}this.matches[e][r]=!0,this.stat&&this._stat(r)}}};Xr.prototype._readdirInGlobStar=function(e){if(this.follow)return this._readdir(e,!1);var r,n,i;try{n=this.fs.lstatSync(e)}catch(o){if(o.code==="ENOENT")return null}var a=n&&n.isSymbolicLink();return this.symlinks[e]=a,!a&&n&&!n.isDirectory()?this.cache[e]="FILE":r=this._readdir(e,!1),r};Xr.prototype._readdir=function(e,r){var n;if(r&&!s8(this.symlinks,e))return this._readdirInGlobStar(e);if(s8(this.cache,e)){var i=this.cache[e];if(!i||i==="FILE")return null;if(Array.isArray(i))return i}try{return this._readdirEntries(e,this.fs.readdirSync(e))}catch(a){return this._readdirError(e,a),null}};Xr.prototype._readdirEntries=function(e,r){if(!this.mark&&!this.stat)for(var n=0;n<r.length;n++){var i=r[n];e==="/"?i=e+i:i=e+"/"+i,this.cache[i]=!0}return this.cache[e]=r,r};Xr.prototype._readdirError=function(e,r){switch(r.code){case"ENOTSUP":case"ENOTDIR":var n=this._makeAbs(e);if(this.cache[n]="FILE",n===this.cwdAbs){var i=new Error(r.code+" invalid cwd "+this.cwd);throw i.path=this.cwd,i.code=r.code,i}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=!1;break;default:if(this.cache[this._makeAbs(e)]=!1,this.strict)throw r;this.silent||console.error("glob error",r);break}};Xr.prototype._processGlobStar=function(e,r,n,i,a,o){var c=this._readdir(n,o);if(c){var u=i.slice(1),l=e?[e]:[],f=l.concat(u);this._process(f,a,!1);var p=c.length,g=this.symlinks[n];if(!(g&&o))for(var v=0;v<p;v++){var x=c[v];if(!(x.charAt(0)==="."&&!this.dot)){var E=l.concat(c[v],u);this._process(E,a,!0);var D=l.concat(c[v],i);this._process(D,a,!0)}}}};Xr.prototype._processSimple=function(e,r){var n=this._stat(e);if(this.matches[r]||(this.matches[r]=Object.create(null)),!!n){if(e&&_D(e)&&!this.nomount){var i=/[\/\\]$/.test(e);e.charAt(0)==="/"?e=i8.join(this.root,e):(e=i8.resolve(this.root,e),i&&(e+="/"))}process.platform==="win32"&&(e=e.replace(/\\/g,"/")),this._emitMatch(r,e)}};Xr.prototype._stat=function(e){var r=this._makeAbs(e),n=e.slice(-1)==="/";if(e.length>this.maxLength)return!1;if(!this.stat&&s8(this.c
|
|||
|
|
`)),r.linkname&&(n+=Y8(" linkpath="+r.linkname+`
|
|||
|
|
`));let i=r.pax;if(i)for(let a in i)n+=Y8(" "+a+"="+i[a]+`
|
|||
|
|
`);return yt.from(n)};Wh.decodePax=function(r){let n={};for(;r.length;){let i=0;for(;i<r.length&&r[i]!==32;)i++;let a=parseInt(r.subarray(0,i).toString(),10);if(!a)return n;let o=yt.toString(r.subarray(i+1,a-1)),c=o.indexOf("=");if(c===-1)return n;n[o.slice(0,c)]=o.slice(c+1),r=r.subarray(a)}return n};Wh.encode=function(r){let n=yt.alloc(512),i=r.name,a="";if(r.typeflag===5&&i[i.length-1]!=="/"&&(i+="/"),yt.byteLength(i)!==i.length)return null;for(;yt.byteLength(i)>100;){let o=i.indexOf("/");if(o===-1)return null;a+=a?"/"+i.slice(0,o):i.slice(0,o),i=i.slice(o+1)}return yt.byteLength(i)>100||yt.byteLength(a)>155||r.linkname&&yt.byteLength(r.linkname)>100?null:(yt.write(n,i),yt.write(n,Gu(r.mode&Yut,6),100),yt.write(n,Gu(r.uid,6),108),yt.write(n,Gu(r.gid,6),116),tlt(r.size,n,124),yt.write(n,Gu(r.mtime.getTime()/1e3|0,11),136),n[156]=$D+Zut(r.type),r.linkname&&yt.write(n,r.linkname,157),yt.copy(Fme,n,w0),yt.copy(Hut,n,K8),r.uname&&yt.write(n,r.uname,265),r.gname&&yt.write(n,r.gname,297),yt.write(n,Gu(r.devmajor||0,6),329),yt.write(n,Gu(r.devminor||0,6),337),a&&yt.write(n,a,345),yt.write(n,Gu(Lme(n),6),148),n)};Wh.decode=function(r,n,i){let a=r[156]===0?0:r[156]-$D,o=Gh(r,0,100,n),c=Uu(r,100,8),u=Uu(r,108,8),l=Uu(r,116,8),f=Uu(r,124,12),p=Uu(r,136,12),g=Qut(a),v=r[157]===0?null:Gh(r,157,100,n),x=Gh(r,265,32),E=Gh(r,297,32),D=Uu(r,329,8),P=Uu(r,337,8),R=Lme(r);if(R===8*32)return null;if(R!==Uu(r,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(Kut(r))r[345]&&(o=Gh(r,345,155,n)+"/"+o);else if(!Xut(r)){if(!i)throw new Error("Invalid tar header: unknown format.")}return a===0&&o&&o[o.length-1]==="/"&&(a=5),{name:o,mode:c,uid:u,gid:l,size:f,mtime:new Date(1e3*p),type:g,linkname:v,uname:x,gname:E,devmajor:D,devminor:P,pax:null}};function Kut(e){return yt.equals(Fme,e.subarray(w0,w0+6))}function Xut(e){return yt.equals(zut,e.subarray(w0,w0+6))&&yt.equals(Vut,e.subarray(K8,K8+2))}function Jut(e,r,n){return typeof e!="number"?n:(e=~~e,e>=r?r:e>=0||(e+=r,e>=0)?e:0)}function Qut(e){switch(e){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null}function Zut(e){switch(e){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0}function $me(e,r,n,i){for(;n<i;n++)if(e[n]===r)return n;return i}function Lme(e){let r=256;for(let n=0;n<148;n++)r+=e[n];for(let n=156;n<512;n++)r+=e[n];return r}function Gu(e,r){return e=e.toString(8),e.length>r?Wut.slice(0,r)+" ":Gut.slice(0,r-e.length)+e+" "}function elt(e,r,n){r[n]=128;for(let i=11;i>0;i--)r[n+i]=e&255,e=Math.floor(e/256)}function tlt(e,r,n){e.toString(8).length>11?elt(e,r,n):yt.write(r,Gu(e,11),n)}function rlt(e){let r;if(e[0]===128)r=!0;else if(e[0]===255)r=!1;else return null;let n=[],i;for(i=e.length-1;i>0;i--){let c=e[i];r?n.push(c):n.push(255-c)}let a=0,o=n.length;for(i=0;i<o;i++)a+=n[i]*Math.pow(256,i);return r?a:-1*a}function Uu(e,r,n){if(e=e.subarray(r,r+n),r=0,e[r]&128)return rlt(e);{for(;r<e.length&&e[r]===32;)r++;let i=Jut($me(e,32,r,e.length),e.length,e.length);for(;r<i&&e[r]===0;)r++;return i===r?0:parseInt(e.subarray(r,i).toString(),8)}}function Gh(e,r,n,i){return yt.toString(e.subarray(r,$me(e,0,r,r+n)),i)}function Y8(e){let r=yt.byteLength(e),n=Math.floor(Math.log(r)/Math.log(10))+1;return r+n>=Math.pow(10,n)&&n++,r+n+e}});var Bme=S((w7t,jme)=>{"use strict";var{Writable:nlt,Readable:ilt,getStreamError:Nme}=V8(),slt=O8(),Mme=FD(),Hh=X8(),alt=Mme.alloc(0),Q8=class{constructor(){this.buffered=0,this.shifted=0,this.queue=new slt,this._offset=0}push(r){this.buffered+=r.byteLength,this.queue.push(r)}shiftFirst(r){return this._buffered===0?null:this._next(r)}shift(r){
|
|||
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,c=!1,u;return{s:function(){n=n.call(e)},n:function(){var f=n.next();return o=f.done,f},e:function(f){c=!0,u=f},f:function(){try{!o&&n.return!=null&&n.return()}finally{if(c)throw u}}}}function Ylt(e,r){if(e){if(typeof e=="string")return Xge(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xge(e,r)}}function Xge(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,i=new Array(r);n<r;n++)i[n]=e[n];return i}var Klt=qD(),Qge=vr(),Jge=Qge.erase,Xlt=Qge.cursor,Jlt=e=>[...Klt(e)].length;Zge.exports=function(e,r){if(!r)return Jge.line+Xlt.to(0);let n=0,i=e.split(/\r?\n/);var a=Vlt(i),o;try{for(a.s();!(o=a.n()).done;){let c=o.value;n+=1+Math.floor(Math.max(Jlt(c)-1,0)/r)}}catch(c){a.e(c)}finally{a.f()}return Jge.lines(n)}});var _N=S((rGt,tve)=>{"use strict";var S0={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},Qlt={arrowUp:S0.arrowUp,arrowDown:S0.arrowDown,arrowLeft:S0.arrowLeft,arrowRight:S0.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},Zlt=process.platform==="win32"?Qlt:S0;tve.exports=Zlt});var nve=S((nGt,rve)=>{"use strict";var em=mr(),zf=_N(),EN=Object.freeze({password:{scale:1,render:e=>"*".repeat(e.length)},emoji:{scale:2,render:e=>"\u{1F603}".repeat(e.length)},invisible:{scale:0,render:e=>""},default:{scale:1,render:e=>`${e}`}}),eft=e=>EN[e]||EN.default,D0=Object.freeze({aborted:em.red(zf.cross),done:em.green(zf.tick),exited:em.yellow(zf.cross),default:em.cyan("?")}),tft=(e,r,n)=>r?D0.aborted:n?D0.exited:e?D0.done:D0.default,rft=e=>em.gray(e?zf.ellipsis:zf.pointerSmall),nft=(e,r)=>em.gray(e?r?zf.pointerSmall:"+":zf.line);rve.exports={styles:EN,render:eft,symbols:D0,symbol:tft,delimiter:rft,item:nft}});var sve=S((iGt,ive)=>{"use strict";var ift=qD();ive.exports=function(e,r){let n=String(ift(e)||"").split(/\r?\n/);return r?n.map(i=>Math.ceil(i.length/r)).reduce((i,a)=>i+a):n.length}});var ove=S((sGt,ave)=>{"use strict";ave.exports=(e,r={})=>{let n=Number.isSafeInteger(parseInt(r.margin))?new Array(parseInt(r.margin)).fill(" ").join(""):r.margin||"",i=r.width;return(e||"").split(/\r?\n/g).map(a=>a.split(/\s+/g).reduce((o,c)=>(c.length+n.length>=i||o[o.length-1].length+c.length+1<i?o[o.length-1]+=` ${c}`:o.push(`${n}${c}`),o),[n]).join(`
|
|||
|
|
`)).join(`
|
|||
|
|
`)}});var uve=S((aGt,cve)=>{"use strict";cve.exports=(e,r,n)=>{n=n||r;let i=Math.min(r-n,e-Math.floor(n/2));i<0&&(i=0);let a=Math.min(i+n,r);return{startIndex:i,endIndex:a}}});var Da=S((oGt,lve)=>{"use strict";lve.exports={action:Vge(),clear:eve(),style:nve(),strip:qD(),figures:_N(),lines:sve(),wrap:ove(),entriesToDisplay:uve()}});var lc=S((cGt,dve)=>{"use strict";var fve=require("readline"),sft=Da(),aft=sft.action,oft=require("events"),pve=vr(),cft=pve.beep,uft=pve.cursor,lft=mr(),SN=class extends oft{constructor(r={}){super(),this.firstRender=!0,this.in=r.stdin||process.stdin,this.out=r.stdout||process.stdout,this.onRender=(r.onRender||(()=>{})).bind(this);let n=fve.createInterface({input:this.in,escapeCodeTimeout:50});fve.emitKeypressEvents(this.in,n),this.in.isTTY&&this.in.setRawMode(!0);let i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,a=(o,c)=>{let u=aft(c,i);u===!1?this._&&this._(o,c):typeof this[u]=="function"?this[u](c):this.bell()};this.close=()=>{this.out.write(uft.show),this.in.removeListener("keypress",a),this.in.isTTY&&this.in.setRawMode(!1),n.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",a)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(cft)}render(){this.onRender(lft),this.firstRender&&(this.firstRender=!1)}};dve.exports=SN});var yve=S((uGt,vve)=>{"use strict";function hve(e,r,n,i,a,o,c){try{var u=e[o](c),l=u.value}catch(f){n(f);return}u.done?r(l):Promise.resolve(l).then(i,a)}function mve(e){return function(){var r=this,n=arguments;return new Promise(function(i,a){var o=e.apply(r,n);function c(l){hve(o,i,a,c,u,"next",l)}function u(l){hve(o,i,a,c,u,"throw",l)}c(void 0)})}}var jD=mr(),fft=lc(),gve=vr(),pft=gve.erase,C0=gve.cursor,BD=Da(),DN=BD.style,CN=BD.clear,dft=BD.lines,hft=BD.figures,PN=class extends fft{constructor(r={}){super(r),this.transform=DN.render(r.style),this.scale=this.transform.scale,this.msg=r.message,this.initial=r.initial||"",this.validator=r.validate||(()=>!0),this.value="",this.errorMsg=r.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=CN("",this.out.columns),this.render()}set value(r){!r&&this.initial?(this.placeholder=!0,this.rendered=jD.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(r)),this._value=r,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}validate(){var r=this;return mve(function*(){let n=yield r.validator(r.value);typeof n=="string"&&(r.errorMsg=n,n=!1),r.error=!n})()}submit(){var r=this;return mve(function*(){if(r.value=r.value||r.initial,r.cursorOffset=0,r.cursor=r.rendered.length,yield r.validate(),r.error){r.red=!0,r.fire(),r.render();return}r.done=!0,r.aborted=!1,r.fire(),r.render(),r.out.write(`
|
|||
|
|
`),r.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(r){this.placeholder||(this.cursor=this.cursor+r,this.cursorOffset+=r)}_(r,n){let i=this.value.slice(0,this.cursor),a=this.value.slice(this.cursor);this.value=`${i}${r}${a}`,this.red=!1,this.cursor=this.placeholder?0:i.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let r=this.value.slice(0,this.cursor-1),n=this.value.slice(this.cursor);this.value=`${r}${n}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let r=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor+1);this.value=`${r}${n}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(C0.down(dft(this.outputError,this.out.columns)-1)+CN(this.outputError,this.out.columns)),this.out.write(CN(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[DN.symbol(this.done,this.aborted),jD.bold(this.msg),DN.delimiter(this.done),this.red?jD.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|||
|
|
`).reduce((r,n,i)=>r+`
|
|||
|
|
${i?" ":hft.pointerSmall} ${jD.red().italic(n)}`,"")),this.out.write(pft.line+C0.to(0)+this.outputText+C0.save+this.outputError+C0.restore+C0.move(this.cursorOffset,0)))}};vve.exports=PN});var _ve=S((lGt,wve)=>{"use strict";var fc=mr(),mft=lc(),P0=Da(),bve=P0.style,xve=P0.clear,UD=P0.figures,gft=P0.wrap,vft=P0.entriesToDisplay,yft=vr(),bft=yft.cursor,TN=class extends mft{constructor(r={}){super(r),this.msg=r.message,this.hint=r.hint||"- Use arrow-keys. Return to submit.",this.warn=r.warn||"- This option is disabled",this.cursor=r.initial||0,this.choices=r.choices.map((n,i)=>(typeof n=="string"&&(n={title:n,value:i}),{title:n&&(n.title||n.value||n),value:n&&(n.value===void 0?i:n.value),description:n&&n.description,selected:n&&n.selected,disabled:n&&n.disabled})),this.optionsPerPage=r.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=xve("",this.out.columns),this.render()}moveCursor(r){this.cursor=r,this.value=this.choices[r].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(r,n){if(r===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(bft.hide):this.out.write(xve(this.outputText,this.out.columns)),super.render();let r=vft(this.cursor,this.choices.length,this.optionsPerPage),n=r.startIndex,i=r.endIndex;if(this.outputText=[bve.symbol(this.done,this.aborted),fc.bold(this.msg),bve.delimiter(!1),this.done?this.selection.title:this.selection.disabled?fc.yellow(this.warn):fc.gray(this.hint)].join(" "),!this.done){this.outputText+=`
|
|||
|
|
`;for(let a=n;a<i;a++){let o,c,u="",l=this.choices[a];a===n&&n>0?c=UD.arrowUp:a===i-1&&i<this.choices.length?c=UD.arrowDown:c=" ",l.disabled?(o=this.cursor===a?fc.gray().underline(l.title):fc.strikethrough().gray(l.title),c=(this.cursor===a?fc.bold().gray(UD.pointer)+" ":" ")+c):(o=this.cursor===a?fc.cyan().underline(l.title):l.title,c=(this.cursor===a?fc.cyan(UD.pointer)+" ":" ")+c,l.description&&this.cursor===a&&(u=` - ${l.description}`,(c.length+o.length+u.length>=this.out.columns||l.description.split(/\r?\n/).length>1)&&(u=`
|
|||
|
|
`+gft(l.description,{margin:3,width:this.out.columns})))),this.outputText+=`${c} ${o}${fc.gray(u)}
|
|||
|
|
`}}this.out.write(this.outputText)}};wve.exports=TN});var Tve=S((fGt,Pve)=>{"use strict";var GD=mr(),xft=lc(),Dve=Da(),Eve=Dve.style,wft=Dve.clear,Cve=vr(),Sve=Cve.cursor,_ft=Cve.erase,RN=class extends xft{constructor(r={}){super(r),this.msg=r.message,this.value=!!r.initial,this.active=r.active||"on",this.inactive=r.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(r,n){if(r===" ")this.value=!this.value;else if(r==="1")this.value=!0;else if(r==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(Sve.hide):this.out.write(wft(this.outputText,this.out.columns)),super.render(),this.outputText=[Eve.symbol(this.done,this.aborted),GD.bold(this.msg),Eve.delimiter(this.done),this.value?this.inactive:GD.cyan().underline(this.inactive),GD.gray("/"),this.value?GD.cyan().underline(this.active):this.active].join(" "),this.out.write(_ft.line+Sve.to(0)+this.outputText))}};Pve.exports=RN});var lo=S((pGt,Rve)=>{"use strict";var AN=class e{constructor({token:r,date:n,parts:i,locales:a}){this.token=r,this.date=n||new Date,this.parts=i||[this],this.locales=a||{}}up(){}down(){}next(){let r=this.parts.indexOf(this);return this.parts.find((n,i)=>i>r&&n instanceof e)}setTo(r){}prev(){let r=[].concat(this.parts).reverse(),n=r.indexOf(this);return r.find((i,a)=>a>n&&i instanceof e)}toString(){return String(this.date)}};Rve.exports=AN});var Ove=S((dGt,Ave)=>{"use strict";var Eft=lo(),ON=class extends Eft{constructor(r={}){super(r)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let r=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?r.toUpperCase():r}};Ave.exports=ON});var kve=S((hGt,Ive)=>{"use strict";var Sft=lo(),Dft=e=>(e=e%10,e===1?"st":e===2?"nd":e===3?"rd":"th"),IN=class extends Sft{constructor(r={}){super(r)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(r){this.date.setDate(parseInt(r.substr(-2)))}toString(){let r=this.date.getDate(),n=this.date.getDay();return this.token==="DD"?String(r).padStart(2,"0"):this.token==="Do"?r+Dft(r):this.token==="d"?n+1:this.token==="ddd"?this.locales.weekdaysShort[n]:this.token==="dddd"?this.locales.weekdays[n]:r}};Ive.exports=IN});var $ve=S((mGt,Fve)=>{"use strict";var Cft=lo(),kN=class extends Cft{constructor(r={}){super(r)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(r){this.date.setHours(parseInt(r.substr(-2)))}toString(){let r=this.date.getHours();return/h/.test(this.token)&&(r=r%12||12),this.token.length>1?String(r).padStart(2,"0"):r}};Fve.exports=kN});var Nve=S((gGt,Lve)=>{"use strict";var Pft=lo(),FN=class extends Pft{constructor(r={}){super(r)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(r){this.date.setMilliseconds(parseInt(r.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};Lve.exports=FN});var qve=S((vGt,Mve)=>{"use strict";var Tft=lo(),$N=class extends Tft{constructor(r={}){super(r)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(r){this.date.setMinutes(parseInt(r.substr(-2)))}toString(){let r=this.date.getMinutes();return this.token.length>1?String(r).padStart(2,"0"):r}};Mve.exports=$N});var Bve=S((yGt,jve)=>{"use strict";var Rft=lo(),LN=class extends Rft{constructor(r={}){super(r)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(r){r=parseInt(r.substr(-2))-1,this.date.setMonth(r<0?0:r)}toString(){let r=this.date.getMonth(),n=this.token.length;return n===2?String(r+1).padStart(2,"0"):n===3?this.locales.monthsShort[r]:n===4?this.locales.months[r]:String(r+1)}};jve.exports=LN});var Gve=S((bGt,Uve)=>{"use strict";var Aft=lo(),NN=class extends Aft{constructor(r={}){super(r)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(r){this.date.setSeconds(parseInt(r.s
|
|||
|
|
`),this.close()}validate(){var r=this;return Kve(function*(){let n=yield r.validator(r.value);typeof n=="string"&&(r.errorMsg=n,n=!1),r.error=!n})()}submit(){var r=this;return Kve(function*(){if(yield r.validate(),r.error){r.color="red",r.fire(),r.render();return}r.done=!0,r.aborted=!1,r.fire(),r.render(),r.out.write(`
|
|||
|
|
`),r.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let r=this.parts[this.cursor].prev();if(r==null)return this.bell();this.moveCursor(this.parts.indexOf(r)),this.render()}right(){let r=this.parts[this.cursor].next();if(r==null)return this.bell();this.moveCursor(this.parts.indexOf(r)),this.render()}next(){let r=this.parts[this.cursor].next();this.moveCursor(r?this.parts.indexOf(r):this.parts.findIndex(n=>n instanceof Zve)),this.render()}_(r){/\d/.test(r)&&(this.typed+=r,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(Qve.hide):this.out.write(Jve(this.outputText,this.out.columns)),super.render(),this.outputText=[Xve.symbol(this.done,this.aborted),qN.bold(this.msg),Xve.delimiter(!1),this.parts.reduce((r,n,i)=>r.concat(i===this.cursor&&!this.done?qN.cyan().underline(n.toString()):n),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
|
|||
|
|
`).reduce((r,n,i)=>r+`
|
|||
|
|
${i?" ":kft.pointerSmall} ${qN.red().italic(n)}`,"")),this.out.write(Fft.line+Qve.to(0)+this.outputText))}};rye.exports=jN});var lye=S((EGt,uye)=>{"use strict";function iye(e,r,n,i,a,o,c){try{var u=e[o](c),l=u.value}catch(f){n(f);return}u.done?r(l):Promise.resolve(l).then(i,a)}function sye(e){return function(){var r=this,n=arguments;return new Promise(function(i,a){var o=e.apply(r,n);function c(l){iye(o,i,a,c,u,"next",l)}function u(l){iye(o,i,a,c,u,"throw",l)}c(void 0)})}}var WD=mr(),Hft=lc(),cye=vr(),HD=cye.cursor,zft=cye.erase,zD=Da(),UN=zD.style,Vft=zD.figures,aye=zD.clear,Yft=zD.lines,Kft=/[0-9]/,GN=e=>e!==void 0,oye=(e,r)=>{let n=Math.pow(10,r);return Math.round(e*n)/n},WN=class extends Hft{constructor(r={}){super(r),this.transform=UN.render(r.style),this.msg=r.message,this.initial=GN(r.initial)?r.initial:"",this.float=!!r.float,this.round=r.round||2,this.inc=r.increment||1,this.min=GN(r.min)?r.min:-1/0,this.max=GN(r.max)?r.max:1/0,this.errorMsg=r.error||"Please Enter A Valid Value",this.validator=r.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(r){!r&&r!==0?(this.placeholder=!0,this.rendered=WD.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${oye(r,this.round)}`),this._value=oye(r,this.round)),this.fire()}get value(){return this._value}parse(r){return this.float?parseFloat(r):parseInt(r)}valid(r){return r==="-"||r==="."&&this.float||Kft.test(r)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let r=this.value;this.value=r!==""?r:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}validate(){var r=this;return sye(function*(){let n=yield r.validator(r.value);typeof n=="string"&&(r.errorMsg=n,n=!1),r.error=!n})()}submit(){var r=this;return sye(function*(){if(yield r.validate(),r.error){r.color="red",r.fire(),r.render();return}let n=r.value;r.value=n!==""?n:r.initial,r.done=!0,r.aborted=!1,r.error=!1,r.fire(),r.render(),r.out.write(`
|
|||
|
|
`),r.close()})()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let r=this.value.toString();if(r.length===0)return this.bell();this.value=this.parse(r=r.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(r,n){if(!this.valid(r))return this.bell();let i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=r,this.lastHit=i,this.color="cyan",r===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(HD.down(Yft(this.outputError,this.out.columns)-1)+aye(this.outputError,this.out.columns)),this.out.write(aye(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[UN.symbol(this.done,this.aborted),WD.bold(this.msg),UN.delimiter(this.done),!this.done||!this.done&&!this.placeholder?WD[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|||
|
|
`).reduce((r,n,i)=>r+`
|
|||
|
|
${i?" ":Vft.pointerSmall} ${WD.red().italic(n)}`,"")),this.out.write(zft.line+HD.to(0)+this.outputText+HD.save+this.outputError+HD.restore))}};uye.exports=WN});var zN=S((SGt,dye)=>{"use strict";var fo=mr(),Xft=vr(),Jft=Xft.cursor,Qft=lc(),T0=Da(),fye=T0.clear,Vu=T0.figures,pye=T0.style,Zft=T0.wrap,ept=T0.entriesToDisplay,HN=class extends Qft{constructor(r={}){super(r),this.msg=r.message,this.cursor=r.cursor||0,this.scrollIndex=r.cursor||0,this.hint=r.hint||"",this.warn=r.warn||"- This option is disabled -",this.minSelected=r.min,this.showMinError=!1,this.maxChoices=r.max,this.instructions=r.instructions,this.optionsPerPage=r.optionsPerPage||10,this.value=r.choices.map((n,i)=>(typeof n=="string"&&(n={title:n,value:i}),{title:n&&(n.title||n.value||n),description:n&&n.description,value:n&&(n.value===void 0?i:n.value),selected:n&&n.selected,disabled:n&&n.disabled})),this.clear=fye("",this.out.columns),r.overrideRender||this.render()}reset(){this.value.map(r=>!r.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(r=>r.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}submit(){let r=this.value.filter(n=>n.selected);this.minSelected&&r.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let r=this.value[this.cursor];if(r.selected)r.selected=!1,this.render();else{if(r.disabled||this.value.filter(n=>n.selected).length>=this.maxChoices)return this.bell();r.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let r=!this.value[this.cursor].selected;this.value.filter(n=>!n.disabled).forEach(n=>n.selected=r),this.render()}_(r,n){if(r===" ")this.handleSpaceToggle();else if(r==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|||
|
|
Instructions:
|
|||
|
|
${Vu.arrowUp}/${Vu.arrowDown}: Highlight option
|
|||
|
|
${Vu.arrowLeft}/${Vu.arrowRight}/[space]: Toggle selection
|
|||
|
|
`+(this.maxChoices===void 0?` a: Toggle all
|
|||
|
|
`:"")+" enter/return: Complete answer":""}renderOption(r,n,i,a){let o=(n.selected?fo.green(Vu.radioOn):Vu.radioOff)+" "+a+" ",c,u;return n.disabled?c=r===i?fo.gray().underline(n.title):fo.strikethrough().gray(n.title):(c=r===i?fo.cyan().underline(n.title):n.title,r===i&&n.description&&(u=` - ${n.description}`,(o.length+c.length+u.length>=this.out.columns||n.description.split(/\r?\n/).length>1)&&(u=`
|
|||
|
|
`+Zft(n.description,{margin:o.length,width:this.out.columns})))),o+c+fo.gray(u||"")}paginateOptions(r){if(r.length===0)return fo.red("No matches for this query.");let n=ept(this.cursor,r.length,this.optionsPerPage),i=n.startIndex,a=n.endIndex,o,c=[];for(let u=i;u<a;u++)u===i&&i>0?o=Vu.arrowUp:u===a-1&&a<r.length?o=Vu.arrowDown:o=" ",c.push(this.renderOption(this.cursor,r[u],u,o));return`
|
|||
|
|
`+c.join(`
|
|||
|
|
`)}renderOptions(r){return this.done?"":this.paginateOptions(r)}renderDoneOrInstructions(){if(this.done)return this.value.filter(n=>n.selected).map(n=>n.title).join(", ");let r=[fo.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&r.push(fo.yellow(this.warn)),r.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Jft.hide),super.render();let r=[pye.symbol(this.done,this.aborted),fo.bold(this.msg),pye.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(r+=fo.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),r+=this.renderOptions(this.value),this.out.write(this.clear+r),this.clear=fye(r,this.out.columns)}};dye.exports=HN});var xye=S((DGt,bye)=>{"use strict";function hye(e,r,n,i,a,o,c){try{var u=e[o](c),l=u.value}catch(f){n(f);return}u.done?r(l):Promise.resolve(l).then(i,a)}function tpt(e){return function(){var r=this,n=arguments;return new Promise(function(i,a){var o=e.apply(r,n);function c(l){hye(o,i,a,c,u,"next",l)}function u(l){hye(o,i,a,c,u,"throw",l)}c(void 0)})}}var R0=mr(),rpt=lc(),yye=vr(),npt=yye.erase,mye=yye.cursor,A0=Da(),VN=A0.style,gye=A0.clear,YN=A0.figures,ipt=A0.wrap,spt=A0.entriesToDisplay,vye=(e,r)=>e[r]&&(e[r].value||e[r].title||e[r]),apt=(e,r)=>e[r]&&(e[r].title||e[r].value||e[r]),opt=(e,r)=>{let n=e.findIndex(i=>i.value===r||i.title===r);return n>-1?n:void 0},KN=class extends rpt{constructor(r={}){super(r),this.msg=r.message,this.suggest=r.suggest,this.choices=r.choices,this.initial=typeof r.initial=="number"?r.initial:opt(r.choices,r.initial),this.select=this.initial||r.cursor||0,this.i18n={noMatches:r.noMatches||"no matches found"},this.fallback=r.fallback||this.initial,this.clearFirst=r.clearFirst||!1,this.suggestions=[],this.input="",this.limit=r.limit||10,this.cursor=0,this.transform=VN.render(r.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=gye("",this.out.columns),this.complete(this.render),this.render()}set fallback(r){this._fb=Number.isSafeInteger(parseInt(r))?parseInt(r):r}get fallback(){let r;return typeof this._fb=="number"?r=this.choices[this._fb]:typeof this._fb=="string"&&(r={title:this._fb}),r||this._fb||{title:this.i18n.noMatches}}moveSelect(r){this.select=r,this.suggestions.length>0?this.value=vye(this.suggestions,r):this.value=this.fallback.value,this.fire()}complete(r){var n=this;return tpt(function*(){let i=n.completing=n.suggest(n.input,n.choices),a=yield i;if(n.completing!==i)return;n.suggestions=a.map((c,u,l)=>({title:apt(l,u),value:vye(l,u),description:c.description})),n.completing=!1;let o=Math.max(a.length-1,0);n.moveSelect(Math.min(o,n.select)),r&&r()})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}_(r,n){let i=this.input.slice(0,this.cursor),a=this.input.slice(this.cursor);this.input=`${i}${r}${a}`,this.cursor=i.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let r=this.input.slice(0,this.cursor-1),n=this.input.slice(this.cursor);this.input=`${r}${n}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let r=this.input.slice(0,this.cursor),n=this.input.slice(this.cursor+1);this.input=`${r}${n}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(r,n,i,a){let o,c=i?YN.arrowUp:a?YN.arrowDown:" ",u=n?R0.cyan().underline(r.title):r.title;return c=(n?R0.cyan(YN.pointer)+" ":" ")+c,r.description&&(o=` - ${r.description}`,(c.length+u.length+o.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(o=`
|
|||
|
|
`+ipt(r.description,{margin:3,width:this.out.columns}))),c+" "+u+R0.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(mye.hide):this.out.write(gye(this.outputText,this.out.columns)),super.render();let r=spt(this.select,this.choices.length,this.limit),n=r.startIndex,i=r.endIndex;if(this.outputText=[VN.symbol(this.done,this.aborted,this.exited),R0.bold(this.msg),VN.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let a=this.suggestions.slice(n,i).map((o,c)=>this.renderOption(o,this.select===c+n,c===0&&n>0,c+n===i-1&&i<this.choices.length)).join(`
|
|||
|
|
`);this.outputText+=`
|
|||
|
|
`+(a||R0.gray(this.fallback.title))}this.out.write(npt.line+mye.to(0)+this.outputText)}};bye.exports=KN});var Sye=S((CGt,Eye)=>{"use strict";var dc=mr(),cpt=vr(),upt=cpt.cursor,lpt=zN(),JN=Da(),wye=JN.clear,_ye=JN.style,tm=JN.figures,XN=class extends lpt{constructor(r={}){r.overrideRender=!0,super(r),this.inputValue="",this.clear=wye("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let r=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let n=this.filteredOptions.findIndex(i=>i===r);this.cursor=n<0?0:n,this.render()}handleSpaceToggle(){let r=this.filteredOptions[this.cursor];if(r.selected)r.selected=!1,this.render();else{if(r.disabled||this.value.filter(n=>n.selected).length>=this.maxChoices)return this.bell();r.selected=!0,this.render()}}handleInputChange(r){this.inputValue=this.inputValue+r,this.updateFilteredOptions()}_(r,n){r===" "?this.handleSpaceToggle():this.handleInputChange(r)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|||
|
|
Instructions:
|
|||
|
|
${tm.arrowUp}/${tm.arrowDown}: Highlight option
|
|||
|
|
${tm.arrowLeft}/${tm.arrowRight}/[space]: Toggle selection
|
|||
|
|
[a,b,c]/delete: Filter choices
|
|||
|
|
enter/return: Complete answer
|
|||
|
|
`:""}renderCurrentInput(){return`
|
|||
|
|
Filtered results for: ${this.inputValue?this.inputValue:dc.gray("Enter something to filter")}
|
|||
|
|
`}renderOption(r,n,i){let a;return n.disabled?a=r===i?dc.gray().underline(n.title):dc.strikethrough().gray(n.title):a=r===i?dc.cyan().underline(n.title):n.title,(n.selected?dc.green(tm.radioOn):tm.radioOff)+" "+a}renderDoneOrInstructions(){if(this.done)return this.value.filter(n=>n.selected).map(n=>n.title).join(", ");let r=[dc.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&r.push(dc.yellow(this.warn)),r.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(upt.hide),super.render();let r=[_ye.symbol(this.done,this.aborted),dc.bold(this.msg),_ye.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(r+=dc.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),r+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+r),this.clear=wye(r,this.out.columns)}};Eye.exports=XN});var Oye=S((PGt,Aye)=>{"use strict";var Dye=mr(),fpt=lc(),Tye=Da(),Cye=Tye.style,ppt=Tye.clear,Rye=vr(),dpt=Rye.erase,Pye=Rye.cursor,QN=class extends fpt{constructor(r={}){super(r),this.msg=r.message,this.value=r.initial,this.initialValue=!!r.initial,this.yesMsg=r.yes||"yes",this.yesOption=r.yesOption||"(Y/n)",this.noMsg=r.no||"no",this.noOption=r.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}_(r,n){return r.toLowerCase()==="y"?(this.value=!0,this.submit()):r.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(Pye.hide):this.out.write(ppt(this.outputText,this.out.columns)),super.render(),this.outputText=[Cye.symbol(this.done,this.aborted),Dye.bold(this.msg),Cye.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Dye.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(dpt.line+Pye.to(0)+this.outputText))}};Aye.exports=QN});var kye=S((TGt,Iye)=>{"use strict";Iye.exports={TextPrompt:yve(),SelectPrompt:_ve(),TogglePrompt:Tve(),DatePrompt:nye(),NumberPrompt:lye(),MultiselectPrompt:zN(),AutocompletePrompt:xye(),AutocompleteMultiselectPrompt:Sye(),ConfirmPrompt:Oye()}});var $ye=S(Fye=>{"use strict";var Pi=Fye,hpt=kye(),VD=e=>e;function po(e,r,n={}){return new Promise((i,a)=>{let o=new hpt[e](r),c=n.onAbort||VD,u=n.onSubmit||VD,l=n.onExit||VD;o.on("state",r.onState||VD),o.on("submit",f=>i(u(f))),o.on("exit",f=>i(l(f))),o.on("abort",f=>a(c(f)))})}Pi.text=e=>po("TextPrompt",e);Pi.password=e=>(e.style="password",Pi.text(e));Pi.invisible=e=>(e.style="invisible",Pi.text(e));Pi.number=e=>po("NumberPrompt",e);Pi.date=e=>po("DatePrompt",e);Pi.confirm=e=>po("ConfirmPrompt",e);Pi.list=e=>{let r=e.separator||",";return po("TextPrompt",e,{onSubmit:n=>n.split(r).map(i=>i.trim())})};Pi.toggle=e=>po("TogglePrompt",e);Pi.select=e=>po("SelectPrompt",e);Pi.multiselect=e=>{e.choices=[].concat(e.choices||[]);let r=n=>n.filter(i=>i.selected).map(i=>i.value);return po("MultiselectPrompt",e,{onAbort:r,onSubmit:r})};Pi.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);let r=n=>n.filter(i=>i.selected).map(i=>i.value);return po("AutocompleteMultiselectPrompt",e,{onAbort:r,onSubmit:r})};var mpt=(e,r)=>Promise.resolve(r.filter(n=>n.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));Pi.autocomplete=e=>(e.suggest=e.suggest||mpt,e.choices=[].concat(e.choices||[]),po("AutocompletePrompt",e))});var Gye=S((AGt,Uye)=>{"use strict";function Lye(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,i)}return n}function Nye(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Lye(Object(n),!0).forEach(function(i){gpt(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lye(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function gpt(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function vpt(e,r){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=ypt(e))||r&&e&&typeof e.length=="number"){n&&(e=n);var i=0,a=function(){};return{s:a,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|||
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,c=!1,u;return{s:function(){n=n.call(e)},n:function(){var f=n.next();return o=f.done,f},e:function(f){c=!0,u=f},f:function(){try{!o&&n.return!=null&&n.return()}finally{if(c)throw u}}}}function ypt(e,r){if(e){if(typeof e=="string")return Mye(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Mye(e,r)}}function Mye(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,i=new Array(r);n<r;n++)i[n]=e[n];return i}function qye(e,r,n,i,a,o,c){try{var u=e[o](c),l=u.value}catch(f){n(f);return}u.done?r(l):Promise.resolve(l).then(i,a)}function jye(e){return function(){var r=this,n=arguments;return new Promise(function(i,a){var o=e.apply(r,n);function c(l){qye(o,i,a,c,u,"next",l)}function u(l){qye(o,i,a,c,u,"throw",l)}c(void 0)})}}var ZN=$ye(),bpt=["suggest","format","onState","validate","onRender","type"],Bye=()=>{};function Yu(){return eM.apply(this,arguments)}function eM(){return eM=jye(function*(e=[],{onSubmit:r=Bye,onCancel:n=Bye}={}){let i={},a=Yu._override||{};e=[].concat(e);let o,c,u,l,f,p,g=function(){var P=jye(function*(R,k,F=!1){if(!(!F&&R.validate&&R.validate(k)!==!0))return R.format?yield R.format(k,i):k});return function(k,F){return P.apply(this,arguments)}}();var v=vpt(e),x;try{for(v.s();!(x=v.n()).done;){c=x.value;var E=c;if(l=E.name,f=E.type,typeof f=="function"&&(f=yield f(o,Nye({},i),c),c.type=f),!!f){for(let P in c){if(bpt.includes(P))continue;let R=c[P];c[P]=typeof R=="function"?yield R(o,Nye({},i),p):R}if(p=c,typeof c.message!="string")throw new Error("prompt message is required");var D=c;if(l=D.name,f=D.type,ZN[f]===void 0)throw new Error(`prompt type (${f}) is not defined`);if(a[c.name]!==void 0&&(o=yield g(c,a[c.name]),o!==void 0)){i[l]=o;continue}try{o=Yu._injected?xpt(Yu._injected,c.initial):yield ZN[f](c),i[l]=o=yield g(c,o,!0),u=yield r(c,o,i)}catch{u=!(yield n(c,i))}if(u)return i}}}catch(P){v.e(P)}finally{v.f()}return i}),eM.apply(this,arguments)}function xpt(e,r){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?r:n}function wpt(e){Yu._injected=(Yu._injected||[]).concat(e)}function _pt(e){Yu._override=Object.assign({},e)}Uye.exports=Object.assign(Yu,{prompt:Yu,prompts:ZN,inject:wpt,override:_pt})});var Hye=S((OGt,Wye)=>{"use strict";Wye.exports=(e,r)=>{if(!(e.meta&&e.name!=="escape")){if(e.ctrl){if(e.name==="a")return"first";if(e.name==="c"||e.name==="d")return"abort";if(e.name==="e")return"last";if(e.name==="g")return"reset"}if(r){if(e.name==="j")return"down";if(e.name==="k")return"up"}return e.name==="return"||e.name==="enter"?"submit":e.name==="backspace"?"delete":e.name==="delete"?"deleteForward":e.name==="abort"?"abort":e.name==="escape"?"exit":e.name==="tab"?"next":e.name==="pagedown"?"nextPage":e.name==="pageup"?"prevPage":e.name==="home"?"home":e.name==="end"?"end":e.name==="up"?"up":e.name==="down"?"down":e.name==="right"?"right":e.name==="left"?"left":!1}}});var YD=S((IGt,zye)=>{"use strict";zye.exports=e=>{let r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),n=new RegExp(r,"g");return typeof e=="string"?e.replace(n,""):e}});var Kye=S((kGt,Yye)=>{"use strict";var Ept=YD(),{erase:Vye,cursor:Spt}=vr(),Dpt=e=>[...Ept(e)].length;Yye.exports=function(e,r){if(!r)return Vye.line+Spt.to(0);let n=0,i=e.split(/\r?\n/);for(let a of i)n+=1+Math.floor(Math.max(Dpt(a)-1,0)/r);return Vye.lines(n)}});var tM=S((FGt,Xye)=>{"use strict";var O0={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},Cpt={arrowUp:O0.arrowUp,arrowDown:O0.arrowDown,arrowLeft:O0.arrowLeft,arrowRight:O0.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u22
|
|||
|
|
`)).join(`
|
|||
|
|
`)}});var i0e=S((MGt,n0e)=>{"use strict";n0e.exports=(e,r,n)=>{n=n||r;let i=Math.min(r-n,e-Math.floor(n/2));i<0&&(i=0);let a=Math.min(i+n,r);return{startIndex:i,endIndex:a}}});var Ca=S((qGt,s0e)=>{"use strict";s0e.exports={action:Hye(),clear:Kye(),style:Qye(),strip:YD(),figures:tM(),lines:e0e(),wrap:r0e(),entriesToDisplay:i0e()}});var hc=S((jGt,o0e)=>{"use strict";var a0e=require("readline"),{action:kpt}=Ca(),Fpt=require("events"),{beep:$pt,cursor:Lpt}=vr(),Npt=mr(),nM=class extends Fpt{constructor(r={}){super(),this.firstRender=!0,this.in=r.stdin||process.stdin,this.out=r.stdout||process.stdout,this.onRender=(r.onRender||(()=>{})).bind(this);let n=a0e.createInterface({input:this.in,escapeCodeTimeout:50});a0e.emitKeypressEvents(this.in,n),this.in.isTTY&&this.in.setRawMode(!0);let i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,a=(o,c)=>{let u=kpt(c,i);u===!1?this._&&this._(o,c):typeof this[u]=="function"?this[u](c):this.bell()};this.close=()=>{this.out.write(Lpt.show),this.in.removeListener("keypress",a),this.in.isTTY&&this.in.setRawMode(!1),n.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",a)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write($pt)}render(){this.onRender(Npt),this.firstRender&&(this.firstRender=!1)}};o0e.exports=nM});var u0e=S((BGt,c0e)=>{"use strict";var KD=mr(),Mpt=hc(),{erase:qpt,cursor:k0}=vr(),{style:iM,clear:sM,lines:jpt,figures:Bpt}=Ca(),aM=class extends Mpt{constructor(r={}){super(r),this.transform=iM.render(r.style),this.scale=this.transform.scale,this.msg=r.message,this.initial=r.initial||"",this.validator=r.validate||(()=>!0),this.value="",this.errorMsg=r.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=sM("",this.out.columns),this.render()}set value(r){!r&&this.initial?(this.placeholder=!0,this.rendered=KD.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(r)),this._value=r,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}async validate(){let r=await this.validator(this.value);typeof r=="string"&&(this.errorMsg=r,r=!1),this.error=!r}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(r){this.placeholder||(this.cursor=this.cursor+r,this.cursorOffset+=r)}_(r,n){let i=this.value.slice(0,this.cursor),a=this.value.slice(this.cursor);this.value=`${i}${r}${a}`,this.red=!1,this.cursor=this.placeholder?0:i.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let r=this.value.slice(0,this.cursor-1),n=this.value.slice(this.cursor);this.value=`${r}${n}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let r=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor+1);this.value=`${r}${n}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(k0.down(jpt(this.outputError,this.out.columns)-1)+sM(this.outputError,this.out.columns)),this.out.write(sM(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[iM.symbol(this.done,this.aborted),KD.bold(this.msg),iM.delimiter(this.done),this.red?KD.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|||
|
|
`).reduce((r,n,i)=>r+`
|
|||
|
|
${i?" ":Bpt.pointerSmall} ${KD.red().italic(n)}`,"")),this.out.write(qpt.line+k0.to(0)+this.outputText+k0.save+this.outputError+k0.restore+k0.move(this.cursorOffset,0)))}};c0e.exports=aM});var d0e=S((UGt,p0e)=>{"use strict";var mc=mr(),Upt=hc(),{style:l0e,clear:f0e,figures:XD,wrap:Gpt,entriesToDisplay:Wpt}=Ca(),{cursor:Hpt}=vr(),oM=class extends Upt{constructor(r={}){super(r),this.msg=r.message,this.hint=r.hint||"- Use arrow-keys. Return to submit.",this.warn=r.warn||"- This option is disabled",this.cursor=r.initial||0,this.choices=r.choices.map((n,i)=>(typeof n=="string"&&(n={title:n,value:i}),{title:n&&(n.title||n.value||n),value:n&&(n.value===void 0?i:n.value),description:n&&n.description,selected:n&&n.selected,disabled:n&&n.disabled})),this.optionsPerPage=r.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=f0e("",this.out.columns),this.render()}moveCursor(r){this.cursor=r,this.value=this.choices[r].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(r,n){if(r===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(Hpt.hide):this.out.write(f0e(this.outputText,this.out.columns)),super.render();let{startIndex:r,endIndex:n}=Wpt(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[l0e.symbol(this.done,this.aborted),mc.bold(this.msg),l0e.delimiter(!1),this.done?this.selection.title:this.selection.disabled?mc.yellow(this.warn):mc.gray(this.hint)].join(" "),!this.done){this.outputText+=`
|
|||
|
|
`;for(let i=r;i<n;i++){let a,o,c="",u=this.choices[i];i===r&&r>0?o=XD.arrowUp:i===n-1&&n<this.choices.length?o=XD.arrowDown:o=" ",u.disabled?(a=this.cursor===i?mc.gray().underline(u.title):mc.strikethrough().gray(u.title),o=(this.cursor===i?mc.bold().gray(XD.pointer)+" ":" ")+o):(a=this.cursor===i?mc.cyan().underline(u.title):u.title,o=(this.cursor===i?mc.cyan(XD.pointer)+" ":" ")+o,u.description&&this.cursor===i&&(c=` - ${u.description}`,(o.length+a.length+c.length>=this.out.columns||u.description.split(/\r?\n/).length>1)&&(c=`
|
|||
|
|
`+Gpt(u.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${a}${mc.gray(c)}
|
|||
|
|
`}}this.out.write(this.outputText)}};p0e.exports=oM});var v0e=S((GGt,g0e)=>{"use strict";var JD=mr(),zpt=hc(),{style:h0e,clear:Vpt}=Ca(),{cursor:m0e,erase:Ypt}=vr(),cM=class extends zpt{constructor(r={}){super(r),this.msg=r.message,this.value=!!r.initial,this.active=r.active||"on",this.inactive=r.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(r,n){if(r===" ")this.value=!this.value;else if(r==="1")this.value=!0;else if(r==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(m0e.hide):this.out.write(Vpt(this.outputText,this.out.columns)),super.render(),this.outputText=[h0e.symbol(this.done,this.aborted),JD.bold(this.msg),h0e.delimiter(this.done),this.value?this.inactive:JD.cyan().underline(this.inactive),JD.gray("/"),this.value?JD.cyan().underline(this.active):this.active].join(" "),this.out.write(Ypt.line+m0e.to(0)+this.outputText))}};g0e.exports=cM});var ho=S((WGt,y0e)=>{"use strict";var uM=class e{constructor({token:r,date:n,parts:i,locales:a}){this.token=r,this.date=n||new Date,this.parts=i||[this],this.locales=a||{}}up(){}down(){}next(){let r=this.parts.indexOf(this);return this.parts.find((n,i)=>i>r&&n instanceof e)}setTo(r){}prev(){let r=[].concat(this.parts).reverse(),n=r.indexOf(this);return r.find((i,a)=>a>n&&i instanceof e)}toString(){return String(this.date)}};y0e.exports=uM});var x0e=S((HGt,b0e)=>{"use strict";var Kpt=ho(),lM=class extends Kpt{constructor(r={}){super(r)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let r=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?r.toUpperCase():r}};b0e.exports=lM});var _0e=S((zGt,w0e)=>{"use strict";var Xpt=ho(),Jpt=e=>(e=e%10,e===1?"st":e===2?"nd":e===3?"rd":"th"),fM=class extends Xpt{constructor(r={}){super(r)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(r){this.date.setDate(parseInt(r.substr(-2)))}toString(){let r=this.date.getDate(),n=this.date.getDay();return this.token==="DD"?String(r).padStart(2,"0"):this.token==="Do"?r+Jpt(r):this.token==="d"?n+1:this.token==="ddd"?this.locales.weekdaysShort[n]:this.token==="dddd"?this.locales.weekdays[n]:r}};w0e.exports=fM});var S0e=S((VGt,E0e)=>{"use strict";var Qpt=ho(),pM=class extends Qpt{constructor(r={}){super(r)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(r){this.date.setHours(parseInt(r.substr(-2)))}toString(){let r=this.date.getHours();return/h/.test(this.token)&&(r=r%12||12),this.token.length>1?String(r).padStart(2,"0"):r}};E0e.exports=pM});var C0e=S((YGt,D0e)=>{"use strict";var Zpt=ho(),dM=class extends Zpt{constructor(r={}){super(r)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(r){this.date.setMilliseconds(parseInt(r.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};D0e.exports=dM});var T0e=S((KGt,P0e)=>{"use strict";var edt=ho(),hM=class extends edt{constructor(r={}){super(r)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(r){this.date.setMinutes(parseInt(r.substr(-2)))}toString(){let r=this.date.getMinutes();return this.token.length>1?String(r).padStart(2,"0"):r}};P0e.exports=hM});var A0e=S((XGt,R0e)=>{"use strict";var tdt=ho(),mM=class extends tdt{constructor(r={}){super(r)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(r){r=parseInt(r.substr(-2))-1,this.date.setMonth(r<0?0:r)}toString(){let r=this.date.getMonth(),n=this.token.length;return n===2?String(r+1).padStart(2,"0"):n===3?this.locales.monthsShort[r]:n===4?this.locales.months[r]:String(r+1)}};R0e.exports=mM});var I0e=S((JGt,O0e)=>{"use strict";var rdt=ho(),gM=class extends rdt{constructor(r={}){super(r)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(r){this.date.setSeconds(parseInt(r.s
|
|||
|
|
`),this.close()}async validate(){let r=await this.validator(this.value);typeof r=="string"&&(this.errorMsg=r,r=!1),this.error=!r}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let r=this.parts[this.cursor].prev();if(r==null)return this.bell();this.moveCursor(this.parts.indexOf(r)),this.render()}right(){let r=this.parts[this.cursor].next();if(r==null)return this.bell();this.moveCursor(this.parts.indexOf(r)),this.render()}next(){let r=this.parts[this.cursor].next();this.moveCursor(r?this.parts.indexOf(r):this.parts.findIndex(n=>n instanceof j0e)),this.render()}_(r){/\d/.test(r)&&(this.typed+=r,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(q0e.hide):this.out.write(M0e(this.outputText,this.out.columns)),super.render(),this.outputText=[N0e.symbol(this.done,this.aborted),yM.bold(this.msg),N0e.delimiter(!1),this.parts.reduce((r,n,i)=>r.concat(i===this.cursor&&!this.done?yM.cyan().underline(n.toString()):n),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
|
|||
|
|
`).reduce((r,n,i)=>r+`
|
|||
|
|
${i?" ":sdt.pointerSmall} ${yM.red().italic(n)}`,"")),this.out.write(adt.line+q0e.to(0)+this.outputText))}};U0e.exports=bM});var V0e=S((tWt,z0e)=>{"use strict";var QD=mr(),vdt=hc(),{cursor:ZD,erase:ydt}=vr(),{style:xM,figures:bdt,clear:W0e,lines:xdt}=Ca(),wdt=/[0-9]/,wM=e=>e!==void 0,H0e=(e,r)=>{let n=Math.pow(10,r);return Math.round(e*n)/n},_M=class extends vdt{constructor(r={}){super(r),this.transform=xM.render(r.style),this.msg=r.message,this.initial=wM(r.initial)?r.initial:"",this.float=!!r.float,this.round=r.round||2,this.inc=r.increment||1,this.min=wM(r.min)?r.min:-1/0,this.max=wM(r.max)?r.max:1/0,this.errorMsg=r.error||"Please Enter A Valid Value",this.validator=r.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(r){!r&&r!==0?(this.placeholder=!0,this.rendered=QD.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${H0e(r,this.round)}`),this._value=H0e(r,this.round)),this.fire()}get value(){return this._value}parse(r){return this.float?parseFloat(r):parseInt(r)}valid(r){return r==="-"||r==="."&&this.float||wdt.test(r)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let r=this.value;this.value=r!==""?r:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}async validate(){let r=await this.validator(this.value);typeof r=="string"&&(this.errorMsg=r,r=!1),this.error=!r}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let r=this.value;this.value=r!==""?r:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let r=this.value.toString();if(r.length===0)return this.bell();this.value=this.parse(r=r.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(r,n){if(!this.valid(r))return this.bell();let i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=r,this.lastHit=i,this.color="cyan",r===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(ZD.down(xdt(this.outputError,this.out.columns)-1)+W0e(this.outputError,this.out.columns)),this.out.write(W0e(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[xM.symbol(this.done,this.aborted),QD.bold(this.msg),xM.delimiter(this.done),!this.done||!this.done&&!this.placeholder?QD[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|||
|
|
`).reduce((r,n,i)=>r+`
|
|||
|
|
${i?" ":bdt.pointerSmall} ${QD.red().italic(n)}`,"")),this.out.write(ydt.line+ZD.to(0)+this.outputText+ZD.save+this.outputError+ZD.restore))}};z0e.exports=_M});var SM=S((rWt,X0e)=>{"use strict";var mo=mr(),{cursor:_dt}=vr(),Edt=hc(),{clear:Y0e,figures:Ku,style:K0e,wrap:Sdt,entriesToDisplay:Ddt}=Ca(),EM=class extends Edt{constructor(r={}){super(r),this.msg=r.message,this.cursor=r.cursor||0,this.scrollIndex=r.cursor||0,this.hint=r.hint||"",this.warn=r.warn||"- This option is disabled -",this.minSelected=r.min,this.showMinError=!1,this.maxChoices=r.max,this.instructions=r.instructions,this.optionsPerPage=r.optionsPerPage||10,this.value=r.choices.map((n,i)=>(typeof n=="string"&&(n={title:n,value:i}),{title:n&&(n.title||n.value||n),description:n&&n.description,value:n&&(n.value===void 0?i:n.value),selected:n&&n.selected,disabled:n&&n.disabled})),this.clear=Y0e("",this.out.columns),r.overrideRender||this.render()}reset(){this.value.map(r=>!r.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(r=>r.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}submit(){let r=this.value.filter(n=>n.selected);this.minSelected&&r.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let r=this.value[this.cursor];if(r.selected)r.selected=!1,this.render();else{if(r.disabled||this.value.filter(n=>n.selected).length>=this.maxChoices)return this.bell();r.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let r=!this.value[this.cursor].selected;this.value.filter(n=>!n.disabled).forEach(n=>n.selected=r),this.render()}_(r,n){if(r===" ")this.handleSpaceToggle();else if(r==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|||
|
|
Instructions:
|
|||
|
|
${Ku.arrowUp}/${Ku.arrowDown}: Highlight option
|
|||
|
|
${Ku.arrowLeft}/${Ku.arrowRight}/[space]: Toggle selection
|
|||
|
|
`+(this.maxChoices===void 0?` a: Toggle all
|
|||
|
|
`:"")+" enter/return: Complete answer":""}renderOption(r,n,i,a){let o=(n.selected?mo.green(Ku.radioOn):Ku.radioOff)+" "+a+" ",c,u;return n.disabled?c=r===i?mo.gray().underline(n.title):mo.strikethrough().gray(n.title):(c=r===i?mo.cyan().underline(n.title):n.title,r===i&&n.description&&(u=` - ${n.description}`,(o.length+c.length+u.length>=this.out.columns||n.description.split(/\r?\n/).length>1)&&(u=`
|
|||
|
|
`+Sdt(n.description,{margin:o.length,width:this.out.columns})))),o+c+mo.gray(u||"")}paginateOptions(r){if(r.length===0)return mo.red("No matches for this query.");let{startIndex:n,endIndex:i}=Ddt(this.cursor,r.length,this.optionsPerPage),a,o=[];for(let c=n;c<i;c++)c===n&&n>0?a=Ku.arrowUp:c===i-1&&i<r.length?a=Ku.arrowDown:a=" ",o.push(this.renderOption(this.cursor,r[c],c,a));return`
|
|||
|
|
`+o.join(`
|
|||
|
|
`)}renderOptions(r){return this.done?"":this.paginateOptions(r)}renderDoneOrInstructions(){if(this.done)return this.value.filter(n=>n.selected).map(n=>n.title).join(", ");let r=[mo.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&r.push(mo.yellow(this.warn)),r.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(_dt.hide),super.render();let r=[K0e.symbol(this.done,this.aborted),mo.bold(this.msg),K0e.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(r+=mo.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),r+=this.renderOptions(this.value),this.out.write(this.clear+r),this.clear=Y0e(r,this.out.columns)}};X0e.exports=EM});var tbe=S((nWt,ebe)=>{"use strict";var F0=mr(),Cdt=hc(),{erase:Pdt,cursor:J0e}=vr(),{style:DM,clear:Q0e,figures:CM,wrap:Tdt,entriesToDisplay:Rdt}=Ca(),Z0e=(e,r)=>e[r]&&(e[r].value||e[r].title||e[r]),Adt=(e,r)=>e[r]&&(e[r].title||e[r].value||e[r]),Odt=(e,r)=>{let n=e.findIndex(i=>i.value===r||i.title===r);return n>-1?n:void 0},PM=class extends Cdt{constructor(r={}){super(r),this.msg=r.message,this.suggest=r.suggest,this.choices=r.choices,this.initial=typeof r.initial=="number"?r.initial:Odt(r.choices,r.initial),this.select=this.initial||r.cursor||0,this.i18n={noMatches:r.noMatches||"no matches found"},this.fallback=r.fallback||this.initial,this.clearFirst=r.clearFirst||!1,this.suggestions=[],this.input="",this.limit=r.limit||10,this.cursor=0,this.transform=DM.render(r.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=Q0e("",this.out.columns),this.complete(this.render),this.render()}set fallback(r){this._fb=Number.isSafeInteger(parseInt(r))?parseInt(r):r}get fallback(){let r;return typeof this._fb=="number"?r=this.choices[this._fb]:typeof this._fb=="string"&&(r={title:this._fb}),r||this._fb||{title:this.i18n.noMatches}}moveSelect(r){this.select=r,this.suggestions.length>0?this.value=Z0e(this.suggestions,r):this.value=this.fallback.value,this.fire()}async complete(r){let n=this.completing=this.suggest(this.input,this.choices),i=await n;if(this.completing!==n)return;this.suggestions=i.map((o,c,u)=>({title:Adt(u,c),value:Z0e(u,c),description:o.description})),this.completing=!1;let a=Math.max(i.length-1,0);this.moveSelect(Math.min(a,this.select)),r&&r()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}_(r,n){let i=this.input.slice(0,this.cursor),a=this.input.slice(this.cursor);this.input=`${i}${r}${a}`,this.cursor=i.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let r=this.input.slice(0,this.cursor-1),n=this.input.slice(this.cursor);this.input=`${r}${n}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let r=this.input.slice(0,this.cursor),n=this.input.slice(this.cursor+1);this.input=`${r}${n}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(r,n,i,a){let o,c=i?CM.arrowUp:a?CM.arrowDown:" ",u=n?F0.cyan().underline(r.title):r.title;return c=(n?F0.cyan(CM.pointer)+" ":" ")+c,r.description&&(o=` - ${r.description}`,(c.length+u.length+o.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(o=`
|
|||
|
|
`+Tdt(r.description,{margin:3,width:this.out.columns}))),c+" "+u+F0.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(J0e.hide):this.out.write(Q0e(this.outputText,this.out.columns)),super.render();let{startIndex:r,endIndex:n}=Rdt(this.select,this.choices.length,this.limit);if(this.outputText=[DM.symbol(this.done,this.aborted,this.exited),F0.bold(this.msg),DM.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let i=this.suggestions.slice(r,n).map((a,o)=>this.renderOption(a,this.select===o+r,o===0&&r>0,o+r===n-1&&n<this.choices.length)).join(`
|
|||
|
|
`);this.outputText+=`
|
|||
|
|
`+(i||F0.gray(this.fallback.title))}this.out.write(Pdt.line+J0e.to(0)+this.outputText)}};ebe.exports=PM});var sbe=S((iWt,ibe)=>{"use strict";var gc=mr(),{cursor:Idt}=vr(),kdt=SM(),{clear:rbe,style:nbe,figures:nm}=Ca(),TM=class extends kdt{constructor(r={}){r.overrideRender=!0,super(r),this.inputValue="",this.clear=rbe("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let r=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let n=this.filteredOptions.findIndex(i=>i===r);this.cursor=n<0?0:n,this.render()}handleSpaceToggle(){let r=this.filteredOptions[this.cursor];if(r.selected)r.selected=!1,this.render();else{if(r.disabled||this.value.filter(n=>n.selected).length>=this.maxChoices)return this.bell();r.selected=!0,this.render()}}handleInputChange(r){this.inputValue=this.inputValue+r,this.updateFilteredOptions()}_(r,n){r===" "?this.handleSpaceToggle():this.handleInputChange(r)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|||
|
|
Instructions:
|
|||
|
|
${nm.arrowUp}/${nm.arrowDown}: Highlight option
|
|||
|
|
${nm.arrowLeft}/${nm.arrowRight}/[space]: Toggle selection
|
|||
|
|
[a,b,c]/delete: Filter choices
|
|||
|
|
enter/return: Complete answer
|
|||
|
|
`:""}renderCurrentInput(){return`
|
|||
|
|
Filtered results for: ${this.inputValue?this.inputValue:gc.gray("Enter something to filter")}
|
|||
|
|
`}renderOption(r,n,i){let a;return n.disabled?a=r===i?gc.gray().underline(n.title):gc.strikethrough().gray(n.title):a=r===i?gc.cyan().underline(n.title):n.title,(n.selected?gc.green(nm.radioOn):nm.radioOff)+" "+a}renderDoneOrInstructions(){if(this.done)return this.value.filter(n=>n.selected).map(n=>n.title).join(", ");let r=[gc.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&r.push(gc.yellow(this.warn)),r.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Idt.hide),super.render();let r=[nbe.symbol(this.done,this.aborted),gc.bold(this.msg),nbe.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(r+=gc.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),r+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+r),this.clear=rbe(r,this.out.columns)}};ibe.exports=TM});var lbe=S((sWt,ube)=>{"use strict";var abe=mr(),Fdt=hc(),{style:obe,clear:$dt}=Ca(),{erase:Ldt,cursor:cbe}=vr(),RM=class extends Fdt{constructor(r={}){super(r),this.msg=r.message,this.value=r.initial,this.initialValue=!!r.initial,this.yesMsg=r.yes||"yes",this.yesOption=r.yesOption||"(Y/n)",this.noMsg=r.no||"no",this.noOption=r.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}_(r,n){return r.toLowerCase()==="y"?(this.value=!0,this.submit()):r.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(cbe.hide):this.out.write($dt(this.outputText,this.out.columns)),super.render(),this.outputText=[obe.symbol(this.done,this.aborted),abe.bold(this.msg),obe.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:abe.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Ldt.line+cbe.to(0)+this.outputText))}};ube.exports=RM});var pbe=S((aWt,fbe)=>{"use strict";fbe.exports={TextPrompt:u0e(),SelectPrompt:d0e(),TogglePrompt:v0e(),DatePrompt:G0e(),NumberPrompt:V0e(),MultiselectPrompt:SM(),AutocompletePrompt:tbe(),AutocompleteMultiselectPrompt:sbe(),ConfirmPrompt:lbe()}});var hbe=S(dbe=>{"use strict";var Ti=dbe,Ndt=pbe(),eC=e=>e;function go(e,r,n={}){return new Promise((i,a)=>{let o=new Ndt[e](r),c=n.onAbort||eC,u=n.onSubmit||eC,l=n.onExit||eC;o.on("state",r.onState||eC),o.on("submit",f=>i(u(f))),o.on("exit",f=>i(l(f))),o.on("abort",f=>a(c(f)))})}Ti.text=e=>go("TextPrompt",e);Ti.password=e=>(e.style="password",Ti.text(e));Ti.invisible=e=>(e.style="invisible",Ti.text(e));Ti.number=e=>go("NumberPrompt",e);Ti.date=e=>go("DatePrompt",e);Ti.confirm=e=>go("ConfirmPrompt",e);Ti.list=e=>{let r=e.separator||",";return go("TextPrompt",e,{onSubmit:n=>n.split(r).map(i=>i.trim())})};Ti.toggle=e=>go("TogglePrompt",e);Ti.select=e=>go("SelectPrompt",e);Ti.multiselect=e=>{e.choices=[].concat(e.choices||[]);let r=n=>n.filter(i=>i.selected).map(i=>i.value);return go("MultiselectPrompt",e,{onAbort:r,onSubmit:r})};Ti.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);let r=n=>n.filter(i=>i.selected).map(i=>i.value);return go("AutocompleteMultiselectPrompt",e,{onAbort:r,onSubmit:r})};var Mdt=(e,r)=>Promise.resolve(r.filter(n=>n.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));Ti.autocomplete=e=>(e.suggest=e.suggest||Mdt,e.choices=[].concat(e.choices||[]),go("AutocompletePrompt",e))});var vbe=S((cWt,gbe)=>{"use strict";var AM=hbe(),qdt=["suggest","format","onState","validate","onRender","type"],mbe=()=>{};async function Xu(e=[],{onSubmit:r=mbe,onCancel:n=mbe}={}){let i={},a=Xu._override||{};e=[].concat(e);let o,c,u,l,f,p,g=async(v,x,E=!1)=>{if(!(!E&&v.validate&&v.validate(x)!==!0))return v.format?await v.format(x,i):x};for(c of e)if({name:l,type:f}=c,typeof f=="function"&&(f=await f(o,{...i},c),c.type=f),!!f){for(let v in c){if(qdt.includes(v))continue;let x=c[v];c[v]=typeof x=="function"?await x(o,{...i},p):x}if(p=c,typeof c.message!="string")throw new Error("prompt message is required");if({name:l,type:f}=c,AM[f]===void 0)throw new Error(`prompt type (${f}) is not defined`);if(a[c.name]!==void 0&&(o=await g(c,a[c.name]),o!==void 0)){i[l]=o;continue}try{o=Xu._injected?jdt(Xu._injected,c.initial):await AM[f](c),i[l]=o=await g(c,o,!0),u=await r(c,o,i)}catch{u=!await n(c,i)}if(u)return i}return i}function jdt(e,r){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?r:n}function Bdt(e){Xu._injected=(Xu._injected||[]).concat(e)}function Udt(e){Xu._override=Object.assign({},e)}gbe.exports=Object.assign(Xu,{prompt:Xu,prompts:AM,inject:Bdt,override:Udt})});var Ju=S((uWt,ybe)=>{"use strict";function Gdt(e){e=(Array.isArray(e)?e:e.split(".")).map(Number);let r=0,n=process.versions.node.split(".").map(Number);for(;r<e.length;r++){if(n[r]>e[r])return!1;if(e[r]>n[r])return!0}return!1}ybe.exports=Gdt("8.6.0")?Gye():vbe()});var rC=S((vWt,IM)=>{"use strict";var Ebe=e=>Number.isNaN(e)?!1:e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141);IM.exports=Ebe;IM.exports.default=Ebe});var kM=S((yWt,Dbe)=>{"use strict";var Sbe="[\uD800-\uDBFF][\uDC00-\uDFFF]",Wdt=e=>e&&e.exact?new RegExp(`^${Sbe}$`):new RegExp(Sbe,"g");Dbe.exports=Wdt});var Pbe=S((bWt,C
|
|||
|
|
`:`
|
|||
|
|
`,A4=(e,r)=>{let n=[],i="";typeof r=="string"?r={section:r,whitespace:!1}:(r=r||Object.create(null),r.whitespace=r.whitespace===!0);let a=r.whitespace?" = ":"=";for(let o of Object.keys(e)){let c=e[o];if(c&&Array.isArray(c))for(let u of c)i+=hm(o+"[]")+a+hm(u)+`
|
|||
|
|
`;else c&&typeof c=="object"?n.push(o):i+=hm(o)+a+hm(c)+R4}r.section&&i.length&&(i="["+hm(r.section)+"]"+R4+i);for(let o of n){let c=bwe(o).join("\\."),u=(r.section?r.section+".":"")+c,{whitespace:l}=r,f=A4(e[o],{section:u,whitespace:l});i.length&&f.length&&(i+=R4),i+=f}return i},bwe=e=>e.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(r=>r.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")),ywe=e=>{let r=Object.create(null),n=r,i=null,a=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=e.split(/[\r\n]+/g);for(let u of o){if(!u||u.match(/^\s*[;#]/))continue;let l=u.match(a);if(!l)continue;if(l[1]!==void 0){if(i=_C(l[1]),i==="__proto__"){n=Object.create(null);continue}n=r[i]=r[i]||Object.create(null);continue}let f=_C(l[2]),p=f.length>2&&f.slice(-2)==="[]",g=p?f.slice(0,-2):f;if(g==="__proto__")continue;let v=l[3]?_C(l[4]):!0,x=v==="true"||v==="false"||v==="null"?JSON.parse(v):v;p&&(T4.call(n,g)?Array.isArray(n[g])||(n[g]=[n[g]]):n[g]=[]),Array.isArray(n[g])?n[g].push(x):n[g]=x}let c=[];for(let u of Object.keys(r)){if(!T4.call(r,u)||typeof r[u]!="object"||Array.isArray(r[u]))continue;let l=bwe(u),f=r,p=l.pop(),g=p.replace(/\\\./g,".");for(let v of l)v!=="__proto__"&&((!T4.call(f,v)||typeof f[v]!="object")&&(f[v]=Object.create(null)),f=f[v]);f===r&&g===p||(f[g]=r[u],c.push(u))}for(let u of c)delete r[u];return r},xwe=e=>e.charAt(0)==='"'&&e.slice(-1)==='"'||e.charAt(0)==="'"&&e.slice(-1)==="'",hm=e=>typeof e!="string"||e.match(/[=\r\n]/)||e.match(/^\[/)||e.length>1&&xwe(e)||e!==e.trim()?JSON.stringify(e):e.replace(/;/g,"\\;").replace(/#/g,"\\#"),_C=(e,r)=>{if(e=(e||"").trim(),xwe(e)){e.charAt(0)==="'"&&(e=e.substr(1,e.length-2));try{e=JSON.parse(e)}catch{}}else{let n=!1,i="";for(let a=0,o=e.length;a<o;a++){let c=e.charAt(a);if(n)"\\;#".indexOf(c)!==-1?i+=c:i+="\\"+c,n=!1;else{if(";#".indexOf(c)!==-1)break;c==="\\"?n=!0:i+=c}}return n&&(i+="\\"),i.trim()}return e};wwe.exports={parse:ywe,decode:ywe,stringify:A4,encode:A4,safe:hm,unsafe:_C}});var Cwe=S(yo=>{"use strict";var Qr=require("path"),O4=require("os"),EC=require("fs"),M0t=_we(),rb=process.platform==="win32",Ewe=e=>{try{return M0t.parse(EC.readFileSync(e,"utf8")).prefix}catch{}},q0t=()=>Object.keys(process.env).reduce((e,r)=>/^npm_config_prefix$/i.test(r)?process.env[r]:e,void 0),j0t=()=>{if(rb&&process.env.APPDATA)return Qr.join(process.env.APPDATA,"/npm/etc/npmrc");if(process.execPath.includes("/Cellar/node")){let e=process.execPath.slice(0,process.execPath.indexOf("/Cellar/node"));return Qr.join(e,"/lib/node_modules/npm/npmrc")}if(process.execPath.endsWith("/bin/node")){let e=Qr.dirname(Qr.dirname(process.execPath));return Qr.join(e,"/etc/npmrc")}},B0t=()=>{if(rb){let{APPDATA:e}=process.env;return e?Qr.join(e,"npm"):Qr.dirname(process.execPath)}return Qr.dirname(Qr.dirname(process.execPath))},U0t=()=>{let e=q0t();if(e)return e;let r=Ewe(Qr.join(O4.homedir(),".npmrc"));if(r)return r;if(process.env.PREFIX)return process.env.PREFIX;let n=Ewe(j0t());return n||B0t()},tb=Qr.resolve(U0t()),Swe=()=>{if(rb&&process.env.LOCALAPPDATA){let e=Qr.join(process.env.LOCALAPPDATA,"Yarn");if(EC.existsSync(e))return e}return!1},G0t=()=>{if(process.env.PREFIX)return process.env.PREFIX;let e=Swe();if(e)return e;let r=Qr.join(O4.homedir(),".config/yarn");if(EC.existsSync(r))return r;let n=Qr.join(O4.homedir(),".yarn-config");return EC.existsSync(n)?n:tb};yo.npm={};yo.npm.prefix=tb;yo.npm.packages=Qr.join(tb,rb?"node_modules":"lib/node_modules");yo.npm.binaries=rb?tb:Qr.join(tb,"bin");var Dwe=Qr.resolve(G0t());yo.yarn={};yo.yarn.prefix=Dwe;yo.yarn.packages=Qr.join(Dwe,Swe()?"Data/global/node_modules":"global/node_modules");yo.yarn.binaries=Qr.join(yo.yarn.packages,".bin")});var Pwe=S((F4,$4)=>{"use strict";(function(e){F4&&typeof F4=="object"&&typeof $4<"u"?$4.exports=e():typeof define=="function"&&define.amd?define([],e):typeof window<"u"?window.isWindows=e():typeof global<"u"?global.isWindows=e():typeof self<"u"?self.isWindows=e():this.isWindows=e()})(function(){"use strict";return function(){return process&&(process.platform==="win32"||/^(msys|cygwin)$/.test(proce
|
|||
|
|
`);for(let[l,f]of[...i].entries()){if(a+=f,Z4.has(f)){let g=parseFloat(/\d[^m]*/.exec(i.slice(l,l+4)));o=g===pbt?null:g}let p=fbt.codes.get(Number(o));o&&p&&(i[l+1]===`
|
|||
|
|
`?a+=a1e(p):f===`
|
|||
|
|
`&&(a+=a1e(o)))}return a};o1e.exports=(e,r,n)=>String(e).normalize().replace(/\r\n/g,`
|
|||
|
|
`).split(`
|
|||
|
|
`).map(i=>mbt(i,r,n)).join(`
|
|||
|
|
`)});var d1e=S((Uzt,p1e)=>{"use strict";var gbt=rC(),vbt=kM(),u1e=L0(),f1e=["\x1B","\x9B"],OC=e=>`${f1e[0]}[${e}m`,l1e=(e,r,n)=>{let i=[];e=[...e];for(let a of e){let o=a;a.includes(";")&&(a=a.split(";")[0][0]+"0");let c=u1e.codes.get(Number.parseInt(a,10));if(c){let u=e.indexOf(c.toString());u===-1?i.push(OC(r?c:o)):e.splice(u,1)}else if(r){i.push(OC(0));break}else i.push(OC(o))}if(r&&(i=i.filter((a,o)=>i.indexOf(a)===o),n!==void 0)){let a=OC(u1e.codes.get(Number.parseInt(n,10)));i=i.reduce((o,c)=>c===a?[c,...o]:[...o,c],[])}return i.join("")};p1e.exports=(e,r,n)=>{let i=[...e],a=[],o=typeof n=="number"?n:i.length,c=!1,u,l=0,f="";for(let[p,g]of i.entries()){let v=!1;if(f1e.includes(g)){let x=/\d[^m]*/.exec(e.slice(p,p+18));u=x&&x.length>0?x[0]:void 0,l<o&&(c=!0,u!==void 0&&a.push(u))}else c&&g==="m"&&(c=!1,v=!0);if(!c&&!v&&l++,!vbt({exact:!0}).test(g)&&gbt(g.codePointAt())&&(l++,typeof n!="number"&&o++),l>r&&l<=o)f+=g;else if(l===r&&!c&&u!==void 0)f=l1e(a);else if(l>=o){f+=l1e(a,!0,u);break}}return f}});var t6=S((Gzt,kC)=>{"use strict";var h1e=dR(),m1e=J4(),ybt=c1e(),bbt=d1e(),xbt=24,IC=e=>{let{columns:r}=e;return r||80},wbt=(e,r)=>{let n=e.rows||xbt,i=r.split(`
|
|||
|
|
`),a=i.length-n;return a<=0?r:bbt(r,i.slice(0,a).join(`
|
|||
|
|
`).length+1,r.length)},e6=(e,{showCursor:r=!1}={})=>{let n=0,i=IC(e),a="",o=(...c)=>{r||m1e.hide();let u=c.join(" ")+`
|
|||
|
|
`;u=wbt(e,u);let l=IC(e);u===a&&i===l||(a=u,i=l,u=ybt(u,l,{trim:!1,hard:!0,wordWrap:!1}),e.write(h1e.eraseLines(n)+u),n=u.split(`
|
|||
|
|
`).length)};return o.clear=()=>{e.write(h1e.eraseLines(n)),a="",i=IC(e),n=0},o.done=()=>{a="",i=IC(e),n=0,r||m1e.show()},o};kC.exports=e6(process.stdout);kC.exports.stderr=e6(process.stderr);kC.exports.create=e6});var q1e=S((xVt,M1e)=>{"use strict";var $bt=(e,r,n)=>{let i=e.indexOf(r);if(i===-1)return e;let a=r.length,o=0,c="";do c+=e.substr(o,i-o)+r+n,o=i+a,i=e.indexOf(r,o);while(i!==-1);return c+=e.substr(o),c},Lbt=(e,r,n,i)=>{let a=0,o="";do{let c=e[i-1]==="\r";o+=e.substr(a,(c?i-1:i)-a)+r+(c?`\r
|
|||
|
|
`:`
|
|||
|
|
`)+n,a=i+1,i=e.indexOf(`
|
|||
|
|
`,a)}while(i!==-1);return o+=e.substr(a),o};M1e.exports={stringReplaceAll:$bt,stringEncaseCRLFWithFirstIndex:Lbt}});var W1e=S((wVt,G1e)=>{"use strict";var Nbt=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,j1e=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,Mbt=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,qbt=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,jbt=new Map([["n",`
|
|||
|
|
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function U1e(e){let r=e[0]==="u",n=e[1]==="{";return r&&!n&&e.length===5||e[0]==="x"&&e.length===3?String.fromCharCode(parseInt(e.slice(1),16)):r&&n?String.fromCodePoint(parseInt(e.slice(2,-1),16)):jbt.get(e)||e}function Bbt(e,r){let n=[],i=r.trim().split(/\s*,\s*/g),a;for(let o of i){let c=Number(o);if(!Number.isNaN(c))n.push(c);else if(a=o.match(Mbt))n.push(a[2].replace(qbt,(u,l,f)=>l?U1e(l):f));else throw new Error(`Invalid Chalk template style argument: ${o} (in style '${e}')`)}return n}function Ubt(e){j1e.lastIndex=0;let r=[],n;for(;(n=j1e.exec(e))!==null;){let i=n[1];if(n[2]){let a=Bbt(i,n[2]);r.push([i].concat(a))}else r.push([i])}return r}function B1e(e,r){let n={};for(let a of r)for(let o of a.styles)n[o[0]]=a.inverse?null:o.slice(1);let i=e;for(let[a,o]of Object.entries(n))if(Array.isArray(o)){if(!(a in i))throw new Error(`Unknown Chalk style: ${a}`);i=o.length>0?i[a](...o):i[a]}return i}G1e.exports=(e,r)=>{let n=[],i=[],a=[];if(r.replace(Nbt,(o,c,u,l,f,p)=>{if(c)a.push(U1e(c));else if(l){let g=a.join("");a=[],i.push(n.length===0?g:B1e(e,n)(g)),n.push({inverse:u,styles:Ubt(l)})}else if(f){if(n.length===0)throw new Error("Found extraneous } in Chalk template literal");i.push(B1e(e,n)(a.join(""))),a=[],n.pop()}else a.push(p)}),i.push(a.join("")),n.length>0){let o=`Chalk template literal is missing ${n.length} closing bracket${n.length===1?"":"s"} (\`}\`)`;throw new Error(o)}return i.join("")}});var f6=S((_Vt,X1e)=>{"use strict";var db=L0(),{stdout:o6,stderr:c6}=gR(),{stringReplaceAll:Gbt,stringEncaseCRLFWithFirstIndex:Wbt}=q1e(),{isArray:qC}=Array,z1e=["ansi","ansi","ansi256","ansi16m"],vm=Object.create(null),Hbt=(e,r={})=>{if(r.level&&!(Number.isInteger(r.level)&&r.level>=0&&r.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let n=o6?o6.level:0;e.level=r.level===void 0?n:r.level},u6=class{constructor(r){return V1e(r)}},V1e=e=>{let r={};return Hbt(r,e),r.template=(...n)=>K1e(r.template,...n),Object.setPrototypeOf(r,jC.prototype),Object.setPrototypeOf(r.template,r),r.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},r.template.Instance=u6,r.template};function jC(e){return V1e(e)}for(let[e,r]of Object.entries(db))vm[e]={get(){let n=BC(this,l6(r.open,r.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:n}),n}};vm.visible={get(){let e=BC(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Y1e=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let e of Y1e)vm[e]={get(){let{level:r}=this;return function(...n){let i=l6(db.color[z1e[r]][e](...n),db.color.close,this._styler);return BC(this,i,this._isEmpty)}}};for(let e of Y1e){let r="bg"+e[0].toUpperCase()+e.slice(1);vm[r]={get(){let{level:n}=this;return function(...i){let a=l6(db.bgColor[z1e[n]][e](...i),db.bgColor.close,this._styler);return BC(this,a,this._isEmpty)}}}}var zbt=Object.defineProperties(()=>{},{...vm,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),l6=(e,r,n)=>{let i,a;return n===void 0?(i=e,a=r):(i=n.openAll+e,a=r+n.closeAll),{open:e,close:r,openAll:i,closeAll:a,parent:n}},BC=(e,r,n)=>{let i=(...a)=>qC(a[0])&&qC(a[0].raw)?H1e(i,K1e(i,...a)):H1e(i,a.length===1?""+a[0]:a.join(" "));return Object.setPrototypeOf(i,zbt),i._generator=e,i._styler=r,i._isEmpty=n,i},H1e=(e,r)=>{if(e.level<=0||!r)return e._isEmpty?"":r;let n=e._styler;if(n===void 0)return r;let{openAll:i,closeAll:a}=n;if(r.indexOf("\x1B")!==-1)for(;n!==void 0;)r=Gbt(r,n.close,n.open),n=n.parent;let o=r.indexOf(`
|
|||
|
|
`);return o!==-1&&(r=Wbt(r,a,i,o)),i+r+a},a6,K1e=(e,...r)=>{let[n]=r;if(!qC(n)||!qC(n.raw))return r.join(" ");let i=r.slice(1),a=[n.raw[0]];for(let o=1;o<n.length;o++)a.push(String(i[o-1]).replace(/[{}\\]/g,"\\$&"),String(n.raw[o]));return a6===void 0&&(a6=W1e()),a6(e,a.join(""))};Object.defineProperties(jC.prototype,vm);var UC=jC();UC.supportsColor=o6;UC.stderr=jC({level:c6?c6.level:0});UC.stderr.supportsColor=c6;X1e.exports=UC});var J1e=S((EVt,Vbt)=>{Vbt.exports={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830
|
|||
|
|
`))this.lineCount+=Math.max(1,Math.ceil(sxt(i)/r))}get isEnabled(){return this._isEnabled&&!this.isSilent}set isEnabled(r){if(typeof r!="boolean")throw new TypeError("The `isEnabled` option must be a boolean");this._isEnabled=r}get isSilent(){return this._isSilent}set isSilent(r){if(typeof r!="boolean")throw new TypeError("The `isSilent` option must be a boolean");this._isSilent=r}frame(){let{frames:r}=this.spinner,n=r[this.frameIndex];this.color&&(n=nxt[this.color](n)),this.frameIndex=++this.frameIndex%r.length;let i=typeof this.prefixText=="string"&&this.prefixText!==""?this.prefixText+" ":"",a=typeof this.text=="string"?" "+this.text:"";return i+n+a}clear(){if(!this.isEnabled||!this.stream.isTTY)return this;for(let r=0;r<this.linesToClear;r++)r>0&&this.stream.moveCursor(0,-1),this.stream.clearLine(),this.stream.cursorTo(this.indent);return this.linesToClear=0,this}render(){return this.isSilent?this:(this.clear(),this.stream.write(this.frame()),this.linesToClear=this.lineCount,this)}start(r){return r&&(this.text=r),this.isSilent?this:this.isEnabled?this.isSpinning?this:(this.hideCursor&&b_e.hide(this.stream),this.discardStdin&&process.stdin.isTTY&&(this.isDiscardingStdin=!0,YC.start()),this.render(),this.id=setInterval(this.render.bind(this),this.interval),this):(this.text&&this.stream.write(`- ${this.text}
|
|||
|
|
`),this)}stop(){return this.isEnabled?(clearInterval(this.id),this.id=void 0,this.frameIndex=0,this.clear(),this.hideCursor&&b_e.show(this.stream),this.discardStdin&&process.stdin.isTTY&&this.isDiscardingStdin&&(YC.stop(),this.isDiscardingStdin=!1),this):this}succeed(r){return this.stopAndPersist({symbol:VC.success,text:r})}fail(r){return this.stopAndPersist({symbol:VC.error,text:r})}warn(r){return this.stopAndPersist({symbol:VC.warning,text:r})}info(r){return this.stopAndPersist({symbol:VC.info,text:r})}stopAndPersist(r={}){if(this.isSilent)return this;let n=r.prefixText||this.prefixText,i=r.text||this.text,a=typeof i=="string"?" "+i:"";return this.stop(),this.stream.write(`${this.getFullPrefixText(n," ")}${r.symbol||" "}${a}
|
|||
|
|
`),this}},lxt=function(e){return new KC(e)};y6.exports=lxt;y6.exports.promise=(e,r)=>{if(typeof e.then!="function")throw new TypeError("Parameter `action` must be a Promise");let n=new KC(r);return n.start(),(async()=>{try{await e,n.succeed()}catch{n.fail()}})(),n}});var D_e=S((uYt,x6)=>{"use strict";var pxt=require("path"),dxt=require("fs"),S_e=(e=process.cwd())=>dxt.existsSync(pxt.resolve(e,"yarn.lock"));x6.exports=S_e;x6.exports.default=S_e});var P_e=S((lYt,w6)=>{"use strict";var C_e=require("fs");w6.exports=e=>new Promise(r=>{C_e.access(e,n=>{r(!n)})});w6.exports.sync=e=>{try{return C_e.accessSync(e),!0}catch{return!1}}});var R_e=S((fYt,_6)=>{"use strict";var T_e=(e,...r)=>new Promise(n=>{n(e(...r))});_6.exports=T_e;_6.exports.default=T_e});var O_e=S((pYt,E6)=>{"use strict";var hxt=R_e(),A_e=e=>{if(!((Number.isInteger(e)||e===1/0)&&e>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));let r=[],n=0,i=()=>{n--,r.length>0&&r.shift()()},a=(u,l,...f)=>{n++;let p=hxt(u,...f);l(p),p.then(i,i)},o=(u,l,...f)=>{n<e?a(u,l,...f):r.push(a.bind(null,u,l,...f))},c=(u,...l)=>new Promise(f=>o(u,f,...l));return Object.defineProperties(c,{activeCount:{get:()=>n},pendingCount:{get:()=>r.length},clearQueue:{value:()=>{r.length=0}}}),c};E6.exports=A_e;E6.exports.default=A_e});var F_e=S((dYt,k_e)=>{"use strict";var I_e=O_e(),XC=class extends Error{constructor(r){super(),this.value=r}},mxt=(e,r)=>Promise.resolve(e).then(r),gxt=e=>Promise.all(e).then(r=>r[1]===!0&&Promise.reject(new XC(r[0])));k_e.exports=(e,r,n)=>{n=Object.assign({concurrency:1/0,preserveOrder:!0},n);let i=I_e(n.concurrency),a=[...e].map(c=>[c,i(mxt,c,r)]),o=I_e(n.preserveOrder?1:1/0);return Promise.all(a.map(c=>o(gxt,c))).then(()=>{}).catch(c=>c instanceof XC?c.value:Promise.reject(c))}});var N_e=S((hYt,S6)=>{"use strict";var $_e=require("path"),L_e=P_e(),vxt=F_e();S6.exports=(e,r)=>(r=Object.assign({cwd:process.cwd()},r),vxt(e,n=>L_e($_e.resolve(r.cwd,n)),r));S6.exports.sync=(e,r)=>{r=Object.assign({cwd:process.cwd()},r);for(let n of e)if(L_e.sync($_e.resolve(r.cwd,n)))return n}});var q_e=S((mYt,D6)=>{"use strict";var al=require("path"),M_e=N_e();D6.exports=(e,r={})=>{let n=al.resolve(r.cwd||""),{root:i}=al.parse(n),a=[].concat(e);return new Promise(o=>{(function c(u){M_e(a,{cwd:u}).then(l=>{l?o(al.join(u,l)):u===i?o(null):c(al.dirname(u))})})(n)})};D6.exports.sync=(e,r={})=>{let n=al.resolve(r.cwd||""),{root:i}=al.parse(n),a=[].concat(e);for(;;){let o=M_e.sync(a,{cwd:n});if(o)return al.join(n,o);if(n===i)return null;n=al.dirname(n)}}});var P6=S((gYt,C6)=>{"use strict";var j_e=q_e();C6.exports=async({cwd:e}={})=>j_e("package.json",{cwd:e});C6.exports.sync=({cwd:e}={})=>j_e.sync("package.json",{cwd:e})});var J_e=S((zYt,X_e)=>{"use strict";var _xt=1/0,Ext="[object Symbol]",Sxt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Dxt="\\u0300-\\u036f\\ufe20-\\ufe23",Cxt="\\u20d0-\\u20f0",Pxt="["+Dxt+Cxt+"]",Txt=RegExp(Pxt,"g"),Rxt={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\
|
|||
|
|
at `+callSiteToString(e[n]);return r}function depd(e){if(!e)throw new TypeError("argument namespace is required");var r=getStack(),n=callSiteLocation(r[1]),i=n[0];function a(o){log.call(a,o)}return a._file=i,a._ignored=isignored(e),a._namespace=e,a._traced=istraced(e),a._warned=Object.create(null),a.function=wrapfunction,a.property=wrapproperty,a}function isignored(e){if(process.noDeprecation)return!0;var r=process.env.NO_DEPRECATION||"";return containsNamespace(r,e)}function istraced(e){if(process.traceDeprecation)return!0;var r=process.env.TRACE_DEPRECATION||"";return containsNamespace(r,e)}function log(e,r){var n=eventListenerCount(process,"deprecation")!==0;if(!(!n&&this._ignored)){var i,a,o,c,u=0,l=!1,f=getStack(),p=this._file;for(r?(c=r,o=callSiteLocation(f[1]),o.name=c.name,p=o[0]):(u=2,c=callSiteLocation(f[u]),o=c);u<f.length;u++)if(i=callSiteLocation(f[u]),a=i[0],a===p)l=!0;else if(a===this._file)p=this._file;else if(l)break;var g=i?c.join(":")+"__"+i.join(":"):void 0;if(!(g!==void 0&&g in this._warned)){this._warned[g]=!0;var v=e;if(v||(v=o===c||!o.name?defaultMessage(c):defaultMessage(o)),n){var x=DeprecationError(this._namespace,v,f.slice(u));process.emit("deprecation",x);return}var E=process.stderr.isTTY?formatColor:formatPlain,D=E.call(this,v,i,f.slice(u));process.stderr.write(D+`
|
|||
|
|
`,"utf8")}}}function callSiteLocation(e){var r=e.getFileName()||"<anonymous>",n=e.getLineNumber(),i=e.getColumnNumber();e.isEval()&&(r=e.getEvalOrigin()+", "+r);var a=[r,n,i];return a.callSite=e,a.name=e.getFunctionName(),a}function defaultMessage(e){var r=e.callSite,n=e.name;n||(n="<anonymous@"+formatLocation(e)+">");var i=r.getThis(),a=i&&r.getTypeName();return a==="Object"&&(a=void 0),a==="Function"&&(a=i.name||a),a&&r.getMethodName()?a+"."+n:n}function formatPlain(e,r,n){var i=new Date().toUTCString(),a=i+" "+this._namespace+" deprecated "+e;if(this._traced){for(var o=0;o<n.length;o++)a+=`
|
|||
|
|
at `+callSiteToString(n[o]);return a}return r&&(a+=" at "+formatLocation(r)),a}function formatColor(e,r,n){var i="\x1B[36;1m"+this._namespace+"\x1B[22;39m \x1B[33;1mdeprecated\x1B[22;39m \x1B[0m"+e+"\x1B[39m";if(this._traced){for(var a=0;a<n.length;a++)i+=`
|
|||
|
|
\x1B[36mat `+callSiteToString(n[a])+"\x1B[39m";return i}return r&&(i+=" \x1B[36m"+formatLocation(r)+"\x1B[39m"),i}function formatLocation(e){return relative(basePath,e[0])+":"+e[1]+":"+e[2]}function getStack(){var e=Error.stackTraceLimit,r={},n=Error.prepareStackTrace;Error.prepareStackTrace=prepareObjectStackTrace,Error.stackTraceLimit=Math.max(10,e),Error.captureStackTrace(r);var i=r.stack.slice(1);return Error.prepareStackTrace=n,Error.stackTraceLimit=e,i}function prepareObjectStackTrace(e,r){return r}function wrapfunction(fn,message){if(typeof fn!="function")throw new TypeError("argument fn must be a function");var args=createArgumentsString(fn.length),deprecate=this,stack=getStack(),site=callSiteLocation(stack[1]);site.name=fn.name;var deprecatedfn=eval("(function ("+args+`) {
|
|||
|
|
"use strict"
|
|||
|
|
log.call(deprecate, message, site)
|
|||
|
|
return fn.apply(this, arguments)
|
|||
|
|
})`);return deprecatedfn}function wrapproperty(e,r,n){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("argument obj must be object");var i=Object.getOwnPropertyDescriptor(e,r);if(!i)throw new TypeError("must call property on owner object");if(!i.configurable)throw new TypeError("property must be configurable");var a=this,o=getStack(),c=callSiteLocation(o[1]);c.name=r,"value"in i&&(i=convertDataDescriptorToAccessor(e,r,n));var u=i.get,l=i.set;typeof u=="function"&&(i.get=function(){return log.call(a,n,c),u.apply(this,arguments)}),typeof l=="function"&&(i.set=function(){return log.call(a,n,c),l.apply(this,arguments)}),Object.defineProperty(e,r,i)}function DeprecationError(e,r,n){var i=new Error,a;return Object.defineProperty(i,"constructor",{value:DeprecationError}),Object.defineProperty(i,"message",{configurable:!0,enumerable:!1,value:r,writable:!0}),Object.defineProperty(i,"name",{enumerable:!1,configurable:!0,value:"DeprecationError",writable:!0}),Object.defineProperty(i,"namespace",{configurable:!0,enumerable:!1,value:e,writable:!0}),Object.defineProperty(i,"stack",{configurable:!0,enumerable:!1,get:function(){return a!==void 0?a:a=createStackString.call(this,n)},set:function(c){a=c}}),i}});var Wm=S((Vtr,AP)=>{"use strict";AP.exports=bEt;AP.exports.format=xDe;AP.exports.parse=wDe;var gEt=/\B(?=(\d{3})+(?!\d))/g,vEt=/(?:\.0*|(\.[^0]+)0+)$/,ll={b:1,kb:1024,mb:1<<20,gb:1<<30,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},yEt=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function bEt(e,r){return typeof e=="string"?wDe(e):typeof e=="number"?xDe(e,r):null}function xDe(e,r){if(!Number.isFinite(e))return null;var n=Math.abs(e),i=r&&r.thousandsSeparator||"",a=r&&r.unitSeparator||"",o=r&&r.decimalPlaces!==void 0?r.decimalPlaces:2,c=!!(r&&r.fixedDecimals),u=r&&r.unit||"";(!u||!ll[u.toLowerCase()])&&(n>=ll.pb?u="PB":n>=ll.tb?u="TB":n>=ll.gb?u="GB":n>=ll.mb?u="MB":n>=ll.kb?u="KB":u="B");var l=e/ll[u.toLowerCase()],f=l.toFixed(o);return c||(f=f.replace(vEt,"$1")),i&&(f=f.split(".").map(function(p,g){return g===0?p.replace(gEt,i):p}).join(".")),f+a+u}function wDe(e){if(typeof e=="number"&&!isNaN(e))return e;if(typeof e!="string")return null;var r=yEt.exec(e),n,i="b";return r?(n=parseFloat(r[1]),i=r[4].toLowerCase()):(n=parseInt(e,10),i="b"),Math.floor(ll[i]*n)}});var Lb=S(oq=>{"use strict";var _De=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,xEt=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,EDe=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,wEt=/\\([\u000b\u0020-\u00ff])/g,_Et=/([\\"])/g,SDe=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;oq.format=EEt;oq.parse=SEt;function EEt(e){if(!e||typeof e!="object")throw new TypeError("argument obj is required");var r=e.parameters,n=e.type;if(!n||!SDe.test(n))throw new TypeError("invalid type");var i=n;if(r&&typeof r=="object")for(var a,o=Object.keys(r).sort(),c=0;c<o.length;c++){if(a=o[c],!EDe.test(a))throw new TypeError("invalid parameter name");i+="; "+a+"="+CEt(r[a])}return i}function SEt(e){if(!e)throw new TypeError("argument string is required");var r=typeof e=="object"?DEt(e):e;if(typeof r!="string")throw new TypeError("argument string is required to be a string");var n=r.indexOf(";"),i=n!==-1?r.slice(0,n).trim():r.trim();if(!SDe.test(i))throw new TypeError("invalid media type");var a=new PEt(i.toLowerCase());if(n!==-1){var o,c,u;for(_De.lastIndex=n;c=_De.exec(r);){if(c.index!==n)throw new TypeError("invalid parameter format");n+=c[0].length,o=c[1].toLowerCase(),u=c[2],u.charCodeAt(0)===34&&(u=u.slice(1,-1),u.indexOf("\\")!==-1&&(u=u.replace(wEt,"$1"))),a.parameters[o]=u}if(n!==r.length)throw new TypeError("invalid parameter format")}return a}function DEt(e){var r;if(typeof e.getHeader=="function"?r=e.getHeader("content-type"):typeof e.headers=="object"&&(r=e.headers&&e.headers["content-type"]),typeof r!="string")throw new TypeError("content-type header is missing from object");return r}function CEt(e){var r=String(e);if(EDe.test(r))return r;if(r.length>0&&!xEt
|
|||
|
|
`).map(function(r){return r.trim()}).join(" ")};xn.formatters.O=function(e){return this.inspectOpts.colors=this.useColors,Gb.inspect(e,this.inspectOpts)};function tSt(e){var r=this.namespace,n=this.useColors;if(n){var i=this.color,a=" \x1B[3"+i+";1m"+r+" \x1B[0m";e[0]=a+e[0].split(`
|
|||
|
|
`).join(`
|
|||
|
|
`+a),e.push("\x1B[3"+i+"m+"+xn.humanize(this.diff)+"\x1B[0m")}else e[0]=new Date().toUTCString()+" "+r+" "+e[0]}function rSt(){return ZEt.write(Gb.format.apply(Gb,arguments)+`
|
|||
|
|
`)}function nSt(e){e==null?delete process.env.DEBUG:process.env.DEBUG=e}function UDe(){return process.env.DEBUG}function iSt(e){var r,n=process.binding("tty_wrap");switch(n.guessHandleType(e)){case"TTY":r=new BDe.WriteStream(e),r._type="tty",r._handle&&r._handle.unref&&r._handle.unref();break;case"FILE":var i=require("fs");r=new i.SyncWriteStream(e,{autoClose:!1}),r._type="fs";break;case"PIPE":case"TCP":var a=require("net");r=new a.Socket({fd:e,readable:!1,writable:!0}),r.readable=!1,r.read=null,r._type="pipe",r._handle&&r._handle.unref&&r._handle.unref();break;default:throw new Error("Implement me. Unknown stream file type!")}return r.fd=e,r._isStdio=!0,r}function sSt(e){e.inspectOpts={};for(var r=Object.keys(xn.inspectOpts),n=0;n<r.length;n++)e.inspectOpts[r[n]]=xn.inspectOpts[r[n]]}xn.enable(UDe())});var zs=S((trr,dq)=>{"use strict";typeof process<"u"&&process.type==="renderer"?dq.exports=jDe():dq.exports=WDe()});var vp=S((rrr,HDe)=>{"use strict";var kP=require("buffer"),Ym=kP.Buffer,Vs={},Ys;for(Ys in kP)kP.hasOwnProperty(Ys)&&(Ys==="SlowBuffer"||Ys==="Buffer"||(Vs[Ys]=kP[Ys]));var Km=Vs.Buffer={};for(Ys in Ym)Ym.hasOwnProperty(Ys)&&(Ys==="allocUnsafe"||Ys==="allocUnsafeSlow"||(Km[Ys]=Ym[Ys]));Vs.Buffer.prototype=Ym.prototype;(!Km.from||Km.from===Uint8Array.from)&&(Km.from=function(e,r,n){if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&typeof e.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return Ym(e,r,n)});Km.alloc||(Km.alloc=function(e,r,n){if(typeof e!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var i=Ym(e);return!r||r.length===0?i.fill(0):typeof n=="string"?i.fill(r,n):i.fill(r),i});if(!Vs.kStringMaxLength)try{Vs.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}Vs.constants||(Vs.constants={MAX_LENGTH:Vs.kMaxLength},Vs.kStringMaxLength&&(Vs.constants.MAX_STRING_LENGTH=Vs.kStringMaxLength));HDe.exports=Vs});var VDe=S(gq=>{"use strict";var zDe="\uFEFF";gq.PrependBOM=hq;function hq(e,r){this.encoder=e,this.addBOM=!0}hq.prototype.write=function(e){return this.addBOM&&(e=zDe+e,this.addBOM=!1),this.encoder.write(e)};hq.prototype.end=function(){return this.encoder.end()};gq.StripBOM=mq;function mq(e,r){this.decoder=e,this.pass=!1,this.options=r||{}}mq.prototype.write=function(e){var r=this.decoder.write(e);return this.pass||!r||(r[0]===zDe&&(r=r.slice(1),typeof this.options.stripBOM=="function"&&this.options.stripBOM()),this.pass=!0),r};mq.prototype.end=function(){return this.decoder.end()}});var XDe=S((irr,KDe)=>{"use strict";var Wb=vp().Buffer;KDe.exports={utf8:{type:"_internal",bomAware:!0},cesu8:{type:"_internal",bomAware:!0},unicode11utf8:"utf8",ucs2:{type:"_internal",bomAware:!0},utf16le:"ucs2",binary:{type:"_internal"},base64:{type:"_internal"},hex:{type:"_internal"},_internal:vq};function vq(e,r){this.enc=e.encodingName,this.bomAware=e.bomAware,this.enc==="base64"?this.encoder=bq:this.enc==="cesu8"&&(this.enc="utf8",this.encoder=xq,Wb.from("eda0bdedb2a9","hex").toString()!=="\u{1F4A9}"&&(this.decoder=wq,this.defaultCharUnicode=r.defaultCharUnicode))}vq.prototype.encoder=yq;vq.prototype.decoder=YDe;var FP=require("string_decoder").StringDecoder;FP.prototype.end||(FP.prototype.end=function(){});function YDe(e,r){FP.call(this,r.enc)}YDe.prototype=FP.prototype;function yq(e,r){this.enc=r.enc}yq.prototype.write=function(e){return Wb.from(e,this.enc)};yq.prototype.end=function(){};function bq(e,r){this.prevStr=""}bq.prototype.write=function(e){e=this.prevStr+e;var r=e.length-e.length%4;return this.prevStr=e.slice(r),e=e.slice(0,r),Wb.from(e,"base64")};bq.prototype.end=function(){return Wb.from(this.prevStr,"base64")};function xq(e,r){}xq.prototype.write=function(e){for(var r=Wb.alloc(e.length*3),n=0,i=0;i<e.length;i++){var a=e.charCodeAt(i);a<128?r[n++]=a:a<2048?(r[n++]=19
|
|||
|
|
\v\f\r\x1B !"#$\u066A&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~\x7F\xB0\xB7\u2219\u221A\u2592\u2500\u2502\u253C\u2524\u252C\u251C\u2534\u2510\u250C\u2514\u2518\u03B2\u221E\u03C6\xB1\xBD\xBC\u2248\xAB\xBB\uFEF7\uFEF8\uFFFD\uFFFD\uFEFB\uFEFC\uFFFD\xA0\xAD\uFE82\xA3\xA4\uFE84\uFFFD\uFFFD\uFE8E\uFE8F\uFE95\uFE99\u060C\uFE9D\uFEA1\uFEA5\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\uFED1\u061B\uFEB1\uFEB5\uFEB9\u061F\xA2\uFE80\uFE81\uFE83\uFE85\uFECA\uFE8B\uFE8D\uFE91\uFE93\uFE97\uFE9B\uFE9F\uFEA3\uFEA7\uFEA9\uFEAB\uFEAD\uFEAF\uFEB3\uFEB7\uFEBB\uFEBF\uFEC1\uFEC5\uFECB\uFECF\xA6\xAC\xF7\xD7\uFEC9\u0640\uFED3\uFED7\uFEDB\uFEDF\uFEE3\uFEE7\uFEEB\uFEED\uFEEF\uFEF3\uFEBD\uFECC\uFECE\uFECD\uFEE1\uFE7D\u0651\uFEE5\uFEE9\uFEEC\uFEF0\uFEF2\uFED0\uFED5\uFEF5\uFEF6\uFEDD\uFED9\uFEF1\u25A0\uFFFD`},ibm864:"cp864",csibm864:"cp864",cp865:{type:"_sbcs",chars:"\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xF8\xA3\xD8\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xA4\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"},ibm865:"cp865",csibm865:"cp865",cp866:{type:"_sbcs",chars:"\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F\u0401\u0451\u0404\u0454\u0407\u0457\u040E\u045E\xB0\u2219\xB7\u221A\u2116\xA4\u25A0\xA0"},ibm866:"cp866",csibm866:"cp866",cp869:{type:"_sbcs",chars:"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0386\uFFFD\xB7\xAC\xA6\u2018\u2019\u0388\u2015\u0389\u038A\u03AA\u038C\uFFFD\uFFFD\u038E\u03AB\xA9\u038F\xB2\xB3\u03AC\xA3\u03AD\u03AE\u03AF\u03CA\u0390\u03CC\u03CD\u0391\u0392\u0393\u0394\u0395\u0396\u0397\xBD\u0398\u0399\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u039A\u039B\u039C\u039D\u2563\u2551\u2557\u255D\u039E\u039F\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u03A0\u03A1\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u03A3\u03A4\u03A5\u03A6\u03A7\u03A8\u03A9\u03B1\u03B2\u03B3\u2518\u250C\u2588\u2584\u03B4\u03B5\u2580\u03B6\u03B7\u03B8\u03B9\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF\u03C0\u03C1\u03C3\u03C2\u03C4\u0384\xAD\xB1\u03C5\u03C6\u03C7\xA7\u03C8\u0385\xB0\xA8\u03C9\u03CB\u03B0\u03CE\u25A0\xA0"},ibm869:"cp869",csibm869:"cp869",cp922:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\u203E\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\u0160\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\u017D\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\u0161\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\u017E\xFF"},ibm922:"cp922",csibm922:"cp922",cp1046:{type:"_sbcs",chars:"\uFE88\xD7\xF7\uF8F6\uF8F5\uF8F4\uF8F7\uFE71\x88\u25A0\u2502\u2500\u2510\u250C\u2514\u2518\uFE79\uFE7B\uFE7D\uFE7F\uFE77\uFE8A\uFEF0\uFEF3\uFEF2\uFECE\uFECF\uFED0\uFEF6\uFEF8\uFEFA\uFEFC\xA0\uF8FA\uF8F9\uF8F8\xA4\uF8FB\uFE8B\uFE91\uFE9
|
|||
|
|
\v\f\r\u1EE8\u1EF0\u1EF2\u1EF6\u1EF8\xDD\u1EF4\x1B !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~\x7F\xC0\u1EA2\xC3\xC1\u1EA0\u1EB6\u1EAC\xC8\u1EBA\u1EBC\xC9\u1EB8\u1EC6\xCC\u1EC8\u0128\xCD\u1ECA\xD2\u1ECE\xD5\xD3\u1ECC\u1ED8\u1EDC\u1EDE\u1EE0\u1EDA\u1EE2\xD9\u1EE6\u0168\xA0\u0102\xC2\xCA\xD4\u01A0\u01AF\u0110\u0103\xE2\xEA\xF4\u01A1\u01B0\u0111\u1EB0\u0300\u0309\u0303\u0301\u0323\xE0\u1EA3\xE3\xE1\u1EA1\u1EB2\u1EB1\u1EB3\u1EB5\u1EAF\u1EB4\u1EAE\u1EA6\u1EA8\u1EAA\u1EA4\u1EC0\u1EB7\u1EA7\u1EA9\u1EAB\u1EA5\u1EAD\xE8\u1EC2\u1EBB\u1EBD\xE9\u1EB9\u1EC1\u1EC3\u1EC5\u1EBF\u1EC7\xEC\u1EC9\u1EC4\u1EBE\u1ED2\u0129\xED\u1ECB\xF2\u1ED4\u1ECF\xF5\xF3\u1ECD\u1ED3\u1ED5\u1ED7\u1ED1\u1ED9\u1EDD\u1EDF\u1EE1\u1EDB\u1EE3\xF9\u1ED6\u1EE7\u0169\xFA\u1EE5\u1EEB\u1EED\u1EEF\u1EE9\u1EF1\u1EF3\u1EF7\u1EF9\xFD\u1EF5\u1ED0`},georgianacademy:{type:"_sbcs",chars:"\x80\x81\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\u0160\u2039\u0152\x8D\x8E\x8F\x90\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\u0161\u203A\u0153\x9D\x9E\u0178\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\u10D0\u10D1\u10D2\u10D3\u10D4\u10D5\u10D6\u10D7\u10D8\u10D9\u10DA\u10DB\u10DC\u10DD\u10DE\u10DF\u10E0\u10E1\u10E2\u10E3\u10E4\u10E5\u10E6\u10E7\u10E8\u10E9\u10EA\u10EB\u10EC\u10ED\u10EE\u10EF\u10F0\u10F1\u10F2\u10F3\u10F4\u10F5\u10F6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"},georgianps:{type:"_sbcs",chars:"\x80\x81\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\u0160\u2039\u0152\x8D\x8E\x8F\x90\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\u0161\u203A\u0153\x9D\x9E\u0178\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\u10D0\u10D1\u10D2\u10D3\u10D4\u10D5\u10D6\u10F1\u10D7\u10D8\u10D9\u10DA\u10DB\u10DC\u10F2\u10DD\u10DE\u10DF\u10E0\u10E1\u10E2\u10F3\u10E3\u10E4\u10E5\u10E6\u10E7\u10E8\u10E9\u10EA\u10EB\u10EC\u10ED\u10EE\u10F4\u10EF\u10F0\u10F5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"},pt154:{type:"_sbcs",chars:"\u0496\u0492\u04EE\u0493\u201E\u2026\u04B6\u04AE\u04B2\u04AF\u04A0\u04E2\u04A2\u049A\u04BA\u04B8\u0497\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u04B3\u04B7\u04A1\u04E3\u04A3\u049B\u04BB\u04B9\xA0\u040E\u045E\u0408\u04E8\u0498\u04B0\xA7\u0401\xA9\u04D8\xAB\xAC\u04EF\xAE\u049C\xB0\u04B1\u0406\u0456\u0499\u04E9\xB6\xB7\u0451\u2116\u04D9\xBB\u0458\u04AA\u04AB\u049D\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F"},viscii:{type:"_sbcs",chars:`\0\u1EB2\u1EB4\u1EAA\x07\b
|
|||
|
|
\v\f\r\u1EF6\u1EF8\x1B\u1EF4 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~\x7F\u1EA0\u1EAE\u1EB0\u1EB6\u1EA4\u1EA6\u1EA8\u1EAC\u1EBC\u1EB8\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EE2\u1EDA\u1EDC\u1EDE\u1ECA\u1ECE\u1ECC\u1EC8\u1EE6\u0168\u1EE4\u1EF2\xD5\u1EAF\u1EB1\u1EB7\u1EA5\u1EA7\u1EA9\u1EAD\u1EBD\u1EB9\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1ED1\u1ED3\u1ED5\u1ED7\u1EE0\u01A0\u1ED9\u1EDD\u1EDF\u1ECB\u1EF0\u1EE8\u1EEA\u1EEC\u01A1\u1EDB\u01AF\xC0\xC1\xC2\xC3\u1EA2\u0102\u1EB3\u1EB5\xC8\xC9\xCA\u1EBA\xCC\xCD\u0128\u1EF3\u0110\u1EE9\xD2\xD3\xD4\u1EA1\u1EF7\u1EEB\u1EED\xD9\xDA\u1EF9\u1EF5\xDD\u1EE1\u01B0\xE0\xE1\xE2\xE3\u1EA3\u0103\u1EEF\u1EAB\xE8\xE9\xEA\u1EBB\xEC\xED\u0129\u1EC9\u0111\u1EF1\xF2\xF3\xF4\xF5\u1ECF\u1ECD\u1EE5\xF9\xFA\u0169\u1EE7\xFD\u1EE3\u1EEE`},iso646cn:{type:"_sbcs",chars:`\0\x07\b
|
|||
|
|
\v\f\r\x1B !"#\xA5%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}\u203E\x7F\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD`},iso646jp:{type:"_sbcs",chars:`\0\x07\b
|
|||
|
|
\v\f\r\x1B !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\xA5]^_\`abcdefghijklmnopqrstuvwxyz{|}\u203E\x7F\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD`},hproman8:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xC0\xC2\xC8\xCA\xCB\xCE\xCF\xB4\u02CB\u02C6\xA8\u02DC\xD9\xDB\u20A4\xAF\xDD\xFD\xB0\xC7\xE7\xD1\xF1\xA1\xBF\xA4\xA3\xA5\xA7\u0192\xA2\xE2\xEA\xF4\xFB\xE1\xE9\xF3\xFA\xE0\xE8\xF2\xF9\xE4\xEB\xF6\xFC\xC5\xEE\xD8\xC6\xE5\xED\xF8\xE6\xC4\xEC\xD6\xDC\xC9\xEF\xDF\xD4\xC1\xC3\xE3\xD0\xF0\xCD\xCC\xD3\xD2\xD5\xF5\u0160\u0161\xDA\u0178\xFF\xDE\xFE\xB7\xB5\xB6\xBE\u2014\xBC\xBD\xAA\xBA\xAB\u25A0\xBB\xB1\uFFFD"},macintosh:{type:"_sbcs",chars:"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u2126\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\xA4\u2039\u203A\uFB01\uFB02\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uFFFD\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7"},ascii:{type:"_sbcs",chars:"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"},tis620:{type:"_sbcs",chars:"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0E01\u0E02\u0E03\u0E04\u0E05\u0E06\u0E07\u0E08\u0E09\u0E0A\u0E0B\u0E0C\u0E0D\u0E0E\u0E0F\u0E10\u0E11\u0E12\u0E13\u0E14\u0E15\u0E16\u0E17\u0E18\u0E19\u0E1A\u0E1B\u0E1C\u0E1D\u0E1E\u0E1F\u0E20\u0E21\u0E22\u0E23\u0E24\u0E25\u0E26\u0E27\u0E28\u0E29\u0E2A\u0E2B\u0E2C\u0E2D\u0E2E\u0E2F\u0E30\u0E31\u0E32\u0E33\u0E34\u0E35\u0E36\u0E37\u0E38\u0E39\u0E3A\uFFFD\uFFFD\uFFFD\uFFFD\u0E3F\u0E40\u0E41\u0E42\u0E43\u0E44\u0E45\u0E46\u0E47\u0E48\u0E49\u0E4A\u0E4B\u0E4C\u0E4D\u0E4E\u0E4F\u0E50\u0E51\u0E52\u0E53\u0E54\u0E55\u0E56\u0E57\u0E58\u0E59\u0E5A\u0E5B\uFFFD\uFFFD\uFFFD\uFFFD"}}});var uCe=S(cCe=>{"use strict";var Jm=vp().Buffer;cCe._dbcs=Ec;var Fi=-1,oCe=-2,Ks=-10,Do=-1e3,Xm=new Array(256),zb=-1;for(BP=0;BP<256;BP++)Xm[BP]=Fi;var BP;function Ec(e,r){if(this.encodingName=e.encodingName,!e)throw new Error("DBCS codec is called without the data.");if(!e.table)throw new Error("Encoding '"+this.encodingName+"' has no data.");var n=e.table();this.decodeTables=[]
|
|||
|
|
<html lang="en">
|
|||
|
|
<head>
|
|||
|
|
<meta charset="utf-8">
|
|||
|
|
<title>Error</title>
|
|||
|
|
</head>
|
|||
|
|
<body>
|
|||
|
|
<pre>`+r+`</pre>
|
|||
|
|
</body>
|
|||
|
|
</html>
|
|||
|
|
`}GPe.exports=OCt;function OCt(e,r,n){var i=n||{},a=i.env||process.env.NODE_ENV||"development",o=i.onerror;return function(c){var u,l,f;if(!c&&jPe(r)){ej("cannot 404 after headers sent");return}if(c?(f=FCt(c),f===void 0?f=LCt(r):u=ICt(c),l=kCt(c,f,a)):(f=404,l="Cannot "+e.method+" "+_Ct($Ct(e))),ej("default %s",f),c&&o&&TCt(o,c,e,r),jPe(r)){ej("cannot %d after headers sent",f),e.socket.destroy();return}NCt(e,r,f,u,l)}}function ICt(e){if(!(!e.headers||typeof e.headers!="object")){for(var r=Object.create(null),n=Object.keys(e.headers),i=0;i<n.length;i++){var a=n[i];r[a]=e.headers[a]}return r}}function kCt(e,r,n){var i;return n!=="production"&&(i=e.stack,!i&&typeof e.toString=="function"&&(i=e.toString())),i||UPe[r]}function FCt(e){if(typeof e.status=="number"&&e.status>=400&&e.status<600)return e.status;if(typeof e.statusCode=="number"&&e.statusCode>=400&&e.statusCode<600)return e.statusCode}function $Ct(e){try{return SCt.original(e).pathname}catch{return"resource"}}function LCt(e){var r=e.statusCode;return(typeof r!="number"||r<400||r>599)&&(r=500),r}function jPe(e){return typeof e.headersSent!="boolean"?!!e._header:e.headersSent}function NCt(e,r,n,i,a){function o(){var c=ACt(a);if(r.statusCode=n,r.statusMessage=UPe[n],MCt(r,i),r.setHeader("Content-Security-Policy","default-src 'none'"),r.setHeader("X-Content-Type-Options","nosniff"),r.setHeader("Content-Type","text/html; charset=utf-8"),r.setHeader("Content-Length",Buffer.byteLength(c,"utf8")),e.method==="HEAD"){r.end();return}r.end(c,"utf8")}if(RCt(e)){o();return}DCt(e),BPe(e,o),e.resume()}function MCt(e,r){if(r)for(var n=Object.keys(r),i=0;i<n.length;i++){var a=n[i];e.setHeader(a,r[a])}}});var ex=S((Vrr,VPe)=>{"use strict";VPe.exports=qCt;function HPe(e,r,n){for(var i=0;i<e.length;i++){var a=e[i];n>0&&Array.isArray(a)?HPe(a,r,n-1):r.push(a)}return r}function zPe(e,r){for(var n=0;n<e.length;n++){var i=e[n];Array.isArray(i)?zPe(i,r):r.push(i)}return r}function qCt(e,r){return r==null?zPe(e,[]):HPe(e,[],r)}});var JPe=S((Yrr,XPe)=>{"use strict";XPe.exports=KPe;var YPe=/\((?!\?)/g;function KPe(e,r,n){n=n||{},r=r||[];var i=n.strict,a=n.end!==!1,o=n.sensitive?"":"i",c=0,u=r.length,l=0,f=0,p;if(e instanceof RegExp){for(;p=YPe.exec(e.source);)r.push({name:f++,optional:!1,offset:p.index});return e}if(Array.isArray(e))return e=e.map(function(x){return KPe(x,r,n).source}),new RegExp("(?:"+e.join("|")+")",o);for(e=("^"+e+(i?"":e[e.length-1]==="/"?"?":"/?")).replace(/\/\(/g,"/(?:").replace(/([\/\.])/g,"\\$1").replace(/(\\\/)?(\\\.)?:(\w+)(\(.*?\))?(\*)?(\?)?/g,function(x,E,D,P,R,k,F,L){E=E||"",D=D||"",R=R||"([^\\/"+D+"]+?)",F=F||"",r.push({name:P,optional:!!F,offset:L+c});var U=""+(F?"":E)+"(?:"+D+(F?E:"")+R+(k?"((?:[\\/"+D+"].+?)?)":"")+")"+F;return c+=U.length-x.length,U}).replace(/\*/g,function(x,E){for(var D=r.length;D-- >u&&r[D].offset>E;)r[D].offset+=3;return"(.*)"});p=YPe.exec(e);){for(var g=0,v=p.index;e.charAt(--v)==="\\";)g++;g%2!==1&&((u+l===r.length||r[u+l].offset>p.index)&&r.splice(u+l,0,{name:f++,optional:!1,offset:p.index}),l++)}return e+=a?"$":e[e.length-1]==="/"?"":"(?=\\/|$)",new RegExp(e,o)}});var tj=S((Krr,ZPe)=>{"use strict";var jCt=JPe(),BCt=zs()("express:router:layer"),UCt=Object.prototype.hasOwnProperty;ZPe.exports=ig;function ig(e,r,n){if(!(this instanceof ig))return new ig(e,r,n);BCt("new %o",e);var i=r||{};this.handle=n,this.name=n.name||"<anonymous>",this.params=void 0,this.path=void 0,this.regexp=jCt(e,this.keys=[],i),this.regexp.fast_star=e==="*",this.regexp.fast_slash=e==="/"&&i.end===!1}ig.prototype.handle_error=function(r,n,i,a){var o=this.handle;if(o.length!==4)return a(r);try{o(r,n,i,a)}catch(c){a(c)}};ig.prototype.handle_request=function(r,n,i){var a=this.handle;if(a.length>3)return i();try{a(r,n,i)}catch(o){i(o)}};ig.prototype.match=function(r){var n;if(r!=null){if(this.regexp.fast_slash)return this.params={},this.path="",!0;if(this.regexp.fast_star)return this.params={0:QPe(r)},this.path=r,!0;n=this.regexp.exec(r)}if(!n)return this.params=void 0,this.path=void 0,!1;this.params={},this.path=n[0];for(var i=this.keys,a=this.params,o=1;o<n.length;o
|
|||
|
|
<html lang="en">
|
|||
|
|
<head>
|
|||
|
|
<meta charset="utf-8">
|
|||
|
|
<title>`+e+`</title>
|
|||
|
|
</head>
|
|||
|
|
<body>
|
|||
|
|
<pre>`+r+`</pre>
|
|||
|
|
</body>
|
|||
|
|
</html>
|
|||
|
|
`}function xTt(e){try{return decodeURIComponent(e)}catch{return-1}}function KTe(e){return typeof e.getHeaderNames!="function"?Object.keys(e._headers||{}):e.getHeaderNames()}function XTe(e,r){var n=typeof e.listenerCount!="function"?e.listeners(r).length:e.listenerCount(r);return n>0}function wTt(e){return typeof e.headersSent!="boolean"?!!e._header:e.headersSent}function hj(e,r){for(var n=[].concat(e||[]),i=0;i<n.length;i++)if(typeof n[i]!="string")throw new TypeError(r+" must be array of strings or false");return n}function sT(e){var r=e&&Date.parse(e);return typeof r=="number"?r:NaN}function _Tt(e){for(var r=0,n=[],i=0,a=0,o=e.length;a<o;a++)switch(e.charCodeAt(a)){case 32:i===r&&(i=r=a+1);break;case 44:i!==r&&n.push(e.substring(i,r)),i=r=a+1;break;default:r=a+1;break}return i!==r&&n.push(e.substring(i,r)),n}function ETt(e,r){for(var n=Object.keys(r),i=0;i<n.length;i++){var a=n[i];e.setHeader(a,r[a])}}});var QTe=S((pnr,JTe)=>{"use strict";JTe.exports=STt;function STt(e){if(!e)throw new TypeError("argument req is required");var r=CTt(e.headers["x-forwarded-for"]||""),n=DTt(e),i=[n].concat(r);return i}function DTt(e){return e.socket?e.socket.remoteAddress:e.connection.remoteAddress}function CTt(e){for(var r=e.length,n=[],i=e.length,a=e.length-1;a>=0;a--)switch(e.charCodeAt(a)){case 32:i===r&&(i=r=a);break;case 44:i!==r&&n.push(e.substring(i,r)),i=r=a;break;default:i=a;break}return i!==r&&n.push(e.substring(i,r)),n}});var eRe=S((ZTe,ix)=>{"use strict";(function(){var e,r,n,i,a,o,c,u,l;r={},u=this,typeof ix<"u"&&ix!==null&&ix.exports?ix.exports=r:u.ipaddr=r,c=function(f,p,g,v){var x,E;if(f.length!==p.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");for(x=0;v>0;){if(E=g-v,E<0&&(E=0),f[x]>>E!==p[x]>>E)return!1;v-=g,x+=1}return!0},r.subnetMatch=function(f,p,g){var v,x,E,D,P;g==null&&(g="unicast");for(E in p)for(D=p[E],D[0]&&!(D[0]instanceof Array)&&(D=[D]),v=0,x=D.length;v<x;v++)if(P=D[v],f.kind()===P[0].kind()&&f.match.apply(f,P))return E;return g},r.IPv4=function(){function f(p){var g,v,x;if(p.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");for(g=0,v=p.length;g<v;g++)if(x=p[g],!(0<=x&&x<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=p}return f.prototype.kind=function(){return"ipv4"},f.prototype.toString=function(){return this.octets.join(".")},f.prototype.toNormalizedString=function(){return this.toString()},f.prototype.toByteArray=function(){return this.octets.slice(0)},f.prototype.match=function(p,g){var v;if(g===void 0&&(v=p,p=v[0],g=v[1]),p.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return c(this.octets,p.octets,8,g)},f.prototype.SpecialRanges={unspecified:[[new f([0,0,0,0]),8]],broadcast:[[new f([255,255,255,255]),32]],multicast:[[new f([224,0,0,0]),4]],linkLocal:[[new f([169,254,0,0]),16]],loopback:[[new f([127,0,0,0]),8]],carrierGradeNat:[[new f([100,64,0,0]),10]],private:[[new f([10,0,0,0]),8],[new f([172,16,0,0]),12],[new f([192,168,0,0]),16]],reserved:[[new f([192,0,0,0]),24],[new f([192,0,2,0]),24],[new f([192,88,99,0]),24],[new f([198,51,100,0]),24],[new f([203,0,113,0]),24],[new f([240,0,0,0]),4]]},f.prototype.range=function(){return r.subnetMatch(this,this.SpecialRanges)},f.prototype.toIPv4MappedAddress=function(){return r.IPv6.parse("::ffff:"+this.toString())},f.prototype.prefixLengthFromSubnetMask=function(){var p,g,v,x,E,D,P;for(P={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},p=0,E=!1,g=v=3;v>=0;g=v+=-1)if(x=this.octets[g],x in P){if(D=P[x],E&&D!==0)return null;D!==8&&(E=!0),p+=D}else return null;return 32-p},f}(),n="(0?\\d+|0x[a-f0-9]+)",i={fourOctet:new RegExp("^"+n+"\\."+n+"\\."+n+"\\."+n+"$","i"),longValue:new RegExp("^"+n+"$","i")},r.IPv4.parser=function(f){var p,g,v,x,E;if(g=function(D){return D[0]==="0"&&D[1]!=="x"?parseInt(D,8):parseInt(D)},p=f.match(i.fourOctet))return function(){var D,P,R,k;for(R=p.slice(1,6),k=[],D=0,P=R.length;D<P;D++)v=R[D],k.push(g(v));return k}();if(p=f.match(i.longValue)){if(E=g(p[1]),E>4294967295||E<0)throw new Error("ipaddr: address ou
|
|||
|
|
Please see the 3.x to 4.x migration guide for details on how to update your app.`)}})};Wr.lazyrouter=function(){this._router||(this._router=new YTt({caseSensitive:this.enabled("case sensitive routing"),strict:this.enabled("strict routing")}),this._router.use(XTt(this.get("query parser fn"))),this._router.use(KTt.init(this)))};Wr.handle=function(r,n,i){var a=this._router,o=i||VTt(r,n,{env:this.get("env"),onerror:sRt.bind(this)});if(!a){lT("no routes defined on app"),o();return}a.handle(r,n,o)};Wr.use=function(r){var n=0,i="/";if(typeof r!="function"){for(var a=r;Array.isArray(a)&&a.length!==0;)a=a[0];typeof a!="function"&&(n=1,i=r)}var o=nRt(wj.call(arguments,n));if(o.length===0)throw new TypeError("app.use() requires a middleware function");this.lazyrouter();var c=this._router;return o.forEach(function(u){if(!u||!u.handle||!u.set)return c.use(i,u);lT(".use app under %s",i),u.mountpath=i,u.parent=this,c.use(i,function(f,p,g){var v=f.app;u.handle(f,p,function(x){fg(f,v.request),fg(p,v.response),g(x)})}),u.emit("mount",this)},this),this};Wr.route=function(r){return this.lazyrouter(),this._router.route(r)};Wr.engine=function(r,n){if(typeof n!="function")throw new Error("callback function required");var i=r[0]!=="."?"."+r:r;return this.engines[i]=n,this};Wr.param=function(r,n){if(this.lazyrouter(),Array.isArray(r)){for(var i=0;i<r.length;i++)this.param(r[i],n);return this}return this._router.param(r,n),this};Wr.set=function(r,n){if(arguments.length===1)return this.settings[r];switch(lT('set "%s" to %o',r,n),this.settings[r]=n,r){case"etag":this.set("etag fn",ZTt(n));break;case"query parser":this.set("query parser fn",eRt(n));break;case"trust proxy":this.set("trust proxy fn",tRt(n)),Object.defineProperty(this.settings,xj,{configurable:!0,value:!1});break}return this};Wr.path=function(){return this.parent?this.parent.path()+this.mountpath:""};Wr.enabled=function(r){return!!this.set(r)};Wr.disabled=function(r){return!this.set(r)};Wr.enable=function(r){return this.set(r,!0)};Wr.disable=function(r){return this.set(r,!1)};bj.forEach(function(e){Wr[e]=function(r){if(e==="get"&&arguments.length===1)return this.set(r);this.lazyrouter();var n=this._router.route(r);return n[e].apply(n,wj.call(arguments,1)),this}});Wr.all=function(r){this.lazyrouter();for(var n=this._router.route(r),i=wj.call(arguments,1),a=0;a<bj.length;a++)n[bj[a]].apply(n,i);return this};Wr.del=rRt.function(Wr.delete,"app.del: Use app.delete instead");Wr.render=function(r,n,i){var a=this.cache,o=i,c=this.engines,u=n,l={},f;if(typeof n=="function"&&(o=n,u={}),yj(l,this.locals),u._locals&&yj(l,u._locals),yj(l,u),l.cache==null&&(l.cache=this.enabled("view cache")),l.cache&&(f=a[r]),!f){var p=this.get("view");if(f=new p(r,{defaultEngine:this.get("view engine"),root:this.get("views"),engines:c}),!f.path){var g=Array.isArray(f.root)&&f.root.length>1?'directories "'+f.root.slice(0,-1).join('", "')+'" or "'+f.root[f.root.length-1]+'"':'directory "'+f.root+'"',v=new Error('Failed to lookup view "'+r+'" in views '+g);return v.view=f,o(v)}l.cache&&(a[r]=f)}aRt(f,l,o)};Wr.listen=function(){var r=QTt.createServer(this);return r.listen.apply(r,arguments)};function sRt(e){this.get("env")!=="test"&&console.error(e.stack||e.toString())}function aRt(e,r,n){try{e.render(r,n)}catch(i){n(i)}}});var mRe=S((mnr,_j)=>{"use strict";_j.exports=hRe;_j.exports.preferredCharsets=hRe;var oRt=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function cRt(e){for(var r=e.split(","),n=0,i=0;n<r.length;n++){var a=uRt(r[n].trim(),n);a&&(r[i++]=a)}return r.length=i,r}function uRt(e,r){var n=oRt.exec(e);if(!n)return null;var i=n[1],a=1;if(n[2])for(var o=n[2].split(";"),c=0;c<o.length;c++){var u=o[c].trim().split("=");if(u[0]==="q"){a=parseFloat(u[1]);break}}return{charset:i,q:a,i:r}}function lRt(e,r,n){for(var i={o:-1,q:0,s:0},a=0;a<r.length;a++){var o=fRt(e,r[a],n);o&&(i.s-o.s||i.q-o.q||i.o-o.o)<0&&(i=o)}return i}function fRt(e,r,n){var i=0;if(r.charset.toLowerCase()===e.toLowerCase())i|=1;else if(r.charset!=="*")return null;return{i:n,o:r.i,q:r.q,s:i}}function hRe(e,r){var n=cRt(e===void 0?"*":e||"");if(!r)return n.filter
|
|||
|
|
<html lang="en">
|
|||
|
|
<head>
|
|||
|
|
<meta charset="utf-8">
|
|||
|
|
<title>`+e+`</title>
|
|||
|
|
</head>
|
|||
|
|
<body>
|
|||
|
|
<pre>`+r+`</pre>
|
|||
|
|
</body>
|
|||
|
|
</html>
|
|||
|
|
`}function v2t(){return function(){this.error(404)}}function y2t(){return function(r){if(this.hasTrailingSlash()){this.error(404);return}var n=Rj.original(this.req);n.path=null,n.pathname=m2t(n.pathname+"/");var i=f2t(d2t.format(n)),a=g2t("Redirecting",'Redirecting to <a href="'+XRe(i)+'">'+XRe(i)+"</a>");r.statusCode=301,r.setHeader("Content-Type","text/html; charset=UTF-8"),r.setHeader("Content-Length",Buffer.byteLength(a)),r.setHeader("Content-Security-Policy","default-src 'none'"),r.setHeader("X-Content-Type-Options","nosniff"),r.setHeader("Location",i),r.end(a)}}});var i2e=S((Li,n2e)=>{"use strict";var mT=APe(),b2t=require("events").EventEmitter,ZRe=IPe(),e2e=fRe(),x2t=rj(),w2t=ij(),t2e=NRe(),r2e=KRe();Li=n2e.exports=_2t;function _2t(){var e=function(r,n,i){e.handle(r,n,i)};return ZRe(e,b2t.prototype,!1),ZRe(e,e2e,!1),e.request=Object.create(t2e,{app:{configurable:!0,enumerable:!0,writable:!0,value:e}}),e.response=Object.create(r2e,{app:{configurable:!0,enumerable:!0,writable:!0,value:e}}),e.init(),e}Li.application=e2e;Li.request=t2e;Li.response=r2e;Li.Route=x2t;Li.Router=w2t;Li.json=mT.json;Li.query=sj();Li.raw=mT.raw;Li.static=QRe();Li.text=mT.text;Li.urlencoded=mT.urlencoded;var E2t=["bodyParser","compress","cookieSession","session","logger","cookieParser","favicon","responseTime","errorHandler","timeout","methodOverride","vhost","csrf","directory","limit","multipart","staticCache"];E2t.forEach(function(e){Object.defineProperty(Li,e,{get:function(){throw new Error("Most middleware (like "+e+") is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.")},configurable:!0})})});var a2e=S((Cnr,s2e)=>{"use strict";s2e.exports=i2e()});var u2e=S((Pnr,c2e)=>{"use strict";var S2t=require("os"),o2e=S2t.homedir();c2e.exports=e=>{if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);return o2e?e.replace(/^~(?=$|\/|\\)/,o2e):e}});var Oj=S((Tnr,l2e)=>{"use strict";function D2t(e){n.debug=n,n.default=n,n.coerce=l,n.disable=o,n.enable=a,n.enabled=c,n.humanize=sF(),n.destroy=f,Object.keys(e).forEach(p=>{n[p]=e[p]}),n.names=[],n.skips=[],n.formatters={};function r(p){let g=0;for(let v=0;v<p.length;v++)g=(g<<5)-g+p.charCodeAt(v),g|=0;return n.colors[Math.abs(g)%n.colors.length]}n.selectColor=r;function n(p){let g,v=null,x,E;function D(...P){if(!D.enabled)return;let R=D,k=Number(new Date),F=k-(g||k);R.diff=F,R.prev=g,R.curr=k,g=k,P[0]=n.coerce(P[0]),typeof P[0]!="string"&&P.unshift("%O");let L=0;P[0]=P[0].replace(/%([a-zA-Z%])/g,(V,j)=>{if(V==="%%")return"%";L++;let W=n.formatters[j];if(typeof W=="function"){let q=P[L];V=W.call(R,q),P.splice(L,1),L--}return V}),n.formatArgs.call(R,P),(R.log||n.log).apply(R,P)}return D.namespace=p,D.useColors=n.useColors(),D.color=n.selectColor(p),D.extend=i,D.destroy=n.destroy,Object.defineProperty(D,"enabled",{enumerable:!0,configurable:!1,get:()=>v!==null?v:(x!==n.namespaces&&(x=n.namespaces,E=n.enabled(p)),E),set:P=>{v=P}}),typeof n.init=="function"&&n.init(D),D}function i(p,g){let v=n(this.namespace+(typeof g>"u"?":":g)+p);return v.log=this.log,v}function a(p){n.save(p),n.namespaces=p,n.names=[],n.skips=[];let g,v=(typeof p=="string"?p:"").split(/[\s,]+/),x=v.length;for(g=0;g<x;g++)v[g]&&(p=v[g].replace(/\*/g,".*?"),p[0]==="-"?n.skips.push(new RegExp("^"+p.substr(1)+"$")):n.names.push(new RegExp("^"+p+"$")))}function o(){let p=[...n.names.map(u),...n.skips.map(u).map(g=>"-"+g)].join(",");return n.enable(""),p}function c(p){if(p[p.length-1]==="*")return!0;let g,v;for(g=0,v=n.skips.length;g<v;g++)if(n.skips[g].test(p))return!1;for(g=0,v=n.names.length;g<v;g++)if(n.names[g].test(p))return!0;return!1}function u(p){return p.toString().substring(2,p.toString().length-2).replace(/\.\*\?$/,"*")}function l(p){return p instanceof Error?p.stack||p.message:p}function f(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}l2e.exports=D2t});var f2e=S((ps,gT)=>{"use strict";ps.formatArgs=P
|
|||
|
|
`).join(`
|
|||
|
|
`+o),e.push(a+"m+"+yT.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=$2t()+r+" "+e[0]}function $2t(){return Fn.inspectOpts.hideDate?"":new Date().toISOString()+" "}function L2t(...e){return process.stderr.write(vT.format(...e)+`
|
|||
|
|
`)}function N2t(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function M2t(){return process.env.DEBUG}function q2t(e){e.inspectOpts={};let r=Object.keys(Fn.inspectOpts);for(let n=0;n<r.length;n++)e.inspectOpts[r[n]]=Fn.inspectOpts[r[n]]}yT.exports=Oj()(Fn);var{formatters:p2e}=yT.exports;p2e.o=function(e){return this.inspectOpts.colors=this.useColors,vT.inspect(e,this.inspectOpts).split(`
|
|||
|
|
`).map(r=>r.trim()).join(" ")};p2e.O=function(e){return this.inspectOpts.colors=this.useColors,vT.inspect(e,this.inspectOpts)}});var kj=S((Rnr,Ij)=>{"use strict";typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Ij.exports=f2e():Ij.exports=d2e()});var C2e=S((Lnr,Uj)=>{"use strict";var Q2t=require("net"),ST=class extends Error{constructor(r){super(`${r} is locked`)}},pg={old:new Set,young:new Set},Z2t=1e3*15,ET,D2e=e=>new Promise((r,n)=>{let i=Q2t.createServer();i.unref(),i.on("error",n),i.listen(e,()=>{let{port:a}=i.address();i.close(()=>{r(a)})})}),eAt=function*(e){e&&(yield*e),yield 0};Uj.exports=async e=>{let r;e&&(r=typeof e.port=="number"?[e.port]:e.port),ET===void 0&&(ET=setInterval(()=>{pg.old=pg.young,pg.young=new Set},Z2t),ET.unref&&ET.unref());for(let n of eAt(r))try{let i=await D2e({...e,port:n});for(;pg.old.has(i)||pg.young.has(i);){if(n!==0)throw new ST(n);i=await D2e({...e,port:n})}return pg.young.add(i),i}catch(i){if(!["EADDRINUSE","EACCES"].includes(i.code)&&!(i instanceof ST))throw i}throw new Error("No available ports found")};Uj.exports.makeRange=(e,r)=>{if(!Number.isInteger(e)||!Number.isInteger(r))throw new TypeError("`from` and `to` must be integer numbers");if(e<1024||e>65535)throw new RangeError("`from` must be between 1024 and 65535");if(r<1024||r>65536)throw new RangeError("`to` must be between 1024 and 65536");if(r<e)throw new RangeError("`to` must be greater than or equal to `from`");return function*(i,a){for(let o=i;o<=a;o++)yield o}(e,r)}});var Ux={};Xn(Ux,{$:()=>n9,bgBlack:()=>_Oe,bgBlue:()=>DOe,bgCyan:()=>POe,bgGreen:()=>EOe,bgMagenta:()=>COe,bgRed:()=>rR,bgWhite:()=>TOe,bgYellow:()=>SOe,black:()=>xOe,blue:()=>Jn,bold:()=>N,cyan:()=>gs,dim:()=>J,gray:()=>Sl,green:()=>te,grey:()=>Oo,hidden:()=>yOe,inverse:()=>vOe,italic:()=>hs,magenta:()=>wOe,red:()=>oe,reset:()=>Og,strikethrough:()=>bOe,underline:()=>tt,white:()=>tR,yellow:()=>ze});var eR,ZB,e9,t9,r9=!0;typeof process<"u"&&({FORCE_COLOR:eR,NODE_DISABLE_COLORS:ZB,NO_COLOR:e9,TERM:t9}=process.env||{},r9=process.stdout&&process.stdout.isTTY);var n9={enabled:!ZB&&e9==null&&t9!=="dumb"&&(eR!=null&&eR!=="0"||r9)};function Vt(e,r){let n=new RegExp(`\\x1b\\[${r}m`,"g"),i=`\x1B[${e}m`,a=`\x1B[${r}m`;return function(o){return!n9.enabled||o==null?o:i+(~(""+o).indexOf(a)?o.replace(n,a+i):o)+a}}var Og=Vt(0,0),N=Vt(1,22),J=Vt(2,22),hs=Vt(3,23),tt=Vt(4,24),vOe=Vt(7,27),yOe=Vt(8,28),bOe=Vt(9,29),xOe=Vt(30,39),oe=Vt(31,39),te=Vt(32,39),ze=Vt(33,39),Jn=Vt(34,39),wOe=Vt(35,39),gs=Vt(36,39),tR=Vt(37,39),Sl=Vt(90,39),Oo=Vt(90,39),_Oe=Vt(40,49),rR=Vt(41,49),EOe=Vt(42,49),SOe=Vt(43,49),DOe=Vt(44,49),COe=Vt(45,49),POe=Vt(46,49),TOe=Vt(47,49);var ROe=100,i9=["green","yellow","blue","magenta","cyan","red"],nR=[],s9=Date.now(),AOe=0,iR=typeof process<"u"?process.env:{};globalThis.DEBUG??=iR.DEBUG??"";globalThis.DEBUG_COLORS??=iR.DEBUG_COLORS?iR.DEBUG_COLORS==="true":!0;var Ig={enable(e){typeof e=="string"&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let r=globalThis.DEBUG.split(",").map(a=>a.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),n=r.some(a=>a===""||a[0]==="-"?!1:e.match(RegExp(a.split("*").join(".*")+"$"))),i=r.some(a=>a===""||a[0]!=="-"?!1:e.match(RegExp(a.slice(1).split("*").join(".*")+"$")));return n&&!i},log:(...e)=>{let[r,n,...i]=e;(console.warn??console.log)(`${r} ${n}`,...i)},formatters:{}};function OOe(e){let r={color:i9[AOe++%i9.length],enabled:Ig.enabled(e),namespace:e,log:Ig.log,extend:()=>{}},n=(...i)=>{let{enabled:a,namespace:o,color:c,log:u}=r;if(i.length!==0&&nR.push([o,...i]),nR.length>ROe&&nR.shift(),Ig.enabled(o)||a){let l=i.map(p=>typeof p=="string"?p:IOe(p)),f=`+${Date.now()-s9}ms`;s9=Date.now(),globalThis.DEBUG_COLORS?u(Ux[c](N(o)),...l,Ux[c](f)):u(o,...l,f)}};return new Proxy(n,{get:(i,a)=>r[a],set:(i,a,o)=>r[a]=o})}var sR=new Proxy(OOe,{get:(e,r)=>Ig[r],set:(e,r,n)=>Ig[r]=n});function IOe(e,r=2){let n=new Set;return JSON.stringify(e,(i,a)=>{if(typeof a=="object"&&a!==null){if(n.has(a))return"[Circular *]";n.add(a)}else if(typeof a=="bigint")return a.toString
|
|||
|
|
${JSON.stringify(u,null,2)}`),u}async function KOe(){let e="/etc/os-release";try{let r=await fR.default.readFile(e,{encoding:"utf-8"});return YOe(r)}catch{return{targetDistro:void 0,familyDistro:void 0,originalDistro:void 0}}}function XOe(e){let r=/^OpenSSL\s(\d+\.\d+)\.\d+/.exec(e);if(r){let n=`${r[1]}.x`;return m9(n)}}function l9(e){let r=/libssl\.so\.(\d)(\.\d)?/.exec(e);if(r){let n=`${r[1]}${r[2]??".0"}.x`;return m9(n)}}function m9(e){let r=(()=>{if(v9(e))return e;let n=e.split(".");return n[1]="0",n.join(".")})();if(VOe.includes(r))return r}function JOe(e){return He(e).with({familyDistro:"musl"},()=>(Qn('Trying platform-specific paths for "alpine"'),["/lib"])).with({familyDistro:"debian"},({archFromUname:r})=>(Qn('Trying platform-specific paths for "debian" (and "ubuntu")'),[`/usr/lib/${r}-linux-gnu`,`/lib/${r}-linux-gnu`])).with({familyDistro:"rhel"},()=>(Qn('Trying platform-specific paths for "rhel"'),["/lib64","/usr/lib64"])).otherwise(({familyDistro:r,arch:n,archFromUname:i})=>(Qn(`Don't know any platform-specific paths for "${r}" on ${n} (${i})`),[]))}async function QOe(e){let r='grep -v "libssl.so.0"',n=await f9(e);if(n){Qn(`Found libssl.so file using platform-specific paths: ${n}`);let o=l9(n);if(Qn(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"libssl-specific-path"}}Qn('Falling back to "ldconfig" and other generic paths');let i=await Kx(`ldconfig -p | sed "s/.*=>s*//" | sed "s|.*/||" | grep libssl | sort | ${r}`);if(i||(i=await f9(["/lib64","/usr/lib64","/lib"])),i){Qn(`Found libssl.so file using "ldconfig" or other generic paths: ${i}`);let o=l9(i);if(Qn(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"ldconfig"}}let a=await Kx("openssl version -v");if(a){Qn(`Found openssl binary with version: ${a}`);let o=XOe(a);if(Qn(`The parsed openssl version is: ${o}`),o)return{libssl:o,strategy:"openssl-binary"}}return Qn("Couldn't find any version of libssl or OpenSSL in the system"),{}}async function f9(e){for(let r of e){let n=await ZOe(r);if(n)return n}}async function ZOe(e){try{return(await fR.default.readdir(e)).find(n=>n.startsWith("libssl.so.")&&!n.startsWith("libssl.so.0"))}catch(r){if(r.code==="ENOENT")return;throw r}}async function Hr(){let{binaryTarget:e}=await g9();return e}function eIe(e){return e.binaryTarget!==void 0}async function Lg(){let{memoized:e,...r}=await g9();return r}var Vx={};async function g9(){if(eIe(Vx))return Promise.resolve({...Vx,memoized:!0});let e=await h9(),r=tIe(e);return Vx={...e,binaryTarget:r},{...Vx,memoized:!1}}function tIe(e){let{platform:r,arch:n,archFromUname:i,libssl:a,targetDistro:o,familyDistro:c,originalDistro:u}=e;r==="linux"&&!["x64","arm64"].includes(n)&&zx(`Prisma only officially supports Linux on amd64 (x86_64) and arm64 (aarch64) system architectures (detected "${n}" instead). If you are using your own custom Prisma engines, you can ignore this warning, as long as you've compiled the engines for your system architecture "${i}".`);let l="1.1.x";if(r==="linux"&&a===void 0){let p=He({familyDistro:c}).with({familyDistro:"debian"},()=>"Please manually install OpenSSL via `apt-get update -y && apt-get install -y openssl` and try installing Prisma again. If you're running Prisma on Docker, add this command to your Dockerfile, or switch to an image that already has OpenSSL installed.").otherwise(()=>"Please manually install OpenSSL and try installing Prisma again.");zx(`Prisma failed to detect the libssl/openssl version to use, and may not work as expected. Defaulting to "openssl-${l}".
|
|||
|
|
${p}`)}let f="debian";if(r==="linux"&&o===void 0&&Qn(`Distro is "${u}". Falling back to Prisma engines built for "${f}".`),r==="darwin"&&n==="arm64")return"darwin-arm64";if(r==="darwin")return"darwin";if(r==="win32")return"windows";if(r==="freebsd")return o;if(r==="openbsd")return"openbsd";if(r==="netbsd")return"netbsd";if(r==="linux"&&o==="nixos")return"linux-nixos";if(r==="linux"&&n==="arm64")return`${o==="musl"?"linux-musl-arm64":"linux-arm64"}-openssl-${a||l}`;if(r==="linux"&&n==="arm")return`linux-arm-openssl-${a||l}`;if(r==="linux"&&o==="musl"){let p="linux-musl";return!a||v9(a)?p:`${p}-openssl-${a}`}return r==="linux"&&o&&a?`${o}-openssl-${a}`:(r!=="linux"&&zx(`Prisma detected unknown OS "${r}" and may not work as expected. Defaulting to "linux".`),a?`${f}-openssl-${a}`:o?`${o}-openssl-${l}`:`${f}-openssl-${l}`)}async function rIe(e){try{return await e()}catch{return}}function Kx(e){return rIe(async()=>{let r=await zOe(e);return Qn(`Command "${e}" successfully returned "${r.stdout}"`),r.stdout})}async function nIe(){return typeof Yx.default.machine=="function"?Yx.default.machine():(await Kx("uname -m"))?.trim()}function v9(e){return e.startsWith("1.")}var C9=B(bR());function xR(e){return(0,C9.default)(e,e,{fallback:tt})}var M6e=function(e,r,n){if(n||arguments.length===2)for(var i=0,a=r.length,o;i<a;i++)(o||!(i in r))&&(o||(o=Array.prototype.slice.call(r,0,i)),o[i]=r[i]);return e.concat(o||Array.prototype.slice.call(r))};function pv(e){return e}function _s(e,r,n,i,a,o,c,u,l){switch(arguments.length){case 1:return e;case 2:return function(){return r(e.apply(this,arguments))};case 3:return function(){return n(r(e.apply(this,arguments)))};case 4:return function(){return i(n(r(e.apply(this,arguments))))};case 5:return function(){return a(i(n(r(e.apply(this,arguments)))))};case 6:return function(){return o(a(i(n(r(e.apply(this,arguments))))))};case 7:return function(){return c(o(a(i(n(r(e.apply(this,arguments)))))))};case 8:return function(){return u(c(o(a(i(n(r(e.apply(this,arguments))))))))};case 9:return function(){return l(u(c(o(a(i(n(r(e.apply(this,arguments)))))))))}}}function vi(e,r,n,i,a,o,c,u,l){switch(arguments.length){case 1:return e;case 2:return r(e);case 3:return n(r(e));case 4:return i(n(r(e)));case 5:return a(i(n(r(e))));case 6:return o(a(i(n(r(e)))));case 7:return c(o(a(i(n(r(e))))));case 8:return u(c(o(a(i(n(r(e)))))));case 9:return l(u(c(o(a(i(n(r(e))))))));default:{for(var f=arguments[0],p=1;p<arguments.length;p++)f=arguments[p](f);return f}}}var Ut=function(e,r){var n=typeof e=="number"?function(i){return i.length>=e}:e;return function(){var i=Array.from(arguments);return n(arguments)?r.apply(this,i):function(a){return r.apply(void 0,M6e([a],i,!1))}}};var BY=function(e){return e._tag==="Some"},UY={_tag:"None"},GY=function(e){return{_tag:"Some",value:e}},iI=function(e){return e._tag==="Left"},WY=function(e){return e._tag==="Right"},p_=function(e){return{_tag:"Left",left:e}},d_=function(e){return{_tag:"Right",right:e}};var sI=function(e,r){return Ut(2,function(n,i){return r.flatMap(n,function(a){return e.fromIO(i(a))})})};function HY(e,r){return function(n){return function(i){return e.ap(e.map(i,function(a){return function(o){return r.ap(a,o)}}),n)}}}function zY(e,r){return function(n){return function(i){return e.map(i,function(a){return r.map(a,n)})}}}function No(e){return function(r,n){return e.map(r,function(){return n})}}function Qc(e){var r=No(e);return function(n){return r(n,void 0)}}function yi(e){return function(r,n){return e.chain(r,function(i){return e.map(n(i),function(){return i})})}}function aI(e){return function(r){return _s(r,e.fromEither)}}function g_(e,r){var n=aI(e),i=yi(r);return function(a,o){return i(a,n(o))}}var Bl=p_,Mo=d_,VY=Ut(2,function(e,r){return bi(e)?e:r(e.right)}),mI=function(e,r){return vi(e,Ul(r))},YY=function(e,r){return vi(e,W6e(r))};var v_="Either";var Ul=function(e){return function(r){return bi(r)?r:Mo(e(r.right))}},y_={URI:v_,map:mI},pFt=Ut(2,No(y_)),dFt=Qc(y_);var G6e=function(e){return function(r){return bi(r)?r:bi(e)?e:Mo(r.right(e.right))}},W6e=G6e,KY={URI:v_
|
|||
|
|
`).slice(1)].join(`
|
|||
|
|
`);return{message:r,stack:n}}function b_(e){if(!(typeof e>"u"))return typeof e=="string"?[["schema.prisma",e]]:e}function eu(e){return e.map(([r])=>r).join(`,
|
|||
|
|
`)}var D_={};Xn(D_,{prismaSchemaWasm:()=>on.default,prismaSchemaWasmVersion:()=>E5e});var on=B(yI());var S_=class{constructor(){this.message=""}get(){return`${this.message}`}set_message(r){this.message=`RuntimeError: ${r}`}};var{dependencies:_5e}=bI();var E5e=_5e["@prisma/prisma-schema-wasm"];globalThis.PRISMA_WASM_PANIC_REGISTRY=new S_;function S5e(e){return e.toString().toLowerCase().replace(/\s+/g,"-")}function Wl(e,r={json:!1}){if(r.json){let i=e.reduce((a,[o,c])=>(a[S5e(o)]=c,a),{});return JSON.stringify(i,null,2)}let n=e.reduce((i,a)=>Math.max(i,a[0].length),0);return e.map(([i,a])=>`${i.padEnd(n)} : ${a}`).join(`
|
|||
|
|
`)}var D5e=bI(),nK=D5e.version;function tu(e){return`${e}
|
|||
|
|
|
|||
|
|
${Wl([["Prisma CLI Version",nK]])}`}var k_=B(Nt());var hd=UY,C_=GY;var C5e=function(e){return e._tag==="Left"?hd:C_(e.right)},iK=function(e,r){return vi(e,wI(r))},P5e=function(e,r){return vi(e,T5e(r))};var xI="Option";var wI=function(e){return function(r){return md(r)?hd:C_(e(r.value))}},sK={URI:xI,map:iK},FFt=Ut(2,No(sK)),$Ft=Qc(sK);var T5e=function(e){return function(r){return md(r)||md(e)?hd:C_(r.value(e.value))}};var R5e=Ut(2,function(e,r){return md(e)?hd:r(e.value)}),aK={URI:xI,map:iK,ap:P5e,chain:R5e};var LFt=Ut(2,function(e,r){return md(e)?r():e});var A5e=C5e,O5e={URI:xI,fromEither:A5e},oK=BY,md=function(e){return e._tag==="None"},I5e=function(e,r){return function(n){return md(n)?e():r(n.value)}};var k5e=I5e,cK=k5e;var NFt=Ut(2,yi(aK)),MFt=Ut(2,g_(O5e,aK));var uK=function(e){return e==null?hd:C_(e)};function lK(e){return _s(Mo,e.of)}function fK(e){return function(r){return e.map(r,Mo)}}function pK(e){return zY(e,y_)}function dK(e){return HY(e,KY)}function hK(e){return function(r,n){return e.chain(r,function(i){return bi(i)?e.of(i):n(i.right)})}}function mK(e){return function(r,n,i){return e.map(r,XY(n,i))}}function gK(e){return function(r,n){return e.map(r,JY(n))}}function vK(e){return function(r){return function(n){return e.chain(n,function(i){return bi(i)?r(i.left):e.of(i)})}}}function yK(e){var r=vK(e);return function(n,i){return vi(n,r(function(a){return e.map(i(a),function(o){return bi(o)?o:Bl(a)})}))}}function P_(e,r){var n=yi(r);return function(i,a){return n(i,_s(a,e.fromIO))}}function bK(e,r){var n=yi(r);return function(i,a){return n(i,_s(a,e.fromTask))}}var _I=function(e){return function(){return Promise.resolve().then(e)}};var T_=function(e,r){return vi(e,xK(r))},EI=function(e,r){return vi(e,q5e(r))};var xK=function(e){return function(r){return function(){return Promise.resolve().then(r).then(e)}}},q5e=function(e){return function(r){return function(){return Promise.all([Promise.resolve().then(r),Promise.resolve().then(e)]).then(function(n){var i=n[0],a=n[1];return i(a)})}}},R_=function(e){return function(){return Promise.resolve(e)}},A_=Ut(2,function(e,r){return function(){return Promise.resolve().then(e).then(function(n){return r(n)()})}});var gd="Task";var Hl={URI:gd,map:T_},t$t=Ut(2,No(Hl)),r$t=Qc(Hl);var wK={URI:gd,of:R_},_K={URI:gd,map:T_,ap:EI};var EK={URI:gd,map:T_,ap:EI,chain:A_},SI={URI:gd,map:T_,of:R_,ap:EI,chain:A_};var SK={URI:gd,fromIO:_I},j5e={flatMap:A_},B5e={fromIO:SK.fromIO},n$t=sI(B5e,j5e),i$t=Ut(2,yi(EK)),s$t=Ut(2,P_(SK,EK));var G5e=function(e,r,n,i){function a(o){return o instanceof n?o:new n(function(c){c(o)})}return new(n||(n=Promise))(function(o,c){function u(p){try{f(i.next(p))}catch(g){c(g)}}function l(p){try{f(i.throw(p))}catch(g){c(g)}}function f(p){p.done?o(p.value):a(p.value).then(u,l)}f((i=i.apply(e,r||[])).next())})},W5e=function(e,r){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,a,o,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(f){return function(p){return l([f,p])}}function l(f){if(i)throw new TypeError("Generator is already executing.");for(;c&&(c=0,f[0]&&(n=0)),n;)try{if(i=1,a&&(o=f[0]&2?a.return:f[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,f[1])).done)return o;switch(a=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return n.label++,{value:f[1],done:!1};case 5:n.label++,a=f[1],f=[0];continue;case 7:f=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){n=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){n.label=f[1];break}if(f[0]===6&&n.label<o[1]){n.label=o[1],o=f;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(f);break}o[2]&&n.ops.pop(),n.trys.pop();continue}f=r.call(e,n)}catch(p){f=[6,p],a=0}finally{i=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}};var DK=lK(wK),CK=fK(Hl);var H5e=_s(_I,CK);var PK=H5e,z5e=CK,gv=R_;var vd=function(e,r){return function(){return G5e(void 0,void 0,void 0,function(){var n;return W5e(this,function(i){switch(i.
|
|||
|
|
`,{reason:i,error:a})};function CI(e){return`${oe(N("Prisma schema validation"))} - ${e}`}function nu({errorOutput:e,reason:r}){return(0,k_.pipe)(Es(()=>JSON.parse(e),()=>({_tag:"unparsed",message:e,reason:r})),Ul(i=>{let a=oe(N(Wi(i.message))),o=He(i).with({error_code:"P1012"},c=>({reason:CI(r),errorCode:c.error_code})).with({error_code:Cr.string},c=>({reason:r,errorCode:c.error_code})).otherwise(()=>({reason:r}));return{_tag:"parsed",message:a,...o}}),QY(k_.identity))}var F_=me("prisma:getConfig"),J5e="P1012",yv=class extends Error{constructor(r){let i=`${He(r).with({_tag:"parsed"},({errorCode:a,message:o,reason:c})=>{let u=a?`Error code: ${a}`:"";return`${c}
|
|||
|
|
${u}
|
|||
|
|
${o}`}).with({_tag:"unparsed"},({message:a,reason:o})=>{let c=oe(N("Details:"));return`${o}
|
|||
|
|
${c} ${a}`}).exhaustive()}
|
|||
|
|
[Context: getConfig]`;super(tu(i)),this.name="GetConfigError"}};function jo(e){return e.directUrl!==void 0?e.directUrl:e.url}function PI(e){return e.directUrl}function bv(e){let r=e?.value,n=e?.fromEnvVar,i=n?process.env[n]:void 0;return r??i}async function Ve(e){let r=ru(F_,"getConfigWasm");F_("Using getConfig Wasm");let n=(0,$K.pipe)(Es(()=>{process.env.FORCE_PANIC_QUERY_ENGINE_GET_CONFIG&&(F_("Triggering a Rust panic..."),on.default.debug_panic());let a=JSON.stringify({prismaSchema:e.datamodel,datasourceOverrides:{},ignoreEnvVarErrors:e.ignoreEnvVarErrors??!1,env:process.env});return on.default.get_config(a)},a=>({type:"wasm-error",reason:"(get-config wasm)",error:a})),Ul(a=>({result:a})),dv(({result:a})=>Es(()=>JSON.parse(a),o=>({type:"parse-json",reason:"Unable to parse JSON",error:o}))),dv(a=>a.errors.length>0?Bl({type:"validation-error",reason:"(get-config wasm)",error:a.errors}):Mo(a.config)));if(ia(n)){F_("config data retrieved without errors in getConfig Wasm");let{right:a}=n;for(let o of a.generators)await LK(o);return Promise.resolve(a)}throw He(n.left).with({type:"wasm-error"},a=>{if(r(a),Zc(a.error)){let{message:c,stack:u}=Ss(a.error);return new sn(c,u,"@prisma/prisma-schema-wasm get_config","FMT_CLI",e.prismaPath,b_(e.datamodel))}let o=a.error.message;return new yv(nu({errorOutput:o,reason:a.reason}))}).with({type:"validation-error"},a=>new yv({_tag:"parsed",errorCode:J5e,reason:CI(a.reason),message:Q5e(a.error)})).otherwise(a=>(r(a),new yv({_tag:"unparsed",message:a.error.message,reason:a.reason})))}async function LK(e){for(let r of e.binaryTargets){if(r.fromEnvVar&&process.env[r.fromEnvVar]){let n=JSON.parse(process.env[r.fromEnvVar]);Array.isArray(n)?(e.binaryTargets=n.map(i=>({fromEnvVar:null,value:i})),await LK(e)):r.value=n}r.value==="native"&&(r.value=await Hr(),r.native=!0)}e.binaryTargets.length===0&&(e.binaryTargets=[{fromEnvVar:null,value:await Hr(),native:!0}])}function Q5e(e){let r=e.map(i=>Wi(i.message)).join(`
|
|||
|
|
|
|||
|
|
`),n=`Validation Error Count: ${e.length}`;return`${r}
|
|||
|
|
${n}`}var kF=B(ZK()),FF=B(require("fs")),Xd=B(require("path"));var WE=B(KJ()),SF=B(Pl()),DF=B(require("fs"));var pr=B(require("path"));var $ee=B(require("path"),1);var JJ=B(require("process"),1),QJ=B(require("fs/promises"),1),ZJ=require("url");var Kl=B(require("path"),1),XJ=e=>e instanceof URL?(0,ZJ.fileURLToPath)(e):e;async function eQ(e,{cwd:r=JJ.default.cwd(),type:n="file",stopAt:i}={}){let a=Kl.default.resolve(XJ(r)??""),{root:o}=Kl.default.parse(a);for(i=Kl.default.resolve(a,XJ(i??o));a&&a!==i&&a!==o;){let c=Kl.default.isAbsolute(e)?e:Kl.default.join(a,e);try{let u=await QJ.default.stat(c);if(n==="file"&&u.isFile()||n==="directory"&&u.isDirectory())return c}catch{}a=Kl.default.dirname(a)}}var Oee=B(require("fs/promises"),1),Iee=B(require("path"),1);var eZ=B(JQ(),1);var QQ=(e,r,n)=>n<0?-1:e.lastIndexOf(r,n);function l9e(e,r){let n=QQ(e,`
|
|||
|
|
`,r-1),i=r-n-1,a=0;for(let o=n;o>=0;o=QQ(e,`
|
|||
|
|
`,o-1))a++;return{line:a,column:i}}function tE(e,r,{oneBased:n=!1}={}){if(r<0||r>=e.length&&e.length>0)throw new RangeError("Index out of bounds");let i=l9e(e,r);return n?{line:i.line+1,column:i.column+1}:i}var f9e=e=>`\\u{${e.codePointAt(0).toString(16)}}`,Cd,pk=class pk extends Error{constructor(n){super();Je(this,"name","JSONError");Je(this,"fileName");Je(this,"codeFrame");Je(this,"rawCodeFrame");Ee(this,Cd);fe(this,Cd,n),Error.captureStackTrace?.(this,pk)}get message(){let{fileName:n,codeFrame:i}=this;return`${$(this,Cd)}${n?` in ${n}`:""}${i?`
|
|||
|
|
|
|||
|
|
${i}
|
|||
|
|
`:""}`}set message(n){fe(this,Cd,n)}};Cd=new WeakMap;var lk=pk,ZQ=(e,r,n=!0)=>(0,eZ.codeFrameColumns)(e,{start:r},{highlightCode:n}),p9e=(e,r)=>{let n=r.match(/in JSON at position (?<index>\d+)(?: \(line (?<line>\d+) column (?<column>\d+)\))?$/);if(!n)return;let{index:i,line:a,column:o}=n.groups;if(a&&o)return{line:Number(a),column:Number(o)};if(i=Number(i),i===e.length){let{line:c,column:u}=tE(e,e.length-1,{oneBased:!0});return{line:c,column:u+1}}return tE(e,i,{oneBased:!0})},d9e=e=>e.replace(/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,(r,n,i)=>`"${i}"(${f9e(i)})`);function fk(e,r,n){typeof r=="string"&&(n=r,r=void 0);let i;try{return JSON.parse(e,r)}catch(c){i=c.message}let a;e?(a=p9e(e,i),i=d9e(i)):i+=" while parsing empty string";let o=new lk(i);throw o.fileName=n,a&&(o.codeFrame=ZQ(e,a),o.rawCodeFrame=ZQ(e,a,!1)),o}var kee=B(Tee(),1);var Ree=require("url");function Aee(e){return e instanceof URL?(0,Ree.fileURLToPath)(e):e}var YUe=e=>Iee.default.resolve(Aee(e)??".","package.json"),KUe=(e,r)=>{let n=typeof e=="string"?fk(e):e;return r&&(0,kee.default)(n),n};async function Fee({cwd:e,normalize:r=!0}={}){let n=await Oee.default.readFile(YUe(e),"utf8");return KUe(n,r)}async function Lk(e){let r=await eQ("package.json",e);if(r)return{packageJson:await Fee({...e,cwd:$ee.default.dirname(r)}),path:r}}var CF=require("util");function Nv({schemas:e}){let r=on.default.lint(JSON.stringify(e));return JSON.parse(r)}function Nk(e,{schemas:r}){try{return e()}catch(n){let{message:i,stack:a}=Ss(n);throw new sn(i,a,"@prisma/prisma-schema-wasm lint","FMT_CLI",eu(r),r)}}function XUe(e){return e.filter(QUe)}function Mv(e){let r=XUe(e),n=[];if(r.length>0){n.push(ze(`
|
|||
|
|
Prisma schema warning${r.length>1?"s":""}:`));for(let i of r)n.push(JUe(i))}return n.join(`
|
|||
|
|
`)}function JUe(e){return ze(`- ${e.text}`)}function QUe(e){return e.is_warning}var Lee=me("prisma:format");async function Mk({schemas:e},r){process.env.FORCE_PANIC_PRISMA_SCHEMA&&Nee(()=>{on.default.debug_panic()},{schemas:e});let i={textDocument:{uri:"file:/dev/null"},options:{...{tabSize:2,insertSpaces:!0},...r}},{formattedMultipleSchemas:a,lintDiagnostics:o}=Nee(()=>{let u=ZUe(JSON.stringify(e),i),l=JSON.parse(u),f=Nv({schemas:l});return{formattedMultipleSchemas:l,lintDiagnostics:f}},{schemas:e}),c=Mv(o);return c&&fr.should.warn()&&console.warn(c),Promise.resolve(a)}function Nee(e,{schemas:r}){try{return e()}catch(n){let{message:i,stack:a}=Ss(n);throw Lee(`Error formatting schema: ${i}`),Lee(a),new sn(i,a,"@prisma/prisma-schema-wasm format","FMT_CLI",eu(r),r)}}function ZUe(e,r){return on.default.format(e,JSON.stringify(r))}var qk=B(Nt());var Mee=B(require("fs"));var Fd=me("prisma:getDMMF"),qv=class extends Error{constructor(r){let i=`${He(r).with({_tag:"parsed"},({errorCode:a,message:o,reason:c})=>{let u=a?`Error code: ${a}`:"";return`${c}
|
|||
|
|
${u}
|
|||
|
|
${o}`}).with({_tag:"unparsed"},({message:a,reason:o})=>{let c=oe(N("Details:"));return`${o}
|
|||
|
|
${c} ${a}`}).exhaustive()}
|
|||
|
|
[Context: getDmmf]`;super(tu(i)),this.name="GetDmmfError"}};async function pE(e){e7e(e.previewFeatures);let r=ru(Fd,"getDmmfWasm");Fd("Using getDmmf Wasm");let i=await(0,qk.pipe)(vd(()=>e.datamodel?(Fd("Using given datamodel"),Promise.resolve(e.datamodel)):(Fd(`Reading datamodel from the given datamodel path ${e.datamodelPath}`),Mee.default.promises.readFile(e.datamodelPath,{encoding:"utf-8"})),o=>({type:"read-datamodel-path",reason:"Error while trying to read the datamodel path",error:o,datamodelPath:e.datamodelPath})),kK(o=>(0,qk.pipe)(Es(()=>{process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF&&(Fd("Triggering a Rust panic..."),on.default.debug_panic());let c=JSON.stringify({prismaSchema:o,noColor:!!process.env.NO_COLOR});return on.default.get_dmmf(c)},c=>({type:"wasm-error",reason:"(get-dmmf wasm)",error:c})),Ul(c=>({result:c})),dv(({result:c})=>Es(()=>JSON.parse(c),u=>({type:"parse-json",reason:"Unable to parse JSON",error:u}))),gv)))();if(ia(i)){Fd("dmmf data retrieved without errors in getDmmf Wasm");let{right:o}=i;return Promise.resolve(o)}throw He(i.left).with({type:"read-datamodel-path"},o=>(r(o),new qv({_tag:"unparsed",message:`${o.error.message}
|
|||
|
|
Datamodel path: "${o.datamodelPath}"`,reason:o.reason}))).with({type:"wasm-error"},o=>{if(r(o),Zc(o.error)){let{message:u,stack:l}=Ss(o.error);return new sn(u,l,"@prisma/prisma-schema-wasm get_dmmf","FMT_CLI",e.prismaPath,b_(e.datamodel))}let c=o.error.message;return new qv(nu({errorOutput:c,reason:o.reason}))}).with({type:"parse-json"},o=>(r(o),new qv({_tag:"unparsed",message:o.error.message,reason:o.reason}))).exhaustive()}function e7e(e){let r=i=>`${Jn(N("info"))} The preview flag "${i}" is not needed anymore, please remove it from your schema.prisma`,n={insensitiveFilters:r("insensitiveFilters"),atomicNumberOperations:r("atomicNumberOperations"),connectOrCreate:r("connectOrCreate"),transaction:r("transaction"),nApi:r("nApi"),transactionApi:r("transactionApi"),uncheckedScalarInputs:r("uncheckedScalarInputs"),nativeTypes:r("nativeTypes"),createMany:r("createMany"),groupBy:r("groupBy"),referentialActions:r("referentialActions"),microsoftSqlServer:r("microsoftSqlServer"),selectRelationCount:r("selectRelationCount"),orderByRelation:r("orderByRelation"),orderByAggregateGroup:r("orderByAggregateGroup")};e?.forEach(i=>{let a=n[i];a&&!process.env.PRISMA_HIDE_PREVIEW_FLAG_WARNINGS&&console.warn(a)})}var gne=require("@prisma/engines");var Zre=B(Pl()),Di=B(require("fs")),bF=B(uu());var ene=B(Uee()),Za=B(require("path")),tne=B(l1()),rne=require("util");var Uk=B(require("fs"));function Gee(e){if(process.platform==="win32")return;let r=Uk.default.statSync(e),n=r.mode|64|8|1;if(r.mode===n)return;let i=n.toString(8).slice(-3);Uk.default.chmodSync(e,i)}var Yk=B(require("fs")),ate=B(l_()),Kk=B(require("path")),ote=B(u_()),cte=require("util");var rte=B(require("process"),1),$d=B(require("path"),1),Bv=B(require("fs"),1),nte=B(Hee(),1);var Qee=B(require("path"),1);var jv=B(require("path"),1),Xee=require("url");var zee=B(require("process"),1),Vee=B(require("path"),1),dE=B(require("fs"),1),Yee=require("url");var Kee={directory:"isDirectory",file:"isFile"};function i7e(e){if(!Object.hasOwnProperty.call(Kee,e))throw new Error(`Invalid type specified: ${e}`)}var s7e=(e,r)=>r[Kee[e]](),a7e=e=>e instanceof URL?(0,Yee.fileURLToPath)(e):e;function Gk(e,{cwd:r=zee.default.cwd(),type:n="file",allowSymlinks:i=!0}={}){i7e(n),r=a7e(r);let a=i?dE.default.statSync:dE.default.lstatSync;for(let o of e)try{let c=a(Vee.default.resolve(r,o),{throwIfNoEntry:!1});if(!c)continue;if(s7e(n,c))return o}catch{}}var o7e=e=>e instanceof URL?(0,Xee.fileURLToPath)(e):e,c7e=Symbol("findUpStop");function u7e(e,r={}){let n=jv.default.resolve(o7e(r.cwd)||""),{root:i}=jv.default.parse(n),a=r.stopAt||i,o=r.limit||Number.POSITIVE_INFINITY,c=[e].flat(),u=f=>{if(typeof e!="function")return Gk(c,f);let p=e(f.cwd);return typeof p=="string"?Gk([p],f):p},l=[];for(;;){let f=u({...r,cwd:n});if(f===c7e||(f&&l.push(jv.default.resolve(n,f)),n===a||l.length>=o))break;n=jv.default.dirname(n)}return l}function Jee(e,r={}){return u7e(e,{...r,limit:1})[0]}function Zee({cwd:e}={}){let r=Jee("package.json",{cwd:e});return r&&Qee.default.dirname(r)}var{env:Wk,cwd:l7e}=rte.default,ete=e=>{try{return Bv.default.accessSync(e,Bv.default.constants.W_OK),!0}catch{return!1}};function tte(e,r){return r.create&&Bv.default.mkdirSync(e,{recursive:!0}),e}function f7e(e){let r=$d.default.join(e,"node_modules");if(!(!ete(r)&&(Bv.default.existsSync(r)||!ete($d.default.join(e)))))return r}function Hk(e={}){if(Wk.CACHE_DIR&&!["true","false","1","0"].includes(Wk.CACHE_DIR))return tte($d.default.join(Wk.CACHE_DIR,e.name),e);let{cwd:r=l7e(),files:n}=e;if(n){if(!Array.isArray(n))throw new TypeError(`Expected \`files\` option to be an array, got \`${typeof n}\`.`);r=(0,nte.default)(n.map(a=>$d.default.resolve(r,a)))}if(r=Zee({cwd:r}),!(!r||!f7e(r)))return tte($d.default.join(r,"node_modules",".cache",e.name),e)}var Ld=B(require("fs")),zk=B(uu()),hE=B(require("os")),mE=B(require("path"));var ite=me("prisma:fetch-engine:cache-dir");async function Uv(){if(hE.default.platform()==="win32"){let e=Hk({name:"prisma",create:!0});if(e)return e;if(process.env.APPDATA)return mE.default.join(process.env.APPDATA,"Prisma")}if(proc
|
|||
|
|
\r
|
|||
|
|
`),i=!1,a=!1,o;e.on("response",c=>{let{headers:u}=c;i=u["transfer-encoding"]==="chunked"&&!u["content-length"]}),e.on("socket",c=>{let u=()=>{if(i&&!a){let f=new Error("Premature close");f.code="ERR_STREAM_PREMATURE_CLOSE",r(f)}},l=f=>{a=Qv.Buffer.compare(f.slice(-5),n)===0,!a&&o&&(a=Qv.Buffer.compare(o.slice(-3),n.slice(0,3))===0&&Qv.Buffer.compare(f.slice(-2),n.slice(3))===0),o=f};c.prependListener("close",u),c.on("data",l),e.on("close",()=>{c.removeListener("close",u),c.removeListener("data",l)})})}var mF=B(ire()),kre=B(require("path")),Fre=B(u_()),$re=B(jY()),Lre=require("util"),Nre=B(require("zlib"));var Cre=B(bre()),Pre=B(Dre()),Tre=B(require("url")),dF=me("prisma:fetch-engine:getProxyAgent");function Rre(e){return e.replace(/^\.*/,".").toLowerCase()}function zGe(e){e=e.trim().toLowerCase();let r=e.split(":",2),n=Rre(r[0]),i=r[1],a=e.includes(":");return{hostname:n,port:i,hasPort:a}}function VGe(e,r){let n=e.port||(e.protocol==="https:"?"443":"80"),i=Rre(e.hostname);return r.split(",").map(zGe).some(function(o){let c=i.indexOf(o.hostname),u=c>-1&&c===i.length-o.hostname.length;return o.hasPort?n===o.port&&u:u})}function YGe(e){let r=process.env.NO_PROXY||process.env.no_proxy||"";if(r&&dF(`noProxy is set to "${r}"`),r==="*"||r!==""&&VGe(e,r))return null;if(e.protocol==="http:"){let n=process.env.HTTP_PROXY||process.env.http_proxy||null;return n&&dF(`uri.protocol is HTTP and the URL for the proxy is "${n}"`),n}if(e.protocol==="https:"){let n=process.env.HTTPS_PROXY||process.env.https_proxy||process.env.HTTP_PROXY||process.env.http_proxy||null;return n&&dF(`uri.protocol is HTTPS and the URL for the proxy is "${n}"`),n}return null}function pf(e){try{let r=Tre.default.parse(e),n=YGe(r);if(n){if(r.protocol==="http:")try{return new Cre.HttpProxyAgent(n)}catch(i){throw new Error(`Error while instantiating HttpProxyAgent with URL: "${n}"
|
|||
|
|
${i}
|
|||
|
|
Check the following env vars "http_proxy" or "HTTP_PROXY". The value should be a valid URL starting with "http://"`)}else if(r.protocol==="https:")try{return new Pre.HttpsProxyAgent(n)}catch(i){throw new Error(`Error while instantiating HttpsProxyAgent with URL: "${n}"
|
|||
|
|
${i}
|
|||
|
|
Check the following env vars "https_proxy" or "HTTPS_PROXY". The value should be a valid URL starting with "https://"`)}}else return}catch(r){console.warn("An error occurred in getProxyAgent(), no proxy agent will be used.",r)}}var qE=me("prisma:fetch-engine:downloadZip"),Are=(0,Lre.promisify)(Fre.default);async function Ore(e){try{let r=`${e}.sha256`,n=await Ja(r,{agent:pf(e)});if(!n.ok){let o=`Failed to fetch sha256 checksum at ${r} - ${n.status} ${n.statusText}`;throw process.env.PRISMA_ENGINES_CHECKSUM_IGNORE_MISSING||(o+=`
|
|||
|
|
|
|||
|
|
If you need to ignore this error (e.g. in an offline environment), set the PRISMA_ENGINES_CHECKSUM_IGNORE_MISSING environment variable to a truthy value.
|
|||
|
|
Example: PRISMA_ENGINES_CHECKSUM_IGNORE_MISSING=1`),new Error(o)}let i=await n.text(),[a]=i.split(/\s+/);if(!/^[a-f0-9]{64}$/gi.test(a))throw new Error(`Unable to parse checksum from ${r} - response body: ${i}`);return a}catch(r){if(process.env.PRISMA_ENGINES_CHECKSUM_IGNORE_MISSING)return qE(`fetchChecksum() failed and was ignored as the PRISMA_ENGINES_CHECKSUM_IGNORE_MISSING environment variable is truthy.
|
|||
|
|
Error: ${r}`),null;throw r}}async function Mre(e,r,n){let i=$re.default.directory(),a=kre.default.join(i,"partial"),o=2,[c,u]=await(0,mF.default)(async()=>await Promise.all([Ore(e),Ore(e.slice(0,e.length-3))]),{retries:o,onFailedAttempt:f=>qE("An error occurred while downloading the checksums files",f)}),l=await(0,mF.default)(async()=>{let f=await Ja(e,{compress:!1,agent:pf(e)});if(!f.ok)throw new Error(`Failed to fetch the engine file at ${e} - ${f.status} ${f.statusText}`);let p=f.headers.get("last-modified"),g=parseFloat(f.headers.get("content-length")),v=Ire.default.createWriteStream(a);return await new Promise(async(x,E)=>{let D=0;if(f.body===null)return E(new Error(`Failed to fetch the engine file at ${e} - response.body is null`));f.body.once("error",E).on("data",V=>{D+=V.length,g&&n&&n(D/g)});let P=Nre.default.createGunzip();P.on("error",E);let R=f.body.pipe(P),k=hF.default.fromStream(f.body,{algorithm:"sha256"}),F=hF.default.fromStream(R,{algorithm:"sha256"});R.pipe(v),v.on("error",E).on("close",()=>{x({lastModified:p,sha256:u,zippedSha256:c})});let L=await F,U=await k;if(c!==null&&c!==U)return E(new Error(`sha256 checksum of ${e} (zipped) should be ${c} but is ${U}`));if(u!==null&&u!==L)return E(new Error(`sha256 checksum of ${e} (unzipped) should be ${u} but is ${L}`))})},{retries:o,onFailedAttempt:f=>qE("An error occurred while downloading the engine file",f)});await tf(a,r);try{await Are(a),await Are(i)}catch(f){qE(f)}return l}var qre=B(require("fs"));var jre=B(require("path"));var KGe=me("prisma:fetch-engine:env"),gF={"query-engine":"PRISMA_QUERY_ENGINE_BINARY","libquery-engine":"PRISMA_QUERY_ENGINE_LIBRARY","schema-engine":"PRISMA_SCHEMA_ENGINE_BINARY"},XGe={"schema-engine":"PRISMA_MIGRATION_ENGINE_BINARY"};function df(e){let r=JGe(e);if(process.env[r]){let n=jre.default.resolve(process.cwd(),process.env[r]);if(!qre.default.existsSync(n))throw new Error(`Env var ${N(r)} is provided but provided path ${tt(process.env[r])} can't be resolved.`);return KGe(`Using env var ${N(r)} for binary ${N(e)}, which points to ${tt(process.env[r])}`),{path:n,fromEnvVar:r}}return null}function JGe(e){let r=gF[e],n=XGe[e];return n&&process.env[n]?process.env[r]?(console.warn(`${ze("prisma:warn")} Both ${N(r)} and ${N(n)} are specified, ${N(r)} takes precedence. ${N(n)} is deprecated.`),r):(console.warn(`${ze("prisma:warn")} ${N(n)} environment variable is deprecated, please use ${N(r)} instead`),n):r}function Bre(e){for(let r of e)if(!df(r))return!1;return!0}var Ure=B(require("crypto")),Gre=B(require("fs"));function vF(e){let r=Ure.default.createHash("sha256"),n=Gre.default.createReadStream(e);return new Promise(i=>{n.on("readable",()=>{let a=n.read();a?r.update(a):i(r.digest("hex"))})})}var Kre=B(Yre());function Xre(e){return new Kre.default(`> ${e} [:bar] :percent`,{stream:process.stdout,width:20,complete:"=",incomplete:" ",total:100,head:"",clear:!0})}var{enginesOverride:Qre}=Jre(),Yo=me("prisma:fetch-engine:download"),yF=(0,rne.promisify)(Di.default.exists),nne="master",ine=/^((\w:[\\\/])|\/)snapshot[\/\\]/;async function jE(options){(Qre?.branch||Qre?.folder)&&(options.version="_local_",options.skipCacheIntegrityCheck=!0);let{binaryTarget,...os}=await Lg();if(os.targetDistro&&["nixos"].includes(os.targetDistro)&&!Bre(Object.keys(options.binaries))?console.error(`${ze("Warning")} Precompiled engine files are not available for ${os.targetDistro}, please provide the paths via environment variables, see https://pris.ly/d/custom-engines`):["freebsd11","freebsd12","freebsd13","freebsd14","freebsd15","openbsd","netbsd"].includes(binaryTarget)?console.error(`${ze("Warning")} Precompiled engine files are not available for ${binaryTarget}. Read more about building your own engines at https://pris.ly/d/build-engines`):"libquery-engine"in options.binaries&&Mp(),!options.binaries||Object.values(options.binaries).length===0)return{};let opts={...options,binaryTargets:options.binaryTargets??[binaryTarget],version:options.version??"latest",binaries:options.binaries},binaryJobs=Object.entries(opts.binaries).flatMap(([e,r])=>opts.binary
|
|||
|
|
- ${a}
|
|||
|
|
- ${o}
|
|||
|
|
- ${c}
|
|||
|
|
- ${u}`)}function lne(e,r){return vd(()=>wu(e,r),n=>n)}async function BE(file){let dir=eval("__dirname");if(dir.match(Vd)){let e=xu.default.join(une.default,"prisma-binaries");await(0,cne.ensureDir)(e);let r=xu.default.join(e,xu.default.basename(file)),n=await bu.default.promises.readFile(file);return await bu.default.promises.writeFile(r,n),ane(r),r}return file}var dne=require("@prisma/engines");var hne=B(Pl());function fne(e){let r=e.e,n=u=>`Prisma cannot find the required \`${u}\` system library in your system`,i=r.message.includes("cannot open shared object file"),a=`Please refer to the documentation about Prisma's system requirements: ${xR("https://pris.ly/d/system-requirements")}`,o=`Unable to require(\`${J(e.id)}\`).`,c=He({message:r.message,code:r.code}).with({code:"ENOENT"},()=>"File does not exist.").when(({message:u})=>i&&u.includes("libz"),()=>`${n("libz")}. Please install it and try again.`).when(({message:u})=>i&&u.includes("libgcc_s"),()=>`${n("libgcc_s")}. Please install it and try again.`).when(({message:u})=>i&&u.includes("libssl"),()=>{let u=e.platformInfo.libssl?`openssl-${e.platformInfo.libssl}`:"openssl";return`${n("libssl")}. Please install ${u} and try again.`}).when(({message:u})=>u.includes("GLIBC"),()=>`Prisma has detected an incompatible version of the \`glibc\` C standard library installed in your system. This probably means your system may be too old to run Prisma. ${a}`).when(({message:u})=>e.platformInfo.platform==="linux"&&u.includes("symbol not found"),()=>`The Prisma engines are not compatible with your system ${e.platformInfo.originalDistro} on (${e.platformInfo.archFromUname}) which uses the \`${e.platformInfo.binaryTarget}\` binaryTarget by default. ${a}`).otherwise(()=>`The Prisma engines do not seem to be compatible with your system. ${a}`);return`${o}
|
|||
|
|
${c}
|
|||
|
|
|
|||
|
|
Details: ${r.message}`}function pne(e,r){try{return require(e)}catch(n){let i=fne({e:n,platformInfo:r,id:e});throw new Error(i)}}async function lWe(e,r){r||(r=(0,dne.getCliQueryEngineBinaryType)()),e=await wu(r,e);let n=await Lg();if(r==="libquery-engine"){Mp();let i=pne(e,n);return`libquery-engine ${i.version().commit}`}else{let{stdout:i}=await(0,hne.default)(e,["--version"]);return i}}function mne(e,r){return vd(()=>lWe(e,r),n=>n)}async function wF(){let r=[{name:"query-engine",type:(0,gne.getCliQueryEngineBinaryType)()},{name:"schema-engine",type:"schema-engine"}],n=r.map(({name:u,type:l})=>pWe(l).then(f=>[u,f])),i=await Promise.all(n).then(Object.fromEntries),a=r.map(({name:u})=>{let[l,f]=fWe(i[u]);return[{[u]:l},f]}),o=a.map(u=>u[0]),c=a.flatMap(u=>u[1]);return[o,c]}function fWe(e){let r=[],n=He(e).with({fromEnvVar:Cr.when(oK)},c=>`, resolved by ${c.fromEnvVar.value}`).otherwise(()=>""),i=He(e).with({path:Cr.when(ia)},c=>c.path.right).with({path:Cr.when(bi)},c=>(r.push(c.path.left),"E_CANNOT_RESOLVE_PATH")).exhaustive();return[`${He(e).with({version:Cr.when(ia)},c=>c.version.right).with({version:Cr.when(bi)},c=>(r.push(c.version.left),"E_CANNOT_RESOLVE_VERSION")).exhaustive()} (at ${vne.default.relative(process.cwd(),i)}${n})`,r]}async function pWe(e){let r=uK(df(e)),n=(0,UE.pipe)(r,wI(c=>c.fromEnvVar)),i=await(0,UE.pipe)(r,cK(()=>lne(e),c=>DK(c.path)))(),a=await(0,UE.pipe)(i,gv,IK(c=>mne(c,e)))();return{path:i,version:a,fromEnvVar:n}}var yne=B(Nt());var GE=me("prisma:mergeSchemas"),_F=class extends Error{constructor(r){let i=`${He(r).with({_tag:"parsed"},({errorCode:a,message:o,reason:c})=>{let u=a?`Error code: ${a}`:"";return`${c}
|
|||
|
|
${u}
|
|||
|
|
${Wi(o)}`}).with({_tag:"unparsed"},({message:a,reason:o})=>{let c=oe(N("Details:"));return`${o}
|
|||
|
|
${c} ${a}`}).exhaustive()}
|
|||
|
|
[Context: mergeSchemas]`;super(tu(i)),this.name="MergeSchemasError"}};function ey(e){let r=ru(GE,"mergeSchemasWasm");GE("Using mergeSchemas Wasm");let n=(0,yne.pipe)(Es(()=>{let a=JSON.stringify({schema:e.schemas});return on.default.merge_schemas(a)},a=>({type:"wasm-error",reason:"(mergeSchemas wasm)",error:a})));if(ia(n))return n.right;throw He(n.left).with({type:"wasm-error"},a=>{if(r(a),console.error(""),Zc(a.error)){let{message:c,stack:u}=Ss(a.error);return GE(`Error merging schemas: ${c}`),GE(u),new sn(c,u,"@prisma/prisma-schema-wasm merge_schemas","FMT_CLI",eu(e.schemas),e.schemas)}let o=a.error.message;return new _F(nu({errorOutput:o,reason:a.reason}))}).exhaustive()}var bne=B(Nt());var ty=me("prisma:validate"),EF=class extends Error{constructor(r){let i=`${He(r).with({_tag:"parsed"},({errorCode:a,message:o,reason:c})=>{let u=a?`Error code: ${a}`:"";return`${c}
|
|||
|
|
${u}
|
|||
|
|
${Wi(o)}`}).with({_tag:"unparsed"},({message:a,reason:o})=>{let c=oe(N("Details:"));return`${o}
|
|||
|
|
${c} ${a}`}).exhaustive()}
|
|||
|
|
[Context: validate]`;super(tu(i)),this.name="ValidateError"}};function hf(e){let r=ru(ty,"validateWasm");ty("Using validate Wasm");let n=(0,bne.pipe)(Es(()=>{process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF&&(ty("Triggering a Rust panic..."),on.default.debug_panic());let a=JSON.stringify({prismaSchema:e.schemas,noColor:!!process.env.NO_COLOR});on.default.validate(a)},a=>({type:"wasm-error",reason:"(validate wasm)",error:a})));if(ia(n))return;throw He(n.left).with({type:"wasm-error"},a=>{if(r(a),console.error(""),Zc(a.error)){let{message:c,stack:u}=Ss(a.error);return ty(`Error validating schema: ${c}`),ty(u),new sn(c,u,"@prisma/prisma-schema-wasm validate","FMT_CLI",eu(e.schemas),e.schemas)}let o=a.error.message;return new EF(nu({errorOutput:o,reason:a.reason}))}).exhaustive()}var dWe=(0,CF.promisify)(DF.default.readFile),Ene=(0,CF.promisify)(DF.default.stat),Yd=sR("prisma:getSchema");async function pt(e,{cwd:r=process.cwd(),argumentName:n="--schema"}={}){let i=await Tne(e,{cwd:r,argumentName:n});if(i.ok)return i.schema;throw new Error(hWe(i.error,r))}async function ry(e,{cwd:r=process.cwd(),argumentName:n="--schema"}={}){let i=await Tne(e,{cwd:r,argumentName:n});return i.ok?i.schema:null}async function Sne(e){Yd("Reading schema from single file",e);let r=await Cne(e,"file");if(r)return{ok:!1,error:r};let n=await dWe(e,{encoding:"utf-8"}),i=[e,n];return{ok:!0,schema:{schemaPath:e,schemaRootDir:pr.default.dirname(e),schemas:[i]}}}async function Dne(e){Yd("Reading schema from multiple files",e);let r=await Cne(e,"directory");if(r)return{ok:!1,error:r};let n=await(0,WE.loadSchemaFiles)(e);Yd("Loading config");let i=await Ve({datamodel:n,ignoreEnvVarErrors:!0});return Yd("Ok"),(0,WE.usesPrismaSchemaFolder)(i)?{ok:!0,schema:{schemaPath:e,schemaRootDir:e,schemas:n}}:{ok:!1,error:{kind:"FolderPreviewNotEnabled",path:e}}}async function Cne(e,r){try{let n=await Ene(e);return r==="file"&&n.isFile()||r==="directory"&&n.isDirectory()?void 0:{kind:"WrongType",path:e,expectedTypes:[r]}}catch(n){if(n.code==="ENOENT")return{kind:"NotFound",path:e,expectedType:r};throw n}}async function Pne(e){let r;try{r=await Ene(e)}catch(n){if(n.code==="ENOENT")return{ok:!1,error:{kind:"NotFound",path:e}};throw n}return r.isFile()?Sne(e):r.isDirectory()?Dne(e):{ok:!1,error:{kind:"WrongType",path:e,expectedTypes:["file","directory"]}}}async function Tne(e,{cwd:r,argumentName:n}){if(e){let u=pr.default.resolve(r,e),l=await Pne(u);if(!l.ok){let f=pr.default.relative(r,u);throw new Error(`Could not load \`${n}\` from provided path \`${f}\`: ${PF(l.error)}`)}return l}let i=await HE(r);if(i.ok)return i;let a=await Rne(r);if(a.ok)return a;let o=await mWe(r,a.error.failures);return o.ok?o:{ok:!1,error:o.error.kind==="Yarn1WorkspaceSchemaNotFound"?a.error:o.error}}function PF(e){switch(e.kind){case"NotFound":return`${e.expectedType??"file or directory"} not found`;case"FolderPreviewNotEnabled":return'"prismaSchemaFolder" preview feature must be enabled';case"WrongType":return`expected ${e.expectedTypes.join(" or ")}`}}function hWe(e,r){let n=["Could not find Prisma Schema that is required for this command.",`You can either provide it with ${te("`--schema`")} argument, set it as \`prisma.schema\` in your package.json or put it into the default location.`,`Checked following paths:
|
|||
|
|
`],i=new Set;for(let a of e.failures){let o=a.rule.schemaPath.path;i.has(a.rule.schemaPath.path)||(n.push(`${pr.default.relative(r,o)}: ${PF(a.error)}`),i.add(o))}return n.push(`
|
|||
|
|
See also https://pris.ly/d/prisma-schema-location`),n.join(`
|
|||
|
|
`)}async function ny(e){let r=await Lk({cwd:e,normalize:!1}),n=r?.packageJson?.prisma;return r?{data:n,packagePath:r.path}:null}async function HE(e){let r=await ny(e);if(Yd("prismaConfig",r),!r||!r.data?.schema)return{ok:!1,error:{kind:"PackageJsonNotConfigured"}};let n=r.data.schema;if(typeof n!="string")throw new Error(`Provided schema path \`${n}\` from \`${pr.default.relative(e,r.packagePath)}\` must be of type string`);let i=pr.default.isAbsolute(n)?n:pr.default.resolve(pr.default.dirname(r.packagePath),n),a=await Pne(i);if(!a.ok)throw new Error(`Could not load schema from \`${pr.default.relative(e,i)}\` provided by "prisma.schema" config of \`${pr.default.relative(e,r.packagePath)}\`: ${PF(a.error)}`);return a}async function mWe(e,r){if(!process.env.npm_config_user_agent?.includes("yarn"))return{ok:!1,error:{kind:"Yarn1WorkspaceSchemaNotFound"}};let n;try{let{stdout:o}=await SF.default.command("yarn --version",{cwd:e});if(o.startsWith("2"))return{ok:!1,error:{kind:"Yarn1WorkspaceSchemaNotFound"}};let{stdout:c}=await SF.default.command("yarn workspaces info --json",{cwd:e}),u=gWe(c);n=Object.values(u)}catch{return{ok:!1,error:{kind:"Yarn1WorkspaceSchemaNotFound"}}}let i=await yWe(e);if(!i)return{ok:!1,error:{kind:"Yarn1WorkspaceSchemaNotFound"}};for(let o of n){let c=pr.default.join(i,o.location),u=await xne(c,r);if(u.ok)return u}return await xne(i,r)}async function xne(e,r){let n=await HE(e);return n.ok?n:Rne(e,r)}async function Rne(e,r=[]){let n={schemaPath:{path:pr.default.join(e,"schema.prisma"),kind:"file"}},i={schemaPath:{path:pr.default.join(e,"prisma","schema.prisma"),kind:"file"},conflictsWith:{path:pr.default.join(e,"prisma","schema"),kind:"directory"}},a={schemaPath:{path:pr.default.join(e,"prisma","schema"),kind:"directory"},conflictsWith:{path:pr.default.join(e,"prisma","schema.prisma"),kind:"file"}},o=[n,i,a];for(let c of o){Yd(`Checking existence of ${c.schemaPath.path}`);let u=await wne(c.schemaPath);if(!u.ok){r.push({rule:c,error:u.error});continue}if(c.conflictsWith&&(await wne(c.conflictsWith)).ok)throw new Error(`Found Prisma Schemas at both \`${pr.default.relative(e,c.schemaPath.path)}\` and \`${pr.default.relative(e,c.conflictsWith.path)}\`. Please remove one.`);return u}return{ok:!1,error:{kind:"NotFoundMultipleLocations",failures:r}}}async function wne(e){switch(e.kind){case"file":return Sne(e.path);case"directory":return Dne(e.path)}}async function Bn(e){return(await pt(e)).schemas}function gWe(e){let r=e.indexOf("{"),n=e.lastIndexOf("}"),i=e.slice(r,n+1);return JSON.parse(i)}function vWe(e){let r=e.workspaces;return r?Array.isArray(r)||r.packages!==void 0:!1}async function _ne(e){let r=await Lk({cwd:e,normalize:!1});return r?{isRoot:vWe(r.packageJson),path:r.path}:null}async function yWe(e){let r=await _ne(e);if(!r)return null;if(r.isRoot===!0)return pr.default.dirname(r.path);let n=pr.default.dirname(pr.default.dirname(r.path));return r=await _ne(n),!r||r.isRoot===!1?null:pr.default.dirname(r.path)}var OF=B(RF()),YE=B(require("fs"));var Kd=B(require("path"));function Ine(e){let r=e.ignoreProcessEnv?{}:process.env,n=i=>i.match(/(.?\${(?:[a-zA-Z0-9_]+)?})/g)?.reduce(function(o,c){let u=/(.?)\${([a-zA-Z0-9_]+)?}/g.exec(c);if(!u)return o;let l=u[1],f,p;if(l==="\\")p=u[0],f=p.replace("\\$","$");else{let g=u[2];p=u[0].substring(l.length),f=Object.hasOwnProperty.call(r,g)?r[g]:e.parsed[g]||"",f=n(f)}return o.replace(p,f)},i)??i;for(let i in e.parsed){let a=Object.hasOwnProperty.call(r,i)?r[i]:e.parsed[i];e.parsed[i]=n(a)}for(let i in e.parsed)r[i]=e.parsed[i];return e}var AF=me("prisma:tryLoadEnv");function iy({rootEnvPath:e,schemaEnvPath:r},n={conflictCheck:"none"}){let i=kne(e);n.conflictCheck!=="none"&&TWe(i,r,n.conflictCheck);let a=null;return Fne(i?.path,r)||(a=kne(r)),!i&&!a&&AF("No Environment variables loaded"),a?.dotenvResult.error?console.error(oe(N("Schema Env Error: "))+a.dotenvResult.error):{message:[i?.message,a?.message].filter(Boolean).join(`
|
|||
|
|
`),parsed:{...i?.dotenvResult?.parsed,...a?.dotenvResult?.parsed}}}function TWe(e,r,n){let i=e?.dotenvResult.parsed,a=!Fne(e?.path,r);if(i&&r&&a&&YE.default.existsSync(r)){let o=OF.default.parse(YE.default.readFileSync(r)),c=[];for(let u in o)i[u]===o[u]&&c.push(u);if(c.length>0){let u=Kd.default.relative(process.cwd(),e.path),l=Kd.default.relative(process.cwd(),r);if(n==="error"){let f=`There is a conflict between env var${c.length>1?"s":""} in ${tt(u)} and ${tt(l)}
|
|||
|
|
Conflicting env vars:
|
|||
|
|
${c.map(p=>` ${N(p)}`).join(`
|
|||
|
|
`)}
|
|||
|
|
|
|||
|
|
We suggest to move the contents of ${tt(l)} to ${tt(u)} to consolidate your env vars.
|
|||
|
|
`;throw new Error(f)}else if(n==="warn"){let f=`Conflict for env var${c.length>1?"s":""} ${c.map(p=>N(p)).join(", ")} in ${tt(u)} and ${tt(l)}
|
|||
|
|
Env vars from ${tt(l)} overwrite the ones from ${tt(u)}
|
|||
|
|
`;console.warn(`${ze("warn(prisma)")} ${f}`)}}}}function kne(e){if(IF(e)){AF(`Environment variables loaded from ${e}`);let r=OF.default.config({path:e,debug:process.env.DOTENV_CONFIG_DEBUG?!0:void 0});return{dotenvResult:Ine(r),message:J(`Environment variables loaded from ${Kd.default.relative(process.cwd(),e)}`),path:e}}else AF(`Environment variables not found at ${e}`);return null}function Fne(e,r){return e&&r&&Kd.default.resolve(e)===Kd.default.resolve(r)}function IF(e){return!!(e&&YE.default.existsSync(e))}var $ne=me("prisma:loadEnv");async function mf(e,r={cwd:process.cwd()}){let n=AWe({cwd:r.cwd})??null,i=Lne(e),a=Lne(await RWe()),c=[i,a,"./prisma/.env","./.env"].find(IF);return{rootEnvPath:n,schemaEnvPath:c}}async function RWe(){try{let e=await HE(process.cwd());return e.ok&&e.schema.schemaPath,null}catch{return null}}function AWe(e){let r=kF.default.sync(i=>{let a=Xd.default.join(i,"package.json");if(kF.default.sync.exists(a))try{if(JSON.parse(FF.default.readFileSync(a,"utf8")).name!==".prisma/client")return $ne(`project root found at ${a}`),a}catch{$ne(`skipping package.json at ${a}`)}},e);if(!r)return null;let n=Xd.default.join(Xd.default.dirname(r),".env");return FF.default.existsSync(n)?n:null}function Lne(e){return e?Xd.default.join(Xd.default.dirname(e),".env"):null}async function at({schemaPath:e,printMessage:r=!1}={}){let n=await mf(e),i=iy(n,{conflictCheck:"error"});r&&i&&i.message&&process.stdout.write(i.message+`
|
|||
|
|
`)}var Nne=e=>`
|
|||
|
|
Using an Accelerate URL is not supported for this CLI command ${te(`prisma ${e}`)} yet.
|
|||
|
|
Please use a direct connection to your database via the datasource \`directUrl\` setting.
|
|||
|
|
|
|||
|
|
More information about this limitation: ${ke("https://pris.ly/d/accelerate-limitations")}
|
|||
|
|
`;async function OWe(e,r,n){n===!0&&(r["--schema"]=(await pt(r["--schema"]))?.schemaPath??void 0);let i=Object.entries(r);for(let[a,o]of i){if(a.includes("url")&&o.includes("prisma://"))return Nne(e);if(a.includes("schema")){await at({schemaPath:o,printMessage:!1});let c=await Mne.default.promises.readFile(o,"utf-8"),u=await Ve({datamodel:c,ignoreEnvVarErrors:!0});if(bv(jo(u.datasources[0]))?.startsWith("prisma://"))return Nne(e)}}}async function Rr(e,r,n){let i=await OWe(e,r,n).catch(()=>{});if(i)throw new Error(i)}var LF=B(require("path"));var IWe="library";function qne(e){let r=kWe();return r||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":IWe)}function kWe(){let e=process.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":void 0}function Ko(e){return e<1e3?`${e}ms`:(e/1e3).toFixed(2)+"s"}function mn(e){if(e.fromEnvVar&&e.fromEnvVar!="null"){let r=process.env[e.fromEnvVar];if(!r)throw new Error(`Attempted to load provider value using \`env(${e.fromEnvVar})\` but it was not present. Please ensure that ${J(e.fromEnvVar)} is present in your Environment Variables`);return r}return e.value}function $F(e){if(e.fromEnvVar&&e.fromEnvVar!="null"){let r=process.env[e.fromEnvVar];if(!r)throw new Error(`Attempted to load binaryTargets value using \`env(${e.fromEnvVar})\` but it was not present. Please ensure that ${J(e.fromEnvVar)} is present in your Environment Variables`);return JSON.parse(r)}return e.value}function sy(e,r){let n=e.getPrettyName(),i=FWe(e),a=$We(e);return`\u2714 Generated ${N(n)}${i?` (${i})`:""}${a} in ${Ko(r)}`}function FWe(e){let r=e.manifest?.version;if(e.getProvider()==="prisma-client-js"){let n=qne(e.config),i="";return e.options?.noEngine?i=", engine=none":n==="binary"?i=", engine=binary":n==="library"&&(i=""),`v${r??"?.?.?"}${i}`}return r}function $We(e){let r=e.options?.generator.output;return r?J(` to .${LF.default.sep}${LF.default.relative(process.cwd(),mn(r))}`):""}var qF=B(require("crypto"));var Hne=B(MF()),zne=B(Wne());function $e(e=""){return(0,zne.default)(e).trimRight()+`
|
|||
|
|
`}function _e(e,r,n=!0,i=!1){try{return(0,Hne.default)(r,{argv:e,stopAtPositional:n,permissive:i})}catch(a){return a}}function xe(e){return e instanceof Error}async function oy(){let e=_e(process.argv.slice(3),{"--schema":String}),r=(await pt(e["--schema"]))?.schemaPath??process.cwd();return qF.default.createHash("sha256").update(r).digest("hex").substring(0,8)}function cy(){let e=process.argv[1];return qF.default.createHash("sha256").update(e).digest("hex").substring(0,8)}function gf(e,r){return new Re(`
|
|||
|
|
${N(oe("!"))} Unknown command "${r}"
|
|||
|
|
${e}`)}var Re=class e extends Error{constructor(r){super(r),this.name="HelpError",Object.setPrototypeOf(this,e.prototype)}};var Vne=B(require("path")),Yne=B(require("url"));function KE(e){let r;try{r=new Yne.URL(e)}catch{throw new Error("Invalid data source URL, see https://www.prisma.io/docs/reference/database-reference/connection-urls")}let n=eo(r.protocol),i=l=>l&&l.length>0,a={},o=r.searchParams.get("schema"),c=r.searchParams.get("socket");for(let[l,f]of r.searchParams)["schema","socket"].includes(l)||(a[l]=f);let u;return n==="sqlite"&&r.pathname?r.pathname.startsWith("file:")?u=r.pathname.slice(5):u=Vne.default.basename(r.pathname):r.pathname.length>1&&(u=r.pathname.slice(1),n==="postgresql"&&!u&&(u="postgres")),{type:n,host:i(r.hostname)?r.hostname:void 0,user:i(r.username)?r.username:void 0,port:i(r.port)?Number(r.port):void 0,password:i(r.password)?r.password:void 0,database:u,schema:o||void 0,uri:e,ssl:!!r.searchParams.get("sslmode"),socket:c||void 0,extraFields:a}}function eo(e){switch(e){case"postgresql:":case"postgres:":case"prisma+postgres:":return"postgresql";case"mongodb+srv:":case"mongodb:":return"mongodb";case"mysql:":return"mysql";case"file:":return"sqlite";case"sqlserver:":return"sqlserver"}throw new Error(`Unknown protocol ${e}`)}var XE=B(require("stream")),Kne=B(require("util"));function jF(e,r){return NWe(e,r)}function NWe(e,r){return e?MWe(e,r):new vf(r)}function MWe(e,r){if(!e)throw new Error("expected readStream");if(!e.readable)throw new Error("readStream must be readable");let n=new vf(r);return e.pipe(n),n}function vf(e){XE.default.Transform.call(this,e),e=e||{},this._readableState.objectMode=!0,this._lineBuffer=[],this._keepEmptyLines=e.keepEmptyLines||!1,this._lastChunkEndedWithCR=!1,this.on("pipe",function(r){this.encoding||r instanceof XE.default.Readable&&(this.encoding=r._readableState.encoding)})}Kne.default.inherits(vf,XE.default.Transform);vf.prototype._transform=function(e,r,n){r=r||"utf8",Buffer.isBuffer(e)&&(r=="buffer"?(e=e.toString(),r="utf8"):e=e.toString(r)),this._chunkEncoding=r;let i=e.split(/\r\n|\r|\n/g);this._lastChunkEndedWithCR&&e[0]==`
|
|||
|
|
`&&i.shift(),this._lineBuffer.length>0&&(this._lineBuffer[this._lineBuffer.length-1]+=i[0],i.shift()),this._lastChunkEndedWithCR=e[e.length-1]=="\r",this._lineBuffer=this._lineBuffer.concat(i),this._pushBuffer(r,1,n)};vf.prototype._pushBuffer=function(e,r,n){for(;this._lineBuffer.length>r;){let i=this._lineBuffer.shift();if((this._keepEmptyLines||i.length>0)&&!this.push(this._reencode(i,e))){let a=this;setImmediate(function(){a._pushBuffer(e,r,n)});return}}n()};vf.prototype._flush=function(e){this._pushBuffer(this._chunkEncoding,0,e)};vf.prototype._reencode=function(e,r){return this.encoding&&this.encoding!=r?Buffer.from(e,r).toString(this.encoding):this.encoding?e:Buffer.from(e,r)};var Xne=require("child_process"),Jne=B(OR());var BF=me("prisma:GeneratorProcess"),qWe=1,yf=class extends Error{constructor(n,i,a){super(n);this.code=i;this.data=a;this.name="GeneratorError";a?.stack&&(this.stack=a.stack)}},uy=class{constructor(r,{isNode:n=!1}={}){this.pathOrCommand=r;this.handlers={};this.errorLogs="";this.exited=!1;this.getManifest=this.rpcMethod("getManifest",r=>r.manifest??null);this.generate=this.rpcMethod("generate");this.isNode=n}async init(){return this.initPromise||(this.initPromise=this.initSingleton()),this.initPromise}initSingleton(){return new Promise((r,n)=>{this.isNode?this.child=(0,Xne.fork)(this.pathOrCommand,[],{stdio:["pipe","inherit","pipe","ipc"],env:{...process.env,PRISMA_GENERATOR_INVOCATION:"true"},execArgv:["--max-old-space-size=8096"]}):this.child=(0,Jne.spawn)(this.pathOrCommand,{stdio:["pipe","inherit","pipe"],env:{...process.env,PRISMA_GENERATOR_INVOCATION:"true"},shell:!0}),this.child.on("exit",(i,a)=>{if(BF(`child exited with code ${i} on signal ${a}`),this.exited=!0,i){let o=new yf(`Generator ${JSON.stringify(this.pathOrCommand)} failed:
|
|||
|
|
|
|||
|
|
${this.errorLogs}`);this.pendingError=o,this.rejectAllHandlers(o)}}),this.child.stdin.on("error",()=>{}),this.child.on("error",i=>{BF(i),this.pendingError=i,i.code==="EACCES"?n(new Error(`The executable at ${this.pathOrCommand} lacks the right permissions. Please use ${N(`chmod +x ${this.pathOrCommand}`)}`)):n(i),this.rejectAllHandlers(i)}),jF(this.child.stderr).on("data",i=>{let a=String(i),o;try{o=JSON.parse(a)}catch{this.errorLogs+=a+`
|
|||
|
|
`,BF(a)}o&&this.handleResponse(o)}),this.child.on("spawn",r)})}rejectAllHandlers(r){for(let n of Object.keys(this.handlers))this.handlers[n].reject(r),delete this.handlers[n]}handleResponse(r){if(r.jsonrpc&&r.id){if(typeof r.id!="number")throw new Error(`message.id has to be a number. Found value ${r.id}`);if(this.handlers[r.id]){if(jWe(r)){let n=new yf(r.error.message,r.error.code,r.error.data);this.handlers[r.id].reject(n)}else this.handlers[r.id].resolve(r.result);delete this.handlers[r.id]}}}sendMessage(r,n){if(!this.child){n(new yf("Generator process has not started yet"));return}if(!this.child.stdin.writable){n(new yf("Cannot send data to the generator process, process already exited"));return}this.child.stdin.write(JSON.stringify(r)+`
|
|||
|
|
`,i=>{if(!i||i.code==="EPIPE")return n();n(i)})}getMessageId(){return qWe++}stop(){if(this.child&&!this.child?.killed){this.child.kill("SIGTERM");let r=2e3,n=200,i,a;Promise.race([new Promise(o=>{a=setTimeout(o,r)}),new Promise(o=>{i=setInterval(()=>{if(this.exited)return o("exited")},n)})]).then(o=>{o!=="exited"&&this.child?.kill("SIGKILL")}).finally(()=>{clearInterval(i),clearTimeout(a)})}}rpcMethod(r,n=i=>i){return i=>new Promise((a,o)=>{if(this.pendingError){o(this.pendingError);return}let c=this.getMessageId();this.handlers[c]={resolve:u=>a(n(u)),reject:o},this.sendMessage({jsonrpc:"2.0",method:r,params:i,id:c},u=>{u&&o(u)})})}};function jWe(e){return e.error!==void 0}var JE=class{constructor(r,n,i){this.manifest=null;this.config=n,this.generatorProcess=new uy(r,{isNode:i})}async init(){await this.generatorProcess.init(),this.manifest=await this.generatorProcess.getManifest(this.config)}stop(){this.generatorProcess.stop()}generate(){if(!this.options)throw new Error("Please first run .setOptions() on the Generator to initialize the options");return this.generatorProcess.generate(this.options)}setOptions(r){this.options=r}setBinaryPaths(r){if(!this.options)throw new Error("Please first run .setOptions() on the Generator to initialize the options");this.options.binaryPaths=r}getPrettyName(){return this.manifest?.prettyName??this.getProvider()}getProvider(){return mn(this.config.provider)}};var va=B(require("fs"),1),Lr=B(require("path"),1),Kr=B(require("process"),1),Xie=require("buffer"),hy=B(require("child_process"),1),Jie=B(require("child_process"),1),yy=B(require("path"),1),ch=B(require("fs"),1),by=B(require("url"),1),uh=B(require("os"),1),Qie=require("timers/promises"),Zie=B(require("stream"),1),ese=require("util"),tse=B(require("os"),1),rse=B(require("tty"),1),nse=B(require("readline"),1),ise=B(require("events"),1),O$=B(require("fs/promises"),1);function Qne(e){return r=>r.length>1?`${e} run ${r[0]} -- ${r.slice(1).join(" ")}`:`${e} run ${r[0]}`}var Zne={agent:"yarn {0}",run:"yarn run {0}",install:"yarn install {0}",frozen:"yarn install --frozen-lockfile",global:"yarn global add {0}",add:"yarn add {0}",upgrade:"yarn upgrade {0}","upgrade-interactive":"yarn upgrade-interactive {0}",execute:"npx {0}",uninstall:"yarn remove {0}",global_uninstall:"yarn global remove {0}"},eie={agent:"pnpm {0}",run:"pnpm run {0}",install:"pnpm i {0}",frozen:"pnpm i --frozen-lockfile",global:"pnpm add -g {0}",add:"pnpm add {0}",upgrade:"pnpm update {0}","upgrade-interactive":"pnpm update -i {0}",execute:"pnpm dlx {0}",uninstall:"pnpm remove {0}",global_uninstall:"pnpm remove --global {0}"},BWe={agent:"bun {0}",run:"bun run {0}",install:"bun install {0}",frozen:"bun install --no-save",global:"bun add -g {0}",add:"bun add {0}",upgrade:"bun update {0}","upgrade-interactive":"bun update {0}",execute:"bunx {0}",uninstall:"bun remove {0}",global_uninstall:"bun remove -g {0}"},my={npm:{agent:"npm {0}",run:Qne("npm"),install:"npm i {0}",frozen:"npm ci",global:"npm i -g {0}",add:"npm i {0}",upgrade:"npm update {0}","upgrade-interactive":null,execute:"npx {0}",uninstall:"npm uninstall {0}",global_uninstall:"npm uninstall -g {0}"},yarn:Zne,"yarn@berry":{...Zne,frozen:"yarn install --immutable",upgrade:"yarn up {0}","upgrade-interactive":"yarn up -i {0}",execute:"yarn dlx {0}",global:"npm i -g {0}",global_uninstall:"npm uninstall -g {0}"},pnpm:eie,"pnpm@6":{...eie,run:Qne("pnpm")},bun:BWe},UWe=Object.keys(my),s$={"bun.lockb":"bun","pnpm-lock.yaml":"pnpm","yarn.lock":"yarn","package-lock.json":"npm","npm-shrinkwrap.json":"npm"},sse={bun:"https://bun.sh",pnpm:"https://pnpm.io/installation","pnpm@6":"https://pnpm.io/6.x/installation",yarn:"https://classic.yarnpkg.com/en/docs/install","yarn@berry":"https://yarnpkg.com/getting-started/install",npm:"https://docs.npmjs.com/cli/v8/configuring-npm/install"},Qo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xy(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var{hasOwnProperty:S5t}=Object.prototype;va
|
|||
|
|
`:10,n=typeof e=="string"?"\r":13;return e[e.length-1]===r&&(e=e.slice(0,-1)),e[e.length-1]===n&&(e=e.slice(0,-1)),e}function mse(e={}){let{env:r=process.env,platform:n=process.platform}=e;return n!=="win32"?"PATH":Object.keys(r).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"}function DHe(e={}){let{cwd:r=Kr.default.cwd(),path:n=Kr.default.env[mse()],execPath:i=Kr.default.execPath}=e,a,o=r instanceof URL?by.default.fileURLToPath(r):r,c=Lr.default.resolve(o),u=[];for(;a!==c;)u.push(Lr.default.join(c,"node_modules/.bin")),a=c,c=Lr.default.resolve(c,"..");return u.push(Lr.default.resolve(o,i,"..")),[...u,n].join(Lr.default.delimiter)}function CHe({env:e=Kr.default.env,...r}={}){e={...e};let n=mse({env:e});return r.path=e[n],e[n]=DHe(r),e}var PHe=(e,r,n,i)=>{if(n==="length"||n==="prototype"||n==="arguments"||n==="caller")return;let a=Object.getOwnPropertyDescriptor(e,n),o=Object.getOwnPropertyDescriptor(r,n);!THe(a,o)&&i||Object.defineProperty(e,n,o)},THe=function(e,r){return e===void 0||e.configurable||e.writable===r.writable&&e.enumerable===r.enumerable&&e.configurable===r.configurable&&(e.writable||e.value===r.value)},RHe=(e,r)=>{let n=Object.getPrototypeOf(r);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},AHe=(e,r)=>`/* Wrapped ${e}*/
|
|||
|
|
${r}`,OHe=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),IHe=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),kHe=(e,r,n)=>{let i=n===""?"":`with ${n.trim()}() `,a=AHe.bind(null,i,r.toString());Object.defineProperty(a,"name",IHe),Object.defineProperty(e,"toString",{...OHe,value:a})};function FHe(e,r,{ignoreNonConfigurable:n=!1}={}){let{name:i}=e;for(let a of Reflect.ownKeys(r))PHe(e,r,a,n);return RHe(e,r),kHe(e,r,i),e}var uS=new WeakMap,gse=(e,r={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let n,i=0,a=e.displayName||e.name||"<anonymous>",o=function(...c){if(uS.set(o,++i),i===1)n=e.apply(this,c),e=null;else if(r.throw===!0)throw new Error(`Function \`${a}\` can only be called once`);return n};return FHe(o,e),uS.set(o,i),o};gse.callCount=e=>{if(!uS.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return uS.get(e)};var $He=()=>{let e=yse-vse+1;return Array.from({length:e},LHe)},LHe=(e,r)=>({name:`SIGRT${r+1}`,number:vse+r,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),vse=34,yse=64,NHe=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",sta
|
|||
|
|
${i.message}`:P,F=[k,r,e].filter(Boolean).join(`
|
|||
|
|
`);return R?(i.originalMessage=i.message,i.message=F):i=new Error(F),i.shortMessage=k,i.command=c,i.escapedCommand=u,i.exitCode=o,i.signal=a,i.signalDescription=x,i.stdout=e,i.stderr=r,i.cwd=v,n!==void 0&&(i.all=n),"bufferedData"in i&&delete i.bufferedData,i.failed=!0,i.timedOut=!!l,i.isCanceled=f,i.killed=p&&!l,i},aS=["stdin","stdout","stderr"],zHe=e=>aS.some(r=>e[r]!==void 0),VHe=e=>{if(!e)return;let{stdio:r}=e;if(r===void 0)return aS.map(i=>e[i]);if(zHe(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aS.map(i=>`\`${i}\``).join(", ")}`);if(typeof r=="string")return r;if(!Array.isArray(r))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof r}\``);let n=Math.max(r.length,aS.length);return Array.from({length:n},(i,a)=>r[a])},th=[];th.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&th.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&th.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var oS=e=>!!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",HF=Symbol.for("signal-exit emitter"),zF=globalThis,YHe=Object.defineProperty.bind(Object),o$=class{constructor(){Je(this,"emitted",{afterExit:!1,exit:!1});Je(this,"listeners",{afterExit:[],exit:[]});Je(this,"count",0);Je(this,"id",Math.random());if(zF[HF])return zF[HF];YHe(zF,HF,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(r,n){this.listeners[r].push(n)}removeListener(r,n){let i=this.listeners[r],a=i.indexOf(n);a!==-1&&(a===0&&i.length===1?i.length=0:i.splice(a,1))}emit(r,n,i){if(this.emitted[r])return!1;this.emitted[r]=!0;let a=!1;for(let o of this.listeners[r])a=o(n,i)===!0||a;return r==="exit"&&(a=this.emit("afterExit",n,i)||a),a}},lS=class{},KHe=e=>({onExit(r,n){return e.onExit(r,n)},load(){return e.load()},unload(){return e.unload()}}),c$=class extends lS{onExit(){return()=>{}}load(){}unload(){}},dS,Zi,xr,rh,nh,bf,Eu,oh,xse,wse,u$=class extends lS{constructor(n){super();Ee(this,oh);Ee(this,dS,l$.platform==="win32"?"SIGINT":"SIGHUP");Ee(this,Zi,new o$);Ee(this,xr);Ee(this,rh);Ee(this,nh);Ee(this,bf,{});Ee(this,Eu,!1);fe(this,xr,n),fe(this,bf,{});for(let i of th)$(this,bf)[i]=()=>{let a=$(this,xr).listeners(i),{count:o}=$(this,Zi),c=n;if(typeof c.__signal_exit_emitter__=="object"&&typeof c.__signal_exit_emitter__.count=="number"&&(o+=c.__signal_exit_emitter__.count),a.length===o){this.unload();let u=$(this,Zi).emit("exit",null,i),l=i==="SIGHUP"?$(this,dS):i;u||n.kill(n.pid,l)}};fe(this,nh,n.reallyExit),fe(this,rh,n.emit)}onExit(n,i){if(!oS($(this,xr)))return()=>{};$(this,Eu)===!1&&this.load();let a=i?.alwaysLast?"afterExit":"exit";return $(this,Zi).on(a,n),()=>{$(this,Zi).removeListener(a,n),$(this,Zi).listeners.exit.length===0&&$(this,Zi).listeners.afterExit.length===0&&this.unload()}}load(){if(!$(this,Eu)){fe(this,Eu,!0),$(this,Zi).count+=1;for(let n of th)try{let i=$(this,bf)[n];i&&$(this,xr).on(n,i)}catch{}$(this,xr).emit=(n,...i)=>de(this,oh,wse).call(this,n,...i),$(this,xr).reallyExit=n=>de(this,oh,xse).call(this,n)}}unload(){$(this,Eu)&&(fe(this,Eu,!1),th.forEach(n=>{let i=$(this,bf)[n];if(!i)throw new Error("Listener not defined for signal: "+n);try{$(this,xr).removeListener(n,i)}catch{}}),$(this,xr).emit=$(this,rh),$(this,xr).reallyExit=$(this,nh),$(this,Zi).count-=1)}};dS=new WeakMap,Zi=new WeakMap,xr=new WeakMap,rh=new WeakMap,nh=new WeakMap,bf=new WeakMap,Eu=new WeakMap,oh=new WeakSet,xse=function(n){return oS($(this,xr))?($(this,xr).exitCode=n||0,$(this,Zi).emit("exit",$(this,xr).exitCode,null),$(this,nh).call($(this,xr),$(this,xr).exitCode)):0},wse=function(n,...i){let a=$(this,rh);if(n==="exit"&&oS($(this,xr))){typeof i[0]=="number"&&($(this,xr).exitCode=i[0]);let o=a.call($(this,xr),n,...i);return $(this,Zi).emit("exit",$(this,xr).exitCode,null),o}else return a.call($(this,xr),n,...i)};var l$=globalThi
|
|||
|
|
`)},Zze=1e3*1e3*100,eVe=({env:e,extendEnv:r,preferLocal:n,localDir:i,execPath:a})=>{let o=r?{...Kr.default.env,...e}:e;return n?CHe({env:o,cwd:i,execPath:a}):o},tVe=(e,r,n={})=>{let i=EHe._parse(e,r,n);return e=i.command,r=i.args,n=i.options,n={maxBuffer:Zze,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:n.cwd||Kr.default.cwd(),execPath:Kr.default.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:Xze,...n},n.env=eVe(n),n.stdio=VHe(n),Kr.default.platform==="win32"&&Lr.default.basename(e,".exe")==="cmd"&&r.unshift("/q"),{file:e,args:r,options:n,parsed:i}},XF=(e,r,n)=>typeof r!="string"&&!Xie.Buffer.isBuffer(r)?n===void 0?void 0:"":e.stripFinalNewline?SHe(r):r;function rVe(e,r,n){let i=tVe(e,r,n),a=zze(e,r),o=Vze(e,r);Qze(o,i.options),aze(i.options);let c;try{c=hy.default.spawn(i.file,i.args,i.options)}catch(x){let E=new hy.default.ChildProcess,D=Promise.reject(oie({error:x,stdout:"",stderr:"",all:"",command:a,escapedCommand:o,parsed:i,timedOut:!1,isCanceled:!1,killed:!1}));return mie(E,D),E}let u=Gze(c),l=sze(c,i.options,u),f=oze(c,i.options,l),p={isCanceled:!1};c.kill=QHe.bind(null,c.kill.bind(c)),c.cancel=nze.bind(null,c,p);let v=gse(async()=>{let[{error:x,exitCode:E,signal:D,timedOut:P},R,k,F]=await jze(c,i.options,f),L=XF(i.options,R),U=XF(i.options,k),V=XF(i.options,F);if(x||E!==0||D!==null){let j=oie({error:x,exitCode:E,signal:D,stdout:L,stderr:U,all:V,command:a,escapedCommand:o,parsed:i,timedOut:P,isCanceled:i.options.signal?i.options.signal.aborted:!1,killed:c.killed});if(!i.options.reject)return j;throw j}return{command:a,escapedCommand:o,exitCode:0,stdout:L,stderr:U,all:V,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return Nze(c,i.options),c.all=Mze(c,i.options),uze(c),mie(c,v),c}function nVe(e,r){let[n,...i]=Kze(e);return rVe(n,i,r)}var p$=class{constructor(r){Je(this,"value");Je(this,"next");this.value=r}},ro,xf,wf,d$=class{constructor(){Ee(this,ro);Ee(this,xf);Ee(this,wf);this.clear()}enqueue(r){let n=new p$(r);$(this,ro)?($(this,xf).next=n,fe(this,xf,n)):(fe(this,ro,n),fe(this,xf,n)),Ic(this,wf)._++}dequeue(){let r=$(this,ro);if(r)return fe(this,ro,$(this,ro).next),Ic(this,wf)._--,r.value}clear(){fe(this,ro,void 0),fe(this,xf,void 0),fe(this,wf,0)}get size(){return $(this,wf)}*[Symbol.iterator](){let r=$(this,ro);for(;r;)yield r.value,r=r.next}};ro=new WeakMap,xf=new WeakMap,wf=new WeakMap;function gie(e){if(!((Number.isInteger(e)||e===Number.POSITIVE_INFINITY)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");let r=new d$,n=0,i=()=>{n--,r.size>0&&r.dequeue()()},a=async(u,l,f)=>{n++;let p=(async()=>u(...f))();l(p);try{await p}catch{}i()},o=(u,l,f)=>{r.enqueue(a.bind(void 0,u,l,f)),(async()=>(await Promise.resolve(),n<e&&r.size>0&&r.dequeue()()))()},c=(u,...l)=>new Promise(f=>{o(u,f,l)});return Object.defineProperties(c,{activeCount:{get:()=>n},pendingCount:{get:()=>r.size},clearQueue:{value:()=>{r.clear()}}}),c}var fS=class extends Error{constructor(r){super(),this.value=r}},iVe=async(e,r)=>r(await e),sVe=async e=>{let r=await Promise.all(e);if(r[1]===!0)throw new fS(r[0]);return!1};async function aVe(e,r,{concurrency:n=Number.POSITIVE_INFINITY,preserveOrder:i=!0}={}){let a=gie(n),o=[...e].map(u=>[u,a(iVe,u,r)]),c=gie(i?1:Number.POSITIVE_INFINITY);try{await Promise.all(o.map(u=>c(sVe,u)))}catch(u){if(u instanceof fS)return u.value;throw u}}var Ose={directory:"isDirectory",file:"isFile"};function oVe(e){if(!Object.hasOwnProperty.call(Ose,e))throw new Error(`Invalid type specified: ${e}`)}var cVe=(e,r)=>r[Ose[e]](),uVe=e=>e instanceof URL?(0,by.fileURLToPath)(e):e;async function vie(e,{cwd:r=Kr.default.cwd(),type:n="file",allowSymlinks:i=!0,concurrency:a,preserveOrder:o}={}){oVe(n),r=uVe(r);let c=i?va.promises.stat:va.promises.lstat;return aVe(e,async u=>{try{let l=await c(Lr.default.resolve(r,u));return cVe(n,l)}catch{return!1}},{concurrency:a,preserveOrder:o})}var lVe=e=>e instanceof URL?(0,by.fileURLToPath)(e):e,fVe=Symbol("findUpStop");async function pVe(e,r={}){let n=Lr.default.resolve(lVe(r.cwd)||""),{root:i}=Lr.default.par
|
|||
|
|
`)).join(`
|
|||
|
|
`)},NVe=(e,r,n)=>{n=n||r;let i=Math.min(r-n,e-Math.floor(n/2));i<0&&(i=0);let a=Math.min(i+n,r);return{startIndex:i,endIndex:a}},no={action:bVe,clear:CVe,style:kVe,strip:j$,figures:qse,lines:$Ve,wrap:LVe,entriesToDisplay:NVe},Eie=nse.default,{action:MVe}=no,qVe=ise.default,{beep:jVe,cursor:BVe}=ba,UVe=ya,GVe=class extends qVe{constructor(r={}){super(),this.firstRender=!0,this.in=r.stdin||process.stdin,this.out=r.stdout||process.stdout,this.onRender=(r.onRender||(()=>{})).bind(this);let n=Eie.createInterface({input:this.in,escapeCodeTimeout:50});Eie.emitKeypressEvents(this.in,n),this.in.isTTY&&this.in.setRawMode(!0);let i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,a=(o,c)=>{let u=MVe(c,i);u===!1?this._&&this._(o,c):typeof this[u]=="function"?this[u](c):this.bell()};this.close=()=>{this.out.write(BVe.show),this.in.removeListener("keypress",a),this.in.isTTY&&this.in.setRawMode(!1),n.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",a)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(jVe)}render(){this.onRender(UVe),this.firstRender&&(this.firstRender=!1)}},Cu=GVe,tS=ya,WVe=Cu,{erase:HVe,cursor:ly}=ba,{style:QF,clear:ZF,lines:zVe,figures:VVe}=no,x$=class extends WVe{constructor(r={}){super(r),this.transform=QF.render(r.style),this.scale=this.transform.scale,this.msg=r.message,this.initial=r.initial||"",this.validator=r.validate||(()=>!0),this.value="",this.errorMsg=r.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=ZF("",this.out.columns),this.render()}set value(r){!r&&this.initial?(this.placeholder=!0,this.rendered=tS.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(r)),this._value=r,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}async validate(){let r=await this.validator(this.value);typeof r=="string"&&(this.errorMsg=r,r=!1),this.error=!r}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(r){this.placeholder||(this.cursor=this.cursor+r,this.cursorOffset+=r)}_(r,n){let i=this.value.slice(0,this.cursor),a=this.value.slice(this.cursor);this.value=`${i}${r}${a}`,this.red=!1,this.cursor=this.placeholder?0:i.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let r=this.value.slice(0,this.cursor-1),n=this.value.slice(this.cursor);this.value=`${r}${n}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let r=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor+1);this.value=`${r}${n}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(ly.down(zVe(this.outputError,this.out.columns)-1)+ZF(this.outputError,this.out.columns)),this.out.write(ZF(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[QF.symbol(this.done,this.aborted),tS.bold(this.msg),QF.delimiter(this.done),this.red?tS.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|||
|
|
`).reduce((r,n,i)=>r+`
|
|||
|
|
${i?" ":VVe.pointerSmall} ${tS.red().italic(n)}`,"")),this.out.write(HVe.line+ly.to(0)+this.outputText+ly.save+this.outputError+ly.restore+ly.move(this.cursorOffset,0)))}},YVe=x$,Xo=ya,KVe=Cu,{style:Sie,clear:Die,figures:rS,wrap:XVe,entriesToDisplay:JVe}=no,{cursor:QVe}=ba,w$=class extends KVe{constructor(r={}){super(r),this.msg=r.message,this.hint=r.hint||"- Use arrow-keys. Return to submit.",this.warn=r.warn||"- This option is disabled",this.cursor=r.initial||0,this.choices=r.choices.map((n,i)=>(typeof n=="string"&&(n={title:n,value:i}),{title:n&&(n.title||n.value||n),value:n&&(n.value===void 0?i:n.value),description:n&&n.description,selected:n&&n.selected,disabled:n&&n.disabled})),this.optionsPerPage=r.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=Die("",this.out.columns),this.render()}moveCursor(r){this.cursor=r,this.value=this.choices[r].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(r,n){if(r===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(QVe.hide):this.out.write(Die(this.outputText,this.out.columns)),super.render();let{startIndex:r,endIndex:n}=JVe(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[Sie.symbol(this.done,this.aborted),Xo.bold(this.msg),Sie.delimiter(!1),this.done?this.selection.title:this.selection.disabled?Xo.yellow(this.warn):Xo.gray(this.hint)].join(" "),!this.done){this.outputText+=`
|
|||
|
|
`;for(let i=r;i<n;i++){let a,o,c="",u=this.choices[i];i===r&&r>0?o=rS.arrowUp:i===n-1&&n<this.choices.length?o=rS.arrowDown:o=" ",u.disabled?(a=this.cursor===i?Xo.gray().underline(u.title):Xo.strikethrough().gray(u.title),o=(this.cursor===i?Xo.bold().gray(rS.pointer)+" ":" ")+o):(a=this.cursor===i?Xo.cyan().underline(u.title):u.title,o=(this.cursor===i?Xo.cyan(rS.pointer)+" ":" ")+o,u.description&&this.cursor===i&&(c=` - ${u.description}`,(o.length+a.length+c.length>=this.out.columns||u.description.split(/\r?\n/).length>1)&&(c=`
|
|||
|
|
`+XVe(u.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${a}${Xo.gray(c)}
|
|||
|
|
`}}this.out.write(this.outputText)}},ZVe=w$,nS=ya,eYe=Cu,{style:Cie,clear:tYe}=no,{cursor:Pie,erase:rYe}=ba,_$=class extends eYe{constructor(r={}){super(r),this.msg=r.message,this.value=!!r.initial,this.active=r.active||"on",this.inactive=r.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(r,n){if(r===" ")this.value=!this.value;else if(r==="1")this.value=!0;else if(r==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(Pie.hide):this.out.write(tYe(this.outputText,this.out.columns)),super.render(),this.outputText=[Cie.symbol(this.done,this.aborted),nS.bold(this.msg),Cie.delimiter(this.done),this.value?this.inactive:nS.cyan().underline(this.inactive),nS.gray("/"),this.value?nS.cyan().underline(this.active):this.active].join(" "),this.out.write(rYe.line+Pie.to(0)+this.outputText))}},nYe=_$,iYe=class E${constructor({token:r,date:n,parts:i,locales:a}){this.token=r,this.date=n||new Date,this.parts=i||[this],this.locales=a||{}}up(){}down(){}next(){let r=this.parts.indexOf(this);return this.parts.find((n,i)=>i>r&&n instanceof E$)}setTo(r){}prev(){let r=[].concat(this.parts).reverse(),n=r.indexOf(this);return r.find((i,a)=>a>n&&i instanceof E$)}toString(){return String(this.date)}},Zo=iYe,sYe=Zo,aYe=class extends sYe{constructor(r={}){super(r)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let r=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?r.toUpperCase():r}},oYe=aYe,cYe=Zo,uYe=e=>(e=e%10,e===1?"st":e===2?"nd":e===3?"rd":"th"),lYe=class extends cYe{constructor(r={}){super(r)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(r){this.date.setDate(parseInt(r.substr(-2)))}toString(){let r=this.date.getDate(),n=this.date.getDay();return this.token==="DD"?String(r).padStart(2,"0"):this.token==="Do"?r+uYe(r):this.token==="d"?n+1:this.token==="ddd"?this.locales.weekdaysShort[n]:this.token==="dddd"?this.locales.weekdays[n]:r}},fYe=lYe,pYe=Zo,dYe=class extends pYe{constructor(r={}){super(r)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(r){this.date.setHours(parseInt(r.substr(-2)))}toString(){let r=this.date.getHours();return/h/.test(this.token)&&(r=r%12||12),this.token.length>1?String(r).padStart(2,"0"):r}},hYe=dYe,mYe=Zo,gYe=class extends mYe{constructor(r={}){super(r)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(r){this.date.setMilliseconds(parseInt(r.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}},vYe=gYe,yYe=Zo,bYe=class extends yYe{constructor(r={}){super(r)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(r){this.date.setMinutes(parseInt(r.substr(-2)))}toString(){let r=this.date.getMinutes();return this.token.length>1?String(r).padStart(2,"0"):r}},xYe=bYe,wYe=Zo,_Ye=class extends wYe{constructor(r={}){super(r)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(r){r=parseInt(r.substr(-2))-1,this.date.setMonth(r<0?0:r)}toString(){let r=this.date.getMonth(),n=this.token.length;return n===2?String(r+1).padStart(2,"0"):n===3?this.locales.monthsShort[r]:n===4?this.locales.months[r]:String(r+1)}},EYe=_Ye,SYe=Zo,DYe=class extends SYe{constructor(r={}){super(r)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(r){this.date.setSeconds(parseInt(r.substr(-2)))}toString(){let r=this.date.getSeconds();return this.token.length>1?String(r).padStart(2,"0"):r}},CYe=DYe,PYe=Zo,TYe=class extends PYe{constructor(r={}){super(r)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(r){this.date.setFullYear(r.substr(-4))}toString(){let r=String(this.date.getFullYear()).padStart(4,
|
|||
|
|
`),this.close()}async validate(){let r=await this.validator(this.value);typeof r=="string"&&(this.errorMsg=r,r=!1),this.error=!r}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let r=this.parts[this.cursor].prev();if(r==null)return this.bell();this.moveCursor(this.parts.indexOf(r)),this.render()}right(){let r=this.parts[this.cursor].next();if(r==null)return this.bell();this.moveCursor(this.parts.indexOf(r)),this.render()}next(){let r=this.parts[this.cursor].next();this.moveCursor(r?this.parts.indexOf(r):this.parts.findIndex(n=>n instanceof Oie)),this.render()}_(r){/\d/.test(r)&&(this.typed+=r,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(Aie.hide):this.out.write(Rie(this.outputText,this.out.columns)),super.render(),this.outputText=[Tie.symbol(this.done,this.aborted),e$.bold(this.msg),Tie.delimiter(!1),this.parts.reduce((r,n,i)=>r.concat(i===this.cursor&&!this.done?e$.cyan().underline(n.toString()):n),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
|
|||
|
|
`).reduce((r,n,i)=>r+`
|
|||
|
|
${i?" ":IYe.pointerSmall} ${e$.red().italic(n)}`,"")),this.out.write(kYe.line+Aie.to(0)+this.outputText))}},WYe=S$,iS=ya,HYe=Cu,{cursor:sS,erase:zYe}=ba,{style:t$,figures:VYe,clear:kie,lines:YYe}=no,KYe=/[0-9]/,r$=e=>e!==void 0,Fie=(e,r)=>{let n=Math.pow(10,r);return Math.round(e*n)/n},D$=class extends HYe{constructor(r={}){super(r),this.transform=t$.render(r.style),this.msg=r.message,this.initial=r$(r.initial)?r.initial:"",this.float=!!r.float,this.round=r.round||2,this.inc=r.increment||1,this.min=r$(r.min)?r.min:-1/0,this.max=r$(r.max)?r.max:1/0,this.errorMsg=r.error||"Please Enter A Valid Value",this.validator=r.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(r){!r&&r!==0?(this.placeholder=!0,this.rendered=iS.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${Fie(r,this.round)}`),this._value=Fie(r,this.round)),this.fire()}get value(){return this._value}parse(r){return this.float?parseFloat(r):parseInt(r)}valid(r){return r==="-"||r==="."&&this.float||KYe.test(r)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let r=this.value;this.value=r!==""?r:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}async validate(){let r=await this.validator(this.value);typeof r=="string"&&(this.errorMsg=r,r=!1),this.error=!r}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let r=this.value;this.value=r!==""?r:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let r=this.value.toString();if(r.length===0)return this.bell();this.value=this.parse(r=r.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(r,n){if(!this.valid(r))return this.bell();let i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=r,this.lastHit=i,this.color="cyan",r===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(sS.down(YYe(this.outputError,this.out.columns)-1)+kie(this.outputError,this.out.columns)),this.out.write(kie(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[t$.symbol(this.done,this.aborted),iS.bold(this.msg),t$.delimiter(this.done),!this.done||!this.done&&!this.placeholder?iS[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|||
|
|
`).reduce((r,n,i)=>r+`
|
|||
|
|
${i?" ":VYe.pointerSmall} ${iS.red().italic(n)}`,"")),this.out.write(zYe.line+sS.to(0)+this.outputText+sS.save+this.outputError+sS.restore))}},XYe=D$,to=ya,{cursor:JYe}=ba,QYe=Cu,{clear:$ie,figures:_u,style:Lie,wrap:ZYe,entriesToDisplay:eKe}=no,tKe=class extends QYe{constructor(r={}){super(r),this.msg=r.message,this.cursor=r.cursor||0,this.scrollIndex=r.cursor||0,this.hint=r.hint||"",this.warn=r.warn||"- This option is disabled -",this.minSelected=r.min,this.showMinError=!1,this.maxChoices=r.max,this.instructions=r.instructions,this.optionsPerPage=r.optionsPerPage||10,this.value=r.choices.map((n,i)=>(typeof n=="string"&&(n={title:n,value:i}),{title:n&&(n.title||n.value||n),description:n&&n.description,value:n&&(n.value===void 0?i:n.value),selected:n&&n.selected,disabled:n&&n.disabled})),this.clear=$ie("",this.out.columns),r.overrideRender||this.render()}reset(){this.value.map(r=>!r.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(r=>r.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}submit(){let r=this.value.filter(n=>n.selected);this.minSelected&&r.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let r=this.value[this.cursor];if(r.selected)r.selected=!1,this.render();else{if(r.disabled||this.value.filter(n=>n.selected).length>=this.maxChoices)return this.bell();r.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let r=!this.value[this.cursor].selected;this.value.filter(n=>!n.disabled).forEach(n=>n.selected=r),this.render()}_(r,n){if(r===" ")this.handleSpaceToggle();else if(r==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|||
|
|
Instructions:
|
|||
|
|
${_u.arrowUp}/${_u.arrowDown}: Highlight option
|
|||
|
|
${_u.arrowLeft}/${_u.arrowRight}/[space]: Toggle selection
|
|||
|
|
`+(this.maxChoices===void 0?` a: Toggle all
|
|||
|
|
`:"")+" enter/return: Complete answer":""}renderOption(r,n,i,a){let o=(n.selected?to.green(_u.radioOn):_u.radioOff)+" "+a+" ",c,u;return n.disabled?c=r===i?to.gray().underline(n.title):to.strikethrough().gray(n.title):(c=r===i?to.cyan().underline(n.title):n.title,r===i&&n.description&&(u=` - ${n.description}`,(o.length+c.length+u.length>=this.out.columns||n.description.split(/\r?\n/).length>1)&&(u=`
|
|||
|
|
`+ZYe(n.description,{margin:o.length,width:this.out.columns})))),o+c+to.gray(u||"")}paginateOptions(r){if(r.length===0)return to.red("No matches for this query.");let{startIndex:n,endIndex:i}=eKe(this.cursor,r.length,this.optionsPerPage),a,o=[];for(let c=n;c<i;c++)c===n&&n>0?a=_u.arrowUp:c===i-1&&i<r.length?a=_u.arrowDown:a=" ",o.push(this.renderOption(this.cursor,r[c],c,a));return`
|
|||
|
|
`+o.join(`
|
|||
|
|
`)}renderOptions(r){return this.done?"":this.paginateOptions(r)}renderDoneOrInstructions(){if(this.done)return this.value.filter(n=>n.selected).map(n=>n.title).join(", ");let r=[to.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&r.push(to.yellow(this.warn)),r.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(JYe.hide),super.render();let r=[Lie.symbol(this.done,this.aborted),to.bold(this.msg),Lie.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(r+=to.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),r+=this.renderOptions(this.value),this.out.write(this.clear+r),this.clear=$ie(r,this.out.columns)}},jse=tKe,fy=ya,rKe=Cu,{erase:nKe,cursor:Nie}=ba,{style:n$,clear:Mie,figures:i$,wrap:iKe,entriesToDisplay:sKe}=no,qie=(e,r)=>e[r]&&(e[r].value||e[r].title||e[r]),aKe=(e,r)=>e[r]&&(e[r].title||e[r].value||e[r]),oKe=(e,r)=>{let n=e.findIndex(i=>i.value===r||i.title===r);return n>-1?n:void 0},C$=class extends rKe{constructor(r={}){super(r),this.msg=r.message,this.suggest=r.suggest,this.choices=r.choices,this.initial=typeof r.initial=="number"?r.initial:oKe(r.choices,r.initial),this.select=this.initial||r.cursor||0,this.i18n={noMatches:r.noMatches||"no matches found"},this.fallback=r.fallback||this.initial,this.clearFirst=r.clearFirst||!1,this.suggestions=[],this.input="",this.limit=r.limit||10,this.cursor=0,this.transform=n$.render(r.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=Mie("",this.out.columns),this.complete(this.render),this.render()}set fallback(r){this._fb=Number.isSafeInteger(parseInt(r))?parseInt(r):r}get fallback(){let r;return typeof this._fb=="number"?r=this.choices[this._fb]:typeof this._fb=="string"&&(r={title:this._fb}),r||this._fb||{title:this.i18n.noMatches}}moveSelect(r){this.select=r,this.suggestions.length>0?this.value=qie(this.suggestions,r):this.value=this.fallback.value,this.fire()}async complete(r){let n=this.completing=this.suggest(this.input,this.choices),i=await n;if(this.completing!==n)return;this.suggestions=i.map((o,c,u)=>({title:aKe(u,c),value:qie(u,c),description:o.description})),this.completing=!1;let a=Math.max(i.length-1,0);this.moveSelect(Math.min(a,this.select)),r&&r()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}_(r,n){let i=this.input.slice(0,this.cursor),a=this.input.slice(this.cursor);this.input=`${i}${r}${a}`,this.cursor=i.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let r=this.input.slice(0,this.cursor-1),n=this.input.slice(this.cursor);this.input=`${r}${n}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let r=this.input.slice(0,this.cursor),n=this.input.slice(this.cursor+1);this.input=`${r}${n}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(r,n,i,a){let o,c=i?i$.arrowUp:a?i$.arrowDown:" ",u=n?fy.cyan().underline(r.title):r.title;return c=(n?fy.cyan(i$.pointer)+" ":" ")+c,r.description&&(o=` - ${r.description}`,(c.length+u.length+o.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(o=`
|
|||
|
|
`+iKe(r.description,{margin:3,width:this.out.columns}))),c+" "+u+fy.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(Nie.hide):this.out.write(Mie(this.outputText,this.out.columns)),super.render();let{startIndex:r,endIndex:n}=sKe(this.select,this.choices.length,this.limit);if(this.outputText=[n$.symbol(this.done,this.aborted,this.exited),fy.bold(this.msg),n$.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let i=this.suggestions.slice(r,n).map((a,o)=>this.renderOption(a,this.select===o+r,o===0&&r>0,o+r===n-1&&n<this.choices.length)).join(`
|
|||
|
|
`);this.outputText+=`
|
|||
|
|
`+(i||fy.gray(this.fallback.title))}this.out.write(nKe.line+Nie.to(0)+this.outputText)}},cKe=C$,Jo=ya,{cursor:uKe}=ba,lKe=jse,{clear:jie,style:Bie,figures:Qd}=no,P$=class extends lKe{constructor(r={}){r.overrideRender=!0,super(r),this.inputValue="",this.clear=jie("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let r=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let n=this.filteredOptions.findIndex(i=>i===r);this.cursor=n<0?0:n,this.render()}handleSpaceToggle(){let r=this.filteredOptions[this.cursor];if(r.selected)r.selected=!1,this.render();else{if(r.disabled||this.value.filter(n=>n.selected).length>=this.maxChoices)return this.bell();r.selected=!0,this.render()}}handleInputChange(r){this.inputValue=this.inputValue+r,this.updateFilteredOptions()}_(r,n){r===" "?this.handleSpaceToggle():this.handleInputChange(r)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|||
|
|
Instructions:
|
|||
|
|
${Qd.arrowUp}/${Qd.arrowDown}: Highlight option
|
|||
|
|
${Qd.arrowLeft}/${Qd.arrowRight}/[space]: Toggle selection
|
|||
|
|
[a,b,c]/delete: Filter choices
|
|||
|
|
enter/return: Complete answer
|
|||
|
|
`:""}renderCurrentInput(){return`
|
|||
|
|
Filtered results for: ${this.inputValue?this.inputValue:Jo.gray("Enter something to filter")}
|
|||
|
|
`}renderOption(r,n,i,a){let o=(n.selected?Jo.green(Qd.radioOn):Qd.radioOff)+" "+a+" ",c;return n.disabled?c=r===i?Jo.gray().underline(n.title):Jo.strikethrough().gray(n.title):c=r===i?Jo.cyan().underline(n.title):n.title,o+c}renderDoneOrInstructions(){if(this.done)return this.value.filter(n=>n.selected).map(n=>n.title).join(", ");let r=[Jo.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&r.push(Jo.yellow(this.warn)),r.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(uKe.hide),super.render();let r=[Bie.symbol(this.done,this.aborted),Jo.bold(this.msg),Bie.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(r+=Jo.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),r+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+r),this.clear=jie(r,this.out.columns)}},fKe=P$,Uie=ya,pKe=Cu,{style:Gie,clear:dKe}=no,{erase:hKe,cursor:Wie}=ba,T$=class extends pKe{constructor(r={}){super(r),this.msg=r.message,this.value=r.initial,this.initialValue=!!r.initial,this.yesMsg=r.yes||"yes",this.yesOption=r.yesOption||"(Y/n)",this.noMsg=r.no||"no",this.noOption=r.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|||
|
|
`),this.close()}_(r,n){return r.toLowerCase()==="y"?(this.value=!0,this.submit()):r.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(Wie.hide):this.out.write(dKe(this.outputText,this.out.columns)),super.render(),this.outputText=[Gie.symbol(this.done,this.aborted),Uie.bold(this.msg),Gie.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Uie.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(hKe.line+Wie.to(0)+this.outputText))}},mKe=T$,gKe={TextPrompt:YVe,SelectPrompt:ZVe,TogglePrompt:nYe,DatePrompt:WYe,NumberPrompt:XYe,MultiselectPrompt:jse,AutocompletePrompt:cKe,AutocompleteMultiselectPrompt:fKe,ConfirmPrompt:mKe};(function(e){let r=e,n=gKe,i=c=>c;function a(c,u,l={}){return new Promise((f,p)=>{let g=new n[c](u),v=l.onAbort||i,x=l.onSubmit||i,E=l.onExit||i;g.on("state",u.onState||i),g.on("submit",D=>f(x(D))),g.on("exit",D=>f(E(D))),g.on("abort",D=>p(v(D)))})}r.text=c=>a("TextPrompt",c),r.password=c=>(c.style="password",r.text(c)),r.invisible=c=>(c.style="invisible",r.text(c)),r.number=c=>a("NumberPrompt",c),r.date=c=>a("DatePrompt",c),r.confirm=c=>a("ConfirmPrompt",c),r.list=c=>{let u=c.separator||",";return a("TextPrompt",c,{onSubmit:l=>l.split(u).map(f=>f.trim())})},r.toggle=c=>a("TogglePrompt",c),r.select=c=>a("SelectPrompt",c),r.multiselect=c=>{c.choices=[].concat(c.choices||[]);let u=l=>l.filter(f=>f.selected).map(f=>f.value);return a("MultiselectPrompt",c,{onAbort:u,onSubmit:u})},r.autocompleteMultiselect=c=>{c.choices=[].concat(c.choices||[]);let u=l=>l.filter(f=>f.selected).map(f=>f.value);return a("AutocompleteMultiselectPrompt",c,{onAbort:u,onSubmit:u})};let o=(c,u)=>Promise.resolve(u.filter(l=>l.title.slice(0,c.length).toLowerCase()===c.toLowerCase()));r.autocomplete=c=>(c.suggest=c.suggest||o,c.choices=[].concat(c.choices||[]),a("AutocompletePrompt",c))})(Fse);var R$=Fse,vKe=["suggest","format","onState","validate","onRender","type"],Hie=()=>{};async function Du(e=[],{onSubmit:r=Hie,onCancel:n=Hie}={}){let i={},a=Du._override||{};e=[].concat(e);let o,c,u,l,f,p,g=async(v,x,E=!1)=>{if(!(!E&&v.validate&&v.validate(x)!==!0))return v.format?await v.format(x,i):x};for(c of e)if({name:l,type:f}=c,typeof f=="function"&&(f=await f(o,{...i},c),c.type=f),!!f){for(let v in c){if(vKe.includes(v))continue;let x=c[v];c[v]=typeof x=="function"?await x(o,{...i},p):x}if(p=c,typeof c.message!="string")throw new Error("prompt message is required");if({name:l,type:f}=c,R$[f]===void 0)throw new Error(`prompt type (${f}) is not defined`);if(a[c.name]!==void 0&&(o=await g(c,a[c.name]),o!==void 0)){i[l]=o;continue}try{o=Du._injected?yKe(Du._injected,c.initial):await R$[f](c),i[l]=o=await g(c,o,!0),u=await r(c,o,i)}catch{u=!await n(c,i)}if(u)return i}return i}function yKe(e,r){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?r:n}function bKe(e){Du._injected=(Du._injected||[]).concat(e)}function xKe(e){Du._override=Object.assign({},e)}var wKe=Object.assign(Du,{prompt:Du,prompts:R$,inject:bKe,override:xKe}),_Ke=wKe,EKe=xy(_Ke),Bse={},sh={};Object.defineProperty(sh,"__esModule",{value:!0});sh.sync=sh.isexe=void 0;var SKe=ch.default,DKe=O$.default,CKe=async(e,r={})=>{let{ignoreErrors:n=!1}=r;try{return Use(await(0,DKe.stat)(e),r)}catch(i){let a=i;if(n||a.code==="EACCES")return!1;throw a}};sh.isexe=CKe;var PKe=(e,r={})=>{let{ignoreErrors:n=!1}=r;try{return Use((0,SKe.statSync)(e),r)}catch(i){let a=i;if(n||a.code==="EACCES")return!1;throw a}};sh.sync=PKe;var Use=(e,r)=>e.isFile()&&TKe(e,r),TKe=(e,r)=>{let n=r.uid??process.getuid?.(),i=r.groups??process.getgroups?.()??[],a=r.gid??process.getgid?.()??i[0];if(n===void 0||a===void 0)throw new Error("cannot get uid or gid");let o=new Set([a,...i]),c=e.mode,u=e.uid,l=e.gid,f=parseInt("100",8),p=parseInt("010",8),g=parseInt("001",8),v=f|p;return!!(c&g||c&p&&o.has(l)||c&f&&u===n||c&v&&n===0)},ah={};Object.defineProperty(ah,"__esModule",{value:!0});ah.sync=ah.isexe=void 0;var RKe=ch.default,AKe=O$.default,OKe=async(e,r={})=>{let{ignoreErrors:n=!1}=r;try{return Gse(await(0,AK
|
|||
|
|
`),Kr.default.env.CI&&Kr.default.exit(1);let u=vy(i,sse[i]),{tryInstall:l}=await EKe({name:"tryInstall",type:"confirm",message:`Would you like to globally install ${u}?`});l||Kr.default.exit(1)}await nVe(`npm i -g ${i.split("@")[0]}${a?`@${a}`:""}`,{stdio:"inherit",cwd:n})}return i}var N5t=Kr.default.env.NI_CONFIG_FILE,GKe=Kr.default.platform==="win32"?Kr.default.env.USERPROFILE:Kr.default.env.HOME,M5t=Lr.default.join(GKe||"~/",".nirc");var pS=class extends Error{constructor({agent:r,command:n}){super(`Command "${n}" is not support by agent "${r}"`)}};function B$(e,r,n=[]){if(!(e in my))throw new Error(`Unsupported agent "${e}"`);let i=my[e][r];if(typeof i=="function")return i(n);if(!i)throw new pS({agent:e,command:r});let a=o=>!o.startsWith("--")&&o.includes(" ")?JSON.stringify(o):o;return i.replace("{0}",n.map(a).join(" ")).trim()}var A$,Jse,Qse,Zse,eae=!0;typeof process<"u"&&({FORCE_COLOR:A$,NODE_DISABLE_COLORS:Jse,NO_COLOR:Qse,TERM:Zse}=process.env||{},eae=process.stdout&&process.stdout.isTTY);var Mt={enabled:!Jse&&Qse==null&&Zse!=="dumb"&&(A$!=null&&A$!=="0"||eae),reset:Xt(0,0),bold:Xt(1,22),dim:Xt(2,22),italic:Xt(3,23),underline:Xt(4,24),inverse:Xt(7,27),hidden:Xt(8,28),strikethrough:Xt(9,29),black:Xt(30,39),red:Xt(31,39),green:Xt(32,39),yellow:Xt(33,39),blue:Xt(34,39),magenta:Xt(35,39),cyan:Xt(36,39),white:Xt(37,39),gray:Xt(90,39),grey:Xt(90,39),bgBlack:Xt(40,49),bgRed:Xt(41,49),bgGreen:Xt(42,49),bgYellow:Xt(43,49),bgBlue:Xt(44,49),bgMagenta:Xt(45,49),bgCyan:Xt(46,49),bgWhite:Xt(47,49)};function Kie(e,r){let n=0,i,a="",o="";for(;n<e.length;n++)i=e[n],a+=i.open,o+=i.close,~r.indexOf(i.close)&&(r=r.replace(i.rgx,i.close+i.open));return a+r+o}function WKe(e,r){let n={has:e,keys:r};return n.reset=Mt.reset.bind(n),n.bold=Mt.bold.bind(n),n.dim=Mt.dim.bind(n),n.italic=Mt.italic.bind(n),n.underline=Mt.underline.bind(n),n.inverse=Mt.inverse.bind(n),n.hidden=Mt.hidden.bind(n),n.strikethrough=Mt.strikethrough.bind(n),n.black=Mt.black.bind(n),n.red=Mt.red.bind(n),n.green=Mt.green.bind(n),n.yellow=Mt.yellow.bind(n),n.blue=Mt.blue.bind(n),n.magenta=Mt.magenta.bind(n),n.cyan=Mt.cyan.bind(n),n.white=Mt.white.bind(n),n.gray=Mt.gray.bind(n),n.grey=Mt.grey.bind(n),n.bgBlack=Mt.bgBlack.bind(n),n.bgRed=Mt.bgRed.bind(n),n.bgGreen=Mt.bgGreen.bind(n),n.bgYellow=Mt.bgYellow.bind(n),n.bgBlue=Mt.bgBlue.bind(n),n.bgMagenta=Mt.bgMagenta.bind(n),n.bgCyan=Mt.bgCyan.bind(n),n.bgWhite=Mt.bgWhite.bind(n),n}function Xt(e,r){let n={open:`\x1B[${e}m`,close:`\x1B[${r}m`,rgx:new RegExp(`\\x1b\\[${r}m`,"g")};return function(i){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(e)||(this.has.push(e),this.keys.push(n)),i===void 0?this:Mt.enabled?Kie(this.keys,i+""):i+""):i===void 0?WKe([e],[n]):Mt.enabled?Kie([n],i+""):i+""}}async function ec(e,r,...n){let i=await wy({autoInstall:!1,cwd:e,programmatic:!0});return B$(i??"npm",r,n)}var wS=require("@prisma/engines");var coe=B(l_()),r3=B(require("path"));var tae=B(require("fs")),Ls=B(require("path")),rae=require("util"),fh=(0,rae.promisify)(tae.default.exists);async function HKe(e){return await fh(Ls.default.resolve(process.cwd(),"prisma/schema.prisma"))||Ls.default.relative(process.cwd(),e)==="prisma"&&await fh(Ls.default.resolve(process.cwd(),"package.json"))?process.cwd():await fh(Ls.default.resolve(e,"node_modules"))?e:await fh(Ls.default.resolve(e,"../node_modules"))?Ls.default.join(e,"../"):await fh(Ls.default.resolve(e,"package.json"))?e:await fh(Ls.default.resolve(e,"../package.json"))?Ls.default.join(e,"../"):e}async function nae(e){let r=zKe(e.defaultOutput);if(r.startsWith("node_modules")){let n=await HKe(e.baseDir);return Ls.default.resolve(n,r)}return Ls.default.resolve(e.baseDir,r)}function zKe(e){return e.startsWith("./")?e.slice(2):e}function iae(e){return e.generators.find(r=>mn(r.provider)==="prisma-client-js")?.previewFeatures||[]}var sae={string:[/\"(.*)\"/g,/\'(.*)\'/g],directive:{pattern:/(@.*)/g},entity:[/model\s+\w+/g,/enum\s+\w+/g,/datasource\s+\w+/g,/source\s+\w+/g,/generator\s+\w+/g],comment:/#.*/g,value:[/\b\s+(\w+)/g],punctuation:/(\:|}|{|"|=)/g,boolean:/(true|false)/g};v
|
|||
|
|
You don't have any ${N("datasource")} defined in your ${N("schema.prisma")}.
|
|||
|
|
You can define a datasource like this:
|
|||
|
|
|
|||
|
|
${N(ph(`datasource db {
|
|||
|
|
provider = "postgresql"
|
|||
|
|
url = env("DB_URL")
|
|||
|
|
}`))}
|
|||
|
|
|
|||
|
|
More information in our documentation:
|
|||
|
|
${ke("https://pris.ly/d/prisma-schema")}
|
|||
|
|
`;var mS=`
|
|||
|
|
${Jn("info")} You don't have any generators defined in your ${N("schema.prisma")}, so nothing will be generated.
|
|||
|
|
You can define them like this:
|
|||
|
|
|
|||
|
|
${N(ph(`generator client {
|
|||
|
|
provider = "prisma-client-js"
|
|||
|
|
}`))}`,uae=`
|
|||
|
|
You don't have any ${N("models")} defined in your ${N("schema.prisma")}, so nothing will be generated.
|
|||
|
|
You can define a model like this:
|
|||
|
|
|
|||
|
|
${N(ph(`model User {
|
|||
|
|
id Int @id @default(autoincrement())
|
|||
|
|
email String @unique
|
|||
|
|
name String?
|
|||
|
|
}`))}
|
|||
|
|
|
|||
|
|
More information in our documentation:
|
|||
|
|
${ke("https://pris.ly/d/prisma-schema")}
|
|||
|
|
`,lae=`
|
|||
|
|
You don't have any ${N("models")} defined in your ${N("schema.prisma")}, so nothing will be generated.
|
|||
|
|
You can define a model like this:
|
|||
|
|
|
|||
|
|
${N(ph(`model User {
|
|||
|
|
id String @id @default(auto()) @map("_id") @db.ObjectId
|
|||
|
|
email String @unique
|
|||
|
|
name String?
|
|||
|
|
}`))}
|
|||
|
|
|
|||
|
|
More information in our documentation:
|
|||
|
|
${ke("https://pris.ly/d/prisma-schema")}
|
|||
|
|
`;function fae(e,r){return Object.entries(e).reduce((n,[i,a])=>(r.includes(i)&&(n[i]=a),n),{})}function pae(e){if(e&&e.length>0){let r=e.map(n=>`${ze("warn")} ${n}`).join(`
|
|||
|
|
`);console.warn(r)}}var Vae=B(require("fs"));var bS=B(require("path"));var Ns=B(require("path"));function dh(e){return Ns.default.sep===Ns.default.posix.sep?e:e.split(Ns.default.sep).join(Ns.default.posix.sep)}function U$(e,r){if(!Ns.default.isAbsolute(e)||!Ns.default.isAbsolute(r))throw new Error("longestCommonPathPrefix expects absolute paths");process.platform==="win32"&&(e.startsWith("\\\\")||r.startsWith("\\\\"))&&(e=Ns.default.toNamespacedPath(e),r=Ns.default.toNamespacedPath(r));let n=JKe(e.split(Ns.default.sep),r.split(Ns.default.sep)).join(Ns.default.sep);if(n==="")return process.platform==="win32"?void 0:"/";if(!(process.platform==="win32"&&["\\","\\\\?","\\\\."].includes(n)))return process.platform==="win32"&&n.endsWith(":")?n+"\\":n}function JKe(e,r){let n=Math.min(e.length,r.length),i=0;for(;i<=n&&e[i]===r[i];)i++;return e.slice(0,i)}var qae=B(require("fs")),K$=B(require("path"));var Lae=B(require("path")),Nae=B($ae());async function OXe(e,r){let n={preserveSymlinks:!1,...r};return new Promise(i=>{(0,Nae.default)(e,n,(a,o)=>{a&&i(void 0),i(o)})})}async function Df(e,r){let n=await OXe(`${e}/package.json`,r);return n&&Lae.default.dirname(n)}var Mae=me("prisma:generator"),IXe=qae.default.promises.realpath;async function X$(e){let r={basedir:e,preserveSymlinks:!0},n=await Df("prisma",r),i=await Df("@prisma/client",r),a=i&&await IXe(i);if(Mae("prismaCLIDir",n),Mae("prismaClientDir",i),n===void 0||i===void 0)return a;let o=K$.default.relative(n,i).split(K$.default.sep);if(!(o[0]!==".."||o[1]===".."))return a}var jae=B(Pl());async function J$(e,r,...n){await jae.default.command(await ec(e,r,...n),{env:{PRISMA_SKIP_POSTINSTALL_GENERATE:"true"},stdio:"inherit",cwd:e})}var Bae=B(require("fs"));var Uae=B(require("path"));function yS(e,r){let[n,i,a]=e.split(".").map(Number),[o,c,u]=r.split(".").map(Number);return n<o?!0:n>o?!1:i<c?!0:i>c?!1:a<u?!0:(a>u,!1)}var kXe=me("prisma:generator");async function Gae(){let e="4.1.0";try{let r=await Df("typescript",{basedir:process.cwd()});kXe("typescriptPath",r);let n=r&&Uae.default.join(r,"package.json");if(n&&Bae.default.existsSync(n)){let a=require(n).version;yS(a,e)&&fr.warn(`Prisma detected that your ${N("TypeScript")} version ${a} is outdated. If you want to use Prisma Client with TypeScript please update it to version ${N(e)} or ${N("newer")}. ${J(`TypeScript found in: ${N(r)}`)}`)}}catch{}}function Wae(){if(process.env.npm_config_user_agent){let e=FXe(process.env.npm_config_user_agent);if(e){let{agent:r,major:n,minor:i,patch:a}=e;if(r==="yarn"&&n===1){let o=`${n}.${i}.${a}`,c="1.19.2";yS(o,c)&&fr.warn(`Your ${N("yarn")} has version ${o}, which is outdated. Please update it to ${N(c)} or ${N("newer")} in order to use Prisma.`)}}}}function FXe(e){let n=/(\w+)\/(\d+)\.(\d+)\.(\d+)/.exec(e);if(n){let i=n[1],a=parseInt(n[2]),o=parseInt(n[3]),c=parseInt(n[4]);return{agent:i,major:a,minor:o,patch:c}}return null}async function Hae(e){let r=await wy({cwd:e,autoInstall:!1,programmatic:!0});return r==="yarn"||r==="yarn@berry"}var zae=me("prisma:generator");async function Yae(e,r){let n=await X$(e);if(zae("baseDir",e),Wae(),await Gae(),!n&&!process.env.PRISMA_GENERATE_SKIP_AUTOINSTALL){let i=U$(e,process.cwd());zae("projectRoot",i);let a=`${N("Warning:")} ${J("[Prisma auto-install on generate]")}`;i===void 0&&(console.warn(ze(`${a} The Prisma schema directory ${N(e)} and the current working directory ${N(process.cwd())} have no common ancestor. The Prisma schema directory will be used as the project root.`)),i=e),Vae.default.existsSync(bS.default.join(i,"package.json"))||console.warn(ze(`${a} Prisma could not find a ${N("package.json")} file in the inferred project root ${N(i)}. During the next step, when an auto-install of Prisma package(s) will be attempted, it will then be created by your package manager on the appropriate level if necessary.`));let o=await Df("prisma",{basedir:e});if(process.platform==="win32"&&await Hae(e)){let c=l=>o!==void 0?l:"",u=l=>o===void 0?l:"";throw new Error(`Could not resolve ${u(`${N("prisma")} and `)}${N("@prisma/client")} in the current project. Pl
|
|||
|
|
Please try to install it by hand with ${N(te(`${await ec(e,"add","@prisma/client")}`))} and rerun ${N(await ec(e,"execute","prisma generate"))} \u{1F64F}.`);console.info(`
|
|||
|
|
\u2714 Installed the ${N(te("@prisma/client"))} and ${N(te("prisma"))} packages in your project`)}if(!n)throw new Error(`Could not resolve @prisma/client.
|
|||
|
|
Please try to install it with ${N(te("npm install @prisma/client"))} and rerun ${N(await ec(e,"execute","prisma generate"))} \u{1F64F}.`);return{outputPath:n,generatorPath:bS.default.resolve(n,"generator-build/index.js"),isNode:!0}}var Q$={"prisma-client-js":Yae};function xS(e){if(e==="schema-engine")return"schemaEngine";if(e==="libquery-engine")return"libqueryEngine";if(e==="query-engine")return"queryEngine";throw new Error(`Could not convert binary type ${e}`)}function Kae(e){return{fromEnvVar:null,value:e}}function Xae(e,r){return e=e||[],e.find(n=>n.native===!0)?[...e,Kae(r)]:[Kae("native"),...e]}var eoe=require("@prisma/engines");var toe=B(uu()),roe=B(require("path"));function Jae(e,r){return Object.entries(e).reduce((n,[i,a])=>(n[r(i)]=a,n),{})}function Qae(){let e=process.env.AWS_LAMBDA_JS_RUNTIME;if(!e||e==="")return null;try{let n=/^nodejs(\d+).x$/.exec(e);if(n)return parseInt(n[1])}catch{console.error(`We could not parse the AWS_LAMBDA_JS_RUNTIME env var with the following value: ${e}. This was silently ignored.`)}return null}function Zae(e){if(e==="schemaEngine")return"schema-engine";if(e==="queryEngine")return"query-engine";if(e==="libqueryEngine")return"libquery-engine";throw new Error(`Could not convert engine type ${e}`)}async function noe({neededVersions,binaryTarget,version,printDownloadProgress,skipDownload,binaryPathsOverride}){let binaryPathsByVersion=Object.create(null);for(let currentVersion in neededVersions){binaryPathsByVersion[currentVersion]={};let neededVersion=neededVersions[currentVersion];if(neededVersion.binaryTargets.length===0&&(neededVersion.binaryTargets=[{fromEnvVar:null,value:binaryTarget}]),process.env.NETLIFY){let e=parseInt(process.versions.node.split(".")[0])>=20,r=Qae(),n=r&&r>=20,i=r&&r<=18,a=neededVersion.binaryTargets.find(c=>c.value==="rhel-openssl-1.0.x");!neededVersion.binaryTargets.find(c=>c.value==="rhel-openssl-3.0.x")&&(e||n)&&!i?neededVersion.binaryTargets.push({fromEnvVar:null,value:"rhel-openssl-3.0.x"}):a||neededVersion.binaryTargets.push({fromEnvVar:null,value:"rhel-openssl-1.0.x"})}let binaryTargetBaseDir=eval("require('path').join(__dirname, '..')");version!==currentVersion&&(binaryTargetBaseDir=roe.default.join(binaryTargetBaseDir,`./engines/${currentVersion}/`),await(0,toe.ensureDir)(binaryTargetBaseDir).catch(e=>console.error(e)));let binariesConfig=neededVersion.engines.reduce((e,r)=>(binaryPathsOverride?.[r]||(e[Zae(r)]=binaryTargetBaseDir),e),Object.create(null));if(Object.values(binariesConfig).length>0){let e=neededVersion.binaryTargets.map(a=>a.value),n=await jE({binaries:binariesConfig,binaryTargets:e,showProgress:typeof printDownloadProgress=="boolean"?printDownloadProgress:!0,version:currentVersion&¤tVersion!=="latest"?currentVersion:eoe.enginesVersion,skipDownload}),i=Jae(n,xS);binaryPathsByVersion[currentVersion]=i}if(binaryPathsOverride){let e=Object.keys(binaryPathsOverride),r=neededVersion.engines.filter(n=>e.includes(n));if(r.length>0)for(let n of r){let i=binaryPathsOverride[n];binaryPathsByVersion[currentVersion][n]={[binaryTarget]:i}}}}return binaryPathsByVersion}function Z$(e,r){let n=e?.requiresEngineVersion;return n=n??r,n??"latest"}var ioe=B(fv());function soe(e){return String(new e3(e))}var e3=class{constructor(r){this.config=r}toString(){let{config:r}=this,n=r.provider.fromEnvVar?`env("${r.provider.fromEnvVar}")`:r.provider.value,i=JSON.parse(JSON.stringify({provider:n,binaryTargets:t3(r.binaryTargets)}));return`generator ${r.name} {
|
|||
|
|
${(0,ioe.default)($Xe(i),2)}
|
|||
|
|
}`}};function t3(e){let r;if(e.length>0){let n=e.find(i=>i.fromEnvVar!==null);n?r=`env("${n.fromEnvVar}")`:r=e.map(i=>i.native?"native":i.value)}else r=void 0;return r}function $Xe(e){let r=Object.keys(e).reduce((n,i)=>Math.max(n,i.length),0);return Object.entries(e).map(([n,i])=>`${n.padEnd(r)} = ${LXe(i)}`).join(`
|
|||
|
|
`)}function LXe(e){return JSON.parse(JSON.stringify(e,(r,n)=>Array.isArray(n)?`[${n.map(i=>JSON.stringify(i)).join(", ")}]`:JSON.stringify(n)))}var Dy=me("prisma:getGenerators");async function tc(options){let{schemaPath,providerAliases:aliases,version,cliVersion,printDownloadProgress,overrideGenerators,skipDownload,binaryPathsOverride,generatorNames=[],postinstall,noEngine,allowNoModels,typedSql}=options;if(!schemaPath)throw new Error(`schemaPath for getGenerators got invalid value ${schemaPath}`);let schemaResult=null;try{schemaResult=await pt(schemaPath)}catch(e){throw new Error(`${schemaPath} does not exist`)}let{schemas}=schemaResult,binaryTarget=await Hr(),queryEngineBinaryType=(0,wS.getCliQueryEngineBinaryType)(),queryEngineType=xS(queryEngineBinaryType),prismaPath=binaryPathsOverride?.[queryEngineType];if(version&&!prismaPath){let potentialPath=eval("require('path').join(__dirname, '..')");if(!potentialPath.match(Vd)){let e={binaries:{[queryEngineBinaryType]:potentialPath},binaryTargets:[binaryTarget],showProgress:!1,version,skipDownload};prismaPath=(await jE(e))[queryEngineBinaryType][binaryTarget]}}let config=await Ve({datamodel:schemas,datamodelPath:schemaPath,prismaPath,ignoreEnvVarErrors:!0});if(config.datasources.length===0)throw new Error(cae);pae(config.warnings);let previewFeatures=iae(config),dmmf=await pE({datamodel:schemas,datamodelPath:schemaPath,prismaPath,previewFeatures});if(dmmf.datamodel.models.length===0&&!allowNoModels)throw config.datasources.some(e=>e.provider==="mongodb")?new Error(lae):new Error(uae);let generatorConfigs=jXe(overrideGenerators||config.generators,generatorNames);await qXe(generatorConfigs);let runningGenerators=[];try{let e=await(0,coe.default)(generatorConfigs,async(a,o)=>{let c=mn(a.provider),u,l=r3.default.dirname(a.sourceFilePath??schemaPath),f=mn(a.provider);aliases&&aliases[f]?(c=aliases[f].generatorPath,u=aliases[f]):Q$[f]&&(u=await Q$[f](l,cliVersion),c=u.generatorPath);let p=new JE(c,a,u?.isNode);if(await p.init(),a.output)a.output={value:r3.default.resolve(l,mn(a.output)),fromEnvVar:null},a.isCustomOutput=!0;else if(u)a.output={value:u.outputPath,fromEnvVar:null};else{if(!p.manifest||!p.manifest.defaultOutput)throw new Error(`Can't resolve output dir for generator ${N(a.name)} with provider ${N(a.provider.value)}.
|
|||
|
|
The generator needs to either define the \`defaultOutput\` path in the manifest or you need to define \`output\` in the datamodel.prisma file.`);a.output={value:await nae({defaultOutput:p.manifest.defaultOutput,baseDir:l}),fromEnvVar:"null"}}let g=ey({schemas}),v=await mf(schemaPath,{cwd:a.output.value}),x={datamodel:g,datasources:config.datasources,generator:a,dmmf,otherGenerators:MXe(generatorConfigs,o),schemaPath,version:version||wS.enginesVersion,postinstall,noEngine,allowNoModels,envPaths:v,typedSql};return p.setOptions(x),runningGenerators.push(p),p},{stopOnError:!1}),r=generatorConfigs.map(a=>mn(a.provider));for(let a of e)if(a.manifest&&a.manifest.requiresGenerators&&a.manifest.requiresGenerators.length>0){for(let o of a.manifest.requiresGenerators)if(!r.includes(o))throw new Error(`Generator "${a.manifest.prettyName}" requires generator "${o}", but it is missing in your schema.prisma.
|
|||
|
|
Please add it to your schema.prisma:
|
|||
|
|
|
|||
|
|
generator gen {
|
|||
|
|
provider = "${o}"
|
|||
|
|
}
|
|||
|
|
`)}let n=Object.create(null);for(let a of e)if(a.manifest&&a.manifest.requiresEngines&&Array.isArray(a.manifest.requiresEngines)&&a.manifest.requiresEngines.length>0){let o=Z$(a.manifest,version);n[o]||(n[o]={engines:[],binaryTargets:[]});for(let u of a.manifest.requiresEngines)n[o].engines.includes(u)||n[o].engines.push(u);let c=a.options?.generator?.binaryTargets;if(c&&c.length>0)for(let u of c)n[o].binaryTargets.find(l=>l.value===u.value)||n[o].binaryTargets.push(u)}Dy("neededVersions",JSON.stringify(n,null,2));let i=await noe({neededVersions:n,binaryTarget,version,printDownloadProgress,skipDownload,binaryPathsOverride});for(let a of e)if(a.manifest&&a.manifest.requiresEngines){let o=Z$(a.manifest,version),c=i[o],u=fae(c,a.manifest.requiresEngines);if(Dy({generatorBinaryPaths:u}),a.setBinaryPaths(u),o!==version&&a.options&&a.manifest.requiresEngines.includes(queryEngineType)&&u[queryEngineType]&&u[queryEngineType]?.[binaryTarget]){let l=await pE({datamodel:schemas,datamodelPath:schemaPath,prismaPath:u[queryEngineType]?.[binaryTarget],previewFeatures}),f={...a.options,dmmf:l};Dy("generator.manifest.prettyName",a.manifest.prettyName),Dy("options",f),Dy("options.generator.binaryTargets",f.generator.binaryTargets),a.setOptions(f)}}return e}catch(e){throw runningGenerators.forEach(r=>r.stop()),e}}async function NXe(e){return(await tc(e))[0]}function MXe(e,r){return[...e.slice(0,r),...e.slice(r+1)]}var aoe=[...kg,"native"],ooe={"linux-glibc-libssl1.0.1":"debian-openssl-1.0.x","linux-glibc-libssl1.0.2":"debian-openssl-1.0.x","linux-glibc-libssl1.1.0":"debian-openssl1.1.x"};async function qXe(e){let r=await Hr();for(let n of e){if(n.config.platforms)throw new Error("The `platforms` field on the generator definition is deprecated. Please rename it to `binaryTargets`.");if(n.config.pinnedBinaryTargets)throw new Error("The `pinnedBinaryTargets` field on the generator definition is deprecated.\nPlease use the PRISMA_QUERY_ENGINE_BINARY env var instead to pin the binary target.");if(n.binaryTargets){let a=(n.binaryTargets&&n.binaryTargets.length>0?n.binaryTargets:[{fromEnvVar:null,value:"native"}]).flatMap(o=>$F(o)).map(o=>o==="native"?r:o);for(let o of a){if(ooe[o])throw new Error(`Binary target ${oe(N(o))} is deprecated. Please use ${te(N(ooe[o]))} instead.`);if(!aoe.includes(o))throw new Error(`Unknown binary target ${oe(o)} in generator ${N(n.name)}.
|
|||
|
|
Possible binaryTargets: ${te(aoe.join(", "))}`)}if(!a.includes(r)){let o=t3(n.binaryTargets);console.log(`${ze("Warning:")} Your current platform \`${N(r)}\` is not included in your generator's \`binaryTargets\` configuration ${JSON.stringify(o)}.
|
|||
|
|
To fix it, use this generator config in your ${N("schema.prisma")}:
|
|||
|
|
${te(soe({...n,binaryTargets:Xae(n.binaryTargets,r)}))}
|
|||
|
|
${Sl(`Note, that by providing \`native\`, Prisma Client automatically resolves \`${r}\`.
|
|||
|
|
Read more about deploying Prisma Client: ${tt("https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-schema/generators")}`)}
|
|||
|
|
`)}}}}function jXe(e,r){if(r.length<1)return e;let n=e.filter(i=>r.includes(i.name));if(n.length!==r.length){let i=r.filter(o=>n.find(c=>c.name===o)==null),a=i.length<=1;throw new Error(`The ${a?"generator":"generators"} ${N(i.join(", "))} specified via ${N("--generator")} ${a?"does":"do"} not exist in your Prisma schema`)}return n}var fr={};Xn(fr,{error:()=>WXe,info:()=>GXe,log:()=>BXe,query:()=>HXe,should:()=>uoe,tags:()=>Cy,warn:()=>UXe});var Cy={error:oe("prisma:error"),warn:ze("prisma:warn"),info:gs("prisma:info"),query:Jn("prisma:query")},uoe={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function BXe(...e){console.log(...e)}function UXe(e,...r){uoe.warn()&&console.warn(`${Cy.warn} ${e}`,...r)}function GXe(e,...r){console.info(`${Cy.info} ${e}`,...r)}function WXe(e,...r){console.error(`${Cy.error} ${e}`,...r)}function HXe(e,...r){console.log(`${Cy.query} ${e}`,...r)}var loe=B(Pl());function foe(e){let r=e.split(/\r?\n/).slice(1),n=[];for(let i of r){let a=String(i);try{let o=JSON.parse(a);n.push(o)}catch(o){throw new Error(`Could not parse schema engine response: ${o}`)}}return n}async function Cf(e,r=process.cwd(),n){if(!e)throw new Error("Connection url is empty. See https://www.prisma.io/docs/reference/database-reference/connection-urls");try{await poe({connectionString:e,cwd:r,schemaEnginePath:n,engineCommandName:"can-connect-to-database"})}catch(i){let a=i;if(a.stderr){let o=foe(a.stderr),c=o.find(u=>u.level==="ERROR"&&u.target==="schema_engine::logger");if(c&&c.fields.error_code&&c.fields.message)return{code:c.fields.error_code,message:c.fields.message};throw new Error(`Schema engine error:
|
|||
|
|
${o.map(u=>u.fields.message).join(`
|
|||
|
|
`)}`)}else throw new Error(`Schema engine exited. ${i}`)}return!0}async function n3(e,r=process.cwd(),n){if(await Cf(e,r,n)===!0)return!1;try{return await poe({connectionString:e,cwd:r,schemaEnginePath:n,engineCommandName:"create-database"}),!0}catch(a){let o=a;if(o.stderr){let c=foe(o.stderr),u=c.find(l=>l.level==="ERROR"&&l.target==="schema_engine::logger");throw u&&u.fields.error_code&&u.fields.message?new Error(`${u.fields.error_code}: ${u.fields.message}`):new Error(`Schema engine error:
|
|||
|
|
${c.map(l=>l.fields.message).join(`
|
|||
|
|
`)}`)}else throw new Error(`Schema engine exited. ${a}`)}}async function poe({connectionString:e,cwd:r,schemaEnginePath:n,engineCommandName:i}){n=n||await wu("schema-engine");try{return await(0,loe.default)(n,["cli","--datasource",e,i],{cwd:r,env:{RUST_BACKTRACE:process.env.RUST_BACKTRACE??"1",RUST_LOG:process.env.RUST_LOG??"info"}})}catch(a){let o=a;throw o.message&&(o.message=o.message.replace(e,"<REDACTED>")),o.stdout&&(o.stdout=o.stdout.replace(e,"<REDACTED>")),o.stderr&&(o.stderr=o.stderr.replace(e,"<REDACTED>")),o}}var Nge=B(oge()),Mge=B(Vh()),Qh=B(require("fs")),qge=B(nv()),MD=B(require("os")),Zh=B(require("path")),jge=B(Yh()),yN=B(Age());async function Oge(e,r){return await Ja(r,{method:"PUT",agent:pf(r),headers:{"Content-Length":String(e.byteLength)},body:e})}async function Ige(e){return(await Fge(`mutation ($data: CreateErrorReportInput!) {
|
|||
|
|
createErrorReport(data: $data)
|
|||
|
|
}`,{data:e})).createErrorReport}async function kge(e){return(await Fge(`mutation ($signedUrl: String!) {
|
|||
|
|
markErrorReportCompleted(signedUrl: $signedUrl)
|
|||
|
|
}`,{signedUrl:e})).markErrorReportCompleted}async function Fge(e,r){let n="https://error-reports.prisma.sh/",i=JSON.stringify({query:e,variables:r});return await Ja(n,{method:"POST",agent:pf(n),body:i,headers:{Accept:"application/json","Content-Type":"application/json"}}).then(a=>{if(!a.ok)throw new Error(`Error during request: ${a.status} ${a.statusText} - Query: ${e}`);return a.json()}).then(a=>{if(a.errors)throw new Error(JSON.stringify(a.errors));return a.data})}function $ge(e){return e.map(([r,n])=>[r,E0(n)])}function E0(e){let r=/url\s*=\s*.+/;return e.split(`
|
|||
|
|
`).map(n=>{let i=r.exec(n);return i?`${n.slice(0,i.index)}url = "***"`:n}).join(`
|
|||
|
|
`)}function gN(e,r){let n={};for(let i in e)typeof e[i]=="object"?n[i]=gN(e[i],r):n[i]=r(e[i]);return n}var vN=B(require("path"));function Sa(e,r){let n=e?.datasources?.[0]?.sourceFilePath;return n?vN.default.dirname(n):r?vN.default.dirname(r):process.cwd()}function as(e){return{files:Lge(e)}}function Jh(e,r){return{files:Lge(e.schemas),configDir:Sa(r,e.schemaPath)}}function Lge(e){return e.map(([r,n])=>({path:r,content:n}))}yN.default.setGracefulCleanup();async function Bge({error:e,cliVersion:r,enginesVersion:n,getDatabaseVersionSafe:i}){let a=await He(e).with({schemaPath:Cr.not(Cr.nullish)},g=>Bn(g.schemaPath)).with({schema:Cr.not(Cr.nullish)},g=>Promise.resolve(g.schema)).otherwise(()=>{}),o=a?$ge(a):void 0,c;if(e.area==="LIFT_CLI"){let g=He({schema:a,introspectionUrl:e.introspectionUrl}).with({schema:Cr.not(void 0)},({schema:v})=>({datasource:{tag:"Schema",...as(v)}})).with({introspectionUrl:Cr.not(void 0)},({introspectionUrl:v})=>({datasource:{tag:"ConnectionString",url:v}})).otherwise(()=>{});c=await i(g)}let u=e.request?JSON.stringify(gN(e.request,g=>typeof g=="string"?E0(g):g)):void 0,l={area:e.area,kind:"RUST_PANIC",cliVersion:r,binaryVersion:n,command:Mlt(),jsStackTrace:(0,jge.default)(e.stack||e.message),rustStackTrace:e.rustStack,operatingSystem:`${MD.default.arch()} ${MD.default.platform()} ${MD.default.release()}`,platform:await Hr(),liftRequest:u,schemaFile:Nlt(o),fingerprint:await Mge.getSignature(),sqlDump:void 0,dbVersion:c},f=await Ige(l);try{if(e.schemaPath){let g=await qlt(e);await Oge(g,f)}}catch(g){console.error(`Error uploading zip file: ${g.message}`)}return await kge(f)}function Nlt(e){if(e)return e.map(([r,n])=>`// ${r}
|
|||
|
|
${n}`).join(`
|
|||
|
|
`)}function Mlt(){return process.argv[2]==="introspect"?"introspect":process.argv[2]==="db"&&process.argv[3]==="pull"?"db pull":process.argv.slice(2).join(" ")}async function qlt(e){if(!e.schemaPath)throw new Error("Can't make zip without schema path");let r=Zh.default.dirname(e.schemaPath),n=yN.default.fileSync(),i=Qh.default.createWriteStream(n.name),a=(0,Nge.default)("zip",{zlib:{level:9}});a.pipe(i);let o=E0(Qh.default.readFileSync(e.schemaPath,"utf-8"));if(a.append(o,{name:Zh.default.basename(e.schemaPath)}),Qh.default.existsSync(r)){let c=await(0,qge.default)("migrations/**/*",{cwd:r});for(let u of c){let l=Qh.default.readFileSync(Zh.default.resolve(r,u),"utf-8");(u.endsWith("schema.prisma")||u.endsWith(Zh.default.basename(e.schemaPath)))&&(l=E0(l)),a.append(l,{name:Zh.default.basename(u)})}}return a.finalize(),new Promise((c,u)=>{i.on("close",()=>{let l=Qh.default.readFileSync(n.name);c(l)}),a.on("error",l=>{u(l)})})}function bN(e,r){if(!e)throw new Error(`${r}. This should never happen. If you see this error, please, open an issue at https://pris.ly/prisma-prisma-bug-report`)}var bbe=B(Ju());var Yf=()=>{let e=process.env;return!!(e.CI||e.CONTINUOUS_INTEGRATION||e.BUILD_NUMBER||e.RUN_ID||e.AGOLA_GIT_REF||e.AC_APPCIRCLE||e.APPVEYOR||e.CODEBUILD||e.TF_BUILD||e.bamboo_planKey||e.BITBUCKET_COMMIT||e.BITRISE_IO||e.BUDDY_WORKSPACE_ID||e.BUILDKITE||e.CIRCLECI||e.CIRRUS_CI||e.CF_BUILD_ID||e.CM_BUILD_ID||e.CI_NAME||e.DRONE||e.DSARI||e.EARTHLY_CI||e.EAS_BUILD||e.GERRIT_PROJECT||e.GITEA_ACTIONS||e.GITHUB_ACTIONS||e.GITLAB_CI||e.GOCD||e.BUILDER_OUTPUT||e.HARNESS_BUILD_ID||e.JENKINS_URL||e.BUILD_ID||e.LAYERCI||e.MAGNUM||e.NETLIFY||e.NEVERCODE||e.PROW_JOB_ID||e.RELEASE_BUILD_ID||e.RENDER||e.SAILCI||e.HUDSON||e.JENKINS_URL||e.BUILD_ID||e.SCREWDRIVER||e.SEMAPHORE||e.SOURCEHUT||e.STRIDER||e.TASK_ID||e.RUN_ID||e.TEAMCITY_VERSION||e.TRAVIS||e.VELA||e.NOW_BUILDER||e.APPCENTER_BUILD_ID||e.CI_XCODE_PROJECT||e.XCS)};var Kf=({stream:e=process.stdin}={})=>!!(e&&e.isTTY&&process.env.TERM!=="dumb");var Pa=()=>!!bbe.default._injected?.length||Kf()&&!Yf();var tC=B(require("path")),xbe=B(require("process")),wbe=B(U1()),_be=B(nv());var OM=tC.default.join(".wrangler","state","v3","d1","miniflare-D1DatabaseObject");async function Xf({arg:e}){let r=xbe.default.cwd(),n=tC.default.posix.join(r,OM),i=(0,wbe.convertPathToPattern)(n),a=await(0,_be.default)(tC.default.posix.join(i,"*.sqlite"),{});if(a.length===0)throw new Error(`No Cloudflare D1 databases found in ${OM}. Did you run \`wrangler d1 create <DATABASE_NAME>\` and \`wrangler dev\`?`);if(a.length>1){let{originalArg:c,recommendedArg:u}=He(e).with("--to-local-d1",l=>({originalArg:l,recommendedArg:"--to-url file:"})).with("--from-local-d1",l=>({originalArg:l,recommendedArg:"--from-url file:"})).exhaustive();throw new Error(`Multiple Cloudflare D1 databases found in ${OM}. Please manually specify the local D1 database with \`${u}\`, without using the \`${c}\` flag.`)}return a[0]}var Kbe=B(Ybe());var MM=B(aC()),cs={topLeft:"\u250C",topRight:"\u2510",bottomRight:"\u2518",bottomLeft:"\u2514",vertical:"\u2502",horizontal:"\u2500"};function oht(e){return e.split(`
|
|||
|
|
`).reduce((r,n)=>Math.max(r,(0,MM.default)(n)),0)+2}function N0({title:e,width:r,height:n,str:i,horizontalPadding:a}){a=a||0,r=r||0,n=n||0,r=Math.max(r,oht(i)+a*2);let o=e?Oo(cs.topLeft+cs.horizontal)+" "+Og(N(e))+" "+Oo(cs.horizontal.repeat(r-e.length-2-3)+cs.topRight)+Og():Oo(cs.topLeft+cs.horizontal)+Oo(cs.horizontal.repeat(r-3)+cs.topRight),c=cs.bottomLeft+cs.horizontal.repeat(r-2)+cs.bottomRight,u=i.split(`
|
|||
|
|
`);u.length<n&&u.push(...new Array(n-u.length).fill(""));let l=u.slice(-n).map(f=>{let p=Math.min((0,MM.default)(f),r),g=Math.max(r-p-2,0);return`${Oo(cs.vertical)}${" ".repeat(a)}${Og((0,Kbe.default)(f,r-2))}${" ".repeat(g-a)}${Oo(cs.vertical)}`}).join(`
|
|||
|
|
`);return Oo(o+`
|
|||
|
|
`+l+`
|
|||
|
|
`+c)}var xc={};Xn(xc,{createDirIfNotExists:()=>O0t,getFilesInDir:()=>N0t,getNestedFoldersInDir:()=>L0t,removeDir:()=>F0t,removeEmptyDirs:()=>k0t,removeFile:()=>$0t,writeFile:()=>I0t});var C4=B(Nt()),dm=B(E4()),P4=B(require("fs/promises"));var sp=B(require("fs/promises")),S4=B(nv()),wC=B(require("path"));function dwe(e){return sp.default.mkdir(e,{recursive:!0})}function hwe({path:e,content:r}){return sp.default.writeFile(e,r,{encoding:"utf-8"})}function mwe(e){let r=dh(wC.default.join(e,"**"));return(0,S4.default)(r,{onlyFiles:!1,onlyDirectories:!0})}function gwe(e,r="**"){let n=dh(wC.default.join(e,r));return(0,S4.default)(n,{onlyFiles:!0,onlyDirectories:!1})}async function D4(e){try{if(!(await sp.default.lstat(e)).isDirectory())return}catch{return}let r=await sp.default.readdir(e);if(r.length>0){let i=r.map(a=>D4(wC.default.join(e,a)));await Promise.all(i)}(await sp.default.readdir(e)).length===0&&await sp.default.rmdir(e)}var O0t=e=>dm.tryCatch(()=>dwe(e),eb("fs-create-dir",{dir:e})),I0t=e=>dm.tryCatch(()=>hwe(e),eb("fs-write-file",e)),k0t=e=>dm.tryCatch(()=>D4(e),eb("fs-remove-empty-dirs",{dir:e})),F0t=e=>(0,C4.pipe)(dm.tryCatch(()=>P4.default.rm(e,{recursive:!0}),eb("fs-remove-dir",{dir:e}))),$0t=e=>(0,C4.pipe)(dm.tryCatch(()=>P4.default.unlink(e),eb("fs-remove-file",{filePath:e}))),L0t=e=>()=>mwe(e),N0t=(e,r="**")=>()=>gwe(e,r);function eb(e,r){return n=>({type:e,error:n,meta:r})}var I4=B(require("fs")),k4=B(Cwe());function ap(){try{let e=I4.default.realpathSync(process.argv[1]),r=e.indexOf(k4.default.yarn.packages)===0;if(e.indexOf(I4.default.realpathSync(k4.default.npm.packages))===0)return"npm";if(r)return"yarn"}catch{}return!1}function Le(e){if(ap())return e;{let r=process.env.npm_config_user_agent?.includes("yarn");return __dirname.includes("_npx")?`npx ${e}`:r?`yarn ${e}`:e}}var Kwe=B(Ju());var Gwe=B(Pwe());var j4=B(require("process"),1),Awe=B(require("os"),1),Owe=B(require("fs"),1);var Twe=B(require("fs"),1);var N4=B(require("fs"),1),L4;function W0t(){try{return N4.default.statSync("/.dockerenv"),!0}catch{return!1}}function H0t(){try{return N4.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function M4(){return L4===void 0&&(L4=W0t()||H0t()),L4}var q4,z0t=()=>{try{return Twe.default.statSync("/run/.containerenv"),!0}catch{return!1}};function SC(){return q4===void 0&&(q4=z0t()||M4()),q4}var Rwe=()=>{if(j4.default.platform!=="linux")return!1;if(Awe.default.release().toLowerCase().includes("microsoft"))return!SC();try{return Owe.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!SC():!1}catch{return!1}},Iwe=j4.default.env.__IS_WSL_TEST__?Rwe:Rwe();var Wwe=B(kwe()),Hwe=B(PC()),zwe=B(Ju()),Vwe=B(Yh());function rbt({title:e,user:r="prisma",repo:n="prisma",template:i="bug_report.yml",body:a}){return(0,Wwe.default)({user:r,repo:n,template:i,title:e,body:a})}async function Ywe(e){if(await He(e.prompt).with(!0,async()=>!!(await(0,zwe.default)({type:"select",name:"value",message:"Would you like to create a GitHub issue?",initial:0,choices:[{title:"Yes",value:!0,description:"Create a new GitHub issue"},{title:"No",value:!1,description:"Don't create a new GitHub issue"}]})).value).otherwise(()=>Promise.resolve(!0))){let n=await Hr(),i=rbt({title:e.title??"",body:nbt(n,e)}),a=(0,Gwe.default)()||Iwe;await(0,Hwe.default)(i,{wait:a})}else process.exit(130)}var nbt=(e,r)=>(0,Vwe.default)(`
|
|||
|
|
Hi Prisma Team! The following command just crashed.
|
|||
|
|
${r.reportId?`The report Id is: ${r.reportId}`:""}
|
|||
|
|
|
|||
|
|
## Command
|
|||
|
|
|
|||
|
|
\`${r.command}\`
|
|||
|
|
|
|||
|
|
## Versions
|
|||
|
|
|
|||
|
|
| Name | Version |
|
|||
|
|
|-------------|--------------------|
|
|||
|
|
| Platform | ${e.padEnd(19)}|
|
|||
|
|
| Node | ${process.version.padEnd(19)}|
|
|||
|
|
| Prisma CLI | ${r.cliVersion.padEnd(19)}|
|
|||
|
|
| Engine | ${r.enginesVersion.padEnd(19)}|
|
|||
|
|
|
|||
|
|
## Error
|
|||
|
|
\`\`\`
|
|||
|
|
${r.error}
|
|||
|
|
\`\`\`
|
|||
|
|
`);async function H4(e){if(!Pa())throw e.error;await ibt(e)}async function ibt({error:e,cliVersion:r,enginesVersion:n,command:i,getDatabaseVersionSafe:a}){let o=e.message.split(`
|
|||
|
|
`).slice(0,Math.max(20,process.stdout.rows)).join(`
|
|||
|
|
`);console.log(`${oe("Oops, an unexpected error occurred!")}
|
|||
|
|
${oe(o)}
|
|||
|
|
|
|||
|
|
${N("Please help us improve Prisma by submitting an error report.")}
|
|||
|
|
${N("Error reports never contain personal or other sensitive information.")}
|
|||
|
|
${J(`Learn more: ${ke("https://pris.ly/d/telemetry")}`)}
|
|||
|
|
`);let{value:c}=await(0,Kwe.default)({type:"select",name:"value",message:"Submit error report",initial:0,choices:[{title:"Yes",value:!0,description:"Send error report once"},{title:"No",value:!1,description:"Don't send error report"}]});if(c)try{console.log("Submitting...");let u=await Bge({error:e,cliVersion:r,enginesVersion:n,getDatabaseVersionSafe:a});console.log(`
|
|||
|
|
${N(`We successfully received the error report id: ${u}`)}`),console.log(`
|
|||
|
|
${N("Thanks a lot for your help! \u{1F64F}")}`)}catch(u){let l=`${N(oe("Oops. We could not send the error report."))}`;console.log(l),console.error(`${Sl("Error report submission failed due to: ")}`,u)}await Ywe({prompt:!c,error:e,cliVersion:r,enginesVersion:n,command:i}),process.exit(1)}var Xwe=B(ek());function z4(e){return(0,Xwe.isIdentifierName)(e)}function V4(e,r){let n={};for(let i of Object.keys(e))n[i]=r(e[i],i);return n}function bo(e,r){Object.defineProperty(e,"name",{value:r,configurable:!0})}var op=class op{constructor(r){this.cmds=r}static new(r){return new op(r)}async parse(r){let n=_e(r,{"--help":Boolean,"-h":"--help","--preview-feature":Boolean,"--telemetry-information":String});if(xe(n))return this.help(n.message);if(n._.length===0||n["--help"])return this.help();let i=this.cmds[n._[0]];if(i){let a=n["--preview-feature"]?[...n._.slice(1),"--preview-feature"]:n._.slice(1);return i.parse(a)}return gf(op.help,n._[0])}help(r){return r?new Re(`
|
|||
|
|
${N(oe("!"))} ${r}
|
|||
|
|
${op.help}`):op.help}};op.help=$e(`
|
|||
|
|
${process.platform==="win32"?"":"\u{1F3CB}\uFE0F "}Manage your database schema and lifecycle during development.
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${J("$")} prisma db [command] [options]
|
|||
|
|
|
|||
|
|
${N("Options")}
|
|||
|
|
|
|||
|
|
-h, --help Display this help message
|
|||
|
|
--schema Custom path to your Prisma schema
|
|||
|
|
|
|||
|
|
${N("Commands")}
|
|||
|
|
pull Pull the state from the database to the Prisma schema using introspection
|
|||
|
|
push Push the state from Prisma schema to the database during prototyping
|
|||
|
|
seed Seed your database
|
|||
|
|
execute Execute native commands to your database
|
|||
|
|
|
|||
|
|
${N("Examples")}
|
|||
|
|
|
|||
|
|
Run \`prisma db pull\`
|
|||
|
|
${J("$")} prisma db pull
|
|||
|
|
|
|||
|
|
Run \`prisma db push\`
|
|||
|
|
${J("$")} prisma db push
|
|||
|
|
|
|||
|
|
Run \`prisma db seed\`
|
|||
|
|
${J("$")} prisma db seed
|
|||
|
|
|
|||
|
|
Run \`prisma db execute\`
|
|||
|
|
${J("$")} prisma db execute
|
|||
|
|
`);var nb=op;var sbt=/^\.{0,2}\//;function Jwe(e){if(["postgres","postgresql","cockroachdb"].includes(e.type)){let r=e.host;return typeof r=="string"&&sbt.test(r)?r:null}return e.socket??null}async function Ai({schemaPath:e,throwIfEnvError:r}={}){let n=await Bn(e),i;try{i=await Ve({datamodel:n,ignoreEnvVarErrors:!1})}catch(u){if(r)throw u;i=await Ve({datamodel:n,ignoreEnvVarErrors:!0})}let a=i.datasources[0]?i.datasources[0]:void 0;if(!a)return{name:void 0,prettyProvider:void 0,dbName:void 0,dbLocation:void 0,url:void 0,schema:void 0,schemas:void 0,configDir:void 0};let o=Zwe(a.provider),c=jo(a).value;if(!c||a.provider==="sqlserver")return{name:a.name,prettyProvider:o,dbName:void 0,dbLocation:void 0,url:c||void 0,schema:void 0,schemas:a.schemas,configDir:Sa(i,e)};try{let u=KE(c),l=Qwe(u),f;["postgresql","cockroachdb"].includes(a.provider)&&(u.schema?f=u.schema:f="public");let p={name:a.name,prettyProvider:o,dbName:u.database,dbLocation:l,url:c,schema:f,schemas:a.schemas,configDir:Sa(i,e)};return a.provider==="postgresql"&&p.dbName===void 0&&(p.dbName="postgres"),p}catch{return{name:a.name,prettyProvider:o,dbName:void 0,dbLocation:void 0,url:c,schema:void 0,schemas:a.schemas,configDir:Sa(i,e)}}}async function ib(e){let r=await Bn(e),n=await Ve({datamodel:r,ignoreEnvVarErrors:!1}),i=n.datasources[0]?n.datasources[0]:void 0;if(!i)throw new Error("A datasource block is missing in the Prisma schema file.");let a=Sa(n,e),o=jo(i).value,c=await Cf(o,a);if(c===!0)return!0;{let{code:u,message:l}=c;throw new Error(`${u}: ${l}`)}}async function nl(e,r){let n=await Bn(r),i=await Ve({datamodel:n,ignoreEnvVarErrors:!1}),a=i.datasources[0]?i.datasources[0]:void 0;if(!a)throw new Error("A datasource block is missing in the Prisma schema file.");let o=Sa(i,r),c=jo(a).value,u=await Cf(c,o);if(u===!0)return;let{code:l,message:f}=u;if(l!=="P1003")throw new Error(`${l}: ${f}`);if(!o)throw new Error(`Could not locate ${r||"schema.prisma"}`);if(await n3(c,o)){if(a.provider==="sqlserver")return`SQL Server database created.
|
|||
|
|
`;let p=KE(c),v=`${Zwe(a.provider)} database${p.database?` ${p.database} `:" "}created`,x=Qwe(p);return x&&(v+=` at ${N(x)}`),v}}function Qwe(e){if(e.type==="sqlite")return e.uri;let r=Jwe(e);if(r)return`unix:${r}`;if(e.host&&e.port)return`${e.host}:${e.port}`;if(e.host)return`${e.host}`}function Zwe(e){switch(e){case"mysql":return"MySQL";case"postgres":case"postgresql":return"PostgreSQL";case"sqlite":return"SQLite";case"cockroachdb":return"CockroachDB";case"sqlserver":return"SQL Server";case"mongodb":return"MongoDB"}}var sb=class extends Error{constructor(){super(`Could not find a ${N("schema.prisma")} file that is required for this command.
|
|||
|
|
You can either provide it with ${te("--schema")}, set it as \`prisma.schema\` in your package.json or put it into the default location ${te("./prisma/schema.prisma")} ${ke("https://pris.ly/d/prisma-schema-location")}`)}};bo(sb,"NoSchemaFoundError");var ab=class extends Error{constructor(){super(`Use the --accept-data-loss flag to ignore the data loss warnings like ${N(te(Le("prisma db push --accept-data-loss")))}`)}};bo(ab,"DbPushIgnoreWarningsWithFlagError");var Y4=class extends Error{constructor(r){super(`Use the --force flag to use the ${r} command in an unattended environment like ${N(te(Le(`prisma migrate ${r} --force`)))}`)}};bo(Y4,"MigrateNeedsForceError");var ob=class extends Error{constructor(){super(`Prisma Migrate has detected that the environment is non-interactive. It is recommended to run this command in an interactive environment.
|
|||
|
|
|
|||
|
|
Use ${N(te("--force"))} to run this command without user interaction.
|
|||
|
|
See ${ke("https://www.prisma.io/docs/reference/api-reference/command-reference#migrate-reset")}`)}};bo(ob,"MigrateResetEnvNonInteractiveError");var mm=class extends Error{constructor(){super(`Prisma Migrate has detected that the environment is non-interactive, which is not supported.
|
|||
|
|
|
|||
|
|
\`prisma migrate dev\` is an interactive command designed to create new migrations and evolve the database in development.
|
|||
|
|
To apply existing migrations in deployments, use ${N(te("prisma migrate deploy"))}.
|
|||
|
|
See ${ke("https://www.prisma.io/docs/reference/api-reference/command-reference#migrate-deploy")}`)}};bo(mm,"MigrateDevEnvNonInteractiveError");var K4=class extends Error{constructor(r){super(`Use the --force flag to use the ${r} command in an unattended environment like ${N(te(Le(`prisma db ${r} --force --preview-feature`)))}`)}};bo(K4,"DbDropNeedsForceError");var e1e=B(require("path"));async function Zr(e,r){let n=await pt(e,r);return TC(n.schemaPath),n}function TC(e){process.stdout.write(J(`Prisma schema loaded from ${e1e.default.relative(process.cwd(),e)}`)+`
|
|||
|
|
`)}function Oi({datasourceInfo:e}){if(!e.name||!e.prettyProvider)return;let r=`Datasource "${e.name}": ${e.prettyProvider} database`;e.dbName&&(r+=` "${e.dbName}"`),e.schemas?.length?r+=`, schemas "${e.schemas.join(", ")}"`:e.schema&&(r+=`, schema "${e.schema}"`),e.dbLocation&&(r+=` at "${e.dbLocation}"`),process.stdout.write(J(r)+`
|
|||
|
|
`)}var S1e=B(require("fs")),D1e=B(t1e());var C1e=B(require("path"));var _1e=B(n1e());var NC=B(t6()),MC=B(require("path"));var x1e=B(require("path"));var w1e=require("child_process");var FC=B(require("stream")),g1e=B(require("util"));function $C(e,r){return _bt(e,r)}function _bt(e,r){return e?Ebt(e,r):new cp(r)}function Ebt(e,r){if(!e)throw new Error("expected readStream");if(!e.readable)throw new Error("readStream must be readable");let n=new cp(r);return e.pipe(n),n}function cp(e){FC.default.Transform.call(this,e),e=e||{},this._readableState.objectMode=!0,this._lineBuffer=[],this._keepEmptyLines=e.keepEmptyLines||!1,this._lastChunkEndedWithCR=!1,this.on("pipe",function(r){this.encoding||r instanceof FC.default.Readable&&(this.encoding=r._readableState.encoding)})}g1e.default.inherits(cp,FC.default.Transform);cp.prototype._transform=function(e,r,n){r=r||"utf8",Buffer.isBuffer(e)&&(r=="buffer"?(e=e.toString(),r="utf8"):e=e.toString(r)),this._chunkEncoding=r;let i=e.split(/\r\n|\r|\n/g);this._lastChunkEndedWithCR&&e[0]==`
|
|||
|
|
`&&i.shift(),this._lineBuffer.length>0&&(this._lineBuffer[this._lineBuffer.length-1]+=i[0],i.shift()),this._lastChunkEndedWithCR=e[e.length-1]=="\r",this._lineBuffer=this._lineBuffer.concat(i),this._pushBuffer(r,1,n)};cp.prototype._pushBuffer=function(e,r,n){for(;this._lineBuffer.length>r;){let i=this._lineBuffer.shift();if((this._keepEmptyLines||i.length>0)&&!this.push(this._reencode(i,e))){let a=this;setImmediate(function(){a._pushBuffer(e,r,n)});return}}n()};cp.prototype._flush=function(e){this._pushBuffer(this._chunkEncoding,0,e)};cp.prototype._reencode=function(e,r){return this.encoding&&this.encoding!=r?Buffer.from(e,r).toString(this.encoding):this.encoding?e:Buffer.from(e,r)};var r6=B(yC()),n6=B(Nt()),y1e=B(x4()),il=B(E4()),lb=B(require("path"));async function b1e({views:e,schemaPath:r}){let n=lb.default.dirname(dh(r)),i=lb.default.posix.join(n,"views");if(e.length===0){await v1e(i);return}let{viewFilesToKeep:a}=await Sbt(i,e);await v1e(i,a)}async function Sbt(e,r){let n=r.map(({schema:f,...p})=>[lb.default.posix.join(e,f),p]),i=n.map(([f])=>f),a=n.map(([f,{name:p,definition:g}])=>({path:lb.default.posix.join(f,`${p}.sql`),content:g})),o=a.map(({path:f})=>f),u=await(0,n6.pipe)(xc.createDirIfNotExists(e),il.chainW(()=>il.traverseArray(xc.createDirIfNotExists)(i)),il.chainW(()=>il.traverseArray(xc.writeFile)(a)))();if(r6.isRight(u))return{viewFilesToKeep:o};throw He(u.left).with({type:"fs-create-dir"},f=>{throw new Error(`Error creating the directory: ${f.meta.dir}.
|
|||
|
|
${f.error}.`)}).with({type:"fs-write-file"},f=>{throw new Error(`Error writing the view definition
|
|||
|
|
${f.meta.content}
|
|||
|
|
to file ${f.meta.path}.
|
|||
|
|
${f.error}.`)}).exhaustive()}async function v1e(e,r=[]){let n=(0,n6.pipe)(xc.getFilesInDir(e,"**/*/*.sql"),y1e.chain(o=>{let c=o.filter(u=>!r.includes(u));return il.traverseArray(xc.removeFile)(c)}),il.chainW(()=>xc.removeEmptyDirs(e))),i=await n();if(r6.isRight(i))return;let a=He(i.left).with({type:"fs-remove-empty-dirs"},o=>{throw new Error(`Error removing empty directories in: ${o.meta.dir}.
|
|||
|
|
${o.error}.`)}).with({type:"fs-remove-file"},o=>{throw new Error(`Error removing the file: ${o.meta.filePath}.
|
|||
|
|
${o.error}.`)}).exhaustive();throw await n(),a}var i6=me("prisma:schemaEngine:rpc"),Dbt=me("prisma:schemaEngine:stderr"),Cbt=me("prisma:schemaEngine:stdin"),LC=class extends Error{constructor(r,n){super(r),this.code=n}};bo(LC,"EngineError");var Pbt=1,Ia=class{constructor({debug:r=!1,schemaPath:n,enabledPreviewFeatures:i}){this.listeners={};this.messages=[];this.lastError=null;this.isRunning=!1;this.schemaPath=n,r&&me.enable("SchemaEngine*"),this.debug=r,this.enabledPreviewFeatures=i}applyMigrations(r){return this.runCommand(this.getRPCPayload("applyMigrations",r))}createDatabase(r){return this.runCommand(this.getRPCPayload("createDatabase",r))}createMigration(r){return this.runCommand(this.getRPCPayload("createMigration",r))}dbExecute(r){return this.runCommand(this.getRPCPayload("dbExecute",r))}debugPanic(){return this.runCommand(this.getRPCPayload("debugPanic",void 0))}devDiagnostic(r){return this.runCommand(this.getRPCPayload("devDiagnostic",r))}diagnoseMigrationHistory(r){return this.runCommand(this.getRPCPayload("diagnoseMigrationHistory",r))}ensureConnectionValidity(r){return this.runCommand(this.getRPCPayload("ensureConnectionValidity",r))}evaluateDataLoss(r){return this.runCommand(this.getRPCPayload("evaluateDataLoss",r))}getDatabaseDescription(r){return this.runCommand(this.getRPCPayload("getDatabaseDescription",{schema:r}))}getDatabaseVersion(r){return this.runCommand(this.getRPCPayload("getDatabaseVersion",r))}async introspect({schema:r,force:n=!1,baseDirectoryPath:i,compositeTypeDepth:a=-1,namespaces:o}){this.latestSchema=r;try{let c=await this.runCommand(this.getRPCPayload("introspect",{schema:r,force:n,compositeTypeDepth:a,namespaces:o,baseDirectoryPath:i})),{views:u}=c;if(u){let l=this.schemaPath??x1e.default.join(process.cwd(),"prisma");await b1e({views:u,schemaPath:l})}return c}finally{this.stop()}}migrateDiff(r){return this.runCommand(this.getRPCPayload("diff",r))}listMigrationDirectories(r){return this.runCommand(this.getRPCPayload("listMigrationDirectories",r))}markMigrationApplied(r){return this.runCommand(this.getRPCPayload("markMigrationApplied",r))}markMigrationRolledBack(r){return this.runCommand(this.getRPCPayload("markMigrationRolledBack",r))}reset(){return this.runCommand(this.getRPCPayload("reset",void 0))}schemaPush(r){return this.runCommand(this.getRPCPayload("schemaPush",r))}introspectSql(r){return this.runCommand(this.getRPCPayload("introspectSql",r))}stop(){this.child&&(this.child.kill(),this.isRunning=!1)}rejectAll(r){Object.entries(this.listeners).map(([n,i])=>{i(null,r),delete this.listeners[n]})}registerCallback(r,n){this.listeners[r]=n}handleResponse(r){let n;try{n=JSON.parse(r)}catch{console.error(`Could not parse Schema engine response: ${r.slice(0,200)}`)}if(n){if(n.id&&(n.result!==void 0||n.error!==void 0))this.listeners[n.id]||console.error(`Got result for unknown id ${n.id}`),this.listeners[n.id]&&(this.listeners[n.id](n),delete this.listeners[n.id]);else if(n.method&&n.id!==void 0&&n.method==="print"&&n.params?.content!==void 0){process.stdout.write(n.params.content+`
|
|||
|
|
`);let i={id:n.id,jsonrpc:"2.0",result:{}};this.child.stdin.write(JSON.stringify(i)+`
|
|||
|
|
`)}}}init(){return this.initPromise||(this.initPromise=this.internalInit()),this.initPromise}internalInit(){return new Promise(async(r,n)=>{try{let{PWD:i,...a}=process.env,o=await wu("schema-engine");i6("starting Schema engine with binary: "+o);let c=[],u=process.cwd();if(this.schemaPath){let l=await Bn(this.schemaPath),f=await Ve({datamodel:l});u=Sa(f,this.schemaPath);let p=l.flatMap(([g])=>["-d",g]);c.push(...p)}this.enabledPreviewFeatures&&Array.isArray(this.enabledPreviewFeatures)&&this.enabledPreviewFeatures.length>0&&c.push("--enabled-preview-features",this.enabledPreviewFeatures.join(",")),this.child=(0,w1e.spawn)(o,c,{cwd:u,stdio:["pipe","pipe",this.debug?process.stderr:"pipe"],env:{RUST_LOG:"info",RUST_BACKTRACE:"1",...a}}),this.isRunning=!0,this.child.on("error",l=>{console.error("[schema-engine] error: %s",l),this.rejectAll(l),n(l)}),this.child.on("exit",l=>{let f=x=>{this.rejectAll(x),n(x)},p=this.messages.join(`
|
|||
|
|
`),g=this.lastError?.message||p,v=()=>{let x=`[EXIT_PANIC]
|
|||
|
|
${p}
|
|||
|
|
${this.lastError?.backtrace??""}`;f(new sn(Tbt(g),x,this.lastRequest,"LIFT_CLI",this.schemaPath,this.latestSchema?.files.map(E=>[E.path,E.content])))};switch(l){case 0:break;case 1:f(new Error(`Error in Schema engine: ${g}`));break;case 101:v();break;default:v()}}),this.child.stdin.on("error",l=>{Cbt(l)}),$C(this.child.stderr).on("data",l=>{let f=String(l);Dbt(f);try{let p=JSON.parse(f);this.messages.push(p.fields.message),p.level==="ERROR"&&(this.lastError=p.fields)}catch{}}),$C(this.child.stdout).on("data",l=>{this.handleResponse(String(l))}),setImmediate(()=>{r()})}catch(i){n(i)}})}async runCommand(r){if(process.env.FORCE_PANIC_SCHEMA_ENGINE&&r.method!=="getDatabaseVersion"&&(r=this.getRPCPayload("debugPanic",void 0)),await this.init(),this.child?.killed)throw new Error(`Can't execute ${JSON.stringify(r)} because Schema engine already exited.`);return new Promise((n,i)=>{if(this.registerCallback(r.id,(a,o)=>{if(o)return i(o);if(a.result!==void 0)n(a.result);else if(a.error)if(i6(a),a.error.data?.is_panic){let c=a.error.data?.error?.message??a.error.message,u=`[RESPONSE_ERROR_PANIC]
|
|||
|
|
${a.error.data?.message??""}`;i(new sn(c,u,this.lastRequest,"LIFT_CLI",this.schemaPath,this.latestSchema?.files.map(l=>[l.path,l.content])))}else if(a.error.data?.message){let c=`${oe(Wi(a.error.data.message))}
|
|||
|
|
`;a.error.data?.error_code?(c=oe(`${a.error.data.error_code}
|
|||
|
|
|
|||
|
|
`)+c,i(new LC(c,a.error.data.error_code))):i(new Error(c))}else i(new Error(`${oe("Error in RPC")}
|
|||
|
|
Request: ${JSON.stringify(r,null,2)}
|
|||
|
|
Response: ${JSON.stringify(a,null,2)}
|
|||
|
|
${a.error.message}
|
|||
|
|
`));else i(new Error(`Got invalid RPC response without .result property: ${JSON.stringify(a)}`))}),this.child.stdin.destroyed)throw new Error(`Can't execute ${JSON.stringify(r)} because Schema engine is destroyed.`);i6("SENDING RPC CALL",JSON.stringify(r)),this.child.stdin.write(JSON.stringify(r)+`
|
|||
|
|
`),this.lastRequest=r})}getRPCPayload(r,n){return{id:Pbt++,jsonrpc:"2.0",method:r,params:n?{...n}:void 0}}};function Tbt(e){return`${oe(N(`Error in Schema engine.
|
|||
|
|
Reason: `))}${e}
|
|||
|
|
`}var Rbt=eval("require('../package.json')"),en=class{constructor(r,n){r?(this.schemaPath=MC.default.resolve(process.cwd(),r),this.migrationsDirectoryPath=MC.default.join(MC.default.dirname(this.schemaPath),"migrations"),this.engine=new Ia({schemaPath:this.schemaPath,enabledPreviewFeatures:n})):this.engine=new Ia({enabledPreviewFeatures:n})}stop(){this.engine.stop()}getPrismaSchema(){if(!this.schemaPath)throw new Error("this.schemaPath is undefined");return pt(this.schemaPath)}reset(){return this.engine.reset()}createMigration(r){return this.engine.createMigration(r)}diagnoseMigrationHistory({optInToShadowDatabase:r}){if(!this.migrationsDirectoryPath)throw new Error("this.migrationsDirectoryPath is undefined");return this.engine.diagnoseMigrationHistory({migrationsDirectoryPath:this.migrationsDirectoryPath,optInToShadowDatabase:r})}listMigrationDirectories(){if(!this.migrationsDirectoryPath)throw new Error("this.migrationsDirectoryPath is undefined");return this.engine.listMigrationDirectories({migrationsDirectoryPath:this.migrationsDirectoryPath})}devDiagnostic(){if(!this.migrationsDirectoryPath)throw new Error("this.migrationsDirectoryPath is undefined");return this.engine.devDiagnostic({migrationsDirectoryPath:this.migrationsDirectoryPath})}async markMigrationApplied({migrationId:r}){if(!this.migrationsDirectoryPath)throw new Error("this.migrationsDirectoryPath is undefined");return await this.engine.markMigrationApplied({migrationsDirectoryPath:this.migrationsDirectoryPath,migrationName:r})}markMigrationRolledBack({migrationId:r}){return this.engine.markMigrationRolledBack({migrationName:r})}applyMigrations(){if(!this.migrationsDirectoryPath)throw new Error("this.migrationsDirectoryPath is undefined");return this.engine.applyMigrations({migrationsDirectoryPath:this.migrationsDirectoryPath})}async evaluateDataLoss(){if(!this.migrationsDirectoryPath)throw new Error("this.migrationsDirectoryPath is undefined");let r=as((await this.getPrismaSchema()).schemas);return this.engine.evaluateDataLoss({migrationsDirectoryPath:this.migrationsDirectoryPath,schema:r})}async push({force:r=!1}){let n=as((await this.getPrismaSchema()).schemas),{warnings:i,unexecutable:a,executedSteps:o}=await this.engine.schemaPush({force:r,schema:n});return{executedSteps:o,warnings:i,unexecutable:a}}async tryToRunGenerate(){if(!this.schemaPath)throw new Error("this.schemaPath is undefined");let r=[];process.stdout.write(`
|
|||
|
|
`),(0,NC.default)(`Running generate... ${J("(Use --skip-generate to skip the generators)")}`);let n=await tc({schemaPath:this.schemaPath,printDownloadProgress:!0,version:_1e.enginesVersion,cliVersion:Rbt.version});for(let i of n){(0,NC.default)(`Running generate... - ${i.getPrettyName()}`);let a=Math.round(performance.now());try{await i.generate();let o=Math.round(performance.now());r.push(sy(i,o-a)),i.stop()}catch(o){r.push(`${o.message}`),i.stop()}}(0,NC.default)(r.join(`
|
|||
|
|
`))}};var E1e=$e(`${N("Usage")}
|
|||
|
|
|
|||
|
|
${J("$")} prisma db execute [options]
|
|||
|
|
|
|||
|
|
${N("Options")}
|
|||
|
|
|
|||
|
|
-h, --help Display this help message
|
|||
|
|
|
|||
|
|
${hs("Datasource input, only 1 must be provided:")}
|
|||
|
|
--url URL of the datasource to run the command on
|
|||
|
|
--schema Path to your Prisma schema file to take the datasource URL from
|
|||
|
|
|
|||
|
|
${hs("Script input, only 1 must be provided:")}
|
|||
|
|
--file Path to a file. The content will be sent as the script to be executed
|
|||
|
|
|
|||
|
|
${N("Flags")}
|
|||
|
|
|
|||
|
|
--stdin Use the terminal standard input as the script to be executed`),fb=class fb{static new(){return new fb}async parse(r){let n=_e(r,{"--help":Boolean,"-h":"--help","--stdin":Boolean,"--file":String,"--schema":String,"--url":String,"--telemetry-information":String},!1);if(xe(n))return this.help(n.message);if(await Rr("db execute",n,!n["--url"]),n["--help"])return this.help();if(await at({schemaPath:n["--schema"],printMessage:!1}),n["--stdin"]&&n["--file"])throw new Error(`--stdin and --file cannot be used at the same time. Only 1 must be provided.
|
|||
|
|
See \`${te(Le("prisma db execute -h"))}\``);if(!n["--stdin"]&&!n["--file"])throw new Error(`Either --stdin or --file must be provided.
|
|||
|
|
See \`${te(Le("prisma db execute -h"))}\``);if(n["--url"]&&n["--schema"])throw new Error(`--url and --schema cannot be used at the same time. Only 1 must be provided.
|
|||
|
|
See \`${te(Le("prisma db execute -h"))}\``);if(!n["--url"]&&!n["--schema"])throw new Error(`Either --url or --schema must be provided.
|
|||
|
|
See \`${te(Le("prisma db execute -h"))}\``);let i="";if(n["--file"])try{i=S1e.default.readFileSync(C1e.default.resolve(n["--file"]),"utf-8")}catch(c){throw c.code==="ENOENT"?new Error(`Provided --file at ${n["--file"]} doesn't exist.`):(console.error(`An error occurred while reading the provided --file at ${n["--file"]}`),c)}n["--stdin"]&&(i=await(0,D1e.default)());let a;if(n["--url"])a={tag:"url",url:n["--url"]};else{let c=await pt(n["--schema"]),u=await Ve({datamodel:c.schemas});a={tag:"schema",...Jh(c,u)}}let o=new en;try{await o.engine.dbExecute({script:i,datasourceType:a})}finally{o.stop()}return"Script executed successfully."}help(r){if(r)throw new Re(`
|
|||
|
|
${r}
|
|||
|
|
|
|||
|
|
${E1e}`);return fb.help}};fb.help=$e(`
|
|||
|
|
${process.platform==="win32"?"":"\u{1F4DD} "}Execute native commands to your database
|
|||
|
|
|
|||
|
|
This command takes as input a datasource, using ${te("--url")} or ${te("--schema")} and a script, using ${te("--stdin")} or ${te("--file")}.
|
|||
|
|
The input parameters are mutually exclusive, only 1 of each (datasource & script) must be provided.
|
|||
|
|
|
|||
|
|
The output of the command is connector-specific, and is not meant for returning data, but only to report success or failure.
|
|||
|
|
|
|||
|
|
On SQL databases, this command takes as input a SQL script.
|
|||
|
|
The whole script will be sent as a single command to the database.
|
|||
|
|
|
|||
|
|
${hs("This command is currently not supported on MongoDB.")}
|
|||
|
|
|
|||
|
|
${E1e}
|
|||
|
|
${N("Examples")}
|
|||
|
|
|
|||
|
|
Execute the content of a SQL script file to the datasource URL taken from the schema
|
|||
|
|
${J("$")} prisma db execute
|
|||
|
|
--file ./script.sql \\
|
|||
|
|
--schema schema.prisma
|
|||
|
|
|
|||
|
|
Execute the SQL script from stdin to the datasource URL specified via the \`DATABASE_URL\` environment variable
|
|||
|
|
${J("$")} echo 'TRUNCATE TABLE dev;' | \\
|
|||
|
|
prisma db execute \\
|
|||
|
|
--stdin \\
|
|||
|
|
--url="$DATABASE_URL"
|
|||
|
|
|
|||
|
|
Like previous example, but exposing the datasource url credentials to your terminal history
|
|||
|
|
${J("$")} echo 'TRUNCATE TABLE dev;' | \\
|
|||
|
|
prisma db execute \\
|
|||
|
|
--stdin \\
|
|||
|
|
--url="mysql://root:root@localhost/mydb"
|
|||
|
|
`);var pb=fb;var up=B(require("path"));function P1e(e){let r=0,n=0;for(let i of e.files)r+=(i.content.match(/^model\s+/gm)||[]).length,n+=(i.content.match(/^type\s+/gm)||[]).length;return{modelsCount:r,typesCount:n}}function T1e(e){return e?e.files.every(r=>r.content.trim()===""):!0}var R1e=B(fv());function A1e(e){return e.map(r=>String(new s6(r))).join(`
|
|||
|
|
|
|||
|
|
`)}var Abt=2,s6=class{constructor(r){this.dataSource=r}toString(){let{dataSource:r}=this,n={provider:r.provider,url:r.url};return r.config&&typeof r.config=="object"&&Object.assign(n,r.config),`datasource ${r.name} {
|
|||
|
|
${(0,R1e.default)(Obt(n),Abt)}
|
|||
|
|
}`}};function Obt(e){let r=Object.keys(e).reduce((n,i)=>Math.max(n,i.length),0);return Object.entries(e).map(([n,i])=>`${n.padEnd(r)} = ${typeof i=="object"&&i&&i.value?JSON.stringify(i.value):JSON.stringify(i)}`).join(`
|
|||
|
|
`)}var O1e=B(require("path"));function I1e(e,r){if(e.files.length===1){r.write(e.files[0].content+`
|
|||
|
|
`);return}let n=e.files.sort((i,a)=>i.path.localeCompare(a.path));for(let i of n){let a=O1e.default.relative(process.cwd(),i.path);r.write(`// ${a}
|
|||
|
|
${i.content}
|
|||
|
|
`)}}var k1e=B(require("fs/promises"));async function F1e(e){await Promise.all(e.map(([r])=>k1e.default.rm(r)))}function $1e(e,r){let n=!1,i=r.map(([a,o])=>{let c=kbt(e,o);return c.replaced&&(n=!0),[a,c.content]});return n||Ibt(e,i),i}function Ibt(e,r){let n=r[0];bN(n,"There always should be at least on file in the schema"),n[1]=`${e}
|
|||
|
|
${n[1]}`}function kbt(e,r){let n=r.split(/\r\n|\r|\n/g),i=Fbt(n);if(!i)return{replaced:!1,content:r};n.splice(i.startLine,i.endLine-i.startLine+1);let a=n.join(`
|
|||
|
|
`).trim();return{replaced:!0,content:`${e}
|
|||
|
|
|
|||
|
|
${a}`}}function Fbt(e){if(e.length<=2)return;let r=e.findIndex(i=>{let a=i.trim();return a.startsWith("datasource")&&a.endsWith("{")});if(r===-1)return;let n=-1;for(let i=r;i<e.length;i++){let a=e[i].trim();if(a.endsWith("}")&&!a.startsWith("//")){n=i;break}}if(n!==-1)return{startLine:r,endLine:n}}var L1e=B(require("fs/promises"));async function N1e(e){await Promise.all(e.files.map(r=>L1e.default.writeFile(r.path,r.content,"utf8")))}var w_e=B(x_e()),fxt={spinner:"dots",color:"cyan",indent:0,stream:process.stdout};function __e(e=!0,r={}){let n={...fxt,...r};return i=>{if(!e)return{success:()=>{},failure:()=>{}};n.stream?.write(`
|
|||
|
|
`);let a=(0,w_e.default)(n);return a.start(i),{success:o=>{a.succeed(o)},failure:o=>{a.fail(o)}}}}var E_e=me("prisma:db:pull"),ym=class ym{static new(){return new ym}urlToDatasource(r,n){let i=n||eo(`${r.split(":")[0]}:`);return A1e([{config:{},provider:i,name:"db",url:r}])}async parse(r){let n=_e(r,{"--help":Boolean,"-h":"--help","--url":String,"--print":Boolean,"--schema":String,"--schemas":String,"--force":Boolean,"--composite-type-depth":Number,"--local-d1":Boolean}),i=__e(!n["--print"]);if(n instanceof Error)return this.help(n.message);if(await Rr("db pull",n,!n["--url"]),n["--help"])return this.help();let a=n["--url"],o=await ry(n["--schema"]),c=o?.schemaPath??null,u=o?.schemaRootDir??process.cwd();E_e("schemaPathResult",o),c&&!n["--print"]?(process.stdout.write(J(`Prisma schema loaded from ${up.default.relative(process.cwd(),c)}`)+`
|
|||
|
|
`),await at({schemaPath:n["--schema"],printMessage:!0}),Oi({datasourceInfo:await Ai({schemaPath:c})})):await at({schemaPath:n["--schema"],printMessage:!1});let l=!!n["--local-d1"];if(!a&&!c&&!l)throw new sb;let{firstDatasource:f,schema:p,validationWarning:g}=await He({url:a,schemaPath:c,fromD1:l}).when(F=>F.schemaPath!==null,async F=>{let L=await Bn(F.schemaPath),U=await Ve({datamodel:L,ignoreEnvVarErrors:!0}),V=U.generators.find(({name:W})=>W==="client")?.previewFeatures,j=U.datasources[0]?U.datasources[0]:void 0;if(F.url){let W=j?.provider;W==="postgres"&&(W="postgresql");let q=eo(`${F.url.split(":")[0]}:`),X=$1e(this.urlToDatasource(F.url,W),L);if(W&&q&&W!==q&&!(W==="cockroachdb"&&q==="postgresql"))throw new Error(`The database provider found in --url (${q}) is different from the provider found in the Prisma schema (${W}).`);return{firstDatasource:j,schema:X,validationWarning:void 0}}else if(F.fromD1){let W=await Xf({arg:"--from-local-d1"}),q=up.default.relative(up.default.dirname(F.schemaPath),W),X=[["schema.prisma",this.urlToDatasource(`file:${q}`,"sqlite")]],Q={firstDatasource:(await Ve({datamodel:X,ignoreEnvVarErrors:!0})).datasources[0],schema:X,validationWarning:void 0},ee=(V||[]).includes("driverAdapters"),ce=`Without the ${N("driverAdapters")} preview feature, the schema introspected via the ${N("--local-d1")} flag will not work with ${N("@prisma/client")}.`;return ee?Q:{...Q,validationWarning:ce}}else await Ve({datamodel:L,ignoreEnvVarErrors:!1});return{firstDatasource:j,schema:L,validationWarning:void 0}}).when(F=>F.fromD1===!0,async F=>{let L=await Xf({arg:"--from-local-d1"}),U=up.default.relative(process.cwd(),L),j=[["schema.prisma",`generator client {
|
|||
|
|
provider = "prisma-client-js"
|
|||
|
|
previewFeatures = ["driverAdapters"]
|
|||
|
|
}
|
|||
|
|
${this.urlToDatasource(`file:${U}`,"sqlite")}`]];return{firstDatasource:(await Ve({datamodel:j,ignoreEnvVarErrors:!0})).datasources[0],schema:j,validationWarning:void 0}}).when(F=>F.url!==void 0,async F=>{eo(`${F.url.split(":")[0]}:`);let L=[["schema.prisma",this.urlToDatasource(F.url)]];return{firstDatasource:(await Ve({datamodel:L,ignoreEnvVarErrors:!0})).datasources[0],schema:L,validationWarning:void 0}}).run();if(c){let F=await Bn(n["--schema"]),L=/\s*model\s*(\w+)\s*{/;if(F.some(([V,j])=>!!L.exec(j))&&!n["--force"]&&f?.provider==="mongodb")throw new Error(`Iterating on one schema using re-introspection with db pull is currently not supported with MongoDB provider.
|
|||
|
|
You can explicitly ignore and override your current local schema file with ${te(Le("prisma db pull --force"))}
|
|||
|
|
Some information will be lost (relations, comments, mapped fields, @ignore...), follow ${ke("https://github.com/prisma/prisma/issues/9585")} for more info.`)}let v=new Ia({schemaPath:c??void 0}),x=!n["--url"]&&c?` based on datasource defined in ${tt(up.default.relative(process.cwd(),c))}`:"",E=i(`Introspecting${x}`),D=Math.round(performance.now()),P,R;try{let F=await v.introspect({schema:as(p),baseDirectoryPath:u,force:n["--force"],compositeTypeDepth:n["--composite-type-depth"],namespaces:n["--schemas"]?.split(",")});P=F.schema,R=F.warnings,E_e("Introspection warnings",R)}catch(F){if(E.failure(),F.code==="P4001"&&T1e(P))throw new Error(`
|
|||
|
|
${oe(N(`${F.code} `))}${oe("The introspected database was empty:")}
|
|||
|
|
|
|||
|
|
${N("prisma db pull")} could not create any models in your ${N("schema.prisma")} file and you will not be able to generate Prisma Client with the ${N(Le("prisma generate"))} command.
|
|||
|
|
|
|||
|
|
${N("To fix this, you have two options:")}
|
|||
|
|
|
|||
|
|
- manually create a table in your database.
|
|||
|
|
- make sure the database connection URL inside the ${N("datasource")} block in ${N("schema.prisma")} points to a database that is not empty (it must contain at least one table).
|
|||
|
|
|
|||
|
|
Then you can run ${te(Le("prisma db pull"))} again.
|
|||
|
|
`);if(F.code==="P1003")throw new Error(`
|
|||
|
|
${oe(N(`${F.code} `))}${oe("The introspected database does not exist:")}
|
|||
|
|
|
|||
|
|
${N("prisma db pull")} could not create any models in your ${N("schema.prisma")} file and you will not be able to generate Prisma Client with the ${N(Le("prisma generate"))} command.
|
|||
|
|
|
|||
|
|
${N("To fix this, you have two options:")}
|
|||
|
|
|
|||
|
|
- manually create a database.
|
|||
|
|
- make sure the database connection URL inside the ${N("datasource")} block in ${N("schema.prisma")} points to an existing database.
|
|||
|
|
|
|||
|
|
Then you can run ${te(Le("prisma db pull"))} again.
|
|||
|
|
`);if(F.code==="P1012"){process.stdout.write(`
|
|||
|
|
`);let L=Wi(F.message);throw new Error(`${oe(L)}
|
|||
|
|
Introspection failed as your current Prisma schema file is invalid
|
|||
|
|
|
|||
|
|
Please fix your current schema manually (using either ${te(Le("prisma validate"))} or the Prisma VS Code extension to understand what's broken and confirm you fixed it), and then run this command again.
|
|||
|
|
Or run this command with the ${te("--force")} flag to ignore your current schema and overwrite it. All local modifications will be lost.
|
|||
|
|
`)}throw process.stdout.write(`
|
|||
|
|
`),F}let k=this.getWarningMessage(R);if(n["--print"])I1e(P,process.stdout),k.trim().length>0&&console.error(k.replace(/(\n)/gm,`
|
|||
|
|
// `));else{c=c||"schema.prisma",n["--force"]&&await F1e(p),await N1e(P);let{modelsCount:F,typesCount:L}=P1e(P),U=`${F} ${F>1?"models":"model"}`,V=`${L} ${L>1?"embedded documents":"embedded document"}`,j;L>0?j=`${U} and ${V}`:j=`${U}`;let W=F+L>1?`${j} and wrote them`:`${j} and wrote it`,q=g?`
|
|||
|
|
${ze(g)}`:"";E.success(`Introspected ${W} into ${tt(up.default.relative(process.cwd(),c))} in ${N(Ko(Math.round(performance.now())-D))}
|
|||
|
|
${ze(k)}
|
|||
|
|
${`Run ${te(Le("prisma generate"))} to generate Prisma Client.`}${q}`)}return""}getWarningMessage(r){return r?`
|
|||
|
|
${r}`:""}help(r){return r?new Re(`
|
|||
|
|
${N(oe("!"))} ${r}
|
|||
|
|
${ym.help}`):ym.help}};ym.help=$e(`
|
|||
|
|
Pull the state from the database to the Prisma schema using introspection
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${J("$")} prisma db pull [flags/options]
|
|||
|
|
|
|||
|
|
${N("Flags")}
|
|||
|
|
|
|||
|
|
-h, --help Display this help message
|
|||
|
|
--force Ignore current Prisma schema file
|
|||
|
|
--print Print the introspected Prisma schema to stdout
|
|||
|
|
|
|||
|
|
${N("Options")}
|
|||
|
|
|
|||
|
|
--schema Custom path to your Prisma schema
|
|||
|
|
--composite-type-depth Specify the depth for introspecting composite types (e.g. Embedded Documents in MongoDB)
|
|||
|
|
Number, default is -1 for infinite depth, 0 = off
|
|||
|
|
--schemas Specify the database schemas to introspect. This overrides the schemas defined in the datasource block of your Prisma schema.
|
|||
|
|
--local-d1 Generate a Prisma schema from a local Cloudflare D1 database
|
|||
|
|
${N("Examples")}
|
|||
|
|
|
|||
|
|
With an existing Prisma schema
|
|||
|
|
${J("$")} prisma db pull
|
|||
|
|
|
|||
|
|
Or specify a Prisma schema path
|
|||
|
|
${J("$")} prisma db pull --schema=./schema.prisma
|
|||
|
|
|
|||
|
|
Instead of saving the result to the filesystem, you can also print it to stdout
|
|||
|
|
${J("$")} prisma db pull --print
|
|||
|
|
|
|||
|
|
Overwrite the current schema with the introspected schema instead of enriching it
|
|||
|
|
${J("$")} prisma db pull --force
|
|||
|
|
|
|||
|
|
Set composite types introspection depth to 2 levels
|
|||
|
|
${J("$")} prisma db pull --composite-type-depth=2
|
|||
|
|
|
|||
|
|
`);var bm=ym;var b6=B(Ju());var xm=class xm{static new(){return new xm}async parse(r){let n=_e(r,{"--help":Boolean,"-h":"--help","--accept-data-loss":Boolean,"--force-reset":Boolean,"--skip-generate":Boolean,"--schema":String,"--telemetry-information":String},!1);if(xe(n))return this.help(n.message);if(await Rr("db push",n,!0),n["--help"])return this.help();await at({schemaPath:n["--schema"],printMessage:!0});let{schemaPath:i}=await Zr(n["--schema"]),a=await Ai({schemaPath:i});Oi({datasourceInfo:a});let o=new en(i);try{let f=await nl("push",i);f&&process.stdout.write(`
|
|||
|
|
`+f+`
|
|||
|
|
`)}catch(f){throw process.stdout.write(`
|
|||
|
|
`),f}let c=!1;if(n["--force-reset"]){process.stdout.write(`
|
|||
|
|
`);try{await o.reset()}catch(g){throw o.stop(),g}let f=`The ${a.prettyProvider} database`;a.dbName&&(f+=` "${a.dbName}"`);let p=a.schemas?.length||0;a.schemas&&p>0?f+=` schema${p>1?"s":""} "${a.schemas.join(", ")}"`:a.schema&&(f+=` schema "${a.schema}"`),a.dbLocation&&(f+=` at "${a.dbLocation}"`),f+=` ${p>1?"were":"was"} successfully reset.
|
|||
|
|
`,process.stdout.write(f),c=!0}let u=Math.round(performance.now()),l;try{l=await o.push({force:n["--accept-data-loss"]})}catch(f){throw o.stop(),f}if(l.unexecutable&&l.unexecutable.length>0){let f=[];f.push(`${N(oe(`
|
|||
|
|
\u26A0\uFE0F We found changes that cannot be executed:
|
|||
|
|
`))}`);for(let g of l.unexecutable)f.push(` \u2022 ${g}`);if(process.stdout.write(`
|
|||
|
|
`),Pa())process.stdout.write(`${f.join(`
|
|||
|
|
`)}
|
|||
|
|
|
|||
|
|
`);else throw o.stop(),new Error(`${f.join(`
|
|||
|
|
`)}
|
|||
|
|
|
|||
|
|
Use the --force-reset flag to drop the database before push like ${N(te(Le("prisma db push --force-reset")))}
|
|||
|
|
${N(oe("All data will be lost."))}
|
|||
|
|
`);process.stdout.write(`
|
|||
|
|
`),(await(0,b6.default)({type:"confirm",name:"value",message:`To apply this change we need to reset the database, do you want to continue? ${oe("All data will be lost")}.`})).value||(process.stdout.write(`Reset cancelled.
|
|||
|
|
`),o.stop(),process.exit(130));try{await o.reset(),a.dbName&&a.dbLocation?process.stdout.write(`The ${a.prettyProvider} database "${a.dbName}" from "${a.dbLocation}" was successfully reset.
|
|||
|
|
`):process.stdout.write(`The ${a.prettyProvider} database was successfully reset.
|
|||
|
|
`),c=!0,await o.push({})}catch(g){throw o.stop(),g}}if(l.warnings&&l.warnings.length>0){process.stdout.write(N(ze(`
|
|||
|
|
\u26A0\uFE0F There might be data loss when applying the changes:
|
|||
|
|
|
|||
|
|
`)));for(let f of l.warnings)process.stdout.write(` \u2022 ${f}
|
|||
|
|
|
|||
|
|
`);if(process.stdout.write(`
|
|||
|
|
`),!n["--accept-data-loss"]){if(!Pa())throw o.stop(),new ab;process.stdout.write(`
|
|||
|
|
`),(await(0,b6.default)({type:"confirm",name:"value",message:"Do you want to ignore the warning(s)?"})).value||(process.stdout.write(`Push cancelled.
|
|||
|
|
`),o.stop(),process.exit(130));try{await o.push({force:!0})}catch(p){throw o.stop(),p}}}if(o.stop(),!c&&l.warnings.length===0&&l.executedSteps===0)process.stdout.write(`
|
|||
|
|
The database is already in sync with the Prisma schema.
|
|||
|
|
`);else{let f=`Done in ${Ko(Math.round(performance.now())-u)}`,p=process.platform==="win32"?"":"\u{1F680} ",g="Your database is now in sync with your Prisma schema.",v="Your database indexes are now in sync with your Prisma schema.",x=eo(`${a.url?.split(":")[0]}:`);process.stdout.write(`
|
|||
|
|
${p}${x==="mongodb"?v:g} ${f}
|
|||
|
|
`)}return!process.env.PRISMA_MIGRATE_SKIP_GENERATE&&!n["--skip-generate"]&&await o.tryToRunGenerate(),""}help(r){return r?new Re(`
|
|||
|
|
${N(oe("!"))} ${r}
|
|||
|
|
${xm.help}`):xm.help}};xm.help=$e(`
|
|||
|
|
${process.platform==="win32"?"":"\u{1F64C} "}Push the state from your Prisma schema to your database
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${J("$")} prisma db push [options]
|
|||
|
|
|
|||
|
|
${N("Options")}
|
|||
|
|
|
|||
|
|
-h, --help Display this help message
|
|||
|
|
--schema Custom path to your Prisma schema
|
|||
|
|
--accept-data-loss Ignore data loss warnings
|
|||
|
|
--force-reset Force a reset of the database before push
|
|||
|
|
--skip-generate Skip triggering generators (e.g. Prisma Client)
|
|||
|
|
|
|||
|
|
${N("Examples")}
|
|||
|
|
|
|||
|
|
Push the Prisma schema state to the database
|
|||
|
|
${J("$")} prisma db push
|
|||
|
|
|
|||
|
|
Specify a schema
|
|||
|
|
${J("$")} prisma db push --schema=./schema.prisma
|
|||
|
|
|
|||
|
|
Ignore data loss warnings
|
|||
|
|
${J("$")} prisma db push --accept-data-loss
|
|||
|
|
`);var gb=xm;var W_e=B(MF());var B_e=B(Pl()),T6=B(require("fs")),U_e=B(D_e());var ol=B(require("path")),G_e=B(P6()),R6=me("prisma:migrate:seed");async function wm(e){let r=process.cwd(),n=yxt(r,e),i=await ny(r);if(i&&i.data?.seed)return;let a=(0,U_e.default)()?"yarn add -D":"npm i -D",o=`${oe('To configure seeding in your project you need to add a "prisma.seed" property in your package.json with the command to execute it:')}
|
|||
|
|
|
|||
|
|
1. Open the package.json of your project
|
|||
|
|
`;return n.numberOfSeedFiles?(await bxt(),o+="2. Add the following example to it:",n.js?o+=`
|
|||
|
|
\`\`\`
|
|||
|
|
"prisma": {
|
|||
|
|
"seed": "node ${n.js}"
|
|||
|
|
}
|
|||
|
|
\`\`\`
|
|||
|
|
`:n.ts?o+=`
|
|||
|
|
\`\`\`
|
|||
|
|
"prisma": {
|
|||
|
|
"seed": "ts-node ${n.ts}"
|
|||
|
|
}
|
|||
|
|
\`\`\`
|
|||
|
|
If you are using ESM (ECMAScript modules):
|
|||
|
|
\`\`\`
|
|||
|
|
"prisma": {
|
|||
|
|
"seed": "node --loader ts-node/esm ${n.ts}"
|
|||
|
|
}
|
|||
|
|
\`\`\`
|
|||
|
|
|
|||
|
|
3. Install the required dependencies by running:
|
|||
|
|
${te(`${a} ts-node typescript @types/node`)}
|
|||
|
|
`:n.sh&&(o+=`
|
|||
|
|
\`\`\`
|
|||
|
|
"prisma": {
|
|||
|
|
"seed": "${n.sh}"
|
|||
|
|
}
|
|||
|
|
\`\`\`
|
|||
|
|
And run \`chmod +x ${n.sh}\` to make it executable.`)):o+=`2. Add one of the following examples to your package.json:
|
|||
|
|
|
|||
|
|
${N("TypeScript:")}
|
|||
|
|
\`\`\`
|
|||
|
|
"prisma": {
|
|||
|
|
"seed": "ts-node ./prisma/seed.ts"
|
|||
|
|
}
|
|||
|
|
\`\`\`
|
|||
|
|
If you are using ESM (ECMAScript modules):
|
|||
|
|
\`\`\`
|
|||
|
|
"prisma": {
|
|||
|
|
"seed": "node --loader ts-node/esm ./prisma/seed.ts"
|
|||
|
|
}
|
|||
|
|
\`\`\`
|
|||
|
|
|
|||
|
|
And install the required dependencies by running:
|
|||
|
|
${a} ts-node typescript @types/node
|
|||
|
|
|
|||
|
|
${N("JavaScript:")}
|
|||
|
|
\`\`\`
|
|||
|
|
"prisma": {
|
|||
|
|
"seed": "node ./prisma/seed.js"
|
|||
|
|
}
|
|||
|
|
\`\`\`
|
|||
|
|
|
|||
|
|
${N("Bash:")}
|
|||
|
|
\`\`\`
|
|||
|
|
"prisma": {
|
|||
|
|
"seed": "./prisma/seed.sh"
|
|||
|
|
}
|
|||
|
|
\`\`\`
|
|||
|
|
And run \`chmod +x prisma/seed.sh\` to make it executable.`,o+=`
|
|||
|
|
More information in our documentation:
|
|||
|
|
${ke("https://pris.ly/d/seeding")}`,o}async function _m(e){let r=await ny(e);if(R6({prismaConfig:r}),!r||!r.data?.seed)return null;let n=r.data.seed;if(typeof n!="string")throw new Error(`Provided seed command \`${n}\` from \`${ol.default.relative(e,r.packagePath)}\` must be of type string`);if(!n)throw new Error(`Provided seed command \`${n}\` from \`${ol.default.relative(e,r.packagePath)}\` cannot be empty`);return n}async function Em({commandFromConfig:e,extraArgs:r}){let n=r?`${e} ${r}`:e;process.stdout.write(`Running seed command \`${hs(n)}\` ...
|
|||
|
|
`);try{await B_e.default.command(n,{stdout:"inherit",stderr:"inherit"})}catch(i){let a=i;return R6({e:a}),console.error(N(oe(`
|
|||
|
|
An error occurred while running the seed command:`))),console.error(oe(a.stderr||String(a))),!1}return!0}function yxt(e,r){let n=ol.default.relative(e,ol.default.join(e,"prisma"));r&&(n=ol.default.relative(e,ol.default.dirname(r)));let i=ol.default.join(n,"seed."),a={seedPath:i,numberOfSeedFiles:0,js:"",ts:"",sh:""},o=["js","ts","sh"];for(let c of o){let u=i+c;T6.default.existsSync(u)&&(a[c]=u,a.numberOfSeedFiles++)}return R6({detected:a}),a}async function bxt(){(await xxt())?.["ts-node"]&&fr.warn(ze('The "ts-node" script in the package.json is not used anymore since version 3.0 and can now be removed.'))}async function xxt(e=process.cwd()){try{let r=await(0,G_e.default)({cwd:e});if(!r)return null;let n=await T6.default.promises.readFile(r,"utf-8"),i=JSON.parse(n),{"ts-node":a}=i.scripts;return{"ts-node":a}}catch{return null}}var Sm=class Sm{static new(){return new Sm}async parse(r){let n=_e(r,{"--help":Boolean,"-h":"--help","--schema":String,"--telemetry-information":String},!1);if(xe(n)){if(n instanceof W_e.ArgError&&n.code==="ARG_UNKNOWN_OPTION")throw new Error(`${n.message}
|
|||
|
|
Did you mean to pass these as arguments to your seed script? If so, add a -- separator before them:
|
|||
|
|
${J("$")} prisma db seed -- --arg1 value1 --arg2 value2`);return this.help(n.message)}if(n["--help"])return this.help();await at({schemaPath:n["--schema"],printMessage:!0});let i=await _m(process.cwd());if(!i){let c=await pt(n["--schema"]),u=await wm(c?.schemaPath??null);if(u)throw new Error(u);return""}let a=n._.join(" ");if(await Em({commandFromConfig:i,extraArgs:a}))return`
|
|||
|
|
${process.platform==="win32"?"":"\u{1F331} "}The seed command has been executed.`;process.exit(1)}help(r){return r?new Re(`
|
|||
|
|
${N(oe("!"))} ${r}
|
|||
|
|
${Sm.help}`):Sm.help}};Sm.help=$e(`
|
|||
|
|
${process.platform==="win32"?"":"\u{1F64C} "}Seed your database
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${J("$")} prisma db seed [options]
|
|||
|
|
|
|||
|
|
${N("Options")}
|
|||
|
|
|
|||
|
|
-h, --help Display this help message
|
|||
|
|
|
|||
|
|
${N("Examples")}
|
|||
|
|
|
|||
|
|
Passing extra arguments to the seed command
|
|||
|
|
${J("$")} prisma db seed -- --arg1 value1 --arg2 value2
|
|||
|
|
`);var vb=Sm;var lp=class lp{constructor(r){this.cmds=r}static new(r){return new lp(r)}async parse(r){let n=_e(r,{"--help":Boolean,"-h":"--help","--preview-feature":Boolean,"--telemetry-information":String});if(xe(n))return this.help(n.message);if(n._.length===0||n["--help"])return this.help();let i=n._[0],a=this.cmds[i];if(a){let o;return i==="diff"?o=n["--preview-feature"]?[...n._.slice(1),"--preview-feature"]:n._.slice(1):o=n._.filter(u=>u!=="--preview-feature").slice(1),a.parse(o)}return gf(lp.help,i)}help(r){return r?new Re(`
|
|||
|
|
${N(oe("!"))} ${r}
|
|||
|
|
${lp.help}`):lp.help}};lp.help=$e(`
|
|||
|
|
Update the database schema with migrations
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${J("$")} prisma migrate [command] [options]
|
|||
|
|
|
|||
|
|
${N("Commands for development")}
|
|||
|
|
|
|||
|
|
dev Create a migration from changes in Prisma schema, apply it to the database
|
|||
|
|
trigger generators (e.g. Prisma Client)
|
|||
|
|
reset Reset your database and apply all migrations, all data will be lost
|
|||
|
|
|
|||
|
|
${N("Commands for production/staging")}
|
|||
|
|
|
|||
|
|
deploy Apply pending migrations to the database
|
|||
|
|
status Check the status of your database migrations
|
|||
|
|
resolve Resolve issues with database migrations, i.e. baseline, failed migration, hotfix
|
|||
|
|
|
|||
|
|
${N("Command for any stage")}
|
|||
|
|
|
|||
|
|
diff Compare the database schema from two arbitrary sources
|
|||
|
|
|
|||
|
|
${N("Options")}
|
|||
|
|
|
|||
|
|
-h, --help Display this help message
|
|||
|
|
--schema Custom path to your Prisma schema
|
|||
|
|
|
|||
|
|
${N("Examples")}
|
|||
|
|
|
|||
|
|
Create a migration from changes in Prisma schema, apply it to the database, trigger generators (e.g. Prisma Client)
|
|||
|
|
${J("$")} prisma migrate dev
|
|||
|
|
|
|||
|
|
Reset your database and apply all migrations
|
|||
|
|
${J("$")} prisma migrate reset
|
|||
|
|
|
|||
|
|
Apply pending migrations to the database in production/staging
|
|||
|
|
${J("$")} prisma migrate deploy
|
|||
|
|
|
|||
|
|
Check the status of migrations in the production/staging database
|
|||
|
|
${J("$")} prisma migrate status
|
|||
|
|
|
|||
|
|
Specify a schema
|
|||
|
|
${J("$")} prisma migrate status --schema=./schema.prisma
|
|||
|
|
|
|||
|
|
Compare the database schema from two databases and render the diff as a SQL script
|
|||
|
|
${J("$")} prisma migrate diff \\
|
|||
|
|
--from-url "$DATABASE_URL" \\
|
|||
|
|
--to-url "postgresql://login:password@localhost:5432/db" \\
|
|||
|
|
--script
|
|||
|
|
`);var yb=lp;var H_e=B(fv());function JC(e){let r=e.split("_");return r.length===1?gs(N(e)):`${r[0]}_${gs(N(r.slice(1).join("_")))}`}function fp(e,r,n){let i=Object.keys(n),a=`${e}/`;return r.forEach(o=>{a+=`
|
|||
|
|
\u2514\u2500 ${JC(o)}/
|
|||
|
|
${(0,H_e.default)(i.map(c=>`\u2514\u2500 ${c}`).join(`
|
|||
|
|
`),4)}`}),a}var wxt=me("prisma:migrate:deploy"),Dm=class Dm{static new(){return new Dm}async parse(r){let n=_e(r,{"--help":Boolean,"-h":"--help","--schema":String,"--telemetry-information":String},!1);if(xe(n))return this.help(n.message);if(await Rr("migrate deploy",n,!0),n["--help"])return this.help();await at({schemaPath:n["--schema"],printMessage:!0});let{schemaPath:i}=await Zr(n["--schema"]);Oi({datasourceInfo:await Ai({schemaPath:i})});let a=new en(i);try{let u=await nl("apply",i);u&&process.stdout.write(`
|
|||
|
|
`+u+`
|
|||
|
|
`)}catch(u){throw process.stdout.write(`
|
|||
|
|
`),u}let o=await a.listMigrationDirectories();if(wxt({listMigrationDirectoriesResult:o}),process.stdout.write(`
|
|||
|
|
`),o.migrations.length>0){let u=o.migrations;process.stdout.write(`${u.length} migration${u.length>1?"s":""} found in prisma/migrations
|
|||
|
|
`)}else process.stdout.write(`No migration found in prisma/migrations
|
|||
|
|
`);let c;try{process.stdout.write(`
|
|||
|
|
`);let{appliedMigrationNames:u}=await a.applyMigrations();c=u}finally{a.stop()}return process.stdout.write(`
|
|||
|
|
`),c.length===0?te("No pending migrations to apply."):`The following migration(s) have been applied:
|
|||
|
|
|
|||
|
|
${fp("migrations",c,{"migration.sql":""})}
|
|||
|
|
|
|||
|
|
${te("All migrations have been successfully applied.")}`}help(r){return r?new Re(`
|
|||
|
|
${N(oe("!"))} ${r}
|
|||
|
|
${Dm.help}`):Dm.help}};Dm.help=$e(`
|
|||
|
|
Apply pending migrations to update the database schema in production/staging
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${J("$")} prisma migrate deploy [options]
|
|||
|
|
|
|||
|
|
${N("Options")}
|
|||
|
|
|
|||
|
|
-h, --help Display this help message
|
|||
|
|
--schema Custom path to your Prisma schema
|
|||
|
|
|
|||
|
|
${N("Examples")}
|
|||
|
|
|
|||
|
|
Deploy your pending migrations to your production/staging database
|
|||
|
|
${J("$")} prisma migrate deploy
|
|||
|
|
|
|||
|
|
Specify a schema
|
|||
|
|
${J("$")} prisma migrate deploy --schema=./schema.prisma
|
|||
|
|
|
|||
|
|
`);var bb=Dm;var ZC=B(Ju());function z_e(e,r=!1){if(e&&e.length>0){let n=[];n.push(`${N(oe(`
|
|||
|
|
\u26A0\uFE0F We found changes that cannot be executed:
|
|||
|
|
`))}`);for(let i of e)n.push(`${` \u2022 Step ${i.stepIndex} ${i.message}`}`);if(process.stdout.write(`
|
|||
|
|
`),r){console.error(`${n.join(`
|
|||
|
|
`)}
|
|||
|
|
`);return}else return`${n.join(`
|
|||
|
|
`)}
|
|||
|
|
|
|||
|
|
You can use ${Le("prisma migrate dev --create-only")} to create the migration file, and manually modify it to address the underlying issue(s).
|
|||
|
|
Then run ${Le("prisma migrate dev")} to apply it and verify it works.
|
|||
|
|
`}}var O6=B(oEe()),QC=B(Ju());async function cEe(e){if(e)return{name:(0,O6.default)(e,{separator:"_"}).substring(0,200)};if((!Kf||Yf())&&!QC.prompt._injected?.length)return{name:""};let n="Enter a name for the new migration:";QC.prompt._injected?.length&&process.stdout.write(n+`
|
|||
|
|
`);let i=await(0,QC.prompt)({type:"text",name:"name",message:n});return"name"in i?{name:(0,O6.default)(i.name,{separator:"_"}).substring(0,200)||""}:{userCancelled:"Canceled by user."}}var I6=me("prisma:migrate:dev"),Cm=class Cm{static new(){return new Cm}async parse(r){let n=_e(r,{"--help":Boolean,"-h":"--help","--name":String,"-n":"--name","--create-only":Boolean,"--schema":String,"--skip-generate":Boolean,"--skip-seed":Boolean,"--telemetry-information":String});if(xe(n))return this.help(n.message);if(await Rr("migrate dev",n,!0),n["--help"])return this.help();await at({schemaPath:n["--schema"],printMessage:!0});let{schemaPath:i,schemas:a}=await Zr(n["--schema"]),o=await Ai({schemaPath:i});Oi({datasourceInfo:o}),process.stdout.write(`
|
|||
|
|
`),hf({schemas:a}),await Ve({datamodel:a,ignoreEnvVarErrors:!1});let c=await nl("create",i);c&&process.stdout.write(c+`
|
|||
|
|
|
|||
|
|
`);let u=new en(i),l;try{l=await u.devDiagnostic(),I6({devDiagnostic:JSON.stringify(l,null,2)})}catch(E){throw u.stop(),E}let f=[];if(l.action.tag==="reset"){if(!n["--force"]){if(!Pa())throw u.stop(),new mm;let E=await this.confirmReset({datasourceInfo:o,reason:l.action.reason});process.stdout.write(`
|
|||
|
|
`),E||(process.stdout.write(`Reset cancelled.
|
|||
|
|
`),u.stop(),process.exit(130))}try{await u.reset()}catch(E){throw u.stop(),E}}try{let{appliedMigrationNames:E}=await u.applyMigrations();f.push(...E),E.length>0&&process.stdout.write(`
|
|||
|
|
The following migration(s) have been applied:
|
|||
|
|
|
|||
|
|
${fp("migrations",E,{"migration.sql":""})}
|
|||
|
|
`)}catch(E){throw u.stop(),E}let p;try{p=await u.evaluateDataLoss(),I6({evaluateDataLossResult:p})}catch(E){throw u.stop(),E}let g=z_e(p.unexecutableSteps,n["--create-only"]);if(g)throw u.stop(),new Error(g);if(p.warnings&&p.warnings.length>0){process.stdout.write(N(`
|
|||
|
|
\u26A0\uFE0F Warnings for the current datasource:
|
|||
|
|
|
|||
|
|
`));for(let E of p.warnings)process.stdout.write(` \u2022 ${E.message}
|
|||
|
|
`);if(process.stdout.write(`
|
|||
|
|
`),!n["--force"]){if(!Pa())throw u.stop(),new mm;let E=n["--create-only"]?"Are you sure you want to create this migration?":"Are you sure you want to create and apply this migration?";(await(0,ZC.default)({type:"confirm",name:"value",message:E})).value||(process.stdout.write(`Migration cancelled.
|
|||
|
|
`),u.stop(),process.exit(130))}}let v;if(p.migrationSteps>0||n["--create-only"]){let E=await cEe(n["--name"]);E.userCancelled?(process.stdout.write(E.userCancelled+`
|
|||
|
|
`),u.stop(),process.exit(130)):v=E.name}let x;try{let E=await u.createMigration({migrationsDirectoryPath:u.migrationsDirectoryPath,migrationName:v||"",draft:!!n["--create-only"],schema:as((await u.getPrismaSchema()).schemas)});if(I6({createMigrationResult:E}),n["--create-only"])return u.stop(),`Prisma Migrate created the following migration without applying it ${JC(E.generatedMigrationName)}
|
|||
|
|
|
|||
|
|
You can now edit it and apply it by running ${te(Le("prisma migrate dev"))}.`;let{appliedMigrationNames:D}=await u.applyMigrations();x=D}finally{u.stop()}if(f.length>0&&process.stdout.write(`
|
|||
|
|
`),x.length===0?f.length>0?process.stdout.write(`${te("Your database is now in sync with your schema.")}
|
|||
|
|
`):process.stdout.write(`Already in sync, no schema change or pending migration was found.
|
|||
|
|
`):process.stdout.write(`
|
|||
|
|
The following migration(s) have been created and applied from new schema changes:
|
|||
|
|
|
|||
|
|
${fp("migrations",x,{"migration.sql":""})}
|
|||
|
|
|
|||
|
|
${te("Your database is now in sync with your schema.")}
|
|||
|
|
`),!process.env.PRISMA_MIGRATE_SKIP_GENERATE&&!n["--skip-generate"]&&(await u.tryToRunGenerate(),process.stdout.write(`
|
|||
|
|
`)),(c||l.action.tag==="reset")&&!process.env.PRISMA_MIGRATE_SKIP_SEED&&!n["--skip-seed"])try{let E=await _m(process.cwd());if(E)process.stdout.write(`
|
|||
|
|
`),await Em({commandFromConfig:E})?process.stdout.write(`
|
|||
|
|
${process.platform==="win32"?"":"\u{1F331} "}The seed command has been executed.
|
|||
|
|
`):process.exit(1);else{let{schemaPath:D}=await pt(n["--schema"]);await wm(D)}}catch(E){console.error(E)}return""}async confirmReset({datasourceInfo:r,reason:n}){process.stdout.write(n+`
|
|||
|
|
`);let i="";["PostgreSQL","SQL Server"].includes(r.prettyProvider)?r.schemas?.length?i=`We need to reset the following schemas: "${r.schemas.join(", ")}"`:r.schema?i=`We need to reset the "${r.schema}" schema`:i="We need to reset the database schema":i=`We need to reset the ${r.prettyProvider} database "${r.dbName}"`,r.dbLocation&&(i+=` at "${r.dbLocation}"`);let a=`${i}
|
|||
|
|
Do you want to continue? ${oe("All data will be lost")}.`;return ZC.default._injected?.length&&process.stdout.write(a+`
|
|||
|
|
`),(await(0,ZC.default)({type:"confirm",name:"value",message:a})).value}help(r){return r?new Re(`
|
|||
|
|
${N(oe("!"))} ${r}
|
|||
|
|
${Cm.help}`):Cm.help}};Cm.help=$e(`
|
|||
|
|
${process.platform==="win32"?"":"\u{1F3CB}\uFE0F "}Create a migration from changes in Prisma schema, apply it to the database, trigger generators (e.g. Prisma Client)
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${J("$")} prisma migrate dev [options]
|
|||
|
|
|
|||
|
|
${N("Options")}
|
|||
|
|
|
|||
|
|
-h, --help Display this help message
|
|||
|
|
--schema Custom path to your Prisma schema
|
|||
|
|
-n, --name Name the migration
|
|||
|
|
--create-only Create a new migration but do not apply it
|
|||
|
|
The migration will be empty if there are no changes in Prisma schema
|
|||
|
|
--skip-generate Skip triggering generators (e.g. Prisma Client)
|
|||
|
|
--skip-seed Skip triggering seed
|
|||
|
|
|
|||
|
|
${N("Examples")}
|
|||
|
|
|
|||
|
|
Create a migration from changes in Prisma schema, apply it to the database, trigger generators (e.g. Prisma Client)
|
|||
|
|
${J("$")} prisma migrate dev
|
|||
|
|
|
|||
|
|
Specify a schema
|
|||
|
|
${J("$")} prisma migrate dev --schema=./schema.prisma
|
|||
|
|
|
|||
|
|
Create a migration without applying it
|
|||
|
|
${J("$")} prisma migrate dev --create-only
|
|||
|
|
`);var xb=Cm;var lEe=B(JG());var pp=B(require("path"));var eP=class{constructor(){this._capturedText=[],this._orig_stdout_write=null}startCapture(){this._orig_stdout_write=process.stdout.write,process.stdout.write=this._writeCapture.bind(this)}stopCapture(){this._orig_stdout_write&&(process.stdout.write=this._orig_stdout_write)}_writeCapture(r){this._capturedText.push(r)}getCapturedText(){return this._capturedText}clearCaptureText(){this._capturedText=[]}};var Zxt=me("prisma:migrate:diff"),uEe=$e(`${N("Usage")}
|
|||
|
|
|
|||
|
|
${J("$")} prisma migrate diff [options]
|
|||
|
|
|
|||
|
|
${N("Options")}
|
|||
|
|
|
|||
|
|
-h, --help Display this help message
|
|||
|
|
-o, --output Writes to a file instead of stdout
|
|||
|
|
|
|||
|
|
${hs("From and To inputs (1 `--from-...` and 1 `--to-...` must be provided):")}
|
|||
|
|
--from-url A datasource URL
|
|||
|
|
--to-url
|
|||
|
|
|
|||
|
|
--from-empty Flag to assume from or to is an empty datamodel
|
|||
|
|
--to-empty
|
|||
|
|
|
|||
|
|
--from-schema-datamodel Path to a Prisma schema file, uses the ${hs("datamodel")} for the diff
|
|||
|
|
--to-schema-datamodel
|
|||
|
|
|
|||
|
|
--from-schema-datasource Path to a Prisma schema file, uses the ${hs("datasource url")} for the diff
|
|||
|
|
--to-schema-datasource
|
|||
|
|
|
|||
|
|
--from-migrations Path to the Prisma Migrate migrations directory
|
|||
|
|
--to-migrations
|
|||
|
|
|
|||
|
|
--from-local-d1 Automatically locate the local Cloudflare D1 database
|
|||
|
|
--to-local-d1
|
|||
|
|
|
|||
|
|
${hs("Shadow database (only required if using --from-migrations or --to-migrations):")}
|
|||
|
|
--shadow-database-url URL for the shadow database
|
|||
|
|
|
|||
|
|
${N("Flags")}
|
|||
|
|
|
|||
|
|
--script Render a SQL script to stdout instead of the default human readable summary (not supported on MongoDB)
|
|||
|
|
--exit-code Change the exit code behavior to signal if the diff is empty or not (Empty: 0, Error: 1, Not empty: 2). Default behavior is Success: 0, Error: 1.`),wb=class wb{static new(){return new wb}async parse(r){let n=_e(r,{"--help":Boolean,"-h":"--help","--output":String,"-o":"--output","--from-empty":Boolean,"--from-schema-datasource":String,"--from-schema-datamodel":String,"--from-url":String,"--from-migrations":String,"--from-local-d1":Boolean,"--to-empty":Boolean,"--to-schema-datasource":String,"--to-schema-datamodel":String,"--to-url":String,"--to-migrations":String,"--to-local-d1":Boolean,"--shadow-database-url":String,"--script":Boolean,"--exit-code":Boolean,"--telemetry-information":String},!1);if(xe(n))return this.help(n.message);if(await Rr("migrate diff",n,!1),n["--help"])return this.help();let i=+!!n["--from-empty"]+ +!!n["--from-schema-datasource"]+ +!!n["--from-schema-datamodel"]+ +!!n["--from-url"]+ +!!n["--from-migrations"]+ +!!n["--from-local-d1"],a=+!!n["--to-empty"]+ +!!n["--to-schema-datasource"]+ +!!n["--to-schema-datamodel"]+ +!!n["--to-url"]+ +!!n["--to-migrations"]+ +!!n["--to-local-d1"];if(i!==1||a!==1){let v=[];return i!==1&&v.push(`${i} \`--from-...\` parameter(s) provided. 1 must be provided.`),a!==1&&v.push(`${a} \`--to-...\` parameter(s) provided. 1 must be provided.`),this.help(`${v.join(`
|
|||
|
|
`)}`)}if(n["--shadow-database-url"]&&(n["--from-local-d1"]||n["--to-local-d1"]))return this.help("The flag `--shadow-database-url` is not compatible with `--from-local-d1` or `--to-local-d1`.");let o;if(n["--from-empty"])o={tag:"empty"};else if(n["--from-schema-datasource"]){await at({schemaPath:n["--from-schema-datasource"],printMessage:!1});let v=await pt(pp.default.resolve(n["--from-schema-datasource"]),{argumentName:"--from-schema-datasource"}),x=await Ve({datamodel:v.schemas});o={tag:"schemaDatasource",...Jh(v,x)}}else if(n["--from-schema-datamodel"]){let v=await pt(pp.default.resolve(n["--from-schema-datamodel"]),{argumentName:"--from-schema-datamodel"});o={tag:"schemaDatamodel",...as(v.schemas)}}else n["--from-url"]?o={tag:"url",url:n["--from-url"]}:n["--from-migrations"]?o={tag:"migrations",path:pp.default.resolve(n["--from-migrations"])}:n["--from-local-d1"]&&(o={tag:"url",url:`file:${await Xf({arg:"--from-local-d1"})}`});let c;if(n["--to-empty"])c={tag:"empty"};else if(n["--to-schema-datasource"]){await at({schemaPath:n["--to-schema-datasource"],printMessage:!1});let v=await pt(pp.default.resolve(n["--to-schema-datasource"]),{argumentName:"--to-schema-datasource"}),x=await Ve({datamodel:v.schemas});c={tag:"schemaDatasource",...Jh(v,x)}}else if(n["--to-schema-datamodel"]){let v=await pt(pp.default.resolve(n["--to-schema-datamodel"]),{argumentName:"--to-schema-datamodel"});c={tag:"schemaDatamodel",...as(v.schemas)}}else n["--to-url"]?c={tag:"url",url:n["--to-url"]}:n["--to-migrations"]?c={tag:"migrations",path:pp.default.resolve(n["--to-migrations"])}:n["--to-local-d1"]&&(c={tag:"url",url:`file:${await Xf({arg:"--to-local-d1"})}`});let u=new en,l=new eP,f=n["--output"],p=!!f;p&&l.startCapture();let g;try{g=await u.engine.migrateDiff({from:o,to:c,script:n["--script"]||!1,shadowDatabaseUrl:n["--shadow-database-url"],exitCode:n["--exit-code"]})}finally{u.stop()}if(p){l.stopCapture();let v=l.getCapturedText();l.clearCaptureText(),await lEe.default.writeAsync(f,v.join(`
|
|||
|
|
`))}return Zxt({migrateDiffOutput:g}),n["--exit-code"]&&g.exitCode&&process.exit(g.exitCode),""}help(r){if(r)throw new Re(`
|
|||
|
|
${r}
|
|||
|
|
|
|||
|
|
${uEe}`);return wb.help}};wb.help=$e(`
|
|||
|
|
${process.platform==="win32"?"":"\u{1F50D} "}Compares the database schema from two arbitrary sources, and outputs the differences either as a human-readable summary (by default) or an executable script.
|
|||
|
|
|
|||
|
|
${te("prisma migrate diff")} is a read-only command that does not write to your datasource(s).
|
|||
|
|
${te("prisma db execute")} can be used to execute its ${te("--script")} output.
|
|||
|
|
|
|||
|
|
The command takes a source ${te("--from-...")} and a destination ${te("--to-...")}.
|
|||
|
|
The source and destination must use the same provider,
|
|||
|
|
e.g. a diff using 2 different providers like PostgreSQL and SQLite is not supported.
|
|||
|
|
|
|||
|
|
It compares the source with the destination to generate a diff.
|
|||
|
|
The diff can be interpreted as generating a migration that brings the source schema (from) to the shape of the destination schema (to).
|
|||
|
|
The default output is a human readable diff, it can be rendered as SQL using \`--script\` on SQL databases.
|
|||
|
|
|
|||
|
|
See the documentation for more information ${ke("https://pris.ly/d/migrate-diff")}
|
|||
|
|
|
|||
|
|
${uEe}
|
|||
|
|
${N("Examples")}
|
|||
|
|
|
|||
|
|
From database to database as summary
|
|||
|
|
e.g. compare two live databases
|
|||
|
|
${J("$")} prisma migrate diff \\
|
|||
|
|
--from-url "$DATABASE_URL" \\
|
|||
|
|
--to-url "postgresql://login:password@localhost:5432/db2"
|
|||
|
|
|
|||
|
|
From a live database to a Prisma datamodel
|
|||
|
|
e.g. roll forward after a migration failed in the middle
|
|||
|
|
${J("$")} prisma migrate diff \\
|
|||
|
|
--shadow-database-url "$SHADOW_DB" \\
|
|||
|
|
--from-url "$PROD_DB" \\
|
|||
|
|
--to-schema-datamodel=next_datamodel.prisma \\
|
|||
|
|
--script
|
|||
|
|
|
|||
|
|
From a live database to a datamodel
|
|||
|
|
e.g. roll backward after a migration failed in the middle
|
|||
|
|
${J("$")} prisma migrate diff \\
|
|||
|
|
--shadow-database-url "$SHADOW_DB" \\
|
|||
|
|
--from-url "$PROD_DB" \\
|
|||
|
|
--to-schema-datamodel=previous_datamodel.prisma \\
|
|||
|
|
--script
|
|||
|
|
|
|||
|
|
From a local D1 database to a datamodel
|
|||
|
|
${J("$")} prisma migrate diff \\
|
|||
|
|
--from-local-d1 \\
|
|||
|
|
--to-schema-datamodel=./prisma/schema.prisma \\
|
|||
|
|
--script
|
|||
|
|
|
|||
|
|
From a Prisma datamodel to a local D1 database
|
|||
|
|
${J("$")} prisma migrate diff \\
|
|||
|
|
--from-schema-datamodel=./prisma/schema.prisma \\
|
|||
|
|
--to-local-d1 \\
|
|||
|
|
--script
|
|||
|
|
|
|||
|
|
From a Prisma Migrate \`migrations\` directory to another database
|
|||
|
|
e.g. generate a migration for a hotfix already applied on production
|
|||
|
|
${J("$")} prisma migrate diff \\
|
|||
|
|
--shadow-database-url "$SHADOW_DB" \\
|
|||
|
|
--from-migrations ./migrations \\
|
|||
|
|
--to-url "$PROD_DB" \\
|
|||
|
|
--script
|
|||
|
|
|
|||
|
|
Execute the --script output with \`prisma db execute\` using bash pipe \`|\`
|
|||
|
|
${J("$")} prisma migrate diff \\
|
|||
|
|
--from-[...] \\
|
|||
|
|
--to-[...] \\
|
|||
|
|
--script | prisma db execute --stdin --url="$DATABASE_URL"
|
|||
|
|
|
|||
|
|
Detect if both sources are in sync, it will exit with exit code 2 if changes are detected
|
|||
|
|
${J("$")} prisma migrate diff \\
|
|||
|
|
--exit-code \\
|
|||
|
|
--from-[...] \\
|
|||
|
|
--to-[...]
|
|||
|
|
`);var _b=wb;var fEe=B(Ju());var Pm=class Pm{static new(){return new Pm}async parse(r){let n=_e(r,{"--help":Boolean,"-h":"--help","--force":Boolean,"-f":"--force","--skip-generate":Boolean,"--skip-seed":Boolean,"--schema":String,"--telemetry-information":String});if(xe(n))return this.help(n.message);if(await Rr("migrate reset",n,!0),n["--help"])return this.help();await at({schemaPath:n["--schema"],printMessage:!0});let{schemaPath:i}=await Zr(n["--schema"]);Oi({datasourceInfo:await Ai({schemaPath:i})});let a=await nl("create",i);if(a&&process.stdout.write(`
|
|||
|
|
`+a+`
|
|||
|
|
`),process.stdout.write(`
|
|||
|
|
`),!n["--force"]){if(!Pa())throw new ob;let u=await(0,fEe.default)({type:"confirm",name:"value",message:`Are you sure you want to reset your database? ${oe("All data will be lost")}.`});process.stdout.write(`
|
|||
|
|
`),u.value||(process.stdout.write(`Reset cancelled.
|
|||
|
|
`),process.exit(130))}let o=new en(i),c;try{await o.reset();let{appliedMigrationNames:u}=await o.applyMigrations();c=u}finally{o.stop()}if(c.length===0?process.stdout.write(`${te(`Database reset successful
|
|||
|
|
`)}
|
|||
|
|
`):(process.stdout.write(`
|
|||
|
|
`),process.stdout.write(`${te("Database reset successful")}
|
|||
|
|
|
|||
|
|
The following migration(s) have been applied:
|
|||
|
|
|
|||
|
|
${fp("migrations",c,{"migration.sql":""})}
|
|||
|
|
`)),!process.env.PRISMA_MIGRATE_SKIP_GENERATE&&!n["--skip-generate"]&&await o.tryToRunGenerate(),!process.env.PRISMA_MIGRATE_SKIP_SEED&&!n["--skip-seed"]){let u=await _m(process.cwd());if(u)process.stdout.write(`
|
|||
|
|
`),await Em({commandFromConfig:u})?process.stdout.write(`
|
|||
|
|
${process.platform==="win32"?"":"\u{1F331} "}The seed command has been executed.
|
|||
|
|
`):process.exit(1);else{let{schemaPath:l}=await pt(n["--schema"]);await wm(l)}}return""}help(r){return r?new Re(`
|
|||
|
|
${N(oe("!"))} ${r}
|
|||
|
|
${Pm.help}`):Pm.help}};Pm.help=$e(`
|
|||
|
|
Reset your database and apply all migrations, all data will be lost
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${J("$")} prisma migrate reset [options]
|
|||
|
|
|
|||
|
|
${N("Options")}
|
|||
|
|
|
|||
|
|
-h, --help Display this help message
|
|||
|
|
--schema Custom path to your Prisma schema
|
|||
|
|
--skip-generate Skip triggering generators (e.g. Prisma Client)
|
|||
|
|
--skip-seed Skip triggering seed
|
|||
|
|
-f, --force Skip the confirmation prompt
|
|||
|
|
|
|||
|
|
${N("Examples")}
|
|||
|
|
|
|||
|
|
Reset your database and apply all migrations, all data will be lost
|
|||
|
|
${J("$")} prisma migrate reset
|
|||
|
|
|
|||
|
|
Specify a schema
|
|||
|
|
${J("$")} prisma migrate reset --schema=./schema.prisma
|
|||
|
|
|
|||
|
|
Use --force to skip the confirmation prompt
|
|||
|
|
${J("$")} prisma migrate reset --force
|
|||
|
|
`);var Eb=Pm;var Tm=class Tm{static new(){return new Tm}async parse(r){let n=_e(r,{"--help":Boolean,"-h":"--help","--applied":String,"--rolled-back":String,"--schema":String,"--telemetry-information":String},!1);if(xe(n))return this.help(n.message);if(await Rr("migrate resolve",n,!0),n["--help"])return this.help();await at({schemaPath:n["--schema"],printMessage:!0});let{schemaPath:i}=await Zr(n["--schema"]);if(Oi({datasourceInfo:await Ai({schemaPath:i})}),!n["--applied"]&&!n["--rolled-back"])throw new Error(`--applied or --rolled-back must be part of the command like:
|
|||
|
|
${N(te(Le("prisma migrate resolve --applied 20201231000000_example")))}
|
|||
|
|
${N(te(Le("prisma migrate resolve --rolled-back 20201231000000_example")))}`);if(n["--applied"]&&n["--rolled-back"])throw new Error("Pass either --applied or --rolled-back, not both.");if(n["--applied"]){if(typeof n["--applied"]!="string"||n["--applied"].length===0)throw new Error(`--applied value must be a string like ${N(te(Le("prisma migrate resolve --applied 20201231000000_example")))}`);await ib(i);let a=new en(i);try{await a.markMigrationApplied({migrationId:n["--applied"]})}finally{a.stop()}return process.stdout.write(`
|
|||
|
|
Migration ${n["--applied"]} marked as applied.
|
|||
|
|
`),""}else{if(typeof n["--rolled-back"]!="string"||n["--rolled-back"].length===0)throw new Error(`--rolled-back value must be a string like ${N(te(Le("prisma migrate resolve --rolled-back 20201231000000_example")))}`);await ib(i);let a=new en(i);try{await a.markMigrationRolledBack({migrationId:n["--rolled-back"]})}finally{a.stop()}return process.stdout.write(`
|
|||
|
|
Migration ${n["--rolled-back"]} marked as rolled back.
|
|||
|
|
`),""}}help(r){return r?new Re(`
|
|||
|
|
${N(oe("!"))} ${r}
|
|||
|
|
${Tm.help}`):Tm.help}};Tm.help=$e(`
|
|||
|
|
Resolve issues with database migrations in deployment databases:
|
|||
|
|
- recover from failed migrations
|
|||
|
|
- baseline databases when starting to use Prisma Migrate on existing databases
|
|||
|
|
- reconcile hotfixes done manually on databases with your migration history
|
|||
|
|
|
|||
|
|
Run "prisma migrate status" to identify if you need to use resolve.
|
|||
|
|
|
|||
|
|
Read more about resolving migration history issues: ${ke("https://pris.ly/d/migrate-resolve")}
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${J("$")} prisma migrate resolve [options]
|
|||
|
|
|
|||
|
|
${N("Options")}
|
|||
|
|
|
|||
|
|
-h, --help Display this help message
|
|||
|
|
--schema Custom path to your Prisma schema
|
|||
|
|
--applied Record a specific migration as applied
|
|||
|
|
--rolled-back Record a specific migration as rolled back
|
|||
|
|
|
|||
|
|
${N("Examples")}
|
|||
|
|
|
|||
|
|
Update migrations table, recording a specific migration as applied
|
|||
|
|
${J("$")} prisma migrate resolve --applied 20201231000000_add_users_table
|
|||
|
|
|
|||
|
|
Update migrations table, recording a specific migration as rolled back
|
|||
|
|
${J("$")} prisma migrate resolve --rolled-back 20201231000000_add_users_table
|
|||
|
|
|
|||
|
|
Specify a schema
|
|||
|
|
${J("$")} prisma migrate resolve --rolled-back 20201231000000_add_users_table --schema=./schema.prisma
|
|||
|
|
`);var Sb=Tm;var pEe=me("prisma:migrate:status"),Rm=class Rm{static new(){return new Rm}async parse(r){let n=_e(r,{"--help":Boolean,"-h":"--help","--schema":String,"--telemetry-information":String},!1);if(xe(n))return this.help(n.message);if(await Rr("migrate status",n,!0),n["--help"])return this.help();await at({schemaPath:n["--schema"],printMessage:!0});let{schemaPath:i}=await Zr(n["--schema"]);Oi({datasourceInfo:await Ai({schemaPath:i})});let a=new en(i);await ib(i);let o,c;try{o=await a.diagnoseMigrationHistory({optInToShadowDatabase:!1}),pEe({diagnoseResult:JSON.stringify(o,null,2)}),c=await a.listMigrationDirectories(),pEe({listMigrationDirectoriesResult:c})}finally{a.stop()}if(process.stdout.write(`
|
|||
|
|
`),c.migrations.length>0){let l=c.migrations;process.stdout.write(`${l.length} migration${l.length>1?"s":""} found in prisma/migrations
|
|||
|
|
`)}else process.stdout.write(`No migration found in prisma/migrations
|
|||
|
|
`);let u=[];if(o.history?.diagnostic==="databaseIsBehind"?(u=o.history.unappliedMigrationNames,process.stdout.write(`Following migration${u.length>1?"s":""} have not yet been applied:
|
|||
|
|
${u.join(`
|
|||
|
|
`)}
|
|||
|
|
|
|||
|
|
To apply migrations in development run ${N(te(Le("prisma migrate dev")))}.
|
|||
|
|
To apply migrations in production run ${N(te(Le("prisma migrate deploy")))}.
|
|||
|
|
`),process.exit(1)):o.history?.diagnostic==="historiesDiverge"&&(console.error(`Your local migration history and the migrations table from your database are different:
|
|||
|
|
|
|||
|
|
The last common migration is: ${o.history.lastCommonMigrationName}
|
|||
|
|
|
|||
|
|
The migration${o.history.unappliedMigrationNames.length>1?"s":""} have not yet been applied:
|
|||
|
|
${o.history.unappliedMigrationNames.join(`
|
|||
|
|
`)}
|
|||
|
|
|
|||
|
|
The migration${o.history.unpersistedMigrationNames.length>1?"s":""} from the database are not found locally in prisma/migrations:
|
|||
|
|
${o.history.unpersistedMigrationNames.join(`
|
|||
|
|
`)}`),process.exit(1)),o.hasMigrationsTable){if(o.failedMigrationNames.length>0){let l=o.failedMigrationNames;console.error(`Following migration${l.length>1?"s":""} have failed:
|
|||
|
|
${l.join(`
|
|||
|
|
`)}
|
|||
|
|
|
|||
|
|
During development if the failed migration(s) have not been deployed to a production database you can then fix the migration(s) and run ${N(te(Le("prisma migrate dev")))}.
|
|||
|
|
`),console.error(`The failed migration(s) can be marked as rolled back or applied:
|
|||
|
|
|
|||
|
|
- If you rolled back the migration(s) manually:
|
|||
|
|
${N(te(Le(`prisma migrate resolve --rolled-back "${l[0]}"`)))}
|
|||
|
|
|
|||
|
|
- If you fixed the database manually (hotfix):
|
|||
|
|
${N(te(Le(`prisma migrate resolve --applied "${l[0]}"`)))}
|
|||
|
|
|
|||
|
|
Read more about how to resolve migration issues in a production database:
|
|||
|
|
${ke("https://pris.ly/d/migrate-resolve")}`),process.exit(1)}else if(process.stdout.write(`
|
|||
|
|
`),u.length===0)return"Database schema is up to date!"}else if(c.migrations.length===0)console.error(`The current database is not managed by Prisma Migrate.
|
|||
|
|
|
|||
|
|
Read more about how to baseline an existing production database:
|
|||
|
|
${ke("https://pris.ly/d/migrate-baseline")}`),process.exit(1);else{let l=c.migrations.shift();console.error(`The current database is not managed by Prisma Migrate.
|
|||
|
|
|
|||
|
|
If you want to keep the current database structure and data and create new migrations, baseline this database with the migration "${l}":
|
|||
|
|
${N(te(Le(`prisma migrate resolve --applied "${l}"`)))}
|
|||
|
|
|
|||
|
|
Read more about how to baseline an existing production database:
|
|||
|
|
https://pris.ly/d/migrate-baseline`),process.exit(1)}return""}help(r){return r?new Re(`
|
|||
|
|
${N(oe("!"))} ${r}
|
|||
|
|
${Rm.help}`):Rm.help}};Rm.help=$e(`
|
|||
|
|
Check the status of your database migrations
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${J("$")} prisma migrate status [options]
|
|||
|
|
|
|||
|
|
${N("Options")}
|
|||
|
|
|
|||
|
|
-h, --help Display this help message
|
|||
|
|
--schema Custom path to your Prisma schema
|
|||
|
|
|
|||
|
|
${N("Examples")}
|
|||
|
|
|
|||
|
|
Check the status of your database migrations
|
|||
|
|
${J("$")} prisma migrate status
|
|||
|
|
|
|||
|
|
Specify a schema
|
|||
|
|
${J("$")} prisma migrate status --schema=./schema.prisma
|
|||
|
|
`);var Db=Rm;var ewt=me("prisma:cli");async function k6(e){let r,n;try{r=new Ia({}),n=await r.getDatabaseVersion(e)}catch(i){ewt(i)}finally{r&&r.isRunning&&r.stop()}return n}var dEe=["postgresql","cockroachdb","mysql","sqlite"];async function F6(e,r){let n=await pt(e),i=await Ve({datamodel:n.schemas});if(!dEe.includes(i.datasources?.[0]?.activeProvider))throw new Error(`Typed SQL is supported only for ${dEe.join(", ")} providers`);if(!rwt(i))throw new Error(`\`typedSql\` preview feature needs to be enabled in ${n.schemaPath}`);let a=i.datasources[0];if(!a)throw new Error(`Could not find datasource in schema ${n.schemaPath}`);let o=jo(a).value;if(!o)throw new Error(`Could not get url from datasource ${a.name} in ${n.schemaPath}`);let c=new Ia({schemaPath:n.schemaPath}),u=[],l=[];try{for(let f of r){let p=await twt(c,o,f);p.ok?u.push(p.result):l.push(p.error)}}finally{c.stop()}return l.length>0?{ok:!1,errors:l}:{ok:!0,queries:u}}async function twt(e,r,n){try{let a=(await e.introspectSql({url:r,queries:[n]})).queries[0];return a?{ok:!0,result:a}:{ok:!1,error:{fileName:n.fileName,message:"Invalid response from schema engine"}}}catch(i){return{ok:!1,error:{fileName:n.fileName,message:String(i)}}}}function rwt(e){return e.generators.some(r=>r?.previewFeatures?.includes("typedSql"))}var $n=B(require("path"));var M6=require("@prisma/engines");var tP=require("@prisma/engines");var N6=B(require("os"));var $6=B(require("fs")),hEe=B(require("module")),mEe=B(P6());async function gEe(e=process.cwd()){return await nwt(e)??await iwt(e)}async function nwt(e=process.cwd()){try{let r=swt("@prisma/client/package.json",e);if(!r)return null;let n=await $6.default.promises.readFile(r,"utf-8"),i=JSON.parse(n);return i.version?i.version:null}catch{return null}}async function iwt(e=process.cwd()){try{let r=await(0,mEe.default)({cwd:e});if(!r)return null;let n=await $6.default.promises.readFile(r,"utf-8"),i=JSON.parse(n),a=i.dependencies?.["@prisma/client"]??i.devDependencies?.["@prisma/client"];return a||null}catch{return null}}function swt(e,r){try{return require.resolve(e,{paths:hEe.default._nodeModulePaths(r)})}catch{return null}}var L6=Cb(),Am=class Am{static new(){return new Am}async parse(r){let n=_e(r,{"--help":Boolean,"-h":"--help","--version":Boolean,"-v":"--version","--json":Boolean,"--telemetry-information":String});if(xe(n))return this.help(n.message);if(n["--help"])return this.help();await at({printMessage:!n["--json"]});let i=await Hr(),a=(0,tP.getCliQueryEngineBinaryType)(),[o,c]=await wF(),u=o.map(v=>He(v).with({"query-engine":Cr.select()},x=>[`Query Engine${a==="libquery-engine"?" (Node-API)":" (Binary)"}`,x]).with({"schema-engine":Cr.select()},x=>["Schema Engine",x]).exhaustive()),l=await gEe(),f=[[L6.name,L6.version],["@prisma/client",l??"Not found"],["Computed binaryTarget",i],["Operating System",N6.default.platform()],["Architecture",N6.default.arch()],["Node.js",process.version],...u,["Schema Wasm",`@prisma/prisma-schema-wasm ${D_.prismaSchemaWasmVersion}`],["Default Engines Hash",tP.enginesVersion],["Studio",L6.devDependencies["@prisma/studio-server"]]];c.length>0&&(process.exitCode=1,c.forEach(v=>console.error(v)));let p=null;try{p=(await pt()).schemaPath}catch{p=null}let g=await this.getFeatureFlags(p);return g&&g.length>0&&f.push(["Preview Features",g.join(", ")]),Wl(f,{json:n["--json"]})}async getFeatureFlags(r){if(!r)return[];try{let n=await Bn(),a=(await Ve({datamodel:n,ignoreEnvVarErrors:!0})).generators.find(o=>o.previewFeatures.length>0);if(a)return a.previewFeatures}catch{}return[]}help(r){return r?new Re(`
|
|||
|
|
${N(oe("!"))} ${r}
|
|||
|
|
${Am.help}`):Am.help}};Am.help=$e(`
|
|||
|
|
Print current version of Prisma components
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${J("$")} prisma -v [options]
|
|||
|
|
${J("$")} prisma version [options]
|
|||
|
|
|
|||
|
|
${N("Options")}
|
|||
|
|
|
|||
|
|
-h, --help Display this help message
|
|||
|
|
--json Output JSON
|
|||
|
|
`);var Om=Am;var Fa=class Fa{constructor(r,n){this.cmds=r;this.ensureBinaries=n}static new(r,n){return new Fa(r,n)}async parse(r){let n=_e(r,{"--help":Boolean,"-h":"--help","--version":Boolean,"-v":"--version","--json":Boolean,"--experimental":Boolean,"--preview-feature":Boolean,"--early-access":Boolean,"--telemetry-information":String});if(xe(n))return this.help(n.message);if(n["--version"])return await(0,M6.ensureBinariesExist)(),Om.new().parse(r);if(n._.length===0||n["--help"])return this.help();let i=n._[0];if(i==="lift")throw new Error(`${oe("prisma lift")} has been renamed to ${te("prisma migrate")}`);i==="introspect"&&(fr.warn(""),fr.warn(`${N(`The ${tt("prisma introspect")} command is deprecated. Please use ${te("prisma db pull")} instead.`)}`),fr.warn(""));let a=this.cmds[i];if(a){this.ensureBinaries.includes(i)&&await(0,M6.ensureBinariesExist)();let o;return n["--experimental"]?o=[...n._.slice(1),`--experimental=${n["--experimental"]}`]:n["--preview-feature"]?o=[...n._.slice(1),`--preview-feature=${n["--preview-feature"]}`]:n["--early-access"]?o=[...n._.slice(1),`--early-access=${n["--early-access"]}`]:o=n._.slice(1),a.parse(o)}return gf(this.help(),n._[0])}help(r){return r?new Re(`
|
|||
|
|
${N(oe("!"))} ${r}
|
|||
|
|
${Fa.help}`):Fa.help}};Fa.tryPdpMessage=`Optimize performance through connection pooling and caching with Prisma Accelerate
|
|||
|
|
and capture real-time events from your database with Prisma Pulse.
|
|||
|
|
Learn more at ${ke("https://pris.ly/cli/pdp")}`,Fa.boxedTryPdpMessage=N0({height:Fa.tryPdpMessage.split(`
|
|||
|
|
`).length,width:0,str:Fa.tryPdpMessage,horizontalPadding:2}),Fa.help=$e(`
|
|||
|
|
${process.platform==="win32"?"":N(te("\u25ED "))}Prisma is a modern DB toolkit to query, migrate and model your database (${ke("https://prisma.io")})
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${J("$")} prisma [command]
|
|||
|
|
|
|||
|
|
${N("Commands")}
|
|||
|
|
|
|||
|
|
init Set up Prisma for your app
|
|||
|
|
generate Generate artifacts (e.g. Prisma Client)
|
|||
|
|
db Manage your database schema and lifecycle
|
|||
|
|
migrate Migrate your database
|
|||
|
|
studio Browse your data with Prisma Studio
|
|||
|
|
validate Validate your Prisma schema
|
|||
|
|
format Format your Prisma schema
|
|||
|
|
version Displays Prisma version info
|
|||
|
|
debug Displays Prisma debug info
|
|||
|
|
|
|||
|
|
${N("Flags")}
|
|||
|
|
|
|||
|
|
--preview-feature Run Preview Prisma commands
|
|||
|
|
--help, -h Show additional information about a command
|
|||
|
|
|
|||
|
|
${Fa.boxedTryPdpMessage}
|
|||
|
|
|
|||
|
|
${N("Examples")}
|
|||
|
|
|
|||
|
|
Set up a new Prisma project
|
|||
|
|
${J("$")} prisma init
|
|||
|
|
|
|||
|
|
Generate artifacts (e.g. Prisma Client)
|
|||
|
|
${J("$")} prisma generate
|
|||
|
|
|
|||
|
|
Browse your data
|
|||
|
|
${J("$")} prisma studio
|
|||
|
|
|
|||
|
|
Create migrations from your Prisma schema, apply them to the database, generate artifacts (e.g. Prisma Client)
|
|||
|
|
${J("$")} prisma migrate dev
|
|||
|
|
|
|||
|
|
Pull the schema from an existing database, updating the Prisma schema
|
|||
|
|
${J("$")} prisma db pull
|
|||
|
|
|
|||
|
|
Push the Prisma schema state to the database
|
|||
|
|
${J("$")} prisma db push
|
|||
|
|
|
|||
|
|
Validate your Prisma schema
|
|||
|
|
${J("$")} prisma validate
|
|||
|
|
|
|||
|
|
Format your Prisma schema
|
|||
|
|
${J("$")} prisma format
|
|||
|
|
|
|||
|
|
Display Prisma version info
|
|||
|
|
${J("$")} prisma version
|
|||
|
|
|
|||
|
|
Display Prisma debug info
|
|||
|
|
${J("$")} prisma debug
|
|||
|
|
`);var rP=Fa;var Im=class Im{static new(){return new Im}async parse(r){let n=_e(r,{"--help":Boolean,"-h":"--help","--schema":String,"--telemetry-information":String});if(xe(n))return this.help(n.message);if(n["--help"])return this.help();await at({schemaPath:n["--schema"],printMessage:!0});let i=(c,u)=>{let l=process.env[c],f=`- ${c}${u?` ${u}`:""}`;return l===void 0?J(f+":"):N(f+`: \`${l}\``)},a;try{a=ke((await pt(n["--schema"]))?.schemaPath)}catch(c){a=c.message}let o=ke(await Uv());return`${tt("-- Prisma schema --")}
|
|||
|
|
Path: ${a}
|
|||
|
|
|
|||
|
|
${tt("-- Local cache directory for engines files --")}
|
|||
|
|
Path: ${o}
|
|||
|
|
|
|||
|
|
${tt("-- Environment variables --")}
|
|||
|
|
When not set, the line is dimmed and no value is displayed.
|
|||
|
|
When set, the line is bold and the value is inside the \`\` backticks.
|
|||
|
|
|
|||
|
|
For general debugging
|
|||
|
|
${i("CI")}
|
|||
|
|
${i("DEBUG")}
|
|||
|
|
${i("NODE_ENV")}
|
|||
|
|
${i("RUST_LOG")}
|
|||
|
|
${i("RUST_BACKTRACE")}
|
|||
|
|
${i("NO_COLOR")}
|
|||
|
|
${i("TERM")}
|
|||
|
|
${i("NODE_TLS_REJECT_UNAUTHORIZED")}
|
|||
|
|
${i("NO_PROXY")}
|
|||
|
|
${i("http_proxy")}
|
|||
|
|
${i("HTTP_PROXY")}
|
|||
|
|
${i("https_proxy")}
|
|||
|
|
${i("HTTPS_PROXY")}
|
|||
|
|
|
|||
|
|
For more information about Prisma environment variables:
|
|||
|
|
See ${ke("https://www.prisma.io/docs/reference/api-reference/environment-variables-reference")}
|
|||
|
|
|
|||
|
|
For hiding messages
|
|||
|
|
${i("PRISMA_DISABLE_WARNINGS")}
|
|||
|
|
${i("PRISMA_HIDE_PREVIEW_FLAG_WARNINGS")}
|
|||
|
|
${i("PRISMA_HIDE_UPDATE_MESSAGE")}
|
|||
|
|
|
|||
|
|
For downloading engines
|
|||
|
|
${i("PRISMA_ENGINES_MIRROR")}
|
|||
|
|
${i("PRISMA_BINARIES_MIRROR","(deprecated)")}
|
|||
|
|
${i("PRISMA_ENGINES_CHECKSUM_IGNORE_MISSING")}
|
|||
|
|
${i("BINARY_DOWNLOAD_VERSION")}
|
|||
|
|
|
|||
|
|
For configuring the Query Engine Type
|
|||
|
|
${i("PRISMA_CLI_QUERY_ENGINE_TYPE")}
|
|||
|
|
${i("PRISMA_CLIENT_ENGINE_TYPE")}
|
|||
|
|
|
|||
|
|
For custom engines
|
|||
|
|
${i("PRISMA_QUERY_ENGINE_BINARY")}
|
|||
|
|
${i("PRISMA_QUERY_ENGINE_LIBRARY")}
|
|||
|
|
${i("PRISMA_SCHEMA_ENGINE_BINARY")}
|
|||
|
|
${i("PRISMA_MIGRATION_ENGINE_BINARY")}
|
|||
|
|
|
|||
|
|
For the "postinstall" npm hook
|
|||
|
|
${i("PRISMA_GENERATE_SKIP_AUTOINSTALL")}
|
|||
|
|
${i("PRISMA_SKIP_POSTINSTALL_GENERATE")}
|
|||
|
|
${i("PRISMA_GENERATE_IN_POSTINSTALL")}
|
|||
|
|
|
|||
|
|
For "prisma generate"
|
|||
|
|
${i("PRISMA_GENERATE_DATAPROXY")}
|
|||
|
|
${i("PRISMA_GENERATE_NO_ENGINE")}
|
|||
|
|
|
|||
|
|
For Prisma Client
|
|||
|
|
${i("PRISMA_SHOW_ALL_TRACES")}
|
|||
|
|
${i("PRISMA_CLIENT_NO_RETRY","(Binary engine only)")}
|
|||
|
|
|
|||
|
|
For Prisma Migrate
|
|||
|
|
${i("PRISMA_SCHEMA_DISABLE_ADVISORY_LOCK")}
|
|||
|
|
${i("PRISMA_MIGRATE_SKIP_GENERATE")}
|
|||
|
|
${i("PRISMA_MIGRATE_SKIP_SEED")}
|
|||
|
|
|
|||
|
|
For Prisma Studio
|
|||
|
|
${i("BROWSER")}
|
|||
|
|
|
|||
|
|
${tt("-- Terminal is interactive? --")}
|
|||
|
|
${Kf()}
|
|||
|
|
|
|||
|
|
${tt("-- CI detected? --")}
|
|||
|
|
${Yf()}
|
|||
|
|
`}help(r){return r?new Re(`
|
|||
|
|
${N(oe("!"))} ${r}
|
|||
|
|
${Im.help}`):Im.help}};Im.help=$e(`
|
|||
|
|
Print information helpful for debugging and bug reports
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${J("$")} prisma debug [options]
|
|||
|
|
|
|||
|
|
${N("Options")}
|
|||
|
|
|
|||
|
|
-h, --help Display this help message
|
|||
|
|
--schema Custom path to your Prisma schema
|
|||
|
|
`);var nP=Im;var vEe=B(require("fs/promises")),yEe=B(require("path"));var km=class km{static new(){return new km}async parse(r){let n=Math.round(performance.now()),i=_e(r,{"--help":Boolean,"-h":"--help","--schema":String,"--telemetry-information":String,"--check":Boolean});if(i instanceof Error)return this.help(i.message);if(i["--help"])return this.help();let{schemaPath:a,schemas:o}=await Zr(i["--schema"]),c=await Mk({schemas:o});if(hf({schemas:c}),i["--check"]){for(let[f,p]of c){let g=o.find(x=>x[0]===f);if(!g)return new Re(`${N(oe("!"))} The schema ${tt(f)} is not found in the schema list.`);let[,v]=g;if(v!==p)return new Re(`${N(oe("!"))} There are unformatted files. Run ${tt("prisma format")} to format them.`)}return"All files are formatted correctly!"}for(let[f,p]of c)await vEe.default.writeFile(f,p);let u=Math.round(performance.now()),l=yEe.default.relative(process.cwd(),a);return`Formatted ${tt(l)} in ${Ko(u-n)} \u{1F680}`}help(r){return r?new Re(`
|
|||
|
|
${N(oe("!"))} ${r}
|
|||
|
|
${km.help}`):km.help}};km.help=$e(`
|
|||
|
|
Format a Prisma schema.
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${J("$")} prisma format [options]
|
|||
|
|
|
|||
|
|
${N("Options")}
|
|||
|
|
|
|||
|
|
-h, --help Display this help message
|
|||
|
|
--schema Custom path to your Prisma schema
|
|||
|
|
|
|||
|
|
${N("Examples")}
|
|||
|
|
|
|||
|
|
With an existing Prisma schema
|
|||
|
|
${J("$")} prisma format
|
|||
|
|
|
|||
|
|
Or specify a Prisma schema path
|
|||
|
|
${J("$")} prisma format --schema=./schema.prisma
|
|||
|
|
|
|||
|
|
`);var iP=km;var E5=require("@prisma/engines");var S5=B(require("fs"));var hp=B(t6()),bP=B(require("path")),_Se=B(SEe());function B6(e){let r=e.datasources?.[0];return r!==void 0&&r.provider!=="sqlite"&&(r.url.fromEnvVar===null||r.directUrl?.fromEnvVar===null)?`
|
|||
|
|
\u{1F6D1} Hardcoding URLs in your schema poses a security risk: ${ke("https://pris.ly/d/datasource-env")}
|
|||
|
|
`:""}var U6=B(require("fs/promises"));var wc=B(require("path")),DEe="sql";async function G6(e){let r=await uwt(e),n=await F6(e,r);if(n.ok)return n.queries;throw new Error(lwt(n.errors))}function CEe(e){return wc.default.join(wc.default.dirname(e),DEe)}async function uwt(e){let r=wc.default.join(wc.default.dirname(e),DEe),n=await U6.default.readdir(r),i=[];for(let a of n){let{name:o,ext:c}=wc.default.parse(a);if(c!==".sql")continue;let u=wc.default.join(r,a);if(!z4(o))throw new Error(`${u} can not be used as a typed sql query: name must be a valid JS identifier`);if(o.startsWith("$"))throw new Error(`${u} can not be used as a typed sql query: name must not start with $`);let l=await U6.default.readFile(wc.default.join(r,a),"utf8");i.push({name:o,source:l,fileName:u})}return i}function lwt(e){let r=[`Errors while reading sql files:
|
|||
|
|
`];for(let{fileName:n,message:i}of e)r.push(`In ${N(wc.default.relative(process.cwd(),n))}:`),r.push(i),r.push("");return r.join(`
|
|||
|
|
`)}var gSe=B(mSe()),_5=class{constructor(){this._queue=[]}push(r){this._deferred?(this._deferred(r),this._deferred=void 0):this._queue.push(r)}nextEvent(){let r=this._queue.shift();return r?Promise.resolve(r):new Promise(n=>{this._deferred=n})}},vP=class{constructor(r){this.changeQueue=new _5;this.watcher=gSe.default.watch(r,{ignoreInitial:!0,followSymlinks:!0}),this.watcher.on("all",(n,i)=>{this.changeQueue.push(i)})}add(r){this.watcher.add(r)}async*[Symbol.asyncIterator](){for(;;)yield await this.changeQueue.nextEvent()}async stop(){await this.watcher.close()}};var vSe=`${ze(N("warn"))} Prisma 2.12.0 has breaking changes.
|
|||
|
|
You can update your code with
|
|||
|
|
${N("`npx @prisma/codemods update-2.12 ./`")}
|
|||
|
|
Read more at ${ke("https://pris.ly/2.12")}`;var ySe=[{text:"Tip: Want real-time updates to your database without manual polling? Discover how with Pulse:",link:"https://pris.ly/tip-0-pulse"},{text:"Tip: Want to react to database changes in your app as they happen? Discover how with Pulse:",link:"https://pris.ly/tip-1-pulse"},{text:"Tip: Need your database queries to be 1000x faster? Accelerate offers you that and more:",link:"https://pris.ly/tip-2-accelerate"},{text:"Tip: Interested in query caching in just a few lines of code? Try Accelerate today!",link:"https://pris.ly/tip-3-accelerate"},{text:"Tip: Easily identify and fix slow SQL queries in your app. Optimize helps you enhance your visibility:",link:"https://pris.ly/--optimize"},{text:"Tip: Curious about the SQL queries Prisma ORM generates? Optimize helps you enhance your visibility:",link:"https://pris.ly/tip-2-optimize"},{text:"Tip: Want to turn off tips and other hints?",link:"https://pris.ly/tip-4-nohints"},{text:"Help us improve the Prisma ORM for everyone. Share your feedback in a short 2-min survey:",link:"https://pris.ly/orm/survey/release-5-22"}];function bSe(e){return`${e.text} ${e.link}`}function xSe(){return ySe[Math.floor(Math.random()*ySe.length)]}function wSe(e){let r=!1,n=null;return async(...i)=>{if(r)return n=i,null;r=!0,await e(...i).catch(a=>console.error(a)),n&&(await e(...n).catch(a=>console.error(a)),n=null),r=!1}}var yP=eval("require('../package.json')"),Nm=class Nm{constructor(){this.logText="";this.hasGeneratorErrored=!1;this.runGenerate=wSe(async({generators:r})=>{let n=[];for(let i of r){let a=Math.round(performance.now());try{await i.generate();let o=Math.round(performance.now());n.push(sy(i,o-a)+`
|
|||
|
|
`),i.stop()}catch(o){this.hasGeneratorErrored=!0,i.stop(),n.push(`${o.message}
|
|||
|
|
|
|||
|
|
`)}}this.logText+=n.join(`
|
|||
|
|
`)})}static new(){return new Nm}async parse(r){let n=_e(r,{"--help":Boolean,"-h":"--help","--watch":Boolean,"--schema":String,"--data-proxy":Boolean,"--accelerate":Boolean,"--no-engine":Boolean,"--no-hints":Boolean,"--generator":[String],"--postinstall":String,"--telemetry-information":String,"--allow-no-models":Boolean,"--sql":Boolean}),i=process.env.PRISMA_GENERATE_IN_POSTINSTALL,a=process.cwd();if(i&&i!=="true"&&(a=i),xe(n))return this.help(n.message);if(n["--help"])return this.help();let o=n["--watch"]||!1;await at({schemaPath:n["--schema"],printMessage:!0});let c=await J1t(n["--schema"],a,!!i),u=xSe();if(!c)return"";let{schemas:l,schemaPath:f}=c;TC(f);let p=await Ve({datamodel:l,ignoreEnvVarErrors:!0}),g,v,x=null,E;n["--sql"]&&(E=await G6(f));try{if(v=await tc({schemaPath:f,printDownloadProgress:!o,version:E5.enginesVersion,cliVersion:yP.version,generatorNames:n["--generator"],postinstall:!!n["--postinstall"],typedSql:E,noEngine:!!n["--no-engine"]||!!n["--data-proxy"]||!!n["--accelerate"]||!!process.env.PRISMA_GENERATE_DATAPROXY||!!process.env.PRISMA_GENERATE_ACCELERATE||!!process.env.PRISMA_GENERATE_NO_ENGINE,allowNoModels:!!n["--allow-no-models"]}),!v||v.length===0)this.logText+=`${mS}
|
|||
|
|
`;else{let R=v.find(k=>k.options&&mn(k.options.generator.provider)==="prisma-client-js");x=R?.manifest?.version??null,g=!!R;try{await this.runGenerate({generators:v})}catch(k){this.logText+=`${k.message}
|
|||
|
|
|
|||
|
|
`}}}catch(R){if(i)return console.error(`${Jn("info")} The postinstall script automatically ran \`prisma generate\`, which failed.
|
|||
|
|
The postinstall script still succeeds but won't generate the Prisma Client.
|
|||
|
|
Please run \`${Le("prisma generate")}\` to see the errors.`),"";if(o)this.logText+=`${R.message}
|
|||
|
|
|
|||
|
|
`;else throw R}let D=!1;if(g)try{let R=X1t();if(R&&typeof R=="string"){let[k,F]=R.split(".");parseInt(k)==2&&parseInt(F)<12&&(D=!0)}}catch{}if(i&&D&&fr.should.warn())return"There have been breaking changes in Prisma Client since you updated last time.\nPlease run `prisma generate` manually.";let P=`
|
|||
|
|
${te("Watching...")} ${J(f)}
|
|||
|
|
`;if(o){(0,hp.default)(P+`
|
|||
|
|
`+this.logText);let R=new vP(f);n["--sql"]&&R.add(CEe(f));for await(let k of R){(0,hp.default)(`Change in ${bP.default.relative(process.cwd(),k)}`);let F;try{if(n["--sql"]&&(E=await G6(f)),F=await tc({schemaPath:f,printDownloadProgress:!o,version:E5.enginesVersion,cliVersion:yP.version,generatorNames:n["--generator"],typedSql:E}),!F||F.length===0)this.logText+=`${mS}
|
|||
|
|
`;else{(0,hp.default)(`
|
|||
|
|
${te("Building...")}
|
|||
|
|
|
|||
|
|
${this.logText}`);try{await this.runGenerate({generators:F}),(0,hp.default)(P+`
|
|||
|
|
`+this.logText)}catch(L){this.logText+=`${L.message}
|
|||
|
|
|
|||
|
|
`,(0,hp.default)(P+`
|
|||
|
|
`+this.logText)}}}catch(L){this.logText+=`${L.message}
|
|||
|
|
|
|||
|
|
`,(0,hp.default)(P+`
|
|||
|
|
`+this.logText)}}}else{let R=v?.find(({options:L})=>L?.generator.provider&&mn(L?.generator.provider)==="prisma-client-js"),k="";if(R){let L=R.options?.generator;if(L?.previewFeatures.includes("deno")&&!!globalThis.Deno&&!L?.isCustomOutput)throw new Error(`Can't find output dir for generator ${N(L.name)} with provider ${N(L.provider.value)}.
|
|||
|
|
When using Deno, you need to define \`output\` in the client generator section of your schema.prisma file.`);let V=D?`
|
|||
|
|
|
|||
|
|
${vSe}`:"",j=n["--no-hints"]??!1,q=x&&yP.version!==x&&fr.should.warn()?`
|
|||
|
|
|
|||
|
|
${ze(N("warn"))} Versions of ${N(`prisma@${yP.version}`)} and ${N(`@prisma/client@${x}`)} don't match.
|
|||
|
|
This might lead to unexpected behavior.
|
|||
|
|
Please make sure they have the same version.`:"";j?k=`${B6(p)}${V}${q}`:k=`
|
|||
|
|
Start by importing your Prisma Client (See: https://pris.ly/d/importing-client)
|
|||
|
|
|
|||
|
|
${bSe(u)}
|
|||
|
|
${B6(p)}${V}${q}`}let F=`
|
|||
|
|
`+this.logText+(g&&!this.hasGeneratorErrored?k:"");if(this.hasGeneratorErrored){if(i)return fr.info(`The postinstall script automatically ran \`prisma generate\`, which failed.
|
|||
|
|
The postinstall script still succeeds but won't generate the Prisma Client.
|
|||
|
|
Please run \`${Le("prisma generate")}\` to see the errors.`),"";throw new Error(F)}else return F}return""}help(r){return r?new Re(`
|
|||
|
|
${N(oe("!"))} ${r}
|
|||
|
|
${Nm.help}`):Nm.help}};Nm.help=$e(`
|
|||
|
|
Generate artifacts (e.g. Prisma Client)
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${J("$")} prisma generate [options]
|
|||
|
|
|
|||
|
|
${N("Options")}
|
|||
|
|
-h, --help Display this help message
|
|||
|
|
--schema Custom path to your Prisma schema
|
|||
|
|
--watch Watch the Prisma schema and rerun after a change
|
|||
|
|
--generator Generator to use (may be provided multiple times)
|
|||
|
|
--no-engine Generate a client for use with Accelerate only
|
|||
|
|
--no-hints Hides the hint messages but still outputs errors and warnings
|
|||
|
|
--allow-no-models Allow generating a client without models
|
|||
|
|
--sql Generate typed sql module
|
|||
|
|
|
|||
|
|
${N("Examples")}
|
|||
|
|
|
|||
|
|
With an existing Prisma schema
|
|||
|
|
${J("$")} prisma generate
|
|||
|
|
|
|||
|
|
Or specify a schema
|
|||
|
|
${J("$")} prisma generate --schema=./schema.prisma
|
|||
|
|
|
|||
|
|
Run the command with multiple specific generators
|
|||
|
|
${J("$")} prisma generate --generator client1 --generator client2
|
|||
|
|
|
|||
|
|
Watch Prisma schema file and rerun after each change
|
|||
|
|
${J("$")} prisma generate --watch
|
|||
|
|
|
|||
|
|
`);var xP=Nm;function X1t(){try{let e=(0,_Se.default)(".prisma/client",{cwd:process.cwd()});if(!e){let r=bP.default.join(process.cwd(),"node_modules/.prisma/client");S5.default.existsSync(r)&&(e=r)}if(e){let r=bP.default.join(e,"index.js");if(S5.default.existsSync(r)){let n=require(r);return n?.prismaVersion?.client??n?.Prisma?.prismaVersion?.client}}}catch{return null}return null}async function J1t(e,r,n){if(n){let i=await ry(e,{cwd:r});return i||(fr.warn(`We could not find your Prisma schema in the default locations (see: ${ke("https://pris.ly/d/prisma-schema-location")}).
|
|||
|
|
If you have a Prisma schema file in a custom path, you will need to run
|
|||
|
|
\`prisma generate --schema=./path/to/your/schema.prisma\` to generate Prisma Client.
|
|||
|
|
If you do not have a Prisma schema file yet, you can ignore this message.`),null)}return pt(e,{cwd:r})}var DSe=B(RF()),Ii=B(require("fs"));var cl=B(require("path"));var CSe=require("util");function wP(e){return N(rR(" ERROR "))+" "+oe(e)}var Q1t=e=>{let{datasourceProvider:r="postgresql",generatorProvider:n=r_t,previewFeatures:i=n_t,output:a=SSe,withModel:o=!1}=e||{},l=`// This is your Prisma schema file,
|
|||
|
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|||
|
|
${r!=="sqlite"?`
|
|||
|
|
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
|
|||
|
|
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
|
|||
|
|
`:""}
|
|||
|
|
generator client {
|
|||
|
|
provider = "${n}"
|
|||
|
|
${i.length>0?` previewFeatures = [${i.map(f=>`"${f}"`).join(", ")}]
|
|||
|
|
`:""}${a!=SSe?` output = "${a}"
|
|||
|
|
`:""}}
|
|||
|
|
|
|||
|
|
datasource db {
|
|||
|
|
provider = "${r}"
|
|||
|
|
url = env("DATABASE_URL")
|
|||
|
|
}
|
|||
|
|
`;if(o){let f=`email String @unique
|
|||
|
|
name String?`;switch(r){case"mongodb":l+=`
|
|||
|
|
model User {
|
|||
|
|
id String @id @default(auto()) @map("_id") @db.ObjectId
|
|||
|
|
${f}
|
|||
|
|
}
|
|||
|
|
`;break;case"cockroachdb":l+=`
|
|||
|
|
model User {
|
|||
|
|
id BigInt @id @default(sequence())
|
|||
|
|
${f}
|
|||
|
|
}
|
|||
|
|
`;break;default:l+=`
|
|||
|
|
model User {
|
|||
|
|
id Int @id @default(autoincrement())
|
|||
|
|
${f}
|
|||
|
|
}
|
|||
|
|
`}}return l},ESe=(e="postgresql://johndoe:randompassword@localhost:5432/mydb?schema=public",r=!0)=>{let n=r?`# Environment variables declared in this file are automatically made available to Prisma.
|
|||
|
|
# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema
|
|||
|
|
|
|||
|
|
# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
|
|||
|
|
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings
|
|||
|
|
|
|||
|
|
`:"";return n+=`DATABASE_URL="${e}"`,n},Z1t=e=>{switch(e){case"mysql":return 3306;case"sqlserver":return 1433;case"mongodb":return 27017;case"postgresql":return 5432;case"cockroachdb":return 26257}},e_t=(e,r=Z1t(e),n="public")=>{switch(e){case"postgresql":return`postgresql://johndoe:randompassword@localhost:${r}/mydb?schema=${n}`;case"cockroachdb":return`postgresql://johndoe:randompassword@localhost:${r}/mydb?schema=${n}`;case"mysql":return`mysql://johndoe:randompassword@localhost:${r}/mydb`;case"sqlserver":return`sqlserver://localhost:${r};database=mydb;user=SA;password=randompassword;`;case"mongodb":return"mongodb+srv://root:randompassword@cluster0.ab1cd.mongodb.net/mydb?retryWrites=true&w=majority";case"sqlite":return"file:./dev.db";default:return}},t_t=()=>`node_modules
|
|||
|
|
# Keep environment variables out of version control
|
|||
|
|
.env
|
|||
|
|
`,r_t="prisma-client-js",n_t=[],SSe="node_modules/.prisma/client",Mm=class Mm{static new(){return new Mm}async parse(r){let n=_e(r,{"--help":Boolean,"-h":"--help","--url":String,"--datasource-provider":String,"--generator-provider":String,"--preview-feature":[String],"--output":String,"--with-model":Boolean});if((0,CSe.isError)(n)||n["--help"])return this.help();if(await Rr("init",n,!1),n._[0])throw Error("The init command does not take any argument.");let a=process.cwd(),o=cl.default.join(a,"prisma");Ii.default.existsSync(cl.default.join(a,"schema.prisma"))&&(console.log(wP(`File ${N("schema.prisma")} already exists in your project.
|
|||
|
|
Please try again in a project that is not yet using Prisma.
|
|||
|
|
`)),process.exit(1)),Ii.default.existsSync(o)&&(console.log(wP(`A folder called ${N("prisma")} already exists in your project.
|
|||
|
|
Please try again in a project that is not yet using Prisma.
|
|||
|
|
`)),process.exit(1)),Ii.default.existsSync(cl.default.join(o,"schema.prisma"))&&(console.log(wP(`File ${N("prisma/schema.prisma")} already exists in your project.
|
|||
|
|
Please try again in a project that is not yet using Prisma.
|
|||
|
|
`)),process.exit(1));let{datasourceProvider:c,url:u}=await He(n).with({"--datasource-provider":Cr.when(D=>!!D)},D=>{let P=D["--datasource-provider"].toLowerCase();if(!["postgresql","mysql","sqlserver","sqlite","mongodb","cockroachdb"].includes(P))throw new Error(`Provider "${n["--datasource-provider"]}" is invalid or not supported. Try again with "postgresql", "mysql", "sqlite", "sqlserver", "mongodb" or "cockroachdb".`);let R=P,k=e_t(R);return Promise.resolve({datasourceProvider:R,url:k})}).with({"--url":Cr.when(D=>!!D)},async D=>{let P=D["--url"],R=await Cf(P);if(R!==!0){let{code:F,message:L}=R;if(F!=="P1003")throw F?new Error(`${F}: ${L}`):new Error(L)}return{datasourceProvider:eo(`${P.split(":")[0]}:`),url:P}}).otherwise(()=>Promise.resolve({datasourceProvider:"postgresql",url:void 0})),l=n["--generator-provider"],f=n["--preview-feature"],p=n["--output"];Ii.default.existsSync(a)||Ii.default.mkdirSync(a),Ii.default.existsSync(o)||Ii.default.mkdirSync(o),Ii.default.writeFileSync(cl.default.join(o,"schema.prisma"),Q1t({datasourceProvider:c,generatorProvider:l,previewFeatures:f,output:p,withModel:n["--with-model"]}));let g=[],v=cl.default.join(a,".env");if(!Ii.default.existsSync(v))Ii.default.writeFileSync(v,ESe(u));else{let D=Ii.default.readFileSync(v,{encoding:"utf8"}),P=DSe.default.parse(D);Object.keys(P).includes("DATABASE_URL")?g.push(`${ze("warn")} Prisma would have added DATABASE_URL but it already exists in ${N(cl.default.relative(a,v))}`):Ii.default.appendFileSync(v,`
|
|||
|
|
|
|||
|
|
# This was inserted by \`prisma init\`:
|
|||
|
|
`+ESe(u))}let x=cl.default.join(a,".gitignore");try{Ii.default.writeFileSync(x,t_t(),{flag:"wx"})}catch(D){D.code==="EEXIST"?g.push(`${ze("warn")} You already have a .gitignore file. Don't forget to add \`.env\` in it to not commit any private information.`):console.error("Failed to write .gitignore file, reason: ",D)}let E=[];return c==="mongodb"?E.push("Define models in the schema.prisma file."):E.push(`Run ${te(Le("prisma db pull"))} to turn your database schema into a Prisma schema.`),E.push(`Run ${te(Le("prisma generate"))} to generate the Prisma Client. You can then start querying your database.`),E.push(`Tip: Explore how you can extend the ${te("ORM")} with scalable connection pooling, global caching, and real-time database events. Read: https://pris.ly/cli/beyond-orm`),(!u||n["--datasource-provider"])&&(n["--datasource-provider"]||E.unshift(`Set the ${te("provider")} of the ${te("datasource")} block in ${te("schema.prisma")} to match your database: ${te("postgresql")}, ${te("mysql")}, ${te("sqlite")}, ${te("sqlserver")}, ${te("mongodb")} or ${te("cockroachdb")}.`),E.unshift(`Set the ${te("DATABASE_URL")} in the ${te(".env")} file to point to your existing database. If your database has no tables yet, read https://pris.ly/d/getting-started`)),`
|
|||
|
|
\u2714 Your Prisma schema was created at ${te("prisma/schema.prisma")}
|
|||
|
|
You can now open it in your favorite editor.
|
|||
|
|
${g.length>0&&fr.should.warn()?`
|
|||
|
|
${g.join(`
|
|||
|
|
`)}
|
|||
|
|
`:""}
|
|||
|
|
Next steps:
|
|||
|
|
${E.map((D,P)=>`${P+1}. ${D}`).join(`
|
|||
|
|
`)}
|
|||
|
|
|
|||
|
|
More information in our documentation:
|
|||
|
|
${ke("https://pris.ly/d/getting-started")}
|
|||
|
|
`}help(r){return r?new Re(`
|
|||
|
|
${N(oe("!"))} ${r}
|
|||
|
|
${Mm.help}`):Mm.help}};Mm.help=$e(`
|
|||
|
|
Set up a new Prisma project
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${J("$")} prisma init [options]
|
|||
|
|
|
|||
|
|
${N("Options")}
|
|||
|
|
|
|||
|
|
-h, --help Display this help message
|
|||
|
|
--datasource-provider Define the datasource provider to use: postgresql, mysql, sqlite, sqlserver, mongodb or cockroachdb
|
|||
|
|
--generator-provider Define the generator provider to use. Default: \`prisma-client-js\`
|
|||
|
|
--preview-feature Define a preview feature to use.
|
|||
|
|
--output Define Prisma Client generator output path to use.
|
|||
|
|
--url Define a custom datasource url
|
|||
|
|
|
|||
|
|
${N("Flags")}
|
|||
|
|
|
|||
|
|
--with-model Add example model to created schema file
|
|||
|
|
|
|||
|
|
${N("Examples")}
|
|||
|
|
|
|||
|
|
Set up a new Prisma project with PostgreSQL (default)
|
|||
|
|
${J("$")} prisma init
|
|||
|
|
|
|||
|
|
Set up a new Prisma project and specify MySQL as the datasource provider to use
|
|||
|
|
${J("$")} prisma init --datasource-provider mysql
|
|||
|
|
|
|||
|
|
Set up a new Prisma project and specify \`prisma-client-go\` as the generator provider to use
|
|||
|
|
${J("$")} prisma init --generator-provider prisma-client-go
|
|||
|
|
|
|||
|
|
Set up a new Prisma project and specify \`x\` and \`y\` as the preview features to use
|
|||
|
|
${J("$")} prisma init --preview-feature x --preview-feature y
|
|||
|
|
|
|||
|
|
Set up a new Prisma project and specify \`./generated-client\` as the output path to use
|
|||
|
|
${J("$")} prisma init --output ./generated-client
|
|||
|
|
|
|||
|
|
Set up a new Prisma project and specify the url that will be used
|
|||
|
|
${J("$")} prisma init --url mysql://user:password@localhost:3306/mydb
|
|||
|
|
|
|||
|
|
Set up a new Prisma project with an example model
|
|||
|
|
${J("$")} prisma init --with-model
|
|||
|
|
`);var _P=Mm;var bt={};Xn(bt,{$:()=>D5,Accelerate:()=>k5,Auth:()=>$5,Environment:()=>q5,Login:()=>TP,Logout:()=>RP,Project:()=>G5,Pulse:()=>z5,ServiceToken:()=>X5,Workspace:()=>Q5});var EP=class extends Error{constructor(){super(`This feature is currently in Early Access. There may be bugs and it's not recommended to use it in production environments.
|
|||
|
|
Please provide the ${te("--early-access")} flag to use this command.`)}};var SP=async(e,r)=>{let n=r[0];if(!n)return new Re("Unknown command.");let i=e[n];return i?r.find(c=>["-h","--help"].includes(c))?`Help output for this command will be available soon. In the meantime, visit ${ke("https://pris.ly/cli/platform-docs")} for more information.`:await i.parse(r.slice(1)):new Re(`Unknown command or parameter "${n}"`)};var PSe=e=>{let{command:r,subcommand:n,subcommands:i,options:a,examples:o,additionalContent:c}=e,u=n?`prisma platform ${r} ${n}`:r&&i?`prisma platform ${r} [command]`:"prisma platform [command]",l=$e(`
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${J("$")} ${u} [options]
|
|||
|
|
`),f=i&&$e(`
|
|||
|
|
${N("Commands")}
|
|||
|
|
|
|||
|
|
${i.map(([E,D])=>`${E.padStart(15)} ${D}`).join(`
|
|||
|
|
`)}
|
|||
|
|
`),p=a&&$e(`
|
|||
|
|
${N("Options")}
|
|||
|
|
|
|||
|
|
${a.map(([E,D,P])=>` ${E.padStart(15)} ${D&&D+","} ${P}`).join(`
|
|||
|
|
`)}
|
|||
|
|
`),g=o&&$e(`
|
|||
|
|
${N("Examples")}
|
|||
|
|
|
|||
|
|
${o.map(E=>` ${J("$")} ${E}`).join(`
|
|||
|
|
`)}
|
|||
|
|
`),v=c&&$e(`
|
|||
|
|
${c.map(E=>`${E}`).join(`
|
|||
|
|
`)}
|
|||
|
|
`),x=[l,f,p,g,v].filter(Boolean).join("");return E=>E?new Re(`
|
|||
|
|
${N(oe("!"))} ${E}
|
|||
|
|
${x}`):x};var D5=class e{constructor(r){this.commands=r;this.help=PSe({subcommands:[["auth","Manage authentication with your Prisma Data Platform account"],["workspace","Manage workspaces"],["project","Manage projects"],["environment","Manage environments"],["apikey","Manage API keys"],["accelerate","Manage Prisma Accelerate"],["pulse","Manage Prisma Pulse"]],options:[["--early-access","","Enable early access features"],["--token","","Specify a token to use for authentication"]],examples:["prisma platform auth login","prisma platform project create --workspace <id>"],additionalContent:["For detailed command descriptions and options, use `prisma platform [command] --help`",`For additional help visit ${ke("https://pris.ly/cli/platform-docs")}`]})}static new(r){return new e(r)}async parse(r){if(!!!r.find(o=>o.match(/early-access/)))throw new EP;let i=r=r.filter(o=>o!=="--early-access");return r.length===0||["-h","--help"].includes(i[0])?this.help():await SP(this.commands,i)}};var k5={};Xn(k5,{$:()=>i_t,Disable:()=>O5,Enable:()=>I5});var ki=()=>class TSe{constructor(r){this.commands=r}static new(r){return new TSe(r)}async parse(r){return await SP(this.commands,r)}};var i_t=ki();var s_t=(e,r,n)=>{let i=Vn(e,r,n);return i===void 0?new Error(`Missing ${r.join(" or ")} parameter`):i};function zn(e,r){let n=_e(e,r);if(xe(n))throw n;return n}var Ft=(e,r,n)=>{let i=s_t(e,r,n);if(i instanceof Error)throw new Error(`Missing ${r.join(" or ")} parameter`);return i},Vn=(e,r,n)=>{let i=Object.entries(e).find(([a])=>r.includes(a));if(!i&&n){let a=process.env[n];if(a)return a}return i?.[1]??void 0};var xo=e=>e instanceof Error?e:new Error(`Unknown error: ${e}`),RSe=e=>e,ASe=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),C5=(e,r)=>{try{return e()}catch(n){return r?r(xo(n)):xo(n)}};var a_t=(e,r)=>{let n={key:r.key??J,values:V4(r.values??{},i=>i===!0?RSe:i)};return Wl(Object.entries(n.values).map(([i,a])=>{let o=a(e[i]);return o===null?null:[n.key(String(i)),o]}).filter(Boolean))},mp=e=>`${te("Success!")} ${e}`,Xe={resourceCreated:e=>mp(`${e.__typename} ${e.displayName} - ${e.id} created.`),resourceDeleted:e=>mp(`${e.__typename} ${e.displayName} - ${e.id} deleted.`),resource:(e,r)=>Xe.table(e,{values:{displayName:n=>tR(N(n)),id:!0,createdAt:n=>n?Intl.DateTimeFormat().format(new Date(n)):null,...r}}),resourceList:e=>e.length===0?Xe.info("No records found."):e.map(r=>Xe.resource(r)).join(`
|
|||
|
|
|
|||
|
|
|
|||
|
|
`),info:e=>e,sections:e=>e.join(`
|
|||
|
|
|
|||
|
|
`),table:a_t,success:mp};var OSe=B(Vh()),ISe=B(Cb());var o_t=me("prisma:cli:platform:_lib:userAgent"),DP=async()=>{let e=await OSe.getSignature().catch(xo);xe(e)&&o_t(`await checkpoint.getSignature() failed silently with ${e.message}`);let r=xe(e)?"unknown":e;return`prisma-cli/${ISe.version} (Signature: ${r})`};var c_t=new URL("https://console.prisma.io/api"),kSe=new URL("https://console.prisma.io"),ft=async e=>{let r=await DP(),n="POST",i=new ci({"Content-Type":"application/json",Authorization:`Bearer ${e.token}`,"User-Agent":r}),a=JSON.stringify(e.body),o=await Ja(c_t.href,{method:n,headers:i,body:a}),c=await o.text();if(o.status>=400)throw new Error(c);let u=JSON.parse(c);if(u.error)throw new Error(`Error from PDP Platform API: ${c}`);let l=Object.values(u.data).filter(f=>typeof f=="object"&&f!==null&&f.__typename?.startsWith("Error"))[0];if(l)throw u_t({message:"<message not selected from server>",...l});return u.data},u_t=e=>new Error(e.message);var Gm=B(uu()),XSe=B(require("path"));var Bm={};Xn(Bm,{default:()=>A5});var VSe=B(R5(),1);Bx(Bm,B(R5(),1));var A5=VSe.default;var YSe=B(uu()),q_t=(e,{beforeParse:r,reviver:n}={})=>{let i=new TextDecoder().decode(e);return typeof r=="function"&&(i=r(i)),JSON.parse(i,n)},KSe=async(e,r)=>{let n=await YSe.default.readFile(e);return q_t(n,r)};var JSe=new A5("prisma-platform-cli").config(),Um=XSe.default.join(JSe,"auth.json"),j_t=e=>{if(typeof e!="object"||e===null)throw new Error("Invalid credentials");if(typeof e.token!="string")throw new Error("Invalid credentials");return e},ul={path:Um,save:async e=>Gm.default.mkdirp(JSe).then(()=>Gm.default.writeJSON(Um,e)).catch(xo),load:async()=>Gm.default.pathExists(Um).then(e=>e?KSe(Um).then(j_t):null).catch(xo),delete:async()=>Gm.default.pathExists(Um).then(e=>e?Gm.default.remove(Um):void 0).then(()=>null).catch(xo)};var Dt={global:{"--token":String},workspace:{"--token":String,"--workspace":String,"-w":"--workspace"},project:{"--token":String,"--project":String,"-p":"--project"},environment:{"--token":String,"--environment":String,"-e":"--environment"},serviceToken:{"--token":String,"--serviceToken":String,"-s":"--serviceToken"},apikey:{"--token":String,"--apikey":String}},B_t=new Error(`No platform credentials found. Run ${te(Le("prisma platform auth login --early-access"))} first. Alternatively you can provide a token via the \`--token\` or \`-t\` parameters, or set the 'PRISMA_TOKEN' environment variable with a token.`),Ct=async e=>{let r=Vn(e,["--token","-t"],"PRISMA_TOKEN");if(r)return r;let n=await ul.load();if(xe(n))throw n;if(!n)throw B_t;return n.token},U_t="prisma://accelerate.prisma-data.net",PP=e=>{let r=new URL(U_t);return r.searchParams.set("api_key",e),N(r.href)};var O5=class e{static new(){return new e}async parse(r){let n=zn(r,{...Dt.environment}),i=await Ct(n),a=Ft(n,["--environment","-e"]);return await ft({token:i,body:{query:`
|
|||
|
|
mutation ($input: MutationAccelerateDisableInput!) {
|
|||
|
|
accelerateDisable(input: $input) {
|
|||
|
|
__typename
|
|||
|
|
... on Error {
|
|||
|
|
message
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
`,variables:{input:{environmentId:a}}}}),Xe.success(`Accelerate disabled. Prisma clients connected to ${a} will not be able to send queries through Accelerate.`)}};var I5=class e{static new(){return new e}async parse(r){let n=_e(r,{...Dt.environment,"--url":String,"--apikey":Boolean,"--region":String});if(xe(n))return n;let i=await Ct(n),a=Ft(n,["--environment","-e"]),o=Ft(n,["--url"]),c=Vn(n,["--apikey"])??!1,u=Vn(n,["--region"]),{databaseLinkCreate:l}=await ft({token:i,body:{query:`
|
|||
|
|
mutation ($input: MutationDatabaseLinkCreateInput!) {
|
|||
|
|
databaseLinkCreate(input: $input) {
|
|||
|
|
__typename
|
|||
|
|
... on Error {
|
|||
|
|
message
|
|||
|
|
}
|
|||
|
|
... on DatabaseLink {
|
|||
|
|
id
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
`,variables:{input:{environmentId:a,connectionString:o,...u&&{regionId:u}}}}}),{serviceTokenCreate:f}=await ft({token:i,body:{query:`
|
|||
|
|
mutation (
|
|||
|
|
$accelerateEnableInput: MutationAccelerateEnableInput!
|
|||
|
|
$serviceTokenCreateInput: MutationServiceTokenCreateInput!
|
|||
|
|
$withServiceToken: Boolean!
|
|||
|
|
) {
|
|||
|
|
accelerateEnable(input: $accelerateEnableInput) {
|
|||
|
|
__typename
|
|||
|
|
... on Error {
|
|||
|
|
message
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
serviceTokenCreate(input: $serviceTokenCreateInput) @include(if: $withServiceToken) {
|
|||
|
|
__typename
|
|||
|
|
... on Error {
|
|||
|
|
message
|
|||
|
|
}
|
|||
|
|
... on ServiceTokenWithValue {
|
|||
|
|
value
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
`,variables:{withServiceToken:c,accelerateEnableInput:{databaseLinkId:l.id},serviceTokenCreateInput:{environmentId:a}}}}),p=ke("https://pris.ly/d/accelerate-getting-started");return f?Xe.success(`Accelerate enabled. Use this Accelerate connection string to authenticate requests:
|
|||
|
|
|
|||
|
|
${PP(f.value)}
|
|||
|
|
|
|||
|
|
For more information, check out the Getting started guide here: ${p}`):Xe.success(`Accelerate enabled. Use your secure API key in your Accelerate connection string to authenticate requests.
|
|||
|
|
|
|||
|
|
For more information, check out the Getting started guide here: ${p}`)}};var $5={};Xn($5,{$:()=>G_t,Login:()=>TP,Logout:()=>RP,Show:()=>F5});var G_t=ki();var eDe=B(ZSe()),tDe=B(require("http"));var rDe=B(PC());var K_t=me("prisma:cli:platform:login"),TP=class e{static new(){return new e}async parse(r){let n=_e(r,{"--optimize":Boolean});if(xe(n))return n;n["--optimize"]&&console.warn("The '--optimize' flag is deprecated. Use API keys instead.");let i=await ul.load();if(xe(i))throw i;if(i)return`Already authenticated. Run ${te(Le("prisma platform auth show --early-access"))} to see the current user.`;console.info(`Authenticating to Prisma Platform CLI via browser.
|
|||
|
|
`);let a=tDe.default.createServer(),c=await(0,eDe.default)(a,0,"127.0.0.1"),u=await X_t({connection:"github",redirectTo:c.href});console.info("Visit the following URL in your browser to authenticate:"),console.info(ke(u.href));let l=await Promise.all([new Promise((f,p)=>{a.once("request",(g,v)=>{a.close(),v.setHeader("connection","close");let x=new URL(g.url||"/","http://localhost").searchParams,E=x.get("token")??"",D=x.get("error"),P=nDe();if(D)P.pathname+="/error",P.searchParams.set("error",D),p(new Error(D));else{let R=Q_t(x.get("user")??"");if(R){x.delete("token"),x.delete("user"),P.pathname+="/success";let k=new URLSearchParams({...Object.fromEntries(x.entries()),email:R.email});P.search=k.toString(),f({token:E,user:R})}else P.pathname+="/error",P.searchParams.set("error","Invalid user"),p(new Error("Invalid user"))}v.statusCode=302,v.setHeader("location",P.href),v.end()}),a.once("error",p)}),(0,rDe.default)(u.href)]).then(f=>f[0]).catch(xo);if(xe(l))throw new Error(`Authentication failed: ${l.message}`);{let f=await ul.save({token:l.token});if(xe(f))throw new Error("Writing credentials to disk failed",{cause:f})}return mp(`Authentication successful for ${l.user.email}`)}},nDe=()=>new URL("/auth/cli",kSe),X_t=async e=>{let n={client:await DP(),...e},i=J_t(n),a=nDe();return a.searchParams.set("state",i),a},J_t=e=>Buffer.from(JSON.stringify(e),"utf-8").toString("base64"),Q_t=e=>{try{let r=JSON.parse(Buffer.from(e,"base64").toString("utf-8"));return typeof r!="object"||r===null?!1:typeof r.id=="string"&&typeof r.displayName=="string"&&typeof r.email=="string"?r:null}catch(r){return K_t(`parseUser() failed silently with ${r}`),null}};var iDe=e=>{if(typeof e!="string")throw new Error("JWTs must use Compact JWS serialization, JWT must be a string");let{1:r,length:n}=e.split(".");if(n===5)throw new Error("Only JWTs using Compact JWS serialization can be decoded");if(n!==3)throw new Error("Invalid JWT");if(!r)throw new Error("JWTs must contain a payload");let i=C5(()=>atob(r),()=>new Error("Failed to base64 decode the payload."));if(xe(i))return i;let a=C5(()=>JSON.parse(i),()=>new Error("Failed to parse the decoded payload as JSON."));if(xe(a))return a;if(!ASe(a))throw new Error("Invalid JWT Claims Set.");return a};var RP=class e{static new(){return new e}async parse(){let r=await ul.load();if(xe(r))throw r;if(!r)return`You are not currently logged in. Run ${te(Le("prisma platform auth login --early-access"))} to log in.`;if(r.token){let n=iDe(r.token);!xe(n)&&n.jti&&await ft({token:r.token,body:{query:`
|
|||
|
|
mutation ($input: MutationManagementTokenDeleteInput!) {
|
|||
|
|
managementTokenDelete(input: $input) {
|
|||
|
|
__typename
|
|||
|
|
... on Error {
|
|||
|
|
message
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
`,variables:{input:{id:n.jti}}}})}return await ul.delete(),mp("You have logged out.")}};var F5=class e{static new(){return new e}async parse(r){let n=zn(r,{...Dt.global,"--sensitive":Boolean}),i=await Ct(n),{me:a}=await ft({token:i,body:{query:`
|
|||
|
|
query {
|
|||
|
|
me {
|
|||
|
|
__typename
|
|||
|
|
user {
|
|||
|
|
__typename
|
|||
|
|
id
|
|||
|
|
email
|
|||
|
|
displayName
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
`}}),o={...a.user,token:Vn(n,["--sensitive"])?i:null};return Xe.sections([Xe.info(`Currently authenticated as ${te(a.user.email)}`),Xe.resource(o,{email:!0,token:!0})])}};var q5={};Xn(q5,{$:()=>Z_t,Create:()=>L5,Delete:()=>N5,Show:()=>M5});var Z_t=ki();var L5=class e{static new(){return new e}async parse(r){let n=zn(r,{...Dt.project,"--name":String,"-n":"--name"}),i=await Ct(n),a=Ft(n,["--project","-p"]),o=Vn(n,["--name","-n"]),{environmentCreate:c}=await ft({token:i,body:{query:`
|
|||
|
|
mutation ($input: MutationEnvironmentCreateInput!) {
|
|||
|
|
environmentCreate(input: $input) {
|
|||
|
|
__typename
|
|||
|
|
...on Error {
|
|||
|
|
message
|
|||
|
|
}
|
|||
|
|
...on Environment {
|
|||
|
|
id
|
|||
|
|
createdAt
|
|||
|
|
displayName
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
`,variables:{input:{projectId:a,displayName:o}}}});return Xe.resourceCreated(c)}};var N5=class e{static new(){return new e}async parse(r){let n=_e(r,{...Dt.environment});if(xe(n))return n;let i=await Ct(n),a=Ft(n,["--environment","-e"]),{environmentDelete:o}=await ft({token:i,body:{query:`
|
|||
|
|
mutation ($input: MutationEnvironmentDeleteInput!) {
|
|||
|
|
environmentDelete(input: $input) {
|
|||
|
|
__typename
|
|||
|
|
...on Error {
|
|||
|
|
message
|
|||
|
|
}
|
|||
|
|
...on Environment {
|
|||
|
|
id
|
|||
|
|
createdAt
|
|||
|
|
displayName
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
`,variables:{input:{id:a}}}});return Xe.resourceDeleted(o)}};var M5=class e{static new(){return new e}async parse(r){let n=_e(r,{...Dt.project});if(xe(n))return n;let i=await Ct(n),a=Ft(n,["--project","-p"]),{project:o}=await ft({token:i,body:{query:`
|
|||
|
|
query ($input: QueryProjectInput!) {
|
|||
|
|
project(input: $input) {
|
|||
|
|
__typename
|
|||
|
|
... on Error {
|
|||
|
|
message
|
|||
|
|
}
|
|||
|
|
... on Project {
|
|||
|
|
environments {
|
|||
|
|
__typename
|
|||
|
|
id
|
|||
|
|
createdAt
|
|||
|
|
displayName
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
`,variables:{input:{id:a}}}});return Xe.resourceList(o.environments)}};var G5={};Xn(G5,{$:()=>eEt,Create:()=>j5,Delete:()=>B5,Show:()=>U5});var eEt=ki();var j5=class e{static new(){return new e}async parse(r){let n=zn(r,{...Dt.workspace,"--name":String,"-n":"--name"}),i=await Ct(n),a=Ft(n,["--workspace","-w"]),o=Vn(n,["--name","-n"]),{projectCreate:c}=await ft({token:i,body:{query:`
|
|||
|
|
mutation ($input: MutationProjectCreateInput!) {
|
|||
|
|
projectCreate(input: $input) {
|
|||
|
|
__typename
|
|||
|
|
...on Error {
|
|||
|
|
message
|
|||
|
|
}
|
|||
|
|
...on Project {
|
|||
|
|
id
|
|||
|
|
createdAt
|
|||
|
|
displayName
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
`,variables:{input:{workspaceId:a,displayName:o}}}});return Xe.resourceCreated(c)}};var B5=class e{static new(){return new e}async parse(r){let n=_e(r,{...Dt.project});if(xe(n))return n;let i=await Ct(n),a=Ft(n,["--project","-p"]),{projectDelete:o}=await ft({token:i,body:{query:`
|
|||
|
|
mutation ($input: MutationProjectDeleteInput!) {
|
|||
|
|
projectDelete(input: $input) {
|
|||
|
|
__typename
|
|||
|
|
...on Error {
|
|||
|
|
message
|
|||
|
|
}
|
|||
|
|
...on ProjectNode {
|
|||
|
|
id
|
|||
|
|
createdAt
|
|||
|
|
displayName
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
`,variables:{input:{id:a}}}});return Xe.resourceDeleted(o)}};var U5=class e{static new(){return new e}async parse(r){let n=_e(r,{...Dt.workspace});if(xe(n))return n;let i=await Ct(n),a=Ft(n,["--workspace","-w"]),{workspace:o}=await ft({token:i,body:{query:`
|
|||
|
|
query ($input: QueryWorkspaceInput!) {
|
|||
|
|
workspace(input: $input) {
|
|||
|
|
__typename
|
|||
|
|
... on Error {
|
|||
|
|
message
|
|||
|
|
}
|
|||
|
|
... on Workspace {
|
|||
|
|
projects {
|
|||
|
|
__typename
|
|||
|
|
id
|
|||
|
|
createdAt
|
|||
|
|
displayName
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
`,variables:{input:{id:a}}}});return Xe.resourceList(o.projects)}};var z5={};Xn(z5,{$:()=>tEt,Disable:()=>W5,Enable:()=>H5});var tEt=ki();var W5=class e{static new(){return new e}async parse(r){let n=zn(r,{...Dt.environment}),i=await Ct(n),a=Ft(n,["--environment","-e"]);return await ft({token:i,body:{query:`
|
|||
|
|
mutation ($input: MutationPulseDisableInput!) {
|
|||
|
|
pulseDisable(input: $input) {
|
|||
|
|
__typename
|
|||
|
|
... on Error {
|
|||
|
|
message
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
`,variables:{input:{environmentId:a}}}}),Xe.success("Pulse disabled.")}};var H5=class e{static new(){return new e}async parse(r){let n=_e(r,{...Dt.environment,"--url":String,"--apikey":Boolean});if(xe(n))return n;let i=await Ct(n),a=Ft(n,["--environment","-e"]),o=Ft(n,["--url"]),c=Vn(n,["--apikey"])??!1,{databaseLinkCreate:u}=await ft({token:i,body:{query:`
|
|||
|
|
mutation ($input: MutationDatabaseLinkCreateInput!) {
|
|||
|
|
databaseLinkCreate(input: $input) {
|
|||
|
|
__typename
|
|||
|
|
... on Error {
|
|||
|
|
message
|
|||
|
|
}
|
|||
|
|
... on DatabaseLink {
|
|||
|
|
id
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
`,variables:{input:{environmentId:a,connectionString:o}}}}),{serviceTokenCreate:l}=await ft({token:i,body:{query:`
|
|||
|
|
mutation (
|
|||
|
|
$pulseEnableInput: MutationPulseEnableInput!
|
|||
|
|
$serviceTokenCreateInput: MutationServiceTokenCreateInput!
|
|||
|
|
$withServiceToken: Boolean!
|
|||
|
|
) {
|
|||
|
|
pulseEnable(input: $pulseEnableInput) {
|
|||
|
|
__typename
|
|||
|
|
... on Error {
|
|||
|
|
message
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
serviceTokenCreate(input: $serviceTokenCreateInput) @include(if: $withServiceToken) {
|
|||
|
|
__typename
|
|||
|
|
... on Error {
|
|||
|
|
message
|
|||
|
|
}
|
|||
|
|
... on ServiceTokenWithValue {
|
|||
|
|
value
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
`,variables:{withServiceToken:c,pulseEnableInput:{databaseLinkId:u.id},serviceTokenCreateInput:{environmentId:a}}}}),f=ke("https://pris.ly/d/pulse-getting-started");return l?Xe.success(`Pulse enabled. Use this Pulse connection string to authenticate requests:
|
|||
|
|
|
|||
|
|
${PP(l.value)}
|
|||
|
|
|
|||
|
|
For more information, check out the Getting started guide here: ${f}`):Xe.success(`Pulse enabled. Use your secure API key in your Pulse connection string to authenticate requests.
|
|||
|
|
|
|||
|
|
For more information, check out the Getting started guide here: ${f}`)}};var X5={};Xn(X5,{$:()=>rEt,Create:()=>V5,Delete:()=>Y5,Show:()=>K5});var rEt=ki();var V5=class e{constructor(r=!1){this.legacy=r}static new(r=!1){return new e(r)}async parse(r){let n=zn(r,{...Dt.environment,"--name":String,"-n":"--name"}),i=await Ct(n),a=Ft(n,["--environment","-e"]),o=Vn(n,["--name","-n"]),{serviceTokenCreate:c}=await ft({token:i,body:{query:`
|
|||
|
|
mutation ($input: MutationServiceTokenCreateInput!) {
|
|||
|
|
serviceTokenCreate(input: $input) {
|
|||
|
|
__typename
|
|||
|
|
... on Error {
|
|||
|
|
message
|
|||
|
|
}
|
|||
|
|
... on ServiceTokenWithValue {
|
|||
|
|
value
|
|||
|
|
serviceToken {
|
|||
|
|
__typename
|
|||
|
|
id
|
|||
|
|
createdAt
|
|||
|
|
displayName
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
`,variables:{input:{displayName:o,environmentId:a}}}}),u=this.legacy?{...c.serviceToken,__typename:"APIKey"}:c.serviceToken;return Xe.sections([Xe.resourceCreated(u),Xe.info(c.value)])}};var Y5=class e{constructor(r=!1){this.legacy=r}static new(r=!1){return new e(r)}async parse(r){let n=zn(r,{...Dt[this.legacy?"apikey":"serviceToken"]}),i=await Ct(n),a=this.legacy?Ft(n,["--apikey"]):Ft(n,["--serviceToken","-s"]),{serviceTokenDelete:o}=await ft({token:i,body:{query:`
|
|||
|
|
mutation ($input: MutationServiceTokenDeleteInput!) {
|
|||
|
|
serviceTokenDelete(input: $input) {
|
|||
|
|
__typename
|
|||
|
|
... on Error {
|
|||
|
|
message
|
|||
|
|
}
|
|||
|
|
... on ServiceTokenNode {
|
|||
|
|
id
|
|||
|
|
displayName
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
`,variables:{input:{id:a}}}});return Xe.resourceDeleted(this.legacy?{...o,__typename:"APIKey"}:o)}};var K5=class e{constructor(r=!1){this.legacy=r}static new(r=!1){return new e(r)}async parse(r){let n=_e(r,{...Dt.environment});if(xe(n))return n;let i=await Ct(n),a=Ft(n,["--environment","-e"]),{environment:o}=await ft({token:i,body:{query:`
|
|||
|
|
query ($input: QueryEnvironmentInput!) {
|
|||
|
|
environment(input: $input) {
|
|||
|
|
__typename
|
|||
|
|
... on Error {
|
|||
|
|
message
|
|||
|
|
}
|
|||
|
|
... on Environment {
|
|||
|
|
serviceTokens {
|
|||
|
|
id
|
|||
|
|
createdAt
|
|||
|
|
displayName
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
`,variables:{input:{id:a}}}}),c=this.legacy?o.serviceTokens.map(u=>({...u,__typename:"APIKey"})):o.serviceTokens;return Xe.resourceList(c)}};var Q5={};Xn(Q5,{$:()=>nEt,Show:()=>J5});var nEt=ki();var J5=class e{static new(){return new e}async parse(r){let n=zn(r,{...Dt.global}),i=await Ct(n),{me:a}=await ft({token:i,body:{query:`
|
|||
|
|
query {
|
|||
|
|
me {
|
|||
|
|
__typename
|
|||
|
|
workspaces {
|
|||
|
|
id
|
|||
|
|
displayName
|
|||
|
|
createdAt
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
`}});return Xe.resourceList(a.workspaces)}};var P2e=require("@prisma/engines");var sDe=require("buffer");function aDe(e,r,n,i){Object.defineProperty(e,r,{get:n,set:i,enumerable:!0,configurable:!0})}var oDe={};aDe(oDe,"serializeRPCMessage",()=>tq);aDe(oDe,"deserializeRPCMessage",()=>rq);var Z5="PrismaBigInt::",eq="PrismaBytes::";function tq(e){return JSON.stringify(e,(r,n)=>typeof n=="bigint"?Z5+n:n?.type==="Buffer"&&Array.isArray(n?.data)?eq+sDe.Buffer.from(n.data).toString("base64"):n)}function rq(e){return JSON.parse(e,(r,n)=>typeof n=="string"&&n.startsWith(Z5)?BigInt(n.substr(Z5.length)):typeof n=="string"&&n.startsWith(eq)?n.substr(eq.length):n)}var b2e=B(hDe()),xT=B(a2e()),x2e=B(require("http")),w2e=B(u2e()),_2e=require("zlib");var To=require("path");var Mj=require("crypto"),m2e=B(kj());function Lj(e,r,n,i){Object.defineProperty(e,r,{get:n,set:i,enumerable:!0,configurable:!0})}var g2e=globalThis,Fj={},bT={},Dp=g2e.parcelRequire1308;Dp==null&&(Dp=function(e){if(e in Fj)return Fj[e].exports;if(e in bT){var r=bT[e];delete bT[e];var n={id:e,exports:{}};return Fj[e]=n,r.call(n.exports,n,n.exports),n.exports}var i=new Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i},Dp.register=function(r,n){bT[r]=n},g2e.parcelRequire1308=Dp);var v2e=Dp.register;v2e("9lTzd",function(module,exports){Lj(module.exports,"guessEnginePaths",()=>guessEnginePaths),Lj(module.exports,"guessPrismaClientPath",()=>guessPrismaClientPath);var $5COlq=Dp("5COlq");async function guessEnginePaths({forceBinary,forceLibrary,resolveOverrides}){let queryEngineName,queryEngineType;if(forceLibrary?(queryEngineName=await(0,$5COlq.prismaEngineName)("query-engine","library"),queryEngineType="library"):forceBinary?(queryEngineName=await(0,$5COlq.prismaEngineName)("query-engine","binary"),queryEngineType="binary"):(queryEngineName=void 0,queryEngineType=void 0),!queryEngineName||!queryEngineType)return{queryEngine:void 0};let queryEnginePath;if(resolveOverrides[".prisma/client"])queryEnginePath=(0,To.resolve)(resolveOverrides[".prisma/client"],`../${queryEngineName}`);else if(resolveOverrides["@prisma/engines"])queryEnginePath=(0,To.resolve)(resolveOverrides["@prisma/engines"],`../../${queryEngineName}`);else{let atPrismaEnginesPath;try{atPrismaEnginesPath=eval("require.resolve('@prisma/engines')")}catch(e){throw new Error("Unable to resolve Prisma engine paths. This is a bug.")}queryEnginePath=(0,To.resolve)(atPrismaEnginesPath`../../${queryEngineName}`)}return{queryEngine:{type:queryEngineType,path:queryEnginePath}}}function guessPrismaClientPath({resolveOverrides}){let prismaClientPath=resolveOverrides["@prisma/client"]||eval("require.resolve('@prisma/client')");return(0,To.resolve)(prismaClientPath,"../")}});v2e("5COlq",function(e,r){Lj(e.exports,"prismaEngineName",()=>n);async function n(i,a){let o=await Hr(),c=o==="windows"?".exe":"";if(a==="library")return qa(o,"fs");if(a==="binary")return`${i}-${o}${c}`;throw new Error(`Unknown engine type: ${a}`)}});function j2t(e){return{models:$j(e.models),enums:$j(e.enums),types:$j(e.types)}}function $j(e){let r={};for(let{name:n,...i}of e)r[n]=i;return r}var ox=(0,m2e.debug)("prisma:studio-pcw"),B2t=/^\s*datasource\s+([^\s]+)\s*{/m,U2t=/url *= *env\("(.*)"\)/,G2t=/url *= *"(.*)"/;async function W2t({schema:e,schemaPath:r,dmmf:n,datasourceProvider:i,previewFeatures:a,datasources:o,engineType:c,paths:u,directUrl:l,versions:f}){let p=e.match(B2t)?.[1]??"",g=e.match(U2t)?.[1]??null,v=e.match(G2t)?.[1]??null,{getPrismaClient:x,PrismaClientKnownRequestError:E,PrismaClientRustPanicError:D,PrismaClientInitializationError:P,PrismaClientValidationError:R}=require(`${u.prismaClient}/runtime/${c}`),k=e,F=(0,Mj.createHash)("sha256").update(Buffer.from(k,"utf8").toString("base64")).digest("hex"),L=x({runtimeDataModel:j2t(n.datamodel),generator:{name:"studio-client",provider:{value:"prisma-client-js",fromEnvVar:null},output:null,binaryTargets:[],previewFeatures:a,config:{}},clientVersion:f?.prisma??"in-memory",engineVersion:f?.queryEngine??"in-memory",dirname:(0,To.dirname)(r),filename:(0,To.basename)(r),
|
|||
|
|
|
|||
|
|
`,n),process.exit(1)}},this.stop=n=>{gl("Stopping Studio server. Reason:",n),this.server&&this.server.close(i=>{i?gl("Unable to close server: ",i):gl("Closed out remaining connections")})},this.options=r,this.options.schemaPath=(0,w2e.default)(this.options.schemaPath),this.channels={project:new jj(r),prisma:new qj(r),telemetry:new Bj(r)}}};var Gj=B(C2e());var T2e=B(PC()),Wj=B(require("path")),DT=me("prisma:cli:studio"),tAt=Cb(),dg=class dg{static new(){return new dg}async parse(r){let n=_e(r,{"--help":Boolean,"-h":"--help","--port":Number,"-p":"--port","--browser":String,"-b":"--browser","--hostname":String,"-n":"--hostname","--schema":String,"--telemetry-information":String});if(xe(n))return this.help(n.message);if(n["--help"])return this.help();await at({schemaPath:n["--schema"],printMessage:!0});let{schemaPath:i,schemas:a}=await Zr(n["--schema"]),o=n["--hostname"],c=n["--port"]||await(0,Gj.default)({port:Gj.default.makeRange(5555,5600)}),u=n["--browser"]||process.env.BROWSER,l=Wj.default.resolve(__dirname,"../build/public"),f=ey({schemas:a}),p=await Ve({datamodel:a,ignoreEnvVarErrors:!0});process.env.PRISMA_DISABLE_WARNINGS="true";let g=new wT({schemaPath:i,schemaText:f,hostname:o,port:c,staticAssetDir:l,prismaClient:{resolve:{"@prisma/client":Wj.default.resolve(__dirname,"../prisma-client/index.js")},directUrl:bv(PI(p.datasources[0]))},versions:{prisma:tAt.version,queryEngine:P2e.enginesVersion}});await g.start();let v=`http://localhost:${c}`;if(!u||u.toLowerCase()!=="none")try{let x=await(0,T2e.default)(v,{app:u,url:!0});x.on("spawn",()=>{DT(`requested to open the url ${v}`)}),x.on("error",E=>{DT(E),DT(`failed to open the url ${v} in browser`)})}catch(x){DT(x)}return this.instance=g,`Prisma Studio is up on ${v}`}help(r){return r?new Re(`
|
|||
|
|
${N(oe("!"))} ${r}
|
|||
|
|
${dg.help}`):dg.help}};dg.help=$e(`
|
|||
|
|
Browse your data with Prisma Studio
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${J("$")} prisma studio [options]
|
|||
|
|
|
|||
|
|
${N("Options")}
|
|||
|
|
|
|||
|
|
-h, --help Display this help message
|
|||
|
|
-p, --port Port to start Studio on
|
|||
|
|
-b, --browser Browser to open Studio in
|
|||
|
|
-n, --hostname Hostname to bind the Express server to
|
|||
|
|
--schema Custom path to your Prisma schema
|
|||
|
|
|
|||
|
|
${N("Examples")}
|
|||
|
|
|
|||
|
|
Start Studio on the default port
|
|||
|
|
${J("$")} prisma studio
|
|||
|
|
|
|||
|
|
Start Studio on a custom port
|
|||
|
|
${J("$")} prisma studio --port 5555
|
|||
|
|
|
|||
|
|
Start Studio in a specific browser
|
|||
|
|
${J("$")} prisma studio --port 5555 --browser firefox
|
|||
|
|
${J("$")} BROWSER=firefox prisma studio --port 5555
|
|||
|
|
|
|||
|
|
Start Studio without opening in a browser
|
|||
|
|
${J("$")} prisma studio --port 5555 --browser none
|
|||
|
|
${J("$")} BROWSER=none prisma studio --port 5555
|
|||
|
|
|
|||
|
|
Specify a schema
|
|||
|
|
${J("$")} prisma studio --schema=./schema.prisma
|
|||
|
|
`);var CT=dg;var R2e=B(Vh()),PT=class e{static new(){return new e}async parse(){let r=await R2e.getInfo(),n=await oy(),i=cy(),a=r.cacheItems.map(o=>({product:o.output.product,version:o.version,package:o.output.package,release_tag:o.output.release_tag,cli_path:o.cli_path,cli_path_hash:o.output.cli_path_hash,last_reminder:o.last_reminder,cached_at:o.cached_at}));return JSON.stringify({signature:r.signature,cachePath:r.cachePath,current:{projectPathHash:n,cliPathHash:i},cacheItems:a},void 0,2)}};var A2e=B(Vh()),Cp=me("prisma:cli:checkpoint");async function O2e({schemaPath:e,isPrismaInstalledGlobally:r,version:n,command:i,telemetryInformation:a}){if(process.env.CHECKPOINT_DISABLE)return Cp("runCheckpointClientCheck() is disabled by the CHECKPOINT_DISABLE env var."),0;try{let o=performance.now(),[c,{schemaProvider:u,schemaPreviewFeatures:l,schemaGeneratorsProviders:f}]=await Promise.all([oy(),rAt(e)]),p=cy(),v=performance.now()-o;Cp(`runCheckpointClientCheck(): Execution time for getting info: ${v} ms`);let x={product:"prisma",version:n,cli_path_hash:p,project_hash:c,schema_providers:u?[u]:void 0,schema_preview_features:l,schema_generators_providers:f,cli_install_type:r?"global":"local",command:i,information:a||process.env.PRISMA_TELEMETRY_INFORMATION,cli_path:process.argv[1]},E=performance.now(),D=await A2e.check(x),R=performance.now()-E;return Cp(`runCheckpointClientCheck(): Execution time for "await checkpoint.check(data)": ${R} ms`),D}catch(o){return Cp("Error from runCheckpointClientCheck()"),Cp(o),0}}async function rAt(e){let r,n,i;try{let a=await Bn(e);try{let o=await Ve({datamodel:a,ignoreEnvVarErrors:!0});o.datasources.length>0&&(r=o.datasources[0].provider),i=o.generators.filter(u=>u&&u.provider).map(u=>mn(u.provider));let c=o.generators.find(u=>mn(u.provider)==="prisma-client-js");c&&c.previewFeatures.length>0&&(n=c.previewFeatures)}catch(o){Cp("Error from tryToReadDataFromSchema() while processing the schema. This is not a fatal error. It will continue without the processed data."),Cp(o)}}catch{}return{schemaProvider:r,schemaPreviewFeatures:n,schemaGeneratorsProviders:i}}var nAt=["--url","--shadow-database-url","--from-url","--to-url","--schema","--file","--from-schema-datamodel","--to-schema-datamodel","--from-schema-datasource","--to-schema-datasource","--from-migrations","--to-migrations","--hostname","--name","--applied","--rolled-back","--token"],I2e=e=>{let r="[redacted]";for(let n=0;n<e.length;n++){let i=e[n];nAt.forEach(a=>{let o=i===a,c=i.indexOf(a);o?e[n+1]=r:c!==-1&&(e[n]=`${a}=${r}`)})}return e};var k2e=B(require("fs")),F2e=B(require("path"));function $2e(){if(k2e.default.existsSync(F2e.default.join(process.cwd(),"prisma.yml")))throw new Error("We detected a Prisma 1 project. For Prisma 1, please use the `prisma1` CLI instead.\nYou can install it with `npm install -g prisma1`.\nIf you want to upgrade to Prisma 2+, please have a look at our upgrade guide:\nhttp://pris.ly/d/upgrading-to-prisma2")}var L2e=ap();function M2e(e){let r=4,n="",i=e.data.previous_version,a=e.data.current_version,o=N2e(e.data.package,e.data.release_tag),c=N2e("@prisma/client",e.data.release_tag,{canBeGlobal:!1,canBeDev:!1});try{let[f]=i.split("."),[p]=a.split(".");f<p&&(n=`
|
|||
|
|
This is a major update - please follow the guide at
|
|||
|
|
https://pris.ly/d/major-version-upgrade
|
|||
|
|
|
|||
|
|
`,r=r+4)}catch{}let u=`
|
|||
|
|
${Jn("Update available")} ${i} -> ${a}
|
|||
|
|
${n}Run the following to update
|
|||
|
|
${N(o)}
|
|||
|
|
${N(c)}`,l=N0({height:r,width:59,str:u,horizontalPadding:2});console.error(l)}function N2e(e,r,n={canBeGlobal:!0,canBeDev:!0}){let i=process.env.npm_config_user_agent?.includes("yarn"),a="";return L2e==="yarn"&&n.canBeGlobal?a=`yarn global add ${e}`:L2e==="npm"&&n.canBeGlobal?a=`npm i -g ${e}`:i&&n.canBeDev?a=`yarn add --dev ${e}`:n.canBeDev?a=`npm i --save-dev ${e}`:i?a=`yarn add ${e}`:a=`npm i ${e}`,a+=`@${r}`,a}var q2e=B(require("path"));var hg=class hg{static new(){return new hg}async parse(r){let n=_e(r,{"--help":Boolean,"-h":"--help","--schema":String,"--telemetry-information":String});if(n instanceof Error)return this.help(n.message);if(n["--help"])return this.help();await at({schemaPath:n["--schema"],printMessage:!0});let{schemaPath:i,schemas:a}=await Zr(n["--schema"]),{lintDiagnostics:o}=Nk(()=>({lintDiagnostics:Nv({schemas:a})}),{schemas:a}),c=Mv(o);c&&fr.should.warn()&&console.warn(c),hf({schemas:a}),await Ve({datamodel:a,ignoreEnvVarErrors:!1});let u=q2e.default.relative(process.cwd(),i);return a.length>1?`The schemas at ${tt(u)} are valid \u{1F680}`:`The schema at ${tt(u)} is valid \u{1F680}`}help(r){return r?new Re(`
|
|||
|
|
${N(oe("!"))} ${r}
|
|||
|
|
${hg.help}`):hg.help}};hg.help=$e(`
|
|||
|
|
Validate a Prisma schema.
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${J("$")} prisma validate [options]
|
|||
|
|
|
|||
|
|
${N("Options")}
|
|||
|
|
|
|||
|
|
-h, --help Display this help message
|
|||
|
|
--schema Custom path to your Prisma schema
|
|||
|
|
|
|||
|
|
${N("Examples")}
|
|||
|
|
|
|||
|
|
With an existing Prisma schema
|
|||
|
|
${J("$")} prisma validate
|
|||
|
|
|
|||
|
|
Or specify a Prisma schema path
|
|||
|
|
${J("$")} prisma validate --schema=./schema.prisma
|
|||
|
|
|
|||
|
|
`);var TT=hg;var iAt=me("prisma:cli:bin"),G2e=Cb(),Hj=process.argv.slice(2);process.removeAllListeners("warning");process.once("SIGINT",()=>{process.exit(130)});var j2e=_e(Hj,{"--schema":String,"--telemetry-information":String},!1,!0),W2e=I2e([...Hj]).join(" "),sAt=ap();async function aAt(){$2e();let e=rP.new({init:_P.new(),platform:bt.$.new({workspace:bt.Workspace.$.new({show:bt.Workspace.Show.new()}),auth:bt.Auth.$.new({login:bt.Auth.Login.new(),logout:bt.Auth.Logout.new(),show:bt.Auth.Show.new()}),environment:bt.Environment.$.new({create:bt.Environment.Create.new(),delete:bt.Environment.Delete.new(),show:bt.Environment.Show.new()}),project:bt.Project.$.new({create:bt.Project.Create.new(),delete:bt.Project.Delete.new(),show:bt.Project.Show.new()}),pulse:bt.Pulse.$.new({enable:bt.Pulse.Enable.new(),disable:bt.Pulse.Disable.new()}),accelerate:bt.Accelerate.$.new({enable:bt.Accelerate.Enable.new(),disable:bt.Accelerate.Disable.new()}),serviceToken:bt.ServiceToken.$.new({create:bt.ServiceToken.Create.new(),delete:bt.ServiceToken.Delete.new(),show:bt.ServiceToken.Show.new()}),apikey:bt.ServiceToken.$.new({create:bt.ServiceToken.Create.new(!0),delete:bt.ServiceToken.Delete.new(!0),show:bt.ServiceToken.Show.new(!0)})}),migrate:yb.new({dev:xb.new(),status:Db.new(),resolve:Sb.new(),reset:Eb.new(),deploy:bb.new(),diff:_b.new()}),db:nb.new({execute:pb.new(),pull:bm.new(),push:gb.new(),seed:vb.new()}),introspect:bm.new(),studio:CT.new(),generate:xP.new(),version:Om.new(),validate:TT.new(),format:iP.new(),telemetry:PT.new(),debug:nP.new()},["version","init","migrate","db","introspect","studio","generate","validate","format","telemetry"]),r=performance.now(),n=await e.parse(Hj),a=performance.now()-r;if(iAt(`Execution time for executing "await cli.parse(commandArray)": ${a} ms`),n instanceof Re)return console.error(n.message),1;if(xe(n))return console.error(n),1;console.log(n);let o=await O2e({command:W2e,isPrismaInstalledGlobally:sAt,schemaPath:j2e["--schema"],telemetryInformation:j2e["--telemetry-information"],version:G2e.version}),c=process.env.PRISMA_HIDE_UPDATE_MESSAGE;return o&&o.status==="ok"&&o.data.outdated&&!c&&M2e(o),0}eval("require.main === module")&&aAt().then(e=>{e!==0&&process.exit(e)}).catch(e=>{if(typeof e[Symbol.iterator]=="function")for(let r of e)B2e(r);else B2e(e)});function B2e(e){vI(e)?H4({error:e,cliVersion:G2e.version,enginesVersion:U2e.enginesVersion,command:W2e,getDatabaseVersionSafe:k6}).catch(r=>{me.enabled("prisma")?console.error(N(oe("Error: "))+r.stack):console.error(N(oe("Error: "))+r.message)}).finally(()=>{process.exit(1)}):(me.enabled("prisma")?console.error(N(oe("Error: "))+e.stack):console.error(N(oe("Error: "))+e.message),process.exit(1))}$n.default.join(__dirname,"../../engines/query-engine-darwin");$n.default.join(__dirname,"../../engines/schema-engine-darwin");$n.default.join(__dirname,"../../engines/query-engine-windows.exe");$n.default.join(__dirname,"../../engines/schema-engine-windows.exe");$n.default.join(__dirname,"../../engines/query-engine-debian-openssl-1.0.x");$n.default.join(__dirname,"../../engines/schema-engine-debian-openssl-1.0.x");$n.default.join(__dirname,"../../engines/query-engine-debian-openssl-1.1.x");$n.default.join(__dirname,"../../engines/schema-engine-debian-openssl-1.1.x");$n.default.join(__dirname,"../../engines/query-engine-debian-openssl-3.0.x");$n.default.join(__dirname,"../../engines/schema-engine-debian-openssl-3.0.x");$n.default.join(__dirname,"../../engines/query-engine-rhel-openssl-1.0.x");$n.default.join(__dirname,"../../engines/schema-engine-rhel-openssl-1.0.x");$n.default.join(__dirname,"../../engines/query-engine-rhel-openssl-1.1.x");$n.default.join(__dirname,"../../engines/schema-engine-rhel-openssl-1.1.x");$n.default.join(__dirname,"../../engines/query-engine-rhel-openssl-3.0.x");$n.default.join(__dirname,"../../engines/schema-engine-rhel-openssl-3.0.x");
|
|||
|
|
/*! Bundled license information:
|
|||
|
|
|
|||
|
|
is-extglob/index.js:
|
|||
|
|
(*!
|
|||
|
|
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
|||
|
|
*
|
|||
|
|
* Copyright (c) 2014-2016, Jon Schlinkert.
|
|||
|
|
* Licensed under the MIT License.
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
is-glob/index.js:
|
|||
|
|
(*!
|
|||
|
|
* is-glob <https://github.com/jonschlinkert/is-glob>
|
|||
|
|
*
|
|||
|
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|||
|
|
* Released under the MIT License.
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
is-number/index.js:
|
|||
|
|
(*!
|
|||
|
|
* is-number <https://github.com/jonschlinkert/is-number>
|
|||
|
|
*
|
|||
|
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
|||
|
|
* Released under the MIT License.
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
to-regex-range/index.js:
|
|||
|
|
(*!
|
|||
|
|
* to-regex-range <https://github.com/micromatch/to-regex-range>
|
|||
|
|
*
|
|||
|
|
* Copyright (c) 2015-present, Jon Schlinkert.
|
|||
|
|
* Released under the MIT License.
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
fill-range/index.js:
|
|||
|
|
(*!
|
|||
|
|
* fill-range <https://github.com/jonschlinkert/fill-range>
|
|||
|
|
*
|
|||
|
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
|||
|
|
* Licensed under the MIT License.
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
queue-microtask/index.js:
|
|||
|
|
(*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|||
|
|
|
|||
|
|
run-parallel/index.js:
|
|||
|
|
(*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|||
|
|
|
|||
|
|
fetch-blob/index.js:
|
|||
|
|
(*! fetch-blob. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
|
|||
|
|
|
|||
|
|
formdata-polyfill/esm.min.js:
|
|||
|
|
(*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
|
|||
|
|
|
|||
|
|
node-domexception/index.js:
|
|||
|
|
(*! node-domexception. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
|
|||
|
|
|
|||
|
|
progress/lib/node-progress.js:
|
|||
|
|
(*!
|
|||
|
|
* node-progress
|
|||
|
|
* Copyright(c) 2011 TJ Holowaychuk <tj@vision-media.ca>
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
normalize-path/index.js:
|
|||
|
|
(*!
|
|||
|
|
* normalize-path <https://github.com/jonschlinkert/normalize-path>
|
|||
|
|
*
|
|||
|
|
* Copyright (c) 2014-2018, Jon Schlinkert.
|
|||
|
|
* Released under the MIT License.
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
safe-buffer/index.js:
|
|||
|
|
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|||
|
|
|
|||
|
|
archiver/lib/error.js:
|
|||
|
|
(**
|
|||
|
|
* Archiver Core
|
|||
|
|
*
|
|||
|
|
* @ignore
|
|||
|
|
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
|
|||
|
|
* @copyright (c) 2012-2014 Chris Talkington, contributors.
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
archiver/lib/core.js:
|
|||
|
|
(**
|
|||
|
|
* Archiver Core
|
|||
|
|
*
|
|||
|
|
* @ignore
|
|||
|
|
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
|
|||
|
|
* @copyright (c) 2012-2014 Chris Talkington, contributors.
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
crc-32/crc32.js:
|
|||
|
|
(*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com *)
|
|||
|
|
|
|||
|
|
zip-stream/index.js:
|
|||
|
|
(**
|
|||
|
|
* ZipStream
|
|||
|
|
*
|
|||
|
|
* @ignore
|
|||
|
|
* @license [MIT]{@link https://github.com/archiverjs/node-zip-stream/blob/master/LICENSE}
|
|||
|
|
* @copyright (c) 2014 Chris Talkington, contributors.
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
archiver/lib/plugins/zip.js:
|
|||
|
|
(**
|
|||
|
|
* ZIP Format Plugin
|
|||
|
|
*
|
|||
|
|
* @module plugins/zip
|
|||
|
|
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
|
|||
|
|
* @copyright (c) 2012-2014 Chris Talkington, contributors.
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
archiver/lib/plugins/tar.js:
|
|||
|
|
(**
|
|||
|
|
* TAR Format Plugin
|
|||
|
|
*
|
|||
|
|
* @module plugins/tar
|
|||
|
|
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
|
|||
|
|
* @copyright (c) 2012-2014 Chris Talkington, contributors.
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
archiver/lib/plugins/json.js:
|
|||
|
|
(**
|
|||
|
|
* JSON Format Plugin
|
|||
|
|
*
|
|||
|
|
* @module plugins/json
|
|||
|
|
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
|
|||
|
|
* @copyright (c) 2012-2014 Chris Talkington, contributors.
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
archiver/index.js:
|
|||
|
|
(**
|
|||
|
|
* Archiver Vending
|
|||
|
|
*
|
|||
|
|
* @ignore
|
|||
|
|
* @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
|
|||
|
|
* @copyright (c) 2012-2014 Chris Talkington, contributors.
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
tmp/lib/tmp.js:
|
|||
|
|
(*!
|
|||
|
|
* Tmp
|
|||
|
|
*
|
|||
|
|
* Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
|
|||
|
|
*
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
is-windows/index.js:
|
|||
|
|
(*!
|
|||
|
|
* is-windows <https://github.com/jonschlinkert/is-windows>
|
|||
|
|
*
|
|||
|
|
* Copyright © 2015-2018, Jon Schlinkert.
|
|||
|
|
* Released under the MIT License.
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
object-assign/index.js:
|
|||
|
|
(*
|
|||
|
|
object-assign
|
|||
|
|
(c) Sindre Sorhus
|
|||
|
|
@license MIT
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
vary/index.js:
|
|||
|
|
(*!
|
|||
|
|
* vary
|
|||
|
|
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
depd/lib/compat/callsite-tostring.js:
|
|||
|
|
(*!
|
|||
|
|
* depd
|
|||
|
|
* Copyright(c) 2014 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
depd/lib/compat/event-listener-count.js:
|
|||
|
|
(*!
|
|||
|
|
* depd
|
|||
|
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
depd/lib/compat/index.js:
|
|||
|
|
(*!
|
|||
|
|
* depd
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
depd/index.js:
|
|||
|
|
(*!
|
|||
|
|
* depd
|
|||
|
|
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
bytes/index.js:
|
|||
|
|
(*!
|
|||
|
|
* bytes
|
|||
|
|
* Copyright(c) 2012-2014 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2015 Jed Watson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
content-type/index.js:
|
|||
|
|
(*!
|
|||
|
|
* content-type
|
|||
|
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
statuses/index.js:
|
|||
|
|
(*!
|
|||
|
|
* statuses
|
|||
|
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
|
* Copyright(c) 2016 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
toidentifier/index.js:
|
|||
|
|
(*!
|
|||
|
|
* toidentifier
|
|||
|
|
* Copyright(c) 2016 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
http-errors/index.js:
|
|||
|
|
(*!
|
|||
|
|
* http-errors
|
|||
|
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
|
* Copyright(c) 2016 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
unpipe/index.js:
|
|||
|
|
(*!
|
|||
|
|
* unpipe
|
|||
|
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
raw-body/index.js:
|
|||
|
|
(*!
|
|||
|
|
* raw-body
|
|||
|
|
* Copyright(c) 2013-2014 Jonathan Ong
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
ee-first/index.js:
|
|||
|
|
(*!
|
|||
|
|
* ee-first
|
|||
|
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
on-finished/index.js:
|
|||
|
|
(*!
|
|||
|
|
* on-finished
|
|||
|
|
* Copyright(c) 2013 Jonathan Ong
|
|||
|
|
* Copyright(c) 2014 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
body-parser/lib/read.js:
|
|||
|
|
(*!
|
|||
|
|
* body-parser
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
media-typer/index.js:
|
|||
|
|
(*!
|
|||
|
|
* media-typer
|
|||
|
|
* Copyright(c) 2014 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
mime-db/index.js:
|
|||
|
|
(*!
|
|||
|
|
* mime-db
|
|||
|
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
|
* Copyright(c) 2015-2022 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
mime-types/index.js:
|
|||
|
|
(*!
|
|||
|
|
* mime-types
|
|||
|
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
type-is/index.js:
|
|||
|
|
(*!
|
|||
|
|
* type-is
|
|||
|
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
body-parser/lib/types/json.js:
|
|||
|
|
(*!
|
|||
|
|
* body-parser
|
|||
|
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
body-parser/lib/types/raw.js:
|
|||
|
|
(*!
|
|||
|
|
* body-parser
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
body-parser/lib/types/text.js:
|
|||
|
|
(*!
|
|||
|
|
* body-parser
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
body-parser/lib/types/urlencoded.js:
|
|||
|
|
(*!
|
|||
|
|
* body-parser
|
|||
|
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
body-parser/index.js:
|
|||
|
|
(*!
|
|||
|
|
* body-parser
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
merge-descriptors/index.js:
|
|||
|
|
(*!
|
|||
|
|
* merge-descriptors
|
|||
|
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
encodeurl/index.js:
|
|||
|
|
(*!
|
|||
|
|
* encodeurl
|
|||
|
|
* Copyright(c) 2016 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
escape-html/index.js:
|
|||
|
|
(*!
|
|||
|
|
* escape-html
|
|||
|
|
* Copyright(c) 2012-2013 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2015 Andreas Lubbe
|
|||
|
|
* Copyright(c) 2015 Tiancheng "Timothy" Gu
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
parseurl/index.js:
|
|||
|
|
(*!
|
|||
|
|
* parseurl
|
|||
|
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
|
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
finalhandler/index.js:
|
|||
|
|
(*!
|
|||
|
|
* finalhandler
|
|||
|
|
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
express/lib/router/layer.js:
|
|||
|
|
(*!
|
|||
|
|
* express
|
|||
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2013 Roman Shtylman
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
methods/index.js:
|
|||
|
|
(*!
|
|||
|
|
* methods
|
|||
|
|
* Copyright(c) 2013-2014 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2015-2016 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
express/lib/router/route.js:
|
|||
|
|
(*!
|
|||
|
|
* express
|
|||
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2013 Roman Shtylman
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
express/lib/router/index.js:
|
|||
|
|
(*!
|
|||
|
|
* express
|
|||
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2013 Roman Shtylman
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
express/lib/middleware/init.js:
|
|||
|
|
(*!
|
|||
|
|
* express
|
|||
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2013 Roman Shtylman
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
express/lib/middleware/query.js:
|
|||
|
|
(*!
|
|||
|
|
* express
|
|||
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2013 Roman Shtylman
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
express/lib/view.js:
|
|||
|
|
(*!
|
|||
|
|
* express
|
|||
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2013 Roman Shtylman
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
content-disposition/index.js:
|
|||
|
|
(*!
|
|||
|
|
* content-disposition
|
|||
|
|
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
destroy/index.js:
|
|||
|
|
(*!
|
|||
|
|
* destroy
|
|||
|
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
etag/index.js:
|
|||
|
|
(*!
|
|||
|
|
* etag
|
|||
|
|
* Copyright(c) 2014-2016 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
fresh/index.js:
|
|||
|
|
(*!
|
|||
|
|
* fresh
|
|||
|
|
* Copyright(c) 2012 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2016-2017 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
range-parser/index.js:
|
|||
|
|
(*!
|
|||
|
|
* range-parser
|
|||
|
|
* Copyright(c) 2012-2014 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2015-2016 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
send/index.js:
|
|||
|
|
(*!
|
|||
|
|
* send
|
|||
|
|
* Copyright(c) 2012 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2014-2016 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
forwarded/index.js:
|
|||
|
|
(*!
|
|||
|
|
* forwarded
|
|||
|
|
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
proxy-addr/index.js:
|
|||
|
|
(*!
|
|||
|
|
* proxy-addr
|
|||
|
|
* Copyright(c) 2014-2016 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
express/lib/utils.js:
|
|||
|
|
(*!
|
|||
|
|
* express
|
|||
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
express/lib/application.js:
|
|||
|
|
(*!
|
|||
|
|
* express
|
|||
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2013 Roman Shtylman
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
negotiator/index.js:
|
|||
|
|
(*!
|
|||
|
|
* negotiator
|
|||
|
|
* Copyright(c) 2012 Federico Romero
|
|||
|
|
* Copyright(c) 2012-2014 Isaac Z. Schlueter
|
|||
|
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
accepts/index.js:
|
|||
|
|
(*!
|
|||
|
|
* accepts
|
|||
|
|
* Copyright(c) 2014 Jonathan Ong
|
|||
|
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
express/lib/request.js:
|
|||
|
|
(*!
|
|||
|
|
* express
|
|||
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2013 Roman Shtylman
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
cookie/index.js:
|
|||
|
|
(*!
|
|||
|
|
* cookie
|
|||
|
|
* Copyright(c) 2012-2014 Roman Shtylman
|
|||
|
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
express/lib/response.js:
|
|||
|
|
(*!
|
|||
|
|
* express
|
|||
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
serve-static/index.js:
|
|||
|
|
(*!
|
|||
|
|
* serve-static
|
|||
|
|
* Copyright(c) 2010 Sencha Inc.
|
|||
|
|
* Copyright(c) 2011 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2014-2016 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
express/lib/express.js:
|
|||
|
|
(*!
|
|||
|
|
* express
|
|||
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2013 Roman Shtylman
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
|
|||
|
|
express/index.js:
|
|||
|
|
(*!
|
|||
|
|
* express
|
|||
|
|
* Copyright(c) 2009-2013 TJ Holowaychuk
|
|||
|
|
* Copyright(c) 2013 Roman Shtylman
|
|||
|
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|||
|
|
* MIT Licensed
|
|||
|
|
*)
|
|||
|
|
*/
|