2592 lines
2.1 MiB
JavaScript
2592 lines
2.1 MiB
JavaScript
|
|
#!/usr/bin/env node
|
|||
|
|
"use strict";var OOe=Object.create;var kg=Object.defineProperty;var IOe=Object.getOwnPropertyDescriptor;var kOe=Object.getOwnPropertyNames;var FOe=Object.getPrototypeOf,$Oe=Object.prototype.hasOwnProperty;var a9=e=>{throw TypeError(e)};var LOe=(e,r,n)=>r in e?kg(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n;var Mp=(e,r)=>()=>(e&&(r=e(e=0)),r);var S=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Qn=(e,r)=>{for(var n in r)kg(e,n,{get:r[n],enumerable:!0})},Gx=(e,r,n,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of kOe(r))!$Oe.call(e,a)&&a!==n&&kg(e,a,{get:()=>r[a],enumerable:!(i=IOe(r,a))||i.enumerable});return e},Wx=(e,r,n)=>(Gx(e,r,"default"),n&&Gx(n,r,"default")),U=(e,r,n)=>(n=e!=null?OOe(FOe(e)):{},Gx(r||!e||!e.__esModule?kg(n,"default",{value:e,enumerable:!0}):n,e)),NOe=e=>Gx(kg({},"__esModule",{value:!0}),e);var Qe=(e,r,n)=>LOe(e,typeof r!="symbol"?r+"":r,n),tR=(e,r,n)=>r.has(e)||a9("Cannot "+n);var $=(e,r,n)=>(tR(e,r,"read from private field"),n?n.call(e):r.get(e)),Ee=(e,r,n)=>r.has(e)?a9("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(e):r.set(e,n),fe=(e,r,n,i)=>(tR(e,r,"write to private field"),i?i.call(e,n):r.set(e,n),n),de=(e,r,n)=>(tR(e,r,"access private method"),n);var Fc=(e,r,n,i)=>({set _(a){fe(e,r,a,n)},get _(){return $(e,r,i)}});var gR=S((aOt,mR)=>{"use strict";var st=mR.exports;mR.exports.default=st;var Rt="\x1B[",jg="\x1B]",jp="\x07",Zx=";",C9=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=C9?"\x1B7":Rt+"s";st.cursorRestorePosition=C9?"\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=jp;st.link=(e,r)=>[jg,"8",Zx,Zx,r,jp,e,jg,"8",Zx,Zx,jp].join("");st.image=(e,r={})=>{let n=`${jg}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")+jp};st.iTerm={setCwd:(e=process.cwd())=>`${jg}50;CurrentDir=${e}${jp}`,annotation:(e,r={})=>{let n=`${jg}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+jp}}});var ew=S((oOt,T9)=>{"use strict";T9.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 bR=S((cOt,R9)=>{"use strict";var DIe=require("os"),P9=require("tty"),ys=ew(),{env:rn}=process,qc;ys("no-color")||ys("no-colors")||ys("color=false")||ys("color=never")?qc=0:(ys("color")||ys("colors")||ys("color=true")||ys("color=always"))&&(qc=1);"FORCE_COLOR"in rn&&(rn.FORCE_COLOR==="true"?qc=1:rn.FORCE_COLOR==="false"?qc=0:qc=rn.FORCE_COLOR.length===0?1:Math.min(parseInt(rn.FORCE_COLOR,10),3));function vR(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function yR(e,r){if(qc===0)return 0;if(ys("color=16m")||ys("color=full")||ys("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 SU=S((POt,Gg)=>{"use strict";var Ug=require("path"),_U=rw(),EU=e=>{e={cwd:process.cwd(),path:process.env[_U()],execPath:process.execPath,...e};let r,n=Ug.resolve(e.cwd),i=[];for(;r!==n;)i.push(Ug.join(n,"node_modules/.bin")),r=n,n=Ug.resolve(n,"..");let a=Ug.resolve(e.cwd,e.execPath,"..");return i.push(a),i.concat(e.path).join(Ug.delimiter)};Gg.exports=EU;Gg.exports.default=EU;Gg.exports.env=e=>{e={env:process.env,...e};let r={...e.env},n=_U({env:r});return e.path=r[n],r[n]=Gg.exports(e),r}});var CU=S((ROt,$R)=>{"use strict";var DU=(e,r)=>{for(let n of Reflect.ownKeys(r))Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n));return e};$R.exports=DU;$R.exports.default=DU});var LR=S((AOt,iw)=>{"use strict";var tke=CU(),nw=new WeakMap,TU=(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(nw.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 tke(o,e),nw.set(o,i),o};iw.exports=TU;iw.exports.default=TU;iw.exports.callCount=e=>{if(!nw.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return nw.get(e)}});var PU=S(sw=>{"use strict";Object.defineProperty(sw,"__esModule",{value:!0});sw.SIGNALS=void 0;var rke=[{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 T?(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};FU.exports=wke});var NU=S((LOt,MR)=>{"use strict";var ow=["stdin","stdout","stderr"],_ke=e=>ow.some(r=>e[r]!==void 0),LU=e=>{if(!e)return;let{stdio:r}=e;if(r===void 0)return ow.map(i=>e[i]);if(_ke(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${ow.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,ow.length);return Array.from({length:n},(i,a)=>r[a])};MR.exports=LU;MR.exports.node=e=>{let r=LU(e);return r==="ipc"?"ipc":r===void 0||typeof r=="string"?[r,r,r,"ipc"]:r.includes("ipc")?r:[...r,"ipc"]}});var MU=S((NOt,cw)=>{"use strict";cw.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&cw.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&cw.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var BR=S((MOt,Kp)=>{"use strict";var ar=global.process,Tl=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"};Tl(ar)?(qU=require("assert"),zp=MU(),jU=/^win/i.test(ar.platform),Wg=require("events"),typeof Wg!="function"&&(Wg=Wg.EventEmitter),ar.__signal_exit_emitter__?nn=ar.__signal_exit_emitter__:(nn=ar.__signal_exit_emitter__=new Wg,nn.count=0,nn.emitted={}),nn.infinite||(nn.setMaxListeners(1/0),nn.infinite=!0),Kp.exports=function(e,r){if(!Tl(global.process))return function(){};qU.equal(typeof e,"function","a callback must be provided for exit handler"),Vp===!1&&qR();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&&uw()};return nn.on(n,e),i},uw=function(){!Vp||!Tl(global.process)||(Vp=!1,zp.forEach(function(r){try{ar.removeListener(r,lw[r])}catch{}}),ar.emit=fw,ar.reallyExit=jR,nn.count-=1)},Kp.exports.unload=uw,Pl=function(r,n,i){nn.emitted[r]||(nn.emitted[r]=!0,nn.emit(r,n,i))},lw={},zp.forEach(function(e){lw[e]=function(){if(Tl(global.process)){var n=ar.listeners(e);n.length===nn.count&&(uw(),Pl("exit",null,e),Pl("afterexit",null,e),jU&&e==="SIGHUP"&&(e="SIGINT"),ar.kill(ar.pid,e))}}}),Kp.exports.signals=function(){return zp},Vp=!1,qR=function(){Vp||!Tl(global.process)||(Vp=!0,nn.count+=1,zp=zp.filter(function(r){try{return ar.on(r,lw[r]),!0}catch{return!1}}),ar.emit=UU,ar.reallyExit=BU)},Kp.exports.load=qR,jR=ar.reallyExit,BU=function(r){Tl(global.process)&&(ar.exitCode=r||0,Pl("exit",ar.exitCode,null),Pl("afterexit",ar.exitCode,null),jR.call(ar,ar.exitCode))},fw=ar.emit,UU=function(r,n){if(r==="exit"&&Tl(global.process)){n!==void 0&&(ar.exitCode=n);var i=fw.apply(this,arguments);return Pl("exit",ar.exitCode,null),Pl("afterexit",ar.exitCode,null),i}else return fw.apply(this,arguments)}):Kp.exports=function(){return function(){}};var qU,zp,jU,Wg,nn,uw,Pl,lw,Vp,qR,jR,BU,fw,UU});var WU=S((qOt,GU)=>{"use strict";var Eke=require("os"),Ske=BR(),Dke=1e3*5,Cke=(e,r="SIGTERM",n={})=>{let i=e(r);return Tke(e,r,n,i),i},Tke=(e,r,n,i)=>{if(!Pke(r,n,i))return;let a=Ake(n),o=setTimeout(()=>{e("SIGKILL")},a);o.unref&&o.unref()},Pke=(e,{forceKillAfterTimeout:r},n)=>Rke(e)&&r!==!1&&n,Rke=e=>e===Eke.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",Ake=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return Dke;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},Oke=(e,r)=>{e.kill()&&(r.isCanceled=!0)},Ike
|
|||
|
|
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 iG(this.pattern,this.options)}parse(r,n){Fw(r);let i=this.options;if(r==="**")if(i.noglobstar)r="*";else return ra;if(r==="")return"";let a="",o=!!i.nocase,c=!1,u=[],l=[],f,p=!1,g=-1,v=-1,x,E,D,T=r.charAt(0)==="."?"":i.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",R=()=>{if(f){switch(f){case"*":a+=a2,o=!0;break;case"?":a+=c2,o=!0;break;default:a+="\\"+f;break}this.debug("clearStateChar %j %j",f,a),f=!1}};for(let L=0,B;L<r.length&&(B=r.charAt(L));L++){if(this.debug("%s %s %s %j",r,L,a,B),c){if(B==="/")return!1;tG[B]&&(a+="\\"),a+=B,c=!1;continue}switch(B){case"/":return!1;case"\\":R(),c=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s %s %s %j <-- stateChar",r,L,a,B),p){this.debug(" in class"),B==="!"&&L===v+1&&(B="^"),a+=B;continue}this.debug("call clearStateChar %j",f),R(),f=B,i.noext&&R();continue;case"(":if(p){a+="(";continue}if(!f){a+="\\(";continue}u.push({type:f,start:L-1,reStart:a.length,open:eG[f].open,close:eG[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+="\\"+B;continue}p=!0,v=L,g=a.length,a+=B;continue;case"]":if(L===v+1||!p){a+="\\"+B;continue}x=r.substring(v+1,L);try{RegExp("["+x+"]")}catch{D=this.parse(x,kw),a=a.substr(0,g)+"\\["+D[0]+"\\]",o=o||D[1],p=!1;continue}o=!0,p=!1,a+=B;continue;default:R(),tG[B]&&!(B==="^"&&p)&&(a+="\\"),a+=B;break}}for(p&&(x=r.substr(v+1),D=this.parse(x,kw),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 B=E.type==="*"?a2:E.type==="?"?c2:"\\"+E.type;o=!0,a=a.slice(0,E.reStart)+B+"\\("+L}R(),c&&(a+="\\\\");let k=I$e[a.charAt(0)];for(let L=l.length-1;L>-1;L--){let B=l[L],V=a.slice(0,B.reStart),j=a.slice(B.reStart,B.reEnd-8),W=a.slice(B.reEnd),q=a.slice(B.reEnd-8,B.reEnd)+W,X=V.split("(").length-1,M=W;for(let ee=0;ee<X;ee++)M=M.replace(/\)[+*?]?/,"");W=M;let J=W===""&&n!==kw?"$":"";a=V+j+W+J+q}if(a!==""&&o&&(a="(?=.)"+a),k&&(a=T+a),n===kw)return[a,o];if(!o)return F$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?a2:n.dot?A$e:O$e,a=n.nocase?"i":"",o=r.map(c=>(c=c.map(u=>typeof u=="string"?$$e(u):u===ra?ra:u._src).reduce((u,l)=>(u[u.length-1]===ra&&l===ra||u.push(l),u),[]),c.forEach((u,l)=>{u!==ra||c[l-1]===ra||(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]=ra))}),c.filter(u=>u!==ra).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;o2.sep!=="/"&&(r=r.split(o2.sep).join("/")),r=r.split(rG),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 ji.defaults(r).Minimatch}};ji.Minimatch=td});var l2=S(aG=>{"use strict";var L$e=sG().Minimatch,N$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};aG.create=(e,r,n)=>{let i;typeof r=="string"?i=[r]:i=r;let a=i.map(c=>N$e(e,c)).map(c=>new L$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 mG=S($w=>{"use strict";var M$e=require("path"),cG=Iw(),uG=ed(),lG=l2(),oG=Dn(),q$e=(e,r,n)=>{let i=`${e}([path], options)`;oG.argument(i,"path",r,["string"]),oG.options(i,"options",n,{matching:["string","array of string"],filter:["function"],files:["boolean"],directories:["boolean"],recursive:["boolean"],ignoreCase:["boolean"]})},fG=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},pG=(e,r)=>e.map(n=>M$e.relative(r,n)),dG=e=>{let r=new Error(`Path you want to find stuff in doesn't exist ${e}`);return r.code="ENOENT",r},hG=e=>{let r=new Error(`Path you want to find stuff in must be a directory ${e}`);return r.code="ENOTDIR",r},j$e=(e,r)=>{let n=[],i=lG.create(e,r.matching,r.ignoreCase),a=1/0;return r.recursive===!1&&(a=1),cG.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(),pG(n,r.cwd)},B$e=(e,r)=>{let n=uG.sync(e,{symlinks:"follow"});if(n===void 0)throw dG(e);if(n.type!=="dir")throw hG(e);return j$e(e,fG(r))},U$e=(e,r)=>new Promise((n,i)=>{let a=[],o=lG.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(pG(a,r.cwd)))};cG.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 sH=S((zIt,iH)=>{"use strict";var RLe=b1(),{MAX_LENGTH:tH,CHAR_BACKSLASH:F2,CHAR_BACKTICK:ALe,CHAR_COMMA:OLe,CHAR_DOT:ILe,CHAR_LEFT_PARENTHESES:kLe,CHAR_RIGHT_PARENTHESES:FLe,CHAR_LEFT_CURLY_BRACE:$Le,CHAR_RIGHT_CURLY_BRACE:LLe,CHAR_LEFT_SQUARE_BRACKET:rH,CHAR_RIGHT_SQUARE_BRACKET:nH,CHAR_DOUBLE_QUOTE:NLe,CHAR_SINGLE_QUOTE:MLe,CHAR_NO_BREAK_SPACE:qLe,CHAR_ZERO_WIDTH_NOBREAK_SPACE:jLe}=eH(),BLe=(e,r={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let n=r||{},i=typeof n.maxLength=="number"?Math.min(tH,n.maxLength):tH;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=T=>{if(T.type==="text"&&u.type==="dot"&&(u.type="text"),u&&u.type==="text"&&T.type==="text"){u.value+=T.value;return}return c.nodes.push(T),T.parent=c,T.prev=u,u=T,T};for(D({type:"bos"});p<f;)if(c=o[o.length-1],v=E(),!(v===jLe||v===qLe)){if(v===F2){D({type:"text",value:(r.keepEscaping?v:"")+E()});continue}if(v===nH){D({type:"text",value:"\\"+v});continue}if(v===rH){l++;let T=!0,R;for(;p<f&&(R=E());){if(v+=R,R===rH){l++;continue}if(R===F2){v+=E();continue}if(R===nH&&(l--,l===0))break}D({type:"text",value:v});continue}if(v===kLe){c=D({type:"paren",nodes:[]}),o.push(c),D({type:"text",value:v});continue}if(v===FLe){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===NLe||v===MLe||v===ALe){let T=v,R;for(r.keepQuotes!==!0&&(v="");p<f&&(R=E());){if(R===F2){v+=R+E();continue}if(R===T){r.keepQuotes===!0&&(v+=R);break}v+=R}D({type:"text",value:v});continue}if(v===$Le){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===LLe){if(c.type!=="brace"){D({type:"text",value:v});continue}let T="close";c=o.pop(),c.close=!0,D({type:T,value:v}),g--,c=o[o.length-1];continue}if(v===OLe&&g>0){if(c.ranges>0){c.ranges=0;let T=c.nodes.shift();c.nodes=[T,{type:"text",value:RLe(c)}]}D({type:"comma",value:v}),c.commas++;continue}if(v===ILe&&g>0&&c.commas===0){let T=c.nodes;if(g===0||T.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"){T.pop();let R=T[T.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 T=o[o.length-1],R=T.nodes.indexOf(c);T.nodes.splice(R,1,...c.nodes)}while(o.length>0);return D({type:"eos"}),a};iH.exports=BLe});var $2=S((VIt,oH)=>{"use strict";var aH=b1(),ULe=YW(),GLe=JW(),WLe=sH(),Ui=(e,r={})=>{let n=[];if(Array.isArray(e))for(let i of e){let a=Ui.create(i,r);Array.isArray(a)?n.push(...a):n.push(a)}else n=[].concat(Ui.create(e,r));return r&&r.expand===!0&&r.nodupes===!0&&(n=[...new Set(n)]),n};Ui.parse=(e,r={})=>WLe(e,r);Ui.stringify=(e,r={})=>aH(typeof e=="string"?Ui.parse(e,r):e,r);Ui.compile=(e,r={})=>(typeof e=="string"&&(e=Ui.parse(e,r)),ULe(e,r));Ui.expand=(e,r={})=>{typeof e=="string"&&(e=Ui.parse(e,r));let n=GLe(e,r);return r.noempty===!0&&(n=n.filter(Boolean)),r.nodupes===!0&&(n=[...new Set(n)]),n};Ui.create=(e,r={})=>e===""||e.length<3?[e]:r.expand!==!0?Ui.compile(e,r):Ui.expand(e,r);oH.exports=Ui});var tv=S((KIt,pH)=>{"use strict";var HLe=require("path"),Ha="\\\\/",cH=`[^${Ha}]`,ko="\\.",zLe="\\+",VLe="\\?",_1="\\/",KLe="(?=.)",uH="[^/]",L2=`(?:${_1}|$)`,lH=`(?:
|
|||
|
|
GFS4: `),console.error(e)});lr[Cn]||(OV=global[Cn]||[],kV(lr,OV),lr.close=function(e){function r(n,i){return e.call(lr,n,function(a){a||IV(),typeof i=="function"&&i.apply(this,arguments)})}return Object.defineProperty(r,r_,{value:e}),r}(lr.close),lr.closeSync=function(e){function r(n){e.apply(lr,arguments),IV()}return Object.defineProperty(r,r_,{value:e}),r}(lr.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Nl(lr[Cn]),require("assert").equal(lr[Cn].length,0)}));var OV;global[Cn]||kV(global,lr[Cn]);PO.exports=CO(O4e(lr));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!lr.__patched&&(PO.exports=CO(lr),lr.__patched=!0);function CO(e){R4e(e),e.gracefulify=CO,e.createReadStream=B,e.createWriteStream=V;var r=e.readFile;e.readFile=n;function n(q,X,M){return typeof X=="function"&&(M=X,X=null),J(q,X,M);function J(ee,ce,H,K){return r(ee,ce,function(ie){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?ld([J,[ee,ce,H],ie,K||Date.now(),Date.now()]):typeof H=="function"&&H.apply(this,arguments)})}}var i=e.writeFile;e.writeFile=a;function a(q,X,M,J){return typeof M=="function"&&(J=M,M=null),ee(q,X,M,J);function ee(ce,H,K,ie,ae){return i(ce,H,K,function(le){le&&(le.code==="EMFILE"||le.code==="ENFILE")?ld([ee,[ce,H,K,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,J){return typeof M=="function"&&(J=M,M=null),ee(q,X,M,J);function ee(ce,H,K,ie,ae){return o(ce,H,K,function(le){le&&(le.code==="EMFILE"||le.code==="ENFILE")?ld([ee,[ce,H,K,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,J){return typeof M=="function"&&(J=M,M=0),ee(q,X,M,J);function ee(ce,H,K,ie,ae){return u(ce,H,K,function(le){le&&(le.code==="EMFILE"||le.code==="ENFILE")?ld([ee,[ce,H,K,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 J=p.test(process.version)?function(H,K,ie,ae){return f(H,ee(H,K,ie,ae))}:function(H,K,ie,ae){return f(H,K,ee(H,K,ie,ae))};return J(q,X,M);function ee(ce,H,K,ie){return function(ae,le){ae&&(ae.code==="EMFILE"||ae.code==="ENFILE")?ld([J,[ce,H,K],ae,ie||Date.now(),Date.now()]):(le&&le.sort&&le.sort(),typeof K=="function"&&K.call(this,ae,le))}}}if(process.version.substr(0,4)==="v0.8"){var v=A4e(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 T=F;Object.defineProperty(e,"FileWriteStream",{get:function(){return T},set:function(q){T=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 B(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,J){return typeof M=="function"&&(J=M,M=null),ee(q,X,M,J);function ee(ce,H,K,ie,ae){return j(ce,H,K,function(le,$t){le&&(le.code==="EMFILE"||le.code==="ENFILE")?ld([ee,[ce,H,K,ie],le,ae||Date.now(),Date.now()]):typeof ie=="function"&&ie.apply(this,arguments)})}}return e}function ld(e){Nl("ENQUEUE",e[0].name,e[1]),l
|
|||
|
|
%s`,B,B,k,i);var V=k.type==="*"?NO:k.type==="?"?LO:"\\"+k.type;a=!0,i=i.slice(0,k.reStart)+V+"\\("+B}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),J=i.slice(q.reEnd-8,q.reEnd),ee=i.slice(q.reEnd);J+=ee;var ce=X.split("(").length-1,H=ee;for(D=0;D<ce;D++)H=H.replace(/\)[+*?]?/,"");ee=H;var K="";ee===""&&r!==n_&&(K="$");var ie=X+M+ee+K+J;i=ie}if(i!==""&&a&&(i="(?=.)"+i),j&&(i=v+i),r===n_)return[i,a];if(!a)return s6e(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}Wi.makeRe=function(e,r){return new Tn(e,r||{}).makeRe()};Tn.prototype.makeRe=i6e;function i6e(){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?NO:r.dot?X4e:Q4e,i=r.nocase?"i":"",a=e.map(function(o){return o.map(function(c){return c===MO?n:typeof c=="string"?a6e(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}Wi.match=function(e,r,n){n=n||{};var i=new Tn(r,n);return e=e.filter(function(a){return i.match(a)}),i.options.nonull&&!e.length&&e.push(r),e};Tn.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;uv.sep!=="/"&&(r=r.split(uv.sep).join("/")),r=r.split(tK),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};Tn.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===MO){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 s6e(e){return e.replace(/\\(.)/g,"$1")}function a6e(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var iK=S((hFt,qO)=>{"use strict";typeof Object.create=="function"?qO.exports=function(r,n){n&&(r.super_=n,r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:qO.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 Zn=S((mFt,BO)=>{"use strict";try{if(jO=require("util"),typeof jO.inherits!="function")throw"";BO.exports=jO.inherits}catch{BO.exports=iK()}var jO});var o_=S((gFt,a_)=>{"use strict";function sK(e){return e.charAt(0)==="/"}function aK(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)}a_.exports=process.platform==="win32"?aK:sK;a_.exports.posix=sK;a_.exports.win32=aK});var GO=S(Zc=>{"use strict";Zc.setopts=p6e;Zc.ownProp=oK;Zc.makeAbs=lv;Zc.finish=d6e;Zc.mark=h6e;Zc.isIgnored=uK;Zc.childrenIgnored=m6e;function oK(e,r){return Object.prototype.hasOwnProperty.call(e,r)}var o6e=require("fs"),dd=require("path"),c6e=s_(),cK=o_(),UO=c6e.Minimatch;function u6e(e,r){return e.localeCompare(r,"en")}function l6e(e,r){e.ignore=r.ignore||[],Array.isArray(e.ignore)||(e.ignore=[e.ignore]),e.ignore.length&&(e.ignore=e.ignore.map(f6e))}function f6e(e){var r=null;if(e.slice(-3)==="/**"){var n=e.replace(/(\/\*\*)+$/,"");r=new UO(n,{dot:!0})}return{matcher:new UO(e,{dot:!0}),gmatcher:r}}function p6e(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||o6e,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),l6e(e,n),e.changedCwd=!1;var i=process.cwd();oK(n,"cwd")?(e.cwd=dd.resolve(n.cwd),e.changedCwd=e.cwd!==i):e.cwd=i,e.root=n.root||dd.resolve(e.cwd,"/"),e.root=dd.resolve(e.root),process.platform==="win32"&&(e.root=e.root.replace(/\\/g,"/")),e.cwdAbs=cK(e.cwd)?e.cwd:lv(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 UO(r,n),e.options=e.minimatch.options}function d6e(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(u6e)),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[lv(e,l)];return f&&p&&(f=p!=="DIR"&&!Array.isArray(p)),f}))}e.ignore.length&&(n=n.filter(function(l){return!uK(e,l)})),e.found=n}function h6e(e,r){var n=lv(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=lv(e,a);e.statCache[u]=e.statCache[n],e.cache[u]=e.cache[n]}}return a}function lv(e,r){var n=r;return r.charAt(0)==="/"?n=dd.join(e.root,r):cK(r)||r===""?n=r:e.changedCwd?n=dd.resolve(e.cwd,r):n=dd.resolve(r),process.platform==="win32"&&(n=n.replace(/\\/g,"/")),n}function uK(e,r){return e.ignore.length?e.ignore.some(function(n){return n.
|
|||
|
|
See: https://github.com/isaacs/node-glob/issues/167`);return new Hr(e,r).found}function Hr(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 Hr))return new Hr(e,r);if(v6e(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()}Hr.prototype._finish=function(){if(fK.ok(this instanceof Hr),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=g6e.realpathSync(a,e.realpathCache);i[o]=!0}catch(c){if(c.syscall==="stat")i[e._makeAbs(a)]=!0;else throw c}})}ql.finish(this)};Hr.prototype._process=function(e,r,n){fK.ok(this instanceof Hr);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=".":((c_(a)||c_(e.map(function(f){return typeof f=="string"?f:"[*]"}).join("/")))&&(!a||!c_(a))&&(a="/"+a),c=a);var u=this._makeAbs(c);if(!y6e(this,c)){var l=o[0]===lK.GLOBSTAR;l?this._processGlobStar(a,c,u,o,r,n):this._processReaddir(a,c,u,o,r,n)}};Hr.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=WO.join(this.root,x)),this._emitMatch(a,x)}return}i.shift();for(var v=0;v<D;v++){var x=g[v],T;e?T=[e,x]:T=[x],this._process(T.concat(i),a,o)}}}};Hr.prototype._emitMatch=function(e,r){if(!b6e(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)}}};Hr.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};Hr.prototype._readdir=function(e,r){var n;if(r&&!HO(this.symlinks,e))return this._readdirInGlobStar(e);if(HO(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}};Hr.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};Hr.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}};Hr.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)}}}};Hr.prototype._processSimple=function(e,r){var n=this._stat(e);if(this.matches[r]||(this.matches[r]=Object.create(null)),!!n){if(e&&c_(e)&&!this.nomount){var i=/[\/\\]$/.test(e);e.charAt(0)==="/"?e=WO.join(this.root,e):(e=WO.resolve(this.root,e),i&&(e+="/"))}process.platform==="win32"&&(e=e.replace(/\\/g,"/")),this._emitMatch(r,e)}};Hr.prototype._stat=function(e){var r=this._makeAbs(e),n=e.slice(-1)==="/";if(e.length>this.maxLength)return!1;if(!this.stat&&HO(this.cach
|
|||
|
|
`).filter(n=>{let i=n.match(OK);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:!M6e.test(a)}).filter(n=>n.trim()!=="").map(n=>r.pretty?n.replace(OK,(i,a)=>i.replace(a,a.replace(q6e,"~"))):n).join(`
|
|||
|
|
`))});var $K=S((OFt,FK)=>{"use strict";var j6e=hv(),B6e=kK(),U6e=e=>e.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,""),iI=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"?U6e(B6e(i.stack)):String(i)).join(`
|
|||
|
|
`);n=`
|
|||
|
|
`+j6e(n,4),super(n),this.name="AggregateError",Object.defineProperty(this,"_errors",{value:r})}*[Symbol.iterator](){for(let r of this._errors)yield r}};FK.exports=iI});var h_=S((IFt,LK)=>{"use strict";var G6e=$K();LK.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 G6e(u)):a(c));return}g++,(async()=>{try{let T=await E.value;c[D]=await r(T,D),g--,x()}catch(T){i?(f=!0,o(T)):(u.push(T),g--,x())}})()};for(let E=0;E<n&&(x(),!p);E++);})});var GK=S((kFt,sI)=>{"use strict";var{promisify:W6e}=require("util"),NK=require("path"),MK=av(),H6e=v1(),z6e=yO(),_s=gi(),V6e=$V(),K6e=NV(),qK=d_(),Y6e=h_(),X6e=W6e(qK),jK={glob:!1,unlink:_s.unlink,unlinkSync:_s.unlinkSync,chmod:_s.chmod,chmodSync:_s.chmodSync,stat:_s.stat,statSync:_s.statSync,lstat:_s.lstat,lstatSync:_s.lstatSync,rmdir:_s.rmdir,rmdirSync:_s.rmdirSync,readdir:_s.readdir,readdirSync:_s.readdirSync};function BK(e,r){if(V6e(e))throw new Error("Cannot delete the current working directory. Can be overridden with the `force` option.");if(!K6e(e,r))throw new Error("Cannot delete files/directories outside the current working directory. Can be overridden with the `force` option.")}function UK(e){return e=Array.isArray(e)?e:[e],e=e.map(r=>process.platform==="win32"&&H6e(r)===!1?z6e(r):r),e}sI.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=UK(e);let c=(await MK(e,o)).sort((p,g)=>g.localeCompare(p));c.length===0&&a({totalCount:0,deletedCount:0,percent:1});let u=0,f=await Y6e(c,async p=>(p=NK.resolve(i,p),r||BK(p,i),n||await X6e(p,jK),u+=1,a({totalCount:c.length,deletedCount:u,percent:u/c.length}),p),o);return f.sort((p,g)=>p.localeCompare(g)),f};sI.exports.sync=(e,{force:r,dryRun:n,cwd:i=process.cwd(),...a}={})=>{a={expandDirectories:!1,onlyFiles:!1,followSymbolicLinks:!1,cwd:i,...a},e=UK(e);let c=MK.sync(e,a).sort((u,l)=>l.localeCompare(u)).map(u=>(u=NK.resolve(i,u),r||BK(u,i),n||qK.sync(u,jK),u));return c.sort((u,l)=>u.localeCompare(l)),c}});var VK=S((FFt,ei)=>{"use strict";var m_=require("fs"),WK=require("path"),Q6e=cW(),HK=h1(),J6e=pw(),Z6e=GK(),e5e=require("stream"),{promisify:t5e}=require("util"),r5e=t5e(e5e.pipeline),{writeFile:n5e}=m_.promises,zK=(e="")=>WK.join(HK,e+Q6e()),i5e=async(e,r)=>r5e(r,m_.createWriteStream(e)),aI=(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 Z6e(o,{force:!0})}};ei.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 WK.join(ei.exports.directory(),e.name)}return zK()+(e.extension===void 0||e.extension===null?"":"."+e.extension.replace(/^\./,""))};ei.exports.file.task=aI(ei.exports.file);ei.exports.directory=({prefix:e=""}={})=>{let r=zK(e);return m_.mkdirSync(r),r};ei.exports.directory.task=aI(ei.exports.directory);ei.exports.write=async(e,r)=>{let n=ei.exports.file(r);return await(J6e(e)?i5e:n5e)(n,e),n};ei.exports.write.task=aI(ei.exports.write,{extraArguments:1});ei.exports.writeSync=(e,r)=>{let n=ei.exports.file(r);return m_.writeFileSync(n,e),n};Object.defineProperty(ei.exports,"root",{get(){return HK}})});var Nt=S(Ie=>{"use strict";var h5e=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"),Dv.checkPaths(e,r,"copy",n,(a,o)=>{if(a)return i(a);let{srcStat:c,destStat:u}=o;Dv.checkParentPaths(e,c,r,"copy",l=>{if(l)return i(l);_X(e,r,n,(f,p)=>{if(f)return i(f);if(!p)return i();Vqe(u,e,r,n,i)})})})}function Vqe(e,r,n,i,a){let o=Sv.dirname(n);Wqe(o,(c,u)=>{if(c)return a(c);if(u)return UI(e,r,n,i,a);Gqe(o,l=>l?a(l):UI(e,r,n,i,a))})}function _X(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 UI(e,r,n,i,a){(i.dereference?wi.stat:wi.lstat)(r,(c,u)=>c?a(c):u.isDirectory()?eje(u,e,r,n,i,a):u.isFile()||u.isCharacterDevice()||u.isBlockDevice()?Kqe(u,e,r,n,i,a):u.isSymbolicLink()?nje(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 Kqe(e,r,n,i,a,o){return r?Yqe(e,n,i,a,o):EX(e,n,i,a,o)}function Yqe(e,r,n,i,a){if(i.overwrite)wi.unlink(n,o=>o?a(o):EX(e,r,n,i,a));else return i.errorOnExist?a(new Error(`'${n}' already exists`)):a()}function EX(e,r,n,i,a){wi.copyFile(r,n,o=>o?a(o):i.preserveTimestamps?Xqe(e.mode,r,n,a):G_(n,e.mode,a))}function Xqe(e,r,n,i){return Qqe(e)?Jqe(n,e,a=>a?i(a):wX(e,r,n,i)):wX(e,r,n,i)}function Qqe(e){return(e&128)===0}function Jqe(e,r,n){return G_(e,r|128,n)}function wX(e,r,n,i){Zqe(r,n,a=>a?i(a):G_(n,e,i))}function G_(e,r,n){return wi.chmod(e,r,n)}function Zqe(e,r,n){wi.stat(e,(i,a)=>i?n(i):Hqe(r,a.atime,a.mtime,n))}function eje(e,r,n,i,a,o){return r?SX(n,i,a,o):tje(e.mode,n,i,a,o)}function tje(e,r,n,i,a){wi.mkdir(n,o=>{if(o)return a(o);SX(r,n,i,c=>c?a(c):G_(n,e,a))})}function SX(e,r,n,i){wi.readdir(e,(a,o)=>a?i(a):GI(o,e,r,n,i))}function GI(e,r,n,i,a){let o=e.pop();return o?rje(e,o,r,n,i,a):a()}function rje(e,r,n,i,a,o){let c=Sv.join(n,r),u=Sv.join(i,r);_X(c,u,a,(l,f)=>{if(l)return o(l);if(!f)return GI(e,n,i,a,o);Dv.checkPaths(c,u,"copy",a,(p,g)=>{if(p)return o(p);let{destStat:v}=g;UI(v,c,u,a,x=>x?o(x):GI(e,n,i,a,o))})})}function nje(e,r,n,i,a){wi.readlink(r,(o,c)=>{if(o)return a(o);if(i.dereference&&(c=Sv.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=Sv.resolve(process.cwd(),l)),Dv.isSrcSubdir(c,l)?a(new Error(`Cannot copy '${c}' to a subdirectory of itself, '${l}'.`)):Dv.isSrcSubdir(l,c)?a(new Error(`Cannot overwrite '${l}' with '${c}'.`)):ije(c,n,a)));else return wi.symlink(c,n,a)})}function ije(e,r,n){wi.unlink(r,i=>i?n(i):wi.symlink(e,r,n))}DX.exports=zqe});var OX=S((fLt,AX)=>{"use strict";var ri=gi(),Cv=require("path"),sje=aa().mkdirsSync,aje=jI().utimesMillisSync,Tv=Yl();function oje(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}=Tv.checkPathsSync(e,r,"copy",n);if(Tv.checkParentPathsSync(e,i,r,"copy"),n.filter&&!n.filter(e,r))return;let o=Cv.dirname(r);return ri.existsSync(o)||sje(o),TX(a,e,r,n)}function TX(e,r,n,i){let o=(i.dereference?ri.statSync:ri.lstatSync)(r);if(o.isDirectory())return hje(o,e,r,n,i);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return cje(o,e,r,n,i);if(o.isSymbolicLink())return vje(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 cje(e,r,n,i,a){return r?uje(e,n,i,a):PX(e,n,i,a)}function uje(e,r,n,i){if(i.overwrite)return ri.unlinkSync(n),PX(e,r,n,i);if(i.errorOnExist)throw new Error(`'${n}' already exists`)}function PX(e,r,n,i){return ri.copyFileSync(r,n),i.preserveTimestamps&&lje(e.mode,r,n),WI(n,e.mode)}function lje(e,r,n){return fje(e)&&pje(n,e),dje(r,n)}function fje(e){return(e&128)===0}function pje(e,r){return WI(e,r|128)}function WI(e,r){return ri.chmodSync(e,r)}function dje(e,r){let n=ri.statSync(e);return aje(r,n.atime,n.mtime)}function hje(e,r,n,i,a){return r?RX(n,i,a):mje(e.mode,n,i,a)}function mje(e,r,n,i){return ri.mkdirSync(n),RX(r,n,i),WI(n,e)}function RX(e,r,n){ri.readdirSync(e).forEach(i=>gje(i,e,r,n))}function gje(e,r,n,i){let a=Cv.join(r,e),o=Cv.join(n,e);if(i.filter&&!i.filter(a,o))return;let{destStat:c}=Tv.checkPathsSync(a,o,"copy",i);return TX(c,a,o,i)}function vje(e,r,n,i){let a=ri.readlinkSync(r);if(i.dereference&&(a=Cv.resolve(process.cwd(),a)),e){let o;try{o=ri.readlinkSync(n)}catch(c){if(c.code==="EINVAL"||c.code==="UNKNOWN")return ri.symlinkSync(a,n);throw c}if(i.dereference&&(o=Cv.resolve(process.cwd(),o)),Tv.isSrcSubdir(a,o))throw new Error(`Cannot copy '${a}' to a subdirectory of itself, '${o}'.`);if(Tv.isSrcSubdir(o,a))throw new Error(`Cannot overwrite '${o}' with '${a}'.`);return yje(a,n)}else return ri.symlinkSync(a,n)}function yje(e,r){return ri.unlinkSync(r),ri.symlinkSync(e,r)}AX.exports=oje});var W_=S((pLt,IX)=>{"use strict";var bje=xi().fromCallback;IX.exports={copy:bje(CX()),copySync:OX()}});var Pv=S((dLt,FX)=>{"use strict";var kX=gi(),xje=xi().fromCallback;function wje(e,r){kX.rm(e,{recursive:!0,force:!0},r)}function _je(e){kX.rmSync(e,{recursive:!0,force:!0})}FX.exports={remove:xje(wje),removeSync:_je}});var UX=S((hLt,BX)=>{"use strict";var Eje=xi().fromPromise,NX=Kl(),MX=require("path"),qX=aa(),jX=Pv(),$X=Eje(async function(r){let n;try{n=await NX.readdir(r)}catch{return qX.mkdirs(r)}return Promise.all(n.map(i=>jX.remove(MX.join(r,i))))});function LX(e){let r;try{r=NX.readdirSync(e)}catch{return qX.mkdirsSync(e)}r.forEach(n=>{n=MX.join(e,n),jX.removeSync(n)})}BX.exports={emptyDirSync:LX,emptydirSync:LX,emptyDir:$X,emptydir:$X}});var zX=S((mLt,HX)=>{"use strict";var Sje=xi().fromCallback,GX=require("path"),cu=gi(),WX=aa();function Dje(e,r){function n(){cu.writeFile(e,"",i=>{if(i)return r(i);r()})}cu.stat(e,(i,a)=>{if(!i&&a.isFile())return r();let o=GX.dirname(e);cu.stat(o,(c,u)=>{if(c)return c.code==="ENOENT"?WX.mkdirs(o,l=>{if(l)return r(l);n()}):r(c);u.isDirectory()?n():cu.readdir(o,l=>{if(l)return r(l)})})})}function Cje(e){let r;try{r=cu.statSync(e)}catch{}if(r&&r.isFile())return;let n=GX.dirname(e);try{cu.statSync(n).isDirectory()||cu.readdirSync(n)}catch(i){if(i&&i.code==="ENOENT")WX.mkdirsSync(n);else throw i}cu.writeFileSync(e,"")}HX.exports={createFile:Sje(Dje),createFileSync:Cje}});var QX=S((gLt,XX)=>{"use strict";var Tje=xi().fromCallback,VX=require("path"),uu=gi(),KX=aa(),Pje=ou().pathExists,{areIdentical:YX}=Yl();function Rje(e,r,n){function i(a,o){uu.link(a,o,c=>{if(c)return n(c);n(null)})}uu.lstat(r,(a,o)=>{uu.lstat(e,(c,u)=>{if(c)return c.message=c.message.replace("lstat","ensureLink"),n(c);if(o&&YX(u,o))return n(null);let l=VX.dirname(r);Pje(l,(f,p)=>{if(f)return n(f);if(p)return i(e,r);KX.mkdirs(l,g=>{if(g)return n(g);i(e,r)})})})})}function Aje(e,r){let n;try{n=uu.lstatSync(r)}catch{}try{let o=uu.lstatSync(e);if(n&&YX(o
|
|||
|
|
GFS4: `),console.error(e)});fr[Pn]||(CQ=global[Pn]||[],PQ(fr,CQ),fr.close=function(e){function r(n,i){return e.call(fr,n,function(a){a||TQ(),typeof i=="function"&&i.apply(this,arguments)})}return Object.defineProperty(r,K_,{value:e}),r}(fr.close),fr.closeSync=function(e){function r(n){e.apply(fr,arguments),TQ()}return Object.defineProperty(r,K_,{value:e}),r}(fr.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Xl(fr[Pn]),require("assert").equal(fr[Pn].length,0)}));var CQ;global[Pn]||PQ(global,fr[Pn]);KI.exports=zI(eBe(fr));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!fr.__patched&&(KI.exports=zI(fr),fr.__patched=!0);function zI(e){Jje(e),e.gracefulify=zI,e.createReadStream=B,e.createWriteStream=V;var r=e.readFile;e.readFile=n;function n(q,X,M){return typeof X=="function"&&(M=X,X=null),J(q,X,M);function J(ee,ce,H,K){return r(ee,ce,function(ie){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?Ed([J,[ee,ce,H],ie,K||Date.now(),Date.now()]):typeof H=="function"&&H.apply(this,arguments)})}}var i=e.writeFile;e.writeFile=a;function a(q,X,M,J){return typeof M=="function"&&(J=M,M=null),ee(q,X,M,J);function ee(ce,H,K,ie,ae){return i(ce,H,K,function(le){le&&(le.code==="EMFILE"||le.code==="ENFILE")?Ed([ee,[ce,H,K,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,J){return typeof M=="function"&&(J=M,M=null),ee(q,X,M,J);function ee(ce,H,K,ie,ae){return o(ce,H,K,function(le){le&&(le.code==="EMFILE"||le.code==="ENFILE")?Ed([ee,[ce,H,K,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,J){return typeof M=="function"&&(J=M,M=0),ee(q,X,M,J);function ee(ce,H,K,ie,ae){return u(ce,H,K,function(le){le&&(le.code==="EMFILE"||le.code==="ENFILE")?Ed([ee,[ce,H,K,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 J=p.test(process.version)?function(H,K,ie,ae){return f(H,ee(H,K,ie,ae))}:function(H,K,ie,ae){return f(H,K,ee(H,K,ie,ae))};return J(q,X,M);function ee(ce,H,K,ie){return function(ae,le){ae&&(ae.code==="EMFILE"||ae.code==="ENFILE")?Ed([J,[ce,H,K],ae,ie||Date.now(),Date.now()]):(le&&le.sort&&le.sort(),typeof K=="function"&&K.call(this,ae,le))}}}if(process.version.substr(0,4)==="v0.8"){var v=Zje(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 T=F;Object.defineProperty(e,"FileWriteStream",{get:function(){return T},set:function(q){T=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 B(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,J){return typeof M=="function"&&(J=M,M=null),ee(q,X,M,J);function ee(ce,H,K,ie,ae){return j(ce,H,K,function(le,$t){le&&(le.code==="EMFILE"||le.code==="ENFILE")?Ed([ee,[ce,H,K,ie],le,ae||Date.now(),Date.now()]):typeof ie=="function"&&ie.apply(this,arguments)})}}return e}function Ed(e){Xl("ENQUEUE",e[0].name,e[1]),f
|
|||
|
|
`,finalEOL:n=!0,replacer:i=null,spaces:a}={}){let o=n?r:"";return JSON.stringify(e,i,a).replace(/\n/g,r)+o}function nBe(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}RQ.exports={stringify:rBe,stripBom:nBe}});var kQ=S((CLt,IQ)=>{"use strict";var Sd;try{Sd=Y_()}catch{Sd=require("fs")}var Q_=xi(),{stringify:AQ,stripBom:OQ}=X_();async function iBe(e,r={}){typeof r=="string"&&(r={encoding:r});let n=r.fs||Sd,i="throws"in r?r.throws:!0,a=await Q_.fromCallback(n.readFile)(e,r);a=OQ(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 sBe=Q_.fromPromise(iBe);function aBe(e,r={}){typeof r=="string"&&(r={encoding:r});let n=r.fs||Sd,i="throws"in r?r.throws:!0;try{let a=n.readFileSync(e,r);return a=OQ(a),JSON.parse(a,r.reviver)}catch(a){if(i)throw a.message=`${e}: ${a.message}`,a;return null}}async function oBe(e,r,n={}){let i=n.fs||Sd,a=AQ(r,n);await Q_.fromCallback(i.writeFile)(e,a,n)}var cBe=Q_.fromPromise(oBe);function uBe(e,r,n={}){let i=n.fs||Sd,a=AQ(r,n);return i.writeFileSync(e,a,n)}var lBe={readFile:sBe,readFileSync:aBe,writeFile:cBe,writeFileSync:uBe};IQ.exports=lBe});var $Q=S((TLt,FQ)=>{"use strict";var J_=kQ();FQ.exports={readJson:J_.readFile,readJsonSync:J_.readFileSync,writeJson:J_.writeFile,writeJsonSync:J_.writeFileSync}});var Z_=S((PLt,MQ)=>{"use strict";var fBe=xi().fromCallback,Av=gi(),LQ=require("path"),NQ=aa(),pBe=ou().pathExists;function dBe(e,r,n,i){typeof n=="function"&&(i=n,n="utf8");let a=LQ.dirname(e);pBe(a,(o,c)=>{if(o)return i(o);if(c)return Av.writeFile(e,r,n,i);NQ.mkdirs(a,u=>{if(u)return i(u);Av.writeFile(e,r,n,i)})})}function hBe(e,...r){let n=LQ.dirname(e);if(Av.existsSync(n))return Av.writeFileSync(e,...r);NQ.mkdirsSync(n),Av.writeFileSync(e,...r)}MQ.exports={outputFile:fBe(dBe),outputFileSync:hBe}});var jQ=S((RLt,qQ)=>{"use strict";var{stringify:mBe}=X_(),{outputFile:gBe}=Z_();async function vBe(e,r,n={}){let i=mBe(r,n);await gBe(e,i,n)}qQ.exports=vBe});var UQ=S((ALt,BQ)=>{"use strict";var{stringify:yBe}=X_(),{outputFileSync:bBe}=Z_();function xBe(e,r,n){let i=yBe(r,n);bBe(e,i,n)}BQ.exports=xBe});var WQ=S((OLt,GQ)=>{"use strict";var wBe=xi().fromPromise,ni=$Q();ni.outputJson=wBe(jQ());ni.outputJsonSync=UQ();ni.outputJSON=ni.outputJson;ni.outputJSONSync=ni.outputJsonSync;ni.writeJSON=ni.writeJson;ni.writeJSONSync=ni.writeJsonSync;ni.readJSON=ni.readJson;ni.readJSONSync=ni.readJsonSync;GQ.exports=ni});var YQ=S((ILt,KQ)=>{"use strict";var _Be=gi(),XI=require("path"),EBe=W_().copy,VQ=Pv().remove,SBe=aa().mkdirp,DBe=ou().pathExists,HQ=Yl();function CBe(e,r,n,i){typeof n=="function"&&(i=n,n={}),n=n||{};let a=n.overwrite||n.clobber||!1;HQ.checkPaths(e,r,"move",n,(o,c)=>{if(o)return i(o);let{srcStat:u,isChangingCase:l=!1}=c;HQ.checkParentPaths(e,u,r,"move",f=>{if(f)return i(f);if(TBe(r))return zQ(e,r,a,l,i);SBe(XI.dirname(r),p=>p?i(p):zQ(e,r,a,l,i))})})}function TBe(e){let r=XI.dirname(e);return XI.parse(r).root===r}function zQ(e,r,n,i,a){if(i)return YI(e,r,n,a);if(n)return VQ(r,o=>o?a(o):YI(e,r,n,a));DBe(r,(o,c)=>o?a(o):c?a(new Error("dest already exists.")):YI(e,r,n,a))}function YI(e,r,n,i){_Be.rename(e,r,a=>a?a.code!=="EXDEV"?i(a):PBe(e,r,n,i):i())}function PBe(e,r,n,i){EBe(e,r,{overwrite:n,errorOnExist:!0,preserveTimestamps:!0},o=>o?i(o):VQ(e,i))}KQ.exports=CBe});var eJ=S((kLt,ZQ)=>{"use strict";var QQ=gi(),JI=require("path"),RBe=W_().copySync,JQ=Pv().removeSync,ABe=aa().mkdirpSync,XQ=Yl();function OBe(e,r,n){n=n||{};let i=n.overwrite||n.clobber||!1,{srcStat:a,isChangingCase:o=!1}=XQ.checkPathsSync(e,r,"move",n);return XQ.checkParentPathsSync(e,a,r,"move"),IBe(r)||ABe(JI.dirname(r)),kBe(e,r,i,o)}function IBe(e){let r=JI.dirname(e);return JI.parse(r).root===r}function kBe(e,r,n,i){if(i)return QI(e,r,n);if(n)return JQ(r),QI(e,r,n);if(QQ.existsSync(r))throw new Error("dest already exists.");return QI(e,r,n)}function QI(e,r,n){try{QQ.renameSync(e,r)}catch(i){if(i.code!=="EXDEV")throw i;return FBe(e,r,n)}}function FBe(e,r,n){return RBe(e,r,{overwrite:n,errorOnExist:!0,preserveTimestamps:!0}),JQ(e)}ZQ.expor
|
|||
|
|
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function KJ(e){return e[0]==="u"&&e.length===5||e[0]==="x"&&e.length===3?String.fromCharCode(parseInt(e.slice(1),16)):_9e.get(e)||e}function E9e(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(x9e))n.push(a[2].replace(w9e,(c,u,l)=>u?KJ(u):l));else throw new Error(`Invalid Chalk template style argument: ${o} (in style '${e}')`);return n}function S9e(e){zJ.lastIndex=0;let r=[],n;for(;(n=zJ.exec(e))!==null;){let i=n[1];if(n[2]){let a=E9e(i,n[2]);r.push([i].concat(a))}else r.push([i])}return r}function VJ(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}YJ.exports=(e,r)=>{let n=[],i=[],a=[];if(r.replace(b9e,(o,c,u,l,f,p)=>{if(c)a.push(KJ(c));else if(l){let g=a.join("");a=[],i.push(n.length===0?g:VJ(e,n)(g)),n.push({inverse:u,styles:S9e(l)})}else if(f){if(n.length===0)throw new Error("Found extraneous } in Chalk template literal");i.push(VJ(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 dk=S((ZLt,Fv)=>{"use strict";var pk=RJ(),Ir=BJ(),fk=HJ().stdout,D9e=XJ(),JJ=process.platform==="win32"&&!(process.env.TERM||"").toLowerCase().startsWith("xterm"),ZJ=["ansi","ansi","ansi256","ansi16m"],eZ=new Set(["gray"]),Pd=Object.create(null);function QJ(e,r){r=r||{};let n=fk?fk.level:0;e.level=r.level===void 0?n:r.level,e.enabled="enabled"in r?r.enabled:e.level>0}function kv(e){if(!this||!(this instanceof kv)||this.template){let r={};return QJ(r,e),r.template=function(){let n=[].slice.call(arguments);return P9e.apply(null,[r.template].concat(n))},Object.setPrototypeOf(r,kv.prototype),Object.setPrototypeOf(r.template,r),r.template.constructor=kv,r.template}QJ(this,e)}JJ&&(Ir.blue.open="\x1B[94m");for(let e of Object.keys(Ir))Ir[e].closeRe=new RegExp(pk(Ir[e].close),"g"),Pd[e]={get(){let r=Ir[e];return cE.call(this,this._styles?this._styles.concat(r):[r],this._empty,e)}};Pd.visible={get(){return cE.call(this,this._styles||[],!0,"visible")}};Ir.color.closeRe=new RegExp(pk(Ir.color.close),"g");for(let e of Object.keys(Ir.color.ansi))eZ.has(e)||(Pd[e]={get(){let r=this.level;return function(){let i={open:Ir.color[ZJ[r]][e].apply(null,arguments),close:Ir.color.close,closeRe:Ir.color.closeRe};return cE.call(this,this._styles?this._styles.concat(i):[i],this._empty,e)}}});Ir.bgColor.closeRe=new RegExp(pk(Ir.bgColor.close),"g");for(let e of Object.keys(Ir.bgColor.ansi)){if(eZ.has(e))continue;let r="bg"+e[0].toUpperCase()+e.slice(1);Pd[r]={get(){let n=this.level;return function(){let a={open:Ir.bgColor[ZJ[n]][e].apply(null,arguments),close:Ir.bgColor.close,closeRe:Ir.bgColor.closeRe};return cE.call(this,this._styles?this._styles.concat(a):[a],this._empty,e)}}}}var C9e=Object.defineProperties(()=>{},Pd);function cE(e,r,n){let i=function(){return T9e.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__=C9e,i}function T9e(){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=Ir.dim.open;JJ&&this.hasGrey&&(Ir.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 Ir.dim.open=i,n}function P9e(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 sZ(e){return mk.default.level>0||e.forceColor}var hk;function aZ(e){if(e){var r;return(r=hk)!=null||(hk=new mk.default.constructor({enabled:!0,level:1})),hk}return mk.default}$v.getChalk=e=>aZ(e.forceColor);function $9e(e,r={}){if(e!==""&&sZ(r)){let n=O9e(aZ(r.forceColor));return F9e(n,e)}else return e}});var hZ=S(uE=>{"use strict";Object.defineProperty(uE,"__esModule",{value:!0});uE.codeFrameColumns=dZ;uE.default=j9e;var cZ=oZ(),uZ=L9e(dk(),!0);function pZ(e){if(typeof WeakMap!="function")return null;var r=new WeakMap,n=new WeakMap;return(pZ=function(i){return i?n:r})(e)}function L9e(e,r){if(!r&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=pZ(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 gk;function N9e(e){if(e){var r;return(r=gk)!=null||(gk=new uZ.default.constructor({enabled:!0,level:1})),gk}return uZ.default}var lZ=!1;function M9e(e){return{gutter:e.grey,marker:e.red.bold,message:e.red.bold}}var fZ=/\r\n|[\n\r\u2028\u2029]/;function q9e(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 T=D+u;if(!l)E[T]=!0;else if(D===0){let R=r[T-1].length;E[T]=[l,R-l+1]}else if(D===x)E[T]=[0,p];else{let R=r[T-D].length;E[T]=[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 dZ(e,r,n={}){let i=(n.highlightCode||n.forceColor)&&(0,cZ.shouldHighlight)(n),a=N9e(n.forceColor),o=M9e(a),c=(D,T)=>i?D(T):T,u=e.split(fZ),{start:l,end:f,markerLines:p}=q9e(r,u,n),g=r.start&&typeof r.start.column=="number",v=String(f).length,E=(i?(0,cZ.default)(e,n):e).split(fZ,f).slice(l,f).map((D,T)=>{let R=l+1+T,F=` ${` ${R}`.slice(-v)} |`,L=p[R],B=!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(""),B&&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 j9e(e,r,n,i={}){if(!lZ){lZ=!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),dZ(e,{start:{column:n,line:r}},i)}});var xk=S((aNt,yZ)=>{"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):()=>{};yZ.exports=H9e});var wk=S((oNt,bZ)=>{"use strict";var z9e="2.0.0",V9e=Number.MAX_SAFE_INTEGER||9007199254740991,K9e=16,Y9e=250,X9e=["major","premajor","minor","preminor","patch","prepatch","prerelease"];bZ.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:K9e,MAX_SAFE_BUILD_LENGTH:Y9e,MAX_SAFE_INTEGER:V9e,RELEASE_TYPES:X9e,SEMVER_SPEC_VERSION:z9e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var wZ=S((Go,xZ)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:_k,MAX_SAFE_BUILD_LENGTH:Q9e,MAX_LENGTH:J9e}=wk(),Z9e=xk();Go=xZ.exports={};var eUe=Go.re=[],tUe=Go.safeRe=[],ve=Go.src=[],ye=Go.t={},rUe=0,Ek="[a-zA-Z0-9-]",nUe=[["\\s",1],["\\d",J9e],[Ek,Q9e]],iUe=e=>{for(let[r,n]of nUe)e=e.split(`${r}*`).join(`${r}{0,${n}}`).split(`${r}+`).join(`${r}{1,${n}}`);return e},je=(e,r,n)=>{let i=iUe(r),a=rUe++;Z9e(e,a,r),ye[e]=a,ve[a]=r,eUe[a]=new RegExp(r,n?"g":void 0),tUe[a]=new RegExp(i,n?"g":void 0)};je("NUMERICIDENTIFIER","0|[1-9]\\d*");je("NUMERICIDENTIFIERLOOSE","\\d+");je("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Ek}*`);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",`${Ek}+`);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,${_k}})(?:\\.(\\d{1,${_k}}))?(?:\\.(\\d{1,${_k}}))?`);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);Go.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);Go.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 kee=S((NNt,i7e)=>{i7e.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 Nee=S((MNt,Lee)=>{"use strict";var s7e=LZ(),a7e=MZ(),o7e=ree(),xE=bee(),c7e=Ld(),u7e=["dependencies","devDependencies","optionalDependencies"],l7e=Iee(),qk=require("url"),bu=kee(),Fee=e=>e.includes("@")&&e.indexOf("@")<e.lastIndexOf(".");Lee.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=xE.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(bu.topLevel).forEach(function(r){Object.prototype.hasOwnProperty.call(e,r)&&this.warn("typo",r,bu.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]):bu.script[r]&&!e.scripts[bu.script[r]]&&this.warn("typo",r,bu.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){y7e(e,this.warn),g7e(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=xE.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(!s7e(e.version,n))throw new Error('Invalid version: "'+e.version+'"');return e.version=a7e(e.version,n),!0},fixPeople:function(e){$ee(e,h7e),$ee(e,m7e)},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+iF(c)+`"\r
|
|||
|
|
\r
|
|||
|
|
${o.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
|
|||
|
|
`)}\r
|
|||
|
|
`):i.push(a+iF(c)+`"; filename="${iF(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 Xv,eGe,tGe,Ute,rGe,Gte,iF,of,Ps,Wte,cf,PE=Mp(()=>{"use strict";Vv();nF();({toStringTag:Xv,iterator:eGe,hasInstance:tGe}=Symbol),Ute=Math.random,rGe="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),Gte=(e,r,n)=>(e+="",/^(Blob|File)$/.test(r&&r[Xv])?[(n=n!==void 0?n+"":r[Xv]=="File"?r.name:"blob",e),r.name!==n||r[Xv]=="blob"?new Bd([r],n,r):r]:[e,r+""]),iF=(e,r)=>(r?e:e.replace(/\r?\n|\r/g,`\r
|
|||
|
|
`)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),of=(e,r,n)=>{if(r.length<n)throw new TypeError(`Failed to execute '${e}' on 'FormData': ${n} arguments required, but only ${r.length} present.`)},cf=(Wte=class{constructor(...r){Ee(this,Ps,[]);if(r.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[Xv](){return"FormData"}[eGe](){return this.entries()}static[tGe](r){return r&&typeof r=="object"&&r[Xv]==="FormData"&&!rGe.some(n=>typeof r[n]!="function")}append(...r){of("append",arguments,2),$(this,Ps).push(Gte(...r))}delete(r){of("delete",arguments,1),r+="",fe(this,Ps,$(this,Ps).filter(([n])=>n!==r))}get(r){of("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 of("getAll",arguments,1),n=[],r+="",$(this,Ps).forEach(i=>i[0]===r&&n.push(i[1])),n}has(r){return of("has",arguments,1),r+="",$(this,Ps).some(n=>n[0]===r)}forEach(r,n){of("forEach",arguments,1);for(var[i,a]of this)r.call(n,a,i,this)}set(...r){of("set",arguments,2);var n=[],i=!0;r=Gte(...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,Wte)});var Xte=S((SMt,Yte)=>{"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)}Yte.exports=globalThis.DOMException});var AE,nGe,TMt,aF=Mp(()=>{"use strict";AE=require("node:fs"),nGe=U(Xte(),1);nF();Vv();({stat:TMt}=AE.promises)});var Jte={};Qn(Jte,{toFormData:()=>lGe});function uGe(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 lGe(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 oF(n[1]||n[2]),a,o,c,u,l,f,p=[],g=new cf,v=R=>{c+=T.decode(R,{stream:!0})},x=R=>{p.push(R)},E=()=>{let R=new Bd(p,f,{type:l});g.append(u,R)},D=()=>{g.append(u,c)},T=new TextDecoder("utf-8");T.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+=T.decode(R,{stream:!0})},i.onHeaderValue=function(R){o+=T.decode(R,{stream:!0})},i.onHeaderEnd=function(){if(o+=T.decode(),a=a.toLowerCase(),a==="content-disposition"){let R=o.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);R&&(u=R[2]||R[3]||""),f=uGe(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 Xa,Kt,Qte,xu,OE,IE,iGe,Jv,sGe,aGe,oGe,cGe,uf,oF,Zte=Mp(()=>{"use strict";aF();PE();Xa=0,Kt={START_BOUNDARY:Xa++,HEADER_FIELD_START:Xa++,HEADER_FIELD:Xa++,HEADER_VALUE_START:Xa++,HEADER_VALUE:Xa++,HEADER_VALUE_ALMOST_DONE:Xa++,HEADERS_ALMOST_DONE:Xa++,PART_DATA_START:Xa++,PART_DATA:Xa++,END:Xa++},Qte=1,xu={PART_BOUNDARY:Qte,LAST_BOUNDARY:Qte*=2},OE=10,IE=13,iGe=32,Jv=45,sGe=58,aGe=97,oGe=122,cGe=e=>e|32,uf=()=>{},oF=class{constructor(r){this.index=0,this.flags=0,this.onHeaderEnd=uf,this.onHeaderField=uf,this.onHeadersEnd=uf,this.onHeaderValue=uf,this.onPartBegin=uf,this.onPartData=uf,this.onPartEnd=uf,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=Kt.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,T=L=>{this[L+"Mark"]=n},R=L=>{delete this[L+"Mark"]},k=(L,B,V,j)=>{(B===void 0||B!==V)&&this[L](j&&j.subarray(B,V))},F=(L,B)=>{let V=L+"Mark";V in this&&(B?(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 Kt.START_BOUNDARY:if(l===c.length-2){if(E===Jv)p|=xu.LAST_BOUNDARY;else if(E!==IE)return;l++;break}else if(l-1===c.length-2){if(p&xu.LAST_BOUNDARY&&E===Jv)f=Kt.END,p=0;else if(!(p&xu.LAST_BOUNDARY)&&E===OE)l=0,k("onPartBegin"),f=Kt.HEADER_FIELD_START;else return;break}E!==c[l+2]&&(l=-2),E===c[l+2]&&l++;break;case Kt.HEADER_FIELD_START:f=Kt.HEADER_FIELD,T("onHeaderField"),l=0;case Kt.HEADER_FIELD:if(E===IE){R("onHeaderField"),f=Kt.HEADERS_ALMOST_DONE;break}if(l++,E===Jv)break;if(E===sGe){if(l===1)return;F("onHeaderField",!0),f=Kt.HEADER_VALUE_START;break}if(D=cGe(E),D<aGe||D>oGe)return;break;case Kt.HEADER_VALUE_START:if(E===iGe)break;T("onHeaderValue"),f=Kt.HEADER_VALUE;case Kt.HEADER_VALUE:E===IE&&(F("onHeaderValue",!0),k("onHeaderEnd"),f=Kt.HEADER_VALUE_ALMOST_DONE);break;case Kt.HEADER_VALUE_ALMOST_DONE:if(E!==OE)return;f=Kt.HEADER_FIELD_START;break;case Kt.HEADERS_ALMOST_DONE:if(E!==OE)return;k("onHeadersEnd"),f=Kt.PART_DATA_START;break;case Kt.PART_DATA_START:f=Kt.PART_DATA,T("onPartData");case Kt.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===IE?p|=xu.PART_BOUNDARY:E===Jv?p|=xu.LAST_BOUNDARY:l=0;else if(l-1===c.length)if(p&xu.PART_BOUNDARY){if(l=0,E===OE){p&=~xu.PART_BOUNDARY,k("onPartEnd"),k("onPartBegin"),f=Kt.HEADER_FIELD_START;break}}else p&xu.LAST_BOUNDARY&&E===Jv?(k("onPartEnd"),f=Kt.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,T("onPartData"),n--}break;case Kt.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===Kt.HEADER_FIELD_START&&this.index===0||this.state===Kt.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==Kt.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}}});var vre=S((v4t,gre)=>{"use strict";function Os(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))}gre.exports=Os;Os.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};Os.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};Os.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};Os.prototype.attempt=f
|
|||
|
|
`).join(`
|
|||
|
|
`+o),e.push(a+"m+"+GE.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=UGe()+r+" "+e[0]}function UGe(){return hn.inspectOpts.hideDate?"":new Date().toISOString()+" "}function GGe(...e){return process.stderr.write(UE.formatWithOptions(hn.inspectOpts,...e)+`
|
|||
|
|
`)}function WGe(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function HGe(){return process.env.DEBUG}function zGe(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]]}GE.exports=pF()(hn);var{formatters:Pre}=GE.exports;Pre.o=function(e){return this.inspectOpts.colors=this.useColors,UE.inspect(e,this.inspectOpts).split(`
|
|||
|
|
`).map(r=>r.trim()).join(" ")};Pre.O=function(e){return this.inspectOpts.colors=this.useColors,UE.inspect(e,this.inspectOpts)}});var WE=S((S4t,mF)=>{"use strict";typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?mF.exports=Dre():mF.exports=Rre()});var Ire=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]}),KGe=Si&&Si.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),Are=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 KGe(r,e),r};Object.defineProperty(Si,"__esModule",{value:!0});Si.req=Si.json=Si.toBuffer=void 0;var YGe=Are(require("http")),XGe=Are(require("https"));async function Ore(e){let r=0,n=[];for await(let i of e)r+=i.length,n.push(i);return Buffer.concat(n,r)}Si.toBuffer=Ore;async function QGe(e){let n=(await Ore(e)).toString("utf8");try{return JSON.parse(n)}catch(i){let a=i;throw a.message+=` (input: ${n})`,a}}Si.json=QGe;function JGe(e,r={}){let i=((typeof e=="string"?e:e.href).startsWith("https:")?XGe:YGe).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=JGe});var vF=S(Zi=>{"use strict";var Fre=Zi&&Zi.__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]}),ZGe=Zi&&Zi.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),eWe=Zi&&Zi.__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)&&Fre(r,e,n);return ZGe(r,e),r},tWe=Zi&&Zi.__exportStar||function(e,r){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(r,n)&&Fre(r,e,n)};Object.defineProperty(Zi,"__esModule",{value:!0});Zi.Agent=void 0;var kre=eWe(require("http"));tWe(Ire(),Zi);var Za=Symbol("AgentBaseInternalState"),gF=class extends kre.Agent{constructor(r){super(r),this[Za]={}}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 kre.Agent)return o.addRequest(r,a);this[Za].currentSocket=o,super.createSocket(r,n,i)},i)}createConnection(){let r=this[Za].currentSocket;if(this[Za].currentSocket=void 0,!r)throw new Error("No socket was returned in the `connect()` function");return r}get defaultPort(){return this[Za].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(r){this[Za]&&(this[Za].defaultPort=r)}get protocol(){return this[Za].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(r){this[Za]&&(this[Za].protocol=r)}};Zi.Agent=gF});var Nre=S(ks=>{"use strict";var rWe=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]}),nWe=ks&&ks.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),Lre=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)&&rWe(r,e,n);return nWe(r,e),r},iWe=ks&&ks.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ks,"__esModule",{value:!0});ks.HttpProxyAgent=void 0;var sWe=Lre(require("net")),aWe=Lre(require("tls")),oWe=iWe(WE()),cWe=require("events"),uWe=vF(),$re=require("url"),Vd=(0,oWe.default)("http-proxy-agent"),HE=class extends uWe.Agent{constructor(r,n){super(n),this.proxy=typeof r=="string"?new $re.URL(r):r,this.proxyHeaders=n?.headers??{},Vd("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?lWe(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 $re.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;Vd("Regenerating stored HTTP header string for request"),r._implicitHeader(),r.outputData&&r.outputData.length>0&&(Vd("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),Vd("Output buffer: %o",r.outputData[0].data));let o;return this.proxy.protocol==="https:"?(Vd("Creating `tls.Socket`: %o",this.connectOpts),o=aWe.connect(this.connectOpts)):(Vd("Creating `net.Socket`: %o",this.connectOpts),o=sWe.connect(this.connectOpts)),await(0,cWe.once)(o,"connect"),o}};HE.protocols=["http","https"];ks.HttpProxyAgent=HE;function lWe(e,...r){let n={},i;for(i in e)r.includes(i)||(n[i]=e[i]);return n}});var Mre=S(Kd=>{"use strict";var fWe=Kd&&Kd.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Kd,"__esModule",{value:!0});Kd.parseProxyResponse=void 0;var pWe=fWe(WE()),zE=(0,pWe.default)("https-proxy-agent:parse-proxy-response");function dWe(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(),zE("onend"),n(new Error("Proxy connection ended before receiving CONNECT response"))}function l(p){c(),zE("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){zE("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(" "),T=+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 B=F.slice(0,L).toLowerCase(),V=F.slice(L+1).trimStart(),j=k[B];typeof j=="string"?k[B]=[j,V]:Array.isArray(j)?j.push(V):k[B]=V}zE("got proxy server response: %o %o",E,k),c(),r({connect:{statusCode:T,statusText:R,headers:k},buffered:g})}e.on("error",l),e.on("end",u),o()})}Kd.parseProxyResponse=dWe});var Gre=S(Fs=>{"use strict";var hWe=Fs&&Fs.__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]}),mWe=Fs&&Fs.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),Bre=Fs&&Fs.__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)&&hWe(r,e,n);return mWe(r,e),r},Ure=Fs&&Fs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Fs,"__esModule",{value:!0});Fs.HttpsProxyAgent=void 0;var yF=Bre(require("net")),qre=Bre(require("tls")),gWe=Ure(require("assert")),vWe=Ure(WE()),yWe=vF(),bWe=require("url"),xWe=Mre(),ry=(0,vWe.default)("https-proxy-agent"),VE=class extends yWe.Agent{constructor(r,n){super(n),this.options={path:void 0},this.proxy=typeof r=="string"?new bWe.URL(r):r,this.proxyHeaders=n?.headers??{},ry("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?jre(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:"){ry("Creating `tls.Socket`: %o",this.connectOpts);let v=this.connectOpts.servername||this.connectOpts.host;a=qre.connect({...this.connectOpts,servername:v})}else ry("Creating `net.Socket`: %o",this.connectOpts),a=yF.connect(this.connectOpts);let o=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},c=yF.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,xWe.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",wWe),n.secureEndpoint){ry("Upgrading socket connection to TLS");let v=n.servername||n.host;return qre.connect({...jre(n,"host","path","port"),socket:a,servername:v})}return a}a.destroy();let g=new yF.Socket({writable:!1});return g.readable=!0,r.once("socket",v=>{ry("Replaying proxy buffer for failed request"),(0,gWe.default)(v.listenerCount("data")>0),v.push(p),v.push(null)}),g}};VE.protocols=["http","https"];Fs.HttpsProxyAgent=VE;function wWe(e){e.resume()}function jre(e,...r){let n={},i;for(i in e)r.includes(i)||(n[i]=e[i]);return n}});var lne=S((cne,une)=>{"use strict";cne=une.exports=Yd;function Yd(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=""}Yd.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}};Yd.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)}}};Yd.prototype.update=function(e,r){var n=Math.floor(e*this.total),i=n-this.curr;this.tick(i,r)};Yd.prototype.interrupt=function(e){this.stream.clearLine(),this.stream.cursorTo(0),this.stream.write(e),this.stream.write(`
|
|||
|
|
`),this.stream.write(this.lastDraw)};Yd.prototype.terminate=function(){this.clear?this.stream.clearLine&&(this.stream.clearLine(),this.stream.cursorTo(0)):this.stream.write(`
|
|||
|
|
`)}});var pne=S((B4t,fne)=>{"use strict";fne.exports=lne()});var mne=S((G4t,PWe)=>{PWe.exports={name:"@prisma/fetch-engine",version:"6.1.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.10.1","@swc/jest":"0.2.37","@types/jest":"29.5.14","@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":"6.1.0-21.11f085a2012c0f4778414c8db2651556ee0ef959","@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 Hne=S((m5t,zWe)=>{zWe.exports={name:"dotenv",version:"16.4.7",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",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",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var NF=S((g5t,Xo)=>{"use strict";var FF=require("fs"),$F=require("path"),VWe=require("os"),KWe=require("crypto"),YWe=Hne(),LF=YWe.version,XWe=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function QWe(e){let r={},n=e.toString();n=n.replace(/\r\n?/mg,`
|
|||
|
|
`);let i;for(;(i=XWe.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 JWe(e){let r=Kne(e),n=Kr.configDotenv({path:r});if(!n.parsed){let c=new Error(`MISSING_DATA: Cannot parse ${r} for an unknown reason`);throw c.code="MISSING_DATA",c}let i=Vne(e).split(","),a=i.length,o;for(let c=0;c<a;c++)try{let u=i[c].trim(),l=tHe(n,u);o=Kr.decrypt(l.ciphertext,l.key);break}catch(u){if(c+1>=a)throw u}return Kr.parse(o)}function ZWe(e){console.log(`[dotenv@${LF}][INFO] ${e}`)}function eHe(e){console.log(`[dotenv@${LF}][WARN] ${e}`)}function eS(e){console.log(`[dotenv@${LF}][DEBUG] ${e}`)}function Vne(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function tHe(e,r){let n;try{n=new URL(r)}catch(u){if(u.code==="ERR_INVALID_URL"){let l=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw l.code="INVALID_DOTENV_KEY",l}throw u}let i=n.password;if(!i){let u=new Error("INVALID_DOTENV_KEY: Missing key part");throw u.code="INVALID_DOTENV_KEY",u}let a=n.searchParams.get("environment");if(!a){let u=new Error("INVALID_DOTENV_KEY: Missing environment part");throw u.code="INVALID_DOTENV_KEY",u}let o=`DOTENV_VAULT_${a.toUpperCase()}`,c=e.parsed[o];if(!c){let u=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${o} in your .env.vault file.`);throw u.code="NOT_FOUND_DOTENV_ENVIRONMENT",u}return{ciphertext:c,key:i}}function Kne(e){let r=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let n of e.path)FF.existsSync(n)&&(r=n.endsWith(".vault")?n:`${n}.vault`);else r=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else r=$F.resolve(process.cwd(),".env.vault");return FF.existsSync(r)?r:null}function zne(e){return e[0]==="~"?$F.join(VWe.homedir(),e.slice(1)):e}function rHe(e){ZWe("Loading env from encrypted .env.vault");let r=Kr._parseVault(e),n=process.env;return e&&e.processEnv!=null&&(n=e.processEnv),Kr.populate(n,r,e),{parsed:r}}function nHe(e){let r=$F.resolve(process.cwd(),".env"),n="utf8",i=!!(e&&e.debug);e&&e.encoding?n=e.encoding:i&&eS("No encoding is specified. UTF-8 is used by default");let a=[r];if(e&&e.path)if(!Array.isArray(e.path))a=[zne(e.path)];else{a=[];for(let l of e.path)a.push(zne(l))}let o,c={};for(let l of a)try{let f=Kr.parse(FF.readFileSync(l,{encoding:n}));Kr.populate(c,f,e)}catch(f){i&&eS(`Failed to load ${l} ${f.message}`),o=f}let u=process.env;return e&&e.processEnv!=null&&(u=e.processEnv),Kr.populate(u,c,e),o?{parsed:c,error:o}:{parsed:c}}function iHe(e){if(Vne(e).length===0)return Kr.configDotenv(e);let r=Kne(e);return r?Kr._configVault(e):(eHe(`You set DOTENV_KEY but you are missing a .env.vault file at ${r}. Did you forget to build it?`),Kr.configDotenv(e))}function sHe(e,r){let n=Buffer.from(r.slice(-64),"hex"),i=Buffer.from(e,"base64"),a=i.subarray(0,12),o=i.subarray(-16);i=i.subarray(12,-16);try{let c=KWe.createDecipheriv("aes-256-gcm",n,a);return c.setAuthTag(o),`${c.update(i)}${c.final()}`}catch(c){let u=c instanceof RangeError,l=c.message==="Invalid key length",f=c.message==="Unsupported state or unable to authenticate data";if(u||l){let p=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw p.code="INVALID_DOTENV_KEY",p}else if(f){let p=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw p.code="DECRYPTION_FAILED",p}else throw c}}function aHe(e,r,n={}){let i=!!(n&&n.debug),a=!!(n&&n.override);if(typeof r!="object"){let o=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw o.code="OBJECT_REQUIRED",o}for(let o of Object.keys(r))Object.prototype.hasOwnProperty.call(e,o)?(a===!0&&(e[o]=r[o]),i&&eS(a===!0?`"${o}" is already defined and WAS overwritten`:`"${o}" is already defined and was NOT overwritten`)):e[o]=r[o]}var Kr={configDotenv:nHe,_configVault:rHe,_parseVault:JWe,config:iHe,decrypt:sHe,parse:QWe,populate:aHe};Xo.exports.configDotenv=Kr.configDotenv;Xo.exports._configVault=Kr._configVault;Xo.exports._parseVault=K
|
|||
|
|
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 Zoe(this.pattern,this.options)}parse(r,n){PS(r);let i=this.options;if(r==="**")if(i.noglobstar)r="*";else return _a;if(r==="")return"";let a="",o=!1,c=!1,u=[],l=[],f,p=!1,g=-1,v=-1,x,E,D,T=r.charAt(0)===".",R=i.dot||T,k=()=>T?"":R?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",F=j=>j.charAt(0)==="."?"":i.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",L=()=>{if(f){switch(f){case"*":a+=b3,o=!0;break;case"?":a+=_3,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;Xoe[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:Yoe[f].open,close:Yoe[f].close};this.debug(this.pattern," ",q),u.push(q),a+=q.open,q.start===0&&q.type!=="!"&&(T=!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!=="!"&&(T=!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("["+QQe(YQe(x))+"]"),a+=W}catch{a=a.substring(0,g)+"(?:$.)"}o=!0,p=!1;continue;default:L(),Xoe[W]&&!(W==="^"&&p)&&(a+="\\"),a+=W;break}}for(p&&(x=r.slice(v+1),D=this.parse(x,x3),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==="*"?b3:E.type==="?"?_3:"\\"+E.type;o=!0,a=a.slice(0,E.reStart)+W+"\\("+j}L(),c&&(a+="\\\\");let B=zQe[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),J=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 K=M===""&&n!==x3?"(?:$|\\/)":"";a=q+X+M+K+J}if(a!==""&&o&&(a="(?=.)"+a),B&&(a=k()+a),n===x3)return[a,o];if(i.nocase&&!o&&(o=r.toUpperCase()!==r.toLowerCase()),!o)return KQe(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?b3:n.dot?WQe:HQe,a=n.nocase?"i":"",o=r.map(c=>(c=c.map(u=>typeof u=="string"?XQe(u):u===_a?_a:u._src).reduce((u,l)=>(u[u.length-1]===_a&&l===_a||u.push(l),u),[]),c.forEach((u,l)=>{u!==_a||c[l-1]===_a||(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]=_a))}),c.filter(u=>u!==_a).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;w3.sep!=="/"&&(r=r.split(w3.sep).join("/")),r=r.split(Qoe),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 ts.defaults(r).Minimatch}};ts.Minimatch=yh});var ice=S((r9t,nce)=>{"use strict";nce.exports=rce;var D3=require("fs"),{EventEmitter:JQe}=require("events"),{Minimatch:S3}=Ay(),{resolve:ZQe}=require("path");function eJe(e,r){return new Promise((n,i)=>{D3.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 ece(e,r){return new Promise((n,i)=>{(r?D3.stat:D3.lstat)(e,(o,c)=>{if(o)switch(o.code){case"ENOENT":n(r?ece(e,!1):null);break;default:n(null);break}else n(c)})})}async function*tce(e,r,n,i,a,o){let c=await eJe(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 ece(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*tce(f,r,n,i,a,!1)):yield{relative:p,absolute:g,stats:v}}}async function*tJe(e,r,n,i){yield*tce("",e,r,n,i,!0)}function rJe(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 RS=class extends JQe{constructor(r,n,i){if(super(),typeof n=="function"&&(i=n,n=null),this.options=rJe(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 S3(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 S3(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 S3(o,{dot:!0}))}this.iterator=tJe(ZQe(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 EJe(e){let r=_Je(e.toString()),n=r.match(yJe);if(n||(n=r.match(bJe)),!n)throw new Error(`could not parse args in autoInject
|
|||
|
|
Source:
|
|||
|
|
`+r);let[,i]=n;return i.replace(/\s/g,"").split(xJe).map(a=>a.replace(wJe,"").trim())}function yce(e,r){var n={};return Object.keys(e).forEach(i=>{var a=e[i],o,c=$y(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=EJe(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),Je(a)(...g)}}),K3(n,r)}function cce(e,r){e.length=1,e.head=e.tail=r}function Y3(e,r,n){if(r==null)r=1;else if(r===0)throw new RangeError("Concurrency must not be zero");var i=Je(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=(...B)=>{f(k,L),F(...B)};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,B){if(B!=null&&typeof B!="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:B||W);if(F?R._tasks.unshift(q):R._tasks.push(q),g||(g=!0,Ou(()=>{g=!1,R.process()})),L||!B)return new Promise((X,M)=>{V=X,j=M})}function x(k){return function(F,...L){a-=1;for(var B=0,V=k.length;B<V;B++){var j=k[B],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()?(Ou(()=>p("drain")),!0):!1}let D=k=>F=>{if(!F)return new Promise((L,B)=>{l(k,(V,j)=>{if(V)return B(V);L(j)})});f(k),u(k,F)};var T=!1,R={_tasks:new T3,_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(!T){for(T=!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 B=0;B<L;B++){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=ku(x(k));i(F,j)}T=!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,Ou(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 bce(e,r){return Y3(e,1,r)}function xce(e,r,n){return Y3(e,r,n)}function SJe(e,r,n,i){i=Iu(i);var a=Je(n);return so(e,(o,c,u)=>{a(r,o,(l,f)=>{r=f,u(l)})},o=>i(o,r))}function X3(...e){var r=e.map(Je);return function(...n){var i=this,a=n[n.length-1];return typeof a=="function"?n.pop():a=xh(),bh(r,n,(o,c,u)=>{c.apply(i,o.concat((l,...f)=>{u(l,f)}))},(o,c)=>a(o,...c)),a[wh]}}function wce(...e){return X3(...e.reverse())}function DJe(e,r,n,i){return z3(Ea(r),e,n,i)}function CJe(e,r,n,i){var a=Je(n);return Ly(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 TJe(e,r,n){return ky(e,1/0,r,n)}function PJe(e,r,n){return ky(e,1,r,n)}function _ce(...e){return function(...r){var n=r.pop();return n(null,...e)}}function ic(e,r){return(n,i,a,o)=>{var c=!1,u;let l=Je(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,qS);g()})},f=>{if
|
|||
|
|
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(vct(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(Che.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=gct.realpathSync(a,e.realpathCache);i[o]=!0}catch(c){if(c.syscall==="stat")i[e._makeAbs(a)]=!0;else throw c}})}Nf.finish(this)};Xr.prototype._process=function(e,r,n){Che.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=".":((SD(a)||SD(e.map(function(f){return typeof f=="string"?f:"[*]"}).join("/")))&&(!a||!SD(a))&&(a="/"+a),c=a);var u=this._makeAbs(c);if(!yct(this,c)){var l=o[0]===Dhe.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=hN.join(this.root,x)),this._emitMatch(a,x)}return}i.shift();for(var v=0;v<D;v++){var x=g[v],T;e?T=[e,x]:T=[x],this._process(T.concat(i),a,o)}}}};Xr.prototype._emitMatch=function(e,r){if(!bct(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&&!mN(this.symlinks,e))return this._readdirInGlobStar(e);if(mN(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&&SD(e)&&!this.nomount){var i=/[\/\\]$/.test(e);e.charAt(0)==="/"?e=hN.join(this.root,e):(e=hN.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&&mN(this.c
|
|||
|
|
`)),r.linkname&&(n+=i8(" linkpath="+r.linkname+`
|
|||
|
|
`));let i=r.pax;if(i)for(let a in i)n+=i8(" "+a+"="+i[a]+`
|
|||
|
|
`);return yt.from(n)};Vh.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};Vh.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,Hu(r.mode&Flt,6),100),yt.write(n,Hu(r.uid,6),108),yt.write(n,Hu(r.gid,6),116),Blt(r.size,n,124),yt.write(n,Hu(r.mtime.getTime()/1e3|0,11),136),n[156]=ND+qlt(r.type),r.linkname&&yt.write(n,r.linkname,157),yt.copy(ige,n,S0),yt.copy(Olt,n,s8),r.uname&&yt.write(n,r.uname,265),r.gname&&yt.write(n,r.gname,297),yt.write(n,Hu(r.devmajor||0,6),329),yt.write(n,Hu(r.devminor||0,6),337),a&&yt.write(n,a,345),yt.write(n,Hu(age(n),6),148),n)};Vh.decode=function(r,n,i){let a=r[156]===0?0:r[156]-ND,o=zh(r,0,100,n),c=Wu(r,100,8),u=Wu(r,108,8),l=Wu(r,116,8),f=Wu(r,124,12),p=Wu(r,136,12),g=Mlt(a),v=r[157]===0?null:zh(r,157,100,n),x=zh(r,265,32),E=zh(r,297,32),D=Wu(r,329,8),T=Wu(r,337,8),R=age(r);if(R===8*32)return null;if(R!==Wu(r,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if($lt(r))r[345]&&(o=zh(r,345,155,n)+"/"+o);else if(!Llt(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:T,pax:null}};function $lt(e){return yt.equals(ige,e.subarray(S0,S0+6))}function Llt(e){return yt.equals(Ilt,e.subarray(S0,S0+6))&&yt.equals(klt,e.subarray(s8,s8+2))}function Nlt(e,r,n){return typeof e!="number"?n:(e=~~e,e>=r?r:e>=0||(e+=r,e>=0)?e:0)}function Mlt(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 qlt(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 sge(e,r,n,i){for(;n<i;n++)if(e[n]===r)return n;return i}function age(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 Hu(e,r){return e=e.toString(8),e.length>r?Alt.slice(0,r)+" ":Rlt.slice(0,r-e.length)+e+" "}function jlt(e,r,n){r[n]=128;for(let i=11;i>0;i--)r[n+i]=e&255,e=Math.floor(e/256)}function Blt(e,r,n){e.toString(8).length>11?jlt(e,r,n):yt.write(r,Hu(e,11),n)}function Ult(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 Wu(e,r,n){if(e=e.subarray(r,r+n),r=0,e[r]&128)return Ult(e);{for(;r<e.length&&e[r]===32;)r++;let i=Nlt(sge(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 zh(e,r,n,i){return yt.toString(e.subarray(r,sge(e,0,r,r+n)),i)}function i8(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 fge=S((aGt,lge)=>{"use strict";var{Writable:Glt,Readable:Wlt,getStreamError:oge}=n8(),Hlt=BN(),cge=LD(),Kh=a8(),zlt=cge.alloc(0),c8=class{constructor(){this.buffered=0,this.shifted=0,this.queue=new Hlt,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 Fft(e,r){if(e){if(typeof e=="string")return xve(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 xve(e,r)}}function xve(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 $ft=BD(),_ve=mr(),wve=_ve.erase,Lft=_ve.cursor,Nft=e=>[...$ft(e)].length;Eve.exports=function(e,r){if(!r)return wve.line+Lft.to(0);let n=0,i=e.split(/\r?\n/);var a=kft(i),o;try{for(a.s();!(o=a.n()).done;){let c=o.value;n+=1+Math.floor(Math.max(Nft(c)-1,0)/r)}}catch(c){a.e(c)}finally{a.f()}return wve.lines(n)}});var I8=S((BGt,Dve)=>{"use strict";var T0={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},Mft={arrowUp:T0.arrowUp,arrowDown:T0.arrowDown,arrowLeft:T0.arrowLeft,arrowRight:T0.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},qft=process.platform==="win32"?Mft:T0;Dve.exports=qft});var Tve=S((UGt,Cve)=>{"use strict";var nm=dr(),Vf=I8(),k8=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}`}}),jft=e=>k8[e]||k8.default,P0=Object.freeze({aborted:nm.red(Vf.cross),done:nm.green(Vf.tick),exited:nm.yellow(Vf.cross),default:nm.cyan("?")}),Bft=(e,r,n)=>r?P0.aborted:n?P0.exited:e?P0.done:P0.default,Uft=e=>nm.gray(e?Vf.ellipsis:Vf.pointerSmall),Gft=(e,r)=>nm.gray(e?r?Vf.pointerSmall:"+":Vf.line);Cve.exports={styles:k8,render:jft,symbols:P0,symbol:Bft,delimiter:Uft,item:Gft}});var Rve=S((GGt,Pve)=>{"use strict";var Wft=BD();Pve.exports=function(e,r){let n=String(Wft(e)||"").split(/\r?\n/);return r?n.map(i=>Math.ceil(i.length/r)).reduce((i,a)=>i+a):n.length}});var Ove=S((WGt,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 kve=S((HGt,Ive)=>{"use strict";Ive.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((zGt,Fve)=>{"use strict";Fve.exports={action:vve(),clear:Sve(),style:Tve(),strip:BD(),figures:I8(),lines:Rve(),wrap:Ove(),entriesToDisplay:kve()}});var pc=S((VGt,Nve)=>{"use strict";var $ve=require("readline"),Hft=Ca(),zft=Hft.action,Vft=require("events"),Lve=mr(),Kft=Lve.beep,Yft=Lve.cursor,Xft=dr(),F8=class extends Vft{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=$ve.createInterface({input:this.in,escapeCodeTimeout:50});$ve.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=zft(c,i);u===!1?this._&&this._(o,c):typeof this[u]=="function"?this[u](c):this.bell()};this.close=()=>{this.out.write(Yft.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(Kft)}render(){this.onRender(Xft),this.firstRender&&(this.firstRender=!1)}};Nve.exports=F8});var Uve=S((KGt,Bve)=>{"use strict";function Mve(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 qve(e){return function(){var r=this,n=arguments;return new Promise(function(i,a){var o=e.apply(r,n);function c(l){Mve(o,i,a,c,u,"next",l)}function u(l){Mve(o,i,a,c,u,"throw",l)}c(void 0)})}}var UD=dr(),Qft=pc(),jve=mr(),Jft=jve.erase,R0=jve.cursor,GD=Ca(),$8=GD.style,L8=GD.clear,Zft=GD.lines,ept=GD.figures,N8=class extends Qft{constructor(r={}){super(r),this.transform=$8.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=L8("",this.out.columns),this.render()}set value(r){!r&&this.initial?(this.placeholder=!0,this.rendered=UD.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 qve(function*(){let n=yield r.validator(r.value);typeof n=="string"&&(r.errorMsg=n,n=!1),r.error=!n})()}submit(){var r=this;return qve(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(R0.down(Zft(this.outputError,this.out.columns)-1)+L8(this.outputError,this.out.columns)),this.out.write(L8(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[$8.symbol(this.done,this.aborted),UD.bold(this.msg),$8.delimiter(this.done),this.red?UD.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|||
|
|
`).reduce((r,n,i)=>r+`
|
|||
|
|
${i?" ":ept.pointerSmall} ${UD.red().italic(n)}`,"")),this.out.write(Jft.line+R0.to(0)+this.outputText+R0.save+this.outputError+R0.restore+R0.move(this.cursorOffset,0)))}};Bve.exports=N8});var zve=S((YGt,Hve)=>{"use strict";var dc=dr(),tpt=pc(),A0=Ca(),Gve=A0.style,Wve=A0.clear,WD=A0.figures,rpt=A0.wrap,npt=A0.entriesToDisplay,ipt=mr(),spt=ipt.cursor,M8=class extends tpt{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=Wve("",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(spt.hide):this.out.write(Wve(this.outputText,this.out.columns)),super.render();let r=npt(this.cursor,this.choices.length,this.optionsPerPage),n=r.startIndex,i=r.endIndex;if(this.outputText=[Gve.symbol(this.done,this.aborted),dc.bold(this.msg),Gve.delimiter(!1),this.done?this.selection.title:this.selection.disabled?dc.yellow(this.warn):dc.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=WD.arrowUp:a===i-1&&i<this.choices.length?c=WD.arrowDown:c=" ",l.disabled?(o=this.cursor===a?dc.gray().underline(l.title):dc.strikethrough().gray(l.title),c=(this.cursor===a?dc.bold().gray(WD.pointer)+" ":" ")+c):(o=this.cursor===a?dc.cyan().underline(l.title):l.title,c=(this.cursor===a?dc.cyan(WD.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=`
|
|||
|
|
`+rpt(l.description,{margin:3,width:this.out.columns})))),this.outputText+=`${c} ${o}${dc.gray(u)}
|
|||
|
|
`}}this.out.write(this.outputText)}};Hve.exports=M8});var Jve=S((XGt,Qve)=>{"use strict";var HD=dr(),apt=pc(),Yve=Ca(),Vve=Yve.style,opt=Yve.clear,Xve=mr(),Kve=Xve.cursor,cpt=Xve.erase,q8=class extends apt{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(Kve.hide):this.out.write(opt(this.outputText,this.out.columns)),super.render(),this.outputText=[Vve.symbol(this.done,this.aborted),HD.bold(this.msg),Vve.delimiter(this.done),this.value?this.inactive:HD.cyan().underline(this.inactive),HD.gray("/"),this.value?HD.cyan().underline(this.active):this.active].join(" "),this.out.write(cpt.line+Kve.to(0)+this.outputText))}};Qve.exports=q8});var fo=S((QGt,Zve)=>{"use strict";var j8=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)}};Zve.exports=j8});var tye=S((JGt,eye)=>{"use strict";var upt=fo(),B8=class extends upt{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}};eye.exports=B8});var nye=S((ZGt,rye)=>{"use strict";var lpt=fo(),fpt=e=>(e=e%10,e===1?"st":e===2?"nd":e===3?"rd":"th"),U8=class extends lpt{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+fpt(r):this.token==="d"?n+1:this.token==="ddd"?this.locales.weekdaysShort[n]:this.token==="dddd"?this.locales.weekdays[n]:r}};rye.exports=U8});var sye=S((eWt,iye)=>{"use strict";var ppt=fo(),G8=class extends ppt{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}};iye.exports=G8});var oye=S((tWt,aye)=>{"use strict";var dpt=fo(),W8=class extends dpt{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)}};aye.exports=W8});var uye=S((rWt,cye)=>{"use strict";var hpt=fo(),H8=class extends hpt{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}};cye.exports=H8});var fye=S((nWt,lye)=>{"use strict";var mpt=fo(),z8=class extends mpt{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)}};lye.exports=z8});var dye=S((iWt,pye)=>{"use strict";var gpt=fo(),V8=class extends gpt{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 bye(function*(){let n=yield r.validator(r.value);typeof n=="string"&&(r.errorMsg=n,n=!1),r.error=!n})()}submit(){var r=this;return bye(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 Eye)),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(_ye.hide):this.out.write(wye(this.outputText,this.out.columns)),super.render(),this.outputText=[xye.symbol(this.done,this.aborted),Y8.bold(this.msg),xye.delimiter(!1),this.parts.reduce((r,n,i)=>r.concat(i===this.cursor&&!this.done?Y8.cyan().underline(n.toString()):n),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
|
|||
|
|
`).reduce((r,n,i)=>r+`
|
|||
|
|
${i?" ":bpt.pointerSmall} ${Y8.red().italic(n)}`,"")),this.out.write(xpt.line+_ye.to(0)+this.outputText))}};Cye.exports=X8});var Fye=S((cWt,kye)=>{"use strict";function Pye(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 Rye(e){return function(){var r=this,n=arguments;return new Promise(function(i,a){var o=e.apply(r,n);function c(l){Pye(o,i,a,c,u,"next",l)}function u(l){Pye(o,i,a,c,u,"throw",l)}c(void 0)})}}var zD=dr(),Opt=pc(),Iye=mr(),VD=Iye.cursor,Ipt=Iye.erase,KD=Ca(),J8=KD.style,kpt=KD.figures,Aye=KD.clear,Fpt=KD.lines,$pt=/[0-9]/,Z8=e=>e!==void 0,Oye=(e,r)=>{let n=Math.pow(10,r);return Math.round(e*n)/n},eM=class extends Opt{constructor(r={}){super(r),this.transform=J8.render(r.style),this.msg=r.message,this.initial=Z8(r.initial)?r.initial:"",this.float=!!r.float,this.round=r.round||2,this.inc=r.increment||1,this.min=Z8(r.min)?r.min:-1/0,this.max=Z8(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=zD.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||$pt.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 Rye(function*(){let n=yield r.validator(r.value);typeof n=="string"&&(r.errorMsg=n,n=!1),r.error=!n})()}submit(){var r=this;return Rye(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(VD.down(Fpt(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=[J8.symbol(this.done,this.aborted),zD.bold(this.msg),J8.delimiter(this.done),!this.done||!this.done&&!this.placeholder?zD[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|||
|
|
`).reduce((r,n,i)=>r+`
|
|||
|
|
${i?" ":kpt.pointerSmall} ${zD.red().italic(n)}`,"")),this.out.write(Ipt.line+VD.to(0)+this.outputText+VD.save+this.outputError+VD.restore))}};kye.exports=eM});var rM=S((uWt,Nye)=>{"use strict";var po=dr(),Lpt=mr(),Npt=Lpt.cursor,Mpt=pc(),O0=Ca(),$ye=O0.clear,Yu=O0.figures,Lye=O0.style,qpt=O0.wrap,jpt=O0.entriesToDisplay,tM=class extends Mpt{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=$ye("",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:
|
|||
|
|
${Yu.arrowUp}/${Yu.arrowDown}: Highlight option
|
|||
|
|
${Yu.arrowLeft}/${Yu.arrowRight}/[space]: Toggle selection
|
|||
|
|
`+(this.maxChoices===void 0?` a: Toggle all
|
|||
|
|
`:"")+" enter/return: Complete answer":""}renderOption(r,n,i,a){let o=(n.selected?po.green(Yu.radioOn):Yu.radioOff)+" "+a+" ",c,u;return n.disabled?c=r===i?po.gray().underline(n.title):po.strikethrough().gray(n.title):(c=r===i?po.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=`
|
|||
|
|
`+qpt(n.description,{margin:o.length,width:this.out.columns})))),o+c+po.gray(u||"")}paginateOptions(r){if(r.length===0)return po.red("No matches for this query.");let n=jpt(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=Yu.arrowUp:u===a-1&&a<r.length?o=Yu.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=[po.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&r.push(po.yellow(this.warn)),r.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Npt.hide),super.render();let r=[Lye.symbol(this.done,this.aborted),po.bold(this.msg),Lye.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(r+=po.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=$ye(r,this.out.columns)}};Nye.exports=tM});var Wye=S((lWt,Gye)=>{"use strict";function Mye(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 Bpt(e){return function(){var r=this,n=arguments;return new Promise(function(i,a){var o=e.apply(r,n);function c(l){Mye(o,i,a,c,u,"next",l)}function u(l){Mye(o,i,a,c,u,"throw",l)}c(void 0)})}}var I0=dr(),Upt=pc(),Uye=mr(),Gpt=Uye.erase,qye=Uye.cursor,k0=Ca(),nM=k0.style,jye=k0.clear,iM=k0.figures,Wpt=k0.wrap,Hpt=k0.entriesToDisplay,Bye=(e,r)=>e[r]&&(e[r].value||e[r].title||e[r]),zpt=(e,r)=>e[r]&&(e[r].title||e[r].value||e[r]),Vpt=(e,r)=>{let n=e.findIndex(i=>i.value===r||i.title===r);return n>-1?n:void 0},sM=class extends Upt{constructor(r={}){super(r),this.msg=r.message,this.suggest=r.suggest,this.choices=r.choices,this.initial=typeof r.initial=="number"?r.initial:Vpt(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=nM.render(r.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=jye("",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=Bye(this.suggestions,r):this.value=this.fallback.value,this.fire()}complete(r){var n=this;return Bpt(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:zpt(l,u),value:Bye(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?iM.arrowUp:a?iM.arrowDown:" ",u=n?I0.cyan().underline(r.title):r.title;return c=(n?I0.cyan(iM.pointer)+" ":" ")+c,r.description&&(o=` - ${r.description}`,(c.length+u.length+o.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(o=`
|
|||
|
|
`+Wpt(r.description,{margin:3,width:this.out.columns}))),c+" "+u+I0.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(qye.hide):this.out.write(jye(this.outputText,this.out.columns)),super.render();let r=Hpt(this.select,this.choices.length,this.limit),n=r.startIndex,i=r.endIndex;if(this.outputText=[nM.symbol(this.done,this.aborted,this.exited),I0.bold(this.msg),nM.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||I0.gray(this.fallback.title))}this.out.write(Gpt.line+qye.to(0)+this.outputText)}};Gye.exports=sM});var Kye=S((fWt,Vye)=>{"use strict";var mc=dr(),Kpt=mr(),Ypt=Kpt.cursor,Xpt=rM(),oM=Ca(),Hye=oM.clear,zye=oM.style,im=oM.figures,aM=class extends Xpt{constructor(r={}){r.overrideRender=!0,super(r),this.inputValue="",this.clear=Hye("",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:
|
|||
|
|
${im.arrowUp}/${im.arrowDown}: Highlight option
|
|||
|
|
${im.arrowLeft}/${im.arrowRight}/[space]: Toggle selection
|
|||
|
|
[a,b,c]/delete: Filter choices
|
|||
|
|
enter/return: Complete answer
|
|||
|
|
`:""}renderCurrentInput(){return`
|
|||
|
|
Filtered results for: ${this.inputValue?this.inputValue:mc.gray("Enter something to filter")}
|
|||
|
|
`}renderOption(r,n,i){let a;return n.disabled?a=r===i?mc.gray().underline(n.title):mc.strikethrough().gray(n.title):a=r===i?mc.cyan().underline(n.title):n.title,(n.selected?mc.green(im.radioOn):im.radioOff)+" "+a}renderDoneOrInstructions(){if(this.done)return this.value.filter(n=>n.selected).map(n=>n.title).join(", ");let r=[mc.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&r.push(mc.yellow(this.warn)),r.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Ypt.hide),super.render();let r=[zye.symbol(this.done,this.aborted),mc.bold(this.msg),zye.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(r+=mc.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=Hye(r,this.out.columns)}};Vye.exports=aM});var t0e=S((pWt,e0e)=>{"use strict";var Yye=dr(),Qpt=pc(),Jye=Ca(),Xye=Jye.style,Jpt=Jye.clear,Zye=mr(),Zpt=Zye.erase,Qye=Zye.cursor,cM=class extends Qpt{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(Qye.hide):this.out.write(Jpt(this.outputText,this.out.columns)),super.render(),this.outputText=[Xye.symbol(this.done,this.aborted),Yye.bold(this.msg),Xye.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Yye.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Zpt.line+Qye.to(0)+this.outputText))}};e0e.exports=cM});var n0e=S((dWt,r0e)=>{"use strict";r0e.exports={TextPrompt:Uve(),SelectPrompt:zve(),TogglePrompt:Jve(),DatePrompt:Tye(),NumberPrompt:Fye(),MultiselectPrompt:rM(),AutocompletePrompt:Wye(),AutocompleteMultiselectPrompt:Kye(),ConfirmPrompt:t0e()}});var s0e=S(i0e=>{"use strict";var Ti=i0e,edt=n0e(),YD=e=>e;function ho(e,r,n={}){return new Promise((i,a)=>{let o=new edt[e](r),c=n.onAbort||YD,u=n.onSubmit||YD,l=n.onExit||YD;o.on("state",r.onState||YD),o.on("submit",f=>i(u(f))),o.on("exit",f=>i(l(f))),o.on("abort",f=>a(c(f)))})}Ti.text=e=>ho("TextPrompt",e);Ti.password=e=>(e.style="password",Ti.text(e));Ti.invisible=e=>(e.style="invisible",Ti.text(e));Ti.number=e=>ho("NumberPrompt",e);Ti.date=e=>ho("DatePrompt",e);Ti.confirm=e=>ho("ConfirmPrompt",e);Ti.list=e=>{let r=e.separator||",";return ho("TextPrompt",e,{onSubmit:n=>n.split(r).map(i=>i.trim())})};Ti.toggle=e=>ho("TogglePrompt",e);Ti.select=e=>ho("SelectPrompt",e);Ti.multiselect=e=>{e.choices=[].concat(e.choices||[]);let r=n=>n.filter(i=>i.selected).map(i=>i.value);return ho("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 ho("AutocompleteMultiselectPrompt",e,{onAbort:r,onSubmit:r})};var tdt=(e,r)=>Promise.resolve(r.filter(n=>n.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));Ti.autocomplete=e=>(e.suggest=e.suggest||tdt,e.choices=[].concat(e.choices||[]),ho("AutocompletePrompt",e))});var d0e=S((mWt,p0e)=>{"use strict";function a0e(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 o0e(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?a0e(Object(n),!0).forEach(function(i){rdt(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a0e(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function rdt(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function ndt(e,r){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=idt(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 idt(e,r){if(e){if(typeof e=="string")return c0e(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 c0e(e,r)}}function c0e(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 u0e(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 l0e(e){return function(){var r=this,n=arguments;return new Promise(function(i,a){var o=e.apply(r,n);function c(l){u0e(o,i,a,c,u,"next",l)}function u(l){u0e(o,i,a,c,u,"throw",l)}c(void 0)})}}var uM=s0e(),sdt=["suggest","format","onState","validate","onRender","type"],f0e=()=>{};function Xu(){return lM.apply(this,arguments)}function lM(){return lM=l0e(function*(e=[],{onSubmit:r=f0e,onCancel:n=f0e}={}){let i={},a=Xu._override||{};e=[].concat(e);let o,c,u,l,f,p,g=function(){var T=l0e(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 T.apply(this,arguments)}}();var v=ndt(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,o0e({},i),c),c.type=f),!!f){for(let T in c){if(sdt.includes(T))continue;let R=c[T];c[T]=typeof R=="function"?yield R(o,o0e({},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,uM[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=Xu._injected?adt(Xu._injected,c.initial):yield uM[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(T){v.e(T)}finally{v.f()}return i}),lM.apply(this,arguments)}function adt(e,r){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?r:n}function odt(e){Xu._injected=(Xu._injected||[]).concat(e)}function cdt(e){Xu._override=Object.assign({},e)}p0e.exports=Object.assign(Xu,{prompt:Xu,prompts:uM,inject:odt,override:cdt})});var m0e=S((gWt,h0e)=>{"use strict";h0e.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 XD=S((vWt,g0e)=>{"use strict";g0e.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 b0e=S((yWt,y0e)=>{"use strict";var udt=XD(),{erase:v0e,cursor:ldt}=mr(),fdt=e=>[...udt(e)].length;y0e.exports=function(e,r){if(!r)return v0e.line+ldt.to(0);let n=0,i=e.split(/\r?\n/);for(let a of i)n+=1+Math.floor(Math.max(fdt(a)-1,0)/r);return v0e.lines(n)}});var fM=S((bWt,x0e)=>{"use strict";var F0={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},pdt={arrowUp:F0.arrowUp,arrowDown:F0.arrowDown,arrowLeft:F0.arrowLeft,arrowRight:F0.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u22
|
|||
|
|
`)).join(`
|
|||
|
|
`)}});var P0e=S((EWt,T0e)=>{"use strict";T0e.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 Ta=S((SWt,R0e)=>{"use strict";R0e.exports={action:m0e(),clear:b0e(),style:_0e(),strip:XD(),figures:fM(),lines:S0e(),wrap:C0e(),entriesToDisplay:P0e()}});var gc=S((DWt,O0e)=>{"use strict";var A0e=require("readline"),{action:bdt}=Ta(),xdt=require("events"),{beep:wdt,cursor:_dt}=mr(),Edt=dr(),dM=class extends xdt{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=bdt(c,i);u===!1?this._&&this._(o,c):typeof this[u]=="function"?this[u](c):this.bell()};this.close=()=>{this.out.write(_dt.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(wdt)}render(){this.onRender(Edt),this.firstRender&&(this.firstRender=!1)}};O0e.exports=dM});var k0e=S((CWt,I0e)=>{"use strict";var QD=dr(),Sdt=gc(),{erase:Ddt,cursor:L0}=mr(),{style:hM,clear:mM,lines:Cdt,figures:Tdt}=Ta(),gM=class extends Sdt{constructor(r={}){super(r),this.transform=hM.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=mM("",this.out.columns),this.render()}set value(r){!r&&this.initial?(this.placeholder=!0,this.rendered=QD.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(L0.down(Cdt(this.outputError,this.out.columns)-1)+mM(this.outputError,this.out.columns)),this.out.write(mM(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[hM.symbol(this.done,this.aborted),QD.bold(this.msg),hM.delimiter(this.done),this.red?QD.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|||
|
|
`).reduce((r,n,i)=>r+`
|
|||
|
|
${i?" ":Tdt.pointerSmall} ${QD.red().italic(n)}`,"")),this.out.write(Ddt.line+L0.to(0)+this.outputText+L0.save+this.outputError+L0.restore+L0.move(this.cursorOffset,0)))}};I0e.exports=gM});var N0e=S((TWt,L0e)=>{"use strict";var vc=dr(),Pdt=gc(),{style:F0e,clear:$0e,figures:JD,wrap:Rdt,entriesToDisplay:Adt}=Ta(),{cursor:Odt}=mr(),vM=class extends Pdt{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=$0e("",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(Odt.hide):this.out.write($0e(this.outputText,this.out.columns)),super.render();let{startIndex:r,endIndex:n}=Adt(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[F0e.symbol(this.done,this.aborted),vc.bold(this.msg),F0e.delimiter(!1),this.done?this.selection.title:this.selection.disabled?vc.yellow(this.warn):vc.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=JD.arrowUp:i===n-1&&n<this.choices.length?o=JD.arrowDown:o=" ",u.disabled?(a=this.cursor===i?vc.gray().underline(u.title):vc.strikethrough().gray(u.title),o=(this.cursor===i?vc.bold().gray(JD.pointer)+" ":" ")+o):(a=this.cursor===i?vc.cyan().underline(u.title):u.title,o=(this.cursor===i?vc.cyan(JD.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=`
|
|||
|
|
`+Rdt(u.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${a}${vc.gray(c)}
|
|||
|
|
`}}this.out.write(this.outputText)}};L0e.exports=vM});var B0e=S((PWt,j0e)=>{"use strict";var ZD=dr(),Idt=gc(),{style:M0e,clear:kdt}=Ta(),{cursor:q0e,erase:Fdt}=mr(),yM=class extends Idt{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(q0e.hide):this.out.write(kdt(this.outputText,this.out.columns)),super.render(),this.outputText=[M0e.symbol(this.done,this.aborted),ZD.bold(this.msg),M0e.delimiter(this.done),this.value?this.inactive:ZD.cyan().underline(this.inactive),ZD.gray("/"),this.value?ZD.cyan().underline(this.active):this.active].join(" "),this.out.write(Fdt.line+q0e.to(0)+this.outputText))}};j0e.exports=yM});var mo=S((RWt,U0e)=>{"use strict";var bM=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)}};U0e.exports=bM});var W0e=S((AWt,G0e)=>{"use strict";var $dt=mo(),xM=class extends $dt{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}};G0e.exports=xM});var z0e=S((OWt,H0e)=>{"use strict";var Ldt=mo(),Ndt=e=>(e=e%10,e===1?"st":e===2?"nd":e===3?"rd":"th"),wM=class extends Ldt{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+Ndt(r):this.token==="d"?n+1:this.token==="ddd"?this.locales.weekdaysShort[n]:this.token==="dddd"?this.locales.weekdays[n]:r}};H0e.exports=wM});var K0e=S((IWt,V0e)=>{"use strict";var Mdt=mo(),_M=class extends Mdt{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}};V0e.exports=_M});var X0e=S((kWt,Y0e)=>{"use strict";var qdt=mo(),EM=class extends qdt{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)}};Y0e.exports=EM});var J0e=S((FWt,Q0e)=>{"use strict";var jdt=mo(),SM=class extends jdt{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}};Q0e.exports=SM});var ebe=S(($Wt,Z0e)=>{"use strict";var Bdt=mo(),DM=class extends Bdt{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)}};Z0e.exports=DM});var rbe=S((LWt,tbe)=>{"use strict";var Udt=mo(),CM=class extends Udt{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 lbe)),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(ube.hide):this.out.write(cbe(this.outputText,this.out.columns)),super.render(),this.outputText=[obe.symbol(this.done,this.aborted),PM.bold(this.msg),obe.delimiter(!1),this.parts.reduce((r,n,i)=>r.concat(i===this.cursor&&!this.done?PM.cyan().underline(n.toString()):n),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
|
|||
|
|
`).reduce((r,n,i)=>r+`
|
|||
|
|
${i?" ":Hdt.pointerSmall} ${PM.red().italic(n)}`,"")),this.out.write(zdt.line+ube.to(0)+this.outputText))}};pbe.exports=RM});var vbe=S((jWt,gbe)=>{"use strict";var eC=dr(),nht=gc(),{cursor:tC,erase:iht}=mr(),{style:AM,figures:sht,clear:hbe,lines:aht}=Ta(),oht=/[0-9]/,OM=e=>e!==void 0,mbe=(e,r)=>{let n=Math.pow(10,r);return Math.round(e*n)/n},IM=class extends nht{constructor(r={}){super(r),this.transform=AM.render(r.style),this.msg=r.message,this.initial=OM(r.initial)?r.initial:"",this.float=!!r.float,this.round=r.round||2,this.inc=r.increment||1,this.min=OM(r.min)?r.min:-1/0,this.max=OM(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=eC.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${mbe(r,this.round)}`),this._value=mbe(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||oht.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(tC.down(aht(this.outputError,this.out.columns)-1)+hbe(this.outputError,this.out.columns)),this.out.write(hbe(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[AM.symbol(this.done,this.aborted),eC.bold(this.msg),AM.delimiter(this.done),!this.done||!this.done&&!this.placeholder?eC[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|||
|
|
`).reduce((r,n,i)=>r+`
|
|||
|
|
${i?" ":sht.pointerSmall} ${eC.red().italic(n)}`,"")),this.out.write(iht.line+tC.to(0)+this.outputText+tC.save+this.outputError+tC.restore))}};gbe.exports=IM});var FM=S((BWt,xbe)=>{"use strict";var go=dr(),{cursor:cht}=mr(),uht=gc(),{clear:ybe,figures:Qu,style:bbe,wrap:lht,entriesToDisplay:fht}=Ta(),kM=class extends uht{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=ybe("",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:
|
|||
|
|
${Qu.arrowUp}/${Qu.arrowDown}: Highlight option
|
|||
|
|
${Qu.arrowLeft}/${Qu.arrowRight}/[space]: Toggle selection
|
|||
|
|
`+(this.maxChoices===void 0?` a: Toggle all
|
|||
|
|
`:"")+" enter/return: Complete answer":""}renderOption(r,n,i,a){let o=(n.selected?go.green(Qu.radioOn):Qu.radioOff)+" "+a+" ",c,u;return n.disabled?c=r===i?go.gray().underline(n.title):go.strikethrough().gray(n.title):(c=r===i?go.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=`
|
|||
|
|
`+lht(n.description,{margin:o.length,width:this.out.columns})))),o+c+go.gray(u||"")}paginateOptions(r){if(r.length===0)return go.red("No matches for this query.");let{startIndex:n,endIndex:i}=fht(this.cursor,r.length,this.optionsPerPage),a,o=[];for(let c=n;c<i;c++)c===n&&n>0?a=Qu.arrowUp:c===i-1&&i<r.length?a=Qu.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=[go.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&r.push(go.yellow(this.warn)),r.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(cht.hide),super.render();let r=[bbe.symbol(this.done,this.aborted),go.bold(this.msg),bbe.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(r+=go.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=ybe(r,this.out.columns)}};xbe.exports=kM});var Dbe=S((UWt,Sbe)=>{"use strict";var N0=dr(),pht=gc(),{erase:dht,cursor:wbe}=mr(),{style:$M,clear:_be,figures:LM,wrap:hht,entriesToDisplay:mht}=Ta(),Ebe=(e,r)=>e[r]&&(e[r].value||e[r].title||e[r]),ght=(e,r)=>e[r]&&(e[r].title||e[r].value||e[r]),vht=(e,r)=>{let n=e.findIndex(i=>i.value===r||i.title===r);return n>-1?n:void 0},NM=class extends pht{constructor(r={}){super(r),this.msg=r.message,this.suggest=r.suggest,this.choices=r.choices,this.initial=typeof r.initial=="number"?r.initial:vht(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=$M.render(r.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=_be("",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=Ebe(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:ght(u,c),value:Ebe(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?LM.arrowUp:a?LM.arrowDown:" ",u=n?N0.cyan().underline(r.title):r.title;return c=(n?N0.cyan(LM.pointer)+" ":" ")+c,r.description&&(o=` - ${r.description}`,(c.length+u.length+o.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(o=`
|
|||
|
|
`+hht(r.description,{margin:3,width:this.out.columns}))),c+" "+u+N0.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(wbe.hide):this.out.write(_be(this.outputText,this.out.columns)),super.render();let{startIndex:r,endIndex:n}=mht(this.select,this.choices.length,this.limit);if(this.outputText=[$M.symbol(this.done,this.aborted,this.exited),N0.bold(this.msg),$M.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||N0.gray(this.fallback.title))}this.out.write(dht.line+wbe.to(0)+this.outputText)}};Sbe.exports=NM});var Rbe=S((GWt,Pbe)=>{"use strict";var yc=dr(),{cursor:yht}=mr(),bht=FM(),{clear:Cbe,style:Tbe,figures:am}=Ta(),MM=class extends bht{constructor(r={}){r.overrideRender=!0,super(r),this.inputValue="",this.clear=Cbe("",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:
|
|||
|
|
${am.arrowUp}/${am.arrowDown}: Highlight option
|
|||
|
|
${am.arrowLeft}/${am.arrowRight}/[space]: Toggle selection
|
|||
|
|
[a,b,c]/delete: Filter choices
|
|||
|
|
enter/return: Complete answer
|
|||
|
|
`:""}renderCurrentInput(){return`
|
|||
|
|
Filtered results for: ${this.inputValue?this.inputValue:yc.gray("Enter something to filter")}
|
|||
|
|
`}renderOption(r,n,i){let a;return n.disabled?a=r===i?yc.gray().underline(n.title):yc.strikethrough().gray(n.title):a=r===i?yc.cyan().underline(n.title):n.title,(n.selected?yc.green(am.radioOn):am.radioOff)+" "+a}renderDoneOrInstructions(){if(this.done)return this.value.filter(n=>n.selected).map(n=>n.title).join(", ");let r=[yc.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&r.push(yc.yellow(this.warn)),r.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(yht.hide),super.render();let r=[Tbe.symbol(this.done,this.aborted),yc.bold(this.msg),Tbe.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(r+=yc.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=Cbe(r,this.out.columns)}};Pbe.exports=MM});var Fbe=S((WWt,kbe)=>{"use strict";var Abe=dr(),xht=gc(),{style:Obe,clear:wht}=Ta(),{erase:_ht,cursor:Ibe}=mr(),qM=class extends xht{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(Ibe.hide):this.out.write(wht(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(_ht.line+Ibe.to(0)+this.outputText))}};kbe.exports=qM});var Lbe=S((HWt,$be)=>{"use strict";$be.exports={TextPrompt:k0e(),SelectPrompt:N0e(),TogglePrompt:B0e(),DatePrompt:dbe(),NumberPrompt:vbe(),MultiselectPrompt:FM(),AutocompletePrompt:Dbe(),AutocompleteMultiselectPrompt:Rbe(),ConfirmPrompt:Fbe()}});var Mbe=S(Nbe=>{"use strict";var Pi=Nbe,Eht=Lbe(),rC=e=>e;function vo(e,r,n={}){return new Promise((i,a)=>{let o=new Eht[e](r),c=n.onAbort||rC,u=n.onSubmit||rC,l=n.onExit||rC;o.on("state",r.onState||rC),o.on("submit",f=>i(u(f))),o.on("exit",f=>i(l(f))),o.on("abort",f=>a(c(f)))})}Pi.text=e=>vo("TextPrompt",e);Pi.password=e=>(e.style="password",Pi.text(e));Pi.invisible=e=>(e.style="invisible",Pi.text(e));Pi.number=e=>vo("NumberPrompt",e);Pi.date=e=>vo("DatePrompt",e);Pi.confirm=e=>vo("ConfirmPrompt",e);Pi.list=e=>{let r=e.separator||",";return vo("TextPrompt",e,{onSubmit:n=>n.split(r).map(i=>i.trim())})};Pi.toggle=e=>vo("TogglePrompt",e);Pi.select=e=>vo("SelectPrompt",e);Pi.multiselect=e=>{e.choices=[].concat(e.choices||[]);let r=n=>n.filter(i=>i.selected).map(i=>i.value);return vo("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 vo("AutocompleteMultiselectPrompt",e,{onAbort:r,onSubmit:r})};var Sht=(e,r)=>Promise.resolve(r.filter(n=>n.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));Pi.autocomplete=e=>(e.suggest=e.suggest||Sht,e.choices=[].concat(e.choices||[]),vo("AutocompletePrompt",e))});var Bbe=S((VWt,jbe)=>{"use strict";var jM=Mbe(),Dht=["suggest","format","onState","validate","onRender","type"],qbe=()=>{};async function Ju(e=[],{onSubmit:r=qbe,onCancel:n=qbe}={}){let i={},a=Ju._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(Dht.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,jM[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=Ju._injected?Cht(Ju._injected,c.initial):await jM[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 Cht(e,r){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?r:n}function Tht(e){Ju._injected=(Ju._injected||[]).concat(e)}function Pht(e){Ju._override=Object.assign({},e)}jbe.exports=Object.assign(Ju,{prompt:Ju,prompts:jM,inject:Tht,override:Pht})});var Zu=S((KWt,Ube)=>{"use strict";function Rht(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}Ube.exports=Rht("8.6.0")?d0e():Bbe()});var iC=S((rHt,UM)=>{"use strict";var Vbe=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);UM.exports=Vbe;UM.exports.default=Vbe});var GM=S((nHt,Ybe)=>{"use strict";var Kbe="[\uD800-\uDBFF][\uDC00-\uDFFF]",Aht=e=>e&&e.exact?new RegExp(`^${Kbe}$`):new RegExp(Kbe,"g");Ybe.exports=Aht});var Qbe=S((iHt,X
|
|||
|
|
`:`
|
|||
|
|
`,j4=(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+=vm(o+"[]")+a+vm(u)+`
|
|||
|
|
`;else c&&typeof c=="object"?n.push(o):i+=vm(o)+a+vm(c)+q4}r.section&&i.length&&(i="["+vm(r.section)+"]"+q4+i);for(let o of n){let c=Gwe(o).join("\\."),u=(r.section?r.section+".":"")+c,{whitespace:l}=r,f=j4(e[o],{section:u,whitespace:l});i.length&&f.length&&(i+=q4),i+=f}return i},Gwe=e=>e.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(r=>r.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")),Uwe=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=SC(l[1]),i==="__proto__"){n=Object.create(null);continue}n=r[i]=r[i]||Object.create(null);continue}let f=SC(l[2]),p=f.length>2&&f.slice(-2)==="[]",g=p?f.slice(0,-2):f;if(g==="__proto__")continue;let v=l[3]?SC(l[4]):!0,x=v==="true"||v==="false"||v==="null"?JSON.parse(v):v;p&&(M4.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(!M4.call(r,u)||typeof r[u]!="object"||Array.isArray(r[u]))continue;let l=Gwe(u),f=r,p=l.pop(),g=p.replace(/\\\./g,".");for(let v of l)v!=="__proto__"&&((!M4.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},Wwe=e=>e.charAt(0)==='"'&&e.slice(-1)==='"'||e.charAt(0)==="'"&&e.slice(-1)==="'",vm=e=>typeof e!="string"||e.match(/[=\r\n]/)||e.match(/^\[/)||e.length>1&&Wwe(e)||e!==e.trim()?JSON.stringify(e):e.replace(/;/g,"\\;").replace(/#/g,"\\#"),SC=(e,r)=>{if(e=(e||"").trim(),Wwe(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};Hwe.exports={parse:Uwe,decode:Uwe,stringify:j4,encode:j4,safe:vm,unsafe:SC}});var Xwe=S(bo=>{"use strict";var Jr=require("path"),B4=require("os"),DC=require("fs"),Sbt=zwe(),sb=process.platform==="win32",Vwe=e=>{try{return Sbt.parse(DC.readFileSync(e,"utf8")).prefix}catch{}},Dbt=()=>Object.keys(process.env).reduce((e,r)=>/^npm_config_prefix$/i.test(r)?process.env[r]:e,void 0),Cbt=()=>{if(sb&&process.env.APPDATA)return Jr.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 Jr.join(e,"/lib/node_modules/npm/npmrc")}if(process.execPath.endsWith("/bin/node")){let e=Jr.dirname(Jr.dirname(process.execPath));return Jr.join(e,"/etc/npmrc")}},Tbt=()=>{if(sb){let{APPDATA:e}=process.env;return e?Jr.join(e,"npm"):Jr.dirname(process.execPath)}return Jr.dirname(Jr.dirname(process.execPath))},Pbt=()=>{let e=Dbt();if(e)return e;let r=Vwe(Jr.join(B4.homedir(),".npmrc"));if(r)return r;if(process.env.PREFIX)return process.env.PREFIX;let n=Vwe(Cbt());return n||Tbt()},ib=Jr.resolve(Pbt()),Kwe=()=>{if(sb&&process.env.LOCALAPPDATA){let e=Jr.join(process.env.LOCALAPPDATA,"Yarn");if(DC.existsSync(e))return e}return!1},Rbt=()=>{if(process.env.PREFIX)return process.env.PREFIX;let e=Kwe();if(e)return e;let r=Jr.join(B4.homedir(),".config/yarn");if(DC.existsSync(r))return r;let n=Jr.join(B4.homedir(),".yarn-config");return DC.existsSync(n)?n:ib};bo.npm={};bo.npm.prefix=ib;bo.npm.packages=Jr.join(ib,sb?"node_modules":"lib/node_modules");bo.npm.binaries=sb?ib:Jr.join(ib,"bin");var Ywe=Jr.resolve(Rbt());bo.yarn={};bo.yarn.prefix=Ywe;bo.yarn.packages=Jr.join(Ywe,Kwe()?"Data/global/node_modules":"global/node_modules");bo.yarn.binaries=Jr.join(bo.yarn.packages,".bin")});var Jwe=S((G4,W4)=>{"use strict";(function(e){G4&&typeof G4=="object"&&typeof W4<"u"?W4.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,c6.has(f)){let g=parseFloat(/\d[^m]*/.exec(i.slice(l,l+4)));o=g===Jbt?null:g}let p=Qbt.codes.get(Number(o));o&&p&&(i[l+1]===`
|
|||
|
|
`?a+=O1e(p):f===`
|
|||
|
|
`&&(a+=O1e(o)))}return a};I1e.exports=(e,r,n)=>String(e).normalize().replace(/\r\n/g,`
|
|||
|
|
`).split(`
|
|||
|
|
`).map(i=>txt(i,r,n)).join(`
|
|||
|
|
`)});var M1e=S((TVt,N1e)=>{"use strict";var rxt=iC(),nxt=GM(),F1e=q0(),L1e=["\x1B","\x9B"],kC=e=>`${L1e[0]}[${e}m`,$1e=(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=F1e.codes.get(Number.parseInt(a,10));if(c){let u=e.indexOf(c.toString());u===-1?i.push(kC(r?c:o)):e.splice(u,1)}else if(r){i.push(kC(0));break}else i.push(kC(o))}if(r&&(i=i.filter((a,o)=>i.indexOf(a)===o),n!==void 0)){let a=kC(F1e.codes.get(Number.parseInt(n,10)));i=i.reduce((o,c)=>c===a?[c,...o]:[...o,c],[])}return i.join("")};N1e.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(L1e.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++,!nxt({exact:!0}).test(g)&&rxt(g.codePointAt())&&(l++,typeof n!="number"&&o++),l>r&&l<=o)f+=g;else if(l===r&&!c&&u!==void 0)f=$1e(a);else if(l>=o){f+=$1e(a,!0,u);break}}return f}});var l6=S((PVt,$C)=>{"use strict";var q1e=gR(),j1e=a6(),ixt=k1e(),sxt=M1e(),axt=24,FC=e=>{let{columns:r}=e;return r||80},oxt=(e,r)=>{let n=e.rows||axt,i=r.split(`
|
|||
|
|
`),a=i.length-n;return a<=0?r:sxt(r,i.slice(0,a).join(`
|
|||
|
|
`).length+1,r.length)},u6=(e,{showCursor:r=!1}={})=>{let n=0,i=FC(e),a="",o=(...c)=>{r||j1e.hide();let u=c.join(" ")+`
|
|||
|
|
`;u=oxt(e,u);let l=FC(e);u===a&&i===l||(a=u,i=l,u=ixt(u,l,{trim:!1,hard:!0,wordWrap:!1}),e.write(q1e.eraseLines(n)+u),n=u.split(`
|
|||
|
|
`).length)};return o.clear=()=>{e.write(q1e.eraseLines(n)),a="",i=FC(e),n=0},o.done=()=>{a="",i=FC(e),n=0,r||j1e.show()},o};$C.exports=u6(process.stdout);$C.exports.stderr=u6(process.stderr);$C.exports.create=u6});var l_e=S((sKt,u_e)=>{"use strict";var wxt=(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},_xt=(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};u_e.exports={stringReplaceAll:wxt,stringEncaseCRLFWithFirstIndex:_xt}});var m_e=S((aKt,h_e)=>{"use strict";var Ext=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,f_e=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,Sxt=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,Dxt=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,Cxt=new Map([["n",`
|
|||
|
|
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function d_e(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)):Cxt.get(e)||e}function Txt(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(Sxt))n.push(a[2].replace(Dxt,(u,l,f)=>l?d_e(l):f));else throw new Error(`Invalid Chalk template style argument: ${o} (in style '${e}')`)}return n}function Pxt(e){f_e.lastIndex=0;let r=[],n;for(;(n=f_e.exec(e))!==null;){let i=n[1];if(n[2]){let a=Txt(i,n[2]);r.push([i].concat(a))}else r.push([i])}return r}function p_e(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}h_e.exports=(e,r)=>{let n=[],i=[],a=[];if(r.replace(Ext,(o,c,u,l,f,p)=>{if(c)a.push(d_e(c));else if(l){let g=a.join("");a=[],i.push(n.length===0?g:p_e(e,n)(g)),n.push({inverse:u,styles:Pxt(l)})}else if(f){if(n.length===0)throw new Error("Found extraneous } in Chalk template literal");i.push(p_e(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 x6=S((oKt,w_e)=>{"use strict";var gb=q0(),{stdout:g6,stderr:v6}=bR(),{stringReplaceAll:Rxt,stringEncaseCRLFWithFirstIndex:Axt}=l_e(),{isArray:BC}=Array,v_e=["ansi","ansi","ansi256","ansi16m"],xm=Object.create(null),Oxt=(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=g6?g6.level:0;e.level=r.level===void 0?n:r.level},y6=class{constructor(r){return y_e(r)}},y_e=e=>{let r={};return Oxt(r,e),r.template=(...n)=>x_e(r.template,...n),Object.setPrototypeOf(r,UC.prototype),Object.setPrototypeOf(r.template,r),r.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},r.template.Instance=y6,r.template};function UC(e){return y_e(e)}for(let[e,r]of Object.entries(gb))xm[e]={get(){let n=GC(this,b6(r.open,r.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:n}),n}};xm.visible={get(){let e=GC(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};var b_e=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let e of b_e)xm[e]={get(){let{level:r}=this;return function(...n){let i=b6(gb.color[v_e[r]][e](...n),gb.color.close,this._styler);return GC(this,i,this._isEmpty)}}};for(let e of b_e){let r="bg"+e[0].toUpperCase()+e.slice(1);xm[r]={get(){let{level:n}=this;return function(...i){let a=b6(gb.bgColor[v_e[n]][e](...i),gb.bgColor.close,this._styler);return GC(this,a,this._isEmpty)}}}}var Ixt=Object.defineProperties(()=>{},{...xm,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),b6=(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}},GC=(e,r,n)=>{let i=(...a)=>BC(a[0])&&BC(a[0].raw)?g_e(i,x_e(i,...a)):g_e(i,a.length===1?""+a[0]:a.join(" "));return Object.setPrototypeOf(i,Ixt),i._generator=e,i._styler=r,i._isEmpty=n,i},g_e=(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=Rxt(r,n.close,n.open),n=n.parent;let o=r.indexOf(`
|
|||
|
|
`);return o!==-1&&(r=Axt(r,a,i,o)),i+r+a},m6,x_e=(e,...r)=>{let[n]=r;if(!BC(n)||!BC(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 m6===void 0&&(m6=m_e()),m6(e,a.join(""))};Object.defineProperties(UC.prototype,xm);var WC=UC();WC.supportsColor=g6;WC.stderr=UC({level:v6?v6.level:0});WC.stderr.supportsColor=v6;w_e.exports=WC});var __e=S((cKt,kxt)=>{kxt.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(Hxt(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=Gxt[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&&W_e.hide(this.stream),this.discardStdin&&process.stdin.isTTY&&(this.isDiscardingStdin=!0,XC.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&&W_e.show(this.stream),this.discardStdin&&process.stdin.isTTY&&this.isDiscardingStdin&&(XC.stop(),this.isDiscardingStdin=!1),this):this}succeed(r){return this.stopAndPersist({symbol:YC.success,text:r})}fail(r){return this.stopAndPersist({symbol:YC.error,text:r})}warn(r){return this.stopAndPersist({symbol:YC.warning,text:r})}info(r){return this.stopAndPersist({symbol:YC.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}},Xxt=function(e){return new QC(e)};T6.exports=Xxt;T6.exports.promise=(e,r)=>{if(typeof e.then!="function")throw new TypeError("Parameter `action` must be a Promise");let n=new QC(r);return n.start(),(async()=>{try{await e,n.succeed()}catch{n.fail()}})(),n}});var X_e=S((KKt,R6)=>{"use strict";var Y_e=require("fs");R6.exports=e=>new Promise(r=>{Y_e.access(e,n=>{r(!n)})});R6.exports.sync=e=>{try{return Y_e.accessSync(e),!0}catch{return!1}}});var J_e=S((YKt,A6)=>{"use strict";var Q_e=(e,...r)=>new Promise(n=>{n(e(...r))});A6.exports=Q_e;A6.exports.default=Q_e});var eEe=S((XKt,O6)=>{"use strict";var Jxt=J_e(),Z_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=Jxt(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};O6.exports=Z_e;O6.exports.default=Z_e});var nEe=S((QKt,rEe)=>{"use strict";var tEe=eEe(),JC=class extends Error{constructor(r){super(),this.value=r}},Zxt=(e,r)=>Promise.resolve(e).then(r),ewt=e=>Promise.all(e).then(r=>r[1]===!0&&Promise.reject(new JC(r[0])));rEe.exports=(e,r,n)=>{n=Object.assign({concurrency:1/0,preserveOrder:!0},n);let i=tEe(n.concurrency),a=[...e].map(c=>[c,i(Zxt,c,r)]),o=tEe(n.preserveOrder?1:1/0);return Promise.all(a.map(c=>o(ewt,c))).then(()=>{}).catch(c=>c instanceof JC?c.value:Promise.reject(c))}});var aEe=S((JKt,I6)=>{"use strict";var iEe=require("path"),sEe=X_e(),twt=nEe();I6.exports=(e,r)=>(r=Object.assign({cwd:process.cwd()},r),twt(e,n=>sEe(iEe.resolve(r.cwd,n)),r));I6.exports.sync=(e,r)=>{r=Object.assign({cwd:process.cwd()},r);for(let n of e)if(sEe.sync(iEe.resolve(r.cwd,n)))return n}});var cEe=S((ZKt,k6)=>{"use strict";var cl=require("path"),oEe=aEe();k6.exports=(e,r={})=>{let n=cl.resolve(r.cwd||""),{root:i}=cl.parse(n),a=[].concat(e);return new Promise(o=>{(function c(u){oEe(a,{cwd:u}).then(l=>{l?o(cl.join(u,l)):u===i?o(null):c(cl.dirname(u))})})(n)})};k6.exports.sync=(e,r={})=>{let n=cl.resolve(r.cwd||""),{root:i}=cl.parse(n),a=[].concat(e);for(;;){let o=oEe.sync(a,{cwd:n});if(o)return cl.join(n,o);if(n===i)return null;n=cl.dirname(n)}}});var $6=S((eYt,F6)=>{"use strict";var uEe=cEe();F6.exports=async({cwd:e}={})=>uEe("package.json",{cwd:e});F6.exports.sync=({cwd:e}={})=>uEe.sync("package.json",{cwd:e})});var bEe=S((AYt,yEe)=>{"use strict";var awt=1/0,owt="[object Symbol]",cwt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,uwt="\\u0300-\\u036f\\ufe20-\\ufe23",lwt="\\u20d0-\\u20f0",fwt="["+uwt+lwt+"]",pwt=RegExp(fwt,"g"),dwt={\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",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:
|
|||
|
|
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 Vm=S((Orr,IT)=>{"use strict";IT.exports=nSt;IT.exports.format=UDe;IT.exports.parse=GDe;var eSt=/\B(?=(\d{3})+(?!\d))/g,tSt=/(?:\.0*|(\.[^0]+)0+)$/,pl={b:1,kb:1024,mb:1<<20,gb:1<<30,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},rSt=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function nSt(e,r){return typeof e=="string"?GDe(e):typeof e=="number"?UDe(e,r):null}function UDe(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||!pl[u.toLowerCase()])&&(n>=pl.pb?u="PB":n>=pl.tb?u="TB":n>=pl.gb?u="GB":n>=pl.mb?u="MB":n>=pl.kb?u="KB":u="B");var l=e/pl[u.toLowerCase()],f=l.toFixed(o);return c||(f=f.replace(tSt,"$1")),i&&(f=f.split(".").map(function(p,g){return g===0?p.replace(eSt,i):p}).join(".")),f+a+u}function GDe(e){if(typeof e=="number"&&!isNaN(e))return e;if(typeof e!="string")return null;var r=rSt.exec(e),n,i="b";return r?(n=parseFloat(r[1]),i=r[4].toLowerCase()):(n=parseInt(e,10),i="b"),Math.floor(pl[i]*n)}});var qb=S(mq=>{"use strict";var WDe=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,iSt=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,HDe=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,sSt=/\\([\u000b\u0020-\u00ff])/g,aSt=/([\\"])/g,zDe=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;mq.format=oSt;mq.parse=cSt;function oSt(e){if(!e||typeof e!="object")throw new TypeError("argument obj is required");var r=e.parameters,n=e.type;if(!n||!zDe.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],!HDe.test(a))throw new TypeError("invalid parameter name");i+="; "+a+"="+lSt(r[a])}return i}function cSt(e){if(!e)throw new TypeError("argument string is required");var r=typeof e=="object"?uSt(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(!zDe.test(i))throw new TypeError("invalid media type");var a=new fSt(i.toLowerCase());if(n!==-1){var o,c,u;for(WDe.lastIndex=n;c=WDe.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(sSt,"$1"))),a.parameters[o]=u}if(n!==r.length)throw new TypeError("invalid parameter format")}return a}function uSt(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 lSt(e){var r=String(e);if(HDe.test(r))return r;if(r.length>0&&!iSt
|
|||
|
|
`).map(function(r){return r.trim()}).join(" ")};wn.formatters.O=function(e){return this.inspectOpts.colors=this.useColors,zb.inspect(e,this.inspectOpts)};function qSt(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+"+wn.humanize(this.diff)+"\x1B[0m")}else e[0]=new Date().toUTCString()+" "+r+" "+e[0]}function jSt(){return NSt.write(zb.format.apply(zb,arguments)+`
|
|||
|
|
`)}function BSt(e){e==null?delete process.env.DEBUG:process.env.DEBUG=e}function lCe(){return process.env.DEBUG}function USt(e){var r,n=process.binding("tty_wrap");switch(n.guessHandleType(e)){case"TTY":r=new uCe.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 GSt(e){e.inspectOpts={};for(var r=Object.keys(wn.inspectOpts),n=0;n<r.length;n++)e.inspectOpts[r[n]]=wn.inspectOpts[r[n]]}wn.enable(lCe())});var Vs=S((qrr,wq)=>{"use strict";typeof process<"u"&&process.type==="renderer"?wq.exports=cCe():wq.exports=pCe()});var yp=S((jrr,dCe)=>{"use strict";var $T=require("buffer"),Qm=$T.Buffer,Ks={},Ys;for(Ys in $T)$T.hasOwnProperty(Ys)&&(Ys==="SlowBuffer"||Ys==="Buffer"||(Ks[Ys]=$T[Ys]));var Jm=Ks.Buffer={};for(Ys in Qm)Qm.hasOwnProperty(Ys)&&(Ys==="allocUnsafe"||Ys==="allocUnsafeSlow"||(Jm[Ys]=Qm[Ys]));Ks.Buffer.prototype=Qm.prototype;(!Jm.from||Jm.from===Uint8Array.from)&&(Jm.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 Qm(e,r,n)});Jm.alloc||(Jm.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=Qm(e);return!r||r.length===0?i.fill(0):typeof n=="string"?i.fill(r,n):i.fill(r),i});if(!Ks.kStringMaxLength)try{Ks.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}Ks.constants||(Ks.constants={MAX_LENGTH:Ks.kMaxLength},Ks.kStringMaxLength&&(Ks.constants.MAX_STRING_LENGTH=Ks.kStringMaxLength));dCe.exports=Ks});var mCe=S(Sq=>{"use strict";var hCe="\uFEFF";Sq.PrependBOM=_q;function _q(e,r){this.encoder=e,this.addBOM=!0}_q.prototype.write=function(e){return this.addBOM&&(e=hCe+e,this.addBOM=!1),this.encoder.write(e)};_q.prototype.end=function(){return this.encoder.end()};Sq.StripBOM=Eq;function Eq(e,r){this.decoder=e,this.pass=!1,this.options=r||{}}Eq.prototype.write=function(e){var r=this.decoder.write(e);return this.pass||!r||(r[0]===hCe&&(r=r.slice(1),typeof this.options.stripBOM=="function"&&this.options.stripBOM()),this.pass=!0),r};Eq.prototype.end=function(){return this.decoder.end()}});var yCe=S((Urr,vCe)=>{"use strict";var Vb=yp().Buffer;vCe.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:Dq};function Dq(e,r){this.enc=e.encodingName,this.bomAware=e.bomAware,this.enc==="base64"?this.encoder=Tq:this.enc==="cesu8"&&(this.enc="utf8",this.encoder=Pq,Vb.from("eda0bdedb2a9","hex").toString()!=="\u{1F4A9}"&&(this.decoder=Rq,this.defaultCharUnicode=r.defaultCharUnicode))}Dq.prototype.encoder=Cq;Dq.prototype.decoder=gCe;var LT=require("string_decoder").StringDecoder;LT.prototype.end||(LT.prototype.end=function(){});function gCe(e,r){LT.call(this,r.enc)}gCe.prototype=LT.prototype;function Cq(e,r){this.enc=r.enc}Cq.prototype.write=function(e){return Vb.from(e,this.enc)};Cq.prototype.end=function(){};function Tq(e,r){this.prevStr=""}Tq.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),Vb.from(e,"base64")};Tq.prototype.end=function(){return Vb.from(this.prevStr,"base64")};function Pq(e,r){}Pq.prototype.write=function(e){for(var r=Vb.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 OCe=S(ACe=>{"use strict";var eg=yp().Buffer;ACe._dbcs=Dc;var Fi=-1,RCe=-2,Xs=-10,Co=-1e3,Zm=new Array(256),Yb=-1;for(GT=0;GT<256;GT++)Zm[GT]=Fi;var GT;function Dc(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>
|
|||
|
|
`}fPe.exports=mTt;function mTt(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&&cPe(r)){cj("cannot 404 after headers sent");return}if(c?(f=yTt(c),f===void 0?f=xTt(r):u=gTt(c),l=vTt(c,f,a)):(f=404,l="Cannot "+e.method+" "+aTt(bTt(e))),cj("default %s",f),c&&o&&pTt(o,c,e,r),cPe(r)){cj("cannot %d after headers sent",f),e.socket.destroy();return}wTt(e,r,f,u,l)}}function gTt(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 vTt(e,r,n){var i;return n!=="production"&&(i=e.stack,!i&&typeof e.toString=="function"&&(i=e.toString())),i||lPe[r]}function yTt(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 bTt(e){try{return cTt.original(e).pathname}catch{return"resource"}}function xTt(e){var r=e.statusCode;return(typeof r!="number"||r<400||r>599)&&(r=500),r}function cPe(e){return typeof e.headersSent!="boolean"?!!e._header:e.headersSent}function wTt(e,r,n,i,a){function o(){var c=hTt(a);if(r.statusCode=n,r.statusMessage=lPe[n],_Tt(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(dTt(e)){o();return}uTt(e),uPe(e,o),e.resume()}function _Tt(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 nx=S((Onr,mPe)=>{"use strict";mPe.exports=ETt;function dPe(e,r,n){for(var i=0;i<e.length;i++){var a=e[i];n>0&&Array.isArray(a)?dPe(a,r,n-1):r.push(a)}return r}function hPe(e,r){for(var n=0;n<e.length;n++){var i=e[n];Array.isArray(i)?hPe(i,r):r.push(i)}return r}function ETt(e,r){return r==null?hPe(e,[]):dPe(e,[],r)}});var bPe=S((Inr,yPe)=>{"use strict";yPe.exports=vPe;var gPe=/\((?!\?)/g;function vPe(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=gPe.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 vPe(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,T,R,k,F,L){E=E||"",D=D||"",R=R||"([^\\/"+D+"]+?)",F=F||"",r.push({name:T,optional:!!F,offset:L+c});var B=""+(F?"":E)+"(?:"+D+(F?E:"")+R+(k?"((?:[\\/"+D+"].+?)?)":"")+")"+F;return c+=B.length-x.length,B}).replace(/\*/g,function(x,E){for(var D=r.length;D-- >u&&r[D].offset>E;)r[D].offset+=3;return"(.*)"});p=gPe.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 uj=S((knr,wPe)=>{"use strict";var STt=bPe(),DTt=Vs()("express:router:layer"),CTt=Object.prototype.hasOwnProperty;wPe.exports=og;function og(e,r,n){if(!(this instanceof og))return new og(e,r,n);DTt("new %o",e);var i=r||{};this.handle=n,this.name=n.name||"<anonymous>",this.params=void 0,this.path=void 0,this.regexp=STt(e,this.keys=[],i),this.regexp.fast_star=e==="*",this.regexp.fast_slash=e==="/"&&i.end===!1}og.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)}};og.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)}};og.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:xPe(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 ZPt(e){try{return decodeURIComponent(e)}catch{return-1}}function mRe(e){return typeof e.getHeaderNames!="function"?Object.keys(e._headers||{}):e.getHeaderNames()}function gRe(e,r){var n=typeof e.listenerCount!="function"?e.listeners(r).length:e.listenerCount(r);return n>0}function eRt(e){return typeof e.headersSent!="boolean"?!!e._header:e.headersSent}function _j(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 aP(e){var r=e&&Date.parse(e);return typeof r=="number"?r:NaN}function tRt(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 rRt(e,r){for(var n=Object.keys(r),i=0;i<n.length;i++){var a=n[i];e.setHeader(a,r[a])}}});var yRe=S((Ynr,vRe)=>{"use strict";vRe.exports=nRt;function nRt(e){if(!e)throw new TypeError("argument req is required");var r=sRt(e.headers["x-forwarded-for"]||""),n=iRt(e),i=[n].concat(r);return i}function iRt(e){return e.socket?e.socket.remoteAddress:e.connection.remoteAddress}function sRt(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 xRe=S((bRe,ox)=>{"use strict";(function(){var e,r,n,i,a,o,c,u,l;r={},u=this,typeof ox<"u"&&ox!==null&&ox.exports?ox.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,T;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(T=D[v],f.kind()===T[0].kind()&&f.match.apply(f,T))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,T;for(T={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 T){if(D=T[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,T,R,k;for(R=p.slice(1,6),k=[],D=0,T=R.length;D<T;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.`)}})};Gr.lazyrouter=function(){this._router||(this._router=new TRt({caseSensitive:this.enabled("case sensitive routing"),strict:this.enabled("strict routing")}),this._router.use(RRt(this.get("query parser fn"))),this._router.use(PRt.init(this)))};Gr.handle=function(r,n,i){var a=this._router,o=i||CRt(r,n,{env:this.get("env"),onerror:MRt.bind(this)});if(!a){fP("no routes defined on app"),o();return}a.handle(r,n,o)};Gr.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=LRt(Rj.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);fP(".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};Gr.route=function(r){return this.lazyrouter(),this._router.route(r)};Gr.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};Gr.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};Gr.set=function(r,n){if(arguments.length===1)return this.settings[r];switch(fP('set "%s" to %o',r,n),this.settings[r]=n,r){case"etag":this.set("etag fn",IRt(n));break;case"query parser":this.set("query parser fn",kRt(n));break;case"trust proxy":this.set("trust proxy fn",FRt(n)),Object.defineProperty(this.settings,Pj,{configurable:!0,value:!1});break}return this};Gr.path=function(){return this.parent?this.parent.path()+this.mountpath:""};Gr.enabled=function(r){return!!this.set(r)};Gr.disabled=function(r){return!this.set(r)};Gr.enable=function(r){return this.set(r,!0)};Gr.disable=function(r){return this.set(r,!1)};Tj.forEach(function(e){Gr[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,Rj.call(arguments,1)),this}});Gr.all=function(r){this.lazyrouter();for(var n=this._router.route(r),i=Rj.call(arguments,1),a=0;a<Tj.length;a++)n[Tj[a]].apply(n,i);return this};Gr.del=$Rt.function(Gr.delete,"app.del: Use app.delete instead");Gr.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={}),Cj(l,this.locals),u._locals&&Cj(l,u._locals),Cj(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)}qRt(f,l,o)};Gr.listen=function(){var r=ORt.createServer(this);return r.listen.apply(r,arguments)};function MRt(e){this.get("env")!=="test"&&console.error(e.stack||e.toString())}function qRt(e,r,n){try{e.render(r,n)}catch(i){n(i)}}});var $Re=S((Jnr,Aj)=>{"use strict";Aj.exports=FRe;Aj.exports.preferredCharsets=FRe;var jRt=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function BRt(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=jRt.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 GRt(e,r,n){for(var i={o:-1,q:0,s:0},a=0;a<r.length;a++){var o=WRt(e,r[a],n);o&&(i.s-o.s||i.q-o.q||i.o-o.o)<0&&(i=o)}return i}function WRt(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 FRe(e,r){var n=BRt(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 X2t(){return function(){this.error(404)}}function Q2t(){return function(r){if(this.hasTrailingSlash()){this.error(404);return}var n=Nj.original(this.req);n.path=null,n.pathname=K2t(n.pathname+"/");var i=W2t(z2t.format(n)),a=Y2t("Redirecting",'Redirecting to <a href="'+g2e(i)+'">'+g2e(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 S2e=S((Li,E2e)=>{"use strict";var gP=JTe(),J2t=require("events").EventEmitter,b2e=ePe(),x2e=ORe(),Z2t=lj(),eAt=pj(),w2e=n2e(),_2e=m2e();Li=E2e.exports=tAt;function tAt(){var e=function(r,n,i){e.handle(r,n,i)};return b2e(e,J2t.prototype,!1),b2e(e,x2e,!1),e.request=Object.create(w2e,{app:{configurable:!0,enumerable:!0,writable:!0,value:e}}),e.response=Object.create(_2e,{app:{configurable:!0,enumerable:!0,writable:!0,value:e}}),e.init(),e}Li.application=x2e;Li.request=w2e;Li.response=_2e;Li.Route=Z2t;Li.Router=eAt;Li.json=gP.json;Li.query=dj();Li.raw=gP.raw;Li.static=y2e();Li.text=gP.text;Li.urlencoded=gP.urlencoded;var rAt=["bodyParser","compress","cookieSession","session","logger","cookieParser","favicon","responseTime","errorHandler","timeout","methodOverride","vhost","csrf","directory","limit","multipart","staticCache"];rAt.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 C2e=S((uir,D2e)=>{"use strict";D2e.exports=S2e()});var R2e=S((lir,P2e)=>{"use strict";var nAt=require("os"),T2e=nAt.homedir();P2e.exports=e=>{if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);return T2e?e.replace(/^~(?=$|\/|\\)/,T2e):e}});var O2e=S((fir,A2e)=>{"use strict";var pg=1e3,dg=pg*60,hg=dg*60,Dp=hg*24,iAt=Dp*7,sAt=Dp*365.25;A2e.exports=function(e,r){r=r||{};var n=typeof e;if(n==="string"&&e.length>0)return aAt(e);if(n==="number"&&isFinite(e))return r.long?cAt(e):oAt(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function aAt(e){if(e=String(e),!(e.length>100)){var r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(r){var n=parseFloat(r[1]),i=(r[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return n*sAt;case"weeks":case"week":case"w":return n*iAt;case"days":case"day":case"d":return n*Dp;case"hours":case"hour":case"hrs":case"hr":case"h":return n*hg;case"minutes":case"minute":case"mins":case"min":case"m":return n*dg;case"seconds":case"second":case"secs":case"sec":case"s":return n*pg;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function oAt(e){var r=Math.abs(e);return r>=Dp?Math.round(e/Dp)+"d":r>=hg?Math.round(e/hg)+"h":r>=dg?Math.round(e/dg)+"m":r>=pg?Math.round(e/pg)+"s":e+"ms"}function cAt(e){var r=Math.abs(e);return r>=Dp?vP(e,r,Dp,"day"):r>=hg?vP(e,r,hg,"hour"):r>=dg?vP(e,r,dg,"minute"):r>=pg?vP(e,r,pg,"second"):e+" ms"}function vP(e,r,n,i){var a=r>=n*1.5;return Math.round(e/n)+" "+i+(a?"s":"")}});var qj=S((pir,I2e)=>{"use strict";function uAt(e){n.debug=n,n.default=n,n.coerce=l,n.disable=o,n.enable=a,n.enabled=c,n.humanize=O2e(),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(...T){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,T[0]=n.coerce(T[0]),typeof T[0]!="string"&&T.unshift("%O");let L=0;T[0]=T[0].replace(/%([a-zA-Z%])/g,(V,j)=>{if(V==="%%")return"%";L++;let W=n.formatters[j];if(typeof W=="function"){let q=T[L];V=W.call(R,q),T.splice
|
|||
|
|
`).join(`
|
|||
|
|
`+o),e.push(a+"m+"+xP.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=bAt()+r+" "+e[0]}function bAt(){return $n.inspectOpts.hideDate?"":new Date().toISOString()+" "}function xAt(...e){return process.stderr.write(bP.format(...e)+`
|
|||
|
|
`)}function wAt(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function _At(){return process.env.DEBUG}function EAt(e){e.inspectOpts={};let r=Object.keys($n.inspectOpts);for(let n=0;n<r.length;n++)e.inspectOpts[r[n]]=$n.inspectOpts[r[n]]}xP.exports=qj()($n);var{formatters:F2e}=xP.exports;F2e.o=function(e){return this.inspectOpts.colors=this.useColors,bP.inspect(e,this.inspectOpts).split(`
|
|||
|
|
`).map(r=>r.trim()).join(" ")};F2e.O=function(e){return this.inspectOpts.colors=this.useColors,bP.inspect(e,this.inspectOpts)}});var Bj=S((hir,jj)=>{"use strict";typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?jj.exports=k2e():jj.exports=$2e()});var K2e=S((wir,Xj)=>{"use strict";var LAt=require("net"),CP=class extends Error{constructor(r){super(`${r} is locked`)}},mg={old:new Set,young:new Set},NAt=1e3*15,DP,V2e=e=>new Promise((r,n)=>{let i=LAt.createServer();i.unref(),i.on("error",n),i.listen(e,()=>{let{port:a}=i.address();i.close(()=>{r(a)})})}),MAt=function*(e){e&&(yield*e),yield 0};Xj.exports=async e=>{let r;e&&(r=typeof e.port=="number"?[e.port]:e.port),DP===void 0&&(DP=setInterval(()=>{mg.old=mg.young,mg.young=new Set},NAt),DP.unref&&DP.unref());for(let n of MAt(r))try{let i=await V2e({...e,port:n});for(;mg.old.has(i)||mg.young.has(i);){if(n!==0)throw new CP(n);i=await V2e({...e,port:n})}return mg.young.add(i),i}catch(i){if(!["EADDRINUSE","EACCES"].includes(i.code)&&!(i instanceof CP))throw i}throw new Error("No available ports found")};Xj.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 Hx={};Qn(Hx,{$:()=>f9,bgBlack:()=>GOe,bgBlue:()=>zOe,bgCyan:()=>KOe,bgGreen:()=>WOe,bgMagenta:()=>VOe,bgRed:()=>iR,bgWhite:()=>YOe,bgYellow:()=>HOe,black:()=>BOe,blue:()=>Mi,bold:()=>N,cyan:()=>vs,dim:()=>Q,gray:()=>Cl,green:()=>te,grey:()=>Io,hidden:()=>qOe,inverse:()=>MOe,italic:()=>gs,magenta:()=>UOe,red:()=>oe,reset:()=>Fg,strikethrough:()=>jOe,underline:()=>tt,white:()=>nR,yellow:()=>ze});var rR,o9,c9,u9,l9=!0;typeof process<"u"&&({FORCE_COLOR:rR,NODE_DISABLE_COLORS:o9,NO_COLOR:c9,TERM:u9}=process.env||{},l9=process.stdout&&process.stdout.isTTY);var f9={enabled:!o9&&c9==null&&u9!=="dumb"&&(rR!=null&&rR!=="0"||l9)};function Vt(e,r){let n=new RegExp(`\\x1b\\[${r}m`,"g"),i=`\x1B[${e}m`,a=`\x1B[${r}m`;return function(o){return!f9.enabled||o==null?o:i+(~(""+o).indexOf(a)?o.replace(n,a+i):o)+a}}var Fg=Vt(0,0),N=Vt(1,22),Q=Vt(2,22),gs=Vt(3,23),tt=Vt(4,24),MOe=Vt(7,27),qOe=Vt(8,28),jOe=Vt(9,29),BOe=Vt(30,39),oe=Vt(31,39),te=Vt(32,39),ze=Vt(33,39),Mi=Vt(34,39),UOe=Vt(35,39),vs=Vt(36,39),nR=Vt(37,39),Cl=Vt(90,39),Io=Vt(90,39),GOe=Vt(40,49),iR=Vt(41,49),WOe=Vt(42,49),HOe=Vt(43,49),zOe=Vt(44,49),VOe=Vt(45,49),KOe=Vt(46,49),YOe=Vt(47,49);var XOe=100,p9=["green","yellow","blue","magenta","cyan","red"],sR=[],d9=Date.now(),QOe=0,aR=typeof process<"u"?process.env:{};globalThis.DEBUG??=aR.DEBUG??"";globalThis.DEBUG_COLORS??=aR.DEBUG_COLORS?aR.DEBUG_COLORS==="true":!0;var $g={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 JOe(e){let r={color:p9[QOe++%p9.length],enabled:$g.enabled(e),namespace:e,log:$g.log,extend:()=>{}},n=(...i)=>{let{enabled:a,namespace:o,color:c,log:u}=r;if(i.length!==0&&sR.push([o,...i]),sR.length>XOe&&sR.shift(),$g.enabled(o)||a){let l=i.map(p=>typeof p=="string"?p:ZOe(p)),f=`+${Date.now()-d9}ms`;d9=Date.now(),globalThis.DEBUG_COLORS?u(Hx[c](N(o)),...l,Hx[c](f)):u(o,...l,f)}};return new Proxy(n,{get:(i,a)=>r[a],set:(i,a,o)=>r[a]=o})}var oR=new Proxy(JOe,{get:(e,r)=>$g[r],set:(e,r,n)=>$g[r]=n});function ZOe(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 gIe(){let e="/etc/os-release";try{let r=await hR.default.readFile(e,{encoding:"utf-8"});return mIe(r)}catch{return{targetDistro:void 0,familyDistro:void 0,originalDistro:void 0}}}function vIe(e){let r=/^OpenSSL\s(\d+\.\d+)\.\d+/.exec(e);if(r){let n=`${r[1]}.x`;return E9(n)}}function y9(e){let r=/libssl\.so\.(\d)(\.\d)?/.exec(e);if(r){let n=`${r[1]}${r[2]??".0"}.x`;return E9(n)}}function E9(e){let r=(()=>{if(D9(e))return e;let n=e.split(".");return n[1]="0",n.join(".")})();if(hIe.includes(r))return r}function yIe(e){return He(e).with({familyDistro:"musl"},()=>(Jn('Trying platform-specific paths for "alpine"'),["/lib","/usr/lib"])).with({familyDistro:"debian"},({archFromUname:r})=>(Jn('Trying platform-specific paths for "debian" (and "ubuntu")'),[`/usr/lib/${r}-linux-gnu`,`/lib/${r}-linux-gnu`])).with({familyDistro:"rhel"},()=>(Jn('Trying platform-specific paths for "rhel"'),["/lib64","/usr/lib64"])).otherwise(({familyDistro:r,arch:n,archFromUname:i})=>(Jn(`Don't know any platform-specific paths for "${r}" on ${n} (${i})`),[]))}async function bIe(e){let r='grep -v "libssl.so.0"',n=await b9(e);if(n){Jn(`Found libssl.so file using platform-specific paths: ${n}`);let o=y9(n);if(Jn(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"libssl-specific-path"}}Jn('Falling back to "ldconfig" and other generic paths');let i=await Jx(`ldconfig -p | sed "s/.*=>s*//" | sed "s|.*/||" | grep libssl | sort | ${r}`);if(i||(i=await b9(["/lib64","/usr/lib64","/lib","/usr/lib"])),i){Jn(`Found libssl.so file using "ldconfig" or other generic paths: ${i}`);let o=y9(i);if(Jn(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"ldconfig"}}let a=await Jx("openssl version -v");if(a){Jn(`Found openssl binary with version: ${a}`);let o=vIe(a);if(Jn(`The parsed openssl version is: ${o}`),o)return{libssl:o,strategy:"openssl-binary"}}return Jn("Couldn't find any version of libssl or OpenSSL in the system"),{}}async function b9(e){for(let r of e){let n=await xIe(r);if(n)return n}}async function xIe(e){try{return(await hR.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 Wr(){let{binaryTarget:e}=await S9();return e}function wIe(e){return e.binaryTarget!==void 0}async function qg(){let{memoized:e,...r}=await S9();return r}var Xx={};async function S9(){if(wIe(Xx))return Promise.resolve({...Xx,memoized:!0});let e=await _9(),r=_Ie(e);return Xx={...e,binaryTarget:r},{...Xx,memoized:!1}}function _Ie(e){let{platform:r,arch:n,archFromUname:i,libssl:a,targetDistro:o,familyDistro:c,originalDistro:u}=e;r==="linux"&&!["x64","arm64"].includes(n)&&Yx(`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.");Yx(`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&&Jn(`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||D9(a)?p:`${p}-openssl-${a}`}return r==="linux"&&o&&a?`${o}-openssl-${a}`:(r!=="linux"&&Yx(`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 EIe(e){try{return await e()}catch{return}}function Jx(e){return EIe(async()=>{let r=await dIe(e);return Jn(`Command "${e}" successfully returned "${r.stdout}"`),r.stdout})}async function SIe(){return typeof Qx.default.machine=="function"?Qx.default.machine():(await Jx("uname -m"))?.trim()}function D9(e){return e.startsWith("1.")}var F9=U(_R());function ER(e){return(0,F9.default)(e,e,{fallback:tt})}var s5e=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 mv(e){return e}function Es(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,s5e([a],i,!1))}}};var KK=function(e){return e._tag==="Some"},YK={_tag:"None"},XK=function(e){return{_tag:"Some",value:e}},oI=function(e){return e._tag==="Left"},QK=function(e){return e._tag==="Right"},g_=function(e){return{_tag:"Left",left:e}},v_=function(e){return{_tag:"Right",right:e}};var cI=function(e,r){return Ut(2,function(n,i){return r.flatMap(n,function(a){return e.fromIO(i(a))})})};function JK(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 ZK(e,r){return function(n){return function(i){return e.map(i,function(a){return r.map(a,n)})}}}function Mo(e){return function(r,n){return e.map(r,function(){return n})}}function eu(e){var r=Mo(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 uI(e){return function(r){return Es(r,e.fromEither)}}function x_(e,r){var n=uI(e),i=yi(r);return function(a,o){return i(a,n(o))}}var Ul=g_,qo=v_,eY=Ut(2,function(e,r){return bi(e)?e:r(e.right)}),yI=function(e,r){return vi(e,Gl(r))},tY=function(e,r){return vi(e,f5e(r))};var w_="Either";var Gl=function(e){return function(r){return bi(r)?r:qo(e(r.right))}},__={URI:w_,map:yI},QFt=Ut(2,Mo(__)),JFt=eu(__);var l5e=function(e){return function(r){return bi(r)?r:bi(e)?e:qo(r.right(e.right))}},f5e=l5e,rY={URI:w_
|
|||
|
|
`).slice(1)].join(`
|
|||
|
|
`);return{message:r,stack:n}}function E_(e){if(!(typeof e>"u"))return typeof e=="string"?[["schema.prisma",e]]:e}function ru(e){return e.map(([r])=>r).join(`,
|
|||
|
|
`)}var R_={};Qn(R_,{prismaSchemaWasm:()=>on.default,prismaSchemaWasmVersion:()=>W5e});var on=U(wI());var P_=class{constructor(){this.message=""}get(){return`${this.message}`}set_message(r){this.message=`RuntimeError: ${r}`}};var{dependencies:G5e}=_I();var W5e=G5e["@prisma/prisma-schema-wasm"];globalThis.PRISMA_WASM_PANIC_REGISTRY=new P_;function H5e(e){return e.toString().toLowerCase().replace(/\s+/g,"-")}function Hl(e,r={json:!1}){if(r.json){let i=e.reduce((a,[o,c])=>(a[H5e(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 z5e=_I(),lY=z5e.version;function nu(e){return`${e}
|
|||
|
|
|
|||
|
|
${Hl([["Prisma CLI Version",lY]])}`}var N_=U(Nt());var gd=YK,A_=XK;var V5e=function(e){return e._tag==="Left"?gd:A_(e.right)},fY=function(e,r){return vi(e,SI(r))},K5e=function(e,r){return vi(e,Y5e(r))};var EI="Option";var SI=function(e){return function(r){return vd(r)?gd:A_(e(r.value))}},pY={URI:EI,map:fY},b$t=Ut(2,Mo(pY)),x$t=eu(pY);var Y5e=function(e){return function(r){return vd(r)||vd(e)?gd:A_(r.value(e.value))}};var X5e=Ut(2,function(e,r){return vd(e)?gd:r(e.value)}),dY={URI:EI,map:fY,ap:K5e,chain:X5e};var w$t=Ut(2,function(e,r){return vd(e)?r():e});var Q5e=V5e,J5e={URI:EI,fromEither:Q5e},hY=KK,vd=function(e){return e._tag==="None"},Z5e=function(e,r){return function(n){return vd(n)?e():r(n.value)}};var eqe=Z5e,mY=eqe;var _$t=Ut(2,yi(dY)),E$t=Ut(2,x_(J5e,dY));var gY=function(e){return e==null?gd:A_(e)};function vY(e){return Es(qo,e.of)}function yY(e){return function(r){return e.map(r,qo)}}function bY(e){return ZK(e,__)}function xY(e){return JK(e,rY)}function wY(e){return function(r,n){return e.chain(r,function(i){return bi(i)?e.of(i):n(i.right)})}}function _Y(e){return function(r,n,i){return e.map(r,nY(n,i))}}function EY(e){return function(r,n){return e.map(r,iY(n))}}function SY(e){return function(r){return function(n){return e.chain(n,function(i){return bi(i)?r(i.left):e.of(i)})}}}function DY(e){var r=SY(e);return function(n,i){return vi(n,r(function(a){return e.map(i(a),function(o){return bi(o)?o:Ul(a)})}))}}function O_(e,r){var n=yi(r);return function(i,a){return n(i,Es(a,e.fromIO))}}function CY(e,r){var n=yi(r);return function(i,a){return n(i,Es(a,e.fromTask))}}var DI=function(e){return function(){return Promise.resolve().then(e)}};var I_=function(e,r){return vi(e,TY(r))},CI=function(e,r){return vi(e,aqe(r))};var TY=function(e){return function(r){return function(){return Promise.resolve().then(r).then(e)}}},aqe=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)})}}},k_=function(e){return function(){return Promise.resolve(e)}},F_=Ut(2,function(e,r){return function(){return Promise.resolve().then(e).then(function(n){return r(n)()})}});var yd="Task";var zl={URI:yd,map:I_},j$t=Ut(2,Mo(zl)),B$t=eu(zl);var PY={URI:yd,of:k_},RY={URI:yd,map:I_,ap:CI};var AY={URI:yd,map:I_,ap:CI,chain:F_},TI={URI:yd,map:I_,of:k_,ap:CI,chain:F_};var OY={URI:yd,fromIO:DI},oqe={flatMap:F_},cqe={fromIO:OY.fromIO},U$t=cI(cqe,oqe),G$t=Ut(2,yi(AY)),W$t=Ut(2,O_(OY,AY));var lqe=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())})},fqe=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 IY=vY(PY),kY=yY(zl);var pqe=Es(DI,kY);var FY=pqe,dqe=kY,bv=k_;var bd=function(e,r){return function(){return lqe(void 0,void 0,void 0,function(){var n;return fqe(this,function(i){switch(i.
|
|||
|
|
`,{reason:i,error:a})};function RI(e){return`${oe(N("Prisma schema validation"))} - ${e}`}function su({errorOutput:e,reason:r}){return(0,N_.pipe)(Ss(()=>JSON.parse(e),()=>({_tag:"unparsed",message:e,reason:r})),Gl(i=>{let a=oe(N(Hi(i.message))),o=He(i).with({error_code:"P1012"},c=>({reason:RI(r),errorCode:c.error_code})).with({error_code:Sr.string},c=>({reason:r,errorCode:c.error_code})).otherwise(()=>({reason:r}));return{_tag:"parsed",message:a,...o}}),sY(N_.identity))}var M_=me("prisma:getConfig"),yqe="P1012",wv=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(nu(i)),this.name="GetConfigError"}};function Bo(e){return e.directUrl!==void 0?e.directUrl:e.url}function AI(e){return e.directUrl}function _v(e){let r=e?.value,n=e?.fromEnvVar,i=n?process.env[n]:void 0;return r??i}async function Ve(e){let r=iu(M_,"getConfigWasm");M_("Using getConfig Wasm");let n=(0,UY.pipe)(Ss(()=>{process.env.FORCE_PANIC_QUERY_ENGINE_GET_CONFIG&&(M_("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})),Gl(a=>({result:a})),gv(({result:a})=>Ss(()=>JSON.parse(a),o=>({type:"parse-json",reason:"Unable to parse JSON",error:o}))),gv(a=>a.errors.length>0?Ul({type:"validation-error",reason:"(get-config wasm)",error:a.errors}):qo(a.config)));if(sa(n)){M_("config data retrieved without errors in getConfig Wasm");let{right:a}=n;for(let o of a.generators)await GY(o);return Promise.resolve(a)}throw He(n.left).with({type:"wasm-error"},a=>{if(r(a),tu(a.error)){let{message:c,stack:u}=Ds(a.error);return new sn(c,u,"@prisma/prisma-schema-wasm get_config","FMT_CLI",e.prismaPath,E_(e.datamodel))}let o=a.error.message;return new wv(su({errorOutput:o,reason:a.reason}))}).with({type:"validation-error"},a=>new wv({_tag:"parsed",errorCode:yqe,reason:RI(a.reason),message:bqe(a.error)})).otherwise(a=>(r(a),new wv({_tag:"unparsed",message:a.error.message,reason:a.reason})))}async function GY(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 GY(e)):r.value=n}r.value==="native"&&(r.value=await Wr(),r.native=!0)}e.binaryTargets.length===0&&(e.binaryTargets=[{fromEnvVar:null,value:await Wr(),native:!0}])}function bqe(e){let r=e.map(i=>Hi(i.message)).join(`
|
|||
|
|
|
|||
|
|
`),n=`Validation Error Count: ${e.length}`;return`${r}
|
|||
|
|
${n}`}var BF=U(aX()),UF=U(require("fs")),Zd=U(require("path"));var ZE=U(pJ()),AF=U(require("fs"));var mn=U(require("path"));var Jee=U(require("node:path"),1);var hJ=U(require("node:process"),1),mJ=U(require("node:fs/promises"),1),gJ=require("node:url");var Ql=U(require("node:path"),1),dJ=e=>e instanceof URL?(0,gJ.fileURLToPath)(e):e;async function vJ(e,{cwd:r=hJ.default.cwd(),type:n="file",stopAt:i}={}){let a=Ql.default.resolve(dJ(r)??""),{root:o}=Ql.default.parse(a);for(i=Ql.default.resolve(a,dJ(i??o));a&&a!==i&&a!==o;){let c=Ql.default.isAbsolute(e)?e:Ql.default.join(a,e);try{let u=await mJ.default.stat(c);if(n==="file"&&u.isFile()||n==="directory"&&u.isDirectory())return c}catch{}a=Ql.default.dirname(a)}}var Kee=U(require("node:fs/promises"),1),Yee=U(require("node:path"),1);var vZ=U(hZ(),1);var mZ=(e,r,n)=>n<0?-1:e.lastIndexOf(r,n);function B9e(e,r){let n=mZ(e,`
|
|||
|
|
`,r-1),i=r-n-1,a=0;for(let o=n;o>=0;o=mZ(e,`
|
|||
|
|
`,o-1))a++;return{line:a,column:i}}function lE(e,r,{oneBased:n=!1}={}){if(r<0||r>=e.length&&e.length>0)throw new RangeError("Index out of bounds");let i=B9e(e,r);return n?{line:i.line+1,column:i.column+1}:i}var U9e=e=>`\\u{${e.codePointAt(0).toString(16)}}`,Rd,bk=class bk extends Error{constructor(n){super();Qe(this,"name","JSONError");Qe(this,"fileName");Qe(this,"codeFrame");Qe(this,"rawCodeFrame");Ee(this,Rd);fe(this,Rd,n),Error.captureStackTrace?.(this,bk)}get message(){let{fileName:n,codeFrame:i}=this;return`${$(this,Rd)}${n?` in ${n}`:""}${i?`
|
|||
|
|
|
|||
|
|
${i}
|
|||
|
|
`:""}`}set message(n){fe(this,Rd,n)}};Rd=new WeakMap;var vk=bk,gZ=(e,r,n=!0)=>(0,vZ.codeFrameColumns)(e,{start:r},{highlightCode:n}),G9e=(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}=lE(e,e.length-1,{oneBased:!0});return{line:c,column:u+1}}return lE(e,i,{oneBased:!0})},W9e=e=>e.replace(/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,(r,n,i)=>`"${i}"(${U9e(i)})`);function yk(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=G9e(e,i),i=W9e(i)):i+=" while parsing empty string";let o=new vk(i);throw o.fileName=n,a&&(o.codeFrame=gZ(e,a),o.rawCodeFrame=gZ(e,a,!1)),o}var Xee=U(Hee(),1);var zee=require("node:url");function Vee(e){return e instanceof URL?(0,zee.fileURLToPath)(e):e}var D7e=e=>Yee.default.resolve(Vee(e)??".","package.json"),C7e=(e,r)=>{let n=typeof e=="string"?yk(e):e;return r&&(0,Xee.default)(n),n};async function Qee({cwd:e,normalize:r=!0}={}){let n=await Kee.default.readFile(D7e(e),"utf8");return C7e(n,r)}async function Zee(e){let r=await vJ("package.json",e);if(r)return{packageJson:await Qee({...e,cwd:Jee.default.dirname(r)}),path:r}}var OF=require("util");function jv({schemas:e}){let r=on.default.lint(JSON.stringify(e));return JSON.parse(r)}function Gk(e,{schemas:r}){try{return e()}catch(n){let{message:i,stack:a}=Ds(n);throw new sn(i,a,"@prisma/prisma-schema-wasm lint","FMT_CLI",ru(r),r)}}function T7e(e){return e.filter(R7e)}function Bv(e){let r=T7e(e),n=[];if(r.length>0){n.push(ze(`
|
|||
|
|
Prisma schema warning${r.length>1?"s":""}:`));for(let i of r)n.push(P7e(i))}return n.join(`
|
|||
|
|
`)}function P7e(e){return ze(`- ${e.text}`)}function R7e(e){return e.is_warning}var ete=me("prisma:format");async function Wk({schemas:e},r){process.env.FORCE_PANIC_PRISMA_SCHEMA&&tte(()=>{on.default.debug_panic()},{schemas:e});let i={textDocument:{uri:"file:/dev/null"},options:{...{tabSize:2,insertSpaces:!0},...r}},{formattedMultipleSchemas:a,lintDiagnostics:o}=tte(()=>{let u=A7e(JSON.stringify(e),i),l=JSON.parse(u),f=jv({schemas:l});return{formattedMultipleSchemas:l,lintDiagnostics:f}},{schemas:e}),c=Bv(o);return c&&Tr.should.warn()&&console.warn(c),Promise.resolve(a)}function tte(e,{schemas:r}){try{return e()}catch(n){let{message:i,stack:a}=Ds(n);throw ete(`Error formatting schema: ${i}`),ete(a),new sn(i,a,"@prisma/prisma-schema-wasm format","FMT_CLI",ru(r),r)}}function A7e(e,r){return on.default.format(e,JSON.stringify(r))}var Hk=U(Nt());var rte=U(require("fs"));var Nd=me("prisma:getDMMF"),Uv=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(nu(i)),this.name="GetDmmfError"}};async function wE(e){let r=iu(Nd,"getDmmfWasm");Nd("Using getDmmf Wasm");let i=await(0,Hk.pipe)(bd(()=>e.datamodel?(Nd("Using given datamodel"),Promise.resolve(e.datamodel)):(Nd(`Reading datamodel from the given datamodel path ${e.datamodelPath}`),rte.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})),jY(o=>(0,Hk.pipe)(Ss(()=>{process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF&&(Nd("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})),Gl(c=>({result:c})),gv(({result:c})=>Ss(()=>JSON.parse(c),u=>({type:"parse-json",reason:"Unable to parse JSON",error:u}))),bv)))();if(sa(i)){Nd("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 Uv({_tag:"unparsed",message:`${o.error.message}
|
|||
|
|
Datamodel path: "${o.datamodelPath}"`,reason:o.reason}))).with({type:"wasm-error"},o=>{if(r(o),tu(o.error)){let{message:u,stack:l}=Ds(o.error);return new sn(u,l,"@prisma/prisma-schema-wasm get_dmmf","FMT_CLI",e.prismaPath,E_(e.datamodel))}let c=o.error.message;return new Uv(su({errorOutput:c,reason:o.reason}))}).with({type:"parse-json"},o=>(r(o),new Uv({_tag:"unparsed",message:o.error.message,reason:o.reason}))).exhaustive()}var Fne=require("@prisma/engines");var vne=U(Xp()),Di=U(require("fs")),DF=U(pu());var yne=U(ate()),eo=U(require("path")),bne=U(h1()),xne=require("util");var Kk=U(require("fs"));function ote(e){if(process.platform==="win32")return;let r=Kk.default.statSync(e),n=r.mode|64|8|1;if(r.mode===n)return;let i=n.toString(8).slice(-3);Kk.default.chmodSync(e,i)}var eF=U(require("fs")),Dte=U(h_()),tF=U(require("path")),Cte=U(d_()),Tte=require("util");var wte=U(require("node:process"),1),Md=U(require("node:path"),1),Wv=U(require("node:fs"),1),_te=U(ute(),1);var vte=U(require("node:path"),1);var Gv=U(require("node:path"),1),hte=require("node:url");var lte=U(require("node:process"),1),fte=U(require("node:path"),1),_E=U(require("node:fs"),1),pte=require("node:url");var dte={directory:"isDirectory",file:"isFile"};function F7e(e){if(!Object.hasOwnProperty.call(dte,e))throw new Error(`Invalid type specified: ${e}`)}var $7e=(e,r)=>r[dte[e]](),L7e=e=>e instanceof URL?(0,pte.fileURLToPath)(e):e;function Yk(e,{cwd:r=lte.default.cwd(),type:n="file",allowSymlinks:i=!0}={}){F7e(n),r=L7e(r);let a=i?_E.default.statSync:_E.default.lstatSync;for(let o of e)try{let c=a(fte.default.resolve(r,o),{throwIfNoEntry:!1});if(!c)continue;if($7e(n,c))return o}catch{}}var N7e=e=>e instanceof URL?(0,hte.fileURLToPath)(e):e,M7e=Symbol("findUpStop");function q7e(e,r={}){let n=Gv.default.resolve(N7e(r.cwd)||""),{root:i}=Gv.default.parse(n),a=r.stopAt||i,o=r.limit||Number.POSITIVE_INFINITY,c=[e].flat(),u=f=>{if(typeof e!="function")return Yk(c,f);let p=e(f.cwd);return typeof p=="string"?Yk([p],f):p},l=[];for(;;){let f=u({...r,cwd:n});if(f===M7e||(f&&l.push(Gv.default.resolve(n,f)),n===a||l.length>=o))break;n=Gv.default.dirname(n)}return l}function mte(e,r={}){return q7e(e,{...r,limit:1})[0]}function yte({cwd:e}={}){let r=mte("package.json",{cwd:e});return r&&vte.default.dirname(r)}var{env:Xk,cwd:j7e}=wte.default,bte=e=>{try{return Wv.default.accessSync(e,Wv.default.constants.W_OK),!0}catch{return!1}};function xte(e,r){return r.create&&Wv.default.mkdirSync(e,{recursive:!0}),e}function B7e(e){let r=Md.default.join(e,"node_modules");if(!(!bte(r)&&(Wv.default.existsSync(r)||!bte(Md.default.join(e)))))return r}function Qk(e={}){if(Xk.CACHE_DIR&&!["true","false","1","0"].includes(Xk.CACHE_DIR))return xte(Md.default.join(Xk.CACHE_DIR,e.name),e);let{cwd:r=j7e(),files:n}=e;if(n){if(!Array.isArray(n))throw new TypeError(`Expected \`files\` option to be an array, got \`${typeof n}\`.`);r=(0,_te.default)(n.map(a=>Md.default.resolve(r,a)))}if(r=yte({cwd:r}),!(!r||!B7e(r)))return xte(Md.default.join(r,"node_modules",".cache",e.name),e)}var qd=U(require("fs")),Jk=U(pu()),EE=U(require("os")),SE=U(require("path"));var Ete=me("prisma:fetch-engine:cache-dir");async function Hv(){if(EE.default.platform()==="win32"){let e=Qk({name:"prisma",create:!0});if(e)return e;if(process.env.APPDATA)return SE.default.join(process.env.APPDATA,"Prisma")}if(process.env.AWS_LAMBDA_FUNCTION_VERSION)try{return await(0,Jk.ensureDir)("/tmp/prisma-download"),"/tmp/prisma-download"}catch{return null}return SE.default.join(EE.default.homedir(),".cache/prisma")}async function Zk(e,r,n){let i=await Hv();if(!i)return null;let a=SE.default.join(i,e,r,n);try{qd.default.existsSync(a)||await(0,Jk.ensureDir)(a)}catch(o){return Ete("The following error is being caught and just there for debugging:"),Ete(o),null}return a}function Ste({channel:e,version:r,binaryTarget:n,binaryName:i,extension:a=".gz"}){let o=process.env.PRISMA_BINARIES_MIRROR||process.env.PRISMA_ENGINES_MIRROR||"https://binaries.prisma.sh",c=n==="windows"&&"libquery-engine"!==i?`.exe${a}`:a;return i==="libquery-engine"&&(i=ja(n,"url"
|
|||
|
|
\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=ty.Buffer.compare(f.slice(-5),n)===0,!a&&o&&(a=ty.Buffer.compare(o.slice(-3),n.slice(0,3))===0&&ty.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 wF=U(_re()),Qre=U(require("path")),Jre=U(d_()),Zre=U(VK()),ene=require("util"),tne=U(require("zlib"));var Wre=U(Nre()),Hre=U(Gre()),zre=U(require("url")),bF=me("prisma:fetch-engine:getProxyAgent");function Vre(e){return e.replace(/^\.*/,".").toLowerCase()}function _We(e){e=e.trim().toLowerCase();let r=e.split(":",2),n=Vre(r[0]),i=r[1],a=e.includes(":");return{hostname:n,port:i,hasPort:a}}function EWe(e,r){let n=e.port||(e.protocol==="https:"?"443":"80"),i=Vre(e.hostname);return r.split(",").map(_We).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 SWe(e){let r=process.env.NO_PROXY||process.env.no_proxy||"";if(r&&bF(`noProxy is set to "${r}"`),r==="*"||r!==""&&EWe(e,r))return null;if(e.protocol==="http:"){let n=process.env.HTTP_PROXY||process.env.http_proxy||null;return n&&bF(`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&&bF(`uri.protocol is HTTPS and the URL for the proxy is "${n}"`),n}return null}function hf(e){try{let r=zre.default.parse(e),n=SWe(r);if(n){if(r.protocol==="http:")try{return new Wre.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 Hre.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 KE=me("prisma:fetch-engine:downloadZip"),Kre=(0,ene.promisify)(Jre.default);async function Yre(e){try{let r=`${e}.sha256`,n=await Ja(r,{agent:hf(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 KE(`fetchChecksum() failed and was ignored as the PRISMA_ENGINES_CHECKSUM_IGNORE_MISSING environment variable is truthy.
|
|||
|
|
Error: ${r}`),null;throw r}}async function rne(e,r,n){let i=Zre.default.directory(),a=Qre.default.join(i,"partial"),o=2,[c,u]=await(0,wF.default)(async()=>await Promise.all([Yre(e),Yre(e.slice(0,e.length-3))]),{retries:o,onFailedAttempt:f=>KE("An error occurred while downloading the checksums files",f)}),l=await(0,wF.default)(async()=>{let f=await Ja(e,{compress:!1,agent:hf(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=Xre.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 T=tne.default.createGunzip();T.on("error",E);let R=f.body.pipe(T),k=xF.default.fromStream(f.body,{algorithm:"sha256"}),F=xF.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,B=await k;if(c!==null&&c!==B)return E(new Error(`sha256 checksum of ${e} (zipped) should be ${c} but is ${B}`));if(u!==null&&u!==L)return E(new Error(`sha256 checksum of ${e} (unzipped) should be ${u} but is ${L}`))})},{retries:o,onFailedAttempt:f=>KE("An error occurred while downloading the engine file",f)});await nf(a,r);try{await Kre(a),await Kre(i)}catch(f){KE(f)}return l}var nne=U(require("fs"));var ine=U(require("path"));var DWe=me("prisma:fetch-engine:env"),_F={"query-engine":"PRISMA_QUERY_ENGINE_BINARY","libquery-engine":"PRISMA_QUERY_ENGINE_LIBRARY","schema-engine":"PRISMA_SCHEMA_ENGINE_BINARY"},CWe={"schema-engine":"PRISMA_MIGRATION_ENGINE_BINARY"};function mf(e){let r=TWe(e);if(process.env[r]){let n=ine.default.resolve(process.cwd(),process.env[r]);if(!nne.default.existsSync(n))throw new Error(`Env var ${N(r)} is provided but provided path ${tt(process.env[r])} can't be resolved.`);return DWe(`Using env var ${N(r)} for binary ${N(e)}, which points to ${tt(process.env[r])}`),{path:n,fromEnvVar:r}}return null}function TWe(e){let r=_F[e],n=CWe[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 sne(e){for(let r of e)if(!mf(r))return!1;return!0}var ane=U(require("crypto")),one=U(require("fs"));function EF(e){let r=ane.default.createHash("sha256"),n=one.default.createReadStream(e);return new Promise(i=>{n.on("readable",()=>{let a=n.read();a?r.update(a):i(r.digest("hex"))})})}var dne=U(pne());function hne(e){return new dne.default(`> ${e} [:bar] :percent`,{stream:process.stdout,width:20,complete:"=",incomplete:" ",total:100,head:"",clear:!0})}var{enginesOverride:gne}=mne(),Yo=me("prisma:fetch-engine:download"),SF=(0,xne.promisify)(Di.default.exists),wne="master",_ne=/^((\w:[\\\/])|\/)snapshot[\/\\]/;async function YE(options){(gne?.branch||gne?.folder)&&(options.version="_local_",options.skipCacheIntegrityCheck=!0);let{binaryTarget,...os}=await qg();if(os.targetDistro&&["nixos"].includes(os.targetDistro)&&!sne(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&&qp(),!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 Pne(e,r){return bd(()=>Su(e,r),n=>n)}async function XE(file){let dir=eval("__dirname");if(dir.match(Xd)){let e=Eu.default.join(Tne.default,"prisma-binaries");await(0,Cne.ensureDir)(e);let r=Eu.default.join(e,Eu.default.basename(file)),n=await _u.default.promises.readFile(file);return await _u.default.promises.writeFile(r,n),Sne(r),r}return file}var One=require("@prisma/engines");var Ine=U(Xp());function Rne(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: ${ER("https://pris.ly/d/system-requirements")}`,o=`Unable to require(\`${Q(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 Ane(e,r){try{return require(e)}catch(n){let i=Rne({e:n,platformInfo:r,id:e});throw new Error(i)}}async function jWe(e,r){r||(r=(0,One.getCliQueryEngineBinaryType)()),e=await Su(r,e);let n=await qg();if(r==="libquery-engine"){qp();let i=Ane(e,n);return`libquery-engine ${i.version().commit}`}else{let{stdout:i}=await(0,Ine.default)(e,["--version"]);return i}}function kne(e,r){return bd(()=>jWe(e,r),n=>n)}async function TF(){let r=[{name:"query-engine",type:(0,Fne.getCliQueryEngineBinaryType)()},{name:"schema-engine",type:"schema-engine"}],n=r.map(({name:u,type:l})=>UWe(l).then(f=>[u,f])),i=await Promise.all(n).then(Object.fromEntries),a=r.map(({name:u})=>{let[l,f]=BWe(i[u]);return[{[u]:l},f]}),o=a.map(u=>u[0]),c=a.flatMap(u=>u[1]);return[o,c]}function BWe(e){let r=[],n=He(e).with({fromEnvVar:Sr.when(hY)},c=>`, resolved by ${c.fromEnvVar.value}`).otherwise(()=>""),i=He(e).with({path:Sr.when(sa)},c=>c.path.right).with({path:Sr.when(bi)},c=>(r.push(c.path.left),"E_CANNOT_RESOLVE_PATH")).exhaustive();return[`${He(e).with({version:Sr.when(sa)},c=>c.version.right).with({version:Sr.when(bi)},c=>(r.push(c.version.left),"E_CANNOT_RESOLVE_VERSION")).exhaustive()} (at ${$ne.default.relative(process.cwd(),i)}${n})`,r]}async function UWe(e){let r=gY(mf(e)),n=(0,QE.pipe)(r,SI(c=>c.fromEnvVar)),i=await(0,QE.pipe)(r,mY(()=>Pne(e),c=>IY(c.path)))(),a=await(0,QE.pipe)(i,bv,qY(c=>kne(c,e)))();return{path:i,version:a,fromEnvVar:n}}var Lne=U(Nt());var JE=me("prisma:mergeSchemas"),PF=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}
|
|||
|
|
${Hi(o)}`}).with({_tag:"unparsed"},({message:a,reason:o})=>{let c=oe(N("Details:"));return`${o}
|
|||
|
|
${c} ${a}`}).exhaustive()}
|
|||
|
|
[Context: mergeSchemas]`;super(nu(i)),this.name="MergeSchemasError"}};function ny(e){let r=iu(JE,"mergeSchemasWasm");JE("Using mergeSchemas Wasm");let n=(0,Lne.pipe)(Ss(()=>{let a=JSON.stringify({schema:e.schemas});return on.default.merge_schemas(a)},a=>({type:"wasm-error",reason:"(mergeSchemas wasm)",error:a})));if(sa(n))return n.right;throw He(n.left).with({type:"wasm-error"},a=>{if(r(a),console.error(""),tu(a.error)){let{message:c,stack:u}=Ds(a.error);return JE(`Error merging schemas: ${c}`),JE(u),new sn(c,u,"@prisma/prisma-schema-wasm merge_schemas","FMT_CLI",ru(e.schemas),e.schemas)}let o=a.error.message;return new PF(su({errorOutput:o,reason:a.reason}))}).exhaustive()}var Nne=U(Nt());var iy=me("prisma:validate"),RF=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}
|
|||
|
|
${Hi(o)}`}).with({_tag:"unparsed"},({message:a,reason:o})=>{let c=oe(N("Details:"));return`${o}
|
|||
|
|
${c} ${a}`}).exhaustive()}
|
|||
|
|
[Context: validate]`;super(nu(i)),this.name="ValidateError"}};function gf(e){let r=iu(iy,"validateWasm");iy("Using validate Wasm");let n=(0,Nne.pipe)(Ss(()=>{process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF&&(iy("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(sa(n))return;throw He(n.left).with({type:"wasm-error"},a=>{if(r(a),console.error(""),tu(a.error)){let{message:c,stack:u}=Ds(a.error);return iy(`Error validating schema: ${c}`),iy(u),new sn(c,u,"@prisma/prisma-schema-wasm validate","FMT_CLI",ru(e.schemas),e.schemas)}let o=a.error.message;return new RF(su({errorOutput:o,reason:a.reason}))}).exhaustive()}var GWe=(0,OF.promisify)(AF.default.readFile),qne=(0,OF.promisify)(AF.default.stat),Qd=oR("prisma:getSchema");async function pt(e,{cwd:r=process.cwd(),argumentName:n="--schema"}={}){let i=await Wne(e,{cwd:r,argumentName:n});if(i.ok)return i.schema;throw new Error(WWe(i.error,r))}async function sy(e,{cwd:r=process.cwd(),argumentName:n="--schema"}={}){let i=await Wne(e,{cwd:r,argumentName:n});return i.ok?i.schema:null}async function jne(e){Qd("Reading schema from single file",e);let r=await Une(e,"file");if(r)return{ok:!1,error:r};let n=await GWe(e,{encoding:"utf-8"}),i=[e,n];return{ok:!0,schema:{schemaPath:e,schemaRootDir:mn.default.dirname(e),schemas:[i]}}}async function Bne(e){Qd("Reading schema from multiple files",e);let r=await Une(e,"directory");if(r)return{ok:!1,error:r};let n=await(0,ZE.loadSchemaFiles)(e);Qd("Loading config");let i=await Ve({datamodel:n,ignoreEnvVarErrors:!0});return Qd("Ok"),(0,ZE.usesPrismaSchemaFolder)(i)?{ok:!0,schema:{schemaPath:e,schemaRootDir:e,schemas:n}}:{ok:!1,error:{kind:"FolderPreviewNotEnabled",path:e}}}async function Une(e,r){try{let n=await qne(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 Gne(e){let r;try{r=await qne(e)}catch(n){if(n.code==="ENOENT")return{ok:!1,error:{kind:"NotFound",path:e}};throw n}return r.isFile()?jne(e):r.isDirectory()?Bne(e):{ok:!1,error:{kind:"WrongType",path:e,expectedTypes:["file","directory"]}}}async function Wne(e,{cwd:r,argumentName:n}){if(e){let o=mn.default.resolve(r,e),c=await Gne(o);if(!c.ok){let u=mn.default.relative(r,o);throw new Error(`Could not load \`${n}\` from provided path \`${u}\`: ${IF(c.error)}`)}return c}let i=await kF(r);if(i.ok)return i;let a=await HWe(r);return a.ok?a:{ok:!1,error:a.error}}function IF(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 WWe(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(`${mn.default.relative(r,o)}: ${IF(a.error)}`),i.add(o))}return n.push(`
|
|||
|
|
See also https://pris.ly/d/prisma-schema-location`),n.join(`
|
|||
|
|
`)}async function ay(e){let r=await Zee({cwd:e,normalize:!1}),n=r?.packageJson?.prisma;return r?{data:n,packagePath:r.path}:null}async function kF(e){let r=await ay(e);if(Qd("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 \`${mn.default.relative(e,r.packagePath)}\` must be of type string`);let i=mn.default.isAbsolute(n)?n:mn.default.resolve(mn.default.dirname(r.packagePath),n),a=await Gne(i);if(!a.ok)throw new Error(`Could not load schema from \`${mn.default.relative(e,i)}\` provided by "prisma.schema" config of \`${mn.default.relative(e,r.packagePath)}\`: ${IF(a.error)}`);return a}async function HWe(e,r=[]){let n={schemaPath:{path:mn.default.join(e,"schema.prisma"),kind:"file"}},i={schemaPath:{path:mn.default.join(e,"prisma","schema.prisma"),kind:"file"},conflictsWith:{path:mn.default.join(e,"prisma","schema"),kind:"directory"}},a={schemaPath:{path:mn.default.join(e,"prisma","schema"),kind:"directory"},conflictsWith:{path:mn.default.join(e,"prisma","schema.prisma"),kind:"file"}},o=[n,i,a];for(let c of o){Qd(`Checking existence of ${c.schemaPath.path}`);let u=await Mne(c.schemaPath);if(!u.ok){r.push({rule:c,error:u.error});continue}if(c.conflictsWith&&(await Mne(c.conflictsWith)).ok)throw new Error(`Found Prisma Schemas at both \`${mn.default.relative(e,c.schemaPath.path)}\` and \`${mn.default.relative(e,c.conflictsWith.path)}\`. Please remove one.`);return u}return{ok:!1,error:{kind:"NotFoundMultipleLocations",failures:r}}}async function Mne(e){switch(e.kind){case"file":return jne(e.path);case"directory":return Bne(e.path)}}async function Un(e){return(await pt(e)).schemas}var qF=U(NF()),tS=U(require("fs"));var Jd=U(require("path"));function Yne(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 MF=me("prisma:tryLoadEnv");function oy({rootEnvPath:e,schemaEnvPath:r},n={conflictCheck:"none"}){let i=Xne(e);n.conflictCheck!=="none"&&oHe(i,r,n.conflictCheck);let a=null;return Qne(i?.path,r)||(a=Xne(r)),!i&&!a&&MF("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 oHe(e,r,n){let i=e?.dotenvResult.parsed,a=!Qne(e?.path,r);if(i&&r&&a&&tS.default.existsSync(r)){let o=qF.default.parse(tS.default.readFileSync(r)),c=[];for(let u in o)i[u]===o[u]&&c.push(u);if(c.length>0){let u=Jd.default.relative(process.cwd(),e.path),l=Jd.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 Xne(e){if(jF(e)){MF(`Environment variables loaded from ${e}`);let r=qF.default.config({path:e,debug:process.env.DOTENV_CONFIG_DEBUG?!0:void 0});return{dotenvResult:Yne(r),message:Q(`Environment variables loaded from ${Jd.default.relative(process.cwd(),e)}`),path:e}}else MF(`Environment variables not found at ${e}`);return null}function Qne(e,r){return e&&r&&Jd.default.resolve(e)===Jd.default.resolve(r)}function jF(e){return!!(e&&tS.default.existsSync(e))}var Jne=me("prisma:loadEnv");async function vf(e,r={cwd:process.cwd()}){let n=uHe({cwd:r.cwd})??null,i=Zne(e),a=Zne(await cHe()),c=[i,a,"./prisma/.env","./.env"].find(jF);return{rootEnvPath:n,schemaEnvPath:c}}async function cHe(){try{let e=await kF(process.cwd());return e.ok&&e.schema.schemaPath,null}catch{return null}}function uHe(e){let r=BF.default.sync(i=>{let a=Zd.default.join(i,"package.json");if(BF.default.sync.exists(a))try{if(JSON.parse(UF.default.readFileSync(a,"utf8")).name!==".prisma/client")return Jne(`project root found at ${a}`),a}catch{Jne(`skipping package.json at ${a}`)}},e);if(!r)return null;let n=Zd.default.join(Zd.default.dirname(r),".env");return UF.default.existsSync(n)?n:null}function Zne(e){return e?Zd.default.join(Zd.default.dirname(e),".env"):null}async function at({schemaPath:e,printMessage:r=!1}={}){let n=await vf(e),i=oy(n,{conflictCheck:"error"});r&&i&&i.message&&process.stdout.write(i.message+`
|
|||
|
|
`)}var eie=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 lHe(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 eie(e);if(a.includes("schema")){await at({schemaPath:o,printMessage:!1});let c=await tie.default.promises.readFile(o,"utf-8"),u=await Ve({datamodel:c,ignoreEnvVarErrors:!0});if(_v(Bo(u.datasources[0]))?.startsWith("prisma://"))return eie(e)}}}async function Pr(e,r,n){let i=await lHe(e,r,n).catch(()=>{});if(i)throw new Error(i)}var WF=U(require("path"));var fHe="library";function rie(e){let r=pHe();return r||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":fHe)}function pHe(){let e=process.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":void 0}function Qo(e){return e<1e3?`${e}ms`:(e/1e3).toFixed(2)+"s"}function gn(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 ${Q(e.fromEnvVar)} is present in your Environment Variables`);return r}return e.value}function GF(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 ${Q(e.fromEnvVar)} is present in your Environment Variables`);return JSON.parse(r)}return e.value}function cy(e,r){let n=e.getPrettyName(),i=dHe(e),a=hHe(e);return`\u2714 Generated ${N(n)}${i?` (${i})`:""}${a} in ${Qo(r)}`}function dHe(e){let r=e.manifest?.version;if(e.getProvider()==="prisma-client-js"){let n=rie(e.config),i="";return e.options?.noEngine?i=", engine=none":n==="binary"?i=", engine=binary":n==="library"&&(i=""),`v${r??"?.?.?"}${i}`}return r}function hHe(e){let r=e.options?.generator.output;return r?Q(` to .${WF.default.sep}${WF.default.relative(process.cwd(),gn(r))}`):""}var VF=U(require("crypto"));var cie=U(zF()),uie=U(oie());function $e(e=""){return(0,uie.default)(e).trimRight()+`
|
|||
|
|
`}function _e(e,r,n=!0,i=!1){try{return(0,cie.default)(r,{argv:e,stopAtPositional:n,permissive:i})}catch(a){return a}}function xe(e){return e instanceof Error}async function ly(){let e=_e(process.argv.slice(3),{"--schema":String}),r=(await pt(e["--schema"]))?.schemaPath??process.cwd();return VF.default.createHash("sha256").update(r).digest("hex").substring(0,8)}function fy(){let e=process.argv[1];return VF.default.createHash("sha256").update(e).digest("hex").substring(0,8)}function yf(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 lie=U(require("path")),fie=U(require("url"));function rS(e){let r;try{r=new fie.URL(e)}catch{throw new Error("Invalid data source URL, see https://www.prisma.io/docs/reference/database-reference/connection-urls")}let n=to(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=lie.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 to(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 nS=U(require("stream")),pie=U(require("util"));function KF(e,r){return gHe(e,r)}function gHe(e,r){return e?vHe(e,r):new bf(r)}function vHe(e,r){if(!e)throw new Error("expected readStream");if(!e.readable)throw new Error("readStream must be readable");let n=new bf(r);return e.pipe(n),n}function bf(e){nS.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 nS.default.Readable&&(this.encoding=r._readableState.encoding)})}pie.default.inherits(bf,nS.default.Transform);bf.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)};bf.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()};bf.prototype._flush=function(e){this._pushBuffer(this._chunkEncoding,0,e)};bf.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 Aie=require("child_process"),Oie=U(Rie());var r$=me("prisma:GeneratorProcess"),LHe=1,xf=class extends Error{constructor(n,i,a){super(n);this.code=i;this.data=a;this.name="GeneratorError";a?.stack&&(this.stack=a.stack)}},py=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,Aie.fork)(this.pathOrCommand,[],{stdio:["pipe","inherit","pipe","ipc"],env:{...process.env,PRISMA_GENERATOR_INVOCATION:"true"},execArgv:["--max-old-space-size=8096"]}):this.child=(0,Oie.spawn)(this.pathOrCommand,{stdio:["pipe","inherit","pipe"],env:{...process.env,PRISMA_GENERATOR_INVOCATION:"true"},shell:!0}),this.child.on("exit",(i,a)=>{if(r$(`child exited with code ${i} on signal ${a}`),this.exited=!0,i){let o=new xf(`Generator ${JSON.stringify(this.pathOrCommand)} failed:
|
|||
|
|
|
|||
|
|
${this.errorLogs}`);this.pendingError=o,this.rejectAllHandlers(o)}}),this.child.stdin.on("error",()=>{}),this.child.on("error",i=>{r$(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)}),KF(this.child.stderr).on("data",i=>{let a=String(i),o;try{o=JSON.parse(a)}catch{this.errorLogs+=a+`
|
|||
|
|
`,r$(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(NHe(r)){let n=new xf(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 xf("Generator process has not started yet"));return}if(!this.child.stdin.writable){n(new xf("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 LHe++}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 NHe(e){return e.error!==void 0}var iS=class{constructor(r,n,i){this.manifest=null;this.config=n,this.generatorProcess=new py(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 gn(this.config.provider)}};var ya=U(require("node:fs"),1),$r=U(require("node:path"),1),Yr=U(require("node:process"),1),Ase=require("node:buffer"),vy=U(require("node:child_process"),1),Ose=U(require("child_process"),1),wy=U(require("path"),1),ph=U(require("fs"),1),_y=U(require("node:url"),1),dh=U(require("node:os"),1),Ise=require("node:timers/promises"),kse=U(require("stream"),1),Fse=require("node:util"),$se=U(require("os"),1),Lse=U(require("tty"),1),Nse=U(require("readline"),1),Mse=U(require("events"),1),z$=U(require("fs/promises"),1);function Iie(e){return r=>r.length>1?`${e} run ${r[0]} -- ${r.slice(1).join(" ")}`:`${e} run ${r[0]}`}var kie={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}"},Fie={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}"},MHe={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}"},yy={npm:{agent:"npm {0}",run:Iie("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:kie,"yarn@berry":{...kie,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:Fie,"pnpm@6":{...Fie,run:Iie("pnpm")},bun:MHe},qHe=Object.keys(yy),x$={"bun.lockb":"bun","pnpm-lock.yaml":"pnpm","yarn.lock":"yarn","package-lock.json":"npm","npm-shrinkwrap.json":"npm"},qse={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"},ec=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ey(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:
|
|||
|
|
`: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 Yse(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 _ze(e={}){let{cwd:r=Yr.default.cwd(),path:n=Yr.default.env[Yse()],execPath:i=Yr.default.execPath}=e,a,o=r instanceof URL?_y.default.fileURLToPath(r):r,c=$r.default.resolve(o),u=[];for(;a!==c;)u.push($r.default.join(c,"node_modules/.bin")),a=c,c=$r.default.resolve(c,"..");return u.push($r.default.resolve(o,i,"..")),[...u,n].join($r.default.delimiter)}function Eze({env:e=Yr.default.env,...r}={}){e={...e};let n=Yse({env:e});return r.path=e[n],e[n]=_ze(r),e}var Sze=(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);!Dze(a,o)&&i||Object.defineProperty(e,n,o)},Dze=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)},Cze=(e,r)=>{let n=Object.getPrototypeOf(r);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},Tze=(e,r)=>`/* Wrapped ${e}*/
|
|||
|
|
${r}`,Pze=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Rze=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Aze=(e,r,n)=>{let i=n===""?"":`with ${n.trim()}() `,a=Tze.bind(null,i,r.toString());Object.defineProperty(a,"name",Rze),Object.defineProperty(e,"toString",{...Pze,value:a})};function Oze(e,r,{ignoreNonConfigurable:n=!1}={}){let{name:i}=e;for(let a of Reflect.ownKeys(r))Sze(e,r,a,n);return Cze(e,r),Aze(e,r,i),e}var gS=new WeakMap,Xse=(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(gS.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 Oze(o,e),gS.set(o,i),o};Xse.callCount=e=>{if(!gS.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return gS.get(e)};var Ize=()=>{let e=Jse-Qse+1;return Array.from({length:e},kze)},kze=(e,r)=>({name:`SIGRT${r+1}`,number:Qse+r,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Qse=34,Jse=64,Fze=[{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}`:T,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},dS=["stdin","stdout","stderr"],Gze=e=>dS.some(r=>e[r]!==void 0),Wze=e=>{if(!e)return;let{stdio:r}=e;if(r===void 0)return dS.map(i=>e[i]);if(Gze(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${dS.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,dS.length);return Array.from({length:n},(i,a)=>r[a])},sh=[];sh.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&sh.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&sh.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var hS=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",a$=Symbol.for("signal-exit emitter"),o$=globalThis,Hze=Object.defineProperty.bind(Object),_$=class{constructor(){Qe(this,"emitted",{afterExit:!1,exit:!1});Qe(this,"listeners",{afterExit:[],exit:[]});Qe(this,"count",0);Qe(this,"id",Math.random());if(o$[a$])return o$[a$];Hze(o$,a$,{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}},vS=class{},zze=e=>({onExit(r,n){return e.onExit(r,n)},load(){return e.load()},unload(){return e.unload()}}),E$=class extends vS{onExit(){return()=>{}}load(){}unload(){}},xS,es,yr,ah,oh,wf,Cu,fh,eae,tae,S$=class extends vS{constructor(n){super();Ee(this,fh);Ee(this,xS,D$.platform==="win32"?"SIGINT":"SIGHUP");Ee(this,es,new _$);Ee(this,yr);Ee(this,ah);Ee(this,oh);Ee(this,wf,{});Ee(this,Cu,!1);fe(this,yr,n),fe(this,wf,{});for(let i of sh)$(this,wf)[i]=()=>{let a=$(this,yr).listeners(i),{count:o}=$(this,es),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,es).emit("exit",null,i),l=i==="SIGHUP"?$(this,xS):i;u||n.kill(n.pid,l)}};fe(this,oh,n.reallyExit),fe(this,ah,n.emit)}onExit(n,i){if(!hS($(this,yr)))return()=>{};$(this,Cu)===!1&&this.load();let a=i?.alwaysLast?"afterExit":"exit";return $(this,es).on(a,n),()=>{$(this,es).removeListener(a,n),$(this,es).listeners.exit.length===0&&$(this,es).listeners.afterExit.length===0&&this.unload()}}load(){if(!$(this,Cu)){fe(this,Cu,!0),$(this,es).count+=1;for(let n of sh)try{let i=$(this,wf)[n];i&&$(this,yr).on(n,i)}catch{}$(this,yr).emit=(n,...i)=>de(this,fh,tae).call(this,n,...i),$(this,yr).reallyExit=n=>de(this,fh,eae).call(this,n)}}unload(){$(this,Cu)&&(fe(this,Cu,!1),sh.forEach(n=>{let i=$(this,wf)[n];if(!i)throw new Error("Listener not defined for signal: "+n);try{$(this,yr).removeListener(n,i)}catch{}}),$(this,yr).emit=$(this,ah),$(this,yr).reallyExit=$(this,oh),$(this,es).count-=1)}};xS=new WeakMap,es=new WeakMap,yr=new WeakMap,ah=new WeakMap,oh=new WeakMap,wf=new WeakMap,Cu=new WeakMap,fh=new WeakSet,eae=function(n){return hS($(this,yr))?($(this,yr).exitCode=n||0,$(this,es).emit("exit",$(this,yr).exitCode,null),$(this,oh).call($(this,yr),$(this,yr).exitCode)):0},tae=function(n,...i){let a=$(this,ah);if(n==="exit"&&hS($(this,yr))){typeof i[0]=="number"&&($(this,yr).exitCode=i[0]);let o=a.call($(this,yr),n,...i);return $(this,es).emit("exit",$(this,yr).exitCode,null),o}else return a.call($(this,yr),n,...i)};var D$=globalThi
|
|||
|
|
`)},XVe=1e3*1e3*100,QVe=({env:e,extendEnv:r,preferLocal:n,localDir:i,execPath:a})=>{let o=r?{...Yr.default.env,...e}:e;return n?Eze({env:o,cwd:i,execPath:a}):o},JVe=(e,r,n={})=>{let i=xze._parse(e,r,n);return e=i.command,r=i.args,n=i.options,n={maxBuffer:XVe,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:n.cwd||Yr.default.cwd(),execPath:Yr.default.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:VVe,...n},n.env=QVe(n),n.stdio=Wze(n),Yr.default.platform==="win32"&&$r.default.basename(e,".exe")==="cmd"&&r.unshift("/q"),{file:e,args:r,options:n,parsed:i}},f$=(e,r,n)=>typeof r!="string"&&!Ase.Buffer.isBuffer(r)?n===void 0?void 0:"":e.stripFinalNewline?wze(r):r;function ZVe(e,r,n){let i=JVe(e,r,n),a=GVe(e,r),o=WVe(e,r);YVe(o,i.options),nVe(i.options);let c;try{c=vy.default.spawn(i.file,i.args,i.options)}catch(x){let E=new vy.default.ChildProcess,D=Promise.reject(Bie({error:x,stdout:"",stderr:"",all:"",command:a,escapedCommand:o,parsed:i,timedOut:!1,isCanceled:!1,killed:!1}));return Yie(E,D),E}let u=jVe(c),l=rVe(c,i.options,u),f=iVe(c,i.options,l),p={isCanceled:!1};c.kill=Yze.bind(null,c.kill.bind(c)),c.cancel=eVe.bind(null,c,p);let v=Xse(async()=>{let[{error:x,exitCode:E,signal:D,timedOut:T},R,k,F]=await NVe(c,i.options,f),L=f$(i.options,R),B=f$(i.options,k),V=f$(i.options,F);if(x||E!==0||D!==null){let j=Bie({error:x,exitCode:E,signal:D,stdout:L,stderr:B,all:V,command:a,escapedCommand:o,parsed:i,timedOut:T,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:B,all:V,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return FVe(c,i.options),c.all=$Ve(c,i.options),aVe(c),Yie(c,v),c}function eKe(e,r){let[n,...i]=zVe(e);return ZVe(n,i,r)}var T$=class{constructor(r){Qe(this,"value");Qe(this,"next");this.value=r}},no,_f,Ef,P$=class{constructor(){Ee(this,no);Ee(this,_f);Ee(this,Ef);this.clear()}enqueue(r){let n=new T$(r);$(this,no)?($(this,_f).next=n,fe(this,_f,n)):(fe(this,no,n),fe(this,_f,n)),Fc(this,Ef)._++}dequeue(){let r=$(this,no);if(r)return fe(this,no,$(this,no).next),Fc(this,Ef)._--,r.value}clear(){fe(this,no,void 0),fe(this,_f,void 0),fe(this,Ef,0)}get size(){return $(this,Ef)}*[Symbol.iterator](){let r=$(this,no);for(;r;)yield r.value,r=r.next}};no=new WeakMap,_f=new WeakMap,Ef=new WeakMap;function Xie(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 P$,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 yS=class extends Error{constructor(r){super(),this.value=r}},tKe=async(e,r)=>r(await e),rKe=async e=>{let r=await Promise.all(e);if(r[1]===!0)throw new yS(r[0]);return!1};async function nKe(e,r,{concurrency:n=Number.POSITIVE_INFINITY,preserveOrder:i=!0}={}){let a=Xie(n),o=[...e].map(u=>[u,a(tKe,u,r)]),c=Xie(i?1:Number.POSITIVE_INFINITY);try{await Promise.all(o.map(u=>c(rKe,u)))}catch(u){if(u instanceof yS)return u.value;throw u}}var fae={directory:"isDirectory",file:"isFile"};function iKe(e){if(!Object.hasOwnProperty.call(fae,e))throw new Error(`Invalid type specified: ${e}`)}var sKe=(e,r)=>r[fae[e]](),aKe=e=>e instanceof URL?(0,_y.fileURLToPath)(e):e;async function Qie(e,{cwd:r=Yr.default.cwd(),type:n="file",allowSymlinks:i=!0,concurrency:a,preserveOrder:o}={}){iKe(n),r=aKe(r);let c=i?ya.promises.stat:ya.promises.lstat;return nKe(e,async u=>{try{let l=await c($r.default.resolve(r,u));return sKe(n,l)}catch{return!1}},{concurrency:a,preserveOrder:o})}var oKe=e=>e instanceof URL?(0,_y.fileURLToPath)(e):e,cKe=Symbol("findUpStop");async function uKe(e,r={}){let n=$r.default.resolve(oKe(r.cwd)||""),{root:i}=$r.default.par
|
|||
|
|
`)).join(`
|
|||
|
|
`)},FKe=(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}},io={action:gKe,clear:EKe,style:AKe,strip:t3,figures:bae,lines:IKe,wrap:kKe,entriesToDisplay:FKe},nse=Nse.default,{action:$Ke}=io,LKe=Mse.default,{beep:NKe,cursor:MKe}=xa,qKe=ba,jKe=class extends LKe{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=nse.createInterface({input:this.in,escapeCodeTimeout:50});nse.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=$Ke(c,i);u===!1?this._&&this._(o,c):typeof this[u]=="function"?this[u](c):this.bell()};this.close=()=>{this.out.write(MKe.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(NKe)}render(){this.onRender(qKe),this.firstRender&&(this.firstRender=!1)}},Ru=jKe,cS=ba,BKe=Ru,{erase:UKe,cursor:dy}=xa,{style:d$,clear:h$,lines:GKe,figures:WKe}=io,$$=class extends BKe{constructor(r={}){super(r),this.transform=d$.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=h$("",this.out.columns),this.render()}set value(r){!r&&this.initial?(this.placeholder=!0,this.rendered=cS.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(dy.down(GKe(this.outputError,this.out.columns)-1)+h$(this.outputError,this.out.columns)),this.out.write(h$(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[d$.symbol(this.done,this.aborted),cS.bold(this.msg),d$.delimiter(this.done),this.red?cS.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|||
|
|
`).reduce((r,n,i)=>r+`
|
|||
|
|
${i?" ":WKe.pointerSmall} ${cS.red().italic(n)}`,"")),this.out.write(UKe.line+dy.to(0)+this.outputText+dy.save+this.outputError+dy.restore+dy.move(this.cursorOffset,0)))}},HKe=$$,Jo=ba,zKe=Ru,{style:ise,clear:sse,figures:uS,wrap:VKe,entriesToDisplay:KKe}=io,{cursor:YKe}=xa,L$=class extends zKe{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=sse("",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(YKe.hide):this.out.write(sse(this.outputText,this.out.columns)),super.render();let{startIndex:r,endIndex:n}=KKe(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[ise.symbol(this.done,this.aborted),Jo.bold(this.msg),ise.delimiter(!1),this.done?this.selection.title:this.selection.disabled?Jo.yellow(this.warn):Jo.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=uS.arrowUp:i===n-1&&n<this.choices.length?o=uS.arrowDown:o=" ",u.disabled?(a=this.cursor===i?Jo.gray().underline(u.title):Jo.strikethrough().gray(u.title),o=(this.cursor===i?Jo.bold().gray(uS.pointer)+" ":" ")+o):(a=this.cursor===i?Jo.cyan().underline(u.title):u.title,o=(this.cursor===i?Jo.cyan(uS.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=`
|
|||
|
|
`+VKe(u.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${a}${Jo.gray(c)}
|
|||
|
|
`}}this.out.write(this.outputText)}},XKe=L$,lS=ba,QKe=Ru,{style:ase,clear:JKe}=io,{cursor:ose,erase:ZKe}=xa,N$=class extends QKe{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(ose.hide):this.out.write(JKe(this.outputText,this.out.columns)),super.render(),this.outputText=[ase.symbol(this.done,this.aborted),lS.bold(this.msg),ase.delimiter(this.done),this.value?this.inactive:lS.cyan().underline(this.inactive),lS.gray("/"),this.value?lS.cyan().underline(this.active):this.active].join(" "),this.out.write(ZKe.line+ose.to(0)+this.outputText))}},eYe=N$,tYe=class M${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 M$)}setTo(r){}prev(){let r=[].concat(this.parts).reverse(),n=r.indexOf(this);return r.find((i,a)=>a>n&&i instanceof M$)}toString(){return String(this.date)}},tc=tYe,rYe=tc,nYe=class extends rYe{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}},iYe=nYe,sYe=tc,aYe=e=>(e=e%10,e===1?"st":e===2?"nd":e===3?"rd":"th"),oYe=class extends sYe{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+aYe(r):this.token==="d"?n+1:this.token==="ddd"?this.locales.weekdaysShort[n]:this.token==="dddd"?this.locales.weekdays[n]:r}},cYe=oYe,uYe=tc,lYe=class extends uYe{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}},fYe=lYe,pYe=tc,dYe=class extends pYe{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)}},hYe=dYe,mYe=tc,gYe=class extends mYe{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}},vYe=gYe,yYe=tc,bYe=class extends yYe{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)}},xYe=bYe,wYe=tc,_Ye=class extends wYe{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}},EYe=_Ye,SYe=tc,DYe=class extends SYe{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 fse)),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(lse.hide):this.out.write(use(this.outputText,this.out.columns)),super.render(),this.outputText=[cse.symbol(this.done,this.aborted),m$.bold(this.msg),cse.delimiter(!1),this.parts.reduce((r,n,i)=>r.concat(i===this.cursor&&!this.done?m$.cyan().underline(n.toString()):n),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
|
|||
|
|
`).reduce((r,n,i)=>r+`
|
|||
|
|
${i?" ":RYe.pointerSmall} ${m$.red().italic(n)}`,"")),this.out.write(AYe.line+lse.to(0)+this.outputText))}},BYe=q$,fS=ba,UYe=Ru,{cursor:pS,erase:GYe}=xa,{style:g$,figures:WYe,clear:dse,lines:HYe}=io,zYe=/[0-9]/,v$=e=>e!==void 0,hse=(e,r)=>{let n=Math.pow(10,r);return Math.round(e*n)/n},j$=class extends UYe{constructor(r={}){super(r),this.transform=g$.render(r.style),this.msg=r.message,this.initial=v$(r.initial)?r.initial:"",this.float=!!r.float,this.round=r.round||2,this.inc=r.increment||1,this.min=v$(r.min)?r.min:-1/0,this.max=v$(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=fS.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${hse(r,this.round)}`),this._value=hse(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||zYe.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(pS.down(HYe(this.outputError,this.out.columns)-1)+dse(this.outputError,this.out.columns)),this.out.write(dse(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[g$.symbol(this.done,this.aborted),fS.bold(this.msg),g$.delimiter(this.done),!this.done||!this.done&&!this.placeholder?fS[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|||
|
|
`).reduce((r,n,i)=>r+`
|
|||
|
|
${i?" ":WYe.pointerSmall} ${fS.red().italic(n)}`,"")),this.out.write(GYe.line+pS.to(0)+this.outputText+pS.save+this.outputError+pS.restore))}},VYe=j$,ro=ba,{cursor:KYe}=xa,YYe=Ru,{clear:mse,figures:Du,style:gse,wrap:XYe,entriesToDisplay:QYe}=io,JYe=class extends YYe{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=mse("",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:
|
|||
|
|
${Du.arrowUp}/${Du.arrowDown}: Highlight option
|
|||
|
|
${Du.arrowLeft}/${Du.arrowRight}/[space]: Toggle selection
|
|||
|
|
`+(this.maxChoices===void 0?` a: Toggle all
|
|||
|
|
`:"")+" enter/return: Complete answer":""}renderOption(r,n,i,a){let o=(n.selected?ro.green(Du.radioOn):Du.radioOff)+" "+a+" ",c,u;return n.disabled?c=r===i?ro.gray().underline(n.title):ro.strikethrough().gray(n.title):(c=r===i?ro.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=`
|
|||
|
|
`+XYe(n.description,{margin:o.length,width:this.out.columns})))),o+c+ro.gray(u||"")}paginateOptions(r){if(r.length===0)return ro.red("No matches for this query.");let{startIndex:n,endIndex:i}=QYe(this.cursor,r.length,this.optionsPerPage),a,o=[];for(let c=n;c<i;c++)c===n&&n>0?a=Du.arrowUp:c===i-1&&i<r.length?a=Du.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=[ro.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&r.push(ro.yellow(this.warn)),r.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(KYe.hide),super.render();let r=[gse.symbol(this.done,this.aborted),ro.bold(this.msg),gse.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(r+=ro.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=mse(r,this.out.columns)}},xae=JYe,hy=ba,ZYe=Ru,{erase:eXe,cursor:vse}=xa,{style:y$,clear:yse,figures:b$,wrap:tXe,entriesToDisplay:rXe}=io,bse=(e,r)=>e[r]&&(e[r].value||e[r].title||e[r]),nXe=(e,r)=>e[r]&&(e[r].title||e[r].value||e[r]),iXe=(e,r)=>{let n=e.findIndex(i=>i.value===r||i.title===r);return n>-1?n:void 0},B$=class extends ZYe{constructor(r={}){super(r),this.msg=r.message,this.suggest=r.suggest,this.choices=r.choices,this.initial=typeof r.initial=="number"?r.initial:iXe(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=y$.render(r.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=yse("",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=bse(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:nXe(u,c),value:bse(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?b$.arrowUp:a?b$.arrowDown:" ",u=n?hy.cyan().underline(r.title):r.title;return c=(n?hy.cyan(b$.pointer)+" ":" ")+c,r.description&&(o=` - ${r.description}`,(c.length+u.length+o.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(o=`
|
|||
|
|
`+tXe(r.description,{margin:3,width:this.out.columns}))),c+" "+u+hy.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(vse.hide):this.out.write(yse(this.outputText,this.out.columns)),super.render();let{startIndex:r,endIndex:n}=rXe(this.select,this.choices.length,this.limit);if(this.outputText=[y$.symbol(this.done,this.aborted,this.exited),hy.bold(this.msg),y$.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||hy.gray(this.fallback.title))}this.out.write(eXe.line+vse.to(0)+this.outputText)}},sXe=B$,Zo=ba,{cursor:aXe}=xa,oXe=xae,{clear:xse,style:wse,figures:rh}=io,U$=class extends oXe{constructor(r={}){r.overrideRender=!0,super(r),this.inputValue="",this.clear=xse("",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:
|
|||
|
|
${rh.arrowUp}/${rh.arrowDown}: Highlight option
|
|||
|
|
${rh.arrowLeft}/${rh.arrowRight}/[space]: Toggle selection
|
|||
|
|
[a,b,c]/delete: Filter choices
|
|||
|
|
enter/return: Complete answer
|
|||
|
|
`:""}renderCurrentInput(){return`
|
|||
|
|
Filtered results for: ${this.inputValue?this.inputValue:Zo.gray("Enter something to filter")}
|
|||
|
|
`}renderOption(r,n,i,a){let o=(n.selected?Zo.green(rh.radioOn):rh.radioOff)+" "+a+" ",c;return n.disabled?c=r===i?Zo.gray().underline(n.title):Zo.strikethrough().gray(n.title):c=r===i?Zo.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=[Zo.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&r.push(Zo.yellow(this.warn)),r.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(aXe.hide),super.render();let r=[wse.symbol(this.done,this.aborted),Zo.bold(this.msg),wse.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(r+=Zo.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=xse(r,this.out.columns)}},cXe=U$,_se=ba,uXe=Ru,{style:Ese,clear:lXe}=io,{erase:fXe,cursor:Sse}=xa,G$=class extends uXe{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(Sse.hide):this.out.write(lXe(this.outputText,this.out.columns)),super.render(),this.outputText=[Ese.symbol(this.done,this.aborted),_se.bold(this.msg),Ese.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:_se.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(fXe.line+Sse.to(0)+this.outputText))}},pXe=G$,dXe={TextPrompt:HKe,SelectPrompt:XKe,TogglePrompt:eYe,DatePrompt:BYe,NumberPrompt:VYe,MultiselectPrompt:xae,AutocompletePrompt:sXe,AutocompleteMultiselectPrompt:cXe,ConfirmPrompt:pXe};(function(e){let r=e,n=dXe,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))})(hae);var W$=hae,hXe=["suggest","format","onState","validate","onRender","type"],Dse=()=>{};async function Pu(e=[],{onSubmit:r=Dse,onCancel:n=Dse}={}){let i={},a=Pu._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(hXe.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,W$[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=Pu._injected?mXe(Pu._injected,c.initial):await W$[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 mXe(e,r){let n=e.shift();if(n instanceof Error)throw n;return n===void 0?r:n}function gXe(e){Pu._injected=(Pu._injected||[]).concat(e)}function vXe(e){Pu._override=Object.assign({},e)}var yXe=Object.assign(Pu,{prompt:Pu,prompts:W$,inject:gXe,override:vXe}),bXe=yXe,xXe=Ey(bXe),wae={},uh={};Object.defineProperty(uh,"__esModule",{value:!0});uh.sync=uh.isexe=void 0;var wXe=ph.default,_Xe=z$.default,EXe=async(e,r={})=>{let{ignoreErrors:n=!1}=r;try{return _ae(await(0,_Xe.stat)(e),r)}catch(i){let a=i;if(n||a.code==="EACCES")return!1;throw a}};uh.isexe=EXe;var SXe=(e,r={})=>{let{ignoreErrors:n=!1}=r;try{return _ae((0,wXe.statSync)(e),r)}catch(i){let a=i;if(n||a.code==="EACCES")return!1;throw a}};uh.sync=SXe;var _ae=(e,r)=>e.isFile()&&DXe(e,r),DXe=(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)},lh={};Object.defineProperty(lh,"__esModule",{value:!0});lh.sync=lh.isexe=void 0;var CXe=ph.default,TXe=z$.default,PXe=async(e,r={})=>{let{ignoreErrors:n=!1}=r;try{return Eae(await(0,TX
|
|||
|
|
`),Yr.default.env.CI&&Yr.default.exit(1);let u=xy(i,qse[i]),{tryInstall:l}=await xXe({name:"tryInstall",type:"confirm",message:`Would you like to globally install ${u}?`});l||Yr.default.exit(1)}await eKe(`npm i -g ${i.split("@")[0]}${a?`@${a}`:""}`,{stdio:"inherit",cwd:n})}return i}var Oqt=Yr.default.env.NI_CONFIG_FILE,jXe=Yr.default.platform==="win32"?Yr.default.env.USERPROFILE:Yr.default.env.HOME,Iqt=$r.default.join(jXe||"~/",".nirc");var bS=class extends Error{constructor({agent:r,command:n}){super(`Command "${n}" is not support by agent "${r}"`)}};function r3(e,r,n=[]){if(!(e in yy))throw new Error(`Unsupported agent "${e}"`);let i=yy[e][r];if(typeof i=="function")return i(n);if(!i)throw new bS({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 H$,Oae,Iae,kae,Fae=!0;typeof process<"u"&&({FORCE_COLOR:H$,NODE_DISABLE_COLORS:Oae,NO_COLOR:Iae,TERM:kae}=process.env||{},Fae=process.stdout&&process.stdout.isTTY);var Mt={enabled:!Oae&&Iae==null&&kae!=="dumb"&&(H$!=null&&H$!=="0"||Fae),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 Rse(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 BXe(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?Rse(this.keys,i+""):i+""):i===void 0?BXe([e],[n]):Mt.enabled?Rse([n],i+""):i+""}}async function rc(e,r,...n){let i=await Sy({autoInstall:!1,cwd:e,programmatic:!0});return r3(i??"npm",r,n)}var TS=require("@prisma/engines");var Uoe=U(h_()),v3=U(require("path"));var $ae=U(require("fs")),Ns=U(require("path")),Lae=require("util"),mh=(0,Lae.promisify)($ae.default.exists);async function UXe(e){return await mh(Ns.default.resolve(process.cwd(),"prisma/schema.prisma"))||Ns.default.relative(process.cwd(),e)==="prisma"&&await mh(Ns.default.resolve(process.cwd(),"package.json"))?process.cwd():await mh(Ns.default.resolve(e,"node_modules"))?e:await mh(Ns.default.resolve(e,"../node_modules"))?Ns.default.join(e,"../"):await mh(Ns.default.resolve(e,"package.json"))?e:await mh(Ns.default.resolve(e,"../package.json"))?Ns.default.join(e,"../"):e}async function Nae(e){let r=GXe(e.defaultOutput);if(r.startsWith("node_modules")){let n=await UXe(e.baseDir);return Ns.default.resolve(n,r)}return Ns.default.resolve(e.baseDir,r)}function GXe(e){return e.startsWith("./")?e.slice(2):e}function Mae(e){return e.generators.find(r=>gn(r.provider)==="prisma-client-js")?.previewFeatures||[]}var qae={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(gh(`datasource db {
|
|||
|
|
provider = "postgresql"
|
|||
|
|
url = env("DB_URL")
|
|||
|
|
}`))}
|
|||
|
|
|
|||
|
|
More information in our documentation:
|
|||
|
|
${ke("https://pris.ly/d/prisma-schema")}
|
|||
|
|
`;var _S=`
|
|||
|
|
${Mi("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(gh(`generator client {
|
|||
|
|
provider = "prisma-client-js"
|
|||
|
|
}`))}`,Gae=`
|
|||
|
|
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(gh(`model User {
|
|||
|
|
id Int @id @default(autoincrement())
|
|||
|
|
email String @unique
|
|||
|
|
name String?
|
|||
|
|
}`))}
|
|||
|
|
|
|||
|
|
More information in our documentation:
|
|||
|
|
${ke("https://pris.ly/d/prisma-schema")}
|
|||
|
|
`,Wae=`
|
|||
|
|
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(gh(`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 Hae(e,r){return Object.entries(e).reduce((n,[i,a])=>(r.includes(i)&&(n[i]=a),n),{})}function zae(e){if(e&&e.length>0){let r=e.map(n=>`${ze("warn")} ${n}`).join(`
|
|||
|
|
`);console.warn(r)}}var Toe=U(require("fs"));var DS=U(require("path"));var Ms=U(require("path"));function vh(e){return Ms.default.sep===Ms.default.posix.sep?e:e.split(Ms.default.sep).join(Ms.default.posix.sep)}function n3(e,r){if(!Ms.default.isAbsolute(e)||!Ms.default.isAbsolute(r))throw new Error("longestCommonPathPrefix expects absolute paths");process.platform==="win32"&&(e.startsWith("\\\\")||r.startsWith("\\\\"))&&(e=Ms.default.toNamespacedPath(e),r=Ms.default.toNamespacedPath(r));let n=KXe(e.split(Ms.default.sep),r.split(Ms.default.sep)).join(Ms.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 KXe(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 boe=U(require("fs")),l3=U(require("path"));var goe=U(require("path")),voe=U(moe());async function PQe(e,r){let n={preserveSymlinks:!1,...r};return new Promise(i=>{(0,voe.default)(e,n,(a,o)=>{a&&i(void 0),i(o)})})}async function Tf(e,r){let n=await PQe(`${e}/package.json`,r);return n&&goe.default.dirname(n)}var yoe=me("prisma:generator"),RQe=boe.default.promises.realpath;async function f3(e){let r={basedir:e,preserveSymlinks:!0},n=await Tf("prisma",r),i=await Tf("@prisma/client",r),a=i&&await RQe(i);if(yoe("prismaCLIDir",n),yoe("prismaClientDir",i),n===void 0||i===void 0)return a;let o=l3.default.relative(n,i).split(l3.default.sep);if(!(o[0]!==".."||o[1]===".."))return a}var xoe=U(Xp());async function p3(e,r,...n){await xoe.default.command(await rc(e,r,...n),{env:{PRISMA_SKIP_POSTINSTALL_GENERATE:"true"},stdio:"inherit",cwd:e})}var _oe=U(require("fs"));var Eoe=U(require("path"));function woe(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 AQe=me("prisma:generator");async function Soe(){let e="4.1.0";try{let r=await Tf("typescript",{basedir:process.cwd()});AQe("typescriptPath",r);let n=r&&Eoe.default.join(r,"package.json");if(n&&_oe.default.existsSync(n)){let a=require(n).version;woe(a,e)&&Tr.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")}. ${Q(`TypeScript found in: ${N(r)}`)}`)}}catch{}}async function Doe(e){let r=await Sy({cwd:e,autoInstall:!1,programmatic:!0});return r==="yarn"||r==="yarn@berry"}var Coe=me("prisma:generator");async function Poe(e,r){let n=await f3(e);if(Coe("baseDir",e),await Soe(),!n&&!process.env.PRISMA_GENERATE_SKIP_AUTOINSTALL){let i=n3(e,process.cwd());Coe("projectRoot",i);let a=`${N("Warning:")} ${Q("[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),Toe.default.existsSync(DS.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 Tf("prisma",{basedir:e});if(process.platform==="win32"&&await Doe(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. Please install ${c("it")}${u("them")} with ${u(`${N(te(`${await rc(e,"add","prisma","-D")}`))} and `)}${N(te(`${await rc(e,"add","@prisma/client")}`))}, and rerun ${N(await rc(e,"execute","prisma generate"))} \u{1F64F}.`)}if(o||await p3(i,"add",`prisma@${r??"latest"}`,"-D","--silent"),await p3(i,"add",`@prisma/client@${r??"latest"}`,"--silent"),n=await f3(DS.default.join(".",e)),!n)throw new Error(`Could not resolve @prisma/client despite the installation that we just tried.
|
|||
|
|
Please try to install it by hand with ${N(te(`${await rc(e,"add","@prisma/client")}`))} and rerun ${N(await rc(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 rc(e,"execute","prisma generate"))} \u{1F64F}.`);return{outputPath:n,generatorPath:DS.default.resolve(n,"generator-build/index.js"),isNode:!0}}var d3={"prisma-client-js":Poe};function CS(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 Roe(e){return{fromEnvVar:null,value:e}}function Aoe(e,r){return e=e||[],e.find(n=>n.native===!0)?[...e,Roe(r)]:[Roe("native"),...e]}var Foe=require("@prisma/engines");var $oe=U(pu()),Loe=U(require("path"));function Ooe(e,r){return Object.entries(e).reduce((n,[i,a])=>(n[r(i)]=a,n),{})}function Ioe(){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 koe(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=Ioe(),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=Loe.default.join(binaryTargetBaseDir,`./engines/${currentVersion}/`),await(0,$oe.ensureDir)(binaryTargetBaseDir).catch(e=>console.error(e)));let binariesConfig=neededVersion.engines.reduce((e,r)=>(binaryPathsOverride?.[r]||(e[koe(r)]=binaryTargetBaseDir),e),Object.create(null));if(Object.values(binariesConfig).length>0){let e=neededVersion.binaryTargets.map(a=>a.value),n=await YE({binaries:binariesConfig,binaryTargets:e,showProgress:typeof printDownloadProgress=="boolean"?printDownloadProgress:!0,version:currentVersion&¤tVersion!=="latest"?currentVersion:Foe.enginesVersion,skipDownload}),i=Ooe(n,CS);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 h3(e,r){let n=e?.requiresEngineVersion;return n=n??r,n??"latest"}var Moe=U(hv());function qoe(e){return String(new m3(e))}var m3=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:g3(r.binaryTargets)}));return`generator ${r.name} {
|
|||
|
|
${(0,Moe.default)(OQe(i),2)}
|
|||
|
|
}`}};function g3(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 OQe(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)} = ${IQe(i)}`).join(`
|
|||
|
|
`)}function IQe(e){return JSON.parse(JSON.stringify(e,(r,n)=>Array.isArray(n)?`[${n.map(i=>JSON.stringify(i)).join(", ")}]`:JSON.stringify(n)))}var Py=me("prisma:getGenerators");async function nc(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 Wr(),queryEngineBinaryType=(0,TS.getCliQueryEngineBinaryType)(),queryEngineType=CS(queryEngineBinaryType),prismaPath=binaryPathsOverride?.[queryEngineType];if(version&&!prismaPath){let potentialPath=eval("require('path').join(__dirname, '..')");if(!potentialPath.match(Xd)){let e={binaries:{[queryEngineBinaryType]:potentialPath},binaryTargets:[binaryTarget],showProgress:!1,version,skipDownload};prismaPath=(await YE(e))[queryEngineBinaryType][binaryTarget]}}let config=await Ve({datamodel:schemas,datamodelPath:schemaPath,prismaPath,ignoreEnvVarErrors:!0});if(config.datasources.length===0)throw new Error(Uae);zae(config.warnings);let previewFeatures=Mae(config),dmmf=await wE({datamodel:schemas,datamodelPath:schemaPath,prismaPath,previewFeatures});if(dmmf.datamodel.models.length===0&&!allowNoModels)throw config.datasources.some(e=>e.provider==="mongodb")?new Error(Wae):new Error(Gae);let generatorConfigs=LQe(overrideGenerators||config.generators,generatorNames);await $Qe(generatorConfigs);let runningGenerators=[];try{let e=await(0,Uoe.default)(generatorConfigs,async(a,o)=>{let c=gn(a.provider),u,l=v3.default.dirname(a.sourceFilePath??schemaPath),f=gn(a.provider);aliases&&aliases[f]?(c=aliases[f].generatorPath,u=aliases[f]):d3[f]&&(u=await d3[f](l,cliVersion),c=u.generatorPath);let p=new iS(c,a,u?.isNode);if(await p.init(),a.output)a.output={value:v3.default.resolve(l,gn(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=ny({schemas}),v=await vf(schemaPath,{cwd:a.output.value}),x={datamodel:g,datasources:config.datasources,generator:a,dmmf,otherGenerators:FQe(generatorConfigs,o),schemaPath,version:version||TS.enginesVersion,postinstall,noEngine,allowNoModels,envPaths:v,typedSql};return p.setOptions(x),runningGenerators.push(p),p},{stopOnError:!1}),r=generatorConfigs.map(a=>gn(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=h3(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)}Py("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=h3(a.manifest,version),c=i[o],u=Hae(c,a.manifest.requiresEngines);if(Py({generatorBinaryPaths:u}),a.setBinaryPaths(u),o!==version&&a.options&&a.manifest.requiresEngines.includes(queryEngineType)&&u[queryEngineType]&&u[queryEngineType]?.[binaryTarget]){let l=await wE({datamodel:schemas,datamodelPath:schemaPath,prismaPath:u[queryEngineType]?.[binaryTarget],previewFeatures}),f={...a.options,dmmf:l};Py("generator.manifest.prettyName",a.manifest.prettyName),Py("options",f),Py("options.generator.binaryTargets",f.generator.binaryTargets),a.setOptions(f)}}return e}catch(e){throw runningGenerators.forEach(r=>r.stop()),e}}async function kQe(e){return(await nc(e))[0]}function FQe(e,r){return[...e.slice(0,r),...e.slice(r+1)]}var joe=[...Lg,"native"],Boe={"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 $Qe(e){let r=await Wr();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=>GF(o)).map(o=>o==="native"?r:o);for(let o of a){if(Boe[o])throw new Error(`Binary target ${oe(N(o))} is deprecated. Please use ${te(N(Boe[o]))} instead.`);if(!joe.includes(o))throw new Error(`Unknown binary target ${oe(o)} in generator ${N(n.name)}.
|
|||
|
|
Possible binaryTargets: ${te(joe.join(", "))}`)}if(!a.includes(r)){let o=g3(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(qoe({...n,binaryTargets:Aoe(n.binaryTargets,r)}))}
|
|||
|
|
${Cl(`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 LQe(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 Tr={};Qn(Tr,{error:()=>jQe,info:()=>qQe,log:()=>NQe,query:()=>BQe,should:()=>Goe,tags:()=>Ry,warn:()=>MQe});var Ry={error:oe("prisma:error"),warn:ze("prisma:warn"),info:vs("prisma:info"),query:Mi("prisma:query")},Goe={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function NQe(...e){console.log(...e)}function MQe(e,...r){Goe.warn()&&console.warn(`${Ry.warn} ${e}`,...r)}function qQe(e,...r){console.info(`${Ry.info} ${e}`,...r)}function jQe(e,...r){console.error(`${Ry.error} ${e}`,...r)}function BQe(e,...r){console.log(`${Ry.query} ${e}`,...r)}var Woe=U(Xp());function Hoe(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 Pf(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 zoe({connectionString:e,cwd:r,schemaEnginePath:n,engineCommandName:"can-connect-to-database"})}catch(i){let a=i;if(a.stderr){let o=Hoe(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 y3(e,r=process.cwd(),n){if(await Pf(e,r,n)===!0)return!1;try{return await zoe({connectionString:e,cwd:r,schemaEnginePath:n,engineCommandName:"create-database"}),!0}catch(a){let o=a;if(o.stderr){let c=Hoe(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 zoe({connectionString:e,cwd:r,schemaEnginePath:n,engineCommandName:i}){n=n||await Su("schema-engine");try{return await(0,Woe.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 ove=U(Oge()),cve=U(Xh()),tm=U(require("fs")),uve=U(av()),jD=U(require("os")),rm=U(require("path")),lve=U(Qh()),P8=U(eve());async function tve(e,r){return await Ja(r,{method:"PUT",agent:hf(r),headers:{"Content-Length":String(e.byteLength)},body:e})}async function rve(e){return(await ive(`mutation ($data: CreateErrorReportInput!) {
|
|||
|
|
createErrorReport(data: $data)
|
|||
|
|
}`,{data:e})).createErrorReport}async function nve(e){return(await ive(`mutation ($signedUrl: String!) {
|
|||
|
|
markErrorReportCompleted(signedUrl: $signedUrl)
|
|||
|
|
}`,{signedUrl:e})).markErrorReportCompleted}async function ive(e,r){let n="https://error-reports.prisma.sh/",i=JSON.stringify({query:e,variables:r});return await Ja(n,{method:"POST",agent:hf(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 sve(e){return e.map(([r,n])=>[r,C0(n)])}function C0(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 C8(e,r){let n={};for(let i in e)typeof e[i]=="object"?n[i]=C8(e[i],r):n[i]=r(e[i]);return n}var T8=U(require("path"));function Da(e,r){let n=e?.datasources?.[0]?.sourceFilePath;return n?T8.default.dirname(n):r?T8.default.dirname(r):process.cwd()}function cs(e){return{files:ave(e)}}function em(e,r){return{files:ave(e.schemas),configDir:Da(r,e.schemaPath)}}function ave(e){return e.map(([r,n])=>({path:r,content:n}))}P8.default.setGracefulCleanup();async function fve({error:e,cliVersion:r,enginesVersion:n,getDatabaseVersionSafe:i}){let a=await He(e).with({schemaPath:Sr.not(Sr.nullish)},g=>Un(g.schemaPath)).with({schema:Sr.not(Sr.nullish)},g=>Promise.resolve(g.schema)).otherwise(()=>{}),o=a?sve(a):void 0,c;if(e.area==="LIFT_CLI"){let g=He({schema:a,introspectionUrl:e.introspectionUrl}).with({schema:Sr.not(void 0)},({schema:v})=>({datasource:{tag:"Schema",...cs(v)}})).with({introspectionUrl:Sr.not(void 0)},({introspectionUrl:v})=>({datasource:{tag:"ConnectionString",url:v}})).otherwise(()=>{});c=await i(g)}let u=e.request?JSON.stringify(C8(e.request,g=>typeof g=="string"?C0(g):g)):void 0,l={area:e.area,kind:"RUST_PANIC",cliVersion:r,binaryVersion:n,command:Sft(),jsStackTrace:(0,lve.default)(e.stack||e.message),rustStackTrace:e.rustStack,operatingSystem:`${jD.default.arch()} ${jD.default.platform()} ${jD.default.release()}`,platform:await Wr(),liftRequest:u,schemaFile:Eft(o),fingerprint:await cve.getSignature(),sqlDump:void 0,dbVersion:c},f=await rve(l);try{if(e.schemaPath){let g=await Dft(e);await tve(g,f)}}catch(g){console.error(`Error uploading zip file: ${g.message}`)}return await nve(f)}function Eft(e){if(e)return e.map(([r,n])=>`// ${r}
|
|||
|
|
${n}`).join(`
|
|||
|
|
`)}function Sft(){return process.argv[2]==="introspect"?"introspect":process.argv[2]==="db"&&process.argv[3]==="pull"?"db pull":process.argv.slice(2).join(" ")}async function Dft(e){if(!e.schemaPath)throw new Error("Can't make zip without schema path");let r=rm.default.dirname(e.schemaPath),n=P8.default.fileSync(),i=tm.default.createWriteStream(n.name),a=(0,ove.default)("zip",{zlib:{level:9}});a.pipe(i);let o=C0(tm.default.readFileSync(e.schemaPath,"utf-8"));if(a.append(o,{name:rm.default.basename(e.schemaPath)}),tm.default.existsSync(r)){let c=await(0,uve.default)("migrations/**/*",{cwd:r});for(let u of c){let l=tm.default.readFileSync(rm.default.resolve(r,u),"utf-8");(u.endsWith("schema.prisma")||u.endsWith(rm.default.basename(e.schemaPath)))&&(l=C0(l)),a.append(l,{name:rm.default.basename(u)})}}return a.finalize(),new Promise((c,u)=>{i.on("close",()=>{let l=tm.default.readFileSync(n.name);c(l)}),a.on("error",l=>{u(l)})})}function R8(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 Gbe=U(Zu());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 Xf=({stream:e=process.stdin}={})=>!!(e&&e.isTTY&&process.env.TERM!=="dumb");var Pa=()=>!!Gbe.default._injected?.length||Xf()&&!Yf();var nC=U(require("node:path")),Wbe=U(require("node:process")),Hbe=U(z1()),zbe=U(av());var BM=nC.default.join(".wrangler","state","v3","d1","miniflare-D1DatabaseObject");async function Qf({arg:e}){let r=Wbe.default.cwd(),n=nC.default.posix.join(r,BM),i=(0,Hbe.convertPathToPattern)(n),a=await(0,zbe.default)(nC.default.posix.join(i,"*.sqlite"),{});if(a.length===0)throw new Error(`No Cloudflare D1 databases found in ${BM}. 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 ${BM}. Please manually specify the local D1 database with \`${u}\`, without using the \`${c}\` flag.`)}return a[0]}var bxe=U(yxe());var KM=U(cC()),us={topLeft:"\u250C",topRight:"\u2510",bottomRight:"\u2518",bottomLeft:"\u2514",vertical:"\u2502",horizontal:"\u2500"};function Vht(e){return e.split(`
|
|||
|
|
`).reduce((r,n)=>Math.max(r,(0,KM.default)(n)),0)+2}function j0({title:e,width:r,height:n,str:i,horizontalPadding:a}){a=a||0,r=r||0,n=n||0,r=Math.max(r,Vht(i)+a*2);let o=e?Io(us.topLeft+us.horizontal)+" "+Fg(N(e))+" "+Io(us.horizontal.repeat(r-e.length-2-3)+us.topRight)+Fg():Io(us.topLeft+us.horizontal)+Io(us.horizontal.repeat(r-3)+us.topRight),c=us.bottomLeft+us.horizontal.repeat(r-2)+us.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,KM.default)(f),r),g=Math.max(r-p-2,0);return`${Io(us.vertical)}${" ".repeat(a)}${Fg((0,bxe.default)(f,r-2))}${" ".repeat(g-a)}${Io(us.vertical)}`}).join(`
|
|||
|
|
`);return Io(o+`
|
|||
|
|
`+l+`
|
|||
|
|
`+c)}var _c={};Qn(_c,{createDirIfNotExists:()=>vbt,getFilesInDir:()=>Ebt,getNestedFoldersInDir:()=>_bt,removeDir:()=>xbt,removeEmptyDirs:()=>bbt,removeFile:()=>wbt,writeFile:()=>ybt});var L4=U(Nt()),gm=U(k4()),N4=U(require("fs/promises"));var ap=U(require("fs/promises")),F4=U(av()),EC=U(require("path"));function Nwe(e){return ap.default.mkdir(e,{recursive:!0})}function Mwe({path:e,content:r}){return ap.default.writeFile(e,r,{encoding:"utf-8"})}function qwe(e){let r=vh(EC.default.join(e,"**"));return(0,F4.default)(r,{onlyFiles:!1,onlyDirectories:!0})}function jwe(e,r="**"){let n=vh(EC.default.join(e,r));return(0,F4.default)(n,{onlyFiles:!0,onlyDirectories:!1})}async function $4(e){try{if(!(await ap.default.lstat(e)).isDirectory())return}catch{return}let r=await ap.default.readdir(e);if(r.length>0){let i=r.map(a=>$4(EC.default.join(e,a)));await Promise.all(i)}(await ap.default.readdir(e)).length===0&&await ap.default.rmdir(e)}var vbt=e=>gm.tryCatch(()=>Nwe(e),nb("fs-create-dir",{dir:e})),ybt=e=>gm.tryCatch(()=>Mwe(e),nb("fs-write-file",e)),bbt=e=>gm.tryCatch(()=>$4(e),nb("fs-remove-empty-dirs",{dir:e})),xbt=e=>(0,L4.pipe)(gm.tryCatch(()=>N4.default.rm(e,{recursive:!0}),nb("fs-remove-dir",{dir:e}))),wbt=e=>(0,L4.pipe)(gm.tryCatch(()=>N4.default.unlink(e),nb("fs-remove-file",{filePath:e}))),_bt=e=>()=>qwe(e),Ebt=(e,r="**")=>()=>jwe(e,r);function nb(e,r){return n=>({type:e,error:n,meta:r})}var U4=U(require("fs")),Qwe=U(Xwe());function op(){try{if(U4.default.realpathSync(process.argv[1]).indexOf(U4.default.realpathSync(Qwe.default.npm.packages))===0)return"npm"}catch{}return!1}function Le(e){return op()?e:__dirname.includes("_npx")?`npx ${e}`:e}var x1e=U(Zu());var h1e=U(Jwe());var Y4=U(require("node:process"),1),t1e=U(require("node:os"),1),r1e=U(require("node:fs"),1);var Zwe=U(require("node:fs"),1);var z4=U(require("node:fs"),1),H4;function Abt(){try{return z4.default.statSync("/.dockerenv"),!0}catch{return!1}}function Obt(){try{return z4.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function V4(){return H4===void 0&&(H4=Abt()||Obt()),H4}var K4,Ibt=()=>{try{return Zwe.default.statSync("/run/.containerenv"),!0}catch{return!1}};function CC(){return K4===void 0&&(K4=Ibt()||V4()),K4}var e1e=()=>{if(Y4.default.platform!=="linux")return!1;if(t1e.default.release().toLowerCase().includes("microsoft"))return!CC();try{return r1e.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!CC():!1}catch{return!1}},n1e=Y4.default.env.__IS_WSL_TEST__?e1e:e1e();var m1e=U(i1e()),g1e=U(RC()),v1e=U(Zu()),y1e=U(Qh());function Ubt({title:e,user:r="prisma",repo:n="prisma",template:i="bug_report.yml",body:a}){return(0,m1e.default)({user:r,repo:n,template:i,title:e,body:a})}async function b1e(e){if(await He(e.prompt).with(!0,async()=>!!(await(0,v1e.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 Wr(),i=Ubt({title:e.title??"",body:Gbt(n,e)}),a=(0,h1e.default)()||n1e;await(0,g1e.default)(i,{wait:a})}else process.exit(130)}var Gbt=(e,r)=>(0,y1e.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 e6(e){if(!Pa())throw e.error;await Wbt(e)}async function Wbt({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.")}
|
|||
|
|
${Q(`Learn more: ${ke("https://pris.ly/d/telemetry")}`)}
|
|||
|
|
`);let{value:c}=await(0,x1e.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 fve({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(`${Cl("Error report submission failed due to: ")}`,u)}await b1e({prompt:!c,error:e,cliVersion:r,enginesVersion:n,command:i}),process.exit(1)}var w1e=U(ok());function t6(e){return(0,w1e.isIdentifierName)(e)}function r6(e,r){let n={};for(let i of Object.keys(e))n[i]=r(e[i],i);return n}function xo(e,r){Object.defineProperty(e,"name",{value:r,configurable:!0})}var cp=class cp{constructor(r){this.cmds=r}static new(r){return new cp(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 yf(cp.help,n._[0])}help(r){return r?new Re(`
|
|||
|
|
${N(oe("!"))} ${r}
|
|||
|
|
${cp.help}`):cp.help}};cp.help=$e(`
|
|||
|
|
${process.platform==="win32"?"":"\u{1F3CB}\uFE0F "}Manage your database schema and lifecycle during development.
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${Q("$")} 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\`
|
|||
|
|
${Q("$")} prisma db pull
|
|||
|
|
|
|||
|
|
Run \`prisma db push\`
|
|||
|
|
${Q("$")} prisma db push
|
|||
|
|
|
|||
|
|
Run \`prisma db seed\`
|
|||
|
|
${Q("$")} prisma db seed
|
|||
|
|
|
|||
|
|
Run \`prisma db execute\`
|
|||
|
|
${Q("$")} prisma db execute
|
|||
|
|
`);var ab=cp;var Hbt=/^\.{0,2}\//;function _1e(e){if(["postgres","postgresql","cockroachdb"].includes(e.type)){let r=e.host;return typeof r=="string"&&Hbt.test(r)?r:null}return e.socket??null}async function Ai({schemaPath:e,throwIfEnvError:r}={}){let n=await Un(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=S1e(a.provider),c=Bo(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:Da(i,e)};try{let u=rS(c),l=E1e(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:Da(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:Da(i,e)}}}async function ob(e){let r=await Un(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=Da(n,e),o=Bo(i).value,c=await Pf(o,a);if(c===!0)return!0;{let{code:u,message:l}=c;throw new Error(`${u}: ${l}`)}}async function sl(e,r){let n=await Un(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=Da(i,r),c=Bo(a).value,u=await Pf(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 y3(c,o)){if(a.provider==="sqlserver")return`SQL Server database created.
|
|||
|
|
`;let p=rS(c),v=`${S1e(a.provider)} database${p.database?` ${p.database} `:" "}created`,x=E1e(p);return x&&(v+=` at ${N(x)}`),v}}function E1e(e){if(e.type==="sqlite")return e.uri;let r=_1e(e);if(r)return`unix:${r}`;if(e.host&&e.port)return`${e.host}:${e.port}`;if(e.host)return`${e.host}`}function S1e(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 cb=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")}`)}};xo(cb,"NoSchemaFoundError");var ub=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")))}`)}};xo(ub,"DbPushIgnoreWarningsWithFlagError");var n6=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`)))}`)}};xo(n6,"MigrateNeedsForceError");var lb=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")}`)}};xo(lb,"MigrateResetEnvNonInteractiveError");var ym=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")}`)}};xo(ym,"MigrateDevEnvNonInteractiveError");var i6=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`)))}`)}};xo(i6,"DbDropNeedsForceError");var D1e=U(require("path"));async function Zr(e,r){let n=await pt(e,r);return AC(n.schemaPath),n}function AC(e){process.stdout.write(Q(`Prisma schema loaded from ${D1e.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(Q(r)+`
|
|||
|
|
`)}var Y1e=U(require("fs")),X1e=U(C1e());var Q1e=U(require("path"));var V1e=U(P1e());var qC=U(l6()),jC=U(require("path"));var H1e=U(require("node:path"));var z1e=require("child_process");var LC=U(require("stream")),B1e=U(require("util"));function NC(e,r){return cxt(e,r)}function cxt(e,r){return e?uxt(e,r):new up(r)}function uxt(e,r){if(!e)throw new Error("expected readStream");if(!e.readable)throw new Error("readStream must be readable");let n=new up(r);return e.pipe(n),n}function up(e){LC.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 LC.default.Readable&&(this.encoding=r._readableState.encoding)})}B1e.default.inherits(up,LC.default.Transform);up.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)};up.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()};up.prototype._flush=function(e){this._pushBuffer(this._chunkEncoding,0,e)};up.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 f6=U(xC()),p6=U(Nt()),G1e=U(A4()),al=U(k4()),db=U(require("path"));async function W1e({views:e,schemaPath:r}){let n=db.default.dirname(vh(r)),i=db.default.posix.join(n,"views");if(e.length===0){await U1e(i);return}let{viewFilesToKeep:a}=await lxt(i,e);await U1e(i,a)}async function lxt(e,r){let n=r.map(({schema:f,...p})=>[db.default.posix.join(e,f),p]),i=n.map(([f])=>f),a=n.map(([f,{name:p,definition:g}])=>({path:db.default.posix.join(f,`${p}.sql`),content:g})),o=a.map(({path:f})=>f),u=await(0,p6.pipe)(_c.createDirIfNotExists(e),al.chainW(()=>al.traverseArray(_c.createDirIfNotExists)(i)),al.chainW(()=>al.traverseArray(_c.writeFile)(a)))();if(f6.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 U1e(e,r=[]){let n=(0,p6.pipe)(_c.getFilesInDir(e,"**/*/*.sql"),G1e.chain(o=>{let c=o.filter(u=>!r.includes(u));return al.traverseArray(_c.removeFile)(c)}),al.chainW(()=>_c.removeEmptyDirs(e))),i=await n();if(f6.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 d6=me("prisma:schemaEngine:rpc"),fxt=me("prisma:schemaEngine:stderr"),pxt=me("prisma:schemaEngine:stdin"),MC=class extends Error{constructor(r,n){super(r),this.code=n}};xo(MC,"EngineError");var dxt=1,ka=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??H1e.default.join(process.cwd(),"prisma");await W1e({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 Su("schema-engine");d6("starting Schema engine with binary: "+o);let c=[],u=process.cwd();if(this.schemaPath){let l=await Un(this.schemaPath),f=await Ve({datamodel:l});u=Da(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,z1e.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(hxt(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=>{pxt(l)}),NC(this.child.stderr).on("data",l=>{let f=String(l);fxt(f);try{let p=JSON.parse(f);this.messages.push(p.fields.message),p.level==="ERROR"&&(this.lastError=p.fields)}catch{}}),NC(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(d6(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(Hi(a.error.data.message))}
|
|||
|
|
`;a.error.data?.error_code?(c=oe(`${a.error.data.error_code}
|
|||
|
|
|
|||
|
|
`)+c,i(new MC(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.`);d6("SENDING RPC CALL",JSON.stringify(r)),this.child.stdin.write(JSON.stringify(r)+`
|
|||
|
|
`),this.lastRequest=r})}getRPCPayload(r,n){return{id:dxt++,jsonrpc:"2.0",method:r,params:n?{...n}:void 0}}};function hxt(e){return`${oe(N(`Error in Schema engine.
|
|||
|
|
Reason: `))}${e}
|
|||
|
|
`}var mxt=eval("require('../package.json')"),en=class{constructor(r,n){r?(this.schemaPath=jC.default.resolve(process.cwd(),r),this.migrationsDirectoryPath=jC.default.join(jC.default.dirname(this.schemaPath),"migrations"),this.engine=new ka({schemaPath:this.schemaPath,enabledPreviewFeatures:n})):this.engine=new ka({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=cs((await this.getPrismaSchema()).schemas);return this.engine.evaluateDataLoss({migrationsDirectoryPath:this.migrationsDirectoryPath,schema:r})}async push({force:r=!1}){let n=cs((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,qC.default)(`Running generate... ${Q("(Use --skip-generate to skip the generators)")}`);let n=await nc({schemaPath:this.schemaPath,printDownloadProgress:!0,version:V1e.enginesVersion,cliVersion:mxt.version});for(let i of n){(0,qC.default)(`Running generate... - ${i.getPrettyName()}`);let a=Math.round(performance.now());try{await i.generate();let o=Math.round(performance.now());r.push(cy(i,o-a)),i.stop()}catch(o){r.push(`${o.message}`),i.stop()}}(0,qC.default)(r.join(`
|
|||
|
|
`))}};var K1e=$e(`${N("Usage")}
|
|||
|
|
|
|||
|
|
${Q("$")} prisma db execute [options]
|
|||
|
|
|
|||
|
|
${N("Options")}
|
|||
|
|
|
|||
|
|
-h, --help Display this help message
|
|||
|
|
|
|||
|
|
${gs("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
|
|||
|
|
|
|||
|
|
${gs("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`),hb=class hb{static new(){return new hb}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 Pr("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=Y1e.default.readFileSync(Q1e.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,X1e.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",...em(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}
|
|||
|
|
|
|||
|
|
${K1e}`);return hb.help}};hb.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.
|
|||
|
|
|
|||
|
|
${gs("This command is currently not supported on MongoDB.")}
|
|||
|
|
|
|||
|
|
${K1e}
|
|||
|
|
${N("Examples")}
|
|||
|
|
|
|||
|
|
Execute the content of a SQL script file to the datasource URL taken from the schema
|
|||
|
|
${Q("$")} 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
|
|||
|
|
${Q("$")} echo 'TRUNCATE TABLE dev;' | \\
|
|||
|
|
prisma db execute \\
|
|||
|
|
--stdin \\
|
|||
|
|
--url="$DATABASE_URL"
|
|||
|
|
|
|||
|
|
Like previous example, but exposing the datasource url credentials to your terminal history
|
|||
|
|
${Q("$")} echo 'TRUNCATE TABLE dev;' | \\
|
|||
|
|
prisma db execute \\
|
|||
|
|
--stdin \\
|
|||
|
|
--url="mysql://root:root@localhost/mydb"
|
|||
|
|
`);var mb=hb;var lp=U(require("path"));function J1e(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 Z1e(e){return e?e.files.every(r=>r.content.trim()===""):!0}var e_e=U(hv());function t_e(e){return e.map(r=>String(new h6(r))).join(`
|
|||
|
|
|
|||
|
|
`)}var gxt=2,h6=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,e_e.default)(vxt(n),gxt)}
|
|||
|
|
}`}};function vxt(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 r_e=U(require("path"));function n_e(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=r_e.default.relative(process.cwd(),i.path);r.write(`// ${a}
|
|||
|
|
${i.content}
|
|||
|
|
`)}}var i_e=U(require("node:fs/promises"));async function s_e(e){await Promise.all(e.map(([r])=>i_e.default.rm(r)))}function a_e(e,r){let n=!1,i=r.map(([a,o])=>{let c=bxt(e,o);return c.replaced&&(n=!0),[a,c.content]});return n||yxt(e,i),i}function yxt(e,r){let n=r[0];R8(n,"There always should be at least on file in the schema"),n[1]=`${e}
|
|||
|
|
${n[1]}`}function bxt(e,r){let n=r.split(/\r\n|\r|\n/g),i=xxt(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 xxt(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 o_e=U(require("node:fs/promises"));async function c_e(e){await Promise.all(e.files.map(r=>o_e.default.writeFile(r.path,r.content,"utf8")))}var z_e=U(H_e()),Qxt={spinner:"dots",color:"cyan",indent:0,stream:process.stdout};function V_e(e=!0,r={}){let n={...Qxt,...r};return i=>{if(!e)return{success:()=>{},failure:()=>{}};n.stream?.write(`
|
|||
|
|
`);let a=(0,z_e.default)(n);return a.start(i),{success:o=>{a.succeed(o)},failure:o=>{a.fail(o)}}}}var K_e=me("prisma:db:pull"),wm=class wm{static new(){return new wm}urlToDatasource(r,n){let i=n||to(`${r.split(":")[0]}:`);return t_e([{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=V_e(!n["--print"]);if(n instanceof Error)return this.help(n.message);if(await Pr("db pull",n,!n["--url"]),n["--help"])return this.help();let a=n["--url"],o=await sy(n["--schema"]),c=o?.schemaPath??null,u=o?.schemaRootDir??process.cwd();K_e("schemaPathResult",o),c&&!n["--print"]?(process.stdout.write(Q(`Prisma schema loaded from ${lp.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 cb;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 Un(F.schemaPath),B=await Ve({datamodel:L,ignoreEnvVarErrors:!0}),V=B.generators.find(({name:W})=>W==="client")?.previewFeatures,j=B.datasources[0]?B.datasources[0]:void 0;if(F.url){let W=j?.provider;W==="postgres"&&(W="postgresql");let q=to(`${F.url.split(":")[0]}:`),X=a_e(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 Qf({arg:"--from-local-d1"}),q=lp.default.relative(lp.default.dirname(F.schemaPath),W),X=[["schema.prisma",this.urlToDatasource(`file:${q}`,"sqlite")]],J={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?J:{...J,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 Qf({arg:"--from-local-d1"}),B=lp.default.relative(process.cwd(),L),j=[["schema.prisma",`generator client {
|
|||
|
|
provider = "prisma-client-js"
|
|||
|
|
previewFeatures = ["driverAdapters"]
|
|||
|
|
}
|
|||
|
|
${this.urlToDatasource(`file:${B}`,"sqlite")}`]];return{firstDatasource:(await Ve({datamodel:j,ignoreEnvVarErrors:!0})).datasources[0],schema:j,validationWarning:void 0}}).when(F=>F.url!==void 0,async F=>{to(`${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 Un(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 ka({schemaPath:c??void 0}),x=!n["--url"]&&c?` based on datasource defined in ${tt(lp.default.relative(process.cwd(),c))}`:"",E=i(`Introspecting${x}`),D=Math.round(performance.now()),T,R;try{let F=await v.introspect({schema:cs(p),baseDirectoryPath:u,force:n["--force"],compositeTypeDepth:n["--composite-type-depth"],namespaces:n["--schemas"]?.split(",")});T=F.schema,R=F.warnings,K_e("Introspection warnings",R)}catch(F){if(E.failure(),F.code==="P4001"&&Z1e(T))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=Hi(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"])n_e(T,process.stdout),k.trim().length>0&&console.error(k.replace(/(\n)/gm,`
|
|||
|
|
// `));else{c=c||"schema.prisma",n["--force"]&&await s_e(p),await c_e(T);let{modelsCount:F,typesCount:L}=J1e(T),B=`${F} ${F>1?"models":"model"}`,V=`${L} ${L>1?"embedded documents":"embedded document"}`,j;L>0?j=`${B} and ${V}`:j=`${B}`;let W=F+L>1?`${j} and wrote them`:`${j} and wrote it`,q=g?`
|
|||
|
|
${ze(g)}`:"";E.success(`Introspected ${W} into ${tt(lp.default.relative(process.cwd(),c))} in ${N(Qo(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}
|
|||
|
|
${wm.help}`):wm.help}};wm.help=$e(`
|
|||
|
|
Pull the state from the database to the Prisma schema using introspection
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${Q("$")} 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
|
|||
|
|
${Q("$")} prisma db pull
|
|||
|
|
|
|||
|
|
Or specify a Prisma schema path
|
|||
|
|
${Q("$")} prisma db pull --schema=./schema.prisma
|
|||
|
|
|
|||
|
|
Instead of saving the result to the filesystem, you can also print it to stdout
|
|||
|
|
${Q("$")} prisma db pull --print
|
|||
|
|
|
|||
|
|
Overwrite the current schema with the introspected schema instead of enriching it
|
|||
|
|
${Q("$")} prisma db pull --force
|
|||
|
|
|
|||
|
|
Set composite types introspection depth to 2 levels
|
|||
|
|
${Q("$")} prisma db pull --composite-type-depth=2
|
|||
|
|
|
|||
|
|
`);var _m=wm;var P6=U(Zu());var Em=class Em{static new(){return new Em}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 Pr("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 sl("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,P6.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 ub;process.stdout.write(`
|
|||
|
|
`),(await(0,P6.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 ${Qo(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=to(`${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}
|
|||
|
|
${Em.help}`):Em.help}};Em.help=$e(`
|
|||
|
|
${process.platform==="win32"?"":"\u{1F64C} "}Push the state from your Prisma schema to your database
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${Q("$")} 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
|
|||
|
|
${Q("$")} prisma db push
|
|||
|
|
|
|||
|
|
Specify a schema
|
|||
|
|
${Q("$")} prisma db push --schema=./schema.prisma
|
|||
|
|
|
|||
|
|
Ignore data loss warnings
|
|||
|
|
${Q("$")} prisma db push --accept-data-loss
|
|||
|
|
`);var bb=Em;var pEe=U(zF());var lEe=U(Xp()),L6=U(require("fs"));var ul=U(require("path")),fEe=U($6()),N6=me("prisma:migrate:seed");async function Sm(e){let r=process.cwd(),n=rwt(r,e),i=await ay(r);if(i&&i.data?.seed)return;let a="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 nwt(),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 Dm(e){let r=await ay(e);if(N6({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 \`${ul.default.relative(e,r.packagePath)}\` must be of type string`);if(!n)throw new Error(`Provided seed command \`${n}\` from \`${ul.default.relative(e,r.packagePath)}\` cannot be empty`);return n}async function Cm({commandFromConfig:e,extraArgs:r}){let n=r?`${e} ${r}`:e;process.stdout.write(`Running seed command \`${gs(n)}\` ...
|
|||
|
|
`);try{await lEe.default.command(n,{stdout:"inherit",stderr:"inherit"})}catch(i){let a=i;return N6({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 rwt(e,r){let n=ul.default.relative(e,ul.default.join(e,"prisma"));r&&(n=ul.default.relative(e,ul.default.dirname(r)));let i=ul.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;L6.default.existsSync(u)&&(a[c]=u,a.numberOfSeedFiles++)}return N6({detected:a}),a}async function nwt(){(await iwt())?.["ts-node"]&&Tr.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 iwt(e=process.cwd()){try{let r=await(0,fEe.default)({cwd:e});if(!r)return null;let n=await L6.default.promises.readFile(r,"utf-8"),i=JSON.parse(n),{"ts-node":a}=i.scripts;return{"ts-node":a}}catch{return null}}var Tm=class Tm{static new(){return new Tm}async parse(r){let n=_e(r,{"--help":Boolean,"-h":"--help","--schema":String,"--telemetry-information":String},!1);if(xe(n)){if(n instanceof pEe.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:
|
|||
|
|
${Q("$")} 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 Dm(process.cwd());if(!i){let c=await pt(n["--schema"]),u=await Sm(c?.schemaPath??null);if(u)throw new Error(u);return""}let a=n._.join(" ");if(await Cm({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}
|
|||
|
|
${Tm.help}`):Tm.help}};Tm.help=$e(`
|
|||
|
|
${process.platform==="win32"?"":"\u{1F64C} "}Seed your database
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${Q("$")} prisma db seed [options]
|
|||
|
|
|
|||
|
|
${N("Options")}
|
|||
|
|
|
|||
|
|
-h, --help Display this help message
|
|||
|
|
|
|||
|
|
${N("Examples")}
|
|||
|
|
|
|||
|
|
Passing extra arguments to the seed command
|
|||
|
|
${Q("$")} prisma db seed -- --arg1 value1 --arg2 value2
|
|||
|
|
`);var xb=Tm;var fp=class fp{constructor(r){this.cmds=r}static new(r){return new fp(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 yf(fp.help,i)}help(r){return r?new Re(`
|
|||
|
|
${N(oe("!"))} ${r}
|
|||
|
|
${fp.help}`):fp.help}};fp.help=$e(`
|
|||
|
|
Update the database schema with migrations
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${Q("$")} 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)
|
|||
|
|
${Q("$")} prisma migrate dev
|
|||
|
|
|
|||
|
|
Reset your database and apply all migrations
|
|||
|
|
${Q("$")} prisma migrate reset
|
|||
|
|
|
|||
|
|
Apply pending migrations to the database in production/staging
|
|||
|
|
${Q("$")} prisma migrate deploy
|
|||
|
|
|
|||
|
|
Check the status of migrations in the production/staging database
|
|||
|
|
${Q("$")} prisma migrate status
|
|||
|
|
|
|||
|
|
Specify a schema
|
|||
|
|
${Q("$")} prisma migrate status --schema=./schema.prisma
|
|||
|
|
|
|||
|
|
Compare the database schema from two databases and render the diff as a SQL script
|
|||
|
|
${Q("$")} prisma migrate diff \\
|
|||
|
|
--from-url "$DATABASE_URL" \\
|
|||
|
|
--to-url "postgresql://login:password@localhost:5432/db" \\
|
|||
|
|
--script
|
|||
|
|
`);var wb=fp;var dEe=U(hv());function ZC(e){let r=e.split("_");return r.length===1?vs(N(e)):`${r[0]}_${vs(N(r.slice(1).join("_")))}`}function pp(e,r,n){let i=Object.keys(n),a=`${e}/`;return r.forEach(o=>{a+=`
|
|||
|
|
\u2514\u2500 ${ZC(o)}/
|
|||
|
|
${(0,dEe.default)(i.map(c=>`\u2514\u2500 ${c}`).join(`
|
|||
|
|
`),4)}`}),a}var swt=me("prisma:migrate:deploy"),Pm=class Pm{static new(){return new Pm}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 Pr("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 sl("apply",i);u&&process.stdout.write(`
|
|||
|
|
`+u+`
|
|||
|
|
`)}catch(u){throw process.stdout.write(`
|
|||
|
|
`),u}let o=await a.listMigrationDirectories();if(swt({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:
|
|||
|
|
|
|||
|
|
${pp("migrations",c,{"migration.sql":""})}
|
|||
|
|
|
|||
|
|
${te("All migrations have been successfully applied.")}`}help(r){return r?new Re(`
|
|||
|
|
${N(oe("!"))} ${r}
|
|||
|
|
${Pm.help}`):Pm.help}};Pm.help=$e(`
|
|||
|
|
Apply pending migrations to update the database schema in production/staging
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${Q("$")} 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
|
|||
|
|
${Q("$")} prisma migrate deploy
|
|||
|
|
|
|||
|
|
Specify a schema
|
|||
|
|
${Q("$")} prisma migrate deploy --schema=./schema.prisma
|
|||
|
|
|
|||
|
|
`);var _b=Pm;var tT=U(Zu());function hEe(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 q6=U(REe()),eT=U(Zu());async function AEe(e){if(e)return{name:(0,q6.default)(e,{separator:"_"}).substring(0,200)};if((!Xf||Yf())&&!eT.prompt._injected?.length)return{name:""};let n="Enter a name for the new migration:";eT.prompt._injected?.length&&process.stdout.write(n+`
|
|||
|
|
`);let i=await(0,eT.prompt)({type:"text",name:"name",message:n});return"name"in i?{name:(0,q6.default)(i.name,{separator:"_"}).substring(0,200)||""}:{userCancelled:"Canceled by user."}}var j6=me("prisma:migrate:dev"),Rm=class Rm{static new(){return new Rm}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 Pr("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(`
|
|||
|
|
`),gf({schemas:a}),await Ve({datamodel:a,ignoreEnvVarErrors:!1});let c=await sl("create",i);c&&process.stdout.write(c+`
|
|||
|
|
|
|||
|
|
`);let u=new en(i),l;try{l=await u.devDiagnostic(),j6({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 ym;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:
|
|||
|
|
|
|||
|
|
${pp("migrations",E,{"migration.sql":""})}
|
|||
|
|
`)}catch(E){throw u.stop(),E}let p;try{p=await u.evaluateDataLoss(),j6({evaluateDataLossResult:p})}catch(E){throw u.stop(),E}let g=hEe(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 ym;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,tT.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 AEe(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:cs((await u.getPrismaSchema()).schemas)});if(j6({createMigrationResult:E}),n["--create-only"])return u.stop(),`Prisma Migrate created the following migration without applying it ${ZC(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:
|
|||
|
|
|
|||
|
|
${pp("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 Dm(process.cwd());if(E)process.stdout.write(`
|
|||
|
|
`),await Cm({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 Sm(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 tT.default._injected?.length&&process.stdout.write(a+`
|
|||
|
|
`),(await(0,tT.default)({type:"confirm",name:"value",message:a})).value}help(r){return r?new Re(`
|
|||
|
|
${N(oe("!"))} ${r}
|
|||
|
|
${Rm.help}`):Rm.help}};Rm.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")}
|
|||
|
|
|
|||
|
|
${Q("$")} 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)
|
|||
|
|
${Q("$")} prisma migrate dev
|
|||
|
|
|
|||
|
|
Specify a schema
|
|||
|
|
${Q("$")} prisma migrate dev --schema=./schema.prisma
|
|||
|
|
|
|||
|
|
Create a migration without applying it
|
|||
|
|
${Q("$")} prisma migrate dev --create-only
|
|||
|
|
`);var Eb=Rm;var IEe=U(iW());var dp=U(require("path"));var rT=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 Nwt=me("prisma:migrate:diff"),OEe=$e(`${N("Usage")}
|
|||
|
|
|
|||
|
|
${Q("$")} prisma migrate diff [options]
|
|||
|
|
|
|||
|
|
${N("Options")}
|
|||
|
|
|
|||
|
|
-h, --help Display this help message
|
|||
|
|
-o, --output Writes to a file instead of stdout
|
|||
|
|
|
|||
|
|
${gs("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 ${gs("datamodel")} for the diff
|
|||
|
|
--to-schema-datamodel
|
|||
|
|
|
|||
|
|
--from-schema-datasource Path to a Prisma schema file, uses the ${gs("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
|
|||
|
|
|
|||
|
|
${gs("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.`),Sb=class Sb{static new(){return new Sb}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 Pr("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(dp.default.resolve(n["--from-schema-datasource"]),{argumentName:"--from-schema-datasource"}),x=await Ve({datamodel:v.schemas});o={tag:"schemaDatasource",...em(v,x)}}else if(n["--from-schema-datamodel"]){let v=await pt(dp.default.resolve(n["--from-schema-datamodel"]),{argumentName:"--from-schema-datamodel"});o={tag:"schemaDatamodel",...cs(v.schemas)}}else n["--from-url"]?o={tag:"url",url:n["--from-url"]}:n["--from-migrations"]?o={tag:"migrations",path:dp.default.resolve(n["--from-migrations"])}:n["--from-local-d1"]&&(o={tag:"url",url:`file:${await Qf({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(dp.default.resolve(n["--to-schema-datasource"]),{argumentName:"--to-schema-datasource"}),x=await Ve({datamodel:v.schemas});c={tag:"schemaDatasource",...em(v,x)}}else if(n["--to-schema-datamodel"]){let v=await pt(dp.default.resolve(n["--to-schema-datamodel"]),{argumentName:"--to-schema-datamodel"});c={tag:"schemaDatamodel",...cs(v.schemas)}}else n["--to-url"]?c={tag:"url",url:n["--to-url"]}:n["--to-migrations"]?c={tag:"migrations",path:dp.default.resolve(n["--to-migrations"])}:n["--to-local-d1"]&&(c={tag:"url",url:`file:${await Qf({arg:"--to-local-d1"})}`});let u=new en,l=new rT,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 IEe.default.writeAsync(f,v.join(`
|
|||
|
|
`))}return Nwt({migrateDiffOutput:g}),n["--exit-code"]&&g.exitCode&&process.exit(g.exitCode),""}help(r){if(r)throw new Re(`
|
|||
|
|
${r}
|
|||
|
|
|
|||
|
|
${OEe}`);return Sb.help}};Sb.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")}
|
|||
|
|
|
|||
|
|
${OEe}
|
|||
|
|
${N("Examples")}
|
|||
|
|
|
|||
|
|
From database to database as summary
|
|||
|
|
e.g. compare two live databases
|
|||
|
|
${Q("$")} 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
|
|||
|
|
${Q("$")} 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
|
|||
|
|
${Q("$")} 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
|
|||
|
|
${Q("$")} prisma migrate diff \\
|
|||
|
|
--from-local-d1 \\
|
|||
|
|
--to-schema-datamodel=./prisma/schema.prisma \\
|
|||
|
|
--script
|
|||
|
|
|
|||
|
|
From a Prisma datamodel to a local D1 database
|
|||
|
|
${Q("$")} 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
|
|||
|
|
${Q("$")} 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 \`|\`
|
|||
|
|
${Q("$")} 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
|
|||
|
|
${Q("$")} prisma migrate diff \\
|
|||
|
|
--exit-code \\
|
|||
|
|
--from-[...] \\
|
|||
|
|
--to-[...]
|
|||
|
|
`);var Db=Sb;var kEe=U(Zu());var Am=class Am{static new(){return new Am}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 Pr("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 sl("create",i);if(a&&process.stdout.write(`
|
|||
|
|
`+a+`
|
|||
|
|
`),process.stdout.write(`
|
|||
|
|
`),!n["--force"]){if(!Pa())throw new lb;let u=await(0,kEe.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:
|
|||
|
|
|
|||
|
|
${pp("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 Dm(process.cwd());if(u)process.stdout.write(`
|
|||
|
|
`),await Cm({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 Sm(l)}}return""}help(r){return r?new Re(`
|
|||
|
|
${N(oe("!"))} ${r}
|
|||
|
|
${Am.help}`):Am.help}};Am.help=$e(`
|
|||
|
|
Reset your database and apply all migrations, all data will be lost
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${Q("$")} 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
|
|||
|
|
${Q("$")} prisma migrate reset
|
|||
|
|
|
|||
|
|
Specify a schema
|
|||
|
|
${Q("$")} prisma migrate reset --schema=./schema.prisma
|
|||
|
|
|
|||
|
|
Use --force to skip the confirmation prompt
|
|||
|
|
${Q("$")} prisma migrate reset --force
|
|||
|
|
`);var Cb=Am;var Om=class Om{static new(){return new Om}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 Pr("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 ob(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 ob(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}
|
|||
|
|
${Om.help}`):Om.help}};Om.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")}
|
|||
|
|
|
|||
|
|
${Q("$")} 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
|
|||
|
|
${Q("$")} prisma migrate resolve --applied 20201231000000_add_users_table
|
|||
|
|
|
|||
|
|
Update migrations table, recording a specific migration as rolled back
|
|||
|
|
${Q("$")} prisma migrate resolve --rolled-back 20201231000000_add_users_table
|
|||
|
|
|
|||
|
|
Specify a schema
|
|||
|
|
${Q("$")} prisma migrate resolve --rolled-back 20201231000000_add_users_table --schema=./schema.prisma
|
|||
|
|
`);var Tb=Om;var FEe=me("prisma:migrate:status"),Im=class Im{static new(){return new Im}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 Pr("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 ob(i);let o,c;try{o=await a.diagnoseMigrationHistory({optInToShadowDatabase:!1}),FEe({diagnoseResult:JSON.stringify(o,null,2)}),c=await a.listMigrationDirectories(),FEe({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}
|
|||
|
|
${Im.help}`):Im.help}};Im.help=$e(`
|
|||
|
|
Check the status of your database migrations
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${Q("$")} 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
|
|||
|
|
${Q("$")} prisma migrate status
|
|||
|
|
|
|||
|
|
Specify a schema
|
|||
|
|
${Q("$")} prisma migrate status --schema=./schema.prisma
|
|||
|
|
`);var Pb=Im;var Mwt=me("prisma:cli");async function B6(e){let r,n;try{r=new ka({}),n=await r.getDatabaseVersion(e)}catch(i){Mwt(i)}finally{r&&r.isRunning&&r.stop()}return n}var $Ee=["postgresql","cockroachdb","mysql","sqlite"];async function U6(e,r){let n=await pt(e),i=await Ve({datamodel:n.schemas});if(!$Ee.includes(i.datasources?.[0]?.activeProvider))throw new Error(`Typed SQL is supported only for ${$Ee.join(", ")} providers`);if(!jwt(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=Bo(a).value;if(!o)throw new Error(`Could not get url from datasource ${a.name} in ${n.schemaPath}`);let c=new ka({schemaPath:n.schemaPath}),u=[],l=[];try{for(let f of r){let p=await qwt(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 qwt(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 jwt(e){return e.generators.some(r=>r?.previewFeatures?.includes("typedSql"))}var Ln=U(require("path"));var z6=require("@prisma/engines");var nT=require("@prisma/engines");var H6=U(require("os"));var G6=U(require("fs")),LEe=U(require("module")),NEe=U($6());async function MEe(e=process.cwd()){return await Bwt(e)??await Uwt(e)}async function Bwt(e=process.cwd()){try{let r=Gwt("@prisma/client/package.json",e);if(!r)return null;let n=await G6.default.promises.readFile(r,"utf-8"),i=JSON.parse(n);return i.version?i.version:null}catch{return null}}async function Uwt(e=process.cwd()){try{let r=await(0,NEe.default)({cwd:e});if(!r)return null;let n=await G6.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 Gwt(e,r){try{return require.resolve(e,{paths:LEe.default._nodeModulePaths(r)})}catch{return null}}var W6=Rb(),km=class km{static new(){return new km}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 Wr(),a=(0,nT.getCliQueryEngineBinaryType)(),[o,c]=await TF(),u=o.map(v=>He(v).with({"query-engine":Sr.select()},x=>[`Query Engine${a==="libquery-engine"?" (Node-API)":" (Binary)"}`,x]).with({"schema-engine":Sr.select()},x=>["Schema Engine",x]).exhaustive()),l=await MEe(),f=[[W6.name,W6.version],["@prisma/client",l??"Not found"],["Computed binaryTarget",i],["Operating System",H6.default.platform()],["Architecture",H6.default.arch()],["Node.js",process.version],...u,["Schema Wasm",`@prisma/prisma-schema-wasm ${R_.prismaSchemaWasmVersion}`],["Default Engines Hash",nT.enginesVersion],["Studio",W6.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(", ")]),Hl(f,{json:n["--json"]})}async getFeatureFlags(r){if(!r)return[];try{let n=await Un(),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}
|
|||
|
|
${km.help}`):km.help}};km.help=$e(`
|
|||
|
|
Print current version of Prisma components
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${Q("$")} prisma -v [options]
|
|||
|
|
${Q("$")} prisma version [options]
|
|||
|
|
|
|||
|
|
${N("Options")}
|
|||
|
|
|
|||
|
|
-h, --help Display this help message
|
|||
|
|
--json Output JSON
|
|||
|
|
`);var Fm=km;var $a=class $a{constructor(r,n){this.cmds=r;this.ensureBinaries=n}static new(r,n){return new $a(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,z6.ensureBinariesExist)(),Fm.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"&&(Tr.warn(""),Tr.warn(`${N(`The ${tt("prisma introspect")} command is deprecated. Please use ${te("prisma db pull")} instead.`)}`),Tr.warn(""));let a=this.cmds[i];if(a){this.ensureBinaries.includes(i)&&await(0,z6.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 yf(this.help(),n._[0])}help(r){return r?new Re(`
|
|||
|
|
${N(oe("!"))} ${r}
|
|||
|
|
${$a.help}`):$a.help}};$a.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")}`,$a.boxedTryPdpMessage=j0({height:$a.tryPdpMessage.split(`
|
|||
|
|
`).length,width:0,str:$a.tryPdpMessage,horizontalPadding:2}),$a.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")}
|
|||
|
|
|
|||
|
|
${Q("$")} 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
|
|||
|
|
|
|||
|
|
${$a.boxedTryPdpMessage}
|
|||
|
|
|
|||
|
|
${N("Examples")}
|
|||
|
|
|
|||
|
|
Set up a new Prisma project
|
|||
|
|
${Q("$")} prisma init
|
|||
|
|
|
|||
|
|
Generate artifacts (e.g. Prisma Client)
|
|||
|
|
${Q("$")} prisma generate
|
|||
|
|
|
|||
|
|
Browse your data
|
|||
|
|
${Q("$")} prisma studio
|
|||
|
|
|
|||
|
|
Create migrations from your Prisma schema, apply them to the database, generate artifacts (e.g. Prisma Client)
|
|||
|
|
${Q("$")} prisma migrate dev
|
|||
|
|
|
|||
|
|
Pull the schema from an existing database, updating the Prisma schema
|
|||
|
|
${Q("$")} prisma db pull
|
|||
|
|
|
|||
|
|
Push the Prisma schema state to the database
|
|||
|
|
${Q("$")} prisma db push
|
|||
|
|
|
|||
|
|
Validate your Prisma schema
|
|||
|
|
${Q("$")} prisma validate
|
|||
|
|
|
|||
|
|
Format your Prisma schema
|
|||
|
|
${Q("$")} prisma format
|
|||
|
|
|
|||
|
|
Display Prisma version info
|
|||
|
|
${Q("$")} prisma version
|
|||
|
|
|
|||
|
|
Display Prisma debug info
|
|||
|
|
${Q("$")} prisma debug
|
|||
|
|
`);var iT=$a;var $m=class $m{static new(){return new $m}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?Q(f+":"):N(f+`: \`${l}\``)},a;try{a=ke((await pt(n["--schema"]))?.schemaPath)}catch(c){a=c.message}let o=ke(await Hv());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? --")}
|
|||
|
|
${Xf()}
|
|||
|
|
|
|||
|
|
${tt("-- CI detected? --")}
|
|||
|
|
${Yf()}
|
|||
|
|
`}help(r){return r?new Re(`
|
|||
|
|
${N(oe("!"))} ${r}
|
|||
|
|
${$m.help}`):$m.help}};$m.help=$e(`
|
|||
|
|
Print information helpful for debugging and bug reports
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${Q("$")} prisma debug [options]
|
|||
|
|
|
|||
|
|
${N("Options")}
|
|||
|
|
|
|||
|
|
-h, --help Display this help message
|
|||
|
|
--schema Custom path to your Prisma schema
|
|||
|
|
`);var sT=$m;var qEe=U(require("node:fs/promises")),jEe=U(require("node:path"));var Lm=class Lm{static new(){return new Lm}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 Wk({schemas:o});if(gf({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 qEe.default.writeFile(f,p);let u=Math.round(performance.now()),l=jEe.default.relative(process.cwd(),a);return`Formatted ${tt(l)} in ${Qo(u-n)} \u{1F680}`}help(r){return r?new Re(`
|
|||
|
|
${N(oe("!"))} ${r}
|
|||
|
|
${Lm.help}`):Lm.help}};Lm.help=$e(`
|
|||
|
|
Format a Prisma schema.
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${Q("$")} 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
|
|||
|
|
${Q("$")} prisma format
|
|||
|
|
|
|||
|
|
Or specify a Prisma schema path
|
|||
|
|
${Q("$")} prisma format --schema=./schema.prisma
|
|||
|
|
|
|||
|
|
`);var aT=Lm;var O5=require("@prisma/engines");var I5=U(require("fs"));var mp=U(l6()),wT=U(require("path")),WSe=U(zEe());function Y6(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 X6=U(require("fs/promises"));var Ec=U(require("path")),VEe="sql";async function Q6(e){let r=await Vwt(e),n=await U6(e,r);if(n.ok)return n.queries;throw new Error(Kwt(n.errors))}function KEe(e){return Ec.default.join(Ec.default.dirname(e),VEe)}async function Vwt(e){let r=Ec.default.join(Ec.default.dirname(e),VEe),n=await X6.default.readdir(r),i=[];for(let a of n){let{name:o,ext:c}=Ec.default.parse(a);if(c!==".sql")continue;let u=Ec.default.join(r,a);if(!t6(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 X6.default.readFile(Ec.default.join(r,a),"utf8");i.push({name:o,source:l,fileName:u})}return i}function Kwt(e){let r=[`Errors while reading sql files:
|
|||
|
|
`];for(let{fileName:n,message:i}of e)r.push(`In ${N(Ec.default.relative(process.cwd(),n))}:`),r.push(i),r.push("");return r.join(`
|
|||
|
|
`)}var MSe=U(NSe()),A5=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})}},bT=class{constructor(r){this.changeQueue=new A5;this.watcher=MSe.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 qSe=`${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 jSe=[{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 USe(){return jSe[Math.floor(Math.random()*jSe.length)]}function GSe(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 xT=eval("require('../package.json')"),jm=class jm{constructor(){this.logText="";this.hasGeneratorErrored=!1;this.runGenerate=GSe(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(cy(i,o-a)+`
|
|||
|
|
`),i.stop()}catch(o){this.hasGeneratorErrored=!0,i.stop(),n.push(`${o.message}
|
|||
|
|
|
|||
|
|
`)}}this.logText+=n.join(`
|
|||
|
|
`)})}static new(){return new jm}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 $_t(n["--schema"],a,!!i),u=USe();if(!c)return"";let{schemas:l,schemaPath:f}=c;AC(f);let p=await Ve({datamodel:l,ignoreEnvVarErrors:!0}),g,v,x=null,E;n["--sql"]&&(E=await Q6(f));try{if(v=await nc({schemaPath:f,printDownloadProgress:!o,version:O5.enginesVersion,cliVersion:xT.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+=`${_S}
|
|||
|
|
`;else{let R=v.find(k=>k.options&&gn(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(`${Mi("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=F_t();if(R&&typeof R=="string"){let[k,F]=R.split(".");parseInt(k)==2&&parseInt(F)<12&&(D=!0)}}catch{}if(i&&D&&Tr.should.warn())return"There have been breaking changes in Prisma Client since you updated last time.\nPlease run `prisma generate` manually.";let T=`
|
|||
|
|
${te("Watching...")} ${Q(f)}
|
|||
|
|
`;if(o){(0,mp.default)(T+`
|
|||
|
|
`+this.logText);let R=new bT(f);n["--sql"]&&R.add(KEe(f));for await(let k of R){(0,mp.default)(`Change in ${wT.default.relative(process.cwd(),k)}`);let F;try{if(n["--sql"]&&(E=await Q6(f)),F=await nc({schemaPath:f,printDownloadProgress:!o,version:O5.enginesVersion,cliVersion:xT.version,generatorNames:n["--generator"],typedSql:E}),!F||F.length===0)this.logText+=`${_S}
|
|||
|
|
`;else{(0,mp.default)(`
|
|||
|
|
${te("Building...")}
|
|||
|
|
|
|||
|
|
${this.logText}`);try{await this.runGenerate({generators:F}),(0,mp.default)(T+`
|
|||
|
|
`+this.logText)}catch(L){this.logText+=`${L.message}
|
|||
|
|
|
|||
|
|
`,(0,mp.default)(T+`
|
|||
|
|
`+this.logText)}}}catch(L){this.logText+=`${L.message}
|
|||
|
|
|
|||
|
|
`,(0,mp.default)(T+`
|
|||
|
|
`+this.logText)}}}else{let R=v?.find(({options:L})=>L?.generator.provider&&gn(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?`
|
|||
|
|
|
|||
|
|
${qSe}`:"",j=n["--no-hints"]??!1,q=x&&xT.version!==x&&Tr.should.warn()?`
|
|||
|
|
|
|||
|
|
${ze(N("warn"))} Versions of ${N(`prisma@${xT.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=`${Y6(p)}${V}${q}`:k=`
|
|||
|
|
Start by importing your Prisma Client (See: https://pris.ly/d/importing-client)
|
|||
|
|
|
|||
|
|
${BSe(u)}
|
|||
|
|
${Y6(p)}${V}${q}`}let F=`
|
|||
|
|
`+this.logText+(g&&!this.hasGeneratorErrored?k:"");if(this.hasGeneratorErrored){if(i)return Tr.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}
|
|||
|
|
${jm.help}`):jm.help}};jm.help=$e(`
|
|||
|
|
Generate artifacts (e.g. Prisma Client)
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${Q("$")} 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
|
|||
|
|
${Q("$")} prisma generate
|
|||
|
|
|
|||
|
|
Or specify a schema
|
|||
|
|
${Q("$")} prisma generate --schema=./schema.prisma
|
|||
|
|
|
|||
|
|
Run the command with multiple specific generators
|
|||
|
|
${Q("$")} prisma generate --generator client1 --generator client2
|
|||
|
|
|
|||
|
|
Watch Prisma schema file and rerun after each change
|
|||
|
|
${Q("$")} prisma generate --watch
|
|||
|
|
|
|||
|
|
`);var _T=jm;function F_t(){try{let e=(0,WSe.default)(".prisma/client",{cwd:process.cwd()});if(!e){let r=wT.default.join(process.cwd(),"node_modules/.prisma/client");I5.default.existsSync(r)&&(e=r)}if(e){let r=wT.default.join(e,"index.js");if(I5.default.existsSync(r)){let n=require(r);return n?.prismaVersion?.client??n?.Prisma?.prismaVersion?.client}}}catch{return null}return null}async function $_t(e,r,n){if(n){let i=await sy(e,{cwd:r});return i||(Tr.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 VSe=U(NF()),Ii=U(require("fs"));var ll=U(require("path"));var KSe=require("util");function ET(e){return N(iR(" ERROR "))+" "+oe(e)}var L_t=e=>{let{datasourceProvider:r="postgresql",generatorProvider:n=j_t,previewFeatures:i=B_t,output:a=zSe,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!=zSe?` 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},HSe=(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},N_t=e=>{switch(e){case"mysql":return 3306;case"sqlserver":return 1433;case"mongodb":return 27017;case"postgresql":return 5432;case"cockroachdb":return 26257}},M_t=(e,r=N_t(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}},q_t=()=>`node_modules
|
|||
|
|
# Keep environment variables out of version control
|
|||
|
|
.env
|
|||
|
|
`,j_t="prisma-client-js",B_t=[],zSe="node_modules/.prisma/client",Bm=class Bm{static new(){return new Bm}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,KSe.isError)(n)||n["--help"])return this.help();if(await Pr("init",n,!1),n._[0])throw Error("The init command does not take any argument.");let a=process.cwd(),o=ll.default.join(a,"prisma");Ii.default.existsSync(ll.default.join(a,"schema.prisma"))&&(console.log(ET(`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(ET(`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(ll.default.join(o,"schema.prisma"))&&(console.log(ET(`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":Sr.when(D=>!!D)},D=>{let T=D["--datasource-provider"].toLowerCase();if(!["postgresql","mysql","sqlserver","sqlite","mongodb","cockroachdb"].includes(T))throw new Error(`Provider "${n["--datasource-provider"]}" is invalid or not supported. Try again with "postgresql", "mysql", "sqlite", "sqlserver", "mongodb" or "cockroachdb".`);let R=T,k=M_t(R);return Promise.resolve({datasourceProvider:R,url:k})}).with({"--url":Sr.when(D=>!!D)},async D=>{let T=D["--url"],R=await Pf(T);if(R!==!0){let{code:F,message:L}=R;if(F!=="P1003")throw F?new Error(`${F}: ${L}`):new Error(L)}return{datasourceProvider:to(`${T.split(":")[0]}:`),url:T}}).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(ll.default.join(o,"schema.prisma"),L_t({datasourceProvider:c,generatorProvider:l,previewFeatures:f,output:p,withModel:n["--with-model"]}));let g=[],v=ll.default.join(a,".env");if(!Ii.default.existsSync(v))Ii.default.writeFileSync(v,HSe(u));else{let D=Ii.default.readFileSync(v,{encoding:"utf8"}),T=VSe.default.parse(D);Object.keys(T).includes("DATABASE_URL")?g.push(`${ze("warn")} Prisma would have added DATABASE_URL but it already exists in ${N(ll.default.relative(a,v))}`):Ii.default.appendFileSync(v,`
|
|||
|
|
|
|||
|
|
# This was inserted by \`prisma init\`:
|
|||
|
|
`+HSe(u))}let x=ll.default.join(a,".gitignore");try{Ii.default.writeFileSync(x,q_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&&Tr.should.warn()?`
|
|||
|
|
${g.join(`
|
|||
|
|
`)}
|
|||
|
|
`:""}
|
|||
|
|
Next steps:
|
|||
|
|
${E.map((D,T)=>`${T+1}. ${D}`).join(`
|
|||
|
|
`)}
|
|||
|
|
|
|||
|
|
More information in our documentation:
|
|||
|
|
${ke("https://pris.ly/d/getting-started")}
|
|||
|
|
`}help(r){return r?new Re(`
|
|||
|
|
${N(oe("!"))} ${r}
|
|||
|
|
${Bm.help}`):Bm.help}};Bm.help=$e(`
|
|||
|
|
Set up a new Prisma project
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${Q("$")} 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)
|
|||
|
|
${Q("$")} prisma init
|
|||
|
|
|
|||
|
|
Set up a new Prisma project and specify MySQL as the datasource provider to use
|
|||
|
|
${Q("$")} prisma init --datasource-provider mysql
|
|||
|
|
|
|||
|
|
Set up a new Prisma project and specify \`prisma-client-go\` as the generator provider to use
|
|||
|
|
${Q("$")} prisma init --generator-provider prisma-client-go
|
|||
|
|
|
|||
|
|
Set up a new Prisma project and specify \`x\` and \`y\` as the preview features to use
|
|||
|
|
${Q("$")} prisma init --preview-feature x --preview-feature y
|
|||
|
|
|
|||
|
|
Set up a new Prisma project and specify \`./generated-client\` as the output path to use
|
|||
|
|
${Q("$")} prisma init --output ./generated-client
|
|||
|
|
|
|||
|
|
Set up a new Prisma project and specify the url that will be used
|
|||
|
|
${Q("$")} prisma init --url mysql://user:password@localhost:3306/mydb
|
|||
|
|
|
|||
|
|
Set up a new Prisma project with an example model
|
|||
|
|
${Q("$")} prisma init --with-model
|
|||
|
|
`);var ST=Bm;var bt={};Qn(bt,{$:()=>k5,Accelerate:()=>B5,Auth:()=>G5,Environment:()=>V5,Login:()=>AT,Logout:()=>OT,Project:()=>Q5,Pulse:()=>eq,ServiceToken:()=>iq,Workspace:()=>aq});var DT=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 CT=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 YSe=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")}
|
|||
|
|
|
|||
|
|
${Q("$")} ${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,T])=>` ${E.padStart(15)} ${D&&D+","} ${T}`).join(`
|
|||
|
|
`)}
|
|||
|
|
`),g=o&&$e(`
|
|||
|
|
${N("Examples")}
|
|||
|
|
|
|||
|
|
${o.map(E=>` ${Q("$")} ${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 k5=class e{constructor(r){this.commands=r;this.help=YSe({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 DT;let i=r=r.filter(o=>o!=="--early-access");return r.length===0||["-h","--help"].includes(i[0])?this.help():await CT(this.commands,i)}};var B5={};Qn(B5,{$:()=>U_t,Disable:()=>q5,Enable:()=>j5});var ki=()=>class XSe{constructor(r){this.commands=r}static new(r){return new XSe(r)}async parse(r){return await CT(this.commands,r)}};var U_t=ki();var G_t=(e,r,n)=>{let i=Kn(e,r,n);return i===void 0?new Error(`Missing ${r.join(" or ")} parameter`):i};function Vn(e,r){let n=_e(e,r);if(xe(n))throw n;return n}var Ft=(e,r,n)=>{let i=G_t(e,r,n);if(i instanceof Error)throw new Error(`Missing ${r.join(" or ")} parameter`);return i},Kn=(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 wo=e=>e instanceof Error?e:new Error(`Unknown error: ${e}`),QSe=e=>e,JSe=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),F5=(e,r)=>{try{return e()}catch(n){return r?r(wo(n)):wo(n)}};var W_t=(e,r)=>{let n={key:r.key??Q,values:r6(r.values??{},i=>i===!0?QSe:i)};return Hl(Object.entries(n.values).map(([i,a])=>{let o=a(e[i]);return o===null?null:[n.key(String(i)),o]}).filter(Boolean))},gp=e=>`${te("Success!")} ${e}`,Xe={resourceCreated:e=>gp(`${e.__typename} ${e.displayName} - ${e.id} created.`),resourceDeleted:e=>gp(`${e.__typename} ${e.displayName} - ${e.id} deleted.`),resource:(e,r)=>Xe.table(e,{values:{displayName:n=>nR(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:W_t,success:gp};var ZSe=U(Xh()),eDe=U(Rb());var H_t=me("prisma:cli:platform:_lib:userAgent"),TT=async()=>{let e=await ZSe.getSignature().catch(wo);xe(e)&&H_t(`await checkpoint.getSignature() failed silently with ${e.message}`);let r=xe(e)?"unknown":e;return`prisma-cli/${eDe.version} (Signature: ${r})`};var z_t=new URL("https://console.prisma.io/api"),tDe=new URL("https://console.prisma.io"),ft=async e=>{let r=await TT(),n="POST",i=new oi({"Content-Type":"application/json",Authorization:`Bearer ${e.token}`,"User-Agent":r}),a=JSON.stringify(e.body),o=await Ja(z_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 V_t({message:"<message not selected from server>",...l});return u.data},V_t=e=>new Error(e.message);var zm=U(pu()),yDe=U(require("path"));var Wm={};Qn(Wm,{default:()=>M5});var mDe=U(N5(),1);Wx(Wm,U(N5(),1));var M5=mDe.default;var gDe=U(pu()),EEt=(e,{beforeParse:r,reviver:n}={})=>{let i=new TextDecoder().decode(e);return typeof r=="function"&&(i=r(i)),JSON.parse(i,n)},vDe=async(e,r)=>{let n=await gDe.default.readFile(e);return EEt(n,r)};var bDe=new M5("prisma-platform-cli").config(),Hm=yDe.default.join(bDe,"auth.json"),SEt=e=>{if(typeof e!="object"||e===null)throw new Error("Invalid credentials");if(typeof e.token!="string")throw new Error("Invalid credentials");return e},fl={path:Hm,save:async e=>zm.default.mkdirp(bDe).then(()=>zm.default.writeJSON(Hm,e)).catch(wo),load:async()=>zm.default.pathExists(Hm).then(e=>e?vDe(Hm).then(SEt):null).catch(wo),delete:async()=>zm.default.pathExists(Hm).then(e=>e?zm.default.remove(Hm):void 0).then(()=>null).catch(wo)};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}},DEt=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=Kn(e,["--token","-t"],"PRISMA_TOKEN");if(r)return r;let n=await fl.load();if(xe(n))throw n;if(!n)throw DEt;return n.token},CEt="prisma://accelerate.prisma-data.net",RT=e=>{let r=new URL(CEt);return r.searchParams.set("api_key",e),N(r.href)};var q5=class e{static new(){return new e}async parse(r){let n=Vn(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 j5=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=Kn(n,["--apikey"])??!1,u=Kn(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:
|
|||
|
|
|
|||
|
|
${RT(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 G5={};Qn(G5,{$:()=>TEt,Login:()=>AT,Logout:()=>OT,Show:()=>U5});var TEt=ki();var _De=U(wDe()),EDe=U(require("http"));var SDe=U(RC());var kEt=me("prisma:cli:platform:login"),AT=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 fl.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=EDe.default.createServer(),c=await(0,_De.default)(a,0,"127.0.0.1"),u=await FEt({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"),T=DDe();if(D)T.pathname+="/error",T.searchParams.set("error",D),p(new Error(D));else{let R=LEt(x.get("user")??"");if(R){x.delete("token"),x.delete("user"),T.pathname+="/success";let k=new URLSearchParams({...Object.fromEntries(x.entries()),email:R.email});T.search=k.toString(),f({token:E,user:R})}else T.pathname+="/error",T.searchParams.set("error","Invalid user"),p(new Error("Invalid user"))}v.statusCode=302,v.setHeader("location",T.href),v.end()}),a.once("error",p)}),(0,SDe.default)(u.href)]).then(f=>f[0]).catch(wo);if(xe(l))throw new Error(`Authentication failed: ${l.message}`);{let f=await fl.save({token:l.token});if(xe(f))throw new Error("Writing credentials to disk failed",{cause:f})}return gp(`Authentication successful for ${l.user.email}`)}},DDe=()=>new URL("/auth/cli",tDe),FEt=async e=>{let n={client:await TT(),...e},i=$Et(n),a=DDe();return a.searchParams.set("state",i),a},$Et=e=>Buffer.from(JSON.stringify(e),"utf-8").toString("base64"),LEt=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 kEt(`parseUser() failed silently with ${r}`),null}};var CDe=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=F5(()=>atob(r),()=>new Error("Failed to base64 decode the payload."));if(xe(i))return i;let a=F5(()=>JSON.parse(i),()=>new Error("Failed to parse the decoded payload as JSON."));if(xe(a))return a;if(!JSe(a))throw new Error("Invalid JWT Claims Set.");return a};var OT=class e{static new(){return new e}async parse(){let r=await fl.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=CDe(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 fl.delete(),gp("You have logged out.")}};var U5=class e{static new(){return new e}async parse(r){let n=Vn(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:Kn(n,["--sensitive"])?i:null};return Xe.sections([Xe.info(`Currently authenticated as ${te(a.user.email)}`),Xe.resource(o,{email:!0,token:!0})])}};var V5={};Qn(V5,{$:()=>NEt,Create:()=>W5,Delete:()=>H5,Show:()=>z5});var NEt=ki();var W5=class e{static new(){return new e}async parse(r){let n=Vn(r,{...Dt.project,"--name":String,"-n":"--name"}),i=await Ct(n),a=Ft(n,["--project","-p"]),o=Kn(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 H5=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 z5=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 Q5={};Qn(Q5,{$:()=>MEt,Create:()=>K5,Delete:()=>Y5,Show:()=>X5});var MEt=ki();var K5=class e{static new(){return new e}async parse(r){let n=Vn(r,{...Dt.workspace,"--name":String,"-n":"--name"}),i=await Ct(n),a=Ft(n,["--workspace","-w"]),o=Kn(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 Y5=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 X5=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 eq={};Qn(eq,{$:()=>qEt,Disable:()=>J5,Enable:()=>Z5});var qEt=ki();var J5=class e{static new(){return new e}async parse(r){let n=Vn(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 Z5=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=Kn(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:
|
|||
|
|
|
|||
|
|
${RT(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 iq={};Qn(iq,{$:()=>jEt,Create:()=>tq,Delete:()=>rq,Show:()=>nq});var jEt=ki();var tq=class e{constructor(r=!1){this.legacy=r}static new(r=!1){return new e(r)}async parse(r){let n=Vn(r,{...Dt.environment,"--name":String,"-n":"--name"}),i=await Ct(n),a=Ft(n,["--environment","-e"]),o=Kn(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 rq=class e{constructor(r=!1){this.legacy=r}static new(r=!1){return new e(r)}async parse(r){let n=Vn(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 nq=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 aq={};Qn(aq,{$:()=>BEt,Show:()=>sq});var BEt=ki();var sq=class e{static new(){return new e}async parse(r){let n=Vn(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 Y2e=require("@prisma/engines");var TDe=require("buffer");function PDe(e,r,n,i){Object.defineProperty(e,r,{get:n,set:i,enumerable:!0,configurable:!0})}var RDe={};PDe(RDe,"serializeRPCMessage",()=>uq);PDe(RDe,"deserializeRPCMessage",()=>lq);var oq="PrismaBigInt::",cq="PrismaBytes::";function uq(e){return JSON.stringify(e,(r,n)=>typeof n=="bigint"?oq+n:n?.type==="Buffer"&&Array.isArray(n?.data)?cq+TDe.Buffer.from(n.data).toString("base64"):n)}function lq(e){return JSON.parse(e,(r,n)=>typeof n=="string"&&n.startsWith(oq)?BigInt(n.substr(oq.length)):typeof n=="string"&&n.startsWith(cq)?n.substr(cq.length):n)}var B2e=U(LDe()),_P=U(C2e()),U2e=U(require("http")),G2e=U(R2e()),W2e=require("zlib");var Ro=require("path");var zj=require("crypto"),N2e=U(Bj());function Wj(e,r,n,i){Object.defineProperty(e,r,{get:n,set:i,enumerable:!0,configurable:!0})}var M2e=globalThis,Uj={},wP={},Cp=M2e.parcelRequire1308;Cp==null&&(Cp=function(e){if(e in Uj)return Uj[e].exports;if(e in wP){var r=wP[e];delete wP[e];var n={id:e,exports:{}};return Uj[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},Cp.register=function(r,n){wP[r]=n},M2e.parcelRequire1308=Cp);var q2e=Cp.register;q2e("9lTzd",function(module,exports){Wj(module.exports,"guessEnginePaths",()=>guessEnginePaths),Wj(module.exports,"guessPrismaClientPath",()=>guessPrismaClientPath);var $5COlq=Cp("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,Ro.resolve)(resolveOverrides[".prisma/client"],`../${queryEngineName}`);else if(resolveOverrides["@prisma/engines"])queryEnginePath=(0,Ro.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,Ro.resolve)(atPrismaEnginesPath`../../${queryEngineName}`)}return{queryEngine:{type:queryEngineType,path:queryEnginePath}}}function guessPrismaClientPath({resolveOverrides}){let prismaClientPath=resolveOverrides["@prisma/client"]||eval("require.resolve('@prisma/client')");return(0,Ro.resolve)(prismaClientPath,"../")}});q2e("5COlq",function(e,r){Wj(e.exports,"prismaEngineName",()=>n);async function n(i,a){let o=await Wr(),c=o==="windows"?".exe":"";if(a==="library")return ja(o,"fs");if(a==="binary")return`${i}-${o}${c}`;throw new Error(`Unknown engine type: ${a}`)}});function SAt(e){return{models:Gj(e.models),enums:Gj(e.enums),types:Gj(e.types)}}function Gj(e){let r={};for(let{name:n,...i}of e)r[n]=i;return r}var lx=(0,N2e.debug)("prisma:studio-pcw"),DAt=/^\s*datasource\s+([^\s]+)\s*{/m,CAt=/url *= *env\("(.*)"\)/,TAt=/url *= *"(.*)"/;async function PAt({schema:e,schemaPath:r,dmmf:n,datasourceProvider:i,previewFeatures:a,datasources:o,engineType:c,paths:u,directUrl:l,versions:f}){let p=e.match(DAt)?.[1]??"",g=e.match(CAt)?.[1]??null,v=e.match(TAt)?.[1]??null,{getPrismaClient:x,PrismaClientKnownRequestError:E,PrismaClientRustPanicError:D,PrismaClientInitializationError:T,PrismaClientValidationError:R}=require(`${u.prismaClient}/runtime/${c}`),k=e,F=(0,zj.createHash)("sha256").update(Buffer.from(k,"utf8").toString("base64")).digest("hex"),L=x({runtimeDataModel:SAt(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,Ro.dirname)(r),filename:(0,Ro.basename)(r),
|
|||
|
|
|
|||
|
|
`,n),process.exit(1)}},this.stop=n=>{yl("Stopping Studio server. Reason:",n),this.server&&this.server.close(i=>{i?yl("Unable to close server: ",i):yl("Closed out remaining connections")})},this.options=r,this.options.schemaPath=(0,G2e.default)(this.options.schemaPath),this.channels={project:new Kj(r),prisma:new Vj(r),telemetry:new Yj(r)}}};var Qj=U(K2e());var X2e=U(RC()),Jj=U(require("path")),TP=me("prisma:cli:studio"),qAt=Rb(),gg=class gg{static new(){return new gg}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,Qj.default)({port:Qj.default.makeRange(5555,5600)}),u=n["--browser"]||process.env.BROWSER,l=Jj.default.resolve(__dirname,"../build/public"),f=ny({schemas:a}),p=await Ve({datamodel:a,ignoreEnvVarErrors:!0});process.env.PRISMA_DISABLE_WARNINGS="true";let g=new EP({schemaPath:i,schemaText:f,hostname:o,port:c,staticAssetDir:l,prismaClient:{resolve:{"@prisma/client":Jj.default.resolve(__dirname,"../prisma-client/index.js")},directUrl:_v(AI(p.datasources[0]))},versions:{prisma:qAt.version,queryEngine:Y2e.enginesVersion}});await g.start();let v=`http://localhost:${c}`;if(!u||u.toLowerCase()!=="none")try{let x=await(0,X2e.default)(v,{app:u,url:!0});x.on("spawn",()=>{TP(`requested to open the url ${v}`)}),x.on("error",E=>{TP(E),TP(`failed to open the url ${v} in browser`)})}catch(x){TP(x)}return this.instance=g,`Prisma Studio is up on ${v}`}help(r){return r?new Re(`
|
|||
|
|
${N(oe("!"))} ${r}
|
|||
|
|
${gg.help}`):gg.help}};gg.help=$e(`
|
|||
|
|
Browse your data with Prisma Studio
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${Q("$")} 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
|
|||
|
|
${Q("$")} prisma studio
|
|||
|
|
|
|||
|
|
Start Studio on a custom port
|
|||
|
|
${Q("$")} prisma studio --port 5555
|
|||
|
|
|
|||
|
|
Start Studio in a specific browser
|
|||
|
|
${Q("$")} prisma studio --port 5555 --browser firefox
|
|||
|
|
${Q("$")} BROWSER=firefox prisma studio --port 5555
|
|||
|
|
|
|||
|
|
Start Studio without opening in a browser
|
|||
|
|
${Q("$")} prisma studio --port 5555 --browser none
|
|||
|
|
${Q("$")} BROWSER=none prisma studio --port 5555
|
|||
|
|
|
|||
|
|
Specify a schema
|
|||
|
|
${Q("$")} prisma studio --schema=./schema.prisma
|
|||
|
|
`);var PP=gg;var Q2e=U(Xh()),RP=class e{static new(){return new e}async parse(){let r=await Q2e.getInfo(),n=await ly(),i=fy(),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 J2e=U(Xh()),Tp=me("prisma:cli:checkpoint");async function Z2e({schemaPath:e,isPrismaInstalledGlobally:r,version:n,command:i,telemetryInformation:a}){if(process.env.CHECKPOINT_DISABLE)return Tp("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([ly(),jAt(e)]),p=fy(),v=performance.now()-o;Tp(`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 J2e.check(x),R=performance.now()-E;return Tp(`runCheckpointClientCheck(): Execution time for "await checkpoint.check(data)": ${R} ms`),D}catch(o){return Tp("Error from runCheckpointClientCheck()"),Tp(o),0}}async function jAt(e){let r,n,i;try{let a=await Un(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=>gn(u.provider));let c=o.generators.find(u=>gn(u.provider)==="prisma-client-js");c&&c.previewFeatures.length>0&&(n=c.previewFeatures)}catch(o){Tp("Error from tryToReadDataFromSchema() while processing the schema. This is not a fatal error. It will continue without the processed data."),Tp(o)}}catch{}return{schemaProvider:r,schemaPreviewFeatures:n,schemaGeneratorsProviders:i}}var BAt=["--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"],eAe=e=>{let r="[redacted]";for(let n=0;n<e.length;n++){let i=e[n];BAt.forEach(a=>{let o=i===a,c=i.indexOf(a);o?e[n+1]=r:c!==-1&&(e[n]=`${a}=${r}`)})}return e};var tAe=U(require("fs")),rAe=U(require("path"));function nAe(){if(tAe.default.existsSync(rAe.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 UAt=op();function sAe(e){let r=4,n="",i=e.data.previous_version,a=e.data.current_version,o=iAe(e.data.package,e.data.release_tag),c=iAe("@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=`
|
|||
|
|
${Mi("Update available")} ${i} -> ${a}
|
|||
|
|
${n}Run the following to update
|
|||
|
|
${N(o)}
|
|||
|
|
${N(c)}`,l=j0({height:r,width:59,str:u,horizontalPadding:2});console.error(l)}function iAe(e,r,n={canBeGlobal:!0,canBeDev:!0}){let i="";return UAt==="npm"&&n.canBeGlobal?i=`npm i -g ${e}`:n.canBeDev?i=`npm i --save-dev ${e}`:i=`npm i ${e}`,i+=`@${r}`,i}var aAe=U(require("node:path"));var vg=class vg{static new(){return new vg}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}=Gk(()=>({lintDiagnostics:jv({schemas:a})}),{schemas:a}),c=Bv(o);c&&Tr.should.warn()&&console.warn(c),gf({schemas:a}),await Ve({datamodel:a,ignoreEnvVarErrors:!1});let u=aAe.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}
|
|||
|
|
${vg.help}`):vg.help}};vg.help=$e(`
|
|||
|
|
Validate a Prisma schema.
|
|||
|
|
|
|||
|
|
${N("Usage")}
|
|||
|
|
|
|||
|
|
${Q("$")} 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
|
|||
|
|
${Q("$")} prisma validate
|
|||
|
|
|
|||
|
|
Or specify a Prisma schema path
|
|||
|
|
${Q("$")} prisma validate --schema=./schema.prisma
|
|||
|
|
|
|||
|
|
`);var AP=vg;var GAt=me("prisma:cli:bin"),lAe=Rb(),Zj=process.argv.slice(2);process.removeAllListeners("warning");process.once("SIGINT",()=>{process.exit(130)});var oAe=_e(Zj,{"--schema":String,"--telemetry-information":String},!1,!0),fAe=eAe([...Zj]).join(" "),WAt=op();async function HAt(){nAe();let e=iT.new({init:ST.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:wb.new({dev:Eb.new(),status:Pb.new(),resolve:Tb.new(),reset:Cb.new(),deploy:_b.new(),diff:Db.new()}),db:ab.new({execute:mb.new(),pull:_m.new(),push:bb.new(),seed:xb.new()}),introspect:_m.new(),studio:PP.new(),generate:_T.new(),version:Fm.new(),validate:AP.new(),format:aT.new(),telemetry:RP.new(),debug:sT.new()},["version","init","migrate","db","introspect","studio","generate","validate","format","telemetry"]),r=performance.now(),n=await e.parse(Zj),a=performance.now()-r;if(GAt(`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 Z2e({command:fAe,isPrismaInstalledGlobally:WAt,schemaPath:oAe["--schema"],telemetryInformation:oAe["--telemetry-information"],version:lAe.version}),c=process.env.PRISMA_HIDE_UPDATE_MESSAGE;return o&&o.status==="ok"&&o.data.outdated&&!c&&sAe(o),0}eval("require.main === module")&&HAt().then(e=>{e!==0&&process.exit(e)}).catch(e=>{if(typeof e[Symbol.iterator]=="function")for(let r of e)cAe(r);else cAe(e)});function cAe(e){xI(e)?e6({error:e,cliVersion:lAe.version,enginesVersion:uAe.enginesVersion,command:fAe,getDatabaseVersionSafe:B6}).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))}Ln.default.join(__dirname,"../../engines/query-engine-darwin");Ln.default.join(__dirname,"../../engines/schema-engine-darwin");Ln.default.join(__dirname,"../../engines/query-engine-windows.exe");Ln.default.join(__dirname,"../../engines/schema-engine-windows.exe");Ln.default.join(__dirname,"../../engines/query-engine-debian-openssl-1.0.x");Ln.default.join(__dirname,"../../engines/schema-engine-debian-openssl-1.0.x");Ln.default.join(__dirname,"../../engines/query-engine-debian-openssl-1.1.x");Ln.default.join(__dirname,"../../engines/schema-engine-debian-openssl-1.1.x");Ln.default.join(__dirname,"../../engines/query-engine-debian-openssl-3.0.x");Ln.default.join(__dirname,"../../engines/schema-engine-debian-openssl-3.0.x");Ln.default.join(__dirname,"../../engines/query-engine-rhel-openssl-1.0.x");Ln.default.join(__dirname,"../../engines/schema-engine-rhel-openssl-1.0.x");Ln.default.join(__dirname,"../../engines/query-engine-rhel-openssl-1.1.x");Ln.default.join(__dirname,"../../engines/schema-engine-rhel-openssl-1.1.x");Ln.default.join(__dirname,"../../engines/query-engine-rhel-openssl-3.0.x");Ln.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
|
|||
|
|
*)
|
|||
|
|
*/
|